@siteboon/claude-code-ui 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -16
- package/dist/assets/index-Cc6pl7ji.css +32 -0
- package/dist/assets/index-Zq2roSUR.js +1206 -0
- package/dist/assets/{vendor-xterm-jI4BCHEb.js → vendor-xterm-DfaPXD3y.js} +12 -12
- package/dist/icons/codex-white.svg +3 -0
- package/dist/icons/codex.svg +3 -0
- package/dist/icons/cursor-white.svg +12 -0
- package/dist/index.html +4 -4
- package/dist/logo-128.png +0 -0
- package/dist/logo-256.png +0 -0
- package/dist/logo-32.png +0 -0
- package/dist/logo-512.png +0 -0
- package/dist/logo-64.png +0 -0
- package/dist/logo.svg +17 -9
- package/package.json +4 -1
- package/server/claude-sdk.js +20 -19
- package/server/database/auth.db +0 -0
- package/server/database/db.js +64 -0
- package/server/database/init.sql +4 -1
- package/server/index.js +236 -18
- package/server/openai-codex.js +387 -0
- package/server/projects.js +448 -7
- package/server/routes/agent.js +42 -4
- package/server/routes/cli-auth.js +263 -0
- package/server/routes/codex.js +310 -0
- package/server/routes/git.js +123 -28
- package/server/routes/taskmaster.js +2 -10
- package/server/routes/user.js +106 -0
- package/server/utils/gitConfig.js +24 -0
- package/dist/assets/index-DXtzL-q9.css +0 -32
- package/dist/assets/index-Do2w3FiK.js +0 -1189
|
@@ -1,1189 +0,0 @@
|
|
|
1
|
-
import{j as n,S as as,F as pi,T as ku,P as wu,E as Tr,V as fi,a as Nl,g as vf,R as kf,D as xn,b as Ks,G as Sl,W as Cl,l as ju,h as Do,c as Nu,C as wf,d as jf,e as ga,f as Nf,i as Sf,u as Cf,k as L0,s as Mf,m as Af,n as Tf,o as Ef,p as Su,q as Cu,r as Mu,t as If,v as Df,w as zf,x as Lf,y as Pf}from"./vendor-codemirror-CnTQH7Pk.js";import{b as Rf,g as ss,a as b,R as Jr,c as Ff,B as Bf,d as Of,e as P0,u as $f,f as _f}from"./vendor-react-DVSKlM5e.js";import{r as qf,a as Hf,b as Uf,c as Wf}from"./vendor-xterm-jI4BCHEb.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&a(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();var ws={},R0;function Vf(){if(R0)return ws;R0=1;var e=Rf();return ws.createRoot=e.createRoot,ws.hydrateRoot=e.hydrateRoot,ws}var Gf=Vf();const Kf=ss(Gf);/**
|
|
2
|
-
* @license lucide-react v0.515.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 Jf=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase()),F0=e=>{const t=Yf(e);return t.charAt(0).toUpperCase()+t.slice(1)},Au=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim(),Xf=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
7
|
-
* @license lucide-react v0.515.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
|
-
*/var Qf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
12
|
-
* @license lucide-react v0.515.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Zf=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:s="",children:i,iconNode:o,...l},c)=>b.createElement("svg",{ref:c,...Qf,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:Au("lucide",s),...!i&&!Xf(l)&&{"aria-hidden":"true"},...l},[...o.map(([d,u])=>b.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
|
|
17
|
-
* @license lucide-react v0.515.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Te=(e,t)=>{const r=b.forwardRef(({className:a,...s},i)=>b.createElement(Zf,{ref:i,iconNode:t,className:Au(`lucide-${Jf(F0(e))}`,`lucide-${e}`,a),...s}));return r.displayName=F0(e),r};/**
|
|
22
|
-
* @license lucide-react v0.515.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const eg=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Tu=Te("arrow-down",eg);/**
|
|
27
|
-
* @license lucide-react v0.515.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const tg=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ml=Te("arrow-right",tg);/**
|
|
32
|
-
* @license lucide-react v0.515.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const rg=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],ng=Te("arrow-up-down",rg);/**
|
|
37
|
-
* @license lucide-react v0.515.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const ag=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],sg=Te("arrow-up",ag);/**
|
|
42
|
-
* @license lucide-react v0.515.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const ig=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],Eu=Te("brain",ig);/**
|
|
47
|
-
* @license lucide-react v0.515.0 - ISC
|
|
48
|
-
*
|
|
49
|
-
* This source code is licensed under the ISC license.
|
|
50
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
-
*/const og=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ln=Te("check",og);/**
|
|
52
|
-
* @license lucide-react v0.515.0 - ISC
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the ISC license.
|
|
55
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/const lg=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ar=Te("chevron-down",lg);/**
|
|
57
|
-
* @license lucide-react v0.515.0 - ISC
|
|
58
|
-
*
|
|
59
|
-
* This source code is licensed under the ISC license.
|
|
60
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
-
*/const cg=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Iu=Te("chevron-left",cg);/**
|
|
62
|
-
* @license lucide-react v0.515.0 - ISC
|
|
63
|
-
*
|
|
64
|
-
* This source code is licensed under the ISC license.
|
|
65
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const dg=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],cn=Te("chevron-right",dg);/**
|
|
67
|
-
* @license lucide-react v0.515.0 - ISC
|
|
68
|
-
*
|
|
69
|
-
* This source code is licensed under the ISC license.
|
|
70
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const ug=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],mg=Te("chevron-up",ug);/**
|
|
72
|
-
* @license lucide-react v0.515.0 - ISC
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the ISC license.
|
|
75
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const hg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],gi=Te("circle-alert",hg);/**
|
|
77
|
-
* @license lucide-react v0.515.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const pg=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],is=Te("circle-check-big",pg);/**
|
|
82
|
-
* @license lucide-react v0.515.0 - ISC
|
|
83
|
-
*
|
|
84
|
-
* This source code is licensed under the ISC license.
|
|
85
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/const fg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],gg=Te("circle-check",fg);/**
|
|
87
|
-
* @license lucide-react v0.515.0 - ISC
|
|
88
|
-
*
|
|
89
|
-
* This source code is licensed under the ISC license.
|
|
90
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const xg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],bg=Te("circle-help",xg);/**
|
|
92
|
-
* @license lucide-react v0.515.0 - ISC
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the ISC license.
|
|
95
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const yg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ma=Te("circle",yg);/**
|
|
97
|
-
* @license lucide-react v0.515.0 - ISC
|
|
98
|
-
*
|
|
99
|
-
* This source code is licensed under the ISC license.
|
|
100
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const vg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Ya=Te("clock",vg);/**
|
|
102
|
-
* @license lucide-react v0.515.0 - ISC
|
|
103
|
-
*
|
|
104
|
-
* This source code is licensed under the ISC license.
|
|
105
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const kg=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],wg=Te("columns-2",kg);/**
|
|
107
|
-
* @license lucide-react v0.515.0 - ISC
|
|
108
|
-
*
|
|
109
|
-
* This source code is licensed under the ISC license.
|
|
110
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const jg=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Du=Te("copy",jg);/**
|
|
112
|
-
* @license lucide-react v0.515.0 - ISC
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the ISC license.
|
|
115
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const Ng=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Js=Te("download",Ng);/**
|
|
117
|
-
* @license lucide-react v0.515.0 - ISC
|
|
118
|
-
*
|
|
119
|
-
* This source code is licensed under the ISC license.
|
|
120
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const Sg=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],B0=Te("external-link",Sg);/**
|
|
122
|
-
* @license lucide-react v0.515.0 - ISC
|
|
123
|
-
*
|
|
124
|
-
* This source code is licensed under the ISC license.
|
|
125
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const Cg=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],os=Te("eye",Cg);/**
|
|
127
|
-
* @license lucide-react v0.515.0 - ISC
|
|
128
|
-
*
|
|
129
|
-
* This source code is licensed under the ISC license.
|
|
130
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const Mg=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Ag=Te("eye-off",Mg);/**
|
|
132
|
-
* @license lucide-react v0.515.0 - ISC
|
|
133
|
-
*
|
|
134
|
-
* This source code is licensed under the ISC license.
|
|
135
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const Tg=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],Eg=Te("file-code",Tg);/**
|
|
137
|
-
* @license lucide-react v0.515.0 - ISC
|
|
138
|
-
*
|
|
139
|
-
* This source code is licensed under the ISC license.
|
|
140
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const Ig=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],mr=Te("file-text",Ig);/**
|
|
142
|
-
* @license lucide-react v0.515.0 - ISC
|
|
143
|
-
*
|
|
144
|
-
* This source code is licensed under the ISC license.
|
|
145
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const Dg=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],O0=Te("file",Dg);/**
|
|
147
|
-
* @license lucide-react v0.515.0 - ISC
|
|
148
|
-
*
|
|
149
|
-
* This source code is licensed under the ISC license.
|
|
150
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const zg=[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]],zu=Te("flag",zg);/**
|
|
152
|
-
* @license lucide-react v0.515.0 - ISC
|
|
153
|
-
*
|
|
154
|
-
* This source code is licensed under the ISC license.
|
|
155
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const Lg=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Jn=Te("folder-open",Lg);/**
|
|
157
|
-
* @license lucide-react v0.515.0 - ISC
|
|
158
|
-
*
|
|
159
|
-
* This source code is licensed under the ISC license.
|
|
160
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const Pg=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Ys=Te("folder-plus",Pg);/**
|
|
162
|
-
* @license lucide-react v0.515.0 - ISC
|
|
163
|
-
*
|
|
164
|
-
* This source code is licensed under the ISC license.
|
|
165
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const Rg=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],En=Te("folder",Rg);/**
|
|
167
|
-
* @license lucide-react v0.515.0 - ISC
|
|
168
|
-
*
|
|
169
|
-
* This source code is licensed under the ISC license.
|
|
170
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const Fg=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Bg=Te("funnel",Fg);/**
|
|
172
|
-
* @license lucide-react v0.515.0 - ISC
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the ISC license.
|
|
175
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const Og=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],Xs=Te("git-branch",Og);/**
|
|
177
|
-
* @license lucide-react v0.515.0 - ISC
|
|
178
|
-
*
|
|
179
|
-
* This source code is licensed under the ISC license.
|
|
180
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const $g=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],$0=Te("git-commit-horizontal",$g);/**
|
|
182
|
-
* @license lucide-react v0.515.0 - ISC
|
|
183
|
-
*
|
|
184
|
-
* This source code is licensed under the ISC license.
|
|
185
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const _g=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],qg=Te("github",_g);/**
|
|
187
|
-
* @license lucide-react v0.515.0 - ISC
|
|
188
|
-
*
|
|
189
|
-
* This source code is licensed under the ISC license.
|
|
190
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const Hg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Fi=Te("globe",Hg);/**
|
|
192
|
-
* @license lucide-react v0.515.0 - ISC
|
|
193
|
-
*
|
|
194
|
-
* This source code is licensed under the ISC license.
|
|
195
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const Ug=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Wg=Te("grid-3x3",Ug);/**
|
|
197
|
-
* @license lucide-react v0.515.0 - ISC
|
|
198
|
-
*
|
|
199
|
-
* This source code is licensed under the ISC license.
|
|
200
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const Vg=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],_0=Te("history",Vg);/**
|
|
202
|
-
* @license lucide-react v0.515.0 - ISC
|
|
203
|
-
*
|
|
204
|
-
* This source code is licensed under the ISC license.
|
|
205
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const Gg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Kg=Te("info",Gg);/**
|
|
207
|
-
* @license lucide-react v0.515.0 - ISC
|
|
208
|
-
*
|
|
209
|
-
* This source code is licensed under the ISC license.
|
|
210
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const Jg=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Al=Te("key",Jg);/**
|
|
212
|
-
* @license lucide-react v0.515.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const Yg=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],Xg=Te("languages",Yg);/**
|
|
217
|
-
* @license lucide-react v0.515.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const Qg=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],Qs=Te("list",Qg);/**
|
|
222
|
-
* @license lucide-react v0.515.0 - ISC
|
|
223
|
-
*
|
|
224
|
-
* This source code is licensed under the ISC license.
|
|
225
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const Zg=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],zo=Te("loader-circle",Zg);/**
|
|
227
|
-
* @license lucide-react v0.515.0 - ISC
|
|
228
|
-
*
|
|
229
|
-
* This source code is licensed under the ISC license.
|
|
230
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const e1=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],js=Te("log-in",e1);/**
|
|
232
|
-
* @license lucide-react v0.515.0 - ISC
|
|
233
|
-
*
|
|
234
|
-
* This source code is licensed under the ISC license.
|
|
235
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const t1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Tl=Te("maximize-2",t1);/**
|
|
237
|
-
* @license lucide-react v0.515.0 - ISC
|
|
238
|
-
*
|
|
239
|
-
* This source code is licensed under the ISC license.
|
|
240
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const r1=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],Xa=Te("message-square",r1);/**
|
|
242
|
-
* @license lucide-react v0.515.0 - ISC
|
|
243
|
-
*
|
|
244
|
-
* This source code is licensed under the ISC license.
|
|
245
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const n1=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]],Us=Te("mic",n1);/**
|
|
247
|
-
* @license lucide-react v0.515.0 - ISC
|
|
248
|
-
*
|
|
249
|
-
* This source code is licensed under the ISC license.
|
|
250
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const a1=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],Lu=Te("minimize-2",a1);/**
|
|
252
|
-
* @license lucide-react v0.515.0 - ISC
|
|
253
|
-
*
|
|
254
|
-
* This source code is licensed under the ISC license.
|
|
255
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const s1=[["path",{d:"M5 12h14",key:"1ays0h"}]],i1=Te("minus",s1);/**
|
|
257
|
-
* @license lucide-react v0.515.0 - ISC
|
|
258
|
-
*
|
|
259
|
-
* This source code is licensed under the ISC license.
|
|
260
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const o1=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Lo=Te("moon",o1);/**
|
|
262
|
-
* @license lucide-react v0.515.0 - ISC
|
|
263
|
-
*
|
|
264
|
-
* This source code is licensed under the ISC license.
|
|
265
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const l1=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],Pu=Te("pause",l1);/**
|
|
267
|
-
* @license lucide-react v0.515.0 - ISC
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the ISC license.
|
|
270
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const c1=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],Po=Te("pen-line",c1);/**
|
|
272
|
-
* @license lucide-react v0.515.0 - ISC
|
|
273
|
-
*
|
|
274
|
-
* This source code is licensed under the ISC license.
|
|
275
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const d1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],u1=Te("pen",d1);/**
|
|
277
|
-
* @license lucide-react v0.515.0 - ISC
|
|
278
|
-
*
|
|
279
|
-
* This source code is licensed under the ISC license.
|
|
280
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const m1=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],h1=Te("play",m1);/**
|
|
282
|
-
* @license lucide-react v0.515.0 - ISC
|
|
283
|
-
*
|
|
284
|
-
* This source code is licensed under the ISC license.
|
|
285
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const p1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],nr=Te("plus",p1);/**
|
|
287
|
-
* @license lucide-react v0.515.0 - ISC
|
|
288
|
-
*
|
|
289
|
-
* This source code is licensed under the ISC license.
|
|
290
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const f1=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Tn=Te("refresh-cw",f1);/**
|
|
292
|
-
* @license lucide-react v0.515.0 - ISC
|
|
293
|
-
*
|
|
294
|
-
* This source code is licensed under the ISC license.
|
|
295
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const g1=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Zs=Te("save",g1);/**
|
|
297
|
-
* @license lucide-react v0.515.0 - ISC
|
|
298
|
-
*
|
|
299
|
-
* This source code is licensed under the ISC license.
|
|
300
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
-
*/const x1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],xa=Te("search",x1);/**
|
|
302
|
-
* @license lucide-react v0.515.0 - ISC
|
|
303
|
-
*
|
|
304
|
-
* This source code is licensed under the ISC license.
|
|
305
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/const b1=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],q0=Te("server",b1);/**
|
|
307
|
-
* @license lucide-react v0.515.0 - ISC
|
|
308
|
-
*
|
|
309
|
-
* This source code is licensed under the ISC license.
|
|
310
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
-
*/const y1=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Qn=Te("settings",y1);/**
|
|
312
|
-
* @license lucide-react v0.515.0 - ISC
|
|
313
|
-
*
|
|
314
|
-
* This source code is licensed under the ISC license.
|
|
315
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/const v1=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],k1=Te("settings-2",v1);/**
|
|
317
|
-
* @license lucide-react v0.515.0 - ISC
|
|
318
|
-
*
|
|
319
|
-
* This source code is licensed under the ISC license.
|
|
320
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const w1=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Bi=Te("shield",w1);/**
|
|
322
|
-
* @license lucide-react v0.515.0 - ISC
|
|
323
|
-
*
|
|
324
|
-
* This source code is licensed under the ISC license.
|
|
325
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const j1=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],Dn=Te("sparkles",j1);/**
|
|
327
|
-
* @license lucide-react v0.515.0 - ISC
|
|
328
|
-
*
|
|
329
|
-
* This source code is licensed under the ISC license.
|
|
330
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/const N1=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],S1=Te("square-check-big",N1);/**
|
|
332
|
-
* @license lucide-react v0.515.0 - ISC
|
|
333
|
-
*
|
|
334
|
-
* This source code is licensed under the ISC license.
|
|
335
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
-
*/const C1=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],M1=Te("square-pen",C1);/**
|
|
337
|
-
* @license lucide-react v0.515.0 - ISC
|
|
338
|
-
*
|
|
339
|
-
* This source code is licensed under the ISC license.
|
|
340
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/const A1=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],H0=Te("star",A1);/**
|
|
342
|
-
* @license lucide-react v0.515.0 - ISC
|
|
343
|
-
*
|
|
344
|
-
* This source code is licensed under the ISC license.
|
|
345
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/const T1=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ro=Te("sun",T1);/**
|
|
347
|
-
* @license lucide-react v0.515.0 - ISC
|
|
348
|
-
*
|
|
349
|
-
* This source code is licensed under the ISC license.
|
|
350
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
-
*/const E1=[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],I1=Te("table-properties",E1);/**
|
|
352
|
-
* @license lucide-react v0.515.0 - ISC
|
|
353
|
-
*
|
|
354
|
-
* This source code is licensed under the ISC license.
|
|
355
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/const D1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],z1=Te("target",D1);/**
|
|
357
|
-
* @license lucide-react v0.515.0 - ISC
|
|
358
|
-
*
|
|
359
|
-
* This source code is licensed under the ISC license.
|
|
360
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const L1=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ba=Te("terminal",L1);/**
|
|
362
|
-
* @license lucide-react v0.515.0 - ISC
|
|
363
|
-
*
|
|
364
|
-
* This source code is licensed under the ISC license.
|
|
365
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/const P1=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Or=Te("trash-2",P1);/**
|
|
367
|
-
* @license lucide-react v0.515.0 - ISC
|
|
368
|
-
*
|
|
369
|
-
* This source code is licensed under the ISC license.
|
|
370
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/const R1=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Wa=Te("triangle-alert",R1);/**
|
|
372
|
-
* @license lucide-react v0.515.0 - ISC
|
|
373
|
-
*
|
|
374
|
-
* This source code is licensed under the ISC license.
|
|
375
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/const F1=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Ns=Te("upload",F1);/**
|
|
377
|
-
* @license lucide-react v0.515.0 - ISC
|
|
378
|
-
*
|
|
379
|
-
* This source code is licensed under the ISC license.
|
|
380
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
-
*/const B1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Mt=Te("x",B1);/**
|
|
382
|
-
* @license lucide-react v0.515.0 - ISC
|
|
383
|
-
*
|
|
384
|
-
* This source code is licensed under the ISC license.
|
|
385
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/const O1=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Fo=Te("zap",O1);function Ru(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Ru(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function Fu(){for(var e,t,r=0,a="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Ru(e))&&(a&&(a+=" "),a+=t);return a}const El="-",$1=e=>{const t=q1(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:o=>{const l=o.split(El);return l[0]===""&&l.length!==1&&l.shift(),Bu(l,t)||_1(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&a[o]?[...c,...a[o]]:c}}},Bu=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],a=t.nextPart.get(r),s=a?Bu(e.slice(1),a):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(El);return t.validators.find(({validator:o})=>o(i))?.classGroupId},U0=/^\[(.+)\]$/,_1=e=>{if(U0.test(e)){const t=U0.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},q1=e=>{const{theme:t,classGroups:r}=e,a={nextPart:new Map,validators:[]};for(const s in r)Bo(r[s],a,s,t);return a},Bo=(e,t,r,a)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:W0(t,s);i.classGroupId=r;return}if(typeof s=="function"){if(H1(s)){Bo(s(a),t,r,a);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{Bo(o,W0(t,i),r,a)})})},W0=(e,t)=>{let r=e;return t.split(El).forEach(a=>{r.nextPart.has(a)||r.nextPart.set(a,{nextPart:new Map,validators:[]}),r=r.nextPart.get(a)}),r},H1=e=>e.isThemeGetter,U1=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,a=new Map;const s=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,a=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=a.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}},Oo="!",$o=":",W1=$o.length,V1=e=>{const{prefix:t,experimentalParseClassName:r}=e;let a=s=>{const i=[];let o=0,l=0,c=0,d;for(let x=0;x<s.length;x++){let y=s[x];if(o===0&&l===0){if(y===$o){i.push(s.slice(c,x)),c=x+W1;continue}if(y==="/"){d=x;continue}}y==="["?o++:y==="]"?o--:y==="("?l++:y===")"&&l--}const u=i.length===0?s:s.substring(c),m=G1(u),h=m!==u,p=d&&d>c?d-c:void 0;return{modifiers:i,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:p}};if(t){const s=t+$o,i=a;a=o=>o.startsWith(s)?i(o.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:o,maybePostfixModifierPosition:void 0}}if(r){const s=a;a=i=>r({className:i,parseClassName:s})}return a},G1=e=>e.endsWith(Oo)?e.substring(0,e.length-1):e.startsWith(Oo)?e.substring(1):e,K1=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const s=[];let i=[];return a.forEach(o=>{o[0]==="["||t[o]?(s.push(...i.sort(),o),i=[]):i.push(o)}),s.push(...i.sort()),s}},J1=e=>({cache:U1(e.cacheSize),parseClassName:V1(e),sortModifiers:K1(e),...$1(e)}),Y1=/\s+/,X1=(e,t)=>{const{parseClassName:r,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:i}=t,o=[],l=e.trim().split(Y1);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:m,modifiers:h,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:y}=r(u);if(m){c=u+(c.length>0?" "+c:c);continue}let k=!!y,w=a(k?x.substring(0,y):x);if(!w){if(!k){c=u+(c.length>0?" "+c:c);continue}if(w=a(x),!w){c=u+(c.length>0?" "+c:c);continue}k=!1}const j=i(h).join(":"),N=p?j+Oo:j,L=N+w;if(o.includes(L))continue;o.push(L);const U=s(w,k);for(let I=0;I<U.length;++I){const H=U[I];o.push(N+H)}c=u+(c.length>0?" "+c:c)}return c};function Q1(){let e=0,t,r,a="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Ou(t))&&(a&&(a+=" "),a+=r);return a}const Ou=e=>{if(typeof e=="string")return e;let t,r="";for(let a=0;a<e.length;a++)e[a]&&(t=Ou(e[a]))&&(r&&(r+=" "),r+=t);return r};function Z1(e,...t){let r,a,s,i=o;function o(c){const d=t.reduce((u,m)=>m(u),e());return r=J1(d),a=r.cache.get,s=r.cache.set,i=l,l(c)}function l(c){const d=a(c);if(d)return d;const u=X1(c,r);return s(c,u),u}return function(){return i(Q1.apply(null,arguments))}}const Vt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},$u=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_u=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ex=/^\d+\/\d+$/,tx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rx=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ax=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,sx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ia=e=>ex.test(e),dt=e=>!!e&&!Number.isNaN(Number(e)),jn=e=>!!e&&Number.isInteger(Number(e)),Oi=e=>e.endsWith("%")&&dt(e.slice(0,-1)),nn=e=>tx.test(e),ix=()=>!0,ox=e=>rx.test(e)&&!nx.test(e),qu=()=>!1,lx=e=>ax.test(e),cx=e=>sx.test(e),dx=e=>!Pe(e)&&!Re(e),ux=e=>Sa(e,Wu,qu),Pe=e=>$u.test(e),qn=e=>Sa(e,Vu,ox),$i=e=>Sa(e,gx,dt),V0=e=>Sa(e,Hu,qu),mx=e=>Sa(e,Uu,cx),Ss=e=>Sa(e,Gu,lx),Re=e=>_u.test(e),Pa=e=>Ca(e,Vu),hx=e=>Ca(e,xx),G0=e=>Ca(e,Hu),px=e=>Ca(e,Wu),fx=e=>Ca(e,Uu),Cs=e=>Ca(e,Gu,!0),Sa=(e,t,r)=>{const a=$u.exec(e);return a?a[1]?t(a[1]):r(a[2]):!1},Ca=(e,t,r=!1)=>{const a=_u.exec(e);return a?a[1]?t(a[1]):r:!1},Hu=e=>e==="position"||e==="percentage",Uu=e=>e==="image"||e==="url",Wu=e=>e==="length"||e==="size"||e==="bg-size",Vu=e=>e==="length",gx=e=>e==="number",xx=e=>e==="family-name",Gu=e=>e==="shadow",bx=()=>{const e=Vt("color"),t=Vt("font"),r=Vt("text"),a=Vt("font-weight"),s=Vt("tracking"),i=Vt("leading"),o=Vt("breakpoint"),l=Vt("container"),c=Vt("spacing"),d=Vt("radius"),u=Vt("shadow"),m=Vt("inset-shadow"),h=Vt("text-shadow"),p=Vt("drop-shadow"),x=Vt("blur"),y=Vt("perspective"),k=Vt("aspect"),w=Vt("ease"),j=Vt("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...L(),Re,Pe],I=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],F=()=>[Re,Pe,c],W=()=>[ia,"full","auto",...F()],M=()=>[jn,"none","subgrid",Re,Pe],_=()=>["auto",{span:["full",jn,Re,Pe]},jn,Re,Pe],O=()=>[jn,"auto",Re,Pe],V=()=>["auto","min","max","fr",Re,Pe],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],ne=()=>["auto",...F()],he=()=>[ia,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],$=()=>[e,Re,Pe],J=()=>[...L(),G0,V0,{position:[Re,Pe]}],C=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",px,ux,{size:[Re,Pe]}],xe=()=>[Oi,Pa,qn],A=()=>["","none","full",d,Re,Pe],te=()=>["",dt,Pa,qn],Ce=()=>["solid","dashed","dotted","double"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],pe=()=>[dt,Oi,G0,V0],_e=()=>["","none",x,Re,Pe],se=()=>["none",dt,Re,Pe],we=()=>["none",dt,Re,Pe],ze=()=>[dt,Re,Pe],Ae=()=>[ia,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[nn],breakpoint:[nn],color:[ix],container:[nn],"drop-shadow":[nn],ease:["in","out","in-out"],font:[dx],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[nn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[nn],shadow:[nn],spacing:["px",dt],text:[nn],"text-shadow":[nn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ia,Pe,Re,k]}],container:["container"],columns:[{columns:[dt,Pe,Re,l]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:U()}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:W()}],"inset-x":[{"inset-x":W()}],"inset-y":[{"inset-y":W()}],start:[{start:W()}],end:[{end:W()}],top:[{top:W()}],right:[{right:W()}],bottom:[{bottom:W()}],left:[{left:W()}],visibility:["visible","invisible","collapse"],z:[{z:[jn,"auto",Re,Pe]}],basis:[{basis:[ia,"full","auto",l,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dt,ia,"auto","initial","none",Pe]}],grow:[{grow:["",dt,Re,Pe]}],shrink:[{shrink:["",dt,Re,Pe]}],order:[{order:[jn,"first","last","none",Re,Pe]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:ne()}],mx:[{mx:ne()}],my:[{my:ne()}],ms:[{ms:ne()}],me:[{me:ne()}],mt:[{mt:ne()}],mr:[{mr:ne()}],mb:[{mb:ne()}],ml:[{ml:ne()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:he()}],w:[{w:[l,"screen",...he()]}],"min-w":[{"min-w":[l,"screen","none",...he()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...he()]}],h:[{h:["screen","lh",...he()]}],"min-h":[{"min-h":["screen","lh","none",...he()]}],"max-h":[{"max-h":["screen","lh",...he()]}],"font-size":[{text:["base",r,Pa,qn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Re,$i]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Oi,Pe]}],"font-family":[{font:[hx,Pe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,Re,Pe]}],"line-clamp":[{"line-clamp":[dt,"none",Re,$i]}],leading:[{leading:[i,...F()]}],"list-image":[{"list-image":["none",Re,Pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Re,Pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[dt,"from-font","auto",Re,qn]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[dt,"auto",Re,Pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re,Pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Re,Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:J()}],"bg-repeat":[{bg:C()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},jn,Re,Pe],radial:["",Re,Pe],conic:[jn,Re,Pe]},fx,mx]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:xe()}],"gradient-via-pos":[{via:xe()}],"gradient-to-pos":[{to:xe()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dt,Re,Pe]}],"outline-w":[{outline:["",dt,Pa,qn]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",u,Cs,Ss]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",m,Cs,Ss]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[dt,qn]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",h,Cs,Ss]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[dt,Re,Pe]}],"mix-blend":[{"mix-blend":[...De(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":De()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[dt]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Re,Pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":L()}],"mask-image-conic-pos":[{"mask-conic":[dt]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:J()}],"mask-repeat":[{mask:C()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Re,Pe]}],filter:[{filter:["","none",Re,Pe]}],blur:[{blur:_e()}],brightness:[{brightness:[dt,Re,Pe]}],contrast:[{contrast:[dt,Re,Pe]}],"drop-shadow":[{"drop-shadow":["","none",p,Cs,Ss]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",dt,Re,Pe]}],"hue-rotate":[{"hue-rotate":[dt,Re,Pe]}],invert:[{invert:["",dt,Re,Pe]}],saturate:[{saturate:[dt,Re,Pe]}],sepia:[{sepia:["",dt,Re,Pe]}],"backdrop-filter":[{"backdrop-filter":["","none",Re,Pe]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[dt,Re,Pe]}],"backdrop-contrast":[{"backdrop-contrast":[dt,Re,Pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dt,Re,Pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dt,Re,Pe]}],"backdrop-invert":[{"backdrop-invert":["",dt,Re,Pe]}],"backdrop-opacity":[{"backdrop-opacity":[dt,Re,Pe]}],"backdrop-saturate":[{"backdrop-saturate":[dt,Re,Pe]}],"backdrop-sepia":[{"backdrop-sepia":["",dt,Re,Pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Re,Pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dt,"initial",Re,Pe]}],ease:[{ease:["linear","initial",w,Re,Pe]}],delay:[{delay:[dt,Re,Pe]}],animate:[{animate:["none",j,Re,Pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Re,Pe]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:we()}],"scale-x":[{"scale-x":we()}],"scale-y":[{"scale-y":we()}],"scale-z":[{"scale-z":we()}],"scale-3d":["scale-3d"],skew:[{skew:ze()}],"skew-x":[{"skew-x":ze()}],"skew-y":[{"skew-y":ze()}],transform:[{transform:[Re,Pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ae()}],"translate-x":[{"translate-x":Ae()}],"translate-y":[{"translate-y":Ae()}],"translate-z":[{"translate-z":Ae()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Re,Pe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Re,Pe]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[dt,Pa,qn,$i]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},yx=Z1(bx);function Ue(...e){return yx(Fu(e))}const Il=b.forwardRef(({className:e,children:t,...r},a)=>n.jsx("div",{ref:a,className:Ue("relative overflow-hidden",e),...r,children:n.jsx("div",{className:"h-full w-full rounded-[inherit] overflow-auto",style:{WebkitOverflowScrolling:"touch",touchAction:"pan-y"},children:t})}));Il.displayName="ScrollArea";const K0=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,J0=Fu,Ku=(e,t)=>r=>{var a;if(t?.variants==null)return J0(e,r?.class,r?.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(d=>{const u=r?.[d],m=i?.[d];if(u===null)return null;const h=K0(u)||K0(m);return s[d][h]}),l=r&&Object.entries(r).reduce((d,u)=>{let[m,h]=u;return h===void 0||(d[m]=h),d},{}),c=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((d,u)=>{let{class:m,className:h,...p}=u;return Object.entries(p).every(x=>{let[y,k]=x;return Array.isArray(k)?k.includes({...i,...l}[y]):{...i,...l}[y]===k})?[...d,m,h]:d},[]);return J0(e,o,c,r?.class,r?.className)},vx=Ku("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Xe=b.forwardRef(({className:e,variant:t,size:r,...a},s)=>n.jsx("button",{className:Ue(vx({variant:t,size:r,className:e})),ref:s,...a}));Xe.displayName="Button";const kx=Ku("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Yn({className:e,variant:t,...r}){return n.jsx("div",{className:Ue(kx({variant:t}),e),...r})}const Xt=b.forwardRef(({className:e,type:t,...r},a)=>n.jsx("input",{type:t,className:Ue("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...r}));Xt.displayName="Input";const Wr=({className:e="w-5 h-5"})=>n.jsx("img",{src:"/icons/claude-ai-icon.svg",alt:"Claude",className:e}),on=({className:e="w-5 h-5"})=>n.jsx("img",{src:"/icons/cursor.svg",alt:"Cursor",className:e}),wx=({status:e="not-configured",size:t="sm",className:r="",showLabel:a=!1})=>{const i=(()=>{switch(e){case"fully-configured":return{icon:is,color:"text-green-500 dark:text-green-400",bgColor:"bg-green-50 dark:bg-green-950",label:"TaskMaster Ready",title:"TaskMaster fully configured with MCP server"};case"taskmaster-only":return{icon:Qn,color:"text-blue-500 dark:text-blue-400",bgColor:"bg-blue-50 dark:bg-blue-950",label:"TaskMaster Init",title:"TaskMaster initialized, MCP server needs setup"};case"mcp-only":return{icon:gi,color:"text-amber-500 dark:text-amber-400",bgColor:"bg-amber-50 dark:bg-amber-950",label:"MCP Ready",title:"MCP server configured, TaskMaster needs initialization"};case"not-configured":case"error":default:return{icon:Mt,color:"text-gray-400 dark:text-gray-500",bgColor:"bg-gray-50 dark:bg-gray-900",label:"No TaskMaster",title:"TaskMaster not configured"}}})(),o=i.icon,l={xs:"w-3 h-3",sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"},c={xs:"p-0.5",sm:"p-1",md:"p-1.5",lg:"p-2"};return a?n.jsxs("div",{className:Ue("inline-flex items-center gap-1.5 text-xs rounded-md px-2 py-1 transition-colors",i.bgColor,i.color,r),title:i.title,children:[n.jsx(o,{className:l[t]}),n.jsx("span",{className:"font-medium",children:i.label})]}):n.jsx("div",{className:Ue("inline-flex items-center justify-center rounded-full transition-colors",i.bgColor,c[t],r),title:i.title,children:n.jsx(o,{className:Ue(l[t],i.color)})})},Qe=(e,t={})=>{const r=localStorage.getItem("auth-token"),a={"Content-Type":"application/json"};return r&&(a.Authorization=`Bearer ${r}`),fetch(e,{...t,headers:{...a,...t.headers}})},at={auth:{status:()=>fetch("/api/auth/status"),login:(e,t)=>fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})}),register:(e,t)=>fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t})}),user:()=>Qe("/api/auth/user"),logout:()=>Qe("/api/auth/logout",{method:"POST"})},projects:()=>Qe("/api/projects"),sessions:(e,t=5,r=0)=>Qe(`/api/projects/${e}/sessions?limit=${t}&offset=${r}`),sessionMessages:(e,t,r=null,a=0)=>{const s=new URLSearchParams;r!==null&&(s.append("limit",r),s.append("offset",a));const i=s.toString(),o=`/api/projects/${e}/sessions/${t}/messages${i?`?${i}`:""}`;return Qe(o)},renameProject:(e,t)=>Qe(`/api/projects/${e}/rename`,{method:"PUT",body:JSON.stringify({displayName:t})}),deleteSession:(e,t)=>Qe(`/api/projects/${e}/sessions/${t}`,{method:"DELETE"}),deleteProject:e=>Qe(`/api/projects/${e}`,{method:"DELETE"}),createProject:e=>Qe("/api/projects/create",{method:"POST",body:JSON.stringify({path:e})}),createWorkspace:e=>Qe("/api/projects/create-workspace",{method:"POST",body:JSON.stringify(e)}),readFile:(e,t)=>Qe(`/api/projects/${e}/file?filePath=${encodeURIComponent(t)}`),saveFile:(e,t,r)=>Qe(`/api/projects/${e}/file`,{method:"PUT",body:JSON.stringify({filePath:t,content:r})}),getFiles:e=>Qe(`/api/projects/${e}/files`),transcribe:e=>Qe("/api/transcribe",{method:"POST",body:e,headers:{}}),taskmaster:{init:e=>Qe(`/api/taskmaster/init/${e}`,{method:"POST"}),addTask:(e,{prompt:t,title:r,description:a,priority:s,dependencies:i})=>Qe(`/api/taskmaster/add-task/${e}`,{method:"POST",body:JSON.stringify({prompt:t,title:r,description:a,priority:s,dependencies:i})}),parsePRD:(e,{fileName:t,numTasks:r,append:a})=>Qe(`/api/taskmaster/parse-prd/${e}`,{method:"POST",body:JSON.stringify({fileName:t,numTasks:r,append:a})}),getTemplates:()=>Qe("/api/taskmaster/prd-templates"),applyTemplate:(e,{templateId:t,fileName:r,customizations:a})=>Qe(`/api/taskmaster/apply-template/${e}`,{method:"POST",body:JSON.stringify({templateId:t,fileName:r,customizations:a})}),updateTask:(e,t,r)=>Qe(`/api/taskmaster/update-task/${e}/${t}`,{method:"PUT",body:JSON.stringify(r)})},browseFilesystem:(e=null)=>{const t=new URLSearchParams;return e&&t.append("path",e),Qe(`/api/browse-filesystem?${t}`)},get:e=>Qe(`/api${e}`)},jx=({onClose:e,onProjectCreated:t})=>{const[r,a]=b.useState(1),[s,i]=b.useState(null),[o,l]=b.useState(""),[c,d]=b.useState(""),[u,m]=b.useState(""),[h,p]=b.useState("stored"),[x,y]=b.useState(""),[k,w]=b.useState(!1),[j,N]=b.useState(null),[L,U]=b.useState([]),[I,H]=b.useState(!1),[F,W]=b.useState([]),[M,_]=b.useState(!1);b.useEffect(()=>{r===2&&s==="new"&&c&&O()},[r,s,c]),b.useEffect(()=>{o.length>2?V(o):(W([]),_(!1))},[o]);const O=async()=>{try{H(!0);const C=((await(await at.get("/settings/credentials?type=github_token")).json()).credentials||[]).filter(ue=>ue.is_active);U(C),C.length>0&&!u&&m(C[0].id.toString())}catch($){console.error("Error loading GitHub tokens:",$)}finally{H(!1)}},V=async $=>{try{const J=$.lastIndexOf("/"),C=J>0?$.substring(0,J):"~",xe=await(await at.browseFilesystem(C)).json();if(xe.suggestions){const A=xe.suggestions.filter(te=>te.path.toLowerCase().startsWith($.toLowerCase()));W(A.slice(0,5)),_(A.length>0)}}catch(J){console.error("Error loading path suggestions:",J)}},T=()=>{if(N(null),r===1){if(!s){N("Please select whether you have an existing workspace or want to create a new one");return}a(2)}else if(r===2){if(!o.trim()){N("Please provide a workspace path");return}a(3)}},Y=()=>{N(null),a(r-1)},ne=async()=>{w(!0),N(null);try{const $={workspaceType:s,path:o.trim()};s==="new"&&c&&($.githubUrl=c.trim(),h==="stored"&&u?$.githubTokenId=parseInt(u):h==="new"&&x&&($.newGithubToken=x.trim()));const J=await at.createWorkspace($),C=await J.json();if(!J.ok)throw new Error(C.error||"Failed to create workspace");t&&t(C.project),e()}catch($){console.error("Error creating workspace:",$),N($.message||"Failed to create workspace")}finally{w(!1)}},he=$=>{l($.path),_(!1)};return n.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-[60] p-0 sm:p-4",children:n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-none sm:rounded-lg shadow-xl w-full h-full sm:h-auto sm:max-w-2xl border-0 sm:border border-gray-200 dark:border-gray-700 overflow-y-auto",children:[n.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-blue-100 dark:bg-blue-900/50 rounded-lg flex items-center justify-center",children:n.jsx(Ys,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),n.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Create New Project"})]}),n.jsx("button",{onClick:e,className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700",disabled:k,children:n.jsx(Mt,{className:"w-5 h-5"})})]}),n.jsx("div",{className:"px-6 pt-4 pb-2",children:n.jsx("div",{className:"flex items-center justify-between",children:[1,2,3].map($=>n.jsxs(Jr.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center font-medium text-sm ${$<r?"bg-green-500 text-white":$===r?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-500"}`,children:$<r?n.jsx(ln,{className:"w-4 h-4"}):$}),n.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 hidden sm:inline",children:$===1?"Type":$===2?"Configure":"Confirm"})]}),$<3&&n.jsx("div",{className:`flex-1 h-1 mx-2 rounded ${$<r?"bg-green-500":"bg-gray-200 dark:bg-gray-700"}`})]},$))})}),n.jsxs("div",{className:"p-6 space-y-6 min-h-[300px]",children:[j&&n.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 flex items-start gap-3",children:[n.jsx(gi,{className:"w-5 h-5 text-red-600 dark:text-red-400 flex-shrink-0 mt-0.5"}),n.jsx("div",{className:"flex-1",children:n.jsx("p",{className:"text-sm text-red-800 dark:text-red-200",children:j})})]}),r===1&&n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{children:[n.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:"Do you already have a workspace, or would you like to create a new one?"}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsx("button",{onClick:()=>i("existing"),className:`p-4 border-2 rounded-lg text-left transition-all ${s==="existing"?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}`,children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-green-100 dark:bg-green-900/50 rounded-lg flex items-center justify-center flex-shrink-0",children:n.jsx(Ys,{className:"w-5 h-5 text-green-600 dark:text-green-400"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("h5",{className:"font-semibold text-gray-900 dark:text-white mb-1",children:"Existing Workspace"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"I already have a workspace on my server and just need to add it to the project list"})]})]})}),n.jsx("button",{onClick:()=>i("new"),className:`p-4 border-2 rounded-lg text-left transition-all ${s==="new"?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}`,children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-purple-100 dark:bg-purple-900/50 rounded-lg flex items-center justify-center flex-shrink-0",children:n.jsx(Xs,{className:"w-5 h-5 text-purple-600 dark:text-purple-400"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("h5",{className:"font-semibold text-gray-900 dark:text-white mb-1",children:"New Workspace"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Create a new workspace, optionally clone from a GitHub repository"})]})]})})]})]})}),r===2&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:s==="existing"?"Workspace Path":"Where should the workspace be created?"}),n.jsxs("div",{className:"relative",children:[n.jsx(Xt,{type:"text",value:o,onChange:$=>l($.target.value),placeholder:s==="existing"?"/path/to/existing/workspace":"/path/to/new/workspace",className:"w-full"}),M&&F.length>0&&n.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg max-h-60 overflow-y-auto",children:F.map(($,J)=>n.jsxs("button",{onClick:()=>he($),className:"w-full px-4 py-2 text-left hover:bg-gray-100 dark:hover:bg-gray-700 text-sm",children:[n.jsx("div",{className:"font-medium text-gray-900 dark:text-white",children:$.name}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:$.path})]},J))})]}),n.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:s==="existing"?"Full path to your existing workspace directory":"Full path where the new workspace will be created"})]}),s==="new"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"GitHub URL (Optional)"}),n.jsx(Xt,{type:"text",value:c,onChange:$=>d($.target.value),placeholder:"https://github.com/username/repository",className:"w-full"}),n.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Leave empty to create an empty workspace, or provide a GitHub URL to clone"})]}),c&&n.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900/50 rounded-lg p-4 border border-gray-200 dark:border-gray-700",children:[n.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[n.jsx(Al,{className:"w-5 h-5 text-gray-600 dark:text-gray-400 flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"flex-1",children:[n.jsx("h5",{className:"font-medium text-gray-900 dark:text-white mb-1",children:"GitHub Authentication (Optional)"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Only required for private repositories. Public repos can be cloned without authentication."})]})]}),I?n.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[n.jsx(zo,{className:"w-4 h-4 animate-spin"}),"Loading stored tokens..."]}):L.length>0?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-3 gap-2 mb-4",children:[n.jsx("button",{onClick:()=>p("stored"),className:`px-3 py-2 text-sm font-medium rounded-lg transition-colors ${h==="stored"?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:"Stored Token"}),n.jsx("button",{onClick:()=>p("new"),className:`px-3 py-2 text-sm font-medium rounded-lg transition-colors ${h==="new"?"bg-blue-500 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:"New Token"}),n.jsx("button",{onClick:()=>{p("none"),m(""),y("")},className:`px-3 py-2 text-sm font-medium rounded-lg transition-colors ${h==="none"?"bg-green-500 text-white":"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300"}`,children:"None (Public)"})]}),h==="stored"?n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Select Token"}),n.jsxs("select",{value:u,onChange:$=>m($.target.value),className:"w-full px-3 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg text-sm",children:[n.jsx("option",{value:"",children:"-- Select a token --"}),L.map($=>n.jsx("option",{value:$.id,children:$.credential_name},$.id))]})]}):h==="new"?n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"GitHub Token"}),n.jsx(Xt,{type:"password",value:x,onChange:$=>y($.target.value),placeholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",className:"w-full"}),n.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"This token will be used only for this operation"})]}):null]}):n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-3 border border-blue-200 dark:border-blue-800",children:n.jsxs("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:["💡 ",n.jsx("strong",{children:"Public repositories"})," don't require authentication. You can skip providing a token if cloning a public repo."]})}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"GitHub Token (Optional for Public Repos)"}),n.jsx(Xt,{type:"password",value:x,onChange:$=>y($.target.value),placeholder:"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (leave empty for public repos)",className:"w-full"}),n.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"No stored tokens available. You can add tokens in Settings → API Keys for easier reuse."})]})]})]})]})]}),r===3&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900/50 rounded-lg p-4 border border-gray-200 dark:border-gray-700",children:[n.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white mb-3",children:"Review Your Configuration"}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Workspace Type:"}),n.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:s==="existing"?"Existing Workspace":"New Workspace"})]}),n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Path:"}),n.jsx("span",{className:"font-mono text-xs text-gray-900 dark:text-white break-all",children:o})]}),s==="new"&&c&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Clone From:"}),n.jsx("span",{className:"font-mono text-xs text-gray-900 dark:text-white break-all",children:c})]}),n.jsxs("div",{className:"flex justify-between text-sm",children:[n.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Authentication:"}),n.jsx("span",{className:"text-xs text-gray-900 dark:text-white",children:h==="stored"&&u?`Using stored token: ${L.find($=>$.id.toString()===u)?.credential_name||"Unknown"}`:h==="new"&&x?"Using provided token":"No authentication"})]})]})]})]}),n.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-4 border border-blue-200 dark:border-blue-800",children:n.jsx("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:s==="existing"?"The workspace will be added to your project list and will be available for Claude/Cursor sessions.":c?"A new workspace will be created and the repository will be cloned from GitHub.":"An empty workspace directory will be created at the specified path."})})]})]}),n.jsxs("div",{className:"flex items-center justify-between p-6 border-t border-gray-200 dark:border-gray-700",children:[n.jsx(Xe,{variant:"outline",onClick:r===1?e:Y,disabled:k,children:r===1?"Cancel":n.jsxs(n.Fragment,{children:[n.jsx(Iu,{className:"w-4 h-4 mr-1"}),"Back"]})}),n.jsx(Xe,{onClick:r===3?ne:T,disabled:k||r===1&&!s,children:k?n.jsxs(n.Fragment,{children:[n.jsx(zo,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating..."]}):r===3?n.jsxs(n.Fragment,{children:[n.jsx(ln,{className:"w-4 h-4 mr-1"}),"Create Project"]}):n.jsxs(n.Fragment,{children:["Next",n.jsx(cn,{className:"w-4 h-4 ml-1"})]})})]})]})})},Ju=b.createContext({user:null,token:null,login:()=>{},register:()=>{},logout:()=>{},isLoading:!0,needsSetup:!1,error:null}),xi=()=>{const e=b.useContext(Ju);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},Nx=({children:e})=>{const[t,r]=b.useState(null),[a,s]=b.useState(localStorage.getItem("auth-token")),[i,o]=b.useState(!0),[l,c]=b.useState(!1),[d,u]=b.useState(null);b.useEffect(()=>{m()},[]);const m=async()=>{try{if(o(!0),u(null),(await(await at.auth.status()).json()).needsSetup){c(!0),o(!1);return}if(a)try{const j=await at.auth.user();if(j.ok){const N=await j.json();r(N.user),c(!1)}else localStorage.removeItem("auth-token"),s(null),r(null)}catch(j){console.error("Token verification failed:",j),localStorage.removeItem("auth-token"),s(null),r(null)}}catch(k){console.error("[AuthContext] Auth status check failed:",k),u("Failed to check authentication status")}finally{o(!1)}},y={user:t,token:a,login:async(k,w)=>{try{u(null);const j=await at.auth.login(k,w),N=await j.json();return j.ok?(s(N.token),r(N.user),localStorage.setItem("auth-token",N.token),{success:!0}):(u(N.error||"Login failed"),{success:!1,error:N.error||"Login failed"})}catch(j){console.error("Login error:",j);const N="Network error. Please try again.";return u(N),{success:!1,error:N}}},register:async(k,w)=>{try{u(null);const j=await at.auth.register(k,w),N=await j.json();return j.ok?(s(N.token),r(N.user),c(!1),localStorage.setItem("auth-token",N.token),{success:!0}):(u(N.error||"Registration failed"),{success:!1,error:N.error||"Registration failed"})}catch(j){console.error("Registration error:",j);const N="Network error. Please try again.";return u(N),{success:!1,error:N}}},logout:()=>{s(null),r(null),localStorage.removeItem("auth-token"),a&&at.auth.logout().catch(k=>{console.error("Logout endpoint error:",k)})},isLoading:i,needsSetup:l,error:d};return n.jsx(Ju.Provider,{value:y,children:e})};function Sx(){const[e,t]=b.useState(null),[r,a]=b.useState([]),[s,i]=b.useState(!1),o=b.useRef(null);b.useEffect(()=>(l(),()=>{o.current&&clearTimeout(o.current),e&&e.close()}),[]);const l=async()=>{try{let u;{const h=localStorage.getItem("auth-token");if(!h){console.warn("No authentication token found for WebSocket connection");return}u=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws?token=${encodeURIComponent(h)}`}const m=new WebSocket(u);m.onopen=()=>{i(!0),t(m)},m.onmessage=h=>{try{const p=JSON.parse(h.data);a(x=>[...x,p])}catch(p){console.error("Error parsing WebSocket message:",p)}},m.onclose=()=>{i(!1),t(null),o.current=setTimeout(()=>{l()},3e3)},m.onerror=h=>{console.error("WebSocket error:",h)}}catch(d){console.error("Error creating WebSocket connection:",d)}};return{ws:e,sendMessage:d=>{e&&s?e.send(JSON.stringify(d)):console.warn("WebSocket not connected")},messages:r,isConnected:s}}const Yu=b.createContext({ws:null,sendMessage:()=>{},messages:[],isConnected:!1}),Xu=()=>{const e=b.useContext(Yu);if(!e)throw new Error("useWebSocketContext must be used within a WebSocketProvider");return e},Cx=({children:e})=>{const t=Sx();return n.jsx(Yu.Provider,{value:t,children:e})},Qu=b.createContext({projects:[],currentProject:null,projectTaskMaster:null,mcpServerStatus:null,tasks:[],nextTask:null,isLoading:!1,isLoadingTasks:!1,isLoadingMCP:!1,error:null,refreshProjects:()=>{},setCurrentProject:()=>{},refreshTasks:()=>{},refreshMCPStatus:()=>{},clearError:()=>{}}),ls=()=>{const e=b.useContext(Qu);if(!e)throw new Error("useTaskMaster must be used within a TaskMasterProvider");return e},Mx=({children:e})=>{const{messages:t}=Xu(),{user:r,token:a,isLoading:s}=xi(),[i,o]=b.useState([]),[l,c]=b.useState(null),[d,u]=b.useState(null),[m,h]=b.useState(null),[p,x]=b.useState([]),[y,k]=b.useState(null),[w,j]=b.useState(!1),[N,L]=b.useState(!1),[U,I]=b.useState(!1),[H,F]=b.useState(null),W=(ne,he)=>{console.error(`TaskMaster ${he} error:`,ne),F({message:ne.message||`Failed to ${he}`,context:he,timestamp:new Date().toISOString()})},M=b.useCallback(()=>{F(null)},[]),_=b.useCallback(async()=>{if(!r||!a){o([]),c(null);return}try{j(!0),M();const ne=await at.get("/projects");if(!ne.ok)throw new Error(`Failed to fetch projects: ${ne.status}`);const he=await ne.json();if(!Array.isArray(he)){console.error("Projects API returned non-array data:",he),o([]);return}const $=he.map(J=>({...J,taskMasterConfigured:J.taskmaster?.hasTaskmaster||!1,taskMasterStatus:J.taskmaster?.status||"not-configured",taskCount:J.taskmaster?.metadata?.taskCount||0,completedCount:J.taskmaster?.metadata?.completed||0}));if(o($),l){const J=$.find(C=>C.name===l.name);J&&(c(J),u(J.taskmaster))}}catch(ne){W(ne,"load projects")}finally{j(!1)}},[r,a]),O=b.useCallback(async ne=>{try{if(c(ne),x([]),k(null),u(null),ne?.name)try{const he=await at.get(`/taskmaster/detect/${encodeURIComponent(ne.name)}`);if(he.ok){const $=await he.json();u($.taskmaster)}else console.warn("Individual TaskMaster detection failed, using project data:",he.status),u(ne.taskmaster||null)}catch(he){console.warn("TaskMaster detection error, using project data:",he.message),u(ne.taskmaster||null)}else u(null)}catch(he){console.error("Error in setCurrentProject:",he),W(he,"set current project"),u(ne?.taskmaster||null)}},[]),V=b.useCallback(async()=>{if(!r||!a){h(null);return}try{I(!0),M();const ne=await at.get("/mcp-utils/taskmaster-server");h(ne)}catch(ne){W(ne,"check MCP server status")}finally{I(!1)}},[r,a]),T=b.useCallback(async()=>{if(!l){x([]),k(null);return}if(!r||!a){x([]),k(null);return}try{L(!0),M();const ne=await at.get(`/taskmaster/tasks/${encodeURIComponent(l.name)}`);if(!ne.ok){const J=await ne.json();throw new Error(J.message||"Failed to load tasks")}const he=await ne.json();x(he.tasks||[]);const $=he.tasks?.find(J=>J.status==="pending"||J.status==="in-progress")||null;k($)}catch(ne){console.error("Error loading tasks:",ne),W(ne,"load tasks"),x([]),k(null)}finally{L(!1)}},[l,r,a]);b.useEffect(()=>{!s&&r&&a?(_(),V()):console.log("Auth not ready or no user, skipping project load:",{authLoading:s,user:!!r,token:!!a})},[_,V,s,r,a]),b.useEffect(()=>{r&&a&&M()},[r,a,M]),b.useEffect(()=>{l?.name&&r&&a&&T()},[l?.name,r,a,T]),b.useEffect(()=>{const ne=t[t.length-1];if(ne)switch(ne.type){case"taskmaster-project-updated":ne.projectName&&_();break;case"taskmaster-tasks-updated":ne.projectName===l?.name&&T();break;case"taskmaster-mcp-status-changed":V();break}},[t,_,T,V,l]);const Y={projects:i,currentProject:l,projectTaskMaster:d,mcpServerStatus:m,tasks:p,nextTask:y,isLoading:w,isLoadingTasks:N,isLoadingMCP:U,error:H,refreshProjects:_,setCurrentProject:O,refreshTasks:T,refreshMCPStatus:V,clearError:M};return n.jsx(Qu.Provider,{value:Y,children:e})},Zu=b.createContext({tasksEnabled:!0,setTasksEnabled:()=>{},toggleTasksEnabled:()=>{},isTaskMasterInstalled:null,isTaskMasterReady:null,installationStatus:null,isCheckingInstallation:!0}),cs=()=>{const e=b.useContext(Zu);if(!e)throw new Error("useTasksSettings must be used within a TasksSettingsProvider");return e},Ax=({children:e})=>{const[t,r]=b.useState(()=>{const p=localStorage.getItem("tasks-enabled");return p!==null?JSON.parse(p):!0}),[a,s]=b.useState(null),[i,o]=b.useState(null),[l,c]=b.useState(null),[d,u]=b.useState(!0);b.useEffect(()=>{localStorage.setItem("tasks-enabled",JSON.stringify(t))},[t]),b.useEffect(()=>{setTimeout(async()=>{try{const x=await at.get("/taskmaster/installation-status");if(x.ok){const y=await x.json();c(y),s(y.installation?.isInstalled||!1),o(y.isReady||!1);const k=localStorage.getItem("tasks-enabled");!y.installation?.isInstalled&&!k&&r(!1)}else console.error("Failed to check TaskMaster installation status"),s(!1),o(!1)}catch(x){console.error("Error checking TaskMaster installation:",x),s(!1),o(!1)}finally{u(!1)}},0)},[]);const h={tasksEnabled:t,setTasksEnabled:r,toggleTasksEnabled:()=>{r(p=>!p)},isTaskMasterInstalled:a,isTaskMasterReady:i,installationStatus:l,isCheckingInstallation:d};return n.jsx(Zu.Provider,{value:h,children:e})},Y0=(e,t)=>{const r=new Date(e),a=t;if(isNaN(r.getTime()))return"Unknown";const s=a-r,i=Math.floor(s/1e3),o=Math.floor(s/(1e3*60)),l=Math.floor(s/(1e3*60*60)),c=Math.floor(s/(1e3*60*60*24));return i<60?"Just now":o===1?"1 min ago":o<60?`${o} mins ago`:l===1?"1 hour ago":l<24?`${l} hours ago`:c===1?"1 day ago":c<7?`${c} days ago`:r.toLocaleDateString()};function X0({projects:e,selectedProject:t,selectedSession:r,onProjectSelect:a,onSessionSelect:s,onNewSession:i,onSessionDelete:o,onProjectDelete:l,isLoading:c,onRefresh:d,onShowSettings:u,updateAvailable:m,latestVersion:h,currentVersion:p,releaseInfo:x,onShowVersionModal:y,isPWA:k,isMobile:w,onToggleSidebar:j}){const[N,L]=b.useState(new Set),[U,I]=b.useState(null),[H,F]=b.useState(!1),[W,M]=b.useState(""),[_,O]=b.useState({}),[V,T]=b.useState({}),[Y,ne]=b.useState(new Set),[he,$]=b.useState(new Date),[J,C]=b.useState("name"),[ue,xe]=b.useState(!1),[A,te]=b.useState(null),[Ce,De]=b.useState(""),[pe,_e]=b.useState({}),[se,we]=b.useState(""),{setCurrentProject:ze,mcpServerStatus:Ae}=ls(),{tasksEnabled:Be}=cs(),[nt,bt]=b.useState(()=>{try{const R=localStorage.getItem("starredProjects");return R?new Set(JSON.parse(R)):new Set}catch(R){return console.error("Error loading starred projects:",R),new Set}}),ut=R=>Q=>{Q.target.closest(".overflow-y-auto")||Q.target.closest("[data-scroll-container]")||(Q.preventDefault(),Q.stopPropagation(),R())};b.useEffect(()=>{const R=setInterval(()=>{$(new Date)},6e4);return()=>clearInterval(R)},[]),b.useEffect(()=>{T({}),ne(new Set)},[e]),b.useEffect(()=>{r&&t&&L(R=>new Set([...R,t.name]))},[r,t]),b.useEffect(()=>{if(e.length>0&&!c){const R=new Set;e.forEach(Q=>{Q.sessions&&Q.sessions.length>=0&&R.add(Q.name)}),ne(R)}},[e,c]),b.useEffect(()=>{const R=()=>{try{const je=localStorage.getItem("claude-settings");if(je){const re=JSON.parse(je);C(re.projectSortOrder||"name")}}catch(je){console.error("Error loading sort order:",je)}};R();const Q=je=>{je.key==="claude-settings"&&R()};window.addEventListener("storage",Q);const be=setInterval(()=>{document.hasFocus()&&R()},1e3);return()=>{window.removeEventListener("storage",Q),clearInterval(be)}},[]);const jt=R=>{const Q=new Set;N.has(R)||Q.add(R),L(Q)},lt=(R,Q)=>{s({...R,__projectName:Q})},qe=R=>{const Q=new Set(nt);Q.has(R)?Q.delete(R):Q.add(R),bt(Q);try{localStorage.setItem("starredProjects",JSON.stringify([...Q]))}catch(be){console.error("Error saving starred projects:",be)}},st=R=>nt.has(R),St=R=>{const Q=[...R.sessions||[],...V[R.name]||[]].map(re=>({...re,__provider:"claude"})),be=(R.cursorSessions||[]).map(re=>({...re,__provider:"cursor"})),je=re=>new Date(re.__provider==="cursor"?re.createdAt:re.lastActivity);return[...Q,...be].sort((re,Me)=>je(Me)-je(re))},Oe=R=>{const Q=St(R);return Q.length===0?new Date(0):Q.reduce((je,re)=>{const Me=new Date(re.lastActivity);return Me>je?Me:je},new Date(0))},Qt=[...e].sort((R,Q)=>{const be=st(R.name),je=st(Q.name);if(be&&!je)return-1;if(!be&&je)return 1;if(J==="date")return Oe(Q)-Oe(R);{const re=R.displayName||R.name,Me=Q.displayName||Q.name;return re.localeCompare(Me)}}),ie=R=>{I(R.name),M(R.displayName)},Se=()=>{I(null),M("")},B=async R=>{try{(await at.renameProject(R,W)).ok?window.refreshProjects?window.refreshProjects():window.location.reload():console.error("Failed to rename project")}catch(Q){console.error("Error renaming project:",Q)}I(null),M("")},K=async(R,Q)=>{if(confirm("Are you sure you want to delete this session? This action cannot be undone."))try{(await at.deleteSession(R,Q)).ok?o&&o(Q):(console.error("Failed to delete session"),alert("Failed to delete session. Please try again."))}catch(be){console.error("Error deleting session:",be),alert("Error deleting session. Please try again.")}},ke=async R=>{if(confirm("Are you sure you want to delete this empty project? This action cannot be undone."))try{const Q=await at.deleteProject(R);if(Q.ok)l&&l(R);else{const be=await Q.json();console.error("Failed to delete project"),alert(be.error||"Failed to delete project. Please try again.")}}catch(Q){console.error("Error deleting project:",Q),alert("Error deleting project. Please try again.")}},We=async R=>{if(!(!(R.sessionMeta?.hasMore!==!1)||_[R.name])){O(be=>({...be,[R.name]:!0}));try{const be=(R.sessions?.length||0)+(V[R.name]?.length||0),je=await at.sessions(R.name,5,be);if(je.ok){const re=await je.json();T(Me=>({...Me,[R.name]:[...Me[R.name]||[],...re.sessions]})),re.hasMore===!1&&(R.sessionMeta={...R.sessionMeta,hasMore:!1})}}catch(be){console.error("Error loading more sessions:",be)}finally{O(be=>({...be,[R.name]:!1}))}}},Ge=Qt.filter(R=>{if(!se.trim())return!0;const Q=se.toLowerCase(),be=(R.displayName||R.name).toLowerCase(),je=R.name.toLowerCase();return be.includes(Q)||je.includes(Q)}),ce=R=>{a(R),ze(R)};return n.jsxs(n.Fragment,{children:[H&&Ff.createPortal(n.jsx(jx,{onClose:()=>F(!1),onProjectCreated:R=>{window.refreshProjects?window.refreshProjects():window.location.reload()}}),document.body),n.jsxs("div",{className:"h-full flex flex-col bg-card md:select-none",style:k&&w?{paddingTop:"44px"}:{},children:[n.jsxs("div",{className:"md:p-4 md:border-b md:border-border",children:[n.jsxs("div",{className:"hidden md:flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center shadow-sm",children:n.jsx(Xa,{className:"w-4 h-4 text-primary-foreground"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-bold text-foreground",children:"Claude Code UI"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"AI coding assistant interface"})]})]}),j&&n.jsx(Xe,{variant:"ghost",size:"sm",className:"h-8 w-8 px-0 hover:bg-accent transition-colors duration-200",onClick:j,title:"Hide sidebar",children:n.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})})]}),n.jsx("div",{className:"md:hidden p-3 border-b border-border",style:k&&w?{paddingTop:"16px"}:{},children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-primary rounded-lg flex items-center justify-center",children:n.jsx(Xa,{className:"w-4 h-4 text-primary-foreground"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Claude Code UI"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Projects"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{className:"w-8 h-8 rounded-md bg-background border border-border flex items-center justify-center active:scale-95 transition-all duration-150",onClick:async()=>{xe(!0);try{await d()}finally{xe(!1)}},disabled:ue,children:n.jsx(Tn,{className:`w-4 h-4 text-foreground ${ue?"animate-spin":""}`})}),n.jsx("button",{className:"w-8 h-8 rounded-md bg-primary text-primary-foreground flex items-center justify-center active:scale-95 transition-all duration-150",onClick:()=>F(!0),children:n.jsx(Ys,{className:"w-4 h-4"})})]})]})})]}),e.length>0&&!c&&n.jsxs("div",{className:"px-3 md:px-4 py-2 border-b border-border space-y-2",children:[n.jsxs("div",{className:"relative",children:[n.jsx(xa,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-muted-foreground"}),n.jsx(Xt,{type:"text",placeholder:"Search projects...",value:se,onChange:R=>we(R.target.value),className:"pl-9 h-9 text-sm bg-muted/50 border-0 focus:bg-background focus:ring-1 focus:ring-primary/20"}),se&&n.jsx("button",{onClick:()=>we(""),className:"absolute right-2 top-1/2 transform -translate-y-1/2 p-1 hover:bg-accent rounded",children:n.jsx(Mt,{className:"w-3 h-3 text-muted-foreground"})})]}),!w&&n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(Xe,{variant:"default",size:"sm",className:"flex-1 h-8 text-xs bg-primary hover:bg-primary/90 transition-all duration-200",onClick:()=>F(!0),title:"Create new project (Ctrl+N)",children:[n.jsx(Ys,{className:"w-3.5 h-3.5 mr-1.5"}),"New Project"]}),n.jsx(Xe,{variant:"outline",size:"sm",className:"h-8 w-8 px-0 hover:bg-accent transition-colors duration-200 group",onClick:async()=>{xe(!0);try{await d()}finally{xe(!1)}},disabled:ue,title:"Refresh projects and sessions (Ctrl+R)",children:n.jsx(Tn,{className:`w-3.5 h-3.5 ${ue?"animate-spin":""} group-hover:rotate-180 transition-transform duration-300`})})]})]}),n.jsx(Il,{className:"flex-1 md:px-2 md:py-3 overflow-y-auto overscroll-contain",children:n.jsx("div",{className:"md:space-y-1 pb-safe-area-inset-bottom",children:c?n.jsxs("div",{className:"text-center py-12 md:py-8 px-4",children:[n.jsx("div",{className:"w-12 h-12 bg-muted rounded-lg flex items-center justify-center mx-auto mb-4 md:mb-3",children:n.jsx("div",{className:"w-6 h-6 animate-spin rounded-full border-2 border-muted-foreground border-t-transparent"})}),n.jsx("h3",{className:"text-base font-medium text-foreground mb-2 md:mb-1",children:"Loading projects..."}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Fetching your Claude projects and sessions"})]}):e.length===0?n.jsxs("div",{className:"text-center py-12 md:py-8 px-4",children:[n.jsx("div",{className:"w-12 h-12 bg-muted rounded-lg flex items-center justify-center mx-auto mb-4 md:mb-3",children:n.jsx(En,{className:"w-6 h-6 text-muted-foreground"})}),n.jsx("h3",{className:"text-base font-medium text-foreground mb-2 md:mb-1",children:"No projects found"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Run Claude CLI in a project directory to get started"})]}):Ge.length===0?n.jsxs("div",{className:"text-center py-12 md:py-8 px-4",children:[n.jsx("div",{className:"w-12 h-12 bg-muted rounded-lg flex items-center justify-center mx-auto mb-4 md:mb-3",children:n.jsx(xa,{className:"w-6 h-6 text-muted-foreground"})}),n.jsx("h3",{className:"text-base font-medium text-foreground mb-2 md:mb-1",children:"No matching projects"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Try adjusting your search term"})]}):Ge.map(R=>{const Q=N.has(R.name),be=t?.name===R.name,je=st(R.name);return n.jsxs("div",{className:"md:space-y-1",children:[n.jsxs("div",{className:"group md:group",children:[n.jsx("div",{className:"md:hidden",children:n.jsx("div",{className:Ue("p-3 mx-3 my-1 rounded-lg bg-card border border-border/50 active:scale-[0.98] transition-all duration-150",be&&"bg-primary/5 border-primary/20",je&&!be&&"bg-yellow-50/50 dark:bg-yellow-900/5 border-yellow-200/30 dark:border-yellow-800/30"),onClick:()=>{jt(R.name)},onTouchEnd:ut(()=>jt(R.name)),children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[n.jsx("div",{className:Ue("w-8 h-8 rounded-lg flex items-center justify-center transition-colors",Q?"bg-primary/10":"bg-muted"),children:Q?n.jsx(Jn,{className:"w-4 h-4 text-primary"}):n.jsx(En,{className:"w-4 h-4 text-muted-foreground"})}),n.jsx("div",{className:"min-w-0 flex-1",children:U===R.name?n.jsx("input",{type:"text",value:W,onChange:re=>M(re.target.value),className:"w-full px-3 py-2 text-sm border-2 border-primary/40 focus:border-primary rounded-lg bg-background text-foreground shadow-sm focus:shadow-md transition-all duration-200 focus:outline-none",placeholder:"Project name",autoFocus:!0,autoComplete:"off",onClick:re=>re.stopPropagation(),onKeyDown:re=>{re.key==="Enter"&&B(R.name),re.key==="Escape"&&Se()},style:{fontSize:"16px",WebkitAppearance:"none",borderRadius:"8px"}}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center justify-between min-w-0 flex-1",children:[n.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:R.displayName}),Be&&n.jsx(wx,{status:(()=>{const re=R.taskmaster?.hasTaskmaster,Me=Ae?.hasMCPServer&&Ae?.isConfigured;return re&&Me?"fully-configured":re?"taskmaster-only":Me?"mcp-only":"not-configured"})(),size:"xs",className:"hidden md:inline-flex flex-shrink-0 ml-2"})]}),n.jsx("p",{className:"text-xs text-muted-foreground",children:(()=>{const re=St(R).length,pt=R.sessionMeta?.hasMore!==!1&&re>=5?`${re}+`:re;return`${pt} session${pt===1?"":"s"}`})()})]})})]}),n.jsx("div",{className:"flex items-center gap-1",children:U===R.name?n.jsxs(n.Fragment,{children:[n.jsx("button",{className:"w-8 h-8 rounded-lg bg-green-500 dark:bg-green-600 flex items-center justify-center active:scale-90 transition-all duration-150 shadow-sm active:shadow-none",onClick:re=>{re.stopPropagation(),B(R.name)},children:n.jsx(ln,{className:"w-4 h-4 text-white"})}),n.jsx("button",{className:"w-8 h-8 rounded-lg bg-gray-500 dark:bg-gray-600 flex items-center justify-center active:scale-90 transition-all duration-150 shadow-sm active:shadow-none",onClick:re=>{re.stopPropagation(),Se()},children:n.jsx(Mt,{className:"w-4 h-4 text-white"})})]}):n.jsxs(n.Fragment,{children:[n.jsx("button",{className:Ue("w-8 h-8 rounded-lg flex items-center justify-center active:scale-90 transition-all duration-150 border",je?"bg-yellow-500/10 dark:bg-yellow-900/30 border-yellow-200 dark:border-yellow-800":"bg-gray-500/10 dark:bg-gray-900/30 border-gray-200 dark:border-gray-800"),onClick:re=>{re.stopPropagation(),qe(R.name)},onTouchEnd:ut(()=>qe(R.name)),title:je?"Remove from favorites":"Add to favorites",children:n.jsx(H0,{className:Ue("w-4 h-4 transition-colors",je?"text-yellow-600 dark:text-yellow-400 fill-current":"text-gray-600 dark:text-gray-400")})}),St(R).length===0&&n.jsx("button",{className:"w-8 h-8 rounded-lg bg-red-500/10 dark:bg-red-900/30 flex items-center justify-center active:scale-90 border border-red-200 dark:border-red-800",onClick:re=>{re.stopPropagation(),ke(R.name)},onTouchEnd:ut(()=>ke(R.name)),children:n.jsx(Or,{className:"w-4 h-4 text-red-600 dark:text-red-400"})}),n.jsx("button",{className:"w-8 h-8 rounded-lg bg-primary/10 dark:bg-primary/20 flex items-center justify-center active:scale-90 border border-primary/20 dark:border-primary/30",onClick:re=>{re.stopPropagation(),ie(R)},onTouchEnd:ut(()=>ie(R)),children:n.jsx(Po,{className:"w-4 h-4 text-primary"})}),n.jsx("div",{className:"w-6 h-6 rounded-md bg-muted/30 flex items-center justify-center",children:Q?n.jsx(Ar,{className:"w-3 h-3 text-muted-foreground"}):n.jsx(cn,{className:"w-3 h-3 text-muted-foreground"})})]})})]})})}),n.jsxs(Xe,{variant:"ghost",className:Ue("hidden md:flex w-full justify-between p-2 h-auto font-normal hover:bg-accent/50",be&&"bg-accent text-accent-foreground",je&&!be&&"bg-yellow-50/50 dark:bg-yellow-900/10 hover:bg-yellow-100/50 dark:hover:bg-yellow-900/20"),onClick:()=>{t?.name!==R.name&&ce(R),jt(R.name)},onTouchEnd:ut(()=>{t?.name!==R.name&&ce(R),jt(R.name)}),children:[n.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[Q?n.jsx(Jn,{className:"w-4 h-4 text-primary flex-shrink-0"}):n.jsx(En,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),n.jsx("div",{className:"min-w-0 flex-1 text-left",children:U===R.name?n.jsxs("div",{className:"space-y-1",children:[n.jsx("input",{type:"text",value:W,onChange:re=>M(re.target.value),className:"w-full px-2 py-1 text-sm border border-border rounded bg-background text-foreground focus:ring-2 focus:ring-primary/20",placeholder:"Project name",autoFocus:!0,onKeyDown:re=>{re.key==="Enter"&&B(R.name),re.key==="Escape"&&Se()}}),n.jsx("div",{className:"text-xs text-muted-foreground truncate",title:R.fullPath,children:R.fullPath})]}):n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-semibold truncate text-foreground",title:R.displayName,children:R.displayName}),n.jsxs("div",{className:"text-xs text-muted-foreground",children:[(()=>{const re=St(R).length;return R.sessionMeta?.hasMore!==!1&&re>=5?`${re}+`:re})(),R.fullPath!==R.displayName&&n.jsxs("span",{className:"ml-1 opacity-60",title:R.fullPath,children:["• ",R.fullPath.length>25?"..."+R.fullPath.slice(-22):R.fullPath]})]})]})})]}),n.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:U===R.name?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"w-6 h-6 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-900/20 flex items-center justify-center rounded cursor-pointer transition-colors",onClick:re=>{re.stopPropagation(),B(R.name)},children:n.jsx(ln,{className:"w-3 h-3"})}),n.jsx("div",{className:"w-6 h-6 text-gray-500 hover:text-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800 flex items-center justify-center rounded cursor-pointer transition-colors",onClick:re=>{re.stopPropagation(),Se()},children:n.jsx(Mt,{className:"w-3 h-3"})})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:Ue("w-6 h-6 opacity-0 group-hover:opacity-100 transition-all duration-200 flex items-center justify-center rounded cursor-pointer touch:opacity-100",je?"hover:bg-yellow-50 dark:hover:bg-yellow-900/20 opacity-100":"hover:bg-accent"),onClick:re=>{re.stopPropagation(),qe(R.name)},title:je?"Remove from favorites":"Add to favorites",children:n.jsx(H0,{className:Ue("w-3 h-3 transition-colors",je?"text-yellow-600 dark:text-yellow-400 fill-current":"text-muted-foreground")})}),n.jsx("div",{className:"w-6 h-6 opacity-0 group-hover:opacity-100 transition-all duration-200 hover:bg-accent flex items-center justify-center rounded cursor-pointer touch:opacity-100",onClick:re=>{re.stopPropagation(),ie(R)},title:"Rename project (F2)",children:n.jsx(Po,{className:"w-3 h-3"})}),St(R).length===0&&n.jsx("div",{className:"w-6 h-6 opacity-0 group-hover:opacity-100 transition-all duration-200 hover:bg-red-50 dark:hover:bg-red-900/20 flex items-center justify-center rounded cursor-pointer touch:opacity-100",onClick:re=>{re.stopPropagation(),ke(R.name)},title:"Delete empty project (Delete)",children:n.jsx(Or,{className:"w-3 h-3 text-red-600 dark:text-red-400"})}),Q?n.jsx(Ar,{className:"w-4 h-4 text-muted-foreground group-hover:text-foreground transition-colors"}):n.jsx(cn,{className:"w-4 h-4 text-muted-foreground group-hover:text-foreground transition-colors"})]})})]})]}),Q&&n.jsxs("div",{className:"ml-3 space-y-1 border-l border-border pl-3",children:[Y.has(R.name)?St(R).length===0&&!_[R.name]?n.jsx("div",{className:"py-2 px-3 text-left",children:n.jsx("p",{className:"text-xs text-muted-foreground",children:"No sessions yet"})}):St(R).map(re=>{const Me=re.__provider==="cursor",pt=new Date(Me?re.createdAt:re.lastActivity),zt=Math.floor((he-pt)/(1e3*60))<10,Kt=Me?re.name||"Untitled Session":re.summary||"New Session",Lr=Me?re.createdAt:re.lastActivity,_r=re.messageCount||0;return n.jsxs("div",{className:"group relative",children:[zt&&n.jsx("div",{className:"absolute left-0 top-1/2 transform -translate-y-1/2 -translate-x-1",children:n.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})}),n.jsx("div",{className:"md:hidden",children:n.jsx("div",{className:Ue("p-2 mx-3 my-0.5 rounded-md bg-card border active:scale-[0.98] transition-all duration-150 relative",r?.id===re.id?"bg-primary/5 border-primary/20":zt?"border-green-500/30 bg-green-50/5 dark:bg-green-900/5":"border-border/30"),onClick:()=>{ce(R),lt(re,R.name)},onTouchEnd:ut(()=>{ce(R),lt(re,R.name)}),children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:Ue("w-5 h-5 rounded-md flex items-center justify-center flex-shrink-0",r?.id===re.id?"bg-primary/10":"bg-muted/50"),children:Me?n.jsx(on,{className:"w-3 h-3"}):n.jsx(Wr,{className:"w-3 h-3"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-xs font-medium truncate text-foreground",children:Kt}),n.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[n.jsx(Ya,{className:"w-2.5 h-2.5 text-muted-foreground"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:Y0(Lr,he)}),_r>0&&n.jsx(Yn,{variant:"secondary",className:"text-xs px-1 py-0 ml-auto",children:_r}),n.jsx("span",{className:"ml-1 opacity-70",children:Me?n.jsx(on,{className:"w-3 h-3"}):n.jsx(Wr,{className:"w-3 h-3"})})]})]}),!Me&&n.jsx("button",{className:"w-5 h-5 rounded-md bg-red-50 dark:bg-red-900/20 flex items-center justify-center active:scale-95 transition-transform opacity-70 ml-1",onClick:Nt=>{Nt.stopPropagation(),K(R.name,re.id)},onTouchEnd:ut(()=>K(R.name,re.id)),children:n.jsx(Or,{className:"w-2.5 h-2.5 text-red-600 dark:text-red-400"})})]})})}),n.jsxs("div",{className:"hidden md:block",children:[n.jsx(Xe,{variant:"ghost",className:Ue("w-full justify-start p-2 h-auto font-normal text-left hover:bg-accent/50 transition-colors duration-200",r?.id===re.id&&"bg-accent text-accent-foreground"),onClick:()=>lt(re,R.name),onTouchEnd:ut(()=>lt(re,R.name)),children:n.jsxs("div",{className:"flex items-start gap-2 min-w-0 w-full",children:[Me?n.jsx(on,{className:"w-3 h-3 mt-0.5 flex-shrink-0"}):n.jsx(Wr,{className:"w-3 h-3 mt-0.5 flex-shrink-0"}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-xs font-medium truncate text-foreground",children:Kt}),n.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[n.jsx(Ya,{className:"w-2.5 h-2.5 text-muted-foreground"}),n.jsx("span",{className:"text-xs text-muted-foreground",children:Y0(Lr,he)}),_r>0&&n.jsx(Yn,{variant:"secondary",className:"text-xs px-1 py-0 ml-auto",children:_r}),n.jsx("span",{className:"ml-1 opacity-70",children:Me?n.jsx(on,{className:"w-3 h-3"}):n.jsx(Wr,{className:"w-3 h-3"})})]})]})]})}),!Me&&n.jsx("div",{className:"absolute right-2 top-1/2 transform -translate-y-1/2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-all duration-200",children:A===re.id?n.jsxs(n.Fragment,{children:[n.jsx("input",{type:"text",value:Ce,onChange:Nt=>De(Nt.target.value),onKeyDown:Nt=>{Nt.stopPropagation(),Nt.key==="Enter"?updateSessionSummary(R.name,re.id,Ce):Nt.key==="Escape"&&(te(null),De(""))},onClick:Nt=>Nt.stopPropagation(),className:"w-32 px-2 py-1 text-xs border border-border rounded bg-background focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),n.jsx("button",{className:"w-6 h-6 bg-green-50 hover:bg-green-100 dark:bg-green-900/20 dark:hover:bg-green-900/40 rounded flex items-center justify-center",onClick:Nt=>{Nt.stopPropagation(),updateSessionSummary(R.name,re.id,Ce)},title:"Save",children:n.jsx(ln,{className:"w-3 h-3 text-green-600 dark:text-green-400"})}),n.jsx("button",{className:"w-6 h-6 bg-gray-50 hover:bg-gray-100 dark:bg-gray-900/20 dark:hover:bg-gray-900/40 rounded flex items-center justify-center",onClick:Nt=>{Nt.stopPropagation(),te(null),De("")},title:"Cancel",children:n.jsx(Mt,{className:"w-3 h-3 text-gray-600 dark:text-gray-400"})})]}):n.jsxs(n.Fragment,{children:[n.jsx("button",{className:"w-6 h-6 bg-gray-50 hover:bg-gray-100 dark:bg-gray-900/20 dark:hover:bg-gray-900/40 rounded flex items-center justify-center",onClick:Nt=>{Nt.stopPropagation(),te(re.id),De(re.summary||"New Session")},title:"Manually edit session name",children:n.jsx(u1,{className:"w-3 h-3 text-gray-600 dark:text-gray-400"})}),n.jsx("button",{className:"w-6 h-6 bg-red-50 hover:bg-red-100 dark:bg-red-900/20 dark:hover:bg-red-900/40 rounded flex items-center justify-center",onClick:Nt=>{Nt.stopPropagation(),K(R.name,re.id)},title:"Delete this session permanently",children:n.jsx(Or,{className:"w-3 h-3 text-red-600 dark:text-red-400"})})]})})]})]},re.id)}):Array.from({length:3}).map((re,Me)=>n.jsx("div",{className:"p-2 rounded-md",children:n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsx("div",{className:"w-3 h-3 bg-muted rounded-full animate-pulse mt-0.5"}),n.jsxs("div",{className:"flex-1 space-y-1",children:[n.jsx("div",{className:"h-3 bg-muted rounded animate-pulse",style:{width:`${60+Me*15}%`}}),n.jsx("div",{className:"h-2 bg-muted rounded animate-pulse w-1/2"})]})]})},Me)),St(R).length>0&&R.sessionMeta?.hasMore!==!1&&n.jsx(Xe,{variant:"ghost",size:"sm",className:"w-full justify-center gap-2 mt-2 text-muted-foreground",onClick:()=>We(R),disabled:_[R.name],children:_[R.name]?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"w-3 h-3 animate-spin rounded-full border border-muted-foreground border-t-transparent"}),"Loading..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Ar,{className:"w-3 h-3"}),"Show more sessions"]})}),n.jsx("div",{className:"md:hidden px-3 pb-2",children:n.jsxs("button",{className:"w-full h-8 bg-primary hover:bg-primary/90 text-primary-foreground rounded-md flex items-center justify-center gap-2 font-medium text-xs active:scale-[0.98] transition-all duration-150",onClick:()=>{ce(R),i(R)},children:[n.jsx(nr,{className:"w-3 h-3"}),"New Session"]})}),n.jsxs(Xe,{variant:"default",size:"sm",className:"hidden md:flex w-full justify-start gap-2 mt-1 h-8 text-xs font-medium bg-primary hover:bg-primary/90 text-primary-foreground transition-colors",onClick:()=>i(R),children:[n.jsx(nr,{className:"w-3 h-3"}),"New Session"]})]})]},R.name)})})}),m&&n.jsxs("div",{className:"md:p-2 border-t border-border/50 flex-shrink-0",children:[n.jsx("div",{className:"hidden md:block",children:n.jsxs(Xe,{variant:"ghost",className:"w-full justify-start gap-3 p-3 h-auto font-normal text-left hover:bg-blue-50 dark:hover:bg-blue-900/20 transition-colors duration-200 border border-blue-200 dark:border-blue-700 rounded-lg mb-2",onClick:y,children:[n.jsxs("div",{className:"relative",children:[n.jsx("svg",{className:"w-4 h-4 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"})}),n.jsx("div",{className:"absolute -top-1 -right-1 w-2 h-2 bg-blue-500 rounded-full animate-pulse"})]}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("div",{className:"text-sm font-medium text-blue-700 dark:text-blue-300",children:x?.title||`Version ${h}`}),n.jsx("div",{className:"text-xs text-blue-600 dark:text-blue-400",children:"Update available"})]})]})}),n.jsx("div",{className:"md:hidden p-3 pb-2",children:n.jsxs("button",{className:"w-full h-12 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-700 rounded-xl flex items-center justify-start gap-3 px-4 active:scale-[0.98] transition-all duration-150",onClick:y,children:[n.jsxs("div",{className:"relative",children:[n.jsx("svg",{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"})}),n.jsx("div",{className:"absolute -top-1 -right-1 w-2 h-2 bg-blue-500 rounded-full animate-pulse"})]}),n.jsxs("div",{className:"min-w-0 flex-1 text-left",children:[n.jsx("div",{className:"text-sm font-medium text-blue-700 dark:text-blue-300",children:x?.title||`Version ${h}`}),n.jsx("div",{className:"text-xs text-blue-600 dark:text-blue-400",children:"Update available"})]})]})})]}),n.jsxs("div",{className:"md:p-2 md:border-t md:border-border flex-shrink-0",children:[n.jsx("div",{className:"md:hidden p-4 pb-20 border-t border-border/50",children:n.jsxs("button",{className:"w-full h-14 bg-muted/50 hover:bg-muted/70 rounded-2xl flex items-center justify-start gap-4 px-4 active:scale-[0.98] transition-all duration-150",onClick:u,children:[n.jsx("div",{className:"w-10 h-10 rounded-2xl bg-background/80 flex items-center justify-center",children:n.jsx(Qn,{className:"w-5 h-5 text-muted-foreground"})}),n.jsx("span",{className:"text-lg font-medium text-foreground",children:"Settings"})]})}),n.jsxs(Xe,{variant:"ghost",className:"hidden md:flex w-full justify-start gap-2 p-2 h-auto font-normal text-muted-foreground hover:text-foreground hover:bg-accent transition-colors duration-200",onClick:u,children:[n.jsx(Qn,{className:"w-3 h-3"}),n.jsx("span",{className:"text-xs",children:"Settings"})]})]})]})]})}function Q0(e){const t=[],r=String(e||"");let a=r.indexOf(","),s=0,i=!1;for(;!i;){a===-1&&(a=r.length,i=!0);const o=r.slice(s,a).trim();(o||!i)&&t.push(o),s=a+1,a=r.indexOf(",",s)}return t}function Tx(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Ex=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ix=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Dx={};function Z0(e,t){return(Dx.jsx?Ix:Ex).test(e)}const zx=/[ \t\n\f\r]/g;function Lx(e){return typeof e=="object"?e.type==="text"?ec(e.value):!1:ec(e)}function ec(e){return e.replace(zx,"")===""}class ds{constructor(t,r,a){this.normal=r,this.property=t,a&&(this.space=a)}}ds.prototype.normal={};ds.prototype.property={};ds.prototype.space=void 0;function em(e,t){const r={},a={};for(const s of e)Object.assign(r,s.property),Object.assign(a,s.normal);return new ds(r,a,t)}function Qa(e){return e.toLowerCase()}class fr{constructor(t,r){this.attribute=r,this.property=t}}fr.prototype.attribute="";fr.prototype.booleanish=!1;fr.prototype.boolean=!1;fr.prototype.commaOrSpaceSeparated=!1;fr.prototype.commaSeparated=!1;fr.prototype.defined=!1;fr.prototype.mustUseProperty=!1;fr.prototype.number=!1;fr.prototype.overloadedBoolean=!1;fr.prototype.property="";fr.prototype.spaceSeparated=!1;fr.prototype.space=void 0;let Px=0;const it=ta(),Ht=ta(),_o=ta(),ye=ta(),It=ta(),ha=ta(),xr=ta();function ta(){return 2**++Px}const qo=Object.freeze(Object.defineProperty({__proto__:null,boolean:it,booleanish:Ht,commaOrSpaceSeparated:xr,commaSeparated:ha,number:ye,overloadedBoolean:_o,spaceSeparated:It},Symbol.toStringTag,{value:"Module"})),_i=Object.keys(qo);class Dl extends fr{constructor(t,r,a,s){let i=-1;if(super(t,r),tc(this,"space",s),typeof a=="number")for(;++i<_i.length;){const o=_i[i];tc(this,_i[i],(a&qo[o])===qo[o])}}}Dl.prototype.defined=!0;function tc(e,t,r){r&&(e[t]=r)}function Ma(e){const t={},r={};for(const[a,s]of Object.entries(e.properties)){const i=new Dl(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(i.mustUseProperty=!0),t[a]=i,r[Qa(a)]=a,r[Qa(i.attribute)]=a}return new ds(t,r,e.space)}const tm=Ma({properties:{ariaActiveDescendant:null,ariaAtomic:Ht,ariaAutoComplete:null,ariaBusy:Ht,ariaChecked:Ht,ariaColCount:ye,ariaColIndex:ye,ariaColSpan:ye,ariaControls:It,ariaCurrent:null,ariaDescribedBy:It,ariaDetails:null,ariaDisabled:Ht,ariaDropEffect:It,ariaErrorMessage:null,ariaExpanded:Ht,ariaFlowTo:It,ariaGrabbed:Ht,ariaHasPopup:null,ariaHidden:Ht,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:It,ariaLevel:ye,ariaLive:null,ariaModal:Ht,ariaMultiLine:Ht,ariaMultiSelectable:Ht,ariaOrientation:null,ariaOwns:It,ariaPlaceholder:null,ariaPosInSet:ye,ariaPressed:Ht,ariaReadOnly:Ht,ariaRelevant:null,ariaRequired:Ht,ariaRoleDescription:It,ariaRowCount:ye,ariaRowIndex:ye,ariaRowSpan:ye,ariaSelected:Ht,ariaSetSize:ye,ariaSort:null,ariaValueMax:ye,ariaValueMin:ye,ariaValueNow:ye,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function rm(e,t){return t in e?e[t]:t}function nm(e,t){return rm(e,t.toLowerCase())}const Rx=Ma({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ha,acceptCharset:It,accessKey:It,action:null,allow:null,allowFullScreen:it,allowPaymentRequest:it,allowUserMedia:it,alt:null,as:null,async:it,autoCapitalize:null,autoComplete:It,autoFocus:it,autoPlay:it,blocking:It,capture:null,charSet:null,checked:it,cite:null,className:It,cols:ye,colSpan:null,content:null,contentEditable:Ht,controls:it,controlsList:It,coords:ye|ha,crossOrigin:null,data:null,dateTime:null,decoding:null,default:it,defer:it,dir:null,dirName:null,disabled:it,download:_o,draggable:Ht,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:it,formTarget:null,headers:It,height:ye,hidden:_o,high:ye,href:null,hrefLang:null,htmlFor:It,httpEquiv:It,id:null,imageSizes:null,imageSrcSet:null,inert:it,inputMode:null,integrity:null,is:null,isMap:it,itemId:null,itemProp:It,itemRef:It,itemScope:it,itemType:It,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:it,low:ye,manifest:null,max:null,maxLength:ye,media:null,method:null,min:null,minLength:ye,multiple:it,muted:it,name:null,nonce:null,noModule:it,noValidate:it,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:it,optimum:ye,pattern:null,ping:It,placeholder:null,playsInline:it,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:it,referrerPolicy:null,rel:It,required:it,reversed:it,rows:ye,rowSpan:ye,sandbox:It,scope:null,scoped:it,seamless:it,selected:it,shadowRootClonable:it,shadowRootDelegatesFocus:it,shadowRootMode:null,shape:null,size:ye,sizes:null,slot:null,span:ye,spellCheck:Ht,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ye,step:null,style:null,tabIndex:ye,target:null,title:null,translate:null,type:null,typeMustMatch:it,useMap:null,value:Ht,width:ye,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:It,axis:null,background:null,bgColor:null,border:ye,borderColor:null,bottomMargin:ye,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:it,declare:it,event:null,face:null,frame:null,frameBorder:null,hSpace:ye,leftMargin:ye,link:null,longDesc:null,lowSrc:null,marginHeight:ye,marginWidth:ye,noResize:it,noHref:it,noShade:it,noWrap:it,object:null,profile:null,prompt:null,rev:null,rightMargin:ye,rules:null,scheme:null,scrolling:Ht,standby:null,summary:null,text:null,topMargin:ye,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ye,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:it,disableRemotePlayback:it,prefix:null,property:null,results:ye,security:null,unselectable:null},space:"html",transform:nm}),Fx=Ma({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"},properties:{about:xr,accentHeight:ye,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ye,amplitude:ye,arabicForm:null,ascent:ye,attributeName:null,attributeType:null,azimuth:ye,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ye,by:null,calcMode:null,capHeight:ye,className:It,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:ye,diffuseConstant:ye,direction:null,display:null,dur:null,divisor:ye,dominantBaseline:null,download:it,dx:null,dy:null,edgeMode:null,editable:null,elevation:ye,enableBackground:null,end:null,event:null,exponent:ye,externalResourcesRequired:null,fill:null,fillOpacity:ye,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:ha,g2:ha,glyphName:ha,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ye,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ye,horizOriginX:ye,horizOriginY:ye,id:null,ideographic:ye,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ye,k:ye,k1:ye,k2:ye,k3:ye,k4:ye,kernelMatrix:xr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ye,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:ye,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:ye,overlineThickness:ye,paintOrder:null,panose1:null,path:null,pathLength:ye,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:It,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ye,pointsAtY:ye,pointsAtZ:ye,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xr,rev:xr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xr,requiredFeatures:xr,requiredFonts:xr,requiredFormats:xr,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:ye,specularExponent:ye,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ye,strikethroughThickness:ye,string:null,stroke:null,strokeDashArray:xr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ye,strokeOpacity:ye,strokeWidth:null,style:null,surfaceScale:ye,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xr,tabIndex:ye,tableValues:null,target:null,targetX:ye,targetY:ye,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ye,underlineThickness:ye,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ye,values:null,vAlphabetic:ye,vMathematical:ye,vectorEffect:null,vHanging:ye,vIdeographic:ye,version:null,vertAdvY:ye,vertOriginX:ye,vertOriginY:ye,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ye,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:rm}),am=Ma({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),sm=Ma({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nm}),im=Ma({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Bx={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"},Ox=/[A-Z]/g,rc=/-[a-z]/g,$x=/^data[-\w.:]+$/i;function om(e,t){const r=Qa(t);let a=t,s=fr;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&$x.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(rc,qx);a="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!rc.test(i)){let o=i.replace(Ox,_x);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Dl}return new s(a,t)}function _x(e){return"-"+e.toLowerCase()}function qx(e){return e.charAt(1).toUpperCase()}const lm=em([tm,Rx,am,sm,im],"html"),bi=em([tm,Fx,am,sm,im],"svg");function nc(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Hx(e){return e.join(" ").trim()}var oa={},qi,ac;function Ux(){if(ac)return qi;ac=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
|
|
387
|
-
`,d="/",u="*",m="",h="comment",p="declaration";qi=function(y,k){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];k=k||{};var w=1,j=1;function N(V){var T=V.match(t);T&&(w+=T.length);var Y=V.lastIndexOf(c);j=~Y?V.length-Y:j+V.length}function L(){var V={line:w,column:j};return function(T){return T.position=new U(V),F(),T}}function U(V){this.start=V,this.end={line:w,column:j},this.source=k.source}U.prototype.content=y;function I(V){var T=new Error(k.source+":"+w+":"+j+": "+V);if(T.reason=V,T.filename=k.source,T.line=w,T.column=j,T.source=y,!k.silent)throw T}function H(V){var T=V.exec(y);if(T){var Y=T[0];return N(Y),y=y.slice(Y.length),T}}function F(){H(r)}function W(V){var T;for(V=V||[];T=M();)T!==!1&&V.push(T);return V}function M(){var V=L();if(!(d!=y.charAt(0)||u!=y.charAt(1))){for(var T=2;m!=y.charAt(T)&&(u!=y.charAt(T)||d!=y.charAt(T+1));)++T;if(T+=2,m===y.charAt(T-1))return I("End of comment missing");var Y=y.slice(2,T-2);return j+=2,N(Y),y=y.slice(T),j+=2,V({type:h,comment:Y})}}function _(){var V=L(),T=H(a);if(T){if(M(),!H(s))return I("property missing ':'");var Y=H(i),ne=V({type:p,property:x(T[0].replace(e,m)),value:Y?x(Y[0].replace(e,m)):m});return H(o),ne}}function O(){var V=[];W(V);for(var T;T=_();)T!==!1&&(V.push(T),W(V));return V}return F(),O()};function x(y){return y?y.replace(l,m):m}return qi}var sc;function Wx(){if(sc)return oa;sc=1;var e=oa&&oa.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(oa,"__esModule",{value:!0}),oa.default=r;var t=e(Ux());function r(a,s){var i=null;if(!a||typeof a!="string")return i;var o=(0,t.default)(a),l=typeof s=="function";return o.forEach(function(c){if(c.type==="declaration"){var d=c.property,u=c.value;l?s(d,u,c):u&&(i=i||{},i[d]=u)}}),i}return oa}var Ra={},ic;function Vx(){if(ic)return Ra;ic=1,Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(d){return!d||r.test(d)||e.test(d)},o=function(d,u){return u.toUpperCase()},l=function(d,u){return"".concat(u,"-")},c=function(d,u){return u===void 0&&(u={}),i(d)?d:(d=d.toLowerCase(),u.reactCompat?d=d.replace(s,l):d=d.replace(a,l),d.replace(t,o))};return Ra.camelCase=c,Ra}var Fa,oc;function Gx(){if(oc)return Fa;oc=1;var e=Fa&&Fa.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Wx()),r=Vx();function a(s,i){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(l,c){l&&c&&(o[(0,r.camelCase)(l,i)]=c)}),o}return a.default=a,Fa=a,Fa}var Kx=Gx();const Jx=ss(Kx),cm=dm("end"),zl=dm("start");function dm(e){return t;function t(r){const a=r&&r.position&&r.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Yx(e){const t=zl(e),r=cm(e);if(t&&r)return{start:t,end:r}}function Va(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?lc(e.position):"start"in e||"end"in e?lc(e):"line"in e||"column"in e?Ho(e):""}function Ho(e){return cc(e&&e.line)+":"+cc(e&&e.column)}function lc(e){return Ho(e&&e.start)+"-"+Ho(e&&e.end)}function cc(e){return e&&typeof e=="number"?e:1}class er extends Error{constructor(t,r,a){super(),typeof r=="string"&&(a=r,r=void 0);let s="",i={},o=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof t=="string"?s=t:!i.cause&&t&&(o=!0,s=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof a=="string"){const c=a.indexOf(":");c===-1?i.ruleId=a:(i.source=a.slice(0,c),i.ruleId=a.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=s,this.line=l?l.line:void 0,this.name=Va(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}er.prototype.file="";er.prototype.name="";er.prototype.reason="";er.prototype.message="";er.prototype.stack="";er.prototype.column=void 0;er.prototype.line=void 0;er.prototype.ancestors=void 0;er.prototype.cause=void 0;er.prototype.fatal=void 0;er.prototype.place=void 0;er.prototype.ruleId=void 0;er.prototype.source=void 0;const Ll={}.hasOwnProperty,Xx=new Map,Qx=/[A-Z]/g,Zx=new Set(["table","tbody","thead","tfoot","tr"]),e2=new Set(["td","th"]),um="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function t2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=c2(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=l2(r,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?bi:lm,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=mm(s,e,void 0);return i&&typeof i!="string"?i:s.create(e,s.Fragment,{children:i||void 0},void 0)}function mm(e,t,r){if(t.type==="element")return r2(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return n2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return s2(e,t,r);if(t.type==="mdxjsEsm")return a2(e,t);if(t.type==="root")return i2(e,t,r);if(t.type==="text")return o2(e,t)}function r2(e,t,r){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=bi,e.schema=s),e.ancestors.push(t);const i=pm(e,t.tagName,!1),o=d2(e,t);let l=Rl(e,t);return Zx.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Lx(c):!0})),hm(e,o,i,t),Pl(o,l),e.ancestors.pop(),e.schema=a,e.create(t,i,o,r)}function n2(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}Za(e,t.position)}function a2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Za(e,t.position)}function s2(e,t,r){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=bi,e.schema=s),e.ancestors.push(t);const i=t.name===null?e.Fragment:pm(e,t.name,!0),o=u2(e,t),l=Rl(e,t);return hm(e,o,i,t),Pl(o,l),e.ancestors.pop(),e.schema=a,e.create(t,i,o,r)}function i2(e,t,r){const a={};return Pl(a,Rl(e,t)),e.create(t,e.Fragment,a,r)}function o2(e,t){return t.value}function hm(e,t,r,a){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=a)}function Pl(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function l2(e,t,r){return a;function a(s,i,o,l){const d=Array.isArray(o.children)?r:t;return l?d(i,o,l):d(i,o)}}function c2(e,t){return r;function r(a,s,i,o){const l=Array.isArray(i.children),c=zl(a);return t(s,i,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function d2(e,t){const r={};let a,s;for(s in t.properties)if(s!=="children"&&Ll.call(t.properties,s)){const i=m2(e,s,t.properties[s]);if(i){const[o,l]=i;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&e2.has(t.tagName)?a=l:r[o]=l}}if(a){const i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return r}function u2(e,t){const r={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const i=a.data.estree.body[0];i.type;const o=i.expression;o.type;const l=o.properties[0];l.type,Object.assign(r,e.evaluater.evaluateExpression(l.argument))}else Za(e,t.position);else{const s=a.name;let i;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const l=a.value.data.estree.body[0];l.type,i=e.evaluater.evaluateExpression(l.expression)}else Za(e,t.position);else i=a.value===null?!0:a.value;r[s]=i}return r}function Rl(e,t){const r=[];let a=-1;const s=e.passKeys?new Map:Xx;for(;++a<t.children.length;){const i=t.children[a];let o;if(e.passKeys){const c=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(c){const d=s.get(c)||0;o=c+"-"+d,s.set(c,d+1)}}const l=mm(e,i,o);l!==void 0&&r.push(l)}return r}function m2(e,t,r){const a=om(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=a.commaSeparated?Tx(r):Hx(r)),a.property==="style"){let s=typeof r=="object"?r:h2(e,String(r));return e.stylePropertyNameCase==="css"&&(s=p2(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?Bx[a.property]||a.property:a.attribute,r]}}function h2(e,t){try{return Jx(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const a=r,s=new er("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=um+"#cannot-parse-style-attribute",s}}function pm(e,t,r){let a;if(!r)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let i=-1,o;for(;++i<s.length;){const l=Z0(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(i&&l.type==="Literal"),optional:!1}:l}a=o}else a=Z0(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return Ll.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);Za(e)}function Za(e,t){const r=new er("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=um+"#cannot-handle-mdx-estrees-without-createevaluater",r}function p2(e){const t={};let r;for(r in e)Ll.call(e,r)&&(t[f2(r)]=e[r]);return t}function f2(e){let t=e.replace(Qx,g2);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function g2(e){return"-"+e.toLowerCase()}const Hi={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"]},x2={};function Fl(e,t){const r=x2,a=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,s=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return fm(e,a,s)}function fm(e,t,r){if(b2(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return dc(e.children,t,r)}return Array.isArray(e)?dc(e,t,r):""}function dc(e,t,r){const a=[];let s=-1;for(;++s<e.length;)a[s]=fm(e[s],t,r);return a.join("")}function b2(e){return!!(e&&typeof e=="object")}const uc=document.createElement("i");function Bl(e){const t="&"+e+";";uc.innerHTML=t;const r=uc.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function kr(e,t,r,a){const s=e.length;let i=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,r=r>0?r:0,a.length<1e4)o=Array.from(a),o.unshift(t,r),e.splice(...o);else for(r&&e.splice(t,r);i<a.length;)o=a.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}function Mr(e,t){return e.length>0?(kr(e,e.length,0,t),e):t}const mc={}.hasOwnProperty;function gm(e){const t={};let r=-1;for(;++r<e.length;)y2(t,e[r]);return t}function y2(e,t){let r;for(r in t){const s=(mc.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r];let o;if(i)for(o in i){mc.call(s,o)||(s[o]=[]);const l=i[o];v2(s[o],Array.isArray(l)?l:l?[l]:[])}}}function v2(e,t){let r=-1;const a=[];for(;++r<t.length;)(t[r].add==="after"?e:a).push(t[r]);kr(e,0,0,a)}function xm(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function $r(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ar=Rn(/[A-Za-z]/),Zt=Rn(/[\dA-Za-z]/),k2=Rn(/[#-'*+\--9=?A-Z^-~]/);function ei(e){return e!==null&&(e<32||e===127)}const Uo=Rn(/\d/),w2=Rn(/[\dA-Fa-f]/),j2=Rn(/[!-/:-@[-`{-~]/);function $e(e){return e!==null&&e<-2}function At(e){return e!==null&&(e<0||e===32)}function gt(e){return e===-2||e===-1||e===32}const yi=Rn(new RegExp("\\p{P}|\\p{S}","u")),Zn=Rn(/\s/);function Rn(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Aa(e){const t=[];let r=-1,a=0,s=0;for(;++r<e.length;){const i=e.charCodeAt(r);let o="";if(i===37&&Zt(e.charCodeAt(r+1))&&Zt(e.charCodeAt(r+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const l=e.charCodeAt(r+1);i<56320&&l>56319&&l<57344?(o=String.fromCharCode(i,l),s=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(a,r),encodeURIComponent(o)),a=r+s+1,o=""),s&&(r+=s,s=0)}return t.join("")+e.slice(a)}function ht(e,t,r,a){const s=a?a-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(c){return gt(c)?(e.enter(r),l(c)):t(c)}function l(c){return gt(c)&&i++<s?(e.consume(c),l):(e.exit(r),t(c))}}const N2={tokenize:S2};function S2(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let r;return t;function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ht(e,t,"linePrefix")}function s(l){return e.enter("paragraph"),i(l)}function i(l){const c=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=c),r=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return $e(l)?(e.consume(l),e.exit("chunkText"),i):(e.consume(l),o)}}const C2={tokenize:M2},hc={tokenize:A2};function M2(e){const t=this,r=[];let a=0,s,i,o;return l;function l(N){if(a<r.length){const L=r[a];return t.containerState=L[1],e.attempt(L[0].continuation,c,d)(N)}return d(N)}function c(N){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&j();const L=t.events.length;let U=L,I;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){I=t.events[U][1].end;break}w(a);let H=L;for(;H<t.events.length;)t.events[H][1].end={...I},H++;return kr(t.events,U+1,0,t.events.slice(L)),t.events.length=H,d(N)}return l(N)}function d(N){if(a===r.length){if(!s)return h(N);if(s.currentConstruct&&s.currentConstruct.concrete)return x(N);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(hc,u,m)(N)}function u(N){return s&&j(),w(a),h(N)}function m(N){return t.parser.lazy[t.now().line]=a!==r.length,o=t.now().offset,x(N)}function h(N){return t.containerState={},e.attempt(hc,p,x)(N)}function p(N){return a++,r.push([t.currentConstruct,t.containerState]),h(N)}function x(N){if(N===null){s&&j(),w(0),e.consume(N);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),y(N)}function y(N){if(N===null){k(e.exit("chunkFlow"),!0),w(0),e.consume(N);return}return $e(N)?(e.consume(N),k(e.exit("chunkFlow")),a=0,t.interrupt=void 0,l):(e.consume(N),y)}function k(N,L){const U=t.sliceStream(N);if(L&&U.push(null),N.previous=i,i&&(i.next=N),i=N,s.defineSkip(N.start),s.write(U),t.parser.lazy[N.start.line]){let I=s.events.length;for(;I--;)if(s.events[I][1].start.offset<o&&(!s.events[I][1].end||s.events[I][1].end.offset>o))return;const H=t.events.length;let F=H,W,M;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(W){M=t.events[F][1].end;break}W=!0}for(w(a),I=H;I<t.events.length;)t.events[I][1].end={...M},I++;kr(t.events,F+1,0,t.events.slice(H)),t.events.length=I}}function w(N){let L=r.length;for(;L-- >N;){const U=r[L];t.containerState=U[1],U[0].exit.call(t,e)}r.length=N}function j(){s.write([null]),i=void 0,s=void 0,t.containerState._closeFlow=void 0}}function A2(e,t,r){return ht(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ya(e){if(e===null||At(e)||Zn(e))return 1;if(yi(e))return 2}function vi(e,t,r){const a=[];let s=-1;for(;++s<e.length;){const i=e[s].resolveAll;i&&!a.includes(i)&&(t=i(t,r),a.push(i))}return t}const Wo={name:"attention",resolveAll:T2,tokenize:E2};function T2(e,t){let r=-1,a,s,i,o,l,c,d,u;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(a=r;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[a][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;c=e[a][1].end.offset-e[a][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const m={...e[a][1].end},h={...e[r][1].start};pc(m,-c),pc(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:m,end:{...e[a][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:h},i={type:c>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[r][1].start}},s={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[a][1].end={...o.start},e[r][1].start={...l.end},d=[],e[a][1].end.offset-e[a][1].start.offset&&(d=Mr(d,[["enter",e[a][1],t],["exit",e[a][1],t]])),d=Mr(d,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",i,t]]),d=Mr(d,vi(t.parser.constructs.insideSpan.null,e.slice(a+1,r),t)),d=Mr(d,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[r][1].end.offset-e[r][1].start.offset?(u=2,d=Mr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])):u=0,kr(e,a-1,r-a+3,d),r=a+d.length-u-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function E2(e,t){const r=this.parser.constructs.attentionMarkers.null,a=this.previous,s=ya(a);let i;return o;function o(c){return i=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===i)return e.consume(c),l;const d=e.exit("attentionSequence"),u=ya(c),m=!u||u===2&&s||r.includes(c),h=!s||s===2&&u||r.includes(a);return d._open=!!(i===42?m:m&&(s||!h)),d._close=!!(i===42?h:h&&(u||!m)),t(c)}}function pc(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const I2={name:"autolink",tokenize:D2};function D2(e,t,r){let a=0;return s;function s(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return ar(p)?(e.consume(p),o):p===64?r(p):d(p)}function o(p){return p===43||p===45||p===46||Zt(p)?(a=1,l(p)):d(p)}function l(p){return p===58?(e.consume(p),a=0,c):(p===43||p===45||p===46||Zt(p))&&a++<32?(e.consume(p),l):(a=0,d(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||ei(p)?r(p):(e.consume(p),c)}function d(p){return p===64?(e.consume(p),u):k2(p)?(e.consume(p),d):r(p)}function u(p){return Zt(p)?m(p):r(p)}function m(p){return p===46?(e.consume(p),a=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||Zt(p))&&a++<63){const x=p===45?h:m;return e.consume(p),x}return r(p)}}const us={partial:!0,tokenize:z2};function z2(e,t,r){return a;function a(i){return gt(i)?ht(e,s,"linePrefix")(i):s(i)}function s(i){return i===null||$e(i)?t(i):r(i)}}const bm={continuation:{tokenize:P2},exit:R2,name:"blockQuote",tokenize:L2};function L2(e,t,r){const a=this;return s;function s(o){if(o===62){const l=a.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),i}return r(o)}function i(o){return gt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function P2(e,t,r){const a=this;return s;function s(o){return gt(o)?ht(e,i,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(bm,t,r)(o)}}function R2(e){e.exit("blockQuote")}const ym={name:"characterEscape",tokenize:F2};function F2(e,t,r){return a;function a(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),s}function s(i){return j2(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(i)}}const vm={name:"characterReference",tokenize:B2};function B2(e,t,r){const a=this;let s=0,i,o;return l;function l(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),c}function c(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),i=31,o=Zt,u(m))}function d(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=w2,u):(e.enter("characterReferenceValue"),i=7,o=Uo,u(m))}function u(m){if(m===59&&s){const h=e.exit("characterReferenceValue");return o===Zt&&!Bl(a.sliceSerialize(h))?r(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&s++<i?(e.consume(m),u):r(m)}}const fc={partial:!0,tokenize:$2},gc={concrete:!0,name:"codeFenced",tokenize:O2};function O2(e,t,r){const a=this,s={partial:!0,tokenize:U};let i=0,o=0,l;return c;function c(I){return d(I)}function d(I){const H=a.events[a.events.length-1];return i=H&&H[1].type==="linePrefix"?H[2].sliceSerialize(H[1],!0).length:0,l=I,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(I)}function u(I){return I===l?(o++,e.consume(I),u):o<3?r(I):(e.exit("codeFencedFenceSequence"),gt(I)?ht(e,m,"whitespace")(I):m(I))}function m(I){return I===null||$e(I)?(e.exit("codeFencedFence"),a.interrupt?t(I):e.check(fc,y,L)(I)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(I))}function h(I){return I===null||$e(I)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(I)):gt(I)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ht(e,p,"whitespace")(I)):I===96&&I===l?r(I):(e.consume(I),h)}function p(I){return I===null||$e(I)?m(I):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(I))}function x(I){return I===null||$e(I)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(I)):I===96&&I===l?r(I):(e.consume(I),x)}function y(I){return e.attempt(s,L,k)(I)}function k(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),w}function w(I){return i>0&>(I)?ht(e,j,"linePrefix",i+1)(I):j(I)}function j(I){return I===null||$e(I)?e.check(fc,y,L)(I):(e.enter("codeFlowValue"),N(I))}function N(I){return I===null||$e(I)?(e.exit("codeFlowValue"),j(I)):(e.consume(I),N)}function L(I){return e.exit("codeFenced"),t(I)}function U(I,H,F){let W=0;return M;function M(Y){return I.enter("lineEnding"),I.consume(Y),I.exit("lineEnding"),_}function _(Y){return I.enter("codeFencedFence"),gt(Y)?ht(I,O,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):O(Y)}function O(Y){return Y===l?(I.enter("codeFencedFenceSequence"),V(Y)):F(Y)}function V(Y){return Y===l?(W++,I.consume(Y),V):W>=o?(I.exit("codeFencedFenceSequence"),gt(Y)?ht(I,T,"whitespace")(Y):T(Y)):F(Y)}function T(Y){return Y===null||$e(Y)?(I.exit("codeFencedFence"),H(Y)):F(Y)}}}function $2(e,t,r){const a=this;return s;function s(o){return o===null?r(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return a.parser.lazy[a.now().line]?r(o):t(o)}}const Ui={name:"codeIndented",tokenize:q2},_2={partial:!0,tokenize:H2};function q2(e,t,r){const a=this;return s;function s(d){return e.enter("codeIndented"),ht(e,i,"linePrefix",5)(d)}function i(d){const u=a.events[a.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(d):r(d)}function o(d){return d===null?c(d):$e(d)?e.attempt(_2,o,c)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||$e(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),l)}function c(d){return e.exit("codeIndented"),t(d)}}function H2(e,t,r){const a=this;return s;function s(o){return a.parser.lazy[a.now().line]?r(o):$e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):ht(e,i,"linePrefix",5)(o)}function i(o){const l=a.events[a.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):$e(o)?s(o):r(o)}}const U2={name:"codeText",previous:V2,resolve:W2,tokenize:G2};function W2(e){let t=e.length-4,r=3,a,s;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=r;++a<t;)if(e[a][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(a=r-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function V2(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function G2(e,t,r){let a=0,s,i;return o;function o(m){return e.enter("codeText"),e.enter("codeTextSequence"),l(m)}function l(m){return m===96?(e.consume(m),a++,l):(e.exit("codeTextSequence"),c(m))}function c(m){return m===null?r(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),c):m===96?(i=e.enter("codeTextSequence"),s=0,u(m)):$e(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||$e(m)?(e.exit("codeTextData"),c(m)):(e.consume(m),d)}function u(m){return m===96?(e.consume(m),s++,u):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(i.type="codeTextData",d(m))}}class K2{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const a=r??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,r,a){const s=r||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&Ba(this.left,a),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ba(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ba(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);Ba(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ba(this.left,r.reverse())}}}function Ba(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function km(e){const t={};let r=-1,a,s,i,o,l,c,d;const u=new K2(e);for(;++r<u.length;){for(;r in t;)r=t[r];if(a=u.get(r),r&&a[1].type==="chunkFlow"&&u.get(r-1)[1].type==="listItemPrefix"&&(c=a[1]._tokenizer.events,i=0,i<c.length&&c[i][1].type==="lineEndingBlank"&&(i+=2),i<c.length&&c[i][1].type==="content"))for(;++i<c.length&&c[i][1].type!=="content";)c[i][1].type==="chunkText"&&(c[i][1]._isInFirstContentOfListItem=!0,i++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,J2(u,r)),r=t[r],d=!0);else if(a[1]._container){for(i=r,s=void 0;i--;)if(o=u.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(u.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=i);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(a[1].end={...u.get(s)[1].start},l=u.slice(s,r),l.unshift(a),u.splice(s,r-s+1,l))}}return kr(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!d}function J2(e,t){const r=e.get(t)[1],a=e.get(t)[2];let s=t-1;const i=[];let o=r._tokenizer;o||(o=a.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],d={};let u,m,h=-1,p=r,x=0,y=0;const k=[y];for(;p;){for(;e.get(++s)[1]!==p;);i.push(s),p._tokenizer||(u=a.sliceStream(p),p.next||u.push(null),m&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=p,p=p.next}for(p=r;++h<l.length;)l[h][0]==="exit"&&l[h-1][0]==="enter"&&l[h][1].type===l[h-1][1].type&&l[h][1].start.line!==l[h][1].end.line&&(y=h+1,k.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):k.pop(),h=k.length;h--;){const w=l.slice(k[h],k[h+1]),j=i.pop();c.push([j,j+w.length-1]),e.splice(j,2,w)}for(c.reverse(),h=-1;++h<c.length;)d[x+c[h][0]]=x+c[h][1],x+=c[h][1]-c[h][0]-1;return d}const Y2={resolve:Q2,tokenize:Z2},X2={partial:!0,tokenize:eb};function Q2(e){return km(e),e}function Z2(e,t){let r;return a;function a(l){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),s(l)}function s(l){return l===null?i(l):$e(l)?e.check(X2,o,i)(l):(e.consume(l),s)}function i(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,s}}function eb(e,t,r){const a=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ht(e,i,"linePrefix")}function i(o){if(o===null||$e(o))return r(o);const l=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(a.parser.constructs.flow,r,t)(o)}}function wm(e,t,r,a,s,i,o,l,c){const d=c||Number.POSITIVE_INFINITY;let u=0;return m;function m(w){return w===60?(e.enter(a),e.enter(s),e.enter(i),e.consume(w),e.exit(i),h):w===null||w===32||w===41||ei(w)?r(w):(e.enter(a),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),y(w))}function h(w){return w===62?(e.enter(i),e.consume(w),e.exit(i),e.exit(s),e.exit(a),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(l),h(w)):w===null||w===60||$e(w)?r(w):(e.consume(w),w===92?x:p)}function x(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function y(w){return!u&&(w===null||w===41||At(w))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(a),t(w)):u<d&&w===40?(e.consume(w),u++,y):w===41?(e.consume(w),u--,y):w===null||w===32||w===40||ei(w)?r(w):(e.consume(w),w===92?k:y)}function k(w){return w===40||w===41||w===92?(e.consume(w),y):y(w)}}function jm(e,t,r,a,s,i){const o=this;let l=0,c;return d;function d(p){return e.enter(a),e.enter(s),e.consume(p),e.exit(s),e.enter(i),u}function u(p){return l>999||p===null||p===91||p===93&&!c||p===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?r(p):p===93?(e.exit(i),e.enter(s),e.consume(p),e.exit(s),e.exit(a),t):$e(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),m(p))}function m(p){return p===null||p===91||p===93||$e(p)||l++>999?(e.exit("chunkString"),u(p)):(e.consume(p),c||(c=!gt(p)),p===92?h:m)}function h(p){return p===91||p===92||p===93?(e.consume(p),l++,m):m(p)}}function Nm(e,t,r,a,s,i){let o;return l;function l(h){return h===34||h===39||h===40?(e.enter(a),e.enter(s),e.consume(h),e.exit(s),o=h===40?41:h,c):r(h)}function c(h){return h===o?(e.enter(s),e.consume(h),e.exit(s),e.exit(a),t):(e.enter(i),d(h))}function d(h){return h===o?(e.exit(i),c(o)):h===null?r(h):$e(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ht(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||$e(h)?(e.exit("chunkString"),d(h)):(e.consume(h),h===92?m:u)}function m(h){return h===o||h===92?(e.consume(h),u):u(h)}}function Ga(e,t){let r;return a;function a(s){return $e(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r=!0,a):gt(s)?ht(e,a,r?"linePrefix":"lineSuffix")(s):t(s)}}const tb={name:"definition",tokenize:nb},rb={partial:!0,tokenize:ab};function nb(e,t,r){const a=this;let s;return i;function i(p){return e.enter("definition"),o(p)}function o(p){return jm.call(a,e,l,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return s=$r(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):r(p)}function c(p){return At(p)?Ga(e,d)(p):d(p)}function d(p){return wm(e,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(rb,m,m)(p)}function m(p){return gt(p)?ht(e,h,"whitespace")(p):h(p)}function h(p){return p===null||$e(p)?(e.exit("definition"),a.parser.defined.push(s),t(p)):r(p)}}function ab(e,t,r){return a;function a(l){return At(l)?Ga(e,s)(l):r(l)}function s(l){return Nm(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return gt(l)?ht(e,o,"whitespace")(l):o(l)}function o(l){return l===null||$e(l)?t(l):r(l)}}const sb={name:"hardBreakEscape",tokenize:ib};function ib(e,t,r){return a;function a(i){return e.enter("hardBreakEscape"),e.consume(i),s}function s(i){return $e(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}const ob={name:"headingAtx",resolve:lb,tokenize:cb};function lb(e,t){let r=e.length-2,a=3,s,i;return e[a][1].type==="whitespace"&&(a+=2),r-2>a&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(a===r-1||r-4>a&&e[r-2][1].type==="whitespace")&&(r-=a+1===r?2:4),r>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[r][1].end},i={type:"chunkText",start:e[a][1].start,end:e[r][1].end,contentType:"text"},kr(e,a,r-a+1,[["enter",s,t],["enter",i,t],["exit",i,t],["exit",s,t]])),e}function cb(e,t,r){let a=0;return s;function s(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&a++<6?(e.consume(u),o):u===null||At(u)?(e.exit("atxHeadingSequence"),l(u)):r(u)}function l(u){return u===35?(e.enter("atxHeadingSequence"),c(u)):u===null||$e(u)?(e.exit("atxHeading"),t(u)):gt(u)?ht(e,l,"whitespace")(u):(e.enter("atxHeadingText"),d(u))}function c(u){return u===35?(e.consume(u),c):(e.exit("atxHeadingSequence"),l(u))}function d(u){return u===null||u===35||At(u)?(e.exit("atxHeadingText"),l(u)):(e.consume(u),d)}}const db=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],xc=["pre","script","style","textarea"],ub={concrete:!0,name:"htmlFlow",resolveTo:pb,tokenize:fb},mb={partial:!0,tokenize:xb},hb={partial:!0,tokenize:gb};function pb(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function fb(e,t,r){const a=this;let s,i,o,l,c;return d;function d(A){return u(A)}function u(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),m}function m(A){return A===33?(e.consume(A),h):A===47?(e.consume(A),i=!0,y):A===63?(e.consume(A),s=3,a.interrupt?t:C):ar(A)?(e.consume(A),o=String.fromCharCode(A),k):r(A)}function h(A){return A===45?(e.consume(A),s=2,p):A===91?(e.consume(A),s=5,l=0,x):ar(A)?(e.consume(A),s=4,a.interrupt?t:C):r(A)}function p(A){return A===45?(e.consume(A),a.interrupt?t:C):r(A)}function x(A){const te="CDATA[";return A===te.charCodeAt(l++)?(e.consume(A),l===te.length?a.interrupt?t:O:x):r(A)}function y(A){return ar(A)?(e.consume(A),o=String.fromCharCode(A),k):r(A)}function k(A){if(A===null||A===47||A===62||At(A)){const te=A===47,Ce=o.toLowerCase();return!te&&!i&&xc.includes(Ce)?(s=1,a.interrupt?t(A):O(A)):db.includes(o.toLowerCase())?(s=6,te?(e.consume(A),w):a.interrupt?t(A):O(A)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?r(A):i?j(A):N(A))}return A===45||Zt(A)?(e.consume(A),o+=String.fromCharCode(A),k):r(A)}function w(A){return A===62?(e.consume(A),a.interrupt?t:O):r(A)}function j(A){return gt(A)?(e.consume(A),j):M(A)}function N(A){return A===47?(e.consume(A),M):A===58||A===95||ar(A)?(e.consume(A),L):gt(A)?(e.consume(A),N):M(A)}function L(A){return A===45||A===46||A===58||A===95||Zt(A)?(e.consume(A),L):U(A)}function U(A){return A===61?(e.consume(A),I):gt(A)?(e.consume(A),U):N(A)}function I(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),c=A,H):gt(A)?(e.consume(A),I):F(A)}function H(A){return A===c?(e.consume(A),c=null,W):A===null||$e(A)?r(A):(e.consume(A),H)}function F(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||At(A)?U(A):(e.consume(A),F)}function W(A){return A===47||A===62||gt(A)?N(A):r(A)}function M(A){return A===62?(e.consume(A),_):r(A)}function _(A){return A===null||$e(A)?O(A):gt(A)?(e.consume(A),_):r(A)}function O(A){return A===45&&s===2?(e.consume(A),ne):A===60&&s===1?(e.consume(A),he):A===62&&s===4?(e.consume(A),ue):A===63&&s===3?(e.consume(A),C):A===93&&s===5?(e.consume(A),J):$e(A)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(mb,xe,V)(A)):A===null||$e(A)?(e.exit("htmlFlowData"),V(A)):(e.consume(A),O)}function V(A){return e.check(hb,T,xe)(A)}function T(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),Y}function Y(A){return A===null||$e(A)?V(A):(e.enter("htmlFlowData"),O(A))}function ne(A){return A===45?(e.consume(A),C):O(A)}function he(A){return A===47?(e.consume(A),o="",$):O(A)}function $(A){if(A===62){const te=o.toLowerCase();return xc.includes(te)?(e.consume(A),ue):O(A)}return ar(A)&&o.length<8?(e.consume(A),o+=String.fromCharCode(A),$):O(A)}function J(A){return A===93?(e.consume(A),C):O(A)}function C(A){return A===62?(e.consume(A),ue):A===45&&s===2?(e.consume(A),C):O(A)}function ue(A){return A===null||$e(A)?(e.exit("htmlFlowData"),xe(A)):(e.consume(A),ue)}function xe(A){return e.exit("htmlFlow"),t(A)}}function gb(e,t,r){const a=this;return s;function s(o){return $e(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):r(o)}function i(o){return a.parser.lazy[a.now().line]?r(o):t(o)}}function xb(e,t,r){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(us,t,r)}}const bb={name:"htmlText",tokenize:yb};function yb(e,t,r){const a=this;let s,i,o;return l;function l(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),c}function c(C){return C===33?(e.consume(C),d):C===47?(e.consume(C),U):C===63?(e.consume(C),N):ar(C)?(e.consume(C),F):r(C)}function d(C){return C===45?(e.consume(C),u):C===91?(e.consume(C),i=0,x):ar(C)?(e.consume(C),j):r(C)}function u(C){return C===45?(e.consume(C),p):r(C)}function m(C){return C===null?r(C):C===45?(e.consume(C),h):$e(C)?(o=m,he(C)):(e.consume(C),m)}function h(C){return C===45?(e.consume(C),p):m(C)}function p(C){return C===62?ne(C):C===45?h(C):m(C)}function x(C){const ue="CDATA[";return C===ue.charCodeAt(i++)?(e.consume(C),i===ue.length?y:x):r(C)}function y(C){return C===null?r(C):C===93?(e.consume(C),k):$e(C)?(o=y,he(C)):(e.consume(C),y)}function k(C){return C===93?(e.consume(C),w):y(C)}function w(C){return C===62?ne(C):C===93?(e.consume(C),w):y(C)}function j(C){return C===null||C===62?ne(C):$e(C)?(o=j,he(C)):(e.consume(C),j)}function N(C){return C===null?r(C):C===63?(e.consume(C),L):$e(C)?(o=N,he(C)):(e.consume(C),N)}function L(C){return C===62?ne(C):N(C)}function U(C){return ar(C)?(e.consume(C),I):r(C)}function I(C){return C===45||Zt(C)?(e.consume(C),I):H(C)}function H(C){return $e(C)?(o=H,he(C)):gt(C)?(e.consume(C),H):ne(C)}function F(C){return C===45||Zt(C)?(e.consume(C),F):C===47||C===62||At(C)?W(C):r(C)}function W(C){return C===47?(e.consume(C),ne):C===58||C===95||ar(C)?(e.consume(C),M):$e(C)?(o=W,he(C)):gt(C)?(e.consume(C),W):ne(C)}function M(C){return C===45||C===46||C===58||C===95||Zt(C)?(e.consume(C),M):_(C)}function _(C){return C===61?(e.consume(C),O):$e(C)?(o=_,he(C)):gt(C)?(e.consume(C),_):W(C)}function O(C){return C===null||C===60||C===61||C===62||C===96?r(C):C===34||C===39?(e.consume(C),s=C,V):$e(C)?(o=O,he(C)):gt(C)?(e.consume(C),O):(e.consume(C),T)}function V(C){return C===s?(e.consume(C),s=void 0,Y):C===null?r(C):$e(C)?(o=V,he(C)):(e.consume(C),V)}function T(C){return C===null||C===34||C===39||C===60||C===61||C===96?r(C):C===47||C===62||At(C)?W(C):(e.consume(C),T)}function Y(C){return C===47||C===62||At(C)?W(C):r(C)}function ne(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):r(C)}function he(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),$}function $(C){return gt(C)?ht(e,J,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):J(C)}function J(C){return e.enter("htmlTextData"),o(C)}}const Ol={name:"labelEnd",resolveAll:jb,resolveTo:Nb,tokenize:Sb},vb={tokenize:Cb},kb={tokenize:Mb},wb={tokenize:Ab};function jb(e){let t=-1;const r=[];for(;++t<e.length;){const a=e[t][1];if(r.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==r.length&&kr(e,0,e.length,r),e}function Nb(e,t){let r=e.length,a=0,s,i,o,l;for(;r--;)if(s=e[r][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[r][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[r][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=r,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(o=r);const c={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[i][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[i+a+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",d,t]],l=Mr(l,e.slice(i+1,i+a+3)),l=Mr(l,[["enter",u,t]]),l=Mr(l,vi(t.parser.constructs.insideSpan.null,e.slice(i+a+4,o-3),t)),l=Mr(l,[["exit",u,t],e[o-2],e[o-1],["exit",d,t]]),l=Mr(l,e.slice(o+1)),l=Mr(l,[["exit",c,t]]),kr(e,i,e.length,l),e}function Sb(e,t,r){const a=this;let s=a.events.length,i,o;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){i=a.events[s][1];break}return l;function l(h){return i?i._inactive?m(h):(o=a.parser.defined.includes($r(a.sliceSerialize({start:i.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):r(h)}function c(h){return h===40?e.attempt(vb,u,o?u:m)(h):h===91?e.attempt(kb,u,o?d:m)(h):o?u(h):m(h)}function d(h){return e.attempt(wb,u,m)(h)}function u(h){return t(h)}function m(h){return i._balanced=!0,r(h)}}function Cb(e,t,r){return a;function a(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),s}function s(m){return At(m)?Ga(e,i)(m):i(m)}function i(m){return m===41?u(m):wm(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return At(m)?Ga(e,c)(m):u(m)}function l(m){return r(m)}function c(m){return m===34||m===39||m===40?Nm(e,d,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):u(m)}function d(m){return At(m)?Ga(e,u)(m):u(m)}function u(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):r(m)}}function Mb(e,t,r){const a=this;return s;function s(l){return jm.call(a,e,i,o,"reference","referenceMarker","referenceString")(l)}function i(l){return a.parser.defined.includes($r(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(l):r(l)}function o(l){return r(l)}}function Ab(e,t,r){return a;function a(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),s}function s(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):r(i)}}const Tb={name:"labelStartImage",resolveAll:Ol.resolveAll,tokenize:Eb};function Eb(e,t,r){const a=this;return s;function s(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),i}function i(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):r(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(l):t(l)}}const Ib={name:"labelStartLink",resolveAll:Ol.resolveAll,tokenize:Db};function Db(e,t,r){const a=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),i}function i(o){return o===94&&"_hiddenFootnoteSupport"in a.parser.constructs?r(o):t(o)}}const Wi={name:"lineEnding",tokenize:zb};function zb(e,t){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ht(e,t,"linePrefix")}}const Ws={name:"thematicBreak",tokenize:Lb};function Lb(e,t,r){let a=0,s;return i;function i(d){return e.enter("thematicBreak"),o(d)}function o(d){return s=d,l(d)}function l(d){return d===s?(e.enter("thematicBreakSequence"),c(d)):a>=3&&(d===null||$e(d))?(e.exit("thematicBreak"),t(d)):r(d)}function c(d){return d===s?(e.consume(d),a++,c):(e.exit("thematicBreakSequence"),gt(d)?ht(e,l,"whitespace")(d):l(d))}}const dr={continuation:{tokenize:Bb},exit:$b,name:"list",tokenize:Fb},Pb={partial:!0,tokenize:_b},Rb={partial:!0,tokenize:Ob};function Fb(e,t,r){const a=this,s=a.events[a.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(p){const x=a.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!a.containerState.marker||p===a.containerState.marker:Uo(p)){if(a.containerState.type||(a.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Ws,r,d)(p):d(p);if(!a.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return r(p)}function c(p){return Uo(p)&&++o<10?(e.consume(p),c):(!a.interrupt||o<2)&&(a.containerState.marker?p===a.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),d(p)):r(p)}function d(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||p,e.check(us,a.interrupt?r:u,e.attempt(Pb,h,m))}function u(p){return a.containerState.initialBlankLine=!0,i++,h(p)}function m(p){return gt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):r(p)}function h(p){return a.containerState.size=i+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Bb(e,t,r){const a=this;return a.containerState._closeFlow=void 0,e.check(us,s,i);function s(l){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,ht(e,t,"listItemIndent",a.containerState.size+1)(l)}function i(l){return a.containerState.furtherBlankLines||!gt(l)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,o(l)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(Rb,t,o)(l))}function o(l){return a.containerState._closeFlow=!0,a.interrupt=void 0,ht(e,e.attempt(dr,t,r),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Ob(e,t,r){const a=this;return ht(e,s,"listItemIndent",a.containerState.size+1);function s(i){const o=a.events[a.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===a.containerState.size?t(i):r(i)}}function $b(e){e.exit(this.containerState.type)}function _b(e,t,r){const a=this;return ht(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const o=a.events[a.events.length-1];return!gt(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}const bc={name:"setextUnderline",resolveTo:qb,tokenize:Hb};function qb(e,t){let r=e.length,a,s,i;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){a=r;break}e[r][1].type==="paragraph"&&(s=r)}else e[r][1].type==="content"&&e.splice(r,1),!i&&e[r][1].type==="definition"&&(i=r);const o={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",i?(e.splice(s,0,["enter",o,t]),e.splice(i+1,0,["exit",e[a][1],t]),e[a][1].end={...e[i][1].end}):e[a][1]=o,e.push(["exit",o,t]),e}function Hb(e,t,r){const a=this;let s;return i;function i(d){let u=a.events.length,m;for(;u--;)if(a.events[u][1].type!=="lineEnding"&&a.events[u][1].type!=="linePrefix"&&a.events[u][1].type!=="content"){m=a.events[u][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||m)?(e.enter("setextHeadingLine"),s=d,o(d)):r(d)}function o(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===s?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),gt(d)?ht(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||$e(d)?(e.exit("setextHeadingLine"),t(d)):r(d)}}const Ub={tokenize:Wb};function Wb(e){const t=this,r=e.attempt(us,a,e.attempt(this.parser.constructs.flowInitial,s,ht(e,e.attempt(this.parser.constructs.flow,s,e.attempt(Y2,s)),"linePrefix")));return r;function a(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function s(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const Vb={resolveAll:Cm()},Gb=Sm("string"),Kb=Sm("text");function Sm(e){return{resolveAll:Cm(e==="text"?Jb:void 0),tokenize:t};function t(r){const a=this,s=this.parser.constructs[e],i=r.attempt(s,o,l);return o;function o(u){return d(u)?i(u):l(u)}function l(u){if(u===null){r.consume(u);return}return r.enter("data"),r.consume(u),c}function c(u){return d(u)?(r.exit("data"),i(u)):(r.consume(u),c)}function d(u){if(u===null)return!0;const m=s[u];let h=-1;if(m)for(;++h<m.length;){const p=m[h];if(!p.previous||p.previous.call(a,a.previous))return!0}return!1}}}function Cm(e){return t;function t(r,a){let s=-1,i;for(;++s<=r.length;)i===void 0?r[s]&&r[s][1].type==="data"&&(i=s,s++):(!r[s]||r[s][1].type!=="data")&&(s!==i+2&&(r[i][1].end=r[s-1][1].end,r.splice(i+2,s-i-2),s=i+2),i=void 0);return e?e(r,a):r}}function Jb(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const a=e[r-1][1],s=t.sliceStream(a);let i=s.length,o=-1,l=0,c;for(;i--;){const d=s[i];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(d===-2)c=!0,l++;else if(d!==-1){i++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){const d={type:r===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:a.start._bufferIndex+o,_index:a.start._index+i,line:a.end.line,column:a.end.column-l,offset:a.end.offset-l},end:{...a.end}};a.end={...d.start},a.start.offset===a.end.offset?Object.assign(a,d):(e.splice(r,0,["enter",d,t],["exit",d,t]),r+=2)}r++}return e}const Yb={42:dr,43:dr,45:dr,48:dr,49:dr,50:dr,51:dr,52:dr,53:dr,54:dr,55:dr,56:dr,57:dr,62:bm},Xb={91:tb},Qb={[-2]:Ui,[-1]:Ui,32:Ui},Zb={35:ob,42:Ws,45:[bc,Ws],60:ub,61:bc,95:Ws,96:gc,126:gc},e4={38:vm,92:ym},t4={[-5]:Wi,[-4]:Wi,[-3]:Wi,33:Tb,38:vm,42:Wo,60:[I2,bb],91:Ib,92:[sb,ym],93:Ol,95:Wo,96:U2},r4={null:[Wo,Vb]},n4={null:[42,95]},a4={null:[]},s4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:n4,contentInitial:Xb,disable:a4,document:Yb,flow:Zb,flowInitial:Qb,insideSpan:r4,string:e4,text:t4},Symbol.toStringTag,{value:"Module"}));function i4(e,t,r){let a={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const s={},i=[];let o=[],l=[];const c={attempt:H(U),check:H(I),consume:j,enter:N,exit:L,interrupt:H(I,{interrupt:!0})},d={code:null,containerState:{},defineSkip:y,events:[],now:x,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:m};let u=t.tokenize.call(d,c);return t.resolveAll&&i.push(t),d;function m(_){return o=Mr(o,_),k(),o[o.length-1]!==null?[]:(F(t,0),d.events=vi(i,d.events,d),d.events)}function h(_,O){return l4(p(_),O)}function p(_){return o4(o,_)}function x(){const{_bufferIndex:_,_index:O,line:V,column:T,offset:Y}=a;return{_bufferIndex:_,_index:O,line:V,column:T,offset:Y}}function y(_){s[_.line]=_.column,M()}function k(){let _;for(;a._index<o.length;){const O=o[a._index];if(typeof O=="string")for(_=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===_&&a._bufferIndex<O.length;)w(O.charCodeAt(a._bufferIndex));else w(O)}}function w(_){u=u(_)}function j(_){$e(_)?(a.line++,a.column=1,a.offset+=_===-3?2:1,M()):_!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===o[a._index].length&&(a._bufferIndex=-1,a._index++)),d.previous=_}function N(_,O){const V=O||{};return V.type=_,V.start=x(),d.events.push(["enter",V,d]),l.push(V),V}function L(_){const O=l.pop();return O.end=x(),d.events.push(["exit",O,d]),O}function U(_,O){F(_,O.from)}function I(_,O){O.restore()}function H(_,O){return V;function V(T,Y,ne){let he,$,J,C;return Array.isArray(T)?xe(T):"tokenize"in T?xe([T]):ue(T);function ue(De){return pe;function pe(_e){const se=_e!==null&&De[_e],we=_e!==null&&De.null,ze=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(we)?we:we?[we]:[]];return xe(ze)(_e)}}function xe(De){return he=De,$=0,De.length===0?ne:A(De[$])}function A(De){return pe;function pe(_e){return C=W(),J=De,De.partial||(d.currentConstruct=De),De.name&&d.parser.constructs.disable.null.includes(De.name)?Ce():De.tokenize.call(O?Object.assign(Object.create(d),O):d,c,te,Ce)(_e)}}function te(De){return _(J,C),Y}function Ce(De){return C.restore(),++$<he.length?A(he[$]):ne}}}function F(_,O){_.resolveAll&&!i.includes(_)&&i.push(_),_.resolve&&kr(d.events,O,d.events.length-O,_.resolve(d.events.slice(O),d)),_.resolveTo&&(d.events=_.resolveTo(d.events,d))}function W(){const _=x(),O=d.previous,V=d.currentConstruct,T=d.events.length,Y=Array.from(l);return{from:T,restore:ne};function ne(){a=_,d.previous=O,d.currentConstruct=V,d.events.length=T,l=Y,M()}}function M(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function o4(e,t){const r=t.start._index,a=t.start._bufferIndex,s=t.end._index,i=t.end._bufferIndex;let o;if(r===s)o=[e[r].slice(a,i)];else{if(o=e.slice(r,s),a>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(a):o.shift()}i>0&&o.push(e[s].slice(0,i))}return o}function l4(e,t){let r=-1;const a=[];let s;for(;++r<e.length;){const i=e[r];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
|
|
388
|
-
`;break}case-3:{o=`\r
|
|
389
|
-
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(i)}s=i===-2,a.push(o)}return a.join("")}function c4(e){const a={constructs:gm([s4,...(e||{}).extensions||[]]),content:s(N2),defined:[],document:s(C2),flow:s(Ub),lazy:{},string:s(Gb),text:s(Kb)};return a;function s(i){return o;function o(l){return i4(a,i,l)}}}function d4(e){for(;!km(e););return e}const yc=/[\0\t\n\r]/g;function u4(){let e=1,t="",r=!0,a;return s;function s(i,o,l){const c=[];let d,u,m,h,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),m=0,t="",r&&(i.charCodeAt(0)===65279&&m++,r=void 0);m<i.length;){if(yc.lastIndex=m,d=yc.exec(i),h=d&&d.index!==void 0?d.index:i.length,p=i.charCodeAt(h),!d){t=i.slice(m);break}if(p===10&&m===h&&a)c.push(-3),a=void 0;else switch(a&&(c.push(-5),a=void 0),m<h&&(c.push(i.slice(m,h)),e+=h-m),p){case 0:{c.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,c.push(-2);e++<u;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:a=!0,e=1}m=h+1}return l&&(a&&c.push(-5),t&&c.push(t),c.push(null)),c}}const m4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function h4(e){return e.replace(m4,p4)}function p4(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const s=r.charCodeAt(1),i=s===120||s===88;return xm(r.slice(i?2:1),i?16:10)}return Bl(r)||e}const Mm={}.hasOwnProperty;function f4(e,t,r){return typeof t!="string"&&(r=t,t=void 0),g4(r)(d4(c4(r).document().write(u4()(e,t,!0))))}function g4(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(qe),autolinkProtocol:W,autolinkEmail:W,atxHeading:i(bt),blockQuote:i(we),characterEscape:W,characterReference:W,codeFenced:i(ze),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(ze,o),codeText:i(Ae,o),codeTextData:W,data:W,codeFlowValue:W,definition:i(Be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(nt),hardBreakEscape:i(ut),hardBreakTrailing:i(ut),htmlFlow:i(jt,o),htmlFlowData:W,htmlText:i(jt,o),htmlTextData:W,image:i(lt),label:o,link:i(qe),listItem:i(St),listItemValue:h,listOrdered:i(st,m),listUnordered:i(st),paragraph:i(Oe),reference:A,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(bt),strong:i(Qt),thematicBreak:i(Se)},exit:{atxHeading:c(),atxHeadingSequence:U,autolink:c(),autolinkEmail:se,autolinkProtocol:_e,blockQuote:c(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:Ce,characterReferenceMarkerNumeric:Ce,characterReferenceValue:De,characterReference:pe,codeFenced:c(k),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:x,codeFlowValue:M,codeIndented:c(w),codeText:c(Y),codeTextData:M,data:M,definition:c(),definitionDestinationString:L,definitionLabelString:j,definitionTitleString:N,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(V),htmlFlowData:M,htmlText:c(T),htmlTextData:M,image:c(he),label:J,labelText:$,lineEnding:_,link:c(ne),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:te,resourceDestinationString:C,resourceTitleString:ue,resource:xe,setextHeading:c(F),setextHeadingLineSequence:H,setextHeadingText:I,strong:c(),thematicBreak:c()}};Am(t,(e||{}).mdastExtensions||[]);const r={};return a;function a(B){let K={type:"root",children:[]};const ke={stack:[K],tokenStack:[],config:t,enter:l,exit:d,buffer:o,resume:u,data:r},We=[];let Ge=-1;for(;++Ge<B.length;)if(B[Ge][1].type==="listOrdered"||B[Ge][1].type==="listUnordered")if(B[Ge][0]==="enter")We.push(Ge);else{const ce=We.pop();Ge=s(B,ce,Ge)}for(Ge=-1;++Ge<B.length;){const ce=t[B[Ge][0]];Mm.call(ce,B[Ge][1].type)&&ce[B[Ge][1].type].call(Object.assign({sliceSerialize:B[Ge][2].sliceSerialize},ke),B[Ge][1])}if(ke.tokenStack.length>0){const ce=ke.tokenStack[ke.tokenStack.length-1];(ce[1]||vc).call(ke,void 0,ce[0])}for(K.position={start:Nn(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:Nn(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<t.transforms.length;)K=t.transforms[Ge](K)||K;return K}function s(B,K,ke){let We=K-1,Ge=-1,ce=!1,R,Q,be,je;for(;++We<=ke;){const re=B[We];switch(re[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{re[0]==="enter"?Ge++:Ge--,je=void 0;break}case"lineEndingBlank":{re[0]==="enter"&&(R&&!je&&!Ge&&!be&&(be=We),je=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:je=void 0}if(!Ge&&re[0]==="enter"&&re[1].type==="listItemPrefix"||Ge===-1&&re[0]==="exit"&&(re[1].type==="listUnordered"||re[1].type==="listOrdered")){if(R){let Me=We;for(Q=void 0;Me--;){const pt=B[Me];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;Q&&(B[Q][1].type="lineEndingBlank",ce=!0),pt[1].type="lineEnding",Q=Me}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarker"||pt[1].type==="listItemIndent"))break}be&&(!Q||be<Q)&&(R._spread=!0),R.end=Object.assign({},Q?B[Q][1].start:re[1].end),B.splice(Q||We,0,["exit",R,re[2]]),We++,ke++}if(re[1].type==="listItemPrefix"){const Me={type:"listItem",_spread:!1,start:Object.assign({},re[1].start),end:void 0};R=Me,B.splice(We,0,["enter",Me,re[2]]),We++,ke++,be=void 0,je=!0}}}return B[K][1]._spread=ce,ke}function i(B,K){return ke;function ke(We){l.call(this,B(We),We),K&&K.call(this,We)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(B,K,ke){this.stack[this.stack.length-1].children.push(B),this.stack.push(B),this.tokenStack.push([K,ke||void 0]),B.position={start:Nn(K.start),end:void 0}}function c(B){return K;function K(ke){B&&B.call(this,ke),d.call(this,ke)}}function d(B,K){const ke=this.stack.pop(),We=this.tokenStack.pop();if(We)We[0].type!==B.type&&(K?K.call(this,B,We[0]):(We[1]||vc).call(this,B,We[0]));else throw new Error("Cannot close `"+B.type+"` ("+Va({start:B.start,end:B.end})+"): it’s not open");ke.position.end=Nn(B.end)}function u(){return Fl(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function h(B){if(this.data.expectingFirstListItemValue){const K=this.stack[this.stack.length-2];K.start=Number.parseInt(this.sliceSerialize(B),10),this.data.expectingFirstListItemValue=void 0}}function p(){const B=this.resume(),K=this.stack[this.stack.length-1];K.lang=B}function x(){const B=this.resume(),K=this.stack[this.stack.length-1];K.meta=B}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const B=this.resume(),K=this.stack[this.stack.length-1];K.value=B.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const B=this.resume(),K=this.stack[this.stack.length-1];K.value=B.replace(/(\r?\n|\r)$/g,"")}function j(B){const K=this.resume(),ke=this.stack[this.stack.length-1];ke.label=K,ke.identifier=$r(this.sliceSerialize(B)).toLowerCase()}function N(){const B=this.resume(),K=this.stack[this.stack.length-1];K.title=B}function L(){const B=this.resume(),K=this.stack[this.stack.length-1];K.url=B}function U(B){const K=this.stack[this.stack.length-1];if(!K.depth){const ke=this.sliceSerialize(B).length;K.depth=ke}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function H(B){const K=this.stack[this.stack.length-1];K.depth=this.sliceSerialize(B).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function W(B){const ke=this.stack[this.stack.length-1].children;let We=ke[ke.length-1];(!We||We.type!=="text")&&(We=ie(),We.position={start:Nn(B.start),end:void 0},ke.push(We)),this.stack.push(We)}function M(B){const K=this.stack.pop();K.value+=this.sliceSerialize(B),K.position.end=Nn(B.end)}function _(B){const K=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=K.children[K.children.length-1];ke.position.end=Nn(B.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(K.type)&&(W.call(this,B),M.call(this,B))}function O(){this.data.atHardBreak=!0}function V(){const B=this.resume(),K=this.stack[this.stack.length-1];K.value=B}function T(){const B=this.resume(),K=this.stack[this.stack.length-1];K.value=B}function Y(){const B=this.resume(),K=this.stack[this.stack.length-1];K.value=B}function ne(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=K,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function he(){const B=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";B.type+="Reference",B.referenceType=K,delete B.url,delete B.title}else delete B.identifier,delete B.label;this.data.referenceType=void 0}function $(B){const K=this.sliceSerialize(B),ke=this.stack[this.stack.length-2];ke.label=h4(K),ke.identifier=$r(K).toLowerCase()}function J(){const B=this.stack[this.stack.length-1],K=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const We=B.children;ke.children=We}else ke.alt=K}function C(){const B=this.resume(),K=this.stack[this.stack.length-1];K.url=B}function ue(){const B=this.resume(),K=this.stack[this.stack.length-1];K.title=B}function xe(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function te(B){const K=this.resume(),ke=this.stack[this.stack.length-1];ke.label=K,ke.identifier=$r(this.sliceSerialize(B)).toLowerCase(),this.data.referenceType="full"}function Ce(B){this.data.characterReferenceType=B.type}function De(B){const K=this.sliceSerialize(B),ke=this.data.characterReferenceType;let We;ke?(We=xm(K,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):We=Bl(K);const Ge=this.stack[this.stack.length-1];Ge.value+=We}function pe(B){const K=this.stack.pop();K.position.end=Nn(B.end)}function _e(B){M.call(this,B);const K=this.stack[this.stack.length-1];K.url=this.sliceSerialize(B)}function se(B){M.call(this,B);const K=this.stack[this.stack.length-1];K.url="mailto:"+this.sliceSerialize(B)}function we(){return{type:"blockquote",children:[]}}function ze(){return{type:"code",lang:null,meta:null,value:""}}function Ae(){return{type:"inlineCode",value:""}}function Be(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function nt(){return{type:"emphasis",children:[]}}function bt(){return{type:"heading",depth:0,children:[]}}function ut(){return{type:"break"}}function jt(){return{type:"html",value:""}}function lt(){return{type:"image",title:null,url:"",alt:null}}function qe(){return{type:"link",title:null,url:"",children:[]}}function st(B){return{type:"list",ordered:B.type==="listOrdered",start:null,spread:B._spread,children:[]}}function St(B){return{type:"listItem",spread:B._spread,checked:null,children:[]}}function Oe(){return{type:"paragraph",children:[]}}function Qt(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function Se(){return{type:"thematicBreak"}}}function Nn(e){return{line:e.line,column:e.column,offset:e.offset}}function Am(e,t){let r=-1;for(;++r<t.length;){const a=t[r];Array.isArray(a)?Am(e,a):x4(e,a)}}function x4(e,t){let r;for(r in t)if(Mm.call(t,r))switch(r){case"canContainEols":{const a=t[r];a&&e[r].push(...a);break}case"transforms":{const a=t[r];a&&e[r].push(...a);break}case"enter":case"exit":{const a=t[r];a&&Object.assign(e[r],a);break}}}function vc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Va({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Va({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Va({start:t.start,end:t.end})+") is still open")}function b4(e){const t=this;t.parser=r;function r(a){return f4(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function y4(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function v4(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
390
|
-
`}]}function k4(e,t){const r=t.value?t.value+`
|
|
391
|
-
`:"",a={};t.lang&&(a.className=["language-"+t.lang]);let s={type:"element",tagName:"code",properties:a,children:[{type:"text",value:r}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function w4(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function j4(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function N4(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=Aa(a.toLowerCase()),i=e.footnoteOrder.indexOf(a);let o,l=e.footnoteCounts.get(a);l===void 0?(l=0,e.footnoteOrder.push(a),o=e.footnoteOrder.length):o=i+1,l+=1,e.footnoteCounts.set(a,l);const c={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+s,id:r+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,d),e.applyData(t,d)}function S4(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function C4(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function Tm(e,t){const r=t.referenceType;let a="]";if(r==="collapsed"?a+="[]":r==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const s=e.all(t),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=a:s.push({type:"text",value:a}),s}function M4(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return Tm(e,t);const s={src:Aa(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const i={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,i),e.applyData(t,i)}function A4(e,t){const r={src:Aa(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,a),e.applyData(t,a)}function T4(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const a={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,a),e.applyData(t,a)}function E4(e,t){const r=String(t.identifier).toUpperCase(),a=e.definitionById.get(r);if(!a)return Tm(e,t);const s={href:Aa(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const i={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function I4(e,t){const r={href:Aa(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const a={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function D4(e,t,r){const a=e.all(t),s=r?z4(r):Em(t),i={},o=[];if(typeof t.checked=="boolean"){const u=a[0];let m;u&&u.type==="element"&&u.tagName==="p"?m=u:(m={type:"element",tagName:"p",properties:{},children:[]},a.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let l=-1;for(;++l<a.length;){const u=a[l];(s||l!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
|
|
392
|
-
`}),u.type==="element"&&u.tagName==="p"&&!s?o.push(...u.children):o.push(u)}const c=a[a.length-1];c&&(s||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
|
|
393
|
-
`});const d={type:"element",tagName:"li",properties:i,children:o};return e.patch(t,d),e.applyData(t,d)}function z4(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let a=-1;for(;!t&&++a<r.length;)t=Em(r[a])}return t}function Em(e){const t=e.spread;return t??e.children.length>1}function L4(e,t){const r={},a=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++s<a.length;){const o=a[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)}function P4(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function R4(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function F4(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function B4(e,t){const r=e.all(t),a=r.shift(),s=[];if(a){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],o),s.push(o)}if(r.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},l=zl(t.children[1]),c=cm(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),s.push(o)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,i),e.applyData(t,i)}function O4(e,t,r){const a=r?r.children:void 0,i=(a?a.indexOf(t):1)===0?"th":"td",o=r&&r.type==="table"?r.align:void 0,l=o?o.length:t.children.length;let c=-1;const d=[];for(;++c<l;){const m=t.children[c],h={},p=o?o[c]:void 0;p&&(h.align=p);let x={type:"element",tagName:i,properties:h,children:[]};m&&(x.children=e.all(m),e.patch(m,x),x=e.applyData(m,x)),d.push(x)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,u),e.applyData(t,u)}function $4(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const kc=9,wc=32;function _4(e){const t=String(e),r=/\r?\n|\r/g;let a=r.exec(t),s=0;const i=[];for(;a;)i.push(jc(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=r.exec(t);return i.push(jc(t.slice(s),s>0,!1)),i.join("")}function jc(e,t,r){let a=0,s=e.length;if(t){let i=e.codePointAt(a);for(;i===kc||i===wc;)a++,i=e.codePointAt(a)}if(r){let i=e.codePointAt(s-1);for(;i===kc||i===wc;)s--,i=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function q4(e,t){const r={type:"text",value:_4(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function H4(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const U4={blockquote:y4,break:v4,code:k4,delete:w4,emphasis:j4,footnoteReference:N4,heading:S4,html:C4,imageReference:M4,image:A4,inlineCode:T4,linkReference:E4,link:I4,listItem:D4,list:L4,paragraph:P4,root:R4,strong:F4,table:B4,tableCell:$4,tableRow:O4,text:q4,thematicBreak:H4,toml:Ms,yaml:Ms,definition:Ms,footnoteDefinition:Ms};function Ms(){}const Im=-1,ki=0,Ka=1,ti=2,$l=3,_l=4,ql=5,Hl=6,Dm=7,zm=8,Nc=typeof self=="object"?self:globalThis,W4=(e,t)=>{const r=(s,i)=>(e.set(i,s),s),a=s=>{if(e.has(s))return e.get(s);const[i,o]=t[s];switch(i){case ki:case Im:return r(o,s);case Ka:{const l=r([],s);for(const c of o)l.push(a(c));return l}case ti:{const l=r({},s);for(const[c,d]of o)l[a(c)]=a(d);return l}case $l:return r(new Date(o),s);case _l:{const{source:l,flags:c}=o;return r(new RegExp(l,c),s)}case ql:{const l=r(new Map,s);for(const[c,d]of o)l.set(a(c),a(d));return l}case Hl:{const l=r(new Set,s);for(const c of o)l.add(a(c));return l}case Dm:{const{name:l,message:c}=o;return r(new Nc[l](c),s)}case zm:return r(BigInt(o),s);case"BigInt":return r(Object(BigInt(o)),s);case"ArrayBuffer":return r(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return r(new DataView(l),o)}}return r(new Nc[i](o),s)};return a},Sc=e=>W4(new Map,e)(0),la="",{toString:V4}={},{keys:G4}=Object,Oa=e=>{const t=typeof e;if(t!=="object"||!e)return[ki,t];const r=V4.call(e).slice(8,-1);switch(r){case"Array":return[Ka,la];case"Object":return[ti,la];case"Date":return[$l,la];case"RegExp":return[_l,la];case"Map":return[ql,la];case"Set":return[Hl,la];case"DataView":return[Ka,r]}return r.includes("Array")?[Ka,r]:r.includes("Error")?[Dm,r]:[ti,r]},As=([e,t])=>e===ki&&(t==="function"||t==="symbol"),K4=(e,t,r,a)=>{const s=(o,l)=>{const c=a.push(o)-1;return r.set(l,c),c},i=o=>{if(r.has(o))return r.get(o);let[l,c]=Oa(o);switch(l){case ki:{let u=o;switch(c){case"bigint":l=zm,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);u=null;break;case"undefined":return s([Im],o)}return s([l,u],o)}case Ka:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),s([c,[...h]],o)}const u=[],m=s([l,u],o);for(const h of o)u.push(i(h));return m}case ti:{if(c)switch(c){case"BigInt":return s([c,o.toString()],o);case"Boolean":case"Number":case"String":return s([c,o.valueOf()],o)}if(t&&"toJSON"in o)return i(o.toJSON());const u=[],m=s([l,u],o);for(const h of G4(o))(e||!As(Oa(o[h])))&&u.push([i(h),i(o[h])]);return m}case $l:return s([l,o.toISOString()],o);case _l:{const{source:u,flags:m}=o;return s([l,{source:u,flags:m}],o)}case ql:{const u=[],m=s([l,u],o);for(const[h,p]of o)(e||!(As(Oa(h))||As(Oa(p))))&&u.push([i(h),i(p)]);return m}case Hl:{const u=[],m=s([l,u],o);for(const h of o)(e||!As(Oa(h)))&&u.push(i(h));return m}}const{message:d}=o;return s([l,{name:c,message:d}],o)};return i},Cc=(e,{json:t,lossy:r}={})=>{const a=[];return K4(!(t||r),!!t,new Map,a)(e),a},ri=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Sc(Cc(e,t)):structuredClone(e):(e,t)=>Sc(Cc(e,t));function J4(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function Y4(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function X4(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||J4,a=e.options.footnoteBackLabel||Y4,s=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[c]);if(!d)continue;const u=e.all(d),m=String(d.identifier).toUpperCase(),h=Aa(m.toLowerCase());let p=0;const x=[],y=e.footnoteCounts.get(m);for(;y!==void 0&&++p<=y;){x.length>0&&x.push({type:"text",value:" "});let j=typeof r=="string"?r:r(c,p);typeof j=="string"&&(j={type:"text",value:j}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(c,p),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const k=u[u.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const j=k.children[k.children.length-1];j&&j.type==="text"?j.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...x)}else u.push(...x);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(d,w),l.push(w)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...ri(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
394
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
395
|
-
`}]}}const ms=function(e){if(e==null)return ty;if(typeof e=="function")return wi(e);if(typeof e=="object")return Array.isArray(e)?Q4(e):Z4(e);if(typeof e=="string")return ey(e);throw new Error("Expected function, string, or object as test")};function Q4(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=ms(e[r]);return wi(a);function a(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function Z4(e){const t=e;return wi(r);function r(a){const s=a;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function ey(e){return wi(t);function t(r){return r&&r.type===e}}function wi(e){return t;function t(r,a,s){return!!(ry(r)&&e.call(this,r,typeof a=="number"?a:void 0,s||void 0))}}function ty(){return!0}function ry(e){return e!==null&&typeof e=="object"&&"type"in e}const Lm=[],ny=!0,Vo=!1,Pm="skip";function Ul(e,t,r,a){let s;typeof t=="function"&&typeof r!="function"?(a=r,r=t):s=t;const i=ms(s),o=a?-1:1;l(e,void 0,[])();function l(c,d,u){const m=c&&typeof c=="object"?c:{};if(typeof m.type=="string"){const p=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=Lm,x,y,k;if((!t||i(c,d,u[u.length-1]||void 0))&&(p=ay(r(c,u)),p[0]===Vo))return p;if("children"in c&&c.children){const w=c;if(w.children&&p[0]!==Pm)for(y=(a?w.children.length:-1)+o,k=u.concat(w);y>-1&&y<w.children.length;){const j=w.children[y];if(x=l(j,y,k)(),x[0]===Vo)return x;y=typeof x[1]=="number"?x[1]:y+o}}return p}}}function ay(e){return Array.isArray(e)?e:typeof e=="number"?[ny,e]:e==null?Lm:[e]}function Wl(e,t,r,a){let s,i,o;typeof t=="function"&&typeof r!="function"?(i=void 0,o=t,s=r):(i=t,o=r,s=a),Ul(e,i,l,s);function l(c,d){const u=d[d.length-1],m=u?u.children.indexOf(c):void 0;return o(c,m,u)}}const Go={}.hasOwnProperty,sy={};function iy(e,t){const r=t||sy,a=new Map,s=new Map,i=new Map,o={...U4,...r.handlers},l={all:d,applyData:ly,definitionById:a,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:o,one:c,options:r,patch:oy,wrap:dy};return Wl(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const m=u.type==="definition"?a:s,h=String(u.identifier).toUpperCase();m.has(h)||m.set(h,u)}}),l;function c(u,m){const h=u.type,p=l.handlers[h];if(Go.call(l.handlers,h)&&p)return p(l,u,m);if(l.options.passThrough&&l.options.passThrough.includes(h)){if("children"in u){const{children:y,...k}=u,w=ri(k);return w.children=l.all(u),w}return ri(u)}return(l.options.unknownHandler||cy)(l,u,m)}function d(u){const m=[];if("children"in u){const h=u.children;let p=-1;for(;++p<h.length;){const x=l.one(h[p],u);if(x){if(p&&h[p-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=Mc(x.value)),!Array.isArray(x)&&x.type==="element")){const y=x.children[0];y&&y.type==="text"&&(y.value=Mc(y.value))}Array.isArray(x)?m.push(...x):m.push(x)}}}return m}}function oy(e,t){e.position&&(t.position=Yx(e))}function ly(e,t){let r=t;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,i=e.data.hProperties;if(typeof a=="string")if(r.type==="element")r.tagName=a;else{const o="children"in r?r.children:[r];r={type:"element",tagName:a,properties:{},children:o}}r.type==="element"&&i&&Object.assign(r.properties,ri(i)),"children"in r&&r.children&&s!==null&&s!==void 0&&(r.children=s)}return r}function cy(e,t){const r=t.data||{},a="value"in t&&!(Go.call(r,"hProperties")||Go.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function dy(e,t){const r=[];let a=-1;for(t&&r.push({type:"text",value:`
|
|
396
|
-
`});++a<e.length;)a&&r.push({type:"text",value:`
|
|
397
|
-
`}),r.push(e[a]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
398
|
-
`}),r}function Mc(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function Ac(e,t){const r=iy(e,t),a=r.one(e,void 0),s=X4(r),i=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
|
399
|
-
`},s),i}function uy(e,t){return e&&"run"in e?async function(r,a){const s=Ac(r,{file:a,...t});await e.run(s,a)}:function(r,a){return Ac(r,{file:a,...e||t})}}function Tc(e){if(e)throw e}var Vi,Ec;function my(){if(Ec)return Vi;Ec=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},i=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var u=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!u&&!m)return!1;var h;for(h in d);return typeof h>"u"||e.call(d,h)},o=function(d,u){r&&u.name==="__proto__"?r(d,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):d[u.name]=u.newValue},l=function(d,u){if(u==="__proto__")if(e.call(d,u)){if(a)return a(d,u).value}else return;return d[u]};return Vi=function c(){var d,u,m,h,p,x,y=arguments[0],k=1,w=arguments.length,j=!1;for(typeof y=="boolean"&&(j=y,y=arguments[1]||{},k=2),(y==null||typeof y!="object"&&typeof y!="function")&&(y={});k<w;++k)if(d=arguments[k],d!=null)for(u in d)m=l(y,u),h=l(d,u),y!==h&&(j&&h&&(i(h)||(p=s(h)))?(p?(p=!1,x=m&&s(m)?m:[]):x=m&&i(m)?m:{},o(y,{name:u,newValue:c(j,x,h)})):typeof h<"u"&&o(y,{name:u,newValue:h}));return y},Vi}var hy=my();const Gi=ss(hy);function Ko(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function py(){const e=[],t={run:r,use:a};return t;function r(...s){let i=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...s);function l(c,...d){const u=e[++i];let m=-1;if(c){o(c);return}for(;++m<s.length;)(d[m]===null||d[m]===void 0)&&(d[m]=s[m]);s=d,u?fy(u,l)(...d):o(null,...d)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function fy(e,t){let r;return a;function a(...o){const l=e.length>o.length;let c;l&&o.push(s);try{c=e.apply(this,o)}catch(d){const u=d;if(l&&r)throw u;return s(u)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,s):c instanceof Error?s(c):i(c))}function s(o,...l){r||(r=!0,t(o,...l))}function i(o){s(null,o)}}const Hr={basename:gy,dirname:xy,extname:by,join:yy,sep:"/"};function gy(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');hs(e);let r=0,a=-1,s=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(i){r=s+1;break}}else a<0&&(i=!0,a=s+1);return a<0?"":e.slice(r,a)}if(t===e)return"";let o=-1,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(i){r=s+1;break}}else o<0&&(i=!0,o=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(a=s):(l=-1,a=o));return r===a?a=o:a<0&&(a=e.length),e.slice(r,a)}function xy(e){if(hs(e),e.length===0)return".";let t=-1,r=e.length,a;for(;--r;)if(e.codePointAt(r)===47){if(a){t=r;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function by(e){hs(e);let t=e.length,r=-1,a=0,s=-1,i=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){a=t+1;break}continue}r<0&&(o=!0,r=t+1),l===46?s<0?s=t:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||r<0||i===0||i===1&&s===r-1&&s===a+1?"":e.slice(s,r)}function yy(...e){let t=-1,r;for(;++t<e.length;)hs(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":vy(r)}function vy(e){hs(e);const t=e.codePointAt(0)===47;let r=ky(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function ky(e,t){let r="",a=0,s=-1,i=0,o=-1,l,c;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(s===o-1||i===1))if(s!==o-1&&i===2){if(r.length<2||a!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(c=r.lastIndexOf("/"),c!==r.length-1){c<0?(r="",a=0):(r=r.slice(0,c),a=r.length-1-r.lastIndexOf("/")),s=o,i=0;continue}}else if(r.length>0){r="",a=0,s=o,i=0;continue}}t&&(r=r.length>0?r+"/..":"..",a=2)}else r.length>0?r+="/"+e.slice(s+1,o):r=e.slice(s+1,o),a=o-s-1;s=o,i=0}else l===46&&i>-1?i++:i=-1}return r}function hs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const wy={cwd:jy};function jy(){return"/"}function Jo(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ny(e){if(typeof e=="string")e=new URL(e);else if(!Jo(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Sy(e)}function Sy(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const a=t.codePointAt(r+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Ki=["history","path","basename","stem","extname","dirname"];class Rm{constructor(t){let r;t?Jo(t)?r={path:t}:typeof t=="string"||Cy(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":wy.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Ki.length;){const i=Ki[a];i in r&&r[i]!==void 0&&r[i]!==null&&(this[i]=i==="history"?[...r[i]]:r[i])}let s;for(s in r)Ki.includes(s)||(this[s]=r[s])}get basename(){return typeof this.path=="string"?Hr.basename(this.path):void 0}set basename(t){Yi(t,"basename"),Ji(t,"basename"),this.path=Hr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Hr.dirname(this.path):void 0}set dirname(t){Ic(this.basename,"dirname"),this.path=Hr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Hr.extname(this.path):void 0}set extname(t){if(Ji(t,"extname"),Ic(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Hr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Jo(t)&&(t=Ny(t)),Yi(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Hr.basename(this.path,this.extname):void 0}set stem(t){Yi(t,"stem"),Ji(t,"stem"),this.path=Hr.join(this.dirname||"",t+(this.extname||""))}fail(t,r,a){const s=this.message(t,r,a);throw s.fatal=!0,s}info(t,r,a){const s=this.message(t,r,a);return s.fatal=void 0,s}message(t,r,a){const s=new er(t,r,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ji(e,t){if(e&&e.includes(Hr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Hr.sep+"`")}function Yi(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Ic(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Cy(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const My=function(e){const a=this.constructor.prototype,s=a[e],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,a),i},Ay={}.hasOwnProperty;class Vl extends My{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=py()}copy(){const t=new Vl;let r=-1;for(;++r<this.attachers.length;){const a=this.attachers[r];t.use(...a)}return t.data(Gi(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(Zi("data",this.frozen),this.namespace[t]=r,this):Ay.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Zi("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=r.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=Ts(t),a=this.parser||this.Parser;return Xi("parse",a),a(String(r),r)}process(t,r){const a=this;return this.freeze(),Xi("process",this.parser||this.Parser),Qi("process",this.compiler||this.Compiler),r?s(void 0,r):new Promise(s);function s(i,o){const l=Ts(t),c=a.parse(l);a.run(c,l,function(u,m,h){if(u||!m||!h)return d(u);const p=m,x=a.stringify(p,h);Iy(x)?h.value=x:h.result=x,d(u,h)});function d(u,m){u||!m?o(u):i?i(m):r(void 0,m)}}}processSync(t){let r=!1,a;return this.freeze(),Xi("processSync",this.parser||this.Parser),Qi("processSync",this.compiler||this.Compiler),this.process(t,s),zc("processSync","process",r),a;function s(i,o){r=!0,Tc(i),a=o}}run(t,r,a){Dc(t),this.freeze();const s=this.transformers;return!a&&typeof r=="function"&&(a=r,r=void 0),a?i(void 0,a):new Promise(i);function i(o,l){const c=Ts(r);s.run(t,c,d);function d(u,m,h){const p=m||t;u?l(u):o?o(p):a(void 0,p,h)}}}runSync(t,r){let a=!1,s;return this.run(t,r,i),zc("runSync","run",a),s;function i(o,l){Tc(o),s=l,a=!0}}stringify(t,r){this.freeze();const a=Ts(r),s=this.compiler||this.Compiler;return Qi("stringify",s),Dc(t),s(t,a)}use(t,...r){const a=this.attachers,s=this.namespace;if(Zi("use",this.frozen),t!=null)if(typeof t=="function")c(t,r);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(d){if(typeof d=="function")c(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[u,...m]=d;c(u,m)}else o(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function o(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(d.plugins),d.settings&&(s.settings=Gi(!0,s.settings,d.settings))}function l(d){let u=-1;if(d!=null)if(Array.isArray(d))for(;++u<d.length;){const m=d[u];i(m)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function c(d,u){let m=-1,h=-1;for(;++m<a.length;)if(a[m][0]===d){h=m;break}if(h===-1)a.push([d,...u]);else if(u.length>0){let[p,...x]=u;const y=a[h][1];Ko(y)&&Ko(p)&&(p=Gi(!0,y,p)),a[h]=[d,p,...x]}}}}const Ty=new Vl().freeze();function Xi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Qi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Zi(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Dc(e){if(!Ko(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function zc(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ts(e){return Ey(e)?e:new Rm(e)}function Ey(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Iy(e){return typeof e=="string"||Dy(e)}function Dy(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const zy="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Lc=[],Pc={allowDangerousHtml:!0},Ly=/^(https?|ircs?|mailto|xmpp)$/i,Py=[{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:"className",id:"remove-classname"},{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 Ry(e){const t=Fy(e),r=By(e);return Oy(t.runSync(t.parse(r),r),e)}function Fy(e){const t=e.rehypePlugins||Lc,r=e.remarkPlugins||Lc,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Pc}:Pc;return Ty().use(b4).use(r).use(uy,a).use(t)}function By(e){const t=e.children||"",r=new Rm;return typeof t=="string"&&(r.value=t),r}function Oy(e,t){const r=t.allowedElements,a=t.allowElement,s=t.components,i=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||$y;for(const u of Py)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+zy+u.id,void 0);return Wl(e,d),t2(e,{Fragment:n.Fragment,components:s,ignoreInvalidStyle:!0,jsx:n.jsx,jsxs:n.jsxs,passKeys:!0,passNode:!0});function d(u,m,h){if(u.type==="raw"&&h&&typeof m=="number")return o?h.children.splice(m,1):h.children[m]={type:"text",value:u.value},m;if(u.type==="element"){let p;for(p in Hi)if(Object.hasOwn(Hi,p)&&Object.hasOwn(u.properties,p)){const x=u.properties[p],y=Hi[p];(y===null||y.includes(u.tagName))&&(u.properties[p]=c(String(x||""),p,u))}}if(u.type==="element"){let p=r?!r.includes(u.tagName):i?i.includes(u.tagName):!1;if(!p&&a&&typeof m=="number"&&(p=!a(u,m,h)),p&&h&&typeof m=="number")return l&&u.children?h.children.splice(m,1,...u.children):h.children.splice(m,1),m}}}function $y(e){const t=e.indexOf(":"),r=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||r!==-1&&t>r||a!==-1&&t>a||Ly.test(e.slice(0,t))?e:""}function Rc(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,s=r.indexOf(t);for(;s!==-1;)a++,s=r.indexOf(t,s+t.length);return a}function _y(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function qy(e,t,r){const s=ms((r||{}).ignore||[]),i=Hy(t);let o=-1;for(;++o<i.length;)Ul(e,"text",l);function l(d,u){let m=-1,h;for(;++m<u.length;){const p=u[m],x=h?h.children:void 0;if(s(p,x?x.indexOf(p):void 0,h))return;h=p}if(h)return c(d,u)}function c(d,u){const m=u[u.length-1],h=i[o][0],p=i[o][1];let x=0;const k=m.children.indexOf(d);let w=!1,j=[];h.lastIndex=0;let N=h.exec(d.value);for(;N;){const L=N.index,U={index:N.index,input:N.input,stack:[...u,d]};let I=p(...N,U);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?h.lastIndex=L+1:(x!==L&&j.push({type:"text",value:d.value.slice(x,L)}),Array.isArray(I)?j.push(...I):I&&j.push(I),x=L+N[0].length,w=!0),!h.global)break;N=h.exec(d.value)}return w?(x<d.value.length&&j.push({type:"text",value:d.value.slice(x)}),m.children.splice(k,1,...j)):j=[d],k+j.length}}function Hy(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<r.length;){const s=r[a];t.push([Uy(s[0]),Wy(s[1])])}return t}function Uy(e){return typeof e=="string"?new RegExp(_y(e),"g"):e}function Wy(e){return typeof e=="function"?e:function(){return e}}const eo="phrasing",to=["autolink","link","image","label"];function Vy(){return{transforms:[Zy],enter:{literalAutolink:Ky,literalAutolinkEmail:ro,literalAutolinkHttp:ro,literalAutolinkWww:ro},exit:{literalAutolink:Qy,literalAutolinkEmail:Xy,literalAutolinkHttp:Jy,literalAutolinkWww:Yy}}}function Gy(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:eo,notInConstruct:to},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:eo,notInConstruct:to},{character:":",before:"[ps]",after:"\\/",inConstruct:eo,notInConstruct:to}]}}function Ky(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ro(e){this.config.enter.autolinkProtocol.call(this,e)}function Jy(e){this.config.exit.autolinkProtocol.call(this,e)}function Yy(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Xy(e){this.config.exit.autolinkEmail.call(this,e)}function Qy(e){this.exit(e)}function Zy(e){qy(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ev],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),tv]],{ignore:["link","linkReference"]})}function ev(e,t,r,a,s){let i="";if(!Fm(s)||(/^w/i.test(t)&&(r=t+r,t="",i="http://"),!rv(r)))return!1;const o=nv(r+a);if(!o[0])return!1;const l={type:"link",title:null,url:i+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function tv(e,t,r,a){return!Fm(a,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+r,children:[{type:"text",value:t+"@"+r}]}}function rv(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function nv(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let r=t[0],a=r.indexOf(")");const s=Rc(e,"(");let i=Rc(e,")");for(;a!==-1&&s>i;)e+=r.slice(0,a+1),r=r.slice(a+1),a=r.indexOf(")"),i++;return[e,r]}function Fm(e,t){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Zn(r)||yi(r))&&(!t||r!==47)}Bm.peek=mv;function av(){this.buffer()}function sv(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function iv(){this.buffer()}function ov(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function lv(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=$r(this.sliceSerialize(e)).toLowerCase(),r.label=t}function cv(e){this.exit(e)}function dv(e){const t=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=$r(this.sliceSerialize(e)).toLowerCase(),r.label=t}function uv(e){this.exit(e)}function mv(){return"["}function Bm(e,t,r,a){const s=r.createTracker(a);let i=s.move("[^");const o=r.enter("footnoteReference"),l=r.enter("reference");return i+=s.move(r.safe(r.associationId(e),{after:"]",before:i})),l(),o(),i+=s.move("]"),i}function hv(){return{enter:{gfmFootnoteCallString:av,gfmFootnoteCall:sv,gfmFootnoteDefinitionLabelString:iv,gfmFootnoteDefinition:ov},exit:{gfmFootnoteCallString:lv,gfmFootnoteCall:cv,gfmFootnoteDefinitionLabelString:dv,gfmFootnoteDefinition:uv}}}function pv(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:r,footnoteReference:Bm},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(a,s,i,o){const l=i.createTracker(o);let c=l.move("[^");const d=i.enter("footnoteDefinition"),u=i.enter("label");return c+=l.move(i.safe(i.associationId(a),{before:c,after:"]"})),u(),c+=l.move("]:"),a.children&&a.children.length>0&&(l.shift(4),c+=l.move((t?`
|
|
400
|
-
`:" ")+i.indentLines(i.containerFlow(a,l.current()),t?Om:fv))),d(),c}}function fv(e,t,r){return t===0?e:Om(e,t,r)}function Om(e,t,r){return(r?"":" ")+e}const gv=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$m.peek=kv;function xv(){return{canContainEols:["delete"],enter:{strikethrough:yv},exit:{strikethrough:vv}}}function bv(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gv}],handlers:{delete:$m}}}function yv(e){this.enter({type:"delete",children:[]},e)}function vv(e){this.exit(e)}function $m(e,t,r,a){const s=r.createTracker(a),i=r.enter("strikethrough");let o=s.move("~~");return o+=r.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),i(),o}function kv(){return"~"}function wv(e){return e.length}function jv(e,t){const r=t||{},a=(r.align||[]).concat(),s=r.stringLength||wv,i=[],o=[],l=[],c=[];let d=0,u=-1;for(;++u<e.length;){const y=[],k=[];let w=-1;for(e[u].length>d&&(d=e[u].length);++w<e[u].length;){const j=Nv(e[u][w]);if(r.alignDelimiters!==!1){const N=s(j);k[w]=N,(c[w]===void 0||N>c[w])&&(c[w]=N)}y.push(j)}o[u]=y,l[u]=k}let m=-1;if(typeof a=="object"&&"length"in a)for(;++m<d;)i[m]=Fc(a[m]);else{const y=Fc(a);for(;++m<d;)i[m]=y}m=-1;const h=[],p=[];for(;++m<d;){const y=i[m];let k="",w="";y===99?(k=":",w=":"):y===108?k=":":y===114&&(w=":");let j=r.alignDelimiters===!1?1:Math.max(1,c[m]-k.length-w.length);const N=k+"-".repeat(j)+w;r.alignDelimiters!==!1&&(j=k.length+j+w.length,j>c[m]&&(c[m]=j),p[m]=j),h[m]=N}o.splice(1,0,h),l.splice(1,0,p),u=-1;const x=[];for(;++u<o.length;){const y=o[u],k=l[u];m=-1;const w=[];for(;++m<d;){const j=y[m]||"";let N="",L="";if(r.alignDelimiters!==!1){const U=c[m]-(k[m]||0),I=i[m];I===114?N=" ".repeat(U):I===99?U%2?(N=" ".repeat(U/2+.5),L=" ".repeat(U/2-.5)):(N=" ".repeat(U/2),L=N):L=" ".repeat(U)}r.delimiterStart!==!1&&!m&&w.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&j==="")&&(r.delimiterStart!==!1||m)&&w.push(" "),r.alignDelimiters!==!1&&w.push(N),w.push(j),r.alignDelimiters!==!1&&w.push(L),r.padding!==!1&&w.push(" "),(r.delimiterEnd!==!1||m!==d-1)&&w.push("|")}x.push(r.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return x.join(`
|
|
401
|
-
`)}function Nv(e){return e==null?"":String(e)}function Fc(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Sv(e,t,r,a){const s=r.enter("blockquote"),i=r.createTracker(a);i.move("> "),i.shift(2);const o=r.indentLines(r.containerFlow(e,i.current()),Cv);return s(),o}function Cv(e,t,r){return">"+(r?"":" ")+e}function Mv(e,t){return Bc(e,t.inConstruct,!0)&&!Bc(e,t.notInConstruct,!1)}function Bc(e,t,r){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return r;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function Oc(e,t,r,a){let s=-1;for(;++s<r.unsafe.length;)if(r.unsafe[s].character===`
|
|
402
|
-
`&&Mv(r.stack,r.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
403
|
-
`}function _m(e,t){const r=String(e);let a=r.indexOf(t),s=a,i=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===s?++i>o&&(o=i):i=1,s=a+t.length,a=r.indexOf(t,s);return o}function Av(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Tv(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Ev(e,t,r,a){const s=Tv(r),i=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(Av(e,r)){const m=r.enter("codeIndented"),h=r.indentLines(i,Iv);return m(),h}const l=r.createTracker(a),c=s.repeat(Math.max(_m(i,s)+1,3)),d=r.enter("codeFenced");let u=l.move(c);if(e.lang){const m=r.enter(`codeFencedLang${o}`);u+=l.move(r.safe(e.lang,{before:u,after:" ",encode:["`"],...l.current()})),m()}if(e.lang&&e.meta){const m=r.enter(`codeFencedMeta${o}`);u+=l.move(" "),u+=l.move(r.safe(e.meta,{before:u,after:`
|
|
404
|
-
`,encode:["`"],...l.current()})),m()}return u+=l.move(`
|
|
405
|
-
`),i&&(u+=l.move(i+`
|
|
406
|
-
`)),u+=l.move(c),d(),u}function Iv(e,t,r){return(r?"":" ")+e}function Gl(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Dv(e,t,r,a){const s=Gl(r),i=s==='"'?"Quote":"Apostrophe",o=r.enter("definition");let l=r.enter("label");const c=r.createTracker(a);let d=c.move("[");return d+=c.move(r.safe(r.associationId(e),{before:d,after:"]",...c.current()})),d+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=r.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(r.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=r.enter("destinationRaw"),d+=c.move(r.safe(e.url,{before:d,after:e.title?" ":`
|
|
407
|
-
`,...c.current()}))),l(),e.title&&(l=r.enter(`title${i}`),d+=c.move(" "+s),d+=c.move(r.safe(e.title,{before:d,after:s,...c.current()})),d+=c.move(s),l()),o(),d}function zv(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function es(e){return"&#x"+e.toString(16).toUpperCase()+";"}function ni(e,t,r){const a=ya(e),s=ya(t);return a===void 0?s===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}qm.peek=Lv;function qm(e,t,r,a){const s=zv(r),i=r.enter("emphasis"),o=r.createTracker(a),l=o.move(s);let c=o.move(r.containerPhrasing(e,{after:s,before:l,...o.current()}));const d=c.charCodeAt(0),u=ni(a.before.charCodeAt(a.before.length-1),d,s);u.inside&&(c=es(d)+c.slice(1));const m=c.charCodeAt(c.length-1),h=ni(a.after.charCodeAt(0),m,s);h.inside&&(c=c.slice(0,-1)+es(m));const p=o.move(s);return i(),r.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},l+c+p}function Lv(e,t,r){return r.options.emphasis||"*"}function Pv(e,t){let r=!1;return Wl(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return r=!0,Vo}),!!((!e.depth||e.depth<3)&&Fl(e)&&(t.options.setext||r))}function Rv(e,t,r,a){const s=Math.max(Math.min(6,e.depth||1),1),i=r.createTracker(a);if(Pv(e,r)){const u=r.enter("headingSetext"),m=r.enter("phrasing"),h=r.containerPhrasing(e,{...i.current(),before:`
|
|
408
|
-
`,after:`
|
|
409
|
-
`});return m(),u(),h+`
|
|
410
|
-
`+(s===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
411
|
-
`))+1))}const o="#".repeat(s),l=r.enter("headingAtx"),c=r.enter("phrasing");i.move(o+" ");let d=r.containerPhrasing(e,{before:"# ",after:`
|
|
412
|
-
`,...i.current()});return/^[\t ]/.test(d)&&(d=es(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,r.options.closeAtx&&(d+=" "+o),c(),l(),d}Hm.peek=Fv;function Hm(e){return e.value||""}function Fv(){return"<"}Um.peek=Bv;function Um(e,t,r,a){const s=Gl(r),i=s==='"'?"Quote":"Apostrophe",o=r.enter("image");let l=r.enter("label");const c=r.createTracker(a);let d=c.move("![");return d+=c.move(r.safe(e.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=r.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(r.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=r.enter("destinationRaw"),d+=c.move(r.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=r.enter(`title${i}`),d+=c.move(" "+s),d+=c.move(r.safe(e.title,{before:d,after:s,...c.current()})),d+=c.move(s),l()),d+=c.move(")"),o(),d}function Bv(){return"!"}Wm.peek=Ov;function Wm(e,t,r,a){const s=e.referenceType,i=r.enter("imageReference");let o=r.enter("label");const l=r.createTracker(a);let c=l.move("![");const d=r.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),o();const u=r.stack;r.stack=[],o=r.enter("reference");const m=r.safe(r.associationId(e),{before:c,after:"]",...l.current()});return o(),r.stack=u,i(),s==="full"||!d||d!==m?c+=l.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Ov(){return"!"}Vm.peek=$v;function Vm(e,t,r){let a=e.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(a);)s+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++i<r.unsafe.length;){const o=r.unsafe[i],l=r.compilePattern(o);let c;if(o.atBreak)for(;c=l.exec(a);){let d=c.index;a.charCodeAt(d)===10&&a.charCodeAt(d-1)===13&&d--,a=a.slice(0,d)+" "+a.slice(c.index+1)}}return s+a+s}function $v(){return"`"}function Gm(e,t){const r=Fl(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Km.peek=_v;function Km(e,t,r,a){const s=Gl(r),i=s==='"'?"Quote":"Apostrophe",o=r.createTracker(a);let l,c;if(Gm(e,r)){const u=r.stack;r.stack=[],l=r.enter("autolink");let m=o.move("<");return m+=o.move(r.containerPhrasing(e,{before:m,after:">",...o.current()})),m+=o.move(">"),l(),r.stack=u,m}l=r.enter("link"),c=r.enter("label");let d=o.move("[");return d+=o.move(r.containerPhrasing(e,{before:d,after:"](",...o.current()})),d+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=r.enter("destinationLiteral"),d+=o.move("<"),d+=o.move(r.safe(e.url,{before:d,after:">",...o.current()})),d+=o.move(">")):(c=r.enter("destinationRaw"),d+=o.move(r.safe(e.url,{before:d,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=r.enter(`title${i}`),d+=o.move(" "+s),d+=o.move(r.safe(e.title,{before:d,after:s,...o.current()})),d+=o.move(s),c()),d+=o.move(")"),l(),d}function _v(e,t,r){return Gm(e,r)?"<":"["}Jm.peek=qv;function Jm(e,t,r,a){const s=e.referenceType,i=r.enter("linkReference");let o=r.enter("label");const l=r.createTracker(a);let c=l.move("[");const d=r.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),o();const u=r.stack;r.stack=[],o=r.enter("reference");const m=r.safe(r.associationId(e),{before:c,after:"]",...l.current()});return o(),r.stack=u,i(),s==="full"||!d||d!==m?c+=l.move(m+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function qv(){return"["}function Kl(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Hv(e){const t=Kl(e),r=e.options.bulletOther;if(!r)return t==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+r+"`) to be different");return r}function Uv(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ym(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Wv(e,t,r,a){const s=r.enter("list"),i=r.bulletCurrent;let o=e.ordered?Uv(r):Kl(r);const l=e.ordered?o==="."?")":".":Hv(r);let c=t&&r.bulletLastUsed?o===r.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(c=!0),Ym(r)===o&&u){let m=-1;for(;++m<e.children.length;){const h=e.children[m];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=l),r.bulletCurrent=o;const d=r.containerFlow(e,a);return r.bulletLastUsed=o,r.bulletCurrent=i,s(),d}function Vv(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Gv(e,t,r,a){const s=Vv(r);let i=r.bulletCurrent||Kl(r);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(r.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let o=i.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=r.createTracker(a);l.move(i+" ".repeat(o-i.length)),l.shift(o);const c=r.enter("listItem"),d=r.indentLines(r.containerFlow(e,l.current()),u);return c(),d;function u(m,h,p){return h?(p?"":" ".repeat(o))+m:(p?i:i+" ".repeat(o-i.length))+m}}function Kv(e,t,r,a){const s=r.enter("paragraph"),i=r.enter("phrasing"),o=r.containerPhrasing(e,a);return i(),s(),o}const Jv=ms(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Yv(e,t,r,a){return(e.children.some(function(o){return Jv(o)})?r.containerPhrasing:r.containerFlow).call(r,e,a)}function Xv(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Xm.peek=Qv;function Xm(e,t,r,a){const s=Xv(r),i=r.enter("strong"),o=r.createTracker(a),l=o.move(s+s);let c=o.move(r.containerPhrasing(e,{after:s,before:l,...o.current()}));const d=c.charCodeAt(0),u=ni(a.before.charCodeAt(a.before.length-1),d,s);u.inside&&(c=es(d)+c.slice(1));const m=c.charCodeAt(c.length-1),h=ni(a.after.charCodeAt(0),m,s);h.inside&&(c=c.slice(0,-1)+es(m));const p=o.move(s+s);return i(),r.attentionEncodeSurroundingInfo={after:h.outside,before:u.outside},l+c+p}function Qv(e,t,r){return r.options.strong||"*"}function Zv(e,t,r,a){return r.safe(e.value,a)}function e5(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function t5(e,t,r){const a=(Ym(r)+(r.options.ruleSpaces?" ":"")).repeat(e5(r));return r.options.ruleSpaces?a.slice(0,-1):a}const Qm={blockquote:Sv,break:Oc,code:Ev,definition:Dv,emphasis:qm,hardBreak:Oc,heading:Rv,html:Hm,image:Um,imageReference:Wm,inlineCode:Vm,link:Km,linkReference:Jm,list:Wv,listItem:Gv,paragraph:Kv,root:Yv,strong:Xm,text:Zv,thematicBreak:t5};function r5(){return{enter:{table:n5,tableData:$c,tableHeader:$c,tableRow:s5},exit:{codeText:i5,table:a5,tableData:no,tableHeader:no,tableRow:no}}}function n5(e){const t=e._align;this.enter({type:"table",align:t.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function a5(e){this.exit(e),this.data.inTable=void 0}function s5(e){this.enter({type:"tableRow",children:[]},e)}function no(e){this.exit(e)}function $c(e){this.enter({type:"tableCell",children:[]},e)}function i5(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,o5));const r=this.stack[this.stack.length-1];r.type,r.value=t,this.exit(e)}function o5(e,t){return t==="|"?t:e}function l5(e){const t=e||{},r=t.tableCellPadding,a=t.tablePipeAlign,s=t.stringLength,i=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
413
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:c,tableRow:l}};function o(p,x,y,k){return d(u(p,y,k),p.align)}function l(p,x,y,k){const w=m(p,y,k),j=d([w]);return j.slice(0,j.indexOf(`
|
|
414
|
-
`))}function c(p,x,y,k){const w=y.enter("tableCell"),j=y.enter("phrasing"),N=y.containerPhrasing(p,{...k,before:i,after:i});return j(),w(),N}function d(p,x){return jv(p,{align:x,alignDelimiters:a,padding:r,stringLength:s})}function u(p,x,y){const k=p.children;let w=-1;const j=[],N=x.enter("table");for(;++w<k.length;)j[w]=m(k[w],x,y);return N(),j}function m(p,x,y){const k=p.children;let w=-1;const j=[],N=x.enter("tableRow");for(;++w<k.length;)j[w]=c(k[w],p,x,y);return N(),j}function h(p,x,y){let k=Qm.inlineCode(p,x,y);return y.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function c5(){return{exit:{taskListCheckValueChecked:_c,taskListCheckValueUnchecked:_c,paragraph:u5}}}function d5(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:m5}}}function _c(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function u5(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const a=r.children[0];if(a&&a.type==="text"){const s=t.children;let i=-1,o;for(;++i<s.length;){const l=s[i];if(l.type==="paragraph"){o=l;break}}o===r&&(a.value=a.value.slice(1),a.value.length===0?r.children.shift():r.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,r.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function m5(e,t,r,a){const s=e.children[0],i=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=r.createTracker(a);i&&l.move(o);let c=Qm.listItem(e,t,r,{...a,...l.current()});return i&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),c;function d(u){return u+o}}function h5(){return[Vy(),hv(),xv(),r5(),c5()]}function p5(e){return{extensions:[Gy(),pv(e),bv(),l5(e),d5()]}}const f5={tokenize:k5,partial:!0},Zm={tokenize:w5,partial:!0},eh={tokenize:j5,partial:!0},th={tokenize:N5,partial:!0},g5={tokenize:S5,partial:!0},rh={name:"wwwAutolink",tokenize:y5,previous:ah},nh={name:"protocolAutolink",tokenize:v5,previous:sh},bn={name:"emailAutolink",tokenize:b5,previous:ih},Yr={};function x5(){return{text:Yr}}let Hn=48;for(;Hn<123;)Yr[Hn]=bn,Hn++,Hn===58?Hn=65:Hn===91&&(Hn=97);Yr[43]=bn;Yr[45]=bn;Yr[46]=bn;Yr[95]=bn;Yr[72]=[bn,nh];Yr[104]=[bn,nh];Yr[87]=[bn,rh];Yr[119]=[bn,rh];function b5(e,t,r){const a=this;let s,i;return o;function o(m){return!Yo(m)||!ih.call(a,a.previous)||Jl(a.events)?r(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(m))}function l(m){return Yo(m)?(e.consume(m),l):m===64?(e.consume(m),c):r(m)}function c(m){return m===46?e.check(g5,u,d)(m):m===45||m===95||Zt(m)?(i=!0,e.consume(m),c):u(m)}function d(m){return e.consume(m),s=!0,c}function u(m){return i&&s&&ar(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):r(m)}}function y5(e,t,r){const a=this;return s;function s(o){return o!==87&&o!==119||!ah.call(a,a.previous)||Jl(a.events)?r(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(f5,e.attempt(Zm,e.attempt(eh,i),r),r)(o))}function i(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function v5(e,t,r){const a=this;let s="",i=!1;return o;function o(m){return(m===72||m===104)&&sh.call(a,a.previous)&&!Jl(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(m),e.consume(m),l):r(m)}function l(m){if(ar(m)&&s.length<5)return s+=String.fromCodePoint(m),e.consume(m),l;if(m===58){const h=s.toLowerCase();if(h==="http"||h==="https")return e.consume(m),c}return r(m)}function c(m){return m===47?(e.consume(m),i?d:(i=!0,c)):r(m)}function d(m){return m===null||ei(m)||At(m)||Zn(m)||yi(m)?r(m):e.attempt(Zm,e.attempt(eh,u),r)(m)}function u(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function k5(e,t,r){let a=0;return s;function s(o){return(o===87||o===119)&&a<3?(a++,e.consume(o),s):o===46&&a===3?(e.consume(o),i):r(o)}function i(o){return o===null?r(o):t(o)}}function w5(e,t,r){let a,s,i;return o;function o(d){return d===46||d===95?e.check(th,c,l)(d):d===null||At(d)||Zn(d)||d!==45&&yi(d)?c(d):(i=!0,e.consume(d),o)}function l(d){return d===95?a=!0:(s=a,a=void 0),e.consume(d),o}function c(d){return s||a||!i?r(d):t(d)}}function j5(e,t){let r=0,a=0;return s;function s(o){return o===40?(r++,e.consume(o),s):o===41&&a<r?i(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(th,t,i)(o):o===null||At(o)||Zn(o)?t(o):(e.consume(o),s)}function i(o){return o===41&&a++,e.consume(o),s}}function N5(e,t,r){return a;function a(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),a):l===38?(e.consume(l),i):l===93?(e.consume(l),s):l===60||l===null||At(l)||Zn(l)?t(l):r(l)}function s(l){return l===null||l===40||l===91||At(l)||Zn(l)?t(l):a(l)}function i(l){return ar(l)?o(l):r(l)}function o(l){return l===59?(e.consume(l),a):ar(l)?(e.consume(l),o):r(l)}}function S5(e,t,r){return a;function a(i){return e.consume(i),s}function s(i){return Zt(i)?r(i):t(i)}}function ah(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||At(e)}function sh(e){return!ar(e)}function ih(e){return!(e===47||Yo(e))}function Yo(e){return e===43||e===45||e===46||e===95||Zt(e)}function Jl(e){let t=e.length,r=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){r=!0;break}if(a._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const C5={tokenize:L5,partial:!0};function M5(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:I5,continuation:{tokenize:D5},exit:z5}},text:{91:{name:"gfmFootnoteCall",tokenize:E5},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:A5,resolveTo:T5}}}}function A5(e,t,r){const a=this;let s=a.events.length;const i=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o;for(;s--;){const c=a.events[s][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return r(c);const d=$r(a.sliceSerialize({start:o.end,end:a.now()}));return d.codePointAt(0)!==94||!i.includes(d.slice(1))?r(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function T5(e,t){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[e[r+1],e[r+2],["enter",a,t],e[r+3],e[r+4],["enter",s,t],["exit",s,t],["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(r,e.length-r+1,...l),e}function E5(e,t,r){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let i=0,o;return l;function l(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),c}function c(m){return m!==94?r(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(i>999||m===93&&!o||m===null||m===91||At(m))return r(m);if(m===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return s.includes($r(a.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):r(m)}return At(m)||(o=!0),i++,e.consume(m),m===92?u:d}function u(m){return m===91||m===92||m===93?(e.consume(m),i++,d):d(m)}}function I5(e,t,r){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let i,o=0,l;return c;function c(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):r(x)}function u(x){if(o>999||x===93&&!l||x===null||x===91||At(x))return r(x);if(x===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return i=$r(a.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return At(x)||(l=!0),o++,e.consume(x),x===92?m:u}function m(x){return x===91||x===92||x===93?(e.consume(x),o++,u):u(x)}function h(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(i)||s.push(i),ht(e,p,"gfmFootnoteDefinitionWhitespace")):r(x)}function p(x){return t(x)}}function D5(e,t,r){return e.check(us,t,e.attempt(C5,t,r))}function z5(e){e.exit("gfmFootnoteDefinition")}function L5(e,t,r){const a=this;return ht(e,s,"gfmFootnoteDefinitionIndent",5);function s(i){const o=a.events[a.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(i):r(i)}}function P5(e){let r=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:i,resolveAll:s};return r==null&&(r=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(o,l){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let d=c;for(;d--;)if(o[d][0]==="exit"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[d][1].end.offset-o[d][1].start.offset){o[c][1].type="strikethroughSequence",o[d][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[d][1].start),end:Object.assign({},o[c][1].end)},m={type:"strikethroughText",start:Object.assign({},o[d][1].end),end:Object.assign({},o[c][1].start)},h=[["enter",u,l],["enter",o[d][1],l],["exit",o[d][1],l],["enter",m,l]],p=l.parser.constructs.insideSpan.null;p&&kr(h,h.length,0,vi(p,o.slice(d+1,c),l)),kr(h,h.length,0,[["exit",m,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",u,l]]),kr(o,d-1,c-d+3,h),c=d+h.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function i(o,l,c){const d=this.previous,u=this.events;let m=0;return h;function h(x){return d===126&&u[u.length-1][1].type!=="characterEscape"?c(x):(o.enter("strikethroughSequenceTemporary"),p(x))}function p(x){const y=ya(d);if(x===126)return m>1?c(x):(o.consume(x),m++,p);if(m<2&&!r)return c(x);const k=o.exit("strikethroughSequenceTemporary"),w=ya(x);return k._open=!w||w===2&&!!y,k._close=!y||y===2&&!!w,l(x)}}}class R5{constructor(){this.map=[]}add(t,r,a){F5(this,t,r,a)}consume(t){if(this.map.sort(function(i,o){return i[0]-o[0]}),this.map.length===0)return;let r=this.map.length;const a=[];for(;r>0;)r-=1,a.push(t.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),t.length=this.map[r][0];a.push(t.slice()),t.length=0;let s=a.pop();for(;s;){for(const i of s)t.push(i);s=a.pop()}this.map.length=0}}function F5(e,t,r,a){let s=0;if(!(r===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=r,e.map[s][2].push(...a);return}s+=1}e.map.push([t,r,a])}}function B5(e,t){let r=!1;const a=[];for(;t<e.length;){const s=e[t];if(r){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const i=a.length-1;a[i]=a[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(r=!0);t+=1}return a}function O5(){return{flow:{null:{name:"table",tokenize:$5,resolveAll:_5}}}}function $5(e,t,r){const a=this;let s=0,i=0,o;return l;function l(M){let _=a.events.length-1;for(;_>-1;){const T=a.events[_][1].type;if(T==="lineEnding"||T==="linePrefix")_--;else break}const O=_>-1?a.events[_][1].type:null,V=O==="tableHead"||O==="tableRow"?I:c;return V===I&&a.parser.lazy[a.now().line]?r(M):V(M)}function c(M){return e.enter("tableHead"),e.enter("tableRow"),d(M)}function d(M){return M===124||(o=!0,i+=1),u(M)}function u(M){return M===null?r(M):$e(M)?i>1?(i=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),p):r(M):gt(M)?ht(e,u,"whitespace")(M):(i+=1,o&&(o=!1,s+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),m(M)))}function m(M){return M===null||M===124||At(M)?(e.exit("data"),u(M)):(e.consume(M),M===92?h:m)}function h(M){return M===92||M===124?(e.consume(M),m):m(M)}function p(M){return a.interrupt=!1,a.parser.lazy[a.now().line]?r(M):(e.enter("tableDelimiterRow"),o=!1,gt(M)?ht(e,x,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):x(M))}function x(M){return M===45||M===58?k(M):M===124?(o=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),y):U(M)}function y(M){return gt(M)?ht(e,k,"whitespace")(M):k(M)}function k(M){return M===58?(i+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),w):M===45?(i+=1,w(M)):M===null||$e(M)?L(M):U(M)}function w(M){return M===45?(e.enter("tableDelimiterFiller"),j(M)):U(M)}function j(M){return M===45?(e.consume(M),j):M===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),N):(e.exit("tableDelimiterFiller"),N(M))}function N(M){return gt(M)?ht(e,L,"whitespace")(M):L(M)}function L(M){return M===124?x(M):M===null||$e(M)?!o||s!==i?U(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):U(M)}function U(M){return r(M)}function I(M){return e.enter("tableRow"),H(M)}function H(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),H):M===null||$e(M)?(e.exit("tableRow"),t(M)):gt(M)?ht(e,H,"whitespace")(M):(e.enter("data"),F(M))}function F(M){return M===null||M===124||At(M)?(e.exit("data"),H(M)):(e.consume(M),M===92?W:F)}function W(M){return M===92||M===124?(e.consume(M),F):F(M)}}function _5(e,t){let r=-1,a=!0,s=0,i=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,d,u,m;const h=new R5;for(;++r<e.length;){const p=e[r],x=p[1];p[0]==="enter"?x.type==="tableHead"?(l=!1,c!==0&&(qc(h,t,c,d,u),u=void 0,c=0),d={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},h.add(r,0,[["enter",d,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(a=!0,m=void 0,i=[0,0,0,0],o=[0,r+1,0,0],l&&(l=!1,u={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},h.add(r,0,[["enter",u,t]])),s=x.type==="tableDelimiterRow"?2:u?3:1):s&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(a=!1,o[2]===0&&(i[1]!==0&&(o[0]=o[1],m=Es(h,t,i,s,void 0,m),i=[0,0,0,0]),o[2]=r)):x.type==="tableCellDivider"&&(a?a=!1:(i[1]!==0&&(o[0]=o[1],m=Es(h,t,i,s,void 0,m)),i=o,o=[i[1],r,0,0])):x.type==="tableHead"?(l=!0,c=r):x.type==="tableRow"||x.type==="tableDelimiterRow"?(c=r,i[1]!==0?(o[0]=o[1],m=Es(h,t,i,s,r,m)):o[1]!==0&&(m=Es(h,t,o,s,r,m)),s=0):s&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(o[3]=r)}for(c!==0&&qc(h,t,c,d,u),h.consume(t.events),r=-1;++r<t.events.length;){const p=t.events[r];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=B5(t.events,r))}return e}function Es(e,t,r,a,s,i){const o=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",l="tableContent";r[0]!==0&&(i.end=Object.assign({},ua(t.events,r[0])),e.add(r[0],0,[["exit",i,t]]));const c=ua(t.events,r[1]);if(i={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(r[1],0,[["enter",i,t]]),r[2]!==0){const d=ua(t.events,r[2]),u=ua(t.events,r[3]),m={type:l,start:Object.assign({},d),end:Object.assign({},u)};if(e.add(r[2],0,[["enter",m,t]]),a!==2){const h=t.events[r[2]],p=t.events[r[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",r[3]>r[2]+1){const x=r[2]+1,y=r[3]-r[2]-1;e.add(x,y,[])}}e.add(r[3]+1,0,[["exit",m,t]])}return s!==void 0&&(i.end=Object.assign({},ua(t.events,s)),e.add(s,0,[["exit",i,t]]),i=void 0),i}function qc(e,t,r,a,s){const i=[],o=ua(t.events,r);s&&(s.end=Object.assign({},o),i.push(["exit",s,t])),a.end=Object.assign({},o),i.push(["exit",a,t]),e.add(r+1,0,i)}function ua(e,t){const r=e[t],a=r[0]==="enter"?"start":"end";return r[1][a]}const q5={name:"tasklistCheck",tokenize:U5};function H5(){return{text:{91:q5}}}function U5(e,t,r){const a=this;return s;function s(c){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?r(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),i)}function i(c){return At(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):r(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):r(c)}function l(c){return $e(c)?t(c):gt(c)?e.check({tokenize:W5},t,r)(c):r(c)}}function W5(e,t,r){return ht(e,a,"whitespace");function a(s){return s===null?r(s):t(s)}}function V5(e){return gm([x5(),M5(),P5(e),O5(),H5()])}const G5={};function K5(e){const t=this,r=e||G5,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),i=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),o=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(V5(r)),i.push(h5()),o.push(p5(r))}function J5(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:i},exit:{mathFlow:s,mathFlowFence:a,mathFlowFenceMeta:r,mathFlowValue:l,mathText:o,mathTextData:l}};function e(c){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},c)}function t(){this.buffer()}function r(){const c=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=c}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(c){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),u=this.stack[this.stack.length-1];u.type,this.exit(c),u.value=d;const m=u.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function i(c){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},c),this.buffer()}function o(c){const d=this.resume(),u=this.stack[this.stack.length-1];u.type,this.exit(c),u.value=d,u.data.hChildren.push({type:"text",value:d})}function l(c){this.config.enter.data.call(this,c),this.config.exit.data.call(this,c)}}function Y5(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
|
415
|
-
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:r,inlineMath:a}};function r(i,o,l,c){const d=i.value||"",u=l.createTracker(c),m="$".repeat(Math.max(_m(d,"$")+1,2)),h=l.enter("mathFlow");let p=u.move(m);if(i.meta){const x=l.enter("mathFlowMeta");p+=u.move(l.safe(i.meta,{after:`
|
|
416
|
-
`,before:p,encode:["$"],...u.current()})),x()}return p+=u.move(`
|
|
417
|
-
`),d&&(p+=u.move(d+`
|
|
418
|
-
`)),p+=u.move(m),h(),p}function a(i,o,l){let c=i.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(c);)d++;const u="$".repeat(d);/[^ \r\n]/.test(c)&&(/^[ \r\n]/.test(c)&&/[ \r\n]$/.test(c)||/^\$|\$$/.test(c))&&(c=" "+c+" ");let m=-1;for(;++m<l.unsafe.length;){const h=l.unsafe[m];if(!h.atBreak)continue;const p=l.compilePattern(h);let x;for(;x=p.exec(c);){let y=x.index;c.codePointAt(y)===10&&c.codePointAt(y-1)===13&&y--,c=c.slice(0,y)+" "+c.slice(x.index+1)}}return u+c+u}function s(){return"$"}}const X5={tokenize:Q5,concrete:!0,name:"mathFlow"},Hc={tokenize:Z5,partial:!0};function Q5(e,t,r){const a=this,s=a.events[a.events.length-1],i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0;let o=0;return l;function l(j){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),c(j)}function c(j){return j===36?(e.consume(j),o++,c):o<2?r(j):(e.exit("mathFlowFenceSequence"),ht(e,d,"whitespace")(j))}function d(j){return j===null||$e(j)?m(j):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),u(j))}function u(j){return j===null||$e(j)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),m(j)):j===36?r(j):(e.consume(j),u)}function m(j){return e.exit("mathFlowFence"),a.interrupt?t(j):e.attempt(Hc,h,k)(j)}function h(j){return e.attempt({tokenize:w,partial:!0},k,p)(j)}function p(j){return(i?ht(e,x,"linePrefix",i+1):x)(j)}function x(j){return j===null?k(j):$e(j)?e.attempt(Hc,h,k)(j):(e.enter("mathFlowValue"),y(j))}function y(j){return j===null||$e(j)?(e.exit("mathFlowValue"),x(j)):(e.consume(j),y)}function k(j){return e.exit("mathFlow"),t(j)}function w(j,N,L){let U=0;return ht(j,I,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function I(W){return j.enter("mathFlowFence"),j.enter("mathFlowFenceSequence"),H(W)}function H(W){return W===36?(U++,j.consume(W),H):U<o?L(W):(j.exit("mathFlowFenceSequence"),ht(j,F,"whitespace")(W))}function F(W){return W===null||$e(W)?(j.exit("mathFlowFence"),N(W)):L(W)}}}function Z5(e,t,r){const a=this;return s;function s(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return a.parser.lazy[a.now().line]?r(o):t(o)}}function e3(e){let r=(e||{}).singleDollarTextMath;return r==null&&(r=!0),{tokenize:a,resolve:t3,previous:r3,name:"mathText"};function a(s,i,o){let l=0,c,d;return u;function u(y){return s.enter("mathText"),s.enter("mathTextSequence"),m(y)}function m(y){return y===36?(s.consume(y),l++,m):l<2&&!r?o(y):(s.exit("mathTextSequence"),h(y))}function h(y){return y===null?o(y):y===36?(d=s.enter("mathTextSequence"),c=0,x(y)):y===32?(s.enter("space"),s.consume(y),s.exit("space"),h):$e(y)?(s.enter("lineEnding"),s.consume(y),s.exit("lineEnding"),h):(s.enter("mathTextData"),p(y))}function p(y){return y===null||y===32||y===36||$e(y)?(s.exit("mathTextData"),h(y)):(s.consume(y),p)}function x(y){return y===36?(s.consume(y),c++,x):c===l?(s.exit("mathTextSequence"),s.exit("mathText"),i(y)):(d.type="mathTextData",p(y))}}}function t3(e){let t=e.length-4,r=3,a,s;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=r;++a<t;)if(e[a][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[r][1].type="mathTextPadding",r+=2,t-=2;break}}for(a=r-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="mathTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function r3(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function n3(e){return{flow:{36:X5},text:{36:e3(e)}}}class pr{constructor(t,r,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=r,this.end=a}static range(t,r){return r?!t||!t.loc||!r.loc||t.loc.lexer!==r.loc.lexer?null:new pr(t.loc.lexer,t.loc.start,r.loc.end):t&&t.loc}}class wr{constructor(t,r){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=r}range(t,r){return new wr(r,pr.range(this,t))}}class ge{constructor(t,r){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var a="KaTeX parse error: "+t,s,i,o=r&&r.loc;if(o&&o.start<=o.end){var l=o.lexer.input;s=o.start,i=o.end,s===l.length?a+=" at end of input: ":a+=" at position "+(s+1)+": ";var c=l.slice(s,i).replace(/[^]/g,"$&̲"),d;s>15?d="…"+l.slice(s-15,s):d=l.slice(0,s);var u;i+15<l.length?u=l.slice(i,i+15)+"…":u=l.slice(i),a+=d+c+u}var m=new Error(a);return m.name="ParseError",m.__proto__=ge.prototype,m.position=s,s!=null&&i!=null&&(m.length=i-s),m.rawMessage=t,m}}ge.prototype.__proto__=Error.prototype;var a3=function(t,r){return t===void 0?r:t},s3=/([A-Z])/g,i3=function(t){return t.replace(s3,"-$1").toLowerCase()},o3={"&":"&",">":">","<":"<",'"':""","'":"'"},l3=/[&><"']/g;function c3(e){return String(e).replace(l3,t=>o3[t])}var oh=function e(t){return t.type==="ordgroup"||t.type==="color"?t.body.length===1?e(t.body[0]):t:t.type==="font"?e(t.body):t},d3=function(t){var r=oh(t);return r.type==="mathord"||r.type==="textord"||r.type==="atom"},u3=function(t){if(!t)throw new Error("Expected non-null, but got "+String(t));return t},m3=function(t){var r=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t);return r?r[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(r[1])?null:r[1].toLowerCase():"_relative"},kt={deflt:a3,escape:c3,hyphenate:i3,getBaseElem:oh,isCharacterBox:d3,protocolFromUrl:m3},Vs={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function h3(e){if(e.default)return e.default;var t=e.type,r=Array.isArray(t)?t[0]:t;if(typeof r!="string")return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}let Yl=class{constructor(t){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var r in Vs)if(Vs.hasOwnProperty(r)){var a=Vs[r];this[r]=t[r]!==void 0?a.processor?a.processor(t[r]):t[r]:h3(a)}}reportNonstrict(t,r,a){var s=this.strict;if(typeof s=="function"&&(s=s(t,r,a)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new ge("LaTeX-incompatible input and strict mode is set to 'error': "+(r+" ["+t+"]"),a);s==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+r+" ["+t+"]"))}}useStrictBehavior(t,r,a){var s=this.strict;if(typeof s=="function")try{s=s(t,r,a)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(r+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+s+"': "+r+" ["+t+"]")),!1)}isTrusted(t){if(t.url&&!t.protocol){var r=kt.protocolFromUrl(t.url);if(r==null)return!1;t.protocol=r}var a=typeof this.trust=="function"?this.trust(t):this.trust;return!!a}};class Sn{constructor(t,r,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=r,this.cramped=a}sup(){return Ur[p3[this.id]]}sub(){return Ur[f3[this.id]]}fracNum(){return Ur[g3[this.id]]}fracDen(){return Ur[x3[this.id]]}cramp(){return Ur[b3[this.id]]}text(){return Ur[y3[this.id]]}isTight(){return this.size>=2}}var Xl=0,ai=1,pa=2,dn=3,ts=4,Er=5,va=6,sr=7,Ur=[new Sn(Xl,0,!1),new Sn(ai,0,!0),new Sn(pa,1,!1),new Sn(dn,1,!0),new Sn(ts,2,!1),new Sn(Er,2,!0),new Sn(va,3,!1),new Sn(sr,3,!0)],p3=[ts,Er,ts,Er,va,sr,va,sr],f3=[Er,Er,Er,Er,sr,sr,sr,sr],g3=[pa,dn,ts,Er,va,sr,va,sr],x3=[dn,dn,Er,Er,sr,sr,sr,sr],b3=[ai,ai,dn,dn,Er,Er,sr,sr],y3=[Xl,ai,pa,dn,pa,dn,pa,dn],Je={DISPLAY:Ur[Xl],TEXT:Ur[pa],SCRIPT:Ur[ts],SCRIPTSCRIPT:Ur[va]},Xo=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function v3(e){for(var t=0;t<Xo.length;t++)for(var r=Xo[t],a=0;a<r.blocks.length;a++){var s=r.blocks[a];if(e>=s[0]&&e<=s[1])return r.name}return null}var Gs=[];Xo.forEach(e=>e.blocks.forEach(t=>Gs.push(...t)));function lh(e){for(var t=0;t<Gs.length;t+=2)if(e>=Gs[t]&&e<=Gs[t+1])return!0;return!1}var ca=80,k3=function(t,r){return"M95,"+(622+t+r)+`
|
|
419
|
-
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
420
|
-
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
421
|
-
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
|
422
|
-
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
423
|
-
c69,-144,104.5,-217.7,106.5,-221
|
|
424
|
-
l`+t/2.075+" -"+t+`
|
|
425
|
-
c5.3,-9.3,12,-14,20,-14
|
|
426
|
-
H400000v`+(40+t)+`H845.2724
|
|
427
|
-
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
428
|
-
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
429
|
-
M`+(834+t)+" "+r+"h400000v"+(40+t)+"h-400000z"},w3=function(t,r){return"M263,"+(601+t+r)+`c0.7,0,18,39.7,52,119
|
|
430
|
-
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
431
|
-
c340,-704.7,510.7,-1060.3,512,-1067
|
|
432
|
-
l`+t/2.084+" -"+t+`
|
|
433
|
-
c4.7,-7.3,11,-11,19,-11
|
|
434
|
-
H40000v`+(40+t)+`H1012.3
|
|
435
|
-
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
436
|
-
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|
437
|
-
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
438
|
-
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
439
|
-
M`+(1001+t)+" "+r+"h400000v"+(40+t)+"h-400000z"},j3=function(t,r){return"M983 "+(10+t+r)+`
|
|
440
|
-
l`+t/3.13+" -"+t+`
|
|
441
|
-
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
|
|
442
|
-
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|
443
|
-
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|
444
|
-
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
445
|
-
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
446
|
-
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
447
|
-
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
448
|
-
M`+(1001+t)+" "+r+"h400000v"+(40+t)+"h-400000z"},N3=function(t,r){return"M424,"+(2398+t+r)+`
|
|
449
|
-
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
450
|
-
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|
451
|
-
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
452
|
-
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
453
|
-
l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
|
|
454
|
-
v`+(40+t)+`H1014.6
|
|
455
|
-
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
456
|
-
c-2,6,-10,9,-24,9
|
|
457
|
-
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+r+`
|
|
458
|
-
h400000v`+(40+t)+"h-400000z"},S3=function(t,r){return"M473,"+(2713+t+r)+`
|
|
459
|
-
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
|
|
460
|
-
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
|
|
461
|
-
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
462
|
-
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|
463
|
-
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|
464
|
-
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
465
|
-
606zM`+(1001+t)+" "+r+"h400000v"+(40+t)+"H1017.7z"},C3=function(t){var r=t/2;return"M400000 "+t+" H0 L"+r+" 0 l65 45 L145 "+(t-80)+" H400000z"},M3=function(t,r,a){var s=a-54-r-t;return"M702 "+(t+r)+"H400000"+(40+t)+`
|
|
466
|
-
H742v`+s+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|
467
|
-
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
468
|
-
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
469
|
-
219 661 l218 661zM702 `+r+"H400000v"+(40+t)+"H742z"},A3=function(t,r,a){r=1e3*r;var s="";switch(t){case"sqrtMain":s=k3(r,ca);break;case"sqrtSize1":s=w3(r,ca);break;case"sqrtSize2":s=j3(r,ca);break;case"sqrtSize3":s=N3(r,ca);break;case"sqrtSize4":s=S3(r,ca);break;case"sqrtTall":s=M3(r,ca,a)}return s},T3=function(t,r){switch(t){case"⎜":return"M291 0 H417 V"+r+" H291z M291 0 H417 V"+r+" H291z";case"∣":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z";case"∥":return"M145 0 H188 V"+r+" H145z M145 0 H188 V"+r+" H145z"+("M367 0 H410 V"+r+" H367z M367 0 H410 V"+r+" H367z");case"⎟":return"M457 0 H583 V"+r+" H457z M457 0 H583 V"+r+" H457z";case"⎢":return"M319 0 H403 V"+r+" H319z M319 0 H403 V"+r+" H319z";case"⎥":return"M263 0 H347 V"+r+" H263z M263 0 H347 V"+r+" H263z";case"⎪":return"M384 0 H504 V"+r+" H384z M384 0 H504 V"+r+" H384z";case"⏐":return"M312 0 H355 V"+r+" H312z M312 0 H355 V"+r+" H312z";case"‖":return"M257 0 H300 V"+r+" H257z M257 0 H300 V"+r+" H257z"+("M478 0 H521 V"+r+" H478z M478 0 H521 V"+r+" H478z");default:return""}},Uc={doubleleftarrow:`M262 157
|
|
470
|
-
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
471
|
-
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
472
|
-
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
473
|
-
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
474
|
-
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
475
|
-
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
476
|
-
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
477
|
-
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
478
|
-
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
479
|
-
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
480
|
-
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
481
|
-
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
482
|
-
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
483
|
-
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
484
|
-
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
485
|
-
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
486
|
-
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
487
|
-
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
488
|
-
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
489
|
-
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
490
|
-
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
491
|
-
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
492
|
-
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
493
|
-
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
494
|
-
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
495
|
-
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
496
|
-
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
497
|
-
435 0h399565z`,leftgroupunder:`M400000 262
|
|
498
|
-
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
499
|
-
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
500
|
-
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
501
|
-
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
502
|
-
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
503
|
-
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
504
|
-
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
505
|
-
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
506
|
-
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
507
|
-
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
508
|
-
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
509
|
-
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
510
|
-
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
511
|
-
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
512
|
-
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
513
|
-
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
514
|
-
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
515
|
-
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z
|
|
516
|
-
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z
|
|
517
|
-
M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
518
|
-
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
519
|
-
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
520
|
-
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z
|
|
521
|
-
M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334
|
|
522
|
-
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
523
|
-
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
524
|
-
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
525
|
-
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
526
|
-
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
527
|
-
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
528
|
-
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
529
|
-
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
530
|
-
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
531
|
-
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
532
|
-
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
533
|
-
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
534
|
-
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
535
|
-
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
536
|
-
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
537
|
-
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
538
|
-
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
539
|
-
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
540
|
-
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
541
|
-
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
542
|
-
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
543
|
-
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
544
|
-
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
545
|
-
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
546
|
-
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
547
|
-
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
548
|
-
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
549
|
-
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
550
|
-
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
551
|
-
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
552
|
-
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
553
|
-
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
554
|
-
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
555
|
-
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
556
|
-
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
557
|
-
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
558
|
-
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
559
|
-
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
560
|
-
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
561
|
-
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
562
|
-
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
563
|
-
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
564
|
-
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
565
|
-
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
566
|
-
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
567
|
-
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
568
|
-
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
569
|
-
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
570
|
-
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
|
|
571
|
-
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
572
|
-
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
573
|
-
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
574
|
-
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
575
|
-
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
576
|
-
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
577
|
-
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
578
|
-
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
579
|
-
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
580
|
-
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
581
|
-
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
582
|
-
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
583
|
-
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
584
|
-
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
585
|
-
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
586
|
-
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
587
|
-
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
588
|
-
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
589
|
-
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
590
|
-
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
591
|
-
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
592
|
-
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
593
|
-
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
594
|
-
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
595
|
-
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
596
|
-
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
597
|
-
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
598
|
-
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
599
|
-
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
600
|
-
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
601
|
-
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
602
|
-
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
603
|
-
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
604
|
-
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
605
|
-
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
606
|
-
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
607
|
-
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
608
|
-
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
609
|
-
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
610
|
-
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
611
|
-
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
612
|
-
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
613
|
-
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
614
|
-
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
615
|
-
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
616
|
-
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
617
|
-
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
618
|
-
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
619
|
-
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
620
|
-
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
621
|
-
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
622
|
-
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
623
|
-
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
624
|
-
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
625
|
-
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
626
|
-
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
627
|
-
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
628
|
-
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
629
|
-
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
630
|
-
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
631
|
-
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
632
|
-
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
633
|
-
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
634
|
-
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
635
|
-
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
636
|
-
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
637
|
-
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
638
|
-
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
639
|
-
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
640
|
-
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
641
|
-
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
642
|
-
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
643
|
-
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
644
|
-
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},E3=function(t,r){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v1759 h347 v-84
|
|
645
|
-
H403z M403 1759 V0 H319 V1759 v`+r+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v1759 H0 v84 H347z
|
|
646
|
-
M347 1759 V0 H263 V1759 v`+r+" v1759 h84z";case"vert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
|
|
647
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
648
|
-
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+" v585 h43z";case"doublevert":return"M145 15 v585 v"+r+` v585 c2.667,10,9.667,15,21,15
|
|
649
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
650
|
-
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+r+` v585 h43z
|
|
651
|
-
M367 15 v585 v`+r+` v585 c2.667,10,9.667,15,21,15
|
|
652
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-r+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
653
|
-
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+r+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+r+` v1715 h263 v84 H319z
|
|
654
|
-
MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+r+` v1799 H0 v-84 H319z
|
|
655
|
-
MM319 602 V0 H403 V602 v`+r+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+r+` v602 h84z
|
|
656
|
-
M403 1759 V0 H319 V1759 v`+r+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+r+` v602 h84z
|
|
657
|
-
M347 1759 V0 h-84 V1759 v`+r+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
|
658
|
-
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
|
659
|
-
-36,557 l0,`+(r+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|
660
|
-
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
|
661
|
-
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
|
662
|
-
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|
663
|
-
l0,-`+(r+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|
664
|
-
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
|
665
|
-
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|
666
|
-
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(r+9)+`
|
|
667
|
-
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
|
668
|
-
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
|
669
|
-
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
|
670
|
-
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
671
|
-
l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
672
|
-
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class ps{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t}toMarkup(){for(var t="",r=0;r<this.children.length;r++)t+=this.children[r].toMarkup();return t}toText(){var t=r=>r.toText();return this.children.map(t).join("")}}var Vr={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Is={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Wc={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function I3(e,t){Vr[e]=t}function Ql(e,t,r){if(!Vr[t])throw new Error("Font metrics not found for font: "+t+".");var a=e.charCodeAt(0),s=Vr[t][a];if(!s&&e[0]in Wc&&(a=Wc[e[0]].charCodeAt(0),s=Vr[t][a]),!s&&r==="text"&&lh(a)&&(s=Vr[t][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var ao={};function D3(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!ao[t]){var r=ao[t]={cssEmPerMu:Is.quad[t]/18};for(var a in Is)Is.hasOwnProperty(a)&&(r[a]=Is[a][t])}return ao[t]}var z3=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Vc=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Gc=function(t,r){return r.size<2?t:z3[t-1][r.size-1]};class sn{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||sn.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=Vc[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var r={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var a in t)t.hasOwnProperty(a)&&(r[a]=t[a]);return new sn(r)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:Gc(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:Vc[t-1]})}havingBaseStyle(t){t=t||this.style.text();var r=Gc(sn.BASESIZE,t);return this.size===r&&this.textSize===sn.BASESIZE&&this.style===t?this:this.extend({style:t,size:r})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==sn.BASESIZE?["sizing","reset-size"+this.size,"size"+sn.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=D3(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}sn.BASESIZE=6;var Qo={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},L3={ex:!0,em:!0,mu:!0},ch=function(t){return typeof t!="string"&&(t=t.unit),t in Qo||t in L3||t==="ex"},Ot=function(t,r){var a;if(t.unit in Qo)a=Qo[t.unit]/r.fontMetrics().ptPerEm/r.sizeMultiplier;else if(t.unit==="mu")a=r.fontMetrics().cssEmPerMu;else{var s;if(r.style.isTight()?s=r.havingStyle(r.style.text()):s=r,t.unit==="ex")a=s.fontMetrics().xHeight;else if(t.unit==="em")a=s.fontMetrics().quad;else throw new ge("Invalid unit: '"+t.unit+"'");s!==r&&(a*=s.sizeMultiplier/r.sizeMultiplier)}return Math.min(t.number*a,r.maxSize)},Ne=function(t){return+t.toFixed(4)+"em"},zn=function(t){return t.filter(r=>r).join(" ")},dh=function(t,r,a){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},r){r.style.isTight()&&this.classes.push("mtight");var s=r.getColor();s&&(this.style.color=s)}},uh=function(t){var r=document.createElement(t);r.className=zn(this.classes);for(var a in this.style)this.style.hasOwnProperty(a)&&(r.style[a]=this.style[a]);for(var s in this.attributes)this.attributes.hasOwnProperty(s)&&r.setAttribute(s,this.attributes[s]);for(var i=0;i<this.children.length;i++)r.appendChild(this.children[i].toNode());return r},P3=/[\s"'>/=\x00-\x1f]/,mh=function(t){var r="<"+t;this.classes.length&&(r+=' class="'+kt.escape(zn(this.classes))+'"');var a="";for(var s in this.style)this.style.hasOwnProperty(s)&&(a+=kt.hyphenate(s)+":"+this.style[s]+";");a&&(r+=' style="'+kt.escape(a)+'"');for(var i in this.attributes)if(this.attributes.hasOwnProperty(i)){if(P3.test(i))throw new ge("Invalid attribute name '"+i+"'");r+=" "+i+'="'+kt.escape(this.attributes[i])+'"'}r+=">";for(var o=0;o<this.children.length;o++)r+=this.children[o].toMarkup();return r+="</"+t+">",r};class fs{constructor(t,r,a,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,dh.call(this,t,a,s),this.children=r||[]}setAttribute(t,r){this.attributes[t]=r}hasClass(t){return this.classes.includes(t)}toNode(){return uh.call(this,"span")}toMarkup(){return mh.call(this,"span")}}class Zl{constructor(t,r,a,s){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,dh.call(this,r,s),this.children=a||[],this.setAttribute("href",t)}setAttribute(t,r){this.attributes[t]=r}hasClass(t){return this.classes.includes(t)}toNode(){return uh.call(this,"a")}toMarkup(){return mh.call(this,"a")}}class R3{constructor(t,r,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=r,this.src=t,this.classes=["mord"],this.style=a}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");t.src=this.src,t.alt=this.alt,t.className="mord";for(var r in this.style)this.style.hasOwnProperty(r)&&(t.style[r]=this.style[r]);return t}toMarkup(){var t='<img src="'+kt.escape(this.src)+'"'+(' alt="'+kt.escape(this.alt)+'"'),r="";for(var a in this.style)this.style.hasOwnProperty(a)&&(r+=kt.hyphenate(a)+":"+this.style[a]+";");return r&&(t+=' style="'+kt.escape(r)+'"'),t+="'/>",t}}var F3={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Ir{constructor(t,r,a,s,i,o,l,c){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=r||0,this.depth=a||0,this.italic=s||0,this.skew=i||0,this.width=o||0,this.classes=l||[],this.style=c||{},this.maxFontSize=0;var d=v3(this.text.charCodeAt(0));d&&this.classes.push(d+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=F3[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),r=null;this.italic>0&&(r=document.createElement("span"),r.style.marginRight=Ne(this.italic)),this.classes.length>0&&(r=r||document.createElement("span"),r.className=zn(this.classes));for(var a in this.style)this.style.hasOwnProperty(a)&&(r=r||document.createElement("span"),r.style[a]=this.style[a]);return r?(r.appendChild(t),r):t}toMarkup(){var t=!1,r="<span";this.classes.length&&(t=!0,r+=' class="',r+=kt.escape(zn(this.classes)),r+='"');var a="";this.italic>0&&(a+="margin-right:"+this.italic+"em;");for(var s in this.style)this.style.hasOwnProperty(s)&&(a+=kt.hyphenate(s)+":"+this.style[s]+";");a&&(t=!0,r+=' style="'+kt.escape(a)+'"');var i=kt.escape(this.text);return t?(r+=">",r+=i,r+="</span>",r):i}}class mn{constructor(t,r){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=r||{}}toNode(){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"svg");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&r.setAttribute(a,this.attributes[a]);for(var s=0;s<this.children.length;s++)r.appendChild(this.children[s].toNode());return r}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&(t+=" "+r+'="'+kt.escape(this.attributes[r])+'"');t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</svg>",t}}class Ln{constructor(t,r){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=r}toNode(){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"path");return this.alternate?r.setAttribute("d",this.alternate):r.setAttribute("d",Uc[this.pathName]),r}toMarkup(){return this.alternate?'<path d="'+kt.escape(this.alternate)+'"/>':'<path d="'+kt.escape(Uc[this.pathName])+'"/>'}}class Zo{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",r=document.createElementNS(t,"line");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&r.setAttribute(a,this.attributes[a]);return r}toMarkup(){var t="<line";for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&(t+=" "+r+'="'+kt.escape(this.attributes[r])+'"');return t+="/>",t}}function Kc(e){if(e instanceof Ir)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function B3(e){if(e instanceof fs)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var O3={bin:1,close:1,inner:1,open:1,punct:1,rel:1},$3={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Dt={math:{},text:{}};function f(e,t,r,a,s,i){Dt[e][s]={font:t,group:r,replace:a},i&&a&&(Dt[e][a]=Dt[e][s])}var g="math",me="text",v="main",E="ams",Rt="accent-token",Ie="bin",or="close",Ta="inner",Ke="mathord",Wt="op-token",jr="open",ji="punct",D="rel",yn="spacing",q="textord";f(g,v,D,"≡","\\equiv",!0);f(g,v,D,"≺","\\prec",!0);f(g,v,D,"≻","\\succ",!0);f(g,v,D,"∼","\\sim",!0);f(g,v,D,"⊥","\\perp");f(g,v,D,"⪯","\\preceq",!0);f(g,v,D,"⪰","\\succeq",!0);f(g,v,D,"≃","\\simeq",!0);f(g,v,D,"∣","\\mid",!0);f(g,v,D,"≪","\\ll",!0);f(g,v,D,"≫","\\gg",!0);f(g,v,D,"≍","\\asymp",!0);f(g,v,D,"∥","\\parallel");f(g,v,D,"⋈","\\bowtie",!0);f(g,v,D,"⌣","\\smile",!0);f(g,v,D,"⊑","\\sqsubseteq",!0);f(g,v,D,"⊒","\\sqsupseteq",!0);f(g,v,D,"≐","\\doteq",!0);f(g,v,D,"⌢","\\frown",!0);f(g,v,D,"∋","\\ni",!0);f(g,v,D,"∝","\\propto",!0);f(g,v,D,"⊢","\\vdash",!0);f(g,v,D,"⊣","\\dashv",!0);f(g,v,D,"∋","\\owns");f(g,v,ji,".","\\ldotp");f(g,v,ji,"⋅","\\cdotp");f(g,v,q,"#","\\#");f(me,v,q,"#","\\#");f(g,v,q,"&","\\&");f(me,v,q,"&","\\&");f(g,v,q,"ℵ","\\aleph",!0);f(g,v,q,"∀","\\forall",!0);f(g,v,q,"ℏ","\\hbar",!0);f(g,v,q,"∃","\\exists",!0);f(g,v,q,"∇","\\nabla",!0);f(g,v,q,"♭","\\flat",!0);f(g,v,q,"ℓ","\\ell",!0);f(g,v,q,"♮","\\natural",!0);f(g,v,q,"♣","\\clubsuit",!0);f(g,v,q,"℘","\\wp",!0);f(g,v,q,"♯","\\sharp",!0);f(g,v,q,"♢","\\diamondsuit",!0);f(g,v,q,"ℜ","\\Re",!0);f(g,v,q,"♡","\\heartsuit",!0);f(g,v,q,"ℑ","\\Im",!0);f(g,v,q,"♠","\\spadesuit",!0);f(g,v,q,"§","\\S",!0);f(me,v,q,"§","\\S");f(g,v,q,"¶","\\P",!0);f(me,v,q,"¶","\\P");f(g,v,q,"†","\\dag");f(me,v,q,"†","\\dag");f(me,v,q,"†","\\textdagger");f(g,v,q,"‡","\\ddag");f(me,v,q,"‡","\\ddag");f(me,v,q,"‡","\\textdaggerdbl");f(g,v,or,"⎱","\\rmoustache",!0);f(g,v,jr,"⎰","\\lmoustache",!0);f(g,v,or,"⟯","\\rgroup",!0);f(g,v,jr,"⟮","\\lgroup",!0);f(g,v,Ie,"∓","\\mp",!0);f(g,v,Ie,"⊖","\\ominus",!0);f(g,v,Ie,"⊎","\\uplus",!0);f(g,v,Ie,"⊓","\\sqcap",!0);f(g,v,Ie,"∗","\\ast");f(g,v,Ie,"⊔","\\sqcup",!0);f(g,v,Ie,"◯","\\bigcirc",!0);f(g,v,Ie,"∙","\\bullet",!0);f(g,v,Ie,"‡","\\ddagger");f(g,v,Ie,"≀","\\wr",!0);f(g,v,Ie,"⨿","\\amalg");f(g,v,Ie,"&","\\And");f(g,v,D,"⟵","\\longleftarrow",!0);f(g,v,D,"⇐","\\Leftarrow",!0);f(g,v,D,"⟸","\\Longleftarrow",!0);f(g,v,D,"⟶","\\longrightarrow",!0);f(g,v,D,"⇒","\\Rightarrow",!0);f(g,v,D,"⟹","\\Longrightarrow",!0);f(g,v,D,"↔","\\leftrightarrow",!0);f(g,v,D,"⟷","\\longleftrightarrow",!0);f(g,v,D,"⇔","\\Leftrightarrow",!0);f(g,v,D,"⟺","\\Longleftrightarrow",!0);f(g,v,D,"↦","\\mapsto",!0);f(g,v,D,"⟼","\\longmapsto",!0);f(g,v,D,"↗","\\nearrow",!0);f(g,v,D,"↩","\\hookleftarrow",!0);f(g,v,D,"↪","\\hookrightarrow",!0);f(g,v,D,"↘","\\searrow",!0);f(g,v,D,"↼","\\leftharpoonup",!0);f(g,v,D,"⇀","\\rightharpoonup",!0);f(g,v,D,"↙","\\swarrow",!0);f(g,v,D,"↽","\\leftharpoondown",!0);f(g,v,D,"⇁","\\rightharpoondown",!0);f(g,v,D,"↖","\\nwarrow",!0);f(g,v,D,"⇌","\\rightleftharpoons",!0);f(g,E,D,"≮","\\nless",!0);f(g,E,D,"","\\@nleqslant");f(g,E,D,"","\\@nleqq");f(g,E,D,"⪇","\\lneq",!0);f(g,E,D,"≨","\\lneqq",!0);f(g,E,D,"","\\@lvertneqq");f(g,E,D,"⋦","\\lnsim",!0);f(g,E,D,"⪉","\\lnapprox",!0);f(g,E,D,"⊀","\\nprec",!0);f(g,E,D,"⋠","\\npreceq",!0);f(g,E,D,"⋨","\\precnsim",!0);f(g,E,D,"⪹","\\precnapprox",!0);f(g,E,D,"≁","\\nsim",!0);f(g,E,D,"","\\@nshortmid");f(g,E,D,"∤","\\nmid",!0);f(g,E,D,"⊬","\\nvdash",!0);f(g,E,D,"⊭","\\nvDash",!0);f(g,E,D,"⋪","\\ntriangleleft");f(g,E,D,"⋬","\\ntrianglelefteq",!0);f(g,E,D,"⊊","\\subsetneq",!0);f(g,E,D,"","\\@varsubsetneq");f(g,E,D,"⫋","\\subsetneqq",!0);f(g,E,D,"","\\@varsubsetneqq");f(g,E,D,"≯","\\ngtr",!0);f(g,E,D,"","\\@ngeqslant");f(g,E,D,"","\\@ngeqq");f(g,E,D,"⪈","\\gneq",!0);f(g,E,D,"≩","\\gneqq",!0);f(g,E,D,"","\\@gvertneqq");f(g,E,D,"⋧","\\gnsim",!0);f(g,E,D,"⪊","\\gnapprox",!0);f(g,E,D,"⊁","\\nsucc",!0);f(g,E,D,"⋡","\\nsucceq",!0);f(g,E,D,"⋩","\\succnsim",!0);f(g,E,D,"⪺","\\succnapprox",!0);f(g,E,D,"≆","\\ncong",!0);f(g,E,D,"","\\@nshortparallel");f(g,E,D,"∦","\\nparallel",!0);f(g,E,D,"⊯","\\nVDash",!0);f(g,E,D,"⋫","\\ntriangleright");f(g,E,D,"⋭","\\ntrianglerighteq",!0);f(g,E,D,"","\\@nsupseteqq");f(g,E,D,"⊋","\\supsetneq",!0);f(g,E,D,"","\\@varsupsetneq");f(g,E,D,"⫌","\\supsetneqq",!0);f(g,E,D,"","\\@varsupsetneqq");f(g,E,D,"⊮","\\nVdash",!0);f(g,E,D,"⪵","\\precneqq",!0);f(g,E,D,"⪶","\\succneqq",!0);f(g,E,D,"","\\@nsubseteqq");f(g,E,Ie,"⊴","\\unlhd");f(g,E,Ie,"⊵","\\unrhd");f(g,E,D,"↚","\\nleftarrow",!0);f(g,E,D,"↛","\\nrightarrow",!0);f(g,E,D,"⇍","\\nLeftarrow",!0);f(g,E,D,"⇏","\\nRightarrow",!0);f(g,E,D,"↮","\\nleftrightarrow",!0);f(g,E,D,"⇎","\\nLeftrightarrow",!0);f(g,E,D,"△","\\vartriangle");f(g,E,q,"ℏ","\\hslash");f(g,E,q,"▽","\\triangledown");f(g,E,q,"◊","\\lozenge");f(g,E,q,"Ⓢ","\\circledS");f(g,E,q,"®","\\circledR");f(me,E,q,"®","\\circledR");f(g,E,q,"∡","\\measuredangle",!0);f(g,E,q,"∄","\\nexists");f(g,E,q,"℧","\\mho");f(g,E,q,"Ⅎ","\\Finv",!0);f(g,E,q,"⅁","\\Game",!0);f(g,E,q,"‵","\\backprime");f(g,E,q,"▲","\\blacktriangle");f(g,E,q,"▼","\\blacktriangledown");f(g,E,q,"■","\\blacksquare");f(g,E,q,"⧫","\\blacklozenge");f(g,E,q,"★","\\bigstar");f(g,E,q,"∢","\\sphericalangle",!0);f(g,E,q,"∁","\\complement",!0);f(g,E,q,"ð","\\eth",!0);f(me,v,q,"ð","ð");f(g,E,q,"╱","\\diagup");f(g,E,q,"╲","\\diagdown");f(g,E,q,"□","\\square");f(g,E,q,"□","\\Box");f(g,E,q,"◊","\\Diamond");f(g,E,q,"¥","\\yen",!0);f(me,E,q,"¥","\\yen",!0);f(g,E,q,"✓","\\checkmark",!0);f(me,E,q,"✓","\\checkmark");f(g,E,q,"ℶ","\\beth",!0);f(g,E,q,"ℸ","\\daleth",!0);f(g,E,q,"ℷ","\\gimel",!0);f(g,E,q,"ϝ","\\digamma",!0);f(g,E,q,"ϰ","\\varkappa");f(g,E,jr,"┌","\\@ulcorner",!0);f(g,E,or,"┐","\\@urcorner",!0);f(g,E,jr,"└","\\@llcorner",!0);f(g,E,or,"┘","\\@lrcorner",!0);f(g,E,D,"≦","\\leqq",!0);f(g,E,D,"⩽","\\leqslant",!0);f(g,E,D,"⪕","\\eqslantless",!0);f(g,E,D,"≲","\\lesssim",!0);f(g,E,D,"⪅","\\lessapprox",!0);f(g,E,D,"≊","\\approxeq",!0);f(g,E,Ie,"⋖","\\lessdot");f(g,E,D,"⋘","\\lll",!0);f(g,E,D,"≶","\\lessgtr",!0);f(g,E,D,"⋚","\\lesseqgtr",!0);f(g,E,D,"⪋","\\lesseqqgtr",!0);f(g,E,D,"≑","\\doteqdot");f(g,E,D,"≓","\\risingdotseq",!0);f(g,E,D,"≒","\\fallingdotseq",!0);f(g,E,D,"∽","\\backsim",!0);f(g,E,D,"⋍","\\backsimeq",!0);f(g,E,D,"⫅","\\subseteqq",!0);f(g,E,D,"⋐","\\Subset",!0);f(g,E,D,"⊏","\\sqsubset",!0);f(g,E,D,"≼","\\preccurlyeq",!0);f(g,E,D,"⋞","\\curlyeqprec",!0);f(g,E,D,"≾","\\precsim",!0);f(g,E,D,"⪷","\\precapprox",!0);f(g,E,D,"⊲","\\vartriangleleft");f(g,E,D,"⊴","\\trianglelefteq");f(g,E,D,"⊨","\\vDash",!0);f(g,E,D,"⊪","\\Vvdash",!0);f(g,E,D,"⌣","\\smallsmile");f(g,E,D,"⌢","\\smallfrown");f(g,E,D,"≏","\\bumpeq",!0);f(g,E,D,"≎","\\Bumpeq",!0);f(g,E,D,"≧","\\geqq",!0);f(g,E,D,"⩾","\\geqslant",!0);f(g,E,D,"⪖","\\eqslantgtr",!0);f(g,E,D,"≳","\\gtrsim",!0);f(g,E,D,"⪆","\\gtrapprox",!0);f(g,E,Ie,"⋗","\\gtrdot");f(g,E,D,"⋙","\\ggg",!0);f(g,E,D,"≷","\\gtrless",!0);f(g,E,D,"⋛","\\gtreqless",!0);f(g,E,D,"⪌","\\gtreqqless",!0);f(g,E,D,"≖","\\eqcirc",!0);f(g,E,D,"≗","\\circeq",!0);f(g,E,D,"≜","\\triangleq",!0);f(g,E,D,"∼","\\thicksim");f(g,E,D,"≈","\\thickapprox");f(g,E,D,"⫆","\\supseteqq",!0);f(g,E,D,"⋑","\\Supset",!0);f(g,E,D,"⊐","\\sqsupset",!0);f(g,E,D,"≽","\\succcurlyeq",!0);f(g,E,D,"⋟","\\curlyeqsucc",!0);f(g,E,D,"≿","\\succsim",!0);f(g,E,D,"⪸","\\succapprox",!0);f(g,E,D,"⊳","\\vartriangleright");f(g,E,D,"⊵","\\trianglerighteq");f(g,E,D,"⊩","\\Vdash",!0);f(g,E,D,"∣","\\shortmid");f(g,E,D,"∥","\\shortparallel");f(g,E,D,"≬","\\between",!0);f(g,E,D,"⋔","\\pitchfork",!0);f(g,E,D,"∝","\\varpropto");f(g,E,D,"◀","\\blacktriangleleft");f(g,E,D,"∴","\\therefore",!0);f(g,E,D,"∍","\\backepsilon");f(g,E,D,"▶","\\blacktriangleright");f(g,E,D,"∵","\\because",!0);f(g,E,D,"⋘","\\llless");f(g,E,D,"⋙","\\gggtr");f(g,E,Ie,"⊲","\\lhd");f(g,E,Ie,"⊳","\\rhd");f(g,E,D,"≂","\\eqsim",!0);f(g,v,D,"⋈","\\Join");f(g,E,D,"≑","\\Doteq",!0);f(g,E,Ie,"∔","\\dotplus",!0);f(g,E,Ie,"∖","\\smallsetminus");f(g,E,Ie,"⋒","\\Cap",!0);f(g,E,Ie,"⋓","\\Cup",!0);f(g,E,Ie,"⩞","\\doublebarwedge",!0);f(g,E,Ie,"⊟","\\boxminus",!0);f(g,E,Ie,"⊞","\\boxplus",!0);f(g,E,Ie,"⋇","\\divideontimes",!0);f(g,E,Ie,"⋉","\\ltimes",!0);f(g,E,Ie,"⋊","\\rtimes",!0);f(g,E,Ie,"⋋","\\leftthreetimes",!0);f(g,E,Ie,"⋌","\\rightthreetimes",!0);f(g,E,Ie,"⋏","\\curlywedge",!0);f(g,E,Ie,"⋎","\\curlyvee",!0);f(g,E,Ie,"⊝","\\circleddash",!0);f(g,E,Ie,"⊛","\\circledast",!0);f(g,E,Ie,"⋅","\\centerdot");f(g,E,Ie,"⊺","\\intercal",!0);f(g,E,Ie,"⋒","\\doublecap");f(g,E,Ie,"⋓","\\doublecup");f(g,E,Ie,"⊠","\\boxtimes",!0);f(g,E,D,"⇢","\\dashrightarrow",!0);f(g,E,D,"⇠","\\dashleftarrow",!0);f(g,E,D,"⇇","\\leftleftarrows",!0);f(g,E,D,"⇆","\\leftrightarrows",!0);f(g,E,D,"⇚","\\Lleftarrow",!0);f(g,E,D,"↞","\\twoheadleftarrow",!0);f(g,E,D,"↢","\\leftarrowtail",!0);f(g,E,D,"↫","\\looparrowleft",!0);f(g,E,D,"⇋","\\leftrightharpoons",!0);f(g,E,D,"↶","\\curvearrowleft",!0);f(g,E,D,"↺","\\circlearrowleft",!0);f(g,E,D,"↰","\\Lsh",!0);f(g,E,D,"⇈","\\upuparrows",!0);f(g,E,D,"↿","\\upharpoonleft",!0);f(g,E,D,"⇃","\\downharpoonleft",!0);f(g,v,D,"⊶","\\origof",!0);f(g,v,D,"⊷","\\imageof",!0);f(g,E,D,"⊸","\\multimap",!0);f(g,E,D,"↭","\\leftrightsquigarrow",!0);f(g,E,D,"⇉","\\rightrightarrows",!0);f(g,E,D,"⇄","\\rightleftarrows",!0);f(g,E,D,"↠","\\twoheadrightarrow",!0);f(g,E,D,"↣","\\rightarrowtail",!0);f(g,E,D,"↬","\\looparrowright",!0);f(g,E,D,"↷","\\curvearrowright",!0);f(g,E,D,"↻","\\circlearrowright",!0);f(g,E,D,"↱","\\Rsh",!0);f(g,E,D,"⇊","\\downdownarrows",!0);f(g,E,D,"↾","\\upharpoonright",!0);f(g,E,D,"⇂","\\downharpoonright",!0);f(g,E,D,"⇝","\\rightsquigarrow",!0);f(g,E,D,"⇝","\\leadsto");f(g,E,D,"⇛","\\Rrightarrow",!0);f(g,E,D,"↾","\\restriction");f(g,v,q,"‘","`");f(g,v,q,"$","\\$");f(me,v,q,"$","\\$");f(me,v,q,"$","\\textdollar");f(g,v,q,"%","\\%");f(me,v,q,"%","\\%");f(g,v,q,"_","\\_");f(me,v,q,"_","\\_");f(me,v,q,"_","\\textunderscore");f(g,v,q,"∠","\\angle",!0);f(g,v,q,"∞","\\infty",!0);f(g,v,q,"′","\\prime");f(g,v,q,"△","\\triangle");f(g,v,q,"Γ","\\Gamma",!0);f(g,v,q,"Δ","\\Delta",!0);f(g,v,q,"Θ","\\Theta",!0);f(g,v,q,"Λ","\\Lambda",!0);f(g,v,q,"Ξ","\\Xi",!0);f(g,v,q,"Π","\\Pi",!0);f(g,v,q,"Σ","\\Sigma",!0);f(g,v,q,"Υ","\\Upsilon",!0);f(g,v,q,"Φ","\\Phi",!0);f(g,v,q,"Ψ","\\Psi",!0);f(g,v,q,"Ω","\\Omega",!0);f(g,v,q,"A","Α");f(g,v,q,"B","Β");f(g,v,q,"E","Ε");f(g,v,q,"Z","Ζ");f(g,v,q,"H","Η");f(g,v,q,"I","Ι");f(g,v,q,"K","Κ");f(g,v,q,"M","Μ");f(g,v,q,"N","Ν");f(g,v,q,"O","Ο");f(g,v,q,"P","Ρ");f(g,v,q,"T","Τ");f(g,v,q,"X","Χ");f(g,v,q,"¬","\\neg",!0);f(g,v,q,"¬","\\lnot");f(g,v,q,"⊤","\\top");f(g,v,q,"⊥","\\bot");f(g,v,q,"∅","\\emptyset");f(g,E,q,"∅","\\varnothing");f(g,v,Ke,"α","\\alpha",!0);f(g,v,Ke,"β","\\beta",!0);f(g,v,Ke,"γ","\\gamma",!0);f(g,v,Ke,"δ","\\delta",!0);f(g,v,Ke,"ϵ","\\epsilon",!0);f(g,v,Ke,"ζ","\\zeta",!0);f(g,v,Ke,"η","\\eta",!0);f(g,v,Ke,"θ","\\theta",!0);f(g,v,Ke,"ι","\\iota",!0);f(g,v,Ke,"κ","\\kappa",!0);f(g,v,Ke,"λ","\\lambda",!0);f(g,v,Ke,"μ","\\mu",!0);f(g,v,Ke,"ν","\\nu",!0);f(g,v,Ke,"ξ","\\xi",!0);f(g,v,Ke,"ο","\\omicron",!0);f(g,v,Ke,"π","\\pi",!0);f(g,v,Ke,"ρ","\\rho",!0);f(g,v,Ke,"σ","\\sigma",!0);f(g,v,Ke,"τ","\\tau",!0);f(g,v,Ke,"υ","\\upsilon",!0);f(g,v,Ke,"ϕ","\\phi",!0);f(g,v,Ke,"χ","\\chi",!0);f(g,v,Ke,"ψ","\\psi",!0);f(g,v,Ke,"ω","\\omega",!0);f(g,v,Ke,"ε","\\varepsilon",!0);f(g,v,Ke,"ϑ","\\vartheta",!0);f(g,v,Ke,"ϖ","\\varpi",!0);f(g,v,Ke,"ϱ","\\varrho",!0);f(g,v,Ke,"ς","\\varsigma",!0);f(g,v,Ke,"φ","\\varphi",!0);f(g,v,Ie,"∗","*",!0);f(g,v,Ie,"+","+");f(g,v,Ie,"−","-",!0);f(g,v,Ie,"⋅","\\cdot",!0);f(g,v,Ie,"∘","\\circ",!0);f(g,v,Ie,"÷","\\div",!0);f(g,v,Ie,"±","\\pm",!0);f(g,v,Ie,"×","\\times",!0);f(g,v,Ie,"∩","\\cap",!0);f(g,v,Ie,"∪","\\cup",!0);f(g,v,Ie,"∖","\\setminus",!0);f(g,v,Ie,"∧","\\land");f(g,v,Ie,"∨","\\lor");f(g,v,Ie,"∧","\\wedge",!0);f(g,v,Ie,"∨","\\vee",!0);f(g,v,q,"√","\\surd");f(g,v,jr,"⟨","\\langle",!0);f(g,v,jr,"∣","\\lvert");f(g,v,jr,"∥","\\lVert");f(g,v,or,"?","?");f(g,v,or,"!","!");f(g,v,or,"⟩","\\rangle",!0);f(g,v,or,"∣","\\rvert");f(g,v,or,"∥","\\rVert");f(g,v,D,"=","=");f(g,v,D,":",":");f(g,v,D,"≈","\\approx",!0);f(g,v,D,"≅","\\cong",!0);f(g,v,D,"≥","\\ge");f(g,v,D,"≥","\\geq",!0);f(g,v,D,"←","\\gets");f(g,v,D,">","\\gt",!0);f(g,v,D,"∈","\\in",!0);f(g,v,D,"","\\@not");f(g,v,D,"⊂","\\subset",!0);f(g,v,D,"⊃","\\supset",!0);f(g,v,D,"⊆","\\subseteq",!0);f(g,v,D,"⊇","\\supseteq",!0);f(g,E,D,"⊈","\\nsubseteq",!0);f(g,E,D,"⊉","\\nsupseteq",!0);f(g,v,D,"⊨","\\models");f(g,v,D,"←","\\leftarrow",!0);f(g,v,D,"≤","\\le");f(g,v,D,"≤","\\leq",!0);f(g,v,D,"<","\\lt",!0);f(g,v,D,"→","\\rightarrow",!0);f(g,v,D,"→","\\to");f(g,E,D,"≱","\\ngeq",!0);f(g,E,D,"≰","\\nleq",!0);f(g,v,yn," ","\\ ");f(g,v,yn," ","\\space");f(g,v,yn," ","\\nobreakspace");f(me,v,yn," ","\\ ");f(me,v,yn," "," ");f(me,v,yn," ","\\space");f(me,v,yn," ","\\nobreakspace");f(g,v,yn,null,"\\nobreak");f(g,v,yn,null,"\\allowbreak");f(g,v,ji,",",",");f(g,v,ji,";",";");f(g,E,Ie,"⊼","\\barwedge",!0);f(g,E,Ie,"⊻","\\veebar",!0);f(g,v,Ie,"⊙","\\odot",!0);f(g,v,Ie,"⊕","\\oplus",!0);f(g,v,Ie,"⊗","\\otimes",!0);f(g,v,q,"∂","\\partial",!0);f(g,v,Ie,"⊘","\\oslash",!0);f(g,E,Ie,"⊚","\\circledcirc",!0);f(g,E,Ie,"⊡","\\boxdot",!0);f(g,v,Ie,"△","\\bigtriangleup");f(g,v,Ie,"▽","\\bigtriangledown");f(g,v,Ie,"†","\\dagger");f(g,v,Ie,"⋄","\\diamond");f(g,v,Ie,"⋆","\\star");f(g,v,Ie,"◃","\\triangleleft");f(g,v,Ie,"▹","\\triangleright");f(g,v,jr,"{","\\{");f(me,v,q,"{","\\{");f(me,v,q,"{","\\textbraceleft");f(g,v,or,"}","\\}");f(me,v,q,"}","\\}");f(me,v,q,"}","\\textbraceright");f(g,v,jr,"{","\\lbrace");f(g,v,or,"}","\\rbrace");f(g,v,jr,"[","\\lbrack",!0);f(me,v,q,"[","\\lbrack",!0);f(g,v,or,"]","\\rbrack",!0);f(me,v,q,"]","\\rbrack",!0);f(g,v,jr,"(","\\lparen",!0);f(g,v,or,")","\\rparen",!0);f(me,v,q,"<","\\textless",!0);f(me,v,q,">","\\textgreater",!0);f(g,v,jr,"⌊","\\lfloor",!0);f(g,v,or,"⌋","\\rfloor",!0);f(g,v,jr,"⌈","\\lceil",!0);f(g,v,or,"⌉","\\rceil",!0);f(g,v,q,"\\","\\backslash");f(g,v,q,"∣","|");f(g,v,q,"∣","\\vert");f(me,v,q,"|","\\textbar",!0);f(g,v,q,"∥","\\|");f(g,v,q,"∥","\\Vert");f(me,v,q,"∥","\\textbardbl");f(me,v,q,"~","\\textasciitilde");f(me,v,q,"\\","\\textbackslash");f(me,v,q,"^","\\textasciicircum");f(g,v,D,"↑","\\uparrow",!0);f(g,v,D,"⇑","\\Uparrow",!0);f(g,v,D,"↓","\\downarrow",!0);f(g,v,D,"⇓","\\Downarrow",!0);f(g,v,D,"↕","\\updownarrow",!0);f(g,v,D,"⇕","\\Updownarrow",!0);f(g,v,Wt,"∐","\\coprod");f(g,v,Wt,"⋁","\\bigvee");f(g,v,Wt,"⋀","\\bigwedge");f(g,v,Wt,"⨄","\\biguplus");f(g,v,Wt,"⋂","\\bigcap");f(g,v,Wt,"⋃","\\bigcup");f(g,v,Wt,"∫","\\int");f(g,v,Wt,"∫","\\intop");f(g,v,Wt,"∬","\\iint");f(g,v,Wt,"∭","\\iiint");f(g,v,Wt,"∏","\\prod");f(g,v,Wt,"∑","\\sum");f(g,v,Wt,"⨂","\\bigotimes");f(g,v,Wt,"⨁","\\bigoplus");f(g,v,Wt,"⨀","\\bigodot");f(g,v,Wt,"∮","\\oint");f(g,v,Wt,"∯","\\oiint");f(g,v,Wt,"∰","\\oiiint");f(g,v,Wt,"⨆","\\bigsqcup");f(g,v,Wt,"∫","\\smallint");f(me,v,Ta,"…","\\textellipsis");f(g,v,Ta,"…","\\mathellipsis");f(me,v,Ta,"…","\\ldots",!0);f(g,v,Ta,"…","\\ldots",!0);f(g,v,Ta,"⋯","\\@cdots",!0);f(g,v,Ta,"⋱","\\ddots",!0);f(g,v,q,"⋮","\\varvdots");f(me,v,q,"⋮","\\varvdots");f(g,v,Rt,"ˊ","\\acute");f(g,v,Rt,"ˋ","\\grave");f(g,v,Rt,"¨","\\ddot");f(g,v,Rt,"~","\\tilde");f(g,v,Rt,"ˉ","\\bar");f(g,v,Rt,"˘","\\breve");f(g,v,Rt,"ˇ","\\check");f(g,v,Rt,"^","\\hat");f(g,v,Rt,"⃗","\\vec");f(g,v,Rt,"˙","\\dot");f(g,v,Rt,"˚","\\mathring");f(g,v,Ke,"","\\@imath");f(g,v,Ke,"","\\@jmath");f(g,v,q,"ı","ı");f(g,v,q,"ȷ","ȷ");f(me,v,q,"ı","\\i",!0);f(me,v,q,"ȷ","\\j",!0);f(me,v,q,"ß","\\ss",!0);f(me,v,q,"æ","\\ae",!0);f(me,v,q,"œ","\\oe",!0);f(me,v,q,"ø","\\o",!0);f(me,v,q,"Æ","\\AE",!0);f(me,v,q,"Œ","\\OE",!0);f(me,v,q,"Ø","\\O",!0);f(me,v,Rt,"ˊ","\\'");f(me,v,Rt,"ˋ","\\`");f(me,v,Rt,"ˆ","\\^");f(me,v,Rt,"˜","\\~");f(me,v,Rt,"ˉ","\\=");f(me,v,Rt,"˘","\\u");f(me,v,Rt,"˙","\\.");f(me,v,Rt,"¸","\\c");f(me,v,Rt,"˚","\\r");f(me,v,Rt,"ˇ","\\v");f(me,v,Rt,"¨",'\\"');f(me,v,Rt,"˝","\\H");f(me,v,Rt,"◯","\\textcircled");var hh={"--":!0,"---":!0,"``":!0,"''":!0};f(me,v,q,"–","--",!0);f(me,v,q,"–","\\textendash");f(me,v,q,"—","---",!0);f(me,v,q,"—","\\textemdash");f(me,v,q,"‘","`",!0);f(me,v,q,"‘","\\textquoteleft");f(me,v,q,"’","'",!0);f(me,v,q,"’","\\textquoteright");f(me,v,q,"“","``",!0);f(me,v,q,"“","\\textquotedblleft");f(me,v,q,"”","''",!0);f(me,v,q,"”","\\textquotedblright");f(g,v,q,"°","\\degree",!0);f(me,v,q,"°","\\degree");f(me,v,q,"°","\\textdegree",!0);f(g,v,q,"£","\\pounds");f(g,v,q,"£","\\mathsterling",!0);f(me,v,q,"£","\\pounds");f(me,v,q,"£","\\textsterling",!0);f(g,E,q,"✠","\\maltese");f(me,E,q,"✠","\\maltese");var Jc='0123456789/@."';for(var so=0;so<Jc.length;so++){var Yc=Jc.charAt(so);f(g,v,q,Yc,Yc)}var Xc='0123456789!@*()-=+";:?/.,';for(var io=0;io<Xc.length;io++){var Qc=Xc.charAt(io);f(me,v,q,Qc,Qc)}var si="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var oo=0;oo<si.length;oo++){var Ds=si.charAt(oo);f(g,v,Ke,Ds,Ds),f(me,v,q,Ds,Ds)}f(g,E,q,"C","ℂ");f(me,E,q,"C","ℂ");f(g,E,q,"H","ℍ");f(me,E,q,"H","ℍ");f(g,E,q,"N","ℕ");f(me,E,q,"N","ℕ");f(g,E,q,"P","ℙ");f(me,E,q,"P","ℙ");f(g,E,q,"Q","ℚ");f(me,E,q,"Q","ℚ");f(g,E,q,"R","ℝ");f(me,E,q,"R","ℝ");f(g,E,q,"Z","ℤ");f(me,E,q,"Z","ℤ");f(g,v,Ke,"h","ℎ");f(me,v,Ke,"h","ℎ");var Ze="";for(var rr=0;rr<si.length;rr++){var $t=si.charAt(rr);Ze=String.fromCharCode(55349,56320+rr),f(g,v,Ke,$t,Ze),f(me,v,q,$t,Ze),Ze=String.fromCharCode(55349,56372+rr),f(g,v,Ke,$t,Ze),f(me,v,q,$t,Ze),Ze=String.fromCharCode(55349,56424+rr),f(g,v,Ke,$t,Ze),f(me,v,q,$t,Ze),Ze=String.fromCharCode(55349,56580+rr),f(g,v,Ke,$t,Ze),f(me,v,q,$t,Ze),Ze=String.fromCharCode(55349,56684+rr),f(g,v,Ke,$t,Ze),f(me,v,q,$t,Ze),Ze=String.fromCharCode(55349,56736+rr),f(g,v,Ke,$t,Ze),f(me,v,q,$t,Ze),Ze=String.fromCharCode(55349,56788+rr),f(g,v,Ke,$t,Ze),f(me,v,q,$t,Ze),Ze=String.fromCharCode(55349,56840+rr),f(g,v,Ke,$t,Ze),f(me,v,q,$t,Ze),Ze=String.fromCharCode(55349,56944+rr),f(g,v,Ke,$t,Ze),f(me,v,q,$t,Ze),rr<26&&(Ze=String.fromCharCode(55349,56632+rr),f(g,v,Ke,$t,Ze),f(me,v,q,$t,Ze),Ze=String.fromCharCode(55349,56476+rr),f(g,v,Ke,$t,Ze),f(me,v,q,$t,Ze))}Ze="𝕜";f(g,v,Ke,"k",Ze);f(me,v,q,"k",Ze);for(var Un=0;Un<10;Un++){var Cn=Un.toString();Ze=String.fromCharCode(55349,57294+Un),f(g,v,Ke,Cn,Ze),f(me,v,q,Cn,Ze),Ze=String.fromCharCode(55349,57314+Un),f(g,v,Ke,Cn,Ze),f(me,v,q,Cn,Ze),Ze=String.fromCharCode(55349,57324+Un),f(g,v,Ke,Cn,Ze),f(me,v,q,Cn,Ze),Ze=String.fromCharCode(55349,57334+Un),f(g,v,Ke,Cn,Ze),f(me,v,q,Cn,Ze)}var el="ÐÞþ";for(var lo=0;lo<el.length;lo++){var zs=el.charAt(lo);f(g,v,Ke,zs,zs),f(me,v,q,zs,zs)}var Ls=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathboldfrak","textboldfrak","Fraktur-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],Zc=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],_3=function(t,r){var a=t.charCodeAt(0),s=t.charCodeAt(1),i=(a-55296)*1024+(s-56320)+65536,o=r==="math"?0:1;if(119808<=i&&i<120484){var l=Math.floor((i-119808)/26);return[Ls[l][2],Ls[l][o]]}else if(120782<=i&&i<=120831){var c=Math.floor((i-120782)/10);return[Zc[c][2],Zc[c][o]]}else{if(i===120485||i===120486)return[Ls[0][2],Ls[0][o]];if(120486<i&&i<120782)return["",""];throw new ge("Unsupported character: "+t)}},Ni=function(t,r,a){return Dt[a][t]&&Dt[a][t].replace&&(t=Dt[a][t].replace),{value:t,metrics:Ql(t,r,a)}},Br=function(t,r,a,s,i){var o=Ni(t,r,a),l=o.metrics;t=o.value;var c;if(l){var d=l.italic;(a==="text"||s&&s.font==="mathit")&&(d=0),c=new Ir(t,l.height,l.depth,d,l.skew,l.width,i)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+r+"' and mode '"+a+"'")),c=new Ir(t,0,0,0,0,0,i);if(s){c.maxFontSize=s.sizeMultiplier,s.style.isTight()&&c.classes.push("mtight");var u=s.getColor();u&&(c.style.color=u)}return c},q3=function(t,r,a,s){return s===void 0&&(s=[]),a.font==="boldsymbol"&&Ni(t,"Main-Bold",r).metrics?Br(t,"Main-Bold",r,a,s.concat(["mathbf"])):t==="\\"||Dt[r][t].font==="main"?Br(t,"Main-Regular",r,a,s):Br(t,"AMS-Regular",r,a,s.concat(["amsrm"]))},H3=function(t,r,a,s,i){return i!=="textord"&&Ni(t,"Math-BoldItalic",r).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},U3=function(t,r,a){var s=t.mode,i=t.text,o=["mord"],l=s==="math"||s==="text"&&r.font,c=l?r.font:r.fontFamily,d="",u="";if(i.charCodeAt(0)===55349&&([d,u]=_3(i,s)),d.length>0)return Br(i,d,s,r,o.concat(u));if(c){var m,h;if(c==="boldsymbol"){var p=H3(i,s,r,o,a);m=p.fontName,h=[p.fontClass]}else l?(m=gh[c].fontName,h=[c]):(m=Ps(c,r.fontWeight,r.fontShape),h=[c,r.fontWeight,r.fontShape]);if(Ni(i,m,s).metrics)return Br(i,m,s,r,o.concat(h));if(hh.hasOwnProperty(i)&&m.slice(0,10)==="Typewriter"){for(var x=[],y=0;y<i.length;y++)x.push(Br(i[y],m,s,r,o.concat(h)));return fh(x)}}if(a==="mathord")return Br(i,"Math-Italic",s,r,o.concat(["mathnormal"]));if(a==="textord"){var k=Dt[s][i]&&Dt[s][i].font;if(k==="ams"){var w=Ps("amsrm",r.fontWeight,r.fontShape);return Br(i,w,s,r,o.concat("amsrm",r.fontWeight,r.fontShape))}else if(k==="main"||!k){var j=Ps("textrm",r.fontWeight,r.fontShape);return Br(i,j,s,r,o.concat(r.fontWeight,r.fontShape))}else{var N=Ps(k,r.fontWeight,r.fontShape);return Br(i,N,s,r,o.concat(N,r.fontWeight,r.fontShape))}}else throw new Error("unexpected type: "+a+" in makeOrd")},W3=(e,t)=>{if(zn(e.classes)!==zn(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(e.classes.length===1){var r=e.classes[0];if(r==="mbin"||r==="mord")return!1}for(var a in e.style)if(e.style.hasOwnProperty(a)&&e.style[a]!==t.style[a])return!1;for(var s in t.style)if(t.style.hasOwnProperty(s)&&e.style[s]!==t.style[s])return!1;return!0},V3=e=>{for(var t=0;t<e.length-1;t++){var r=e[t],a=e[t+1];r instanceof Ir&&a instanceof Ir&&W3(r,a)&&(r.text+=a.text,r.height=Math.max(r.height,a.height),r.depth=Math.max(r.depth,a.depth),r.italic=a.italic,e.splice(t+1,1),t--)}return e},e0=function(t){for(var r=0,a=0,s=0,i=0;i<t.children.length;i++){var o=t.children[i];o.height>r&&(r=o.height),o.depth>a&&(a=o.depth),o.maxFontSize>s&&(s=o.maxFontSize)}t.height=r,t.depth=a,t.maxFontSize=s},ur=function(t,r,a,s){var i=new fs(t,r,a,s);return e0(i),i},ph=(e,t,r,a)=>new fs(e,t,r,a),G3=function(t,r,a){var s=ur([t],[],r);return s.height=Math.max(a||r.fontMetrics().defaultRuleThickness,r.minRuleThickness),s.style.borderBottomWidth=Ne(s.height),s.maxFontSize=1,s},K3=function(t,r,a,s){var i=new Zl(t,r,a,s);return e0(i),i},fh=function(t){var r=new ps(t);return e0(r),r},J3=function(t,r){return t instanceof ps?ur([],[t],r):t},Y3=function(t){if(t.positionType==="individualShift"){for(var r=t.children,a=[r[0]],s=-r[0].shift-r[0].elem.depth,i=s,o=1;o<r.length;o++){var l=-r[o].shift-i-r[o].elem.depth,c=l-(r[o-1].elem.height+r[o-1].elem.depth);i=i+l,a.push({type:"kern",size:c}),a.push(r[o])}return{children:a,depth:s}}var d;if(t.positionType==="top"){for(var u=t.positionData,m=0;m<t.children.length;m++){var h=t.children[m];u-=h.type==="kern"?h.size:h.elem.height+h.elem.depth}d=u}else if(t.positionType==="bottom")d=-t.positionData;else{var p=t.children[0];if(p.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")d=-p.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")d=-p.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:d}},X3=function(t,r){for(var{children:a,depth:s}=Y3(t),i=0,o=0;o<a.length;o++){var l=a[o];if(l.type==="elem"){var c=l.elem;i=Math.max(i,c.maxFontSize,c.height)}}i+=2;var d=ur(["pstrut"],[]);d.style.height=Ne(i);for(var u=[],m=s,h=s,p=s,x=0;x<a.length;x++){var y=a[x];if(y.type==="kern")p+=y.size;else{var k=y.elem,w=y.wrapperClasses||[],j=y.wrapperStyle||{},N=ur(w,[d,k],void 0,j);N.style.top=Ne(-i-p-k.depth),y.marginLeft&&(N.style.marginLeft=y.marginLeft),y.marginRight&&(N.style.marginRight=y.marginRight),u.push(N),p+=k.height+k.depth}m=Math.min(m,p),h=Math.max(h,p)}var L=ur(["vlist"],u);L.style.height=Ne(h);var U;if(m<0){var I=ur([],[]),H=ur(["vlist"],[I]);H.style.height=Ne(-m);var F=ur(["vlist-s"],[new Ir("")]);U=[ur(["vlist-r"],[L,F]),ur(["vlist-r"],[H])]}else U=[ur(["vlist-r"],[L])];var W=ur(["vlist-t"],U);return U.length===2&&W.classes.push("vlist-t2"),W.height=h,W.depth=-m,W},Q3=(e,t)=>{var r=ur(["mspace"],[],t),a=Ot(e,t);return r.style.marginRight=Ne(a),r},Ps=function(t,r,a){var s="";switch(t){case"amsrm":s="AMS";break;case"textrm":s="Main";break;case"textsf":s="SansSerif";break;case"texttt":s="Typewriter";break;default:s=t}var i;return r==="textbf"&&a==="textit"?i="BoldItalic":r==="textbf"?i="Bold":r==="textit"?i="Italic":i="Regular",s+"-"+i},gh={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},xh={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Z3=function(t,r){var[a,s,i]=xh[t],o=new Ln(a),l=new mn([o],{width:Ne(s),height:Ne(i),style:"width:"+Ne(s),viewBox:"0 0 "+1e3*s+" "+1e3*i,preserveAspectRatio:"xMinYMin"}),c=ph(["overlay"],[l],r);return c.height=i,c.style.height=Ne(i),c.style.width=Ne(s),c},G={fontMap:gh,makeSymbol:Br,mathsym:q3,makeSpan:ur,makeSvgSpan:ph,makeLineSpan:G3,makeAnchor:K3,makeFragment:fh,wrapFragment:J3,makeVList:X3,makeOrd:U3,makeGlue:Q3,staticSvg:Z3,svgData:xh,tryCombineChars:V3},Ft={number:3,unit:"mu"},Wn={number:4,unit:"mu"},an={number:5,unit:"mu"},e6={mord:{mop:Ft,mbin:Wn,mrel:an,minner:Ft},mop:{mord:Ft,mop:Ft,mrel:an,minner:Ft},mbin:{mord:Wn,mop:Wn,mopen:Wn,minner:Wn},mrel:{mord:an,mop:an,mopen:an,minner:an},mopen:{},mclose:{mop:Ft,mbin:Wn,mrel:an,minner:Ft},mpunct:{mord:Ft,mop:Ft,mrel:an,mopen:Ft,mclose:Ft,mpunct:Ft,minner:Ft},minner:{mord:Ft,mop:Ft,mbin:Wn,mrel:an,mopen:Ft,mpunct:Ft,minner:Ft}},t6={mord:{mop:Ft},mop:{mord:Ft,mop:Ft},mbin:{},mrel:{},mopen:{},mclose:{mop:Ft},mpunct:{},minner:{mop:Ft}},bh={},ii={},oi={};function Ee(e){for(var{type:t,names:r,props:a,handler:s,htmlBuilder:i,mathmlBuilder:o}=e,l={type:t,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:s},c=0;c<r.length;++c)bh[r[c]]=l;t&&(i&&(ii[t]=i),o&&(oi[t]=o))}function ra(e){var{type:t,htmlBuilder:r,mathmlBuilder:a}=e;Ee({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:r,mathmlBuilder:a})}var li=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},_t=function(t){return t.type==="ordgroup"?t.body:[t]},hn=G.makeSpan,r6=["leftmost","mbin","mopen","mrel","mop","mpunct"],n6=["rightmost","mrel","mclose","mpunct"],a6={display:Je.DISPLAY,text:Je.TEXT,script:Je.SCRIPT,scriptscript:Je.SCRIPTSCRIPT},s6={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Gt=function(t,r,a,s){s===void 0&&(s=[null,null]);for(var i=[],o=0;o<t.length;o++){var l=vt(t[o],r);if(l instanceof ps){var c=l.children;i.push(...c)}else i.push(l)}if(G.tryCombineChars(i),!a)return i;var d=r;if(t.length===1){var u=t[0];u.type==="sizing"?d=r.havingSize(u.size):u.type==="styling"&&(d=r.havingStyle(a6[u.style]))}var m=hn([s[0]||"leftmost"],[],r),h=hn([s[1]||"rightmost"],[],r),p=a==="root";return ed(i,(x,y)=>{var k=y.classes[0],w=x.classes[0];k==="mbin"&&n6.includes(w)?y.classes[0]="mord":w==="mbin"&&r6.includes(k)&&(x.classes[0]="mord")},{node:m},h,p),ed(i,(x,y)=>{var k=tl(y),w=tl(x),j=k&&w?x.hasClass("mtight")?t6[k][w]:e6[k][w]:null;if(j)return G.makeGlue(j,d)},{node:m},h,p),i},ed=function e(t,r,a,s,i){s&&t.push(s);for(var o=0;o<t.length;o++){var l=t[o],c=yh(l);if(c){e(c.children,r,a,null,i);continue}var d=!l.hasClass("mspace");if(d){var u=r(l,a.node);u&&(a.insertAfter?a.insertAfter(u):(t.unshift(u),o++))}d?a.node=l:i&&l.hasClass("newline")&&(a.node=hn(["leftmost"])),a.insertAfter=(m=>h=>{t.splice(m+1,0,h),o++})(o)}s&&t.pop()},yh=function(t){return t instanceof ps||t instanceof Zl||t instanceof fs&&t.hasClass("enclosing")?t:null},i6=function e(t,r){var a=yh(t);if(a){var s=a.children;if(s.length){if(r==="right")return e(s[s.length-1],"right");if(r==="left")return e(s[0],"left")}}return t},tl=function(t,r){return t?(r&&(t=i6(t,r)),s6[t.classes[0]]||null):null},rs=function(t,r){var a=["nulldelimiter"].concat(t.baseSizingClasses());return hn(r.concat(a))},vt=function(t,r,a){if(!t)return hn();if(ii[t.type]){var s=ii[t.type](t,r);if(a&&r.size!==a.size){s=hn(r.sizingClasses(a),[s],r);var i=r.sizeMultiplier/a.sizeMultiplier;s.height*=i,s.depth*=i}return s}else throw new ge("Got group of unknown type: '"+t.type+"'")};function Rs(e,t){var r=hn(["base"],e,t),a=hn(["strut"]);return a.style.height=Ne(r.height+r.depth),r.depth&&(a.style.verticalAlign=Ne(-r.depth)),r.children.unshift(a),r}function rl(e,t){var r=null;e.length===1&&e[0].type==="tag"&&(r=e[0].tag,e=e[0].body);var a=Gt(e,t,"root"),s;a.length===2&&a[1].hasClass("tag")&&(s=a.pop());for(var i=[],o=[],l=0;l<a.length;l++)if(o.push(a[l]),a[l].hasClass("mbin")||a[l].hasClass("mrel")||a[l].hasClass("allowbreak")){for(var c=!1;l<a.length-1&&a[l+1].hasClass("mspace")&&!a[l+1].hasClass("newline");)l++,o.push(a[l]),a[l].hasClass("nobreak")&&(c=!0);c||(i.push(Rs(o,t)),o=[])}else a[l].hasClass("newline")&&(o.pop(),o.length>0&&(i.push(Rs(o,t)),o=[]),i.push(a[l]));o.length>0&&i.push(Rs(o,t));var d;r?(d=Rs(Gt(r,t,!0)),d.classes=["tag"],i.push(d)):s&&i.push(s);var u=hn(["katex-html"],i);if(u.setAttribute("aria-hidden","true"),d){var m=d.children[0];m.style.height=Ne(u.height+u.depth),u.depth&&(m.style.verticalAlign=Ne(-u.depth))}return u}function vh(e){return new ps(e)}class vr{constructor(t,r,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=r||[],this.classes=a||[]}setAttribute(t,r){this.attributes[t]=r}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&t.setAttribute(r,this.attributes[r]);this.classes.length>0&&(t.className=zn(this.classes));for(var a=0;a<this.children.length;a++)if(this.children[a]instanceof Gr&&this.children[a+1]instanceof Gr){for(var s=this.children[a].toText()+this.children[++a].toText();this.children[a+1]instanceof Gr;)s+=this.children[++a].toText();t.appendChild(new Gr(s).toNode())}else t.appendChild(this.children[a].toNode());return t}toMarkup(){var t="<"+this.type;for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&(t+=" "+r+'="',t+=kt.escape(this.attributes[r]),t+='"');this.classes.length>0&&(t+=' class ="'+kt.escape(zn(this.classes))+'"'),t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Gr{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return kt.escape(this.toText())}toText(){return this.text}}class o6{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character=" ":t>=-.05556&&t<=-.05555?this.character=" ":t>=-.1667&&t<=-.1666?this.character=" ":t>=-.2223&&t<=-.2222?this.character=" ":t>=-.2778&&t<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Ne(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Ne(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var fe={MathNode:vr,TextNode:Gr,SpaceNode:o6,newDocumentFragment:vh},Dr=function(t,r,a){return Dt[r][t]&&Dt[r][t].replace&&t.charCodeAt(0)!==55349&&!(hh.hasOwnProperty(t)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(t=Dt[r][t].replace),new fe.TextNode(t)},t0=function(t){return t.length===1?t[0]:new fe.MathNode("mrow",t)},r0=function(t,r){if(r.fontFamily==="texttt")return"monospace";if(r.fontFamily==="textsf")return r.fontShape==="textit"&&r.fontWeight==="textbf"?"sans-serif-bold-italic":r.fontShape==="textit"?"sans-serif-italic":r.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(r.fontShape==="textit"&&r.fontWeight==="textbf")return"bold-italic";if(r.fontShape==="textit")return"italic";if(r.fontWeight==="textbf")return"bold";var a=r.font;if(!a||a==="mathnormal")return null;var s=t.mode;if(a==="mathit")return"italic";if(a==="boldsymbol")return t.type==="textord"?"bold":"bold-italic";if(a==="mathbf")return"bold";if(a==="mathbb")return"double-struck";if(a==="mathsfit")return"sans-serif-italic";if(a==="mathfrak")return"fraktur";if(a==="mathscr"||a==="mathcal")return"script";if(a==="mathsf")return"sans-serif";if(a==="mathtt")return"monospace";var i=t.text;if(["\\imath","\\jmath"].includes(i))return null;Dt[s][i]&&Dt[s][i].replace&&(i=Dt[s][i].replace);var o=G.fontMap[a].fontName;return Ql(i,o,s)?G.fontMap[a].variant:null};function co(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Gr&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var r=e.children[0];return r instanceof Gr&&r.text===","}else return!1}var gr=function(t,r,a){if(t.length===1){var s=Tt(t[0],r);return a&&s instanceof vr&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var i=[],o,l=0;l<t.length;l++){var c=Tt(t[l],r);if(c instanceof vr&&o instanceof vr){if(c.type==="mtext"&&o.type==="mtext"&&c.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...c.children);continue}else if(c.type==="mn"&&o.type==="mn"){o.children.push(...c.children);continue}else if(co(c)&&o.type==="mn"){o.children.push(...c.children);continue}else if(c.type==="mn"&&co(o))c.children=[...o.children,...c.children],i.pop();else if((c.type==="msup"||c.type==="msub")&&c.children.length>=1&&(o.type==="mn"||co(o))){var d=c.children[0];d instanceof vr&&d.type==="mn"&&(d.children=[...o.children,...d.children],i.pop())}else if(o.type==="mi"&&o.children.length===1){var u=o.children[0];if(u instanceof Gr&&u.text==="̸"&&(c.type==="mo"||c.type==="mi"||c.type==="mn")){var m=c.children[0];m instanceof Gr&&m.text.length>0&&(m.text=m.text.slice(0,1)+"̸"+m.text.slice(1),i.pop())}}}i.push(c),o=c}return i},Pn=function(t,r,a){return t0(gr(t,r,a))},Tt=function(t,r){if(!t)return new fe.MathNode("mrow");if(oi[t.type]){var a=oi[t.type](t,r);return a}else throw new ge("Got group of unknown type: '"+t.type+"'")};function td(e,t,r,a,s){var i=gr(e,r),o;i.length===1&&i[0]instanceof vr&&["mrow","mtable"].includes(i[0].type)?o=i[0]:o=new fe.MathNode("mrow",i);var l=new fe.MathNode("annotation",[new fe.TextNode(t)]);l.setAttribute("encoding","application/x-tex");var c=new fe.MathNode("semantics",[o,l]),d=new fe.MathNode("math",[c]);d.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&d.setAttribute("display","block");var u=s?"katex":"katex-mathml";return G.makeSpan([u],[d])}var kh=function(t){return new sn({style:t.displayMode?Je.DISPLAY:Je.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},wh=function(t,r){if(r.displayMode){var a=["katex-display"];r.leqno&&a.push("leqno"),r.fleqn&&a.push("fleqn"),t=G.makeSpan(a,[t])}return t},l6=function(t,r,a){var s=kh(a),i;if(a.output==="mathml")return td(t,r,s,a.displayMode,!0);if(a.output==="html"){var o=rl(t,s);i=G.makeSpan(["katex"],[o])}else{var l=td(t,r,s,a.displayMode,!1),c=rl(t,s);i=G.makeSpan(["katex"],[l,c])}return wh(i,a)},c6=function(t,r,a){var s=kh(a),i=rl(t,s),o=G.makeSpan(["katex"],[i]);return wh(o,a)},d6={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},u6=function(t){var r=new fe.MathNode("mo",[new fe.TextNode(d6[t.replace(/^\\/,"")])]);return r.setAttribute("stretchy","true"),r},m6={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},h6=function(t){return t.type==="ordgroup"?t.body.length:1},p6=function(t,r){function a(){var l=4e5,c=t.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(c)){var d=t,u=h6(d.base),m,h,p;if(u>5)c==="widehat"||c==="widecheck"?(m=420,l=2364,p=.42,h=c+"4"):(m=312,l=2340,p=.34,h="tilde4");else{var x=[1,1,2,2,3,3][u];c==="widehat"||c==="widecheck"?(l=[0,1062,2364,2364,2364][x],m=[0,239,300,360,420][x],p=[0,.24,.3,.3,.36,.42][x],h=c+x):(l=[0,600,1033,2339,2340][x],m=[0,260,286,306,312][x],p=[0,.26,.286,.3,.306,.34][x],h="tilde"+x)}var y=new Ln(h),k=new mn([y],{width:"100%",height:Ne(p),viewBox:"0 0 "+l+" "+m,preserveAspectRatio:"none"});return{span:G.makeSvgSpan([],[k],r),minWidth:0,height:p}}else{var w=[],j=m6[c],[N,L,U]=j,I=U/1e3,H=N.length,F,W;if(H===1){var M=j[3];F=["hide-tail"],W=[M]}else if(H===2)F=["halfarrow-left","halfarrow-right"],W=["xMinYMin","xMaxYMin"];else if(H===3)F=["brace-left","brace-center","brace-right"],W=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
673
|
-
`+H+" children.");for(var _=0;_<H;_++){var O=new Ln(N[_]),V=new mn([O],{width:"400em",height:Ne(I),viewBox:"0 0 "+l+" "+U,preserveAspectRatio:W[_]+" slice"}),T=G.makeSvgSpan([F[_]],[V],r);if(H===1)return{span:T,minWidth:L,height:I};T.style.height=Ne(I),w.push(T)}return{span:G.makeSpan(["stretchy"],w,r),minWidth:L,height:I}}}var{span:s,minWidth:i,height:o}=a();return s.height=o,s.style.height=Ne(o),i>0&&(s.style.minWidth=Ne(i)),s},f6=function(t,r,a,s,i){var o,l=t.height+t.depth+a+s;if(/fbox|color|angl/.test(r)){if(o=G.makeSpan(["stretchy",r],[],i),r==="fbox"){var c=i.color&&i.getColor();c&&(o.style.borderColor=c)}}else{var d=[];/^[bx]cancel$/.test(r)&&d.push(new Zo({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(r)&&d.push(new Zo({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new mn(d,{width:"100%",height:Ne(l)});o=G.makeSvgSpan([],[u],i)}return o.height=l,o.style.height=Ne(l),o},pn={encloseSpan:f6,mathMLnode:u6,svgSpan:p6};function ot(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function n0(e){var t=Si(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Si(e){return e&&(e.type==="atom"||$3.hasOwnProperty(e.type))?e:null}var a0=(e,t)=>{var r,a,s;e&&e.type==="supsub"?(a=ot(e.base,"accent"),r=a.base,e.base=r,s=B3(vt(e,t)),e.base=a):(a=ot(e,"accent"),r=a.base);var i=vt(r,t.havingCrampedStyle()),o=a.isShifty&&kt.isCharacterBox(r),l=0;if(o){var c=kt.getBaseElem(r),d=vt(c,t.havingCrampedStyle());l=Kc(d).skew}var u=a.label==="\\c",m=u?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight),h;if(a.isStretchy)h=pn.svgSpan(a,t),h=G.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+Ne(2*l)+")",marginLeft:Ne(2*l)}:void 0}]},t);else{var p,x;a.label==="\\vec"?(p=G.staticSvg("vec",t),x=G.svgData.vec[1]):(p=G.makeOrd({mode:a.mode,text:a.label},t,"textord"),p=Kc(p),p.italic=0,x=p.width,u&&(m+=p.depth)),h=G.makeSpan(["accent-body"],[p]);var y=a.label==="\\textcircled";y&&(h.classes.push("accent-full"),m=i.height);var k=l;y||(k-=x/2),h.style.left=Ne(k),a.label==="\\textcircled"&&(h.style.top=".2em"),h=G.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-m},{type:"elem",elem:h}]},t)}var w=G.makeSpan(["mord","accent"],[h],t);return s?(s.children[0]=w,s.height=Math.max(w.height,s.height),s.classes[0]="mord",s):w},jh=(e,t)=>{var r=e.isStretchy?pn.mathMLnode(e.label):new fe.MathNode("mo",[Dr(e.label,e.mode)]),a=new fe.MathNode("mover",[Tt(e.base,t),r]);return a.setAttribute("accent","true"),a},g6=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ee({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var r=li(t[0]),a=!g6.test(e.funcName),s=!a||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:a,isShifty:s,base:r}},htmlBuilder:a0,mathmlBuilder:jh});Ee({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var r=t[0],a=e.parser.mode;return a==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:e.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:a0,mathmlBuilder:jh});Ee({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:r,funcName:a}=e,s=t[0];return{type:"accentUnder",mode:r.mode,label:a,base:s}},htmlBuilder:(e,t)=>{var r=vt(e.base,t),a=pn.svgSpan(e,t),s=e.label==="\\utilde"?.12:0,i=G.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:r}]},t);return G.makeSpan(["mord","accentunder"],[i],t)},mathmlBuilder:(e,t)=>{var r=pn.mathMLnode(e.label),a=new fe.MathNode("munder",[Tt(e.base,t),r]);return a.setAttribute("accentunder","true"),a}});var Fs=e=>{var t=new fe.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ee({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){var{parser:a,funcName:s}=e;return{type:"xArrow",mode:a.mode,label:s,body:t[0],below:r[0]}},htmlBuilder(e,t){var r=t.style,a=t.havingStyle(r.sup()),s=G.wrapFragment(vt(e.body,a,t),t),i=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(i+"-arrow-pad");var o;e.below&&(a=t.havingStyle(r.sub()),o=G.wrapFragment(vt(e.below,a,t),t),o.classes.push(i+"-arrow-pad"));var l=pn.svgSpan(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(d-=s.depth);var u;if(o){var m=-t.fontMetrics().axisHeight+o.height+.5*l.height+.111;u=G.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c},{type:"elem",elem:o,shift:m}]},t)}else u=G.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:d},{type:"elem",elem:l,shift:c}]},t);return u.children[0].children[0].children[1].classes.push("svg-align"),G.makeSpan(["mrel","x-arrow"],[u],t)},mathmlBuilder(e,t){var r=pn.mathMLnode(e.label);r.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(e.body){var s=Fs(Tt(e.body,t));if(e.below){var i=Fs(Tt(e.below,t));a=new fe.MathNode("munderover",[r,i,s])}else a=new fe.MathNode("mover",[r,s])}else if(e.below){var o=Fs(Tt(e.below,t));a=new fe.MathNode("munder",[r,o])}else a=Fs(),a=new fe.MathNode("mover",[r,a]);return a}});var x6=G.makeSpan;function Nh(e,t){var r=Gt(e.body,t,!0);return x6([e.mclass],r,t)}function Sh(e,t){var r,a=gr(e.body,t);return e.mclass==="minner"?r=new fe.MathNode("mpadded",a):e.mclass==="mord"?e.isCharacterBox?(r=a[0],r.type="mi"):r=new fe.MathNode("mi",a):(e.isCharacterBox?(r=a[0],r.type="mo"):r=new fe.MathNode("mo",a),e.mclass==="mbin"?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):e.mclass==="mpunct"?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(r.attributes.lspace="0em",r.attributes.rspace="0em"):e.mclass==="minner"&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}Ee({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:r,funcName:a}=e,s=t[0];return{type:"mclass",mode:r.mode,mclass:"m"+a.slice(5),body:_t(s),isCharacterBox:kt.isCharacterBox(s)}},htmlBuilder:Nh,mathmlBuilder:Sh});var Ci=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Ee({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:r}=e;return{type:"mclass",mode:r.mode,mclass:Ci(t[0]),body:_t(t[1]),isCharacterBox:kt.isCharacterBox(t[1])}}});Ee({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:r,funcName:a}=e,s=t[1],i=t[0],o;a!=="\\stackrel"?o=Ci(s):o="mrel";var l={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:_t(s)},c={type:"supsub",mode:i.mode,base:l,sup:a==="\\underset"?null:i,sub:a==="\\underset"?i:null};return{type:"mclass",mode:r.mode,mclass:o,body:[c],isCharacterBox:kt.isCharacterBox(c)}},htmlBuilder:Nh,mathmlBuilder:Sh});Ee({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:r}=e;return{type:"pmb",mode:r.mode,mclass:Ci(t[0]),body:_t(t[0])}},htmlBuilder(e,t){var r=Gt(e.body,t,!0),a=G.makeSpan([e.mclass],r,t);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(e,t){var r=gr(e.body,t),a=new fe.MathNode("mstyle",r);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var b6={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},rd=()=>({type:"styling",body:[],mode:"math",style:"display"}),nd=e=>e.type==="textord"&&e.text==="@",y6=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function v6(e,t,r){var a=b6[e];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(a,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var s=r.callFunction("\\\\cdleft",[t[0]],[]),i={type:"atom",text:a,mode:"math",family:"rel"},o=r.callFunction("\\Big",[i],[]),l=r.callFunction("\\\\cdright",[t[1]],[]),c={type:"ordgroup",mode:"math",body:[s,o,l]};return r.callFunction("\\\\cdparent",[c],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var d={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[d],[])}default:return{type:"textord",text:" ",mode:"math"}}}function k6(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var r=e.fetch().text;if(r==="&"||r==="\\\\")e.consume();else if(r==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new ge("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var a=[],s=[a],i=0;i<t.length;i++){for(var o=t[i],l=rd(),c=0;c<o.length;c++)if(!nd(o[c]))l.body.push(o[c]);else{a.push(l),c+=1;var d=n0(o[c]).text,u=new Array(2);if(u[0]={type:"ordgroup",mode:"math",body:[]},u[1]={type:"ordgroup",mode:"math",body:[]},!("=|.".indexOf(d)>-1))if("<>AV".indexOf(d)>-1)for(var m=0;m<2;m++){for(var h=!0,p=c+1;p<o.length;p++){if(y6(o[p],d)){h=!1,c=p;break}if(nd(o[p]))throw new ge("Missing a "+d+" character to complete a CD arrow.",o[p]);u[m].body.push(o[p])}if(h)throw new ge("Missing a "+d+" character to complete a CD arrow.",o[c])}else throw new ge('Expected one of "<>AV=|." after @',o[c]);var x=v6(d,u,e),y={type:"styling",body:[x],mode:"math",style:"display"};a.push(y),l=rd()}i%2===0?a.push(l):a.shift(),a=[],s.push(a)}e.gullet.endGroup(),e.gullet.endGroup();var k=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:k,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}Ee({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:r,funcName:a}=e;return{type:"cdlabel",mode:r.mode,side:a.slice(4),label:t[0]}},htmlBuilder(e,t){var r=t.havingStyle(t.style.sup()),a=G.wrapFragment(vt(e.label,r,t),t);return a.classes.push("cd-label-"+e.side),a.style.bottom=Ne(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(e,t){var r=new fe.MathNode("mrow",[Tt(e.label,t)]);return r=new fe.MathNode("mpadded",[r]),r.setAttribute("width","0"),e.side==="left"&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new fe.MathNode("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}});Ee({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:r}=e;return{type:"cdlabelparent",mode:r.mode,fragment:t[0]}},htmlBuilder(e,t){var r=G.wrapFragment(vt(e.fragment,t),t);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(e,t){return new fe.MathNode("mrow",[Tt(e.fragment,t)])}});Ee({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:r}=e,a=ot(t[0],"ordgroup"),s=a.body,i="",o=0;o<s.length;o++){var l=ot(s[o],"textord");i+=l.text}var c=parseInt(i),d;if(isNaN(c))throw new ge("\\@char has non-numeric argument "+i);if(c<0||c>=1114111)throw new ge("\\@char with invalid code point "+i);return c<=65535?d=String.fromCharCode(c):(c-=65536,d=String.fromCharCode((c>>10)+55296,(c&1023)+56320)),{type:"textord",mode:r.mode,text:d}}});var Ch=(e,t)=>{var r=Gt(e.body,t.withColor(e.color),!1);return G.makeFragment(r)},Mh=(e,t)=>{var r=gr(e.body,t.withColor(e.color)),a=new fe.MathNode("mstyle",r);return a.setAttribute("mathcolor",e.color),a};Ee({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:r}=e,a=ot(t[0],"color-token").color,s=t[1];return{type:"color",mode:r.mode,color:a,body:_t(s)}},htmlBuilder:Ch,mathmlBuilder:Mh});Ee({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:r,breakOnTokenText:a}=e,s=ot(t[0],"color-token").color;r.gullet.macros.set("\\current@color",s);var i=r.parseExpression(!0,a);return{type:"color",mode:r.mode,color:s,body:i}},htmlBuilder:Ch,mathmlBuilder:Mh});Ee({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,r){var{parser:a}=e,s=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,i=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:i,size:s&&ot(s,"size").value}},htmlBuilder(e,t){var r=G.makeSpan(["mspace"],[],t);return e.newLine&&(r.classes.push("newline"),e.size&&(r.style.marginTop=Ne(Ot(e.size,t)))),r},mathmlBuilder(e,t){var r=new fe.MathNode("mspace");return e.newLine&&(r.setAttribute("linebreak","newline"),e.size&&r.setAttribute("height",Ne(Ot(e.size,t)))),r}});var nl={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Ah=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new ge("Expected a control sequence",e);return t},w6=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},Th=(e,t,r,a)=>{var s=e.gullet.macros.get(r.text);s==null&&(r.noexpand=!0,s={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,s,a)};Ee({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:r}=e;t.consumeSpaces();var a=t.fetch();if(nl[a.text])return(r==="\\global"||r==="\\\\globallong")&&(a.text=nl[a.text]),ot(t.parseFunction(),"internal");throw new ge("Invalid token after macro prefix",a)}});Ee({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:r}=e,a=t.gullet.popToken(),s=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new ge("Expected a control sequence",a);for(var i=0,o,l=[[]];t.gullet.future().text!=="{";)if(a=t.gullet.popToken(),a.text==="#"){if(t.gullet.future().text==="{"){o=t.gullet.future(),l[i].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new ge('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==i+1)throw new ge('Argument number "'+a.text+'" out of order');i++,l.push([])}else{if(a.text==="EOF")throw new ge("Expected a macro definition");l[i].push(a.text)}var{tokens:c}=t.gullet.consumeArg();return o&&c.unshift(o),(r==="\\edef"||r==="\\xdef")&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(s,{tokens:c,numArgs:i,delimiters:l},r===nl[r]),{type:"internal",mode:t.mode}}});Ee({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:r}=e,a=Ah(t.gullet.popToken());t.gullet.consumeSpaces();var s=w6(t);return Th(t,a,s,r==="\\\\globallet"),{type:"internal",mode:t.mode}}});Ee({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:r}=e,a=Ah(t.gullet.popToken()),s=t.gullet.popToken(),i=t.gullet.popToken();return Th(t,a,i,r==="\\\\globalfuture"),t.gullet.pushToken(i),t.gullet.pushToken(s),{type:"internal",mode:t.mode}}});var _a=function(t,r,a){var s=Dt.math[t]&&Dt.math[t].replace,i=Ql(s||t,r,a);if(!i)throw new Error("Unsupported symbol "+t+" and font size "+r+".");return i},s0=function(t,r,a,s){var i=a.havingBaseStyle(r),o=G.makeSpan(s.concat(i.sizingClasses(a)),[t],a),l=i.sizeMultiplier/a.sizeMultiplier;return o.height*=l,o.depth*=l,o.maxFontSize=i.sizeMultiplier,o},Eh=function(t,r,a){var s=r.havingBaseStyle(a),i=(1-r.sizeMultiplier/s.sizeMultiplier)*r.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Ne(i),t.height-=i,t.depth+=i},j6=function(t,r,a,s,i,o){var l=G.makeSymbol(t,"Main-Regular",i,s),c=s0(l,r,s,o);return a&&Eh(c,s,r),c},N6=function(t,r,a,s){return G.makeSymbol(t,"Size"+r+"-Regular",a,s)},Ih=function(t,r,a,s,i,o){var l=N6(t,r,i,s),c=s0(G.makeSpan(["delimsizing","size"+r],[l],s),Je.TEXT,s,o);return a&&Eh(c,s,Je.TEXT),c},uo=function(t,r,a){var s;r==="Size1-Regular"?s="delim-size1":s="delim-size4";var i=G.makeSpan(["delimsizinginner",s],[G.makeSpan([],[G.makeSymbol(t,r,a)])]);return{type:"elem",elem:i}},mo=function(t,r,a){var s=Vr["Size4-Regular"][t.charCodeAt(0)]?Vr["Size4-Regular"][t.charCodeAt(0)][4]:Vr["Size1-Regular"][t.charCodeAt(0)][4],i=new Ln("inner",T3(t,Math.round(1e3*r))),o=new mn([i],{width:Ne(s),height:Ne(r),style:"width:"+Ne(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*r),preserveAspectRatio:"xMinYMin"}),l=G.makeSvgSpan([],[o],a);return l.height=r,l.style.height=Ne(r),l.style.width=Ne(s),{type:"elem",elem:l}},al=.008,Bs={type:"kern",size:-1*al},S6=["|","\\lvert","\\rvert","\\vert"],C6=["\\|","\\lVert","\\rVert","\\Vert"],Dh=function(t,r,a,s,i,o){var l,c,d,u,m="",h=0;l=d=u=t,c=null;var p="Size1-Regular";t==="\\uparrow"?d=u="⏐":t==="\\Uparrow"?d=u="‖":t==="\\downarrow"?l=d="⏐":t==="\\Downarrow"?l=d="‖":t==="\\updownarrow"?(l="\\uparrow",d="⏐",u="\\downarrow"):t==="\\Updownarrow"?(l="\\Uparrow",d="‖",u="\\Downarrow"):S6.includes(t)?(d="∣",m="vert",h=333):C6.includes(t)?(d="∥",m="doublevert",h=556):t==="["||t==="\\lbrack"?(l="⎡",d="⎢",u="⎣",p="Size4-Regular",m="lbrack",h=667):t==="]"||t==="\\rbrack"?(l="⎤",d="⎥",u="⎦",p="Size4-Regular",m="rbrack",h=667):t==="\\lfloor"||t==="⌊"?(d=l="⎢",u="⎣",p="Size4-Regular",m="lfloor",h=667):t==="\\lceil"||t==="⌈"?(l="⎡",d=u="⎢",p="Size4-Regular",m="lceil",h=667):t==="\\rfloor"||t==="⌋"?(d=l="⎥",u="⎦",p="Size4-Regular",m="rfloor",h=667):t==="\\rceil"||t==="⌉"?(l="⎤",d=u="⎥",p="Size4-Regular",m="rceil",h=667):t==="("||t==="\\lparen"?(l="⎛",d="⎜",u="⎝",p="Size4-Regular",m="lparen",h=875):t===")"||t==="\\rparen"?(l="⎞",d="⎟",u="⎠",p="Size4-Regular",m="rparen",h=875):t==="\\{"||t==="\\lbrace"?(l="⎧",c="⎨",u="⎩",d="⎪",p="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(l="⎫",c="⎬",u="⎭",d="⎪",p="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(l="⎧",u="⎩",d="⎪",p="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(l="⎫",u="⎭",d="⎪",p="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(l="⎧",u="⎭",d="⎪",p="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(l="⎫",u="⎩",d="⎪",p="Size4-Regular");var x=_a(l,p,i),y=x.height+x.depth,k=_a(d,p,i),w=k.height+k.depth,j=_a(u,p,i),N=j.height+j.depth,L=0,U=1;if(c!==null){var I=_a(c,p,i);L=I.height+I.depth,U=2}var H=y+N+L,F=Math.max(0,Math.ceil((r-H)/(U*w))),W=H+F*U*w,M=s.fontMetrics().axisHeight;a&&(M*=s.sizeMultiplier);var _=W/2-M,O=[];if(m.length>0){var V=W-y-N,T=Math.round(W*1e3),Y=E3(m,Math.round(V*1e3)),ne=new Ln(m,Y),he=(h/1e3).toFixed(3)+"em",$=(T/1e3).toFixed(3)+"em",J=new mn([ne],{width:he,height:$,viewBox:"0 0 "+h+" "+T}),C=G.makeSvgSpan([],[J],s);C.height=T/1e3,C.style.width=he,C.style.height=$,O.push({type:"elem",elem:C})}else{if(O.push(uo(u,p,i)),O.push(Bs),c===null){var ue=W-y-N+2*al;O.push(mo(d,ue,s))}else{var xe=(W-y-N-L)/2+2*al;O.push(mo(d,xe,s)),O.push(Bs),O.push(uo(c,p,i)),O.push(Bs),O.push(mo(d,xe,s))}O.push(Bs),O.push(uo(l,p,i))}var A=s.havingBaseStyle(Je.TEXT),te=G.makeVList({positionType:"bottom",positionData:_,children:O},A);return s0(G.makeSpan(["delimsizing","mult"],[te],A),Je.TEXT,s,o)},ho=80,po=.08,fo=function(t,r,a,s,i){var o=A3(t,s,a),l=new Ln(t,o),c=new mn([l],{width:"400em",height:Ne(r),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return G.makeSvgSpan(["hide-tail"],[c],i)},M6=function(t,r){var a=r.havingBaseSizing(),s=Rh("\\surd",t*a.sizeMultiplier,Ph,a),i=a.sizeMultiplier,o=Math.max(0,r.minRuleThickness-r.fontMetrics().sqrtRuleThickness),l,c=0,d=0,u=0,m;return s.type==="small"?(u=1e3+1e3*o+ho,t<1?i=1:t<1.4&&(i=.7),c=(1+o+po)/i,d=(1+o)/i,l=fo("sqrtMain",c,u,o,r),l.style.minWidth="0.853em",m=.833/i):s.type==="large"?(u=(1e3+ho)*Ja[s.size],d=(Ja[s.size]+o)/i,c=(Ja[s.size]+o+po)/i,l=fo("sqrtSize"+s.size,c,u,o,r),l.style.minWidth="1.02em",m=1/i):(c=t+o+po,d=t+o,u=Math.floor(1e3*t+o)+ho,l=fo("sqrtTall",c,u,o,r),l.style.minWidth="0.742em",m=1.056),l.height=d,l.style.height=Ne(c),{span:l,advanceWidth:m,ruleWidth:(r.fontMetrics().sqrtRuleThickness+o)*i}},zh=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],A6=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Lh=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Ja=[0,1.2,1.8,2.4,3],T6=function(t,r,a,s,i){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),zh.includes(t)||Lh.includes(t))return Ih(t,r,!1,a,s,i);if(A6.includes(t))return Dh(t,Ja[r],!1,a,s,i);throw new ge("Illegal delimiter: '"+t+"'")},E6=[{type:"small",style:Je.SCRIPTSCRIPT},{type:"small",style:Je.SCRIPT},{type:"small",style:Je.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],I6=[{type:"small",style:Je.SCRIPTSCRIPT},{type:"small",style:Je.SCRIPT},{type:"small",style:Je.TEXT},{type:"stack"}],Ph=[{type:"small",style:Je.SCRIPTSCRIPT},{type:"small",style:Je.SCRIPT},{type:"small",style:Je.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],D6=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+t.type+"' here.")},Rh=function(t,r,a,s){for(var i=Math.min(2,3-s.style.size),o=i;o<a.length&&a[o].type!=="stack";o++){var l=_a(t,D6(a[o]),"math"),c=l.height+l.depth;if(a[o].type==="small"){var d=s.havingBaseStyle(a[o].style);c*=d.sizeMultiplier}if(c>r)return a[o]}return a[a.length-1]},Fh=function(t,r,a,s,i,o){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var l;Lh.includes(t)?l=E6:zh.includes(t)?l=Ph:l=I6;var c=Rh(t,r,l,s);return c.type==="small"?j6(t,c.style,a,s,i,o):c.type==="large"?Ih(t,c.size,a,s,i,o):Dh(t,r,a,s,i,o)},z6=function(t,r,a,s,i,o){var l=s.fontMetrics().axisHeight*s.sizeMultiplier,c=901,d=5/s.fontMetrics().ptPerEm,u=Math.max(r-l,a+l),m=Math.max(u/500*c,2*u-d);return Fh(t,m,!0,s,i,o)},un={sqrtImage:M6,sizedDelim:T6,sizeToMaxHeight:Ja,customSizedDelim:Fh,leftRightDelim:z6},ad={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},L6=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Mi(e,t){var r=Si(e);if(r&&L6.includes(r.text))return r;throw r?new ge("Invalid delimiter '"+r.text+"' after '"+t.funcName+"'",e):new ge("Invalid delimiter type '"+e.type+"'",e)}Ee({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var r=Mi(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:ad[e.funcName].size,mclass:ad[e.funcName].mclass,delim:r.text}},htmlBuilder:(e,t)=>e.delim==="."?G.makeSpan([e.mclass]):un.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Dr(e.delim,e.mode));var r=new fe.MathNode("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var a=Ne(un.sizeToMaxHeight[e.size]);return r.setAttribute("minsize",a),r.setAttribute("maxsize",a),r}});function sd(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ee({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var r=e.parser.gullet.macros.get("\\current@color");if(r&&typeof r!="string")throw new ge("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Mi(t[0],e).text,color:r}}});Ee({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var r=Mi(t[0],e),a=e.parser;++a.leftrightDepth;var s=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var i=ot(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:s,left:r.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{sd(e);for(var r=Gt(e.body,t,!0,["mopen","mclose"]),a=0,s=0,i=!1,o=0;o<r.length;o++)r[o].isMiddle?i=!0:(a=Math.max(r[o].height,a),s=Math.max(r[o].depth,s));a*=t.sizeMultiplier,s*=t.sizeMultiplier;var l;if(e.left==="."?l=rs(t,["mopen"]):l=un.leftRightDelim(e.left,a,s,t,e.mode,["mopen"]),r.unshift(l),i)for(var c=1;c<r.length;c++){var d=r[c],u=d.isMiddle;u&&(r[c]=un.leftRightDelim(u.delim,a,s,u.options,e.mode,[]))}var m;if(e.right===".")m=rs(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;m=un.leftRightDelim(e.right,a,s,h,e.mode,["mclose"])}return r.push(m),G.makeSpan(["minner"],r,t)},mathmlBuilder:(e,t)=>{sd(e);var r=gr(e.body,t);if(e.left!=="."){var a=new fe.MathNode("mo",[Dr(e.left,e.mode)]);a.setAttribute("fence","true"),r.unshift(a)}if(e.right!=="."){var s=new fe.MathNode("mo",[Dr(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),r.push(s)}return t0(r)}});Ee({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var r=Mi(t[0],e);if(!e.parser.leftrightDepth)throw new ge("\\middle without preceding \\left",r);return{type:"middle",mode:e.parser.mode,delim:r.text}},htmlBuilder:(e,t)=>{var r;if(e.delim===".")r=rs(t,[]);else{r=un.sizedDelim(e.delim,1,t,e.mode,[]);var a={delim:e.delim,options:t};r.isMiddle=a}return r},mathmlBuilder:(e,t)=>{var r=e.delim==="\\vert"||e.delim==="|"?Dr("|","text"):Dr(e.delim,e.mode),a=new fe.MathNode("mo",[r]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var i0=(e,t)=>{var r=G.wrapFragment(vt(e.body,t),t),a=e.label.slice(1),s=t.sizeMultiplier,i,o=0,l=kt.isCharacterBox(e.body);if(a==="sout")i=G.makeSpan(["stretchy","sout"]),i.height=t.fontMetrics().defaultRuleThickness/s,o=-.5*t.fontMetrics().xHeight;else if(a==="phase"){var c=Ot({number:.6,unit:"pt"},t),d=Ot({number:.35,unit:"ex"},t),u=t.havingBaseSizing();s=s/u.sizeMultiplier;var m=r.height+r.depth+c+d;r.style.paddingLeft=Ne(m/2+c);var h=Math.floor(1e3*m*s),p=C3(h),x=new mn([new Ln("phase",p)],{width:"400em",height:Ne(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});i=G.makeSvgSpan(["hide-tail"],[x],t),i.style.height=Ne(m),o=r.depth+c+d}else{/cancel/.test(a)?l||r.classes.push("cancel-pad"):a==="angl"?r.classes.push("anglpad"):r.classes.push("boxpad");var y=0,k=0,w=0;/box/.test(a)?(w=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),y=t.fontMetrics().fboxsep+(a==="colorbox"?0:w),k=y):a==="angl"?(w=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),y=4*w,k=Math.max(0,.25-r.depth)):(y=l?.2:0,k=y),i=pn.encloseSpan(r,a,y,k,t),/fbox|boxed|fcolorbox/.test(a)?(i.style.borderStyle="solid",i.style.borderWidth=Ne(w)):a==="angl"&&w!==.049&&(i.style.borderTopWidth=Ne(w),i.style.borderRightWidth=Ne(w)),o=r.depth+k,e.backgroundColor&&(i.style.backgroundColor=e.backgroundColor,e.borderColor&&(i.style.borderColor=e.borderColor))}var j;if(e.backgroundColor)j=G.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:o},{type:"elem",elem:r,shift:0}]},t);else{var N=/cancel|phase/.test(a)?["svg-align"]:[];j=G.makeVList({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:i,shift:o,wrapperClasses:N}]},t)}return/cancel/.test(a)&&(j.height=r.height,j.depth=r.depth),/cancel/.test(a)&&!l?G.makeSpan(["mord","cancel-lap"],[j],t):G.makeSpan(["mord"],[j],t)},o0=(e,t)=>{var r=0,a=new fe.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Tt(e.body,t)]);switch(e.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*r+"pt"),a.setAttribute("height","+"+2*r+"pt"),a.setAttribute("lspace",r+"pt"),a.setAttribute("voffset",r+"pt"),e.label==="\\fcolorbox"){var s=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);a.setAttribute("style","border: "+s+"em solid "+String(e.borderColor))}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&a.setAttribute("mathbackground",e.backgroundColor),a};Ee({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,r){var{parser:a,funcName:s}=e,i=ot(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:a.mode,label:s,backgroundColor:i,body:o}},htmlBuilder:i0,mathmlBuilder:o0});Ee({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(e,t,r){var{parser:a,funcName:s}=e,i=ot(t[0],"color-token").color,o=ot(t[1],"color-token").color,l=t[2];return{type:"enclose",mode:a.mode,label:s,backgroundColor:o,borderColor:i,body:l}},htmlBuilder:i0,mathmlBuilder:o0});Ee({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\fbox",body:t[0]}}});Ee({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:r,funcName:a}=e,s=t[0];return{type:"enclose",mode:r.mode,label:a,body:s}},htmlBuilder:i0,mathmlBuilder:o0});Ee({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\angl",body:t[0]}}});var Bh={};function Xr(e){for(var{type:t,names:r,props:a,handler:s,htmlBuilder:i,mathmlBuilder:o}=e,l={type:t,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},c=0;c<r.length;++c)Bh[r[c]]=l;i&&(ii[t]=i),o&&(oi[t]=o)}var Oh={};function S(e,t){Oh[e]=t}function id(e){var t=[];e.consumeSpaces();var r=e.fetch().text;for(r==="\\relax"&&(e.consume(),e.consumeSpaces(),r=e.fetch().text);r==="\\hline"||r==="\\hdashline";)e.consume(),t.push(r==="\\hdashline"),e.consumeSpaces(),r=e.fetch().text;return t}var Ai=e=>{var t=e.parser.settings;if(!t.displayMode)throw new ge("{"+e.envName+"} can be used only in display mode.")};function l0(e){if(e.indexOf("ed")===-1)return e.indexOf("*")===-1}function Fn(e,t,r){var{hskipBeforeAndAfter:a,addJot:s,cols:i,arraystretch:o,colSeparationType:l,autoTag:c,singleRow:d,emptySingleRow:u,maxNumCols:m,leqno:h}=t;if(e.gullet.beginGroup(),d||e.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=e.gullet.expandMacroAsText("\\arraystretch");if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new ge("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var x=[],y=[x],k=[],w=[],j=c!=null?[]:void 0;function N(){c&&e.gullet.macros.set("\\@eqnsw","1",!0)}function L(){j&&(e.gullet.macros.get("\\df@tag")?(j.push(e.subparse([new wr("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):j.push(!!c&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(N(),w.push(id(e));;){var U=e.parseExpression(!1,d?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),U={type:"ordgroup",mode:e.mode,body:U},r&&(U={type:"styling",mode:e.mode,style:r,body:[U]}),x.push(U);var I=e.fetch().text;if(I==="&"){if(m&&x.length===m){if(d||l)throw new ge("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(I==="\\end"){L(),x.length===1&&U.type==="styling"&&U.body[0].body.length===0&&(y.length>1||!u)&&y.pop(),w.length<y.length+1&&w.push([]);break}else if(I==="\\\\"){e.consume();var H=void 0;e.gullet.future().text!==" "&&(H=e.parseSizeGroup(!0)),k.push(H?H.value:null),L(),w.push(id(e)),x=[],y.push(x),N()}else throw new ge("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:s,arraystretch:o,body:y,cols:i,rowGaps:k,hskipBeforeAndAfter:a,hLinesBeforeRow:w,colSeparationType:l,tags:j,leqno:h}}function c0(e){return e.slice(0,1)==="d"?"display":"text"}var Qr=function(t,r){var a,s,i=t.body.length,o=t.hLinesBeforeRow,l=0,c=new Array(i),d=[],u=Math.max(r.fontMetrics().arrayRuleWidth,r.minRuleThickness),m=1/r.fontMetrics().ptPerEm,h=5*m;if(t.colSeparationType&&t.colSeparationType==="small"){var p=r.havingStyle(Je.SCRIPT).sizeMultiplier;h=.2778*(p/r.sizeMultiplier)}var x=t.colSeparationType==="CD"?Ot({number:3,unit:"ex"},r):12*m,y=3*m,k=t.arraystretch*x,w=.7*k,j=.3*k,N=0;function L(lt){for(var qe=0;qe<lt.length;++qe)qe>0&&(N+=.25),d.push({pos:N,isDashed:lt[qe]})}for(L(o[0]),a=0;a<t.body.length;++a){var U=t.body[a],I=w,H=j;l<U.length&&(l=U.length);var F=new Array(U.length);for(s=0;s<U.length;++s){var W=vt(U[s],r);H<W.depth&&(H=W.depth),I<W.height&&(I=W.height),F[s]=W}var M=t.rowGaps[a],_=0;M&&(_=Ot(M,r),_>0&&(_+=j,H<_&&(H=_),_=0)),t.addJot&&(H+=y),F.height=I,F.depth=H,N+=I,F.pos=N,N+=H+_,c[a]=F,L(o[a+1])}var O=N/2+r.fontMetrics().axisHeight,V=t.cols||[],T=[],Y,ne,he=[];if(t.tags&&t.tags.some(lt=>lt))for(a=0;a<i;++a){var $=c[a],J=$.pos-O,C=t.tags[a],ue=void 0;C===!0?ue=G.makeSpan(["eqn-num"],[],r):C===!1?ue=G.makeSpan([],[],r):ue=G.makeSpan([],Gt(C,r,!0),r),ue.depth=$.depth,ue.height=$.height,he.push({type:"elem",elem:ue,shift:J})}for(s=0,ne=0;s<l||ne<V.length;++s,++ne){for(var xe=V[ne]||{},A=!0;xe.type==="separator";){if(A||(Y=G.makeSpan(["arraycolsep"],[]),Y.style.width=Ne(r.fontMetrics().doubleRuleSep),T.push(Y)),xe.separator==="|"||xe.separator===":"){var te=xe.separator==="|"?"solid":"dashed",Ce=G.makeSpan(["vertical-separator"],[],r);Ce.style.height=Ne(N),Ce.style.borderRightWidth=Ne(u),Ce.style.borderRightStyle=te,Ce.style.margin="0 "+Ne(-u/2);var De=N-O;De&&(Ce.style.verticalAlign=Ne(-De)),T.push(Ce)}else throw new ge("Invalid separator type: "+xe.separator);ne++,xe=V[ne]||{},A=!1}if(!(s>=l)){var pe=void 0;(s>0||t.hskipBeforeAndAfter)&&(pe=kt.deflt(xe.pregap,h),pe!==0&&(Y=G.makeSpan(["arraycolsep"],[]),Y.style.width=Ne(pe),T.push(Y)));var _e=[];for(a=0;a<i;++a){var se=c[a],we=se[s];if(we){var ze=se.pos-O;we.depth=se.depth,we.height=se.height,_e.push({type:"elem",elem:we,shift:ze})}}_e=G.makeVList({positionType:"individualShift",children:_e},r),_e=G.makeSpan(["col-align-"+(xe.align||"c")],[_e]),T.push(_e),(s<l-1||t.hskipBeforeAndAfter)&&(pe=kt.deflt(xe.postgap,h),pe!==0&&(Y=G.makeSpan(["arraycolsep"],[]),Y.style.width=Ne(pe),T.push(Y)))}}if(c=G.makeSpan(["mtable"],T),d.length>0){for(var Ae=G.makeLineSpan("hline",r,u),Be=G.makeLineSpan("hdashline",r,u),nt=[{type:"elem",elem:c,shift:0}];d.length>0;){var bt=d.pop(),ut=bt.pos-O;bt.isDashed?nt.push({type:"elem",elem:Be,shift:ut}):nt.push({type:"elem",elem:Ae,shift:ut})}c=G.makeVList({positionType:"individualShift",children:nt},r)}if(he.length===0)return G.makeSpan(["mord"],[c],r);var jt=G.makeVList({positionType:"individualShift",children:he},r);return jt=G.makeSpan(["tag"],[jt],r),G.makeFragment([c,jt])},P6={c:"center ",l:"left ",r:"right "},Zr=function(t,r){for(var a=[],s=new fe.MathNode("mtd",[],["mtr-glue"]),i=new fe.MathNode("mtd",[],["mml-eqn-num"]),o=0;o<t.body.length;o++){for(var l=t.body[o],c=[],d=0;d<l.length;d++)c.push(new fe.MathNode("mtd",[Tt(l[d],r)]));t.tags&&t.tags[o]&&(c.unshift(s),c.push(s),t.leqno?c.unshift(i):c.push(i)),a.push(new fe.MathNode("mtr",c))}var u=new fe.MathNode("mtable",a),m=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);u.setAttribute("rowspacing",Ne(m));var h="",p="";if(t.cols&&t.cols.length>0){var x=t.cols,y="",k=!1,w=0,j=x.length;x[0].type==="separator"&&(h+="top ",w=1),x[x.length-1].type==="separator"&&(h+="bottom ",j-=1);for(var N=w;N<j;N++)x[N].type==="align"?(p+=P6[x[N].align],k&&(y+="none "),k=!0):x[N].type==="separator"&&k&&(y+=x[N].separator==="|"?"solid ":"dashed ",k=!1);u.setAttribute("columnalign",p.trim()),/[sd]/.test(y)&&u.setAttribute("columnlines",y.trim())}if(t.colSeparationType==="align"){for(var L=t.cols||[],U="",I=1;I<L.length;I++)U+=I%2?"0em ":"1em ";u.setAttribute("columnspacing",U.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?u.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?u.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?u.setAttribute("columnspacing","0.5em"):u.setAttribute("columnspacing","1em");var H="",F=t.hLinesBeforeRow;h+=F[0].length>0?"left ":"",h+=F[F.length-1].length>0?"right ":"";for(var W=1;W<F.length-1;W++)H+=F[W].length===0?"none ":F[W][0]?"dashed ":"solid ";return/[sd]/.test(H)&&u.setAttribute("rowlines",H.trim()),h!==""&&(u=new fe.MathNode("menclose",[u]),u.setAttribute("notation",h.trim())),t.arraystretch&&t.arraystretch<1&&(u=new fe.MathNode("mstyle",[u]),u.setAttribute("scriptlevel","1")),u},$h=function(t,r){t.envName.indexOf("ed")===-1&&Ai(t);var a=[],s=t.envName.indexOf("at")>-1?"alignat":"align",i=t.envName==="split",o=Fn(t.parser,{cols:a,addJot:!0,autoTag:i?void 0:l0(t.envName),emptySingleRow:!0,colSeparationType:s,maxNumCols:i?2:void 0,leqno:t.parser.settings.leqno},"display"),l,c=0,d={type:"ordgroup",mode:t.mode,body:[]};if(r[0]&&r[0].type==="ordgroup"){for(var u="",m=0;m<r[0].body.length;m++){var h=ot(r[0].body[m],"textord");u+=h.text}l=Number(u),c=l*2}var p=!c;o.body.forEach(function(w){for(var j=1;j<w.length;j+=2){var N=ot(w[j],"styling"),L=ot(N.body[0],"ordgroup");L.body.unshift(d)}if(p)c<w.length&&(c=w.length);else{var U=w.length/2;if(l<U)throw new ge("Too many math in a row: "+("expected "+l+", but got "+U),w[0])}});for(var x=0;x<c;++x){var y="r",k=0;x%2===1?y="l":x>0&&p&&(k=1),a[x]={type:"align",align:y,pregap:k,postgap:0}}return o.colSeparationType=p?"align":"alignat",o};Xr({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var r=Si(t[0]),a=r?[t[0]]:ot(t[0],"ordgroup").body,s=a.map(function(o){var l=n0(o),c=l.text;if("lcr".indexOf(c)!==-1)return{type:"align",align:c};if(c==="|")return{type:"separator",separator:"|"};if(c===":")return{type:"separator",separator:":"};throw new ge("Unknown column alignment: "+c,o)}),i={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Fn(e.parser,i,c0(e.envName))},htmlBuilder:Qr,mathmlBuilder:Zr});Xr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],r="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if(e.envName.charAt(e.envName.length-1)==="*"){var s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),r=s.fetch().text,"lcr".indexOf(r)===-1)throw new ge("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),a.cols=[{type:"align",align:r}]}}var i=Fn(e.parser,a,c0(e.envName)),o=Math.max(0,...i.body.map(l=>l.length));return i.cols=new Array(o).fill({type:"align",align:r}),t?{type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:Qr,mathmlBuilder:Zr});Xr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},r=Fn(e.parser,t,"script");return r.colSeparationType="small",r},htmlBuilder:Qr,mathmlBuilder:Zr});Xr({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var r=Si(t[0]),a=r?[t[0]]:ot(t[0],"ordgroup").body,s=a.map(function(o){var l=n0(o),c=l.text;if("lc".indexOf(c)!==-1)return{type:"align",align:c};throw new ge("Unknown column alignment: "+c,o)});if(s.length>1)throw new ge("{subarray} can contain only one column");var i={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5};if(i=Fn(e.parser,i,"script"),i.body.length>0&&i.body[0].length>1)throw new ge("{subarray} can contain only one column");return i},htmlBuilder:Qr,mathmlBuilder:Zr});Xr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},r=Fn(e.parser,t,c0(e.envName));return{type:"leftright",mode:e.mode,body:[r],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Qr,mathmlBuilder:Zr});Xr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:$h,htmlBuilder:Qr,mathmlBuilder:Zr});Xr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){["gather","gather*"].includes(e.envName)&&Ai(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:l0(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Fn(e.parser,t,"display")},htmlBuilder:Qr,mathmlBuilder:Zr});Xr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:$h,htmlBuilder:Qr,mathmlBuilder:Zr});Xr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Ai(e);var t={autoTag:l0(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Fn(e.parser,t,"display")},htmlBuilder:Qr,mathmlBuilder:Zr});Xr({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Ai(e),k6(e.parser)},htmlBuilder:Qr,mathmlBuilder:Zr});S("\\nonumber","\\gdef\\@eqnsw{0}");S("\\notag","\\nonumber");Ee({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new ge(e.funcName+" valid only within array environment")}});var od=Bh;Ee({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:r,funcName:a}=e,s=t[0];if(s.type!=="ordgroup")throw new ge("Invalid environment name",s);for(var i="",o=0;o<s.body.length;++o)i+=ot(s.body[o],"textord").text;if(a==="\\begin"){if(!od.hasOwnProperty(i))throw new ge("No such environment: "+i,s);var l=od[i],{args:c,optArgs:d}=r.parseArguments("\\begin{"+i+"}",l),u={mode:r.mode,envName:i,parser:r},m=l.handler(u,c,d);r.expect("\\end",!1);var h=r.nextToken,p=ot(r.parseFunction(),"environment");if(p.name!==i)throw new ge("Mismatch: \\begin{"+i+"} matched by \\end{"+p.name+"}",h);return m}return{type:"environment",mode:r.mode,name:i,nameGroup:s}}});var _h=(e,t)=>{var r=e.font,a=t.withFont(r);return vt(e.body,a)},qh=(e,t)=>{var r=e.font,a=t.withFont(r);return Tt(e.body,a)},ld={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Ee({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:r,funcName:a}=e,s=li(t[0]),i=a;return i in ld&&(i=ld[i]),{type:"font",mode:r.mode,font:i.slice(1),body:s}},htmlBuilder:_h,mathmlBuilder:qh});Ee({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:r}=e,a=t[0],s=kt.isCharacterBox(a);return{type:"mclass",mode:r.mode,mclass:Ci(a),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:a}],isCharacterBox:s}}});Ee({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:r,funcName:a,breakOnTokenText:s}=e,{mode:i}=r,o=r.parseExpression(!0,s),l="math"+a.slice(1);return{type:"font",mode:i,font:l,body:{type:"ordgroup",mode:r.mode,body:o}}},htmlBuilder:_h,mathmlBuilder:qh});var Hh=(e,t)=>{var r=t;return e==="display"?r=r.id>=Je.SCRIPT.id?r.text():Je.DISPLAY:e==="text"&&r.size===Je.DISPLAY.size?r=Je.TEXT:e==="script"?r=Je.SCRIPT:e==="scriptscript"&&(r=Je.SCRIPTSCRIPT),r},d0=(e,t)=>{var r=Hh(e.size,t.style),a=r.fracNum(),s=r.fracDen(),i;i=t.havingStyle(a);var o=vt(e.numer,i,t);if(e.continued){var l=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<l?l:o.height,o.depth=o.depth<c?c:o.depth}i=t.havingStyle(s);var d=vt(e.denom,i,t),u,m,h;e.hasBarLine?(e.barSize?(m=Ot(e.barSize,t),u=G.makeLineSpan("frac-line",t,m)):u=G.makeLineSpan("frac-line",t),m=u.height,h=u.height):(u=null,m=0,h=t.fontMetrics().defaultRuleThickness);var p,x,y;r.size===Je.DISPLAY.size||e.size==="display"?(p=t.fontMetrics().num1,m>0?x=3*h:x=7*h,y=t.fontMetrics().denom1):(m>0?(p=t.fontMetrics().num2,x=h):(p=t.fontMetrics().num3,x=3*h),y=t.fontMetrics().denom2);var k;if(u){var j=t.fontMetrics().axisHeight;p-o.depth-(j+.5*m)<x&&(p+=x-(p-o.depth-(j+.5*m))),j-.5*m-(d.height-y)<x&&(y+=x-(j-.5*m-(d.height-y)));var N=-(j-.5*m);k=G.makeVList({positionType:"individualShift",children:[{type:"elem",elem:d,shift:y},{type:"elem",elem:u,shift:N},{type:"elem",elem:o,shift:-p}]},t)}else{var w=p-o.depth-(d.height-y);w<x&&(p+=.5*(x-w),y+=.5*(x-w)),k=G.makeVList({positionType:"individualShift",children:[{type:"elem",elem:d,shift:y},{type:"elem",elem:o,shift:-p}]},t)}i=t.havingStyle(r),k.height*=i.sizeMultiplier/t.sizeMultiplier,k.depth*=i.sizeMultiplier/t.sizeMultiplier;var L;r.size===Je.DISPLAY.size?L=t.fontMetrics().delim1:r.size===Je.SCRIPTSCRIPT.size?L=t.havingStyle(Je.SCRIPT).fontMetrics().delim2:L=t.fontMetrics().delim2;var U,I;return e.leftDelim==null?U=rs(t,["mopen"]):U=un.customSizedDelim(e.leftDelim,L,!0,t.havingStyle(r),e.mode,["mopen"]),e.continued?I=G.makeSpan([]):e.rightDelim==null?I=rs(t,["mclose"]):I=un.customSizedDelim(e.rightDelim,L,!0,t.havingStyle(r),e.mode,["mclose"]),G.makeSpan(["mord"].concat(i.sizingClasses(t)),[U,G.makeSpan(["mfrac"],[k]),I],t)},u0=(e,t)=>{var r=new fe.MathNode("mfrac",[Tt(e.numer,t),Tt(e.denom,t)]);if(!e.hasBarLine)r.setAttribute("linethickness","0px");else if(e.barSize){var a=Ot(e.barSize,t);r.setAttribute("linethickness",Ne(a))}var s=Hh(e.size,t.style);if(s.size!==t.style.size){r=new fe.MathNode("mstyle",[r]);var i=s.size===Je.DISPLAY.size?"true":"false";r.setAttribute("displaystyle",i),r.setAttribute("scriptlevel","0")}if(e.leftDelim!=null||e.rightDelim!=null){var o=[];if(e.leftDelim!=null){var l=new fe.MathNode("mo",[new fe.TextNode(e.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}if(o.push(r),e.rightDelim!=null){var c=new fe.MathNode("mo",[new fe.TextNode(e.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),o.push(c)}return t0(o)}return r};Ee({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:r,funcName:a}=e,s=t[0],i=t[1],o,l=null,c=null,d="auto";switch(a){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,l="(",c=")";break;case"\\\\bracefrac":o=!1,l="\\{",c="\\}";break;case"\\\\brackfrac":o=!1,l="[",c="]";break;default:throw new Error("Unrecognized genfrac command")}switch(a){case"\\dfrac":case"\\dbinom":d="display";break;case"\\tfrac":case"\\tbinom":d="text";break}return{type:"genfrac",mode:r.mode,continued:!1,numer:s,denom:i,hasBarLine:o,leftDelim:l,rightDelim:c,size:d,barSize:null}},htmlBuilder:d0,mathmlBuilder:u0});Ee({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:r,funcName:a}=e,s=t[0],i=t[1];return{type:"genfrac",mode:r.mode,continued:!0,numer:s,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});Ee({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:r,token:a}=e,s;switch(r){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:s,token:a}}});var cd=["display","text","script","scriptscript"],dd=function(t){var r=null;return t.length>0&&(r=t,r=r==="."?null:r),r};Ee({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:r}=e,a=t[4],s=t[5],i=li(t[0]),o=i.type==="atom"&&i.family==="open"?dd(i.text):null,l=li(t[1]),c=l.type==="atom"&&l.family==="close"?dd(l.text):null,d=ot(t[2],"size"),u,m=null;d.isBlank?u=!0:(m=d.value,u=m.number>0);var h="auto",p=t[3];if(p.type==="ordgroup"){if(p.body.length>0){var x=ot(p.body[0],"textord");h=cd[Number(x.text)]}}else p=ot(p,"textord"),h=cd[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:a,denom:s,continued:!1,hasBarLine:u,barSize:m,leftDelim:o,rightDelim:c,size:h}},htmlBuilder:d0,mathmlBuilder:u0});Ee({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:r,funcName:a,token:s}=e;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:ot(t[0],"size").value,token:s}}});Ee({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:r,funcName:a}=e,s=t[0],i=u3(ot(t[1],"infix").size),o=t[2],l=i.number>0;return{type:"genfrac",mode:r.mode,numer:s,denom:o,continued:!1,hasBarLine:l,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:d0,mathmlBuilder:u0});var Uh=(e,t)=>{var r=t.style,a,s;e.type==="supsub"?(a=e.sup?vt(e.sup,t.havingStyle(r.sup()),t):vt(e.sub,t.havingStyle(r.sub()),t),s=ot(e.base,"horizBrace")):s=ot(e,"horizBrace");var i=vt(s.base,t.havingBaseStyle(Je.DISPLAY)),o=pn.svgSpan(s,t),l;if(s.isOver?(l=G.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:.1},{type:"elem",elem:o}]},t),l.children[0].children[0].children[1].classes.push("svg-align")):(l=G.makeVList({positionType:"bottom",positionData:i.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:i}]},t),l.children[0].children[0].children[0].classes.push("svg-align")),a){var c=G.makeSpan(["mord",s.isOver?"mover":"munder"],[l],t);s.isOver?l=G.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:c},{type:"kern",size:.2},{type:"elem",elem:a}]},t):l=G.makeVList({positionType:"bottom",positionData:c.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:c}]},t)}return G.makeSpan(["mord",s.isOver?"mover":"munder"],[l],t)},R6=(e,t)=>{var r=pn.mathMLnode(e.label);return new fe.MathNode(e.isOver?"mover":"munder",[Tt(e.base,t),r])};Ee({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:r,funcName:a}=e;return{type:"horizBrace",mode:r.mode,label:a,isOver:/^\\over/.test(a),base:t[0]}},htmlBuilder:Uh,mathmlBuilder:R6});Ee({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,a=t[1],s=ot(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:r.mode,href:s,body:_t(a)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var r=Gt(e.body,t,!1);return G.makeAnchor(e.href,[],r,t)},mathmlBuilder:(e,t)=>{var r=Pn(e.body,t);return r instanceof vr||(r=new vr("mrow",[r])),r.setAttribute("href",e.href),r}});Ee({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,a=ot(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:a}))return r.formatUnsupportedCmd("\\url");for(var s=[],i=0;i<a.length;i++){var o=a[i];o==="~"&&(o="\\textasciitilde"),s.push({type:"textord",mode:"text",text:o})}var l={type:"text",mode:r.mode,font:"\\texttt",body:s};return{type:"href",mode:r.mode,href:a,body:_t(l)}}});Ee({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:r}=e;return{type:"hbox",mode:r.mode,body:_t(t[0])}},htmlBuilder(e,t){var r=Gt(e.body,t,!1);return G.makeFragment(r)},mathmlBuilder(e,t){return new fe.MathNode("mrow",gr(e.body,t))}});Ee({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:r,funcName:a,token:s}=e,i=ot(t[0],"raw").string,o=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,c={};switch(a){case"\\htmlClass":c.class=i,l={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,l={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,l={command:"\\htmlStyle",style:i};break;case"\\htmlData":{for(var d=i.split(","),u=0;u<d.length;u++){var m=d[u].split("=");if(m.length!==2)throw new ge("Error parsing key-value for \\htmlData");c["data-"+m[0].trim()]=m[1].trim()}l={command:"\\htmlData",attributes:c};break}default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(l)?{type:"html",mode:r.mode,attributes:c,body:_t(o)}:r.formatUnsupportedCmd(a)},htmlBuilder:(e,t)=>{var r=Gt(e.body,t,!1),a=["enclosing"];e.attributes.class&&a.push(...e.attributes.class.trim().split(/\s+/));var s=G.makeSpan(a,r,t);for(var i in e.attributes)i!=="class"&&e.attributes.hasOwnProperty(i)&&s.setAttribute(i,e.attributes[i]);return s},mathmlBuilder:(e,t)=>Pn(e.body,t)});Ee({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e;return{type:"htmlmathml",mode:r.mode,html:_t(t[0]),mathml:_t(t[1])}},htmlBuilder:(e,t)=>{var r=Gt(e.html,t,!1);return G.makeFragment(r)},mathmlBuilder:(e,t)=>Pn(e.mathml,t)});var go=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!r)throw new ge("Invalid size: '"+t+"' in \\includegraphics");var a={number:+(r[1]+r[2]),unit:r[3]};if(!ch(a))throw new ge("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};Ee({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,r)=>{var{parser:a}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},o={number:0,unit:"em"},l="";if(r[0])for(var c=ot(r[0],"raw").string,d=c.split(","),u=0;u<d.length;u++){var m=d[u].split("=");if(m.length===2){var h=m[1].trim();switch(m[0].trim()){case"alt":l=h;break;case"width":s=go(h);break;case"height":i=go(h);break;case"totalheight":o=go(h);break;default:throw new ge("Invalid key: '"+m[0]+"' in \\includegraphics.")}}}var p=ot(t[0],"url").url;return l===""&&(l=p,l=l.replace(/^.*[\\/]/,""),l=l.substring(0,l.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:p})?{type:"includegraphics",mode:a.mode,alt:l,width:s,height:i,totalheight:o,src:p}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var r=Ot(e.height,t),a=0;e.totalheight.number>0&&(a=Ot(e.totalheight,t)-r);var s=0;e.width.number>0&&(s=Ot(e.width,t));var i={height:Ne(r+a)};s>0&&(i.width=Ne(s)),a>0&&(i.verticalAlign=Ne(-a));var o=new R3(e.src,e.alt,i);return o.height=r,o.depth=a,o},mathmlBuilder:(e,t)=>{var r=new fe.MathNode("mglyph",[]);r.setAttribute("alt",e.alt);var a=Ot(e.height,t),s=0;if(e.totalheight.number>0&&(s=Ot(e.totalheight,t)-a,r.setAttribute("valign",Ne(-s))),r.setAttribute("height",Ne(a+s)),e.width.number>0){var i=Ot(e.width,t);r.setAttribute("width",Ne(i))}return r.setAttribute("src",e.src),r}});Ee({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:r,funcName:a}=e,s=ot(t[0],"size");if(r.settings.strict){var i=a[1]==="m",o=s.value.unit==="mu";i?(o||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+s.value.unit+" units")),r.mode!=="math"&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):o&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:s.value}},htmlBuilder(e,t){return G.makeGlue(e.dimension,t)},mathmlBuilder(e,t){var r=Ot(e.dimension,t);return new fe.SpaceNode(r)}});Ee({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r,funcName:a}=e,s=t[0];return{type:"lap",mode:r.mode,alignment:a.slice(5),body:s}},htmlBuilder:(e,t)=>{var r;e.alignment==="clap"?(r=G.makeSpan([],[vt(e.body,t)]),r=G.makeSpan(["inner"],[r],t)):r=G.makeSpan(["inner"],[vt(e.body,t)]);var a=G.makeSpan(["fix"],[]),s=G.makeSpan([e.alignment],[r,a],t),i=G.makeSpan(["strut"]);return i.style.height=Ne(s.height+s.depth),s.depth&&(i.style.verticalAlign=Ne(-s.depth)),s.children.unshift(i),s=G.makeSpan(["thinbox"],[s],t),G.makeSpan(["mord","vbox"],[s],t)},mathmlBuilder:(e,t)=>{var r=new fe.MathNode("mpadded",[Tt(e.body,t)]);if(e.alignment!=="rlap"){var a=e.alignment==="llap"?"-1":"-0.5";r.setAttribute("lspace",a+"width")}return r.setAttribute("width","0px"),r}});Ee({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:r,parser:a}=e,s=a.mode;a.switchMode("math");var i=r==="\\("?"\\)":"$",o=a.parseExpression(!1,i);return a.expect(i),a.switchMode(s),{type:"styling",mode:a.mode,style:"text",body:o}}});Ee({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new ge("Mismatched "+e.funcName)}});var ud=(e,t)=>{switch(t.style.size){case Je.DISPLAY.size:return e.display;case Je.TEXT.size:return e.text;case Je.SCRIPT.size:return e.script;case Je.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ee({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:r}=e;return{type:"mathchoice",mode:r.mode,display:_t(t[0]),text:_t(t[1]),script:_t(t[2]),scriptscript:_t(t[3])}},htmlBuilder:(e,t)=>{var r=ud(e,t),a=Gt(r,t,!1);return G.makeFragment(a)},mathmlBuilder:(e,t)=>{var r=ud(e,t);return Pn(r,t)}});var Wh=(e,t,r,a,s,i,o)=>{e=G.makeSpan([],[e]);var l=r&&kt.isCharacterBox(r),c,d;if(t){var u=vt(t,a.havingStyle(s.sup()),a);d={elem:u,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-u.depth)}}if(r){var m=vt(r,a.havingStyle(s.sub()),a);c={elem:m,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-m.height)}}var h;if(d&&c){var p=a.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o;h=G.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Ne(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Ne(i)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else if(c){var x=e.height-o;h=G.makeVList({positionType:"top",positionData:x,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:c.elem,marginLeft:Ne(-i)},{type:"kern",size:c.kern},{type:"elem",elem:e}]},a)}else if(d){var y=e.depth+o;h=G.makeVList({positionType:"bottom",positionData:y,children:[{type:"elem",elem:e},{type:"kern",size:d.kern},{type:"elem",elem:d.elem,marginLeft:Ne(i)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else return e;var k=[h];if(c&&i!==0&&!l){var w=G.makeSpan(["mspace"],[],a);w.style.marginRight=Ne(i),k.unshift(w)}return G.makeSpan(["mop","op-limits"],k,a)},Vh=["\\smallint"],Ea=(e,t)=>{var r,a,s=!1,i;e.type==="supsub"?(r=e.sup,a=e.sub,i=ot(e.base,"op"),s=!0):i=ot(e,"op");var o=t.style,l=!1;o.size===Je.DISPLAY.size&&i.symbol&&!Vh.includes(i.name)&&(l=!0);var c;if(i.symbol){var d=l?"Size2-Regular":"Size1-Regular",u="";if((i.name==="\\oiint"||i.name==="\\oiiint")&&(u=i.name.slice(1),i.name=u==="oiint"?"\\iint":"\\iiint"),c=G.makeSymbol(i.name,d,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){var m=c.italic,h=G.staticSvg(u+"Size"+(l?"2":"1"),t);c=G.makeVList({positionType:"individualShift",children:[{type:"elem",elem:c,shift:0},{type:"elem",elem:h,shift:l?.08:0}]},t),i.name="\\"+u,c.classes.unshift("mop"),c.italic=m}}else if(i.body){var p=Gt(i.body,t,!0);p.length===1&&p[0]instanceof Ir?(c=p[0],c.classes[0]="mop"):c=G.makeSpan(["mop"],p,t)}else{for(var x=[],y=1;y<i.name.length;y++)x.push(G.mathsym(i.name[y],i.mode,t));c=G.makeSpan(["mop"],x,t)}var k=0,w=0;return(c instanceof Ir||i.name==="\\oiint"||i.name==="\\oiiint")&&!i.suppressBaseShift&&(k=(c.height-c.depth)/2-t.fontMetrics().axisHeight,w=c.italic),s?Wh(c,r,a,t,o,w,k):(k&&(c.style.position="relative",c.style.top=Ne(k)),c)},gs=(e,t)=>{var r;if(e.symbol)r=new vr("mo",[Dr(e.name,e.mode)]),Vh.includes(e.name)&&r.setAttribute("largeop","false");else if(e.body)r=new vr("mo",gr(e.body,t));else{r=new vr("mi",[new Gr(e.name.slice(1))]);var a=new vr("mo",[Dr("","text")]);e.parentIsSupSub?r=new vr("mrow",[r,a]):r=vh([r,a])}return r},F6={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ee({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:r,funcName:a}=e,s=a;return s.length===1&&(s=F6[s]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:Ea,mathmlBuilder:gs});Ee({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:r}=e,a=t[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:_t(a)}},htmlBuilder:Ea,mathmlBuilder:gs});var B6={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ee({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:Ea,mathmlBuilder:gs});Ee({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:Ea,mathmlBuilder:gs});Ee({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:r}=e,a=r;return a.length===1&&(a=B6[a]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:Ea,mathmlBuilder:gs});var Gh=(e,t)=>{var r,a,s=!1,i;e.type==="supsub"?(r=e.sup,a=e.sub,i=ot(e.base,"operatorname"),s=!0):i=ot(e,"operatorname");var o;if(i.body.length>0){for(var l=i.body.map(m=>{var h=m.text;return typeof h=="string"?{type:"textord",mode:m.mode,text:h}:m}),c=Gt(l,t.withFont("mathrm"),!0),d=0;d<c.length;d++){var u=c[d];u instanceof Ir&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=G.makeSpan(["mop"],c,t)}else o=G.makeSpan(["mop"],[],t);return s?Wh(o,r,a,t,t.style,0,0):o},O6=(e,t)=>{for(var r=gr(e.body,t.withFont("mathrm")),a=!0,s=0;s<r.length;s++){var i=r[s];if(!(i instanceof fe.SpaceNode))if(i instanceof fe.MathNode)switch(i.type){case"mi":case"mn":case"ms":case"mspace":case"mtext":break;case"mo":{var o=i.children[0];i.children.length===1&&o instanceof fe.TextNode?o.text=o.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):a=!1;break}default:a=!1}else a=!1}if(a){var l=r.map(u=>u.toText()).join("");r=[new fe.TextNode(l)]}var c=new fe.MathNode("mi",r);c.setAttribute("mathvariant","normal");var d=new fe.MathNode("mo",[Dr("","text")]);return e.parentIsSupSub?new fe.MathNode("mrow",[c,d]):fe.newDocumentFragment([c,d])};Ee({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:r,funcName:a}=e,s=t[0];return{type:"operatorname",mode:r.mode,body:_t(s),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Gh,mathmlBuilder:O6});S("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");ra({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?G.makeFragment(Gt(e.body,t,!1)):G.makeSpan(["mord"],Gt(e.body,t,!0),t)},mathmlBuilder(e,t){return Pn(e.body,t,!0)}});Ee({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:r}=e,a=t[0];return{type:"overline",mode:r.mode,body:a}},htmlBuilder(e,t){var r=vt(e.body,t.havingCrampedStyle()),a=G.makeLineSpan("overline-line",t),s=t.fontMetrics().defaultRuleThickness,i=G.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*s},{type:"elem",elem:a},{type:"kern",size:s}]},t);return G.makeSpan(["mord","overline"],[i],t)},mathmlBuilder(e,t){var r=new fe.MathNode("mo",[new fe.TextNode("‾")]);r.setAttribute("stretchy","true");var a=new fe.MathNode("mover",[Tt(e.body,t),r]);return a.setAttribute("accent","true"),a}});Ee({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,a=t[0];return{type:"phantom",mode:r.mode,body:_t(a)}},htmlBuilder:(e,t)=>{var r=Gt(e.body,t.withPhantom(),!1);return G.makeFragment(r)},mathmlBuilder:(e,t)=>{var r=gr(e.body,t);return new fe.MathNode("mphantom",r)}});Ee({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,a=t[0];return{type:"hphantom",mode:r.mode,body:a}},htmlBuilder:(e,t)=>{var r=G.makeSpan([],[vt(e.body,t.withPhantom())]);if(r.height=0,r.depth=0,r.children)for(var a=0;a<r.children.length;a++)r.children[a].height=0,r.children[a].depth=0;return r=G.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},t),G.makeSpan(["mord"],[r],t)},mathmlBuilder:(e,t)=>{var r=gr(_t(e.body),t),a=new fe.MathNode("mphantom",r),s=new fe.MathNode("mpadded",[a]);return s.setAttribute("height","0px"),s.setAttribute("depth","0px"),s}});Ee({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:r}=e,a=t[0];return{type:"vphantom",mode:r.mode,body:a}},htmlBuilder:(e,t)=>{var r=G.makeSpan(["inner"],[vt(e.body,t.withPhantom())]),a=G.makeSpan(["fix"],[]);return G.makeSpan(["mord","rlap"],[r,a],t)},mathmlBuilder:(e,t)=>{var r=gr(_t(e.body),t),a=new fe.MathNode("mphantom",r),s=new fe.MathNode("mpadded",[a]);return s.setAttribute("width","0px"),s}});Ee({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:r}=e,a=ot(t[0],"size").value,s=t[1];return{type:"raisebox",mode:r.mode,dy:a,body:s}},htmlBuilder(e,t){var r=vt(e.body,t),a=Ot(e.dy,t);return G.makeVList({positionType:"shift",positionData:-a,children:[{type:"elem",elem:r}]},t)},mathmlBuilder(e,t){var r=new fe.MathNode("mpadded",[Tt(e.body,t)]),a=e.dy.number+e.dy.unit;return r.setAttribute("voffset",a),r}});Ee({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Ee({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,r){var{parser:a}=e,s=r[0],i=ot(t[0],"size"),o=ot(t[1],"size");return{type:"rule",mode:a.mode,shift:s&&ot(s,"size").value,width:i.value,height:o.value}},htmlBuilder(e,t){var r=G.makeSpan(["mord","rule"],[],t),a=Ot(e.width,t),s=Ot(e.height,t),i=e.shift?Ot(e.shift,t):0;return r.style.borderRightWidth=Ne(a),r.style.borderTopWidth=Ne(s),r.style.bottom=Ne(i),r.width=a,r.height=s+i,r.depth=-i,r.maxFontSize=s*1.125*t.sizeMultiplier,r},mathmlBuilder(e,t){var r=Ot(e.width,t),a=Ot(e.height,t),s=e.shift?Ot(e.shift,t):0,i=t.color&&t.getColor()||"black",o=new fe.MathNode("mspace");o.setAttribute("mathbackground",i),o.setAttribute("width",Ne(r)),o.setAttribute("height",Ne(a));var l=new fe.MathNode("mpadded",[o]);return s>=0?l.setAttribute("height",Ne(s)):(l.setAttribute("height",Ne(s)),l.setAttribute("depth",Ne(-s))),l.setAttribute("voffset",Ne(s)),l}});function Kh(e,t,r){for(var a=Gt(e,t,!1),s=t.sizeMultiplier/r.sizeMultiplier,i=0;i<a.length;i++){var o=a[i].classes.indexOf("sizing");o<0?Array.prototype.push.apply(a[i].classes,t.sizingClasses(r)):a[i].classes[o+1]==="reset-size"+t.size&&(a[i].classes[o+1]="reset-size"+r.size),a[i].height*=s,a[i].depth*=s}return G.makeFragment(a)}var md=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],$6=(e,t)=>{var r=t.havingSize(e.size);return Kh(e.body,r,t)};Ee({type:"sizing",names:md,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:r,funcName:a,parser:s}=e,i=s.parseExpression(!1,r);return{type:"sizing",mode:s.mode,size:md.indexOf(a)+1,body:i}},htmlBuilder:$6,mathmlBuilder:(e,t)=>{var r=t.havingSize(e.size),a=gr(e.body,r),s=new fe.MathNode("mstyle",a);return s.setAttribute("mathsize",Ne(r.sizeMultiplier)),s}});Ee({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,r)=>{var{parser:a}=e,s=!1,i=!1,o=r[0]&&ot(r[0],"ordgroup");if(o)for(var l="",c=0;c<o.body.length;++c){var d=o.body[c];if(l=d.text,l==="t")s=!0;else if(l==="b")i=!0;else{s=!1,i=!1;break}}else s=!0,i=!0;var u=t[0];return{type:"smash",mode:a.mode,body:u,smashHeight:s,smashDepth:i}},htmlBuilder:(e,t)=>{var r=G.makeSpan([],[vt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return r;if(e.smashHeight&&(r.height=0,r.children))for(var a=0;a<r.children.length;a++)r.children[a].height=0;if(e.smashDepth&&(r.depth=0,r.children))for(var s=0;s<r.children.length;s++)r.children[s].depth=0;var i=G.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r}]},t);return G.makeSpan(["mord"],[i],t)},mathmlBuilder:(e,t)=>{var r=new fe.MathNode("mpadded",[Tt(e.body,t)]);return e.smashHeight&&r.setAttribute("height","0px"),e.smashDepth&&r.setAttribute("depth","0px"),r}});Ee({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){var{parser:a}=e,s=r[0],i=t[0];return{type:"sqrt",mode:a.mode,body:i,index:s}},htmlBuilder(e,t){var r=vt(e.body,t.havingCrampedStyle());r.height===0&&(r.height=t.fontMetrics().xHeight),r=G.wrapFragment(r,t);var a=t.fontMetrics(),s=a.defaultRuleThickness,i=s;t.style.id<Je.TEXT.id&&(i=t.fontMetrics().xHeight);var o=s+i/4,l=r.height+r.depth+o+s,{span:c,ruleWidth:d,advanceWidth:u}=un.sqrtImage(l,t),m=c.height-d;m>r.height+r.depth+o&&(o=(o+m-r.height-r.depth)/2);var h=c.height-r.height-o-d;r.style.paddingLeft=Ne(u);var p=G.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+h)},{type:"elem",elem:c},{type:"kern",size:d}]},t);if(e.index){var x=t.havingStyle(Je.SCRIPTSCRIPT),y=vt(e.index,x,t),k=.6*(p.height-p.depth),w=G.makeVList({positionType:"shift",positionData:-k,children:[{type:"elem",elem:y}]},t),j=G.makeSpan(["root"],[w]);return G.makeSpan(["mord","sqrt"],[j,p],t)}else return G.makeSpan(["mord","sqrt"],[p],t)},mathmlBuilder(e,t){var{body:r,index:a}=e;return a?new fe.MathNode("mroot",[Tt(r,t),Tt(a,t)]):new fe.MathNode("msqrt",[Tt(r,t)])}});var hd={display:Je.DISPLAY,text:Je.TEXT,script:Je.SCRIPT,scriptscript:Je.SCRIPTSCRIPT};Ee({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:r,funcName:a,parser:s}=e,i=s.parseExpression(!0,r),o=a.slice(1,a.length-5);return{type:"styling",mode:s.mode,style:o,body:i}},htmlBuilder(e,t){var r=hd[e.style],a=t.havingStyle(r).withFont("");return Kh(e.body,a,t)},mathmlBuilder(e,t){var r=hd[e.style],a=t.havingStyle(r),s=gr(e.body,a),i=new fe.MathNode("mstyle",s),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=o[e.style];return i.setAttribute("scriptlevel",l[0]),i.setAttribute("displaystyle",l[1]),i}});var _6=function(t,r){var a=t.base;if(a)if(a.type==="op"){var s=a.limits&&(r.style.size===Je.DISPLAY.size||a.alwaysHandleSupSub);return s?Ea:null}else if(a.type==="operatorname"){var i=a.alwaysHandleSupSub&&(r.style.size===Je.DISPLAY.size||a.limits);return i?Gh:null}else{if(a.type==="accent")return kt.isCharacterBox(a.base)?a0:null;if(a.type==="horizBrace"){var o=!t.sub;return o===a.isOver?Uh:null}else return null}else return null};ra({type:"supsub",htmlBuilder(e,t){var r=_6(e,t);if(r)return r(e,t);var{base:a,sup:s,sub:i}=e,o=vt(a,t),l,c,d=t.fontMetrics(),u=0,m=0,h=a&&kt.isCharacterBox(a);if(s){var p=t.havingStyle(t.style.sup());l=vt(s,p,t),h||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(i){var x=t.havingStyle(t.style.sub());c=vt(i,x,t),h||(m=o.depth+x.fontMetrics().subDrop*x.sizeMultiplier/t.sizeMultiplier)}var y;t.style===Je.DISPLAY?y=d.sup1:t.style.cramped?y=d.sup3:y=d.sup2;var k=t.sizeMultiplier,w=Ne(.5/d.ptPerEm/k),j=null;if(c){var N=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");(o instanceof Ir||N)&&(j=Ne(-o.italic))}var L;if(l&&c){u=Math.max(u,y,l.depth+.25*d.xHeight),m=Math.max(m,d.sub2);var U=d.defaultRuleThickness,I=4*U;if(u-l.depth-(c.height-m)<I){m=I-(u-l.depth)+c.height;var H=.8*d.xHeight-(u-l.depth);H>0&&(u+=H,m-=H)}var F=[{type:"elem",elem:c,shift:m,marginRight:w,marginLeft:j},{type:"elem",elem:l,shift:-u,marginRight:w}];L=G.makeVList({positionType:"individualShift",children:F},t)}else if(c){m=Math.max(m,d.sub1,c.height-.8*d.xHeight);var W=[{type:"elem",elem:c,marginLeft:j,marginRight:w}];L=G.makeVList({positionType:"shift",positionData:m,children:W},t)}else if(l)u=Math.max(u,y,l.depth+.25*d.xHeight),L=G.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:l,marginRight:w}]},t);else throw new Error("supsub must have either sup or sub.");var M=tl(o,"right")||"mord";return G.makeSpan([M],[o,G.makeSpan(["msupsub"],[L])],t)},mathmlBuilder(e,t){var r=!1,a,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===e.base.isOver&&(r=!0,a=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var i=[Tt(e.base,t)];e.sub&&i.push(Tt(e.sub,t)),e.sup&&i.push(Tt(e.sup,t));var o;if(r)o=a?"mover":"munder";else if(e.sub)if(e.sup){var d=e.base;d&&d.type==="op"&&d.limits&&t.style===Je.DISPLAY||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(t.style===Je.DISPLAY||d.limits)?o="munderover":o="msubsup"}else{var c=e.base;c&&c.type==="op"&&c.limits&&(t.style===Je.DISPLAY||c.alwaysHandleSupSub)||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(c.limits||t.style===Je.DISPLAY)?o="munder":o="msub"}else{var l=e.base;l&&l.type==="op"&&l.limits&&(t.style===Je.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||t.style===Je.DISPLAY)?o="mover":o="msup"}return new fe.MathNode(o,i)}});ra({type:"atom",htmlBuilder(e,t){return G.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var r=new fe.MathNode("mo",[Dr(e.text,e.mode)]);if(e.family==="bin"){var a=r0(e,t);a==="bold-italic"&&r.setAttribute("mathvariant",a)}else e.family==="punct"?r.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&r.setAttribute("stretchy","false");return r}});var Jh={mi:"italic",mn:"normal",mtext:"normal"};ra({type:"mathord",htmlBuilder(e,t){return G.makeOrd(e,t,"mathord")},mathmlBuilder(e,t){var r=new fe.MathNode("mi",[Dr(e.text,e.mode,t)]),a=r0(e,t)||"italic";return a!==Jh[r.type]&&r.setAttribute("mathvariant",a),r}});ra({type:"textord",htmlBuilder(e,t){return G.makeOrd(e,t,"textord")},mathmlBuilder(e,t){var r=Dr(e.text,e.mode,t),a=r0(e,t)||"normal",s;return e.mode==="text"?s=new fe.MathNode("mtext",[r]):/[0-9]/.test(e.text)?s=new fe.MathNode("mn",[r]):e.text==="\\prime"?s=new fe.MathNode("mo",[r]):s=new fe.MathNode("mi",[r]),a!==Jh[s.type]&&s.setAttribute("mathvariant",a),s}});var xo={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},bo={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ra({type:"spacing",htmlBuilder(e,t){if(bo.hasOwnProperty(e.text)){var r=bo[e.text].className||"";if(e.mode==="text"){var a=G.makeOrd(e,t,"textord");return a.classes.push(r),a}else return G.makeSpan(["mspace",r],[G.mathsym(e.text,e.mode,t)],t)}else{if(xo.hasOwnProperty(e.text))return G.makeSpan(["mspace",xo[e.text]],[],t);throw new ge('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var r;if(bo.hasOwnProperty(e.text))r=new fe.MathNode("mtext",[new fe.TextNode(" ")]);else{if(xo.hasOwnProperty(e.text))return new fe.MathNode("mspace");throw new ge('Unknown type of space "'+e.text+'"')}return r}});var pd=()=>{var e=new fe.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};ra({type:"tag",mathmlBuilder(e,t){var r=new fe.MathNode("mtable",[new fe.MathNode("mtr",[pd(),new fe.MathNode("mtd",[Pn(e.body,t)]),pd(),new fe.MathNode("mtd",[Pn(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});var fd={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},gd={"\\textbf":"textbf","\\textmd":"textmd"},q6={"\\textit":"textit","\\textup":"textup"},xd=(e,t)=>{var r=e.font;if(r){if(fd[r])return t.withTextFontFamily(fd[r]);if(gd[r])return t.withTextFontWeight(gd[r]);if(r==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(q6[r])};Ee({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:r,funcName:a}=e,s=t[0];return{type:"text",mode:r.mode,body:_t(s),font:a}},htmlBuilder(e,t){var r=xd(e,t),a=Gt(e.body,r,!0);return G.makeSpan(["mord","text"],a,r)},mathmlBuilder(e,t){var r=xd(e,t);return Pn(e.body,r)}});Ee({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:r}=e;return{type:"underline",mode:r.mode,body:t[0]}},htmlBuilder(e,t){var r=vt(e.body,t),a=G.makeLineSpan("underline-line",t),s=t.fontMetrics().defaultRuleThickness,i=G.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:s},{type:"elem",elem:a},{type:"kern",size:3*s},{type:"elem",elem:r}]},t);return G.makeSpan(["mord","underline"],[i],t)},mathmlBuilder(e,t){var r=new fe.MathNode("mo",[new fe.TextNode("‾")]);r.setAttribute("stretchy","true");var a=new fe.MathNode("munder",[Tt(e.body,t),r]);return a.setAttribute("accentunder","true"),a}});Ee({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:r}=e;return{type:"vcenter",mode:r.mode,body:t[0]}},htmlBuilder(e,t){var r=vt(e.body,t),a=t.fontMetrics().axisHeight,s=.5*(r.height-a-(r.depth+a));return G.makeVList({positionType:"shift",positionData:s,children:[{type:"elem",elem:r}]},t)},mathmlBuilder(e,t){return new fe.MathNode("mpadded",[Tt(e.body,t)],["vcenter"])}});Ee({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,r){throw new ge("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var r=bd(e),a=[],s=t.havingStyle(t.style.text()),i=0;i<r.length;i++){var o=r[i];o==="~"&&(o="\\textasciitilde"),a.push(G.makeSymbol(o,"Typewriter-Regular",e.mode,s,["mord","texttt"]))}return G.makeSpan(["mord","text"].concat(s.sizingClasses(t)),G.tryCombineChars(a),s)},mathmlBuilder(e,t){var r=new fe.TextNode(bd(e)),a=new fe.MathNode("mtext",[r]);return a.setAttribute("mathvariant","monospace"),a}});var bd=e=>e.body.replace(/ /g,e.star?"␣":" "),In=bh,Yh=`[ \r
|
|
674
|
-
]`,H6="\\\\[a-zA-Z@]+",U6="\\\\[^\uD800-\uDFFF]",W6="("+H6+")"+Yh+"*",V6=`\\\\(
|
|
675
|
-
|[ \r ]+
|
|
676
|
-
?)[ \r ]*`,sl="[̀-ͯ]",G6=new RegExp(sl+"+$"),K6="("+Yh+"+)|"+(V6+"|")+"([!-\\[\\]-‧-豈-]"+(sl+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(sl+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+W6)+("|"+U6+")");class yd{constructor(t,r){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=r,this.tokenRegex=new RegExp(K6,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,r){this.catcodes[t]=r}lex(){var t=this.input,r=this.tokenRegex.lastIndex;if(r===t.length)return new wr("EOF",new pr(this,r,r));var a=this.tokenRegex.exec(t);if(a===null||a.index!==r)throw new ge("Unexpected character: '"+t[r]+"'",new wr(t[r],new pr(this,r,r+1)));var s=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[s]===14){var i=t.indexOf(`
|
|
677
|
-
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new wr(s,new pr(this,r,this.tokenRegex.lastIndex))}}class J6{constructor(t,r){t===void 0&&(t={}),r===void 0&&(r={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=r,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new ge("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var r in t)t.hasOwnProperty(r)&&(t[r]==null?delete this.current[r]:this.current[r]=t[r])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,r,a){if(a===void 0&&(a=!1),a){for(var s=0;s<this.undefStack.length;s++)delete this.undefStack[s][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=r)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(t)&&(i[t]=this.current[t])}r==null?delete this.current[t]:this.current[t]=r}}var Y6=Oh;S("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});S("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});S("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});S("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});S("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var r=e.future();return t[0].length===1&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});S("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");S("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var vd={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};S("\\char",function(e){var t=e.popToken(),r,a="";if(t.text==="'")r=8,t=e.popToken();else if(t.text==='"')r=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")a=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new ge("\\char` missing argument");a=t.text.charCodeAt(0)}else r=10;if(r){if(a=vd[t.text],a==null||a>=r)throw new ge("Invalid base-"+r+" digit "+t.text);for(var s;(s=vd[e.future().text])!=null&&s<r;)a*=r,a+=s,e.popToken()}return"\\@char{"+a+"}"});var m0=(e,t,r,a)=>{var s=e.consumeArg().tokens;if(s.length!==1)throw new ge("\\newcommand's first argument must be a macro name");var i=s[0].text,o=e.isDefined(i);if(o&&!t)throw new ge("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!o&&!r)throw new ge("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var l=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var c="",d=e.expandNextToken();d.text!=="]"&&d.text!=="EOF";)c+=d.text,d=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new ge("Invalid number of arguments: "+c);l=parseInt(c),s=e.consumeArg().tokens}return o&&a||e.macros.set(i,{tokens:s,numArgs:l}),""};S("\\newcommand",e=>m0(e,!1,!0,!1));S("\\renewcommand",e=>m0(e,!0,!1,!1));S("\\providecommand",e=>m0(e,!0,!0,!0));S("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(r=>r.text).join("")),""});S("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(r=>r.text).join("")),""});S("\\show",e=>{var t=e.popToken(),r=t.text;return console.log(t,e.macros.get(r),In[r],Dt.math[r],Dt.text[r]),""});S("\\bgroup","{");S("\\egroup","}");S("~","\\nobreakspace");S("\\lq","`");S("\\rq","'");S("\\aa","\\r a");S("\\AA","\\r A");S("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");S("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");S("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");S("ℬ","\\mathscr{B}");S("ℰ","\\mathscr{E}");S("ℱ","\\mathscr{F}");S("ℋ","\\mathscr{H}");S("ℐ","\\mathscr{I}");S("ℒ","\\mathscr{L}");S("ℳ","\\mathscr{M}");S("ℛ","\\mathscr{R}");S("ℭ","\\mathfrak{C}");S("ℌ","\\mathfrak{H}");S("ℨ","\\mathfrak{Z}");S("\\Bbbk","\\Bbb{k}");S("·","\\cdotp");S("\\llap","\\mathllap{\\textrm{#1}}");S("\\rlap","\\mathrlap{\\textrm{#1}}");S("\\clap","\\mathclap{\\textrm{#1}}");S("\\mathstrut","\\vphantom{(}");S("\\underbar","\\underline{\\text{#1}}");S("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');S("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");S("\\ne","\\neq");S("≠","\\neq");S("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");S("∉","\\notin");S("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");S("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");S("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");S("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");S("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");S("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");S("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");S("⟂","\\perp");S("‼","\\mathclose{!\\mkern-0.8mu!}");S("∌","\\notni");S("⌜","\\ulcorner");S("⌝","\\urcorner");S("⌞","\\llcorner");S("⌟","\\lrcorner");S("©","\\copyright");S("®","\\textregistered");S("️","\\textregistered");S("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');S("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');S("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');S("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');S("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");S("⋮","\\vdots");S("\\varGamma","\\mathit{\\Gamma}");S("\\varDelta","\\mathit{\\Delta}");S("\\varTheta","\\mathit{\\Theta}");S("\\varLambda","\\mathit{\\Lambda}");S("\\varXi","\\mathit{\\Xi}");S("\\varPi","\\mathit{\\Pi}");S("\\varSigma","\\mathit{\\Sigma}");S("\\varUpsilon","\\mathit{\\Upsilon}");S("\\varPhi","\\mathit{\\Phi}");S("\\varPsi","\\mathit{\\Psi}");S("\\varOmega","\\mathit{\\Omega}");S("\\substack","\\begin{subarray}{c}#1\\end{subarray}");S("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");S("\\boxed","\\fbox{$\\displaystyle{#1}$}");S("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");S("\\implies","\\DOTSB\\;\\Longrightarrow\\;");S("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");S("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");S("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var kd={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};S("\\dots",function(e){var t="\\dotso",r=e.expandAfterFuture().text;return r in kd?t=kd[r]:(r.slice(0,4)==="\\not"||r in Dt.math&&["bin","rel"].includes(Dt.math[r].group))&&(t="\\dotsb"),t});var h0={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};S("\\dotso",function(e){var t=e.future().text;return t in h0?"\\ldots\\,":"\\ldots"});S("\\dotsc",function(e){var t=e.future().text;return t in h0&&t!==","?"\\ldots\\,":"\\ldots"});S("\\cdots",function(e){var t=e.future().text;return t in h0?"\\@cdots\\,":"\\@cdots"});S("\\dotsb","\\cdots");S("\\dotsm","\\cdots");S("\\dotsi","\\!\\cdots");S("\\dotsx","\\ldots\\,");S("\\DOTSI","\\relax");S("\\DOTSB","\\relax");S("\\DOTSX","\\relax");S("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");S("\\,","\\tmspace+{3mu}{.1667em}");S("\\thinspace","\\,");S("\\>","\\mskip{4mu}");S("\\:","\\tmspace+{4mu}{.2222em}");S("\\medspace","\\:");S("\\;","\\tmspace+{5mu}{.2777em}");S("\\thickspace","\\;");S("\\!","\\tmspace-{3mu}{.1667em}");S("\\negthinspace","\\!");S("\\negmedspace","\\tmspace-{4mu}{.2222em}");S("\\negthickspace","\\tmspace-{5mu}{.277em}");S("\\enspace","\\kern.5em ");S("\\enskip","\\hskip.5em\\relax");S("\\quad","\\hskip1em\\relax");S("\\qquad","\\hskip2em\\relax");S("\\tag","\\@ifstar\\tag@literal\\tag@paren");S("\\tag@paren","\\tag@literal{({#1})}");S("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new ge("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});S("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");S("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");S("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");S("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");S("\\newline","\\\\\\relax");S("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Xh=Ne(Vr["Main-Regular"][84][1]-.7*Vr["Main-Regular"][65][1]);S("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Xh+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");S("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Xh+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");S("\\hspace","\\@ifstar\\@hspacer\\@hspace");S("\\@hspace","\\hskip #1\\relax");S("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");S("\\ordinarycolon",":");S("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");S("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');S("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');S("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');S("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');S("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');S("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');S("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');S("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');S("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');S("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');S("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');S("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');S("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');S("∷","\\dblcolon");S("∹","\\eqcolon");S("≔","\\coloneqq");S("≕","\\eqqcolon");S("⩴","\\Coloneqq");S("\\ratio","\\vcentcolon");S("\\coloncolon","\\dblcolon");S("\\colonequals","\\coloneqq");S("\\coloncolonequals","\\Coloneqq");S("\\equalscolon","\\eqqcolon");S("\\equalscoloncolon","\\Eqqcolon");S("\\colonminus","\\coloneq");S("\\coloncolonminus","\\Coloneq");S("\\minuscolon","\\eqcolon");S("\\minuscoloncolon","\\Eqcolon");S("\\coloncolonapprox","\\Colonapprox");S("\\coloncolonsim","\\Colonsim");S("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");S("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");S("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");S("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");S("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");S("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");S("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");S("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");S("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");S("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");S("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");S("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");S("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");S("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");S("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");S("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");S("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");S("\\nleqq","\\html@mathml{\\@nleqq}{≰}");S("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");S("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");S("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");S("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");S("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");S("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");S("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");S("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");S("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");S("\\imath","\\html@mathml{\\@imath}{ı}");S("\\jmath","\\html@mathml{\\@jmath}{ȷ}");S("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");S("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");S("⟦","\\llbracket");S("⟧","\\rrbracket");S("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");S("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");S("⦃","\\lBrace");S("⦄","\\rBrace");S("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");S("⦵","\\minuso");S("\\darr","\\downarrow");S("\\dArr","\\Downarrow");S("\\Darr","\\Downarrow");S("\\lang","\\langle");S("\\rang","\\rangle");S("\\uarr","\\uparrow");S("\\uArr","\\Uparrow");S("\\Uarr","\\Uparrow");S("\\N","\\mathbb{N}");S("\\R","\\mathbb{R}");S("\\Z","\\mathbb{Z}");S("\\alef","\\aleph");S("\\alefsym","\\aleph");S("\\Alpha","\\mathrm{A}");S("\\Beta","\\mathrm{B}");S("\\bull","\\bullet");S("\\Chi","\\mathrm{X}");S("\\clubs","\\clubsuit");S("\\cnums","\\mathbb{C}");S("\\Complex","\\mathbb{C}");S("\\Dagger","\\ddagger");S("\\diamonds","\\diamondsuit");S("\\empty","\\emptyset");S("\\Epsilon","\\mathrm{E}");S("\\Eta","\\mathrm{H}");S("\\exist","\\exists");S("\\harr","\\leftrightarrow");S("\\hArr","\\Leftrightarrow");S("\\Harr","\\Leftrightarrow");S("\\hearts","\\heartsuit");S("\\image","\\Im");S("\\infin","\\infty");S("\\Iota","\\mathrm{I}");S("\\isin","\\in");S("\\Kappa","\\mathrm{K}");S("\\larr","\\leftarrow");S("\\lArr","\\Leftarrow");S("\\Larr","\\Leftarrow");S("\\lrarr","\\leftrightarrow");S("\\lrArr","\\Leftrightarrow");S("\\Lrarr","\\Leftrightarrow");S("\\Mu","\\mathrm{M}");S("\\natnums","\\mathbb{N}");S("\\Nu","\\mathrm{N}");S("\\Omicron","\\mathrm{O}");S("\\plusmn","\\pm");S("\\rarr","\\rightarrow");S("\\rArr","\\Rightarrow");S("\\Rarr","\\Rightarrow");S("\\real","\\Re");S("\\reals","\\mathbb{R}");S("\\Reals","\\mathbb{R}");S("\\Rho","\\mathrm{P}");S("\\sdot","\\cdot");S("\\sect","\\S");S("\\spades","\\spadesuit");S("\\sub","\\subset");S("\\sube","\\subseteq");S("\\supe","\\supseteq");S("\\Tau","\\mathrm{T}");S("\\thetasym","\\vartheta");S("\\weierp","\\wp");S("\\Zeta","\\mathrm{Z}");S("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");S("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");S("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");S("\\bra","\\mathinner{\\langle{#1}|}");S("\\ket","\\mathinner{|{#1}\\rangle}");S("\\braket","\\mathinner{\\langle{#1}\\rangle}");S("\\Bra","\\left\\langle#1\\right|");S("\\Ket","\\left|#1\\right\\rangle");var Qh=e=>t=>{var r=t.consumeArg().tokens,a=t.consumeArg().tokens,s=t.consumeArg().tokens,i=t.consumeArg().tokens,o=t.macros.get("|"),l=t.macros.get("\\|");t.macros.beginGroup();var c=m=>h=>{e&&(h.macros.set("|",o),s.length&&h.macros.set("\\|",l));var p=m;if(!m&&s.length){var x=h.future();x.text==="|"&&(h.popToken(),p=!0)}return{tokens:p?s:a,numArgs:0}};t.macros.set("|",c(!1)),s.length&&t.macros.set("\\|",c(!0));var d=t.consumeArg().tokens,u=t.expandTokens([...i,...d,...r]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};S("\\bra@ket",Qh(!1));S("\\bra@set",Qh(!0));S("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");S("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");S("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");S("\\angln","{\\angl n}");S("\\blue","\\textcolor{##6495ed}{#1}");S("\\orange","\\textcolor{##ffa500}{#1}");S("\\pink","\\textcolor{##ff00af}{#1}");S("\\red","\\textcolor{##df0030}{#1}");S("\\green","\\textcolor{##28ae7b}{#1}");S("\\gray","\\textcolor{gray}{#1}");S("\\purple","\\textcolor{##9d38bd}{#1}");S("\\blueA","\\textcolor{##ccfaff}{#1}");S("\\blueB","\\textcolor{##80f6ff}{#1}");S("\\blueC","\\textcolor{##63d9ea}{#1}");S("\\blueD","\\textcolor{##11accd}{#1}");S("\\blueE","\\textcolor{##0c7f99}{#1}");S("\\tealA","\\textcolor{##94fff5}{#1}");S("\\tealB","\\textcolor{##26edd5}{#1}");S("\\tealC","\\textcolor{##01d1c1}{#1}");S("\\tealD","\\textcolor{##01a995}{#1}");S("\\tealE","\\textcolor{##208170}{#1}");S("\\greenA","\\textcolor{##b6ffb0}{#1}");S("\\greenB","\\textcolor{##8af281}{#1}");S("\\greenC","\\textcolor{##74cf70}{#1}");S("\\greenD","\\textcolor{##1fab54}{#1}");S("\\greenE","\\textcolor{##0d923f}{#1}");S("\\goldA","\\textcolor{##ffd0a9}{#1}");S("\\goldB","\\textcolor{##ffbb71}{#1}");S("\\goldC","\\textcolor{##ff9c39}{#1}");S("\\goldD","\\textcolor{##e07d10}{#1}");S("\\goldE","\\textcolor{##a75a05}{#1}");S("\\redA","\\textcolor{##fca9a9}{#1}");S("\\redB","\\textcolor{##ff8482}{#1}");S("\\redC","\\textcolor{##f9685d}{#1}");S("\\redD","\\textcolor{##e84d39}{#1}");S("\\redE","\\textcolor{##bc2612}{#1}");S("\\maroonA","\\textcolor{##ffbde0}{#1}");S("\\maroonB","\\textcolor{##ff92c6}{#1}");S("\\maroonC","\\textcolor{##ed5fa6}{#1}");S("\\maroonD","\\textcolor{##ca337c}{#1}");S("\\maroonE","\\textcolor{##9e034e}{#1}");S("\\purpleA","\\textcolor{##ddd7ff}{#1}");S("\\purpleB","\\textcolor{##c6b9fc}{#1}");S("\\purpleC","\\textcolor{##aa87ff}{#1}");S("\\purpleD","\\textcolor{##7854ab}{#1}");S("\\purpleE","\\textcolor{##543b78}{#1}");S("\\mintA","\\textcolor{##f5f9e8}{#1}");S("\\mintB","\\textcolor{##edf2df}{#1}");S("\\mintC","\\textcolor{##e0e5cc}{#1}");S("\\grayA","\\textcolor{##f6f7f7}{#1}");S("\\grayB","\\textcolor{##f0f1f2}{#1}");S("\\grayC","\\textcolor{##e3e5e6}{#1}");S("\\grayD","\\textcolor{##d6d8da}{#1}");S("\\grayE","\\textcolor{##babec2}{#1}");S("\\grayF","\\textcolor{##888d93}{#1}");S("\\grayG","\\textcolor{##626569}{#1}");S("\\grayH","\\textcolor{##3b3e40}{#1}");S("\\grayI","\\textcolor{##21242c}{#1}");S("\\kaBlue","\\textcolor{##314453}{#1}");S("\\kaGreen","\\textcolor{##71B307}{#1}");var Zh={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class X6{constructor(t,r,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=r,this.expansionCount=0,this.feed(t),this.macros=new J6(Y6,r.macros),this.mode=a,this.stack=[]}feed(t){this.lexer=new yd(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var r,a,s;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;r=this.popToken(),{tokens:s,end:a}=this.consumeArg(["]"])}else({tokens:s,start:r,end:a}=this.consumeArg());return this.pushToken(new wr("EOF",a.loc)),this.pushTokens(s),new wr("",pr.range(r,a))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var r=[],a=t&&t.length>0;a||this.consumeSpaces();var s=this.future(),i,o=0,l=0;do{if(i=this.popToken(),r.push(i),i.text==="{")++o;else if(i.text==="}"){if(--o,o===-1)throw new ge("Extra }",i)}else if(i.text==="EOF")throw new ge("Unexpected end of input in a macro argument, expected '"+(t&&a?t[l]:"}")+"'",i);if(t&&a)if((o===0||o===1&&t[l]==="{")&&i.text===t[l]){if(++l,l===t.length){r.splice(-l,l);break}}else l=0}while(o!==0||a);return s.text==="{"&&r[r.length-1].text==="}"&&(r.pop(),r.shift()),r.reverse(),{tokens:r,start:s,end:i}}consumeArgs(t,r){if(r){if(r.length!==t+1)throw new ge("The length of delimiters doesn't match the number of args!");for(var a=r[0],s=0;s<a.length;s++){var i=this.popToken();if(a[s]!==i.text)throw new ge("Use of the macro doesn't match its definition",i)}}for(var o=[],l=0;l<t;l++)o.push(this.consumeArg(r&&r[l+1]).tokens);return o}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new ge("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var r=this.popToken(),a=r.text,s=r.noexpand?null:this._getExpansion(a);if(s==null||t&&s.unexpandable){if(t&&s==null&&a[0]==="\\"&&!this.isDefined(a))throw new ge("Undefined control sequence: "+a);return this.pushToken(r),!1}this.countExpansion(1);var i=s.tokens,o=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){i=i.slice();for(var l=i.length-1;l>=0;--l){var c=i[l];if(c.text==="#"){if(l===0)throw new ge("Incomplete placeholder at end of macro body",c);if(c=i[--l],c.text==="#")i.splice(l+1,1);else if(/^[1-9]$/.test(c.text))i.splice(l,2,...o[+c.text-1]);else throw new ge("Not a valid argument number",c)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new wr(t)]):void 0}expandTokens(t){var r=[],a=this.stack.length;for(this.pushTokens(t);this.stack.length>a;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),r.push(s)}return this.countExpansion(r.length),r}expandMacroAsText(t){var r=this.expandMacro(t);return r&&r.map(a=>a.text).join("")}_getExpansion(t){var r=this.macros.get(t);if(r==null)return r;if(t.length===1){var a=this.lexer.catcodes[t];if(a!=null&&a!==13)return}var s=typeof r=="function"?r(this):r;if(typeof s=="string"){var i=0;if(s.indexOf("#")!==-1)for(var o=s.replace(/##/g,"");o.indexOf("#"+(i+1))!==-1;)++i;for(var l=new yd(s,this.settings),c=[],d=l.lex();d.text!=="EOF";)c.push(d),d=l.lex();c.reverse();var u={tokens:c,numArgs:i};return u}return s}isDefined(t){return this.macros.has(t)||In.hasOwnProperty(t)||Dt.math.hasOwnProperty(t)||Dt.text.hasOwnProperty(t)||Zh.hasOwnProperty(t)}isExpandable(t){var r=this.macros.get(t);return r!=null?typeof r=="string"||typeof r=="function"||!r.unexpandable:In.hasOwnProperty(t)&&!In[t].primitive}}var wd=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Os=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),yo={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},jd={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Ti{constructor(t,r){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new X6(t,r,this.mode),this.settings=r,this.leftrightDepth=0}expect(t,r){if(r===void 0&&(r=!0),this.fetch().text!==t)throw new ge("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());r&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var r=this.nextToken;this.consume(),this.gullet.pushToken(new wr("}")),this.gullet.pushTokens(t);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=r,a}parseExpression(t,r){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Ti.endOfExpression.indexOf(s.text)!==-1||r&&s.text===r||t&&In[s.text]&&In[s.text].infix)break;var i=this.parseAtom(r);if(i){if(i.type==="internal")continue}else break;a.push(i)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(t){for(var r=-1,a,s=0;s<t.length;s++)if(t[s].type==="infix"){if(r!==-1)throw new ge("only one infix operator per group",t[s].token);r=s,a=t[s].replaceWith}if(r!==-1&&a){var i,o,l=t.slice(0,r),c=t.slice(r+1);l.length===1&&l[0].type==="ordgroup"?i=l[0]:i={type:"ordgroup",mode:this.mode,body:l},c.length===1&&c[0].type==="ordgroup"?o=c[0]:o={type:"ordgroup",mode:this.mode,body:c};var d;return a==="\\\\abovefrac"?d=this.callFunction(a,[i,t[r],o],[]):d=this.callFunction(a,[i,o],[]),[d]}else return t}handleSupSubscript(t){var r=this.fetch(),a=r.text;this.consume(),this.consumeSpaces();var s;do{var i;s=this.parseGroup(t)}while(((i=s)==null?void 0:i.type)==="internal");if(!s)throw new ge("Expected group after '"+a+"'",r);return s}formatUnsupportedCmd(t){for(var r=[],a=0;a<t.length;a++)r.push({type:"textord",mode:"text",text:t[a]});var s={type:"text",mode:this.mode,body:r},i={type:"color",mode:this.mode,color:this.settings.errorColor,body:[s]};return i}parseAtom(t){var r=this.parseGroup("atom",t);if(r?.type==="internal"||this.mode==="text")return r;for(var a,s;;){this.consumeSpaces();var i=this.fetch();if(i.text==="\\limits"||i.text==="\\nolimits"){if(r&&r.type==="op"){var o=i.text==="\\limits";r.limits=o,r.alwaysHandleSupSub=!0}else if(r&&r.type==="operatorname")r.alwaysHandleSupSub&&(r.limits=i.text==="\\limits");else throw new ge("Limit controls must follow a math operator",i);this.consume()}else if(i.text==="^"){if(a)throw new ge("Double superscript",i);a=this.handleSupSubscript("superscript")}else if(i.text==="_"){if(s)throw new ge("Double subscript",i);s=this.handleSupSubscript("subscript")}else if(i.text==="'"){if(a)throw new ge("Double superscript",i);var l={type:"textord",mode:this.mode,text:"\\prime"},c=[l];for(this.consume();this.fetch().text==="'";)c.push(l),this.consume();this.fetch().text==="^"&&c.push(this.handleSupSubscript("superscript")),a={type:"ordgroup",mode:this.mode,body:c}}else if(Os[i.text]){var d=wd.test(i.text),u=[];for(u.push(new wr(Os[i.text])),this.consume();;){var m=this.fetch().text;if(!Os[m]||wd.test(m)!==d)break;u.unshift(new wr(Os[m])),this.consume()}var h=this.subparse(u);d?s={type:"ordgroup",mode:"math",body:h}:a={type:"ordgroup",mode:"math",body:h}}else break}return a||s?{type:"supsub",mode:this.mode,base:r,sup:a,sub:s}:r}parseFunction(t,r){var a=this.fetch(),s=a.text,i=In[s];if(!i)return null;if(this.consume(),r&&r!=="atom"&&!i.allowedInArgument)throw new ge("Got function '"+s+"' with no arguments"+(r?" as "+r:""),a);if(this.mode==="text"&&!i.allowedInText)throw new ge("Can't use function '"+s+"' in text mode",a);if(this.mode==="math"&&i.allowedInMath===!1)throw new ge("Can't use function '"+s+"' in math mode",a);var{args:o,optArgs:l}=this.parseArguments(s,i);return this.callFunction(s,o,l,a,t)}callFunction(t,r,a,s,i){var o={funcName:t,parser:this,token:s,breakOnTokenText:i},l=In[t];if(l&&l.handler)return l.handler(o,r,a);throw new ge("No function handler for "+t)}parseArguments(t,r){var a=r.numArgs+r.numOptionalArgs;if(a===0)return{args:[],optArgs:[]};for(var s=[],i=[],o=0;o<a;o++){var l=r.argTypes&&r.argTypes[o],c=o<r.numOptionalArgs;(r.primitive&&l==null||r.type==="sqrt"&&o===1&&i[0]==null)&&(l="primitive");var d=this.parseGroupOfType("argument to '"+t+"'",l,c);if(c)i.push(d);else if(d!=null)s.push(d);else throw new ge("Null argument, please report this as a bug")}return{args:s,optArgs:i}}parseGroupOfType(t,r,a){switch(r){case"color":return this.parseColorGroup(a);case"size":return this.parseSizeGroup(a);case"url":return this.parseUrlGroup(a);case"math":case"text":return this.parseArgumentGroup(a,r);case"hbox":{var s=this.parseArgumentGroup(a,"text");return s!=null?{type:"styling",mode:s.mode,body:[s],style:"text"}:null}case"raw":{var i=this.parseStringGroup("raw",a);return i!=null?{type:"raw",mode:"text",string:i.text}:null}case"primitive":{if(a)throw new ge("A primitive argument cannot be optional");var o=this.parseGroup(t);if(o==null)throw new ge("Expected group as "+t,this.fetch());return o}case"original":case null:case void 0:return this.parseArgumentGroup(a);default:throw new ge("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,r){var a=this.gullet.scanArgument(r);if(a==null)return null;for(var s="",i;(i=this.fetch()).text!=="EOF";)s+=i.text,this.consume();return this.consume(),a.text=s,a}parseRegexGroup(t,r){for(var a=this.fetch(),s=a,i="",o;(o=this.fetch()).text!=="EOF"&&t.test(i+o.text);)s=o,i+=s.text,this.consume();if(i==="")throw new ge("Invalid "+r+": '"+a.text+"'",a);return a.range(s,i)}parseColorGroup(t){var r=this.parseStringGroup("color",t);if(r==null)return null;var a=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(r.text);if(!a)throw new ge("Invalid color: '"+r.text+"'",r);var s=a[0];return/^[0-9a-f]{6}$/i.test(s)&&(s="#"+s),{type:"color-token",mode:this.mode,color:s}}parseSizeGroup(t){var r,a=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?r=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):r=this.parseStringGroup("size",t),!r)return null;!t&&r.text.length===0&&(r.text="0pt",a=!0);var s=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(r.text);if(!s)throw new ge("Invalid size: '"+r.text+"'",r);var i={number:+(s[1]+s[2]),unit:s[3]};if(!ch(i))throw new ge("Invalid unit: '"+i.unit+"'",r);return{type:"size",mode:this.mode,value:i,isBlank:a}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var r=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),r==null)return null;var a=r.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:a}}parseArgumentGroup(t,r){var a=this.gullet.scanArgument(t);if(a==null)return null;var s=this.mode;r&&this.switchMode(r),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:a.loc,body:i};return r&&this.switchMode(s),o}parseGroup(t,r){var a=this.fetch(),s=a.text,i;if(s==="{"||s==="\\begingroup"){this.consume();var o=s==="{"?"}":"\\endgroup";this.gullet.beginGroup();var l=this.parseExpression(!1,o),c=this.fetch();this.expect(o),this.gullet.endGroup(),i={type:"ordgroup",mode:this.mode,loc:pr.range(a,c),body:l,semisimple:s==="\\begingroup"||void 0}}else if(i=this.parseFunction(r,t)||this.parseSymbol(),i==null&&s[0]==="\\"&&!Zh.hasOwnProperty(s)){if(this.settings.throwOnError)throw new ge("Undefined control sequence: "+s,a);i=this.formatUnsupportedCmd(s),this.consume()}return i}formLigatures(t){for(var r=t.length-1,a=0;a<r;++a){var s=t[a],i=s.text;i==="-"&&t[a+1].text==="-"&&(a+1<r&&t[a+2].text==="-"?(t.splice(a,3,{type:"textord",mode:"text",loc:pr.range(s,t[a+2]),text:"---"}),r-=2):(t.splice(a,2,{type:"textord",mode:"text",loc:pr.range(s,t[a+1]),text:"--"}),r-=1)),(i==="'"||i==="`")&&t[a+1].text===i&&(t.splice(a,2,{type:"textord",mode:"text",loc:pr.range(s,t[a+1]),text:i+i}),r-=1)}}parseSymbol(){var t=this.fetch(),r=t.text;if(/^\\verb[^a-zA-Z]/.test(r)){this.consume();var a=r.slice(5),s=a.charAt(0)==="*";if(s&&(a=a.slice(1)),a.length<2||a.charAt(0)!==a.slice(-1))throw new ge(`\\verb assertion failed --
|
|
678
|
-
please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:s}}jd.hasOwnProperty(r[0])&&!Dt[this.mode][r[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+r[0]+'" used in math mode',t),r=jd[r[0]]+r.slice(1));var i=G6.exec(r);i&&(r=r.substring(0,i.index),r==="i"?r="ı":r==="j"&&(r="ȷ"));var o;if(Dt[this.mode][r]){this.settings.strict&&this.mode==="math"&&el.indexOf(r)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+r[0]+'" used in math mode',t);var l=Dt[this.mode][r].group,c=pr.range(t),d;if(O3.hasOwnProperty(l)){var u=l;d={type:"atom",mode:this.mode,family:u,loc:c,text:r}}else d={type:l,mode:this.mode,loc:c,text:r};o=d}else if(r.charCodeAt(0)>=128)this.settings.strict&&(lh(r.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+r[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+r[0]+'"'+(" ("+r.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:pr.range(t),text:r};else return null;if(this.consume(),i)for(var m=0;m<i[0].length;m++){var h=i[0][m];if(!yo[h])throw new ge("Unknown accent ' "+h+"'",t);var p=yo[h][this.mode]||yo[h].text;if(!p)throw new ge("Accent "+h+" unsupported in "+this.mode+" mode",t);o={type:"accent",mode:this.mode,loc:pr.range(t),label:p,isStretchy:!1,isShifty:!0,base:o}}return o}}Ti.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var p0=function(t,r){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new Ti(t,r);delete a.gullet.macros.current["\\df@tag"];var s=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!r.displayMode)throw new ge("\\tag works only in display equations");s=[{type:"tag",mode:"text",body:s,tag:a.subparse([new wr("\\df@tag")])}]}return s},ep=function(t,r,a){r.textContent="";var s=f0(t,a).toNode();r.appendChild(s)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),ep=function(){throw new ge("KaTeX doesn't work in quirks mode.")});var Q6=function(t,r){var a=f0(t,r).toMarkup();return a},Z6=function(t,r){var a=new Yl(r);return p0(t,a)},tp=function(t,r,a){if(a.throwOnError||!(t instanceof ge))throw t;var s=G.makeSpan(["katex-error"],[new Ir(r)]);return s.setAttribute("title",t.toString()),s.setAttribute("style","color:"+a.errorColor),s},f0=function(t,r){var a=new Yl(r);try{var s=p0(t,a);return l6(s,t,a)}catch(i){return tp(i,t,a)}},ek=function(t,r){var a=new Yl(r);try{var s=p0(t,a);return c6(s,t,a)}catch(i){return tp(i,t,a)}},tk="0.16.25",rk={Span:fs,Anchor:Zl,SymbolNode:Ir,SvgNode:mn,PathNode:Ln,LineNode:Zo},Nd={version:tk,render:ep,renderToString:Q6,ParseError:ge,SETTINGS_SCHEMA:Vs,__parse:Z6,__renderToDomTree:f0,__renderToHTMLTree:ek,__setFontMetrics:I3,__defineSymbol:f,__defineFunction:Ee,__defineMacro:S,__domTree:rk};const nk={};function ak(e){const t=this,r=e||nk,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),i=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),o=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(n3(r)),i.push(J5()),o.push(Y5(r))}const Sd=/[#.]/g;function sk(e,t){const r=e||"",a={};let s=0,i,o;for(;s<r.length;){Sd.lastIndex=s;const l=Sd.exec(r),c=r.slice(s,l?l.index:r.length);c&&(i?i==="#"?a.id=c:Array.isArray(a.className)?a.className.push(c):a.className=[c]:o=c,s+=c.length),l&&(i=l[0],s++)}return{type:"element",tagName:o||t||"div",properties:a,children:[]}}function rp(e,t,r){const a=r?ck(r):void 0;function s(i,o,...l){let c;if(i==null){c={type:"root",children:[]};const d=o;l.unshift(d)}else{c=sk(i,t);const d=c.tagName.toLowerCase(),u=a?a.get(d):void 0;if(c.tagName=u||d,ik(o))l.unshift(o);else for(const[m,h]of Object.entries(o))ok(e,c.properties,m,h)}for(const d of l)il(c.children,d);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return s}function ik(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,r=Object.keys(e);for(const a of r){const s=t[a];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const i=s;for(const o of i)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function ok(e,t,r,a){const s=om(e,r);let i;if(a!=null){if(typeof a=="number"){if(Number.isNaN(a))return;i=a}else typeof a=="boolean"?i=a:typeof a=="string"?s.spaceSeparated?i=nc(a):s.commaSeparated?i=Q0(a):s.commaOrSpaceSeparated?i=nc(Q0(a).join(" ")):i=Cd(s,s.property,a):Array.isArray(a)?i=[...a]:i=s.property==="style"?lk(a):String(a);if(Array.isArray(i)){const o=[];for(const l of i)o.push(Cd(s,s.property,l));i=o}s.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[s.property]=i}}function il(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const r of t)il(e,r);else if(typeof t=="object"&&"type"in t)t.type==="root"?il(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Cd(e,t,r){if(typeof r=="string"){if(e.number&&r&&!Number.isNaN(Number(r)))return Number(r);if((e.boolean||e.overloadedBoolean)&&(r===""||Qa(r)===Qa(t)))return!0}return r}function lk(e){const t=[];for(const[r,a]of Object.entries(e))t.push([r,a].join(": "));return t.join("; ")}function ck(e){const t=new Map;for(const r of e)t.set(r.toLowerCase(),r);return t}const dk=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],uk=rp(lm,"div"),mk=rp(bi,"g",dk),vo={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function hk(e,t){return np(e,{})||{type:"root",children:[]}}function np(e,t){const r=pk(e,t);return r&&t.afterTransform&&t.afterTransform(e,r),r}function pk(e,t){switch(e.nodeType){case 1:return bk(e,t);case 3:return gk(e);case 8:return xk(e);case 9:return Md(e,t);case 10:return fk();case 11:return Md(e,t);default:return}}function Md(e,t){return{type:"root",children:ap(e,t)}}function fk(){return{type:"doctype"}}function gk(e){return{type:"text",value:e.nodeValue||""}}function xk(e){return{type:"comment",value:e.nodeValue||""}}function bk(e,t){const r=e.namespaceURI,a=r===vo.svg?mk:uk,s=r===vo.html?e.tagName.toLowerCase():e.tagName,i=r===vo.html&&s==="template"?e.content:e,o=e.getAttributeNames(),l={};let c=-1;for(;++c<o.length;)l[o[c]]=e.getAttribute(o[c])||"";return a(s,l,ap(i,t))}function ap(e,t){const r=e.childNodes,a=[];let s=-1;for(;++s<r.length;){const i=np(r[s],t);i!==void 0&&a.push(i)}return a}new DOMParser;function yk(e,t){const r=vk(e);return hk(r)}function vk(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const Ad=function(e,t,r){const a=ms(r);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(a(e.children[t],t,e))return e.children[t]},na=function(e){if(e==null)return jk;if(typeof e=="string")return wk(e);if(typeof e=="object")return kk(e);if(typeof e=="function")return g0(e);throw new Error("Expected function, string, or array as `test`")};function kk(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=na(e[r]);return g0(a);function a(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function wk(e){return g0(t);function t(r){return r.tagName===e}}function g0(e){return t;function t(r,a,s){return!!(Nk(r)&&e.call(this,r,typeof a=="number"?a:void 0,s||void 0))}}function jk(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Nk(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Td=/\n/g,Ed=/[\t ]+/g,ol=na("br"),Id=na(Dk),Sk=na("p"),Dd=na("tr"),Ck=na(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",Ik,zk]),sp=na(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function Mk(e,t){const r=t||{},a="children"in e?e.children:[],s=sp(e),i=lp(e,{whitespace:r.whitespace||"normal"}),o=[];(e.type==="text"||e.type==="comment")&&o.push(...op(e,{breakBefore:!0,breakAfter:!0}));let l=-1;for(;++l<a.length;)o.push(...ip(a[l],e,{whitespace:i,breakBefore:l?void 0:s,breakAfter:l<a.length-1?ol(a[l+1]):s}));const c=[];let d;for(l=-1;++l<o.length;){const u=o[l];typeof u=="number"?d!==void 0&&u>d&&(d=u):u&&(d!==void 0&&d>-1&&c.push(`
|
|
679
|
-
`.repeat(d)||" "),d=-1,c.push(u))}return c.join("")}function ip(e,t,r){return e.type==="element"?Ak(e,t,r):e.type==="text"?r.whitespace==="normal"?op(e,r):Tk(e):[]}function Ak(e,t,r){const a=lp(e,r),s=e.children||[];let i=-1,o=[];if(Ck(e))return o;let l,c;for(ol(e)||Dd(e)&&Ad(t,e,Dd)?c=`
|
|
680
|
-
`:Sk(e)?(l=2,c=2):sp(e)&&(l=1,c=1);++i<s.length;)o=o.concat(ip(s[i],e,{whitespace:a,breakBefore:i?void 0:l,breakAfter:i<s.length-1?ol(s[i+1]):c}));return Id(e)&&Ad(t,e,Id)&&o.push(" "),l&&o.unshift(l),c&&o.push(c),o}function op(e,t){const r=String(e.value),a=[],s=[];let i=0;for(;i<=r.length;){Td.lastIndex=i;const c=Td.exec(r),d=c&&"index"in c?c.index:r.length;a.push(Ek(r.slice(i,d).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?t.breakBefore:!0,d===r.length?t.breakAfter:!0)),i=d+1}let o=-1,l;for(;++o<a.length;)a[o].charCodeAt(a[o].length-1)===8203||o<a.length-1&&a[o+1].charCodeAt(0)===8203?(s.push(a[o]),l=void 0):a[o]?(typeof l=="number"&&s.push(l),s.push(a[o]),l=0):(o===0||o===a.length-1)&&s.push(0);return s}function Tk(e){return[String(e.value)]}function Ek(e,t,r){const a=[];let s=0,i;for(;s<e.length;){Ed.lastIndex=s;const o=Ed.exec(e);i=o?o.index:e.length,!s&&!i&&o&&!t&&a.push(""),s!==i&&a.push(e.slice(s,i)),s=o?i+o[0].length:i}return s!==i&&!r&&a.push(""),a.join(" ")}function lp(e,t){if(e.type==="element"){const r=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function Ik(e){return!!(e.properties||{}).hidden}function Dk(e){return e.tagName==="td"||e.tagName==="th"}function zk(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const Lk={},Pk=[];function Rk(e){const t=e||Lk;return function(r,a){Ul(r,"element",function(s,i){const o=Array.isArray(s.properties.className)?s.properties.className:Pk,l=o.includes("language-math"),c=o.includes("math-display"),d=o.includes("math-inline");let u=c;if(!l&&!c&&!d)return;let m=i[i.length-1],h=s;if(s.tagName==="code"&&l&&m&&m.type==="element"&&m.tagName==="pre"&&(h=m,m=i[i.length-2],u=!0),!m)return;const p=Mk(h,{whitespace:"pre"});let x;try{x=Nd.renderToString(p,{...t,displayMode:u,throwOnError:!0})}catch(k){const w=k,j=w.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...i,s],cause:w,place:s.position,ruleId:j,source:"rehype-katex"});try{x=Nd.renderToString(p,{...t,displayMode:u,strict:"ignore",throwOnError:!1})}catch{x=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(k)},children:[{type:"text",value:p}]}]}}typeof x=="string"&&(x=yk(x).children);const y=m.children.indexOf(h);return m.children.splice(y,1,...x),Pm})}}var ko={exports:{}},wo,zd;function Fk(){if(zd)return wo;zd=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return wo=e,wo}var jo,Ld;function Bk(){if(Ld)return jo;Ld=1;var e=Fk();function t(){}function r(){}return r.resetWarningCache=t,jo=function(){function a(o,l,c,d,u,m){if(m!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}a.isRequired=a;function s(){return a}var i={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:s,element:a,elementType:a,instanceOf:s,node:a,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i},jo}var Pd;function Ok(){return Pd||(Pd=1,ko.exports=Bk()()),ko.exports}var $k=Ok();const Ct=ss($k);function aa(e,t,r,a){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(u){try{d(a.next(u))}catch(m){o(m)}}function c(u){try{d(a.throw(u))}catch(m){o(m)}}function d(u){u.done?i(u.value):s(u.value).then(l,c)}d((a=a.apply(e,t||[])).next())})}const _k=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function ka(e,t,r){const a=qk(e),{webkitRelativePath:s}=e,i=typeof t=="string"?t:typeof s=="string"&&s.length>0?s:`./${e.name}`;return typeof a.path!="string"&&Rd(a,"path",i),Rd(a,"relativePath",i),a}function qk(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const a=t.split(".").pop().toLowerCase(),s=_k.get(a);s&&Object.defineProperty(e,"type",{value:s,writable:!1,configurable:!1,enumerable:!0})}return e}function Rd(e,t,r){Object.defineProperty(e,t,{value:r,writable:!1,configurable:!1,enumerable:!0})}const Hk=[".DS_Store","Thumbs.db"];function Uk(e){return aa(this,void 0,void 0,function*(){return ci(e)&&Wk(e.dataTransfer)?Jk(e.dataTransfer,e.type):Vk(e)?Gk(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Kk(e):[]})}function Wk(e){return ci(e)}function Vk(e){return ci(e)&&ci(e.target)}function ci(e){return typeof e=="object"&&e!==null}function Gk(e){return ll(e.target.files).map(t=>ka(t))}function Kk(e){return aa(this,void 0,void 0,function*(){return(yield Promise.all(e.map(r=>r.getFile()))).map(r=>ka(r))})}function Jk(e,t){return aa(this,void 0,void 0,function*(){if(e.items){const r=ll(e.items).filter(s=>s.kind==="file");if(t!=="drop")return r;const a=yield Promise.all(r.map(Yk));return Fd(cp(a))}return Fd(ll(e.files).map(r=>ka(r)))})}function Fd(e){return e.filter(t=>Hk.indexOf(t.name)===-1)}function ll(e){if(e===null)return[];const t=[];for(let r=0;r<e.length;r++){const a=e[r];t.push(a)}return t}function Yk(e){if(typeof e.webkitGetAsEntry!="function")return Bd(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?dp(t):Bd(e,t)}function cp(e){return e.reduce((t,r)=>[...t,...Array.isArray(r)?cp(r):[r]],[])}function Bd(e,t){return aa(this,void 0,void 0,function*(){var r;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const i=yield e.getAsFileSystemHandle();if(i===null)throw new Error(`${e} is not a File`);if(i!==void 0){const o=yield i.getFile();return o.handle=i,ka(o)}}const a=e.getAsFile();if(!a)throw new Error(`${e} is not a File`);return ka(a,(r=t?.fullPath)!==null&&r!==void 0?r:void 0)})}function Xk(e){return aa(this,void 0,void 0,function*(){return e.isDirectory?dp(e):Qk(e)})}function dp(e){const t=e.createReader();return new Promise((r,a)=>{const s=[];function i(){t.readEntries(o=>aa(this,void 0,void 0,function*(){if(o.length){const l=Promise.all(o.map(Xk));s.push(l),i()}else try{const l=yield Promise.all(s);r(l)}catch(l){a(l)}}),o=>{a(o)})}i()})}function Qk(e){return aa(this,void 0,void 0,function*(){return new Promise((t,r)=>{e.file(a=>{const s=ka(a,e.fullPath);t(s)},a=>{r(a)})})})}var $s={},Od;function Zk(){return Od||(Od=1,$s.__esModule=!0,$s.default=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(",");if(r.length===0)return!0;var a=e.name||"",s=(e.type||"").toLowerCase(),i=s.replace(/\/.*$/,"");return r.some(function(o){var l=o.trim().toLowerCase();return l.charAt(0)==="."?a.toLowerCase().endsWith(l):l.endsWith("/*")?i===l.replace(/\/.*$/,""):s===l})}return!0}),$s}var e7=Zk();const No=ss(e7);function $d(e){return n7(e)||r7(e)||mp(e)||t7()}function t7(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
681
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r7(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function n7(e){if(Array.isArray(e))return cl(e)}function _d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function qd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_d(Object(r),!0).forEach(function(a){up(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_d(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function up(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ns(e,t){return i7(e)||s7(e,t)||mp(e,t)||a7()}function a7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
682
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mp(e,t){if(e){if(typeof e=="string")return cl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cl(e,t)}}function cl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function s7(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a=[],s=!0,i=!1,o,l;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(a.push(o.value),!(t&&a.length===t));s=!0);}catch(c){i=!0,l=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw l}}return a}}function i7(e){if(Array.isArray(e))return e}var o7=typeof No=="function"?No:No.default,l7="file-invalid-type",c7="file-too-large",d7="file-too-small",u7="too-many-files",m7=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",r=t.split(","),a=r.length>1?"one of ".concat(r.join(", ")):r[0];return{code:l7,message:"File type must be ".concat(a)}},Hd=function(t){return{code:c7,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Ud=function(t){return{code:d7,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},h7={code:u7,message:"Too many files"};function hp(e,t){var r=e.type==="application/x-moz-file"||o7(e,t);return[r,r?null:m7(t)]}function pp(e,t,r){if(Gn(e.size))if(Gn(t)&&Gn(r)){if(e.size>r)return[!1,Hd(r)];if(e.size<t)return[!1,Ud(t)]}else{if(Gn(t)&&e.size<t)return[!1,Ud(t)];if(Gn(r)&&e.size>r)return[!1,Hd(r)]}return[!0,null]}function Gn(e){return e!=null}function p7(e){var t=e.files,r=e.accept,a=e.minSize,s=e.maxSize,i=e.multiple,o=e.maxFiles,l=e.validator;return!i&&t.length>1||i&&o>=1&&t.length>o?!1:t.every(function(c){var d=hp(c,r),u=ns(d,1),m=u[0],h=pp(c,a,s),p=ns(h,1),x=p[0],y=l?l(c):null;return m&&x&&!y})}function di(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function _s(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Wd(e){e.preventDefault()}function f7(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function g7(e){return e.indexOf("Edge/")!==-1}function x7(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return f7(e)||g7(e)}function qr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(a){for(var s=arguments.length,i=new Array(s>1?s-1:0),o=1;o<s;o++)i[o-1]=arguments[o];return t.some(function(l){return!di(a)&&l&&l.apply(void 0,[a].concat(i)),di(a)})}}function b7(){return"showOpenFilePicker"in window}function y7(e){if(Gn(e)){var t=Object.entries(e).filter(function(r){var a=ns(r,2),s=a[0],i=a[1],o=!0;return fp(s)||(console.warn('Skipped "'.concat(s,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(i)||!i.every(gp))&&(console.warn('Skipped "'.concat(s,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(r,a){var s=ns(a,2),i=s[0],o=s[1];return qd(qd({},r),{},up({},i,o))},{});return[{description:"Files",accept:t}]}return e}function v7(e){if(Gn(e))return Object.entries(e).reduce(function(t,r){var a=ns(r,2),s=a[0],i=a[1];return[].concat($d(t),[s],$d(i))},[]).filter(function(t){return fp(t)||gp(t)}).join(",")}function k7(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function w7(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function fp(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function gp(e){return/^.*\.[\w]+$/.test(e)}var j7=["children"],N7=["open"],S7=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],C7=["refKey","onChange","onClick"];function M7(e){return E7(e)||T7(e)||xp(e)||A7()}function A7(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
683
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T7(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function E7(e){if(Array.isArray(e))return dl(e)}function So(e,t){return z7(e)||D7(e,t)||xp(e,t)||I7()}function I7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
684
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xp(e,t){if(e){if(typeof e=="string")return dl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dl(e,t)}}function dl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function D7(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var a=[],s=!0,i=!1,o,l;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(a.push(o.value),!(t&&a.length===t));s=!0);}catch(c){i=!0,l=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw l}}return a}}function z7(e){if(Array.isArray(e))return e}function Vd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Bt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vd(Object(r),!0).forEach(function(a){ul(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vd(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function ul(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ui(e,t){if(e==null)return{};var r=L7(e,t),a,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function L7(e,t){if(e==null)return{};var r={},a=Object.keys(e),s,i;for(i=0;i<a.length;i++)s=a[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}var x0=b.forwardRef(function(e,t){var r=e.children,a=ui(e,j7),s=yp(a),i=s.open,o=ui(s,N7);return b.useImperativeHandle(t,function(){return{open:i}},[i]),Jr.createElement(b.Fragment,null,r(Bt(Bt({},o),{},{open:i})))});x0.displayName="Dropzone";var bp={disabled:!1,getFilesFromEvent:Uk,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};x0.defaultProps=bp;x0.propTypes={children:Ct.func,accept:Ct.objectOf(Ct.arrayOf(Ct.string)),multiple:Ct.bool,preventDropOnDocument:Ct.bool,noClick:Ct.bool,noKeyboard:Ct.bool,noDrag:Ct.bool,noDragEventsBubbling:Ct.bool,minSize:Ct.number,maxSize:Ct.number,maxFiles:Ct.number,disabled:Ct.bool,getFilesFromEvent:Ct.func,onFileDialogCancel:Ct.func,onFileDialogOpen:Ct.func,useFsAccessApi:Ct.bool,autoFocus:Ct.bool,onDragEnter:Ct.func,onDragLeave:Ct.func,onDragOver:Ct.func,onDrop:Ct.func,onDropAccepted:Ct.func,onDropRejected:Ct.func,onError:Ct.func,validator:Ct.func};var ml={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function yp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Bt(Bt({},bp),e),r=t.accept,a=t.disabled,s=t.getFilesFromEvent,i=t.maxSize,o=t.minSize,l=t.multiple,c=t.maxFiles,d=t.onDragEnter,u=t.onDragLeave,m=t.onDragOver,h=t.onDrop,p=t.onDropAccepted,x=t.onDropRejected,y=t.onFileDialogCancel,k=t.onFileDialogOpen,w=t.useFsAccessApi,j=t.autoFocus,N=t.preventDropOnDocument,L=t.noClick,U=t.noKeyboard,I=t.noDrag,H=t.noDragEventsBubbling,F=t.onError,W=t.validator,M=b.useMemo(function(){return v7(r)},[r]),_=b.useMemo(function(){return y7(r)},[r]),O=b.useMemo(function(){return typeof k=="function"?k:Gd},[k]),V=b.useMemo(function(){return typeof y=="function"?y:Gd},[y]),T=b.useRef(null),Y=b.useRef(null),ne=b.useReducer(P7,ml),he=So(ne,2),$=he[0],J=he[1],C=$.isFocused,ue=$.isFileDialogActive,xe=b.useRef(typeof window<"u"&&window.isSecureContext&&w&&b7()),A=function(){!xe.current&&ue&&setTimeout(function(){if(Y.current){var Se=Y.current.files;Se.length||(J({type:"closeDialog"}),V())}},300)};b.useEffect(function(){return window.addEventListener("focus",A,!1),function(){window.removeEventListener("focus",A,!1)}},[Y,ue,V,xe]);var te=b.useRef([]),Ce=function(Se){T.current&&T.current.contains(Se.target)||(Se.preventDefault(),te.current=[])};b.useEffect(function(){return N&&(document.addEventListener("dragover",Wd,!1),document.addEventListener("drop",Ce,!1)),function(){N&&(document.removeEventListener("dragover",Wd),document.removeEventListener("drop",Ce))}},[T,N]),b.useEffect(function(){return!a&&j&&T.current&&T.current.focus(),function(){}},[T,j,a]);var De=b.useCallback(function(ie){F?F(ie):console.error(ie)},[F]),pe=b.useCallback(function(ie){ie.preventDefault(),ie.persist(),st(ie),te.current=[].concat(M7(te.current),[ie.target]),_s(ie)&&Promise.resolve(s(ie)).then(function(Se){if(!(di(ie)&&!H)){var B=Se.length,K=B>0&&p7({files:Se,accept:M,minSize:o,maxSize:i,multiple:l,maxFiles:c,validator:W}),ke=B>0&&!K;J({isDragAccept:K,isDragReject:ke,isDragActive:!0,type:"setDraggedFiles"}),d&&d(ie)}}).catch(function(Se){return De(Se)})},[s,d,De,H,M,o,i,l,c,W]),_e=b.useCallback(function(ie){ie.preventDefault(),ie.persist(),st(ie);var Se=_s(ie);if(Se&&ie.dataTransfer)try{ie.dataTransfer.dropEffect="copy"}catch{}return Se&&m&&m(ie),!1},[m,H]),se=b.useCallback(function(ie){ie.preventDefault(),ie.persist(),st(ie);var Se=te.current.filter(function(K){return T.current&&T.current.contains(K)}),B=Se.indexOf(ie.target);B!==-1&&Se.splice(B,1),te.current=Se,!(Se.length>0)&&(J({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),_s(ie)&&u&&u(ie))},[T,u,H]),we=b.useCallback(function(ie,Se){var B=[],K=[];ie.forEach(function(ke){var We=hp(ke,M),Ge=So(We,2),ce=Ge[0],R=Ge[1],Q=pp(ke,o,i),be=So(Q,2),je=be[0],re=be[1],Me=W?W(ke):null;if(ce&&je&&!Me)B.push(ke);else{var pt=[R,re];Me&&(pt=pt.concat(Me)),K.push({file:ke,errors:pt.filter(function(qt){return qt})})}}),(!l&&B.length>1||l&&c>=1&&B.length>c)&&(B.forEach(function(ke){K.push({file:ke,errors:[h7]})}),B.splice(0)),J({acceptedFiles:B,fileRejections:K,isDragReject:K.length>0,type:"setFiles"}),h&&h(B,K,Se),K.length>0&&x&&x(K,Se),B.length>0&&p&&p(B,Se)},[J,l,M,o,i,c,h,p,x,W]),ze=b.useCallback(function(ie){ie.preventDefault(),ie.persist(),st(ie),te.current=[],_s(ie)&&Promise.resolve(s(ie)).then(function(Se){di(ie)&&!H||we(Se,ie)}).catch(function(Se){return De(Se)}),J({type:"reset"})},[s,we,De,H]),Ae=b.useCallback(function(){if(xe.current){J({type:"openDialog"}),O();var ie={multiple:l,types:_};window.showOpenFilePicker(ie).then(function(Se){return s(Se)}).then(function(Se){we(Se,null),J({type:"closeDialog"})}).catch(function(Se){k7(Se)?(V(Se),J({type:"closeDialog"})):w7(Se)?(xe.current=!1,Y.current?(Y.current.value=null,Y.current.click()):De(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):De(Se)});return}Y.current&&(J({type:"openDialog"}),O(),Y.current.value=null,Y.current.click())},[J,O,V,w,we,De,_,l]),Be=b.useCallback(function(ie){!T.current||!T.current.isEqualNode(ie.target)||(ie.key===" "||ie.key==="Enter"||ie.keyCode===32||ie.keyCode===13)&&(ie.preventDefault(),Ae())},[T,Ae]),nt=b.useCallback(function(){J({type:"focus"})},[]),bt=b.useCallback(function(){J({type:"blur"})},[]),ut=b.useCallback(function(){L||(x7()?setTimeout(Ae,0):Ae())},[L,Ae]),jt=function(Se){return a?null:Se},lt=function(Se){return U?null:jt(Se)},qe=function(Se){return I?null:jt(Se)},st=function(Se){H&&Se.stopPropagation()},St=b.useMemo(function(){return function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Se=ie.refKey,B=Se===void 0?"ref":Se,K=ie.role,ke=ie.onKeyDown,We=ie.onFocus,Ge=ie.onBlur,ce=ie.onClick,R=ie.onDragEnter,Q=ie.onDragOver,be=ie.onDragLeave,je=ie.onDrop,re=ui(ie,S7);return Bt(Bt(ul({onKeyDown:lt(qr(ke,Be)),onFocus:lt(qr(We,nt)),onBlur:lt(qr(Ge,bt)),onClick:jt(qr(ce,ut)),onDragEnter:qe(qr(R,pe)),onDragOver:qe(qr(Q,_e)),onDragLeave:qe(qr(be,se)),onDrop:qe(qr(je,ze)),role:typeof K=="string"&&K!==""?K:"presentation"},B,T),!a&&!U?{tabIndex:0}:{}),re)}},[T,Be,nt,bt,ut,pe,_e,se,ze,U,I,a]),Oe=b.useCallback(function(ie){ie.stopPropagation()},[]),Qt=b.useMemo(function(){return function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Se=ie.refKey,B=Se===void 0?"ref":Se,K=ie.onChange,ke=ie.onClick,We=ui(ie,C7),Ge=ul({accept:M,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:jt(qr(K,ze)),onClick:jt(qr(ke,Oe)),tabIndex:-1},B,Y);return Bt(Bt({},Ge),We)}},[Y,r,l,ze,a]);return Bt(Bt({},$),{},{isFocused:C&&!a,getRootProps:St,getInputProps:Qt,rootRef:T,inputRef:Y,open:jt(Ae)})}function P7(e,t){switch(t.type){case"focus":return Bt(Bt({},e),{},{isFocused:!0});case"blur":return Bt(Bt({},e),{},{isFocused:!1});case"openDialog":return Bt(Bt({},ml),{},{isFileDialogActive:!0});case"closeDialog":return Bt(Bt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Bt(Bt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Bt(Bt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Bt({},ml);default:return e}}function Gd(){}const Co=({todos:e,isResult:t=!1})=>{if(!e||!Array.isArray(e))return null;const r=i=>{switch(i){case"completed":return n.jsx(gg,{className:"w-4 h-4 text-green-500 dark:text-green-400"});case"in_progress":return n.jsx(Ya,{className:"w-4 h-4 text-blue-500 dark:text-blue-400"});case"pending":default:return n.jsx(ma,{className:"w-4 h-4 text-gray-400 dark:text-gray-500"})}},a=i=>{switch(i){case"completed":return"bg-green-100 dark:bg-green-900/30 text-green-800 dark:text-green-200 border-green-200 dark:border-green-800";case"in_progress":return"bg-blue-100 dark:bg-blue-900/30 text-blue-800 dark:text-blue-200 border-blue-200 dark:border-blue-800";case"pending":default:return"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 border-gray-200 dark:border-gray-700"}},s=i=>{switch(i){case"high":return"bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300 border-red-200 dark:border-red-800";case"medium":return"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-300 border-yellow-200 dark:border-yellow-800";case"low":default:return"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 border-gray-200 dark:border-gray-700"}};return n.jsxs("div",{className:"space-y-3",children:[t&&n.jsxs("div",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:["Todo List (",e.length," ",e.length===1?"item":"items",")"]}),e.map((i,o)=>n.jsxs("div",{className:"flex items-start gap-3 p-3 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-sm hover:shadow-md dark:shadow-gray-900/50 transition-shadow",children:[n.jsx("div",{className:"flex-shrink-0 mt-0.5",children:r(i.status)}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[n.jsx("p",{className:`text-sm font-medium ${i.status==="completed"?"line-through text-gray-500 dark:text-gray-400":"text-gray-900 dark:text-gray-100"}`,children:i.content}),n.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[n.jsx(Yn,{variant:"outline",className:`text-xs px-2 py-0.5 ${s(i.priority)}`,children:i.priority}),n.jsx(Yn,{variant:"outline",className:`text-xs px-2 py-0.5 ${a(i.status)}`,children:i.status.replace("_"," ")})]})]})})]},i.id||`todo-${o}`))]})};var R7=qf(),F7=Hf(),B7=Uf(),O7=Wf();const $7=`
|
|
685
|
-
.xterm .xterm-screen {
|
|
686
|
-
outline: none !important;
|
|
687
|
-
}
|
|
688
|
-
.xterm:focus .xterm-screen {
|
|
689
|
-
outline: none !important;
|
|
690
|
-
}
|
|
691
|
-
.xterm-screen:focus {
|
|
692
|
-
outline: none !important;
|
|
693
|
-
}
|
|
694
|
-
`;if(typeof document<"u"){const e=document.createElement("style");e.type="text/css",e.innerText=$7,document.head.appendChild(e)}const Vn=new Map;function b0({selectedProject:e,selectedSession:t,isActive:r,initialCommand:a,isPlainShell:s=!1,onProcessComplete:i}){const o=b.useRef(null),l=b.useRef(null),c=b.useRef(null),d=b.useRef(null),[u,m]=b.useState(!1),[h,p]=b.useState(!1),[x,y]=b.useState(!1),[k,w]=b.useState(null),[j,N]=b.useState(!1),L=()=>{!h||u||j||(N(!0),H())},U=()=>{d.current&&(d.current.close(),d.current=null),l.current&&(l.current.clear(),l.current.write("\x1B[2J\x1B[H")),m(!1),N(!1)},I=()=>{y(!0),Array.from(Vn.keys()).filter(W=>W.includes(e.name)).forEach(W=>Vn.delete(W)),d.current&&(d.current.close(),d.current=null),l.current&&(l.current.dispose(),l.current=null,c.current=null),m(!1),p(!1),setTimeout(()=>{y(!1)},200)};b.useEffect(()=>{const F=t?.id||null;k!==null&&k!==F&&h&&(U(),Array.from(Vn.keys()).forEach(M=>{M.includes(e.name)&&Vn.delete(M)})),w(F)},[t?.id,h]),b.useEffect(()=>{if(!o.current||!e||x)return;const F=t?.id||`project-${e.name}`,W=Vn.get(F);if(W&&!l.current)try{l.current=W.terminal,c.current=W.fitAddon,d.current=W.ws,m(W.isConnected),l.current.element&&l.current.element.parentNode&&l.current.element.parentNode.removeChild(l.current.element),l.current.open(o.current),setTimeout(()=>{c.current&&(c.current.fit(),d.current&&d.current.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"resize",cols:l.current.cols,rows:l.current.rows})))},100),p(!0);return}catch{Vn.delete(F),l.current=null,c.current=null,d.current=null}if(l.current)return;l.current=new R7.Terminal({cursorBlink:!0,fontSize:14,fontFamily:'Menlo, Monaco, "Courier New", monospace',allowProposedApi:!0,allowTransparency:!1,convertEol:!0,scrollback:1e4,tabStopWidth:4,windowsMode:!1,macOptionIsMeta:!0,macOptionClickForcesSelection:!1,theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#ffffff",cursorAccent:"#1e1e1e",selection:"#264f78",selectionForeground:"#ffffff",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff",extendedAnsi:["#000000","#800000","#008000","#808000","#000080","#800080","#008080","#c0c0c0","#808080","#ff0000","#00ff00","#ffff00","#0000ff","#ff00ff","#00ffff","#ffffff"]}}),c.current=new F7.FitAddon;const M=new B7.ClipboardAddon,_=new O7.WebglAddon;l.current.loadAddon(c.current),l.current.loadAddon(M);try{l.current.loadAddon(_)}catch{}l.current.open(o.current),setTimeout(()=>{c.current&&c.current.fit()},50),l.current.attachCustomKeyEventHandler(V=>(V.ctrlKey||V.metaKey)&&V.key==="c"&&l.current.hasSelection()?(document.execCommand("copy"),!1):(V.ctrlKey||V.metaKey)&&V.key==="v"?(navigator.clipboard.readText().then(T=>{d.current&&d.current.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"input",data:T}))}).catch(T=>{}),!1):!0),setTimeout(()=>{c.current&&(c.current.fit(),l.current&&d.current&&d.current.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"resize",cols:l.current.cols,rows:l.current.rows})))},100),p(!0),l.current.onData(V=>{d.current&&d.current.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"input",data:V}))});const O=new ResizeObserver(()=>{c.current&&l.current&&setTimeout(()=>{c.current.fit(),d.current&&d.current.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"resize",cols:l.current.cols,rows:l.current.rows}))},50)});return o.current&&O.observe(o.current),()=>{if(O.disconnect(),l.current&&e){const V=t?.id||`project-${e.name}`;try{Vn.set(V,{terminal:l.current,fitAddon:c.current,ws:d.current,isConnected:u})}catch{}}}},[o.current,e,t,x]),b.useEffect(()=>{!r||!h||setTimeout(()=>{c.current&&(c.current.fit(),l.current&&d.current&&d.current.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"resize",cols:l.current.cols,rows:l.current.rows})))},100)},[r,h]);const H=async()=>{if(!(j||u))try{let W;{const M=localStorage.getItem("auth-token");if(!M){console.error("No authentication token found for Shell WebSocket connection");return}W=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/shell?token=${encodeURIComponent(M)}`}d.current=new WebSocket(W),d.current.onopen=()=>{m(!0),N(!1),setTimeout(()=>{c.current&&l.current&&(c.current.fit(),setTimeout(()=>{const M={type:"init",projectPath:e.fullPath||e.path,sessionId:s?null:t?.id,hasSession:s?!1:!!t,provider:s?"plain-shell":t?.__provider||"claude",cols:l.current.cols,rows:l.current.rows,initialCommand:a,isPlainShell:s};console.log("Shell init payload:",M),d.current.send(JSON.stringify(M)),setTimeout(()=>{l.current&&d.current&&d.current.readyState===WebSocket.OPEN&&d.current.send(JSON.stringify({type:"resize",cols:l.current.cols,rows:l.current.rows}))},100)},50))},200)},d.current.onmessage=M=>{try{const _=JSON.parse(M.data);if(_.type==="output"){const O=/(https?:\/\/[^\s\x1b\x07]+)/g;let V=_.data;const T=[];let Y;for(;(Y=O.exec(V.replace(/\x1b\[[0-9;]*m/g,"")))!==null;)T.push(Y[1]);if(s&&i){const ne=V.replace(/\x1b\[[0-9;]*m/g,"");if(ne.includes("Process exited with code 0"))i(0);else if(ne.match(/Process exited with code (\d+)/)){const he=parseInt(ne.match(/Process exited with code (\d+)/)[1]);he!==0&&i(he)}}l.current.write(V)}else _.type==="url_open"&&window.open(_.url,"_blank")}catch{}},d.current.onclose=M=>{m(!1),N(!1),l.current&&(l.current.clear(),l.current.write("\x1B[2J\x1B[H"))},d.current.onerror=M=>{m(!1),N(!1)}}catch{m(!1),N(!1)}};return e?n.jsxs("div",{className:"h-full flex flex-col bg-gray-900 w-full",children:[n.jsx("div",{className:"flex-shrink-0 bg-gray-800 border-b border-gray-700 px-4 py-2",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${u?"bg-green-500":"bg-red-500"}`}),t&&(()=>{const F=t.__provider==="cursor"?t.name||"Untitled Session":t.summary||"New Session";return n.jsxs("span",{className:"text-xs text-blue-300",children:["(",F.slice(0,30),"...)"]})})(),!t&&n.jsx("span",{className:"text-xs text-gray-400",children:"(New Session)"}),!h&&n.jsx("span",{className:"text-xs text-yellow-400",children:"(Initializing...)"}),x&&n.jsx("span",{className:"text-xs text-blue-400",children:"(Restarting...)"})]}),n.jsxs("div",{className:"flex items-center space-x-3",children:[u&&n.jsxs("button",{onClick:U,className:"px-3 py-1 text-xs bg-red-600 text-white rounded hover:bg-red-700 flex items-center space-x-1",title:"Disconnect from shell",children:[n.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),n.jsx("span",{children:"Disconnect"})]}),n.jsxs("button",{onClick:I,disabled:x||u,className:"text-xs text-gray-400 hover:text-white disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-1",title:"Restart Shell (disconnect first)",children:[n.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),n.jsx("span",{children:"Restart"})]})]})]})}),n.jsxs("div",{className:"flex-1 p-2 overflow-hidden relative",children:[n.jsx("div",{ref:o,className:"h-full w-full focus:outline-none",style:{outline:"none"}}),!h&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90",children:n.jsx("div",{className:"text-white",children:"Loading terminal..."})}),h&&!u&&!j&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90 p-4",children:n.jsxs("div",{className:"text-center max-w-sm w-full",children:[n.jsxs("button",{onClick:L,className:"px-6 py-3 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors flex items-center justify-center space-x-2 text-base font-medium w-full sm:w-auto",title:"Connect to shell",children:[n.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),n.jsx("span",{children:"Continue in Shell"})]}),n.jsx("p",{className:"text-gray-400 text-sm mt-3 px-2",children:s?`Run ${a||"command"} in ${e.displayName}`:t?`Resume session: ${(t.__provider==="cursor"?t.name||"Untitled Session":t.summary||"New Session").slice(0,50)}...`:"Start a new Claude session"})]})}),j&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-900 bg-opacity-90 p-4",children:n.jsxs("div",{className:"text-center max-w-sm w-full",children:[n.jsxs("div",{className:"flex items-center justify-center space-x-3 text-yellow-400",children:[n.jsx("div",{className:"w-6 h-6 animate-spin rounded-full border-2 border-yellow-400 border-t-transparent"}),n.jsx("span",{className:"text-base font-medium",children:"Connecting to shell..."})]}),n.jsx("p",{className:"text-gray-400 text-sm mt-3 px-2",children:s?`Running ${a||"command"} in ${e.displayName}`:`Starting Claude CLI in ${e.displayName}`})]})})]})]}):n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[n.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center",children:n.jsx("svg",{className:"w-8 h-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2z"})})}),n.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Select a Project"}),n.jsx("p",{children:"Choose a project to open an interactive shell in that directory"})]})})}const vp=({task:e,onClose:t,onEdit:r,onStatusChange:a,onTaskClick:s,isOpen:i=!0,className:o=""})=>{const[l,c]=b.useState(!1),[d,u]=b.useState(e||{}),[m,h]=b.useState(!1),[p,x]=b.useState(!1),[y,k]=b.useState(!1),{currentProject:w,refreshTasks:j}=ls();if(!i||!e)return null;const N=async()=>{if(w){h(!0);try{const M={};if(d.title!==e.title&&(M.title=d.title),d.description!==e.description&&(M.description=d.description),d.details!==e.details&&(M.details=d.details),Object.keys(M).length>0){const _=await at.taskmaster.updateTask(w.name,e.id,M);if(_.ok)j?.(),r?.(d),c(!1);else{const O=await _.json();console.error("Failed to update task:",O),alert(`Failed to update task: ${O.message}`)}}else c(!1)}catch(M){console.error("Error updating task:",M),alert("Error updating task. Please try again.")}finally{h(!1)}}},L=()=>{navigator.clipboard.writeText(e.id.toString())},U=M=>{switch(M){case"done":return{icon:is,color:"text-green-600 dark:text-green-400",bg:"bg-green-50 dark:bg-green-950"};case"in-progress":return{icon:Ya,color:"text-blue-600 dark:text-blue-400",bg:"bg-blue-50 dark:bg-blue-950"};case"review":return{icon:gi,color:"text-amber-600 dark:text-amber-400",bg:"bg-amber-50 dark:bg-amber-950"};case"deferred":return{icon:Pu,color:"text-gray-500 dark:text-gray-400",bg:"bg-gray-50 dark:bg-gray-800"};case"cancelled":return{icon:Mt,color:"text-red-600 dark:text-red-400",bg:"bg-red-50 dark:bg-red-950"};default:return{icon:ma,color:"text-slate-500 dark:text-slate-400",bg:"bg-slate-50 dark:bg-slate-800"}}},I=U(e.status),H=I.icon,F=M=>{switch(M){case"high":return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-950";case"medium":return"text-yellow-600 dark:text-yellow-400 bg-yellow-50 dark:bg-yellow-950";case"low":return"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-950";default:return"text-gray-600 dark:text-gray-400 bg-gray-50 dark:bg-gray-800"}},W=[{value:"pending",label:"Pending"},{value:"in-progress",label:"In Progress"},{value:"review",label:"Review"},{value:"done",label:"Done"},{value:"deferred",label:"Deferred"},{value:"cancelled",label:"Cancelled"}];return n.jsx("div",{className:"modal-backdrop fixed inset-0 flex items-center justify-center z-[100] md:p-4 bg-black/50",children:n.jsxs("div",{className:Ue("bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 md:rounded-lg shadow-xl","w-full md:max-w-4xl h-full md:h-[90vh] flex flex-col",o),children:[n.jsxs("div",{className:"flex items-center justify-between p-4 md:p-6 border-b border-gray-200 dark:border-gray-700 flex-shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[n.jsx(H,{className:Ue("w-6 h-6",I.color)}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsxs("button",{onClick:L,className:"flex items-center gap-1 px-2 py-1 text-xs bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-300 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",title:"Click to copy task ID",children:[n.jsxs("span",{children:["Task ",e.id]}),n.jsx(Du,{className:"w-3 h-3"})]}),e.parentId&&n.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Subtask of Task ",e.parentId]})]}),l?n.jsx("input",{type:"text",value:d.title||"",onChange:M=>u({...d,title:M.target.value}),className:"w-full text-lg font-semibold bg-transparent border-b-2 border-blue-500 focus:outline-none text-gray-900 dark:text-white",placeholder:"Task title"}):n.jsx("h1",{className:"text-lg md:text-xl font-semibold text-gray-900 dark:text-white line-clamp-2",children:e.title})]})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[l?n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:N,disabled:m,className:"p-2 text-green-600 hover:text-green-700 hover:bg-green-50 dark:hover:bg-green-950 rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:m?"Saving...":"Save changes",children:n.jsx(Zs,{className:Ue("w-5 h-5",m&&"animate-spin")})}),n.jsx("button",{onClick:()=>{c(!1),u(e)},disabled:m,className:"p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Cancel editing",children:n.jsx(Mt,{className:"w-5 h-5"})})]}):n.jsx("button",{onClick:()=>c(!0),className:"p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors",title:"Edit task",children:n.jsx(M1,{className:"w-5 h-5"})}),n.jsx("button",{onClick:t,className:"p-2 text-gray-500 hover:text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors",title:"Close",children:n.jsx(Mt,{className:"w-5 h-5"})})]})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-4 md:p-6 space-y-6 min-h-0",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Status"}),n.jsx("div",{className:Ue("w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600",I.bg,I.color),children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(H,{className:"w-4 h-4"}),n.jsx("span",{className:"font-medium capitalize",children:W.find(M=>M.value===e.status)?.label||e.status})]})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Priority"}),n.jsxs("div",{className:Ue("px-3 py-2 rounded-md text-sm font-medium capitalize",F(e.priority)),children:[n.jsx(zu,{className:"w-4 h-4 inline mr-2"}),e.priority||"Not set"]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Dependencies"}),e.dependencies&&e.dependencies.length>0?n.jsx("div",{className:"flex flex-wrap gap-1",children:e.dependencies.map(M=>n.jsxs("button",{onClick:()=>s&&s({id:M}),className:"px-2 py-1 bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300 rounded text-sm hover:bg-blue-200 dark:hover:bg-blue-800 transition-colors cursor-pointer disabled:cursor-default disabled:opacity-50",disabled:!s,title:s?`Click to view Task ${M}`:`Task ${M}`,children:[n.jsx(Ml,{className:"w-3 h-3 inline mr-1"}),M]},M))}):n.jsx("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No dependencies"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Description"}),l?n.jsx("textarea",{value:d.description||"",onChange:M=>u({...d,description:M.target.value}),rows:3,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-800 text-gray-900 dark:text-white",placeholder:"Task description"}):n.jsx("p",{className:"text-gray-700 dark:text-gray-300 whitespace-pre-wrap",children:e.description||"No description provided"})]}),e.details&&n.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg",children:[n.jsxs("button",{onClick:()=>x(!p),className:"w-full flex items-center justify-between p-4 text-left hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:[n.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Implementation Details"}),p?n.jsx(Ar,{className:"w-4 h-4 text-gray-500"}):n.jsx(cn,{className:"w-4 h-4 text-gray-500"})]}),p&&n.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 p-4",children:l?n.jsx("textarea",{value:d.details||"",onChange:M=>u({...d,details:M.target.value}),rows:4,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-800 text-gray-900 dark:text-white",placeholder:"Implementation details"}):n.jsx("div",{className:"bg-gray-50 dark:bg-gray-800 rounded-md p-4",children:n.jsx("p",{className:"text-gray-700 dark:text-gray-300 whitespace-pre-wrap",children:e.details})})})]}),e.testStrategy&&n.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg",children:[n.jsxs("button",{onClick:()=>k(!y),className:"w-full flex items-center justify-between p-4 text-left hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:[n.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Test Strategy"}),y?n.jsx(Ar,{className:"w-4 h-4 text-gray-500"}):n.jsx(cn,{className:"w-4 h-4 text-gray-500"})]}),y&&n.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 p-4",children:n.jsx("div",{className:"bg-blue-50 dark:bg-blue-950 rounded-md p-4",children:n.jsx("p",{className:"text-gray-700 dark:text-gray-300 whitespace-pre-wrap",children:e.testStrategy})})})]}),e.subtasks&&e.subtasks.length>0&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:["Subtasks (",e.subtasks.length,")"]}),n.jsx("div",{className:"space-y-2",children:e.subtasks.map(M=>{const _=U(M.status),O=_.icon;return n.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 dark:bg-gray-800 rounded-md",children:[n.jsx(O,{className:Ue("w-4 h-4",_.color)}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("h4",{className:"font-medium text-gray-900 dark:text-white truncate",children:M.title}),M.description&&n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 truncate",children:M.description})]}),n.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:M.id})]},M.id)})})]})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 md:p-6 border-t border-gray-200 dark:border-gray-700 flex-shrink-0",children:[n.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Task ID: ",e.id]}),n.jsx("div",{className:"flex items-center gap-2",children:n.jsx("button",{onClick:t,className:"px-4 py-2 text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-800 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-md transition-colors",children:"Close"})})]})]})})},Kd=({onShowAllTasks:e,onStartTask:t,className:r=""})=>{const{nextTask:a,tasks:s,currentProject:i,isLoadingTasks:o,projectTaskMaster:l,refreshTasks:c,refreshProjects:d}=ls(),[u,m]=b.useState(!1),[h,p]=b.useState(!1),[x,y]=b.useState(!1),[k,w]=b.useState(!1),[j,N]=b.useState(!1),[L,U]=b.useState(!1),[I,H]=b.useState(!1),F=()=>{y(!0),p(!1)},W=()=>{w(!0),p(!1)};if(!i||o)return null;let M;if((!s||s.length===0)&&!l?.hasTaskmaster)M=n.jsxs("div",{className:Ue("bg-blue-50 dark:bg-blue-950 border border-blue-200 dark:border-blue-800 rounded-lg p-3 mb-4",r),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Qs,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"TaskMaster AI is not configured"}),n.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-0.5"})]})]}),n.jsx("div",{className:"flex items-center gap-1",children:n.jsxs("button",{onClick:()=>p(!h),className:"text-xs px-2 py-1 bg-blue-600 hover:bg-blue-700 text-white rounded transition-colors flex items-center gap-1",children:[n.jsx(Qn,{className:"w-3 h-3"}),"Initialize TaskMaster AI"]})})]}),h&&n.jsxs("div",{className:"mt-3 pt-3 border-t border-blue-200 dark:border-blue-800",children:[!l?.hasTaskmaster&&n.jsxs("div",{className:"mb-3 p-3 bg-blue-50 dark:bg-blue-900/50 rounded-lg",children:[n.jsx("h4",{className:"text-sm font-medium text-blue-900 dark:text-blue-100 mb-2",children:"🎯 What is TaskMaster?"}),n.jsxs("div",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[n.jsxs("p",{children:["• ",n.jsx("strong",{children:"AI-Powered Task Management:"})," Break complex projects into manageable subtasks"]}),n.jsxs("p",{children:["• ",n.jsx("strong",{children:"PRD Templates:"})," Generate tasks from Product Requirements Documents"]}),n.jsxs("p",{children:["• ",n.jsx("strong",{children:"Dependency Tracking:"})," Understand task relationships and execution order"]}),n.jsxs("p",{children:["• ",n.jsx("strong",{children:"Progress Visualization:"})," Kanban boards and detailed task analytics"]}),n.jsxs("p",{children:["• ",n.jsx("strong",{children:"CLI Integration:"})," Use taskmaster commands for advanced workflows"]})]})]}),n.jsx("div",{className:"flex flex-col gap-2",children:l?.hasTaskmaster?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-2 p-2 bg-green-50 dark:bg-green-900/30 rounded text-xs text-green-800 dark:text-green-200",children:[n.jsx("strong",{children:"Add more tasks:"})," Create additional tasks manually or generate them from a PRD template"]}),n.jsxs("button",{className:"text-xs px-3 py-2 bg-green-100 dark:bg-green-900 hover:bg-green-200 dark:hover:bg-green-800 text-green-800 dark:text-green-200 rounded transition-colors text-left flex items-center gap-2 disabled:opacity-50",onClick:F,disabled:I,children:[n.jsx(nr,{className:"w-3 h-3"}),"Create a new task manually"]}),n.jsxs("button",{className:"text-xs px-3 py-2 bg-purple-100 dark:bg-purple-900 hover:bg-purple-200 dark:hover:bg-purple-800 text-purple-800 dark:text-purple-200 rounded transition-colors text-left flex items-center gap-2 disabled:opacity-50",onClick:W,disabled:I,children:[n.jsx(mr,{className:"w-3 h-3"}),I?"Parsing...":"Generate tasks from PRD template"]})]}):n.jsxs("button",{className:"text-xs px-3 py-2 bg-slate-100 dark:bg-slate-800 hover:bg-slate-200 dark:hover:bg-slate-700 text-slate-800 dark:text-slate-200 rounded transition-colors text-left flex items-center gap-2",onClick:()=>N(!0),children:[n.jsx(ba,{className:"w-3 h-3"}),"Initialize TaskMaster"]})})]})]});else if(a)M=n.jsx("div",{className:Ue("bg-slate-50 dark:bg-slate-900/30 border border-slate-200 dark:border-slate-700 rounded-lg p-3 mb-4",r),children:n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("div",{className:"w-5 h-5 bg-blue-100 dark:bg-blue-900/50 rounded-full flex items-center justify-center flex-shrink-0",children:n.jsx(z1,{className:"w-3 h-3 text-blue-600 dark:text-blue-400"})}),n.jsxs("span",{className:"text-xs text-slate-600 dark:text-slate-400 font-medium",children:["Task ",a.id]}),a.priority==="high"&&n.jsx("div",{className:"w-4 h-4 rounded bg-red-100 dark:bg-red-900/50 flex items-center justify-center",title:"High Priority",children:n.jsx(Fo,{className:"w-2.5 h-2.5 text-red-600 dark:text-red-400"})}),a.priority==="medium"&&n.jsx("div",{className:"w-4 h-4 rounded bg-amber-100 dark:bg-amber-900/50 flex items-center justify-center",title:"Medium Priority",children:n.jsx(zu,{className:"w-2.5 h-2.5 text-amber-600 dark:text-amber-400"})}),a.priority==="low"&&n.jsx("div",{className:"w-4 h-4 rounded bg-gray-100 dark:bg-gray-800 flex items-center justify-center",title:"Low Priority",children:n.jsx(ma,{className:"w-2.5 h-2.5 text-gray-400 dark:text-gray-500"})})]}),n.jsx("p",{className:"text-sm font-medium text-slate-900 dark:text-slate-100 line-clamp-1",children:a.title})]}),n.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[n.jsxs("button",{onClick:()=>t?.(),className:"text-xs px-3 py-1.5 bg-blue-600 hover:bg-blue-700 text-white rounded-md font-medium transition-colors shadow-sm flex items-center gap-1",children:[n.jsx(h1,{className:"w-3 h-3"}),"Start Task"]}),n.jsx("button",{onClick:()=>U(!0),className:"text-xs px-2 py-1.5 border border-slate-300 dark:border-slate-600 hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-600 dark:text-slate-300 rounded-md transition-colors flex items-center gap-1",title:"View task details",children:n.jsx(os,{className:"w-3 h-3"})}),e&&n.jsx("button",{onClick:e,className:"text-xs px-2 py-1.5 border border-slate-300 dark:border-slate-600 hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-600 dark:text-slate-300 rounded-md transition-colors flex items-center gap-1",title:"View all tasks",children:n.jsx(Qs,{className:"w-3 h-3"})})]})]})});else if(s&&s.length>0){const _=s.filter(V=>V.status==="done").length,O=s.length;M=n.jsx("div",{className:Ue("bg-purple-50 dark:bg-purple-950 border border-purple-200 dark:border-purple-800 rounded-lg p-3 mb-4",r),children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(is,{className:"w-4 h-4 text-purple-600 dark:text-purple-400"}),n.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:_===O?"All done! 🎉":"No pending tasks"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsxs("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:[_,"/",O]}),n.jsx("button",{onClick:e,className:"text-xs px-2 py-1 bg-purple-600 hover:bg-purple-700 text-white rounded transition-colors",children:"Review"})]})]})})}else M=null;return n.jsxs(n.Fragment,{children:[M,x&&n.jsx(_7,{currentProject:i,onClose:()=>y(!1),onTaskCreated:()=>{c(),y(!1)}}),k&&n.jsx(q7,{currentProject:i,onClose:()=>w(!1),onTemplateApplied:()=>{c(),w(!1)}}),j&&n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:n.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700 w-full max-w-4xl h-[600px] flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-blue-100 dark:bg-blue-900/50 rounded-lg flex items-center justify-center",children:n.jsx(ba,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"TaskMaster Setup"}),n.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Interactive CLI for ",i?.displayName]})]})]}),n.jsx("button",{onClick:()=>N(!1),className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800",children:n.jsx(Mt,{className:"w-5 h-5"})})]}),n.jsx("div",{className:"flex-1 p-4",children:n.jsx("div",{className:"h-full bg-black rounded-lg overflow-hidden",children:n.jsx(b0,{selectedProject:i,selectedSession:null,isActive:!0,initialCommand:"npx task-master init",isPlainShell:!0})})}),n.jsx("div",{className:"p-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:"TaskMaster initialization will start automatically"}),n.jsx("button",{onClick:()=>N(!1),className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors",children:"Close"})]})})]})}),L&&a&&n.jsx(vp,{task:a,isOpen:L,onClose:()=>U(!1),onStatusChange:()=>c?.(),onTaskClick:null})]})},_7=({currentProject:e,onClose:t,onTaskCreated:r})=>{const[a,s]=b.useState({title:"",description:"",priority:"medium",useAI:!1,prompt:""}),[i,o]=b.useState(!1),l=async c=>{if(c.preventDefault(),!!e){o(!0);try{const d=a.useAI?{prompt:a.prompt,priority:a.priority}:{title:a.title,description:a.description,priority:a.priority},u=await at.taskmaster.addTask(e.name,d);if(u.ok)r();else{const m=await u.json();console.error("Failed to create task:",m),alert(`Failed to create task: ${m.message}`)}}catch(d){console.error("Error creating task:",d),alert("Error creating task. Please try again.")}finally{o(!1)}}};return n.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 w-full max-w-md",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Create New Task"}),n.jsx("button",{onClick:t,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded",children:n.jsx(Mt,{className:"w-4 h-4"})})]}),n.jsxs("form",{onSubmit:l,className:"space-y-4",children:[n.jsx("div",{children:n.jsxs("label",{className:"flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[n.jsx("input",{type:"checkbox",checked:a.useAI,onChange:c=>s(d=>({...d,useAI:c.target.checked}))}),"Use AI to generate task details"]})}),a.useAI?n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Task Description (AI will generate details)"}),n.jsx("textarea",{value:a.prompt,onChange:c=>s(d=>({...d,prompt:c.target.value})),className:"w-full p-2 border border-gray-300 dark:border-gray-600 rounded focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white",rows:"3",placeholder:"Describe what you want to accomplish...",required:!0})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Task Title"}),n.jsx("input",{type:"text",value:a.title,onChange:c=>s(d=>({...d,title:c.target.value})),className:"w-full p-2 border border-gray-300 dark:border-gray-600 rounded focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white",placeholder:"Enter task title...",required:!0})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Description"}),n.jsx("textarea",{value:a.description,onChange:c=>s(d=>({...d,description:c.target.value})),className:"w-full p-2 border border-gray-300 dark:border-gray-600 rounded focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white",rows:"3",placeholder:"Describe the task...",required:!0})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Priority"}),n.jsxs("select",{value:a.priority,onChange:c=>s(d=>({...d,priority:c.target.value})),className:"w-full p-2 border border-gray-300 dark:border-gray-600 rounded focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white",children:[n.jsx("option",{value:"low",children:"Low"}),n.jsx("option",{value:"medium",children:"Medium"}),n.jsx("option",{value:"high",children:"High"})]})]}),n.jsxs("div",{className:"flex gap-2 pt-4",children:[n.jsx("button",{type:"button",onClick:t,className:"flex-1 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300",disabled:i,children:"Cancel"}),n.jsx("button",{type:"submit",className:"flex-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded disabled:opacity-50",disabled:i||a.useAI&&!a.prompt.trim()||!a.useAI&&(!a.title.trim()||!a.description.trim()),children:i?"Creating...":"Create Task"})]})]})]})})},q7=({currentProject:e,onClose:t,onTemplateApplied:r})=>{const[a,s]=b.useState([]),[i,o]=b.useState(null),[l,c]=b.useState({}),[d,u]=b.useState("prd.txt"),[m,h]=b.useState(!0),[p,x]=b.useState(!1),[y,k]=b.useState("select");useEffect(()=>{(async()=>{try{const L=await at.taskmaster.getTemplates();if(L.ok){const U=await L.json();s(U.templates)}}catch(L){console.error("Error loading templates:",L)}finally{h(!1)}})()},[]);const w=N=>{o(N);const L=N.content.match(/\[([^\]]+)\]/g)||[],U=[...new Set(L.map(H=>H.slice(1,-1)))],I={};U.forEach(H=>{I[H]=""}),c(I),k("customize")},j=async()=>{if(!(!i||!e)){x(!0);try{const N=await at.taskmaster.applyTemplate(e.name,{templateId:i.id,fileName:d,customizations:l});if(!N.ok){const U=await N.json();throw new Error(U.message||"Failed to apply template")}const L=await at.taskmaster.parsePRD(e.name,{fileName:d,numTasks:10});if(!L.ok){const U=await L.json();throw new Error(U.message||"Failed to generate tasks")}k("generate"),setTimeout(()=>{r()},2e3)}catch(N){console.error("Error applying template:",N),alert(`Error: ${N.message}`),x(!1)}}};return m?n.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:n.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 w-full max-w-md",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"}),n.jsx("span",{className:"text-gray-900 dark:text-white",children:"Loading templates..."})]})})}):n.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-6 w-full max-w-2xl max-h-[80vh] overflow-y-auto",children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:y==="select"?"Select PRD Template":y==="customize"?"Customize Template":"Generating Tasks"}),n.jsx("button",{onClick:t,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded",children:n.jsx(Mt,{className:"w-4 h-4"})})]}),y==="select"&&n.jsx("div",{className:"space-y-3",children:a.map(N=>n.jsx("div",{className:"p-4 border border-gray-200 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors",onClick:()=>w(N),children:n.jsxs("div",{className:"flex items-start justify-between",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("h4",{className:"font-medium text-gray-900 dark:text-white",children:N.name}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:N.description}),n.jsx("span",{className:"inline-block text-xs bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 px-2 py-1 rounded mt-2",children:N.category})]}),n.jsx(Ml,{className:"w-4 h-4 text-gray-400 mt-1"})]})},N.id))}),y==="customize"&&i&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"File Name"}),n.jsx("input",{type:"text",value:d,onChange:N=>u(N.target.value),className:"w-full p-2 border border-gray-300 dark:border-gray-600 rounded focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white",placeholder:"prd.txt"})]}),Object.keys(l).length>0&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Customize Template"}),n.jsx("div",{className:"space-y-3",children:Object.entries(l).map(([N,L])=>n.jsxs("div",{children:[n.jsx("label",{className:"block text-xs text-gray-600 dark:text-gray-400 mb-1",children:N.replace(/([A-Z])/g," $1").replace(/^./,U=>U.toUpperCase())}),n.jsx("input",{type:"text",value:L,onChange:U=>c(I=>({...I,[N]:U.target.value})),className:"w-full p-2 border border-gray-300 dark:border-gray-600 rounded text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white",placeholder:`Enter ${N.toLowerCase()}`})]},N))})]}),n.jsxs("div",{className:"flex gap-2 pt-4",children:[n.jsx("button",{onClick:()=>k("select"),className:"flex-1 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300",children:"Back"}),n.jsx("button",{onClick:j,className:"flex-1 px-4 py-2 bg-purple-600 hover:bg-purple-700 text-white rounded disabled:opacity-50",disabled:p,children:p?"Applying...":"Apply & Generate Tasks"})]})]}),y==="generate"&&n.jsxs("div",{className:"text-center py-8",children:[n.jsx("div",{className:"w-16 h-16 bg-green-100 dark:bg-green-900 rounded-full flex items-center justify-center mx-auto mb-4",children:n.jsx(is,{className:"w-8 h-8 text-green-600 dark:text-green-400"})}),n.jsx("h4",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:"Template Applied Successfully!"}),n.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Your PRD has been created and tasks are being generated..."})]})]})})};function H7({status:e,onAbort:t,isLoading:r,provider:a="claude"}){const[s,i]=b.useState(0),[o,l]=b.useState(0),[c,d]=b.useState(0);if(b.useEffect(()=>{if(!r){i(0),d(0);return}const w=Date.now(),j=30+Math.random()*20,N=setInterval(()=>{const L=Math.floor((Date.now()-w)/1e3);i(L),d(Math.floor(L*j))},1e3);return()=>clearInterval(N)},[r]),b.useEffect(()=>{if(!r)return;const w=setInterval(()=>{l(j=>(j+1)%4)},500);return()=>clearInterval(w)},[r]),!r)return null;const u=["Thinking","Processing","Analyzing","Working","Computing","Reasoning"],m=Math.floor(s/3)%u.length,h=e?.text||u[m],p=e?.tokens||c,x=e?.can_interrupt!==!1,k=["✻","✹","✸","✶"][o];return n.jsx("div",{className:"w-full mb-3 sm:mb-6 animate-in slide-in-from-bottom duration-300",children:n.jsxs("div",{className:"flex items-center justify-between max-w-4xl mx-auto bg-gray-800 dark:bg-gray-900 text-white rounded-lg shadow-lg px-2.5 py-2 sm:px-4 sm:py-3 border border-gray-700 dark:border-gray-800",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[n.jsx("span",{className:Ue("text-base sm:text-xl transition-all duration-500 flex-shrink-0",o%2===0?"text-blue-400 scale-110":"text-blue-300"),children:k}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[n.jsxs("span",{className:"font-medium text-xs sm:text-sm truncate",children:[h,"..."]}),n.jsxs("span",{className:"text-gray-400 text-xs sm:text-sm flex-shrink-0",children:["(",s,"s)"]}),p>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-gray-500 hidden sm:inline",children:"·"}),n.jsxs("span",{className:"text-gray-300 text-xs sm:text-sm hidden sm:inline flex-shrink-0",children:["⚒ ",p.toLocaleString()]})]}),n.jsx("span",{className:"text-gray-500 hidden sm:inline",children:"·"}),n.jsx("span",{className:"text-gray-400 text-xs sm:text-sm hidden sm:inline",children:"esc to stop"})]})})]})}),x&&t&&n.jsxs("button",{onClick:t,className:"ml-2 sm:ml-3 text-xs bg-red-600 hover:bg-red-700 active:bg-red-800 text-white px-2 py-1 sm:px-3 sm:py-1.5 rounded-md transition-colors flex items-center gap-1 sm:gap-1.5 flex-shrink-0 font-medium",children:[n.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),n.jsx("span",{className:"hidden sm:inline",children:"Stop"})]})]})})}function U7({used:e,total:t}){if(e==null||t==null||t<=0)return null;const r=Math.min(100,e/t*100),a=10,s=2*Math.PI*a,i=s-r/100*s,o=()=>r<50?"#3b82f6":r<75?"#f59e0b":"#ef4444";return n.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600 dark:text-gray-400",children:[n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",className:"transform -rotate-90",children:[n.jsx("circle",{cx:"12",cy:"12",r:a,fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-gray-300 dark:text-gray-600"}),n.jsx("circle",{cx:"12",cy:"12",r:a,fill:"none",stroke:o(),strokeWidth:"2",strokeDasharray:s,strokeDashoffset:i,strokeLinecap:"round"})]}),n.jsxs("span",{title:`${e.toLocaleString()} / ${t.toLocaleString()} tokens`,children:[r.toFixed(1),"%"]})]})}async function W7(e,t){const r=new FormData,a=`recording_${Date.now()}.webm`,s=new File([e],a,{type:e.type});r.append("audio",s);const i=window.localStorage.getItem("whisperMode")||"default";r.append("mode",i);try{const o=await at.transcribe(r);if(!o.ok){const c=await o.json().catch(()=>({}));throw new Error(c.error||`Transcription error: ${o.status} ${o.statusText}`)}return(await o.json()).text||""}catch(o){throw o.name==="TypeError"&&o.message.includes("fetch")?new Error("Cannot connect to server. Please ensure the backend is running."):o}}function kp({onTranscript:e,className:t=""}){const[r,a]=b.useState("idle"),[s,i]=b.useState(null),[o,l]=b.useState(!0),c=b.useRef(null),d=b.useRef(null),u=b.useRef([]),m=b.useRef(0);b.useEffect(()=>{(()=>{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia){l(!1),i("Microphone not supported. Please use HTTPS or a modern browser.");return}if(location.protocol!=="https:"&&location.hostname!=="localhost"){l(!1),i("Microphone requires HTTPS. Please use a secure connection.");return}l(!0),i(null)})()},[]);const h=async()=>{try{if(console.log("Starting recording..."),i(null),u.current=[],!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new Error("Microphone access not available. Please use HTTPS or a supported browser.");const N=await navigator.mediaDevices.getUserMedia({audio:!0});d.current=N;const L=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"audio/mp4",U=new MediaRecorder(N,{mimeType:L});c.current=U,U.ondataavailable=I=>{I.data.size>0&&u.current.push(I.data)},U.onstop=async()=>{console.log("Recording stopped, creating blob...");const I=new Blob(u.current,{type:L});d.current&&(d.current.getTracks().forEach(M=>M.stop()),d.current=null),a("transcribing");const H=window.localStorage.getItem("whisperMode")||"default",F=H==="prompt"||H==="vibe"||H==="instructions"||H==="architect";let W;F&&(W=setTimeout(()=>{a("processing")},2e3));try{const M=await W7(I);M&&e&&e(M)}catch(M){console.error("Transcription error:",M),i(M.message)}finally{W&&clearTimeout(W),a("idle")}},U.start(),a("recording"),console.log("Recording started successfully")}catch(N){console.error("Failed to start recording:",N);let L="Microphone access failed";N.name==="NotAllowedError"?L="Microphone access denied. Please allow microphone permissions.":N.name==="NotFoundError"?L="No microphone found. Please check your audio devices.":N.name==="NotSupportedError"?L="Microphone not supported by this browser.":N.name==="NotReadableError"?L="Microphone is being used by another application.":N.message.includes("HTTPS")&&(L=N.message),i(L),a("idle")}},p=()=>{console.log("Stopping recording..."),c.current&&c.current.state==="recording"?c.current.stop():(console.log("Recorder not in recording state, forcing cleanup"),d.current&&(d.current.getTracks().forEach(N=>N.stop()),d.current=null),a("idle"))},x=N=>{if(N&&(N.preventDefault(),N.stopPropagation()),!o)return;const L=Date.now();if(L-m.current<300){console.log("Ignoring rapid tap");return}m.current=L,console.log("Button clicked, current state:",r),r==="idle"?h():r==="recording"&&p()};b.useEffect(()=>()=>{d.current&&d.current.getTracks().forEach(N=>N.stop())},[]);const y=()=>{if(!o)return{icon:n.jsx(Us,{className:"w-5 h-5"}),className:"bg-gray-400 cursor-not-allowed",disabled:!0};switch(r){case"recording":return{icon:n.jsx(Us,{className:"w-5 h-5 text-white"}),className:"bg-red-500 hover:bg-red-600 animate-pulse",disabled:!1};case"transcribing":return{icon:n.jsx(zo,{className:"w-5 h-5 animate-spin"}),className:"bg-blue-500 hover:bg-blue-600",disabled:!0};case"processing":return{icon:n.jsx(Eu,{className:"w-5 h-5 animate-pulse"}),className:"bg-purple-500 hover:bg-purple-600",disabled:!0};default:return{icon:n.jsx(Us,{className:"w-5 h-5"}),className:"bg-gray-700 hover:bg-gray-600",disabled:!1}}},{icon:k,className:w,disabled:j}=y();return n.jsxs("div",{className:"relative",children:[n.jsx("button",{type:"button",style:{backgroundColor:r==="recording"?"#ef4444":r==="transcribing"?"#3b82f6":r==="processing"?"#a855f7":"#374151"},className:`
|
|
695
|
-
flex items-center justify-center
|
|
696
|
-
w-12 h-12 rounded-full
|
|
697
|
-
text-white transition-all duration-200
|
|
698
|
-
focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500
|
|
699
|
-
dark:ring-offset-gray-800
|
|
700
|
-
touch-action-manipulation
|
|
701
|
-
${j?"cursor-not-allowed opacity-75":"cursor-pointer"}
|
|
702
|
-
${r==="recording"?"animate-pulse":""}
|
|
703
|
-
hover:opacity-90
|
|
704
|
-
${t}
|
|
705
|
-
`,onClick:x,disabled:j,children:k}),s&&n.jsx("div",{className:`absolute top-full mt-2 left-1/2 transform -translate-x-1/2
|
|
706
|
-
bg-red-500 text-white text-xs px-2 py-1 rounded whitespace-nowrap z-10
|
|
707
|
-
animate-fade-in`,children:s}),r==="recording"&&n.jsx("div",{className:"absolute -inset-1 rounded-full border-2 border-red-500 animate-ping pointer-events-none"}),r==="processing"&&n.jsx("div",{className:"absolute -inset-1 rounded-full border-2 border-purple-500 animate-ping pointer-events-none"})]})}function fn(e){return Array.isArray?Array.isArray(e):Np(e)==="[object Array]"}function V7(e){if(typeof e=="string")return e;let t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function G7(e){return e==null?"":V7(e)}function Kr(e){return typeof e=="string"}function wp(e){return typeof e=="number"}function K7(e){return e===!0||e===!1||J7(e)&&Np(e)=="[object Boolean]"}function jp(e){return typeof e=="object"}function J7(e){return jp(e)&&e!==null}function yr(e){return e!=null}function Mo(e){return!e.trim().length}function Np(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Y7="Incorrect 'index' type",X7=e=>`Invalid value for key ${e}`,Q7=e=>`Pattern length exceeds max of ${e}.`,Z7=e=>`Missing ${e} property in key`,ew=e=>`Property 'weight' in key '${e}' must be a positive integer`,Jd=Object.prototype.hasOwnProperty;class tw{constructor(t){this._keys=[],this._keyMap={};let r=0;t.forEach(a=>{let s=Sp(a);this._keys.push(s),this._keyMap[s.id]=s,r+=s.weight}),this._keys.forEach(a=>{a.weight/=r})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Sp(e){let t=null,r=null,a=null,s=1,i=null;if(Kr(e)||fn(e))a=e,t=Yd(e),r=hl(e);else{if(!Jd.call(e,"name"))throw new Error(Z7("name"));const o=e.name;if(a=o,Jd.call(e,"weight")&&(s=e.weight,s<=0))throw new Error(ew(o));t=Yd(o),r=hl(o),i=e.getFn}return{path:t,id:r,weight:s,src:a,getFn:i}}function Yd(e){return fn(e)?e:e.split(".")}function hl(e){return fn(e)?e.join("."):e}function rw(e,t){let r=[],a=!1;const s=(i,o,l)=>{if(yr(i))if(!o[l])r.push(i);else{let c=o[l];const d=i[c];if(!yr(d))return;if(l===o.length-1&&(Kr(d)||wp(d)||K7(d)))r.push(G7(d));else if(fn(d)){a=!0;for(let u=0,m=d.length;u<m;u+=1)s(d[u],o,l+1)}else o.length&&s(d,o,l+1)}};return s(e,Kr(t)?t.split("."):t,0),a?r:r[0]}const nw={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},aw={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},sw={location:0,threshold:.6,distance:100},iw={useExtendedSearch:!1,getFn:rw,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var et={...aw,...nw,...sw,...iw};const ow=/[^ ]+/g;function lw(e=1,t=3){const r=new Map,a=Math.pow(10,t);return{get(s){const i=s.match(ow).length;if(r.has(i))return r.get(i);const o=1/Math.pow(i,.5*e),l=parseFloat(Math.round(o*a)/a);return r.set(i,l),l},clear(){r.clear()}}}class y0{constructor({getFn:t=et.getFn,fieldNormWeight:r=et.fieldNormWeight}={}){this.norm=lw(r,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((r,a)=>{this._keysMap[r.id]=a})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Kr(this.docs[0])?this.docs.forEach((t,r)=>{this._addString(t,r)}):this.docs.forEach((t,r)=>{this._addObject(t,r)}),this.norm.clear())}add(t){const r=this.size();Kr(t)?this._addString(t,r):this._addObject(t,r)}removeAt(t){this.records.splice(t,1);for(let r=t,a=this.size();r<a;r+=1)this.records[r].i-=1}getValueForItemAtKeyId(t,r){return t[this._keysMap[r]]}size(){return this.records.length}_addString(t,r){if(!yr(t)||Mo(t))return;let a={v:t,i:r,n:this.norm.get(t)};this.records.push(a)}_addObject(t,r){let a={i:r,$:{}};this.keys.forEach((s,i)=>{let o=s.getFn?s.getFn(t):this.getFn(t,s.path);if(yr(o)){if(fn(o)){let l=[];const c=[{nestedArrIndex:-1,value:o}];for(;c.length;){const{nestedArrIndex:d,value:u}=c.pop();if(yr(u))if(Kr(u)&&!Mo(u)){let m={v:u,i:d,n:this.norm.get(u)};l.push(m)}else fn(u)&&u.forEach((m,h)=>{c.push({nestedArrIndex:h,value:m})})}a.$[i]=l}else if(Kr(o)&&!Mo(o)){let l={v:o,n:this.norm.get(o)};a.$[i]=l}}}),this.records.push(a)}toJSON(){return{keys:this.keys,records:this.records}}}function Cp(e,t,{getFn:r=et.getFn,fieldNormWeight:a=et.fieldNormWeight}={}){const s=new y0({getFn:r,fieldNormWeight:a});return s.setKeys(e.map(Sp)),s.setSources(t),s.create(),s}function cw(e,{getFn:t=et.getFn,fieldNormWeight:r=et.fieldNormWeight}={}){const{keys:a,records:s}=e,i=new y0({getFn:t,fieldNormWeight:r});return i.setKeys(a),i.setIndexRecords(s),i}function qs(e,{errors:t=0,currentLocation:r=0,expectedLocation:a=0,distance:s=et.distance,ignoreLocation:i=et.ignoreLocation}={}){const o=t/e.length;if(i)return o;const l=Math.abs(a-r);return s?o+l/s:l?1:o}function dw(e=[],t=et.minMatchCharLength){let r=[],a=-1,s=-1,i=0;for(let o=e.length;i<o;i+=1){let l=e[i];l&&a===-1?a=i:!l&&a!==-1&&(s=i-1,s-a+1>=t&&r.push([a,s]),a=-1)}return e[i-1]&&i-a>=t&&r.push([a,i-1]),r}const Kn=32;function uw(e,t,r,{location:a=et.location,distance:s=et.distance,threshold:i=et.threshold,findAllMatches:o=et.findAllMatches,minMatchCharLength:l=et.minMatchCharLength,includeMatches:c=et.includeMatches,ignoreLocation:d=et.ignoreLocation}={}){if(t.length>Kn)throw new Error(Q7(Kn));const u=t.length,m=e.length,h=Math.max(0,Math.min(a,m));let p=i,x=h;const y=l>1||c,k=y?Array(m):[];let w;for(;(w=e.indexOf(t,x))>-1;){let H=qs(t,{currentLocation:w,expectedLocation:h,distance:s,ignoreLocation:d});if(p=Math.min(H,p),x=w+u,y){let F=0;for(;F<u;)k[w+F]=1,F+=1}}x=-1;let j=[],N=1,L=u+m;const U=1<<u-1;for(let H=0;H<u;H+=1){let F=0,W=L;for(;F<W;)qs(t,{errors:H,currentLocation:h+W,expectedLocation:h,distance:s,ignoreLocation:d})<=p?F=W:L=W,W=Math.floor((L-F)/2+F);L=W;let M=Math.max(1,h-W+1),_=o?m:Math.min(h+W,m)+u,O=Array(_+2);O[_+1]=(1<<H)-1;for(let T=_;T>=M;T-=1){let Y=T-1,ne=r[e.charAt(Y)];if(y&&(k[Y]=+!!ne),O[T]=(O[T+1]<<1|1)&ne,H&&(O[T]|=(j[T+1]|j[T])<<1|1|j[T+1]),O[T]&U&&(N=qs(t,{errors:H,currentLocation:Y,expectedLocation:h,distance:s,ignoreLocation:d}),N<=p)){if(p=N,x=Y,x<=h)break;M=Math.max(1,2*h-x)}}if(qs(t,{errors:H+1,currentLocation:h,expectedLocation:h,distance:s,ignoreLocation:d})>p)break;j=O}const I={isMatch:x>=0,score:Math.max(.001,N)};if(y){const H=dw(k,l);H.length?c&&(I.indices=H):I.isMatch=!1}return I}function mw(e){let t={};for(let r=0,a=e.length;r<a;r+=1){const s=e.charAt(r);t[s]=(t[s]||0)|1<<a-r-1}return t}const mi=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):e=>e;class Mp{constructor(t,{location:r=et.location,threshold:a=et.threshold,distance:s=et.distance,includeMatches:i=et.includeMatches,findAllMatches:o=et.findAllMatches,minMatchCharLength:l=et.minMatchCharLength,isCaseSensitive:c=et.isCaseSensitive,ignoreDiacritics:d=et.ignoreDiacritics,ignoreLocation:u=et.ignoreLocation}={}){if(this.options={location:r,threshold:a,distance:s,includeMatches:i,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:c,ignoreDiacritics:d,ignoreLocation:u},t=c?t:t.toLowerCase(),t=d?mi(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const m=(p,x)=>{this.chunks.push({pattern:p,alphabet:mw(p),startIndex:x})},h=this.pattern.length;if(h>Kn){let p=0;const x=h%Kn,y=h-x;for(;p<y;)m(this.pattern.substr(p,Kn),p),p+=Kn;if(x){const k=h-Kn;m(this.pattern.substr(k),k)}}else m(this.pattern,0)}searchIn(t){const{isCaseSensitive:r,ignoreDiacritics:a,includeMatches:s}=this.options;if(t=r?t:t.toLowerCase(),t=a?mi(t):t,this.pattern===t){let y={isMatch:!0,score:0};return s&&(y.indices=[[0,t.length-1]]),y}const{location:i,distance:o,threshold:l,findAllMatches:c,minMatchCharLength:d,ignoreLocation:u}=this.options;let m=[],h=0,p=!1;this.chunks.forEach(({pattern:y,alphabet:k,startIndex:w})=>{const{isMatch:j,score:N,indices:L}=uw(t,y,k,{location:i+w,distance:o,threshold:l,findAllMatches:c,minMatchCharLength:d,includeMatches:s,ignoreLocation:u});j&&(p=!0),h+=N,j&&L&&(m=[...m,...L])});let x={isMatch:p,score:p?h/this.chunks.length:1};return p&&s&&(x.indices=m),x}}class Bn{constructor(t){this.pattern=t}static isMultiMatch(t){return Xd(t,this.multiRegex)}static isSingleMatch(t){return Xd(t,this.singleRegex)}search(){}}function Xd(e,t){const r=e.match(t);return r?r[1]:null}class hw extends Bn{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const r=t===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class pw extends Bn{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const a=t.indexOf(this.pattern)===-1;return{isMatch:a,score:a?0:1,indices:[0,t.length-1]}}}class fw extends Bn{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const r=t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class gw extends Bn{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const r=!t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class xw extends Bn{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const r=t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class bw extends Bn{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const r=!t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class Ap extends Bn{constructor(t,{location:r=et.location,threshold:a=et.threshold,distance:s=et.distance,includeMatches:i=et.includeMatches,findAllMatches:o=et.findAllMatches,minMatchCharLength:l=et.minMatchCharLength,isCaseSensitive:c=et.isCaseSensitive,ignoreDiacritics:d=et.ignoreDiacritics,ignoreLocation:u=et.ignoreLocation}={}){super(t),this._bitapSearch=new Mp(t,{location:r,threshold:a,distance:s,includeMatches:i,findAllMatches:o,minMatchCharLength:l,isCaseSensitive:c,ignoreDiacritics:d,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Tp extends Bn{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let r=0,a;const s=[],i=this.pattern.length;for(;(a=t.indexOf(this.pattern,r))>-1;)r=a+i,s.push([a,r-1]);const o=!!s.length;return{isMatch:o,score:o?0:1,indices:s}}}const pl=[hw,Tp,fw,gw,bw,xw,pw,Ap],Qd=pl.length,yw=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,vw="|";function kw(e,t={}){return e.split(vw).map(r=>{let a=r.trim().split(yw).filter(i=>i&&!!i.trim()),s=[];for(let i=0,o=a.length;i<o;i+=1){const l=a[i];let c=!1,d=-1;for(;!c&&++d<Qd;){const u=pl[d];let m=u.isMultiMatch(l);m&&(s.push(new u(m,t)),c=!0)}if(!c)for(d=-1;++d<Qd;){const u=pl[d];let m=u.isSingleMatch(l);if(m){s.push(new u(m,t));break}}}return s})}const ww=new Set([Ap.type,Tp.type]);class jw{constructor(t,{isCaseSensitive:r=et.isCaseSensitive,ignoreDiacritics:a=et.ignoreDiacritics,includeMatches:s=et.includeMatches,minMatchCharLength:i=et.minMatchCharLength,ignoreLocation:o=et.ignoreLocation,findAllMatches:l=et.findAllMatches,location:c=et.location,threshold:d=et.threshold,distance:u=et.distance}={}){this.query=null,this.options={isCaseSensitive:r,ignoreDiacritics:a,includeMatches:s,minMatchCharLength:i,findAllMatches:l,ignoreLocation:o,location:c,threshold:d,distance:u},t=r?t:t.toLowerCase(),t=a?mi(t):t,this.pattern=t,this.query=kw(this.pattern,this.options)}static condition(t,r){return r.useExtendedSearch}searchIn(t){const r=this.query;if(!r)return{isMatch:!1,score:1};const{includeMatches:a,isCaseSensitive:s,ignoreDiacritics:i}=this.options;t=s?t:t.toLowerCase(),t=i?mi(t):t;let o=0,l=[],c=0;for(let d=0,u=r.length;d<u;d+=1){const m=r[d];l.length=0,o=0;for(let h=0,p=m.length;h<p;h+=1){const x=m[h],{isMatch:y,indices:k,score:w}=x.search(t);if(y){if(o+=1,c+=w,a){const j=x.constructor.type;ww.has(j)?l=[...l,...k]:l.push(k)}}else{c=0,o=0,l.length=0;break}}if(o){let h={isMatch:!0,score:c/o};return a&&(h.indices=l),h}}return{isMatch:!1,score:1}}}const fl=[];function Nw(...e){fl.push(...e)}function gl(e,t){for(let r=0,a=fl.length;r<a;r+=1){let s=fl[r];if(s.condition(e,t))return new s(e,t)}return new Mp(e,t)}const hi={AND:"$and",OR:"$or"},xl={PATH:"$path",PATTERN:"$val"},bl=e=>!!(e[hi.AND]||e[hi.OR]),Sw=e=>!!e[xl.PATH],Cw=e=>!fn(e)&&jp(e)&&!bl(e),Zd=e=>({[hi.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Ep(e,t,{auto:r=!0}={}){const a=s=>{let i=Object.keys(s);const o=Sw(s);if(!o&&i.length>1&&!bl(s))return a(Zd(s));if(Cw(s)){const c=o?s[xl.PATH]:i[0],d=o?s[xl.PATTERN]:s[c];if(!Kr(d))throw new Error(X7(c));const u={keyId:hl(c),pattern:d};return r&&(u.searcher=gl(d,t)),u}let l={children:[],operator:i[0]};return i.forEach(c=>{const d=s[c];fn(d)&&d.forEach(u=>{l.children.push(a(u))})}),l};return bl(e)||(e=Zd(e)),a(e)}function Mw(e,{ignoreFieldNorm:t=et.ignoreFieldNorm}){e.forEach(r=>{let a=1;r.matches.forEach(({key:s,norm:i,score:o})=>{const l=s?s.weight:null;a*=Math.pow(o===0&&l?Number.EPSILON:o,(l||1)*(t?1:i))}),r.score=a})}function Aw(e,t){const r=e.matches;t.matches=[],yr(r)&&r.forEach(a=>{if(!yr(a.indices)||!a.indices.length)return;const{indices:s,value:i}=a;let o={indices:s,value:i};a.key&&(o.key=a.key.src),a.idx>-1&&(o.refIndex=a.idx),t.matches.push(o)})}function Tw(e,t){t.score=e.score}function Ew(e,t,{includeMatches:r=et.includeMatches,includeScore:a=et.includeScore}={}){const s=[];return r&&s.push(Aw),a&&s.push(Tw),e.map(i=>{const{idx:o}=i,l={item:t[o],refIndex:o};return s.length&&s.forEach(c=>{c(i,l)}),l})}class Ia{constructor(t,r={},a){this.options={...et,...r},this.options.useExtendedSearch,this._keyStore=new tw(this.options.keys),this.setCollection(t,a)}setCollection(t,r){if(this._docs=t,r&&!(r instanceof y0))throw new Error(Y7);this._myIndex=r||Cp(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){yr(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const r=[];for(let a=0,s=this._docs.length;a<s;a+=1){const i=this._docs[a];t(i,a)&&(this.removeAt(a),a-=1,s-=1,r.push(i))}return r}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:r=-1}={}){const{includeMatches:a,includeScore:s,shouldSort:i,sortFn:o,ignoreFieldNorm:l}=this.options;let c=Kr(t)?Kr(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return Mw(c,{ignoreFieldNorm:l}),i&&c.sort(o),wp(r)&&r>-1&&(c=c.slice(0,r)),Ew(c,this._docs,{includeMatches:a,includeScore:s})}_searchStringList(t){const r=gl(t,this.options),{records:a}=this._myIndex,s=[];return a.forEach(({v:i,i:o,n:l})=>{if(!yr(i))return;const{isMatch:c,score:d,indices:u}=r.searchIn(i);c&&s.push({item:i,idx:o,matches:[{score:d,value:i,norm:l,indices:u}]})}),s}_searchLogical(t){const r=Ep(t,this.options),a=(l,c,d)=>{if(!l.children){const{keyId:m,searcher:h}=l,p=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(c,m),searcher:h});return p&&p.length?[{idx:d,item:c,matches:p}]:[]}const u=[];for(let m=0,h=l.children.length;m<h;m+=1){const p=l.children[m],x=a(p,c,d);if(x.length)u.push(...x);else if(l.operator===hi.AND)return[]}return u},s=this._myIndex.records,i={},o=[];return s.forEach(({$:l,i:c})=>{if(yr(l)){let d=a(r,l,c);d.length&&(i[c]||(i[c]={idx:c,item:l,matches:[]},o.push(i[c])),d.forEach(({matches:u})=>{i[c].matches.push(...u)}))}}),o}_searchObjectList(t){const r=gl(t,this.options),{keys:a,records:s}=this._myIndex,i=[];return s.forEach(({$:o,i:l})=>{if(!yr(o))return;let c=[];a.forEach((d,u)=>{c.push(...this._findMatches({key:d,value:o[u],searcher:r}))}),c.length&&i.push({idx:l,item:o,matches:c})}),i}_findMatches({key:t,value:r,searcher:a}){if(!yr(r))return[];let s=[];if(fn(r))r.forEach(({v:i,i:o,n:l})=>{if(!yr(i))return;const{isMatch:c,score:d,indices:u}=a.searchIn(i);c&&s.push({score:d,key:t,value:i,idx:o,norm:l,indices:u})});else{const{v:i,n:o}=r,{isMatch:l,score:c,indices:d}=a.searchIn(i);l&&s.push({score:c,key:t,value:i,norm:o,indices:d})}return s}}Ia.version="7.1.0";Ia.createIndex=Cp;Ia.parseIndex=cw;Ia.config=et;Ia.parseQuery=Ep;Nw(jw);const Iw=({commands:e=[],selectedIndex:t=-1,onSelect:r,onClose:a,position:s={top:0,left:0},isOpen:i=!1,frequentCommands:o=[]})=>{const l=b.useRef(null),c=b.useRef(null),u=(()=>{const j=window.innerWidth<640,N=window.innerHeight;return j?{position:"fixed",bottom:`${s.bottom||90}px`,left:"16px",right:"16px",width:"auto",maxWidth:"calc(100vw - 32px)",maxHeight:"min(50vh, 300px)"}:{position:"fixed",top:`${Math.max(16,Math.min(s.top,N-316))}px`,left:`${s.left}px`,width:"min(400px, calc(100vw - 32px))",maxWidth:"calc(100vw - 32px)",maxHeight:"300px"}})();if(b.useEffect(()=>{const j=N=>{l.current&&!l.current.contains(N.target)&&i&&a()};if(i)return document.addEventListener("mousedown",j),()=>{document.removeEventListener("mousedown",j)}},[i,a]),b.useEffect(()=>{if(c.current&&l.current){const j=l.current.getBoundingClientRect(),N=c.current.getBoundingClientRect();N.bottom>j.bottom?c.current.scrollIntoView({block:"nearest",behavior:"smooth"}):N.top<j.top&&c.current.scrollIntoView({block:"nearest",behavior:"smooth"})}},[t]),!i)return null;if(e.length===0)return n.jsx("div",{ref:l,className:"command-menu command-menu-empty",style:{...u,maxHeight:"300px",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",zIndex:1e3,padding:"20px",opacity:1,transform:"translateY(0)",transition:"opacity 150ms ease-in-out, transform 150ms ease-in-out",textAlign:"center"},children:"No commands available"});const m=o.length>0,h=e.reduce((j,N)=>{const L=N.namespace||N.type||"other";return j[L]||(j[L]=[]),j[L].push(N),j},{});m&&(h.frequent=o);const x=(m?["frequent","builtin","project","user","other"]:["builtin","project","user","other"]).filter(j=>h[j]),y={frequent:"⭐ Frequently Used",builtin:"Built-in Commands",project:"Project Commands",user:"User Commands",other:"Other Commands"};let k=0;const w=[];return x.forEach(j=>{h[j].forEach(N=>{w.push({...N,globalIndex:k++,namespace:j})})}),n.jsxs("div",{ref:l,role:"listbox","aria-label":"Available commands",className:"command-menu",style:{...u,maxHeight:"300px",overflowY:"auto",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",zIndex:1e3,padding:"8px",opacity:i?1:0,transform:i?"translateY(0)":"translateY(-10px)",transition:"opacity 150ms ease-in-out, transform 150ms ease-in-out"},children:[x.map(j=>n.jsxs("div",{className:"command-group",children:[x.length>1&&n.jsx("div",{style:{fontSize:"11px",fontWeight:600,textTransform:"uppercase",color:"#6b7280",padding:"8px 12px 4px",letterSpacing:"0.05em"},children:y[j]||j}),h[j].map(N=>{const L=w.find(I=>I.name===N.name&&I.namespace===j),U=L&&L.globalIndex===t;return n.jsxs("div",{ref:U?c:null,role:"option","aria-selected":U,className:"command-item",onMouseEnter:()=>r&&r(N,L.globalIndex,!0),onClick:()=>r&&r(N,L.globalIndex,!1),style:{display:"flex",alignItems:"flex-start",padding:"10px 12px",borderRadius:"6px",cursor:"pointer",backgroundColor:U?"#eff6ff":"transparent",transition:"background-color 100ms ease-in-out",marginBottom:"2px"},onMouseDown:I=>I.preventDefault(),children:[n.jsxs("div",{style:{flex:1,minWidth:0},children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:N.description?"4px":0},children:[n.jsxs("span",{style:{fontSize:"16px",flexShrink:0},children:[j==="builtin"&&"⚡",j==="project"&&"📁",j==="user"&&"👤",j==="other"&&"📝"]}),n.jsx("span",{style:{fontWeight:600,fontSize:"14px",color:"#111827",fontFamily:"monospace"},children:N.name}),N.metadata?.type&&n.jsx("span",{className:"command-metadata-badge",style:{fontSize:"10px",padding:"2px 6px",borderRadius:"4px",backgroundColor:"#f3f4f6",color:"#6b7280",fontWeight:500},children:N.metadata.type})]}),N.description&&n.jsx("div",{style:{fontSize:"13px",color:"#6b7280",marginLeft:"24px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:N.description})]}),U&&n.jsx("span",{style:{marginLeft:"8px",color:"#3b82f6",fontSize:"12px",fontWeight:600},children:"↵"})]},`${j}-${N.name}`)})]},j)),n.jsx("style",{children:`
|
|
708
|
-
.command-menu {
|
|
709
|
-
background-color: white;
|
|
710
|
-
border: 1px solid #e5e7eb;
|
|
711
|
-
}
|
|
712
|
-
.command-menu-empty {
|
|
713
|
-
color: #6b7280;
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
@media (prefers-color-scheme: dark) {
|
|
717
|
-
.command-menu {
|
|
718
|
-
background-color: #1f2937 !important;
|
|
719
|
-
border: 1px solid #374151 !important;
|
|
720
|
-
}
|
|
721
|
-
.command-menu-empty {
|
|
722
|
-
color: #9ca3af !important;
|
|
723
|
-
}
|
|
724
|
-
.command-item[aria-selected="true"] {
|
|
725
|
-
background-color: #1e40af !important;
|
|
726
|
-
}
|
|
727
|
-
.command-item span:not(.command-metadata-badge) {
|
|
728
|
-
color: #f3f4f6 !important;
|
|
729
|
-
}
|
|
730
|
-
.command-metadata-badge {
|
|
731
|
-
background-color: #f3f4f6 !important;
|
|
732
|
-
color: #6b7280 !important;
|
|
733
|
-
}
|
|
734
|
-
.command-item div {
|
|
735
|
-
color: #d1d5db !important;
|
|
736
|
-
}
|
|
737
|
-
.command-group > div:first-child {
|
|
738
|
-
color: #9ca3af !important;
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
`})]})};function Mn(e){return e&&e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function Dw(e){if(!e||typeof e!="string")return e;try{return e.replace(/```\s*([^\n\r]+?)\s*```/g,"`$1`")}catch{return e}}function Ao(e){if(!e||typeof e!="string")return e;const t=[],r="__MATH_BLOCK_",a="__";let s=e.replace(/\$\$([\s\S]*?)\$\$|\$([^\$\n]+?)\$/g,i=>{const o=t.length;return t.push(i),`${r}${o}${a}`});return s=s.replace(/\\n/g,`
|
|
742
|
-
`).replace(/\\t/g," ").replace(/\\r/g,"\r"),s=s.replace(new RegExp(`${r}(\\d+)${a}`,"g"),(i,o)=>t[parseInt(o)]),s}const $a=({children:e,className:t})=>{const r=Dw(String(e??"")),a=b.useMemo(()=>[K5,ak],[]),s=b.useMemo(()=>[Rk],[]);return n.jsx("div",{className:t,children:n.jsx(Ry,{remarkPlugins:a,rehypePlugins:s,components:zw,children:r})})};function yl(e){try{return typeof e!="string"?e:e.replace(/Claude AI usage limit reached\|(\d{10,13})/g,(t,r)=>{let a=parseInt(r,10);if(!Number.isFinite(a))return t;a<1e12&&(a*=1e3);const s=new Date(a),i=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1}).format(s),o=-s.getTimezoneOffset(),l=o>=0?"+":"-",c=Math.abs(o),d=Math.floor(c/60),u=c%60,m=`GMT${l}${d}${u?":"+String(u).padStart(2,"0"):""}`,x=((Intl.DateTimeFormat().resolvedOptions().timeZone||"").split("/").pop()||"").replace(/_/g," ").toLowerCase().replace(/\b\w/g,j=>j.toUpperCase()),y=x?`${m} (${x})`:m,k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],w=`${s.getDate()} ${k[s.getMonth()]} ${s.getFullYear()}`;return`Claude usage limit reached. Your limit will reset at **${i} ${y}** - ${w}`})}catch{return e}}const cr={setItem:(e,t)=>{try{if(e.startsWith("chat_messages_")&&typeof t=="string")try{const r=JSON.parse(t);if(Array.isArray(r)&&r.length>50){console.warn(`Truncating chat history for ${e} from ${r.length} to 50 messages`);const a=r.slice(-50);t=JSON.stringify(a)}}catch(r){console.warn("Could not parse chat messages for truncation:",r)}localStorage.setItem(e,t)}catch(r){if(r.name==="QuotaExceededError"){console.warn("localStorage quota exceeded, clearing old data");const a=Object.keys(localStorage),s=a.filter(o=>o.startsWith("chat_messages_")).sort();s.length>3&&s.slice(0,s.length-3).forEach(o=>{localStorage.removeItem(o),console.log(`Removed old chat data: ${o}`)}),a.filter(o=>o.startsWith("draft_input_")).forEach(o=>{localStorage.removeItem(o)});try{localStorage.setItem(e,t)}catch(o){if(console.error("Failed to save to localStorage even after cleanup:",o),e.startsWith("chat_messages_")&&typeof t=="string")try{const l=JSON.parse(t);if(Array.isArray(l)&&l.length>10){const c=l.slice(-10);localStorage.setItem(e,JSON.stringify(c)),console.warn("Saved only last 10 messages due to quota constraints")}}catch(l){console.error("Final save attempt failed:",l)}}}else console.error("localStorage error:",r)}},getItem:e=>{try{return localStorage.getItem(e)}catch(t){return console.error("localStorage getItem error:",t),null}},removeItem:e=>{try{localStorage.removeItem(e)}catch(t){console.error("localStorage removeItem error:",t)}}},zw={code:({node:e,inline:t,className:r,children:a,...s})=>{const[i,o]=Jr.useState(!1),l=Array.isArray(a)?a.join(""):String(a??""),c=/[\r\n]/.test(l);if(t||e&&e.type==="inlineCode"||!c)return n.jsx("code",{className:`font-mono text-[0.9em] px-1.5 py-0.5 rounded-md bg-gray-100 text-gray-900 border border-gray-200 dark:bg-gray-800/60 dark:text-gray-100 dark:border-gray-700 whitespace-pre-wrap break-words ${r||""}`,...s,children:a});const m=l,h=()=>{const p=()=>{o(!0),setTimeout(()=>o(!1),1500)};try{if(navigator&&navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(m).then(p).catch(()=>{const x=document.createElement("textarea");x.value=m,x.style.position="fixed",x.style.opacity="0",document.body.appendChild(x),x.select();try{document.execCommand("copy")}catch{}document.body.removeChild(x),p()});else{const x=document.createElement("textarea");x.value=m,x.style.position="fixed",x.style.opacity="0",document.body.appendChild(x),x.select();try{document.execCommand("copy")}catch{}document.body.removeChild(x),p()}}catch{}};return n.jsxs("div",{className:"relative group my-2",children:[n.jsx("button",{type:"button",onClick:h,className:"absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-100 focus:opacity-100 active:opacity-100 transition-opacity text-xs px-2 py-1 rounded-md bg-gray-700/80 hover:bg-gray-700 text-white border border-gray-600",title:i?"Copied":"Copy code","aria-label":i?"Copied":"Copy code",children:i?n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Copied"]}):n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsxs("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),n.jsx("path",{d:"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"})]}),"Copy"]})}),n.jsx("pre",{className:"bg-gray-900 dark:bg-gray-900 border border-gray-700/40 rounded-lg p-3 overflow-x-auto",children:n.jsx("code",{className:`text-gray-100 dark:text-gray-100 text-sm font-mono ${r||""}`,...s,children:a})})]})},blockquote:({children:e})=>n.jsx("blockquote",{className:"border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic text-gray-600 dark:text-gray-400 my-2",children:e}),a:({href:e,children:t})=>n.jsx("a",{href:e,className:"text-blue-600 dark:text-blue-400 hover:underline",target:"_blank",rel:"noopener noreferrer",children:t}),p:({children:e})=>n.jsx("div",{className:"mb-2 last:mb-0",children:e}),table:({children:e})=>n.jsx("div",{className:"overflow-x-auto my-2",children:n.jsx("table",{className:"min-w-full border-collapse border border-gray-200 dark:border-gray-700",children:e})}),thead:({children:e})=>n.jsx("thead",{className:"bg-gray-50 dark:bg-gray-800",children:e}),th:({children:e})=>n.jsx("th",{className:"px-3 py-2 text-left text-sm font-semibold border border-gray-200 dark:border-gray-700",children:e}),td:({children:e})=>n.jsx("td",{className:"px-3 py-2 align-top text-sm border border-gray-200 dark:border-gray-700",children:e})},Lw=b.memo(({message:e,index:t,prevMessage:r,createDiff:a,onFileOpen:s,onShowSettings:i,autoExpandTools:o,showRawParameters:l,showThinking:c,selectedProject:d})=>{const u=r&&r.type===e.type&&(r.type==="assistant"||r.type==="user"||r.type==="tool"||r.type==="error"),m=Jr.useRef(null),[h,p]=Jr.useState(!1);return Jr.useEffect(()=>{if(!o||!m.current||!e.isToolUse)return;const x=new IntersectionObserver(y=>{y.forEach(k=>{k.isIntersecting&&!h&&(p(!0),m.current.querySelectorAll("details").forEach(j=>{j.open=!0}))})},{threshold:.1});return x.observe(m.current),()=>{m.current&&x.unobserve(m.current)}},[o,h,e.isToolUse]),n.jsx("div",{ref:m,className:`chat-message ${e.type} ${u?"grouped":""} ${e.type==="user"?"flex justify-end px-3 sm:px-0":"px-3 sm:px-0"}`,children:e.type==="user"?n.jsxs("div",{className:"flex items-end space-x-0 sm:space-x-3 w-full sm:w-auto sm:max-w-[85%] md:max-w-md lg:max-w-lg xl:max-w-xl",children:[n.jsxs("div",{className:"bg-blue-600 text-white rounded-2xl rounded-br-md px-3 sm:px-4 py-2 shadow-sm flex-1 sm:flex-initial",children:[n.jsx("div",{className:"text-sm whitespace-pre-wrap break-words",children:e.content}),e.images&&e.images.length>0&&n.jsx("div",{className:"mt-2 grid grid-cols-2 gap-2",children:e.images.map((x,y)=>n.jsx("img",{src:x.data,alt:x.name,className:"rounded-lg max-w-full h-auto cursor-pointer hover:opacity-90 transition-opacity",onClick:()=>window.open(x.data,"_blank")},y))}),n.jsx("div",{className:"text-xs text-blue-100 mt-1 text-right",children:new Date(e.timestamp).toLocaleTimeString()})]}),!u&&n.jsx("div",{className:"hidden sm:flex w-8 h-8 bg-blue-600 rounded-full items-center justify-center text-white text-sm flex-shrink-0",children:"U"})]}):n.jsxs("div",{className:"w-full",children:[!u&&n.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[e.type==="error"?n.jsx("div",{className:"w-8 h-8 bg-red-600 rounded-full flex items-center justify-center text-white text-sm flex-shrink-0",children:"!"}):e.type==="tool"?n.jsx("div",{className:"w-8 h-8 bg-gray-600 dark:bg-gray-700 rounded-full flex items-center justify-center text-white text-sm flex-shrink-0",children:"🔧"}):n.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-sm flex-shrink-0 p-1",children:(localStorage.getItem("selected-provider")||"claude")==="cursor"?n.jsx(on,{className:"w-full h-full"}):n.jsx(Wr,{className:"w-full h-full"})}),n.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:e.type==="error"?"Error":e.type==="tool"?"Tool":(localStorage.getItem("selected-provider")||"claude")==="cursor"?"Cursor":"Claude"})]}),n.jsxs("div",{className:"w-full",children:[e.isToolUse&&!["Read","TodoWrite","TodoRead"].includes(e.toolName)?["Grep","Glob"].includes(e.toolName)?n.jsx(n.Fragment,{children:n.jsx("div",{className:"group relative bg-gray-50/50 dark:bg-gray-800/30 border-l-2 border-blue-400 dark:border-blue-500 pl-3 py-2 my-2",children:n.jsxs("div",{className:"flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600 dark:text-gray-400 flex-1 min-w-0",children:[n.jsx("svg",{className:"w-3.5 h-3.5 text-blue-500 dark:text-blue-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),n.jsx("span",{className:"font-medium flex-shrink-0",children:e.toolName}),n.jsx("span",{className:"text-gray-400 dark:text-gray-500 flex-shrink-0",children:"•"}),e.toolInput&&(()=>{try{const y=JSON.parse(e.toolInput);return n.jsxs("span",{className:"font-mono truncate flex-1 min-w-0",children:[y.pattern&&n.jsxs("span",{children:["pattern: ",n.jsx("span",{className:"text-blue-600 dark:text-blue-400",children:y.pattern})]}),y.path&&n.jsxs("span",{className:"ml-2",children:["in: ",y.path]})]})}catch{return null}})()]}),e.toolResult&&n.jsxs("a",{href:`#tool-result-${e.toolId}`,className:"flex-shrink-0 text-xs text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium transition-colors flex items-center gap-1",children:[n.jsx("span",{children:"results"}),n.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})})}):n.jsxs("div",{className:"group relative bg-gradient-to-br from-blue-50/50 to-indigo-50/50 dark:from-blue-950/20 dark:to-indigo-950/20 border border-blue-100/30 dark:border-blue-800/30 rounded-lg p-3 mb-2",children:[n.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-500/3 to-indigo-500/3 dark:from-blue-400/3 dark:to-indigo-400/3 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),n.jsxs("div",{className:"relative flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"relative w-8 h-8 bg-gradient-to-br from-blue-500 to-indigo-600 dark:from-blue-400 dark:to-indigo-500 rounded-lg flex items-center justify-center shadow-lg shadow-blue-500/20 dark:shadow-blue-400/20",children:[n.jsxs("svg",{className:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),n.jsx("div",{className:"absolute inset-0 rounded-lg bg-blue-500 dark:bg-blue-400 animate-pulse opacity-20"})]}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"font-semibold text-gray-900 dark:text-white text-sm",children:e.toolName}),n.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 font-mono",children:e.toolId})]})]}),i&&n.jsx("button",{onClick:y=>{y.stopPropagation(),i()},className:"p-2 rounded-lg hover:bg-white/60 dark:hover:bg-gray-800/60 transition-all duration-200 group/btn backdrop-blur-sm",title:"Tool Settings",children:n.jsxs("svg",{className:"w-4 h-4 text-gray-600 dark:text-gray-400 group-hover/btn:text-blue-600 dark:group-hover/btn:text-blue-400 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})})]}),e.toolInput&&e.toolName==="Edit"&&(()=>{try{const y=JSON.parse(e.toolInput);if(y.file_path&&y.old_string&&y.new_string)return n.jsxs("details",{className:"relative mt-3 group/details",open:o,children:[n.jsxs("summary",{className:"flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 p-2.5 rounded-lg hover:bg-white/50 dark:hover:bg-gray-800/50",children:[n.jsx("svg",{className:"w-4 h-4 transition-transform duration-200 group-open/details:rotate-180",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),n.jsx("span",{className:"flex items-center gap-2",children:n.jsx("span",{children:"View edit diff for"})}),n.jsx("button",{onClick:async k=>{if(k.preventDefault(),k.stopPropagation(),!!s)try{const w=await at.readFile(d?.name,y.file_path),j=await w.json();if(!w.ok||j.error){console.error("Failed to fetch file:",j.error),s(y.file_path);return}const N=j.content||"",L=N.replace(y.new_string,y.old_string);s(y.file_path,{old_string:L,new_string:N})}catch(w){console.error("Error preparing diff:",w),s(y.file_path)}},className:"px-2.5 py-1 rounded-md bg-white/60 dark:bg-gray-800/60 text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/30 font-mono text-xs font-medium transition-all duration-200 shadow-sm",children:y.file_path.split("/").pop()})]}),n.jsxs("div",{className:"mt-3 pl-6",children:[n.jsxs("div",{className:"bg-white dark:bg-gray-900/50 border border-gray-200/60 dark:border-gray-700/60 rounded-lg overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-gradient-to-r from-gray-50 to-gray-100/50 dark:from-gray-800/80 dark:to-gray-800/40 border-b border-gray-200/60 dark:border-gray-700/60 backdrop-blur-sm",children:[n.jsx("button",{onClick:async()=>{if(s)try{const k=await at.readFile(d?.name,y.file_path),w=await k.json();if(!k.ok||w.error){console.error("Failed to fetch file:",w.error),s(y.file_path);return}const j=w.content||"",N=j.replace(y.new_string,y.old_string);s(y.file_path,{old_string:N,new_string:j})}catch(k){console.error("Error preparing diff:",k),s(y.file_path)}},className:"text-xs font-mono text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 truncate cursor-pointer font-medium transition-colors",children:y.file_path}),n.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 font-medium px-2 py-0.5 bg-gray-100 dark:bg-gray-700/50 rounded",children:"Diff"})]}),n.jsx("div",{className:"text-xs font-mono",children:a(y.old_string,y.new_string).map((k,w)=>n.jsxs("div",{className:"flex",children:[n.jsx("span",{className:`w-8 text-center border-r ${k.type==="removed"?"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 border-red-200 dark:border-red-800":"bg-green-50 dark:bg-green-900/20 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800"}`,children:k.type==="removed"?"-":"+"}),n.jsx("span",{className:`px-2 py-0.5 flex-1 whitespace-pre-wrap ${k.type==="removed"?"bg-red-50 dark:bg-red-900/20 text-red-800 dark:text-red-200":"bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200"}`,children:k.content})]},w))})]}),l&&n.jsxs("details",{className:"relative mt-3 pl-6 group/raw",open:o,children:[n.jsxs("summary",{className:"flex items-center gap-2 text-xs font-medium text-gray-600 dark:text-gray-400 cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 p-2 rounded-lg hover:bg-white/50 dark:hover:bg-gray-800/50",children:[n.jsx("svg",{className:"w-3 h-3 transition-transform duration-200 group-open/raw:rotate-180",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),"View raw parameters"]}),n.jsx("pre",{className:"mt-2 text-xs bg-gray-50 dark:bg-gray-800/50 border border-gray-200/60 dark:border-gray-700/60 p-3 rounded-lg whitespace-pre-wrap break-words overflow-hidden text-gray-700 dark:text-gray-300 font-mono",children:e.toolInput})]})]})]})}catch{}return n.jsxs("details",{className:"relative mt-3 group/params",open:o,children:[n.jsxs("summary",{className:"flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 p-2.5 rounded-lg hover:bg-white/50 dark:hover:bg-gray-800/50",children:[n.jsx("svg",{className:"w-4 h-4 transition-transform duration-200 group-open/params:rotate-180",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),"View input parameters"]}),n.jsx("pre",{className:"mt-3 text-xs bg-gray-50 dark:bg-gray-800/50 border border-gray-200/60 dark:border-gray-700/60 p-3 rounded-lg whitespace-pre-wrap break-words overflow-hidden text-gray-700 dark:text-gray-300 font-mono",children:e.toolInput})]})})(),e.toolInput&&e.toolName!=="Edit"&&(()=>{if(e.toolName==="Write")try{let y;if(typeof e.toolInput=="string"?y=JSON.parse(e.toolInput):y=e.toolInput,y.file_path&&y.content!==void 0)return n.jsxs("details",{className:"relative mt-3 group/details",open:o,children:[n.jsxs("summary",{className:"flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 p-2.5 rounded-lg hover:bg-white/50 dark:hover:bg-gray-800/50",children:[n.jsx("svg",{className:"w-4 h-4 transition-transform duration-200 group-open/details:rotate-180",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-lg leading-none",children:"📄"}),n.jsx("span",{children:"Creating new file:"})]}),n.jsx("button",{onClick:async k=>{if(k.preventDefault(),k.stopPropagation(),!!s)try{const w=await at.readFile(d?.name,y.file_path),j=await w.json(),N=w.ok&&!j.error?j.content||"":y.content||"";s(y.file_path,{old_string:"",new_string:N})}catch(w){console.error("Error preparing diff:",w),s(y.file_path,{old_string:"",new_string:y.content||""})}},className:"px-2.5 py-1 rounded-md bg-white/60 dark:bg-gray-800/60 text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/30 font-mono text-xs font-medium transition-all duration-200 shadow-sm",children:y.file_path.split("/").pop()})]}),n.jsxs("div",{className:"mt-3 pl-6",children:[n.jsxs("div",{className:"bg-white dark:bg-gray-900/50 border border-gray-200/60 dark:border-gray-700/60 rounded-lg overflow-hidden shadow-sm",children:[n.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-gradient-to-r from-gray-50 to-gray-100/50 dark:from-gray-800/80 dark:to-gray-800/40 border-b border-gray-200/60 dark:border-gray-700/60 backdrop-blur-sm",children:[n.jsx("button",{onClick:async()=>{if(s)try{const k=await at.readFile(d?.name,y.file_path),w=await k.json(),j=k.ok&&!w.error?w.content||"":y.content||"";s(y.file_path,{old_string:"",new_string:j})}catch(k){console.error("Error preparing diff:",k),s(y.file_path,{old_string:"",new_string:y.content||""})}},className:"text-xs font-mono text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 truncate cursor-pointer font-medium transition-colors",children:y.file_path}),n.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 font-medium px-2 py-0.5 bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400 rounded",children:"New File"})]}),n.jsx("div",{className:"text-xs font-mono",children:a("",y.content).map((k,w)=>n.jsxs("div",{className:"flex",children:[n.jsx("span",{className:`w-8 text-center border-r ${k.type==="removed"?"bg-red-50 dark:bg-red-900/20 text-red-600 dark:text-red-400 border-red-200 dark:border-red-800":"bg-green-50 dark:bg-green-900/20 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800"}`,children:k.type==="removed"?"-":"+"}),n.jsx("span",{className:`px-2 py-0.5 flex-1 whitespace-pre-wrap ${k.type==="removed"?"bg-red-50 dark:bg-red-900/20 text-red-800 dark:text-red-200":"bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200"}`,children:k.content})]},w))})]}),l&&n.jsxs("details",{className:"relative mt-3 pl-6 group/raw",open:o,children:[n.jsxs("summary",{className:"flex items-center gap-2 text-xs font-medium text-gray-600 dark:text-gray-400 cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 p-2 rounded-lg hover:bg-white/50 dark:hover:bg-gray-800/50",children:[n.jsx("svg",{className:"w-3 h-3 transition-transform duration-200 group-open/raw:rotate-180",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),"View raw parameters"]}),n.jsx("pre",{className:"mt-2 text-xs bg-gray-50 dark:bg-gray-800/50 border border-gray-200/60 dark:border-gray-700/60 p-3 rounded-lg whitespace-pre-wrap break-words overflow-hidden text-gray-700 dark:text-gray-300 font-mono",children:e.toolInput})]})]})]})}catch{}if(e.toolName==="TodoWrite")try{const y=JSON.parse(e.toolInput);if(y.todos&&Array.isArray(y.todos))return n.jsxs("details",{className:"relative mt-3 group/todo",open:o,children:[n.jsxs("summary",{className:"flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 p-2.5 rounded-lg hover:bg-white/50 dark:hover:bg-gray-800/50",children:[n.jsx("svg",{className:"w-4 h-4 transition-transform duration-200 group-open/todo:rotate-180",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-lg leading-none",children:"✓"}),n.jsx("span",{children:"Updating Todo List"})]})]}),n.jsxs("div",{className:"mt-3",children:[n.jsx(Co,{todos:y.todos}),l&&n.jsxs("details",{className:"relative mt-3 group/raw",open:o,children:[n.jsxs("summary",{className:"flex items-center gap-2 text-xs font-medium text-gray-600 dark:text-gray-400 cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 p-2 rounded-lg hover:bg-white/50 dark:hover:bg-gray-800/50",children:[n.jsx("svg",{className:"w-3 h-3 transition-transform duration-200 group-open/raw:rotate-180",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),"View raw parameters"]}),n.jsx("pre",{className:"mt-2 text-xs bg-gray-50 dark:bg-gray-800/50 border border-gray-200/60 dark:border-gray-700/60 p-3 rounded-lg overflow-x-auto text-gray-700 dark:text-gray-300 font-mono",children:e.toolInput})]})]})]})}catch{}if(e.toolName==="Bash")try{const y=JSON.parse(e.toolInput);return n.jsxs("div",{className:"my-2",children:[n.jsxs("div",{className:"bg-gray-900 dark:bg-gray-950 rounded-md px-3 py-2 font-mono text-sm",children:[n.jsx("span",{className:"text-green-400",children:"$"}),n.jsx("span",{className:"text-gray-100 ml-2",children:y.command})]}),y.description&&n.jsx("div",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400 italic ml-1",children:y.description})]})}catch{}if(e.toolName==="Read")try{const y=JSON.parse(e.toolInput);if(y.file_path){const k=y.file_path.split("/").pop();return n.jsxs("div",{className:"mt-2 text-sm text-blue-700 dark:text-blue-300",children:["Read"," ",n.jsx("button",{onClick:()=>s&&s(y.file_path),className:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 underline font-mono",children:k})]})}}catch{}if(e.toolName==="exit_plan_mode")try{const y=JSON.parse(e.toolInput);if(y.plan){const k=y.plan.replace(/\\n/g,`
|
|
743
|
-
`);return n.jsxs("details",{className:"mt-2",open:o,children:[n.jsxs("summary",{className:"text-sm text-blue-700 dark:text-blue-300 cursor-pointer hover:text-blue-800 dark:hover:text-blue-200 flex items-center gap-2",children:[n.jsx("svg",{className:"w-4 h-4 transition-transform details-chevron",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),"📋 View implementation plan"]}),n.jsx($a,{className:"mt-3 prose prose-sm max-w-none dark:prose-invert",children:k})]})}}catch{}return n.jsxs("details",{className:"relative mt-3 group/params",open:o,children:[n.jsxs("summary",{className:"flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 p-2.5 rounded-lg hover:bg-white/50 dark:hover:bg-gray-800/50",children:[n.jsx("svg",{className:"w-4 h-4 transition-transform duration-200 group-open/params:rotate-180",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),"View input parameters"]}),n.jsx("pre",{className:"mt-3 text-xs bg-gray-50 dark:bg-gray-800/50 border border-gray-200/60 dark:border-gray-700/60 p-3 rounded-lg whitespace-pre-wrap break-words overflow-hidden text-gray-700 dark:text-gray-300 font-mono",children:e.toolInput})]})})(),e.toolResult&&(!e.toolResult.isError&&(e.toolName==="Edit"||e.toolName==="Write"||e.toolName==="ApplyPatch"||e.toolName==="Bash")?null:n.jsxs("div",{id:`tool-result-${e.toolId}`,className:`relative mt-4 p-4 rounded-lg border backdrop-blur-sm scroll-mt-4 ${e.toolResult.isError?"bg-gradient-to-br from-red-50 to-rose-50 dark:from-red-950/20 dark:to-rose-950/20 border-red-200/60 dark:border-red-800/60":"bg-gradient-to-br from-green-50 to-emerald-50 dark:from-green-950/20 dark:to-emerald-950/20 border-green-200/60 dark:border-green-800/60"}`,children:[n.jsx("div",{className:`absolute inset-0 rounded-lg opacity-50 ${e.toolResult.isError?"bg-gradient-to-br from-red-500/5 to-rose-500/5 dark:from-red-400/5 dark:to-rose-400/5":"bg-gradient-to-br from-green-500/5 to-emerald-500/5 dark:from-green-400/5 dark:to-emerald-400/5"}`}),n.jsxs("div",{className:"relative flex items-center gap-2.5 mb-3",children:[n.jsx("div",{className:`w-6 h-6 rounded-lg flex items-center justify-center shadow-md ${e.toolResult.isError?"bg-gradient-to-br from-red-500 to-rose-600 dark:from-red-400 dark:to-rose-500 shadow-red-500/20":"bg-gradient-to-br from-green-500 to-emerald-600 dark:from-green-400 dark:to-emerald-500 shadow-green-500/20"}`,children:n.jsx("svg",{className:"w-3.5 h-3.5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.toolResult.isError?n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M6 18L18 6M6 6l12 12"}):n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M5 13l4 4L19 7"})})}),n.jsx("span",{className:`text-sm font-semibold ${e.toolResult.isError?"text-red-800 dark:text-red-200":"text-green-800 dark:text-green-200"}`,children:e.toolResult.isError?"Tool Error":"Tool Result"})]}),n.jsx("div",{className:`relative text-sm ${e.toolResult.isError?"text-red-900 dark:text-red-100":"text-green-900 dark:text-green-100"}`,children:(()=>{const k=String(e.toolResult.content||"");if((e.toolName==="TodoWrite"||e.toolName==="TodoRead")&&(k.includes("Todos have been modified successfully")||k.includes("Todo list")||k.startsWith("[")&&k.includes('"content"')&&k.includes('"status"')))try{let N=null;if(k.startsWith("["))N=JSON.parse(k);else if(k.includes("Todos have been modified successfully"))return n.jsx("div",{children:n.jsx("div",{className:"flex items-center gap-2 mb-2",children:n.jsx("span",{className:"font-medium",children:"Todo list has been updated successfully"})})});if(N&&Array.isArray(N))return n.jsxs("div",{children:[n.jsx("div",{className:"flex items-center gap-2 mb-3",children:n.jsx("span",{className:"font-medium",children:"Current Todo List"})}),n.jsx(Co,{todos:N,isResult:!0})]})}catch{}if(e.toolName==="exit_plan_mode")try{const N=JSON.parse(k);if(N.plan){const L=N.plan.replace(/\\n/g,`
|
|
744
|
-
`);return n.jsxs("div",{children:[n.jsx("div",{className:"flex items-center gap-2 mb-3",children:n.jsx("span",{className:"font-medium",children:"Implementation Plan"})}),n.jsx($a,{className:"prose prose-sm max-w-none dark:prose-invert",children:L})]})}}catch{}if((e.toolName==="Grep"||e.toolName==="Glob")&&e.toolResult?.toolUseResult){const N=e.toolResult.toolUseResult;if(N.filenames&&Array.isArray(N.filenames)&&N.filenames.length>0)return n.jsxs("div",{children:[n.jsx("div",{className:"flex items-center gap-2 mb-3",children:n.jsxs("span",{className:"font-medium",children:["Found ",N.numFiles||N.filenames.length," ",N.numFiles===1||N.filenames.length===1?"file":"files"]})}),n.jsx("div",{className:"space-y-1 max-h-96 overflow-y-auto",children:N.filenames.map((L,U)=>{const I=L.split("/").pop(),H=L.substring(0,L.lastIndexOf("/"));return n.jsxs("div",{onClick:()=>{s&&s(L)},className:"group flex items-center gap-2 px-2 py-1.5 rounded hover:bg-green-100/50 dark:hover:bg-green-800/20 cursor-pointer transition-colors",children:[n.jsx("svg",{className:"w-4 h-4 text-green-600 dark:text-green-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"font-mono text-sm font-medium text-green-800 dark:text-green-200 truncate group-hover:text-green-900 dark:group-hover:text-green-100",children:I}),n.jsx("div",{className:"font-mono text-xs text-green-600/70 dark:text-green-400/70 truncate",children:H})]}),n.jsx("svg",{className:"w-4 h-4 text-green-600 dark:text-green-400 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]},U)})})]})}if(k.includes("Do you want to proceed?")&&e.toolName==="Bash"){const N=k.split(`
|
|
745
|
-
`),L=N.findIndex(_=>_.includes("Do you want to proceed?")),U=N.slice(0,L).join(`
|
|
746
|
-
`),I=N.slice(L),H=I.find(_=>_.includes("Do you want to proceed?"))||"",F=[];I.forEach(_=>{const O=_.match(/^\s*(\d+)\.\s+(.+)$/);O&&F.push({number:O[1],text:O[2].trim()})});const W=k.match(/>\s*(\d+)/),M=W?W[1]:null;return n.jsxs("div",{className:"space-y-3",children:[U&&n.jsx("div",{className:"bg-gray-900 dark:bg-gray-950 text-gray-100 rounded-lg p-3 font-mono text-xs overflow-x-auto",children:n.jsx("pre",{className:"whitespace-pre-wrap break-words",children:U})}),n.jsx("div",{className:"bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-amber-500 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:n.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("h4",{className:"font-semibold text-amber-900 dark:text-amber-100 text-base mb-2",children:"Interactive Prompt"}),n.jsx("p",{className:"text-sm text-amber-800 dark:text-amber-200 mb-4",children:H}),n.jsx("div",{className:"space-y-2 mb-4",children:F.map(_=>n.jsx("button",{className:`w-full text-left px-4 py-3 rounded-lg border-2 transition-all ${M===_.number?"bg-amber-600 dark:bg-amber-700 text-white border-amber-600 dark:border-amber-700 shadow-md":"bg-white dark:bg-gray-800 text-amber-900 dark:text-amber-100 border-amber-300 dark:border-amber-700 hover:border-amber-400 dark:hover:border-amber-600 hover:shadow-sm"} ${M?"cursor-default":"cursor-not-allowed opacity-75"}`,disabled:!0,children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold ${M===_.number?"bg-white/20":"bg-amber-100 dark:bg-amber-800/50"}`,children:_.number}),n.jsx("span",{className:"text-sm sm:text-base font-medium flex-1",children:_.text}),M===_.number&&n.jsx("svg",{className:"w-5 h-5 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:n.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]})},_.number))}),M&&n.jsxs("div",{className:"bg-amber-100 dark:bg-amber-800/30 rounded-lg p-3",children:[n.jsxs("p",{className:"text-amber-900 dark:text-amber-100 text-sm font-medium mb-1",children:["✓ Claude selected option ",M]}),n.jsx("p",{className:"text-amber-800 dark:text-amber-200 text-xs",children:"In the CLI, you would select this option interactively using arrow keys or by typing the number."})]})]})]})})]})}const w=k.match(/The file (.+?) has been updated\./);if(w)return n.jsxs("div",{children:[n.jsx("div",{className:"flex items-center gap-2 mb-2",children:n.jsx("span",{className:"font-medium",children:"File updated successfully"})}),n.jsx("button",{onClick:async()=>{if(s)try{const L=await(await Qe(`/api/git/file-with-diff?project=${encodeURIComponent(d?.name)}&file=${encodeURIComponent(w[1])}`)).json();!L.error&&L.oldContent!==void 0&&L.currentContent!==void 0?s(w[1],{old_string:L.oldContent||"",new_string:L.currentContent||""}):s(w[1])}catch(N){console.error("Error fetching file diff:",N),s(w[1])}},className:"text-xs font-mono bg-green-100 dark:bg-green-800/30 px-2 py-1 rounded text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 underline cursor-pointer",children:w[1]})]});const j=k.match(/(?:The file|File) (.+?) has been (?:created|written)(?: successfully)?\.?/);return j?n.jsxs("div",{children:[n.jsx("div",{className:"flex items-center gap-2 mb-2",children:n.jsx("span",{className:"font-medium",children:"File created successfully"})}),n.jsx("button",{onClick:async()=>{if(s)try{const L=await(await Qe(`/api/git/file-with-diff?project=${encodeURIComponent(d?.name)}&file=${encodeURIComponent(j[1])}`)).json();!L.error&&L.oldContent!==void 0&&L.currentContent!==void 0?s(j[1],{old_string:L.oldContent||"",new_string:L.currentContent||""}):s(j[1])}catch(N){console.error("Error fetching file diff:",N),s(j[1])}},className:"text-xs font-mono bg-green-100 dark:bg-green-800/30 px-2 py-1 rounded text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 underline cursor-pointer",children:j[1]})]}):e.toolName==="Write"&&!e.toolResult.isError?n.jsxs("div",{className:"text-green-700 dark:text-green-300",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),n.jsx("span",{className:"font-medium",children:"File written successfully"})]}),n.jsx("p",{className:"text-xs mt-1 text-green-600 dark:text-green-400",children:"The file content is displayed in the diff view above"})]}):k.includes("cat -n")&&k.includes("→")?n.jsxs("details",{open:o,children:[n.jsxs("summary",{className:"text-sm text-green-700 dark:text-green-300 cursor-pointer hover:text-green-800 dark:hover:text-green-200 mb-2 flex items-center gap-2",children:[n.jsx("svg",{className:"w-4 h-4 transition-transform details-chevron",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),"View file content"]}),n.jsx("div",{className:"mt-2 bg-gray-100 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:n.jsx("div",{className:"text-xs font-mono p-3 whitespace-pre-wrap break-words overflow-hidden",children:k})})]}):k.length>300?n.jsxs("details",{open:o,children:[n.jsxs("summary",{className:"text-sm text-green-700 dark:text-green-300 cursor-pointer hover:text-green-800 dark:hover:text-green-200 mb-2 flex items-center gap-2",children:[n.jsx("svg",{className:"w-4 h-4 transition-transform details-chevron",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),"View full output (",k.length," chars)"]}),n.jsx($a,{className:"mt-2 prose prose-sm max-w-none prose-green dark:prose-invert",children:k})]}):n.jsx($a,{className:"prose prose-sm max-w-none prose-green dark:prose-invert",children:k})})()})]}))]}):e.isInteractivePrompt?n.jsx("div",{className:"bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-amber-500 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:n.jsx("svg",{className:"w-5 h-5 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("h4",{className:"font-semibold text-amber-900 dark:text-amber-100 text-base mb-3",children:"Interactive Prompt"}),(()=>{const x=e.content.split(`
|
|
747
|
-
`).filter(w=>w.trim()),y=x.find(w=>w.includes("?"))||x[0]||"",k=[];return x.forEach(w=>{const j=w.match(/[❯\s]*(\d+)\.\s+(.+)/);if(j){const N=w.includes("❯");k.push({number:j[1],text:j[2].trim(),isSelected:N})}}),n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-sm text-amber-800 dark:text-amber-200 mb-4",children:y}),n.jsx("div",{className:"space-y-2 mb-4",children:k.map(w=>n.jsx("button",{className:`w-full text-left px-4 py-3 rounded-lg border-2 transition-all ${w.isSelected?"bg-amber-600 dark:bg-amber-700 text-white border-amber-600 dark:border-amber-700 shadow-md":"bg-white dark:bg-gray-800 text-amber-900 dark:text-amber-100 border-amber-300 dark:border-amber-700"} cursor-not-allowed opacity-75`,disabled:!0,children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold ${w.isSelected?"bg-white/20":"bg-amber-100 dark:bg-amber-800/50"}`,children:w.number}),n.jsx("span",{className:"text-sm sm:text-base font-medium flex-1",children:w.text}),w.isSelected&&n.jsx("span",{className:"text-lg",children:"❯"})]})},w.number))}),n.jsxs("div",{className:"bg-amber-100 dark:bg-amber-800/30 rounded-lg p-3",children:[n.jsx("p",{className:"text-amber-900 dark:text-amber-100 text-sm font-medium mb-1",children:"⏳ Waiting for your response in the CLI"}),n.jsx("p",{className:"text-amber-800 dark:text-amber-200 text-xs",children:"Please select an option in your terminal where Claude is running."})]})]})})()]})]})}):e.isToolUse&&e.toolName==="Read"?(()=>{try{const x=JSON.parse(e.toolInput);if(x.file_path){const y=x.file_path.split("/").pop();return n.jsx("div",{className:"bg-gray-50/50 dark:bg-gray-800/30 border-l-2 border-gray-400 dark:border-gray-500 pl-3 py-2 my-2",children:n.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600 dark:text-gray-400",children:[n.jsx("svg",{className:"w-3.5 h-3.5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),n.jsx("span",{className:"font-medium",children:"Read"}),n.jsx("button",{onClick:()=>s&&s(x.file_path),className:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-mono transition-colors",children:y})]})})}}catch{return n.jsx("div",{className:"bg-gray-50/50 dark:bg-gray-800/30 border-l-2 border-gray-400 dark:border-gray-500 pl-3 py-2 my-2",children:n.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600 dark:text-gray-400",children:[n.jsx("svg",{className:"w-3.5 h-3.5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),n.jsx("span",{className:"font-medium",children:"Read file"})]})})}})():e.isToolUse&&e.toolName==="TodoWrite"?(()=>{try{const x=JSON.parse(e.toolInput);if(x.todos&&Array.isArray(x.todos))return n.jsxs("div",{className:"bg-gray-50/50 dark:bg-gray-800/30 border-l-2 border-gray-400 dark:border-gray-500 pl-3 py-2 my-2",children:[n.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600 dark:text-gray-400 mb-2",children:[n.jsx("svg",{className:"w-3.5 h-3.5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})}),n.jsx("span",{className:"font-medium",children:"Update todo list"})]}),n.jsx(Co,{todos:x.todos})]})}catch{return n.jsx("div",{className:"bg-gray-50/50 dark:bg-gray-800/30 border-l-2 border-gray-400 dark:border-gray-500 pl-3 py-2 my-2",children:n.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600 dark:text-gray-400",children:[n.jsx("svg",{className:"w-3.5 h-3.5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})}),n.jsx("span",{className:"font-medium",children:"Update todo list"})]})})}})():e.isToolUse&&e.toolName==="TodoRead"?n.jsx("div",{className:"bg-gray-50/50 dark:bg-gray-800/30 border-l-2 border-gray-400 dark:border-gray-500 pl-3 py-2 my-2",children:n.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-600 dark:text-gray-400",children:[n.jsx("svg",{className:"w-3.5 h-3.5 text-gray-500 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),n.jsx("span",{className:"font-medium",children:"Read todo list"})]})}):n.jsxs("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:[c&&e.reasoning&&n.jsxs("details",{className:"mb-3",children:[n.jsx("summary",{className:"cursor-pointer text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 font-medium",children:"💭 Thinking..."}),n.jsx("div",{className:"mt-2 pl-4 border-l-2 border-gray-300 dark:border-gray-600 italic text-gray-600 dark:text-gray-400 text-sm",children:n.jsx("div",{className:"whitespace-pre-wrap",children:e.reasoning})})]}),(()=>{const x=yl(String(e.content||"")),y=x.trim();if((y.startsWith("{")||y.startsWith("["))&&(y.endsWith("}")||y.endsWith("]")))try{const k=JSON.parse(y),w=JSON.stringify(k,null,2);return n.jsxs("div",{className:"my-2",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2 text-sm text-gray-600 dark:text-gray-400",children:[n.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),n.jsx("span",{className:"font-medium",children:"JSON Response"})]}),n.jsx("div",{className:"bg-gray-800 dark:bg-gray-900 border border-gray-600/30 dark:border-gray-700 rounded-lg overflow-hidden",children:n.jsx("pre",{className:"p-4 overflow-x-auto",children:n.jsx("code",{className:"text-gray-100 dark:text-gray-200 text-sm font-mono block whitespace-pre",children:w})})})]})}catch{}return e.type==="assistant"?n.jsx($a,{className:"prose prose-sm max-w-none dark:prose-invert prose-gray",children:x}):n.jsx("div",{className:"whitespace-pre-wrap",children:x})})()]}),n.jsx("div",{className:`text-xs text-gray-500 dark:text-gray-400 mt-1 ${u?"opacity-0 group-hover:opacity-100":""}`,children:new Date(e.timestamp).toLocaleTimeString()})]})]})})}),Pw=({file:e,onRemove:t,uploadProgress:r,error:a})=>{const[s,i]=b.useState(null);return b.useEffect(()=>{const o=URL.createObjectURL(e);return i(o),()=>URL.revokeObjectURL(o)},[e]),n.jsxs("div",{className:"relative group",children:[n.jsx("img",{src:s,alt:e.name,className:"w-20 h-20 object-cover rounded"}),r!==void 0&&r<100&&n.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center",children:n.jsxs("div",{className:"text-white text-xs",children:[r,"%"]})}),a&&n.jsx("div",{className:"absolute inset-0 bg-red-500/50 flex items-center justify-center",children:n.jsx("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),n.jsx("button",{onClick:t,className:"absolute -top-2 -right-2 bg-red-500 text-white rounded-full p-1 opacity-0 group-hover:opacity-100",children:n.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})};function Rw({selectedProject:e,selectedSession:t,ws:r,sendMessage:a,messages:s,onFileOpen:i,onInputFocusChange:o,onSessionActive:l,onSessionInactive:c,onSessionProcessing:d,onSessionNotProcessing:u,processingSessions:m,onReplaceTemporarySession:h,onNavigateToSession:p,onShowSettings:x,autoExpandTools:y,showRawParameters:k,showThinking:w,autoScrollToBottom:j,sendByCtrlEnter:N,externalMessageUpdate:L,onTaskClick:U,onShowAllTasks:I}){const{tasksEnabled:H}=cs(),[F,W]=b.useState(()=>typeof window<"u"&&e&&cr.getItem(`draft_input_${e.name}`)||""),[M,_]=b.useState(()=>{if(typeof window<"u"&&e){const z=cr.getItem(`chat_messages_${e.name}`);return z?JSON.parse(z):[]}return[]}),[O,V]=b.useState(!1),[T,Y]=b.useState(t?.id||null),[ne,he]=b.useState(!1),[$,J]=b.useState([]),[C,ue]=b.useState(!1),[xe,A]=b.useState(!1),[te,Ce]=b.useState(0),[De,pe]=b.useState(!1),[_e,se]=b.useState(0),we=20,[ze,Ae]=b.useState(!1),[Be,nt]=b.useState("default"),[bt,ut]=b.useState([]),[jt,lt]=b.useState(new Map),[qe,st]=b.useState(new Map),St=b.useRef(null),Oe=b.useRef(null),Qt=b.useRef(null),ie=b.useRef(null),Se=b.useRef(!1),B=b.useRef(""),K=b.useRef(null),ke=b.useRef(null),[We,Ge]=b.useState(""),[ce,R]=b.useState(!1),[Q,be]=b.useState([]),[je,re]=b.useState([]),[Me,pt]=b.useState(-1),[qt,zt]=b.useState(0),[Kt,Lr]=b.useState(-1),[_r,Nt]=b.useState(!1),[Pr,en]=b.useState(!1),vn=b.useRef({height:0,top:0}),[Rr,X]=b.useState(!1),[le,Ye]=b.useState([]),[wt,Jt]=b.useState([]),[Yt,Nr]=b.useState(""),[Ii,lr]=b.useState(!1),[On,$n]=b.useState(null),[Da,tr]=b.useState(-1),[xs,P]=b.useState(-1),[ve,tt]=b.useState(100),[Et,Lt]=b.useState(null),[Pt,Sr]=b.useState(()=>localStorage.getItem("selected-provider")||"claude"),[sa,C0]=b.useState(()=>localStorage.getItem("cursor-model")||"gpt-5");b.useEffect(()=>{if(t?.id){const z=localStorage.getItem(`permissionMode-${t.id}`);nt(z||"default")}},[t?.id]),b.useEffect(()=>{t&&t.__provider&&t.__provider!==Pt&&(Sr(t.__provider),localStorage.setItem("selected-provider",t.__provider))},[t]),b.useEffect(()=>{Pt==="cursor"&&fetch("/api/cursor/config",{headers:{Authorization:`Bearer ${localStorage.getItem("auth-token")}`}}).then(z=>z.json()).then(z=>{if(z.success&&z.config?.model?.modelId){const ee={"gpt-5":"gpt-5","claude-4-sonnet":"sonnet-4","sonnet-4":"sonnet-4","claude-4-opus":"opus-4.1","opus-4.1":"opus-4.1"}[z.config.model.modelId]||z.config.model.modelId;localStorage.getItem("cursor-model")||C0(ee)}}).catch(z=>console.error("Error loading Cursor config:",z))},[Pt]),b.useEffect(()=>{(async()=>{if(e)try{const ae=await Qe("/api/commands/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectPath:e.path})});if(!ae.ok)throw new Error("Failed to fetch commands");const ee=await ae.json(),Z=[...(ee.builtIn||[]).map(He=>({...He,type:"built-in"})),...(ee.custom||[]).map(He=>({...He,type:"custom"}))];Ye(Z);const de=`command_history_${e.name}`,Fe=cr.getItem(de);if(Fe)try{const He=JSON.parse(Fe),ft=Z.sort((Ve,oe)=>{const Le=He[Ve.name]||0;return(He[oe.name]||0)-Le});Ye(ft)}catch(He){console.error("Error parsing command history:",He)}}catch(ae){console.error("Error fetching slash commands:",ae),Ye([])}})()},[e]);const Di=b.useMemo(()=>le.length?new Ia(le,{keys:[{name:"name",weight:2},{name:"description",weight:1}],threshold:.4,includeScore:!0,minMatchCharLength:1}):null,[le]);b.useEffect(()=>{if(!Yt){Jt(le);return}if(!Di){Jt([]);return}const z=Di.search(Yt);Jt(z.map(ae=>ae.item))},[Yt,le,Di]);const Zp=b.useMemo(()=>{if(!e||le.length===0)return[];const z=`command_history_${e.name}`,ae=cr.getItem(z);if(!ae)return[];try{const ee=JSON.parse(ae);return le.map(de=>({...de,usageCount:ee[de.name]||0})).filter(de=>de.usageCount>0).sort((de,Fe)=>Fe.usageCount-de.usageCount).slice(0,5)}catch(ee){return console.error("Error parsing command history:",ee),[]}},[e,le]),ef=b.useCallback((z,ae,ee)=>{if(!z||!e)return;if(ee){tr(ae);return}const Z=`command_history_${e.name}`,de=cr.getItem(Z);let Fe={};try{Fe=de?JSON.parse(de):{}}catch(He){console.error("Error parsing command history:",He)}Fe[z.name]=(Fe[z.name]||0)+1,cr.setItem(Z,JSON.stringify(Fe)),M0(z)},[e]),tf=b.useCallback(z=>{const{action:ae,data:ee}=z;switch(ae){case"clear":_([]),J([]);break;case"help":_(Z=>[...Z,{role:"assistant",content:ee.content,timestamp:Date.now()}]);break;case"model":_(Z=>[...Z,{role:"assistant",content:`**Current Model**: ${ee.current.model}
|
|
748
|
-
|
|
749
|
-
**Available Models**:
|
|
750
|
-
|
|
751
|
-
Claude: ${ee.available.claude.join(", ")}
|
|
752
|
-
|
|
753
|
-
Cursor: ${ee.available.cursor.join(", ")}`,timestamp:Date.now()}]);break;case"cost":{const Z=`**Token Usage**: ${ee.tokenUsage.used.toLocaleString()} / ${ee.tokenUsage.total.toLocaleString()} (${ee.tokenUsage.percentage}%)
|
|
754
|
-
|
|
755
|
-
**Estimated Cost**:
|
|
756
|
-
- Input: $${ee.cost.input}
|
|
757
|
-
- Output: $${ee.cost.output}
|
|
758
|
-
- **Total**: $${ee.cost.total}
|
|
759
|
-
|
|
760
|
-
**Model**: ${ee.model}`;_(de=>[...de,{role:"assistant",content:Z,timestamp:Date.now()}]);break}case"status":{const Z=`**System Status**
|
|
761
|
-
|
|
762
|
-
- Version: ${ee.version}
|
|
763
|
-
- Uptime: ${ee.uptime}
|
|
764
|
-
- Model: ${ee.model}
|
|
765
|
-
- Provider: ${ee.provider}
|
|
766
|
-
- Node.js: ${ee.nodeVersion}
|
|
767
|
-
- Platform: ${ee.platform}`;_(de=>[...de,{role:"assistant",content:Z,timestamp:Date.now()}]);break}case"memory":ee.error?_(Z=>[...Z,{role:"assistant",content:`⚠️ ${ee.message}`,timestamp:Date.now()}]):(_(Z=>[...Z,{role:"assistant",content:`📝 ${ee.message}
|
|
768
|
-
|
|
769
|
-
Path: \`${ee.path}\``,timestamp:Date.now()}]),ee.exists&&i&&i(ee.path));break;case"config":x&&x();break;case"rewind":ee.error?_(Z=>[...Z,{role:"assistant",content:`⚠️ ${ee.message}`,timestamp:Date.now()}]):(_(Z=>Z.slice(0,-ee.steps*2)),_(Z=>[...Z,{role:"assistant",content:`⏪ ${ee.message}`,timestamp:Date.now()}]));break;default:console.warn("Unknown built-in command action:",ae)}},[i,x]),zi=b.useRef(null),rf=b.useCallback(async(z,ae)=>{const{content:ee,hasBashCommands:Z,hasFileIncludes:de}=z;if(Z&&!window.confirm("This command contains bash commands that will be executed. Do you want to proceed?")){_(He=>[...He,{role:"assistant",content:"❌ Command execution cancelled",timestamp:Date.now()}]);return}W(ee),setTimeout(()=>{if(zi.current){const Fe={preventDefault:()=>{}};zi.current(Fe)}},50)},[]),M0=b.useCallback(async z=>{if(!(!z||!e))try{const ae=F.match(new RegExp(`${z.name}\\s*(.*)`)),ee=ae&&ae[1]?ae[1].trim().split(/\s+/):[],Z={projectPath:e.path,projectName:e.name,sessionId:T,provider:Pt,model:Pt==="cursor"?sa:"claude-sonnet-4.5",tokenUsage:On},de=await Qe("/api/commands/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commandName:z.name,commandPath:z.path,args:ee,context:Z})});if(!de.ok)throw new Error("Failed to execute command");const Fe=await de.json();Fe.type==="builtin"?tf(Fe):Fe.type==="custom"&&await rf(Fe,ee),W(""),X(!1),P(-1),Nr(""),tr(-1)}catch(ae){console.error("Error executing command:",ae),_(ee=>[...ee,{role:"assistant",content:`Error executing command: ${ae.message}`,timestamp:Date.now()}])}},[F,e,T,Pt,sa,On]),nf=b.useMemo(()=>{const z=new Map;return(ae,ee)=>{const Z=`${ae.length}-${ee.length}-${ae.slice(0,50)}`;if(z.has(Z))return z.get(Z);const de=af(ae,ee);if(z.set(Z,de),z.size>100){const Fe=z.keys().next().value;z.delete(Fe)}return de}},[]),za=b.useCallback(async(z,ae,ee=!1)=>{if(!z||!ae)return[];const Z=!ee;Z?ue(!0):A(!0);try{const de=ee?te:0,Fe=await at.sessionMessages(z,ae,we,de);if(!Fe.ok)throw new Error("Failed to load session messages");const He=await Fe.json();if(He.hasMore!==void 0)return pe(He.hasMore),se(He.total),Ce(de+(He.messages?.length||0)),He.messages||[];{const ft=He.messages||[];return pe(!1),se(ft.length),ft}}catch(de){return console.error("Error loading session messages:",de),[]}finally{Z?ue(!1):A(!1)}},[te]),bs=b.useCallback(async(z,ae)=>{if(!z||!ae)return[];ue(!0);try{const ee=`/api/cursor/sessions/${encodeURIComponent(ae)}?projectPath=${encodeURIComponent(z)}`,Z=await Qe(ee);if(!Z.ok)return[];const Fe=(await Z.json())?.session?.messages||[],He=[],ft={};for(let Ve=0;Ve<Fe.length;Ve++){const oe=Fe[Ve],Le=oe.content;let rt="",yt="assistant",xt=null;try{if(Le?.role&&Le?.content){if(Le.role==="system")continue;if(Le.role==="tool"){if(Array.isArray(Le.content)){for(const ct of Le.content)if(ct?.type==="tool-result"){let mt=ct.toolName||"Unknown Tool";mt==="ApplyPatch"&&(mt="Edit");const Cr=ct.toolCallId||Le.id,kn=ct.result||"";ft[Cr]?ft[Cr].toolResult={content:kn,isError:!1}:He.push({type:"assistant",content:"",timestamp:new Date(Date.now()+Ve*1e3),blobId:oe.id,sequence:oe.sequence,rowid:oe.rowid,isToolUse:!0,toolName:mt,toolId:Cr,toolInput:null,toolResult:{content:kn,isError:!1}})}}continue}else if(yt=Le.role==="user"?"user":"assistant",Array.isArray(Le.content)){const ct=[];for(const mt of Le.content)if(mt?.type==="text"&&mt?.text)ct.push(Mn(mt.text));else if(mt?.type==="reasoning"&&mt?.text)xt=Mn(mt.text);else if(mt?.type==="tool-call"){(ct.length>0||xt)&&(He.push({type:yt,content:ct.join(`
|
|
770
|
-
`),reasoning:xt,timestamp:new Date(Date.now()+Ve*1e3),blobId:oe.id,sequence:oe.sequence,rowid:oe.rowid}),ct.length=0,xt=null);let Cr=mt.toolName||"Unknown Tool";Cr==="ApplyPatch"&&(Cr="Edit");const kn=mt.toolCallId||`tool_${Ve}`;let rn=mt.args;if(Cr==="Edit"&&mt.args)if(mt.args.patch){const Fr=mt.args.patch.split(`
|
|
771
|
-
`);let La=[],Ri=[],z0=!1;for(const wn of Fr)wn.startsWith("@@")?z0=!0:z0&&(wn.startsWith("-")?La.push(wn.substring(1)):wn.startsWith("+")?Ri.push(wn.substring(1)):wn.startsWith(" ")&&(La.push(wn.substring(1)),Ri.push(wn.substring(1))));const ks=mt.args.file_path;rn={file_path:ks&&!ks.startsWith("/")?`${z}/${ks}`:ks,old_string:La.join(`
|
|
772
|
-
`)||mt.args.patch,new_string:Ri.join(`
|
|
773
|
-
`)||mt.args.patch}}else rn=mt.args;else if(Cr==="Read"&&mt.args){const Fr=mt.args.path||mt.args.file_path;rn={file_path:Fr&&!Fr.startsWith("/")?`${z}/${Fr}`:Fr}}else if(Cr==="Write"&&mt.args){const Fr=mt.args.path||mt.args.file_path;rn={file_path:Fr&&!Fr.startsWith("/")?`${z}/${Fr}`:Fr,content:mt.args.contents||mt.args.content}}const D0={type:"assistant",content:"",timestamp:new Date(Date.now()+Ve*1e3),blobId:oe.id,sequence:oe.sequence,rowid:oe.rowid,isToolUse:!0,toolName:Cr,toolId:kn,toolInput:rn?JSON.stringify(rn):null,toolResult:null};He.push(D0),ft[kn]=D0}else if(mt?.type==="tool_use"){(ct.length>0||xt)&&(He.push({type:yt,content:ct.join(`
|
|
774
|
-
`),reasoning:xt,timestamp:new Date(Date.now()+Ve*1e3),blobId:oe.id,sequence:oe.sequence,rowid:oe.rowid}),ct.length=0,xt=null);const Cr=mt.name||"Unknown Tool",kn=mt.id||`tool_${Ve}`,rn={type:"assistant",content:"",timestamp:new Date(Date.now()+Ve*1e3),blobId:oe.id,sequence:oe.sequence,rowid:oe.rowid,isToolUse:!0,toolName:Cr,toolId:kn,toolInput:mt.input?JSON.stringify(mt.input):null,toolResult:null};He.push(rn),ft[kn]=rn}else typeof mt=="string"&&ct.push(mt);ct.length>0?(rt=ct.join(`
|
|
775
|
-
`),xt&&!rt&&(He.push({type:yt,content:"",reasoning:xt,timestamp:new Date(Date.now()+Ve*1e3),blobId:oe.id,sequence:oe.sequence,rowid:oe.rowid}),rt="")):rt=""}else typeof Le.content=="string"&&(rt=Le.content)}else if(Le?.message?.role&&Le?.message?.content){if(Le.message.role==="system")continue;yt=Le.message.role==="user"?"user":"assistant",Array.isArray(Le.message.content)?rt=Le.message.content.map(ct=>typeof ct=="string"?ct:ct?.text||"").filter(Boolean).join(`
|
|
776
|
-
`):typeof Le.message.content=="string"&&(rt=Le.message.content)}}catch(ct){console.log("Error parsing blob content:",ct)}if(rt&&rt.trim()){const ct={type:yt,content:rt,timestamp:new Date(Date.now()+Ve*1e3),blobId:oe.id,sequence:oe.sequence,rowid:oe.rowid};xt&&(ct.reasoning=xt),He.push(ct)}}return He.sort((Ve,oe)=>Ve.sequence!==void 0&&oe.sequence!==void 0?Ve.sequence-oe.sequence:Ve.rowid!==void 0&&oe.rowid!==void 0?Ve.rowid-oe.rowid:new Date(Ve.timestamp)-new Date(oe.timestamp)),He}catch(ee){return console.error("Error loading Cursor session messages:",ee),[]}finally{ue(!1)}},[]),af=(z,ae)=>{const ee=z.split(`
|
|
777
|
-
`),Z=ae.split(`
|
|
778
|
-
`),de=[];let Fe=0,He=0;for(;Fe<ee.length||He<Z.length;){const ft=ee[Fe],Ve=Z[He];Fe>=ee.length?(de.push({type:"added",content:Ve,lineNum:He+1}),He++):He>=Z.length?(de.push({type:"removed",content:ft,lineNum:Fe+1}),Fe++):ft===Ve?(Fe++,He++):(de.push({type:"removed",content:ft,lineNum:Fe+1}),de.push({type:"added",content:Ve,lineNum:He+1}),Fe++,He++)}return de},sf=z=>{const ae=[],ee=new Map;for(const Z of z)if(Z.message?.role==="user"&&Array.isArray(Z.message?.content))for(const de of Z.message.content)de.type==="tool_result"&&ee.set(de.tool_use_id,{content:de.content,isError:de.is_error,timestamp:new Date(Z.timestamp||Date.now()),toolUseResult:Z.toolUseResult||null});for(const Z of z)if(Z.message?.role==="user"&&Z.message?.content){let de="",Fe="user";if(Array.isArray(Z.message.content)){const ft=[];for(const Ve of Z.message.content)Ve.type==="text"&&ft.push(Mn(Ve.text));de=ft.join(`
|
|
779
|
-
`)}else typeof Z.message.content=="string"?de=Mn(Z.message.content):de=Mn(String(Z.message.content));!de||de.startsWith("<command-name>")||de.startsWith("<command-message>")||de.startsWith("<command-args>")||de.startsWith("<local-command-stdout>")||de.startsWith("<system-reminder>")||de.startsWith("Caveat:")||de.startsWith("This session is being continued from a previous")||de.startsWith("[Request interrupted")||(de=Ao(de),ae.push({type:Fe,content:de,timestamp:Z.timestamp||new Date().toISOString()}))}else if(Z.message?.role==="assistant"&&Z.message?.content){if(Array.isArray(Z.message.content)){for(const de of Z.message.content)if(de.type==="text"){let Fe=de.text;typeof Fe=="string"&&(Fe=Ao(Fe)),ae.push({type:"assistant",content:Fe,timestamp:Z.timestamp||new Date().toISOString()})}else if(de.type==="tool_use"){const Fe=ee.get(de.id);ae.push({type:"assistant",content:"",timestamp:Z.timestamp||new Date().toISOString(),isToolUse:!0,toolName:de.name,toolInput:JSON.stringify(de.input),toolResult:Fe?{content:typeof Fe.content=="string"?Fe.content:JSON.stringify(Fe.content),isError:Fe.isError,toolUseResult:Fe.toolUseResult}:null,toolError:Fe?.isError||!1,toolResultTimestamp:Fe?.timestamp||new Date})}}else if(typeof Z.message.content=="string"){let de=Z.message.content;de=Ao(de),ae.push({type:"assistant",content:de,timestamp:Z.timestamp||new Date().toISOString()})}}return ae},A0=b.useMemo(()=>sf($),[$]),tn=b.useCallback(()=>{ie.current&&(ie.current.scrollTop=ie.current.scrollHeight)},[]),ys=b.useCallback(()=>{if(!ie.current)return!1;const{scrollTop:z,scrollHeight:ae,clientHeight:ee}=ie.current;return ae-z-ee<50},[]),Li=b.useCallback(async()=>{if(ie.current){const z=ie.current,ae=ys();en(!ae);const ee=z.scrollTop<100,Z=localStorage.getItem("selected-provider")||"claude";if(ee&&De&&!xe&&t&&e&&Z!=="cursor"){const de=z.scrollHeight,Fe=z.scrollTop,He=await za(e.name,t.id,!0);He.length>0&&(J(ft=>[...He,...ft]),setTimeout(()=>{if(ie.current){const Ve=ie.current.scrollHeight-de;ie.current.scrollTop=Fe+Ve}},0))}}},[ys,De,xe,t,e,za]);b.useEffect(()=>{(async()=>{if(t&&e){const ae=localStorage.getItem("selected-provider")||"claude";if(Se.current=!0,T!==null&&T!==t.id?(Ce(0),pe(!1),se(0),$n(null),V(!1),r&&a&&a({type:"check-session-status",sessionId:t.id,provider:ae})):T===null&&(Ce(0),pe(!1),se(0),r&&a&&a({type:"check-session-status",sessionId:t.id,provider:ae})),ae==="cursor")if(Y(t.id),sessionStorage.setItem("cursorSessionId",t.id),ze)Ae(!1);else{const Z=e.fullPath||e.path,de=await bs(Z,t.id);J([]),_(de)}else if(Y(t.id),ze)Ae(!1);else{const Z=await za(e.name,t.id,!1);J(Z)}}else!ze&&!O&&(_([]),J([])),Y(null),sessionStorage.removeItem("cursorSessionId"),Ce(0),pe(!1),se(0);setTimeout(()=>{Se.current=!1},250)})()},[t,e,bs,tn,ze]),b.useEffect(()=>{L>0&&t&&e&&(async()=>{try{if((localStorage.getItem("selected-provider")||"claude")==="cursor"){const ee=e.fullPath||e.path,Z=await bs(ee,t.id);J([]),_(Z)}else{const ee=await za(e.name,t.id,!1);J(ee),ys&&j&&setTimeout(()=>tn(),200)}}catch(ae){console.error("Error reloading messages from external update:",ae)}})()},[L,t,e,bs,za,ys,j,tn]),b.useEffect(()=>{$.length>0&&_(A0)},[A0,$]),b.useEffect(()=>{o&&o(ne)},[ne,o]),b.useEffect(()=>{e&&F!==""?cr.setItem(`draft_input_${e.name}`,F):e&&F===""&&cr.removeItem(`draft_input_${e.name}`)},[F,e]),b.useEffect(()=>{e&&M.length>0&&cr.setItem(`chat_messages_${e.name}`,JSON.stringify(M))},[M,e]),b.useEffect(()=>{if(e){const z=cr.getItem(`draft_input_${e.name}`)||"";z!==F&&W(z)}},[e?.name]),b.useEffect(()=>{T&&O&&d&&d(T)},[O,T,d]),b.useEffect(()=>{T&&m&&m.has(T)&&!O&&(V(!0),Nt(!0))},[T,m]),b.useEffect(()=>{if(s.length>0){const z=s[s.length-1];if(!["projects_updated","taskmaster-project-updated","session-created","claude-complete"].includes(z.type)&&z.sessionId&&T&&z.sessionId!==T){console.log("⏭️ Skipping message for different session:",z.sessionId,"current:",T);return}switch(z.type){case"session-created":z.sessionId&&!T&&(sessionStorage.setItem("pendingSessionId",z.sessionId),h&&h(z.sessionId));break;case"token-budget":break;case"claude-response":const Z=z.data.message||z.data;if(Z&&typeof Z=="object"&&Z.type){if(Z.type==="content_block_delta"&&Z.delta?.text){const oe=Mn(Z.delta.text);B.current+=oe,K.current||(K.current=setTimeout(()=>{const Le=B.current;B.current="",K.current=null,Le&&_(rt=>{const yt=[...rt],xt=yt[yt.length-1];return xt&&xt.type==="assistant"&&!xt.isToolUse&&xt.isStreaming?xt.content=(xt.content||"")+Le:yt.push({type:"assistant",content:Le,timestamp:new Date,isStreaming:!0}),yt})},100));return}if(Z.type==="content_block_stop"){K.current&&(clearTimeout(K.current),K.current=null);const oe=B.current;B.current="",oe&&_(Le=>{const rt=[...Le],yt=rt[rt.length-1];return yt&&yt.type==="assistant"&&!yt.isToolUse&&yt.isStreaming?yt.content=(yt.content||"")+oe:rt.push({type:"assistant",content:oe,timestamp:new Date,isStreaming:!0}),rt}),_(Le=>{const rt=[...Le],yt=rt[rt.length-1];return yt&&yt.type==="assistant"&&yt.isStreaming&&(yt.isStreaming=!1),rt});return}}if(z.data.type==="system"&&z.data.subtype==="init"&&z.data.session_id&&T&&z.data.session_id!==T){console.log("🔄 Claude CLI session duplication detected:",{originalSession:T,newSession:z.data.session_id}),Ae(!0),p&&p(z.data.session_id);return}if(z.data.type==="system"&&z.data.subtype==="init"&&z.data.session_id&&!T){console.log("🔄 New session init detected:",{newSession:z.data.session_id}),Ae(!0),p&&p(z.data.session_id);return}if(z.data.type==="system"&&z.data.subtype==="init"&&z.data.session_id&&T&&z.data.session_id===T){console.log("🔄 System init message for current session, ignoring");return}if(Array.isArray(Z.content)){for(const oe of Z.content)if(oe.type==="tool_use"){const Le=oe.input?JSON.stringify(oe.input,null,2):"";_(rt=>[...rt,{type:"assistant",content:"",timestamp:new Date,isToolUse:!0,toolName:oe.name,toolInput:Le,toolId:oe.id,toolResult:null}])}else if(oe.type==="text"&&oe.text?.trim()){let Le=Mn(oe.text);Le=yl(Le),_(rt=>[...rt,{type:"assistant",content:Le,timestamp:new Date}])}}else if(typeof Z.content=="string"&&Z.content.trim()){let oe=Mn(Z.content);oe=yl(oe),_(Le=>[...Le,{type:"assistant",content:oe,timestamp:new Date}])}if(Z.role==="user"&&Array.isArray(Z.content))for(const oe of Z.content)oe.type==="tool_result"&&_(Le=>Le.map(rt=>rt.isToolUse&&rt.toolId===oe.tool_use_id?{...rt,toolResult:{content:oe.content,isError:oe.is_error,timestamp:new Date}}:rt));break;case"claude-output":{const oe=String(z.data||"");oe.trim()&&(B.current+=B.current?`
|
|
780
|
-
${oe}`:oe,K.current||(K.current=setTimeout(()=>{const Le=B.current;B.current="",K.current=null,Le&&_(rt=>{const yt=[...rt],xt=yt[yt.length-1];return xt&&xt.type==="assistant"&&!xt.isToolUse&&xt.isStreaming?xt.content=xt.content?`${xt.content}
|
|
781
|
-
${Le}`:Le:yt.push({type:"assistant",content:Le,timestamp:new Date,isStreaming:!0}),yt})},100)))}break;case"claude-interactive-prompt":_(oe=>[...oe,{type:"assistant",content:z.data,timestamp:new Date,isInteractivePrompt:!0}]);break;case"claude-error":_(oe=>[...oe,{type:"error",content:`Error: ${z.error}`,timestamp:new Date}]);break;case"cursor-system":try{const oe=z.data;if(oe&&oe.type==="system"&&oe.subtype==="init"&&oe.session_id){if(T&&oe.session_id!==T){console.log("🔄 Cursor session switch detected:",{originalSession:T,newSession:oe.session_id}),Ae(!0),p&&p(oe.session_id);return}if(!T){console.log("🔄 Cursor new session init detected:",{newSession:oe.session_id}),Ae(!0),p&&p(oe.session_id);return}}}catch(oe){console.warn("Error handling cursor-system message:",oe)}break;case"cursor-user":break;case"cursor-tool-use":_(oe=>[...oe,{type:"assistant",content:`Using tool: ${z.tool} ${z.input?`with ${z.input}`:""}`,timestamp:new Date,isToolUse:!0,toolName:z.tool,toolInput:z.input}]);break;case"cursor-error":_(oe=>[...oe,{type:"error",content:`Cursor error: ${z.error||"Unknown error"}`,timestamp:new Date}]);break;case"cursor-result":const de=z.sessionId||T;if(de===T&&(V(!1),Nt(!1),Lt(null)),de&&(c&&c(de),u&&u(de)),de===T)try{const oe=z.data||{},Le=typeof oe.result=="string"?oe.result:"";K.current&&(clearTimeout(K.current),K.current=null);const rt=B.current;B.current="",_(yt=>{const xt=[...yt],ct=xt[xt.length-1];if(ct&&ct.type==="assistant"&&!ct.isToolUse&&ct.isStreaming){const mt=Le&&Le.trim()?Le:(ct.content||"")+(rt||"");ct.content=mt,ct.isStreaming=!1}else Le&&Le.trim()&&xt.push({type:oe.is_error?"error":"assistant",content:Le,timestamp:new Date,isStreaming:!1});return xt})}catch(oe){console.warn("Error handling cursor-result message:",oe)}const Fe=sessionStorage.getItem("pendingSessionId");de&&!T&&de===Fe&&(Y(de),sessionStorage.removeItem("pendingSessionId"),window.refreshProjects&&setTimeout(()=>window.refreshProjects(),500));break;case"cursor-output":try{const Le=String(z.data??"").replace(/\x1b\[[0-9;?]*[A-Za-z]/g,"").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"").trim();Le&&(B.current+=B.current?`
|
|
782
|
-
${Le}`:Le,K.current||(K.current=setTimeout(()=>{const rt=B.current;B.current="",K.current=null,rt&&_(yt=>{const xt=[...yt],ct=xt[xt.length-1];return ct&&ct.type==="assistant"&&!ct.isToolUse&&ct.isStreaming?ct.content=ct.content?`${ct.content}
|
|
783
|
-
${rt}`:rt:xt.push({type:"assistant",content:rt,timestamp:new Date,isStreaming:!0}),xt})},100)))}catch(oe){console.warn("Error handling cursor-output message:",oe)}break;case"claude-complete":const He=z.sessionId||T||sessionStorage.getItem("pendingSessionId");(He===T||!T)&&(V(!1),Nt(!1),Lt(null),e&&t?.id&&(async()=>{try{const Le=`/api/projects/${e.name}/sessions/${t.id}/token-usage`,rt=await Qe(Le);if(rt.ok){const yt=await rt.json();$n(yt)}}catch(Le){console.error("Failed to fetch updated token usage:",Le)}})()),He&&(c&&c(He),u&&u(He));const ft=sessionStorage.getItem("pendingSessionId");ft&&!T&&z.exitCode===0&&(Y(ft),sessionStorage.removeItem("pendingSessionId"),console.log("✅ New session complete, ID set to:",ft)),e&&z.exitCode===0&&cr.removeItem(`chat_messages_${e.name}`);break;case"session-aborted":{const oe=z.sessionId||T;oe===T&&(V(!1),Nt(!1),Lt(null)),oe&&(c&&c(oe),u&&u(oe)),_(Le=>[...Le,{type:"assistant",content:"Session interrupted by user.",timestamp:new Date}]);break}case"session-status":{const oe=z.sessionId;(oe===T||t&&oe===t.id)&&z.isProcessing&&(V(!0),Nt(!0),d&&d(oe));break}case"claude-status":const Ve=z.data;if(Ve){let oe={text:"Working...",tokens:0,can_interrupt:!0};Ve.message?oe.text=Ve.message:Ve.status?oe.text=Ve.status:typeof Ve=="string"&&(oe.text=Ve),Ve.tokens?oe.tokens=Ve.tokens:Ve.token_count&&(oe.tokens=Ve.token_count),Ve.can_interrupt!==void 0&&(oe.can_interrupt=Ve.can_interrupt),Lt(oe),V(!0),Nt(oe.can_interrupt)}break}}},[s]),b.useEffect(()=>{e&&of()},[e]);const of=async()=>{try{const z=await at.getFiles(e.name);if(z.ok){const ae=await z.json(),ee=T0(ae);be(ee)}}catch(z){console.error("Error fetching files:",z)}},T0=(z,ae="")=>{let ee=[];for(const Z of z){const de=ae?`${ae}/${Z.name}`:Z.name;Z.type==="directory"&&Z.children?ee=ee.concat(T0(Z.children,de)):Z.type==="file"&&ee.push({name:Z.name,path:de,relativePath:Z.path})}return ee};b.useEffect(()=>{const z=F.slice(0,qt),ae=z.lastIndexOf("@");if(ae!==-1){const ee=z.slice(ae+1);if(ee.includes(" "))R(!1),Lr(-1);else{Lr(ae),R(!0);const Z=Q.filter(de=>de.name.toLowerCase().includes(ee.toLowerCase())||de.path.toLowerCase().includes(ee.toLowerCase())).slice(0,10);re(Z),pt(-1)}}else R(!1),Lr(-1)},[F,qt,Q]),b.useEffect(()=>{const z=setTimeout(()=>{Ge(F)},150);return()=>clearTimeout(z)},[F]);const E0=b.useMemo(()=>M.length<=ve?M:M.slice(-ve),[M,ve]);b.useEffect(()=>{if(!j&&ie.current){const z=ie.current;vn.current={height:z.scrollHeight,top:z.scrollTop}}}),b.useEffect(()=>{if(ie.current&&M.length>0)if(j)Pr||setTimeout(()=>tn(),50);else{const z=ie.current,ae=vn.current.height,ee=vn.current.top,de=z.scrollHeight-ae;de>0&&ee>0&&(z.scrollTop=ee+de)}},[M.length,Pr,tn,j]),b.useEffect(()=>{ie.current&&M.length>0&&!Se.current&&(en(!1),setTimeout(()=>{tn()},200))},[t?.id,e?.name]),b.useEffect(()=>{const z=ie.current;if(z)return z.addEventListener("scroll",Li),()=>z.removeEventListener("scroll",Li)},[Li]),b.useEffect(()=>{if(Oe.current){Oe.current.style.height="auto",Oe.current.style.height=Oe.current.scrollHeight+"px";const z=parseInt(window.getComputedStyle(Oe.current).lineHeight),ae=Oe.current.scrollHeight>z*2;lr(ae)}},[]),b.useEffect(()=>{Oe.current&&!F.trim()&&(Oe.current.style.height="auto",lr(!1))},[F]),b.useEffect(()=>{if(!e||!t?.id||t.id.startsWith("new-session-")){$n(null);return}(async()=>{try{const ae=`/api/projects/${e.name}/sessions/${t.id}/token-usage`,ee=await Qe(ae);if(ee.ok){const Z=await ee.json();$n(Z)}else $n(null)}catch(ae){console.error("Failed to fetch initial token usage:",ae)}})()},[t?.id,e?.path]);const lf=b.useCallback(z=>{z.trim()&&W(ae=>{const ee=ae.trim()?`${ae} ${z}`:z;return setTimeout(()=>{if(Oe.current){Oe.current.style.height="auto",Oe.current.style.height=Oe.current.scrollHeight+"px";const Z=parseInt(window.getComputedStyle(Oe.current).lineHeight),de=Oe.current.scrollHeight>Z*2;lr(de)}},0),ee})},[]),cf=b.useCallback(()=>{tt(z=>z+100)},[]),vs=b.useCallback(z=>{const ae=z.filter(ee=>{try{if(!ee||typeof ee!="object")return console.warn("Invalid file object:",ee),!1;if(!ee.type||!ee.type.startsWith("image/"))return!1;if(!ee.size||ee.size>5242880){const Z=ee.name||"Unknown file";return st(de=>{const Fe=new Map(de);return Fe.set(Z,"File too large (max 5MB)"),Fe}),!1}return!0}catch(Z){return console.error("Error validating file:",Z,ee),!1}});ae.length>0&&ut(ee=>[...ee,...ae].slice(0,5))},[]),df=b.useCallback(async z=>{const ae=Array.from(z.clipboardData.items);for(const ee of ae)if(ee.type.startsWith("image/")){const Z=ee.getAsFile();Z&&vs([Z])}if(ae.length===0&&z.clipboardData.files.length>0){const Z=Array.from(z.clipboardData.files).filter(de=>de.type.startsWith("image/"));Z.length>0&&vs(Z)}},[vs]),{getRootProps:uf,getInputProps:mf,isDragActive:hf,open:pf}=yp({accept:{"image/*":[".png",".jpg",".jpeg",".gif",".webp",".svg"]},maxSize:5*1024*1024,maxFiles:5,onDrop:vs,noClick:!0,noKeyboard:!0}),_n=b.useCallback(async z=>{if(z.preventDefault(),!F.trim()||O||!e)return;let ae=[];if(bt.length>0){const ft=new FormData;bt.forEach(Ve=>{ft.append("images",Ve)});try{const Ve=cr.getItem("auth-token"),oe={};Ve&&(oe.Authorization=`Bearer ${Ve}`);const Le=await fetch(`/api/projects/${e.name}/upload-images`,{method:"POST",headers:oe,body:ft});if(!Le.ok)throw new Error("Failed to upload images");ae=(await Le.json()).images}catch(Ve){console.error("Image upload failed:",Ve),_(oe=>[...oe,{type:"error",content:`Failed to upload images: ${Ve.message}`,timestamp:new Date}]);return}}const ee={type:"user",content:F,images:ae,timestamp:new Date};_(ft=>[...ft,ee]),V(!0),Nt(!0),Lt({text:"Processing",tokens:0,can_interrupt:!0}),en(!1),setTimeout(()=>tn(),100);const Z=T||t?.id||sessionStorage.getItem("cursorSessionId"),de=Z||`new-session-${Date.now()}`;l&&l(de);const He=(()=>{try{const ft=Pt==="cursor"?"cursor-tools-settings":"claude-settings",Ve=cr.getItem(ft);if(Ve)return JSON.parse(Ve)}catch(ft){console.error("Error loading tools settings:",ft)}return{allowedTools:[],disallowedTools:[],skipPermissions:!1}})();a(Pt==="cursor"?{type:"cursor-command",command:F,sessionId:Z,options:{cwd:e.fullPath||e.path,projectPath:e.fullPath||e.path,sessionId:Z,resume:!!Z,model:sa,skipPermissions:He?.skipPermissions||!1,toolsSettings:He}}:{type:"claude-command",command:F,options:{projectPath:e.path,cwd:e.fullPath,sessionId:T,resume:!!T,toolsSettings:He,permissionMode:Be,images:ae}}),W(""),ut([]),lt(new Map),st(new Map),lr(!1),Oe.current&&(Oe.current.style.height="auto"),e&&cr.removeItem(`draft_input_${e.name}`)},[F,O,e,bt,T,t,Pt,Be,l,sa,a,W,ut,lt,st,lr,Oe,_,V,Nt,Lt,en,tn]);b.useEffect(()=>{zi.current=_n},[_n]);const I0=z=>{if(!z)return;const ae=F.slice(0,xs),ee=F.slice(xs),Z=ee.indexOf(" "),de=Z!==-1?ee.slice(Z):"",Fe=ae+z.name+" "+de;W(Fe),X(!1),P(-1),Nr(""),tr(-1),ke.current&&clearTimeout(ke.current),M0(z)},ff=z=>{if(Rr&&wt.length>0){if(z.key==="ArrowDown"){z.preventDefault(),tr(ae=>ae<wt.length-1?ae+1:0);return}if(z.key==="ArrowUp"){z.preventDefault(),tr(ae=>ae>0?ae-1:wt.length-1);return}if(z.key==="Tab"||z.key==="Enter"){z.preventDefault(),Da>=0?I0(wt[Da]):wt.length>0&&I0(wt[0]);return}if(z.key==="Escape"){z.preventDefault(),X(!1),P(-1),Nr(""),tr(-1),ke.current&&clearTimeout(ke.current);return}}if(ce&&je.length>0){if(z.key==="ArrowDown"){z.preventDefault(),pt(ae=>ae<je.length-1?ae+1:0);return}if(z.key==="ArrowUp"){z.preventDefault(),pt(ae=>ae>0?ae-1:je.length-1);return}if(z.key==="Tab"||z.key==="Enter"){z.preventDefault(),Me>=0?Pi(je[Me]):je.length>0&&Pi(je[0]);return}if(z.key==="Escape"){z.preventDefault(),R(!1);return}}if(z.key==="Tab"&&!ce&&!Rr){z.preventDefault();const ae=["default","acceptEdits","bypassPermissions","plan"],Z=(ae.indexOf(Be)+1)%ae.length,de=ae[Z];nt(de),t?.id&&localStorage.setItem(`permissionMode-${t.id}`,de);return}if(z.key==="Enter"){if(z.nativeEvent.isComposing)return;(z.ctrlKey||z.metaKey)&&!z.shiftKey?(z.preventDefault(),_n(z)):!z.shiftKey&&!z.ctrlKey&&!z.metaKey&&(N||(z.preventDefault(),_n(z)))}},Pi=z=>{const ae=F.slice(0,Kt),ee=F.slice(Kt),Z=ee.indexOf(" "),de=Z!==-1?ee.slice(Z):"",Fe=ae+"@"+z.path+" "+de,He=ae.length+1+z.path.length+1;Oe.current&&!Oe.current.matches(":focus")&&Oe.current.focus(),W(Fe),zt(He),R(!1),Lr(-1),Oe.current&&requestAnimationFrame(()=>{Oe.current&&(Oe.current.setSelectionRange(He,He),Oe.current.matches(":focus")||Oe.current.focus())})},gf=z=>{const ae=z.target.value,ee=z.target.selectionStart;if(!T&&ae.trim(),W(ae),zt(ee),!ae.trim()){z.target.style.height="auto",lr(!1),X(!1),P(-1),Nr("");return}const Z=ae.slice(0,ee);if((Z.match(/```/g)||[]).length%2===1){X(!1),P(-1),Nr("");return}const He=/(^|\s)\/(\S*)$/,ft=Z.match(He);if(ft){const Ve=ft.index+ft[1].length,oe=ft[2];P(Ve),X(!0),tr(-1),ke.current&&clearTimeout(ke.current),ke.current=setTimeout(()=>{Nr(oe)},150)}else X(!1),P(-1),Nr(""),ke.current&&clearTimeout(ke.current)},xf=z=>{zt(z.target.selectionStart)},bf=()=>{T&&_r&&a({type:"abort-session",sessionId:T,provider:Pt})},yf=()=>{const z=["default","acceptEdits","bypassPermissions","plan"],ee=(z.indexOf(Be)+1)%z.length,Z=z[ee];nt(Z),t?.id&&localStorage.setItem(`permissionMode-${t.id}`,Z)};return e?n.jsxs(n.Fragment,{children:[n.jsx("style",{children:`
|
|
784
|
-
details[open] .details-chevron {
|
|
785
|
-
transform: rotate(180deg);
|
|
786
|
-
}
|
|
787
|
-
`}),n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsxs("div",{ref:ie,className:"flex-1 overflow-y-auto overflow-x-hidden px-0 py-3 sm:p-4 space-y-3 sm:space-y-4 relative",children:[C&&M.length===0?n.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400 mt-8",children:n.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[n.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-gray-400"}),n.jsx("p",{children:"Loading session messages..."})]})}):M.length===0?n.jsxs("div",{className:"flex items-center justify-center h-full",children:[!t&&!T&&n.jsxs("div",{className:"text-center px-6 sm:px-4 py-8",children:[n.jsx("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-3",children:"Choose Your AI Assistant"}),n.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-8",children:"Select a provider to start a new conversation"}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center mb-8",children:[n.jsxs("button",{onClick:()=>{Sr("claude"),localStorage.setItem("selected-provider","claude"),setTimeout(()=>Oe.current?.focus(),100)},className:`group relative w-64 h-32 bg-white dark:bg-gray-800 rounded-xl border-2 transition-all duration-200 hover:scale-105 hover:shadow-xl ${Pt==="claude"?"border-blue-500 shadow-lg ring-2 ring-blue-500/20":"border-gray-200 dark:border-gray-700 hover:border-blue-400"}`,children:[n.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[n.jsx(Wr,{className:"w-10 h-10"}),n.jsxs("div",{children:[n.jsx("p",{className:"font-semibold text-gray-900 dark:text-white",children:"Claude"}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"by Anthropic"})]})]}),Pt==="claude"&&n.jsx("div",{className:"absolute top-2 right-2",children:n.jsx("div",{className:"w-5 h-5 bg-blue-500 rounded-full flex items-center justify-center",children:n.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})})})]}),n.jsxs("button",{onClick:()=>{Sr("cursor"),localStorage.setItem("selected-provider","cursor"),setTimeout(()=>Oe.current?.focus(),100)},className:`group relative w-64 h-32 bg-white dark:bg-gray-800 rounded-xl border-2 transition-all duration-200 hover:scale-105 hover:shadow-xl ${Pt==="cursor"?"border-purple-500 shadow-lg ring-2 ring-purple-500/20":"border-gray-200 dark:border-gray-700 hover:border-purple-400"}`,children:[n.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-3",children:[n.jsx(on,{className:"w-10 h-10"}),n.jsxs("div",{children:[n.jsx("p",{className:"font-semibold text-gray-900 dark:text-white",children:"Cursor"}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"AI Code Editor"})]})]}),Pt==="cursor"&&n.jsx("div",{className:"absolute top-2 right-2",children:n.jsx("div",{className:"w-5 h-5 bg-purple-500 rounded-full flex items-center justify-center",children:n.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})})})]})]}),n.jsxs("div",{className:`mb-6 transition-opacity duration-200 ${Pt==="cursor"?"opacity-100":"opacity-0 pointer-events-none"}`,children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:Pt==="cursor"?"Select Model":" "}),n.jsxs("select",{value:sa,onChange:z=>{const ae=z.target.value;C0(ae),localStorage.setItem("cursor-model",ae)},className:"pl-4 pr-10 py-2 text-sm bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 min-w-[140px]",disabled:Pt!=="cursor",children:[n.jsx("option",{value:"gpt-5",children:"GPT-5"}),n.jsx("option",{value:"sonnet-4",children:"Sonnet-4"}),n.jsx("option",{value:"opus-4.1",children:"Opus 4.1"})]})]}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:Pt==="claude"?"Ready to use Claude AI. Start typing your message below.":Pt==="cursor"?`Ready to use Cursor with ${sa}. Start typing your message below.`:"Select a provider above to begin"}),Pt&&H&&n.jsx("div",{className:"mt-4 px-4 sm:px-0",children:n.jsx(Kd,{onStartTask:()=>W("Start the next task"),onShowAllTasks:I})})]}),t&&n.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400 px-6 sm:px-4",children:[n.jsx("p",{className:"font-bold text-lg sm:text-xl mb-3",children:"Continue your conversation"}),n.jsx("p",{className:"text-sm sm:text-base leading-relaxed",children:"Ask questions about your code, request changes, or get help with development tasks"}),H&&n.jsx("div",{className:"mt-4 px-4 sm:px-0",children:n.jsx(Kd,{onStartTask:()=>W("Start the next task"),onShowAllTasks:I})})]})]}):n.jsxs(n.Fragment,{children:[xe&&n.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400 py-3",children:n.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[n.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-gray-400"}),n.jsx("p",{className:"text-sm",children:"Loading older messages..."})]})}),De&&!xe&&n.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400 text-sm py-2 border-b border-gray-200 dark:border-gray-700",children:_e>0&&n.jsxs("span",{children:["Showing ",$.length," of ",_e," messages •",n.jsx("span",{className:"text-xs",children:"Scroll up to load more"})]})}),!De&&M.length>ve&&n.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400 text-sm py-2 border-b border-gray-200 dark:border-gray-700",children:["Showing last ",ve," messages (",M.length," total) •",n.jsx("button",{className:"ml-1 text-blue-600 hover:text-blue-700 underline",onClick:cf,children:"Load earlier messages"})]}),E0.map((z,ae)=>{const ee=ae>0?E0[ae-1]:null;return n.jsx(Lw,{message:z,index:ae,prevMessage:ee,createDiff:nf,onFileOpen:i,onShowSettings:x,autoExpandTools:y,showRawParameters:k,showThinking:w,selectedProject:e},ae)})]}),O&&n.jsx("div",{className:"chat-message assistant",children:n.jsxs("div",{className:"w-full",children:[n.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[n.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-sm flex-shrink-0 p-1 bg-transparent",children:(localStorage.getItem("selected-provider")||"claude")==="cursor"?n.jsx(on,{className:"w-full h-full"}):n.jsx(Wr,{className:"w-full h-full"})}),n.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-white",children:(localStorage.getItem("selected-provider")||"claude")==="cursor"?"Cursor":"Claude"})]}),n.jsx("div",{className:"w-full text-sm text-gray-500 dark:text-gray-400 pl-3 sm:pl-0",children:n.jsxs("div",{className:"flex items-center space-x-1",children:[n.jsx("div",{className:"animate-pulse",children:"●"}),n.jsx("div",{className:"animate-pulse",style:{animationDelay:"0.2s"},children:"●"}),n.jsx("div",{className:"animate-pulse",style:{animationDelay:"0.4s"},children:"●"}),n.jsx("span",{className:"ml-2",children:"Thinking..."})]})})]})}),n.jsx("div",{ref:St})]}),n.jsxs("div",{className:"p-2 sm:p-4 md:p-4 flex-shrink-0 pb-2 sm:pb-4 md:pb-6",children:[n.jsx("div",{className:"flex-1",children:n.jsx(H7,{status:Et,isLoading:O,onAbort:bf,provider:Pt,showThinking:w})}),n.jsx("div",{ref:Qt,className:"max-w-4xl mx-auto mb-3",children:n.jsxs("div",{className:"flex items-center justify-center gap-3",children:[n.jsx("button",{type:"button",onClick:yf,className:`px-3 py-1.5 rounded-lg text-sm font-medium border transition-all duration-200 ${Be==="default"?"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 border-gray-300 dark:border-gray-600 hover:bg-gray-200 dark:hover:bg-gray-600":Be==="acceptEdits"?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-300 border-green-300 dark:border-green-600 hover:bg-green-100 dark:hover:bg-green-900/30":Be==="bypassPermissions"?"bg-orange-50 dark:bg-orange-900/20 text-orange-700 dark:text-orange-300 border-orange-300 dark:border-orange-600 hover:bg-orange-100 dark:hover:bg-orange-900/30":"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300 border-blue-300 dark:border-blue-600 hover:bg-blue-100 dark:hover:bg-blue-900/30"}`,title:"Click to change permission mode (or press Tab in input)",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`w-2 h-2 rounded-full ${Be==="default"?"bg-gray-500":Be==="acceptEdits"?"bg-green-500":Be==="bypassPermissions"?"bg-orange-500":"bg-blue-500"}`}),n.jsxs("span",{children:[Be==="default"&&"Default Mode",Be==="acceptEdits"&&"Accept Edits",Be==="bypassPermissions"&&"Bypass Permissions",Be==="plan"&&"Plan Mode"]})]})}),n.jsx(U7,{used:On?.used||0,total:On?.total||parseInt(void 0)||16e4}),n.jsxs("button",{type:"button",onClick:()=>{const z=!Rr;X(z),Nr(""),tr(-1),z&&Jt(le),Oe.current&&Oe.current.focus()},className:"relative w-8 h-8 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 rounded-full flex items-center justify-center transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:ring-offset-gray-800",title:"Show all commands",children:[n.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})}),le.length>0&&n.jsx("span",{className:"absolute -top-1 -right-1 bg-blue-600 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center",style:{fontSize:"10px"},children:le.length})]}),F.trim()&&n.jsx("button",{type:"button",onClick:z=>{z.preventDefault(),z.stopPropagation(),W(""),Oe.current&&(Oe.current.style.height="auto",Oe.current.focus()),lr(!1)},className:"w-8 h-8 bg-white dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-full flex items-center justify-center transition-all duration-200 group shadow-sm",title:"Clear input",children:n.jsx("svg",{className:"w-4 h-4 text-gray-600 dark:text-gray-300 group-hover:text-gray-800 dark:group-hover:text-gray-100 transition-colors",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),Pr&&M.length>0&&n.jsx("button",{onClick:tn,className:"w-8 h-8 bg-blue-600 hover:bg-blue-700 text-white rounded-full shadow-lg flex items-center justify-center transition-all duration-200 hover:scale-105 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:ring-offset-gray-800",title:"Scroll to bottom",children:n.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})})]})}),n.jsxs("form",{onSubmit:_n,className:"relative max-w-4xl mx-auto",children:[hf&&n.jsx("div",{className:"absolute inset-0 bg-blue-500/20 border-2 border-dashed border-blue-500 rounded-lg flex items-center justify-center z-50",children:n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg p-4 shadow-lg",children:[n.jsx("svg",{className:"w-8 h-8 text-blue-500 mx-auto mb-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),n.jsx("p",{className:"text-sm font-medium",children:"Drop images here"})]})}),bt.length>0&&n.jsx("div",{className:"mb-2 p-2 bg-gray-50 dark:bg-gray-800 rounded-lg",children:n.jsx("div",{className:"flex flex-wrap gap-2",children:bt.map((z,ae)=>n.jsx(Pw,{file:z,onRemove:()=>{ut(ee=>ee.filter((Z,de)=>de!==ae))},uploadProgress:jt.get(z.name),error:qe.get(z.name)},ae))})}),ce&&je.length>0&&n.jsx("div",{className:"absolute bottom-full left-0 right-0 mb-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg max-h-48 overflow-y-auto z-50 backdrop-blur-sm",children:je.map((z,ae)=>n.jsxs("div",{className:`px-4 py-3 cursor-pointer border-b border-gray-100 dark:border-gray-700 last:border-b-0 touch-manipulation ${ae===Me?"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300":"hover:bg-gray-50 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300"}`,onMouseDown:ee=>{ee.preventDefault(),ee.stopPropagation()},onClick:ee=>{ee.preventDefault(),ee.stopPropagation(),Pi(z)},children:[n.jsx("div",{className:"font-medium text-sm",children:z.name}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 font-mono",children:z.path})]},z.path))}),n.jsx(Iw,{commands:wt,selectedIndex:Da,onSelect:ef,onClose:()=>{X(!1),P(-1),Nr(""),tr(-1)},position:{top:Oe.current?Math.max(16,Oe.current.getBoundingClientRect().top-316):0,left:Oe.current?Oe.current.getBoundingClientRect().left:16,bottom:Oe.current?window.innerHeight-Oe.current.getBoundingClientRect().top+8:90},isOpen:Rr,frequentCommands:Yt?[]:Zp}),n.jsxs("div",{...uf(),className:`relative bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 focus-within:ring-2 focus-within:ring-blue-500 dark:focus-within:ring-blue-500 focus-within:border-blue-500 transition-all duration-200 overflow-hidden ${Ii?"chat-input-expanded":""}`,children:[n.jsx("input",{...mf()}),n.jsx("textarea",{ref:Oe,value:F,onChange:gf,onClick:xf,onKeyDown:ff,onPaste:df,onFocus:()=>he(!0),onBlur:()=>he(!1),onInput:z=>{z.target.style.height="auto",z.target.style.height=z.target.scrollHeight+"px",zt(z.target.selectionStart);const ae=parseInt(window.getComputedStyle(z.target).lineHeight),ee=z.target.scrollHeight>ae*2;lr(ee)},placeholder:`Type / for commands, @ for files, or ask ${Pt==="cursor"?"Cursor":"Claude"} anything...`,disabled:O,className:"chat-input-placeholder block w-full pl-12 pr-20 sm:pr-40 py-1.5 sm:py-4 bg-transparent rounded-2xl focus:outline-none text-gray-900 dark:text-gray-100 placeholder-gray-400 dark:placeholder-gray-500 disabled:opacity-50 resize-none min-h-[50px] sm:min-h-[80px] max-h-[40vh] sm:max-h-[300px] overflow-y-auto text-sm sm:text-base leading-[21px] sm:leading-6 transition-all duration-200",style:{height:"50px"}}),n.jsx("button",{type:"button",onClick:pf,className:"absolute left-2 top-1/2 transform -translate-y-1/2 p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Attach images",children:n.jsx("svg",{className:"w-5 h-5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),n.jsx("div",{className:"absolute right-16 sm:right-16 top-1/2 transform -translate-y-1/2",style:{display:"none"},children:n.jsx(kp,{onTranscript:lf,className:"w-10 h-10 sm:w-10 sm:h-10"})}),n.jsx("button",{type:"submit",disabled:!F.trim()||O,onMouseDown:z=>{z.preventDefault(),_n(z)},onTouchStart:z=>{z.preventDefault(),_n(z)},className:"absolute right-2 top-1/2 transform -translate-y-1/2 w-12 h-12 sm:w-12 sm:h-12 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed rounded-full flex items-center justify-center transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:ring-offset-gray-800",children:n.jsx("svg",{className:"w-4 h-4 sm:w-5 sm:h-5 text-white transform rotate-90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})}),n.jsx("div",{className:`absolute bottom-1 left-12 right-14 sm:right-40 text-xs text-gray-400 dark:text-gray-500 pointer-events-none hidden sm:block transition-opacity duration-200 ${F.trim()?"opacity-0":"opacity-100"}`,children:N?"Ctrl+Enter to send • Shift+Enter for new line • Tab to change modes • / for slash commands":"Enter to send • Shift+Enter for new line • Tab to change modes • / for slash commands"})]})]})]})]})]}):n.jsx("div",{className:"flex items-center justify-center h-full",children:n.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400",children:n.jsx("p",{children:"Select a project to start chatting with Claude"})})})}const Fw=Jr.memo(Rw);class Ut{constructor(t,r,a,s){this.fromA=t,this.toA=r,this.fromB=a,this.toB=s}offset(t,r=t){return new Ut(this.fromA+t,this.toA+t,this.fromB+r,this.toB+r)}}function ea(e,t,r,a,s,i){if(e==a)return[];let o=k0(e,t,r,a,s,i),l=w0(e,t+o,r,a,s+o,i);t+=o,r-=l,s+=o,i-=l;let c=r-t,d=i-s;if(!c||!d)return[new Ut(t,r,s,i)];if(c>d){let m=e.slice(t,r).indexOf(a.slice(s,i));if(m>-1)return[new Ut(t,t+m,s,s),new Ut(t+m+d,r,i,i)]}else if(d>c){let m=a.slice(s,i).indexOf(e.slice(t,r));if(m>-1)return[new Ut(t,t,s,s+m),new Ut(r,r,s+m+c,i)]}if(c==1||d==1)return[new Ut(t,r,s,i)];let u=zp(e,t,r,a,s,i);if(u){let[m,h,p]=u;return ea(e,t,m,a,s,h).concat(ea(e,m+p,r,a,h+p,i))}return Bw(e,t,r,a,s,i)}let qa=1e9,Ha=0,v0=!1;function Bw(e,t,r,a,s,i){let o=r-t,l=i-s;if(qa<1e9&&Math.min(o,l)>qa*16||Ha>0&&Date.now()>Ha)return Math.min(o,l)>qa*64?[new Ut(t,r,s,i)]:eu(e,t,r,a,s,i);let c=Math.ceil((o+l)/2);To.reset(c),Eo.reset(c);let d=(p,x)=>e.charCodeAt(t+p)==a.charCodeAt(s+x),u=(p,x)=>e.charCodeAt(r-p-1)==a.charCodeAt(i-x-1),m=(o-l)%2!=0?Eo:null,h=m?null:To;for(let p=0;p<c;p++){if(p>qa||Ha>0&&!(p&63)&&Date.now()>Ha)return eu(e,t,r,a,s,i);let x=To.advance(p,o,l,c,m,!1,d)||Eo.advance(p,o,l,c,h,!0,u);if(x)return Ow(e,t,r,t+x[0],a,s,i,s+x[1])}return[new Ut(t,r,s,i)]}class Ip{constructor(){this.vec=[]}reset(t){this.len=t<<1;for(let r=0;r<this.len;r++)this.vec[r]=-1;this.vec[t+1]=0,this.start=this.end=0}advance(t,r,a,s,i,o,l){for(let c=-t+this.start;c<=t-this.end;c+=2){let d=s+c,u=c==-t||c!=t&&this.vec[d-1]<this.vec[d+1]?this.vec[d+1]:this.vec[d-1]+1,m=u-c;for(;u<r&&m<a&&l(u,m);)u++,m++;if(this.vec[d]=u,u>r)this.end+=2;else if(m>a)this.start+=2;else if(i){let h=s+(r-a)-c;if(h>=0&&h<this.len&&i.vec[h]!=-1)if(o){let p=i.vec[h];if(p>=r-u)return[p,s+p-h]}else{let p=r-i.vec[h];if(u>=p)return[u,m]}}}return null}}const To=new Ip,Eo=new Ip;function Ow(e,t,r,a,s,i,o,l){let c=!1;return!wa(e,a)&&++a==r&&(c=!0),!wa(s,l)&&++l==o&&(c=!0),c?[new Ut(t,r,i,o)]:ea(e,t,a,s,i,l).concat(ea(e,a,r,s,l,o))}function Dp(e,t){let r=1,a=Math.min(e,t);for(;r<a;)r=r<<1;return r}function k0(e,t,r,a,s,i){if(t==r||t==i||e.charCodeAt(t)!=a.charCodeAt(s))return 0;let o=Dp(r-t,i-s);for(let l=t,c=s;;){let d=l+o,u=c+o;if(d>r||u>i||e.slice(l,d)!=a.slice(c,u)){if(o==1)return l-t-(wa(e,l)?0:1);o=o>>1}else{if(d==r||u==i)return d-t;l=d,c=u}}}function w0(e,t,r,a,s,i){if(t==r||s==i||e.charCodeAt(r-1)!=a.charCodeAt(i-1))return 0;let o=Dp(r-t,i-s);for(let l=r,c=i;;){let d=l-o,u=c-o;if(d<t||u<s||e.slice(d,l)!=a.slice(u,c)){if(o==1)return r-l-(wa(e,l)?0:1);o=o>>1}else{if(d==t||u==s)return r-d;l=d,c=u}}}function vl(e,t,r,a,s,i,o,l){let c=a.slice(s,i),d=null;for(;;){if(d||o<l)return d;for(let u=t+o;;){wa(e,u)||u++;let m=u+o;if(wa(e,m)||(m+=m==u+1?1:-1),m>=r)break;let h=e.slice(u,m),p=-1;for(;(p=c.indexOf(h,p+1))!=-1;){let x=k0(e,m,r,a,s+p+h.length,i),y=w0(e,t,u,a,s,s+p),k=h.length+x+y;(!d||d[2]<k)&&(d=[u-y,s+p-y,k])}u=m}if(l<0)return d;o=o>>1}}function zp(e,t,r,a,s,i){let o=r-t,l=i-s;if(o<l){let c=zp(a,s,i,e,t,r);return c&&[c[1],c[0],c[2]]}return o<4||l*2<o?null:vl(e,t,r,a,s,i,Math.floor(o/4),-1)}function eu(e,t,r,a,s,i){v0=!0;let o=r-t,l=i-s,c;if(o<l){let h=vl(a,s,i,e,t,r,Math.floor(o/6),50);c=h&&[h[1],h[0],h[2]]}else c=vl(e,t,r,a,s,i,Math.floor(l/6),50);if(!c)return[new Ut(t,r,s,i)];let[d,u,m]=c;return ea(e,t,d,a,s,u).concat(ea(e,d+m,r,a,u+m,i))}function Lp(e,t){for(let r=1;r<e.length;r++){let a=e[r-1],s=e[r];a.toA>s.fromA-t&&a.toB>s.fromB-t&&(e[r-1]=new Ut(a.fromA,s.toA,a.fromB,s.toB),e.splice(r--,1))}}function $w(e,t,r){for(;;){Lp(r,1);let a=!1;for(let s=0;s<r.length;s++){let i=r[s],o,l;(o=k0(e,i.fromA,i.toA,t,i.fromB,i.toB))&&(i=r[s]=new Ut(i.fromA+o,i.toA,i.fromB+o,i.toB)),(l=w0(e,i.fromA,i.toA,t,i.fromB,i.toB))&&(i=r[s]=new Ut(i.fromA,i.toA-l,i.fromB,i.toB-l));let c=i.toA-i.fromA,d=i.toB-i.fromB;if(c&&d)continue;let u=i.fromA-(s?r[s-1].toA:0),m=(s<r.length-1?r[s+1].fromA:e.length)-i.toA;if(!u||!m)continue;let h=c?e.slice(i.fromA,i.toA):t.slice(i.fromB,i.toB);u<=h.length&&e.slice(i.fromA-u,i.fromA)==h.slice(h.length-u)?(r[s]=new Ut(i.fromA-u,i.toA-u,i.fromB-u,i.toB-u),a=!0):m<=h.length&&e.slice(i.toA,i.toA+m)==h.slice(0,m)&&(r[s]=new Ut(i.fromA+m,i.toA+m,i.fromB+m,i.toB+m),a=!0)}if(!a)break}return r}function _w(e,t,r){for(let a=0,s=0;s<e.length;s++){let i=e[s],o=i.toA-i.fromA,l=i.toB-i.fromB;if(o&&l||o>3||l>3){let c=s==e.length-1?t.length:e[s+1].fromA,d=i.fromA-a,u=c-i.toA,m=ru(t,i.fromA,d),h=tu(t,i.toA,u),p=i.fromA-m,x=h-i.toA;if((!o||!l)&&p&&x){let y=Math.max(o,l),[k,w,j]=o?[t,i.fromA,i.toA]:[r,i.fromB,i.toB];y>p&&t.slice(m,i.fromA)==k.slice(j-p,j)?(i=e[s]=new Ut(m,m+o,i.fromB-p,i.toB-p),m=i.fromA,h=tu(t,i.toA,c-i.toA)):y>x&&t.slice(i.toA,h)==k.slice(w,w+x)&&(i=e[s]=new Ut(h-o,h,i.fromB+x,i.toB+x),h=i.toA,m=ru(t,i.fromA,i.fromA-a)),p=i.fromA-m,x=h-i.toA}if(p||x)i=e[s]=new Ut(i.fromA-p,i.toA+x,i.fromB-p,i.toB+x);else if(o){if(!l){let y=au(t,i.fromA,i.toA),k,w=y<0?-1:nu(t,i.toA,i.fromA);y>-1&&(k=y-i.fromA)<=u&&t.slice(i.fromA,y)==t.slice(i.toA,i.toA+k)?i=e[s]=i.offset(k):w>-1&&(k=i.toA-w)<=d&&t.slice(i.fromA-k,i.fromA)==t.slice(w,i.toA)&&(i=e[s]=i.offset(-k))}}else{let y=au(r,i.fromB,i.toB),k,w=y<0?-1:nu(r,i.toB,i.fromB);y>-1&&(k=y-i.fromB)<=u&&r.slice(i.fromB,y)==r.slice(i.toB,i.toB+k)?i=e[s]=i.offset(k):w>-1&&(k=i.toB-w)<=d&&r.slice(i.fromB-k,i.fromB)==r.slice(w,i.toB)&&(i=e[s]=i.offset(-k))}}a=i.toA}return Lp(e,3),e}let Xn;try{Xn=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch{}function Pp(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Rp(e,t){if(t==e.length)return 0;let r=e.charCodeAt(t);return r<192?Pp(r)?1:0:Xn?!Op(r)||t==e.length-1?Xn.test(String.fromCharCode(r))?1:0:Xn.test(e.slice(t,t+2))?2:0:0}function Fp(e,t){if(!t)return 0;let r=e.charCodeAt(t-1);return r<192?Pp(r)?1:0:Xn?!$p(r)||t==1?Xn.test(String.fromCharCode(r))?1:0:Xn.test(e.slice(t-2,t))?2:0:0}const Bp=8;function tu(e,t,r){if(t==e.length||!Fp(e,t))return t;for(let a=t,s=t+r,i=0;i<Bp;i++){let o=Rp(e,a);if(!o||a+o>s)return a;a+=o}return t}function ru(e,t,r){if(!t||!Rp(e,t))return t;for(let a=t,s=t-r,i=0;i<Bp;i++){let o=Fp(e,a);if(!o||a-o<s)return a;a-=o}return t}function nu(e,t,r){for(;t!=r;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function au(e,t,r){for(;t!=r;t++)if(e.charCodeAt(t)==10)return t;return-1}const Op=e=>e>=55296&&e<=56319,$p=e=>e>=56320&&e<=57343;function wa(e,t){return!t||t==e.length||!Op(e.charCodeAt(t-1))||!$p(e.charCodeAt(t))}function qw(e,t,r){var a;return qa=((a=r?.scanLimit)!==null&&a!==void 0?a:1e9)>>1,Ha=r?.timeout?Date.now()+r.timeout:0,v0=!1,$w(e,t,ea(e,0,e.length,t,0,t.length))}function _p(){return!v0}function qp(e,t,r){return _w(qw(e,t,r),e,t)}const gn=pi.define({combine:e=>e[0]}),Hw=Nl.define(),Hp=pi.define(),zr=as.define({create(e){return null},update(e,t){for(let r of t.effects)r.is(Hw)&&(e=r.value);for(let r of t.state.facet(Hp))e=r(e,t);return e}});function Io(e){let t=e.field(zr,!1);if(!t)return null;let r=e.facet(gn);return{chunks:t,side:r?r.side:null}}class fa{constructor(t,r,a,s,i,o=!0){this.changes=t,this.fromA=r,this.toA=a,this.fromB=s,this.toB=i,this.precise=o}offset(t,r){return t||r?new fa(this.changes,this.fromA+t,this.toA+t,this.fromB+r,this.toB+r,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(t,r,a){let s=qp(t.toString(),r.toString(),a);return Up(s,t,r,0,0,_p())}static updateA(t,r,a,s,i){return cu(lu(t,s,!0,a.length),t,r,a,i)}static updateB(t,r,a,s,i){return cu(lu(t,s,!1,r.length),t,r,a,i)}}function su(e,t,r,a){let s=r.lineAt(e),i=a.lineAt(t);return s.to==e&&i.to==t&&e<r.length&&t<a.length?[e+1,t+1]:[s.from,i.from]}function iu(e,t,r,a){let s=r.lineAt(e),i=a.lineAt(t);return s.from==e&&i.from==t?[e,t]:[s.to+1,i.to+1]}function Up(e,t,r,a,s,i){let o=[];for(let l=0;l<e.length;l++){let c=e[l],[d,u]=su(c.fromA+a,c.fromB+s,t,r),[m,h]=iu(c.toA+a,c.toB+s,t,r),p=[c.offset(-d+a,-u+s)];for(;l<e.length-1;){let x=e[l+1],[y,k]=su(x.fromA+a,x.fromB+s,t,r);if(y>m+1&&k>h+1)break;p.push(x.offset(-d+a,-u+s)),[m,h]=iu(x.toA+a,x.toB+s,t,r),l++}o.push(new fa(p,d,Math.max(d,m),u,Math.max(u,h),i))}return o}const Hs=1e3;function ou(e,t,r,a){let s=0,i=e.length;for(;;){if(s==i){let u=0,m=0;s&&({toA:u,toB:m}=e[s-1]);let h=t-(r?u:m);return[u+h,m+h]}let o=s+i>>1,l=e[o],[c,d]=r?[l.fromA,l.toA]:[l.fromB,l.toB];if(c>t)i=o;else if(d<=t)s=o+1;else return a?[l.fromA,l.fromB]:[l.toA,l.toB]}}function lu(e,t,r,a){let s=[];return t.iterChangedRanges((i,o,l,c)=>{let d=0,u=r?t.length:a,m=0,h=r?a:t.length;i>Hs&&([d,m]=ou(e,i-Hs,r,!0)),o<t.length-Hs&&([u,h]=ou(e,o+Hs,r,!1));let p=c-l-(o-i),x,[y,k]=r?[p,0]:[0,p];s.length&&(x=s[s.length-1]).toA>=d?s[s.length-1]={fromA:x.fromA,fromB:x.fromB,toA:u,toB:h,diffA:x.diffA+y,diffB:x.diffB+k}:s.push({fromA:d,toA:u,fromB:m,toB:h,diffA:y,diffB:k})}),s}function cu(e,t,r,a,s){if(!e.length)return t;let i=[];for(let o=0,l=0,c=0,d=0;;o++){let u=o==e.length?null:e[o],m=u?u.fromA+l:r.length,h=u?u.fromB+c:a.length;for(;d<t.length;){let k=t[d];if(k.toA+l>m||k.toB+c>h)break;i.push(k.offset(l,c)),d++}if(!u)break;let p=u.toA+l+u.diffA,x=u.toB+c+u.diffB,y=qp(r.sliceString(m,p),a.sliceString(h,x),s);for(let k of Up(y,r,a,m,h,_p()))i.push(k);for(l+=u.diffA,c+=u.diffB;d<t.length;){let k=t[d];if(k.fromA+l>p&&k.fromB+c>x)break;d++}}return i}const Uw={scanLimit:500},Wp=fi.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=mu(e))}update(e){(e.docChanged||e.viewportChanged||Ww(e.startState,e.state)||Vw(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=mu(e.view))}},{decorations:e=>e.deco});function Ww(e,t){return e.field(zr,!1)!=t.field(zr,!1)}function Vw(e,t){return e.facet(gn)!=t.facet(gn)}const du=xn.line({class:"cm-changedLine"}),Vp=xn.mark({class:"cm-changedText"}),Gw=xn.mark({tagName:"ins",class:"cm-insertedLine"}),Kw=xn.mark({tagName:"del",class:"cm-deletedLine"}),uu=new class extends Sl{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function Jw(e,t,r,a,s,i){let o=r?e.fromA:e.fromB,l=r?e.toA:e.toB,c=0;if(o!=l){s.add(o,o,du),s.add(o,l,r?Kw:Gw),i&&i.add(o,o,uu);for(let d=t.iterRange(o,l-1),u=o;!d.next().done;){if(d.lineBreak){u++,s.add(u,u,du),i&&i.add(u,u,uu);continue}let m=u+d.value.length;if(a)for(;c<e.changes.length;){let h=e.changes[c],p=o+(r?h.fromA:h.fromB),x=o+(r?h.toA:h.toB),y=Math.max(u,p),k=Math.min(m,x);if(y<k&&s.add(y,k,Vp),x<m)c++;else break}u=m}}}function mu(e){let t=e.state.field(zr),{side:r,highlightChanges:a,markGutter:s,overrideChunk:i}=e.state.facet(gn),o=r=="a",l=new Ks,c=s?new Ks:null,{from:d,to:u}=e.viewport;for(let m of t){if((o?m.fromA:m.fromB)>=u)break;(o?m.toA:m.toB)>d&&(!i||!i(e.state,m,l,c))&&Jw(m,e.state.doc,o,a,l,c)}return{deco:l.finish(),gutter:c&&c.finish()}}const kl=Nl.define({map:(e,t)=>t.mapPos(e)});class Yw extends Cl{constructor(t){super(),this.lines=t}eq(t){return this.lines==t.lines}toDOM(t){let r=document.createElement("div");return r.className="cm-collapsedLines",r.textContent=t.state.phrase("$ unchanged lines",this.lines),r.addEventListener("click",a=>{let s=t.posAtDOM(a.target);t.dispatch({effects:kl.of(s)});let{side:i,sibling:o}=t.state.facet(gn);o&&o().dispatch({effects:kl.of(Xw(s,t.state.field(zr),i=="a"))})}),r}ignoreEvent(t){return t instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}}function Xw(e,t,r){let a=0,s=0;for(let i=0;;i++){let o=i<t.length?t[i]:null;if(!o||(r?o.fromA:o.fromB)>=e)return s+(e-a);[a,s]=r?[o.toA,o.toB]:[o.toB,o.toA]}}const Qw=as.define({create(e){return xn.none},update(e,t){e=e.map(t.changes);for(let r of t.effects)r.is(kl)&&(e=e.update({filter:a=>a!=r.value}));return e},provide:e=>Tr.decorations.from(e)});function Zw({margin:e=3,minSize:t=4}){return Qw.init(r=>e8(r,e,t))}function e8(e,t,r){let a=new Ks,s=e.facet(gn).side=="a",i=e.field(zr),o=1;for(let l=0;;l++){let c=l<i.length?i[l]:null,d=l?o+t:1,u=c?e.doc.lineAt(s?c.fromA:c.fromB).number-1-t:e.doc.lines,m=u-d+1;if(m>=r&&a.add(e.doc.line(d).from,e.doc.line(u).to,xn.replace({widget:new Yw(m),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,s?c.toA:c.toB)).number}return a.finish()}const t8=Tr.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"⦚"',marginInlineEnd:"7px"},"&:after":{content:'"⦚"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),r8=new class extends Sl{constructor(){super(...arguments),this.elementClass="cm-deletedLineGutter"}},n8=wu.low(vf({class:"cm-changeGutter",markers:e=>{var t;return((t=e.plugin(Wp))===null||t===void 0?void 0:t.gutter)||kf.empty},widgetMarker:(e,t)=>t instanceof Gp?r8:null}));function a8(e){var t;let r=typeof e.original=="string"?ku.of(e.original.split(/\r?\n/)):e.original,a=e.diffConfig||Uw;return[wu.low(Wp),l8,t8,Tr.editorAttributes.of({class:"cm-merge-b"}),Hp.of((s,i)=>{let o=i.effects.find(l=>l.is(j0));return o&&(s=fa.updateA(s,o.value.doc,i.startState.doc,o.value.changes,a)),i.docChanged&&(s=fa.updateB(s,i.state.field(ja),i.newDoc,i.changes,a)),s}),gn.of({highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1,syntaxHighlightDeletions:e.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:(t=e.mergeControls)!==null&&t!==void 0?t:!0,overrideChunk:e.allowInlineDiffs?m8:void 0,side:"b"}),ja.init(()=>r),e.gutter!==!1?n8:[],e.collapseUnchanged?Zw(e.collapseUnchanged):[],zr.init(s=>fa.build(r,s.doc,a))]}const j0=Nl.define(),ja=as.define({create:()=>ku.empty,update(e,t){for(let r of t.effects)r.is(j0)&&(e=r.value.doc);return e}}),hu=new WeakMap;class Gp extends Cl{constructor(t){super(),this.buildDOM=t,this.dom=null}eq(t){return this.dom==t.dom}toDOM(t){return this.dom||(this.dom=this.buildDOM(t))}}function s8(e,t,r){let a=hu.get(t.changes);if(a)return a;let s=o=>{let{highlightChanges:l,syntaxHighlightDeletions:c,syntaxHighlightDeletionsMaxLength:d,mergeControls:u}=e.facet(gn),m=document.createElement("div");if(m.className="cm-deletedChunk",u){let L=m.appendChild(document.createElement("div"));L.className="cm-chunkButtons";let U=H=>{H.preventDefault(),i8(o,o.posAtDOM(m))},I=H=>{H.preventDefault(),o8(o,o.posAtDOM(m))};if(typeof u=="function")L.appendChild(u("accept",U)),L.appendChild(u("reject",I));else{let H=L.appendChild(document.createElement("button"));H.name="accept",H.textContent=e.phrase("Accept"),H.onmousedown=U;let F=L.appendChild(document.createElement("button"));F.name="reject",F.textContent=e.phrase("Reject"),F.onmousedown=I}}if(r||t.fromA>=t.toA)return m;let h=o.state.field(ja).sliceString(t.fromA,t.endA),p=c&&e.facet(ju),x=j(),y=t.changes,k=0,w=!1;function j(){let L=m.appendChild(document.createElement("div"));return L.className="cm-deletedLine",L.appendChild(document.createElement("del"))}function N(L,U,I){for(let H=L;H<U;){if(h.charAt(H)==`
|
|
788
|
-
`){x.firstChild||x.appendChild(document.createElement("br")),x=j(),H++;continue}let F=U,W=I+(w?" cm-deletedText":""),M=!1,_=h.indexOf(`
|
|
789
|
-
`,H);if(_>-1&&_<U&&(F=_),l&&k<y.length){let O=Math.max(0,w?y[k].toA:y[k].fromA);O<=F&&(F=O,w&&k++,M=!0)}if(F>H){let O=document.createTextNode(h.slice(H,F));if(W){let V=x.appendChild(document.createElement("span"));V.className=W,V.appendChild(O)}else x.appendChild(O);H=F}M&&(w=!w)}}if(p&&t.toA-t.fromA<=d){let L=p.parser.parse(h),U=0;Do(L,{style:I=>Nu(e,I)},(I,H,F)=>{I>U&&N(U,I,""),N(I,H,F),U=H}),N(U,h.length,"")}else N(0,h.length,"");return x.firstChild||x.appendChild(document.createElement("br")),m},i=xn.widget({block:!0,side:-1,widget:new Gp(s)});return hu.set(t.changes,i),i}function i8(e,t){let{state:r}=e,a=t??r.selection.main.head,s=e.state.field(zr).find(c=>c.fromB<=a&&c.endB>=a);if(!s)return!1;let i=e.state.sliceDoc(s.fromB,Math.max(s.fromB,s.toB-1)),o=e.state.field(ja);s.fromB!=s.toB&&s.toA<=o.length&&(i+=e.state.lineBreak);let l=wf.of({from:s.fromA,to:Math.min(o.length,s.toA),insert:i},o.length);return e.dispatch({effects:j0.of({doc:l.apply(o),changes:l}),userEvent:"accept"}),!0}function o8(e,t){let{state:r}=e,a=t??r.selection.main.head,s=r.field(zr).find(l=>l.fromB<=a&&l.endB>=a);if(!s)return!1;let o=r.field(ja).sliceString(s.fromA,Math.max(s.fromA,s.toA-1));return s.fromA!=s.toA&&s.toB<=r.doc.length&&(o+=r.lineBreak),e.dispatch({changes:{from:s.fromB,to:Math.min(r.doc.length,s.toB),insert:o},userEvent:"revert"}),!0}function pu(e){let t=new Ks;for(let r of e.field(zr)){let a=e.facet(gn).overrideChunk&&Kp(e,r);t.add(r.fromB,r.fromB,s8(e,r,!!a))}return t.finish()}const l8=as.define({create:e=>pu(e),update(e,t){return t.state.field(zr,!1)!=t.startState.field(zr,!1)?pu(t.state):e},provide:e=>Tr.decorations.from(e)}),fu=new WeakMap;function Kp(e,t){let r=fu.get(t);if(r!==void 0)return r;r=null;let a=e.field(ja),s=e.doc,i=a.lineAt(t.endA).number-a.lineAt(t.fromA).number+1,o=s.lineAt(t.endB).number-s.lineAt(t.fromB).number+1;e:if(i==o&&i<10){let l=[],c=0,d=t.fromA,u=t.fromB;for(let m of t.changes){if(m.fromA<m.toA){c+=m.toA-m.fromA;let h=a.sliceString(d+m.fromA,d+m.toA);if(/\n/.test(h))break e;l.push(xn.widget({widget:new c8(h),side:-1}).range(u+m.fromB))}m.fromB<m.toB&&l.push(Vp.range(u+m.fromB,u+m.toB))}c<t.endA-t.fromA-i*2&&(r=l)}return fu.set(t,r),r}class c8 extends Cl{constructor(t){super(),this.text=t}eq(t){return this.text==t.text}toDOM(t){let r=document.createElement("del");return r.className="cm-deletedText",r.textContent=this.text,r}}const d8=new class extends Sl{constructor(){super(...arguments),this.elementClass="cm-inlineChangedLineGutter"}},u8=xn.line({class:"cm-inlineChangedLine"});function m8(e,t,r,a){let s=Kp(e,t),i=0;if(!s)return!1;for(let o=e.doc.lineAt(t.fromB);;){for(a&&a.add(o.from,o.from,d8),r.add(o.from,o.from,u8);i<s.length&&s[i].to<=o.to;){let l=s[i++];r.add(l.from,l.to,l.value)}if(o.to>=t.endB)break;o=e.doc.lineAt(o.to+1)}return!0}var h8=function(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(e);s<a.length;s++)t.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(r[a[s]]=e[a[s]]);return r};const ir=pi.define({combine:e=>{const t=[];for(let r of e){if(!r)continue;const{create:a,gutters:s}=r,i=h8(r,["create","gutters"]);t.push(Object.assign(Object.assign({},i),{enabled:!0,gutters:s?s.filter(o=>Object.keys(o).length>0):void 0}))}return jf(t,{enabled:t.length>0,displayText:"characters",eventHandlers:{},showOverlay:"always",gutters:[]})}}),br={PixelMultiplier:2,SizeRatio:4,MaxWidth:120},p8=Tr.theme({".cm-minimap-overlay-container":{position:"absolute",top:0,height:"100%",width:"100%","&.cm-minimap-overlay-mouse-over":{opacity:0,transition:"visibility 0s linear 300ms, opacity 300ms"},"&.cm-minimap-overlay-mouse-over:hover":{opacity:1,transition:"visibility 0s linear 0ms, opacity 300ms"},"&.cm-minimap-overlay-off":{display:"none"},"& .cm-minimap-overlay":{background:"rgb(121, 121, 121)",opacity:"0.2",position:"absolute",right:0,top:0,width:"100%",transition:"top 0s ease-in 0ms","&:hover":{opacity:"0.3"}},"&.cm-minimap-overlay-active":{opacity:1,visibility:"visible",transition:"visibility 0s linear 0ms, opacity 300ms","& .cm-minimap-overlay":{opacity:"0.4"}}}}),An=br.PixelMultiplier*br.SizeRatio,f8=fi.fromClass(class{constructor(e){this.view=e,this._isDragging=!1,e.state.facet(ir).enabled&&this.create(e)}create(e){this.container=ga("div",{class:"cm-minimap-overlay-container"}),this.dom=ga("div",{class:"cm-minimap-overlay"}),this.container.appendChild(this.dom),this.container.addEventListener("mousedown",this.onMouseDown.bind(this)),window.addEventListener("mouseup",this.onMouseUp.bind(this)),window.addEventListener("mousemove",this.onMouseMove.bind(this));const t=e.dom.querySelector(".cm-minimap-inner");t&&t.appendChild(this.container),this.computeShowOverlay(),this.computeHeight(),this.computeTop()}remove(){this.container&&(this.container.removeEventListener("mousedown",this.onMouseDown),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("mousemove",this.onMouseMove),this.container.remove())}update(e){const t=e.startState.facet(ir).enabled,r=e.state.facet(ir).enabled;if(t&&!r){this.remove();return}!t&&r&&this.create(e.view),r&&(this.computeShowOverlay(),e.geometryChanged&&(this.computeHeight(),this.computeTop()))}computeHeight(){if(!this.dom)return;const e=this.view.dom.clientHeight/An;this.dom.style.height=e+"px"}computeTop(){if(!this._isDragging&&this.dom){const{clientHeight:e,scrollHeight:t,scrollTop:r}=this.view.scrollDOM,a=t-e,s=r/An,i=e/An,o=e-i;let l=r/a;isNaN(l)&&(l=0);const c=o*l,d=Math.min(c,s);this.dom.style.top=d+"px"}}computeShowOverlay(){if(!this.container)return;const{showOverlay:e}=this.view.state.facet(ir);e==="mouse-over"?this.container.classList.add("cm-minimap-overlay-mouse-over"):this.container.classList.remove("cm-minimap-overlay-mouse-over");const{clientHeight:t,scrollHeight:r}=this.view.scrollDOM;t===r?this.container.classList.add("cm-minimap-overlay-off"):this.container.classList.remove("cm-minimap-overlay-off")}onMouseDown(e){if(!this.container||e.button===2)return;const{clientY:t,target:r}=e;if(r===this.dom){this._dragStartY=e.clientY,this._isDragging=!0,this.container.classList.add("cm-minimap-overlay-active");return}const{clientHeight:a,scrollHeight:s,scrollTop:i}=this.view.scrollDOM,o=r.getBoundingClientRect().top,l=(t-o)*An,c=i/(s-a),u=(a*An-a)*c,m=Math.max(0,i-u);this.view.scrollDOM.scrollTop=m+l-a/2}onMouseUp(e){this._isDragging&&this.container&&(this._dragStartY=void 0,this._isDragging=!1,this.container.classList.remove("cm-minimap-overlay-active"))}onMouseMove(e){if(!this._isDragging||!this.dom)return;if(e.preventDefault(),e.stopPropagation(),!this._dragStartY){this._dragStartY=e.clientY;return}const t=e.clientY-this._dragStartY,r=t<0,a=t>0;this._dragStartY=e.clientY;const s=this.dom.getBoundingClientRect().height,i=this.dom.getBoundingClientRect().y,o=i+s,l=parseFloat(this.dom.style.top),c=this.view.scrollDOM.scrollTop,d=this.view.scrollDOM.clientHeight,u=this.view.scrollDOM.scrollHeight,m=c===0,h=Math.round(c)>=Math.round(u-d);if(m&&r||m&&e.clientY<i||h&&a||h&&e.clientY>o)return;const p=this.view.scrollDOM.scrollHeight,x=this.view.scrollDOM.clientHeight,y=(p-x)/An,k=x-x/An,w=l+t,j=w/k,N=(p-x)*j,L=w*An;this.view.scrollDOM.scrollTop=Math.max(N,L);const U=Math.min(Math.max(0,w),Math.min(k,y));this.dom.style.top=U+"px"}destroy(){this.remove()}},{eventHandlers:{scroll(){requestAnimationFrame(()=>this.computeTop())}}}),g8=[p8,f8];class N0{constructor(t){this.map=new Map,this.view=t}get(t){return this.map.get(t)}set(t,r){this.map.set(t,r)}}function gu(e){var t;if(!e.facet(ir).enabled)return[];const r=[],a=e.doc.iterLines(),s=Nf(e).iter();let i=0;for(a.next();!a.done;){const o=a.value;let l=i,c=l+o.length;for(;s.value&&s.to<l;)s.next();const{from:d,to:u}=s,m=l>=d&&l<u,h=c>d&&c<=u;if(m){let p=(t=r.pop())!==null&&t!==void 0?t:[],x=p.pop();x&&x.folded&&(x.to=u),x&&p.push(x),(!x||!x.folded)&&p.push({from:d,to:u,folded:!0}),h||p.push({from:u,to:c,folded:!1}),r.push(p)}else h?r.push([{from:l,to:d,folded:!1},{from:d,to:u,folded:!0}]):r.push([{from:l,to:c,folded:!1}]);i=c+1,a.next()}return r}const Na=as.define({create:e=>gu(e),update:(e,t)=>Ei([t])||t.docChanged?gu(t.state):e});function Ei(e){return e.find(t=>t.effects.find(r=>r.is(Sf)||r.is(Cf)))}class x8 extends N0{constructor(t){super(t),this.count=void 0}shouldUpdate(t){if(!t.state.facet(ir).enabled)return!1;if(t.docChanged)return!0;for(const r of t.transactions)for(const a of r.effects)if(a.is(Mf))return!0;return!!(Ei(t.transactions)||this.count===void 0)}update(t){if(!this.shouldUpdate(t))return;this.map.clear();const r=t.state.field(Na);this.count=Af(t.state),Tf(t.state,(a,s,i)=>{const o=this.findLine(s,r),l=this.findLine(i,r);let c=a.severity;for(let d=o;d<=l;d++){const u=this.get(d);u&&(c=[c,u].sort(this.sort.bind(this)).slice(0,1)[0]),this.set(d,c)}})}drawLine(t,r){const{context:a,lineHeight:s,offsetX:i,offsetY:o}=t,l=this.get(r);l&&(a.globalAlpha=.65,a.beginPath(),a.rect(i,o,a.canvas.width-i,s),a.fillStyle=this.color(l),a.fill())}findLine(t,r){return r.findIndex(s=>{const i=s.slice(0,1)[0],o=s.slice(-1)[0];return!i||!o?!1:i.from<=t&&t<=o.to})+1}color(t){return t==="error"?"#d11":t==="warning"?"orange":"#999"}sort(t,r){return this.score(r)-this.score(t)}score(t){switch(t){case"error":return 3;case"warning":return 2;default:return 1}}}function b8(e){return new x8(e)}class y8 extends N0{constructor(t){super(t),this.getDrawInfo(),this._themeClasses=t.dom.classList.value}shouldUpdate(t){return t.state.facet(ir).enabled?!!(t.docChanged||t.selectionSet||this._themeClasses!==this.view.dom.classList.value||Ei(t.transactions)):!1}update(t){if(!this.shouldUpdate(t))return;this.map.clear(),this._themeClasses!==this.view.dom.classList.value&&(this._drawInfo=void 0,this._themeClasses=this.view.dom.classList.value);const{ranges:r}=t.state.selection;let a=0;for(const[s,i]of t.state.field(Na).entries()){const o=[];let l=0;for(const d of i){do{if(a>=r.length||d.to<r[a].from)continue;if(r[a].from===r[a].to){a++;continue}const u=r[a],m={from:l+Math.max(d.from,u.from)-d.from,to:l+Math.min(d.to,u.to)-d.from,extends:u.to>d.to},h=o.slice(-1)[0];if(h&&h.to===m.from){let{to:p}=m;d.folded&&m.extends?p=m.from+1:d.folded&&!m.extends&&(p=h.to),o[o.length-1]=Object.assign(Object.assign({},h),{to:p,extends:m.extends})}else d.folded||o.push(m);if(m.extends)break;a++}while(a<r.length&&d.to>=r[a].from);l+=d.folded?1:d.to-d.from}if(o.length===0)continue;const c=s+1;this.map.set(c,o)}}drawLine(t,r){let{context:a,lineHeight:s,charWidth:i,offsetX:o,offsetY:l}=t;const c=this.get(r);if(c)for(const d of c){const u=o+d.from*i,m=(d.to-d.from)*i,h=a.canvas.width-u;d.extends&&(a.globalAlpha=.65,a.beginPath(),a.rect(u,l,h,s),a.fillStyle=this.getDrawInfo().backgroundColor,a.fill()),a.globalAlpha=1,a.beginPath(),a.rect(u,l,m,s),a.fillStyle=this.getDrawInfo().backgroundColor,a.fill()}}getDrawInfo(){if(this._drawInfo)return this._drawInfo;const t=document.createElement("span");t.setAttribute("class","cm-selectionBackground"),this.view.dom.appendChild(t);const a={backgroundColor:window.getComputedStyle(t).backgroundColor};return this._drawInfo=a,this.view.dom.removeChild(t),a}}function v8(e){return new y8(e)}class k8 extends N0{constructor(t){super(t),this._fontInfoMap=new Map,this._themeClasses=new Set(t.dom.classList.values()),t.state.facet(ir).enabled&&this.updateImpl(t.state)}shouldUpdate(t){return!!(t.docChanged||t.state.facet(ir)!==t.startState.facet(ir)||this.themeChanged()||Ei(t.transactions))}update(t){this.shouldUpdate(t)&&(this._highlightingCallbackId&&(typeof window.requestIdleCallback<"u"?cancelIdleCallback(this._highlightingCallbackId):clearTimeout(this._highlightingCallbackId)),this.updateImpl(t.state,t.changes))}updateImpl(t,r){var a;this.map.clear(),this._displayText=t.facet(ir).displayText,this.themeChanged()&&this._fontInfoMap.clear();let s;if(this._previousTree&&r){const m=L0.addTree(this._previousTree),h=[];r.iterChangedRanges((p,x,y,k)=>h.push({fromA:p,toA:x,fromB:y,toB:k})),s=L0.applyChanges(m,h)}const i=t.doc.toString(),o=(a=t.facet(ju))===null||a===void 0?void 0:a.parser,l=o?o.parse(i,s):void 0;this._previousTree=l;const c={style:m=>Nu(t,m)};let d=[];if(l){const m=t.doc.lineAt(this.view.viewport.from).number,h=t.doc.lineAt(this.view.viewport.to).number,p=h-m,x=m/(t.doc.lines-p),{SizeRatio:y,PixelMultiplier:k}=br,w=p*y*k,j=x*w,N=Math.max(1,Math.floor(m-j)),L=Math.min(h+Math.floor(w-j),t.doc.lines);Do(l,c,(U,I,H)=>{d.push({from:U,to:I,tags:H})},t.doc.line(N).from,t.doc.line(L).to)}this.updateMapImpl(t,d),d=[];const u=()=>{l&&(Do(l,c,(m,h,p)=>{d.push({from:m,to:h,tags:p})}),this.updateMapImpl(t,d),this._highlightingCallbackId=void 0)};this._highlightingCallbackId=typeof window.requestIdleCallback<"u"?requestIdleCallback(u):setTimeout(u)}updateMapImpl(t,r){this.map.clear();const a=t.doc.toString(),s=r.values();let i=s.next();for(const[o,l]of t.field(Na).entries()){const c=[];for(const u of l){if(u.from===u.to)continue;if(u.folded){c.push({text:"…",tags:""});continue}let m=u.from;for(;!i.done&&i.value.from<u.to;){const{from:h,to:p,tags:x}=i.value;if(p<m){i=s.next();continue}h>m&&c.push({text:a.slice(m,h),tags:""});const y=Math.max(h,u.from),k=Math.min(p,u.to);if(c.push({text:a.slice(y,k),tags:x}),m=k,p>k)break;i=s.next()}m!==u.to&&c.push({text:a.slice(m,u.to),tags:""})}const d=o+1;this.map.set(d,c)}}measure(t){const{color:r,font:a,lineHeight:s}=this.getFontInfo("");return t.textBaseline="ideographic",t.fillStyle=r,t.font=a,{charWidth:t.measureText("_").width,lineHeight:s}}beforeDraw(){this._fontInfoMap.clear()}drawLine(t,r){const a=this.get(r);if(!a)return;let{context:s,charWidth:i,lineHeight:o,offsetX:l,offsetY:c}=t,d;s.textBaseline="ideographic";for(const u of a){const m=this.getFontInfo(u.tags);switch((!d||d.color!==m.color)&&(s.fillStyle=m.color),(!d||d.font!==m.font)&&(s.font=m.font),d=m,o=Math.max(o,m.lineHeight),this._displayText){case"characters":{s.fillText(u.text,l,c+o),l+=u.text.length*i;break}case"blocks":{const h=/\S+/g;let p;for(;(p=h.exec(u.text))!==null;){const x=l+p.index*i;let y=(h.lastIndex-p.index)*i;if(x>s.canvas.width)break;x+y>s.canvas.width&&(y=s.canvas.width-x);const k=2/br.SizeRatio,w=o-k;s.fillStyle=m.color,s.globalAlpha=.65,s.beginPath(),s.rect(x,c,y,w),s.fill()}l+=u.text.length*i;break}}}}getFontInfo(t){const r=this._fontInfoMap.get(t);if(r)return r;const a=ga("span",{class:t}),s=ga("div",{class:"cm-line",style:"display: none"},a);this.view.contentDOM.appendChild(s);const i=window.getComputedStyle(a),o=parseFloat(i.lineHeight)/br.SizeRatio,l={color:i.color,font:`${i.fontStyle} ${i.fontWeight} ${o}px ${i.fontFamily}`,lineHeight:o};return this._fontInfoMap.set(t,l),this.view.contentDOM.removeChild(s),l}themeChanged(){const t=this._themeClasses,r=new Set(this.view.dom.classList.values());if(this._themeClasses=r,!t||(t.delete("cm-focused"),r.delete("cm-focused"),t.size!==r.size))return!0;let a=!0;return t.forEach(s=>{r.has(s)||(a=!1)}),!a}}function w8(e){return new k8(e)}const Jp=4;function j8(e,t,r){const a=e[r];a&&(t.context.fillStyle=a,t.context.globalAlpha=1,t.context.beginPath(),t.context.rect(t.offsetX,t.offsetY,Jp,t.lineHeight),t.context.fill())}const N8=Tr.theme({"&":{height:"100%",overflowY:"auto"},"& .cm-minimap-gutter":{borderRight:0,flexShrink:0,left:"unset",position:"sticky",right:0,top:0},"& .cm-minimap-inner":{height:"100%",position:"absolute",right:0,top:0,overflowY:"hidden","& canvas":{display:"block"}},"& .cm-minimap-box-shadow":{boxShadow:"12px 0px 20px 5px #6c6c6c"}}),xu=6,S8=fi.fromClass(class{constructor(e){this.view=e,this.text=w8(e),this.selection=v8(e),this.diagnostic=b8(e),e.state.facet(Ua)&&this.create(e)}create(e){const t=e.state.facet(Ua);if(!t)throw Error("Expected nonnull");this.inner=ga("div",{class:"cm-minimap-inner"}),this.canvas=ga("canvas"),this.dom=t.create(e).dom,this.dom.classList.add("cm-gutters"),this.dom.classList.add("cm-minimap-gutter"),this.inner.appendChild(this.canvas),this.dom.appendChild(this.inner),this.view.scrollDOM.insertBefore(this.dom,this.view.contentDOM.nextSibling);for(const r in this.view.state.facet(ir).eventHandlers){const a=this.view.state.facet(ir).eventHandlers[r];a&&this.dom.addEventListener(r,s=>a(s,this.view))}}remove(){this.dom&&this.dom.remove()}update(e){const t=e.startState.facet(Ua),r=e.state.facet(Ua);if(t&&!r){this.remove();return}!t&&r&&this.create(e.view),r&&(this.text.update(e),this.selection.update(e),this.diagnostic.update(e),this.render())}getWidth(){const e=this.view.dom.clientWidth;if(e<=br.MaxWidth*xu){const t=e/(br.MaxWidth*xu);return br.MaxWidth*t}return br.MaxWidth}render(){if(!this.dom||!this.canvas||!this.inner)return;this.text.beforeDraw(),this.updateBoxShadow(),this.dom.style.width=this.getWidth()+"px",this.canvas.style.maxWidth=this.getWidth()+"px",this.canvas.width=this.getWidth()*br.PixelMultiplier;const e=this.view.dom.getBoundingClientRect().height;this.inner.style.minHeight=e+"px",this.canvas.height=e*br.PixelMultiplier,this.canvas.style.height=e+"px";const t=this.canvas.getContext("2d");if(!t)return;t.clearRect(0,0,this.canvas.width,this.canvas.height);const{charWidth:r,lineHeight:a}=this.text.measure(t);let{startIndex:s,endIndex:i,offsetY:o}=this.canvasStartAndEndIndex(t,a);const l=this.view.state.facet(ir).gutters;for(let c=s;c<i;c++){const d=this.view.state.field(Na);if(c>=d.length)break;const u={offsetX:0,offsetY:o,context:t,lineHeight:a,charWidth:r};if(l.length){u.offsetX+=2;for(let m of l)j8(m,u,c+1),u.offsetX+=Jp;u.offsetX+=2}this.text.drawLine(u,c+1),this.selection.drawLine(u,c+1),this.diagnostic.drawLine(u,c+1),o+=a}t.restore()}canvasStartAndEndIndex(e,t){let{top:r,bottom:a}=this.view.documentPadding;r/=br.SizeRatio,a/=br.SizeRatio;const s=e.canvas.height,{clientHeight:i,scrollHeight:o,scrollTop:l}=this.view.scrollDOM;let c=l/(o-i);isNaN(c)&&(c=0);const d=this.view.state.field(Na).length,u=r+a+d*t,m=Math.max(0,c*(u-s)),h=Math.max(0,r-m),p=Math.round(Math.max(0,m-r)/t),x=Math.round((s-h)/t);return{startIndex:p,endIndex:p+x,offsetY:h}}updateBoxShadow(){if(!this.canvas)return;const{clientWidth:e,scrollWidth:t,scrollLeft:r}=this.view.scrollDOM;e+r<t?this.canvas.classList.add("cm-minimap-box-shadow"):this.canvas.classList.remove("cm-minimap-box-shadow")}destroy(){this.remove()}},{eventHandlers:{scroll(){requestAnimationFrame(()=>this.render())}},provide:e=>Tr.scrollMargins.of(t=>{var r;const a=(r=t.plugin(e))===null||r===void 0?void 0:r.getWidth();return a?{right:a}:null})}),Ua=pi.define({combine:e=>{var t;return(t=e.find(r=>r!==null))!==null&&t!==void 0?t:null},enables:e=>[[ir.compute([e],t=>t.facet(e)),N8,Na,S8,g8]]});function wl({file:e,onClose:t,projectPath:r,isSidebar:a=!1,isExpanded:s=!1,onToggleExpand:i=null}){const[o,l]=b.useState(""),[c,d]=b.useState(!0),[u,m]=b.useState(!1),[h,p]=b.useState(!1),[x,y]=b.useState(()=>{const C=localStorage.getItem("codeEditorTheme");return C?C==="dark":!0}),[k,w]=b.useState(!1),[j,N]=b.useState(!!e.diffInfo),[L,U]=b.useState(()=>localStorage.getItem("codeEditorWordWrap")==="true"),[I,H]=b.useState(()=>localStorage.getItem("codeEditorShowMinimap")!=="false"),[F,W]=b.useState(()=>localStorage.getItem("codeEditorLineNumbers")!=="false"),[M,_]=b.useState(()=>localStorage.getItem("codeEditorFontSize")||"14"),O=b.useRef(null),V=b.useMemo(()=>{if(!e.diffInfo||!j||!I)return[];const C={};return[Ua.compute(["doc"],ue=>{const A=Io(ue)?.chunks||[];return Object.keys(C).forEach(te=>delete C[te]),A.forEach(te=>{const Ce=ue.doc.lineAt(te.fromB).number,De=ue.doc.lineAt(Math.min(te.toB,ue.doc.length)).number;for(let pe=Ce;pe<=De;pe++)C[pe]=x?"rgba(34, 197, 94, 0.8)":"rgba(34, 197, 94, 1)"}),{create:()=>({dom:document.createElement("div")}),displayText:"blocks",showOverlay:"always",gutters:[C]}})]},[e.diffInfo,j,I,x]),T=b.useMemo(()=>!e.diffInfo||!j?[]:[fi.fromClass(class{constructor(C){setTimeout(()=>{const xe=Io(C.state)?.chunks||[];if(xe.length>0){const A=xe[0];C.dispatch({effects:Tr.scrollIntoView(A.fromB,{y:"center"})})}},100)}update(){}destroy(){}})],[e.diffInfo,j]),Y=b.useMemo(()=>{const C=ue=>{const xe=document.createElement("div");xe.className="cm-editor-toolbar-panel";let A=0;const te=()=>{const Ce=e.diffInfo&&j,pe=(Ce?Io(ue.state):null)?.chunks||[],_e=pe.length;let se='<div style="display: flex; align-items: center; justify-content: space-between; width: 100%;">';if(se+='<div style="display: flex; align-items: center; gap: 8px;">',Ce&&(se+=`
|
|
790
|
-
<span style="font-weight: 500;">${_e>0?`${A+1}/${_e}`:"0"} changes</span>
|
|
791
|
-
<button class="cm-diff-nav-btn cm-diff-nav-prev" title="Previous change" ${_e===0?"disabled":""}>
|
|
792
|
-
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
793
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7" />
|
|
794
|
-
</svg>
|
|
795
|
-
</button>
|
|
796
|
-
<button class="cm-diff-nav-btn cm-diff-nav-next" title="Next change" ${_e===0?"disabled":""}>
|
|
797
|
-
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
798
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
|
|
799
|
-
</svg>
|
|
800
|
-
</button>
|
|
801
|
-
`),se+="</div>",se+='<div style="display: flex; align-items: center; gap: 4px;">',e.diffInfo&&(se+=`
|
|
802
|
-
<button class="cm-toolbar-btn cm-toggle-diff-btn" title="${j?"Hide diff highlighting":"Show diff highlighting"}">
|
|
803
|
-
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
804
|
-
${j?'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" />':'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" />'}
|
|
805
|
-
</svg>
|
|
806
|
-
</button>
|
|
807
|
-
`),se+=`
|
|
808
|
-
<button class="cm-toolbar-btn cm-settings-btn" title="Editor Settings">
|
|
809
|
-
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
810
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
|
811
|
-
</svg>
|
|
812
|
-
</button>
|
|
813
|
-
`,a&&i&&(se+=`
|
|
814
|
-
<button class="cm-toolbar-btn cm-expand-btn" title="${s?"Collapse editor":"Expand editor to full width"}">
|
|
815
|
-
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
816
|
-
${s?'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25" />':'<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" />'}
|
|
817
|
-
</svg>
|
|
818
|
-
</button>
|
|
819
|
-
`),se+="</div>",se+="</div>",xe.innerHTML=se,Ce){const ze=xe.querySelector(".cm-diff-nav-prev"),Ae=xe.querySelector(".cm-diff-nav-next");ze?.addEventListener("click",()=>{if(pe.length===0)return;A=A>0?A-1:pe.length-1;const Be=pe[A];Be&&ue.dispatch({effects:Tr.scrollIntoView(Be.fromB,{y:"center"})}),te()}),Ae?.addEventListener("click",()=>{if(pe.length===0)return;A=A<pe.length-1?A+1:0;const Be=pe[A];Be&&ue.dispatch({effects:Tr.scrollIntoView(Be.fromB,{y:"center"})}),te()})}e.diffInfo&&xe.querySelector(".cm-toggle-diff-btn")?.addEventListener("click",()=>{N(!j)}),xe.querySelector(".cm-settings-btn")?.addEventListener("click",()=>{window.openSettings&&window.openSettings("appearance")}),a&&i&&xe.querySelector(".cm-expand-btn")?.addEventListener("click",()=>{i()})};return te(),{top:!0,dom:xe,update:te}};return[Ef.of(C)]},[e.diffInfo,j,a,s,i]),ne=C=>{const ue=C.split(".").pop()?.toLowerCase();switch(ue){case"js":case"jsx":case"ts":case"tsx":return[Pf({jsx:!0,typescript:ue.includes("ts")})];case"py":return[Lf()];case"html":case"htm":return[zf()];case"css":case"scss":case"less":return[Df()];case"json":return[If()];case"md":case"markdown":return[Mu()];default:return[]}};b.useEffect(()=>{(async()=>{try{if(d(!0),e.diffInfo&&e.diffInfo.new_string!==void 0&&e.diffInfo.old_string!==void 0){l(e.diffInfo.new_string),d(!1);return}const ue=await at.readFile(e.projectName,e.path);if(!ue.ok)throw new Error(`Failed to load file: ${ue.status} ${ue.statusText}`);const xe=await ue.json();l(xe.content)}catch(ue){console.error("Error loading file:",ue),l(`// Error loading file: ${ue.message}
|
|
820
|
-
// File: ${e.name}
|
|
821
|
-
// Path: ${e.path}`)}finally{d(!1)}})()},[e,r]);const he=async()=>{m(!0);try{console.log("Saving file:",{projectName:e.projectName,path:e.path,contentLength:o?.length});const C=await at.saveFile(e.projectName,e.path,o);if(console.log("Save response:",{status:C.status,ok:C.ok,contentType:C.headers.get("content-type")}),!C.ok){const xe=C.headers.get("content-type");if(xe&&xe.includes("application/json")){const A=await C.json();throw new Error(A.error||`Save failed: ${C.status}`)}else{const A=await C.text();throw console.error("Non-JSON error response:",A),new Error(`Save failed: ${C.status} ${C.statusText}`)}}const ue=await C.json();console.log("Save successful:",ue),w(!0),setTimeout(()=>w(!1),2e3)}catch(C){console.error("Error saving file:",C),alert(`Error saving file: ${C.message}`)}finally{m(!1)}},$=()=>{const C=new Blob([o],{type:"text/plain"}),ue=URL.createObjectURL(C),xe=document.createElement("a");xe.href=ue,xe.download=e.name,document.body.appendChild(xe),xe.click(),document.body.removeChild(xe),URL.revokeObjectURL(ue)},J=()=>{p(!h)};return b.useEffect(()=>{localStorage.setItem("codeEditorTheme",x?"dark":"light")},[x]),b.useEffect(()=>{localStorage.setItem("codeEditorWordWrap",L.toString())},[L]),b.useEffect(()=>{const C=()=>{const ue=localStorage.getItem("codeEditorTheme");ue&&y(ue==="dark");const xe=localStorage.getItem("codeEditorWordWrap");xe!==null&&U(xe==="true");const A=localStorage.getItem("codeEditorShowMinimap");A!==null&&H(A!=="false");const te=localStorage.getItem("codeEditorLineNumbers");te!==null&&W(te!=="false");const Ce=localStorage.getItem("codeEditorFontSize");Ce&&_(Ce)};return window.addEventListener("storage",C),window.addEventListener("codeEditorSettingsChanged",C),()=>{window.removeEventListener("storage",C),window.removeEventListener("codeEditorSettingsChanged",C)}},[]),b.useEffect(()=>{const C=ue=>{(ue.ctrlKey||ue.metaKey)&&(ue.key==="s"?(ue.preventDefault(),he()):ue.key==="Escape"&&(ue.preventDefault(),t()))};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[o]),c?n.jsxs(n.Fragment,{children:[n.jsx("style",{children:`
|
|
822
|
-
.code-editor-loading {
|
|
823
|
-
background-color: ${x?"#111827":"#ffffff"} !important;
|
|
824
|
-
}
|
|
825
|
-
.code-editor-loading:hover {
|
|
826
|
-
background-color: ${x?"#111827":"#ffffff"} !important;
|
|
827
|
-
}
|
|
828
|
-
`}),a?n.jsx("div",{className:"w-full h-full flex items-center justify-center bg-background",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"}),n.jsxs("span",{className:"text-gray-900 dark:text-white",children:["Loading ",e.name,"..."]})]})}):n.jsx("div",{className:"fixed inset-0 z-40 md:bg-black/50 md:flex md:items-center md:justify-center",children:n.jsx("div",{className:"code-editor-loading w-full h-full md:rounded-lg md:w-auto md:h-auto p-8 flex items-center justify-center",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"}),n.jsxs("span",{className:"text-gray-900 dark:text-white",children:["Loading ",e.name,"..."]})]})})})]}):n.jsxs(n.Fragment,{children:[n.jsx("style",{children:`
|
|
829
|
-
/* Light background for full line changes */
|
|
830
|
-
.cm-deletedChunk {
|
|
831
|
-
background-color: ${x?"rgba(239, 68, 68, 0.15)":"rgba(255, 235, 235, 1)"} !important;
|
|
832
|
-
border-left: 3px solid ${x?"rgba(239, 68, 68, 0.6)":"rgb(239, 68, 68)"} !important;
|
|
833
|
-
padding-left: 4px !important;
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
.cm-insertedChunk {
|
|
837
|
-
background-color: ${x?"rgba(34, 197, 94, 0.15)":"rgba(230, 255, 237, 1)"} !important;
|
|
838
|
-
border-left: 3px solid ${x?"rgba(34, 197, 94, 0.6)":"rgb(34, 197, 94)"} !important;
|
|
839
|
-
padding-left: 4px !important;
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
/* Override linear-gradient underline and use solid darker background for partial changes */
|
|
843
|
-
.cm-editor.cm-merge-b .cm-changedText {
|
|
844
|
-
background: ${x?"rgba(34, 197, 94, 0.4)":"rgba(34, 197, 94, 0.3)"} !important;
|
|
845
|
-
padding-top: 2px !important;
|
|
846
|
-
padding-bottom: 2px !important;
|
|
847
|
-
margin-top: -2px !important;
|
|
848
|
-
margin-bottom: -2px !important;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
.cm-editor .cm-deletedChunk .cm-changedText {
|
|
852
|
-
background: ${x?"rgba(239, 68, 68, 0.4)":"rgba(239, 68, 68, 0.3)"} !important;
|
|
853
|
-
padding-top: 2px !important;
|
|
854
|
-
padding-bottom: 2px !important;
|
|
855
|
-
margin-top: -2px !important;
|
|
856
|
-
margin-bottom: -2px !important;
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
/* Minimap gutter styling */
|
|
860
|
-
.cm-gutter.cm-gutter-minimap {
|
|
861
|
-
background-color: ${x?"#1e1e1e":"#f5f5f5"};
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
/* Editor toolbar panel styling */
|
|
865
|
-
.cm-editor-toolbar-panel {
|
|
866
|
-
padding: 8px 12px;
|
|
867
|
-
background-color: ${x?"#1f2937":"#ffffff"};
|
|
868
|
-
border-bottom: 1px solid ${x?"#374151":"#e5e7eb"};
|
|
869
|
-
color: ${x?"#d1d5db":"#374151"};
|
|
870
|
-
font-size: 14px;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
.cm-diff-nav-btn,
|
|
874
|
-
.cm-toolbar-btn {
|
|
875
|
-
padding: 4px;
|
|
876
|
-
background: transparent;
|
|
877
|
-
border: none;
|
|
878
|
-
cursor: pointer;
|
|
879
|
-
border-radius: 4px;
|
|
880
|
-
display: inline-flex;
|
|
881
|
-
align-items: center;
|
|
882
|
-
justify-content: center;
|
|
883
|
-
color: inherit;
|
|
884
|
-
transition: background-color 0.2s;
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
.cm-diff-nav-btn:hover,
|
|
888
|
-
.cm-toolbar-btn:hover {
|
|
889
|
-
background-color: ${x?"#374151":"#f3f4f6"};
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
.cm-diff-nav-btn:disabled {
|
|
893
|
-
opacity: 0.5;
|
|
894
|
-
cursor: not-allowed;
|
|
895
|
-
}
|
|
896
|
-
`}),n.jsx("div",{className:a?"w-full h-full flex flex-col":`fixed inset-0 z-40 md:bg-black/50 md:flex md:items-center md:justify-center md:p-4 ${h?"md:p-0":""}`,children:n.jsxs("div",{className:a?"bg-background flex flex-col w-full h-full":`bg-background shadow-2xl flex flex-col ${"w-full h-full md:rounded-lg md:shadow-2xl"+(h?" md:w-full md:h-full md:rounded-none":" md:w-full md:max-w-6xl md:h-[80vh] md:max-h-[80vh]")}`,children:[n.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border flex-shrink-0 min-w-0",children:[n.jsx("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("h3",{className:"font-medium text-gray-900 dark:text-white truncate",children:e.name}),e.diffInfo&&n.jsx("span",{className:"text-xs bg-blue-100 dark:bg-blue-900 text-blue-600 dark:text-blue-300 px-2 py-1 rounded whitespace-nowrap",children:"Showing changes"})]}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 truncate",children:e.path})]})}),n.jsxs("div",{className:"flex items-center gap-1 md:gap-2 flex-shrink-0",children:[n.jsx("button",{onClick:$,className:"p-2 md:p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 min-w-[44px] min-h-[44px] md:min-w-0 md:min-h-0 flex items-center justify-center",title:"Download file",children:n.jsx(Js,{className:"w-5 h-5 md:w-4 md:h-4"})}),n.jsx("button",{onClick:he,disabled:u,className:`px-3 py-2 text-white rounded-md disabled:opacity-50 flex items-center gap-2 transition-colors min-h-[44px] md:min-h-0 ${k?"bg-green-600 hover:bg-green-700":"bg-blue-600 hover:bg-blue-700"}`,children:k?n.jsxs(n.Fragment,{children:[n.jsx("svg",{className:"w-5 h-5 md:w-4 md:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),n.jsx("span",{className:"hidden sm:inline",children:"Saved!"})]}):n.jsxs(n.Fragment,{children:[n.jsx(Zs,{className:"w-5 h-5 md:w-4 md:h-4"}),n.jsx("span",{className:"hidden sm:inline",children:u?"Saving...":"Save"})]})}),!a&&n.jsx("button",{onClick:J,className:"hidden md:flex p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 items-center justify-center",title:h?"Exit fullscreen":"Fullscreen",children:h?n.jsx(Lu,{className:"w-4 h-4"}):n.jsx(Tl,{className:"w-4 h-4"})}),n.jsx("button",{onClick:t,className:"p-2 md:p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 min-w-[44px] min-h-[44px] md:min-w-0 md:min-h-0 flex items-center justify-center",title:"Close",children:n.jsx(Mt,{className:"w-6 h-6 md:w-4 md:h-4"})})]})]}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(Su,{ref:O,value:o,onChange:l,extensions:[...ne(e.name),...Y,...e.diffInfo&&j&&e.diffInfo.old_string!==void 0?[a8({original:e.diffInfo.old_string,mergeControls:!1,highlightChanges:!0,syntaxHighlightDeletions:!1,gutter:!0}),...V,...T]:[],...L?[Tr.lineWrapping]:[]],theme:x?Cu:void 0,height:"100%",style:{fontSize:`${M}px`,height:"100%"},basicSetup:{lineNumbers:F,foldGutter:!0,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,highlightSelectionMatches:!0,searchKeymap:!0}})}),n.jsxs("div",{className:"flex items-center justify-between p-3 border-t border-border bg-muted flex-shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-600 dark:text-gray-400",children:[n.jsxs("span",{children:["Lines: ",o.split(`
|
|
897
|
-
`).length]}),n.jsxs("span",{children:["Characters: ",o.length]})]}),n.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Press Ctrl+S to save • Esc to close"})]})]})})]})}function C8({file:e,onClose:t}){const r=`/api/projects/${e.projectName}/files/content?path=${encodeURIComponent(e.path)}`,[a,s]=b.useState(null),[i,o]=b.useState(null),[l,c]=b.useState(!0);return b.useEffect(()=>{let d;const u=new AbortController;return(async()=>{try{c(!0),o(null),s(null);const h=localStorage.getItem("auth-token");if(!h){o("Missing authentication token");return}const p=await fetch(r,{headers:{Authorization:`Bearer ${h}`},signal:u.signal});if(!p.ok)throw new Error(`Request failed with status ${p.status}`);const x=await p.blob();d=URL.createObjectURL(x),s(d)}catch(h){if(h.name==="AbortError")return;console.error("Error loading image:",h),o("Unable to load image")}finally{c(!1)}})(),()=>{u.abort(),d&&URL.revokeObjectURL(d)}},[r]),n.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-4xl max-h-[90vh] w-full mx-4 overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[n.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:e.name}),n.jsx(Xe,{variant:"ghost",size:"sm",onClick:t,className:"h-8 w-8 p-0",children:n.jsx(Mt,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"p-4 flex justify-center items-center bg-gray-50 dark:bg-gray-900 min-h-[400px]",children:[l&&n.jsx("div",{className:"text-center text-gray-500 dark:text-gray-400",children:n.jsx("p",{children:"Loading image…"})}),!l&&a&&n.jsx("img",{src:a,alt:e.name,className:"max-w-full max-h-[70vh] object-contain rounded-lg shadow-md"}),!l&&!a&&n.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[n.jsx("p",{children:i||"Unable to load image"}),n.jsx("p",{className:"text-sm mt-2 break-all",children:e.path})]})]}),n.jsx("div",{className:"p-4 border-t bg-gray-50 dark:bg-gray-800",children:n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:e.path})})]})})}function M8({selectedProject:e}){const[t,r]=b.useState([]),[a,s]=b.useState(!1),[i,o]=b.useState(new Set),[l,c]=b.useState(null),[d,u]=b.useState(null),[m,h]=b.useState("detailed"),[p,x]=b.useState(""),[y,k]=b.useState([]);b.useEffect(()=>{e&&j()},[e]),b.useEffect(()=>{const O=localStorage.getItem("file-tree-view-mode");O&&["simple","detailed","compact"].includes(O)&&h(O)},[]),b.useEffect(()=>{if(!p.trim())k(t);else{const O=w(t,p.toLowerCase());k(O);const V=T=>{T.forEach(Y=>{Y.type==="directory"&&Y.children&&Y.children.length>0&&(o(ne=>new Set(ne.add(Y.path))),V(Y.children))})};V(O)}},[t,p]);const w=(O,V)=>O.reduce((T,Y)=>{const ne=Y.name.toLowerCase().includes(V);let he=[];return Y.type==="directory"&&Y.children&&(he=w(Y.children,V)),(ne||he.length>0)&&T.push({...Y,children:he}),T},[]),j=async()=>{s(!0);try{const O=await at.getFiles(e.name);if(!O.ok){const T=await O.text();console.error("❌ File fetch failed:",O.status,T),r([]);return}const V=await O.json();r(V)}catch(O){console.error("❌ Error fetching files:",O),r([])}finally{s(!1)}},N=O=>{const V=new Set(i);V.has(O)?V.delete(O):V.add(O),o(V)},L=O=>{h(O),localStorage.setItem("file-tree-view-mode",O)},U=O=>{if(!O||O===0)return"0 B";const V=1024,T=["B","KB","MB","GB"],Y=Math.floor(Math.log(O)/Math.log(V));return parseFloat((O/Math.pow(V,Y)).toFixed(1))+" "+T[Y]},I=O=>{if(!O)return"-";const V=new Date,T=new Date(O),Y=Math.floor((V-T)/1e3);return Y<60?"just now":Y<3600?`${Math.floor(Y/60)} min ago`:Y<86400?`${Math.floor(Y/3600)} hours ago`:Y<2592e3?`${Math.floor(Y/86400)} days ago`:T.toLocaleDateString()},H=(O,V=0)=>O.map(T=>n.jsxs("div",{className:"select-none",children:[n.jsx(Xe,{variant:"ghost",className:Ue("w-full justify-start p-2 h-auto font-normal text-left hover:bg-accent"),style:{paddingLeft:`${V*16+12}px`},onClick:()=>{T.type==="directory"?N(T.path):F(T.name)?u({name:T.name,path:T.path,projectPath:e.path,projectName:e.name}):c({name:T.name,path:T.path,projectPath:e.path,projectName:e.name})},children:n.jsxs("div",{className:"flex items-center gap-2 min-w-0 w-full",children:[T.type==="directory"?i.has(T.path)?n.jsx(Jn,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}):n.jsx(En,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}):W(T.name),n.jsx("span",{className:"text-sm truncate text-foreground",children:T.name})]})}),T.type==="directory"&&i.has(T.path)&&T.children&&T.children.length>0&&n.jsx("div",{children:H(T.children,V+1)})]},T.path)),F=O=>{const V=O.split(".").pop()?.toLowerCase();return["png","jpg","jpeg","gif","svg","webp","ico","bmp"].includes(V)},W=O=>{const V=O.split(".").pop()?.toLowerCase(),T=["js","jsx","ts","tsx","py","java","cpp","c","php","rb","go","rs"],Y=["md","txt","doc","pdf"],ne=["png","jpg","jpeg","gif","svg","webp","ico","bmp"];return T.includes(V)?n.jsx(Eg,{className:"w-4 h-4 text-green-500 flex-shrink-0"}):Y.includes(V)?n.jsx(mr,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}):ne.includes(V)?n.jsx(O0,{className:"w-4 h-4 text-purple-500 flex-shrink-0"}):n.jsx(O0,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"})},M=(O,V=0)=>O.map(T=>n.jsxs("div",{className:"select-none",children:[n.jsxs("div",{className:Ue("grid grid-cols-12 gap-2 p-2 hover:bg-accent cursor-pointer items-center"),style:{paddingLeft:`${V*16+12}px`},onClick:()=>{T.type==="directory"?N(T.path):F(T.name)?u({name:T.name,path:T.path,projectPath:e.path,projectName:e.name}):c({name:T.name,path:T.path,projectPath:e.path,projectName:e.name})},children:[n.jsxs("div",{className:"col-span-5 flex items-center gap-2 min-w-0",children:[T.type==="directory"?i.has(T.path)?n.jsx(Jn,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}):n.jsx(En,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}):W(T.name),n.jsx("span",{className:"text-sm truncate text-foreground",children:T.name})]}),n.jsx("div",{className:"col-span-2 text-sm text-muted-foreground",children:T.type==="file"?U(T.size):"-"}),n.jsx("div",{className:"col-span-3 text-sm text-muted-foreground",children:I(T.modified)}),n.jsx("div",{className:"col-span-2 text-sm text-muted-foreground font-mono",children:T.permissionsRwx||"-"})]}),T.type==="directory"&&i.has(T.path)&&T.children&&M(T.children,V+1)]},T.path)),_=(O,V=0)=>O.map(T=>n.jsxs("div",{className:"select-none",children:[n.jsxs("div",{className:Ue("flex items-center justify-between p-2 hover:bg-accent cursor-pointer"),style:{paddingLeft:`${V*16+12}px`},onClick:()=>{T.type==="directory"?N(T.path):F(T.name)?u({name:T.name,path:T.path,projectPath:e.path,projectName:e.name}):c({name:T.name,path:T.path,projectPath:e.path,projectName:e.name})},children:[n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[T.type==="directory"?i.has(T.path)?n.jsx(Jn,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}):n.jsx(En,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}):W(T.name),n.jsx("span",{className:"text-sm truncate text-foreground",children:T.name})]}),n.jsx("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:T.type==="file"&&n.jsxs(n.Fragment,{children:[n.jsx("span",{children:U(T.size)}),n.jsx("span",{className:"font-mono",children:T.permissionsRwx})]})})]}),T.type==="directory"&&i.has(T.path)&&T.children&&_(T.children,V+1)]},T.path));return a?n.jsx("div",{className:"h-full flex items-center justify-center",children:n.jsx("div",{className:"text-gray-500 dark:text-gray-400",children:"Loading files..."})}):n.jsxs("div",{className:"h-full flex flex-col bg-card",children:[n.jsxs("div",{className:"p-4 border-b border-border space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Files"}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx(Xe,{variant:m==="simple"?"default":"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>L("simple"),title:"Simple view",children:n.jsx(Qs,{className:"w-4 h-4"})}),n.jsx(Xe,{variant:m==="compact"?"default":"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>L("compact"),title:"Compact view",children:n.jsx(os,{className:"w-4 h-4"})}),n.jsx(Xe,{variant:m==="detailed"?"default":"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>L("detailed"),title:"Detailed view",children:n.jsx(I1,{className:"w-4 h-4"})})]})]}),n.jsxs("div",{className:"relative",children:[n.jsx(xa,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-muted-foreground"}),n.jsx(Xt,{type:"text",placeholder:"Search files and folders...",value:p,onChange:O=>x(O.target.value),className:"pl-8 pr-8 h-8 text-sm"}),p&&n.jsx(Xe,{variant:"ghost",size:"sm",className:"absolute right-1 top-1/2 transform -translate-y-1/2 h-6 w-6 p-0 hover:bg-accent",onClick:()=>x(""),title:"Clear search",children:n.jsx(Mt,{className:"w-3 h-3"})})]})]}),m==="detailed"&&y.length>0&&n.jsx("div",{className:"px-4 pt-2 pb-1 border-b border-border",children:n.jsxs("div",{className:"grid grid-cols-12 gap-2 px-2 text-xs font-medium text-muted-foreground",children:[n.jsx("div",{className:"col-span-5",children:"Name"}),n.jsx("div",{className:"col-span-2",children:"Size"}),n.jsx("div",{className:"col-span-3",children:"Modified"}),n.jsx("div",{className:"col-span-2",children:"Permissions"})]})}),n.jsx(Il,{className:"flex-1 p-4",children:t.length===0?n.jsxs("div",{className:"text-center py-8",children:[n.jsx("div",{className:"w-12 h-12 bg-muted rounded-lg flex items-center justify-center mx-auto mb-3",children:n.jsx(En,{className:"w-6 h-6 text-muted-foreground"})}),n.jsx("h4",{className:"font-medium text-foreground mb-1",children:"No files found"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Check if the project path is accessible"})]}):y.length===0&&p?n.jsxs("div",{className:"text-center py-8",children:[n.jsx("div",{className:"w-12 h-12 bg-muted rounded-lg flex items-center justify-center mx-auto mb-3",children:n.jsx(xa,{className:"w-6 h-6 text-muted-foreground"})}),n.jsx("h4",{className:"font-medium text-foreground mb-1",children:"No matches found"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Try a different search term or clear the search"})]}):n.jsxs("div",{className:m==="detailed"?"":"space-y-1",children:[m==="simple"&&H(y),m==="compact"&&_(y),m==="detailed"&&M(y)]})}),l&&n.jsx(wl,{file:l,onClose:()=>c(null),projectPath:l.projectPath}),d&&n.jsx(C8,{file:d,onClose:()=>u(null)})]})}function Yp({project:e,session:t=null,command:r=null,isActive:a=!0,isPlainShell:s=null,autoConnect:i=!0,onComplete:o=null,onClose:l=null,title:c=null,className:d="",showHeader:u=!0,compact:m=!1}){const[h,p]=b.useState(!1),x=s!==null?s:r!==null,y=k=>{p(!0),o&&o(k)};return e?n.jsxs("div",{className:`h-full flex flex-col ${d}`,children:[u&&c&&n.jsx("div",{className:"flex-shrink-0 bg-gray-800 border-b border-gray-700 px-4 py-2",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-200",children:c}),h&&n.jsx("span",{className:"text-xs text-green-400",children:"(Completed)"})]}),l&&n.jsx("button",{onClick:l,className:"text-gray-400 hover:text-white",title:"Close",children:n.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})}),n.jsx("div",{className:"flex-1",children:n.jsx(b0,{selectedProject:e,selectedSession:t,isActive:a,initialCommand:r,isPlainShell:x,onProcessComplete:y})})]}):n.jsx("div",{className:`h-full flex items-center justify-center ${d}`,children:n.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[n.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center",children:n.jsx("svg",{className:"w-8 h-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 002 2z"})})}),n.jsx("h3",{className:"text-lg font-semibold mb-2",children:"No Project Selected"}),n.jsx("p",{children:"A project is required to open a shell"})]})})}function bu({diff:e,fileName:t,isMobile:r,wrapText:a}){if(!e)return n.jsx("div",{className:"p-4 text-center text-gray-500 dark:text-gray-400 text-sm",children:"No diff available"});const s=(i,o)=>{const l=i.startsWith("+")&&!i.startsWith("+++"),c=i.startsWith("-")&&!i.startsWith("---"),d=i.startsWith("@@");return n.jsx("div",{className:`font-mono text-xs p-2 ${r&&a?"whitespace-pre-wrap break-all":"whitespace-pre overflow-x-auto"} ${l?"bg-green-50 dark:bg-green-950 text-green-700 dark:text-green-300":c?"bg-red-50 dark:bg-red-950 text-red-700 dark:text-red-300":d?"bg-blue-50 dark:bg-blue-950 text-blue-700 dark:text-blue-300":"text-gray-600 dark:text-gray-400"}`,children:i},o)};return n.jsx("div",{className:"diff-viewer",children:e.split(`
|
|
898
|
-
`).map((i,o)=>s(i,o))})}function A8({selectedProject:e,isMobile:t,onFileOpen:r}){const[a,s]=b.useState(null),[i,o]=b.useState({}),[l,c]=b.useState(!1),[d,u]=b.useState(""),[m,h]=b.useState(new Set),[p,x]=b.useState(new Set),[y,k]=b.useState(!1),[w,j]=b.useState(""),[N,L]=b.useState([]),[U,I]=b.useState(!0),[H,F]=b.useState(!1),[W,M]=b.useState(!1),[_,O]=b.useState(!1),[V,T]=b.useState(""),[Y,ne]=b.useState(!1),[he,$]=b.useState("changes"),[J,C]=b.useState([]),[ue,xe]=b.useState(new Set),[A,te]=b.useState({}),[Ce,De]=b.useState(!1),[pe,_e]=b.useState(null),[se,we]=b.useState(!1),[ze,Ae]=b.useState(!1),[Be,nt]=b.useState(!1),[bt,ut]=b.useState(!1),[jt,lt]=b.useState(t),[qe,st]=b.useState(null),St=b.useRef(null),Oe=b.useRef(null),[Qt,ie]=b.useState(()=>localStorage.getItem("selected-provider")||"claude");b.useEffect(()=>{const X=()=>{const le=localStorage.getItem("selected-provider")||"claude";ie(le)};return window.addEventListener("storage",X),()=>window.removeEventListener("storage",X)},[]),b.useEffect(()=>{e&&(Se(),B(),K(),he==="history"&&qt())},[e,he]),b.useEffect(()=>{const X=le=>{Oe.current&&!Oe.current.contains(le.target)&&M(!1)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[]);const Se=async()=>{if(e){c(!0);try{const le=await(await Qe(`/api/git/status?project=${encodeURIComponent(e.name)}`)).json();if(le.error)console.error("Git status error:",le.error),s({error:le.error,details:le.details});else{s(le),j(le.branch||"main");const Ye=new Set([...le.modified||[],...le.added||[],...le.deleted||[],...le.untracked||[]]);x(Ye);for(const wt of le.modified||[])Me(wt);for(const wt of le.added||[])Me(wt);for(const wt of le.deleted||[])Me(wt);for(const wt of le.untracked||[])Me(wt)}}catch(X){console.error("Error fetching git status:",X)}finally{c(!1)}}},B=async()=>{try{const le=await(await Qe(`/api/git/branches?project=${encodeURIComponent(e.name)}`)).json();!le.error&&le.branches&&L(le.branches)}catch(X){console.error("Error fetching branches:",X)}},K=async()=>{if(e)try{const le=await(await Qe(`/api/git/remote-status?project=${encodeURIComponent(e.name)}`)).json();le.error?_e(null):_e(le)}catch(X){console.error("Error fetching remote status:",X),_e(null)}},ke=async X=>{try{const Ye=await(await Qe("/api/git/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.name,branch:X})})).json();Ye.success?(j(X),M(!1),Se()):console.error("Failed to switch branch:",Ye.error)}catch(le){console.error("Error switching branch:",le)}},We=async()=>{if(V.trim()){ne(!0);try{const le=await(await Qe("/api/git/create-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.name,branch:V.trim()})})).json();le.success?(j(V.trim()),O(!1),M(!1),T(""),B(),Se()):console.error("Failed to create branch:",le.error)}catch(X){console.error("Error creating branch:",X)}finally{ne(!1)}}},Ge=async()=>{we(!0);try{const le=await(await Qe("/api/git/fetch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.name})})).json();le.success?(Se(),K()):console.error("Fetch failed:",le.error)}catch(X){console.error("Error fetching from remote:",X)}finally{we(!1)}},ce=async()=>{Ae(!0);try{const le=await(await Qe("/api/git/pull",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.name})})).json();le.success?(Se(),K()):console.error("Pull failed:",le.error)}catch(X){console.error("Error pulling from remote:",X)}finally{Ae(!1)}},R=async()=>{nt(!0);try{const le=await(await Qe("/api/git/push",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.name})})).json();le.success?(Se(),K()):console.error("Push failed:",le.error)}catch(X){console.error("Error pushing to remote:",X)}finally{nt(!1)}},Q=async()=>{ut(!0);try{const le=await(await Qe("/api/git/publish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.name,branch:w})})).json();le.success?(Se(),K()):console.error("Publish failed:",le.error)}catch(X){console.error("Error publishing branch:",X)}finally{ut(!1)}},be=async X=>{try{const Ye=await(await Qe("/api/git/discard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.name,file:X})})).json();Ye.success?(x(wt=>{const Jt=new Set(wt);return Jt.delete(X),Jt}),Se()):console.error("Discard failed:",Ye.error)}catch(le){console.error("Error discarding changes:",le)}},je=async X=>{try{const Ye=await(await Qe("/api/git/delete-untracked",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.name,file:X})})).json();Ye.success?(x(wt=>{const Jt=new Set(wt);return Jt.delete(X),Jt}),Se()):console.error("Delete failed:",Ye.error)}catch(le){console.error("Error deleting untracked file:",le)}},re=async()=>{if(!qe)return;const{type:X,file:le,message:Ye}=qe;st(null);try{switch(X){case"discard":await be(le);break;case"delete":await je(le);break;case"commit":await Pr();break;case"pull":await ce();break;case"push":await R();break;case"publish":await Q();break}}catch(wt){console.error(`Error executing ${X}:`,wt)}},Me=async X=>{try{const Ye=await(await Qe(`/api/git/diff?project=${encodeURIComponent(e.name)}&file=${encodeURIComponent(X)}`)).json();!Ye.error&&Ye.diff&&o(wt=>({...wt,[X]:Ye.diff}))}catch(le){console.error("Error fetching file diff:",le)}},pt=async X=>{if(r)try{const Ye=await(await Qe(`/api/git/file-with-diff?project=${encodeURIComponent(e.name)}&file=${encodeURIComponent(X)}`)).json();if(Ye.error){console.error("Error fetching file with diff:",Ye.error),r(X);return}const wt={old_string:Ye.oldContent||"",new_string:Ye.currentContent||""};r(X,wt)}catch(le){console.error("Error opening file:",le),r(X)}},qt=async()=>{try{const le=await(await Qe(`/api/git/commits?project=${encodeURIComponent(e.name)}&limit=10`)).json();!le.error&&le.commits&&C(le.commits)}catch(X){console.error("Error fetching commits:",X)}},zt=async X=>{try{const Ye=await(await Qe(`/api/git/commit-diff?project=${encodeURIComponent(e.name)}&commit=${X}`)).json();!Ye.error&&Ye.diff&&te(wt=>({...wt,[X]:Ye.diff}))}catch(le){console.error("Error fetching commit diff:",le)}},Kt=async()=>{De(!0);try{const le=await(await Qe("/api/git/generate-commit-message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.name,files:Array.from(p),provider:Qt})})).json();le.message?u(le.message):console.error("Failed to generate commit message:",le.error)}catch(X){console.error("Error generating commit message:",X)}finally{De(!1)}},Lr=X=>{h(le=>{const Ye=new Set(le);return Ye.has(X)?Ye.delete(X):Ye.add(X),Ye})},_r=X=>{xe(le=>{const Ye=new Set(le);return Ye.has(X)?Ye.delete(X):(Ye.add(X),A[X]||zt(X)),Ye})},Nt=X=>{x(le=>{const Ye=new Set(le);return Ye.has(X)?Ye.delete(X):Ye.add(X),Ye})},Pr=async()=>{if(!(!d.trim()||p.size===0)){k(!0);try{const le=await(await Qe("/api/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project:e.name,message:d,files:Array.from(p)})})).json();le.success?(u(""),x(new Set),Se(),K()):console.error("Commit failed:",le.error)}catch(X){console.error("Error committing changes:",X)}finally{k(!1)}}},en=X=>{switch(X){case"M":return"Modified";case"A":return"Added";case"D":return"Deleted";case"U":return"Untracked";default:return X}},vn=X=>{const le=ue.has(X.hash),Ye=A[X.hash];return n.jsxs("div",{className:"border-b border-gray-200 dark:border-gray-700 last:border-0",children:[n.jsxs("div",{className:"flex items-start p-3 hover:bg-gray-50 dark:hover:bg-gray-800 cursor-pointer",onClick:()=>_r(X.hash),children:[n.jsx("div",{className:"mr-2 mt-1 p-0.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded",children:le?n.jsx(Ar,{className:"w-3 h-3"}):n.jsx(cn,{className:"w-3 h-3"})}),n.jsx("div",{className:"flex-1 min-w-0",children:n.jsxs("div",{className:"flex items-start justify-between gap-2",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white truncate",children:X.message}),n.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:[X.author," • ",X.date]})]}),n.jsx("span",{className:"text-xs font-mono text-gray-400 dark:text-gray-500 flex-shrink-0",children:X.hash.substring(0,7)})]})})]}),le&&Ye&&n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900",children:n.jsxs("div",{className:"max-h-96 overflow-y-auto p-2",children:[n.jsx("div",{className:"text-xs font-mono text-gray-600 dark:text-gray-400 mb-2",children:X.stats}),n.jsx(bu,{diff:Ye,fileName:"commit",isMobile:t,wrapText:U})]})})]},X.hash)},Rr=(X,le)=>{const Ye=m.has(X),wt=p.has(X),Jt=i[X];return n.jsxs("div",{className:"border-b border-gray-200 dark:border-gray-700 last:border-0",children:[n.jsxs("div",{className:`flex items-center hover:bg-gray-50 dark:hover:bg-gray-800 ${t?"px-2 py-1.5":"px-3 py-2"}`,children:[n.jsx("input",{type:"checkbox",checked:wt,onChange:()=>Nt(X),onClick:Yt=>Yt.stopPropagation(),className:`rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600 ${t?"mr-1.5":"mr-2"}`}),n.jsxs("div",{className:"flex items-center flex-1",children:[n.jsx("div",{className:`p-0.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded cursor-pointer ${t?"mr-1":"mr-2"}`,onClick:Yt=>{Yt.stopPropagation(),Lr(X)},children:n.jsx(cn,{className:`w-3 h-3 transition-transform duration-200 ease-in-out ${Ye?"rotate-90":"rotate-0"}`})}),n.jsx("span",{className:`flex-1 truncate ${t?"text-xs":"text-sm"} cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 hover:underline`,onClick:Yt=>{Yt.stopPropagation(),pt(X)},title:"Click to open file",children:X}),n.jsxs("div",{className:"flex items-center gap-1",children:[(le==="M"||le==="D")&&n.jsxs("button",{onClick:Yt=>{Yt.stopPropagation(),st({type:"discard",file:X,message:`Discard all changes to "${X}"? This action cannot be undone.`})},className:`${t?"px-2 py-1 text-xs":"p-1"} hover:bg-red-100 dark:hover:bg-red-900 rounded text-red-600 dark:text-red-400 font-medium flex items-center gap-1`,title:"Discard changes",children:[n.jsx(Or,{className:"w-3 h-3"}),t&&n.jsx("span",{children:"Discard"})]}),le==="U"&&n.jsxs("button",{onClick:Yt=>{Yt.stopPropagation(),st({type:"delete",file:X,message:`Delete untracked file "${X}"? This action cannot be undone.`})},className:`${t?"px-2 py-1 text-xs":"p-1"} hover:bg-red-100 dark:hover:bg-red-900 rounded text-red-600 dark:text-red-400 font-medium flex items-center gap-1`,title:"Delete untracked file",children:[n.jsx(Or,{className:"w-3 h-3"}),t&&n.jsx("span",{children:"Delete"})]}),n.jsx("span",{className:`inline-flex items-center justify-center w-5 h-5 rounded text-xs font-bold border ${le==="M"?"bg-yellow-100 text-yellow-700 dark:bg-yellow-900 dark:text-yellow-300 border-yellow-200 dark:border-yellow-800":le==="A"?"bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300 border-green-200 dark:border-green-800":le==="D"?"bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300 border-red-200 dark:border-red-800":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300 border-gray-300 dark:border-gray-600"}`,title:en(le),children:le})]})]})]}),n.jsxs("div",{className:`bg-gray-50 dark:bg-gray-900 transition-all duration-400 ease-in-out overflow-hidden ${Ye&&Jt?"max-h-[600px] opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-1"}`,children:[n.jsxs("div",{className:"flex items-center justify-between p-2 border-b border-gray-200 dark:border-gray-700",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:`inline-flex items-center justify-center w-5 h-5 rounded text-xs font-bold border ${le==="M"?"bg-yellow-100 text-yellow-700 dark:bg-yellow-900 dark:text-yellow-300 border-yellow-200 dark:border-yellow-800":le==="A"?"bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300 border-green-200 dark:border-green-800":le==="D"?"bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300 border-red-200 dark:border-red-800":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300 border-gray-300 dark:border-gray-600"}`,children:le}),n.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:en(le)})]}),t&&n.jsx("button",{onClick:Yt=>{Yt.stopPropagation(),I(!U)},className:"text-xs text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white",title:U?"Switch to horizontal scroll":"Switch to text wrap",children:U?"↔️ Scroll":"↩️ Wrap"})]}),n.jsx("div",{className:"max-h-96 overflow-y-auto",children:Jt&&n.jsx(bu,{diff:Jt,fileName:X,isMobile:t,wrapText:U})})]})]},X)};return e?n.jsxs("div",{className:"h-full flex flex-col bg-background",children:[n.jsxs("div",{className:`flex items-center justify-between border-b border-gray-200 dark:border-gray-700 ${t?"px-3 py-2":"px-4 py-3"}`,children:[n.jsxs("div",{className:"relative",ref:Oe,children:[n.jsxs("button",{onClick:()=>M(!W),className:`flex items-center hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition-colors ${t?"space-x-1 px-2 py-1":"space-x-2 px-3 py-1.5"}`,children:[n.jsx(Xs,{className:`text-gray-600 dark:text-gray-400 ${t?"w-3 h-3":"w-4 h-4"}`}),n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("span",{className:`font-medium ${t?"text-xs":"text-sm"}`,children:w}),pe?.hasRemote&&n.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[pe.ahead>0&&n.jsxs("span",{className:"text-green-600 dark:text-green-400",title:`${pe.ahead} commit${pe.ahead!==1?"s":""} ahead`,children:["↑",pe.ahead]}),pe.behind>0&&n.jsxs("span",{className:"text-blue-600 dark:text-blue-400",title:`${pe.behind} commit${pe.behind!==1?"s":""} behind`,children:["↓",pe.behind]}),pe.isUpToDate&&n.jsx("span",{className:"text-gray-500 dark:text-gray-400",title:"Up to date with remote",children:"✓"})]})]}),n.jsx(Ar,{className:`w-3 h-3 text-gray-500 transition-transform ${W?"rotate-180":""}`})]}),W&&n.jsxs("div",{className:"absolute top-full left-0 mt-1 w-64 bg-white dark:bg-gray-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 z-50",children:[n.jsx("div",{className:"py-1 max-h-64 overflow-y-auto",children:N.map(X=>n.jsx("button",{onClick:()=>ke(X),className:`w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${X===w?"bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-gray-100":"text-gray-700 dark:text-gray-300"}`,children:n.jsxs("div",{className:"flex items-center space-x-2",children:[X===w&&n.jsx(ln,{className:"w-3 h-3 text-green-600 dark:text-green-400"}),n.jsx("span",{className:X===w?"font-medium":"",children:X})]})},X))}),n.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 py-1",children:n.jsxs("button",{onClick:()=>{O(!0),M(!1)},className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 flex items-center space-x-2",children:[n.jsx(nr,{className:"w-3 h-3"}),n.jsx("span",{children:"Create new branch"})]})})]})]}),n.jsxs("div",{className:`flex items-center ${t?"gap-1":"gap-2"}`,children:[pe?.hasRemote&&n.jsxs(n.Fragment,{children:[!pe?.hasUpstream&&n.jsxs("button",{onClick:()=>st({type:"publish",message:`Publish branch "${w}" to ${pe.remoteName}?`}),disabled:bt,className:"px-2 py-1 text-xs bg-purple-600 text-white rounded hover:bg-purple-700 disabled:opacity-50 flex items-center gap-1",title:`Publish branch "${w}" to ${pe.remoteName}`,children:[n.jsx(Ns,{className:`w-3 h-3 ${bt?"animate-pulse":""}`}),n.jsx("span",{children:bt?"Publishing...":"Publish"})]}),pe?.hasUpstream&&!pe?.isUpToDate&&n.jsxs(n.Fragment,{children:[pe.behind>0&&n.jsxs("button",{onClick:()=>st({type:"pull",message:`Pull ${pe.behind} commit${pe.behind!==1?"s":""} from ${pe.remoteName}?`}),disabled:ze,className:"px-2 py-1 text-xs bg-green-600 text-white rounded hover:bg-green-700 disabled:opacity-50 flex items-center gap-1",title:`Pull ${pe.behind} commit${pe.behind!==1?"s":""} from ${pe.remoteName}`,children:[n.jsx(Js,{className:`w-3 h-3 ${ze?"animate-pulse":""}`}),n.jsx("span",{children:ze?"Pulling...":`Pull ${pe.behind}`})]}),pe.ahead>0&&n.jsxs("button",{onClick:()=>st({type:"push",message:`Push ${pe.ahead} commit${pe.ahead!==1?"s":""} to ${pe.remoteName}?`}),disabled:Be,className:"px-2 py-1 text-xs bg-orange-600 text-white rounded hover:bg-orange-700 disabled:opacity-50 flex items-center gap-1",title:`Push ${pe.ahead} commit${pe.ahead!==1?"s":""} to ${pe.remoteName}`,children:[n.jsx(Ns,{className:`w-3 h-3 ${Be?"animate-pulse":""}`}),n.jsx("span",{children:Be?"Pushing...":`Push ${pe.ahead}`})]}),(pe.ahead>0||pe.behind>0&&pe.ahead>0)&&n.jsxs("button",{onClick:Ge,disabled:se,className:"px-2 py-1 text-xs bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center gap-1",title:`Fetch from ${pe.remoteName}`,children:[n.jsx(Tn,{className:`w-3 h-3 ${se?"animate-spin":""}`}),n.jsx("span",{children:se?"Fetching...":"Fetch"})]})]})]}),n.jsx("button",{onClick:()=>{Se(),B(),K()},disabled:l,className:`hover:bg-gray-100 dark:hover:bg-gray-800 rounded ${t?"p-1":"p-1.5"}`,children:n.jsx(Tn,{className:`${l?"animate-spin":""} ${t?"w-3 h-3":"w-4 h-4"}`})})]})]}),a?.error?n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-gray-500 dark:text-gray-400 px-6 py-12",children:[n.jsx(Xs,{className:"w-20 h-20 mb-6 opacity-30"}),n.jsx("h3",{className:"text-xl font-medium mb-3 text-center",children:a.error}),a.details&&n.jsx("p",{className:"text-sm text-center leading-relaxed mb-6 max-w-md",children:a.details}),n.jsx("div",{className:"p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-200 dark:border-blue-800 max-w-md",children:n.jsxs("p",{className:"text-sm text-blue-700 dark:text-blue-300 text-center",children:[n.jsx("strong",{children:"Tip:"})," Run ",n.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-2 py-1 rounded font-mono text-xs",children:"git init"})," in your project directory to initialize git source control."]})})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:`flex border-b border-gray-200 dark:border-gray-700 transition-all duration-300 ease-in-out ${m.size===0?"max-h-16 opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2 overflow-hidden"}`,children:[n.jsx("button",{onClick:()=>$("changes"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${he==="changes"?"text-blue-600 dark:text-blue-400 border-b-2 border-blue-600 dark:border-blue-400":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"}`,children:n.jsxs("div",{className:"flex items-center justify-center gap-2",children:[n.jsx(mr,{className:"w-4 h-4"}),n.jsx("span",{children:"Changes"})]})}),n.jsx("button",{onClick:()=>$("history"),className:`flex-1 px-4 py-2 text-sm font-medium transition-colors ${he==="history"?"text-blue-600 dark:text-blue-400 border-b-2 border-blue-600 dark:border-blue-400":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"}`,children:n.jsxs("div",{className:"flex items-center justify-center gap-2",children:[n.jsx(_0,{className:"w-4 h-4"}),n.jsx("span",{children:"History"})]})})]}),he==="changes"&&n.jsx(n.Fragment,{children:n.jsx("div",{className:`transition-all duration-300 ease-in-out ${m.size===0?"max-h-96 opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2 overflow-hidden"}`,children:t&&jt?n.jsx("div",{className:"px-4 py-2 border-b border-gray-200 dark:border-gray-700",children:n.jsxs("button",{onClick:()=>lt(!1),className:"w-full flex items-center justify-center gap-2 px-3 py-2 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700",children:[n.jsx($0,{className:"w-4 h-4"}),n.jsxs("span",{children:["Commit ",p.size," file",p.size!==1?"s":""]}),n.jsx(Ar,{className:"w-3 h-3"})]})}):n.jsx(n.Fragment,{children:n.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:[t&&n.jsxs("div",{className:"flex items-center justify-between mb-2",children:[n.jsx("span",{className:"text-sm font-medium",children:"Commit Changes"}),n.jsx("button",{onClick:()=>lt(!0),className:"p-1 hover:bg-gray-100 dark:hover:bg-gray-800 rounded",children:n.jsx(Ar,{className:"w-4 h-4 rotate-180"})})]}),n.jsxs("div",{className:"relative",children:[n.jsx("textarea",{ref:St,value:d,onChange:X=>u(X.target.value),placeholder:"Message (Ctrl+Enter to commit)",className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 resize-none pr-20",rows:"3",onKeyDown:X=>{X.key==="Enter"&&(X.ctrlKey||X.metaKey)&&Pr()}}),n.jsxs("div",{className:"absolute right-2 top-2 flex gap-1",children:[n.jsx("button",{onClick:Kt,disabled:p.size===0||Ce,className:"p-1.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 disabled:opacity-50 disabled:cursor-not-allowed",title:"Generate commit message",children:Ce?n.jsx(Tn,{className:"w-4 h-4 animate-spin"}):n.jsx(Dn,{className:"w-4 h-4"})}),n.jsx("div",{style:{display:"none"},children:n.jsx(kp,{onTranscript:X=>u(X),mode:"default",className:"p-1.5"})})]})]}),n.jsxs("div",{className:"flex items-center justify-between mt-2",children:[n.jsxs("span",{className:"text-xs text-gray-500",children:[p.size," file",p.size!==1?"s":""," selected"]}),n.jsxs("button",{onClick:()=>st({type:"commit",message:`Commit ${p.size} file${p.size!==1?"s":""} with message: "${d.trim()}"?`}),disabled:!d.trim()||p.size===0||y,className:"px-3 py-1 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-1",children:[n.jsx(ln,{className:"w-3 h-3"}),n.jsx("span",{children:y?"Committing...":"Commit"})]})]})]})})})}),he==="changes"&&a&&!a.error&&n.jsxs("div",{className:`border-b border-gray-200 dark:border-gray-700 flex items-center justify-between transition-all duration-300 ease-in-out ${t?"px-3 py-1.5":"px-4 py-2"} ${m.size===0?"max-h-16 opacity-100 translate-y-0":"max-h-0 opacity-0 -translate-y-2 overflow-hidden"}`,children:[n.jsxs("span",{className:"text-gray-600 dark:text-gray-400 text-xs",children:[p.size," of ",(a?.modified?.length||0)+(a?.added?.length||0)+(a?.deleted?.length||0)+(a?.untracked?.length||0)," ",t?"":"files"," selected"]}),n.jsxs("div",{className:`flex ${t?"gap-1":"gap-2"}`,children:[n.jsx("button",{onClick:()=>{const X=new Set([...a?.modified||[],...a?.added||[],...a?.deleted||[],...a?.untracked||[]]);x(X)},className:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 text-xs",children:t?"All":"Select All"}),n.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"|"}),n.jsx("button",{onClick:()=>x(new Set),className:"text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 text-xs",children:t?"None":"Deselect All"})]})]}),!a?.error&&!t&&n.jsxs("div",{className:"border-b border-gray-200 dark:border-gray-700",children:[n.jsxs("button",{onClick:()=>F(!H),className:"w-full px-4 py-2 bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-750 text-xs text-gray-600 dark:text-gray-400 flex items-center justify-center gap-1",children:[n.jsx(Kg,{className:"w-3 h-3"}),n.jsx("span",{children:"File Status Guide"}),H?n.jsx(Ar,{className:"w-3 h-3"}):n.jsx(cn,{className:"w-3 h-3"})]}),H&&n.jsx("div",{className:"px-4 py-3 bg-gray-50 dark:bg-gray-800 text-xs",children:n.jsxs("div",{className:`${t?"grid grid-cols-2 gap-3 justify-items-center":"flex justify-center gap-6"}`,children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 bg-yellow-100 text-yellow-700 dark:bg-yellow-900 dark:text-yellow-300 rounded border border-yellow-200 dark:border-yellow-800 font-bold text-xs",children:"M"}),n.jsx("span",{className:"text-gray-600 dark:text-gray-400 italic",children:"Modified"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300 rounded border border-green-200 dark:border-green-800 font-bold text-xs",children:"A"}),n.jsx("span",{className:"text-gray-600 dark:text-gray-400 italic",children:"Added"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 bg-red-100 text-red-700 dark:bg-red-900 dark:text-red-300 rounded border border-red-200 dark:border-red-800 font-bold text-xs",children:"D"}),n.jsx("span",{className:"text-gray-600 dark:text-gray-400 italic",children:"Deleted"})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300 rounded border border-gray-300 dark:border-gray-600 font-bold text-xs",children:"U"}),n.jsx("span",{className:"text-gray-600 dark:text-gray-400 italic",children:"Untracked"})]})]})})]})]}),he==="changes"&&!a?.error&&n.jsx("div",{className:`flex-1 overflow-y-auto ${t?"pb-mobile-nav":""}`,children:l?n.jsx("div",{className:"flex items-center justify-center h-32",children:n.jsx(Tn,{className:"w-6 h-6 animate-spin text-gray-400"})}):!a||!a.modified?.length&&!a.added?.length&&!a.deleted?.length&&!a.untracked?.length?n.jsxs("div",{className:"flex flex-col items-center justify-center h-32 text-gray-500 dark:text-gray-400",children:[n.jsx($0,{className:"w-12 h-12 mb-2 opacity-50"}),n.jsx("p",{className:"text-sm",children:"No changes detected"})]}):n.jsxs("div",{className:t?"pb-4":"",children:[a.modified?.map(X=>Rr(X,"M")),a.added?.map(X=>Rr(X,"A")),a.deleted?.map(X=>Rr(X,"D")),a.untracked?.map(X=>Rr(X,"U"))]})}),he==="history"&&!a?.error&&n.jsx("div",{className:`flex-1 overflow-y-auto ${t?"pb-mobile-nav":""}`,children:l?n.jsx("div",{className:"flex items-center justify-center h-32",children:n.jsx(Tn,{className:"w-6 h-6 animate-spin text-gray-400"})}):J.length===0?n.jsxs("div",{className:"flex flex-col items-center justify-center h-32 text-gray-500 dark:text-gray-400",children:[n.jsx(_0,{className:"w-12 h-12 mb-2 opacity-50"}),n.jsx("p",{className:"text-sm",children:"No commits found"})]}):n.jsx("div",{className:t?"pb-4":"",children:J.map(X=>vn(X))})}),_&&n.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[n.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50",onClick:()=>O(!1)}),n.jsx("div",{className:"relative bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full",children:n.jsxs("div",{className:"p-6",children:[n.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Create New Branch"}),n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:"Branch Name"}),n.jsx("input",{type:"text",value:V,onChange:X=>T(X.target.value),onKeyDown:X=>{X.key==="Enter"&&!Y&&We()},placeholder:"feature/new-feature",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500",autoFocus:!0})]}),n.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-4",children:["This will create a new branch from the current branch (",w,")"]}),n.jsxs("div",{className:"flex justify-end space-x-3",children:[n.jsx("button",{onClick:()=>{O(!1),T("")},className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md",children:"Cancel"}),n.jsx("button",{onClick:We,disabled:!V.trim()||Y,className:"px-4 py-2 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-2",children:Y?n.jsxs(n.Fragment,{children:[n.jsx(Tn,{className:"w-3 h-3 animate-spin"}),n.jsx("span",{children:"Creating..."})]}):n.jsxs(n.Fragment,{children:[n.jsx(nr,{className:"w-3 h-3"}),n.jsx("span",{children:"Create Branch"})]})})]})]})})]}),qe&&n.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[n.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50",onClick:()=>st(null)}),n.jsx("div",{className:"relative bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full",children:n.jsxs("div",{className:"p-6",children:[n.jsxs("div",{className:"flex items-center mb-4",children:[n.jsx("div",{className:`p-2 rounded-full mr-3 ${qe.type==="discard"||qe.type==="delete"?"bg-red-100 dark:bg-red-900":"bg-yellow-100 dark:bg-yellow-900"}`,children:n.jsx(Wa,{className:`w-5 h-5 ${qe.type==="discard"||qe.type==="delete"?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`})}),n.jsx("h3",{className:"text-lg font-semibold",children:qe.type==="discard"?"Discard Changes":qe.type==="delete"?"Delete File":qe.type==="commit"?"Confirm Commit":qe.type==="pull"?"Confirm Pull":qe.type==="publish"?"Publish Branch":"Confirm Push"})]}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:qe.message}),n.jsxs("div",{className:"flex justify-end space-x-3",children:[n.jsx("button",{onClick:()=>st(null),className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md",children:"Cancel"}),n.jsx("button",{onClick:re,className:`px-4 py-2 text-sm text-white rounded-md ${qe.type==="discard"||qe.type==="delete"?"bg-red-600 hover:bg-red-700":qe.type==="commit"?"bg-blue-600 hover:bg-blue-700":qe.type==="pull"?"bg-green-600 hover:bg-green-700":qe.type==="publish"?"bg-purple-600 hover:bg-purple-700":"bg-orange-600 hover:bg-orange-700"} flex items-center space-x-2`,children:qe.type==="discard"?n.jsxs(n.Fragment,{children:[n.jsx(Or,{className:"w-4 h-4"}),n.jsx("span",{children:"Discard"})]}):qe.type==="delete"?n.jsxs(n.Fragment,{children:[n.jsx(Or,{className:"w-4 h-4"}),n.jsx("span",{children:"Delete"})]}):qe.type==="commit"?n.jsxs(n.Fragment,{children:[n.jsx(ln,{className:"w-4 h-4"}),n.jsx("span",{children:"Commit"})]}):qe.type==="pull"?n.jsxs(n.Fragment,{children:[n.jsx(Js,{className:"w-4 h-4"}),n.jsx("span",{children:"Pull"})]}):qe.type==="publish"?n.jsxs(n.Fragment,{children:[n.jsx(Ns,{className:"w-4 h-4"}),n.jsx("span",{children:"Publish"})]}):n.jsxs(n.Fragment,{children:[n.jsx(Ns,{className:"w-4 h-4"}),n.jsx("span",{children:"Push"})]})})]})]})})]})]}):n.jsx("div",{className:"h-full flex items-center justify-center text-gray-500 dark:text-gray-400",children:n.jsx("p",{children:"Select a project to view source control"})})}class T8 extends Jr.Component{constructor(t){super(t),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,r){console.error("ErrorBoundary caught an error:",t,r),this.setState({error:t,errorInfo:r})}render(){return this.state.hasError?n.jsx("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:n.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-6 max-w-md",children:[n.jsxs("div",{className:"flex items-center mb-4",children:[n.jsx("div",{className:"flex-shrink-0",children:n.jsx("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:n.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),n.jsx("h3",{className:"ml-3 text-sm font-medium text-red-800",children:"Something went wrong"})]}),n.jsxs("div",{className:"text-sm text-red-700",children:[n.jsx("p",{className:"mb-2",children:"An error occurred while loading the chat interface."}),this.props.showDetails&&this.state.error&&n.jsxs("details",{className:"mt-4",children:[n.jsx("summary",{className:"cursor-pointer text-xs font-mono",children:"Error Details"}),n.jsxs("pre",{className:"mt-2 text-xs bg-red-100 p-2 rounded overflow-auto max-h-40",children:[this.state.error.toString(),this.state.errorInfo&&this.state.errorInfo.componentStack]})]})]}),n.jsx("div",{className:"mt-4",children:n.jsx("button",{onClick:()=>{this.setState({hasError:!1,error:null,errorInfo:null}),this.props.onRetry&&this.props.onRetry()},className:"bg-red-600 text-white px-4 py-2 rounded text-sm hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500",children:"Try Again"})})]})}):this.props.children}}const hr=({children:e,content:t,position:r="top",className:a="",delay:s=500})=>{const[i,o]=b.useState(!1),[l,c]=b.useState(null),d=()=>{const p=setTimeout(()=>{o(!0)},s);c(p)},u=()=>{l&&(clearTimeout(l),c(null)),o(!1)},m=()=>{switch(r){case"top":return"bottom-full left-1/2 transform -translate-x-1/2 mb-2";case"bottom":return"top-full left-1/2 transform -translate-x-1/2 mt-2";case"left":return"right-full top-1/2 transform -translate-y-1/2 mr-2";case"right":return"left-full top-1/2 transform -translate-y-1/2 ml-2";default:return"bottom-full left-1/2 transform -translate-x-1/2 mb-2"}},h=()=>{switch(r){case"top":return"top-full left-1/2 transform -translate-x-1/2 border-t-gray-900 dark:border-t-gray-100";case"bottom":return"bottom-full left-1/2 transform -translate-x-1/2 border-b-gray-900 dark:border-b-gray-100";case"left":return"left-full top-1/2 transform -translate-y-1/2 border-l-gray-900 dark:border-l-gray-100";case"right":return"right-full top-1/2 transform -translate-y-1/2 border-r-gray-900 dark:border-r-gray-100";default:return"top-full left-1/2 transform -translate-x-1/2 border-t-gray-900 dark:border-t-gray-100"}};return t?n.jsxs("div",{className:"relative inline-block",onMouseEnter:d,onMouseLeave:u,children:[e,i&&n.jsxs("div",{className:Ue("absolute z-50 px-2 py-1 text-xs font-medium text-white bg-gray-900 dark:bg-gray-100 dark:text-gray-900 rounded shadow-lg whitespace-nowrap pointer-events-none","animate-in fade-in-0 zoom-in-95 duration-200",m(),a),children:[t,n.jsx("div",{className:Ue("absolute w-0 h-0 border-4 border-transparent",h())})]})]}):e},yu=({task:e,onClick:t,showParent:r=!1,className:a=""})=>{const i=(l=>{switch(l){case"done":return{icon:is,bgColor:"bg-green-50 dark:bg-green-950",borderColor:"border-green-200 dark:border-green-800",iconColor:"text-green-600 dark:text-green-400",textColor:"text-green-900 dark:text-green-100",statusText:"Done"};case"in-progress":return{icon:Ya,bgColor:"bg-blue-50 dark:bg-blue-950",borderColor:"border-blue-200 dark:border-blue-800",iconColor:"text-blue-600 dark:text-blue-400",textColor:"text-blue-900 dark:text-blue-100",statusText:"In Progress"};case"review":return{icon:gi,bgColor:"bg-amber-50 dark:bg-amber-950",borderColor:"border-amber-200 dark:border-amber-800",iconColor:"text-amber-600 dark:text-amber-400",textColor:"text-amber-900 dark:text-amber-100",statusText:"Review"};case"deferred":return{icon:Pu,bgColor:"bg-gray-50 dark:bg-gray-800",borderColor:"border-gray-200 dark:border-gray-700",iconColor:"text-gray-500 dark:text-gray-400",textColor:"text-gray-700 dark:text-gray-300",statusText:"Deferred"};case"cancelled":return{icon:Mt,bgColor:"bg-red-50 dark:bg-red-950",borderColor:"border-red-200 dark:border-red-800",iconColor:"text-red-600 dark:text-red-400",textColor:"text-red-900 dark:text-red-100",statusText:"Cancelled"};case"pending":default:return{icon:ma,bgColor:"bg-slate-50 dark:bg-slate-800",borderColor:"border-slate-200 dark:border-slate-700",iconColor:"text-slate-500 dark:text-slate-400",textColor:"text-slate-900 dark:text-slate-100",statusText:"Pending"}}})(e.status);i.icon;const o=l=>{switch(l){case"high":return n.jsx(hr,{content:"High Priority",children:n.jsx("div",{className:"w-4 h-4 bg-red-100 dark:bg-red-900/30 rounded flex items-center justify-center",children:n.jsx(mg,{className:"w-2.5 h-2.5 text-red-600 dark:text-red-400"})})});case"medium":return n.jsx(hr,{content:"Medium Priority",children:n.jsx("div",{className:"w-4 h-4 bg-amber-100 dark:bg-amber-900/30 rounded flex items-center justify-center",children:n.jsx(i1,{className:"w-2.5 h-2.5 text-amber-600 dark:text-amber-400"})})});case"low":return n.jsx(hr,{content:"Low Priority",children:n.jsx("div",{className:"w-4 h-4 bg-blue-100 dark:bg-blue-900/30 rounded flex items-center justify-center",children:n.jsx(ma,{className:"w-1.5 h-1.5 text-blue-600 dark:text-blue-400 fill-current"})})});default:return n.jsx(hr,{content:"No Priority Set",children:n.jsx("div",{className:"w-4 h-4 bg-gray-100 dark:bg-gray-800 rounded flex items-center justify-center",children:n.jsx(ma,{className:"w-1.5 h-1.5 text-gray-400 dark:text-gray-500"})})})}};return n.jsxs("div",{className:Ue("bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700","hover:shadow-md hover:border-blue-300 dark:hover:border-blue-600 transition-all duration-200 cursor-pointer","p-3 space-y-3",t&&"hover:-translate-y-0.5",a),onClick:t,children:[n.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("div",{className:"flex items-center gap-2 mb-1",children:n.jsx(hr,{content:`Task ID: ${e.id}`,children:n.jsx("span",{className:"text-xs font-mono text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-700 px-2 py-0.5 rounded",children:e.id})})}),n.jsx("h3",{className:"font-medium text-sm text-gray-900 dark:text-white line-clamp-2 leading-tight",children:e.title}),r&&e.parentId&&n.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400 font-medium",children:["Task ",e.parentId]})]}),n.jsx("div",{className:"flex-shrink-0",children:o(e.priority)})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"flex items-center",children:e.dependencies&&Array.isArray(e.dependencies)&&e.dependencies.length>0&&n.jsx(hr,{content:`Depends on: ${e.dependencies.map(l=>`Task ${l}`).join(", ")}`,children:n.jsxs("div",{className:"flex items-center gap-1 text-xs text-amber-600 dark:text-amber-400",children:[n.jsx(Ml,{className:"w-3 h-3"}),n.jsxs("span",{children:["Depends on: ",e.dependencies.join(", ")]})]})})}),n.jsx(hr,{content:`Status: ${i.statusText}`,children:n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx("div",{className:Ue("w-2 h-2 rounded-full",i.iconColor.replace("text-","bg-"))}),n.jsx("span",{className:Ue("text-xs font-medium",i.textColor),children:i.statusText})]})})]}),e.subtasks&&e.subtasks.length>0&&n.jsx("div",{className:"ml-3",children:n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Progress:"}),n.jsx(hr,{content:`${e.subtasks.filter(l=>l.status==="done").length} of ${e.subtasks.length} subtasks completed`,children:n.jsx("div",{className:"flex-1 bg-gray-200 dark:bg-gray-700 rounded-full h-1.5",children:n.jsx("div",{className:Ue("h-full rounded-full transition-all duration-300",e.status==="done"?"bg-green-500":"bg-blue-500"),style:{width:`${Math.round(e.subtasks.filter(l=>l.status==="done").length/e.subtasks.length*100)}%`}})})}),n.jsx(hr,{content:`${e.subtasks.filter(l=>l.status==="done").length} completed, ${e.subtasks.filter(l=>l.status==="pending").length} pending, ${e.subtasks.filter(l=>l.status==="in-progress").length} in progress`,children:n.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[e.subtasks.filter(l=>l.status==="done").length,"/",e.subtasks.length]})})]})})]})},E8=({currentProject:e,onClose:t,onTaskCreated:r})=>n.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-md border border-gray-200 dark:border-gray-700",children:[n.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-blue-100 dark:bg-blue-900/50 rounded-lg flex items-center justify-center",children:n.jsx(Dn,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),n.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Create AI-Generated Task"})]}),n.jsx("button",{onClick:t,className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700",children:n.jsx(Mt,{className:"w-5 h-5"})})]}),n.jsxs("div",{className:"p-6 space-y-6",children:[n.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-4 border border-blue-200 dark:border-blue-800",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-blue-100 dark:bg-blue-900/50 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5",children:n.jsx(Dn,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("h4",{className:"font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"💡 Pro Tip: Ask Claude Code Directly!"}),n.jsx("p",{className:"text-sm text-blue-800 dark:text-blue-200 mb-3",children:"You can simply ask Claude Code in the chat to create tasks for you. The AI assistant will automatically generate detailed tasks with research-backed insights."}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded border border-blue-200 dark:border-blue-700 p-3 mb-3",children:[n.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Example:"}),n.jsx("p",{className:"text-sm text-gray-900 dark:text-white font-mono",children:'"Please add a new task to implement user profile image uploads using Cloudinary, research the best approach."'})]}),n.jsxs("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:[n.jsx("strong",{children:"This runs:"})," ",n.jsx("code",{className:"bg-blue-100 dark:bg-blue-900/50 px-1 rounded text-xs",children:'task-master add-task --prompt="Implement user profile image uploads using Cloudinary" --research'})]})]})]})}),n.jsxs("div",{className:"text-center pt-4 border-t border-gray-200 dark:border-gray-700",children:[n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:"For more examples and advanced usage patterns:"}),n.jsx("a",{href:"https://github.com/eyaltoledano/claude-task-master/blob/main/docs/examples.md",target:"_blank",rel:"noopener noreferrer",className:"inline-block text-sm text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 underline font-medium",children:"View TaskMaster Documentation →"})]}),n.jsx("div",{className:"pt-4",children:n.jsx("button",{onClick:t,className:"w-full px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors",children:"Got it, I'll ask Claude Code directly"})})]})]})}),I8=({tasks:e=[],onTaskClick:t,className:r="",showParentTasks:a=!1,defaultView:s="kanban",currentProject:i,onTaskCreated:o,onShowPRDEditor:l,existingPRDs:c=[],onRefreshPRDs:d})=>{const[u,m]=b.useState(""),[h,p]=b.useState("all"),[x,y]=b.useState("all"),[k,w]=b.useState("id"),[j,N]=b.useState("asc"),[L,U]=b.useState(s),[I,H]=b.useState(!1),[F,W]=b.useState(!1),[M,_]=b.useState(!1),[O,V]=b.useState(!1),[T,Y]=b.useState(!1),[ne,he]=b.useState(!1),{projectTaskMaster:$,refreshProjects:J,refreshTasks:C,setCurrentProject:ue}=ls();b.useEffect(()=>{const se=we=>{ne&&!we.target.closest(".relative")&&he(!1)};return document.addEventListener("mousedown",se),()=>document.removeEventListener("mousedown",se)},[ne]);const xe=b.useMemo(()=>{const se=new Set(e.map(we=>we.status).filter(Boolean));return Array.from(se).sort()},[e]),A=b.useMemo(()=>{const se=new Set(e.map(we=>we.priority).filter(Boolean));return Array.from(se).sort()},[e]),te=b.useMemo(()=>{let se=e.filter(we=>{const ze=u.toLowerCase(),Ae=!u||we.title.toLowerCase().includes(ze)||we.description?.toLowerCase().includes(ze)||we.id.toString().includes(ze),Be=h==="all"||we.status===h,nt=x==="all"||we.priority===x;return Ae&&Be&&nt});return se.sort((we,ze)=>{let Ae,Be;switch(k){case"title":Ae=we.title.toLowerCase(),Be=ze.title.toLowerCase();break;case"status":const nt={pending:1,"in-progress":2,done:3,blocked:4,deferred:5,cancelled:6};Ae=nt[we.status]||99,Be=nt[ze.status]||99;break;case"priority":const bt={high:3,medium:2,low:1};Ae=bt[we.priority]||0,Be=bt[ze.priority]||0;break;case"updated":Ae=new Date(we.updatedAt||we.createdAt||0),Be=new Date(ze.updatedAt||ze.createdAt||0);break;case"id":default:const ut=qe=>qe.toString().split(".").map(St=>parseInt(St,10)),jt=ut(we.id),lt=ut(ze.id);for(let qe=0;qe<Math.max(jt.length,lt.length);qe++){const st=jt[qe]||0,St=lt[qe]||0;if(st!==St){Ae=st,Be=St;break}}break}return k==="updated"?j==="asc"?Ae-Be:Be-Ae:typeof Ae=="string"?j==="asc"?Ae.localeCompare(Be):Be.localeCompare(Ae):j==="asc"?Ae-Be:Be-Ae}),se},[e,u,h,x,k,j]),Ce=b.useMemo(()=>{const se=[{id:"pending",title:"📋 To Do",status:"pending",color:"bg-slate-50 dark:bg-slate-900/50 border-slate-200 dark:border-slate-700",headerColor:"bg-slate-100 dark:bg-slate-800 text-slate-800 dark:text-slate-200"},{id:"in-progress",title:"🚀 In Progress",status:"in-progress",color:"bg-blue-50 dark:bg-blue-900/50 border-blue-200 dark:border-blue-700",headerColor:"bg-blue-100 dark:bg-blue-800 text-blue-800 dark:text-blue-200"},{id:"done",title:"✅ Done",status:"done",color:"bg-emerald-50 dark:bg-emerald-900/50 border-emerald-200 dark:border-emerald-700",headerColor:"bg-emerald-100 dark:bg-emerald-800 text-emerald-800 dark:text-emerald-200"},{id:"blocked",title:"🚫 Blocked",status:"blocked",color:"bg-red-50 dark:bg-red-900/50 border-red-200 dark:border-red-700",headerColor:"bg-red-100 dark:bg-red-800 text-red-800 dark:text-red-200"},{id:"deferred",title:"⏳ Deferred",status:"deferred",color:"bg-amber-50 dark:bg-amber-900/50 border-amber-200 dark:border-amber-700",headerColor:"bg-amber-100 dark:bg-amber-800 text-amber-800 dark:text-amber-200"},{id:"cancelled",title:"❌ Cancelled",status:"cancelled",color:"bg-gray-50 dark:bg-gray-900/50 border-gray-200 dark:border-gray-700",headerColor:"bg-gray-100 dark:bg-gray-800 text-gray-800 dark:text-gray-200"}],we=["pending","in-progress","done"];return se.filter(Ae=>{const Be=te.some(bt=>bt.status===Ae.status),nt=we.includes(Ae.status);return Be||nt}).map(Ae=>({...Ae,tasks:te.filter(Be=>Be.status===Ae.status)}))},[te]),De=se=>{k===se?N(j==="asc"?"desc":"asc"):(w(se),N("asc"))},pe=()=>{m(""),p("all"),y("all")},_e=se=>k!==se?n.jsx(ng,{className:"w-4 h-4"}):j==="asc"?n.jsx(sg,{className:"w-4 h-4"}):n.jsx(Tu,{className:"w-4 h-4"});if(e.length===0){const se=i?.taskMasterConfigured||i?.taskmaster?.hasTaskmaster||$?.hasTaskmaster;return n.jsxs("div",{className:Ue("text-center py-12",r),children:[se?n.jsxs("div",{className:"max-w-4xl mx-auto",children:[n.jsxs("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-950/50 dark:to-indigo-950/50 rounded-xl border border-blue-200 dark:border-blue-800 p-6 mb-6",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsx("div",{className:"w-10 h-10 bg-blue-100 dark:bg-blue-900/50 rounded-lg flex items-center justify-center",children:n.jsx(mr,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Getting Started with TaskMaster"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"TaskMaster is initialized! Here's what to do next:"})]})]}),n.jsxs("div",{className:"space-y-4 text-left",children:[n.jsxs("div",{className:"grid gap-3",children:[n.jsxs("div",{className:"flex gap-3 p-3 bg-white dark:bg-gray-800/50 rounded-lg border border-blue-100 dark:border-blue-800/50",children:[n.jsx("div",{className:"flex-shrink-0 w-6 h-6 bg-blue-600 text-white text-xs font-semibold rounded-full flex items-center justify-center",children:"1"}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium text-gray-900 dark:text-white mb-1",children:"Create a Product Requirements Document (PRD)"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-2",children:"Discuss your project idea and create a PRD that describes what you want to build."}),n.jsxs("button",{onClick:()=>{l?.()},className:"inline-flex items-center gap-1 text-xs bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300 px-2 py-1 rounded hover:bg-purple-200 dark:hover:bg-purple-900/50 transition-colors",children:[n.jsx(mr,{className:"w-3 h-3"}),"Add PRD"]}),c.length>0&&n.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200 dark:border-gray-700",children:[n.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"Existing PRDs:"}),n.jsx("div",{className:"flex flex-wrap gap-2",children:c.map(we=>n.jsxs("button",{onClick:async()=>{try{const ze=await at.get(`/taskmaster/prd/${encodeURIComponent(i.name)}/${encodeURIComponent(we.name)}`);if(ze.ok){const Ae=await ze.json();l?.({name:we.name,content:Ae.content,isExisting:!0})}else console.error("Failed to load PRD:",ze.statusText)}catch(ze){console.error("Error loading PRD:",ze)}},className:"inline-flex items-center gap-1 text-xs bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 px-2 py-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",children:[n.jsx(mr,{className:"w-3 h-3"}),we.name]},we.name))})]})]})]}),n.jsxs("div",{className:"flex gap-3 p-3 bg-white dark:bg-gray-800/50 rounded-lg border border-blue-100 dark:border-blue-800/50",children:[n.jsx("div",{className:"flex-shrink-0 w-6 h-6 bg-blue-600 text-white text-xs font-semibold rounded-full flex items-center justify-center",children:"2"}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium text-gray-900 dark:text-white mb-1",children:"Generate Tasks from PRD"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Once you have a PRD, ask your AI assistant to parse it and TaskMaster will automatically break it down into manageable tasks with implementation details."})]})]}),n.jsxs("div",{className:"flex gap-3 p-3 bg-white dark:bg-gray-800/50 rounded-lg border border-blue-100 dark:border-blue-800/50",children:[n.jsx("div",{className:"flex-shrink-0 w-6 h-6 bg-blue-600 text-white text-xs font-semibold rounded-full flex items-center justify-center",children:"3"}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium text-gray-900 dark:text-white mb-1",children:"Analyze & Expand Tasks"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Ask your AI assistant to analyze task complexity and expand them into detailed subtasks for easier implementation."})]})]}),n.jsxs("div",{className:"flex gap-3 p-3 bg-white dark:bg-gray-800/50 rounded-lg border border-blue-100 dark:border-blue-800/50",children:[n.jsx("div",{className:"flex-shrink-0 w-6 h-6 bg-blue-600 text-white text-xs font-semibold rounded-full flex items-center justify-center",children:"4"}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium text-gray-900 dark:text-white mb-1",children:"Start Building"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Ask your AI assistant to begin working on tasks, update their status, and add new tasks as your project evolves."})]})]})]}),n.jsx("div",{className:"flex gap-3 pt-4 border-t border-blue-200 dark:border-blue-700",children:n.jsxs("button",{onClick:we=>{we.preventDefault(),we.stopPropagation(),l?.()},className:"flex items-center gap-2 px-4 py-2 bg-purple-600 hover:bg-purple-700 text-white rounded-lg font-medium transition-colors cursor-pointer",style:{zIndex:10},children:[n.jsx(mr,{className:"w-4 h-4"}),"Add PRD"]})})]})]}),n.jsx("div",{className:"text-center",children:n.jsxs("div",{className:"text-sm text-gray-500 dark:text-gray-400 mb-2",children:["💡 ",n.jsx("strong",{children:"Tip:"})," Start with a PRD to get the most out of TaskMaster's AI-powered task generation"]})})]}):n.jsxs("div",{className:"max-w-md mx-auto",children:[n.jsx("div",{className:"text-blue-600 dark:text-blue-400 mb-4",children:n.jsx(Qn,{className:"w-12 h-12 mx-auto mb-4"})}),n.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:"TaskMaster AI is not configured"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"TaskMaster helps break down complex projects into manageable tasks with AI-powered assistance"}),n.jsxs("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-950 rounded-lg text-left",children:[n.jsx("h4",{className:"text-sm font-medium text-blue-900 dark:text-blue-100 mb-3",children:"🎯 What is TaskMaster?"}),n.jsxs("div",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[n.jsxs("p",{children:["• ",n.jsx("strong",{children:"AI-Powered Task Management:"})," Break complex projects into manageable subtasks"]}),n.jsxs("p",{children:["• ",n.jsx("strong",{children:"PRD Templates:"})," Generate tasks from Product Requirements Documents"]}),n.jsxs("p",{children:["• ",n.jsx("strong",{children:"Dependency Tracking:"})," Understand task relationships and execution order"]}),n.jsxs("p",{children:["• ",n.jsx("strong",{children:"Progress Visualization:"})," Kanban boards and detailed task analytics"]}),n.jsxs("p",{children:["• ",n.jsx("strong",{children:"CLI Integration:"})," Use taskmaster commands for advanced workflows"]})]})]}),n.jsxs("button",{onClick:()=>{Y(!1),_(!0)},className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-medium transition-colors flex items-center gap-2 mx-auto",children:[n.jsx(ba,{className:"w-4 h-4"}),"Initialize TaskMaster AI"]})]}),M&&n.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center p-4 pt-16 bg-black/50 backdrop-blur-sm",children:n.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700 w-full max-w-4xl h-[600px] flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-blue-100 dark:bg-blue-900/50 rounded-lg flex items-center justify-center",children:n.jsx(ba,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"TaskMaster Setup"}),n.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Interactive CLI for ",i?.displayName]})]})]}),n.jsx("button",{onClick:()=>{_(!1),setTimeout(()=>{J(),i&&ue(i)},1e3)},className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800",children:n.jsx(nr,{className:"w-5 h-5 rotate-45"})})]}),n.jsx("div",{className:"flex-1 p-4",children:n.jsx("div",{className:"h-full bg-black rounded-lg overflow-hidden",onClick:we=>{const ze=we.currentTarget.querySelector(".xterm-screen");ze&&ze.focus()},children:n.jsx(b0,{selectedProject:i,selectedSession:null,isActive:!0,initialCommand:"npx task-master init",isPlainShell:!0,onProcessComplete:we=>{Y(!0),we===0&&setTimeout(()=>{J(),i&&ue(i)},1e3)}})})}),n.jsx("div",{className:"p-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:T?n.jsxs("span",{className:"flex items-center gap-2 text-green-600 dark:text-green-400",children:[n.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"}),"TaskMaster setup completed! You can now close this window."]}):"TaskMaster initialization will start automatically"}),n.jsx("button",{onClick:()=>{_(!1),Y(!1),setTimeout(()=>{J(),i&&ue(i)},1e3)},className:Ue("px-4 py-2 text-sm font-medium rounded-md transition-colors",T?"bg-green-600 hover:bg-green-700 text-white":"text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600"),children:T?"Close & Continue":"Close"})]})})]})})]})}return n.jsxs("div",{className:Ue("space-y-4",r),children:[n.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 lg:items-center lg:justify-between",children:[n.jsxs("div",{className:"relative flex-1 max-w-md",children:[n.jsx(xa,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),n.jsx("input",{type:"text",placeholder:"Search tasks...",value:u,onChange:se=>m(se.target.value),className:"pl-10 pr-4 py-2 w-full border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsxs("div",{className:"flex bg-gray-100 dark:bg-gray-800 rounded-lg p-1",children:[n.jsx("button",{onClick:()=>U("kanban"),className:Ue("p-2 rounded-md transition-colors",L==="kanban"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"),title:"Kanban view",children:n.jsx(wg,{className:"w-4 h-4"})}),n.jsx("button",{onClick:()=>U("list"),className:Ue("p-2 rounded-md transition-colors",L==="list"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"),title:"List view",children:n.jsx(Qs,{className:"w-4 h-4"})}),n.jsx("button",{onClick:()=>U("grid"),className:Ue("p-2 rounded-md transition-colors",L==="grid"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"),title:"Grid view",children:n.jsx(Wg,{className:"w-4 h-4"})})]}),n.jsxs("button",{onClick:()=>H(!I),className:Ue("flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors",I?"bg-blue-50 dark:bg-blue-900 border-blue-200 dark:border-blue-700 text-blue-700 dark:text-blue-300":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"),children:[n.jsx(Bg,{className:"w-4 h-4"}),n.jsx("span",{className:"hidden sm:inline",children:"Filters"}),n.jsx(Ar,{className:Ue("w-4 h-4 transition-transform",I&&"rotate-180")})]}),i&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>V(!0),className:"p-2 text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors border border-gray-300 dark:border-gray-600",title:"TaskMaster Getting Started Guide",children:n.jsx(bg,{className:"w-4 h-4"})}),n.jsx("div",{className:"relative",children:c.length>0?n.jsxs("div",{className:"relative",children:[n.jsxs("button",{onClick:()=>he(!ne),className:"flex items-center gap-2 px-3 py-2 bg-purple-600 hover:bg-purple-700 text-white rounded-lg transition-colors font-medium",title:`${c.length} PRD${c.length>1?"s":""} available`,children:[n.jsx(mr,{className:"w-4 h-4"}),n.jsx("span",{className:"hidden sm:inline",children:"PRDs"}),n.jsx("span",{className:"px-1.5 py-0.5 text-xs bg-purple-500 rounded-full min-w-[1.25rem] text-center",children:c.length}),n.jsx(Ar,{className:Ue("w-3 h-3 transition-transform hidden sm:block",ne&&"rotate-180")})]}),ne&&n.jsx("div",{className:"absolute right-0 top-full mt-2 w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-xl z-30",children:n.jsxs("div",{className:"p-2",children:[n.jsxs("button",{onClick:()=>{l?.(),he(!1)},className:"w-full text-left px-3 py-2 text-sm font-medium text-purple-700 dark:text-purple-300 hover:bg-purple-50 dark:hover:bg-purple-900/30 rounded flex items-center gap-2",children:[n.jsx(nr,{className:"w-4 h-4"}),"Create New PRD"]}),n.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700 my-1"}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 px-3 py-1 font-medium",children:"Existing PRDs:"}),c.map(se=>n.jsxs("button",{onClick:async()=>{try{const we=await at.get(`/taskmaster/prd/${encodeURIComponent(i.name)}/${encodeURIComponent(se.name)}`);if(we.ok){const ze=await we.json();l?.({name:se.name,content:ze.content,isExisting:!0}),he(!1)}}catch(we){console.error("Error loading PRD:",we)}},className:"w-full text-left px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded flex items-center gap-2",title:`Modified: ${new Date(se.modified).toLocaleDateString()}`,children:[n.jsx(mr,{className:"w-4 h-4"}),n.jsx("span",{className:"truncate",children:se.name})]},se.name))]})})]}):n.jsxs("button",{onClick:()=>{l?.()},className:"flex items-center gap-2 px-3 py-2 bg-purple-600 hover:bg-purple-700 text-white rounded-lg transition-colors font-medium",title:"Create Product Requirements Document",children:[n.jsx(mr,{className:"w-4 h-4"}),n.jsx("span",{className:"hidden sm:inline",children:"Add PRD"})]})}),(i?.taskMasterConfigured||i?.taskmaster?.hasTaskmaster||$?.hasTaskmaster||e.length>0)&&n.jsxs("button",{onClick:()=>W(!0),className:"flex items-center gap-2 px-3 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg transition-colors font-medium",title:"Add a new task",children:[n.jsx(nr,{className:"w-4 h-4"}),n.jsx("span",{className:"hidden sm:inline",children:"Add Task"})]})]})]})]}),I&&n.jsxs("div",{className:"bg-gray-50 dark:bg-gray-800 rounded-lg p-4 space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Status"}),n.jsxs("select",{value:h,onChange:se=>p(se.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500",children:[n.jsx("option",{value:"all",children:"All Statuses"}),xe.map(se=>n.jsx("option",{value:se,children:se.charAt(0).toUpperCase()+se.slice(1).replace("-"," ")},se))]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Priority"}),n.jsxs("select",{value:x,onChange:se=>y(se.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500",children:[n.jsx("option",{value:"all",children:"All Priorities"}),A.map(se=>n.jsx("option",{value:se,children:se.charAt(0).toUpperCase()+se.slice(1)},se))]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Sort By"}),n.jsxs("select",{value:`${k}-${j}`,onChange:se=>{const[we,ze]=se.target.value.split("-");w(we),N(ze)},className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500",children:[n.jsx("option",{value:"id-asc",children:"ID (Ascending)"}),n.jsx("option",{value:"id-desc",children:"ID (Descending)"}),n.jsx("option",{value:"title-asc",children:"Title (A-Z)"}),n.jsx("option",{value:"title-desc",children:"Title (Z-A)"}),n.jsx("option",{value:"status-asc",children:"Status (Pending First)"}),n.jsx("option",{value:"status-desc",children:"Status (Done First)"}),n.jsx("option",{value:"priority-asc",children:"Priority (High First)"}),n.jsx("option",{value:"priority-desc",children:"Priority (Low First)"})]})]})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Showing ",te.length," of ",e.length," tasks"]}),n.jsx("button",{onClick:pe,className:"text-sm text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",children:"Clear Filters"})]})]}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsxs("button",{onClick:()=>De("id"),className:Ue("flex items-center gap-1 px-3 py-1.5 rounded-md text-sm transition-colors",k==="id"?"bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300":"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"),children:["ID ",_e("id")]}),n.jsxs("button",{onClick:()=>De("status"),className:Ue("flex items-center gap-1 px-3 py-1.5 rounded-md text-sm transition-colors",k==="status"?"bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300":"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"),children:["Status ",_e("status")]}),n.jsxs("button",{onClick:()=>De("priority"),className:Ue("flex items-center gap-1 px-3 py-1.5 rounded-md text-sm transition-colors",k==="priority"?"bg-blue-100 dark:bg-blue-900 text-blue-700 dark:text-blue-300":"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"),children:["Priority ",_e("priority")]})]}),te.length===0?n.jsx("div",{className:"text-center py-12",children:n.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[n.jsx(xa,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),n.jsx("h3",{className:"text-lg font-medium mb-2",children:"No tasks match your filters"}),n.jsx("p",{className:"text-sm",children:"Try adjusting your search or filter criteria."})]})}):L==="kanban"?n.jsx("div",{className:Ue("grid gap-6",Ce.length===1&&"grid-cols-1 max-w-md mx-auto",Ce.length===2&&"grid-cols-1 md:grid-cols-2",Ce.length===3&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3",Ce.length===4&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-4",Ce.length===5&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",Ce.length>=6&&"grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"),children:Ce.map(se=>n.jsxs("div",{className:Ue("rounded-xl border shadow-sm transition-shadow hover:shadow-md",se.color),children:[n.jsx("div",{className:Ue("px-4 py-3 rounded-t-xl border-b",se.headerColor),children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"font-semibold text-sm",children:se.title}),n.jsx("div",{className:"flex items-center gap-2",children:n.jsx("span",{className:"text-xs font-medium px-2 py-1 bg-white/60 dark:bg-black/20 rounded-full",children:se.tasks.length})})]})}),n.jsx("div",{className:"p-3 space-y-3 min-h-[200px] max-h-[calc(100vh-300px)] overflow-y-auto",children:se.tasks.length===0?n.jsxs("div",{className:"text-center py-8 text-gray-400 dark:text-gray-500",children:[n.jsx("div",{className:"w-8 h-8 mx-auto mb-2 rounded-full bg-gray-200 dark:bg-gray-700 flex items-center justify-center",children:n.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-300 dark:bg-gray-600"})}),n.jsx("div",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:"No tasks yet"}),n.jsx("div",{className:"text-xs text-gray-400 dark:text-gray-500 mt-1",children:se.status==="pending"?"Tasks will appear here":se.status==="in-progress"?"Move tasks here when started":se.status==="done"?"Completed tasks appear here":"Tasks with this status will appear here"})]}):se.tasks.map(we=>n.jsx("div",{className:"transform transition-transform hover:scale-[1.02]",children:n.jsx(yu,{task:we,onClick:()=>t?.(we),showParent:a,className:"w-full shadow-sm hover:shadow-md transition-shadow cursor-pointer"})},we.id))})]},se.id))}):n.jsx("div",{className:Ue("gap-4",L==="grid"?"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3":"space-y-4"),children:te.map(se=>n.jsx(yu,{task:se,onClick:()=>t?.(se),showParent:a,className:L==="grid"?"h-full":""},se.id))}),F&&n.jsx(E8,{currentProject:i,onClose:()=>W(!1),onTaskCreated:()=>{W(!1),o&&o()}}),O&&n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:n.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700 w-full max-w-4xl max-h-[90vh] overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-blue-100 dark:bg-blue-900/50 rounded-lg flex items-center justify-center",children:n.jsx(mr,{className:"w-5 h-5 text-blue-600 dark:text-blue-400"})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:"Getting Started with TaskMaster"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Your guide to productive task management"})]})]}),n.jsx("button",{onClick:()=>V(!1),className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:n.jsx(Mt,{className:"w-5 h-5"})})]}),n.jsx("div",{className:"p-6 overflow-y-auto max-h-[calc(90vh-120px)]",children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-4 p-4 bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-950/50 dark:to-indigo-950/50 rounded-lg border border-blue-200 dark:border-blue-800",children:[n.jsx("div",{className:"flex-shrink-0 w-8 h-8 bg-blue-600 text-white text-sm font-semibold rounded-full flex items-center justify-center",children:"1"}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Create a Product Requirements Document (PRD)"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:"Discuss your project idea and create a PRD that describes what you want to build."}),n.jsxs("button",{onClick:()=>{l?.(),V(!1)},className:"inline-flex items-center gap-2 text-sm bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300 px-3 py-1.5 rounded-lg hover:bg-purple-200 dark:hover:bg-purple-900/50 transition-colors",children:[n.jsx(mr,{className:"w-4 h-4"}),"Add PRD"]})]})]}),n.jsxs("div",{className:"flex gap-4 p-4 bg-gradient-to-r from-green-50 to-emerald-50 dark:from-green-950/50 dark:to-emerald-950/50 rounded-lg border border-green-200 dark:border-green-800",children:[n.jsx("div",{className:"flex-shrink-0 w-8 h-8 bg-green-600 text-white text-sm font-semibold rounded-full flex items-center justify-center",children:"2"}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Generate Tasks from PRD"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:"Once you have a PRD, ask your AI assistant to parse it and TaskMaster will automatically break it down into manageable tasks with implementation details."}),n.jsxs("div",{className:"bg-white dark:bg-gray-800/50 rounded border border-green-200 dark:border-green-700/50 p-3 mb-2",children:[n.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"💬 Example:"}),n.jsx("p",{className:"text-xs text-gray-900 dark:text-white font-mono",children:`"I've just initialized a new project with Claude Task Master. I have a PRD at .taskmaster/docs/prd.txt. Can you help me parse it and set up the initial tasks?"`})]})]})]}),n.jsxs("div",{className:"flex gap-4 p-4 bg-gradient-to-r from-amber-50 to-orange-50 dark:from-amber-950/50 dark:to-orange-950/50 rounded-lg border border-amber-200 dark:border-amber-800",children:[n.jsx("div",{className:"flex-shrink-0 w-8 h-8 bg-amber-600 text-white text-sm font-semibold rounded-full flex items-center justify-center",children:"3"}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Analyze & Expand Tasks"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:"Ask your AI assistant to analyze task complexity and expand them into detailed subtasks for easier implementation."}),n.jsxs("div",{className:"bg-white dark:bg-gray-800/50 rounded border border-amber-200 dark:border-amber-700/50 p-3 mb-2",children:[n.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"💬 Example:"}),n.jsx("p",{className:"text-xs text-gray-900 dark:text-white font-mono",children:'"Task 5 seems complex. Can you break it down into subtasks?"'})]})]})]}),n.jsxs("div",{className:"flex gap-4 p-4 bg-gradient-to-r from-purple-50 to-pink-50 dark:from-purple-950/50 dark:to-pink-950/50 rounded-lg border border-purple-200 dark:border-purple-800",children:[n.jsx("div",{className:"flex-shrink-0 w-8 h-8 bg-purple-600 text-white text-sm font-semibold rounded-full flex items-center justify-center",children:"4"}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Start Building"}),n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:"Ask your AI assistant to begin working on tasks, update their status, and add new tasks as your project evolves."}),n.jsxs("div",{className:"bg-white dark:bg-gray-800/50 rounded border border-purple-200 dark:border-purple-700/50 p-3 mb-3",children:[n.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"💬 Example:"}),n.jsx("p",{className:"text-xs text-gray-900 dark:text-white font-mono",children:'"Please add a new task to implement user profile image uploads using Cloudinary, research the best approach."'})]}),n.jsx("a",{href:"https://github.com/eyaltoledano/claude-task-master/blob/main/docs/examples.md",target:"_blank",rel:"noopener noreferrer",className:"inline-block text-xs text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 underline",children:"View more examples and usage patterns →"})]})]}),n.jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700",children:[n.jsx("h4",{className:"font-medium text-gray-900 dark:text-white mb-3",children:"💡 Pro Tips"}),n.jsxs("ul",{className:"space-y-2 text-sm text-gray-600 dark:text-gray-400",children:[n.jsxs("li",{className:"flex items-start gap-2",children:[n.jsx("span",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full mt-2 flex-shrink-0"}),"Use the search bar to quickly find specific tasks"]}),n.jsxs("li",{className:"flex items-start gap-2",children:[n.jsx("span",{className:"w-1.5 h-1.5 bg-green-500 rounded-full mt-2 flex-shrink-0"}),"Switch between Kanban, List, and Grid views using the view toggles"]}),n.jsxs("li",{className:"flex items-start gap-2",children:[n.jsx("span",{className:"w-1.5 h-1.5 bg-purple-500 rounded-full mt-2 flex-shrink-0"}),"Use filters to focus on specific task statuses or priorities"]}),n.jsxs("li",{className:"flex items-start gap-2",children:[n.jsx("span",{className:"w-1.5 h-1.5 bg-orange-500 rounded-full mt-2 flex-shrink-0"}),"Click on any task to view detailed information and manage subtasks"]})]})]}),n.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-950/50 rounded-lg border border-blue-200 dark:border-blue-800",children:[n.jsx("h4",{className:"font-medium text-blue-900 dark:text-blue-100 mb-3",children:"📚 Learn More"}),n.jsx("p",{className:"text-sm text-blue-800 dark:text-blue-200 mb-3",children:"TaskMaster AI is an advanced task management system built for developers. Get documentation, examples, and contribute to the project."}),n.jsxs("a",{href:"https://github.com/eyaltoledano/claude-task-master",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm bg-blue-600 hover:bg-blue-700 text-white px-3 py-2 rounded-lg font-medium transition-colors",children:[n.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:n.jsx("path",{fillRule:"evenodd",d:"M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z",clipRule:"evenodd"})}),"View on GitHub",n.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]})})]})})]})},D8=({file:e,onClose:t,projectPath:r,project:a,initialContent:s="",isNewFile:i=!1,onSave:o})=>{const[l,c]=b.useState(s),[d,u]=b.useState(!i),[m,h]=b.useState(!1),[p,x]=b.useState(!1),[y,k]=b.useState(!0),[w,j]=b.useState(!1),[N,L]=b.useState(!1),[U,I]=b.useState(!0),[H,F]=b.useState(""),[W,M]=b.useState(!1),[_,O]=b.useState(!1),[V,T]=b.useState([]),Y=b.useRef(null),ne=`# Product Requirements Document - Example Project
|
|
899
|
-
|
|
900
|
-
## 1. Overview
|
|
901
|
-
**Product Name:** AI-Powered Task Manager
|
|
902
|
-
**Version:** 1.0
|
|
903
|
-
**Date:** 2024-12-27
|
|
904
|
-
**Author:** Development Team
|
|
905
|
-
|
|
906
|
-
This document outlines the requirements for building an AI-powered task management application that integrates with development workflows and provides intelligent task breakdown and prioritization.
|
|
907
|
-
|
|
908
|
-
## 2. Objectives
|
|
909
|
-
- Create an intuitive task management system that works seamlessly with developer tools
|
|
910
|
-
- Provide AI-powered task generation from high-level requirements
|
|
911
|
-
- Enable real-time collaboration and progress tracking
|
|
912
|
-
- Integrate with popular development environments (VS Code, Cursor, etc.)
|
|
913
|
-
|
|
914
|
-
### Success Metrics
|
|
915
|
-
- User adoption rate > 80% within development teams
|
|
916
|
-
- Task completion rate improvement of 25%
|
|
917
|
-
- Time-to-delivery reduction of 15%
|
|
918
|
-
|
|
919
|
-
## 3. User Stories
|
|
920
|
-
|
|
921
|
-
### Core Functionality
|
|
922
|
-
- As a project manager, I want to create PRDs that automatically generate detailed tasks so I can save time on project planning
|
|
923
|
-
- As a developer, I want to see my next task clearly highlighted so I can maintain focus
|
|
924
|
-
- As a team lead, I want to track progress across multiple projects so I can provide accurate status updates
|
|
925
|
-
- As a developer, I want tasks to be broken down into implementable subtasks so I can work more efficiently
|
|
926
|
-
|
|
927
|
-
### AI Integration
|
|
928
|
-
- As a user, I want to describe a feature in natural language and get detailed implementation tasks so I can start working immediately
|
|
929
|
-
- As a project manager, I want the AI to analyze task complexity and suggest appropriate time estimates
|
|
930
|
-
- As a developer, I want intelligent task prioritization based on dependencies and deadlines
|
|
931
|
-
|
|
932
|
-
### Collaboration
|
|
933
|
-
- As a team member, I want to see real-time updates when tasks are completed so I can coordinate my work
|
|
934
|
-
- As a stakeholder, I want to view project progress through intuitive dashboards
|
|
935
|
-
- As a developer, I want to add implementation notes to tasks for future reference
|
|
936
|
-
|
|
937
|
-
## 4. Functional Requirements
|
|
938
|
-
|
|
939
|
-
### Task Management
|
|
940
|
-
- Create, edit, and delete tasks with rich metadata (priority, status, dependencies, estimates)
|
|
941
|
-
- Hierarchical task structure with subtasks and sub-subtasks
|
|
942
|
-
- Real-time status updates and progress tracking
|
|
943
|
-
- Dependency management with circular dependency detection
|
|
944
|
-
- Bulk operations (move, update status, assign)
|
|
945
|
-
|
|
946
|
-
### AI Features
|
|
947
|
-
- Natural language PRD parsing to generate structured tasks
|
|
948
|
-
- Intelligent task breakdown with complexity analysis
|
|
949
|
-
- Automated subtask generation with implementation details
|
|
950
|
-
- Smart dependency suggestion
|
|
951
|
-
- Progress prediction based on historical data
|
|
952
|
-
|
|
953
|
-
### Integration Features
|
|
954
|
-
- VS Code/Cursor extension for in-editor task management
|
|
955
|
-
- Git integration for linking commits to tasks
|
|
956
|
-
- API for third-party tool integration
|
|
957
|
-
- Webhook support for external notifications
|
|
958
|
-
- CLI tool for command-line task management
|
|
959
|
-
|
|
960
|
-
### User Interface
|
|
961
|
-
- Responsive web application (desktop and mobile)
|
|
962
|
-
- Multiple view modes (Kanban, list, calendar)
|
|
963
|
-
- Dark/light theme support
|
|
964
|
-
- Drag-and-drop task organization
|
|
965
|
-
- Advanced filtering and search capabilities
|
|
966
|
-
- Keyboard shortcuts for power users
|
|
967
|
-
|
|
968
|
-
## 5. Technical Requirements
|
|
969
|
-
|
|
970
|
-
### Frontend
|
|
971
|
-
- React.js with TypeScript for type safety
|
|
972
|
-
- Modern UI framework (Tailwind CSS)
|
|
973
|
-
- State management (Context API or Redux)
|
|
974
|
-
- Real-time updates via WebSockets
|
|
975
|
-
- Progressive Web App (PWA) support
|
|
976
|
-
- Accessibility compliance (WCAG 2.1 AA)
|
|
977
|
-
|
|
978
|
-
### Backend
|
|
979
|
-
- Node.js with Express.js framework
|
|
980
|
-
- RESTful API design with OpenAPI documentation
|
|
981
|
-
- Real-time communication via Socket.io
|
|
982
|
-
- Background job processing
|
|
983
|
-
- Rate limiting and security middleware
|
|
984
|
-
|
|
985
|
-
### AI Integration
|
|
986
|
-
- Integration with multiple AI providers (OpenAI, Anthropic, etc.)
|
|
987
|
-
- Fallback model support
|
|
988
|
-
- Context-aware prompt engineering
|
|
989
|
-
- Token usage optimization
|
|
990
|
-
- Model response caching
|
|
991
|
-
|
|
992
|
-
### Database
|
|
993
|
-
- Primary: PostgreSQL for relational data
|
|
994
|
-
- Cache: Redis for session management and real-time features
|
|
995
|
-
- Full-text search capabilities
|
|
996
|
-
- Database migrations and seeding
|
|
997
|
-
- Backup and recovery procedures
|
|
998
|
-
|
|
999
|
-
### Infrastructure
|
|
1000
|
-
- Docker containerization
|
|
1001
|
-
- Cloud deployment (AWS/GCP/Azure)
|
|
1002
|
-
- Auto-scaling capabilities
|
|
1003
|
-
- Monitoring and logging (structured logging)
|
|
1004
|
-
- CI/CD pipeline with automated testing
|
|
1005
|
-
|
|
1006
|
-
## 6. Non-Functional Requirements
|
|
1007
|
-
|
|
1008
|
-
### Performance
|
|
1009
|
-
- Page load time < 2 seconds
|
|
1010
|
-
- API response time < 500ms for 95% of requests
|
|
1011
|
-
- Support for 1000+ concurrent users
|
|
1012
|
-
- Efficient handling of large task lists (10,000+ tasks)
|
|
1013
|
-
|
|
1014
|
-
### Security
|
|
1015
|
-
- JWT-based authentication with refresh tokens
|
|
1016
|
-
- Role-based access control (RBAC)
|
|
1017
|
-
- Data encryption at rest and in transit
|
|
1018
|
-
- Regular security audits and penetration testing
|
|
1019
|
-
- GDPR and privacy compliance
|
|
1020
|
-
|
|
1021
|
-
### Reliability
|
|
1022
|
-
- 99.9% uptime SLA
|
|
1023
|
-
- Graceful error handling and recovery
|
|
1024
|
-
- Data backup every 6 hours with point-in-time recovery
|
|
1025
|
-
- Disaster recovery plan with RTO < 4 hours
|
|
1026
|
-
|
|
1027
|
-
### Scalability
|
|
1028
|
-
- Horizontal scaling for both frontend and backend
|
|
1029
|
-
- Database read replicas for query optimization
|
|
1030
|
-
- CDN for static asset delivery
|
|
1031
|
-
- Microservices architecture for future expansion
|
|
1032
|
-
|
|
1033
|
-
## 7. User Experience Design
|
|
1034
|
-
|
|
1035
|
-
### Information Architecture
|
|
1036
|
-
- Intuitive navigation with breadcrumbs
|
|
1037
|
-
- Context-aware menus and actions
|
|
1038
|
-
- Progressive disclosure of complex features
|
|
1039
|
-
- Consistent design patterns throughout
|
|
1040
|
-
|
|
1041
|
-
### Interaction Design
|
|
1042
|
-
- Smooth animations and transitions
|
|
1043
|
-
- Immediate feedback for user actions
|
|
1044
|
-
- Undo/redo functionality for critical operations
|
|
1045
|
-
- Smart defaults and auto-save features
|
|
1046
|
-
|
|
1047
|
-
### Visual Design
|
|
1048
|
-
- Modern, clean interface with plenty of whitespace
|
|
1049
|
-
- Consistent color scheme and typography
|
|
1050
|
-
- Clear visual hierarchy with proper contrast ratios
|
|
1051
|
-
- Iconography that supports comprehension
|
|
1052
|
-
|
|
1053
|
-
## 8. Integration Requirements
|
|
1054
|
-
|
|
1055
|
-
### Development Tools
|
|
1056
|
-
- VS Code extension with task panel and quick actions
|
|
1057
|
-
- Cursor IDE integration with AI task suggestions
|
|
1058
|
-
- Terminal CLI for command-line workflow
|
|
1059
|
-
- Browser extension for web-based tools
|
|
1060
|
-
|
|
1061
|
-
### Third-Party Services
|
|
1062
|
-
- GitHub/GitLab integration for issue sync
|
|
1063
|
-
- Slack/Discord notifications
|
|
1064
|
-
- Calendar integration (Google Calendar, Outlook)
|
|
1065
|
-
- Time tracking tools (Toggl, Harvest)
|
|
1066
|
-
|
|
1067
|
-
### APIs and Webhooks
|
|
1068
|
-
- RESTful API with comprehensive documentation
|
|
1069
|
-
- GraphQL endpoint for complex queries
|
|
1070
|
-
- Webhook system for external integrations
|
|
1071
|
-
- SDK development for major programming languages
|
|
1072
|
-
|
|
1073
|
-
## 9. Implementation Phases
|
|
1074
|
-
|
|
1075
|
-
### Phase 1: Core MVP (8-10 weeks)
|
|
1076
|
-
- Basic task management (CRUD operations)
|
|
1077
|
-
- Simple AI task generation
|
|
1078
|
-
- Web interface with essential features
|
|
1079
|
-
- User authentication and basic permissions
|
|
1080
|
-
|
|
1081
|
-
### Phase 2: Enhanced Features (6-8 weeks)
|
|
1082
|
-
- Advanced AI features (complexity analysis, subtask generation)
|
|
1083
|
-
- Real-time collaboration
|
|
1084
|
-
- Mobile-responsive design
|
|
1085
|
-
- Integration with one development tool (VS Code)
|
|
1086
|
-
|
|
1087
|
-
### Phase 3: Enterprise Features (4-6 weeks)
|
|
1088
|
-
- Advanced user management and permissions
|
|
1089
|
-
- API and webhook system
|
|
1090
|
-
- Performance optimization
|
|
1091
|
-
- Comprehensive testing and security audit
|
|
1092
|
-
|
|
1093
|
-
### Phase 4: Ecosystem Expansion (4-6 weeks)
|
|
1094
|
-
- Additional tool integrations
|
|
1095
|
-
- Mobile app development
|
|
1096
|
-
- Advanced analytics and reporting
|
|
1097
|
-
- Third-party marketplace preparation
|
|
1098
|
-
|
|
1099
|
-
## 10. Risk Assessment
|
|
1100
|
-
|
|
1101
|
-
### Technical Risks
|
|
1102
|
-
- AI model reliability and cost management
|
|
1103
|
-
- Real-time synchronization complexity
|
|
1104
|
-
- Database performance with large datasets
|
|
1105
|
-
- Integration complexity with multiple tools
|
|
1106
|
-
|
|
1107
|
-
### Business Risks
|
|
1108
|
-
- User adoption in competitive market
|
|
1109
|
-
- AI provider dependency
|
|
1110
|
-
- Data privacy and security concerns
|
|
1111
|
-
- Feature scope creep and timeline delays
|
|
1112
|
-
|
|
1113
|
-
### Mitigation Strategies
|
|
1114
|
-
- Implement robust error handling and fallback systems
|
|
1115
|
-
- Develop comprehensive testing strategy
|
|
1116
|
-
- Create detailed documentation and user guides
|
|
1117
|
-
- Establish clear project scope and change management process
|
|
1118
|
-
|
|
1119
|
-
## 11. Success Criteria
|
|
1120
|
-
|
|
1121
|
-
### Development Milestones
|
|
1122
|
-
- Alpha version with core features completed
|
|
1123
|
-
- Beta version with selected user group feedback
|
|
1124
|
-
- Production-ready version with full feature set
|
|
1125
|
-
- Post-launch iterations based on user feedback
|
|
1126
|
-
|
|
1127
|
-
### Business Metrics
|
|
1128
|
-
- User engagement and retention rates
|
|
1129
|
-
- Task completion and productivity metrics
|
|
1130
|
-
- Customer satisfaction scores (NPS > 50)
|
|
1131
|
-
- Revenue targets and subscription growth
|
|
1132
|
-
|
|
1133
|
-
## 12. Appendices
|
|
1134
|
-
|
|
1135
|
-
### Glossary
|
|
1136
|
-
- **PRD**: Product Requirements Document
|
|
1137
|
-
- **AI**: Artificial Intelligence
|
|
1138
|
-
- **CRUD**: Create, Read, Update, Delete
|
|
1139
|
-
- **API**: Application Programming Interface
|
|
1140
|
-
- **CI/CD**: Continuous Integration/Continuous Deployment
|
|
1141
|
-
|
|
1142
|
-
### References
|
|
1143
|
-
- Industry best practices for task management
|
|
1144
|
-
- AI integration patterns and examples
|
|
1145
|
-
- Security and compliance requirements
|
|
1146
|
-
- Performance benchmarking data
|
|
1147
|
-
|
|
1148
|
-
---
|
|
1149
|
-
|
|
1150
|
-
**Document Control:**
|
|
1151
|
-
- Version: 1.0
|
|
1152
|
-
- Last Updated: December 27, 2024
|
|
1153
|
-
- Next Review: January 15, 2025
|
|
1154
|
-
- Approved By: Product Owner, Technical Lead`;b.useEffect(()=>{(async()=>{if(e?.name)F(e.name.replace(/\.(txt|md)$/,""));else if(i){const Ce=new Date().toISOString().split("T")[0];F(`prd-${Ce}`)}if(i){c(ne),u(!1);return}if(e.content){c(e.content),u(!1);return}try{u(!0);const te=await at.readFile(e.projectName,e.path);if(!te.ok)throw new Error(`Failed to load file: ${te.status} ${te.statusText}`);const Ce=await te.json();c(Ce.content||ne)}catch(te){console.error("Error loading PRD file:",te),c(`# Error Loading PRD
|
|
1155
|
-
|
|
1156
|
-
Error: ${te.message}
|
|
1157
|
-
|
|
1158
|
-
File: ${e?.name||"New PRD"}
|
|
1159
|
-
Path: ${e?.path||"Not saved yet"}
|
|
1160
|
-
|
|
1161
|
-
${ne}`)}finally{u(!1)}})()},[e,r,i]),b.useEffect(()=>{(async()=>{if(!a?.name){console.log("No project name available:",a);return}try{console.log("Fetching PRDs for project:",a.name);const te=await at.get(`/taskmaster/prd/${encodeURIComponent(a.name)}`);if(te.ok){const Ce=await te.json();console.log("Fetched existing PRDs:",Ce.prds),T(Ce.prds||[])}else console.log("Failed to fetch PRDs:",te.status,te.statusText)}catch(te){console.error("Error fetching existing PRDs:",te)}})()},[a?.name]);const he=async()=>{if(!l.trim()){alert("Please add content before saving.");return}if(!H.trim()){alert("Please provide a filename for the PRD.");return}const A=H.endsWith(".txt")||H.endsWith(".md")?H:`${H}.txt`,te=V.find(Ce=>Ce.name===A);if(console.log("Save check:",{fullFileName:A,existingPRDs:V,existingFile:te,isExisting:e?.isExisting,fileObject:e,shouldShowModal:te&&!e?.isExisting}),te&&!e?.isExisting){console.log("Showing overwrite confirmation modal"),O(!0);return}await $()},$=async()=>{h(!0);try{const A=H.endsWith(".txt")||H.endsWith(".md")?H:`${H}.txt`,te=await Qe(`/api/taskmaster/prd/${encodeURIComponent(a?.name)}`,{method:"POST",body:JSON.stringify({fileName:A,content:l})});if(!te.ok){const De=await te.json();throw new Error(De.message||`Save failed: ${te.status}`)}j(!0),setTimeout(()=>j(!1),2e3);const Ce=await at.get(`/taskmaster/prd/${encodeURIComponent(a.name)}`);if(Ce.ok){const De=await Ce.json();T(De.prds||[])}o&&await o()}catch(A){console.error("Error saving PRD:",A),alert(`Error saving PRD: ${A.message}`)}finally{h(!1)}},J=()=>{const A=new Blob([l],{type:"text/markdown"}),te=URL.createObjectURL(A),Ce=document.createElement("a");Ce.href=te;const De=H?`${H}.txt`:"prd.txt";Ce.download=De,document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce),URL.revokeObjectURL(te)},C=async()=>{if(!l.trim()){alert("Please add content to the PRD before generating tasks.");return}M(!0)},ue=()=>{x(!p)};b.useEffect(()=>{const A=te=>{(te.ctrlKey||te.metaKey)&&(te.key==="s"?(te.preventDefault(),he()):te.key==="Escape"&&(te.preventDefault(),t()))};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[l]);const xe=A=>A.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/^\- (.*$)/gim,"<li>$1</li>").replace(/(<li>.*<\/li>)/gims,"<ul>$1</ul>").replace(/\n\n/gim,"</p><p>").replace(/^(?!<[h|u|l])(.*$)/gim,"<p>$1</p>").replace(/<\/ul>\s*<ul>/gim,"");return d?n.jsx("div",{className:"fixed inset-0 z-[200] md:bg-black/50 md:flex md:items-center md:justify-center",children:n.jsx("div",{className:"w-full h-full md:rounded-lg md:w-auto md:h-auto p-8 flex items-center justify-center bg-white dark:bg-gray-900",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"}),n.jsx("span",{className:"text-gray-900 dark:text-white",children:"Loading PRD..."})]})})}):n.jsxs("div",{className:`fixed inset-0 z-[200] md:bg-black/50 md:flex md:items-center md:justify-center md:p-4 ${p?"md:p-0":""}`,children:[n.jsxs("div",{className:Ue("bg-white dark:bg-gray-900 shadow-2xl flex flex-col","w-full h-full md:rounded-lg md:shadow-2xl",p?"md:w-full md:h-full md:rounded-none":"md:w-full md:max-w-6xl md:h-[85vh] md:max-h-[85vh]"),children:[n.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[n.jsx("div",{className:"w-8 h-8 bg-purple-600 rounded flex items-center justify-center flex-shrink-0",children:n.jsx(mr,{className:"w-4 h-4 text-white"})}),n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-1 min-w-0 flex-1",children:[n.jsxs("div",{className:"flex items-center min-w-0 flex-1 bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-md px-3 py-2 focus-within:ring-2 focus-within:ring-purple-500 focus-within:border-purple-500 dark:focus-within:ring-purple-400 dark:focus-within:border-purple-400",children:[n.jsx("input",{type:"text",value:H,onChange:A=>{const te=A.target.value.replace(/[<>:"/\\|?*]/g,"");F(te)},className:"font-medium text-gray-900 dark:text-white bg-transparent border-none outline-none min-w-0 flex-1 text-base sm:text-sm placeholder-gray-400 dark:placeholder-gray-500",placeholder:"Enter PRD filename",maxLength:100}),n.jsx("span",{className:"text-sm sm:text-xs text-gray-500 dark:text-gray-400 whitespace-nowrap ml-1",children:".txt"})]}),n.jsx("button",{onClick:()=>document.querySelector('input[placeholder="Enter PRD filename"]')?.focus(),className:"p-1 text-gray-400 hover:text-purple-600 dark:hover:text-purple-400 transition-colors",title:"Click to edit filename",children:n.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"})})})]}),n.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[n.jsx("span",{className:"text-xs bg-purple-100 dark:bg-purple-900 text-purple-600 dark:text-purple-300 px-2 py-1 rounded whitespace-nowrap",children:"📋 PRD"}),i&&n.jsx("span",{className:"text-xs bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-300 px-2 py-1 rounded whitespace-nowrap",children:"✨ New"})]})]}),n.jsx("p",{className:"text-xs sm:text-sm text-gray-500 dark:text-gray-400 truncate mt-1",children:"Product Requirements Document"})]})]}),n.jsxs("div",{className:"flex items-center gap-1 md:gap-2 flex-shrink-0",children:[n.jsx("button",{onClick:()=>L(!N),className:Ue("p-2 md:p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800","min-w-[44px] min-h-[44px] md:min-w-0 md:min-h-0 flex items-center justify-center",N?"text-purple-600 dark:text-purple-400 bg-purple-50 dark:bg-purple-900":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"),title:N?"Switch to edit mode":"Preview markdown",children:n.jsx(os,{className:"w-5 h-5 md:w-4 md:h-4"})}),n.jsx("button",{onClick:()=>I(!U),className:Ue("p-2 md:p-2 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800","min-w-[44px] min-h-[44px] md:min-w-0 md:min-h-0 flex items-center justify-center",U?"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"),title:U?"Disable word wrap":"Enable word wrap",children:n.jsx("span",{className:"text-sm md:text-xs font-mono font-bold",children:"↵"})}),n.jsx("button",{onClick:()=>k(!y),className:"p-2 md:p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 min-w-[44px] min-h-[44px] md:min-w-0 md:min-h-0 flex items-center justify-center",title:"Toggle theme",children:n.jsx("span",{className:"text-lg md:text-base",children:y?"☀️":"🌙"})}),n.jsx("button",{onClick:J,className:"p-2 md:p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 min-w-[44px] min-h-[44px] md:min-w-0 md:min-h-0 flex items-center justify-center",title:"Download PRD",children:n.jsx(Js,{className:"w-5 h-5 md:w-4 md:h-4"})}),n.jsxs("button",{onClick:C,disabled:!l.trim(),className:Ue("px-3 py-2 rounded-md disabled:opacity-50 flex items-center gap-2 transition-colors text-sm font-medium","bg-purple-600 hover:bg-purple-700 text-white","min-h-[44px] md:min-h-0"),title:"Generate tasks from PRD content",children:[n.jsx(Dn,{className:"w-4 h-4"}),n.jsx("span",{className:"hidden md:inline",children:"Generate Tasks"})]}),n.jsx("button",{onClick:he,disabled:m,className:Ue("px-3 py-2 text-white rounded-md disabled:opacity-50 flex items-center gap-2 transition-colors","min-h-[44px] md:min-h-0",w?"bg-green-600 hover:bg-green-700":"bg-purple-600 hover:bg-purple-700"),children:w?n.jsxs(n.Fragment,{children:[n.jsx("svg",{className:"w-5 h-5 md:w-4 md:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),n.jsx("span",{className:"hidden sm:inline",children:"Saved!"})]}):n.jsxs(n.Fragment,{children:[n.jsx(Zs,{className:"w-5 h-5 md:w-4 md:h-4"}),n.jsx("span",{className:"hidden sm:inline",children:m?"Saving...":"Save PRD"})]})}),n.jsx("button",{onClick:ue,className:"hidden md:flex p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 items-center justify-center",title:p?"Exit fullscreen":"Fullscreen",children:p?n.jsx(Lu,{className:"w-4 h-4"}):n.jsx(Tl,{className:"w-4 h-4"})}),n.jsx("button",{onClick:t,className:"p-2 md:p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 min-w-[44px] min-h-[44px] md:min-w-0 md:min-h-0 flex items-center justify-center",title:"Close",children:n.jsx(Mt,{className:"w-6 h-6 md:w-4 md:h-4"})})]})]}),n.jsx("div",{className:"flex-1 overflow-hidden",children:N?n.jsx("div",{className:"h-full overflow-y-auto p-6 prose prose-gray dark:prose-invert max-w-none",children:n.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:xe(l)}})}):n.jsx(Su,{ref:Y,value:l,onChange:c,extensions:[Mu(),...U?[Tr.lineWrapping]:[]],theme:y?Cu:void 0,height:"100%",style:{fontSize:"14px",height:"100%"},basicSetup:{lineNumbers:!0,foldGutter:!0,dropCursor:!1,allowMultipleSelections:!1,indentOnInput:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,highlightSelectionMatches:!0,searchKeymap:!0}})}),n.jsxs("div",{className:"flex items-center justify-between p-3 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800 flex-shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-600 dark:text-gray-400",children:[n.jsxs("span",{children:["Lines: ",l.split(`
|
|
1162
|
-
`).length]}),n.jsxs("span",{children:["Characters: ",l.length]}),n.jsxs("span",{children:["Words: ",l.split(/\s+/).filter(A=>A.length>0).length]}),n.jsx("span",{children:"Format: Markdown"})]}),n.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Press Ctrl+S to save • Esc to close"})]})]}),W&&n.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-md border border-gray-200 dark:border-gray-700",children:[n.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-purple-100 dark:bg-purple-900/50 rounded-lg flex items-center justify-center",children:n.jsx(Dn,{className:"w-4 h-4 text-purple-600 dark:text-purple-400"})}),n.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Generate Tasks from PRD"})]}),n.jsx("button",{onClick:()=>M(!1),className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700",children:n.jsx(Mt,{className:"w-5 h-5"})})]}),n.jsxs("div",{className:"p-6 space-y-4",children:[n.jsx("div",{className:"bg-purple-50 dark:bg-purple-900/20 rounded-lg p-4 border border-purple-200 dark:border-purple-800",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-purple-100 dark:bg-purple-900/50 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5",children:n.jsx(Dn,{className:"w-4 h-4 text-purple-600 dark:text-purple-400"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("h4",{className:"font-semibold text-purple-900 dark:text-purple-100 mb-2",children:"💡 Pro Tip: Ask Claude Code Directly!"}),n.jsx("p",{className:"text-sm text-purple-800 dark:text-purple-200 mb-3",children:"You can simply ask Claude Code in the chat to parse your PRD and generate tasks. The AI assistant will automatically save your PRD and create detailed tasks with implementation details."}),n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded border border-purple-200 dark:border-purple-700 p-3 mb-3",children:[n.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"💬 Example:"}),n.jsxs("p",{className:"text-xs text-gray-900 dark:text-white font-mono",children:[`"I've just initialized a new project with Claude Task Master. I have a PRD at .taskmaster/docs/`,H.endsWith(".txt")||H.endsWith(".md")?H:`${H}.txt`,'. Can you help me parse it and set up the initial tasks?"']})]}),n.jsxs("p",{className:"text-xs text-purple-700 dark:text-purple-300",children:[n.jsx("strong",{children:"This will:"})," Save your PRD, analyze its content, and generate structured tasks with subtasks, dependencies, and implementation details."]})]})]})}),n.jsxs("div",{className:"text-center pt-4 border-t border-gray-200 dark:border-gray-700",children:[n.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:"For more examples and advanced usage patterns:"}),n.jsx("a",{href:"https://github.com/eyaltoledano/claude-task-master/blob/main/docs/examples.md",target:"_blank",rel:"noopener noreferrer",className:"inline-block text-sm text-purple-600 dark:text-purple-400 hover:text-purple-700 dark:hover:text-purple-300 underline font-medium",children:"View TaskMaster Documentation →"})]}),n.jsx("div",{className:"pt-4",children:n.jsx("button",{onClick:()=>M(!1),className:"w-full px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors",children:"Got it, I'll ask Claude Code directly"})})]})]})}),_&&n.jsxs("div",{className:"fixed inset-0 z-[300] flex items-center justify-center p-4",children:[n.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50",onClick:()=>O(!1)}),n.jsx("div",{className:"relative bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full border border-gray-200 dark:border-gray-700",children:n.jsxs("div",{className:"p-6",children:[n.jsxs("div",{className:"flex items-center mb-4",children:[n.jsx("div",{className:"p-2 rounded-full mr-3 bg-yellow-100 dark:bg-yellow-900",children:n.jsx(Wa,{className:"w-5 h-5 text-yellow-600 dark:text-yellow-400"})}),n.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"File Already Exists"})]}),n.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:['A PRD file named "',H.endsWith(".txt")||H.endsWith(".md")?H:`${H}.txt`,'" already exists. Do you want to overwrite it with the current content?']}),n.jsxs("div",{className:"flex justify-end space-x-3",children:[n.jsx("button",{onClick:()=>O(!1),className:"px-4 py-2 text-sm text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md hover:bg-gray-50 dark:hover:bg-gray-600 transition-colors",children:"Cancel"}),n.jsxs("button",{onClick:async()=>{O(!1),await $()},className:"px-4 py-2 text-sm text-white bg-yellow-600 hover:bg-yellow-700 rounded-md flex items-center space-x-2 transition-colors",children:[n.jsx(Zs,{className:"w-4 h-4"}),n.jsx("span",{children:"Overwrite"})]})]})]})})]})]})};function z8({selectedProject:e,selectedSession:t,activeTab:r,setActiveTab:a,ws:s,sendMessage:i,messages:o,isMobile:l,isPWA:c,onMenuClick:d,isLoading:u,onInputFocusChange:m,onSessionActive:h,onSessionInactive:p,onSessionProcessing:x,onSessionNotProcessing:y,processingSessions:k,onReplaceTemporarySession:w,onNavigateToSession:j,onShowSettings:N,autoExpandTools:L,showRawParameters:U,showThinking:I,autoScrollToBottom:H,sendByCtrlEnter:F,externalMessageUpdate:W}){const[M,_]=b.useState(null),[O,V]=b.useState(null),[T,Y]=b.useState(!1),[ne,he]=b.useState(600),[$,J]=b.useState(!1),[C,ue]=b.useState(!1),xe=b.useRef(null),[A,te]=b.useState(!1),[Ce,De]=b.useState(null),[pe,_e]=b.useState([]),[se,we]=b.useState(null),{tasks:ze,currentProject:Ae,refreshTasks:Be,setCurrentProject:nt}=ls(),{tasksEnabled:bt,isTaskMasterInstalled:ut,isTaskMasterReady:jt}=cs(),lt=bt&&ut;b.useEffect(()=>{e&&e!==Ae&&nt(e)},[e,Ae,nt]),b.useEffect(()=>{!lt&&r==="tasks"&&a("chat")},[lt,r,a]),b.useEffect(()=>{(async()=>{if(!Ae?.name){_e([]);return}try{const K=await at.get(`/taskmaster/prd/${encodeURIComponent(Ae.name)}`);if(K.ok){const ke=await K.json();_e(ke.prdFiles||[])}else _e([])}catch(K){console.error("Failed to load existing PRDs:",K),_e([])}})()},[Ae?.name]);const qe=(B,K=null)=>{const ke={name:B.split("/").pop(),path:B,projectName:e?.name,diffInfo:K};_(ke)},st=()=>{_(null),ue(!1)},St=()=>{ue(!C)},Oe=B=>{if(typeof B=="object"&&B.id&&!B.title){const K=ze?.find(ke=>ke.id===B.id);K&&(V(K),Y(!0))}else V(B),Y(!0)},Qt=()=>{Y(!1),V(null)},ie=(B,K)=>{console.log("Update task status:",B,K),Be?.()},Se=B=>{l||(J(!0),B.preventDefault())};return b.useEffect(()=>{const B=ke=>{if(!$)return;const We=xe.current?.parentElement;if(!We)return;const Ge=We.getBoundingClientRect(),ce=Ge.right-ke.clientX,R=300,Q=Ge.width*.8;ce>=R&&ce<=Q&&he(ce)},K=()=>{J(!1)};return $&&(document.addEventListener("mousemove",B),document.addEventListener("mouseup",K),document.body.style.cursor="col-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",K),document.body.style.cursor="",document.body.style.userSelect=""}},[$]),u?n.jsxs("div",{className:"h-full flex flex-col",children:[l&&n.jsx("div",{className:"bg-background border-b border-border p-2 sm:p-3 pwa-header-safe flex-shrink-0",children:n.jsx("button",{onClick:d,className:"p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 pwa-menu-button",children:n.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})}),n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400",children:[n.jsx("div",{className:"w-12 h-12 mx-auto mb-4",children:n.jsx("div",{className:"w-full h-full rounded-full border-4 border-gray-200 border-t-blue-500",style:{animation:"spin 1s linear infinite",WebkitAnimation:"spin 1s linear infinite",MozAnimation:"spin 1s linear infinite"}})}),n.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Loading Claude Code UI"}),n.jsx("p",{children:"Setting up your workspace..."})]})})]}):e?n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{className:"bg-background border-b border-border p-2 sm:p-3 pwa-header-safe flex-shrink-0",children:n.jsxs("div",{className:"flex items-center justify-between relative",children:[n.jsxs("div",{className:"flex items-center space-x-2 min-w-0 flex-1",children:[l&&n.jsx("button",{onClick:d,onTouchStart:B=>{B.preventDefault(),d()},className:"p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 touch-manipulation active:scale-95 pwa-menu-button flex-shrink-0",children:n.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),n.jsxs("div",{className:"min-w-0 flex items-center gap-2 flex-1 overflow-x-auto scrollbar-hide",children:[r==="chat"&&t&&n.jsx("div",{className:"w-5 h-5 flex-shrink-0 flex items-center justify-center",children:t.__provider==="cursor"?n.jsx(on,{className:"w-4 h-4"}):n.jsx(Wr,{className:"w-4 h-4"})}),n.jsx("div",{className:"min-w-0 flex-1",children:r==="chat"&&t?n.jsxs("div",{className:"min-w-0",children:[n.jsx("h2",{className:"text-sm sm:text-base font-semibold text-gray-900 dark:text-white whitespace-nowrap overflow-x-auto scrollbar-hide",children:t.__provider==="cursor"?t.name||"Untitled Session":t.summary||"New Session"}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:e.displayName})]}):r==="chat"&&!t?n.jsxs("div",{className:"min-w-0",children:[n.jsx("h2",{className:"text-sm sm:text-base font-semibold text-gray-900 dark:text-white",children:"New Session"}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:e.displayName})]}):n.jsxs("div",{className:"min-w-0",children:[n.jsx("h2",{className:"text-sm sm:text-base font-semibold text-gray-900 dark:text-white",children:r==="files"?"Project Files":r==="git"?"Source Control":r==="tasks"&<?"TaskMaster":"Project"}),n.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:e.displayName})]})})]})]}),n.jsx("div",{className:"flex-shrink-0 hidden sm:block",children:n.jsxs("div",{className:"relative flex bg-gray-100 dark:bg-gray-800 rounded-lg p-1",children:[n.jsx(hr,{content:"Chat",position:"bottom",children:n.jsx("button",{onClick:()=>a("chat"),className:`relative px-2 sm:px-3 py-1.5 text-xs sm:text-sm font-medium rounded-md ${r==="chat"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:n.jsxs("span",{className:"flex items-center gap-1 sm:gap-1.5",children:[n.jsx("svg",{className:"w-3 sm:w-3.5 h-3 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),n.jsx("span",{className:"hidden md:hidden lg:inline",children:"Chat"})]})})}),n.jsx(hr,{content:"Shell",position:"bottom",children:n.jsx("button",{onClick:()=>a("shell"),className:`relative px-2 sm:px-3 py-1.5 text-xs sm:text-sm font-medium rounded-md transition-all duration-200 ${r==="shell"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:n.jsxs("span",{className:"flex items-center gap-1 sm:gap-1.5",children:[n.jsx("svg",{className:"w-3 sm:w-3.5 h-3 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2z"})}),n.jsx("span",{className:"hidden md:hidden lg:inline",children:"Shell"})]})})}),n.jsx(hr,{content:"Files",position:"bottom",children:n.jsx("button",{onClick:()=>a("files"),className:`relative px-2 sm:px-3 py-1.5 text-xs sm:text-sm font-medium rounded-md transition-all duration-200 ${r==="files"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:n.jsxs("span",{className:"flex items-center gap-1 sm:gap-1.5",children:[n.jsx("svg",{className:"w-3 sm:w-3.5 h-3 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-5l-2-2H5a2 2 0 00-2 2z"})}),n.jsx("span",{className:"hidden md:hidden lg:inline",children:"Files"})]})})}),n.jsx(hr,{content:"Source Control",position:"bottom",children:n.jsx("button",{onClick:()=>a("git"),className:`relative px-2 sm:px-3 py-1.5 text-xs sm:text-sm font-medium rounded-md transition-all duration-200 ${r==="git"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:n.jsxs("span",{className:"flex items-center gap-1 sm:gap-1.5",children:[n.jsx("svg",{className:"w-3 sm:w-3.5 h-3 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),n.jsx("span",{className:"hidden md:hidden lg:inline",children:"Source Control"})]})})}),lt&&n.jsx(hr,{content:"Tasks",position:"bottom",children:n.jsx("button",{onClick:()=>a("tasks"),className:`relative px-2 sm:px-3 py-1.5 text-xs sm:text-sm font-medium rounded-md transition-all duration-200 ${r==="tasks"?"bg-white dark:bg-gray-700 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:n.jsxs("span",{className:"flex items-center gap-1 sm:gap-1.5",children:[n.jsx("svg",{className:"w-3 sm:w-3.5 h-3 sm:h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})}),n.jsx("span",{className:"hidden md:hidden lg:inline",children:"Tasks"})]})})})]})})]})}),n.jsxs("div",{className:"flex-1 flex min-h-0 overflow-hidden",children:[n.jsxs("div",{className:`flex-1 flex flex-col min-h-0 overflow-hidden ${M?"mr-0":""} ${C?"hidden":""}`,children:[n.jsx("div",{className:`h-full ${r==="chat"?"block":"hidden"}`,children:n.jsx(T8,{showDetails:!0,children:n.jsx(Fw,{selectedProject:e,selectedSession:t,ws:s,sendMessage:i,messages:o,onFileOpen:qe,onInputFocusChange:m,onSessionActive:h,onSessionInactive:p,onSessionProcessing:x,onSessionNotProcessing:y,processingSessions:k,onReplaceTemporarySession:w,onNavigateToSession:j,onShowSettings:N,autoExpandTools:L,showRawParameters:U,showThinking:I,autoScrollToBottom:H,sendByCtrlEnter:F,externalMessageUpdate:W,onShowAllTasks:bt?()=>a("tasks"):null})})}),n.jsx("div",{className:`h-full overflow-hidden ${r==="files"?"block":"hidden"}`,children:n.jsx(M8,{selectedProject:e})}),n.jsx("div",{className:`h-full overflow-hidden ${r==="shell"?"block":"hidden"}`,children:n.jsx(Yp,{project:e,session:t,isActive:r==="shell",showHeader:!1})}),n.jsx("div",{className:`h-full overflow-hidden ${r==="git"?"block":"hidden"}`,children:n.jsx(A8,{selectedProject:e,isMobile:l,onFileOpen:qe})}),lt&&n.jsx("div",{className:`h-full ${r==="tasks"?"block":"hidden"}`,children:n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:n.jsx(I8,{tasks:ze||[],onTaskClick:Oe,showParentTasks:!0,className:"flex-1 overflow-y-auto p-4",currentProject:Ae,onTaskCreated:Be,onShowPRDEditor:(B=null)=>{De(B),te(!0)},existingPRDs:pe,onRefreshPRDs:(B=!1)=>{Ae?.name&&at.get(`/taskmaster/prd/${encodeURIComponent(Ae.name)}`).then(K=>K.ok?K.json():Promise.reject()).then(K=>{_e(K.prdFiles||[]),B&&(we("PRD saved successfully!"),setTimeout(()=>we(null),3e3))}).catch(K=>console.error("Failed to refresh PRDs:",K))}})})}),n.jsx("div",{className:`h-full overflow-hidden ${r==="preview"?"block":"hidden"}`})]}),M&&!l&&n.jsxs(n.Fragment,{children:[!C&&n.jsx("div",{ref:xe,onMouseDown:Se,className:"flex-shrink-0 w-1 bg-gray-200 dark:bg-gray-700 hover:bg-blue-500 dark:hover:bg-blue-600 cursor-col-resize transition-colors relative group",title:"Drag to resize",children:n.jsx("div",{className:"absolute inset-y-0 left-1/2 -translate-x-1/2 w-1 bg-blue-500 dark:bg-blue-600 opacity-0 group-hover:opacity-100 transition-opacity"})}),n.jsx("div",{className:`flex-shrink-0 border-l border-gray-200 dark:border-gray-700 h-full overflow-hidden ${C?"flex-1":""}`,style:C?{}:{width:`${ne}px`},children:n.jsx(wl,{file:M,onClose:st,projectPath:e?.path,isSidebar:!0,isExpanded:C,onToggleExpand:St})})]})]}),M&&l&&n.jsx(wl,{file:M,onClose:st,projectPath:e?.path,isSidebar:!1}),lt&&T&&O&&n.jsx(vp,{task:O,isOpen:T,onClose:Qt,onStatusChange:ie,onTaskClick:Oe}),A&&n.jsx(D8,{project:Ae,projectPath:Ae?.fullPath||Ae?.path,onClose:()=>{te(!1),De(null)},isNewFile:!Ce?.isExisting,file:{name:Ce?.name||"prd.txt",content:Ce?.content||""},onSave:async()=>{te(!1),De(null);try{const B=await at.get(`/taskmaster/prd/${encodeURIComponent(Ae.name)}`);if(B.ok){const K=await B.json();_e(K.prdFiles||[]),we("PRD saved successfully!"),setTimeout(()=>we(null),3e3)}}catch(B){console.error("Failed to refresh PRDs:",B)}Be?.()}}),se&&n.jsx("div",{className:"fixed bottom-4 right-4 z-50 animate-in slide-in-from-bottom-2 duration-300",children:n.jsxs("div",{className:"bg-green-600 text-white px-4 py-3 rounded-lg shadow-lg flex items-center gap-3",children:[n.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),n.jsx("span",{className:"font-medium",children:se})]})})]}):n.jsxs("div",{className:"h-full flex flex-col",children:[l&&n.jsx("div",{className:"bg-background border-b border-border p-2 sm:p-3 pwa-header-safe flex-shrink-0",children:n.jsx("button",{onClick:d,className:"p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white rounded-md hover:bg-gray-100 dark:hover:bg-gray-700 pwa-menu-button",children:n.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})}),n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsxs("div",{className:"text-center text-gray-500 dark:text-gray-400 max-w-md mx-auto px-6",children:[n.jsx("div",{className:"w-16 h-16 mx-auto mb-6 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center",children:n.jsx("svg",{className:"w-8 h-8 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-5l-2-2H5a2 2 0 00-2 2z"})})}),n.jsx("h2",{className:"text-2xl font-semibold mb-3 text-gray-900 dark:text-white",children:"Choose Your Project"}),n.jsx("p",{className:"text-gray-600 dark:text-gray-300 mb-6 leading-relaxed",children:"Select a project from the sidebar to start coding with Claude. Each project contains your chat sessions and file history."}),n.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 rounded-lg p-4 border border-blue-200 dark:border-blue-800",children:n.jsxs("p",{className:"text-sm text-blue-700 dark:text-blue-300",children:["💡 ",n.jsx("strong",{children:"Tip:"})," ",l?"Tap the menu button above to access projects":"Create a new project by clicking the folder icon in the sidebar"]})})]})})]})}const L8=Jr.memo(z8);function P8({activeTab:e,setActiveTab:t,isInputFocused:r}){const{tasksEnabled:a}=cs(),s=[{id:"chat",icon:Xa,onClick:()=>t("chat")},{id:"shell",icon:ba,onClick:()=>t("shell")},{id:"files",icon:En,onClick:()=>t("files")},{id:"git",icon:Xs,onClick:()=>t("git")},...a?[{id:"tasks",icon:S1,onClick:()=>t("tasks")}]:[]];return n.jsx("div",{className:`fixed bottom-0 left-0 right-0 bg-background border-t border-border z-50 ios-bottom-safe transform transition-transform duration-300 ease-in-out shadow-lg ${r?"translate-y-full":"translate-y-0"}`,children:n.jsx("div",{className:"flex items-center justify-around py-1",children:s.map(i=>{const o=i.icon,l=e===i.id;return n.jsxs("button",{onClick:i.onClick,onTouchStart:c=>{c.preventDefault(),i.onClick()},className:`flex items-center justify-center p-2 rounded-lg min-h-[40px] min-w-[40px] relative touch-manipulation ${l?"text-blue-600 dark:text-blue-400":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white"}`,"aria-label":i.id,children:[n.jsx(o,{className:"w-5 h-5"}),l&&n.jsx("div",{className:"absolute top-0 left-1/2 transform -translate-x-1/2 w-6 h-0.5 bg-blue-600 dark:bg-blue-400 rounded-full"})]},i.id)})})})}const Xp=b.createContext(),S0=()=>{const e=b.useContext(Xp);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},R8=({children:e})=>{const[t,r]=b.useState(()=>{const i=localStorage.getItem("theme");return i?i==="dark":window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches:!1});b.useEffect(()=>{if(t){document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark");const i=document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');i&&i.setAttribute("content","black-translucent");const o=document.querySelector('meta[name="theme-color"]');o&&o.setAttribute("content","#0c1117")}else{document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light");const i=document.querySelector('meta[name="apple-mobile-web-app-status-bar-style"]');i&&i.setAttribute("content","default");const o=document.querySelector('meta[name="theme-color"]');o&&o.setAttribute("content","#ffffff")}},[t]),b.useEffect(()=>{if(!window.matchMedia)return;const i=window.matchMedia("(prefers-color-scheme: dark)"),o=l=>{localStorage.getItem("theme")||r(l.matches)};return i.addEventListener("change",o),()=>i.removeEventListener("change",o)},[]);const s={isDarkMode:t,toggleDarkMode:()=>{r(i=>!i)}};return n.jsx(Xp.Provider,{value:s,children:e})},jl="1.11.0",Qp=(e,t)=>{const[r,a]=b.useState(!1),[s,i]=b.useState(null),[o,l]=b.useState(null);return b.useEffect(()=>{const c=async()=>{try{const m=await(await fetch(`https://api.github.com/repos/${e}/${t}/releases/latest`)).json();if(m.tag_name){const h=m.tag_name.replace(/^v/,"");i(h),a(jl!==h),l({title:m.name||m.tag_name,body:m.body||"",htmlUrl:m.html_url||`https://github.com/${e}/${t}/releases/latest`,publishedAt:m.published_at})}else a(!1),i(null),l(null)}catch(u){console.error("Version check failed:",u),a(!1),i(null),l(null)}};c();const d=setInterval(c,300*1e3);return()=>clearInterval(d)},[e,t]),{updateAvailable:r,latestVersion:s,currentVersion:jl,releaseInfo:o}};function F8(){const[e,t]=b.useState([]),[r,a]=b.useState([]),[s,i]=b.useState(!0),[o,l]=b.useState(!1),[c,d]=b.useState(!1),[u,m]=b.useState(""),[h,p]=b.useState(""),[x,y]=b.useState(""),[k,w]=b.useState(""),[j,N]=b.useState({}),[L,U]=b.useState(null),[I,H]=b.useState(null),{updateAvailable:F,latestVersion:W,releaseInfo:M}=Qp("siteboon","claudecodeui");b.useEffect(()=>{_()},[]);const _=async()=>{try{i(!0);const J=localStorage.getItem("auth-token"),ue=await(await fetch("/api/settings/api-keys",{headers:{Authorization:`Bearer ${J}`}})).json();t(ue.apiKeys||[]);const A=await(await fetch("/api/settings/credentials?type=github_token",{headers:{Authorization:`Bearer ${J}`}})).json();a(A.credentials||[])}catch(J){console.error("Error fetching settings:",J)}finally{i(!1)}},O=async()=>{if(u.trim())try{const J=localStorage.getItem("auth-token"),ue=await(await fetch("/api/settings/api-keys",{method:"POST",headers:{Authorization:`Bearer ${J}`,"Content-Type":"application/json"},body:JSON.stringify({keyName:u})})).json();ue.success&&(H(ue.apiKey),m(""),l(!1),_())}catch(J){console.error("Error creating API key:",J)}},V=async J=>{if(confirm("Are you sure you want to delete this API key?"))try{const C=localStorage.getItem("auth-token");await fetch(`/api/settings/api-keys/${J}`,{method:"DELETE",headers:{Authorization:`Bearer ${C}`}}),_()}catch(C){console.error("Error deleting API key:",C)}},T=async(J,C)=>{try{const ue=localStorage.getItem("auth-token");await fetch(`/api/settings/api-keys/${J}/toggle`,{method:"PATCH",headers:{Authorization:`Bearer ${ue}`,"Content-Type":"application/json"},body:JSON.stringify({isActive:!C})}),_()}catch(ue){console.error("Error toggling API key:",ue)}},Y=async()=>{if(!(!h.trim()||!x.trim()))try{const J=localStorage.getItem("auth-token");(await(await fetch("/api/settings/credentials",{method:"POST",headers:{Authorization:`Bearer ${J}`,"Content-Type":"application/json"},body:JSON.stringify({credentialName:h,credentialType:"github_token",credentialValue:x,description:k})})).json()).success&&(p(""),y(""),w(""),d(!1),_())}catch(J){console.error("Error creating GitHub credential:",J)}},ne=async J=>{if(confirm("Are you sure you want to delete this GitHub token?"))try{const C=localStorage.getItem("auth-token");await fetch(`/api/settings/credentials/${J}`,{method:"DELETE",headers:{Authorization:`Bearer ${C}`}}),_()}catch(C){console.error("Error deleting GitHub credential:",C)}},he=async(J,C)=>{try{const ue=localStorage.getItem("auth-token");await fetch(`/api/settings/credentials/${J}/toggle`,{method:"PATCH",headers:{Authorization:`Bearer ${ue}`,"Content-Type":"application/json"},body:JSON.stringify({isActive:!C})}),_()}catch(ue){console.error("Error toggling GitHub credential:",ue)}},$=(J,C)=>{navigator.clipboard.writeText(J),U(C),setTimeout(()=>U(null),2e3)};return s?n.jsx("div",{className:"text-muted-foreground",children:"Loading..."}):n.jsxs("div",{className:"space-y-8",children:[I&&n.jsxs("div",{className:"p-4 bg-yellow-500/10 border border-yellow-500/20 rounded-lg",children:[n.jsx("h4",{className:"font-semibold text-yellow-500 mb-2",children:"⚠️ Save Your API Key"}),n.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"This is the only time you'll see this key. Store it securely."}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("code",{className:"flex-1 px-3 py-2 bg-background/50 rounded font-mono text-sm break-all",children:I.apiKey}),n.jsx(Xe,{size:"sm",variant:"outline",onClick:()=>$(I.apiKey,"new"),children:L==="new"?n.jsx(ln,{className:"h-4 w-4"}):n.jsx(Du,{className:"h-4 w-4"})})]}),n.jsx(Xe,{size:"sm",variant:"ghost",className:"mt-3",onClick:()=>H(null),children:"I've saved it"})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Al,{className:"h-5 w-5"}),n.jsx("h3",{className:"text-lg font-semibold",children:"API Keys"})]}),n.jsxs(Xe,{size:"sm",onClick:()=>l(!o),children:[n.jsx(nr,{className:"h-4 w-4 mr-1"}),"New API Key"]})]}),n.jsxs("div",{className:"mb-4",children:[n.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Generate API keys to access the external API from other applications."}),n.jsxs("a",{href:"/api-docs.html",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-primary hover:underline inline-flex items-center gap-1",children:["API Documentation",n.jsx(B0,{className:"h-3 w-3"})]})]}),o&&n.jsxs("div",{className:"mb-4 p-4 border rounded-lg bg-card",children:[n.jsx(Xt,{placeholder:"API Key Name (e.g., Production Server)",value:u,onChange:J=>m(J.target.value),className:"mb-2"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(Xe,{onClick:O,children:"Create"}),n.jsx(Xe,{variant:"outline",onClick:()=>l(!1),children:"Cancel"})]})]}),n.jsx("div",{className:"space-y-2",children:e.length===0?n.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No API keys created yet."}):e.map(J=>n.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"font-medium",children:J.key_name}),n.jsx("code",{className:"text-xs text-muted-foreground",children:J.api_key}),n.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Created: ",new Date(J.created_at).toLocaleDateString(),J.last_used&&` • Last used: ${new Date(J.last_used).toLocaleDateString()}`]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Xe,{size:"sm",variant:J.is_active?"outline":"secondary",onClick:()=>T(J.id,J.is_active),children:J.is_active?"Active":"Inactive"}),n.jsx(Xe,{size:"sm",variant:"ghost",onClick:()=>V(J.id),children:n.jsx(Or,{className:"h-4 w-4"})})]})]},J.id))})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(qg,{className:"h-5 w-5"}),n.jsx("h3",{className:"text-lg font-semibold",children:"GitHub Credentials"})]}),n.jsxs(Xe,{size:"sm",onClick:()=>d(!c),children:[n.jsx(nr,{className:"h-4 w-4 mr-1"}),"Add Token"]})]}),n.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Add GitHub Personal Access Tokens to clone private repositories. You can also pass tokens directly in API requests without storing them."}),c&&n.jsxs("div",{className:"mb-4 p-4 border rounded-lg bg-card space-y-3",children:[n.jsx(Xt,{placeholder:"Token Name (e.g., Personal Repos)",value:h,onChange:J=>p(J.target.value)}),n.jsxs("div",{className:"relative",children:[n.jsx(Xt,{type:j.new?"text":"password",placeholder:"GitHub Personal Access Token (ghp_...)",value:x,onChange:J=>y(J.target.value),className:"pr-10"}),n.jsx("button",{type:"button",onClick:()=>N({...j,new:!j.new}),className:"absolute right-3 top-2.5 text-muted-foreground hover:text-foreground",children:j.new?n.jsx(Ag,{className:"h-4 w-4"}):n.jsx(os,{className:"h-4 w-4"})})]}),n.jsx(Xt,{placeholder:"Description (optional)",value:k,onChange:J=>w(J.target.value)}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(Xe,{onClick:Y,children:"Add Token"}),n.jsx(Xe,{variant:"outline",onClick:()=>{d(!1),p(""),y(""),w("")},children:"Cancel"})]}),n.jsx("a",{href:"https://github.com/settings/tokens",target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline block",children:"How to create a GitHub Personal Access Token →"})]}),n.jsx("div",{className:"space-y-2",children:r.length===0?n.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No GitHub tokens added yet."}):r.map(J=>n.jsxs("div",{className:"flex items-center justify-between p-3 border rounded-lg",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"font-medium",children:J.credential_name}),J.description&&n.jsx("div",{className:"text-xs text-muted-foreground",children:J.description}),n.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Added: ",new Date(J.created_at).toLocaleDateString()]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Xe,{size:"sm",variant:J.is_active?"outline":"secondary",onClick:()=>he(J.id,J.is_active),children:J.is_active?"Active":"Inactive"}),n.jsx(Xe,{size:"sm",variant:"ghost",onClick:()=>ne(J.id),children:n.jsx(Or,{className:"h-4 w-4"})})]})]},J.id))})]}),n.jsx("div",{className:"pt-6 border-t border-border/50",children:n.jsxs("div",{className:"flex items-center justify-between text-xs italic text-muted-foreground/60",children:[n.jsxs("a",{href:M?.htmlUrl||"https://github.com/siteboon/claudecodeui/releases",target:"_blank",rel:"noopener noreferrer",className:"hover:text-muted-foreground transition-colors",children:["v",jl]}),F&&W&&n.jsxs("a",{href:M?.htmlUrl||"https://github.com/siteboon/claudecodeui/releases",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-2 py-0.5 bg-green-500/10 text-green-600 dark:text-green-400 rounded-full hover:bg-green-500/20 transition-colors not-italic font-medium",children:[n.jsxs("span",{className:"text-[10px]",children:["Update available: v",W]}),n.jsx(B0,{className:"h-2.5 w-2.5"})]})]})})]})}function B8({isOpen:e,onClose:t,projects:r=[],initialTab:a="tools"}){const{isDarkMode:s,toggleDarkMode:i}=S0(),{tasksEnabled:o,setTasksEnabled:l,isTaskMasterInstalled:c,isTaskMasterReady:d,installationStatus:u,isCheckingInstallation:m}=cs(),[h,p]=b.useState([]),[x,y]=b.useState([]),[k,w]=b.useState(""),[j,N]=b.useState(""),[L,U]=b.useState(!1),[I,H]=b.useState(!1),[F,W]=b.useState(null),[M,_]=b.useState("name"),[O,V]=b.useState([]),[T,Y]=b.useState(!1),[ne,he]=b.useState(null),[$,J]=b.useState({name:"",type:"stdio",scope:"user",projectPath:"",config:{command:"",args:[],env:{},url:"",headers:{},timeout:3e4},jsonInput:"",importMode:"form"}),[C,ue]=b.useState(!1),[xe,A]=b.useState({}),[te,Ce]=b.useState({}),[De,pe]=b.useState({}),[_e,se]=b.useState(a),[we,ze]=b.useState(""),[Ae,Be]=b.useState("claude"),[nt,bt]=b.useState(()=>localStorage.getItem("codeEditorTheme")||"dark"),[ut,jt]=b.useState(()=>localStorage.getItem("codeEditorWordWrap")==="true"),[lt,qe]=b.useState(()=>localStorage.getItem("codeEditorShowMinimap")!=="false"),[st,St]=b.useState(()=>localStorage.getItem("codeEditorLineNumbers")!=="false"),[Oe,Qt]=b.useState(()=>localStorage.getItem("codeEditorFontSize")||"14"),[ie,Se]=b.useState([]),[B,K]=b.useState([]),[ke,We]=b.useState(!1),[Ge,ce]=b.useState(""),[R,Q]=b.useState(""),[be,je]=b.useState([]),[re,Me]=b.useState(!1),[pt,qt]=b.useState(""),[zt,Kt]=b.useState(null),Lr=["Bash(git log:*)","Bash(git diff:*)","Bash(git status:*)","Write","Read","Edit","Glob","Grep","MultiEdit","Task","TodoWrite","TodoRead","WebFetch","WebSearch"],_r=["Shell(ls)","Shell(mkdir)","Shell(cd)","Shell(cat)","Shell(echo)","Shell(git status)","Shell(git diff)","Shell(git log)","Shell(npm install)","Shell(npm run)","Shell(python)","Shell(node)"],Nt=async()=>{try{const P=localStorage.getItem("auth-token"),ve=await fetch("/api/cursor/mcp",{headers:{Authorization:`Bearer ${P}`,"Content-Type":"application/json"}});if(ve.ok){const tt=await ve.json();je(tt.servers||[])}else console.error("Failed to fetch Cursor MCP servers")}catch(P){console.error("Error fetching Cursor MCP servers:",P)}},Pr=async()=>{try{const P=localStorage.getItem("auth-token"),ve=await fetch("/api/mcp/config/read",{headers:{Authorization:`Bearer ${P}`,"Content-Type":"application/json"}});if(ve.ok){const Lt=await ve.json();if(Lt.success&&Lt.servers){V(Lt.servers);return}}const tt=await fetch("/api/mcp/cli/list",{headers:{Authorization:`Bearer ${P}`,"Content-Type":"application/json"}});if(tt.ok){const Lt=await tt.json();if(Lt.success&&Lt.servers){const Pt=Lt.servers.map(Sr=>({id:Sr.name,name:Sr.name,type:Sr.type,scope:"user",config:{command:Sr.command||"",args:Sr.args||[],env:Sr.env||{},url:Sr.url||"",headers:Sr.headers||{},timeout:3e4},created:new Date().toISOString(),updated:new Date().toISOString()}));V(Pt);return}}const Et=await fetch("/api/mcp/servers?scope=user",{headers:{Authorization:`Bearer ${P}`,"Content-Type":"application/json"}});if(Et.ok){const Lt=await Et.json();V(Lt.servers||[])}else console.error("Failed to fetch MCP servers")}catch(P){console.error("Error fetching MCP servers:",P)}},en=async P=>{try{const ve=localStorage.getItem("auth-token");ne&&await vn(ne.id,"user");const tt=await fetch("/api/mcp/cli/add",{method:"POST",headers:{Authorization:`Bearer ${ve}`,"Content-Type":"application/json"},body:JSON.stringify({name:P.name,type:P.type,scope:P.scope,projectPath:P.projectPath,command:P.config?.command,args:P.config?.args||[],url:P.config?.url,headers:P.config?.headers||{},env:P.config?.env||{}})});if(tt.ok){const Et=await tt.json();if(Et.success)return await Pr(),!0;throw new Error(Et.error||"Failed to save server via Claude CLI")}else{const Et=await tt.json();throw new Error(Et.error||"Failed to save server")}}catch(ve){throw console.error("Error saving MCP server:",ve),ve}},vn=async(P,ve="user")=>{try{const tt=localStorage.getItem("auth-token"),Et=await fetch(`/api/mcp/cli/remove/${P}?scope=${ve}`,{method:"DELETE",headers:{Authorization:`Bearer ${tt}`,"Content-Type":"application/json"}});if(Et.ok){const Lt=await Et.json();if(Lt.success)return await Pr(),!0;throw new Error(Lt.error||"Failed to delete server via Claude CLI")}else{const Lt=await Et.json();throw new Error(Lt.error||"Failed to delete server")}}catch(tt){throw console.error("Error deleting MCP server:",tt),tt}};b.useEffect(()=>{e&&(Rr(),se(a))},[e,a]),b.useEffect(()=>{localStorage.setItem("codeEditorTheme",nt),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[nt]),b.useEffect(()=>{localStorage.setItem("codeEditorWordWrap",ut.toString()),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[ut]),b.useEffect(()=>{localStorage.setItem("codeEditorShowMinimap",lt.toString()),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[lt]),b.useEffect(()=>{localStorage.setItem("codeEditorLineNumbers",st.toString()),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[st]),b.useEffect(()=>{localStorage.setItem("codeEditorFontSize",Oe),window.dispatchEvent(new Event("codeEditorSettingsChanged"))},[Oe]);const Rr=async()=>{try{const P=localStorage.getItem("claude-settings");if(P){const tt=JSON.parse(P);p(tt.allowedTools||[]),y(tt.disallowedTools||[]),U(tt.skipPermissions||!1),_(tt.projectSortOrder||"name")}else p([]),y([]),U(!1),_("name");const ve=localStorage.getItem("cursor-tools-settings");if(ve){const tt=JSON.parse(ve);Se(tt.allowedCommands||[]),K(tt.disallowedCommands||[]),We(tt.skipPermissions||!1)}else Se([]),K([]),We(!1);await Pr(),await Nt()}catch(P){console.error("Error loading tool settings:",P),p([]),y([]),U(!1),_("name")}},X=()=>{qt("claude"),Kt(r?.[0]||{name:"default",fullPath:process.cwd()}),Me(!0)},le=()=>{qt("cursor"),Kt(r?.[0]||{name:"default",fullPath:process.cwd()}),Me(!0)},Ye=P=>{Me(!1)},wt=()=>{H(!0),W(null);try{const P={allowedTools:h,disallowedTools:x,skipPermissions:L,projectSortOrder:M,lastUpdated:new Date().toISOString()},ve={allowedCommands:ie,disallowedCommands:B,skipPermissions:ke,lastUpdated:new Date().toISOString()};localStorage.setItem("claude-settings",JSON.stringify(P)),localStorage.setItem("cursor-tools-settings",JSON.stringify(ve)),W("success"),setTimeout(()=>{t()},1e3)}catch(P){console.error("Error saving tool settings:",P),W("error")}finally{H(!1)}},Jt=P=>{P&&!h.includes(P)&&(p([...h,P]),w(""))},Yt=P=>{p(h.filter(ve=>ve!==P))},Nr=P=>{P&&!x.includes(P)&&(y([...x,P]),N(""))},Ii=P=>{y(x.filter(ve=>ve!==P))},lr=()=>{J({name:"",type:"stdio",scope:"user",projectPath:"",config:{command:"",args:[],env:{},url:"",headers:{},timeout:3e4},jsonInput:"",importMode:"form"}),he(null),Y(!1),ze("")},On=(P=null)=>{P?(he(P),J({name:P.name,type:P.type,scope:P.scope,projectPath:P.projectPath||"",config:{...P.config},raw:P.raw,importMode:"form",jsonInput:""})):lr(),Y(!0)},$n=async P=>{P.preventDefault(),ue(!0);try{if($.importMode==="json"){const ve=localStorage.getItem("auth-token"),tt=await fetch("/api/mcp/cli/add-json",{method:"POST",headers:{Authorization:`Bearer ${ve}`,"Content-Type":"application/json"},body:JSON.stringify({name:$.name,jsonConfig:$.jsonInput,scope:$.scope,projectPath:$.projectPath})});if(tt.ok){const Et=await tt.json();if(Et.success)await Pr(),lr(),W("success");else throw new Error(Et.error||"Failed to add server via JSON")}else{const Et=await tt.json();throw new Error(Et.error||"Failed to add server")}}else await en($),lr(),W("success")}catch(ve){alert(`Error: ${ve.message}`),W("error")}finally{ue(!1)}},Da=async(P,ve)=>{if(confirm("Are you sure you want to delete this MCP server?"))try{await vn(P,ve),W("success")}catch(tt){alert(`Error: ${tt.message}`),W("error")}},tr=(P,ve)=>{J(tt=>({...tt,config:{...tt.config,[P]:ve}}))},xs=P=>{switch(P){case"stdio":return n.jsx(ba,{className:"w-4 h-4"});case"sse":return n.jsx(Fo,{className:"w-4 h-4"});case"http":return n.jsx(Fi,{className:"w-4 h-4"});default:return n.jsx(q0,{className:"w-4 h-4"})}};return e?n.jsxs("div",{className:"modal-backdrop fixed inset-0 flex items-center justify-center z-[9999] md:p-4 bg-background/95",children:[n.jsxs("div",{className:"bg-background border border-border md:rounded-lg shadow-xl w-full md:max-w-4xl h-full md:h-[90vh] flex flex-col",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 md:p-6 border-b border-border flex-shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Qn,{className:"w-5 h-5 md:w-6 md:h-6 text-blue-600"}),n.jsx("h2",{className:"text-lg md:text-xl font-semibold text-foreground",children:"Settings"})]}),n.jsx(Xe,{variant:"ghost",size:"sm",onClick:t,className:"text-muted-foreground hover:text-foreground touch-manipulation",children:n.jsx(Mt,{className:"w-5 h-5"})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.jsx("div",{className:"border-b border-border",children:n.jsxs("div",{className:"flex px-4 md:px-6",children:[n.jsx("button",{onClick:()=>se("tools"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${_e==="tools"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:"Tools"}),n.jsx("button",{onClick:()=>se("appearance"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${_e==="appearance"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:"Appearance"}),n.jsx("button",{onClick:()=>se("tasks"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${_e==="tasks"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:"Tasks"}),n.jsxs("button",{onClick:()=>se("api"),className:`px-4 py-3 text-sm font-medium border-b-2 transition-colors ${_e==="api"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:[n.jsx(Al,{className:"w-4 h-4 inline mr-2"}),"API & Tokens"]})]})}),n.jsxs("div",{className:"p-4 md:p-6 space-y-6 md:space-y-8 pb-safe-area-inset-bottom",children:[_e==="appearance"&&n.jsx("div",{className:"space-y-6 md:space-y-8",children:_e==="appearance"&&n.jsxs("div",{className:"space-y-6 md:space-y-8",children:[n.jsx("div",{className:"space-y-4",children:n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-foreground",children:"Dark Mode"}),n.jsx("div",{className:"text-sm text-muted-foreground",children:"Toggle between light and dark themes"})]}),n.jsxs("button",{onClick:i,className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":s,"aria-label":"Toggle dark mode",children:[n.jsx("span",{className:"sr-only",children:"Toggle dark mode"}),n.jsx("span",{className:`${s?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200 flex items-center justify-center`,children:s?n.jsx(Lo,{className:"w-3.5 h-3.5 text-gray-700"}):n.jsx(Ro,{className:"w-3.5 h-3.5 text-yellow-500"})})]})]})})}),n.jsx("div",{className:"space-y-4",children:n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-foreground",children:"Project Sorting"}),n.jsx("div",{className:"text-sm text-muted-foreground",children:"How projects are ordered in the sidebar"})]}),n.jsxs("select",{value:M,onChange:P=>_(P.target.value),className:"text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2 w-32",children:[n.jsx("option",{value:"name",children:"Alphabetical"}),n.jsx("option",{value:"date",children:"Recent Activity"})]})]})})}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Code Editor"}),n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-foreground",children:"Editor Theme"}),n.jsx("div",{className:"text-sm text-muted-foreground",children:"Default theme for the code editor"})]}),n.jsxs("button",{onClick:()=>bt(nt==="dark"?"light":"dark"),className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":nt==="dark","aria-label":"Toggle editor theme",children:[n.jsx("span",{className:"sr-only",children:"Toggle editor theme"}),n.jsx("span",{className:`${nt==="dark"?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200 flex items-center justify-center`,children:nt==="dark"?n.jsx(Lo,{className:"w-3.5 h-3.5 text-gray-700"}):n.jsx(Ro,{className:"w-3.5 h-3.5 text-yellow-500"})})]})]})}),n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-foreground",children:"Word Wrap"}),n.jsx("div",{className:"text-sm text-muted-foreground",children:"Enable word wrapping by default in the editor"})]}),n.jsxs("button",{onClick:()=>jt(!ut),className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":ut,"aria-label":"Toggle word wrap",children:[n.jsx("span",{className:"sr-only",children:"Toggle word wrap"}),n.jsx("span",{className:`${ut?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200`})]})]})}),n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-foreground",children:"Show Minimap"}),n.jsx("div",{className:"text-sm text-muted-foreground",children:"Display a minimap for easier navigation in diff view"})]}),n.jsxs("button",{onClick:()=>qe(!lt),className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":lt,"aria-label":"Toggle minimap",children:[n.jsx("span",{className:"sr-only",children:"Toggle minimap"}),n.jsx("span",{className:`${lt?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200`})]})]})}),n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-foreground",children:"Show Line Numbers"}),n.jsx("div",{className:"text-sm text-muted-foreground",children:"Display line numbers in the editor"})]}),n.jsxs("button",{onClick:()=>St(!st),className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":st,"aria-label":"Toggle line numbers",children:[n.jsx("span",{className:"sr-only",children:"Toggle line numbers"}),n.jsx("span",{className:`${st?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200`})]})]})}),n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-foreground",children:"Font Size"}),n.jsx("div",{className:"text-sm text-muted-foreground",children:"Editor font size in pixels"})]}),n.jsxs("select",{value:Oe,onChange:P=>Qt(P.target.value),className:"text-sm bg-gray-50 dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 p-2 w-24",children:[n.jsx("option",{value:"10",children:"10px"}),n.jsx("option",{value:"11",children:"11px"}),n.jsx("option",{value:"12",children:"12px"}),n.jsx("option",{value:"13",children:"13px"}),n.jsx("option",{value:"14",children:"14px"}),n.jsx("option",{value:"15",children:"15px"}),n.jsx("option",{value:"16",children:"16px"}),n.jsx("option",{value:"18",children:"18px"}),n.jsx("option",{value:"20",children:"20px"})]})]})})]})]})}),_e==="tools"&&n.jsxs("div",{className:"space-y-6 md:space-y-8",children:[n.jsx("div",{className:"border-b border-gray-300 dark:border-gray-600",children:n.jsxs("div",{className:"flex gap-4",children:[n.jsx("button",{onClick:()=>Be("claude"),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Ae==="claude"?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Wr,{className:"w-4 h-4"}),n.jsx("span",{children:"Claude"})]})}),n.jsx("button",{onClick:()=>Be("cursor"),className:`px-4 py-2 text-sm font-medium border-b-2 transition-colors ${Ae==="cursor"?"border-purple-600 text-purple-600 dark:text-purple-400":"border-transparent text-muted-foreground hover:text-foreground"}`,children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(on,{className:"w-4 h-4"}),n.jsx("span",{children:"Cursor"})]})})]})}),Ae==="claude"&&n.jsxs("div",{className:"space-y-6 md:space-y-8",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Wa,{className:"w-5 h-5 text-orange-500"}),n.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Permission Settings"})]}),n.jsx("div",{className:"bg-orange-50 dark:bg-orange-900/20 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:n.jsxs("label",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"checkbox",checked:L,onChange:P=>U(P.target.checked),className:"w-4 h-4 text-blue-600 bg-gray-100 dark:bg-gray-700 border-gray-300 dark:border-gray-600 rounded focus:ring-blue-500 focus:ring-2 checked:bg-blue-600 dark:checked:bg-blue-600"}),n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100",children:"Skip permission prompts (use with caution)"}),n.jsx("div",{className:"text-sm text-orange-700 dark:text-orange-300",children:"Equivalent to --dangerously-skip-permissions flag"})]})]})})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(js,{className:"w-5 h-5 text-blue-500"}),n.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Authentication"})]}),n.jsx("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-blue-900 dark:text-blue-100",children:"Claude CLI Login"}),n.jsx("div",{className:"text-sm text-blue-700 dark:text-blue-300",children:"Sign in to your Claude account to enable AI features"})]}),n.jsxs(Xe,{onClick:X,className:"bg-blue-600 hover:bg-blue-700 text-white",size:"sm",children:[n.jsx(js,{className:"w-4 h-4 mr-2"}),"Login"]})]})})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Bi,{className:"w-5 h-5 text-green-500"}),n.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Allowed Tools"})]}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Tools that are automatically allowed without prompting for permission"}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[n.jsx(Xt,{value:k,onChange:P=>w(P.target.value),placeholder:'e.g., "Bash(git log:*)" or "Write"',onKeyPress:P=>{P.key==="Enter"&&Jt(k)},className:"flex-1 h-10 touch-manipulation",style:{fontSize:"16px"}}),n.jsxs(Xe,{onClick:()=>Jt(k),disabled:!k,size:"sm",className:"h-10 px-4 touch-manipulation",children:[n.jsx(nr,{className:"w-4 h-4 mr-2 sm:mr-0"}),n.jsx("span",{className:"sm:hidden",children:"Add Tool"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Quick add common tools:"}),n.jsx("div",{className:"grid grid-cols-2 sm:flex sm:flex-wrap gap-2",children:Lr.map(P=>n.jsx(Xe,{variant:"outline",size:"sm",onClick:()=>Jt(P),disabled:h.includes(P),className:"text-xs h-8 touch-manipulation truncate",children:P},P))})]}),n.jsxs("div",{className:"space-y-2",children:[h.map(P=>n.jsxs("div",{className:"flex items-center justify-between bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-3",children:[n.jsx("span",{className:"font-mono text-sm text-green-800 dark:text-green-200",children:P}),n.jsx(Xe,{variant:"ghost",size:"sm",onClick:()=>Yt(P),className:"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300",children:n.jsx(Mt,{className:"w-4 h-4"})})]},P)),h.length===0&&n.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No allowed tools configured"})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Wa,{className:"w-5 h-5 text-red-500"}),n.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Disallowed Tools"})]}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Tools that are automatically blocked without prompting for permission"}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[n.jsx(Xt,{value:j,onChange:P=>N(P.target.value),placeholder:'e.g., "Bash(rm:*)" or "Write"',onKeyPress:P=>{P.key==="Enter"&&Nr(j)},className:"flex-1 h-10 touch-manipulation",style:{fontSize:"16px"}}),n.jsxs(Xe,{onClick:()=>Nr(j),disabled:!j,size:"sm",className:"h-10 px-4 touch-manipulation",children:[n.jsx(nr,{className:"w-4 h-4 mr-2 sm:mr-0"}),n.jsx("span",{className:"sm:hidden",children:"Add Tool"})]})]}),n.jsxs("div",{className:"space-y-2",children:[x.map(P=>n.jsxs("div",{className:"flex items-center justify-between bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-3",children:[n.jsx("span",{className:"font-mono text-sm text-red-800 dark:text-red-200",children:P}),n.jsx(Xe,{variant:"ghost",size:"sm",onClick:()=>Ii(P),className:"text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:n.jsx(Mt,{className:"w-4 h-4"})})]},P)),x.length===0&&n.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No disallowed tools configured"})]})]}),n.jsxs("div",{className:"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:[n.jsx("h4",{className:"font-medium text-blue-900 dark:text-blue-100 mb-2",children:"Tool Pattern Examples:"}),n.jsxs("ul",{className:"text-sm text-blue-800 dark:text-blue-200 space-y-1",children:[n.jsxs("li",{children:[n.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Bash(git log:*)"'})," - Allow all git log commands"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Bash(git diff:*)"'})," - Allow all git diff commands"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Write"'})," - Allow all Write tool usage"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Read"'})," - Allow all Read tool usage"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:'"Bash(rm:*)"'})," - Block all rm commands (dangerous)"]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(q0,{className:"w-5 h-5 text-purple-500"}),n.jsx("h3",{className:"text-lg font-medium text-foreground",children:"MCP Servers"})]}),n.jsx("div",{className:"space-y-2",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:"Model Context Protocol servers provide additional tools and data sources to Claude"})}),n.jsx("div",{className:"flex justify-between items-center",children:n.jsxs(Xe,{onClick:()=>On(),className:"bg-purple-600 hover:bg-purple-700 text-white",size:"sm",children:[n.jsx(nr,{className:"w-4 h-4 mr-2"}),"Add MCP Server"]})}),n.jsxs("div",{className:"space-y-2",children:[O.map(P=>n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-start justify-between",children:[n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[xs(P.type),n.jsx("span",{className:"font-medium text-foreground",children:P.name}),n.jsx(Yn,{variant:"outline",className:"text-xs",children:P.type}),n.jsx(Yn,{variant:"outline",className:"text-xs",children:P.scope==="local"?"📁 local":P.scope==="user"?"👤 user":P.scope}),P.projectPath&&n.jsx(Yn,{variant:"outline",className:"text-xs bg-purple-50 dark:bg-purple-900/20",title:P.projectPath,children:P.projectPath.split("/").pop()})]}),n.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[P.type==="stdio"&&P.config.command&&n.jsxs("div",{children:["Command: ",n.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:P.config.command})]}),(P.type==="sse"||P.type==="http")&&P.config.url&&n.jsxs("div",{children:["URL: ",n.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:P.config.url})]}),P.config.args&&P.config.args.length>0&&n.jsxs("div",{children:["Args: ",n.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:P.config.args.join(" ")})]}),P.config.env&&Object.keys(P.config.env).length>0&&n.jsxs("div",{children:["Environment: ",n.jsx("code",{className:"bg-gray-100 dark:bg-gray-800 px-1 rounded text-xs",children:Object.entries(P.config.env).map(([ve,tt])=>`${ve}=${tt}`).join(", ")})]}),P.raw&&n.jsxs("details",{className:"mt-2",children:[n.jsx("summary",{className:"cursor-pointer text-xs text-muted-foreground hover:text-foreground",children:"View full config"}),n.jsx("pre",{className:"mt-1 text-xs bg-gray-100 dark:bg-gray-800 p-2 rounded overflow-x-auto",children:JSON.stringify(P.raw,null,2)})]})]}),xe[P.id]&&n.jsxs("div",{className:`mt-2 p-2 rounded text-xs ${xe[P.id].success?"bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200":"bg-red-50 dark:bg-red-900/20 text-red-800 dark:text-red-200"}`,children:[n.jsx("div",{className:"font-medium",children:xe[P.id].message}),xe[P.id].details&&xe[P.id].details.length>0&&n.jsx("ul",{className:"mt-1 space-y-0.5",children:xe[P.id].details.map((ve,tt)=>n.jsxs("li",{children:["• ",ve]},tt))})]}),te[P.id]&&n.jsxs("div",{className:"mt-2 p-2 rounded text-xs bg-blue-50 dark:bg-blue-900/20 text-blue-800 dark:text-blue-200 border border-blue-200 dark:border-blue-800",children:[n.jsx("div",{className:"font-medium mb-2",children:"Available Tools & Resources"}),te[P.id].tools&&te[P.id].tools.length>0&&n.jsxs("div",{className:"mb-2",children:[n.jsxs("div",{className:"font-medium text-xs mb-1",children:["Tools (",te[P.id].tools.length,"):"]}),n.jsx("ul",{className:"space-y-0.5",children:te[P.id].tools.map((ve,tt)=>n.jsxs("li",{className:"flex items-start gap-1",children:[n.jsx("span",{className:"text-blue-400 mt-0.5",children:"•"}),n.jsxs("div",{children:[n.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:ve.name}),ve.description&&ve.description!=="No description provided"&&n.jsxs("span",{className:"ml-1 text-xs opacity-75",children:["- ",ve.description]})]})]},tt))})]}),te[P.id].resources&&te[P.id].resources.length>0&&n.jsxs("div",{className:"mb-2",children:[n.jsxs("div",{className:"font-medium text-xs mb-1",children:["Resources (",te[P.id].resources.length,"):"]}),n.jsx("ul",{className:"space-y-0.5",children:te[P.id].resources.map((ve,tt)=>n.jsxs("li",{className:"flex items-start gap-1",children:[n.jsx("span",{className:"text-blue-400 mt-0.5",children:"•"}),n.jsxs("div",{children:[n.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:ve.name}),ve.description&&ve.description!=="No description provided"&&n.jsxs("span",{className:"ml-1 text-xs opacity-75",children:["- ",ve.description]})]})]},tt))})]}),te[P.id].prompts&&te[P.id].prompts.length>0&&n.jsxs("div",{children:[n.jsxs("div",{className:"font-medium text-xs mb-1",children:["Prompts (",te[P.id].prompts.length,"):"]}),n.jsx("ul",{className:"space-y-0.5",children:te[P.id].prompts.map((ve,tt)=>n.jsxs("li",{className:"flex items-start gap-1",children:[n.jsx("span",{className:"text-blue-400 mt-0.5",children:"•"}),n.jsxs("div",{children:[n.jsx("code",{className:"bg-blue-100 dark:bg-blue-800 px-1 rounded",children:ve.name}),ve.description&&ve.description!=="No description provided"&&n.jsxs("span",{className:"ml-1 text-xs opacity-75",children:["- ",ve.description]})]})]},tt))})]}),(!te[P.id].tools||te[P.id].tools.length===0)&&(!te[P.id].resources||te[P.id].resources.length===0)&&(!te[P.id].prompts||te[P.id].prompts.length===0)&&n.jsx("div",{className:"text-xs opacity-75",children:"No tools, resources, or prompts discovered"})]})]}),n.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[n.jsx(Xe,{onClick:()=>On(P),variant:"ghost",size:"sm",className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",title:"Edit server",children:n.jsx(Po,{className:"w-4 h-4"})}),n.jsx(Xe,{onClick:()=>Da(P.id,P.scope),variant:"ghost",size:"sm",className:"text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",title:"Delete server",children:n.jsx(Or,{className:"w-4 h-4"})})]})]})},P.id)),O.length===0&&n.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No MCP servers configured"})]})]}),T&&n.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[110] p-4",children:n.jsxs("div",{className:"bg-background border border-border rounded-lg w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[n.jsx("h3",{className:"text-lg font-medium text-foreground",children:ne?"Edit MCP Server":"Add MCP Server"}),n.jsx(Xe,{variant:"ghost",size:"sm",onClick:lr,children:n.jsx(Mt,{className:"w-4 h-4"})})]}),n.jsxs("form",{onSubmit:$n,className:"p-4 space-y-4",children:[!ne&&n.jsxs("div",{className:"flex gap-2 mb-4",children:[n.jsx("button",{type:"button",onClick:()=>J(P=>({...P,importMode:"form"})),className:`px-4 py-2 rounded-lg font-medium transition-colors ${$.importMode==="form"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:"Form Input"}),n.jsx("button",{type:"button",onClick:()=>J(P=>({...P,importMode:"json"})),className:`px-4 py-2 rounded-lg font-medium transition-colors ${$.importMode==="json"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:"JSON Import"})]}),$.importMode==="form"&&ne&&n.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-3",children:[n.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Scope"}),n.jsxs("div",{className:"flex items-center gap-2",children:[$.scope==="user"?n.jsx(Fi,{className:"w-4 h-4"}):n.jsx(Jn,{className:"w-4 h-4"}),n.jsx("span",{className:"text-sm",children:$.scope==="user"?"User (Global)":"Project (Local)"}),$.scope==="local"&&$.projectPath&&n.jsxs("span",{className:"text-xs text-muted-foreground",children:["- ",$.projectPath]})]}),n.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Scope cannot be changed when editing an existing server"})]}),$.importMode==="form"&&!ne&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Scope *"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",onClick:()=>J(P=>({...P,scope:"user",projectPath:""})),className:`flex-1 px-4 py-2 rounded-lg font-medium transition-colors ${$.scope==="user"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:n.jsxs("div",{className:"flex items-center justify-center gap-2",children:[n.jsx(Fi,{className:"w-4 h-4"}),n.jsx("span",{children:"User (Global)"})]})}),n.jsx("button",{type:"button",onClick:()=>J(P=>({...P,scope:"local"})),className:`flex-1 px-4 py-2 rounded-lg font-medium transition-colors ${$.scope==="local"?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:n.jsxs("div",{className:"flex items-center justify-center gap-2",children:[n.jsx(Jn,{className:"w-4 h-4"}),n.jsx("span",{children:"Project (Local)"})]})})]}),n.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:$.scope==="user"?"User scope: Available across all projects on your machine":"Local scope: Only available in the selected project"})]}),$.scope==="local"&&!ne&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Project *"}),n.jsxs("select",{value:$.projectPath,onChange:P=>J(ve=>({...ve,projectPath:P.target.value})),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500",required:$.scope==="local",children:[n.jsx("option",{value:"",children:"Select a project..."}),r.map(P=>n.jsx("option",{value:P.path||P.fullPath,children:P.displayName||P.name},P.name))]}),$.projectPath&&n.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Path: ",$.projectPath]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:$.importMode==="json"?"md:col-span-2":"",children:[n.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Server Name *"}),n.jsx(Xt,{value:$.name,onChange:P=>{J(ve=>({...ve,name:P.target.value}))},placeholder:"my-server",required:!0})]}),$.importMode==="form"&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Transport Type *"}),n.jsxs("select",{value:$.type,onChange:P=>{J(ve=>({...ve,type:P.target.value}))},className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500",children:[n.jsx("option",{value:"stdio",children:"stdio"}),n.jsx("option",{value:"sse",children:"SSE"}),n.jsx("option",{value:"http",children:"HTTP"})]})]})]}),ne&&$.raw&&$.importMode==="form"&&n.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:[n.jsxs("h4",{className:"text-sm font-medium text-foreground mb-2",children:["Configuration Details (from ",ne.scope==="global"?"~/.claude.json":"project config",")"]}),n.jsx("pre",{className:"text-xs bg-gray-100 dark:bg-gray-800 p-3 rounded overflow-x-auto",children:JSON.stringify($.raw,null,2)})]}),$.importMode==="json"&&n.jsx("div",{className:"space-y-4",children:n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"JSON Configuration *"}),n.jsx("textarea",{value:$.jsonInput,onChange:P=>{J(ve=>({...ve,jsonInput:P.target.value}));try{if(P.target.value.trim()){const ve=JSON.parse(P.target.value);ve.type?ve.type==="stdio"&&!ve.command?ze("stdio type requires a command field"):(ve.type==="http"||ve.type==="sse")&&!ve.url?ze(`${ve.type} type requires a url field`):ze(""):ze("Missing required field: type")}}catch{P.target.value.trim()?ze("Invalid JSON format"):ze("")}},className:`w-full px-3 py-2 border ${we?"border-red-500":"border-gray-300 dark:border-gray-600"} bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500 font-mono text-sm`,rows:"8",placeholder:`{
|
|
1163
|
-
"type": "stdio",
|
|
1164
|
-
"command": "/path/to/server",
|
|
1165
|
-
"args": ["--api-key", "abc123"],
|
|
1166
|
-
"env": {
|
|
1167
|
-
"CACHE_DIR": "/tmp"
|
|
1168
|
-
}
|
|
1169
|
-
}`,required:!0}),we&&n.jsx("p",{className:"text-xs text-red-500 mt-1",children:we}),n.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Paste your MCP server configuration in JSON format. Example formats:",n.jsx("br",{}),"• stdio: ",'{"type":"stdio","command":"npx","args":["@upstash/context7-mcp"]}',n.jsx("br",{}),"• http/sse: ",'{"type":"http","url":"https://api.example.com/mcp"}']})]})}),$.importMode==="form"&&$.type==="stdio"&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Command *"}),n.jsx(Xt,{value:$.config.command,onChange:P=>tr("command",P.target.value),placeholder:"/path/to/mcp-server",required:!0})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Arguments (one per line)"}),n.jsx("textarea",{value:Array.isArray($.config.args)?$.config.args.join(`
|
|
1170
|
-
`):"",onChange:P=>tr("args",P.target.value.split(`
|
|
1171
|
-
`).filter(ve=>ve.trim())),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500",rows:"3",placeholder:`--api-key
|
|
1172
|
-
abc123`})]})]}),$.importMode==="form"&&($.type==="sse"||$.type==="http")&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"URL *"}),n.jsx(Xt,{value:$.config.url,onChange:P=>tr("url",P.target.value),placeholder:"https://api.example.com/mcp",type:"url",required:!0})]}),$.importMode==="form"&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Environment Variables (KEY=value, one per line)"}),n.jsx("textarea",{value:Object.entries($.config.env||{}).map(([P,ve])=>`${P}=${ve}`).join(`
|
|
1173
|
-
`),onChange:P=>{const ve={};P.target.value.split(`
|
|
1174
|
-
`).forEach(tt=>{const[Et,...Lt]=tt.split("=");Et&&Et.trim()&&(ve[Et.trim()]=Lt.join("=").trim())}),tr("env",ve)},className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500",rows:"3",placeholder:`API_KEY=your-key
|
|
1175
|
-
DEBUG=true`})]}),$.importMode==="form"&&($.type==="sse"||$.type==="http")&&n.jsxs("div",{children:[n.jsx("label",{className:"block text-sm font-medium text-foreground mb-2",children:"Headers (KEY=value, one per line)"}),n.jsx("textarea",{value:Object.entries($.config.headers||{}).map(([P,ve])=>`${P}=${ve}`).join(`
|
|
1176
|
-
`),onChange:P=>{const ve={};P.target.value.split(`
|
|
1177
|
-
`).forEach(tt=>{const[Et,...Lt]=tt.split("=");Et&&Et.trim()&&(ve[Et.trim()]=Lt.join("=").trim())}),tr("headers",ve)},className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-lg focus:ring-blue-500 focus:border-blue-500",rows:"3",placeholder:`Authorization=Bearer token
|
|
1178
|
-
X-API-Key=your-key`})]}),n.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[n.jsx(Xe,{type:"button",variant:"outline",onClick:lr,children:"Cancel"}),n.jsx(Xe,{type:"submit",disabled:C,className:"bg-purple-600 hover:bg-purple-700 disabled:opacity-50",children:C?"Saving...":ne?"Update Server":"Add Server"})]})]})]})})]}),Ae==="cursor"&&n.jsxs("div",{className:"space-y-6 md:space-y-8",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Wa,{className:"w-5 h-5 text-orange-500"}),n.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Cursor Permission Settings"})]}),n.jsx("div",{className:"bg-orange-50 dark:bg-orange-900/20 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:n.jsxs("label",{className:"flex items-center gap-3",children:[n.jsx("input",{type:"checkbox",checked:ke,onChange:P=>We(P.target.checked),className:"w-4 h-4 text-blue-600 bg-gray-100 dark:bg-gray-700 border-gray-300 dark:border-gray-600 rounded focus:ring-blue-500 focus:ring-2 checked:bg-blue-600 dark:checked:bg-blue-600"}),n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100",children:"Skip permission prompts (use with caution)"}),n.jsx("div",{className:"text-sm text-orange-700 dark:text-orange-300",children:"Equivalent to -f flag in Cursor CLI"})]})]})})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(js,{className:"w-5 h-5 text-purple-500"}),n.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Authentication"})]}),n.jsx("div",{className:"bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-800 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-purple-900 dark:text-purple-100",children:"Cursor CLI Login"}),n.jsx("div",{className:"text-sm text-purple-700 dark:text-purple-300",children:"Sign in to your Cursor account to enable AI features"})]}),n.jsxs(Xe,{onClick:le,className:"bg-purple-600 hover:bg-purple-700 text-white",size:"sm",children:[n.jsx(js,{className:"w-4 h-4 mr-2"}),"Login"]})]})})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Bi,{className:"w-5 h-5 text-green-500"}),n.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Allowed Shell Commands"})]}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Shell commands that are automatically allowed without prompting for permission"}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[n.jsx(Xt,{value:Ge,onChange:P=>ce(P.target.value),placeholder:'e.g., "Shell(ls)" or "Shell(git status)"',onKeyPress:P=>{P.key==="Enter"&&Ge&&!ie.includes(Ge)&&(Se([...ie,Ge]),ce(""))},className:"flex-1 h-10 touch-manipulation",style:{fontSize:"16px"}}),n.jsxs(Xe,{onClick:()=>{Ge&&!ie.includes(Ge)&&(Se([...ie,Ge]),ce(""))},disabled:!Ge,size:"sm",className:"h-10 px-4 touch-manipulation",children:[n.jsx(nr,{className:"w-4 h-4 mr-2 sm:mr-0"}),n.jsx("span",{className:"sm:hidden",children:"Add Command"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("p",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Quick add common commands:"}),n.jsx("div",{className:"grid grid-cols-2 sm:flex sm:flex-wrap gap-2",children:_r.map(P=>n.jsx(Xe,{variant:"outline",size:"sm",onClick:()=>{ie.includes(P)||Se([...ie,P])},disabled:ie.includes(P),className:"text-xs h-8 touch-manipulation truncate",children:P},P))})]}),n.jsxs("div",{className:"space-y-2",children:[ie.map(P=>n.jsxs("div",{className:"flex items-center justify-between bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-3",children:[n.jsx("span",{className:"font-mono text-sm text-green-800 dark:text-green-200",children:P}),n.jsx(Xe,{variant:"ghost",size:"sm",onClick:()=>Se(ie.filter(ve=>ve!==P)),className:"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300",children:n.jsx(Mt,{className:"w-4 h-4"})})]},P)),ie.length===0&&n.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No allowed shell commands configured"})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Bi,{className:"w-5 h-5 text-red-500"}),n.jsx("h3",{className:"text-lg font-medium text-foreground",children:"Disallowed Shell Commands"})]}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Shell commands that should always be denied"}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[n.jsx(Xt,{value:R,onChange:P=>Q(P.target.value),placeholder:'e.g., "Shell(rm -rf)" or "Shell(sudo)"',onKeyPress:P=>{P.key==="Enter"&&R&&!B.includes(R)&&(K([...B,R]),Q(""))},className:"flex-1 h-10 touch-manipulation",style:{fontSize:"16px"}}),n.jsxs(Xe,{onClick:()=>{R&&!B.includes(R)&&(K([...B,R]),Q(""))},disabled:!R,size:"sm",className:"h-10 px-4 touch-manipulation",children:[n.jsx(nr,{className:"w-4 h-4 mr-2 sm:mr-0"}),n.jsx("span",{className:"sm:hidden",children:"Add Command"})]})]}),n.jsxs("div",{className:"space-y-2",children:[B.map(P=>n.jsxs("div",{className:"flex items-center justify-between bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-3",children:[n.jsx("span",{className:"font-mono text-sm text-red-800 dark:text-red-200",children:P}),n.jsx(Xe,{variant:"ghost",size:"sm",onClick:()=>K(B.filter(ve=>ve!==P)),className:"text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300",children:n.jsx(Mt,{className:"w-4 h-4"})})]},P)),B.length===0&&n.jsx("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:"No disallowed shell commands configured"})]})]}),n.jsxs("div",{className:"bg-purple-50 dark:bg-purple-900/20 border border-purple-200 dark:border-purple-800 rounded-lg p-4",children:[n.jsx("h4",{className:"font-medium text-purple-900 dark:text-purple-100 mb-2",children:"Cursor Shell Command Examples:"}),n.jsxs("ul",{className:"text-sm text-purple-800 dark:text-purple-200 space-y-1",children:[n.jsxs("li",{children:[n.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(ls)"'})," - Allow ls command"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(git status)"'})," - Allow git status command"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"Shell(mkdir)"'})," - Allow mkdir command"]}),n.jsxs("li",{children:[n.jsx("code",{className:"bg-purple-100 dark:bg-purple-800 px-1 rounded",children:'"-f"'})," flag - Skip all permission prompts (dangerous)"]})]})]})]})]}),_e==="tasks"&&n.jsx("div",{className:"space-y-6 md:space-y-8",children:m?n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-blue-600 border-t-transparent rounded-full"}),n.jsx("span",{className:"text-sm text-muted-foreground",children:"Checking TaskMaster installation..."})]})}):n.jsxs(n.Fragment,{children:[!c&&n.jsx("div",{className:"bg-orange-50 dark:bg-orange-950/50 border border-orange-200 dark:border-orange-800 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-orange-100 dark:bg-orange-900 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:n.jsx("svg",{className:"w-4 h-4 text-orange-600 dark:text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"font-medium text-orange-900 dark:text-orange-100 mb-2",children:"TaskMaster AI CLI Not Installed"}),n.jsxs("div",{className:"text-sm text-orange-800 dark:text-orange-200 space-y-3",children:[n.jsx("p",{children:"TaskMaster CLI is required to use task management features. Install it to get started:"}),n.jsxs("div",{className:"bg-orange-100 dark:bg-orange-900/50 rounded-lg p-3 font-mono text-sm",children:[n.jsx("code",{children:"npm install -g task-master-ai"}),n.jsxs("a",{href:"https://github.com/eyaltoledano/claude-task-master",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",children:[n.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:n.jsx("path",{fillRule:"evenodd",d:"M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z",clipRule:"evenodd"})}),"View on GitHub",n.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("p",{className:"font-medium",children:"After installation:"}),n.jsxs("ol",{className:"list-decimal list-inside space-y-1 text-xs",children:[n.jsx("li",{children:"Restart this application"}),n.jsx("li",{children:"TaskMaster features will automatically become available"}),n.jsxs("li",{children:["Use ",n.jsx("code",{className:"bg-orange-100 dark:bg-orange-800 px-1 rounded",children:"task-master init"})," in your project directory"]})]})]})]})]})]})}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"bg-gray-50 dark:bg-gray-900/50 border border-gray-200 dark:border-gray-700 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-foreground",children:"Enable TaskMaster Integration"}),n.jsx("div",{className:"text-sm text-muted-foreground mt-1",children:"Show TaskMaster tasks, banners, and sidebar indicators across the interface"}),!c&&n.jsx("div",{className:"text-xs text-orange-600 dark:text-orange-400 mt-1",children:"TaskMaster CLI must be installed first"})]}),n.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:o,onChange:P=>l(P.target.checked),disabled:!c,className:"sr-only peer"}),n.jsx("div",{className:`w-11 h-6 ${c?"bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800":"bg-gray-300 dark:bg-gray-600"} rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600`})]})]})}),n.jsx("div",{className:"bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 rounded-lg p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-blue-100 dark:bg-blue-900 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:n.jsx(Fo,{className:"w-4 h-4 text-blue-600 dark:text-blue-400"})}),n.jsxs("div",{children:[n.jsx("div",{className:"font-medium text-blue-900 dark:text-blue-100 mb-2",children:"🎯 About TaskMaster AI"}),n.jsxs("div",{className:"text-sm text-blue-800 dark:text-blue-200 space-y-2",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"AI-Powered Task Management:"})," Break complex projects into manageable subtasks with AI assistance"]}),n.jsxs("p",{children:[n.jsx("strong",{children:"PRD:"})," Generate structured tasks from Product Requirements Documents"]}),n.jsxs("p",{children:[n.jsx("strong",{children:"Dependency Tracking:"})," Understand task relationships and execution order"]}),n.jsxs("p",{children:[n.jsx("strong",{children:"Progress Visualization:"})," Kanban boards, and detailed task views"]})]})]}),n.jsx("div",{className:"mt-4 pt-4 border-t border-blue-200 dark:border-blue-700",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-6 h-6 bg-blue-100 dark:bg-blue-800 rounded-full flex items-center justify-center flex-shrink-0 mt-0.5",children:n.jsx("svg",{className:"w-3 h-3 text-blue-600 dark:text-blue-400",fill:"currentColor",viewBox:"0 0 20 20",children:n.jsx("path",{fillRule:"evenodd",d:"M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z",clipRule:"evenodd"})})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"font-medium text-blue-900 dark:text-blue-100 mb-2",children:"📚 Learn More & Tutorial"}),n.jsxs("div",{className:"text-sm text-blue-800 dark:text-blue-200 space-y-2",children:[n.jsxs("p",{children:["TaskMaster AI (aka ",n.jsx("strong",{children:"claude-task-master"})," ) is an advanced AI-powered task management system built for developers."]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("a",{href:"https://github.com/eyaltoledano/claude-task-master",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 font-medium",children:[n.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:n.jsx("path",{fillRule:"evenodd",d:"M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z",clipRule:"evenodd"})}),"View on GitHub",n.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]}),n.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:"Find documentation, setup guides, and examples for advanced TaskMaster workflows"})]})]})]})]})})]})})]})]})}),_e==="api"&&n.jsx("div",{className:"space-y-6 md:space-y-8",children:n.jsx(F8,{})})]})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-4 md:p-6 border-t border-border flex-shrink-0 gap-3 pb-safe-area-inset-bottom",children:[n.jsxs("div",{className:"flex items-center justify-center sm:justify-start gap-2 order-2 sm:order-1",children:[F==="success"&&n.jsxs("div",{className:"text-green-600 dark:text-green-400 text-sm flex items-center gap-1",children:[n.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:n.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Settings saved successfully!"]}),F==="error"&&n.jsxs("div",{className:"text-red-600 dark:text-red-400 text-sm flex items-center gap-1",children:[n.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",children:n.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})}),"Failed to save settings"]})]}),n.jsxs("div",{className:"flex items-center gap-3 order-1 sm:order-2",children:[n.jsx(Xe,{variant:"outline",onClick:t,disabled:I,className:"flex-1 sm:flex-none h-10 touch-manipulation",children:"Cancel"}),n.jsx(Xe,{onClick:wt,disabled:I,className:"flex-1 sm:flex-none h-10 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 touch-manipulation",children:I?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-4 h-4 animate-spin rounded-full border-2 border-white border-t-transparent"}),"Saving..."]}):"Save Settings"})]})]})]}),re&&n.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 max-md:items-stretch max-md:justify-stretch",children:n.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-4xl h-3/4 flex flex-col md:max-w-4xl md:h-3/4 md:rounded-lg md:m-4 max-md:max-w-none max-md:h-full max-md:rounded-none max-md:m-0",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[n.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:pt==="claude"?"Claude CLI Login":"Cursor CLI Login"}),n.jsx("button",{onClick:()=>Me(!1),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:n.jsx(Mt,{className:"w-6 h-6"})})]}),n.jsx("div",{className:"flex-1 overflow-hidden",children:n.jsx(Yp,{project:zt,command:pt==="claude"?"claude /login":"cursor-agent login",onComplete:Ye,showHeader:!1})})]})})]}):null}function O8(){const{isDarkMode:e,toggleDarkMode:t}=S0();return n.jsxs("button",{onClick:t,className:"relative inline-flex h-8 w-14 items-center rounded-full bg-gray-200 dark:bg-gray-700 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:focus:ring-offset-gray-900",role:"switch","aria-checked":e,"aria-label":"Toggle dark mode",children:[n.jsx("span",{className:"sr-only",children:"Toggle dark mode"}),n.jsx("span",{className:`${e?"translate-x-7":"translate-x-1"} inline-block h-6 w-6 transform rounded-full bg-white shadow-lg transition-transform duration-200 flex items-center justify-center`,children:e?n.jsx("svg",{className:"w-3.5 h-3.5 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})}):n.jsx("svg",{className:"w-3.5 h-3.5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})})})]})}const $8=({isOpen:e,onToggle:t,autoExpandTools:r,onAutoExpandChange:a,showRawParameters:s,onShowRawParametersChange:i,showThinking:o,onShowThinkingChange:l,autoScrollToBottom:c,onAutoScrollChange:d,sendByCtrlEnter:u,onSendByCtrlEnterChange:m,isMobile:h})=>{const[p,x]=b.useState(e),[y,k]=b.useState(()=>localStorage.getItem("whisperMode")||"default"),{isDarkMode:w}=S0();b.useEffect(()=>{x(e)},[e]);const j=()=>{const N=!p;x(N),t(N)};return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`fixed ${h?"bottom-44":"top-1/2 -translate-y-1/2"} ${p?"right-64":"right-0"} z-50 transition-all duration-150 ease-out`,children:n.jsx("button",{onClick:j,className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-l-md p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors shadow-lg","aria-label":p?"Close settings panel":"Open settings panel",children:p?n.jsx(cn,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}):n.jsx(Iu,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"})})}),n.jsx("div",{className:`fixed top-0 right-0 h-full w-64 bg-background border-l border-border shadow-xl transform transition-transform duration-150 ease-out z-40 ${p?"translate-x-0":"translate-x-full"} ${h?"h-screen":""}`,children:n.jsxs("div",{className:"h-full flex flex-col",children:[n.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900",children:n.jsxs("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2",children:[n.jsx(k1,{className:"h-5 w-5 text-gray-600 dark:text-gray-400"}),"Quick Settings"]})}),n.jsxs("div",{className:`flex-1 overflow-y-auto overflow-x-hidden p-4 space-y-6 bg-background ${h?"pb-mobile-nav":""}`,children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"Appearance"}),n.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[n.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[w?n.jsx(Lo,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}):n.jsx(Ro,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Dark Mode"]}),n.jsx(O8,{})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"Tool Display"}),n.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[n.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[n.jsx(Tl,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Auto-expand tools"]}),n.jsx("input",{type:"checkbox",checked:r,onChange:N=>a(N.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 focus:ring-2 dark:focus:ring-blue-400 bg-gray-100 dark:bg-gray-800 checked:bg-blue-600 dark:checked:bg-blue-600"})]}),n.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[n.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[n.jsx(os,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Show raw parameters"]}),n.jsx("input",{type:"checkbox",checked:s,onChange:N=>i(N.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 focus:ring-2 dark:focus:ring-blue-400 bg-gray-100 dark:bg-gray-800 checked:bg-blue-600 dark:checked:bg-blue-600"})]}),n.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[n.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[n.jsx(Eu,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Show thinking"]}),n.jsx("input",{type:"checkbox",checked:o,onChange:N=>l(N.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 focus:ring-2 dark:focus:ring-blue-400 bg-gray-100 dark:bg-gray-800 checked:bg-blue-600 dark:checked:bg-blue-600"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"View Options"}),n.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[n.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[n.jsx(Tu,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Auto-scroll to bottom"]}),n.jsx("input",{type:"checkbox",checked:c,onChange:N=>d(N.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 focus:ring-2 dark:focus:ring-blue-400 bg-gray-100 dark:bg-gray-800 checked:bg-blue-600 dark:checked:bg-blue-600"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"Input Settings"}),n.jsxs("label",{className:"flex items-center justify-between p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[n.jsxs("span",{className:"flex items-center gap-2 text-sm text-gray-900 dark:text-white",children:[n.jsx(Xg,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Send by Ctrl+Enter"]}),n.jsx("input",{type:"checkbox",checked:u,onChange:N=>m(N.target.checked),className:"h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 focus:ring-2 dark:focus:ring-blue-400 bg-gray-100 dark:bg-gray-800 checked:bg-blue-600 dark:checked:bg-blue-600"})]}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 ml-3",children:"When enabled, pressing Ctrl+Enter will send the message instead of just Enter. This is useful for IME users to avoid accidental sends."})]}),n.jsxs("div",{className:"space-y-2",style:{display:"none"},children:[n.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-gray-500 dark:text-gray-400 mb-2",children:"Whisper Dictation"}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[n.jsx("input",{type:"radio",name:"whisperMode",value:"default",checked:y==="default",onChange:()=>{k("default"),localStorage.setItem("whisperMode","default"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),n.jsxs("div",{className:"ml-3 flex-1",children:[n.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[n.jsx(Us,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Default Mode"]}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Direct transcription of your speech"})]})]}),n.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[n.jsx("input",{type:"radio",name:"whisperMode",value:"prompt",checked:y==="prompt",onChange:()=>{k("prompt"),localStorage.setItem("whisperMode","prompt"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),n.jsxs("div",{className:"ml-3 flex-1",children:[n.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[n.jsx(Dn,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Prompt Enhancement"]}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Transform rough ideas into clear, detailed AI prompts"})]})]}),n.jsxs("label",{className:"flex items-start p-3 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer transition-colors border border-transparent hover:border-gray-300 dark:hover:border-gray-600",children:[n.jsx("input",{type:"radio",name:"whisperMode",value:"vibe",checked:y==="vibe"||y==="instructions"||y==="architect",onChange:()=>{k("vibe"),localStorage.setItem("whisperMode","vibe"),window.dispatchEvent(new Event("whisperModeChanged"))},className:"mt-0.5 h-4 w-4 border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-500 focus:ring-blue-500 dark:focus:ring-blue-400 dark:bg-gray-800 dark:checked:bg-blue-600"}),n.jsxs("div",{className:"ml-3 flex-1",children:[n.jsxs("span",{className:"flex items-center gap-2 text-sm font-medium text-gray-900 dark:text-white",children:[n.jsx(mr,{className:"h-4 w-4 text-gray-600 dark:text-gray-400"}),"Vibe Mode"]}),n.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Format ideas as clear agent instructions with details"})]})]})]})]})]})]})}),p&&n.jsx("div",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm z-30 transition-opacity duration-150 ease-out",onClick:j})]})},_8=()=>{const[e,t]=b.useState(""),[r,a]=b.useState(""),[s,i]=b.useState(""),[o,l]=b.useState(!1),[c,d]=b.useState(""),{register:u}=xi(),m=async h=>{if(h.preventDefault(),d(""),r!==s){d("Passwords do not match");return}if(e.length<3){d("Username must be at least 3 characters long");return}if(r.length<6){d("Password must be at least 6 characters long");return}l(!0);const p=await u(e,r);p.success||d(p.error),l(!1)};return n.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:n.jsx("div",{className:"w-full max-w-md",children:n.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8 space-y-6",children:[n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"flex justify-center mb-4",children:n.jsx(Wr,{size:64})}),n.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Welcome to Claude Code UI"}),n.jsx("p",{className:"text-muted-foreground mt-2",children:"Set up your account to get started"})]}),n.jsxs("form",{onSubmit:m,className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-foreground mb-1",children:"Username"}),n.jsx("input",{type:"text",id:"username",value:e,onChange:h=>t(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your username",required:!0,disabled:o})]}),n.jsxs("div",{children:[n.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-1",children:"Password"}),n.jsx("input",{type:"password",id:"password",value:r,onChange:h=>a(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your password",required:!0,disabled:o})]}),n.jsxs("div",{children:[n.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-foreground mb-1",children:"Confirm Password"}),n.jsx("input",{type:"password",id:"confirmPassword",value:s,onChange:h=>i(h.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Confirm your password",required:!0,disabled:o})]}),c&&n.jsx("div",{className:"p-3 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-md",children:n.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:c})}),n.jsx("button",{type:"submit",disabled:o,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200",children:o?"Setting up...":"Create Account"})]}),n.jsx("div",{className:"text-center",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:"This is a single-user system. Only one account can be created."})})]})})})},q8=()=>{const[e,t]=b.useState(""),[r,a]=b.useState(""),[s,i]=b.useState(!1),[o,l]=b.useState(""),{login:c}=xi(),d=async u=>{if(u.preventDefault(),l(""),!e||!r){l("Please enter both username and password");return}i(!0);const m=await c(e,r);m.success||l(m.error),i(!1)};return n.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:n.jsx("div",{className:"w-full max-w-md",children:n.jsxs("div",{className:"bg-card rounded-lg shadow-lg border border-border p-8 space-y-6",children:[n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"flex justify-center mb-4",children:n.jsx("div",{className:"w-16 h-16 bg-primary rounded-lg flex items-center justify-center shadow-sm",children:n.jsx(Xa,{className:"w-8 h-8 text-primary-foreground"})})}),n.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Welcome Back"}),n.jsx("p",{className:"text-muted-foreground mt-2",children:"Sign in to your Claude Code UI account"})]}),n.jsxs("form",{onSubmit:d,className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-foreground mb-1",children:"Username"}),n.jsx("input",{type:"text",id:"username",value:e,onChange:u=>t(u.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your username",required:!0,disabled:s})]}),n.jsxs("div",{children:[n.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-foreground mb-1",children:"Password"}),n.jsx("input",{type:"password",id:"password",value:r,onChange:u=>a(u.target.value),className:"w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your password",required:!0,disabled:s})]}),o&&n.jsx("div",{className:"p-3 bg-red-100 dark:bg-red-900/20 border border-red-300 dark:border-red-800 rounded-md",children:n.jsx("p",{className:"text-sm text-red-700 dark:text-red-400",children:o})}),n.jsx("button",{type:"submit",disabled:s,className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200",children:s?"Signing in...":"Sign In"})]}),n.jsx("div",{className:"text-center",children:n.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your credentials to access Claude Code UI"})})]})})})},H8=()=>n.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"flex justify-center mb-4",children:n.jsx("div",{className:"w-16 h-16 bg-primary rounded-lg flex items-center justify-center shadow-sm",children:n.jsx(Xa,{className:"w-8 h-8 text-primary-foreground"})})}),n.jsx("h1",{className:"text-2xl font-bold text-foreground mb-2",children:"Claude Code UI"}),n.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[n.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce"}),n.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),n.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]}),n.jsx("p",{className:"text-muted-foreground mt-2",children:"Loading..."})]})}),U8=({children:e})=>{const{user:t,isLoading:r,needsSetup:a}=xi();return r?n.jsx(H8,{}):a?n.jsx(_8,{}):t?e:n.jsx(q8,{})};function da(e,t){const[r,a]=b.useState(()=>{if(typeof window>"u")return t;try{const i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return console.log(i),t}});return[r,i=>{if(!(typeof window>"u"))try{const o=i instanceof Function?i(r):i;window.localStorage.setItem(e,JSON.stringify(o)),a(o)}catch(o){console.log(o)}}]}function vu(){const e=$f(),{sessionId:t}=_f(),{updateAvailable:r,latestVersion:a,currentVersion:s,releaseInfo:i}=Qp("siteboon","claudecodeui"),[o,l]=b.useState(!1),[c,d]=b.useState([]),[u,m]=b.useState(null),[h,p]=b.useState(null),[x,y]=b.useState("chat"),[k,w]=b.useState(!1),[j,N]=b.useState(!1),[L,U]=b.useState(!0),[I,H]=b.useState(!1),[F,W]=b.useState(!1),[M,_]=b.useState("tools"),[O,V]=b.useState(!1),[T,Y]=da("autoExpandTools",!1),[ne,he]=da("showRawParameters",!1),[$,J]=da("showThinking",!0),[C,ue]=da("autoScrollToBottom",!0),[xe,A]=da("sendByCtrlEnter",!1),[te,Ce]=da("sidebarVisible",!0),[De,pe]=b.useState(new Set),[_e,se]=b.useState(new Set),[we,ze]=b.useState(0),{ws:Ae,sendMessage:Be,messages:nt}=Xu(),[bt,ut]=b.useState(!1);b.useEffect(()=>{const ce=()=>{const R=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone||document.referrer.includes("android-app://");ut(R),R?(document.documentElement.classList.add("pwa-mode"),document.body.classList.add("pwa-mode")):(document.documentElement.classList.remove("pwa-mode"),document.body.classList.remove("pwa-mode"))};return ce(),window.matchMedia("(display-mode: standalone)").addEventListener("change",ce),()=>{window.matchMedia("(display-mode: standalone)").removeEventListener("change",ce)}},[]),b.useEffect(()=>{const ce=()=>{w(window.innerWidth<768)};return ce(),window.addEventListener("resize",ce),()=>window.removeEventListener("resize",ce)},[]),b.useEffect(()=>{lt()},[]);const jt=(ce,R,Q,be)=>{if(!Q||!be)return!0;const je=ce?.find(zt=>zt.name===Q.name),re=R?.find(zt=>zt.name===Q.name);if(!je||!re)return!1;const Me=je.sessions?.find(zt=>zt.id===be.id),pt=re.sessions?.find(zt=>zt.id===be.id);return!Me||!pt?!1:Me.id===pt.id&&Me.title===pt.title&&Me.created_at===pt.created_at&&Me.updated_at===pt.updated_at};b.useEffect(()=>{if(nt.length>0){const ce=nt[nt.length-1];if(ce.type==="projects_updated"){if(ce.changedFile&&h&&u){const be=ce.changedFile.split("/");be.length>=2&&be[be.length-1].replace(".jsonl","")===h.id&&(De.has(h.id)||ze(pt=>pt+1))}if(h&&De.has(h.id)||De.size>0&&Array.from(De).some(be=>be.startsWith("new-session-"))){const be=ce.projects;if(!jt(c,be,u,h))return}const Q=ce.projects;if(d(Q),u){const be=Q.find(je=>je.name===u.name);be&&(JSON.stringify(be)!==JSON.stringify(u)&&m(be),h&&(be.sessions?.find(re=>re.id===h.id)||p(null)))}}}},[nt,u,h,De]);const lt=async()=>{try{U(!0);const R=await(await at.projects()).json();for(let Q of R)try{const be=`/api/cursor/sessions?projectPath=${encodeURIComponent(Q.fullPath||Q.path)}`,je=await Qe(be);if(je.ok){const re=await je.json();re.success&&re.sessions?Q.cursorSessions=re.sessions:Q.cursorSessions=[]}else Q.cursorSessions=[]}catch(be){console.error(`Error fetching Cursor sessions for project ${Q.name}:`,be),Q.cursorSessions=[]}d(Q=>Q.length===0||R.some((je,re)=>{const Me=Q[re];return Me?je.name!==Me.name||je.displayName!==Me.displayName||je.fullPath!==Me.fullPath||JSON.stringify(je.sessionMeta)!==JSON.stringify(Me.sessionMeta)||JSON.stringify(je.sessions)!==JSON.stringify(Me.sessions)||JSON.stringify(je.cursorSessions)!==JSON.stringify(Me.cursorSessions):!0})||R.length!==Q.length?R:Q)}catch(ce){console.error("Error fetching projects:",ce)}finally{U(!1)}};window.refreshProjects=lt,window.openSettings=b.useCallback((ce="tools")=>{_(ce),W(!0)},[]),b.useEffect(()=>{if(t&&c.length>0){const ce=!h||h.id!==t;for(const R of c){let Q=R.sessions?.find(je=>je.id===t);if(Q){m(R),p({...Q,__provider:"claude"}),ce&&y("chat");return}const be=R.cursorSessions?.find(je=>je.id===t);if(be){m(R),p({...be,__provider:"cursor"}),ce&&y("chat");return}}}},[t,c,e]);const qe=ce=>{m(ce),p(null),e("/"),k&&N(!1)},st=ce=>{if(p(ce),x!=="git"&&x!=="preview"&&y("chat"),(localStorage.getItem("selected-provider")||"claude")==="cursor"&&sessionStorage.setItem("cursorSessionId",ce.id),k){const Q=ce.__projectName,be=u?.name;Q!==be&&N(!1)}e(`/session/${ce.id}`)},St=ce=>{m(ce),p(null),y("chat"),e("/"),k&&N(!1)},Oe=ce=>{h?.id===ce&&(p(null),e("/")),d(R=>R.map(Q=>({...Q,sessions:Q.sessions?.filter(be=>be.id!==ce)||[],sessionMeta:{...Q.sessionMeta,total:Math.max(0,(Q.sessionMeta?.total||0)-1)}})))},Qt=async()=>{try{const R=await(await at.projects()).json();if(d(Q=>R.some((je,re)=>{const Me=Q[re];return Me?je.name!==Me.name||je.displayName!==Me.displayName||je.fullPath!==Me.fullPath||JSON.stringify(je.sessionMeta)!==JSON.stringify(Me.sessionMeta)||JSON.stringify(je.sessions)!==JSON.stringify(Me.sessions):!0})||R.length!==Q.length?R:Q),u){const Q=R.find(be=>be.name===u.name);if(Q&&(JSON.stringify(Q)!==JSON.stringify(u)&&m(Q),h)){const be=Q.sessions?.find(je=>je.id===h.id);be&&JSON.stringify(be)!==JSON.stringify(h)&&p(be)}}}catch(ce){console.error("Error refreshing sidebar:",ce)}},ie=ce=>{u?.name===ce&&(m(null),p(null),e("/")),d(R=>R.filter(Q=>Q.name!==ce))},Se=b.useCallback(ce=>{ce&&pe(R=>new Set([...R,ce]))},[]),B=b.useCallback(ce=>{ce&&pe(R=>{const Q=new Set(R);return Q.delete(ce),Q})},[]),K=b.useCallback(ce=>{ce&&se(R=>new Set([...R,ce]))},[]),ke=b.useCallback(ce=>{ce&&se(R=>{const Q=new Set(R);return Q.delete(ce),Q})},[]),We=b.useCallback(ce=>{ce&&pe(R=>{const Q=new Set;for(const be of R)be.startsWith("new-session-")||Q.add(be);return Q.add(ce),Q})},[]),Ge=()=>{const[ce,R]=b.useState(!1),[Q,be]=b.useState(""),[je,re]=b.useState("");if(!o)return null;const Me=qt=>qt?qt.replace(/\b[0-9a-f]{40}\b/gi,"").replace(/(?:^|\s|-)([0-9a-f]{7,10})\b/gi,"").replace(/\*\*Full Changelog\*\*:.*$/gim,"").replace(/https?:\/\/github\.com\/[^\/]+\/[^\/]+\/compare\/[^\s)]+/gi,"").replace(/\n\s*\n\s*\n/g,`
|
|
1179
|
-
|
|
1180
|
-
`).trim():"",pt=async()=>{R(!0),be(`Starting update...
|
|
1181
|
-
`),re("");try{const qt=await Qe("/api/system/update",{method:"POST"}),zt=await qt.json();qt.ok?(be(Kt=>Kt+zt.output+`
|
|
1182
|
-
`),be(Kt=>Kt+`
|
|
1183
|
-
✅ Update completed successfully!
|
|
1184
|
-
`),be(Kt=>Kt+`Please restart the server to apply changes.
|
|
1185
|
-
`)):(re(zt.error||"Update failed"),be(Kt=>Kt+`
|
|
1186
|
-
❌ Update failed: `+(zt.error||"Unknown error")+`
|
|
1187
|
-
`))}catch(qt){re(qt.message),be(zt=>zt+`
|
|
1188
|
-
❌ Update failed: `+qt.message+`
|
|
1189
|
-
`)}finally{R(!1)}};return n.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[n.jsx("button",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>l(!1),"aria-label":"Close version upgrade modal"}),n.jsxs("div",{className:"relative bg-white dark:bg-gray-800 rounded-lg shadow-xl border border-gray-200 dark:border-gray-700 w-full max-w-2xl mx-4 p-6 space-y-4 max-h-[90vh] overflow-y-auto",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center",children:n.jsx("svg",{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"})})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Update Available"}),n.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:i?.title||"A new version is ready"})]})]}),n.jsx("button",{onClick:()=>l(!1),className:"p-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-md hover:bg-gray-100 dark:hover:bg-gray-700",children:n.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex justify-between items-center p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg",children:[n.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Current Version"}),n.jsx("span",{className:"text-sm text-gray-900 dark:text-white font-mono",children:s})]}),n.jsxs("div",{className:"flex justify-between items-center p-3 bg-blue-50 dark:bg-blue-900/20 rounded-lg border border-blue-200 dark:border-blue-700",children:[n.jsx("span",{className:"text-sm font-medium text-blue-700 dark:text-blue-300",children:"Latest Version"}),n.jsx("span",{className:"text-sm text-blue-900 dark:text-blue-100 font-mono",children:a})]})]}),i?.body&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"What's New:"}),i?.htmlUrl&&n.jsxs("a",{href:i.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-600 dark:text-blue-400 hover:text-blue-700 dark:hover:text-blue-300 hover:underline flex items-center gap-1",children:["View full release",n.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]}),n.jsx("div",{className:"bg-gray-50 dark:bg-gray-700/50 rounded-lg p-4 border border-gray-200 dark:border-gray-600 max-h-64 overflow-y-auto",children:n.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300 whitespace-pre-wrap prose prose-sm dark:prose-invert max-w-none",children:Me(i.body)})})]}),Q&&n.jsxs("div",{className:"space-y-2",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Update Progress:"}),n.jsx("div",{className:"bg-gray-900 dark:bg-gray-950 rounded-lg p-4 border border-gray-700 max-h-48 overflow-y-auto",children:n.jsx("pre",{className:"text-xs text-green-400 font-mono whitespace-pre-wrap",children:Q})})]}),!ce&&!Q&&n.jsxs("div",{className:"space-y-3",children:[n.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-white",children:"Manual upgrade:"}),n.jsx("div",{className:"bg-gray-100 dark:bg-gray-800 rounded-lg p-3 border",children:n.jsx("code",{className:"text-sm text-gray-800 dark:text-gray-200 font-mono",children:"git checkout main && git pull && npm install"})}),n.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:'Or click "Update Now" to run the update automatically.'})]}),n.jsxs("div",{className:"flex gap-2 pt-2",children:[n.jsx("button",{onClick:()=>l(!1),className:"flex-1 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md transition-colors",children:Q?"Close":"Later"}),!Q&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>{navigator.clipboard.writeText("git checkout main && git pull && npm install")},className:"flex-1 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md transition-colors",children:"Copy Command"}),n.jsx("button",{onClick:pt,disabled:ce,className:"flex-1 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:cursor-not-allowed rounded-md transition-colors flex items-center justify-center gap-2",children:ce?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),"Updating..."]}):"Update Now"})]})]})]})]})};return n.jsxs("div",{className:"fixed inset-0 flex bg-background",children:[!k&&n.jsx("div",{className:`h-full flex-shrink-0 border-r border-border bg-card transition-all duration-300 ${te?"w-80":"w-14"}`,children:n.jsx("div",{className:"h-full overflow-hidden",children:te?n.jsx(X0,{projects:c,selectedProject:u,selectedSession:h,onProjectSelect:qe,onSessionSelect:st,onNewSession:St,onSessionDelete:Oe,onProjectDelete:ie,isLoading:L,onRefresh:Qt,onShowSettings:()=>W(!0),updateAvailable:r,latestVersion:a,currentVersion:s,releaseInfo:i,onShowVersionModal:()=>l(!0),isPWA:bt,isMobile:k,onToggleSidebar:()=>Ce(!1)}):n.jsxs("div",{className:"h-full flex flex-col items-center py-4 gap-4",children:[n.jsx("button",{onClick:()=>Ce(!0),className:"p-2 hover:bg-accent rounded-md transition-colors duration-200 group","aria-label":"Show sidebar",title:"Show sidebar",children:n.jsx("svg",{className:"w-5 h-5 text-foreground group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:n.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})})}),n.jsx("button",{onClick:()=>W(!0),className:"p-2 hover:bg-accent rounded-md transition-colors duration-200","aria-label":"Settings",title:"Settings",children:n.jsx(Qn,{className:"w-5 h-5 text-muted-foreground hover:text-foreground transition-colors"})}),r&&n.jsxs("button",{onClick:()=>l(!0),className:"relative p-2 hover:bg-accent rounded-md transition-colors duration-200","aria-label":"Update available",title:"Update available",children:[n.jsx(Dn,{className:"w-5 h-5 text-blue-500"}),n.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 bg-blue-500 rounded-full animate-pulse"})]})]})})}),k&&n.jsxs("div",{className:`fixed inset-0 z-50 flex transition-all duration-150 ease-out ${j?"opacity-100 visible":"opacity-0 invisible"}`,children:[n.jsx("button",{className:"fixed inset-0 bg-background/80 backdrop-blur-sm transition-opacity duration-150 ease-out",onClick:ce=>{ce.stopPropagation(),N(!1)},onTouchStart:ce=>{ce.preventDefault(),ce.stopPropagation(),N(!1)},"aria-label":"Close sidebar"}),n.jsx("div",{className:`relative w-[85vw] max-w-sm sm:w-80 h-full bg-card border-r border-border transform transition-transform duration-150 ease-out ${j?"translate-x-0":"-translate-x-full"}`,onClick:ce=>ce.stopPropagation(),onTouchStart:ce=>ce.stopPropagation(),children:n.jsx(X0,{projects:c,selectedProject:u,selectedSession:h,onProjectSelect:qe,onSessionSelect:st,onNewSession:St,onSessionDelete:Oe,onProjectDelete:ie,isLoading:L,onRefresh:Qt,onShowSettings:()=>W(!0),updateAvailable:r,latestVersion:a,currentVersion:s,releaseInfo:i,onShowVersionModal:()=>l(!0),isPWA:bt,isMobile:k,onToggleSidebar:()=>Ce(!1)})})]}),n.jsx("div",{className:`flex-1 flex flex-col min-w-0 ${k&&!I?"pb-mobile-nav":""}`,children:n.jsx(L8,{selectedProject:u,selectedSession:h,activeTab:x,setActiveTab:y,ws:Ae,sendMessage:Be,messages:nt,isMobile:k,isPWA:bt,onMenuClick:()=>N(!0),isLoading:L,onInputFocusChange:H,onSessionActive:Se,onSessionInactive:B,onSessionProcessing:K,onSessionNotProcessing:ke,processingSessions:_e,onReplaceTemporarySession:We,onNavigateToSession:ce=>e(`/session/${ce}`),onShowSettings:()=>W(!0),autoExpandTools:T,showRawParameters:ne,showThinking:$,autoScrollToBottom:C,sendByCtrlEnter:xe,externalMessageUpdate:we})}),k&&n.jsx(P8,{activeTab:x,setActiveTab:y,isInputFocused:I}),x==="chat"&&n.jsx($8,{isOpen:O,onToggle:V,autoExpandTools:T,onAutoExpandChange:Y,showRawParameters:ne,onShowRawParametersChange:he,showThinking:$,onShowThinkingChange:J,autoScrollToBottom:C,onAutoScrollChange:ue,sendByCtrlEnter:xe,onSendByCtrlEnterChange:A,isMobile:k}),n.jsx(B8,{isOpen:F,onClose:()=>W(!1),projects:c,initialTab:M}),n.jsx(Ge,{})]})}function W8(){return n.jsx(R8,{children:n.jsx(Nx,{children:n.jsx(Cx,{children:n.jsx(Ax,{children:n.jsx(Mx,{children:n.jsx(U8,{children:n.jsx(Bf,{children:n.jsxs(Of,{children:[n.jsx(P0,{path:"/",element:n.jsx(vu,{})}),n.jsx(P0,{path:"/session/:sessionId",element:n.jsx(vu,{})})]})})})})})})})})}"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(e=>{e.forEach(t=>{t.unregister()})}).catch(e=>{console.warn("Failed to unregister service workers:",e)});Kf.createRoot(document.getElementById("root")).render(n.jsx(Jr.StrictMode,{children:n.jsx(W8,{})}));
|