@muyichengshayu/promptx 0.1.21 → 0.1.23
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/CHANGELOG.md +14 -0
- package/apps/server/src/repository.js +54 -1
- package/apps/server/src/taskRoutes.js +6 -4
- package/apps/web/dist/assets/CodexSessionManagerDialog-Ct3Z8yNx.js +6 -0
- package/apps/web/dist/assets/TaskDiffReviewDialog-BaW1jx72.js +12 -0
- package/apps/web/dist/assets/WorkbenchSettingsDialog-fei-ilUn.js +26 -0
- package/apps/web/dist/assets/WorkbenchView-B31NAx9n.js +236 -0
- package/apps/web/dist/assets/{index-Dd5oL2Cq.css → index-SlXaI2eN.css} +1 -1
- package/apps/web/dist/assets/{index-CPEYh7Do.js → index-w7ugR3S2.js} +6 -6
- package/apps/web/dist/index.html +2 -2
- package/package.json +1 -1
- package/apps/web/dist/assets/CodexSessionManagerDialog-4PTYEnnh.js +0 -1
- package/apps/web/dist/assets/TaskDiffReviewDialog-DJeBWA9i.js +0 -12
- package/apps/web/dist/assets/WorkbenchSettingsDialog-D_Lykg61.js +0 -26
- package/apps/web/dist/assets/WorkbenchView-C2MWZt4p.js +0 -236
- package/apps/web/dist/assets/info-DUErgVjs.js +0 -6
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodexSessionManagerDialog-Ct3Z8yNx.js","assets/index-w7ugR3S2.js","assets/index-SlXaI2eN.css","assets/TaskDiffReviewDialog-BaW1jx72.js","assets/WorkbenchSettingsDialog-fei-ilUn.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{h as oo,w as De,o as kt,a as C,c as Ee,b as le,d as Ye,e as B,f as Ze,n as Se,g as h,r as Gt,u as c,i as we,T as $r,j as Ju,t as A,k as de,l as _t,F as mt,m as It,p as ju,q as pu,s as du,v as wn,x as U,y as $e,z as ze,A as Qt,B as cn,C as No,D as $n,E as Mr,G as Mn,H as Is,I as ro,_ as so,J as zu,K as Fs,L as $s,M as iu,N as au,O as Oo}from"./index-w7ugR3S2.js";/**
|
|
3
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const Ms=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
8
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/const zo=e=>e==="";/**
|
|
13
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/const Ps=(...e)=>e.filter((t,u,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===u).join(" ").trim();/**
|
|
18
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
19
|
+
*
|
|
20
|
+
* This source code is licensed under the ISC license.
|
|
21
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
+
*/const qo=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
23
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/const Bs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,u,n)=>n?n.toUpperCase():u.toLowerCase());/**
|
|
28
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the ISC license.
|
|
31
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/const Rs=e=>{const t=Bs(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
33
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the ISC license.
|
|
36
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/var Lu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
38
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the ISC license.
|
|
41
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/const Ls=({name:e,iconNode:t,absoluteStrokeWidth:u,"absolute-stroke-width":n,strokeWidth:r,"stroke-width":o,size:i=Lu.width,color:s=Lu.stroke,...a},{slots:l})=>oo("svg",{...Lu,...a,width:i,height:i,stroke:s,"stroke-width":zo(u)||zo(n)||u===!0||n===!0?Number(r||o||Lu["stroke-width"])*24/Number(i):r||o||Lu["stroke-width"],class:Ps("lucide",a.class,...e?[`lucide-${qo(Rs(e))}-icon`,`lucide-${qo(e)}`]:["lucide-icon"]),...!l.default&&!Ms(a)&&{"aria-hidden":"true"}},[...t.map(d=>oo(...d)),...l.default?[l.default()]:[]]);/**
|
|
43
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the ISC license.
|
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/const Pe=(e,t)=>(u,{slots:n,attrs:r})=>oo(Ls,{...r,...u,iconNode:t,name:e},n);/**
|
|
48
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
49
|
+
*
|
|
50
|
+
* This source code is licensed under the ISC license.
|
|
51
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
+
*/const Ns=Pe("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
53
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the ISC license.
|
|
56
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/const Os=Pe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
58
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
59
|
+
*
|
|
60
|
+
* This source code is licensed under the ISC license.
|
|
61
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
+
*/const zs=Pe("arrow-up-left",[["path",{d:"M7 17V7h10",key:"11bw93"}],["path",{d:"M17 17 7 7",key:"2786uv"}]]);/**
|
|
63
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
64
|
+
*
|
|
65
|
+
* This source code is licensed under the ISC license.
|
|
66
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
+
*/const jo=Pe("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
|
|
68
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/const qs=Pe("blocks",[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]]);/**
|
|
73
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/const js=Pe("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
78
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/const Uu=Pe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
83
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const Us=Pe("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
88
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/const jn=Pe("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
93
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const ko=Pe("circle-alert",[["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"}]]);/**
|
|
98
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const Vs=Pe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
103
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const Hs=Pe("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
|
|
108
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const Ws=Pe("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
113
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const Tn=Pe("clock-3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]);/**
|
|
118
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const Uo=Pe("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);/**
|
|
123
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const io=Pe("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
128
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const Un=Pe("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);/**
|
|
133
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const dn=Pe("folder-open",[["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"}]]);/**
|
|
138
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const _o=Pe("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
|
143
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const Ks=Pe("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
148
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const qt=Pe("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
153
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const Pr=Pe("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);/**
|
|
158
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const Hu=Pe("pencil-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["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"}]]);/**
|
|
163
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const Br=Pe("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
168
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const Gs=Pe("save",[["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"}]]);/**
|
|
173
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const Zs=Pe("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);/**
|
|
178
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const Xs=Pe("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
|
|
183
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const Ys=Pe("settings-2",[["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"}]]);/**
|
|
188
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const Vu=Pe("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
|
|
193
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const Js=Pe("triangle-alert",[["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"}]]);/**
|
|
198
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const Qs=Pe("upload",[["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"}]]);/**
|
|
203
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const ei=Pe("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
|
|
208
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const Rr=Pe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ti={class:"min-w-0 flex-1"},ui={key:0,class:"flex items-center gap-2"},ni=["disabled"],So={__name:"DialogShell",props:{open:{type:Boolean,default:!1},backdropClass:{type:String,default:"z-50 items-end justify-center px-0 py-0 sm:items-center sm:px-4 sm:py-6"},panelClass:{type:String,default:""},headerClass:{type:String,default:"px-4 py-4 sm:px-5"},bodyClass:{type:String,default:"min-h-0 flex-1"},showClose:{type:Boolean,default:!0},closeDisabled:{type:Boolean,default:!1},closeOnBackdrop:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},lockBodyScroll:{type:Boolean,default:!0}},emits:["close"],setup(e,{emit:t}){const u=e,n=t;function r(){u.closeDisabled||n("close")}function o(){!u.closeOnBackdrop||u.closeDisabled||n("close")}function i(s){!u.open||!u.closeOnEscape||u.closeDisabled||s.key==="Escape"&&n("close")}return De(()=>u.open,s=>{if(u.lockBodyScroll&&document.body.classList.toggle("overflow-hidden",s),s&&u.closeOnEscape){window.addEventListener("keydown",i);return}window.removeEventListener("keydown",i)},{immediate:!0}),kt(()=>{u.lockBodyScroll&&document.body.classList.remove("overflow-hidden"),window.removeEventListener("keydown",i)}),(s,a)=>(C(),Ee(Ju,{to:"body"},[le($r,{name:"dialog-shell"},{default:Ye(()=>[e.open?(C(),B("div",{key:0,class:Se(["theme-modal-backdrop dialog-shell-backdrop fixed inset-0 flex",e.backdropClass]),onClick:Ze(o,["self"])},[h("section",{class:Se(["panel dialog-shell-panel flex min-h-0 w-full flex-col overflow-hidden",e.panelClass])},[s.$slots.title||s.$slots.header||s.$slots["header-actions"]||e.showClose?(C(),B("div",{key:0,class:Se(["theme-divider flex items-start justify-between gap-4 border-b",e.headerClass])},[h("div",ti,[Gt(s.$slots,"header",{},()=>[Gt(s.$slots,"title")])]),s.$slots["header-actions"]||e.showClose?(C(),B("div",ui,[Gt(s.$slots,"header-actions"),e.showClose?(C(),B("button",{key:0,type:"button",class:"theme-icon-button h-8 w-8 shrink-0",disabled:e.closeDisabled,onClick:r},[le(c(Rr),{class:"h-4 w-4"})],8,ni)):we("",!0)])):we("",!0)],2)):we("",!0),h("div",{class:Se(e.bodyClass)},[Gt(s.$slots,"default")],2)],2)],2)):we("",!0)]),_:3})]))}},oi={class:"flex items-start gap-3"},ri={class:"theme-heading text-base font-semibold"},si={key:0,class:"theme-muted-text mt-1 text-sm leading-6"},ii={class:"flex justify-end gap-2 px-5 py-4"},ai=["disabled"],li=["disabled"],fn={__name:"ConfirmDialog",props:{open:{type:Boolean,default:!1},title:{type:String,default:""},description:{type:String,default:""},confirmText:{type:String,default:""},cancelText:{type:String,default:""},loading:{type:Boolean,default:!1},danger:{type:Boolean,default:!1}},emits:["cancel","confirm"],setup(e,{emit:t}){const u=e,n=t,{t:r}=_t(),o=de(()=>u.title||r("common.confirm")),i=de(()=>u.confirmText||r("common.confirm")),s=de(()=>u.cancelText||r("common.cancel"));return(a,l)=>(C(),Ee(So,{open:e.open,"backdrop-class":"z-[90] items-end justify-center px-0 py-0 sm:items-center sm:px-4 sm:py-6","panel-class":"max-w-md","header-class":"px-5 py-4","body-class":"flex flex-col","close-disabled":e.loading,"close-on-backdrop":!e.loading,"close-on-escape":!e.loading,onClose:l[2]||(l[2]=d=>n("cancel"))},{title:Ye(()=>[h("div",oi,[h("span",{class:Se(["inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-sm border border-dashed",e.danger?"theme-status-danger":"theme-status-neutral"])},[le(c(Js),{class:"h-4 w-4"})],2),h("div",null,[h("h2",ri,A(o.value),1),e.description?(C(),B("p",si,A(e.description),1)):we("",!0)])])]),default:Ye(()=>[h("div",ii,[h("button",{type:"button",class:"tool-button px-4 py-2 text-sm",disabled:e.loading,onClick:l[0]||(l[0]=d=>n("cancel"))},A(s.value),9,ai),h("button",{type:"button",class:Se(["tool-button px-4 py-2 text-sm",e.danger?"tool-button-danger":"tool-button-primary"]),disabled:e.loading,onClick:l[1]||(l[1]=d=>n("confirm"))},A(e.loading?c(r)("common.processing"):i.value),11,li)])]),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"]))}},Ht={NONE:"none",LATEST:"latest",ALL:"all"};function ci(e="",t={}){const u=String(e||"").trim().toLowerCase();return u===Ht.ALL?Ht.ALL:u===Ht.LATEST?Ht.LATEST:u===Ht.NONE?Ht.NONE:t.includeEvents?Ht.ALL:t.includeLatestEvents?Ht.LATEST:Ht.NONE}const Tt={SESSION:"session",SESSION_UPDATED:"session.updated",STATUS:"status",STDOUT:"stdout",STDERR:"stderr",AGENT_EVENT:"agent_event",COMPLETED:"completed",STOPPED:"stopped",ERROR:"error"};function Lr(e=""){const t=String(e||"").trim().toLowerCase();return t==="codex"?Tt.AGENT_EVENT:t}const Qe={THREAD_STARTED:"thread.started",TURN_STARTED:"turn.started",TURN_COMPLETED:"turn.completed",TURN_FAILED:"turn.failed",ERROR:"error",ITEM_STARTED:"item.started",ITEM_UPDATED:"item.updated",ITEM_COMPLETED:"item.completed"},qe={REASONING:"reasoning",WEB_SEARCH:"web_search",COLLAB_TOOL_CALL:"collab_tool_call",FILE_CHANGE:"file_change",COMMAND_EXECUTION:"command_execution",TODO_LIST:"todo_list",AGENT_MESSAGE:"agent_message"},di={none:{label:"不过期",hours:null}};Object.entries(di).map(([e,t])=>({value:e,label:t.label}));const xn={CODEX:"codex",CLAUDE_CODE:"claude-code",OPENCODE:"opencode"},Nr=[{value:xn.CODEX,label:"Codex",enabled:!0},{value:xn.CLAUDE_CODE,label:"Claude Code",enabled:!0},{value:xn.OPENCODE,label:"OpenCode",enabled:!0}],Oe={TEXT:"text",IMAGE:"image",IMPORTED_TEXT:"imported_text"};Oe.TEXT+"",Oe.IMAGE+"",Oe.IMPORTED_TEXT+"";const fi=[{value:"local",label:"跟随本机时区"}],pi={SKIP:"skip"},hi=[{value:pi.SKIP,label:"已有运行时跳过本次"}],Vn={DINGTALK:"dingtalk",FEISHU:"feishu",WEBHOOK:"webhook"},mi=[{value:Vn.DINGTALK,label:"钉钉 Webhook"},{value:Vn.FEISHU,label:"飞书 Webhook"},{value:Vn.WEBHOOK,label:"通用 Webhook"}],Hn={COMPLETED:"completed",SUCCESS:"success",ERROR:"error"},gi=[{value:Hn.COMPLETED,label:"本次运行结束后"},{value:Hn.SUCCESS,label:"本次运行成功后"},{value:Hn.ERROR,label:"本次运行失败后"}],bi={SUMMARY:"summary"},xi=[{value:bi.SUMMARY,label:"摘要消息"}],Vo={ZH_CN:"zh-CN",EN_US:"en-US"},vi=[{value:Vo.ZH_CN,label:"简体中文"},{value:Vo.EN_US,label:"English"}];function Or(e){var u;const t=String(e||"").trim().toLowerCase();return((u=Nr.find(n=>n.value===t))==null?void 0:u.value)||xn.CODEX}function Ge(e){var t;return((t=Nr.find(u=>u.value===Or(e)))==null?void 0:t.label)||"Codex"}function yi(e=[],t=10){const u=e.find(n=>{var r;return(n.type===Oe.TEXT||n.type===Oe.IMPORTED_TEXT)&&((r=n.content)==null?void 0:r.trim())});return u?u.content.replace(/\s+/g," ").trim().slice(0,t):""}const ki={class:"theme-divider settings-dialog-nav border-b px-3 py-3 sm:w-60 sm:shrink-0 sm:border-b-0 sm:border-r sm:px-4 sm:py-4"},_i={class:"settings-nav flex gap-2 overflow-x-auto sm:flex-col sm:overflow-visible"},Si=["onClick"],wi={class:"min-w-0"},Ti={class:"text-sm font-medium"},Ci={class:"theme-muted-text mt-1 hidden text-xs leading-5 sm:block"},Ei={__name:"DialogSideNav",props:{modelValue:{type:String,default:""},sections:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:t}){const u=t;function n(r=""){u("update:modelValue",String(r||""))}return(r,o)=>(C(),B("aside",ki,[h("nav",_i,[(C(!0),B(mt,null,It(e.sections,i=>(C(),B("button",{key:i.id,type:"button",class:Se(["settings-nav__item flex min-w-0 items-start gap-3 rounded-sm border px-3 py-3 text-left transition sm:w-full",e.modelValue===i.id?"theme-card-selected":"theme-card-idle-muted border-dashed hover:border-[var(--theme-borderStrong)] hover:bg-[var(--theme-appPanelStrong)]"]),onClick:s=>n(i.id)},[(C(),Ee(ju(i.icon),{class:"mt-0.5 h-4 w-4 shrink-0"})),h("div",wi,[h("div",Ti,A(i.label),1),h("p",Ci,A(i.description),1)])],10,Si))),128))])]))}},Ai=["disabled","onKeydown"],Di={class:"min-w-0 flex-1"},Ii={class:"theme-muted-text text-sm"},Fi={class:"flex min-h-0 w-full flex-col"},$i={class:"min-h-0 flex-1 space-y-2 overflow-y-auto p-2"},Mi=["onClick"],Pi={class:"theme-empty-state px-3 py-4 text-sm"},Kt={__name:"WorkbenchSelect",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:""},emptyText:{type:String,default:""},getOptionValue:{type:Function,default:e=>(e==null?void 0:e.id)??(e==null?void 0:e.value)??""},triggerClass:{type:String,default:""}},emits:["update:modelValue","refresh-intent"],setup(e,{emit:t}){const u=e,n=t,{t:r}=_t(),o=U(null),i=U(null),s=U(!1),a=U(!1),l=U({}),d=de(()=>{const $=String(u.modelValue??"");return u.options.find(Z=>String(u.getOptionValue(Z)??"")===$)||null}),p=de(()=>u.placeholder||r("common.select")),m=de(()=>u.emptyText||r("common.noOptions"));function _($){return $&&typeof $=="object"&&Object.prototype.hasOwnProperty.call($,"label")?String($.label||""):String(u.getOptionValue($)??"")}function b(){u.disabled||(s.value||n("refresh-intent"),s.value=!0)}function E(){s.value=!1}function j(){if(s.value){E();return}b()}function y($){n("update:modelValue",String(u.getOptionValue($)??"").trim()),E()}function x(){if(!s.value||!o.value||typeof window>"u")return;const $=o.value.getBoundingClientRect(),Z=window.innerWidth,w=window.innerHeight,J=8,Q=8,R=160,q=360,ne=Math.max(0,w-$.bottom-Q),re=Math.max(0,$.top-Q);a.value=ne<260&&re>ne;const be=a.value?re-J:ne-J,ce=Math.max(Math.min(q,Math.max(be,0)),Math.min(R,a.value?re:ne)),O=Math.min($.width,Z-Q*2),K=Math.min(Math.max(Q,$.left),Math.max(Q,Z-Q-O));l.value={left:`${K}px`,top:a.value?`${$.top-J}px`:`${$.bottom+J}px`,width:`${O}px`,maxHeight:`${Math.max(ce,120)}px`,transform:a.value?"translateY(-100%)":"none"}}function D($){var Z;!s.value||!o.value||o.value.contains($.target)||(Z=i.value)!=null&&Z.contains($.target)||E()}function P($){$.key==="Escape"&&E()}return De(()=>u.disabled,$=>{$&&E()}),De(s,async $=>{$&&(await $e(),x())}),pu(()=>{document.addEventListener("pointerdown",D),document.addEventListener("keydown",P),window.addEventListener("resize",x),window.addEventListener("scroll",x,!0)}),kt(()=>{document.removeEventListener("pointerdown",D),document.removeEventListener("keydown",P),window.removeEventListener("resize",x),window.removeEventListener("scroll",x,!0)}),($,Z)=>(C(),B("div",{ref_key:"rootRef",ref:o,class:"relative min-w-0"},[h("button",{type:"button",class:Se(["workbench-select-trigger flex w-full items-center gap-3 rounded-sm border px-3 py-2 text-left transition focus:outline-none focus:ring-2",[u.triggerClass,e.disabled?"cursor-not-allowed border-[color-mix(in_srgb,var(--theme-borderDefault)_88%,var(--theme-textMuted))] bg-[color-mix(in_srgb,var(--theme-appPanelMuted)_82%,var(--theme-appBg))] text-[var(--theme-textMuted)]":"theme-input-shell text-[var(--theme-textPrimary)] hover:border-[var(--theme-borderStrong)] focus:border-[var(--theme-borderStrong)] focus:ring-[var(--theme-focusRing)]"]]),disabled:e.disabled,onClick:j,onKeydown:[du(Ze(b,["prevent"]),["down"]),du(Ze(j,["prevent"]),["enter"]),du(Ze(j,["prevent"]),["space"])]},[h("div",Di,[Gt($.$slots,"trigger",{selectedOption:d.value,open:s.value,loading:e.loading,disabled:e.disabled},()=>[h("div",Ii,A(d.value?_(d.value):p.value),1)])]),h("div",{class:Se(["flex shrink-0 items-center gap-2",e.disabled?"text-[var(--theme-textMuted)] opacity-80":"theme-muted-text"])},[e.loading?(C(),Ee(c(qt),{key:0,class:"h-4 w-4 animate-spin"})):we("",!0),le(c(Uu),{class:Se(["h-4 w-4 transition",s.value?"rotate-180":""])},null,8,["class"])],2)],42,Ai),(C(),Ee(Ju,{to:"body"},[s.value?(C(),B("div",{key:0,ref_key:"panelRef",ref:i,class:"workbench-select-panel theme-popover fixed z-[90] flex overflow-hidden rounded-sm border",style:wn(l.value)},[h("div",Fi,[Gt($.$slots,"header",{loading:e.loading,options:e.options}),h("div",$i,[e.options.length?(C(!0),B(mt,{key:0},It(e.options,w=>Gt($.$slots,"option",{key:String(e.getOptionValue(w)??""),option:w,selected:String(e.getOptionValue(w)??"")===String(e.modelValue??""),select:()=>y(w)},()=>[h("button",{type:"button",class:"workbench-select-option theme-filter-idle w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm",onClick:J=>y(w)},A(_(w)),9,Mi)])),128)):Gt($.$slots,"empty",{key:1},()=>[h("div",Pi,A(m.value),1)])])])],4)):we("",!0)]))],512))}},Ho={},zr=typeof import.meta<"u"&&Ho?Ho:{};function Bi(){if(typeof window>"u")return"http://localhost:3000";const e=new URL(window.location.origin),t=String(zr.VITE_API_PORT||"").trim();if(t)return e.port=t,e.toString().replace(/\/$/,"");const u=String(e.port||"");return new Set(["4173","5173","5174"]).has(u)?(e.port="3000",e.toString().replace(/\/$/,"")):e.toString().replace(/\/$/,"")}const wo=(zr.VITE_API_BASE_URL||Bi()).replace(/\/$/,"");function To(e={},t="errors.requestFailed"){const u=String((e==null?void 0:e.messageKey)||"").trim();if(u){const n=ze(u);if(n&&n!==u)return n}return(e==null?void 0:e.message)||ze(t)}async function Ve(e,t={}){const u=typeof t.body<"u"&&!(t.body instanceof FormData),n=await fetch(`${wo}${e}`,{headers:{...u?{"Content-Type":"application/json"}:{},...t.headers||{}},...t});if(!n.ok){const o=await n.json().catch(()=>({}));throw new Error(To(o))}return n.status===204?null:(n.headers.get("content-type")||"").includes("application/json")?n.json():n.text()}function Co(){return wo}function vn(e){return e?e.startsWith("http")?e:`${wo}${e}`:""}function gm(){return Ve("/api/meta",{cache:"no-store"})}function Ri(){return Ve("/api/tasks")}function Li(e=30){const t=new URLSearchParams,u=Math.max(1,Number(e)||30);return t.set("limit",String(u)),Ve(`/api/tasks/workspace-diff-summaries?${t.toString()}`,{cache:"no-store"})}function Ni(e){return Ve("/api/tasks",{method:"POST",body:JSON.stringify(e)})}function qr(e){return Ve(`/api/tasks/${e}`)}function jr(e,t){return Ve(`/api/tasks/${e}`,{method:"PUT",body:JSON.stringify(t)})}function Oi(e){return Ve(`/api/tasks/${e}`,{method:"DELETE"})}const Ur=Co();async function zi(e){const t=new FormData;t.append("file",e);const u=await fetch(`${Ur}/api/uploads`,{method:"POST",body:t});if(!u.ok){const n=await u.json().catch(()=>({}));throw new Error(To(n,"errors.uploadFailed"))}return u.json()}async function qi(e){const t=new FormData;t.append("file",e);const u=await fetch(`${Ur}/api/imports/pdf`,{method:"POST",body:t});if(!u.ok){const n=await u.json().catch(()=>({}));throw new Error(To(n,"errors.pdfImportFailed"))}return u.json()}function ji(){return Ve("/api/codex/sessions")}function Ui(e={}){const t=new URLSearchParams,u=String(e.engine||"").trim();u&&t.set("engine",u);const n=t.toString();return Ve(`/api/codex/workspaces${n?`?${n}`:""}`)}function bm(e={}){const t=new URLSearchParams,u=String(e.path||"").trim(),n=Number(e.limit||0);u&&t.set("path",u),Number.isFinite(n)&&n>0&&t.set("limit",String(n));const r=t.toString();return Ve(`/api/codex/directories/tree${r?`?${r}`:""}`,{cache:"no-store"})}function xm(e,t={}){const u=new URLSearchParams,n=String(e||"").trim(),r=String(t.path||"").trim(),o=Number(t.limit||0);n&&u.set("q",n),r&&u.set("path",r),Number.isFinite(o)&&o>0&&u.set("limit",String(o));const i=u.toString();return Ve(`/api/codex/directories/search${i?`?${i}`:""}`,{cache:"no-store"})}function Vi(e){return Ve("/api/codex/sessions",{method:"POST",body:JSON.stringify(e)})}function Hi(e,t){return Ve(`/api/codex/sessions/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}function Wi(e){return Ve(`/api/codex/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}function Ki(e,t={}){const u=new URLSearchParams,n=String(t.path||"").trim(),r=String(t.refreshToken||"").trim();n&&u.set("path",n),r&&u.set("_",r);const o=u.toString();return Ve(`/api/codex/sessions/${encodeURIComponent(e)}/files/tree${o?`?${o}`:""}`,{cache:"no-store"})}function Gi(e,t,u={}){const n=new URLSearchParams,r=String(t||"").trim(),o=Number(u.limit||60),i=String(u.refreshToken||"").trim();r&&n.set("q",r),Number.isFinite(o)&&o>0&&n.set("limit",String(o)),i&&n.set("_",i);const s=n.toString();return Ve(`/api/codex/sessions/${encodeURIComponent(e)}/files/search${s?`?${s}`:""}`,{cache:"no-store"})}function Zi(e,t){return Ve(`/api/tasks/${encodeURIComponent(e)}/codex-session`,{method:"POST",body:JSON.stringify({sessionId:t})})}function Xi(e,t={}){const u=new URLSearchParams,n=Number(t.limit||20),r=ci(t.events,t);Number.isFinite(n)&&n>0&&u.set("limit",String(n)),u.set("events",r);const o=u.toString();return Ve(`/api/tasks/${encodeURIComponent(e)}/codex-runs${o?`?${o}`:""}`,{cache:"no-store"})}function Yi(e,t={}){const u=new URLSearchParams,n=Math.max(0,Number(t.afterSeq)||0),r=Math.max(1,Number(t.limit)||5e3);n>0&&u.set("afterSeq",String(n)),r>0&&u.set("limit",String(r));const o=u.toString();return Ve(`/api/codex/runs/${encodeURIComponent(e)}/events${o?`?${o}`:""}`,{cache:"no-store"})}function vm(e,t={}){const u=new URLSearchParams,n=String(t.scope||"workspace").trim(),r=String(t.runId||"").trim(),o=String(t.filePath||"").trim(),i=t.includeFiles!==!1,s=t.includeStats!==!1;n==="run"?u.set("scope","run"):n==="task"?u.set("scope","task"):u.set("scope","workspace"),r&&u.set("runId",r),o&&u.set("filePath",o),i||u.set("includeFiles","false"),s||u.set("includeStats","false");const a=u.toString();return Ve(`/api/tasks/${encodeURIComponent(e)}/git-diff${a?`?${a}`:""}`,{cache:"no-store"})}function Ji(e,t){return Ve(`/api/tasks/${encodeURIComponent(e)}/codex-runs`,{method:"POST",body:JSON.stringify(t)})}function Qi(e){return Ve(`/api/tasks/${encodeURIComponent(e)}/codex-runs`,{method:"DELETE"})}function ea(e){return Ve(`/api/codex/runs/${encodeURIComponent(e)}/stop`,{method:"POST"})}const ta={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},ua={class:"theme-muted-text mt-1 text-xs"},na={class:"settings-dialog-content min-h-0 flex-1 overflow-y-auto px-5 py-5"},oa={key:0,class:"theme-muted-text flex items-center gap-2 py-4 text-sm"},ra={key:1,class:"space-y-4"},sa={key:0,class:"space-y-4"},ia={class:"theme-heading text-base font-medium"},aa={class:"theme-muted-text mt-1 text-xs leading-5"},la={class:"settings-section-card px-4 py-4"},ca={class:"block space-y-1.5"},da={class:"theme-muted-text text-xs"},fa=["placeholder"],pa={key:1,class:"space-y-4"},ha={class:"flex items-start justify-between gap-3"},ma={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},ga={class:"theme-muted-text mt-1 text-xs leading-5"},ba={class:"inline-flex items-center gap-2 text-sm text-[var(--theme-textPrimary)]"},xa={class:"settings-section-card px-4 py-4"},va={class:"grid gap-4 sm:grid-cols-2"},ya={class:"space-y-1.5 sm:col-span-2"},ka={class:"theme-muted-text text-xs"},_a={class:"truncate text-sm text-[var(--theme-textPrimary)]"},Sa={class:"space-y-1.5"},wa={class:"theme-muted-text text-xs"},Ta=["disabled"],Ca={key:0,class:"space-y-1.5"},Ea={class:"theme-muted-text text-xs"},Aa={class:"truncate text-sm text-[var(--theme-textPrimary)]"},Da={class:"space-y-1.5"},Ia={class:"theme-muted-text text-xs"},Fa={class:"truncate text-sm text-[var(--theme-textPrimary)]"},$a={class:"theme-muted-text text-xs"},Ma={class:"truncate text-sm text-[var(--theme-textPrimary)]"},Pa={class:"theme-muted-text mt-3 space-y-1 text-xs leading-6"},Ba={key:2,class:"space-y-4"},Ra={class:"flex items-start justify-between gap-3"},La={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},Na={class:"theme-muted-text mt-1 text-xs leading-5"},Oa={class:"inline-flex items-center gap-2 text-sm text-[var(--theme-textPrimary)]"},za={class:"settings-section-card px-4 py-4"},qa={class:"grid gap-4 sm:grid-cols-2"},ja={class:"space-y-1.5"},Ua={class:"theme-muted-text text-xs"},Va={class:"truncate text-sm text-[var(--theme-textPrimary)]"},Ha={class:"space-y-1.5"},Wa={class:"theme-muted-text text-xs"},Ka={class:"truncate text-sm text-[var(--theme-textPrimary)]"},Ga={class:"space-y-1.5 sm:col-span-2"},Za={class:"theme-muted-text text-xs"},Xa=["placeholder","disabled"],Ya={class:"space-y-1.5"},Ja={class:"theme-muted-text text-xs"},Qa=["placeholder","disabled"],el={class:"space-y-1.5"},tl={class:"theme-muted-text text-xs"},ul={class:"truncate text-sm text-[var(--theme-textPrimary)]"},nl={class:"space-y-1.5"},ol={class:"theme-muted-text text-xs"},rl={class:"truncate text-sm text-[var(--theme-textPrimary)]"},sl={class:"theme-muted-text mt-3 space-y-1 text-xs leading-6"},il={key:0,class:"theme-danger-text"},al={key:3,class:"theme-danger-text text-sm"},ll={class:"theme-divider flex flex-col gap-3 border-t px-5 py-4 sm:flex-row sm:items-center sm:justify-between"},cl={class:"theme-muted-text theme-note-text"},dl={class:"flex items-center justify-end gap-2"},fl=["disabled"],pl=["disabled"],hl="0 9 * * 1-5",Wn="weekdays",Nu="09:00",yu="1",ml={__name:"EditTaskDialog",props:{open:{type:Boolean,default:!1},taskSlug:{type:String,default:""},taskTitle:{type:String,default:""}},emits:["close","saved"],setup(e,{emit:t}){const u=e,n=t,{locale:r,t:o}=_t(),i=U(!1),s=U(!1),a=U(""),l=U("basic"),d=$n({title:"",automationEnabled:!1,automationMode:Wn,automationTime:Nu,automationWeekday:yu,automationTimezone:"local",automationConcurrencyPolicy:"skip",automationLastTriggeredAt:"",automationNextTriggerAt:"",notificationEnabled:!1,notificationChannelType:"dingtalk",notificationWebhookUrl:"",notificationSecret:"",notificationTriggerOn:"completed",notificationLocale:"zh-CN",notificationMessageMode:"summary",notificationLastStatus:"",notificationLastError:"",notificationLastSentAt:""}),p=de(()=>String(u.taskTitle||"").trim()||o("workbench.untitledTask")),m=de(()=>[{id:"basic",label:o("taskDialog.sections.basic.label"),description:o("taskDialog.sections.basic.description"),icon:Hu},{id:"automation",label:o("taskDialog.sections.automation.label"),description:o("taskDialog.sections.automation.description"),icon:Tn},{id:"notification",label:o("taskDialog.sections.notification.label"),description:o("taskDialog.sections.notification.description"),icon:jo}]),_=de(()=>[{value:"daily",label:o("taskDialog.sections.automation.modeDaily")},{value:"weekdays",label:o("taskDialog.sections.automation.modeWeekdays")},{value:"weekly",label:o("taskDialog.sections.automation.modeWeekly")}]),b=de(()=>[{value:"1",label:o("taskDialog.sections.automation.weekday1")},{value:"2",label:o("taskDialog.sections.automation.weekday2")},{value:"3",label:o("taskDialog.sections.automation.weekday3")},{value:"4",label:o("taskDialog.sections.automation.weekday4")},{value:"5",label:o("taskDialog.sections.automation.weekday5")},{value:"6",label:o("taskDialog.sections.automation.weekday6")},{value:"0",label:o("taskDialog.sections.automation.weekday0")}]),E=de(()=>fi.map(O=>({...O,label:O.value==="local"?o("taskDialog.sections.automation.timezoneLocal"):O.label}))),j=de(()=>hi.map(O=>({...O,label:O.value==="skip"?o("taskDialog.sections.automation.concurrencySkip"):O.label}))),y=de(()=>mi.map(O=>({...O,label:O.value==="dingtalk"?o("taskDialog.sections.notification.channelDingtalk"):O.value==="feishu"?o("taskDialog.sections.notification.channelFeishu"):O.value==="webhook"?o("taskDialog.sections.notification.channelWebhook"):O.label}))),x=de(()=>gi.map(O=>({...O,label:O.value==="completed"?o("taskDialog.sections.notification.triggerCompleted"):O.value==="success"?o("taskDialog.sections.notification.triggerSuccess"):O.value==="error"?o("taskDialog.sections.notification.triggerError"):O.label}))),D=de(()=>xi.map(O=>({...O,label:O.value==="summary"?o("taskDialog.sections.notification.messageSummary"):O.label}))),P=de(()=>vi.map(O=>({...O,label:O.value==="zh-CN"?o("taskDialog.sections.notification.localeZhCn"):O.value==="en-US"?o("taskDialog.sections.notification.localeEnUs"):O.label}))),$=de(()=>d.notificationEnabled?d.notificationLastStatus==="success"?o("taskDialog.sections.notification.statusSuccess"):d.notificationLastStatus==="error"?o("taskDialog.sections.notification.statusError"):o("taskDialog.sections.notification.statusPending"):o("taskDialog.sections.notification.statusDisabled"));function Z(){d.title="",d.automationEnabled=!1,d.automationMode=Wn,d.automationTime=Nu,d.automationWeekday=yu,d.automationTimezone="local",d.automationConcurrencyPolicy="skip",d.automationLastTriggeredAt="",d.automationNextTriggerAt="",d.notificationEnabled=!1,d.notificationChannelType="dingtalk",d.notificationWebhookUrl="",d.notificationSecret="",d.notificationTriggerOn="completed",d.notificationLocale=String(r.value||"zh-CN"),d.notificationMessageMode="summary",d.notificationLastStatus="",d.notificationLastError="",d.notificationLastSentAt=""}function w(O=0){return String(O).padStart(2,"0")}function J(O=""){const K=String(O||"").trim().replace(/\s+/g," ");let F=K.match(/^(\d{1,2}) (\d{1,2}) \* \* 1-5$/);return F?{mode:"weekdays",time:`${w(F[2])}:${w(F[1])}`,weekday:yu}:(F=K.match(/^(\d{1,2}) (\d{1,2}) \* \* \*$/),F?{mode:"daily",time:`${w(F[2])}:${w(F[1])}`,weekday:yu}:(F=K.match(/^(\d{1,2}) (\d{1,2}) \* \* ([0-6])$/),F?{mode:"weekly",time:`${w(F[2])}:${w(F[1])}`,weekday:String(F[3])}:{mode:Wn,time:Nu,weekday:yu}))}function Q(O=""){const F=String(O||"").trim().match(/^(\d{1,2}):(\d{2})$/);if(!F)return Nu;const ye=Number(F[1]),V=Number(F[2]);return!Number.isInteger(ye)||!Number.isInteger(V)||ye<0||ye>23||V<0||V>59?Nu:`${w(ye)}:${w(V)}`}function R(){var he;const O=Q(d.automationTime),[K,F]=O.split(":"),ye=Number(K),V=Number(F);if(d.automationMode==="daily")return`${V} ${ye} * * *`;if(d.automationMode==="weekly"){const G=((he=b.value.find(X=>X.value===String(d.automationWeekday||"")))==null?void 0:he.value)||yu;return`${V} ${ye} * * ${G}`}return`${V} ${ye} * * 1-5`}function q(O={}){var F,ye,V,he,G,X,Y,ve,oe,ge,Te,Re,Me,xe,rt,et;d.title=String(O.title||""),d.automationEnabled=!!((F=O.automation)!=null&&F.enabled);const K=J(((ye=O.automation)==null?void 0:ye.cron)||hl);d.automationMode=K.mode,d.automationTime=K.time,d.automationWeekday=K.weekday,d.automationTimezone=String(((V=O.automation)==null?void 0:V.timezone)||"local"),d.automationConcurrencyPolicy=String(((he=O.automation)==null?void 0:he.concurrencyPolicy)||"skip"),d.automationLastTriggeredAt=String(((G=O.automation)==null?void 0:G.lastTriggeredAt)||""),d.automationNextTriggerAt=String(((X=O.automation)==null?void 0:X.nextTriggerAt)||""),d.notificationEnabled=!!((Y=O.notification)!=null&&Y.enabled),d.notificationChannelType=String(((ve=O.notification)==null?void 0:ve.channelType)||"dingtalk"),d.notificationWebhookUrl=String(((oe=O.notification)==null?void 0:oe.webhookUrl)||""),d.notificationSecret=String(((ge=O.notification)==null?void 0:ge.secret)||""),d.notificationTriggerOn=String(((Te=O.notification)==null?void 0:Te.triggerOn)||"completed"),d.notificationLocale=String(((Re=O.notification)==null?void 0:Re.locale)||r.value||"zh-CN"),d.notificationMessageMode=String(((Me=O.notification)==null?void 0:Me.messageMode)||"summary"),d.notificationLastStatus=String(((xe=O.notification)==null?void 0:xe.lastStatus)||""),d.notificationLastError=String(((rt=O.notification)==null?void 0:rt.lastError)||""),d.notificationLastSentAt=String(((et=O.notification)==null?void 0:et.lastSentAt)||"")}async function ne(){const O=String(u.taskSlug||"").trim();if(!O){Z();return}i.value=!0,a.value="";try{const K=await qr(O);q(K)}catch(K){a.value=(K==null?void 0:K.message)||o("taskDialog.loadFailed")}finally{i.value=!1}}function re(){return{title:d.title,automation:{enabled:d.automationEnabled,cron:R(),timezone:d.automationTimezone,concurrencyPolicy:d.automationConcurrencyPolicy},notification:{enabled:d.notificationEnabled,channelType:d.notificationChannelType,webhookUrl:d.notificationWebhookUrl,secret:d.notificationSecret,triggerOn:d.notificationTriggerOn,locale:d.notificationLocale,messageMode:d.notificationMessageMode}}}async function be(){const O=String(u.taskSlug||"").trim();if(!(!O||i.value||s.value)){s.value=!0,a.value="";try{const K=await jr(O,re());q(K),n("saved",K),n("close")}catch(K){a.value=(K==null?void 0:K.message)||o("taskDialog.saveFailed")}finally{s.value=!1}}}function ce(O=""){if(!O)return o("common.notAvailable");const K=new Date(O);return Number.isNaN(K.getTime())?o("common.notAvailable"):Mr(K.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return De(()=>u.open,O=>{if(O){l.value="basic",ne();return}},{immediate:!0}),De(()=>u.taskSlug,()=>{u.open&&ne()}),(O,K)=>(C(),Ee(So,{open:e.open,"backdrop-class":"z-[75] items-end justify-center px-0 py-0 sm:items-center sm:px-4 sm:py-6","panel-class":"settings-dialog-panel h-full max-w-5xl sm:h-[42rem] sm:max-h-[88vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body min-h-0 flex flex-1 flex-col sm:flex-row",onClose:K[16]||(K[16]=F=>n("close"))},{title:Ye(()=>[h("div",null,[h("div",ta,[le(c(Hu),{class:"h-4 w-4"}),h("span",null,A(c(o)("taskDialog.title")),1)]),h("p",ua,A(c(o)("taskDialog.currentTask",{title:p.value})),1)])]),default:Ye(()=>[le(Ei,{modelValue:l.value,"onUpdate:modelValue":K[0]||(K[0]=F=>l.value=F),sections:m.value},null,8,["modelValue","sections"]),h("div",na,[i.value?(C(),B("div",oa,[le(c(qt),{class:"h-4 w-4 animate-spin"}),h("span",null,A(c(o)("taskDialog.loading")),1)])):(C(),B("div",ra,[l.value==="basic"?(C(),B("section",sa,[h("div",null,[h("div",ia,A(c(o)("taskDialog.sections.basic.title")),1),h("p",aa,A(c(o)("taskDialog.sections.basic.intro")),1)]),h("section",la,[h("label",ca,[h("span",da,A(c(o)("taskDialog.sections.basic.taskTitle")),1),Qt(h("input",{"onUpdate:modelValue":K[1]||(K[1]=F=>d.title=F),type:"text",maxlength:"140",class:"tool-input",placeholder:c(o)("taskDialog.sections.basic.taskTitlePlaceholder")},null,8,fa),[[cn,d.title]])])])])):l.value==="automation"?(C(),B("section",pa,[h("div",ha,[h("div",null,[h("div",ma,[le(c(Tn),{class:"h-4 w-4"}),h("span",null,A(c(o)("taskDialog.sections.automation.title")),1)]),h("p",ga,A(c(o)("taskDialog.sections.automation.intro")),1)]),h("label",ba,[Qt(h("input",{"onUpdate:modelValue":K[2]||(K[2]=F=>d.automationEnabled=F),type:"checkbox",class:"h-4 w-4"},null,512),[[No,d.automationEnabled]]),h("span",null,A(c(o)("taskDialog.enabled")),1)])]),h("section",xa,[h("div",va,[h("label",ya,[h("span",ka,A(c(o)("taskDialog.sections.automation.mode")),1),le(Kt,{modelValue:d.automationMode,"onUpdate:modelValue":K[3]||(K[3]=F=>d.automationMode=F),options:_.value,disabled:!d.automationEnabled,"get-option-value":F=>F.value},{trigger:Ye(({selectedOption:F})=>[h("div",_a,A((F==null?void 0:F.label)||c(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),h("label",Sa,[h("span",wa,A(c(o)("taskDialog.sections.automation.time")),1),Qt(h("input",{"onUpdate:modelValue":K[4]||(K[4]=F=>d.automationTime=F),type:"time",class:"tool-input",disabled:!d.automationEnabled},null,8,Ta),[[cn,d.automationTime]])]),d.automationMode==="weekly"?(C(),B("label",Ca,[h("span",Ea,A(c(o)("taskDialog.sections.automation.weekday")),1),le(Kt,{modelValue:d.automationWeekday,"onUpdate:modelValue":K[5]||(K[5]=F=>d.automationWeekday=F),options:b.value,disabled:!d.automationEnabled,"get-option-value":F=>F.value},{trigger:Ye(({selectedOption:F})=>[h("div",Aa,A((F==null?void 0:F.label)||c(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])])):we("",!0),h("label",Da,[h("span",Ia,A(c(o)("taskDialog.sections.automation.timezone")),1),le(Kt,{modelValue:d.automationTimezone,"onUpdate:modelValue":K[6]||(K[6]=F=>d.automationTimezone=F),options:E.value,disabled:!d.automationEnabled,"get-option-value":F=>F.value},{trigger:Ye(({selectedOption:F})=>[h("div",Fa,A((F==null?void 0:F.label)||c(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),h("label",{class:Se(["space-y-1.5",d.automationMode==="weekly"?"":"sm:col-span-2"])},[h("span",$a,A(c(o)("taskDialog.sections.automation.concurrencyPolicy")),1),le(Kt,{modelValue:d.automationConcurrencyPolicy,"onUpdate:modelValue":K[7]||(K[7]=F=>d.automationConcurrencyPolicy=F),options:j.value,disabled:!d.automationEnabled,"get-option-value":F=>F.value},{trigger:Ye(({selectedOption:F})=>[h("div",Ma,A((F==null?void 0:F.label)||c(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])],2)]),h("div",Pa,[h("p",null,A(c(o)("taskDialog.sections.automation.lastTriggered",{value:ce(d.automationLastTriggeredAt)})),1),h("p",null,A(c(o)("taskDialog.sections.automation.nextTriggered",{value:ce(d.automationNextTriggerAt)})),1)])])])):(C(),B("section",Ba,[h("div",Ra,[h("div",null,[h("div",La,[le(c(jo),{class:"h-4 w-4"}),h("span",null,A(c(o)("taskDialog.sections.notification.title")),1)]),h("p",Na,A(c(o)("taskDialog.sections.notification.intro")),1)]),h("label",Oa,[Qt(h("input",{"onUpdate:modelValue":K[8]||(K[8]=F=>d.notificationEnabled=F),type:"checkbox",class:"h-4 w-4"},null,512),[[No,d.notificationEnabled]]),h("span",null,A(c(o)("taskDialog.enabled")),1)])]),h("section",za,[h("div",qa,[h("label",ja,[h("span",Ua,A(c(o)("taskDialog.sections.notification.channelType")),1),le(Kt,{modelValue:d.notificationChannelType,"onUpdate:modelValue":K[9]||(K[9]=F=>d.notificationChannelType=F),options:y.value,disabled:!d.notificationEnabled,"get-option-value":F=>F.value},{trigger:Ye(({selectedOption:F})=>[h("div",Va,A((F==null?void 0:F.label)||c(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),h("label",Ha,[h("span",Wa,A(c(o)("taskDialog.sections.notification.triggerOn")),1),le(Kt,{modelValue:d.notificationTriggerOn,"onUpdate:modelValue":K[10]||(K[10]=F=>d.notificationTriggerOn=F),options:x.value,disabled:!d.notificationEnabled,"get-option-value":F=>F.value},{trigger:Ye(({selectedOption:F})=>[h("div",Ka,A((F==null?void 0:F.label)||c(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),h("label",Ga,[h("span",Za,A(c(o)("taskDialog.sections.notification.webhookUrl")),1),Qt(h("input",{"onUpdate:modelValue":K[11]||(K[11]=F=>d.notificationWebhookUrl=F),type:"text",class:"tool-input",placeholder:c(o)("taskDialog.sections.notification.webhookUrlPlaceholder"),disabled:!d.notificationEnabled},null,8,Xa),[[cn,d.notificationWebhookUrl]])]),h("label",Ya,[h("span",Ja,A(c(o)("taskDialog.sections.notification.secret")),1),Qt(h("input",{"onUpdate:modelValue":K[12]||(K[12]=F=>d.notificationSecret=F),type:"text",class:"tool-input",placeholder:c(o)("taskDialog.sections.notification.secretPlaceholder"),disabled:!d.notificationEnabled},null,8,Qa),[[cn,d.notificationSecret]])]),h("label",el,[h("span",tl,A(c(o)("taskDialog.sections.notification.locale")),1),le(Kt,{modelValue:d.notificationLocale,"onUpdate:modelValue":K[13]||(K[13]=F=>d.notificationLocale=F),options:P.value,disabled:!d.notificationEnabled,"get-option-value":F=>F.value},{trigger:Ye(({selectedOption:F})=>[h("div",ul,A((F==null?void 0:F.label)||c(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),h("label",nl,[h("span",ol,A(c(o)("taskDialog.sections.notification.messageMode")),1),le(Kt,{modelValue:d.notificationMessageMode,"onUpdate:modelValue":K[14]||(K[14]=F=>d.notificationMessageMode=F),options:D.value,disabled:!d.notificationEnabled,"get-option-value":F=>F.value},{trigger:Ye(({selectedOption:F})=>[h("div",rl,A((F==null?void 0:F.label)||c(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])])]),h("div",sl,[h("p",null,A(c(o)("taskDialog.sections.notification.status",{value:$.value})),1),h("p",null,A(c(o)("taskDialog.sections.notification.lastSent",{value:ce(d.notificationLastSentAt)})),1),d.notificationLastError?(C(),B("p",il,A(c(o)("taskDialog.sections.notification.lastError",{value:d.notificationLastError})),1)):we("",!0)])])])),a.value?(C(),B("p",al,A(a.value),1)):we("",!0)]))]),h("div",ll,[h("p",cl,A(c(o)("taskDialog.footerHint")),1),h("div",dl,[h("button",{type:"button",class:"tool-button px-3 py-2 text-sm",disabled:s.value,onClick:K[15]||(K[15]=F=>n("close"))},A(c(o)("common.cancel")),9,fl),h("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-sm",disabled:s.value||i.value,onClick:be},[s.value?(C(),Ee(c(qt),{key:0,class:"h-4 w-4 animate-spin"})):(C(),Ee(c(Gs),{key:1,class:"h-4 w-4"})),h("span",null,A(s.value?c(o)("common.saving"):c(o)("taskDialog.saveTaskConfig")),1)],8,pl)])])]),_:1},8,["open"]))}},gl={key:0,class:"flex items-center gap-2 text-sm"},bl={class:"min-w-0 flex-1 truncate"},xl={class:"theme-muted-text ml-2 hidden font-mono text-[11px] sm:inline"},vl={class:"theme-status-neutral hidden items-center rounded-sm border border-dashed px-1.5 py-0.5 text-[10px] sm:inline-flex"},yl={key:1,class:"theme-muted-text text-sm"},kl={class:"theme-divider theme-muted-text flex items-center justify-between gap-3 border-b border-dashed px-3 py-2 text-[11px]"},_l=["onClick"],Sl={class:"flex items-center gap-3"},wl={class:"min-w-0 flex-1"},Tl={class:"flex items-center gap-2 text-sm sm:hidden"},Cl={class:"min-w-0 flex-1 truncate font-medium text-[var(--theme-textPrimary)]"},El={class:"hidden items-center gap-2 text-sm sm:flex"},Al={class:"min-w-0 flex-1 truncate"},Dl={class:"font-medium text-[var(--theme-textPrimary)]"},Il={class:"theme-muted-text ml-2 font-mono text-[11px]"},Fl={class:"theme-status-neutral inline-flex items-center rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},$l={__name:"CodexSessionSelect",props:{modelValue:{type:String,default:""},sessions:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","refresh-intent"],setup(e,{emit:t}){const u=t,{t:n}=_t();function r(l){return(l==null?void 0:l.title)||n("projectManager.untitledProject")}function o(l){return(l==null?void 0:l.cwd)||n("projectManager.notSet")}function i(l){return l!=null&&l.running?n("projectManager.running"):n("projectManager.idle")}function s(l){return l!=null&&l.running?"theme-status-warning":"theme-status-success"}function a(l){return l?"theme-filter-active":"theme-filter-idle"}return(l,d)=>(C(),Ee(Kt,{"model-value":e.modelValue,options:e.sessions,loading:e.loading,disabled:e.disabled,"trigger-class":"h-9",placeholder:c(n)("projectManager.selectProject"),"empty-text":c(n)("projectManager.noProjectsInSelect"),"get-option-value":p=>(p==null?void 0:p.id)||"","onUpdate:modelValue":d[0]||(d[0]=p=>u("update:modelValue",p)),onRefreshIntent:d[1]||(d[1]=p=>u("refresh-intent"))},{trigger:Ye(({selectedOption:p,disabled:m})=>[p?(C(),B("div",gl,[h("span",bl,[h("span",{class:Se(["font-medium",m?"theme-muted-text":"text-[var(--theme-textPrimary)]"])},A(r(p)),3),h("span",xl,A(o(p)),1)]),h("span",vl,A(c(Ge)(p.engine)),1),h("span",{class:Se(["hidden items-center rounded-sm border border-dashed px-1.5 py-0.5 text-[10px] sm:inline-flex",s(p)])},A(i(p)),3)])):(C(),B("div",yl,A(e.loading?c(n)("projectManager.syncingProjects"):c(n)("projectManager.selectProject")),1))]),header:Ye(()=>[h("div",kl,[h("span",null,A(e.loading?c(n)("projectManager.syncingLatestProjects"):c(n)("projectManager.projectCount",{count:e.sessions.length})),1),e.loading?(C(),Ee(c(qt),{key:0,class:"h-3.5 w-3.5 animate-spin"})):we("",!0)])]),option:Ye(({option:p,selected:m,select:_})=>[h("button",{type:"button",class:Se(["w-full rounded-sm border border-dashed p-3 text-left transition",a(m)]),onClick:_},[h("div",Sl,[h("div",wl,[h("div",Tl,[h("span",Cl,A(r(p)),1)]),h("div",El,[h("span",Al,[h("span",Dl,A(r(p)),1),h("span",Il,A(o(p)),1)]),h("span",Fl,A(c(Ge)(p.engine)),1),h("span",{class:Se(["inline-flex items-center rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",s(p)])},A(i(p)),3)])]),m?(C(),Ee(c(js),{key:0,class:"h-4 w-4 shrink-0 text-[var(--theme-textSecondary)]"})):we("",!0)])],10,_l)]),_:1},8,["model-value","options","loading","disabled","placeholder","empty-text","get-option-value"]))}},Ml=["disabled"],Pl=["disabled"],Bl=["src","alt"],Vr={__name:"ImagePreviewOverlay",props:{modelValue:{type:String,default:""},images:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:t}){const u=e,n=t,{t:r}=_t(),o=U(1),i=de(()=>u.images.map(y=>String(y||"").trim()).filter(Boolean)),s=de(()=>i.value.findIndex(y=>y===u.modelValue)),a=de(()=>s.value>=0?i.value[s.value]:"");function l(){n("update:modelValue",""),o.value=1}function d(y){n("update:modelValue",String(y||"").trim()),o.value=1}function p(){s.value<=0||d(i.value[s.value-1])}function m(){s.value<0||s.value>=i.value.length-1||d(i.value[s.value+1])}function _(y){const x=Math.min(3,Math.max(.5,o.value+y));o.value=Math.round(x*100)/100}function b(){o.value=1}function E(y){a.value&&(y.preventDefault(),_(y.deltaY<0?.1:-.1))}function j(y){if(a.value){if(y.key==="Escape"){y.preventDefault(),l();return}if(y.key==="ArrowLeft"){y.preventDefault(),p();return}if(y.key==="ArrowRight"){y.preventDefault(),m();return}if(y.key==="+"||y.key==="="){y.preventDefault(),_(.1);return}if(y.key==="-"){y.preventDefault(),_(-.1);return}y.key==="0"&&(y.preventDefault(),b())}}return De(()=>u.modelValue,y=>{y||(o.value=1)}),De(i,y=>{if(u.modelValue){if(!y.length){l();return}if(!y.includes(u.modelValue)){const x=Math.min(s.value,y.length-1);d(y[x]||y[0])}}},{immediate:!0}),pu(()=>{window.addEventListener("keydown",j)}),kt(()=>{window.removeEventListener("keydown",j)}),(y,x)=>(C(),Ee(Ju,{to:"body"},[a.value?(C(),B("div",{key:0,class:"image-preview-overlay fixed inset-0 z-50 flex items-center justify-center p-6",onClick:l,onWheel:E},[h("div",{class:"absolute left-4 top-4 flex items-center gap-2",onClick:x[2]||(x[2]=Ze(()=>{},["stop"]))},[h("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition",onClick:x[0]||(x[0]=D=>_(-.1))},A(c(r)("imagePreview.zoomOut")),1),h("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition",onClick:b},A(Math.round(o.value*100))+"% ",1),h("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition",onClick:x[1]||(x[1]=D=>_(.1))},A(c(r)("imagePreview.zoomIn")),1)]),h("div",{class:"absolute right-4 top-4 flex items-center gap-2",onClick:x[3]||(x[3]=Ze(()=>{},["stop"]))},[h("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition disabled:cursor-not-allowed disabled:opacity-40",disabled:s.value<=0,onClick:p},A(c(r)("imagePreview.previous")),9,Ml),h("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition disabled:cursor-not-allowed disabled:opacity-40",disabled:s.value<0||s.value>=i.value.length-1,onClick:m},A(c(r)("imagePreview.next")),9,Pl),h("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition",onClick:l},A(c(r)("imagePreview.close")),1)]),h("img",{src:a.value,alt:c(r)("imagePreview.alt"),class:"image-preview-overlay__image max-h-[90vh] max-w-[90vw] object-contain shadow-2xl transition-transform",style:wn({transform:`scale(${o.value})`}),onClick:x[4]||(x[4]=Ze(()=>{},["stop"]))},null,12,Bl)],32)):we("",!0)]))}},Rl=`${Co()}/api/events/stream`,_u=new Set;let lu=null,yn=null;function ao(){yn&&(window.clearTimeout(yn),yn=null)}function Hr(){lu&&(lu.close(),lu=null)}function Ll(e){_u.forEach(t=>{try{t(e)}catch{}})}function Wr(){typeof window>"u"||typeof window.EventSource>"u"||lu||!_u.size||(ao(),lu=new window.EventSource(Rl),lu.onmessage=e=>{try{const t=JSON.parse(String(e.data||"{}"));if(!(t!=null&&t.type))return;Ll(t)}catch{}},lu.onerror=()=>{Hr(),_u.size&&(ao(),yn=window.setTimeout(()=>{Wr()},1500))})}function Nl(e){return typeof e!="function"?()=>{}:(_u.add(e),Wr(),()=>{_u.delete(e),!_u.size&&(ao(),Hr())})}const Kr=U(0),lo=U(0),kn=U(""),_n=U(0),Gr=$n({}),co=$n({}),fo=$n({}),qu=new Map;let Wo=!1;const Ol=new Set(["created","updated","deleted","session-linked","session-cleared"]),zl=new Set(["completed","error","stopped","interrupted","stop_timeout"]);function Kn(e,t=""){const u=String(t||"").trim();u&&(e[u]=Math.max(0,Number(e[u])||0)+1)}function ql(e={}){const t=String(e.type||"").trim(),u=String(e.reason||"").trim();return{updatesTaskList:t==="runs.changed"||t==="tasks.changed"&&Ol.has(u),updatesSessions:t==="ready"||t==="runs.changed"||t==="sessions.changed",updatesTaskRuns:t==="runs.changed",updatesTaskDiff:t==="runs.changed"||t==="tasks.changed"&&(u==="session-linked"||u==="session-cleared")}}function jl(e=null,t=null){const u=String((e==null?void 0:e.runId)||"").trim(),n=String((e==null?void 0:e.status)||"").trim(),r=String((t==null?void 0:t.runId)||"").trim(),o=String((t==null?void 0:t.status)||"").trim();return!u||!r||u!==r||!n||n!==o?!1:zl.has(o)}function Ul(e="",t={}){const u=String(e||"").trim();if(!u)return;const n=qu.get(u);n!=null&&n.size&&n.forEach(r=>{try{r(t)}catch{}})}function Vl(e={}){const t=String(e.type||"").trim(),u=String(e.taskSlug||"").trim(),n=ql(e);if(t){if(t==="ready"){Kr.value+=1,kn.value="",_n.value+=1;return}if(t==="tasks.changed"){kn.value=u,n.updatesTaskList&&(lo.value+=1),n.updatesTaskDiff&&Kn(co,u);return}if(t==="runs.changed"){kn.value=u;const r={runId:String(e.runId||"").trim(),status:String(e.status||"").trim(),sentAt:String(e.sentAt||"").trim()},o=u&&fo[u]||null,i=jl(o,r);u&&(fo[u]=r),n.updatesTaskList&&!i&&(lo.value+=1),n.updatesSessions&&(_n.value+=1),n.updatesTaskRuns&&Kn(Gr,u),n.updatesTaskDiff&&!i&&Kn(co,u);return}if(t==="sessions.changed"){n.updatesSessions&&(_n.value+=1);return}t==="run.event"&&Ul(u,{taskSlug:u,runId:String(e.runId||"").trim(),event:e.event||null})}}function Zr(){Wo||typeof window>"u"||(Nl(e=>{Vl(e)}),Wo=!0)}function Hl(e=""){const t=String(e||"").trim();return t?Math.max(0,Number(Gr[t])||0):0}function Wl(e=""){const t=String(e||"").trim();return t?Math.max(0,Number(co[t])||0):0}function Kl(e=""){const t=String(e||"").trim();return t&&fo[t]||null}function Gl(e="",t){const u=String(e||"").trim();if(!u||typeof t!="function")return()=>{};Zr();const n=qu.get(u)||new Set;return n.add(t),qu.set(u,n),()=>{const r=qu.get(u);r&&(r.delete(t),r.size||qu.delete(u))}}function Xr(){return Zr(),{readyVersion:Kr,listSyncVersion:lo,listSyncTaskSlug:kn,sessionsSyncVersion:_n,getTaskRunSyncVersion:Hl,getTaskRunChange:Kl,getTaskDiffSyncVersion:Wl}}const Zl=new Set(["queued","starting","running","stopping"]);function cu(){return Mn()==="en-US"}function M(e,t){return cu()?t:e}function Ko(e=""){const t=Date.parse(String(e||""));return Number.isFinite(t)?t:0}function Go(e=[],t=""){return[...e].sort((u,n)=>{const r=+!!(n!=null&&n.running)-+!!(u!=null&&u.running);if(r)return r;const o=+((n==null?void 0:n.id)===t)-+((u==null?void 0:u.id)===t);if(o)return o;const i=Ko(n.updatedAt)-Ko(u.updatedAt);return i||String(u.title||u.cwd||u.id).localeCompare(String(n.title||n.cwd||n.id),Mn())})}function Xl(e="",t=500){const u=String(e||"").trim();return u?u.length<=t?u:`${u.slice(0,t)}...`:""}function Gn(e=[]){const t=Array.isArray(e)?e:[];return t.length?t.map(u=>`${u.completed?"[x]":"[ ]"} ${u.text||M("未命名任务","Untitled Task")}`).join(`
|
|
213
|
+
`):""}function Dt(e=0){const t=Number(e||0);return Number.isFinite(t)?t.toLocaleString(Mn()):"0"}function Yr(e=0){const t=Math.max(0,Math.floor(Number(e)||0));if(t<66)return`${t}s`;const u=Math.floor(t/3600),n=Math.floor(t%3600/60),r=t%60;return u>0?cu()?`${u}h ${n}m ${r}s`:`${u}小时${n}分${r}秒`:cu()?`${n}m ${r}s`:`${n}分${r}秒`}function ut(e="",t=140){const u=String(e||"").replace(/\s+/g," ").trim();return u?u.length<=t?u:`${u.slice(0,t)}...`:""}function Jr(e="",t=[]){const u=t.filter(Boolean);if(!u.length)return"";const n=u.map(r=>`- ${r}`).join(`
|
|
214
|
+
`);return e?`${e}
|
|
215
|
+
${n}`:n}function Au(){return{commandCount:0,webSearchCount:0,fileChangeCount:0,subAgentCount:0,waitingAgentCount:0,currentActivity:"",latestActivity:"",latestDetail:""}}function po(e=[],t=""){const u=String(t||"").trim();return u&&(Array.isArray(e)?e:[]).find(n=>(n==null?void 0:n.runId)===u)||null}function Yl(e,t,u,n,r){const o=po(e,t);return o?(o.events=[],o.lastEventSeq=0,o.summary=Au(),((u==null?void 0:u.items)||[]).forEach(i=>{Ao(o,i,n,r)}),o.eventCount=Math.max(Math.max(0,Number(o.eventCount)||0),Array.isArray(u==null?void 0:u.items)?u.items.length:0,Math.max(0,Number(o.lastEventSeq)||0)),o.eventsLoaded=!0,o.eventsLoading=!1,o):null}function Cn(e={}){return Or(e==null?void 0:e.engine)}function ht(e={}){return Ge(Cn(e))}function Wu(e=""){return Zl.has(String(e||"").trim())}function Eo(e=""){const t=String(e||"").trim();if(!t)return null;const u=t.match(/^Reconnecting\.\.\.\s*(\d+)\/(\d+)\s*\(([\s\S]+)\)$/i);return u?{attempt:Number(u[1]||0),total:Number(u[2]||0),reason:String(u[3]||"").trim(),rawMessage:t}:null}function Zo(e={},t="completed"){const u=e.action||{},n=String(u.type||"").trim(),r=String(e.query||u.query||"").trim(),o=Array.isArray(u.queries)?u.queries.map(s=>String(s||"").trim()).filter(Boolean):[],i=String(u.url||r||"").trim();return n==="search"?{kind:"command",title:t==="started"?M("正在搜索网页","Searching the web"):M("已搜索网页","Web search completed"),detail:Jr(r?M(`关键词:${r}`,`Query: ${r}`):"",o.length>1?o:[])}:n==="open_page"?{kind:"command",title:t==="started"?M("正在打开网页","Opening page"):M("已打开网页","Page opened"),detail:i}:{kind:"command",title:t==="started"?M("准备网页检索","Preparing web search"):M("网页检索已更新","Web search updated"),detail:r}}function Xo(e={},t="completed"){const u=String(e.tool||"").trim(),n=Array.isArray(e.receiver_thread_ids)?e.receiver_thread_ids.filter(Boolean).length:0,r=ut(e.prompt);return u==="spawn_agent"?{kind:"todo",title:t==="started"?M("正在启动子代理","Starting sub-agent"):M(`已启动 ${n||1} 个子代理`,`Started ${n||1} sub-agent(s)`),detail:r?M(`任务:${r}`,`Task: ${r}`):""}:u==="wait"?{kind:"todo",title:t==="started"?n?M(`等待 ${n} 个子代理返回结果`,`Waiting for ${n} sub-agent result(s)`):M("等待子代理返回结果","Waiting for sub-agent results"):M("子代理结果已汇总","Sub-agent results aggregated"),detail:r?M(`等待内容:${r}`,`Waiting on: ${r}`):""}:{kind:"todo",title:t==="started"?M(`正在执行协作工具:${u||"未知工具"}`,`Running collaboration tool: ${u||"Unknown tool"}`):M(`协作工具完成:${u||"未知工具"}`,`Collaboration tool completed: ${u||"Unknown tool"}`),detail:r?M(`任务:${r}`,`Task: ${r}`):""}}function Yo(e={},t="completed"){const u=Array.isArray(e.changes)?e.changes:[],n={create:M("新增","Added"),update:M("更新","Updated"),delete:M("删除","Deleted")};return{kind:"command",title:t==="started"?M("正在整理文件变更","Collecting file changes"):M(`已记录 ${u.length||0} 个文件改动`,`Recorded ${u.length||0} file change(s)`),detail:Jr("",u.map(r=>{const o=String((r==null?void 0:r.path)||"").trim();return`${n[String((r==null?void 0:r.kind)||"").trim()]||M("变更","Changed")} ${o||M("未命名文件","Unnamed file")}`}))}}function Jl(e,t={}){var i,s,a,l,d,p,m,_;e!=null&&e.summary||(e.summary=Au());const u=e.summary,n=ht(e),r=String(t.type||"").trim(),o=t.item||{};if(r===Qe.TURN_STARTED){u.currentActivity=M("正在分析任务","Analyzing task"),u.latestActivity=M(`${n} 开始执行`,`${n} started`),u.latestDetail="";return}if(r===Qe.TURN_COMPLETED){u.currentActivity="",u.waitingAgentCount=0,u.latestActivity=M(`${n} 执行完成`,`${n} completed`),u.latestDetail="";return}if(r===Qe.TURN_FAILED){u.currentActivity="",u.waitingAgentCount=0,u.latestActivity=M("本轮运行失败","This run failed"),u.latestDetail="";return}if(r===Qe.ERROR){const b=Eo(Ku(t));if(b){u.currentActivity=M(`网络异常,正在重试 (${b.attempt}/${b.total})`,`Network error, retrying (${b.attempt}/${b.total})`),u.latestActivity=u.currentActivity,u.latestDetail=ut(b.reason,120);return}u.currentActivity="",u.latestActivity=M(`${n} 返回错误`,`${n} returned an error`),u.latestDetail=ut(Ku(t),120);return}if(r===Qe.ITEM_STARTED){if(o.type===qe.REASONING){u.currentActivity=M("正在思考","Thinking"),u.latestActivity=M("正在思考","Thinking"),u.latestDetail=ut(o.text,120);return}if(o.type===qe.COMMAND_EXECUTION){u.currentActivity=M("正在执行命令","Running command"),u.latestActivity=M("开始执行命令","Command started"),u.latestDetail=ut(o.command,120);return}if(o.type===qe.WEB_SEARCH){u.currentActivity=((i=o.action)==null?void 0:i.type)==="open_page"?M("正在打开网页","Opening page"):M("正在搜索网页","Searching the web"),u.latestActivity=u.currentActivity,u.latestDetail=ut(((s=o.action)==null?void 0:s.type)==="open_page"?((a=o.action)==null?void 0:a.url)||o.query:o.query||((l=o.action)==null?void 0:l.query),120);return}if(o.type===qe.COLLAB_TOOL_CALL){if(o.tool==="wait"){const b=Array.isArray(o.receiver_thread_ids)?o.receiver_thread_ids.filter(Boolean).length:0;u.waitingAgentCount=b,u.currentActivity=b?M(`等待 ${b} 个子代理返回结果`,`Waiting for ${b} sub-agent result(s)`):M("等待子代理返回结果","Waiting for sub-agent results"),u.latestActivity=u.currentActivity,u.latestDetail=ut(o.prompt,120);return}if(o.tool==="spawn_agent"){u.currentActivity=M("正在启动子代理","Starting sub-agent"),u.latestActivity=M("正在启动子代理","Starting sub-agent"),u.latestDetail=ut(o.prompt,120);return}}if(o.type===qe.FILE_CHANGE){u.currentActivity=M("正在整理文件变更","Collecting file changes"),u.latestActivity=M("正在整理文件变更","Collecting file changes"),u.latestDetail=ut((o.changes||[]).map(b=>b==null?void 0:b.path).filter(Boolean).join(cu()?", ":","),120);return}o.type===qe.TODO_LIST&&(u.currentActivity=M("正在规划执行步骤","Planning steps"),u.latestActivity=M("正在规划执行步骤","Planning steps"),u.latestDetail=ut((o.items||[]).map(b=>b==null?void 0:b.text).filter(Boolean).join(cu()?"; ":";"),120));return}if(r===Qe.ITEM_COMPLETED){if(o.type===qe.COMMAND_EXECUTION){u.commandCount+=1,u.currentActivity="",u.latestActivity=M("命令执行完成","Command completed"),u.latestDetail=ut(o.command,120);return}if(o.type===qe.WEB_SEARCH){u.webSearchCount+=1,u.currentActivity="",u.latestActivity=((d=o.action)==null?void 0:d.type)==="open_page"?M("已打开网页","Page opened"):M("已搜索网页","Web search completed"),u.latestDetail=ut(((p=o.action)==null?void 0:p.type)==="open_page"?((m=o.action)==null?void 0:m.url)||o.query:o.query||((_=o.action)==null?void 0:_.query),120);return}if(o.type===qe.COLLAB_TOOL_CALL){if(o.tool==="spawn_agent"){const b=Array.isArray(o.receiver_thread_ids)?o.receiver_thread_ids.filter(Boolean).length:0;u.subAgentCount+=b,u.currentActivity="",u.latestActivity=b?M(`已启动 ${b} 个子代理`,`Started ${b} sub-agent(s)`):M("已启动子代理","Started sub-agent"),u.latestDetail=ut(o.prompt,120);return}if(o.tool==="wait"){u.waitingAgentCount=0,u.currentActivity="",u.latestActivity=M("子代理结果已汇总","Sub-agent results aggregated"),u.latestDetail=ut(o.prompt,120);return}u.currentActivity="",u.latestActivity=M(`协作工具完成:${o.tool||"未知工具"}`,`Collaboration tool completed: ${o.tool||"Unknown tool"}`),u.latestDetail=ut(o.prompt,120);return}if(o.type===qe.FILE_CHANGE){const b=Array.isArray(o.changes)?o.changes:[];u.fileChangeCount+=b.length,u.currentActivity="",u.latestActivity=b.length?M(`已记录 ${b.length} 个文件改动`,`Recorded ${b.length} file change(s)`):M("已记录文件改动","Recorded file changes"),u.latestDetail=ut(b.map(E=>E==null?void 0:E.path).filter(Boolean).join(cu()?", ":","),120);return}if(o.type===qe.TODO_LIST){u.currentActivity="",u.latestActivity=M("待办列表已更新","Todo list updated"),u.latestDetail=ut((o.items||[]).map(b=>b==null?void 0:b.text).filter(Boolean).join(cu()?"; ":";"),120);return}o.type===qe.AGENT_MESSAGE&&(u.currentActivity="",u.latestActivity=M(`${n} 已返回结果`,`${n} returned a result`),u.latestDetail=ut(o.text,120))}}function Ql(e={},t={}){const u=Date.parse(String(e.startedAt||""));if(!Number.isFinite(u))return 0;if(Wu(e.status)){if(t.currentRunningRunId&&String(t.currentRunningRunId)===String(e.runId||"")&&Number.isFinite(Number(t.runningElapsedSeconds)))return Math.max(0,Math.floor(Number(t.runningElapsedSeconds)||0));const r=Number(t.nowMs)||Date.now();return Math.max(0,Math.floor((r-u)/1e3))}const n=Date.parse(String(e.finishedAt||""));return Number.isFinite(n)&&n>=u?Math.max(0,Math.floor((n-u)/1e3)):0}function Qr(e={},t={}){const u=e.summary||Au(),n=[],r=Ql(e,t);return r>0&&n.push({key:"elapsed",label:M("耗时","Elapsed"),value:Yr(r)}),u.webSearchCount&&n.push({key:"web",label:M("网页","Web"),value:Dt(u.webSearchCount)}),u.commandCount&&n.push({key:"command",label:M("命令","Command"),value:Dt(u.commandCount)}),u.fileChangeCount&&n.push({key:"file",label:M("改动","Changes"),value:Dt(u.fileChangeCount)}),u.subAgentCount&&n.push({key:"agent",label:M("子代理","Sub-agent"),value:Dt(u.subAgentCount)}),n}function es(e={}){const t=e.summary||Au();return t.waitingAgentCount>0?M(`当前:等待 ${Dt(t.waitingAgentCount)} 个子代理返回结果`,`Current: waiting for ${Dt(t.waitingAgentCount)} sub-agent result(s)`):t.currentActivity?M(`当前:${t.currentActivity}`,`Current: ${t.currentActivity}`):t.latestActivity?M(`最近:${t.latestActivity}`,`Latest: ${t.latestActivity}`):Wu(e.status)?M(`当前:正在等待 ${ht(e)} 返回更多事件`,`Current: waiting for more events from ${ht(e)}`):""}function ts(e={}){const t=e.summary||Au();return String(t.latestDetail||"").trim()}function ec(e={}){return!!(Qr(e).length||es(e)||ts(e))}const tc=[{type:"startup_config",title:e=>M(`${Ge(e)} 启动配置冲突`,`${Ge(e)} startup config conflict`),summary:e=>M(`${Ge(e)} 当前启动参数可能与本机包装脚本、别名或外部环境配置冲突,请检查 CLI 启动方式。`,`${Ge(e)} startup arguments may conflict with your local wrapper script, alias, or external environment configuration. Please check how the CLI is launched.`),patterns:[/not inside a trusted directory/i,/do you trust the contents of this directory/i,/trusted directory/i,/skip-git-repo-check/i,/prompt injection/i,/目录.*信任/,/可信目录/]},{type:"billing",title:M("额度或账单异常","Quota or billing issue"),summary:e=>M(`${Ge(e)} 可能因为额度不足、欠费或账单限制而无法继续执行。`,`${Ge(e)} may be unable to continue due to quota exhaustion, billing issues, or account limits.`),patterns:[/insufficient_quota/i,/exceeded your current quota/i,/\bquota\b/i,/\bbilling\b/i,/credit balance/i,/payment required/i,/余额不足/,/欠费/,/账单/,/充值/]},{type:"permission",title:M("权限不足","Insufficient permissions"),summary:e=>M(`${Ge(e)} 当前权限不够,无法访问所需文件、命令或资源。`,`${Ge(e)} does not currently have permission to access the required files, commands, or resources.`),patterns:[/permission denied/i,/insufficient permissions?/i,/forbidden/i,/unauthorized/i,/access denied/i,/not allowed/i,/权限不足/,/没有权限/,/无权/,/拒绝访问/]},{type:"rate_limit",title:M("请求过于频繁","Too many requests"),summary:e=>M(`${Ge(e)} 可能触发了限流,请稍后再试。`,`${Ge(e)} may have hit a rate limit. Please try again later.`),patterns:[/rate limit/i,/too many requests/i,/\b429\b/,/请求过于频繁/,/限流/]},{type:"context_limit",title:M("上下文过长","Context too long"),summary:M("这次发送的内容可能过长,超过了模型可处理的上下文限制。","The content sent in this run may be too long and exceed the model context limit."),patterns:[/context length/i,/maximum context length/i,/context_length_exceeded/i,/token limit/i,/prompt is too long/i,/上下文过长/,/超过.*token/i,/超出.*上下文/]},{type:"model_unavailable",title:M("模型或服务暂不可用","Model or service unavailable"),summary:e=>M(`${Ge(e)} 背后的模型或服务当前不可用,请稍后重试。`,`The model or service behind ${Ge(e)} is currently unavailable. Please try again later.`),patterns:[/model .*not found/i,/model .*unavailable/i,/service unavailable/i,/server error/i,/overloaded/i,/\b503\b/,/模型不可用/,/服务不可用/]},{type:"network",title:M("网络连接异常","Network connection issue"),summary:e=>M(`${Ge(e)} 在请求过程中遇到了网络问题或连接超时。`,`${Ge(e)} encountered a network problem or timeout while making the request.`),patterns:[/timed out/i,/\btimeout\b/i,/stream disconnected/i,/error sending request/i,/connection reset/i,/connection closed/i,/socket hang up/i,/network error/i,/fetch failed/i,/econnreset/i,/econnrefused/i,/enotfound/i,/network is unreachable/i,/temporary failure in name resolution/i,/网络异常/,/连接超时/]},{type:"cli_missing",title:e=>M(`${Ge(e)} CLI 不可用`,`${Ge(e)} CLI unavailable`),summary:e=>M(`当前环境没有正确安装或配置 ${Ge(e)} CLI。`,`${Ge(e)} CLI is not correctly installed or configured in the current environment.`),patterns:[/找不到 Codex CLI/,/找不到 Claude Code CLI/,/找不到 OpenCode CLI/,/codex --version/i,/claude --version/i,/opencode --version/i,/enoent/i,/not recognized as an internal or external command/i,/command not found/i]}];function Tu(e="",t="codex"){const u=String(e||"").trim();if(!u)return null;const n=tc.find(r=>r.patterns.some(o=>o.test(u)));return n?{type:n.type,title:typeof n.title=="function"?n.title(t):n.title,summary:typeof n.summary=="function"?n.summary(t):n.summary,rawMessage:u}:null}function fu(e="",t="codex"){const u=String(e||"").trim();if(!u)return"";const n=Tu(u,t);return n?`${n.summary}
|
|
216
|
+
|
|
217
|
+
${M("原始错误","Raw error")}: ${n.rawMessage}`:u}function ho(e,t=0){if(!e||t>4)return"";if(typeof e=="string")return e.trim();if(typeof e!="object")return"";const u=["message","detail","error","last_error","cause","reason","stderr","text","summary"];for(const n of u){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const r=ho(e[n],t+1);if(r)return r}for(const n of Object.values(e)){const r=ho(n,t+1);if(r)return r}return""}function Ku(e={}){return ho(e)}function uc(e={},t="Codex",u="codex"){const n=String(e.type||"").trim(),r=e.item||{};if(!n)return{title:M(`收到 ${t} 事件`,`Received ${t} event`),detail:""};if(n===Qe.THREAD_STARTED)return{title:M(`${t} 会话已创建`,`${t} session created`),detail:e.thread_id?M(`线程 ID: ${e.thread_id}`,`Thread ID: ${e.thread_id}`):""};if(n===Qe.TURN_STARTED)return{title:M(`${t} 开始执行`,`${t} started`),detail:""};if(n===Qe.TURN_COMPLETED){const o=e.usage?[M(`输入 ${Dt(e.usage.input_tokens)}`,`Input ${Dt(e.usage.input_tokens)}`),e.usage.cached_input_tokens?M(`缓存 ${Dt(e.usage.cached_input_tokens)}`,`Cached ${Dt(e.usage.cached_input_tokens)}`):"",M(`输出 ${Dt(e.usage.output_tokens)}`,`Output ${Dt(e.usage.output_tokens)}`)].filter(Boolean).join(" / "):"";return{title:M(`${t} 执行完成`,`${t} completed`),detail:o}}if(n===Qe.ERROR||n===Qe.TURN_FAILED){const o=Ku(e)||M(`${t} 执行失败`,`${t} failed`),i=n===Qe.ERROR?Eo(o):null;if(i)return{kind:"info",title:M(`网络异常,正在重试 (${i.attempt}/${i.total})`,`Network error, retrying (${i.attempt}/${i.total})`),detail:fu(i.reason||i.rawMessage,u)};const s=Tu(o,u);return{kind:"error",title:(s==null?void 0:s.title)||(n===Qe.TURN_FAILED?M("本轮运行失败","This run failed"):M(`${t} 返回错误`,`${t} returned an error`)),detail:fu(o,u)}}if(n===Qe.ITEM_STARTED)return r.type===qe.REASONING?{kind:"info",title:M("正在思考","Thinking"),detail:r.text||""}:r.type===qe.WEB_SEARCH?Zo(r,"started"):r.type===qe.COLLAB_TOOL_CALL?Xo(r,"started"):r.type===qe.FILE_CHANGE?Yo(r,"started"):r.type===qe.COMMAND_EXECUTION?{kind:"command",title:M("开始执行命令","Command started"),detail:r.command||""}:r.type===qe.TODO_LIST?{kind:"todo",title:M("更新待办列表","Update todo list"),detail:Gn(r.items)}:{title:M(`开始处理 ${r.type||"未知项目"}`,`Started handling ${r.type||"unknown item"}`),detail:""};if(n===Qe.ITEM_UPDATED&&r.type===qe.TODO_LIST)return{kind:"todo",title:M("更新待办列表","Update todo list"),detail:Gn(r.items)};if(n===Qe.ITEM_COMPLETED){if(r.type===qe.AGENT_MESSAGE&&r.text)return{kind:"result",title:M(`${t} 已返回结果`,`${t} returned a result`),detail:""};if(r.type===qe.WEB_SEARCH)return Zo(r,"completed");if(r.type===qe.COLLAB_TOOL_CALL)return Xo(r,"completed");if(r.type===qe.FILE_CHANGE)return Yo(r,"completed");if(r.type===qe.COMMAND_EXECUTION){const o=r.exit_code===0||r.status==="completed";return{kind:o?"command":"error",title:o?M("命令执行完成","Command completed"):M(`命令执行失败(exit ${r.exit_code??"?"})`,`Command failed (exit ${r.exit_code??"?"})`),detail:[r.command,Xl(r.aggregated_output)].filter(Boolean).join(`
|
|
218
|
+
|
|
219
|
+
`)}}return r.type===qe.TODO_LIST?{kind:"todo",title:M("更新待办列表","Update todo list"),detail:Gn(r.items)}:{title:M(`完成 ${r.type||"未知项目"}`,`Completed ${r.type||"unknown item"}`),detail:""}}return{title:M(`事件: ${n}`,`Event: ${n}`),detail:""}}function nc(e){return e.status==="queued"?M("排队中","Queued"):e.status==="starting"?M("启动中","Starting"):e.status==="stopping"?M("停止中","Stopping"):e.status==="running"?M("进行中","Running"):e.status==="error"?M("失败","Failed"):e.status==="interrupted"?M("已中断","Interrupted"):e.status==="stopped"?M("已停止","Stopped"):e.status==="stop_timeout"?M("停止超时","Stop timeout"):M("已完成","Completed")}function us(e={},t){if(typeof e=="string"){const r=e.trim();return r?{id:t(),kind:"info",title:r,detail:""}:null}const u=String(e.title||"").trim(),n=String(e.detail||"").trim();return!u&&!n?null:{id:t(),kind:e.kind||"info",title:u||n,detail:u?n:""}}function oc(e={},t){const u=Array.isArray(e.promptBlocks)?e.promptBlocks.map(n=>({...n,meta:n!=null&&n.meta?{...n.meta}:{},content:(n==null?void 0:n.type)==="image"?vn(n.content):n.content})):[];return{id:t(),runId:String(e.id||"").trim(),engine:Cn(e),prompt:String(e.prompt||"").trim(),promptBlocks:u,status:"completed",startedAt:e.startedAt||e.createdAt||"",finishedAt:e.finishedAt||"",events:[],eventCount:Math.max(0,Number(e.eventCount)||(Array.isArray(e.events)?e.events.length:0)),eventsLoaded:!!e.eventsIncluded,eventsLoading:!1,responseMessage:"",errorMessage:"",lastEventSeq:0,summary:Au()}}function Wt(e,t,u){const n=us(t,u);n&&(e.events.push(n),e.events.length>120&&e.events.splice(0,e.events.length-120))}function rc(e,t,u){var r;const n=us(t,u);if(n){for(let o=e.events.length-1;o>=0;o-=1){const i=M("网络异常,正在重试","Network error, retrying");if(String(((r=e.events[o])==null?void 0:r.title)||"").startsWith(i)){e.events.splice(o,1,n);return}}e.events.push(n),e.events.length>120&&e.events.splice(0,e.events.length-120)}}function sc(e,t={},u,n=()=>{}){var o,i,s,a,l,d,p,m,_,b,E,j;const r=Lr(t.type);if(r===Tt.SESSION){n(t.session),e.engine=Cn(t.session||e),Wt(e,{title:M(`已连接项目:${((o=t.session)==null?void 0:o.title)||"未命名项目"}`,`Connected project: ${((i=t.session)==null?void 0:i.title)||"Untitled Project"}`),detail:(s=t.session)!=null&&s.cwd?M(`工作目录:${t.session.cwd}`,`Working directory: ${t.session.cwd}`):""},u);return}if(r===Tt.SESSION_UPDATED){n(t.session),e.engine=Cn(t.session||e),Wt(e,{title:M("项目会话已更新","Project session updated"),detail:(a=t.session)!=null&&a.started?M("后续请求会继续复用当前项目的执行引擎会话。","Subsequent requests will continue reusing the current engine session for this project."):""},u);return}if(r===Tt.STATUS){if(t.stage==="starting"||t.stage==="resuming")return;Wt(e,{title:t.message||M("状态已更新","Status updated"),detail:""},u);return}if(r===Tt.STDERR){const y=Tu(t.text,e.engine);Wt(e,{kind:"error",title:(y==null?void 0:y.title)||"stderr",detail:fu(t.text,e.engine)},u);return}if(r===Tt.STDOUT){Wt(e,{kind:"command",title:"stdout",detail:t.text},u);return}if(r===Tt.AGENT_EVENT){Jl(e,t.event);const y=uc(t.event,ht(e),e.engine);String(y.title||"").startsWith(M("网络异常,正在重试","Network error, retrying"))?rc(e,y,u):Wt(e,y,u),((l=t.event)==null?void 0:l.type)===Qe.ITEM_COMPLETED&&((p=(d=t.event)==null?void 0:d.item)==null?void 0:p.type)===qe.AGENT_MESSAGE&&((_=(m=t.event)==null?void 0:m.item)!=null&&_.text)&&(e.responseMessage=t.event.item.text);const x=Ku(t.event)||M(`${ht(e)} 执行失败`,`${ht(e)} failed`);if(!(((b=t.event)==null?void 0:b.type)==="error"?Eo(x):null)&&(((E=t.event)==null?void 0:E.type)===Qe.ERROR||((j=t.event)==null?void 0:j.type)===Qe.TURN_FAILED)){const P=Ku(t.event)||M(`${ht(e)} 执行失败`,`${ht(e)} failed`);e.errorMessage=fu(P,e.engine),e.status="error"}return}if(r===Tt.COMPLETED){Wt(e,{kind:"result",title:M("本轮执行结束","Run finished"),detail:""},u),t.message&&(e.responseMessage=t.message);return}if(r===Tt.STOPPED){Wt(e,{title:t.message||M("执行已手动停止","Execution stopped manually"),detail:""},u);return}if(r===Tt.ERROR){const y=Tu(t.message,e.engine);Wt(e,{kind:"error",title:(y==null?void 0:y.title)||M("执行失败","Execution failed"),detail:fu(t.message||M(`${ht(e)} 执行失败`,`${ht(e)} failed`),e.engine)},u)}}function ic(e="",t="",u="codex"){const n=String(e||"").trim(),r=String(t||"").trim();if(!r)return!1;if(!n||/no last agent message|wrote empty content/i.test(n)||/执行失败[。.]?$/i.test(n))return!0;const o=Tu(n,u),i=Tu(r,u);return!o&&!!i}function ac(e,t={}){e.status=t.status||"completed",e.responseMessage=String(t.responseMessage||e.responseMessage||""),e.finishedAt=String(t.finishedAt||e.finishedAt||"");const u=fu(String(t.errorMessage||""),e.engine),n=String(e.errorMessage||"");return e.errorMessage=ic(t.errorMessage,n,e.engine)?n:u,e.status==="completed"&&!e.responseMessage&&(e.responseMessage=M(`本轮 ${ht(e)} 执行已完成,没有返回额外文本。`,`${ht(e)} completed in this run without returning additional text.`)),e}function Ao(e,t={},u,n=()=>{}){const r=Math.max(0,Number(t==null?void 0:t.seq)||0);if(r&&r<=Number(e.lastEventSeq||0))return!1;const o=(t==null?void 0:t.payload)||{};sc(e,o,u,n);const i=Lr(o.type);return i===Tt.COMPLETED?(e.status="completed",e.finishedAt=new Date().toISOString()):i===Tt.STOPPED?(e.status="stopped",e.errorMessage="",e.finishedAt=new Date().toISOString()):i===Tt.ERROR&&(e.status="error",e.errorMessage=fu(String(o.message||e.errorMessage||M(`${ht(e)} 执行失败`,`${ht(e)} failed`)),e.engine),e.finishedAt=new Date().toISOString()),r&&(e.lastEventSeq=r),e.eventCount=Math.max(Math.max(0,Number(e.eventCount)||0),r,Array.isArray(e.events)?e.events.length:0),(r||Array.isArray(e.events)&&e.events.length)&&(e.eventsLoaded=!0),!0}function Jo(e,t,u,n){const r=oc(e,t);return(e.events||[]).forEach(o=>{Ao(r,o,u,n)}),ac(r,e)}const lc=1800,cc=7200;function dc(){return{commandCount:0,webSearchCount:0,fileChangeCount:0,subAgentCount:0,waitingAgentCount:0,currentActivity:"",latestActivity:"",latestDetail:""}}function fc(e={}){const{props:t,turns:u,sessions:n,sending:r,sendingStartedAt:o,currentRunningRunId:i,sessionError:s,supportsServerEvents:a,scheduleScrollToBottom:l,resetAutoStickToBottom:d,mergeSessionRecord:p,mergeSession:m,loadSessions:_}=e;let b=0,E=0,j=null,y="",x=null,D="",P=0;const $=new Map;function Z(){return b+=1,b}function w(){return E+=1,E}function J(){x&&(window.clearInterval(x),x=null)}function Q(){P=Date.now()}function R(){$.clear(),u.value=[],r.value=!1,o.value=0,i.value="",D="",y="",b=0,E=0,d()}function q(){const G=[...u.value].reverse().find(X=>Wu(X.status))||null;if(i.value=(G==null?void 0:G.runId)||"",r.value=!!G,G!=null&&G.startedAt){const X=Date.parse(String(G.startedAt||""));o.value=Number.isFinite(X)?X:Date.now();return}o.value=0}function ne(G=null){return G?{...G}:dc()}function re(G,X=null){if(!(X!=null&&X.runId)||G.eventsLoaded||!X.eventsLoaded)return $.has(G.runId)&&(G.eventsLoading=!0),G;const Y=Math.max(Math.max(0,Number(X.lastEventSeq)||0),Math.max(0,Number(X.eventCount)||0),Array.isArray(X.events)?X.events.length:0),ve=Math.max(0,Number(G.eventCount)||0);return Y<ve?($.has(G.runId)&&(G.eventsLoading=!0),G):(G.events=Array.isArray(X.events)?[...X.events]:[],G.eventCount=Math.max(Math.max(0,Number(G.eventCount)||0),Math.max(0,Number(X.eventCount)||0),G.events.length),G.eventsLoaded=!0,G.eventsLoading=$.has(G.runId),G.lastEventSeq=Math.max(0,Number(X.lastEventSeq)||0),G.summary=ne(X.summary),G)}function be(G,X){const Y=po(u.value,G);return Y?(Y.eventsLoading=!!X,u.value=[...u.value],Y):null}async function ce(G,X={}){const Y=String((G==null?void 0:G.runId)||"").trim(),{force:ve=!1}=X;if(!Y)return[];const oe=po(u.value,Y)||G;if(oe!=null&&oe.eventsLoaded&&!ve)return oe.events;if($.has(Y))return $.get(Y);be(Y,!0);const ge=(async()=>{var Te;try{const Re=await Yi(Y,{limit:5e3}),Me=Yl(u.value,Y,Re,w,xe=>{m(xe,{preserveRunning:!0})});return Me?(u.value=[...u.value],t.active&&((Te=u.value.at(-1))==null?void 0:Te.runId)===Y&&l(),Me.events):Array.isArray(oe==null?void 0:oe.events)?oe.events:[]}catch(Re){throw s.value=Re.message,Re}finally{be(Y,!1),$.delete(Y)}})();return $.set(Y,ge),ge}function O(G,X){const Y=String(G||"").trim();if(!Y||!X)return!1;const ve=u.value.findIndex(Te=>Te.runId===Y);if(ve<0)return!1;const oe=u.value[ve];return Ao(oe,X,w,Te=>{m(Te,{preserveRunning:!0})})&&(u.value=[...u.value],q(),l()),!0}function K(){J(),!(a||!t.active||!r.value||!t.taskSlug)&&(x=window.setInterval(()=>{ye({force:!0}).catch(()=>{});const G=Date.now();G-P<cc||(P=G,_({force:!0}).catch(()=>{}))},lc))}function F(G=[]){const X=[...n.value],Y=new Map(u.value.filter(oe=>String((oe==null?void 0:oe.runId)||"").trim()).map(oe=>[String(oe.runId||"").trim(),oe])),ve=oe=>{if(!(oe!=null&&oe.id))return;const ge=X.findIndex(Te=>Te.id===oe.id);ge>=0?X[ge]=p(X[ge],oe,{preserveRunning:!0}):X.unshift(p(null,oe,{preserveRunning:!0}))};b=0,E=0,u.value=[...G||[]].reverse().map(oe=>{const ge=Jo(oe,Z,w,ve);return re(ge,Y.get(String((oe==null?void 0:oe.id)||"").trim())||null)}),n.value=X,q()}async function ye(G={}){const{force:X=!1,scrollToLatest:Y=!1}=G,ve=String(t.taskSlug||"").trim();if(!(!ve||!t.active&&!X))return j&&y===ve||j&&!X||(y=ve,j=(async()=>{try{const ge=(await Xi(ve,{limit:30,events:"latest"})).items||[],Te=JSON.stringify(ge.map(xe=>({id:xe.id,status:xe.status,updatedAt:xe.updatedAt,eventCount:Math.max(0,Number(xe.eventCount)||0)}))),Re=Y||D&&Te!==D;F(ge),D=Te,K();const Me=u.value.at(-1)||null;Me!=null&&Me.runId&&!Me.eventsLoaded&&ce(Me).catch(()=>{}),Re&&l()}catch(oe){s.value=oe.message}finally{j=null,y=""}})()),j}function V(G={}){const X=(G==null?void 0:G.run)||null,Y=(G==null?void 0:G.session)||null;if(Y&&m(Y,{preserveRunning:!0}),!(X!=null&&X.id)){q(),l({force:!0});return}const oe=Jo(X,Z,w,Te=>{m(Te,{preserveRunning:!0})}),ge=u.value.findIndex(Te=>Te.runId===oe.runId);if(ge>=0){const Te=[...u.value];Te.splice(ge,1,oe),u.value=Te}else u.value=[...u.value,oe];q(),l({force:!0})}async function he(){if(!(!t.taskSlug||r.value))try{await Qi(t.taskSlug),R(),l({force:!0})}catch(G){s.value=G.message}}return{applyCreatedRun:V,applyIncomingRunEvent:O,clearRunPollTimer:J,clearTurns:he,loadTurnEvents:ce,markFallbackSessionPollNow:Q,refreshRunHistory:ye,resetRunHistoryState:R,syncRunningStateFromTurns:q,updatePollingState:K}}const pc=1500,hc=3e4;function mc(e={}){const{props:t,sessions:u,workspaces:n,loading:r,managerBusy:o,sending:i,stopping:s,sessionError:a,showManager:l,selectedSessionId:d,currentRunningRunId:p,supportsServerEvents:m,mergeSession:_,applyCreatedRun:b,refreshRunHistory:E,markFallbackSessionPollNow:j,showToast:y}=e;let x=null,D=null,P=0,$=0;const Z=de(()=>typeof t.buildPrompt=="function"||!!String(t.prompt||"").trim()),w=de(()=>u.value.length>0),J=de(()=>Go(u.value,d.value)),Q=de(()=>w.value?"":ze("projectManager.noProjects"));async function R(X={}){const{force:Y=!1}=X;if(x)return x;const ve=Date.now();return!Y&&P&&ve-P<pc?{items:u.value,workspaces:n.value}:(x=(async()=>{r.value=!0,a.value="";try{const ge=(await ji()).items||[];return u.value=ge,P=Date.now(),{items:ge,workspaces:n.value}}catch(oe){throw a.value=oe.message,oe}finally{r.value=!1,x=null}})(),x)}async function q(X={}){const{force:Y=!1}=X;if(D)return D;const ve=Date.now();return!Y&&$&&ve-$<hc?{items:n.value}:(D=(async()=>{try{const oe=await Ui();return n.value=oe.items||[],$=Date.now(),{items:n.value}}finally{D=null}})(),D)}async function ne(X={}){const{forceSessions:Y=!1,forceWorkspaces:ve=!1}=X,[oe,ge]=await Promise.all([R({force:Y}),q({force:ve})]);return{items:(oe==null?void 0:oe.items)||u.value,workspaces:(ge==null?void 0:ge.items)||n.value}}function re(X=""){const Y=String(X||"").trim();!Y||n.value.includes(Y)||(n.value=[Y,...n.value])}function be(){l.value=!0,q().catch(()=>{})}function ce(){l.value=!1}function O(X){const Y=String(X||"").trim();if(t.sessionSelectionLocked&&Y&&Y!==d.value){a.value=t.sessionSelectionLockReason||ze("taskActions.sessionLocked");return}d.value=Y}function K(){ne({forceSessions:!0,forceWorkspaces:!0}).catch(()=>{})}async function F(X){o.value=!0,a.value="";try{const Y=await Vi(X);return _(Y),re(Y.cwd),d.value=Y.id,Y}catch(Y){throw a.value=Y.message,Y}finally{o.value=!1}}async function ye(X,Y){o.value=!0,a.value="";try{const ve=await Hi(X,Y);return _(ve),re(ve.cwd),ve}catch(ve){throw a.value=ve.message,ve}finally{o.value=!1}}async function V(X){var ve;const Y=String(X||"").trim();if(!Y)return{deletedSessionId:"",selectedSessionId:d.value};o.value=!0,a.value="";try{await Wi(Y);const oe=u.value.filter(Te=>Te.id!==Y);u.value=oe;let ge=d.value;return d.value===Y&&(ge=((ve=Go(oe,"")[0])==null?void 0:ve.id)||"",d.value=ge),{deletedSessionId:Y,selectedSessionId:ge}}catch(oe){throw a.value=oe.message,oe}finally{o.value=!1}}async function he(){if(!t.taskSlug||!Z.value||i.value||s.value)return!1;if(!d.value){const X=ze("projectManager.selectProject");return a.value=X,y==null||y({message:X,type:"warning"}),!1}a.value="";try{await ne({forceSessions:!0});const X=u.value.find(ge=>ge.id===d.value)||null;if(!X)return a.value=ze("projectManager.projectMissing"),!1;if(X.running)return a.value=ze("sessionTurns.currentProjectRunning"),!1;const Y=typeof t.buildPrompt=="function"?await t.buildPrompt():t.prompt,ve=typeof t.buildPromptBlocks=="function"?await t.buildPromptBlocks():[];if(!String(Y||"").trim())return a.value=ze("sessionTurns.noPromptToSend"),!1;const oe=await Ji(t.taskSlug,{sessionId:d.value,prompt:Y,promptBlocks:ve});return b(oe),typeof t.afterSend=="function"&&Promise.resolve(t.afterSend()).catch(ge=>{console.error("[promptx] afterSend failed",ge)}),m||(j(),Promise.all([E({force:!0}),R({force:!0})]).catch(ge=>{a.value=ge.message})),!0}catch(X){return a.value=X.message,!1}}async function G(){if(!(!p.value||s.value))try{s.value=!0,await ea(p.value),m||(j(),await Promise.all([E({force:!0}),R({force:!0})]))}catch(X){s.value=!1,a.value=X.message}}return{closeManager:ce,handleCreateSession:F,handleDeleteSession:V,handleSelectSession:O,handleSend:he,handleUpdateSession:ye,hasPrompt:Z,helperText:Q,loadSessions:R,loadSessionResources:ne,loadWorkspaces:q,openManager:be,refreshSessionsForSelection:K,sortedSessions:J,stopSending:G}}function gc(e={}){const{transcriptRef:t,hasNewerMessages:u,threshold:n=48}=e;let r=0,o=[],i=!1,s=!1,a=0,l=!0;function d(){if(typeof window>"u"||!o.length){o=[];return}o.forEach(Q=>{window.cancelAnimationFrame(Q)}),o=[]}function p(){r+=1,d()}function m(Q){s=!!Q,(u==null?void 0:u.value)!==void 0&&(u.value=s)}function _(){i=!1,a+=1,l=!0,m(!1)}function b(Q=t==null?void 0:t.value){return Q?Q.scrollHeight-Q.scrollTop-Q.clientHeight<=n:!0}function E(){return l&&!i}function j(){l&&!i&&m(!1)}function y(){if(l=b(),!l){p();return}j()}function x(){a+=1,i=!0,p()}function D(){const Q=a+1;a=Q,$e(()=>{Q===a&&requestAnimationFrame(()=>{Q===a&&(i=!1,l=b(),j())})})}function P(){i=!0,p()}function $(){D()}function Z(Q={}){const{force:R=!1}=Q;R&&_(),p();const q=r;$e(()=>{if(!(t==null?void 0:t.value)||q!==r)return;if(!R&&!E()){m(!0);return}const re=()=>{const ce=t==null?void 0:t.value;!ce||q!==r||(ce.scrollTop=ce.scrollHeight,l=!0,m(!1))};re(),o=[requestAnimationFrame(()=>{re(),o=[requestAnimationFrame(re)]})]})}function w(){Z({force:!0})}function J(){a+=1,p()}return{cancelScheduledScrollToBottom:p,destroy:J,handleTranscriptScroll:y,handleTranscriptTouchEnd:$,handleTranscriptTouchMove:P,handleTranscriptTouchStart:x,isTranscriptNearBottom:b,resetAutoStickToBottom:_,scheduleScrollToBottom:Z,scrollToBottom:w}}const bc=150;function xc(e,t){const u=Xr(),n=U([]),r=U([]),o=U(!1),i=U(!1),s=U(!1),a=U(!1),l=U(""),d=U([]),p=U(null),m=U(0),_=U(0),b=U(!1),E=U(""),j=U(!1),y=typeof window<"u"&&typeof window.EventSource<"u";function x(fe=""){const Be=typeof fe=="object"&&fe!==null?String(fe.message||"").trim():String(fe||"").trim();Be&&t("toast",typeof fe=="object"&&fe!==null?{...fe,message:Be}:Be)}let D=null,P=null,$=null,Z={sessions:!1,runs:!1};const w=de({get(){return String(e.selectedSessionId||"").trim()},set(fe){t("selected-session-change",String(fe||"").trim())}}),J=de(()=>a.value?ze("sessionPanel.stopping"):`${ze("projectManager.running")} (${Yr(_.value)})`),{destroy:Q,handleTranscriptScroll:R,handleTranscriptTouchEnd:q,handleTranscriptTouchMove:ne,handleTranscriptTouchStart:re,resetAutoStickToBottom:be,scheduleScrollToBottom:ce,scrollToBottom:O}=gc({transcriptRef:p,hasNewerMessages:j});function K(fe,Be,Ce={}){const{preserveRunning:We=!1}=Ce;return Be!=null&&Be.id?We?{...Be,running:!!(fe!=null&&fe.running)}:Be:fe||null}function F(fe,Be={}){if(!(fe!=null&&fe.id))return;const Ce=[...n.value],We=Ce.findIndex(xt=>xt.id===fe.id);We>=0?Ce[We]=K(Ce[We],fe,Be):Ce.unshift(K(null,fe,Be)),n.value=Ce}const{applyCreatedRun:ye,applyIncomingRunEvent:V,clearRunPollTimer:he,clearTurns:G,loadTurnEvents:X,markFallbackSessionPollNow:Y,refreshRunHistory:ve,resetRunHistoryState:oe,updatePollingState:ge}=fc({props:e,turns:d,sessions:n,sending:s,sendingStartedAt:m,currentRunningRunId:E,sessionError:l,supportsServerEvents:y,scheduleScrollToBottom:ce,resetAutoStickToBottom:be,mergeSessionRecord:K,mergeSession:F,loadSessions:(...fe)=>Ne(...fe)}),{closeManager:Te,handleCreateSession:Re,handleDeleteSession:Me,handleSelectSession:xe,handleSend:rt,handleUpdateSession:et,helperText:Ie,loadSessions:Ne,loadSessionResources:dt,loadWorkspaces:Je,openManager:ft,refreshSessionsForSelection:pt,sortedSessions:He,stopSending:St}=mc({props:e,sessions:n,workspaces:r,loading:o,managerBusy:i,sending:s,stopping:a,sessionError:l,showManager:b,selectedSessionId:w,currentRunningRunId:E,supportsServerEvents:y,mergeSession:F,applyCreatedRun:ye,refreshRunHistory:ve,markFallbackSessionPollNow:Y,showToast:x});function Xe(){D&&(window.clearInterval(D),D=null)}function gt(){Xe(),m.value||(m.value=Date.now()),_.value=Math.max(0,Math.floor((Date.now()-m.value)/1e3)),D=window.setInterval(()=>{_.value=Math.max(0,Math.floor((Date.now()-m.value)/1e3))},1e3)}function at(){$&&(window.clearTimeout($),$=null)}function lt(){at();const fe=Z;Z={sessions:!1,runs:!1},fe.sessions&&Ne({force:!0}).catch(()=>{}),fe.runs&&ve({force:!0}).catch(()=>{})}function st(fe={}){typeof window>"u"||(Z={sessions:Z.sessions||!!fe.sessions,runs:Z.runs||!!fe.runs},!($||!Z.sessions&&!Z.runs)&&($=window.setTimeout(()=>{lt()},bc)))}function bt(fe){return Qr(fe,{currentRunningRunId:E.value,runningElapsedSeconds:_.value,nowMs:Date.now()})}function Ue(fe=""){if(!fe)return"";const Be=new Date(fe);return Number.isNaN(Be.getTime())?"":Be.toLocaleTimeString(Mn(),{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function ct(fe){return fe.status==="error"||fe.status==="stop_timeout"?"theme-process-error":fe.status==="interrupted"||fe.status==="stopped"?"theme-process-stopped":fe.status==="completed"?"theme-process-completed":"theme-process-running"}function it(fe){return!!(fe.responseMessage||fe.errorMessage||fe.status==="completed")}return De(s,fe=>{fe?(m.value||(m.value=Date.now()),gt()):(Xe(),m.value=0,_.value=0,a.value=!1),ge(),t("sending-change",fe)},{immediate:!0}),De(()=>!!e.taskRunning,fe=>{!e.active||fe||!s.value||st({sessions:!0,runs:!0})}),De(()=>e.active,fe=>{if(fe){dt({forceSessions:!0}).catch(()=>{});return}at(),he()},{immediate:!0}),De(()=>e.taskSlug,()=>{oe(),b.value=!1,l.value="",e.active&&ve({force:!0,scrollToLatest:!0}).catch(()=>{})},{immediate:!0}),kt(()=>{Xe(),he(),at(),Q(),P==null||P()}),De(()=>u.readyVersion.value,()=>{const fe=String(e.taskSlug||"").trim();!e.active&&!b.value||(b.value&&Je().catch(()=>{}),st({sessions:!0,runs:!!fe}))}),De(()=>u.sessionsSyncVersion.value,()=>{!e.active&&!b.value||st({sessions:!0})}),De(()=>u.getTaskRunSyncVersion(e.taskSlug),()=>{!e.active||!e.taskSlug||st({sessions:!0,runs:!0})}),De(()=>String(e.taskSlug||"").trim(),fe=>{P==null||P(),P=null,fe&&(P=Gl(fe,({runId:Be,event:Ce})=>{if(!e.active)return;V(Be,Ce)||st({sessions:!0,runs:!0})}))},{immediate:!0}),{clearTurns:G,closeManager:Te,formatTurnTime:Ue,getProcessCardClass:ct,getProcessStatus:nc,getTurnAgentLabel:ht,getTurnSummaryDetail:ts,getDisplayTurnSummaryItems:bt,getTurnSummaryStatus:es,handleCreateSession:Re,handleDeleteSession:Me,handleSelectSession:xe,handleSend:rt,handleUpdateSession:et,loadTurnEvents:X,hasTurnSummary:ec,helperText:Ie,loading:o,managerBusy:i,openManager:ft,refreshSessionsForSelection:pt,selectedSessionId:w,sending:s,stopping:a,sessionError:l,shouldShowResponse:it,showManager:b,sortedSessions:He,stopSending:St,hasNewerMessages:j,transcriptRef:p,turns:d,workspaces:r,workingLabel:J,sessions:n,loadSessions:Ne,handleTranscriptScroll:R,handleTranscriptTouchEnd:q,handleTranscriptTouchMove:ne,handleTranscriptTouchStart:re,scrollToBottom:O}}const vc=8,yc=320,kc=10,_c=400;function Qo(e,t,u){const n=String(e||"").trimEnd();return n?n.split(/\r?\n/).length>t||n.length>u:!1}function Sc(e={}){const{turns:t,loadTurnEvents:u}=e,n=U({}),r=U({}),o=U({});function i(w){return String((w==null?void 0:w.runId)||(w==null?void 0:w.id)||"").trim()}function s(w){const J=i(w);return!!J&&J===i(t.value.at(-1))}function a(w,J=null){const Q=Math.max(0,Number(w==null?void 0:w.eventCount)||0,Array.isArray(w==null?void 0:w.events)?w.events.length:0);return!Array.isArray(J)||!(w!=null&&w.eventsLoaded)?Q:Math.max(0,J.length)}function l(w){return!Wu(w==null?void 0:w.status)&&!s(w)&&a(w)>3}function d(w){return Qo(w==null?void 0:w.prompt,vc,yc)}function p(w){return!Wu(w==null?void 0:w.status)&&!s(w)&&d(w)}function m(w){return String((w==null?void 0:w.errorMessage)||(w==null?void 0:w.responseMessage)||"")}function _(w){return Qo(m(w),kc,_c)}function b(w){return!(w!=null&&w.errorMessage)&&!s(w)&&_(w)}function E(w){return a(w)>0}function j(w=[]){const J=new Set((w||[]).map(q=>i(q)).filter(Boolean));n.value=Object.fromEntries(Object.entries(n.value).filter(([q])=>J.has(q))),r.value=Object.fromEntries(Object.entries(r.value).filter(([q])=>J.has(q))),o.value=Object.fromEntries(Object.entries(o.value).filter(([q])=>J.has(q)));const Q=(w||[]).at(-1)||null,R=i(Q);R&&(Object.prototype.hasOwnProperty.call(n.value,R)||(n.value={...n.value,[R]:!1}),Object.prototype.hasOwnProperty.call(r.value,R)||(r.value={...r.value,[R]:!1}),Object.prototype.hasOwnProperty.call(o.value,R)||(o.value={...o.value,[R]:!1}))}function y(w){const J=i(w);return J?Object.prototype.hasOwnProperty.call(n.value,J)?!!n.value[J]:l(w):!1}async function x(w){const J=i(w);if(!J)return;const Q=!y(w);n.value={...n.value,[J]:Q},!Q&&E(w)&&!w.eventsLoaded&&!w.eventsLoading&&await u(w).catch(()=>{})}function D(w){const J=i(w);return J?Object.prototype.hasOwnProperty.call(r.value,J)?!!r.value[J]:p(w):!1}function P(w){const J=i(w);!J||!d(w)||(r.value={...r.value,[J]:!D(w)})}function $(w){const J=i(w);return J?Object.prototype.hasOwnProperty.call(o.value,J)?!!o.value[J]:b(w):!1}function Z(w){const J=i(w);!J||!_(w)||(o.value={...o.value,[J]:!$(w)})}return De(t,w=>{j(w)},{immediate:!0,deep:!0}),{canCollapsePrompt:d,canCollapseResponse:_,getTurnEventCollapseKey:i,getTurnEventCount:a,hasTurnEventHistory:E,isLatestTurn:s,isPromptCollapsed:D,isResponseCollapsed:$,isTurnEventsCollapsed:y,togglePrompt:P,toggleResponse:Z,toggleTurnEvents:x}}const er={};function wc(e){let t=er[e];if(t)return t;t=er[e]=[];for(let u=0;u<128;u++){const n=String.fromCharCode(u);t.push(n)}for(let u=0;u<e.length;u++){const n=e.charCodeAt(u);t[n]="%"+("0"+n.toString(16).toUpperCase()).slice(-2)}return t}function Cu(e,t){typeof t!="string"&&(t=Cu.defaultChars);const u=wc(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(n){let r="";for(let o=0,i=n.length;o<i;o+=3){const s=parseInt(n.slice(o+1,o+3),16);if(s<128){r+=u[s];continue}if((s&224)===192&&o+3<i){const a=parseInt(n.slice(o+4,o+6),16);if((a&192)===128){const l=s<<6&1984|a&63;l<128?r+="��":r+=String.fromCharCode(l),o+=3;continue}}if((s&240)===224&&o+6<i){const a=parseInt(n.slice(o+4,o+6),16),l=parseInt(n.slice(o+7,o+9),16);if((a&192)===128&&(l&192)===128){const d=s<<12&61440|a<<6&4032|l&63;d<2048||d>=55296&&d<=57343?r+="���":r+=String.fromCharCode(d),o+=6;continue}}if((s&248)===240&&o+9<i){const a=parseInt(n.slice(o+4,o+6),16),l=parseInt(n.slice(o+7,o+9),16),d=parseInt(n.slice(o+10,o+12),16);if((a&192)===128&&(l&192)===128&&(d&192)===128){let p=s<<18&1835008|a<<12&258048|l<<6&4032|d&63;p<65536||p>1114111?r+="����":(p-=65536,r+=String.fromCharCode(55296+(p>>10),56320+(p&1023))),o+=9;continue}}r+="�"}return r})}Cu.defaultChars=";/?:@&=+$,#";Cu.componentChars="";const tr={};function Tc(e){let t=tr[e];if(t)return t;t=tr[e]=[];for(let u=0;u<128;u++){const n=String.fromCharCode(u);/^[0-9a-z]$/i.test(n)?t.push(n):t.push("%"+("0"+u.toString(16).toUpperCase()).slice(-2))}for(let u=0;u<e.length;u++)t[e.charCodeAt(u)]=e[u];return t}function Qu(e,t,u){typeof t!="string"&&(u=t,t=Qu.defaultChars),typeof u>"u"&&(u=!0);const n=Tc(t);let r="";for(let o=0,i=e.length;o<i;o++){const s=e.charCodeAt(o);if(u&&s===37&&o+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3))){r+=e.slice(o,o+3),o+=2;continue}if(s<128){r+=n[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1<i){const a=e.charCodeAt(o+1);if(a>=56320&&a<=57343){r+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}r+="%EF%BF%BD";continue}r+=encodeURIComponent(e[o])}return r}Qu.defaultChars=";/?:@&=+$,-_.!~*'()#";Qu.componentChars="-_.!~*'()";function Do(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function En(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Cc=/^([a-z0-9.+-]+:)/i,Ec=/:[0-9]*$/,Ac=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Dc=["<",">",'"',"`"," ","\r",`
|
|
220
|
+
`," "],Ic=["{","}","|","\\","^","`"].concat(Dc),Fc=["'"].concat(Ic),ur=["%","/","?",";","#"].concat(Fc),nr=["/","?","#"],$c=255,or=/^[+a-z0-9A-Z_-]{0,63}$/,Mc=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,rr={javascript:!0,"javascript:":!0},sr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Io(e,t){if(e&&e instanceof En)return e;const u=new En;return u.parse(e,t),u}En.prototype.parse=function(e,t){let u,n,r,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const l=Ac.exec(o);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}let i=Cc.exec(o);if(i&&(i=i[0],u=i.toLowerCase(),this.protocol=i,o=o.substr(i.length)),(t||i||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r=o.substr(0,2)==="//",r&&!(i&&rr[i])&&(o=o.substr(2),this.slashes=!0)),!rr[i]&&(r||i&&!sr[i])){let l=-1;for(let b=0;b<nr.length;b++)n=o.indexOf(nr[b]),n!==-1&&(l===-1||n<l)&&(l=n);let d,p;l===-1?p=o.lastIndexOf("@"):p=o.lastIndexOf("@",l),p!==-1&&(d=o.slice(0,p),o=o.slice(p+1),this.auth=d),l=-1;for(let b=0;b<ur.length;b++)n=o.indexOf(ur[b]),n!==-1&&(l===-1||n<l)&&(l=n);l===-1&&(l=o.length),o[l-1]===":"&&l--;const m=o.slice(0,l);o=o.slice(l),this.parseHost(m),this.hostname=this.hostname||"";const _=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!_){const b=this.hostname.split(/\./);for(let E=0,j=b.length;E<j;E++){const y=b[E];if(y&&!y.match(or)){let x="";for(let D=0,P=y.length;D<P;D++)y.charCodeAt(D)>127?x+="x":x+=y[D];if(!x.match(or)){const D=b.slice(0,E),P=b.slice(E+1),$=y.match(Mc);$&&(D.push($[1]),P.unshift($[2])),P.length&&(o=P.join(".")+o),this.hostname=D.join(".");break}}}}this.hostname.length>$c&&(this.hostname=""),_&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const s=o.indexOf("#");s!==-1&&(this.hash=o.substr(s),o=o.slice(0,s));const a=o.indexOf("?");return a!==-1&&(this.search=o.substr(a),o=o.slice(0,a)),o&&(this.pathname=o),sr[u]&&this.hostname&&!this.pathname&&(this.pathname=""),this};En.prototype.parseHost=function(e){let t=Ec.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const Pc=Object.freeze(Object.defineProperty({__proto__:null,decode:Cu,encode:Qu,format:Do,parse:Io},Symbol.toStringTag,{value:"Module"})),ns=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,os=/[\0-\x1F\x7F-\x9F]/,Bc=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Fo=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,rs=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,ss=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Rc=Object.freeze(Object.defineProperty({__proto__:null,Any:ns,Cc:os,Cf:Bc,P:Fo,S:rs,Z:ss},Symbol.toStringTag,{value:"Module"})),Lc=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),Nc=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var Zn;const Oc=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),zc=(Zn=String.fromCodePoint)!==null&&Zn!==void 0?Zn:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function qc(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Oc.get(e))!==null&&t!==void 0?t:e}var ot;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(ot||(ot={}));const jc=32;var uu;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(uu||(uu={}));function mo(e){return e>=ot.ZERO&&e<=ot.NINE}function Uc(e){return e>=ot.UPPER_A&&e<=ot.UPPER_F||e>=ot.LOWER_A&&e<=ot.LOWER_F}function Vc(e){return e>=ot.UPPER_A&&e<=ot.UPPER_Z||e>=ot.LOWER_A&&e<=ot.LOWER_Z||mo(e)}function Hc(e){return e===ot.EQUALS||Vc(e)}var nt;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(nt||(nt={}));var tu;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(tu||(tu={}));class Wc{constructor(t,u,n){this.decodeTree=t,this.emitCodePoint=u,this.errors=n,this.state=nt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=tu.Strict}startEntity(t){this.decodeMode=t,this.state=nt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,u){switch(this.state){case nt.EntityStart:return t.charCodeAt(u)===ot.NUM?(this.state=nt.NumericStart,this.consumed+=1,this.stateNumericStart(t,u+1)):(this.state=nt.NamedEntity,this.stateNamedEntity(t,u));case nt.NumericStart:return this.stateNumericStart(t,u);case nt.NumericDecimal:return this.stateNumericDecimal(t,u);case nt.NumericHex:return this.stateNumericHex(t,u);case nt.NamedEntity:return this.stateNamedEntity(t,u)}}stateNumericStart(t,u){return u>=t.length?-1:(t.charCodeAt(u)|jc)===ot.LOWER_X?(this.state=nt.NumericHex,this.consumed+=1,this.stateNumericHex(t,u+1)):(this.state=nt.NumericDecimal,this.stateNumericDecimal(t,u))}addToNumericResult(t,u,n,r){if(u!==n){const o=n-u;this.result=this.result*Math.pow(r,o)+parseInt(t.substr(u,o),r),this.consumed+=o}}stateNumericHex(t,u){const n=u;for(;u<t.length;){const r=t.charCodeAt(u);if(mo(r)||Uc(r))u+=1;else return this.addToNumericResult(t,n,u,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(t,n,u,16),-1}stateNumericDecimal(t,u){const n=u;for(;u<t.length;){const r=t.charCodeAt(u);if(mo(r))u+=1;else return this.addToNumericResult(t,n,u,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(t,n,u,10),-1}emitNumericEntity(t,u){var n;if(this.consumed<=u)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===ot.SEMI)this.consumed+=1;else if(this.decodeMode===tu.Strict)return 0;return this.emitCodePoint(qc(this.result),this.consumed),this.errors&&(t!==ot.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,u){const{decodeTree:n}=this;let r=n[this.treeIndex],o=(r&uu.VALUE_LENGTH)>>14;for(;u<t.length;u++,this.excess++){const i=t.charCodeAt(u);if(this.treeIndex=Kc(n,r,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===tu.Attribute&&(o===0||Hc(i))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],o=(r&uu.VALUE_LENGTH)>>14,o!==0){if(i===ot.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==tu.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:u,decodeTree:n}=this,r=(n[u]&uu.VALUE_LENGTH)>>14;return this.emitNamedEntityData(u,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,u,n){const{decodeTree:r}=this;return this.emitCodePoint(u===1?r[t]&~uu.VALUE_LENGTH:r[t+1],n),u===3&&this.emitCodePoint(r[t+2],n),n}end(){var t;switch(this.state){case nt.NamedEntity:return this.result!==0&&(this.decodeMode!==tu.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case nt.NumericDecimal:return this.emitNumericEntity(0,2);case nt.NumericHex:return this.emitNumericEntity(0,3);case nt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case nt.EntityStart:return 0}}}function is(e){let t="";const u=new Wc(e,n=>t+=zc(n));return function(r,o){let i=0,s=0;for(;(s=r.indexOf("&",s))>=0;){t+=r.slice(i,s),u.startEntity(o);const l=u.write(r,s+1);if(l<0){i=s+u.end();break}i=s+l,s=l===0?i+1:i}const a=t+r.slice(i);return t="",a}}function Kc(e,t,u,n){const r=(t&uu.BRANCH_LENGTH)>>7,o=t&uu.JUMP_TABLE;if(r===0)return o!==0&&n===o?u:-1;if(o){const a=n-o;return a<0||a>=r?-1:e[u+a]-1}let i=u,s=i+r-1;for(;i<=s;){const a=i+s>>>1,l=e[a];if(l<n)i=a+1;else if(l>n)s=a-1;else return e[a+r]}return-1}const Gc=is(Lc);is(Nc);function as(e,t=tu.Legacy){return Gc(e,t)}function Zc(e){return Object.prototype.toString.call(e)}function $o(e){return Zc(e)==="[object String]"}const Xc=Object.prototype.hasOwnProperty;function Yc(e,t){return Xc.call(e,t)}function Pn(e){return Array.prototype.slice.call(arguments,1).forEach(function(u){if(u){if(typeof u!="object")throw new TypeError(u+"must be object");Object.keys(u).forEach(function(n){e[n]=u[n]})}}),e}function ls(e,t,u){return[].concat(e.slice(0,t),u,e.slice(t+1))}function Mo(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function An(e){if(e>65535){e-=65536;const t=55296+(e>>10),u=56320+(e&1023);return String.fromCharCode(t,u)}return String.fromCharCode(e)}const cs=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Jc=/&([a-z#][a-z0-9]{1,31});/gi,Qc=new RegExp(cs.source+"|"+Jc.source,"gi"),e0=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function t0(e,t){if(t.charCodeAt(0)===35&&e0.test(t)){const n=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Mo(n)?An(n):e}const u=as(e);return u!==e?u:e}function u0(e){return e.indexOf("\\")<0?e:e.replace(cs,"$1")}function Eu(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(Qc,function(t,u,n){return u||t0(t,n)})}const n0=/[&<>"]/,o0=/[&<>"]/g,r0={"&":"&","<":"<",">":">",'"':"""};function s0(e){return r0[e]}function ou(e){return n0.test(e)?e.replace(o0,s0):e}const i0=/[.?*+^$[\]\\(){}|-]/g;function a0(e){return e.replace(i0,"\\$&")}function je(e){switch(e){case 9:case 32:return!0}return!1}function Gu(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Zu(e){return Fo.test(e)||rs.test(e)}function Xu(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Bn(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const l0={mdurl:Pc,ucmicro:Rc},c0=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:ls,assign:Pn,escapeHtml:ou,escapeRE:a0,fromCodePoint:An,has:Yc,isMdAsciiPunct:Xu,isPunctChar:Zu,isSpace:je,isString:$o,isValidEntityCode:Mo,isWhiteSpace:Gu,lib:l0,normalizeReference:Bn,unescapeAll:Eu,unescapeMd:u0},Symbol.toStringTag,{value:"Module"}));function d0(e,t,u){let n,r,o,i;const s=e.posMax,a=e.pos;for(e.pos=t+1,n=1;e.pos<s;){if(o=e.src.charCodeAt(e.pos),o===93&&(n--,n===0)){r=!0;break}if(i=e.pos,e.md.inline.skipToken(e),o===91){if(i===e.pos-1)n++;else if(u)return e.pos=a,-1}}let l=-1;return r&&(l=e.pos),e.pos=a,l}function f0(e,t,u){let n,r=t;const o={ok:!1,pos:0,str:""};if(e.charCodeAt(r)===60){for(r++;r<u;){if(n=e.charCodeAt(r),n===10||n===60)return o;if(n===62)return o.pos=r+1,o.str=Eu(e.slice(t+1,r)),o.ok=!0,o;if(n===92&&r+1<u){r+=2;continue}r++}return o}let i=0;for(;r<u&&(n=e.charCodeAt(r),!(n===32||n<32||n===127));){if(n===92&&r+1<u){if(e.charCodeAt(r+1)===32)break;r+=2;continue}if(n===40&&(i++,i>32))return o;if(n===41){if(i===0)break;i--}r++}return t===r||i!==0||(o.str=Eu(e.slice(t,r)),o.pos=r,o.ok=!0),o}function p0(e,t,u,n){let r,o=t;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)i.str=n.str,i.marker=n.marker;else{if(o>=u)return i;let s=e.charCodeAt(o);if(s!==34&&s!==39&&s!==40)return i;t++,o++,s===40&&(s=41),i.marker=s}for(;o<u;){if(r=e.charCodeAt(o),r===i.marker)return i.pos=o+1,i.str+=Eu(e.slice(t,o)),i.ok=!0,i;if(r===40&&i.marker===41)return i;r===92&&o+1<u&&o++,o++}return i.can_continue=!0,i.str+=Eu(e.slice(t,o)),i}const h0=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:f0,parseLinkLabel:d0,parseLinkTitle:p0},Symbol.toStringTag,{value:"Module"})),jt={};jt.code_inline=function(e,t,u,n,r){const o=e[t];return"<code"+r.renderAttrs(o)+">"+ou(o.content)+"</code>"};jt.code_block=function(e,t,u,n,r){const o=e[t];return"<pre"+r.renderAttrs(o)+"><code>"+ou(e[t].content)+`</code></pre>
|
|
221
|
+
`};jt.fence=function(e,t,u,n,r){const o=e[t],i=o.info?Eu(o.info).trim():"";let s="",a="";if(i){const d=i.split(/(\s+)/g);s=d[0],a=d.slice(2).join("")}let l;if(u.highlight?l=u.highlight(o.content,s,a)||ou(o.content):l=ou(o.content),l.indexOf("<pre")===0)return l+`
|
|
222
|
+
`;if(i){const d=o.attrIndex("class"),p=o.attrs?o.attrs.slice():[];d<0?p.push(["class",u.langPrefix+s]):(p[d]=p[d].slice(),p[d][1]+=" "+u.langPrefix+s);const m={attrs:p};return`<pre><code${r.renderAttrs(m)}>${l}</code></pre>
|
|
223
|
+
`}return`<pre><code${r.renderAttrs(o)}>${l}</code></pre>
|
|
224
|
+
`};jt.image=function(e,t,u,n,r){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=r.renderInlineAsText(o.children,u,n),r.renderToken(e,t,u)};jt.hardbreak=function(e,t,u){return u.xhtmlOut?`<br />
|
|
225
|
+
`:`<br>
|
|
226
|
+
`};jt.softbreak=function(e,t,u){return u.breaks?u.xhtmlOut?`<br />
|
|
227
|
+
`:`<br>
|
|
228
|
+
`:`
|
|
229
|
+
`};jt.text=function(e,t){return ou(e[t].content)};jt.html_block=function(e,t){return e[t].content};jt.html_inline=function(e,t){return e[t].content};function Du(){this.rules=Pn({},jt)}Du.prototype.renderAttrs=function(t){let u,n,r;if(!t.attrs)return"";for(r="",u=0,n=t.attrs.length;u<n;u++)r+=" "+ou(t.attrs[u][0])+'="'+ou(t.attrs[u][1])+'"';return r};Du.prototype.renderToken=function(t,u,n){const r=t[u];let o="";if(r.hidden)return"";r.block&&r.nesting!==-1&&u&&t[u-1].hidden&&(o+=`
|
|
230
|
+
`),o+=(r.nesting===-1?"</":"<")+r.tag,o+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(o+=" /");let i=!1;if(r.block&&(i=!0,r.nesting===1&&u+1<t.length)){const s=t[u+1];(s.type==="inline"||s.hidden||s.nesting===-1&&s.tag===r.tag)&&(i=!1)}return o+=i?`>
|
|
231
|
+
`:">",o};Du.prototype.renderInline=function(e,t,u){let n="";const r=this.rules;for(let o=0,i=e.length;o<i;o++){const s=e[o].type;typeof r[s]<"u"?n+=r[s](e,o,t,u,this):n+=this.renderToken(e,o,t)}return n};Du.prototype.renderInlineAsText=function(e,t,u){let n="";for(let r=0,o=e.length;r<o;r++)switch(e[r].type){case"text":n+=e[r].content;break;case"image":n+=this.renderInlineAsText(e[r].children,t,u);break;case"html_inline":case"html_block":n+=e[r].content;break;case"softbreak":case"hardbreak":n+=`
|
|
232
|
+
`;break}return n};Du.prototype.render=function(e,t,u){let n="";const r=this.rules;for(let o=0,i=e.length;o<i;o++){const s=e[o].type;s==="inline"?n+=this.renderInline(e[o].children,t,u):typeof r[s]<"u"?n+=r[s](e,o,t,u,this):n+=this.renderToken(e,o,t,u)}return n};function yt(){this.__rules__=[],this.__cache__=null}yt.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};yt.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(u){u.enabled&&u.alt.forEach(function(n){t.indexOf(n)<0&&t.push(n)})}),e.__cache__={},t.forEach(function(u){e.__cache__[u]=[],e.__rules__.forEach(function(n){n.enabled&&(u&&n.alt.indexOf(u)<0||e.__cache__[u].push(n.fn))})})};yt.prototype.at=function(e,t,u){const n=this.__find__(e),r=u||{};if(n===-1)throw new Error("Parser rule not found: "+e);this.__rules__[n].fn=t,this.__rules__[n].alt=r.alt||[],this.__cache__=null};yt.prototype.before=function(e,t,u,n){const r=this.__find__(e),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:u,alt:o.alt||[]}),this.__cache__=null};yt.prototype.after=function(e,t,u,n){const r=this.__find__(e),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:u,alt:o.alt||[]}),this.__cache__=null};yt.prototype.push=function(e,t,u){const n=u||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null};yt.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const u=[];return e.forEach(function(n){const r=this.__find__(n);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+n)}this.__rules__[r].enabled=!0,u.push(n)},this),this.__cache__=null,u};yt.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(u){u.enabled=!1}),this.enable(e,t)};yt.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const u=[];return e.forEach(function(n){const r=this.__find__(n);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+n)}this.__rules__[r].enabled=!1,u.push(n)},this),this.__cache__=null,u};yt.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Mt(e,t,u){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=u,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Mt.prototype.attrIndex=function(t){if(!this.attrs)return-1;const u=this.attrs;for(let n=0,r=u.length;n<r;n++)if(u[n][0]===t)return n;return-1};Mt.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};Mt.prototype.attrSet=function(t,u){const n=this.attrIndex(t),r=[t,u];n<0?this.attrPush(r):this.attrs[n]=r};Mt.prototype.attrGet=function(t){const u=this.attrIndex(t);let n=null;return u>=0&&(n=this.attrs[u][1]),n};Mt.prototype.attrJoin=function(t,u){const n=this.attrIndex(t);n<0?this.attrPush([t,u]):this.attrs[n][1]=this.attrs[n][1]+" "+u};function ds(e,t,u){this.src=e,this.env=u,this.tokens=[],this.inlineMode=!1,this.md=t}ds.prototype.Token=Mt;const m0=/\r\n?|\n/g,g0=/\0/g;function b0(e){let t;t=e.src.replace(m0,`
|
|
233
|
+
`),t=t.replace(g0,"�"),e.src=t}function x0(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function v0(e){const t=e.tokens;for(let u=0,n=t.length;u<n;u++){const r=t[u];r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function y0(e){return/^<a[>\s]/i.test(e)}function k0(e){return/^<\/a\s*>/i.test(e)}function _0(e){const t=e.tokens;if(e.md.options.linkify)for(let u=0,n=t.length;u<n;u++){if(t[u].type!=="inline"||!e.md.linkify.pretest(t[u].content))continue;let r=t[u].children,o=0;for(let i=r.length-1;i>=0;i--){const s=r[i];if(s.type==="link_close"){for(i--;r[i].level!==s.level&&r[i].type!=="link_open";)i--;continue}if(s.type==="html_inline"&&(y0(s.content)&&o>0&&o--,k0(s.content)&&o++),!(o>0)&&s.type==="text"&&e.md.linkify.test(s.content)){const a=s.content;let l=e.md.linkify.match(a);const d=[];let p=s.level,m=0;l.length>0&&l[0].index===0&&i>0&&r[i-1].type==="text_special"&&(l=l.slice(1));for(let _=0;_<l.length;_++){const b=l[_].url,E=e.md.normalizeLink(b);if(!e.md.validateLink(E))continue;let j=l[_].text;l[_].schema?l[_].schema==="mailto:"&&!/^mailto:/i.test(j)?j=e.md.normalizeLinkText("mailto:"+j).replace(/^mailto:/,""):j=e.md.normalizeLinkText(j):j=e.md.normalizeLinkText("http://"+j).replace(/^http:\/\//,"");const y=l[_].index;if(y>m){const $=new e.Token("text","",0);$.content=a.slice(m,y),$.level=p,d.push($)}const x=new e.Token("link_open","a",1);x.attrs=[["href",E]],x.level=p++,x.markup="linkify",x.info="auto",d.push(x);const D=new e.Token("text","",0);D.content=j,D.level=p,d.push(D);const P=new e.Token("link_close","a",-1);P.level=--p,P.markup="linkify",P.info="auto",d.push(P),m=l[_].lastIndex}if(m<a.length){const _=new e.Token("text","",0);_.content=a.slice(m),_.level=p,d.push(_)}t[u].children=r=ls(r,i,d)}}}}const fs=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,S0=/\((c|tm|r)\)/i,w0=/\((c|tm|r)\)/ig,T0={c:"©",r:"®",tm:"™"};function C0(e,t){return T0[t.toLowerCase()]}function E0(e){let t=0;for(let u=e.length-1;u>=0;u--){const n=e[u];n.type==="text"&&!t&&(n.content=n.content.replace(w0,C0)),n.type==="link_open"&&n.info==="auto"&&t--,n.type==="link_close"&&n.info==="auto"&&t++}}function A0(e){let t=0;for(let u=e.length-1;u>=0;u--){const n=e[u];n.type==="text"&&!t&&fs.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),n.type==="link_open"&&n.info==="auto"&&t--,n.type==="link_close"&&n.info==="auto"&&t++}}function D0(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(S0.test(e.tokens[t].content)&&E0(e.tokens[t].children),fs.test(e.tokens[t].content)&&A0(e.tokens[t].children))}const I0=/['"]/,ir=/['"]/g,ar="’";function pn(e,t,u){return e.slice(0,t)+u+e.slice(t+1)}function F0(e,t){let u;const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=e[r].level;for(u=n.length-1;u>=0&&!(n[u].level<=i);u--);if(n.length=u+1,o.type!=="text")continue;let s=o.content,a=0,l=s.length;e:for(;a<l;){ir.lastIndex=a;const d=ir.exec(s);if(!d)break;let p=!0,m=!0;a=d.index+1;const _=d[0]==="'";let b=32;if(d.index-1>=0)b=s.charCodeAt(d.index-1);else for(u=r-1;u>=0&&!(e[u].type==="softbreak"||e[u].type==="hardbreak");u--)if(e[u].content){b=e[u].content.charCodeAt(e[u].content.length-1);break}let E=32;if(a<l)E=s.charCodeAt(a);else for(u=r+1;u<e.length&&!(e[u].type==="softbreak"||e[u].type==="hardbreak");u++)if(e[u].content){E=e[u].content.charCodeAt(0);break}const j=Xu(b)||Zu(String.fromCharCode(b)),y=Xu(E)||Zu(String.fromCharCode(E)),x=Gu(b),D=Gu(E);if(D?p=!1:y&&(x||j||(p=!1)),x?m=!1:j&&(D||y||(m=!1)),E===34&&d[0]==='"'&&b>=48&&b<=57&&(m=p=!1),p&&m&&(p=j,m=y),!p&&!m){_&&(o.content=pn(o.content,d.index,ar));continue}if(m)for(u=n.length-1;u>=0;u--){let P=n[u];if(n[u].level<i)break;if(P.single===_&&n[u].level===i){P=n[u];let $,Z;_?($=t.md.options.quotes[2],Z=t.md.options.quotes[3]):($=t.md.options.quotes[0],Z=t.md.options.quotes[1]),o.content=pn(o.content,d.index,Z),e[P.token].content=pn(e[P.token].content,P.pos,$),a+=Z.length-1,P.token===r&&(a+=$.length-1),s=o.content,l=s.length,n.length=u;continue e}}p?n.push({token:r,pos:d.index,single:_,level:i}):m&&_&&(o.content=pn(o.content,d.index,ar))}}}function $0(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!I0.test(e.tokens[t].content)||F0(e.tokens[t].children,e)}function M0(e){let t,u;const n=e.tokens,r=n.length;for(let o=0;o<r;o++){if(n[o].type!=="inline")continue;const i=n[o].children,s=i.length;for(t=0;t<s;t++)i[t].type==="text_special"&&(i[t].type="text");for(t=u=0;t<s;t++)i[t].type==="text"&&t+1<s&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==u&&(i[u]=i[t]),u++);t!==u&&(i.length=u)}}const Xn=[["normalize",b0],["block",x0],["inline",v0],["linkify",_0],["replacements",D0],["smartquotes",$0],["text_join",M0]];function Po(){this.ruler=new yt;for(let e=0;e<Xn.length;e++)this.ruler.push(Xn[e][0],Xn[e][1])}Po.prototype.process=function(e){const t=this.ruler.getRules("");for(let u=0,n=t.length;u<n;u++)t[u](e)};Po.prototype.State=ds;function Ut(e,t,u,n){this.src=e,this.md=t,this.env=u,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let o=0,i=0,s=0,a=0,l=r.length,d=!1;i<l;i++){const p=r.charCodeAt(i);if(!d)if(je(p)){s++,p===9?a+=4-a%4:a++;continue}else d=!0;(p===10||i===l-1)&&(p!==10&&i++,this.bMarks.push(o),this.eMarks.push(i),this.tShift.push(s),this.sCount.push(a),this.bsCount.push(0),d=!1,s=0,a=0,o=i+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Ut.prototype.push=function(e,t,u){const n=new Mt(e,t,u);return n.block=!0,u<0&&this.level--,n.level=this.level,u>0&&this.level++,this.tokens.push(n),n};Ut.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};Ut.prototype.skipEmptyLines=function(t){for(let u=this.lineMax;t<u&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};Ut.prototype.skipSpaces=function(t){for(let u=this.src.length;t<u;t++){const n=this.src.charCodeAt(t);if(!je(n))break}return t};Ut.prototype.skipSpacesBack=function(t,u){if(t<=u)return t;for(;t>u;)if(!je(this.src.charCodeAt(--t)))return t+1;return t};Ut.prototype.skipChars=function(t,u){for(let n=this.src.length;t<n&&this.src.charCodeAt(t)===u;t++);return t};Ut.prototype.skipCharsBack=function(t,u,n){if(t<=n)return t;for(;t>n;)if(u!==this.src.charCodeAt(--t))return t+1;return t};Ut.prototype.getLines=function(t,u,n,r){if(t>=u)return"";const o=new Array(u-t);for(let i=0,s=t;s<u;s++,i++){let a=0;const l=this.bMarks[s];let d=l,p;for(s+1<u||r?p=this.eMarks[s]+1:p=this.eMarks[s];d<p&&a<n;){const m=this.src.charCodeAt(d);if(je(m))m===9?a+=4-(a+this.bsCount[s])%4:a++;else if(d-l<this.tShift[s])a++;else break;d++}a>n?o[i]=new Array(a-n+1).join(" ")+this.src.slice(d,p):o[i]=this.src.slice(d,p)}return o.join("")};Ut.prototype.Token=Mt;const P0=65536;function Yn(e,t){const u=e.bMarks[t]+e.tShift[t],n=e.eMarks[t];return e.src.slice(u,n)}function lr(e){const t=[],u=e.length;let n=0,r=e.charCodeAt(n),o=!1,i=0,s="";for(;n<u;)r===124&&(o?(s+=e.substring(i,n-1),i=n):(t.push(s+e.substring(i,n)),s="",i=n+1)),o=r===92,n++,r=e.charCodeAt(n);return t.push(s+e.substring(i)),t}function B0(e,t,u,n){if(t+2>u)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)return!1;let o=e.bMarks[r]+e.tShift[r];if(o>=e.eMarks[r])return!1;const i=e.src.charCodeAt(o++);if(i!==124&&i!==45&&i!==58||o>=e.eMarks[r])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58&&!je(s)||i===45&&je(s))return!1;for(;o<e.eMarks[r];){const P=e.src.charCodeAt(o);if(P!==124&&P!==45&&P!==58&&!je(P))return!1;o++}let a=Yn(e,t+1),l=a.split("|");const d=[];for(let P=0;P<l.length;P++){const $=l[P].trim();if(!$){if(P===0||P===l.length-1)continue;return!1}if(!/^:?-+:?$/.test($))return!1;$.charCodeAt($.length-1)===58?d.push($.charCodeAt(0)===58?"center":"right"):$.charCodeAt(0)===58?d.push("left"):d.push("")}if(a=Yn(e,t).trim(),a.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=lr(a),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop();const p=l.length;if(p===0||p!==d.length)return!1;if(n)return!0;const m=e.parentType;e.parentType="table";const _=e.md.block.ruler.getRules("blockquote"),b=e.push("table_open","table",1),E=[t,0];b.map=E;const j=e.push("thead_open","thead",1);j.map=[t,t+1];const y=e.push("tr_open","tr",1);y.map=[t,t+1];for(let P=0;P<l.length;P++){const $=e.push("th_open","th",1);d[P]&&($.attrs=[["style","text-align:"+d[P]]]);const Z=e.push("inline","",0);Z.content=l[P].trim(),Z.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let x,D=0;for(r=t+2;r<u&&!(e.sCount[r]<e.blkIndent);r++){let P=!1;for(let Z=0,w=_.length;Z<w;Z++)if(_[Z](e,r,u,!0)){P=!0;break}if(P||(a=Yn(e,r).trim(),!a)||e.sCount[r]-e.blkIndent>=4||(l=lr(a),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop(),D+=p-l.length,D>P0))break;if(r===t+2){const Z=e.push("tbody_open","tbody",1);Z.map=x=[t+2,0]}const $=e.push("tr_open","tr",1);$.map=[r,r+1];for(let Z=0;Z<p;Z++){const w=e.push("td_open","td",1);d[Z]&&(w.attrs=[["style","text-align:"+d[Z]]]);const J=e.push("inline","",0);J.content=l[Z]?l[Z].trim():"",J.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return x&&(e.push("tbody_close","tbody",-1),x[1]=r),e.push("table_close","table",-1),E[1]=r,e.parentType=m,e.line=r,!0}function R0(e,t,u){if(e.sCount[t]-e.blkIndent<4)return!1;let n=t+1,r=n;for(;n<u;){if(e.isEmpty(n)){n++;continue}if(e.sCount[n]-e.blkIndent>=4){n++,r=n;continue}break}e.line=r;const o=e.push("code_block","code",0);return o.content=e.getLines(t,r,4+e.blkIndent,!1)+`
|
|
234
|
+
`,o.map=[t,e.line],!0}function L0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>o)return!1;const i=e.src.charCodeAt(r);if(i!==126&&i!==96)return!1;let s=r;r=e.skipChars(r,i);let a=r-s;if(a<3)return!1;const l=e.src.slice(s,r),d=e.src.slice(r,o);if(i===96&&d.indexOf(String.fromCharCode(i))>=0)return!1;if(n)return!0;let p=t,m=!1;for(;p++,!(p>=u||(r=s=e.bMarks[p]+e.tShift[p],o=e.eMarks[p],r<o&&e.sCount[p]<e.blkIndent));)if(e.src.charCodeAt(r)===i&&!(e.sCount[p]-e.blkIndent>=4)&&(r=e.skipChars(r,i),!(r-s<a)&&(r=e.skipSpaces(r),!(r<o)))){m=!0;break}a=e.sCount[t],e.line=p+(m?1:0);const _=e.push("fence","code",0);return _.info=d,_.content=e.getLines(t+1,p,a,!0),_.markup=l,_.map=[t,e.line],!0}function N0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const i=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(n)return!0;const s=[],a=[],l=[],d=[],p=e.md.block.ruler.getRules("blockquote"),m=e.parentType;e.parentType="blockquote";let _=!1,b;for(b=t;b<u;b++){const D=e.sCount[b]<e.blkIndent;if(r=e.bMarks[b]+e.tShift[b],o=e.eMarks[b],r>=o)break;if(e.src.charCodeAt(r++)===62&&!D){let $=e.sCount[b]+1,Z,w;e.src.charCodeAt(r)===32?(r++,$++,w=!1,Z=!0):e.src.charCodeAt(r)===9?(Z=!0,(e.bsCount[b]+$)%4===3?(r++,$++,w=!1):w=!0):Z=!1;let J=$;for(s.push(e.bMarks[b]),e.bMarks[b]=r;r<o;){const Q=e.src.charCodeAt(r);if(je(Q))Q===9?J+=4-(J+e.bsCount[b]+(w?1:0))%4:J++;else break;r++}_=r>=o,a.push(e.bsCount[b]),e.bsCount[b]=e.sCount[b]+1+(Z?1:0),l.push(e.sCount[b]),e.sCount[b]=J-$,d.push(e.tShift[b]),e.tShift[b]=r-e.bMarks[b];continue}if(_)break;let P=!1;for(let $=0,Z=p.length;$<Z;$++)if(p[$](e,b,u,!0)){P=!0;break}if(P){e.lineMax=b,e.blkIndent!==0&&(s.push(e.bMarks[b]),a.push(e.bsCount[b]),d.push(e.tShift[b]),l.push(e.sCount[b]),e.sCount[b]-=e.blkIndent);break}s.push(e.bMarks[b]),a.push(e.bsCount[b]),d.push(e.tShift[b]),l.push(e.sCount[b]),e.sCount[b]=-1}const E=e.blkIndent;e.blkIndent=0;const j=e.push("blockquote_open","blockquote",1);j.markup=">";const y=[t,0];j.map=y,e.md.block.tokenize(e,t,b);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=i,e.parentType=m,y[1]=e.line;for(let D=0;D<d.length;D++)e.bMarks[D+t]=s[D],e.tShift[D+t]=d[D],e.sCount[D+t]=l[D],e.bsCount[D+t]=a[D];return e.blkIndent=E,!0}function O0(e,t,u,n){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(o++);if(i!==42&&i!==45&&i!==95)return!1;let s=1;for(;o<r;){const l=e.src.charCodeAt(o++);if(l!==i&&!je(l))return!1;l===i&&s++}if(s<3)return!1;if(n)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=Array(s+1).join(String.fromCharCode(i)),!0}function cr(e,t){const u=e.eMarks[t];let n=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(n++);if(r!==42&&r!==45&&r!==43)return-1;if(n<u){const o=e.src.charCodeAt(n);if(!je(o))return-1}return n}function dr(e,t){const u=e.bMarks[t]+e.tShift[t],n=e.eMarks[t];let r=u;if(r+1>=n)return-1;let o=e.src.charCodeAt(r++);if(o<48||o>57)return-1;for(;;){if(r>=n)return-1;if(o=e.src.charCodeAt(r++),o>=48&&o<=57){if(r-u>=10)return-1;continue}if(o===41||o===46)break;return-1}return r<n&&(o=e.src.charCodeAt(r),!je(o))?-1:r}function z0(e,t){const u=e.level+2;for(let n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===u&&e.tokens[n].type==="paragraph_open"&&(e.tokens[n+2].hidden=!0,e.tokens[n].hidden=!0,n+=2)}function q0(e,t,u,n){let r,o,i,s,a=t,l=!0;if(e.sCount[a]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[a]-e.listIndent>=4&&e.sCount[a]<e.blkIndent)return!1;let d=!1;n&&e.parentType==="paragraph"&&e.sCount[a]>=e.blkIndent&&(d=!0);let p,m,_;if((_=dr(e,a))>=0){if(p=!0,i=e.bMarks[a]+e.tShift[a],m=Number(e.src.slice(i,_-1)),d&&m!==1)return!1}else if((_=cr(e,a))>=0)p=!1;else return!1;if(d&&e.skipSpaces(_)>=e.eMarks[a])return!1;if(n)return!0;const b=e.src.charCodeAt(_-1),E=e.tokens.length;p?(s=e.push("ordered_list_open","ol",1),m!==1&&(s.attrs=[["start",m]])):s=e.push("bullet_list_open","ul",1);const j=[a,0];s.map=j,s.markup=String.fromCharCode(b);let y=!1;const x=e.md.block.ruler.getRules("list"),D=e.parentType;for(e.parentType="list";a<u;){o=_,r=e.eMarks[a];const P=e.sCount[a]+_-(e.bMarks[a]+e.tShift[a]);let $=P;for(;o<r;){const ce=e.src.charCodeAt(o);if(ce===9)$+=4-($+e.bsCount[a])%4;else if(ce===32)$++;else break;o++}const Z=o;let w;Z>=r?w=1:w=$-P,w>4&&(w=1);const J=P+w;s=e.push("list_item_open","li",1),s.markup=String.fromCharCode(b);const Q=[a,0];s.map=Q,p&&(s.info=e.src.slice(i,_-1));const R=e.tight,q=e.tShift[a],ne=e.sCount[a],re=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=J,e.tight=!0,e.tShift[a]=Z-e.bMarks[a],e.sCount[a]=$,Z>=r&&e.isEmpty(a+1)?e.line=Math.min(e.line+2,u):e.md.block.tokenize(e,a,u,!0),(!e.tight||y)&&(l=!1),y=e.line-a>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=re,e.tShift[a]=q,e.sCount[a]=ne,e.tight=R,s=e.push("list_item_close","li",-1),s.markup=String.fromCharCode(b),a=e.line,Q[1]=a,a>=u||e.sCount[a]<e.blkIndent||e.sCount[a]-e.blkIndent>=4)break;let be=!1;for(let ce=0,O=x.length;ce<O;ce++)if(x[ce](e,a,u,!0)){be=!0;break}if(be)break;if(p){if(_=dr(e,a),_<0)break;i=e.bMarks[a]+e.tShift[a]}else if(_=cr(e,a),_<0)break;if(b!==e.src.charCodeAt(_-1))break}return p?s=e.push("ordered_list_close","ol",-1):s=e.push("bullet_list_close","ul",-1),s.markup=String.fromCharCode(b),j[1]=a,e.line=a,e.parentType=D,l&&z0(e,E),!0}function j0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],i=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function s(x){const D=e.lineMax;if(x>=D||e.isEmpty(x))return null;let P=!1;if(e.sCount[x]-e.blkIndent>3&&(P=!0),e.sCount[x]<0&&(P=!0),!P){const w=e.md.block.ruler.getRules("reference"),J=e.parentType;e.parentType="reference";let Q=!1;for(let R=0,q=w.length;R<q;R++)if(w[R](e,x,D,!0)){Q=!0;break}if(e.parentType=J,Q)return null}const $=e.bMarks[x]+e.tShift[x],Z=e.eMarks[x];return e.src.slice($,Z+1)}let a=e.src.slice(r,o+1);o=a.length;let l=-1;for(r=1;r<o;r++){const x=a.charCodeAt(r);if(x===91)return!1;if(x===93){l=r;break}else if(x===10){const D=s(i);D!==null&&(a+=D,o=a.length,i++)}else if(x===92&&(r++,r<o&&a.charCodeAt(r)===10)){const D=s(i);D!==null&&(a+=D,o=a.length,i++)}}if(l<0||a.charCodeAt(l+1)!==58)return!1;for(r=l+2;r<o;r++){const x=a.charCodeAt(r);if(x===10){const D=s(i);D!==null&&(a+=D,o=a.length,i++)}else if(!je(x))break}const d=e.md.helpers.parseLinkDestination(a,r,o);if(!d.ok)return!1;const p=e.md.normalizeLink(d.str);if(!e.md.validateLink(p))return!1;r=d.pos;const m=r,_=i,b=r;for(;r<o;r++){const x=a.charCodeAt(r);if(x===10){const D=s(i);D!==null&&(a+=D,o=a.length,i++)}else if(!je(x))break}let E=e.md.helpers.parseLinkTitle(a,r,o);for(;E.can_continue;){const x=s(i);if(x===null)break;a+=x,r=o,o=a.length,i++,E=e.md.helpers.parseLinkTitle(a,r,o,E)}let j;for(r<o&&b!==r&&E.ok?(j=E.str,r=E.pos):(j="",r=m,i=_);r<o;){const x=a.charCodeAt(r);if(!je(x))break;r++}if(r<o&&a.charCodeAt(r)!==10&&j)for(j="",r=m,i=_;r<o;){const x=a.charCodeAt(r);if(!je(x))break;r++}if(r<o&&a.charCodeAt(r)!==10)return!1;const y=Bn(a.slice(1,l));return y?(n||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[y]>"u"&&(e.env.references[y]={title:j,href:p}),e.line=i),!0):!1}const U0=["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"],V0="[a-zA-Z_:][a-zA-Z0-9:._-]*",H0="[^\"'=<>`\\x00-\\x20]+",W0="'[^']*'",K0='"[^"]*"',G0="(?:"+H0+"|"+W0+"|"+K0+")",Z0="(?:\\s+"+V0+"(?:\\s*=\\s*"+G0+")?)",ps="<[A-Za-z][A-Za-z0-9\\-]*"+Z0+"*\\s*\\/?>",hs="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",X0="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",Y0="<[?][\\s\\S]*?[?]>",J0="<![A-Za-z][^>]*>",Q0="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",ed=new RegExp("^(?:"+ps+"|"+hs+"|"+X0+"|"+Y0+"|"+J0+"|"+Q0+")"),td=new RegExp("^(?:"+ps+"|"+hs+")"),ku=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+U0.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(td.source+"\\s*$"),/^$/,!1]];function ud(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let i=e.src.slice(r,o),s=0;for(;s<ku.length&&!ku[s][0].test(i);s++);if(s===ku.length)return!1;if(n)return ku[s][2];let a=t+1;if(!ku[s][1].test(i)){for(;a<u&&!(e.sCount[a]<e.blkIndent);a++)if(r=e.bMarks[a]+e.tShift[a],o=e.eMarks[a],i=e.src.slice(r,o),ku[s][1].test(i)){i.length!==0&&a++;break}}e.line=a;const l=e.push("html_block","",0);return l.map=[t,a],l.content=e.getLines(t,a,e.blkIndent,!0),!0}function nd(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.src.charCodeAt(r);if(i!==35||r>=o)return!1;let s=1;for(i=e.src.charCodeAt(++r);i===35&&r<o&&s<=6;)s++,i=e.src.charCodeAt(++r);if(s>6||r<o&&!je(i))return!1;if(n)return!0;o=e.skipSpacesBack(o,r);const a=e.skipCharsBack(o,35,r);a>r&&je(e.src.charCodeAt(a-1))&&(o=a),e.line=t+1;const l=e.push("heading_open","h"+String(s),1);l.markup="########".slice(0,s),l.map=[t,e.line];const d=e.push("inline","",0);d.content=e.src.slice(r,o).trim(),d.map=[t,e.line],d.children=[];const p=e.push("heading_close","h"+String(s),-1);return p.markup="########".slice(0,s),!0}function od(e,t,u){const n=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let o=0,i,s=t+1;for(;s<u&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let _=e.bMarks[s]+e.tShift[s];const b=e.eMarks[s];if(_<b&&(i=e.src.charCodeAt(_),(i===45||i===61)&&(_=e.skipChars(_,i),_=e.skipSpaces(_),_>=b))){o=i===61?1:2;break}}if(e.sCount[s]<0)continue;let m=!1;for(let _=0,b=n.length;_<b;_++)if(n[_](e,s,u,!0)){m=!0;break}if(m)break}if(!o)return!1;const a=e.getLines(t,s,e.blkIndent,!1).trim();e.line=s+1;const l=e.push("heading_open","h"+String(o),1);l.markup=String.fromCharCode(i),l.map=[t,e.line];const d=e.push("inline","",0);d.content=a,d.map=[t,e.line-1],d.children=[];const p=e.push("heading_close","h"+String(o),-1);return p.markup=String.fromCharCode(i),e.parentType=r,!0}function rd(e,t,u){const n=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let o=t+1;for(e.parentType="paragraph";o<u&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let l=!1;for(let d=0,p=n.length;d<p;d++)if(n[d](e,o,u,!0)){l=!0;break}if(l)break}const i=e.getLines(t,o,e.blkIndent,!1).trim();e.line=o;const s=e.push("paragraph_open","p",1);s.map=[t,e.line];const a=e.push("inline","",0);return a.content=i,a.map=[t,e.line],a.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const hn=[["table",B0,["paragraph","reference"]],["code",R0],["fence",L0,["paragraph","reference","blockquote","list"]],["blockquote",N0,["paragraph","reference","blockquote","list"]],["hr",O0,["paragraph","reference","blockquote","list"]],["list",q0,["paragraph","reference","blockquote"]],["reference",j0],["html_block",ud,["paragraph","reference","blockquote"]],["heading",nd,["paragraph","reference","blockquote"]],["lheading",od],["paragraph",rd]];function Rn(){this.ruler=new yt;for(let e=0;e<hn.length;e++)this.ruler.push(hn[e][0],hn[e][1],{alt:(hn[e][2]||[]).slice()})}Rn.prototype.tokenize=function(e,t,u){const n=this.ruler.getRules(""),r=n.length,o=e.md.options.maxNesting;let i=t,s=!1;for(;i<u&&(e.line=i=e.skipEmptyLines(i),!(i>=u||e.sCount[i]<e.blkIndent));){if(e.level>=o){e.line=u;break}const a=e.line;let l=!1;for(let d=0;d<r;d++)if(l=n[d](e,i,u,!1),l){if(a>=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),i=e.line,i<u&&e.isEmpty(i)&&(s=!0,i++,e.line=i)}};Rn.prototype.parse=function(e,t,u,n){if(!e)return;const r=new this.State(e,t,u,n);this.tokenize(r,r.line,r.lineMax)};Rn.prototype.State=Ut;function en(e,t,u,n){this.src=e,this.env=u,this.md=t,this.tokens=n,this.tokens_meta=Array(n.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}en.prototype.pushPending=function(){const e=new Mt("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};en.prototype.push=function(e,t,u){this.pending&&this.pushPending();const n=new Mt(e,t,u);let r=null;return u<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),n.level=this.level,u>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(r),n};en.prototype.scanDelims=function(e,t){const u=this.posMax,n=this.src.charCodeAt(e),r=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o<u&&this.src.charCodeAt(o)===n;)o++;const i=o-e,s=o<u?this.src.charCodeAt(o):32,a=Xu(r)||Zu(String.fromCharCode(r)),l=Xu(s)||Zu(String.fromCharCode(s)),d=Gu(r),p=Gu(s),m=!p&&(!l||d||a),_=!d&&(!a||p||l);return{can_open:m&&(t||!_||a),can_close:_&&(t||!m||l),length:i}};en.prototype.Token=Mt;function sd(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function id(e,t){let u=e.pos;for(;u<e.posMax&&!sd(e.src.charCodeAt(u));)u++;return u===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,u)),e.pos=u,!0)}const ad=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function ld(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const u=e.pos,n=e.posMax;if(u+3>n||e.src.charCodeAt(u)!==58||e.src.charCodeAt(u+1)!==47||e.src.charCodeAt(u+2)!==47)return!1;const r=e.pending.match(ad);if(!r)return!1;const o=r[1],i=e.md.linkify.matchAtStart(e.src.slice(u-o.length));if(!i)return!1;let s=i.url;if(s.length<=o.length)return!1;let a=s.length;for(;a>0&&s.charCodeAt(a-1)===42;)a--;a!==s.length&&(s=s.slice(0,a));const l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const d=e.push("link_open","a",1);d.attrs=[["href",l]],d.markup="linkify",d.info="auto";const p=e.push("text","",0);p.content=e.md.normalizeLinkText(s);const m=e.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return e.pos+=s.length-o.length,!0}function cd(e,t){let u=e.pos;if(e.src.charCodeAt(u)!==10)return!1;const n=e.pending.length-1,r=e.posMax;if(!t)if(n>=0&&e.pending.charCodeAt(n)===32)if(n>=1&&e.pending.charCodeAt(n-1)===32){let o=n-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(u++;u<r&&je(e.src.charCodeAt(u));)u++;return e.pos=u,!0}const Bo=[];for(let e=0;e<256;e++)Bo.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Bo[e.charCodeAt(0)]=1});function dd(e,t){let u=e.pos;const n=e.posMax;if(e.src.charCodeAt(u)!==92||(u++,u>=n))return!1;let r=e.src.charCodeAt(u);if(r===10){for(t||e.push("hardbreak","br",0),u++;u<n&&(r=e.src.charCodeAt(u),!!je(r));)u++;return e.pos=u,!0}let o=e.src[u];if(r>=55296&&r<=56319&&u+1<n){const s=e.src.charCodeAt(u+1);s>=56320&&s<=57343&&(o+=e.src[u+1],u++)}const i="\\"+o;if(!t){const s=e.push("text_special","",0);r<256&&Bo[r]!==0?s.content=o:s.content=i,s.markup=i,s.info="escape"}return e.pos=u+1,!0}function fd(e,t){let u=e.pos;if(e.src.charCodeAt(u)!==96)return!1;const r=u;u++;const o=e.posMax;for(;u<o&&e.src.charCodeAt(u)===96;)u++;const i=e.src.slice(r,u),s=i.length;if(e.backticksScanned&&(e.backticks[s]||0)<=r)return t||(e.pending+=i),e.pos+=s,!0;let a=u,l;for(;(l=e.src.indexOf("`",a))!==-1;){for(a=l+1;a<o&&e.src.charCodeAt(a)===96;)a++;const d=a-l;if(d===s){if(!t){const p=e.push("code_inline","code",0);p.markup=i,p.content=e.src.slice(u,l).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=a,!0}e.backticks[d]=l}return e.backticksScanned=!0,t||(e.pending+=i),e.pos+=s,!0}function pd(e,t){const u=e.pos,n=e.src.charCodeAt(u);if(t||n!==126)return!1;const r=e.scanDelims(e.pos,!0);let o=r.length;const i=String.fromCharCode(n);if(o<2)return!1;let s;o%2&&(s=e.push("text","",0),s.content=i,o--);for(let a=0;a<o;a+=2)s=e.push("text","",0),s.content=i+i,e.delimiters.push({marker:n,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function fr(e,t){let u;const n=[],r=t.length;for(let o=0;o<r;o++){const i=t[o];if(i.marker!==126||i.end===-1)continue;const s=t[i.end];u=e.tokens[i.token],u.type="s_open",u.tag="s",u.nesting=1,u.markup="~~",u.content="",u=e.tokens[s.token],u.type="s_close",u.tag="s",u.nesting=-1,u.markup="~~",u.content="",e.tokens[s.token-1].type==="text"&&e.tokens[s.token-1].content==="~"&&n.push(s.token-1)}for(;n.length;){const o=n.pop();let i=o+1;for(;i<e.tokens.length&&e.tokens[i].type==="s_close";)i++;i--,o!==i&&(u=e.tokens[i],e.tokens[i]=e.tokens[o],e.tokens[o]=u)}}function hd(e){const t=e.tokens_meta,u=e.tokens_meta.length;fr(e,e.delimiters);for(let n=0;n<u;n++)t[n]&&t[n].delimiters&&fr(e,t[n].delimiters)}const ms={tokenize:pd,postProcess:hd};function md(e,t){const u=e.pos,n=e.src.charCodeAt(u);if(t||n!==95&&n!==42)return!1;const r=e.scanDelims(e.pos,n===42);for(let o=0;o<r.length;o++){const i=e.push("text","",0);i.content=String.fromCharCode(n),e.delimiters.push({marker:n,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function pr(e,t){const u=t.length;for(let n=u-1;n>=0;n--){const r=t[n];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const o=t[r.end],i=n>0&&t[n-1].end===r.end+1&&t[n-1].marker===r.marker&&t[n-1].token===r.token-1&&t[r.end+1].token===o.token+1,s=String.fromCharCode(r.marker),a=e.tokens[r.token];a.type=i?"strong_open":"em_open",a.tag=i?"strong":"em",a.nesting=1,a.markup=i?s+s:s,a.content="";const l=e.tokens[o.token];l.type=i?"strong_close":"em_close",l.tag=i?"strong":"em",l.nesting=-1,l.markup=i?s+s:s,l.content="",i&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--)}}function gd(e){const t=e.tokens_meta,u=e.tokens_meta.length;pr(e,e.delimiters);for(let n=0;n<u;n++)t[n]&&t[n].delimiters&&pr(e,t[n].delimiters)}const gs={tokenize:md,postProcess:gd};function bd(e,t){let u,n,r,o,i="",s="",a=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const d=e.pos,p=e.posMax,m=e.pos+1,_=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(_<0)return!1;let b=_+1;if(b<p&&e.src.charCodeAt(b)===40){for(l=!1,b++;b<p&&(u=e.src.charCodeAt(b),!(!je(u)&&u!==10));b++);if(b>=p)return!1;if(a=b,r=e.md.helpers.parseLinkDestination(e.src,b,e.posMax),r.ok){for(i=e.md.normalizeLink(r.str),e.md.validateLink(i)?b=r.pos:i="",a=b;b<p&&(u=e.src.charCodeAt(b),!(!je(u)&&u!==10));b++);if(r=e.md.helpers.parseLinkTitle(e.src,b,e.posMax),b<p&&a!==b&&r.ok)for(s=r.str,b=r.pos;b<p&&(u=e.src.charCodeAt(b),!(!je(u)&&u!==10));b++);}(b>=p||e.src.charCodeAt(b)!==41)&&(l=!0),b++}if(l){if(typeof e.env.references>"u")return!1;if(b<p&&e.src.charCodeAt(b)===91?(a=b+1,b=e.md.helpers.parseLinkLabel(e,b),b>=0?n=e.src.slice(a,b++):b=_+1):b=_+1,n||(n=e.src.slice(m,_)),o=e.env.references[Bn(n)],!o)return e.pos=d,!1;i=o.href,s=o.title}if(!t){e.pos=m,e.posMax=_;const E=e.push("link_open","a",1),j=[["href",i]];E.attrs=j,s&&j.push(["title",s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=b,e.posMax=p,!0}function xd(e,t){let u,n,r,o,i,s,a,l,d="";const p=e.pos,m=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const _=e.pos+2,b=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(b<0)return!1;if(o=b+1,o<m&&e.src.charCodeAt(o)===40){for(o++;o<m&&(u=e.src.charCodeAt(o),!(!je(u)&&u!==10));o++);if(o>=m)return!1;for(l=o,s=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),s.ok&&(d=e.md.normalizeLink(s.str),e.md.validateLink(d)?o=s.pos:d=""),l=o;o<m&&(u=e.src.charCodeAt(o),!(!je(u)&&u!==10));o++);if(s=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<m&&l!==o&&s.ok)for(a=s.str,o=s.pos;o<m&&(u=e.src.charCodeAt(o),!(!je(u)&&u!==10));o++);else a="";if(o>=m||e.src.charCodeAt(o)!==41)return e.pos=p,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<m&&e.src.charCodeAt(o)===91?(l=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?r=e.src.slice(l,o++):o=b+1):o=b+1,r||(r=e.src.slice(_,b)),i=e.env.references[Bn(r)],!i)return e.pos=p,!1;d=i.href,a=i.title}if(!t){n=e.src.slice(_,b);const E=[];e.md.inline.parse(n,e.md,e.env,E);const j=e.push("image","img",0),y=[["src",d],["alt",""]];j.attrs=y,j.children=E,j.content=n,a&&y.push(["title",a])}return e.pos=o,e.posMax=m,!0}const vd=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,yd=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function kd(e,t){let u=e.pos;if(e.src.charCodeAt(u)!==60)return!1;const n=e.pos,r=e.posMax;for(;;){if(++u>=r)return!1;const i=e.src.charCodeAt(u);if(i===60)return!1;if(i===62)break}const o=e.src.slice(n+1,u);if(yd.test(o)){const i=e.md.normalizeLink(o);if(!e.md.validateLink(i))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",i]],s.markup="autolink",s.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(o);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=o.length+2,!0}if(vd.test(o)){const i=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(i))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",i]],s.markup="autolink",s.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(o);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=o.length+2,!0}return!1}function _d(e){return/^<a[>\s]/i.test(e)}function Sd(e){return/^<\/a\s*>/i.test(e)}function wd(e){const t=e|32;return t>=97&&t<=122}function Td(e,t){if(!e.md.options.html)return!1;const u=e.posMax,n=e.pos;if(e.src.charCodeAt(n)!==60||n+2>=u)return!1;const r=e.src.charCodeAt(n+1);if(r!==33&&r!==63&&r!==47&&!wd(r))return!1;const o=e.src.slice(n).match(ed);if(!o)return!1;if(!t){const i=e.push("html_inline","",0);i.content=o[0],_d(i.content)&&e.linkLevel++,Sd(i.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const Cd=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Ed=/^&([a-z][a-z0-9]{1,31});/i;function Ad(e,t){const u=e.pos,n=e.posMax;if(e.src.charCodeAt(u)!==38||u+1>=n)return!1;if(e.src.charCodeAt(u+1)===35){const o=e.src.slice(u).match(Cd);if(o){if(!t){const i=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),s=e.push("text_special","",0);s.content=Mo(i)?An(i):An(65533),s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(u).match(Ed);if(o){const i=as(o[0]);if(i!==o[0]){if(!t){const s=e.push("text_special","",0);s.content=i,s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function hr(e){const t={},u=e.length;if(!u)return;let n=0,r=-2;const o=[];for(let i=0;i<u;i++){const s=e[i];if(o.push(0),(e[n].marker!==s.marker||r!==s.token-1)&&(n=i),r=s.token,s.length=s.length||0,!s.close)continue;t.hasOwnProperty(s.marker)||(t[s.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[s.marker][(s.open?3:0)+s.length%3];let l=n-o[n]-1,d=l;for(;l>a;l-=o[l]+1){const p=e[l];if(p.marker===s.marker&&p.open&&p.end<0){let m=!1;if((p.close||s.open)&&(p.length+s.length)%3===0&&(p.length%3!==0||s.length%3!==0)&&(m=!0),!m){const _=l>0&&!e[l-1].open?o[l-1]+1:0;o[i]=i-l+_,o[l]=_,s.open=!1,p.end=i,p.close=!1,d=-1,r=-2;break}}}d!==-1&&(t[s.marker][(s.open?3:0)+(s.length||0)%3]=d)}}function Dd(e){const t=e.tokens_meta,u=e.tokens_meta.length;hr(e.delimiters);for(let n=0;n<u;n++)t[n]&&t[n].delimiters&&hr(t[n].delimiters)}function Id(e){let t,u,n=0;const r=e.tokens,o=e.tokens.length;for(t=u=0;t<o;t++)r[t].nesting<0&&n--,r[t].level=n,r[t].nesting>0&&n++,r[t].type==="text"&&t+1<o&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==u&&(r[u]=r[t]),u++);t!==u&&(r.length=u)}const Jn=[["text",id],["linkify",ld],["newline",cd],["escape",dd],["backticks",fd],["strikethrough",ms.tokenize],["emphasis",gs.tokenize],["link",bd],["image",xd],["autolink",kd],["html_inline",Td],["entity",Ad]],Qn=[["balance_pairs",Dd],["strikethrough",ms.postProcess],["emphasis",gs.postProcess],["fragments_join",Id]];function tn(){this.ruler=new yt;for(let e=0;e<Jn.length;e++)this.ruler.push(Jn[e][0],Jn[e][1]);this.ruler2=new yt;for(let e=0;e<Qn.length;e++)this.ruler2.push(Qn[e][0],Qn[e][1])}tn.prototype.skipToken=function(e){const t=e.pos,u=this.ruler.getRules(""),n=u.length,r=e.md.options.maxNesting,o=e.cache;if(typeof o[t]<"u"){e.pos=o[t];return}let i=!1;if(e.level<r){for(let s=0;s<n;s++)if(e.level++,i=u[s](e,!0),e.level--,i){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;i||e.pos++,o[t]=e.pos};tn.prototype.tokenize=function(e){const t=this.ruler.getRules(""),u=t.length,n=e.posMax,r=e.md.options.maxNesting;for(;e.pos<n;){const o=e.pos;let i=!1;if(e.level<r){for(let s=0;s<u;s++)if(i=t[s](e,!1),i){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(e.pos>=n)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};tn.prototype.parse=function(e,t,u,n){const r=new this.State(e,t,u,n);this.tokenize(r);const o=this.ruler2.getRules(""),i=o.length;for(let s=0;s<i;s++)o[s](r)};tn.prototype.State=en;function Fd(e){const t={};e=e||{},t.src_Any=ns.source,t.src_Cc=os.source,t.src_Z=ss.source,t.src_P=Fo.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const u="[><|]";return t.src_pseudo_letter="(?:(?!"+u+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+u+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+u+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+u+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function go(e){return Array.prototype.slice.call(arguments,1).forEach(function(u){u&&Object.keys(u).forEach(function(n){e[n]=u[n]})}),e}function Ln(e){return Object.prototype.toString.call(e)}function $d(e){return Ln(e)==="[object String]"}function Md(e){return Ln(e)==="[object Object]"}function Pd(e){return Ln(e)==="[object RegExp]"}function mr(e){return Ln(e)==="[object Function]"}function Bd(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const bs={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Rd(e){return Object.keys(e||{}).reduce(function(t,u){return t||bs.hasOwnProperty(u)},!1)}const Ld={"http:":{validate:function(e,t,u){const n=e.slice(t);return u.re.http||(u.re.http=new RegExp("^\\/\\/"+u.re.src_auth+u.re.src_host_port_strict+u.re.src_path,"i")),u.re.http.test(n)?n.match(u.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,u){const n=e.slice(t);return u.re.no_http||(u.re.no_http=new RegExp("^"+u.re.src_auth+"(?:localhost|(?:(?:"+u.re.src_domain+")\\.)+"+u.re.src_domain_root+")"+u.re.src_port+u.re.src_host_terminator+u.re.src_path,"i")),u.re.no_http.test(n)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:n.match(u.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,u){const n=e.slice(t);return u.re.mailto||(u.re.mailto=new RegExp("^"+u.re.src_email_name+"@"+u.re.src_host_strict,"i")),u.re.mailto.test(n)?n.match(u.re.mailto)[0].length:0}}},Nd="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",Od="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function zd(e){e.__index__=-1,e.__text_cache__=""}function qd(e){return function(t,u){const n=t.slice(u);return e.test(n)?n.match(e)[0].length:0}}function gr(){return function(e,t){t.normalize(e)}}function Dn(e){const t=e.re=Fd(e.__opts__),u=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||u.push(Nd),u.push(t.src_xn),t.src_tlds=u.join("|");function n(s){return s.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(n(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(n(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(n(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(n(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function o(s,a){throw new Error('(LinkifyIt) Invalid schema "'+s+'": '+a)}Object.keys(e.__schemas__).forEach(function(s){const a=e.__schemas__[s];if(a===null)return;const l={validate:null,link:null};if(e.__compiled__[s]=l,Md(a)){Pd(a.validate)?l.validate=qd(a.validate):mr(a.validate)?l.validate=a.validate:o(s,a),mr(a.normalize)?l.normalize=a.normalize:a.normalize?o(s,a):l.normalize=gr();return}if($d(a)){r.push(s);return}o(s,a)}),r.forEach(function(s){e.__compiled__[e.__schemas__[s]]&&(e.__compiled__[s].validate=e.__compiled__[e.__schemas__[s]].validate,e.__compiled__[s].normalize=e.__compiled__[e.__schemas__[s]].normalize)}),e.__compiled__[""]={validate:null,normalize:gr()};const i=Object.keys(e.__compiled__).filter(function(s){return s.length>0&&e.__compiled__[s]}).map(Bd).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+i+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+i+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),zd(e)}function jd(e,t){const u=e.__index__,n=e.__last_index__,r=e.__text_cache__.slice(u,n);this.schema=e.__schema__.toLowerCase(),this.index=u+t,this.lastIndex=n+t,this.raw=r,this.text=r,this.url=r}function bo(e,t){const u=new jd(e,t);return e.__compiled__[u.schema].normalize(u,e),u}function Ct(e,t){if(!(this instanceof Ct))return new Ct(e,t);t||Rd(e)&&(t=e,e={}),this.__opts__=go({},bs,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=go({},Ld,e),this.__compiled__={},this.__tlds__=Od,this.__tlds_replaced__=!1,this.re={},Dn(this)}Ct.prototype.add=function(t,u){return this.__schemas__[t]=u,Dn(this),this};Ct.prototype.set=function(t){return this.__opts__=go(this.__opts__,t),this};Ct.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let u,n,r,o,i,s,a,l,d;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(u=a.exec(t))!==null;)if(o=this.testSchemaAt(t,u[2],a.lastIndex),o){this.__schema__=u[2],this.__index__=u.index+u[1].length,this.__last_index__=u.index+u[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&(n=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(i=n.index+n[1].length,(this.__index__<0||i<this.__index__)&&(this.__schema__="",this.__index__=i,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(d=t.indexOf("@"),d>=0&&(r=t.match(this.re.email_fuzzy))!==null&&(i=r.index+r[1].length,s=r.index+r[0].length,(this.__index__<0||i<this.__index__||i===this.__index__&&s>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=s))),this.__index__>=0};Ct.prototype.pretest=function(t){return this.re.pretest.test(t)};Ct.prototype.testSchemaAt=function(t,u,n){return this.__compiled__[u.toLowerCase()]?this.__compiled__[u.toLowerCase()].validate(t,n,this):0};Ct.prototype.match=function(t){const u=[];let n=0;this.__index__>=0&&this.__text_cache__===t&&(u.push(bo(this,n)),n=this.__last_index__);let r=n?t.slice(n):t;for(;this.test(r);)u.push(bo(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return u.length?u:null};Ct.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const u=this.re.schema_at_start.exec(t);if(!u)return null;const n=this.testSchemaAt(t,u[2],u[0].length);return n?(this.__schema__=u[2],this.__index__=u.index+u[1].length,this.__last_index__=u.index+u[0].length+n,bo(this,0)):null};Ct.prototype.tlds=function(t,u){return t=Array.isArray(t)?t:[t],u?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(n,r,o){return n!==o[r-1]}).reverse(),Dn(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Dn(this),this)};Ct.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Ct.prototype.onCompile=function(){};const Su=2147483647,Ot=36,Ro=1,Yu=26,Ud=38,Vd=700,xs=72,vs=128,ys="-",Hd=/^xn--/,Wd=/[^\0-\x7F]/,Kd=/[\x2E\u3002\uFF0E\uFF61]/g,Gd={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},eo=Ot-Ro,zt=Math.floor,to=String.fromCharCode;function eu(e){throw new RangeError(Gd[e])}function Zd(e,t){const u=[];let n=e.length;for(;n--;)u[n]=t(e[n]);return u}function ks(e,t){const u=e.split("@");let n="";u.length>1&&(n=u[0]+"@",e=u[1]),e=e.replace(Kd,".");const r=e.split("."),o=Zd(r,t).join(".");return n+o}function _s(e){const t=[];let u=0;const n=e.length;for(;u<n;){const r=e.charCodeAt(u++);if(r>=55296&&r<=56319&&u<n){const o=e.charCodeAt(u++);(o&64512)==56320?t.push(((r&1023)<<10)+(o&1023)+65536):(t.push(r),u--)}else t.push(r)}return t}const Xd=e=>String.fromCodePoint(...e),Yd=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Ot},br=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Ss=function(e,t,u){let n=0;for(e=u?zt(e/Vd):e>>1,e+=zt(e/t);e>eo*Yu>>1;n+=Ot)e=zt(e/eo);return zt(n+(eo+1)*e/(e+Ud))},ws=function(e){const t=[],u=e.length;let n=0,r=vs,o=xs,i=e.lastIndexOf(ys);i<0&&(i=0);for(let s=0;s<i;++s)e.charCodeAt(s)>=128&&eu("not-basic"),t.push(e.charCodeAt(s));for(let s=i>0?i+1:0;s<u;){const a=n;for(let d=1,p=Ot;;p+=Ot){s>=u&&eu("invalid-input");const m=Yd(e.charCodeAt(s++));m>=Ot&&eu("invalid-input"),m>zt((Su-n)/d)&&eu("overflow"),n+=m*d;const _=p<=o?Ro:p>=o+Yu?Yu:p-o;if(m<_)break;const b=Ot-_;d>zt(Su/b)&&eu("overflow"),d*=b}const l=t.length+1;o=Ss(n-a,l,a==0),zt(n/l)>Su-r&&eu("overflow"),r+=zt(n/l),n%=l,t.splice(n++,0,r)}return String.fromCodePoint(...t)},Ts=function(e){const t=[];e=_s(e);const u=e.length;let n=vs,r=0,o=xs;for(const a of e)a<128&&t.push(to(a));const i=t.length;let s=i;for(i&&t.push(ys);s<u;){let a=Su;for(const d of e)d>=n&&d<a&&(a=d);const l=s+1;a-n>zt((Su-r)/l)&&eu("overflow"),r+=(a-n)*l,n=a;for(const d of e)if(d<n&&++r>Su&&eu("overflow"),d===n){let p=r;for(let m=Ot;;m+=Ot){const _=m<=o?Ro:m>=o+Yu?Yu:m-o;if(p<_)break;const b=p-_,E=Ot-_;t.push(to(br(_+b%E,0))),p=zt(b/E)}t.push(to(br(p,0))),o=Ss(r,l,s===i),r=0,++s}++r,++n}return t.join("")},Jd=function(e){return ks(e,function(t){return Hd.test(t)?ws(t.slice(4).toLowerCase()):t})},Qd=function(e){return ks(e,function(t){return Wd.test(t)?"xn--"+Ts(t):t})},Cs={version:"2.3.1",ucs2:{decode:_s,encode:Xd},decode:ws,encode:Ts,toASCII:Qd,toUnicode:Jd},ef={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},tf={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},uf={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},nf={default:ef,zero:tf,commonmark:uf},of=/^(vbscript|javascript|file|data):/,rf=/^data:image\/(gif|png|jpeg|webp);/;function sf(e){const t=e.trim().toLowerCase();return of.test(t)?rf.test(t):!0}const Es=["http:","https:","mailto:"];function af(e){const t=Io(e,!0);if(t.hostname&&(!t.protocol||Es.indexOf(t.protocol)>=0))try{t.hostname=Cs.toASCII(t.hostname)}catch{}return Qu(Do(t))}function lf(e){const t=Io(e,!0);if(t.hostname&&(!t.protocol||Es.indexOf(t.protocol)>=0))try{t.hostname=Cs.toUnicode(t.hostname)}catch{}return Cu(Do(t),Cu.defaultChars+"%")}function Ft(e,t){if(!(this instanceof Ft))return new Ft(e,t);t||$o(e)||(t=e||{},e="default"),this.inline=new tn,this.block=new Rn,this.core=new Po,this.renderer=new Du,this.linkify=new Ct,this.validateLink=sf,this.normalizeLink=af,this.normalizeLinkText=lf,this.utils=c0,this.helpers=Pn({},h0),this.options={},this.configure(e),t&&this.set(t)}Ft.prototype.set=function(e){return Pn(this.options,e),this};Ft.prototype.configure=function(e){const t=this;if($o(e)){const u=e;if(e=nf[u],!e)throw new Error('Wrong `markdown-it` preset "'+u+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(u){e.components[u].rules&&t[u].ruler.enableOnly(e.components[u].rules),e.components[u].rules2&&t[u].ruler2.enableOnly(e.components[u].rules2)}),this};Ft.prototype.enable=function(e,t){let u=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){u=u.concat(this[r].ruler.enable(e,!0))},this),u=u.concat(this.inline.ruler2.enable(e,!0));const n=e.filter(function(r){return u.indexOf(r)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this};Ft.prototype.disable=function(e,t){let u=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){u=u.concat(this[r].ruler.disable(e,!0))},this),u=u.concat(this.inline.ruler2.disable(e,!0));const n=e.filter(function(r){return u.indexOf(r)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this};Ft.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Ft.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const u=new this.core.State(e,this,t);return this.core.process(u),u.tokens};Ft.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Ft.prototype.parseInline=function(e,t){const u=new this.core.State(e,this,t);return u.inlineMode=!0,this.core.process(u),u.tokens};Ft.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const hu=new Ft({html:!1,breaks:!0,linkify:!0,typographer:!1}),xr=hu.renderer.rules.link_open,vr=hu.renderer.rules.table_open,yr=hu.renderer.rules.table_close;hu.renderer.rules.link_open=(e,t,u,n,r)=>{const o=e[t];return o.attrSet("target","_blank"),o.attrSet("rel","noreferrer noopener"),typeof xr=="function"?xr(e,t,u,n,r):r.renderToken(e,t,u)};hu.renderer.rules.table_open=(e,t,u,n,r)=>`<div class="codex-table-wrap">${typeof vr=="function"?vr(e,t,u,n,r):r.renderToken(e,t,u)}`;hu.renderer.rules.table_close=(e,t,u,n,r)=>`${typeof yr=="function"?yr(e,t,u,n,r):r.renderToken(e,t,u)}</div>`;function kr(e=""){const t=String(e||"").trim();return t?hu.render(t):""}const cf={class:"panel relative flex h-full min-h-0 flex-col overflow-hidden"},df={class:"workbench-panel-header theme-divider theme-muted-panel border-b p-3"},ff={class:"flex flex-col gap-2"},pf={class:"flex items-center gap-2"},hf=["title"],mf={class:"flex shrink-0 items-center gap-1.5"},gf=["disabled"],bf={class:"hidden sm:inline"},xf=["disabled"],vf={class:"hidden sm:inline"},yf={key:0,class:"theme-danger-text inline-flex items-center gap-2 text-sm"},kf={class:"min-h-0 flex-1"},_f={key:0,class:"theme-empty-state px-4 py-6 text-sm"},Sf={class:"flex justify-end"},wf={class:"transcript-card transcript-card--prompt min-w-0 w-full max-w-[92%] rounded-sm bg-[var(--theme-promptBg)] px-4 py-3 text-sm text-[var(--theme-promptText)]"},Tf={class:"flex items-center justify-between gap-3 text-xs opacity-75"},Cf={class:"flex items-center gap-2"},Ef=["onClick"],Af={class:"relative mt-2"},Df={key:0,class:"whitespace-pre-wrap break-all font-sans leading-7"},If={key:1,class:"transcript-card__media overflow-hidden rounded-sm border border-dashed border-[var(--theme-promptBorder)]/70 bg-white/40"},Ff={class:"flex items-center gap-2 border-b border-dashed border-[var(--theme-promptBorder)]/60 px-3 py-2 text-xs opacity-80"},$f={class:"px-3 py-3"},Mf=["onClick"],Pf=["src","alt"],Bf={key:2,class:"pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-[var(--theme-promptBg)] via-[var(--theme-promptBg)] to-transparent"},Rf={class:"flex justify-start"},Lf={class:"flex items-center justify-between gap-3 text-xs"},Nf={class:"flex items-center gap-2"},Of=["disabled","onClick"],zf={key:0,class:"transcript-card__subtle mt-3 rounded-sm bg-white/10 px-3 py-2 text-xs text-current/70"},qf={key:1,class:"mt-3 space-y-3"},jf={class:"text-sm font-medium leading-6"},Uf={key:0,class:"mt-1 whitespace-pre-wrap break-all font-mono text-[11px] leading-5 opacity-85"},Vf={key:2,class:"transcript-card__subtle mt-3 rounded-sm bg-white/10 px-3 py-2 text-xs text-current/70"},Hf={key:3,class:"mt-3 text-xs text-current/80"},Wf={key:4,class:"transcript-card__subtle mt-3 rounded-sm bg-white/15 px-3 py-2 text-xs text-current/80"},Kf={class:"flex items-start justify-between gap-3"},Gf={class:"min-w-0 flex-1"},Zf={key:0,class:"leading-5"},Xf={key:1,class:"mt-1 break-all leading-5 opacity-75"},Yf={key:2,class:"mt-2 flex flex-wrap gap-2"},Jf={class:"opacity-75"},Qf={class:"font-medium"},e1=["onClick"],t1={key:0,class:"flex justify-start"},u1={class:"flex items-center justify-between gap-3 text-xs text-current/80"},n1=["onClick"],o1={class:"relative mt-2"},r1=["innerHTML"],s1={class:"pointer-events-none absolute bottom-1 right-1 z-10 flex flex-col items-end gap-1.5 sm:bottom-3 sm:right-3"},i1=["disabled"],a1={key:2,class:"task-loading-dots","aria-hidden":"true"},mn="max-h-40 overflow-hidden",l1={__name:"CodexSessionPanel",props:{prompt:{type:String,default:""},buildPrompt:{type:Function,default:null},buildPromptBlocks:{type:Function,default:null},beforeSend:{type:Function,default:null},afterSend:{type:Function,default:null},taskSlug:{type:String,default:""},selectedSessionId:{type:String,default:""},active:{type:Boolean,default:!1},sessionSelectionLocked:{type:Boolean,default:!1},sessionSelectionLockReason:{type:String,default:""},diffSupported:{type:Boolean,default:!1},taskRunning:{type:Boolean,default:!1}},emits:["project-created","selected-session-change","sending-change","open-diff","toast"],setup(e,{expose:t,emit:u}){const n=ro(()=>so(()=>import("./CodexSessionManagerDialog-Ct3Z8yNx.js"),__vite__mapDeps([0,1,2]))),r=u,o=e,{closeManager:i,formatTurnTime:s,getProcessCardClass:a,getProcessStatus:l,getTurnAgentLabel:d,getDisplayTurnSummaryItems:p,getTurnSummaryDetail:m,getTurnSummaryStatus:_,handleCreateSession:b,handleDeleteSession:E,handleSelectSession:j,handleSend:y,handleTranscriptScroll:x,handleTranscriptTouchEnd:D,handleTranscriptTouchMove:P,handleTranscriptTouchStart:$,handleUpdateSession:Z,helperText:w,loadTurnEvents:J,loading:Q,managerBusy:R,openManager:q,refreshSessionsForSelection:ne,selectedSessionId:re,sending:be,stopping:ce,hasTurnSummary:O,hasNewerMessages:K,sessionError:F,shouldShowResponse:ye,showManager:V,sortedSessions:he,stopSending:G,transcriptRef:X,turns:Y,workspaces:ve,sessions:oe,loadSessions:ge,scrollToBottom:Te}=xc(o,r),Re=new Map,Me=U(""),{t:xe}=_t();function rt(ue={}){const pe=String((ue==null?void 0:ue.title)||"").trim();return pe?[/^已连接项目:/,/^工作目录:/,/^项目会话已更新$/,/^Codex 会话已创建$/,/^Claude Code 会话已创建$/,/^OpenCode 会话已创建$/,/^线程 ID:/,/^Thread ID:/,/^Connected project:/,/^Working directory:/,/^Project session updated$/,/ session created$/].some(N=>N.test(pe)):!1}const{canCollapsePrompt:et,canCollapseResponse:Ie,getTurnEventCount:Ne,hasTurnEventHistory:dt,isPromptCollapsed:Je,isResponseCollapsed:ft,isTurnEventsCollapsed:pt,togglePrompt:He,toggleResponse:St,toggleTurnEvents:Xe}=Sc({turns:Y,loadTurnEvents:J});function gt(ue){return String((ue==null?void 0:ue.runId)||(ue==null?void 0:ue.id)||"").trim()}function at(ue){ue!=null&&ue.runId&&r("open-diff",{scope:"run",runId:ue.runId})}function lt(){r("open-diff",{scope:"workspace",runId:""})}function st(ue){if(ue!=null&&ue.errorMessage)return"";const pe=String((ue==null?void 0:ue.responseMessage)||""),N=gt(ue);if(!N)return kr(pe);const T=Re.get(N);if((T==null?void 0:T.source)===pe)return T.html;const L=kr(pe);return Re.set(N,{source:pe,html:L}),L}function bt(ue){Me.value=String(ue||"").trim()}const Ue=de(()=>Y.value.flatMap(ue=>(Array.isArray(ue==null?void 0:ue.promptBlocks)?ue.promptBlocks:[]).filter(pe=>(pe==null?void 0:pe.type)==="image").map(pe=>pe.content)));function ct(ue){const pe=Array.isArray(ue==null?void 0:ue.events)?ue.events:[],N=pe.filter(T=>!rt(T));return N.length?N:pe}function it(ue){return ue!=null&&ue.eventsLoaded?Ne(ue,ct(ue)):Ne(ue)}function fe(ue){return dt(ue)}function Be(ue){return!!(ue!=null&&ue.eventsLoading)}function Ce(ue){return!!(ue!=null&&ue.eventsLoaded)&&ct(ue).length>0&&!pt(ue)}function We(ue){return dt(ue)&&pt(ue)}function xt(ue){return dt(ue)&&!(ue!=null&&ue.eventsLoaded)&&!(ue!=null&&ue.eventsLoading)}return De(Y,ue=>{const pe=new Set((ue||[]).map(N=>gt(N)).filter(Boolean));for(const N of Re.keys())pe.has(N)||Re.delete(N)},{immediate:!0,deep:!0}),t({send:y,scrollToBottom:Te,stop:G}),(ue,pe)=>(C(),B("section",cf,[le(c(n),{open:c(V),sessions:c(oe),workspaces:c(ve),"selected-session-id":c(re),"selection-locked":e.sessionSelectionLocked,"selection-lock-reason":e.sessionSelectionLockReason,loading:c(Q),sending:c(be),"on-refresh":c(ge),"on-create":c(b),"on-update":c(Z),"on-delete":c(E),onClose:c(i),onProjectCreated:pe[0]||(pe[0]=N=>r("project-created",N)),onSelectSession:c(j)},null,8,["open","sessions","workspaces","selected-session-id","selection-locked","selection-lock-reason","loading","sending","on-refresh","on-create","on-update","on-delete","onClose","onSelectSession"]),h("div",df,[h("div",ff,[h("div",pf,[h("div",{class:"min-w-0 flex-1",title:c(w)||""},[le($l,{modelValue:c(re),"onUpdate:modelValue":pe[1]||(pe[1]=N=>Is(re)?re.value=N:null),sessions:c(he),loading:c(Q),disabled:c(be)||c(R)||e.sessionSelectionLocked,onRefreshIntent:c(ne)},null,8,["modelValue","sessions","loading","disabled","onRefreshIntent"])],8,hf),h("div",mf,[e.diffSupported?(C(),B("button",{key:0,type:"button",class:"tool-button tool-button-info-subtle inline-flex items-center gap-1.5 whitespace-nowrap px-2.5 py-2 text-xs sm:gap-2 sm:px-3",disabled:!e.taskSlug,onClick:lt},[le(c(Uo),{class:"h-4 w-4"}),pe[11]||(pe[11]=h("span",{class:"sm:hidden"},"代码",-1)),h("span",bf,A(c(xe)("sessionPanel.diff")),1)],8,gf)):we("",!0),h("button",{type:"button",class:"tool-button inline-flex items-center gap-1.5 whitespace-nowrap px-2.5 py-2 text-xs sm:gap-2 sm:px-3",disabled:c(R),onClick:pe[2]||(pe[2]=(...N)=>c(q)&&c(q)(...N))},[le(c(Hu),{class:"h-4 w-4"}),pe[12]||(pe[12]=h("span",{class:"sm:hidden"},"项目",-1)),h("span",vf,A(c(xe)("sessionPanel.manageProjects")),1)],8,xf)])]),c(F)?(C(),B("p",yf,[le(c(ko),{class:"h-4 w-4"}),h("span",null,A(c(F)),1)])):we("",!0)])]),h("div",kf,[h("div",{ref_key:"transcriptRef",ref:X,class:"h-full space-y-4 overflow-y-auto px-4 py-4",onScroll:pe[3]||(pe[3]=(...N)=>c(x)&&c(x)(...N)),onTouchstartPassive:pe[4]||(pe[4]=(...N)=>c($)&&c($)(...N)),onTouchmovePassive:pe[5]||(pe[5]=(...N)=>c(P)&&c(P)(...N)),onTouchendPassive:pe[6]||(pe[6]=(...N)=>c(D)&&c(D)(...N)),onTouchcancelPassive:pe[7]||(pe[7]=(...N)=>c(D)&&c(D)(...N))},[c(Y).length?we("",!0):(C(),B("div",_f,A(c(xe)("sessionPanel.empty")),1)),(C(!0),B(mt,null,It(c(Y),N=>(C(),B("div",{key:N.id,class:"space-y-3"},[h("div",Sf,[h("div",wf,[h("div",Tf,[h("span",null,A(c(xe)("sessionPanel.promptTitle")),1),h("div",Cf,[c(et)(N)?(C(),B("button",{key:0,type:"button",class:"transcript-card__toggle inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1 text-[11px] transition hover:bg-white/15",onClick:T=>c(He)(N)},[c(Je)(N)?(C(),Ee(c(Uu),{key:0,class:"h-3 w-3"})):(C(),Ee(c(jn),{key:1,class:"h-3 w-3"})),h("span",null,A(c(Je)(N)?c(xe)("sessionPanel.expand"):c(xe)("sessionPanel.collapse")),1)],8,Ef)):we("",!0),h("span",null,A(c(s)(N.startedAt)),1)])]),h("div",Af,[Array.isArray(N.promptBlocks)&&N.promptBlocks.length?(C(),B("div",{key:0,class:Se(["space-y-3",c(et)(N)&&c(Je)(N)?mn:""])},[(C(!0),B(mt,null,It(N.promptBlocks,(T,L)=>(C(),B(mt,{key:`${N.id}-prompt-${L}`},[T.type==="text"||T.type==="imported_text"?(C(),B("pre",Df,A(T.content),1)):(C(),B("div",If,[h("div",Ff,[le(c(_o),{class:"h-3.5 w-3.5"}),h("span",null,A(c(xe)("sessionPanel.promptImage")),1)]),h("div",$f,[h("button",{type:"button",class:"inline-flex cursor-zoom-in justify-center",onClick:ae=>bt(T.content)},[h("img",{src:T.content,alt:c(xe)("sessionPanel.promptImageAlt"),class:"max-h-52 w-auto max-w-full rounded-sm object-contain"},null,8,Pf)],8,Mf)])]))],64))),128))],2)):(C(),B("pre",{key:1,class:Se(["whitespace-pre-wrap break-all font-sans leading-7",c(et)(N)&&c(Je)(N)?mn:""])},A(N.prompt),3)),c(et)(N)&&c(Je)(N)?(C(),B("div",Bf)):we("",!0)])])]),h("div",Rf,[h("div",{class:Se(["transcript-card transcript-card--process min-w-0 w-full max-w-[94%] rounded-sm px-4 py-3",c(a)(N)])},[h("div",Lf,[h("span",null,A(c(xe)("sessionPanel.processTitle")),1),h("div",Nf,[fe(N)?(C(),B("button",{key:0,type:"button",class:"transcript-card__toggle inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1 text-[11px] transition hover:bg-white/15",disabled:N.eventsLoading,onClick:T=>c(Xe)(N)},[Be(N)?(C(),Ee(c(qt),{key:0,class:"h-3 w-3 animate-spin"})):c(pt)(N)?(C(),Ee(c(Uu),{key:1,class:"h-3 w-3"})):(C(),Ee(c(jn),{key:2,class:"h-3 w-3"})),h("span",null,A(N.eventsLoading?c(xe)("sessionPanel.loading"):c(pt)(N)?`${c(xe)("sessionPanel.expand")} (${it(N)})`:c(xe)("sessionPanel.collapse")),1)],8,Of)):we("",!0),h("span",null,A(c(l)(N)),1)])]),Be(N)?(C(),B("div",zf,A(c(xe)("sessionPanel.loadingEvents")),1)):Ce(N)?(C(),B("div",qf,[(C(!0),B(mt,null,It(ct(N),T=>(C(),B("div",{key:T.id,class:Se(["transcript-event-card rounded-sm px-3 py-2",{"bg-[var(--theme-appPanelStrong)]":T.kind==="info"||T.kind==="command","theme-status-warning":T.kind==="todo","theme-status-success":T.kind==="result","theme-status-danger":T.kind==="error"}])},[h("div",jf,A(T.title),1),T.detail?(C(),B("pre",Uf,A(T.detail),1)):we("",!0)],2))),128))])):We(N)||xt(N)?(C(),B("div",Vf,A(N.eventsLoaded?c(xe)("sessionPanel.hiddenEventsLoaded",{count:it(N)}):c(xe)("sessionPanel.hiddenEventsLoadLater",{count:it(N)})),1)):(C(),B("p",Hf,A(["queued","starting","running","stopping"].includes(N.status)?c(xe)("sessionPanel.waitingEvents",{agent:c(d)(N)}):c(xe)("sessionPanel.noEvents")),1)),c(O)(N)?(C(),B("div",Wf,[h("div",Kf,[h("div",Gf,[c(_)(N)?(C(),B("div",Zf,A(c(_)(N)),1)):we("",!0),c(m)(N)?(C(),B("div",Xf,A(c(m)(N)),1)):we("",!0),c(p)(N).length?(C(),B("div",Yf,[(C(!0),B(mt,null,It(c(p)(N),T=>(C(),B("span",{key:T.key,class:"transcript-card__pill inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1"},[h("span",Jf,A(T.label),1),h("span",Qf,A(T.value),1)]))),128))])):we("",!0)]),e.diffSupported&&N.runId?(C(),B("button",{key:0,type:"button",class:"transcript-card__toggle shrink-0 inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1 text-[11px] transition hover:bg-white/15",onClick:T=>at(N)},[le(c(Uo),{class:"h-3 w-3"}),h("span",null,A(c(xe)("sessionPanel.view")),1)],8,e1)):we("",!0)])])):we("",!0)],2)]),c(ye)(N)?(C(),B("div",t1,[h("div",{class:Se(["transcript-card transcript-card--response min-w-0 w-full max-w-[92%] rounded-sm px-4 py-3 text-sm leading-7",N.errorMessage?"bg-[var(--theme-dangerSoft)] text-[var(--theme-dangerText)]":"bg-[var(--theme-responseBg)] text-[var(--theme-responseText)]"])},[h("div",u1,[h("span",null,A(N.errorMessage?c(xe)("sessionPanel.errorSuffix",{agent:c(d)(N)}):c(xe)("sessionPanel.responseSuffix",{agent:c(d)(N)})),1),c(Ie)(N)?(C(),B("button",{key:0,type:"button",class:"transcript-card__toggle inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1 text-[11px] transition hover:bg-white/15",onClick:T=>c(St)(N)},[c(ft)(N)?(C(),Ee(c(Uu),{key:0,class:"h-3 w-3"})):(C(),Ee(c(jn),{key:1,class:"h-3 w-3"})),h("span",null,A(c(ft)(N)?c(xe)("sessionPanel.expand"):c(xe)("sessionPanel.collapse")),1)],8,n1)):we("",!0)]),h("div",o1,[N.errorMessage?(C(),B("div",{key:0,class:Se([c(Ie)(N)&&c(ft)(N)?mn:"","whitespace-pre-wrap break-all"])},A(N.errorMessage),3)):(C(),B("div",{key:1,class:Se(["prose-like codex-markdown",c(Ie)(N)&&c(ft)(N)?mn:""]),innerHTML:st(N)},null,10,r1)),c(Ie)(N)&&c(ft)(N)?(C(),B("div",{key:2,class:Se(["pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t",N.errorMessage?"from-[var(--theme-dangerSoft)] via-[var(--theme-dangerSoft)] to-transparent":"from-[var(--theme-responseBg)] via-[var(--theme-responseBg)] to-transparent"])},null,2)):we("",!0)])],2)])):we("",!0)]))),128))],544),h("div",s1,[c(K)?(C(),B("button",{key:0,type:"button",class:"tool-button pointer-events-auto inline-flex items-center gap-1.5 border-[var(--theme-borderStrong)] bg-[var(--theme-appOverlay)] px-2.5 py-1.5 text-[11px] shadow-sm backdrop-blur",onClick:pe[8]||(pe[8]=(...N)=>c(Te)&&c(Te)(...N))},[le(c(Ns),{class:"h-3.5 w-3.5"}),h("span",null,A(c(xe)("sessionPanel.jumpToLatest")),1)])):we("",!0),c(be)?(C(),B("button",{key:1,type:"button",class:"tool-button tool-button-warning-subtle pointer-events-auto inline-flex items-center gap-1.5 border-[var(--theme-borderStrong)] bg-[var(--theme-appOverlay)] px-2.5 py-1.5 text-[11px] shadow-sm backdrop-blur",disabled:c(ce),onClick:pe[9]||(pe[9]=(...N)=>c(G)&&c(G)(...N))},[c(ce)?(C(),Ee(c(qt),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(C(),Ee(c(Hs),{key:1,class:"h-3.5 w-3.5"})),h("span",null,A(c(ce)?c(xe)("sessionPanel.stopping"):c(xe)("sessionPanel.stop")),1),c(ce)?we("",!0):(C(),B("span",a1,[...pe[13]||(pe[13]=[h("span",{class:"task-loading-dots__dot"},null,-1),h("span",{class:"task-loading-dots__dot"},null,-1),h("span",{class:"task-loading-dots__dot"},null,-1)])]))],8,i1)):we("",!0)])]),le(Vr,{modelValue:Me.value,"onUpdate:modelValue":pe[10]||(pe[10]=N=>Me.value=N),images:Ue.value},null,8,["modelValue","images"])]))}},c1={key:0,class:"h-full min-h-0"},d1={key:1,class:"panel theme-muted-text flex h-full items-center px-5 py-4 text-sm"},_r={__name:"WorkbenchActivityPanel",props:{taskSlug:{type:String,default:""},buildPrompt:{type:Function,default:null},buildPromptBlocks:{type:Function,default:null},selectedSessionId:{type:String,default:""},sessionSelectionLocked:{type:Boolean,default:!1},sessionSelectionLockReason:{type:String,default:""},diffSupported:{type:Boolean,default:!1},taskRunning:{type:Boolean,default:!1},emptyMessage:{type:String,default:""}},emits:["sending-change","project-created","selected-session-change","open-diff","toast"],setup(e,{expose:t,emit:u}){const n=u,r=U(null);function o(){var a,l;return(l=(a=r.value)==null?void 0:a.send)==null?void 0:l.call(a)}function i(){var a,l;(l=(a=r.value)==null?void 0:a.stop)==null||l.call(a)}function s(){var a,l;(l=(a=r.value)==null?void 0:a.scrollToBottom)==null||l.call(a)}return t({send:o,stop:i,scrollToBottom:s}),(a,l)=>e.taskSlug?(C(),B("div",c1,[le(l1,{ref_key:"panelRef",ref:r,active:!!e.taskSlug,"task-slug":e.taskSlug,"build-prompt":e.buildPrompt||(()=>""),"build-prompt-blocks":e.buildPromptBlocks||(()=>[]),"selected-session-id":e.selectedSessionId,"session-selection-locked":e.sessionSelectionLocked,"session-selection-lock-reason":e.sessionSelectionLockReason,"diff-supported":e.diffSupported,"task-running":e.taskRunning,onProjectCreated:l[0]||(l[0]=d=>n("project-created",d)),onSendingChange:l[1]||(l[1]=d=>n("sending-change",d)),onSelectedSessionChange:l[2]||(l[2]=d=>n("selected-session-change",d)),onOpenDiff:l[3]||(l[3]=d=>n("open-diff",d)),onToast:l[4]||(l[4]=d=>n("toast",d))},null,8,["active","task-slug","build-prompt","build-prompt-blocks","selected-session-id","session-selection-locked","session-selection-lock-reason","diff-supported","task-running"])])):e.emptyMessage?(C(),B("section",d1,A(e.emptyMessage),1)):we("",!0)}};function f1(e){const{activeIndex:t,blocks:u,isTextLikeBlock:n,placeCursor:r,resizeAllTextareas:o,selectionMap:i,sessionId:s,setBlocks:a,textareas:l}=e,d=U(_()),p=U(null),m=U(null);function _(){return{open:!1,blockIndex:-1,start:0,end:0,query:"",trigger:"mention"}}function b(R,q){const ne=l.value[R];if(!ne||typeof document>"u")return null;const re=window.getComputedStyle(ne),be=document.createElement("div"),ce=document.createElement("span"),O=["boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize"];be.style.position="fixed",be.style.left="-9999px",be.style.top="0",be.style.visibility="hidden",be.style.whiteSpace="pre-wrap",be.style.wordWrap="break-word",O.forEach(Y=>{be.style[Y]=re[Y]});const K=ne.value.slice(0,q),F=ne.value.slice(q,q+1)||" ",ye=ne.value.slice(q+1);be.textContent=K,ce.textContent=F,be.appendChild(ce),ye&&be.appendChild(document.createTextNode(ye)),document.body.appendChild(be);const V=ne.getBoundingClientRect(),he=Number.parseFloat(re.lineHeight)||Number.parseFloat(re.fontSize)*1.4||20,G=V.left+ce.offsetLeft-ne.scrollLeft,X=V.top+ce.offsetTop-ne.scrollTop;return document.body.removeChild(be),{left:G,top:X,right:G,bottom:X+he,width:0,height:he}}function E(R,q){return!R&&!q?!1:!R||!q?!0:Math.abs((R.left||0)-(q.left||0))>=1||Math.abs((R.top||0)-(q.top||0))>=1||Math.abs((R.bottom||0)-(q.bottom||0))>=1}function j(){const R=d.value;if(!R.open||R.blockIndex<0){p.value=null;return}const q=b(R.blockIndex,R.start);E(q,p.value)&&(p.value=q)}function y(R){const q=Number(R==null?void 0:R.blockIndex);if(q<0)return;const ne=u.value[q];if(!ne||!n(ne))return;const re=Math.max(0,Number(R.start)||0),be=Math.max(re,Number(R.end)||re),ce=`${ne.content.slice(0,re)}${ne.content.slice(be)}`,O=[...u.value];O.splice(q,1,{...ne,content:ce}),a(O),t.value=q,i.value[q]={start:re,end:re},$e(()=>r(q,re))}function x(R={}){const{suppressCurrent:q=!1,cleanupShortcut:ne=!1}=R,re=d.value;q&&re.open&&(m.value={blockIndex:re.blockIndex,start:re.start,end:re.end,query:re.query,trigger:re.trigger}),d.value=_(),p.value=null,ne&&re.trigger==="shortcut"&&y(re)}function D(){x({suppressCurrent:!0,cleanupShortcut:d.value.trigger==="shortcut"})}function P(R,q){const ne=q||l.value[R],re=u.value[R];if(!ne||!re||!n(re)){d.value.blockIndex===R&&x();return}const be=ne.selectionStart??0,ce=ne.selectionEnd??0;if(be!==ce){d.value.blockIndex===R&&x();return}const K=String(re.content||"").slice(0,ce),F=K.lastIndexOf("@");if(F<0){d.value.blockIndex===R&&x();return}const ye=K.slice(F+1);if(/\s/.test(ye)){d.value.blockIndex===R&&x();return}const V=F,he=m.value;if(he&&he.blockIndex===R&&he.start===V&&he.end===ce&&he.query===ye)return;m.value=null;const G=!d.value.open||d.value.blockIndex!==R||d.value.start!==V,X=b(R,V),Y=d.value.open&&d.value.blockIndex===R&&d.value.start===V&&d.value.trigger||"mention";d.value={open:!0,blockIndex:R,start:V,end:ce,query:ye,trigger:Y},(G||E(X,p.value))&&(p.value=X)}function $(R,q){i.value[R]={start:q.target.selectionStart??0,end:q.target.selectionEnd??0},P(R,q.target)}function Z(R){t.value=R;const q=l.value[R];i.value[R]={start:(q==null?void 0:q.selectionStart)??0,end:(q==null?void 0:q.selectionEnd)??0},P(R,q)}function w(){var V,he;const R=Math.min(t.value??0,Math.max(u.value.length-1,0)),q=u.value[R];if(!q||!n(q))return!1;const ne=l.value[R],re=q.content.length,be={start:(ne==null?void 0:ne.selectionStart)??((V=i.value[R])==null?void 0:V.start)??re,end:(ne==null?void 0:ne.selectionEnd)??((he=i.value[R])==null?void 0:he.end)??re},ce=Math.max(0,be.start??0),O=Math.max(ce,be.end??ce),K=`${q.content.slice(0,ce)}@${q.content.slice(O)}`,F=ce+1,ye=[...u.value];return ye.splice(R,1,{...q,content:K}),a(ye),t.value=R,i.value[R]={start:F,end:F},m.value=null,$e(()=>{r(R,F),d.value={open:!0,blockIndex:R,start:ce,end:F,query:"",trigger:"shortcut"},p.value=b(R,ce)}),!0}function J(R){const q=String((R==null?void 0:R.path)||"").trim(),ne=d.value;if(!q||ne.blockIndex<0)return x(),!1;const re=u.value[ne.blockIndex];if(!re||!n(re))return x(),!1;const be=ne.trigger==="shortcut"?`${q} `:`@${q} `,ce=`${re.content.slice(0,ne.start)}${be}${re.content.slice(ne.end)}`,O=ne.start+be.length,K=[...u.value];return K.splice(ne.blockIndex,1,{...re,content:ce}),a(K),t.value=ne.blockIndex,i.value[ne.blockIndex]={start:O,end:O},m.value=null,x(),$e(()=>r(ne.blockIndex,O)),!0}function Q(){d.value.open&&j()}return De(()=>(s==null?void 0:s.value)??s,()=>{x()}),De(()=>d.value.open,R=>{R||$e(()=>{o==null||o()})}),pu(()=>{window.addEventListener("resize",Q),window.addEventListener("scroll",Q)}),kt(()=>{window.removeEventListener("resize",Q),window.removeEventListener("scroll",Q)}),{mentionState:d,mentionAnchorRect:p,applyMentionSelection:J,closeMentionPicker:x,dismissMentionPicker:D,handleTextFocus:Z,openPathPickerFromShortcut:w,recordSelection:$,syncMentionState:P,updateMentionAnchor:j}}const As=20;function gn(e,t){if(!e||!t)return 0;const u=e.getBoundingClientRect(),n=t.getBoundingClientRect();return u.top-n.top+t.scrollTop}function p1({containerScrollTop:e=0,containerClientHeight:t=0,targetTop:u=0,targetHeight:n=0,align:r="nearest",padding:o=As}={}){const i=Math.max(0,Number(o)||0),s=Math.max(0,Number(e)||0),a=Math.max(0,Number(t)||0),l=Math.max(0,Number(u)||0),d=Math.max(0,Number(n)||0),p=l+d;if(!a)return s;if(r==="end")return Math.max(0,p-a+i);const m=s+i,_=s+a-i;return l<m?Math.max(0,l-i):p>_?Math.max(0,p-a+i):s}function h1({containerScrollTop:e=0,containerClientHeight:t=0,targetTop:u=0,targetHeight:n=0,padding:r=As}={}){const o=Math.max(0,Number(r)||0),i=Math.max(0,Number(e)||0),s=Math.max(0,Number(t)||0),a=Math.max(0,Number(u)||0),l=Math.max(0,Number(n)||0),d=a+l;if(!s)return!0;const p=i+o,m=i+s-o;return l>=Math.max(0,m-p)?d>p&&a<m:a>=p&&d<=m}function m1(e){const{props:t,panelRef:u,onClose:n}=e,r=U({left:"12px",top:"12px",width:"560px",maxHeight:"420px"}),o=U(!1),i=U("bottom");function s(){n==null||n()}function a(_=!1){const b=window.innerWidth,E=window.innerHeight,j=12,y=8,x=320,D=560,P=420,$=180,Z=Math.min(D,Math.max(x,b-j*2)),w=Math.min(Z,b-j*2),J=t.anchorRect||{left:(b-w)/2,top:E/2,bottom:E/2};let Q=J.left;Q+w>b-j&&(Q=b-j-w),Q<j&&(Q=j);const R=Math.max(0,E-j-(J.bottom+y)),q=Math.max(0,J.top-y-j);_?i.value=R>=q?"bottom":"top":i.value==="bottom"&&R<$&&q>R+24?i.value="top":i.value==="top"&&q<$&&R>q+24&&(i.value="bottom");const ne=i.value,re=ne==="bottom"?R:q,be=Math.max(140,E-j*2),ce=Math.min(be,Math.max(Math.min(P,re||P),$)),O={left:`${Math.round(Q)}px`,width:`${Math.round(w)}px`,maxHeight:`${Math.round(ce)}px`,top:"auto",bottom:"auto"};return ne==="bottom"?O.top=`${Math.round(Math.max(j,J.bottom+y))}px`:O.bottom=`${Math.round(Math.max(j,E-J.top+y))}px`,O}function l(_=!1){const b=a(_);r.value={...r.value,left:b.left,top:b.top,bottom:b.bottom,width:b.width,maxHeight:b.maxHeight}}function d(){return!t.open||!t.anchorRect?!1:(i.value="bottom",l(!0),o.value=!0,!0)}function p(){o.value=!1}function m(_){!t.open||!u.value||u.value.contains(_.target)||s()}return pu(()=>{document.addEventListener("pointerdown",m)}),kt(()=>{document.removeEventListener("pointerdown",m)}),{closePicker:s,initializePanel:d,panelReady:o,panelStyle:r,resetPanel:p,updatePanelPosition:l}}const uo="promptx:codex-recent-paths",g1=12;function b1(e){const{props:t,onSelect:u}=e,n=U([]),r=U(!1),o=U(""),i=U([]),s=U(!1),a=U(""),l=U([]),d=U([]),p=U("tree"),m=U(""),_=new Map;let b=null,E=0,j=0;const y=de(()=>String(t.query||"").trim()),x=de(()=>!!y.value),D=de(()=>ye(n.value)),P=de(()=>String(t.sessionId||"").trim()),$=de(()=>P.value?`promptx:codex-tree-expanded:${P.value}`:""),Z=de(()=>{if(!y.value)return l.value;const T=new Set(i.value.map(L=>L.path));return l.value.filter(L=>T.has(L.path))}),w=de(()=>{const T=new Set(Z.value.map(L=>L.path));return i.value.filter(L=>!T.has(L.path))}),J=de(()=>y.value?[...Z.value,...w.value]:l.value),Q=de(()=>p.value==="search"?J.value:D.value),R=de(()=>p.value==="search"?s.value:r.value),q=de(()=>p.value==="search"?a.value:o.value),ne=de(()=>p.value==="search"&&!!t.sessionId&&!y.value&&!l.value.length),re=de(()=>p.value==="search"&&!!t.sessionId&&!!y.value&&!s.value&&!a.value&&!J.value.length),be=de(()=>p.value==="tree"&&!!t.sessionId&&!r.value&&!o.value&&!D.value.length);function ce(T,L){if(!T||typeof window>"u")return L;try{const ae=window.localStorage.getItem(T);return ae?JSON.parse(ae):L}catch{return L}}function O(T,L){if(!(!T||typeof window>"u"))try{window.localStorage.setItem(T,JSON.stringify(L))}catch{}}function K(T=[]){return[...T].sort((L,ae)=>{const me=+(L.type!=="directory")-+(ae.type!=="directory");return me||String(L.path||L.name||"").localeCompare(String(ae.path||ae.name||""),"zh-CN")})}function F(T){return{...T,children:[],expanded:!1,loaded:!1,loading:!1}}function ye(T=[],L=0,ae=[]){return T.forEach(me=>{ae.push({...me,depth:L}),me.type==="directory"&&me.expanded&&me.children.length&&ye(me.children,L+1,ae)}),ae}function V(T,L=n.value){for(const ae of L){if(ae.path===T)return ae;if(ae.children.length){const me=V(T,ae.children);if(me)return me}}return null}function he(){n.value=[...n.value]}function G(T=n.value,L=[]){return T.forEach(ae=>{ae.type==="directory"&&ae.expanded&&(L.push(ae.path),ae.children.length&&G(ae.children,L))}),L}function X(){if(!$.value)return;const T=[...new Set(G())];d.value=T,O($.value,T)}function Y(){d.value=$.value?ce($.value,[]).filter(Boolean):[]}function ve(){const T=ce(uo,[]);if(!Array.isArray(T)||!P.value){l.value=[];return}l.value=T.filter(L=>L&&L.sessionId===P.value&&L.path).sort((L,ae)=>Number(ae.usedAt||0)-Number(L.usedAt||0)).slice(0,g1)}function oe(T){return T.name||T.path||"."}function ge(T){return T.path||"."}function Te(T){if(!P.value||!(T!=null&&T.path))return;const L={sessionId:P.value,path:T.path,name:T.name||oe(T),type:T.type||"file",usedAt:Date.now()},ae=ce(uo,[]),me=[L];Array.isArray(ae)&&ae.forEach(Ae=>{!(Ae!=null&&Ae.path)||!(Ae!=null&&Ae.sessionId)||Ae.sessionId===L.sessionId&&Ae.path===L.path||me.push(Ae)}),O(uo,me.slice(0,40)),ve()}function Re(T=""){const L=String(T||"").trim();return!L||!L.includes("/")?"":L.slice(0,L.lastIndexOf("/"))}function Me(){const T=Q.value;if(!T.length)return-1;const L=T.findIndex(ae=>ae.path===m.value);return L>=0?L:0}function xe(){const T=Q.value,L=Me();return L<0||!T.length?null:T[L]||null}function rt(){const T=Q.value;if(!T.length){m.value="";return}T.some(L=>L.path===m.value)||(m.value=T[0].path)}function et(T,L){if(L){_.set(T,L);return}_.delete(T)}function Ie(){var L;const T=_.get(m.value);(L=T==null?void 0:T.scrollIntoView)==null||L.call(T,{block:"nearest"})}function Ne(T=""){return String(T||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function dt(T="",L=""){const ae=String(T||""),me=String(L||"").trim().toLowerCase();if(!ae||!me)return null;const Ae=ae.toLowerCase(),Et=Ae.indexOf(me);if(Et>=0)return{start:Et,end:Et+me.length};const Pt=me.split(/[\\/\s_.-]+/).filter(Boolean).sort(($t,At)=>At.length-$t.length);for(const $t of Pt){if($t.length<2)continue;const At=Ae.indexOf($t);if(At>=0)return{start:At,end:At+$t.length}}return null}function Je(T="",L=""){const ae=String(T||""),me=dt(ae,L);return me?`${Ne(ae.slice(0,me.start))}<mark class="theme-search-highlight">${Ne(ae.slice(me.start,me.end))}</mark>${Ne(ae.slice(me.end))}`:Ne(ae)}function ft(T){return Je(oe(T),y.value)}function pt(T){return Je(ge(T),y.value)}async function He(T="",L={}){if(!t.sessionId){n.value=[],o.value="",r.value=!1;return}const ae=!T,me=ae?null:V(T);if(!(!ae&&!me)&&!(!L.force&&(ae&&n.value.length||!ae&&me.loaded))){ae?(r.value=!0,o.value=""):(me.loading=!0,o.value="",he());try{const Ae=await Ki(t.sessionId,{path:T,refreshToken:L.refreshToken||""}),Et=K(Ae.items||[]).map(F);if(ae){n.value=Et;return}me.children=Et,me.loaded=!0}catch(Ae){o.value=Ae.message}finally{ae?r.value=!1:(me.loading=!1,he())}}}async function St(T=n.value,L=new Set,ae={}){for(const me of T)me.type!=="directory"||!L.has(me.path)||(me.expanded=!0,he(),await He(me.path,ae),me.children.length&&await St(me.children,L,ae))}async function Xe(T={}){await He("",T);const L=new Set(d.value),ae=L.size>0;for(const Ae of n.value)Ae.type!=="directory"||!Ae.hasChildren||(Ae.expanded=ae?L.has(Ae.path):!0);if(he(),ae){await St(n.value,L,T);return}const me=n.value.filter(Ae=>Ae.type==="directory"&&Ae.expanded&&Ae.hasChildren);await Promise.all(me.map(Ae=>He(Ae.path,T))),X()}async function gt(T){if(p.value!=="tree")return;const L=V(T);if(!(!L||L.type!=="directory")){if(!L.loaded&&!L.loading){L.expanded=!0,he(),await He(L.path),X();return}L.expanded=!L.expanded,he(),X()}}function at(T){return T!=null&&T.path?(Te(T),u==null||u(T),!0):!1}async function lt(T={}){const L=y.value;E+=1;const ae=E,me=T.refreshToken||"";if(!t.open||!t.sessionId||!L){s.value=!1,a.value="",L||(i.value=[]);return}try{const Ae=await Gi(t.sessionId,L,{limit:80,refreshToken:me});if(ae!==E)return;i.value=Ae.items||[]}catch(Ae){if(ae!==E)return;a.value=Ae.message,i.value=[]}finally{ae===E&&(s.value=!1)}}function st(T={}){if(b&&(window.clearTimeout(b),b=null),!t.open||!t.sessionId||!y.value){s.value=!1,a.value="",y.value||(i.value=[]);return}s.value=!0,a.value="",b=window.setTimeout(()=>{lt(T)},120)}function bt(){if(!t.sessionId){n.value=[],o.value="",r.value=!1,i.value=[],a.value="",s.value=!1;return}j=Date.now(),n.value=[],o.value="",i.value=[],a.value="",Xe({force:!0,refreshToken:j}),st({refreshToken:j})}function Ue(){ve(),Y(),it(x.value?"search":"tree"),bt()}function ct(){b&&(window.clearTimeout(b),b=null),i.value=[],a.value="",s.value=!1}function it(T){p.value=T,T==="tree"&&t.sessionId&&!r.value&&!n.value.length&&Xe({force:!0}),$e(()=>{rt(),Ie()})}function fe(T){const L=Q.value;if(!L.length)return!1;const ae=Me(),me=ae<0?0:(ae+T+L.length)%L.length;return m.value=L[me].path,!0}async function Be(){if(p.value!=="tree")return!1;const T=xe();if(!T||T.type!=="directory")return!1;if(!T.expanded)return await gt(T.path),m.value=T.path,!0;const L=Q.value,ae=Me(),me=L[ae+1];return me&&Re(me.path)===T.path?(m.value=me.path,!0):!1}function Ce(){if(p.value!=="tree")return!1;const T=xe();if(!T)return!1;if(T.type==="directory"&&T.expanded){const ae=V(T.path);return ae&&(ae.expanded=!1,he(),X()),m.value=T.path,!0}const L=Re(T.path);return L?(m.value=L,!0):!1}function We(){const T=Q.value;return T.length?at(T[Me()]):!1}function xt(T=1){const L=["search","tree"],ae=L.indexOf(p.value),me=ae<0?0:(ae+T+L.length)%L.length;return it(L[me]),!0}function ue(){n.value=[],o.value="",r.value=!1,i.value=[],a.value="",s.value=!1,ve(),Y(),t.sessionId&&t.open&&(Xe({force:!0}),st())}function pe(){it(x.value?"search":"tree"),st()}function N(){rt(),$e(Ie)}return kt(()=>{b&&window.clearTimeout(b)}),{activeKey:m,activeTab:p,collapseActiveDirectory:Ce,confirmActive:We,currentError:q,currentLoading:R,emitSelect:at,expandActiveDirectory:Be,getDisplayName:oe,getHighlightedName:ft,getHighlightedPath:pt,handleQueryChange:pe,handleSessionChange:ue,handleVisibleItemsChange:N,initializeData:Ue,moveActive:fe,normalSearchItems:w,normalizedQuery:y,recentSearchItems:Z,resetData:ct,setActiveTab:it,setItemRef:et,showSearchEmptyState:re,showSearchPromptState:ne,showTreeEmptyState:be,switchTab:xt,toggleDirectory:gt,treeItems:D,visibleItems:Q}}function x1(e){const{props:t,panelRef:u,onClose:n,onSelect:r}=e,{closePicker:o,initializePanel:i,panelReady:s,panelStyle:a,resetPanel:l,updatePanelPosition:d}=m1({props:t,panelRef:u,onClose:n}),p=b1({props:t,onSelect:r});return De(()=>t.open,m=>{if(!m){p.resetData(),l();return}l(),t.anchorRect&&i()&&p.initializeData()},{flush:"sync"}),De(()=>t.anchorRect,m=>{if(!(!t.open||!m)){if(!s.value){i()&&p.initializeData();return}d(!1)}},{flush:"sync"}),De(()=>t.sessionId,()=>{p.handleSessionChange()},{flush:"sync",immediate:!0}),De(()=>t.query,()=>{p.handleQueryChange()},{immediate:!0}),De(p.visibleItems,()=>{p.handleVisibleItemsChange()},{immediate:!0}),De(()=>p.activeKey.value,()=>{p.handleVisibleItemsChange()}),{...p,closePicker:o,panelReady:s,panelStyle:a}}const v1={class:"theme-divider flex items-center justify-between gap-2 border-b border-dashed px-2.5 py-2"},y1={class:"flex items-center gap-1.5"},k1={class:"flex shrink-0 items-center gap-2"},_1={class:"min-h-0 flex-1 overflow-y-auto p-2"},S1={key:0,class:"theme-empty-state px-3 py-4 text-xs"},w1={key:1,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},T1={key:2,class:"theme-empty-state px-3 py-4 text-xs"},C1={key:3,class:"theme-empty-state px-3 py-4 text-xs"},E1={key:4,class:"theme-empty-state px-3 py-4 text-xs"},A1={key:5,class:"theme-empty-state px-3 py-4 text-xs"},D1={key:6,class:"space-y-1"},I1={key:0,class:"theme-muted-text px-1 py-0.5 text-[10px] uppercase tracking-[0.12em]"},F1=["onMouseenter","onClick"],$1={class:"min-w-0 flex-1"},M1=["innerHTML"],P1=["innerHTML"],B1={key:1,class:"theme-muted-text px-1 py-0.5 text-[10px] uppercase tracking-[0.12em]"},R1=["onMouseenter","onClick"],L1={class:"min-w-0 flex-1"},N1=["innerHTML"],O1=["innerHTML"],z1={key:7,class:"space-y-1"},q1=["onMouseenter"],j1={class:"flex items-start gap-1.5"},U1=["onClick"],V1={key:1,class:"block h-5 w-5 shrink-0"},H1=["onClick"],W1={class:"min-w-0 flex-1"},K1={class:"flex items-center gap-1.5"},G1={__name:"PathMentionPicker",props:{open:{type:Boolean,default:!1},sessionId:{type:String,default:""},query:{type:String,default:""},anchorRect:{type:Object,default:null}},emits:["close","select"],setup(e,{expose:t,emit:u}){const n=e,r=u,o=U(null),{t:i}=_t(),{activeKey:s,activeTab:a,closePicker:l,collapseActiveDirectory:d,confirmActive:p,currentError:m,currentLoading:_,emitSelect:b,expandActiveDirectory:E,getDisplayName:j,getHighlightedName:y,getHighlightedPath:x,moveActive:D,normalSearchItems:P,normalizedQuery:$,panelReady:Z,panelStyle:w,recentSearchItems:J,setActiveTab:Q,setItemRef:R,showSearchEmptyState:q,showSearchPromptState:ne,showTreeEmptyState:re,switchTab:be,toggleDirectory:ce,treeItems:O,visibleItems:K}=x1({props:n,panelRef:o,onClose:()=>r("close"),onSelect:F=>r("select",F)});return t({collapseActiveDirectory:d,moveActive:D,confirmActive:p,expandActiveDirectory:E,switchTab:be}),(F,ye)=>(C(),Ee(Ju,{to:"body"},[e.open&&c(Z)?(C(),B("div",{key:0,ref_key:"panelRef",ref:o,class:"theme-popover fixed z-40 flex flex-col overflow-hidden rounded-sm border shadow-lg",style:wn(c(w))},[h("div",v1,[h("div",y1,[h("button",{type:"button",class:Se(["inline-flex h-7 items-center gap-1 rounded-sm border px-2 text-[11px] transition",c(a)==="search"?"tool-button-accent-subtle":"theme-filter-idle border-dashed"]),onClick:ye[0]||(ye[0]=V=>c(Q)("search"))},[le(c(Zs),{class:"h-3.5 w-3.5"}),h("span",null,A(c(i)("pathPicker.searchTab")),1)],2),h("button",{type:"button",class:Se(["inline-flex h-7 items-center gap-1 rounded-sm border px-2 text-[11px] transition",c(a)==="tree"?"tool-button-accent-subtle":"theme-filter-idle border-dashed"]),onClick:ye[1]||(ye[1]=V=>c(Q)("tree"))},[le(c(dn),{class:"h-3.5 w-3.5"}),h("span",null,A(c(i)("pathPicker.treeTab")),1)],2)]),h("div",k1,[h("div",{class:Se(["theme-muted-text inline-flex h-7 w-7 items-center justify-center",c(_)?"opacity-100":"opacity-0"])},[le(c(qt),{class:"h-3.5 w-3.5 animate-spin"})],2),h("button",{type:"button",class:"tool-button inline-flex h-7 w-7 items-center justify-center",onClick:ye[2]||(ye[2]=(...V)=>c(l)&&c(l)(...V))},[le(c(Rr),{class:"h-4 w-4"})])])]),h("div",_1,[e.sessionId?c(m)?(C(),B("div",w1,A(c(m)),1)):c(ne)?(C(),B("div",T1,A(c(i)("pathPicker.searchPrompt")),1)):c(q)?(C(),B("div",C1,A(c(i)("pathPicker.noResults")),1)):c(re)?(C(),B("div",E1,A(c(i)("pathPicker.emptyDirectory")),1)):c(_)&&!c(K).length?(C(),B("div",A1,A(c(i)("pathPicker.loading")),1)):c(a)==="search"?(C(),B("div",D1,[c(J).length?(C(),B("div",I1,A(c(i)("pathPicker.recent")),1)):we("",!0),(C(!0),B(mt,null,It(c(J),V=>(C(),B("button",{key:V.path,ref_for:!0,ref:he=>c(R)(V.path,he),type:"button",class:Se(["flex w-full items-start gap-2 rounded-sm border border-transparent px-2.5 py-1.5 text-left transition",c(s)===V.path?"theme-list-item-active":"theme-list-item-hover"]),onMouseenter:he=>s.value=V.path,onClick:he=>c(b)(V)},[(C(),Ee(ju(V.type==="directory"?c(dn):c(Un)),{class:"theme-muted-text mt-0.5 h-4 w-4 shrink-0"})),h("div",$1,[h("div",null,[h("span",{class:"truncate text-[13px] text-[var(--theme-textPrimary)]",innerHTML:c(y)(V)},null,8,M1)]),h("div",{class:"theme-muted-text truncate font-mono text-[10px]",innerHTML:c(x)(V)},null,8,P1)])],42,F1))),128)),c($)&&c(P).length?(C(),B("div",B1,A(c(i)("pathPicker.results")),1)):we("",!0),(C(!0),B(mt,null,It(c(P),V=>(C(),B("button",{key:V.path,ref_for:!0,ref:he=>c(R)(V.path,he),type:"button",class:Se(["flex w-full items-start gap-2 rounded-sm border border-transparent px-2.5 py-1.5 text-left transition",c(s)===V.path?"theme-list-item-active":"theme-list-item-hover"]),onMouseenter:he=>s.value=V.path,onClick:he=>c(b)(V)},[(C(),Ee(ju(V.type==="directory"?c(dn):c(Un)),{class:"theme-muted-text mt-0.5 h-4 w-4 shrink-0"})),h("div",L1,[h("div",null,[h("span",{class:"truncate text-[13px] text-[var(--theme-textPrimary)]",innerHTML:c(y)(V)},null,8,N1)]),h("div",{class:"theme-muted-text truncate font-mono text-[10px]",innerHTML:c(x)(V)},null,8,O1)])],42,R1))),128))])):(C(),B("div",z1,[(C(!0),B(mt,null,It(c(O),V=>(C(),B("div",{key:V.path,ref_for:!0,ref:he=>c(R)(V.path,he),class:Se(["rounded-sm border border-transparent px-1.5 py-1 transition",c(s)===V.path?"theme-list-item-active":V.type==="directory"&&V.expanded?"theme-list-item-expanded":"theme-list-item-hover"]),style:wn({paddingLeft:`${V.depth*16+6}px`}),onMouseenter:he=>s.value=V.path},[h("div",j1,[V.type==="directory"?(C(),B("button",{key:0,type:"button",class:"theme-icon-button h-5 w-5 shrink-0",onClick:Ze(he=>c(ce)(V.path),["stop"])},[V.loading?(C(),Ee(c(qt),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(C(),Ee(c(Us),{key:1,class:Se(["h-3.5 w-3.5 transition",V.expanded?"rotate-90 text-[var(--theme-textPrimary)]":""])},null,8,["class"]))],8,U1)):(C(),B("span",V1)),h("button",{type:"button",class:"flex min-w-0 flex-1 items-start gap-1.5 rounded-sm px-0.5 py-0.5 text-left",onClick:he=>c(b)(V)},[(C(),Ee(ju(V.type==="directory"?c(dn):c(Un)),{class:Se(["h-4 w-4 shrink-0",V.type==="directory"&&V.expanded?"text-[var(--theme-textPrimary)]":"text-[var(--theme-textMuted)]"])},null,8,["class"])),h("div",W1,[h("div",K1,[h("span",{class:Se(["truncate text-[13px]",V.type==="directory"?"font-medium text-[var(--theme-textPrimary)]":"text-[var(--theme-textPrimary)]"])},A(c(j)(V)),3)])])],8,H1)])],46,q1))),128))])):(C(),B("div",S1,A(c(i)("pathPicker.selectProjectFirst")),1))])],4)):we("",!0)]))}},Z1={class:"theme-divider theme-secondary-text border-b px-5 py-3 text-sm"},X1={class:"flex justify-end"},Y1={class:"grid w-full grid-cols-3 gap-2 sm:flex sm:w-auto sm:flex-wrap sm:items-center sm:justify-end"},J1=["accept"],Q1={key:0,class:"group relative"},ep=["value","placeholder","onFocus","onBlur","onInput","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown","onClick","onKeyup","onSelect"],tp=["onClick"],up={key:1,class:"group relative dashed-panel overflow-hidden"},np={class:"theme-divider theme-secondary-text flex items-start justify-between gap-3 border-b border-dashed px-4 py-3 text-xs"},op={class:"min-w-0 pr-24"},rp={class:"theme-heading font-medium"},sp={class:"mt-1 truncate font-mono"},ip={class:"mt-1"},ap={class:"absolute right-3 top-3 flex flex-wrap gap-2 opacity-0 transition group-hover:opacity-100 focus-within:opacity-100"},lp=["onClick"],cp=["onClick"],dp=["onClick"],fp={key:0,class:"theme-secondary-text px-4 py-3 text-sm leading-7"},pp={key:0},hp=["value","placeholder","onFocus","onBlur","onInput","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown","onClick","onKeyup","onSelect"],mp={key:2,class:"group relative"},gp=["onClick"],bp=["onClick"],xp={class:"theme-divider theme-muted-text flex items-center gap-2 border-b px-4 py-3 text-xs"},vp={class:"mx-auto flex w-full max-w-[720px] justify-center px-4 py-4"},yp=["onClick"],kp=["src","alt"],Sr=10*1024*1024,wr=2*1024*1024,Tr=8*1024*1024,_p=1500,Sp={__name:"BlockEditor",props:{modelValue:{type:Array,required:!0},codexSessionId:{type:String,default:""},uploading:{type:Boolean,default:!1}},emits:["update:modelValue","upload-files","import-text-files","import-pdf-files","clear-request","file-feedback"],setup(e,{expose:t,emit:u}){const n=e,r=u,{t:o}=_t(),i=new Set([".md",".markdown",".txt",".js",".mjs",".cjs",".ts",".mts",".cts",".jsx",".tsx",".vue",".json",".css",".scss",".sass",".less",".html",".htm",".xml",".svg",".yml",".yaml",".toml",".ini",".conf",".env",".py",".java",".go",".rs",".rb",".php",".sh",".bash",".zsh",".sql",".c",".cc",".cpp",".h",".hpp",".cs",".kt",".swift",".log",".csv"]),s=new Set(["application/json","application/ld+json","application/xml","application/javascript","application/x-javascript","application/typescript","application/x-typescript","application/yaml","application/x-yaml","application/toml","application/x-toml","application/x-sh","application/x-shellscript","application/sql"]),a=["image/*",".md,.markdown,.txt,.js,.mjs,.cjs,.ts,.mts,.cts,.jsx,.tsx,.vue,.json,.css,.scss,.sass,.less,.html,.htm,.xml,.svg,.yml,.yaml,.toml,.ini,.conf,.env,.py,.java,.go,.rs,.rb,.php,.sh,.bash,.zsh,.sql,.c,.cc,.cpp,.h,.hpp,.cs,.kt,.swift,.log,.csv",".pdf","text/plain","text/markdown","text/*","application/json","application/xml","application/javascript","application/typescript","application/yaml","application/x-yaml","application/toml","application/x-toml","application/x-sh","application/x-shellscript","application/sql","application/pdf"].join(","),l=de(()=>n.modelValue),d=de(()=>n.codexSessionId),p=U(0),m=U([]),_=U(-1),b=U(-1),E=U(null),j=U(null),y=U(null),x=U(null),D=U(null),P=U({}),$=U(""),Z=U(0),w=U(-1),J=U("nearest"),Q=U("visible"),R=U(null);let q=null,ne=null,re=0,be=0;const{mentionState:ce,mentionAnchorRect:O,applyMentionSelection:K,closeMentionPicker:F,dismissMentionPicker:ye,handleTextFocus:V,openPathPickerFromShortcut:he,recordSelection:G,syncMentionState:X,updateMentionAnchor:Y}=f1({activeIndex:p,blocks:l,isTextLikeBlock:ge,placeCursor:Ce,resizeAllTextareas:Je,selectionMap:P,sessionId:d,setBlocks:Ie,textareas:m}),ve=de(()=>l.value.filter(f=>(f==null?void 0:f.type)===Oe.IMAGE&&String(f.content||"").trim()).map(f=>String(f.content||"").trim()));function oe(f){return(f==null?void 0:f.type)===Oe.TEXT}function ge(f){return(f==null?void 0:f.type)===Oe.TEXT||(f==null?void 0:f.type)===Oe.IMPORTED_TEXT}function Te(f){return f&&f.type!==Oe.TEXT}function Re(){var f,g;return((g=(f=globalThis.crypto)==null?void 0:f.randomUUID)==null?void 0:g.call(f))||`block-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function Me(f={}){return{...f,clientId:String((f==null?void 0:f.clientId)||(f==null?void 0:f.id)||Re()),meta:f!=null&&f.meta?{...f.meta}:{}}}function xe(f=""){return Me({type:Oe.TEXT,content:f,meta:{}})}function rt(f=[]){const g=Array.isArray(f)?f.filter(Boolean):[];if(!g.length)return[xe("")];const v=[];return g.forEach((I,W)=>{const te=Me(I),_e=v[v.length-1];!_e&&Te(te)&&v.push(xe("")),_e&&Te(_e)&&Te(te)&&v.push(xe("")),v.push(te),W===g.length-1&&Te(te)&&v.push(xe(""))}),v}function et(f=[],g=[]){return f===g?!0:!Array.isArray(f)||!Array.isArray(g)||f.length!==g.length?!1:f.every((v,I)=>{var te,_e,Le,ie;const W=g[I];return!W||(v==null?void 0:v.type)!==W.type||(v==null?void 0:v.content)!==W.content?!1:(((te=v==null?void 0:v.meta)==null?void 0:te.fileName)||"")===(((_e=W.meta)==null?void 0:_e.fileName)||"")&&!!((Le=v==null?void 0:v.meta)!=null&&Le.collapsed)==!!((ie=W.meta)!=null&&ie.collapsed)})}function Ie(f){r("update:modelValue",rt(f))}function Ne(f,g){if(f){if(m.value[g]===f)return;m.value[g]=f,dt(f);return}m.value[g]=null}function dt(f,g={}){if(!f)return;const{allowShrink:v=!0,preserveViewport:I=!0,preserveSelection:W=!0}=g,te=window.scrollX,_e=window.scrollY,Le=f.selectionStart,ie=f.selectionEnd,Lt=document.activeElement===f,wt=Number.parseFloat(f.style.height)||f.offsetHeight||40;v?(f.style.height="auto",f.style.height=`${Math.max(f.scrollHeight,40)}px`):f.style.height=`${Math.max(wt,f.scrollHeight,40)}px`,W&&Lt&&Le!==null&&ie!==null&&f.setSelectionRange(Le,ie),I&&(window.scrollX!==te||window.scrollY!==_e)&&window.scrollTo(te,_e)}function Je(){m.value.forEach(f=>dt(f))}function ft(){if(Date.now()<=be)return;const f=w.value;f<0||at(f)||He()}function pt(){q&&(window.clearTimeout(q),q=null)}function He(){var f;w.value=-1,J.value="nearest",Q.value="visible",R.value=null,pt(),re&&((f=window.cancelAnimationFrame)==null||f.call(window,re),re=0)}function St(f=8e3){pt();const g=Math.max(0,Number(f)||0);g&&(q=window.setTimeout(()=>{He()},g))}function Xe(){ne&&(ne.disconnect(),ne=null)}function gt(f){const g=j.value;if(!g)return;const v=Math.max(0,Number(f)||0);Math.abs(g.scrollTop-v)<1||(be=Date.now()+120,g.scrollTop=v)}function at(f,g={}){const v=j.value,I=m.value[f];return!v||!I?!1:h1({containerScrollTop:v.scrollTop,containerClientHeight:v.clientHeight,targetTop:gn(I,v),targetHeight:I.offsetHeight,padding:g.padding})}function lt(){const f=j.value;return f?Math.max(120,Math.round(f.clientHeight*.2)):120}function st(f){const g=j.value,v=m.value[f];return!g||!v?null:gn(v,g)-g.scrollTop}function bt(f){const g=st(f);return g===null?null:{mode:"preserve",anchorOffset:g}}function Ue(){const f=w.value;if(f<0)return;const g=j.value,v=m.value[f];if(!(!g||!v)){if(Q.value==="preserve"&&R.value!==null){const I=gn(v,g),W=I-g.scrollTop,te=Number(R.value)||0;if(Math.abs(W-te)<=lt()){gt(I-te);return}}Be(f,{align:J.value||"nearest"})}}function ct(){w.value<0||$e(()=>{var f,g;Ue(),re&&((f=window.cancelAnimationFrame)==null||f.call(window,re)),re=((g=window.requestAnimationFrame)==null?void 0:g.call(window,()=>{re=0,Ue()}))||0})}function it(f,g={}){const v=Math.max(-1,Number(f)||-1);if(v<0){He();return}w.value=v,J.value=g.align==="end"?"end":"nearest",Q.value=g.mode==="preserve"?"preserve":"visible",R.value=typeof g.anchorOffset=="number"?g.anchorOffset:null,St(g.duration),ct()}function fe(f){Xe(),!(!f||typeof window>"u"||typeof window.ResizeObserver>"u")&&(ne=new window.ResizeObserver(()=>{w.value>=0&&ct()}),ne.observe(f))}function Be(f,g={}){const v=m.value[f];if(!v)return;const{align:I="nearest"}=g,W=j.value;if(!W){v.scrollIntoView({block:I==="end"?"end":"nearest",inline:"nearest"});return}const te=p1({containerScrollTop:W.scrollTop,containerClientHeight:W.clientHeight,targetTop:gn(v,W),targetHeight:v.offsetHeight,align:I});te!==W.scrollTop&>(te)}function Ce(f,g=null,v={}){const I=m.value[f];if(!I)return;const W=g??I.value.length;try{I.focus({preventScroll:!0})}catch{I.focus()}I.setSelectionRange(W,W),Be(f,v),v.follow!==!1&&it(f,{align:v.align,mode:v.followMode,anchorOffset:v.followAnchorOffset,duration:v.followDuration}),P.value[f]={start:W,end:W}}function We(f,g){Z.value=Date.now();const v=l.value.map((I,W)=>W===f?{...I,content:g}:I);Ie(v)}function xt(f,g=""){const v=l.value[f];if(!ge(v))return!1;const I=String(g??"");if(I===v.content)return!1;const W=[...l.value];return W.splice(f,1,{...v,content:I}),Ie(W),!0}function ue(){let f=!1;return m.value.forEach((g,v)=>{g&&(f=xt(v,g.value)||f)}),f}function pe(f=null){return typeof f=="number"?_.value===f:_.value>=0}function N(f){const g=l.value.map((v,I)=>{var W;return I===f?{...v,meta:{...v.meta,collapsed:!((W=v.meta)!=null&&W.collapsed)}}:v});Ie(g)}function T(f){const g=l.value[f];if(!g||g.type!==Oe.IMPORTED_TEXT)return;const v=l.value.map((I,W)=>W===f?{type:Oe.TEXT,content:I.content,meta:{}}:I);Ie(v),p.value=f,$e(()=>Ce(f,0))}function L(f){const g=l.value[f];if((g==null?void 0:g.type)===Oe.TEXT&&l.value.length===1){Ie([{...g,content:""}]),$e(()=>Ce(0,0));return}const v=l.value.filter((I,W)=>W!==f);Ie(v),$e(()=>{var W;const I=Math.max(0,Math.min(f,v.length-1));((W=l.value[I])==null?void 0:W.type)===Oe.TEXT&&Ce(I,0)})}function ae(){Ie([xe("")]),p.value=0,P.value={0:{start:0,end:0}},$e(()=>Ce(0,0))}function me(f="",g=180){return String(f).replace(/\s+/g," ").trim().slice(0,g)}function Ae(f=""){const g=String(f),v=g?g.split(`
|
|
235
|
+
`).length:0,I=g.length;return o("blockEditor.stats",{lines:v,chars:I})}function Et(f,g,v={}){const{focusAfterInserted:I=!1}=v,W=I?bt(f):null,te=[...l.value],_e=te[f],Le=P.value[f]||{start:_e.content.length,end:_e.content.length},ie=Math.max(0,Le.start??0),Lt=Math.max(ie,Le.end??ie),wt=_e.content.slice(0,ie),xu=_e.content.slice(Lt),Nt=[];wt&&Nt.push({..._e,content:wt}),Nt.push(...g),xu&&Nt.push(xe(xu)),te.splice(f,1,...Nt),Ie(te),$e(()=>{const an=I?f+Nt.length-(xu?1:0):f,Jt=l.value.findIndex((ln,vu)=>vu>=an&&ln.type===Oe.TEXT);Jt>=0&&(p.value=Jt,Ce(Jt,0,{align:"nearest",followMode:W==null?void 0:W.mode,followAnchorOffset:W==null?void 0:W.anchorOffset}))})}function Pt(f,g={}){const{focusAfterInserted:v=!1}=g;if(!f.length)return;const I=Math.min(p.value??0,Math.max(l.value.length-1,0)),W=l.value[I],te=v?bt(I):null;if(!W||W.type===Oe.IMPORTED_TEXT){const _e=[...l.value],Le=I+1;_e.splice(Le,0,...f),Ie(_e),v&&$e(()=>{const ie=l.value.findIndex((Lt,wt)=>wt>=Le+f.length&&Lt.type===Oe.TEXT);ie>=0&&(p.value=ie,Ce(ie,0,{align:"nearest",followMode:te==null?void 0:te.mode,followAnchorOffset:te==null?void 0:te.anchorOffset}))});return}if(!oe(W)){const _e=[...l.value],Le=_e.length?I+1:0;_e.splice(Le,0,...f),Ie(_e),v&&$e(()=>{const ie=l.value.findIndex((Lt,wt)=>wt>=Le+f.length&&Lt.type===Oe.TEXT);ie>=0&&(p.value=ie,Ce(ie,0,{align:"nearest",followMode:te==null?void 0:te.mode,followAnchorOffset:te==null?void 0:te.anchorOffset}))});return}Et(I,f,{focusAfterInserted:v})}function $t(f){const g=String(f||"");if(!g)return;const v=Math.min(p.value??0,Math.max(l.value.length-1,0)),I=l.value[v];if(!I||!ge(I)){Pt([xe(g)]);return}const W=P.value[v]||{start:I.content.length,end:I.content.length},te=Math.max(0,W.start??0),_e=Math.max(te,W.end??te),Le=`${I.content.slice(0,te)}${g}${I.content.slice(_e)}`,ie=[...l.value];ie.splice(v,1,{...I,content:Le}),Ie(ie),$e(()=>Ce(v,te+g.length))}function At(f){Pt(f,{focusAfterInserted:!0})}function Iu(f){Pt(f,{focusAfterInserted:!0})}function mu(f){Pt(f,{focusAfterInserted:!0})}function Zt(f,g){const v=l.value[f],I=l.value[g];if(!ge(v)||!ge(I))return;const W=g<f?`${I.content}${v.content}`:`${v.content}${I.content}`,te=[...l.value],_e=Math.min(f,g),Le=Math.max(f,g);te.splice(_e,1,{...te[_e],content:W}),te.splice(Le,1),Ie(te);const ie=g<f?I.content.length:v.content.length;p.value=_e,$e(()=>Ce(_e,ie))}function Xt(f,g,v=0){const I=l.value.filter((te,_e)=>_e!==g);Ie(I);const W=g<f?f-1:f;p.value=W,$e(()=>Ce(W,v))}function k(f){const g=l.value.findIndex((v,I)=>I>f&&v.type===Oe.TEXT);g>=0&&(p.value=g,$e(()=>Ce(g,0)))}function S(f){const g=String(f||"").trim();g&&($.value=g)}function z(f){const g=[...f].filter(v=>v&&v.type.startsWith("image/"));g.length&&r("upload-files",g)}function se(f){const g=String((f==null?void 0:f.name)||"").trim().toLowerCase();return g.includes(".")?`.${g.split(".").pop()}`:""}function ee(f,g){return String((f==null?void 0:f.name)||"").trim()||o(g)}function ke(f){const g=Math.max(0,Number(f)||0);return g>=1024*1024?`${(g/(1024*1024)).toFixed(g>=10*1024*1024?0:1)} MB`:g>=1024?`${Math.round(g/1024)} KB`:`${g} B`}function tt(f){if(!f)return!1;const g=String(f.type||"").toLowerCase(),v=se(f);return g.startsWith("text/")||i.has(v)||s.has(g)}function Fe(f){if(!f)return!1;const g=String(f.name||"").toLowerCase(),v=String(f.type||"").toLowerCase();return g.endsWith(".pdf")||v==="application/pdf"}function Bt(f){const g=Array.from(f||[]).filter(Boolean),v={imageFiles:[],textFiles:[],pdfFiles:[]},I=[],W=[];return g.forEach(te=>{if(te.type.startsWith("image/")){if(te.size>Sr){W.push({name:ee(te,"blockEditor.unnamedImage"),limit:ke(Sr)});return}v.imageFiles.push(te);return}if(Fe(te)){if(te.size>Tr){W.push({name:ee(te,"blockEditor.unnamedPdf"),limit:ke(Tr)});return}v.pdfFiles.push(te);return}if(tt(te)){if(te.size>wr){W.push({name:ee(te,"blockEditor.unnamedFile"),limit:ke(wr)});return}v.textFiles.push(te);return}I.push(ee(te,"blockEditor.unnamedFile"))}),{...v,unsupportedFiles:I,oversizedFiles:W}}function Yt(f){const g=String(f||"").trim();g&&r("file-feedback",g)}function gu({unsupportedFiles:f=[],oversizedFiles:g=[]}={}){var v;f.length&&Yt(o("blockEditor.unsupportedFiles",{names:f.slice(0,3).join("、"),extra:Math.max(0,f.length-3)})),g.length&&Yt(o("blockEditor.oversizedFiles",{names:g.slice(0,2).map(I=>I.name).join("、"),extra:Math.max(0,g.length-2),limit:((v=g[0])==null?void 0:v.limit)||""}))}function ru(f){const{imageFiles:g,textFiles:v,pdfFiles:I,unsupportedFiles:W,oversizedFiles:te}=Bt(f);return gu({unsupportedFiles:W,oversizedFiles:te}),v.length&&r("import-text-files",v),I.length&&r("import-pdf-files",I),g.length&&z(g),g.length+v.length+I.length>0}function Vt(f){const g=[...f.clipboardData.items].filter(v=>v.kind==="file").map(v=>v.getAsFile()).filter(Boolean);g.length&&(f.preventDefault(),ru(g))}function Rt(f){f.preventDefault(),ru(f.dataTransfer.files)}function Ke(f){ru(f.target.files),f.target.value=""}function bu(){var f;(f=x.value)==null||f.click()}function Nn(f){var g;return!!((g=f==null?void 0:f.closest)!=null&&g.call(f,'textarea,button,input,select,option,label,a,[contenteditable="true"]'))}function Fu(f=0){const g=m.value.map((I,W)=>({element:I,index:W})).filter(I=>I.element);if(!g.length)return-1;const v=g.reduce((I,W)=>{const te=W.element.getBoundingClientRect(),_e=te.top+te.height/2,Le=Math.abs(f-_e);return!I||Le<I.distance?{index:W.index,distance:Le}:I},null);return(v==null?void 0:v.index)??-1}function On(){if(!Array.isArray(l.value)||!l.value.length)return-1;const f=Math.max(0,Math.min(p.value??0,l.value.length-1));if(m.value[f])return f;let g=-1,v=Number.POSITIVE_INFINITY;return m.value.forEach((I,W)=>{if(!I)return;const te=Math.abs(W-f);(te<v||te===v&&W>f)&&(g=W,v=te)}),g}function zn(f=0,g={}){const{preferActive:v=!1}=g,I=v?On():Fu(f);I<0||(F(),p.value=I,$e(()=>{var _e,Le;const W=m.value[I],te=f<=(((_e=W==null?void 0:W.getBoundingClientRect)==null?void 0:_e.call(W).top)??0)?0:((Le=W==null?void 0:W.value)==null?void 0:Le.length)||0;Ce(I,te)}))}function qn(f){var g,v;Nn(f.target)||(v=(g=E.value)==null?void 0:g.contains)!=null&&v.call(g,f.target)&&zn(f.clientY||0,{preferActive:!0})}function su(f,g){Z.value=Date.now();const v=ce.value.open&&ce.value.blockIndex===f;dt(g.target,v?{allowShrink:!1,preserveViewport:!1,preserveSelection:!1}:void 0),X(f,g.target),it(f,{align:f===l.value.length-1?"end":"nearest"})}function un(f){_.value=f,b.value=f,Z.value=Date.now()}function $u(f,g){Z.value=Date.now(),xt(f,g.target.value),su(f,g)}function nn(f,g){Z.value=Date.now(),xt(f,g.target.value),_.value=-1,su(f,g)}function Mu(f){b.value=f,at(f,{padding:0})||Be(f,{align:"nearest"})}function Pu(f){b.value===f&&(b.value=-1),!pe(f)&&w.value===f&&He()}async function Bu(f,g){var _e,Le,ie,Lt,wt,xu,Nt,an,Jt,ln,vu,Lo;const v=l.value[f],I=g.target;if((g.metaKey||g.ctrlKey)&&g.shiftKey&&g.key==="Backspace"){g.preventDefault(),r("clear-request");return}if(!ge(v))return;if((g.metaKey||g.ctrlKey)&&!g.shiftKey&&!g.altKey&&g.key.toLowerCase()==="k"&&he()){g.preventDefault();return}if(ce.value.open&&ce.value.blockIndex===f){if(g.key==="Escape"){g.preventDefault(),ye();return}if(g.key==="ArrowDown"&&(Le=(_e=D.value)==null?void 0:_e.moveActive)!=null&&Le.call(_e,1)){g.preventDefault();return}if(g.key==="ArrowUp"&&(Lt=(ie=D.value)==null?void 0:ie.moveActive)!=null&&Lt.call(ie,-1)){g.preventDefault();return}if(g.key==="ArrowRight"&&await((xu=(wt=D.value)==null?void 0:wt.expandActiveDirectory)==null?void 0:xu.call(wt))){g.preventDefault();return}if(g.key==="ArrowLeft"&&(an=(Nt=D.value)==null?void 0:Nt.collapseActiveDirectory)!=null&&an.call(Nt)){g.preventDefault();return}if(!g.altKey&&!g.metaKey&&!g.ctrlKey&&g.key==="Tab"&&(ln=(Jt=D.value)==null?void 0:Jt.switchTab)!=null&&ln.call(Jt,g.shiftKey?-1:1)){g.preventDefault();return}if(!g.shiftKey&&!g.altKey&&!g.metaKey&&!g.ctrlKey&&g.key==="Enter"&&(Lo=(vu=D.value)==null?void 0:vu.confirmActive)!=null&&Lo.call(vu)){g.preventDefault();return}}const W=I.selectionStart??0,te=I.selectionEnd??0;if(g.key==="Backspace"&&W===0&&te===0){const Ru=l.value[f-1];if(!Ru)return;if(g.preventDefault(),ge(Ru)){Zt(f,f-1);return}Xt(f,f-1,0);return}if(g.key==="Delete"&&W===v.content.length&&te===v.content.length){const Ru=l.value[f+1];if(!Ru)return;if(g.preventDefault(),ge(Ru)){Zt(f,f+1);return}Xt(f,f+1,v.content.length)}}function on(){const f=l.value.findIndex(g=>g.type===Oe.TEXT);f<0||(p.value=f,$e(()=>{var I;const g=m.value[f],v=(g==null?void 0:g.selectionStart)??((I=g==null?void 0:g.value)==null?void 0:I.length)??0;Ce(f,v)}))}function rn(){return _.value>=0||b.value>=0?!0:Date.now()-Z.value<_p}const sn=de(()=>l.value.map((f,g)=>{var v;return`${g}:${f.type}:${(v=f.meta)!=null&&v.collapsed?"1":"0"}`}).join("|")),H=de(()=>l.value.map((f,g)=>ge(f)?`${g}:${f.type}:${f.content||""}`:`${g}:${f.type}`).join("|"));return De(sn,()=>{$e(()=>{Je()})},{immediate:!0}),De(()=>n.modelValue,f=>{const g=rt(f);et(g,f)||r("update:modelValue",g),_.value>=g.length&&(_.value=-1)},{immediate:!0,deep:!0}),De(H,()=>{$e(()=>{Je()})},{immediate:!0}),De(sn,()=>{ce.value.open&&$e(Y)}),De(y,f=>{fe(f)},{immediate:!0}),kt(()=>{He(),Xe()}),t({clearContent:ae,flushPendingInput:ue,focusEditor:on,insertBlocks:Iu,insertImportedBlocks:mu,insertTextAtSelection:$t,insertUploadedBlocks:At,isComposing:pe,isEditing:rn,isImportedBlockActive:()=>{var f;return((f=l.value[p.value])==null?void 0:f.type)===Oe.IMPORTED_TEXT},openFilePicker:bu}),(f,g)=>(C(),B("section",{ref_key:"surfaceRef",ref:E,class:"panel relative flex h-full min-h-0 flex-col overflow-hidden",onClick:qn,onDrop:Rt,onDragover:g[1]||(g[1]=Ze(()=>{},["prevent"])),onPaste:Vt},[h("div",Z1,[h("div",X1,[h("div",Y1,[Gt(f.$slots,"header-actions")])]),h("input",{ref_key:"fileInputRef",ref:x,class:"hidden",type:"file",accept:c(a),multiple:"",onChange:Ke},null,40,J1)]),h("div",{ref_key:"contentRef",ref:j,class:"flex-1 overflow-y-auto px-5 py-5",onScroll:ft},[h("div",{ref_key:"contentBodyRef",ref:y,class:"flex flex-col gap-5"},[(C(!0),B(mt,null,It(l.value,(v,I)=>{var W,te,_e,Le;return C(),B(mt,{key:String(v.id||v.clientId||`${v.type}-${I}`)},[v.type===c(Oe).TEXT?(C(),B("div",Q1,[h("textarea",{ref_for:!0,ref:ie=>Ne(ie,I),rows:"1",value:v.content,class:"w-full resize-none overflow-hidden border-0 bg-transparent p-0 pr-12 text-[15px] leading-8 text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]",placeholder:I===0?c(o)("blockEditor.placeholderFirst"):c(o)("blockEditor.placeholderNext"),onFocus:ie=>{c(V)(I),Mu(I)},onBlur:ie=>Pu(I),onInput:ie=>{We(I,ie.target.value),su(I,ie)},onCompositionstart:ie=>un(I),onCompositionupdate:ie=>$u(I,ie),onCompositionend:ie=>nn(I,ie),onKeydown:ie=>Bu(I,ie),onClick:ie=>c(G)(I,ie),onKeyup:ie=>c(G)(I,ie),onSelect:ie=>c(G)(I,ie)},null,40,ep),h("button",{type:"button",class:"tool-button tool-button-danger-subtle absolute right-0 top-1 inline-flex items-center gap-1.5 px-2 py-1 text-xs opacity-0 transition group-hover:opacity-100 focus:opacity-100",onClick:ie=>L(I)},[le(c(Vu),{class:"h-3.5 w-3.5"}),h("span",null,A(c(o)("blockEditor.delete")),1)],8,tp)])):v.type===c(Oe).IMPORTED_TEXT?(C(),B("div",up,[h("div",np,[h("div",op,[h("p",rp,A(c(o)("blockEditor.importedFile")),1),h("p",sp,A(((W=v.meta)==null?void 0:W.fileName)||c(o)("blockEditor.unnamedFile")),1),h("p",ip,A(Ae(v.content)),1)]),h("div",ap,[h("button",{type:"button",class:"tool-button inline-flex items-center gap-1.5 px-2 py-1 text-xs",onClick:ie=>N(I)},[le(c(Uu),{class:Se(["h-3.5 w-3.5",(te=v.meta)!=null&&te.collapsed?"rotate-180":""])},null,8,["class"]),h("span",null,A((_e=v.meta)!=null&&_e.collapsed?c(o)("blockEditor.expand"):c(o)("blockEditor.collapse")),1)],8,lp),h("button",{type:"button",class:"tool-button inline-flex items-center gap-1.5 px-2 py-1 text-xs",onClick:ie=>T(I)},[le(c(io),{class:"h-3.5 w-3.5"}),h("span",null,A(c(o)("blockEditor.convertToText")),1)],8,cp),h("button",{type:"button",class:"tool-button tool-button-danger-subtle inline-flex items-center gap-1.5 px-2 py-1 text-xs",onClick:ie=>L(I)},[le(c(Vu),{class:"h-3.5 w-3.5"}),h("span",null,A(c(o)("blockEditor.delete")),1)],8,dp)])]),(Le=v.meta)!=null&&Le.collapsed?(C(),B("div",fp,[zu(A(me(v.content)||c(o)("blockEditor.emptyContent")),1),v.content.length>180?(C(),B("span",pp,"...")):we("",!0)])):(C(),B("textarea",{key:1,ref_for:!0,ref:ie=>Ne(ie,I),rows:"1",value:v.content,class:"w-full resize-none overflow-hidden border-0 bg-transparent px-4 py-4 text-[15px] leading-8 text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]",placeholder:c(o)("blockEditor.emptyImportPlaceholder"),onFocus:ie=>{c(V)(I),Mu(I)},onBlur:ie=>Pu(I),onInput:ie=>{We(I,ie.target.value),su(I,ie)},onCompositionstart:ie=>un(I),onCompositionupdate:ie=>$u(I,ie),onCompositionend:ie=>nn(I,ie),onKeydown:ie=>Bu(I,ie),onClick:ie=>c(G)(I,ie),onKeyup:ie=>c(G)(I,ie),onSelect:ie=>c(G)(I,ie)},null,40,hp))])):(C(),B("figure",mp,[h("button",{type:"button",class:"tool-button tool-button-danger-subtle absolute right-3 top-3 z-10 inline-flex items-center gap-1.5 px-2 py-1 text-xs opacity-0 transition group-hover:opacity-100 focus:opacity-100",onClick:ie=>L(I)},[le(c(Vu),{class:"h-3.5 w-3.5"}),h("span",null,A(c(o)("blockEditor.delete")),1)],8,gp),h("div",{class:"theme-inline-panel overflow-hidden rounded-sm border",onClick:ie=>k(I)},[h("div",xp,[le(c(_o),{class:"h-4 w-4"}),h("span",null,A(c(o)("blockEditor.insertedImage")),1)]),h("div",vp,[h("button",{type:"button",class:"inline-flex cursor-zoom-in justify-center",onClick:Ze(ie=>S(v.content),["stop"])},[h("img",{src:v.content,alt:c(o)("blockEditor.insertedImageAlt"),class:"max-h-[380px] w-auto max-w-full object-contain"},null,8,kp)],8,yp)])],8,bp)]))],64)}),128))],512)],544),le(Vr,{modelValue:$.value,"onUpdate:modelValue":g[0]||(g[0]=v=>$.value=v),images:ve.value},null,8,["modelValue","images"]),le(G1,{ref_key:"mentionPickerRef",ref:D,open:c(ce).open&&!!c(O),"session-id":e.codexSessionId,query:c(ce).query,"anchor-rect":c(O),onClose:c(ye),onSelect:c(K)},null,8,["open","session-id","query","anchor-rect","onClose","onSelect"])],544))}},wp=["disabled"],Tp=["disabled"],Cp=["disabled"],Ep={__name:"WorkbenchEditorActions",props:{canAddTodo:{type:Boolean,default:!1},uploading:{type:Boolean,default:!1},isCurrentTaskSending:{type:Boolean,default:!1},sendState:{type:String,default:"idle"},todoCount:{type:Number,default:0}},emits:["add-todo","open-file-picker","clear-request","copy-request","manage-todo","send-request"],setup(e,{emit:t}){const u=e,n=t,{t:r}=_t(),o=de(()=>u.sendState==="sending"||u.sendState==="running");return(i,s)=>(C(),B(mt,null,[h("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",disabled:e.uploading,onMousedown:s[0]||(s[0]=Ze(()=>{},["prevent"])),onClick:s[1]||(s[1]=a=>n("open-file-picker"))},[e.uploading?(C(),Ee(c(qt),{key:0,class:"h-4 w-4 animate-spin"})):(C(),Ee(c(Qs),{key:1,class:"h-4 w-4"})),h("span",null,A(c(r)("editor.chooseFiles")),1)],40,wp),h("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",onMousedown:s[2]||(s[2]=Ze(()=>{},["prevent"])),onClick:s[3]||(s[3]=a=>n("clear-request"))},[le(c(ei),{class:"h-4 w-4"}),h("span",null,A(c(r)("editor.clear")),1)],32),h("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",disabled:!e.canAddTodo,onMousedown:s[4]||(s[4]=Ze(()=>{},["prevent"])),onClick:s[5]||(s[5]=a=>n("add-todo"))},[le(c(Br),{class:"h-4 w-4"}),h("span",null,A(c(r)("editor.todo")),1)],40,Tp),h("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",onMousedown:s[6]||(s[6]=Ze(()=>{},["prevent"])),onClick:s[7]||(s[7]=a=>n("manage-todo"))},[le(c(Pr),{class:"h-4 w-4"}),h("span",null,A(e.todoCount>0?c(r)("editor.todoWithCount",{count:e.todoCount}):c(r)("editor.todo")),1)],32),h("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",disabled:e.isCurrentTaskSending,onMousedown:s[8]||(s[8]=Ze(()=>{},["prevent"])),onClick:s[9]||(s[9]=a=>n("send-request"))},[o.value?(C(),Ee(c(qt),{key:0,class:"h-4 w-4 animate-spin"})):(C(),Ee(c(Xs),{key:1,class:"h-4 w-4"})),h("span",null,A(c(r)("editor.send")),1)],40,Cp)],64))}},Ap={key:0,class:"panel theme-muted-text flex h-full items-center px-5 py-4 text-sm"},Cr={__name:"WorkbenchInputPanel",props:{canAddTodo:{type:Boolean,default:!1},codexSessionId:{type:String,default:""},isCurrentTaskSending:{type:Boolean,default:!1},sendState:{type:String,default:"idle"},modelValue:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},todoCount:{type:Number,default:0},uploading:{type:Boolean,default:!1}},emits:["add-todo","update:modelValue","upload-files","import-text-files","import-pdf-files","file-feedback","clear-request","copy-request","manage-todo","send-request"],setup(e,{expose:t,emit:u}){const n=e,r=u,o=U(null),{t:i}=_t(),s=de({get:()=>n.modelValue,set:y=>r("update:modelValue",y)});function a(){var y,x;(x=(y=o.value)==null?void 0:y.openFilePicker)==null||x.call(y)}function l(){var y,x;(x=(y=o.value)==null?void 0:y.focusEditor)==null||x.call(y)}function d(){var y,x;return((x=(y=o.value)==null?void 0:y.flushPendingInput)==null?void 0:x.call(y))||!1}function p(y){var x,D;(D=(x=o.value)==null?void 0:x.insertBlocks)==null||D.call(x,y)}function m(y){var x,D;(D=(x=o.value)==null?void 0:x.insertImportedBlocks)==null||D.call(x,y)}function _(y){var x,D;(D=(x=o.value)==null?void 0:x.insertUploadedBlocks)==null||D.call(x,y)}function b(){var y,x;return((x=(y=o.value)==null?void 0:y.isImportedBlockActive)==null?void 0:x.call(y))||!1}function E(){var y,x;return((x=(y=o.value)==null?void 0:y.isComposing)==null?void 0:x.call(y))||!1}function j(){var y,x;return((x=(y=o.value)==null?void 0:y.isEditing)==null?void 0:x.call(y))||!1}return t({focusEditor:l,flushPendingInput:d,insertBlocks:p,insertImportedBlocks:m,insertUploadedBlocks:_,isComposing:E,isEditing:j,isImportedBlockActive:b,openFilePicker:a}),(y,x)=>e.loading&&!e.modelValue.length?(C(),B("section",Ap,A(c(i)("workbench.loadingTaskContent")),1)):(C(),Ee(Sp,{key:1,ref_key:"blockEditorRef",ref:o,modelValue:s.value,"onUpdate:modelValue":x[5]||(x[5]=D=>s.value=D),"codex-session-id":e.codexSessionId,uploading:e.uploading,onUploadFiles:x[6]||(x[6]=D=>r("upload-files",D)),onImportTextFiles:x[7]||(x[7]=D=>r("import-text-files",D)),onImportPdfFiles:x[8]||(x[8]=D=>r("import-pdf-files",D)),onFileFeedback:x[9]||(x[9]=D=>r("file-feedback",D)),onClearRequest:x[10]||(x[10]=D=>r("clear-request"))},{"header-actions":Ye(()=>[le(Ep,{"can-add-todo":e.canAddTodo,"is-current-task-sending":e.isCurrentTaskSending,"send-state":e.sendState,"todo-count":e.todoCount,uploading:e.uploading,onAddTodo:x[0]||(x[0]=D=>r("add-todo")),onOpenFilePicker:a,onClearRequest:x[1]||(x[1]=D=>r("clear-request")),onCopyRequest:x[2]||(x[2]=D=>r("copy-request")),onManageTodo:x[3]||(x[3]=D=>r("manage-todo")),onSendRequest:x[4]||(x[4]=D=>r("send-request"))},null,8,["can-add-todo","is-current-task-sending","send-state","todo-count","uploading"])]),_:1},8,["modelValue","codex-session-id","uploading"]))}},Dp={class:"panel workbench-mobile-header-panel shrink-0 overflow-hidden"},Ip={class:"workbench-panel-header workbench-mobile-header theme-divider border-b px-2.5 py-2"},Fp={class:"flex items-center gap-2"},$p=["title","aria-label"],Mp={class:"min-w-0 flex-1"},Pp=["value","placeholder"],Bp=["disabled"],Rp={class:"truncate"},Lp={__name:"WorkbenchMobileDetailHeader",props:{currentTaskSlug:{type:String,default:""},editingTaskTitleSlug:{type:String,default:""},title:{type:String,default:""},titleInputValue:{type:String,default:""},currentTaskAutoTitle:{type:String,default:""}},emits:["back","begin-edit","title-blur","cancel-title-edit","update:titleInputValue"],setup(e,{emit:t}){const u=t,{t:n}=_t();return(r,o)=>(C(),B("section",Dp,[h("div",Ip,[h("div",Fp,[h("button",{type:"button",class:"tool-button inline-flex h-8 w-8 shrink-0 items-center justify-center px-0 py-0 text-[11px]",title:c(n)("workbench.tasks"),"aria-label":c(n)("workbench.tasks"),onClick:o[0]||(o[0]=i=>u("back"))},[le(c(Os),{class:"h-3.5 w-3.5"})],8,$p),h("div",Mp,[e.currentTaskSlug&&e.editingTaskTitleSlug===e.currentTaskSlug?(C(),B("input",{key:0,value:e.titleInputValue,type:"text",maxlength:"140","data-task-title-input":"current",class:"block w-full appearance-none border-0 bg-transparent p-0 text-left text-[13px] font-semibold leading-5 outline-none placeholder:text-[var(--theme-textMuted)]",placeholder:e.currentTaskAutoTitle||c(n)("workbench.untitledTask"),onInput:o[1]||(o[1]=i=>u("update:titleInputValue",i.target.value)),onKeydown:[o[2]||(o[2]=du(Ze(i=>i.target.blur(),["prevent"]),["enter"])),o[3]||(o[3]=du(Ze(i=>u("cancel-title-edit"),["prevent"]),["esc"]))],onBlur:o[4]||(o[4]=i=>u("title-blur"))},null,40,Pp)):(C(),B("button",{key:1,type:"button",class:"inline-flex w-full items-center gap-1 truncate bg-transparent p-0 text-left text-[13px] font-semibold leading-5",disabled:!e.currentTaskSlug,onClick:o[5]||(o[5]=i=>u("begin-edit"))},[h("span",Rp,A(e.title||c(n)("workbench.untitledTask")),1),le(c(Hu),{class:"h-2.5 w-2.5 shrink-0 opacity-50"})],8,Bp))])])])]))}},Np={class:"panel flex h-full min-h-0 flex-col overflow-hidden"},Op={class:"flex items-center justify-between gap-3"},zp={class:"flex min-h-8 items-center"},qp={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},jp=["title"],Up=["disabled","title"],Vp={class:"whitespace-nowrap"},Hp={class:"min-h-0 flex-1 overflow-y-auto px-3 py-3"},Wp={key:0,class:"theme-empty-state px-3 py-4 text-sm"},Kp=["onClick"],Gp={key:0,class:"theme-selection-indicator absolute inset-y-2 left-0 w-1 rounded-full"},Zp={class:"flex items-start justify-between gap-3"},Xp={class:"min-w-0 h-5 flex-1 overflow-hidden"},Yp=["value","placeholder"],Jp=["title","onClick"],Qp={class:"min-w-0 truncate"},eh={class:"flex shrink-0 items-center gap-1.5 text-[10px] uppercase tracking-[0.18em] opacity-80"},th={class:"theme-divider border-t px-3 py-3"},uh={key:0,class:"theme-danger-text mb-3 inline-flex min-w-0 items-start gap-2 text-xs"},nh={class:"min-w-0 break-words"},oh={class:"grid grid-cols-2 gap-2"},rh=["disabled","title"],sh={class:"whitespace-nowrap"},ih=["disabled","title"],ah={class:"whitespace-nowrap"},Er={__name:"WorkbenchTaskListPanel",props:{loadingTasks:{type:Boolean,default:!1},tasks:{type:Array,default:()=>[]},currentTaskSlug:{type:String,default:""},editingTaskTitleSlug:{type:String,default:""},draftTitle:{type:String,default:""},currentTaskAutoTitle:{type:String,default:""},creatingTask:{type:Boolean,default:!1},loadingTask:{type:Boolean,default:!1},uploading:{type:Boolean,default:!1},error:{type:String,default:""},removingTask:{type:Boolean,default:!1},isCurrentTaskSending:{type:Boolean,default:!1},mobile:{type:Boolean,default:!1}},emits:["open-settings","create-task","select-task","title-click","title-blur","cancel-title-edit","update:draftTitle","edit-task","delete-task"],setup(e,{emit:t}){const u=e,n=t,{t:r}=_t();function o(d){return d.slug===u.currentTaskSlug?"workbench-task-card--active theme-card-selected":d.sending?"workbench-task-card--running theme-card-warning":"theme-card-idle-muted"}function i(){return"theme-status-warning"}function s(d){const p=new Date(d.updatedAt);return Number.isNaN(p.getTime())?"":u.mobile?Fs(p.toISOString()):Mr(p.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function a(d){var p,m;return!((p=d==null?void 0:d.workspaceDiffSummary)!=null&&p.supported)||!((m=d==null?void 0:d.workspaceDiffSummary)!=null&&m.fileCount)?!1:u.mobile?d.slug===u.currentTaskSlug||!!d.sending:!0}function l(d){return d.slug===u.currentTaskSlug?"theme-badge-strong":"theme-badge-muted"}return(d,p)=>(C(),B("aside",Np,[h("div",{class:Se(["workbench-panel-header theme-divider border-b px-4 py-4",e.mobile?"workbench-mobile-header px-3 py-3":""])},[h("div",Op,[h("div",zp,[h("div",qp,[le(c(qs),{class:"h-4 w-4"}),h("span",null,A(c(r)("workbench.title")),1)])]),h("button",{type:"button",class:"tool-button inline-flex items-center gap-2 whitespace-nowrap px-3 py-2 text-xs",title:c(r)("workbench.settings"),onClick:p[0]||(p[0]=m=>n("open-settings"))},[le(c(Ys),{class:"h-4 w-4"}),h("span",{class:Se(e.mobile?"whitespace-nowrap":"hidden whitespace-nowrap sm:inline")},A(c(r)("workbench.settings")),3)],8,jp)]),h("button",{type:"button",class:"tool-button tool-button-primary mt-4 inline-flex w-full items-center justify-center gap-2 whitespace-nowrap px-3 py-2 text-sm",disabled:e.creatingTask||e.uploading,title:e.creatingTask?c(r)("workbench.creatingTask"):c(r)("workbench.createTask"),onClick:p[1]||(p[1]=m=>n("create-task"))},[le(c(Br),{class:"h-4 w-4"}),h("span",Vp,A(e.creatingTask?c(r)("workbench.creatingTask"):c(r)("workbench.createTask")),1)],8,Up)],2),h("div",Hp,[e.loadingTasks&&!e.tasks.length?(C(),B("div",Wp,A(c(r)("workbench.loadingTasks")),1)):(C(),B("div",{key:1,class:Se(["space-y-2",e.mobile?"space-y-1.5":""])},[(C(!0),B(mt,null,It(e.tasks,m=>{var _,b;return C(),B("article",{key:m.slug,class:Se(["workbench-task-card group relative cursor-default rounded-sm border px-3 py-3 transition",[o(m),e.mobile?"workbench-task-card--mobile px-3 py-2.5":""]]),onClick:E=>n("select-task",m.slug)},[m.slug===e.currentTaskSlug?(C(),B("span",Gp)):we("",!0),h("div",Zp,[h("div",Xp,[m.slug===e.currentTaskSlug&&e.editingTaskTitleSlug===m.slug?(C(),B("input",{key:0,value:e.draftTitle,type:"text",maxlength:"140","data-task-title-input":"current",class:"block h-5 min-h-0 w-full appearance-none border-0 bg-transparent p-0 text-left text-sm font-semibold leading-5 outline-none placeholder:text-[var(--theme-textMuted)]",placeholder:e.currentTaskAutoTitle||c(r)("workbench.untitledTask"),onClick:p[2]||(p[2]=Ze(()=>{},["stop"])),onInput:p[3]||(p[3]=E=>n("update:draftTitle",E.target.value)),onKeydown:[p[4]||(p[4]=du(Ze(E=>E.target.blur(),["prevent"]),["enter"])),p[5]||(p[5]=du(Ze(E=>n("cancel-title-edit"),["prevent"]),["esc"]))],onBlur:p[6]||(p[6]=E=>n("title-blur"))},null,40,Yp)):(C(),B("button",{key:1,type:"button",class:Se(["inline-flex h-5 w-full items-center gap-1.5 truncate bg-transparent p-0 text-left text-sm leading-5",m.slug===e.currentTaskSlug?"font-semibold":"font-medium"]),title:m.displayTitle,onClick:Ze(E=>n("title-click",m.slug),["stop"])},[(_=m.automation)!=null&&_.enabled?(C(),Ee(c(Tn),{key:0,class:"h-3.5 w-3.5 shrink-0 opacity-70"})):we("",!0),h("span",Qp,A(m.displayTitle),1)],10,Jp))]),h("div",eh,[m.sending?(C(),B("span",{key:0,class:Se(["inline-flex items-center gap-1.5 rounded-sm border border-dashed px-1.5 py-0.5",[i(),e.mobile?"text-[9px] tracking-[0.14em]":""]])},[p[9]||(p[9]=h("span",{class:"task-loading-dots","aria-hidden":"true"},[h("span",{class:"task-loading-dots__dot"}),h("span",{class:"task-loading-dots__dot"}),h("span",{class:"task-loading-dots__dot"})],-1)),h("span",null,A(c(r)("workbench.running")),1)],2)):we("",!0)])]),h("div",{class:Se(["workbench-task-card__preview mt-2 truncate text-xs opacity-80",e.mobile?"mt-1.5 text-[11px]":""])},A(m.lastPromptPreview||c(r)("workbench.noMessagesYet")),3),h("div",{class:Se(["mt-2 flex items-center justify-between gap-3",e.mobile?"mt-1.5":""])},[h("div",{class:Se(["min-w-0 text-[11px] opacity-70",e.mobile?"text-[10px] opacity-60":""])},A(s(m)),3),h("div",{class:Se(["flex shrink-0 items-center gap-1.5 text-[10px] uppercase tracking-[0.18em] opacity-80",e.mobile?"tracking-[0.12em]":""])},[a(m)?(C(),B("span",{key:0,class:Se(["inline-flex items-center gap-1 rounded-sm border border-dashed px-1.5 py-0.5",[l(m),e.mobile?"text-[9px]":""]])},[h("span",null,A(c(r)("workbench.filesCount",{count:((b=m.workspaceDiffSummary)==null?void 0:b.fileCount)||0})),1)],2)):we("",!0)],2)],2)],10,Kp)}),128))],2))]),h("div",th,[e.error?(C(),B("div",uh,[le(c(ko),{class:"mt-0.5 h-4 w-4 shrink-0"}),h("span",nh,A(e.error),1)])):we("",!0),h("div",oh,[h("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-2 whitespace-nowrap px-3 py-2 text-sm",disabled:!e.currentTaskSlug||e.removingTask||e.creatingTask,title:c(r)("workbench.editTask"),onClick:p[7]||(p[7]=m=>n("edit-task"))},[le(c(Hu),{class:"h-4 w-4"}),h("span",sh,A(c(r)("workbench.editTask")),1)],8,rh),h("button",{type:"button",class:"tool-button tool-button-danger-subtle inline-flex w-full items-center justify-center gap-2 whitespace-nowrap px-3 py-2 text-sm",disabled:!e.currentTaskSlug||e.removingTask||e.creatingTask||e.isCurrentTaskSending,title:e.removingTask?c(r)("workbench.deletingTask"):c(r)("workbench.deleteTask"),onClick:p[8]||(p[8]=m=>n("delete-task"))},[le(c(Vu),{class:"h-4 w-4"}),h("span",ah,A(e.removingTask?c(r)("workbench.deletingTask"):c(r)("workbench.deleteTask")),1)],8,ih)])])]))}},lh={class:"min-w-0"},ch={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},dh={class:"theme-muted-text mt-1 text-xs leading-5"},fh={class:"theme-divider flex items-center justify-between gap-3 border-b border-dashed px-5 py-3 text-xs"},ph={class:"theme-muted-text"},hh={class:"theme-status-neutral inline-flex items-center rounded-sm border border-dashed px-2 py-1"},mh={key:0,class:"min-h-0 flex-1 overflow-y-auto px-5 py-4"},gh={class:"space-y-3"},bh={class:"flex flex-wrap items-start justify-between gap-3"},xh={class:"min-w-0 flex-1"},vh={class:"theme-heading flex flex-wrap items-center gap-2 text-sm font-medium"},yh={class:"theme-status-neutral inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-0.5 text-[11px]"},kh={class:"mt-2 whitespace-pre-wrap break-words text-sm leading-6"},_h={class:"theme-muted-text mt-3 flex flex-wrap items-center gap-2 text-[11px]"},Sh={class:"rounded-sm border border-dashed px-2 py-1"},wh={key:0,class:"inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1"},Th={key:1,class:"inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1"},Ch={key:2,class:"inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1"},Eh={class:"flex shrink-0 items-center gap-2"},Ah=["onClick"],Dh=["onClick"],Ih={key:1,class:"theme-empty-state flex min-h-0 flex-1 items-center justify-center px-6 py-10 text-sm"},Fh={__name:"WorkbenchTodoDialog",props:{items:{type:Array,default:()=>[]},open:{type:Boolean,default:!1}},emits:["close","delete","use"],setup(e,{emit:t}){const u=e,n=t,{t:r}=_t(),o=de(()=>(u.items||[]).map(s=>{var b;const a=Array.isArray(s==null?void 0:s.blocks)?s.blocks:[],l=((b=a.find(E=>["text","imported_text"].includes(String((E==null?void 0:E.type)||""))&&String((E==null?void 0:E.content)||"").trim()))==null?void 0:b.content)||"",d=String(l||"").replace(/\s+/g," ").trim().slice(0,120),p=a.filter(E=>String((E==null?void 0:E.type)||"")==="image").length,m=a.filter(E=>String((E==null?void 0:E.type)||"")==="imported_text").length,_=a.filter(E=>String((E==null?void 0:E.type)||"")==="text"&&String((E==null?void 0:E.content)||"").trim()).length;return{...s,blockCount:a.length,imageCount:p,importedCount:m,preview:d||(p?r("todoDialog.imagePreview",{count:p}):r("todoDialog.noPreview")),textCount:_,timeLabel:i(s==null?void 0:s.createdAt)}}));function i(s=""){const a=Date.parse(String(s||""));if(!a)return r("todoDialog.justAdded");try{return new Intl.DateTimeFormat(void 0,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(a))}catch{return String(s||"")}}return(s,a)=>(C(),Ee(So,{open:e.open,"backdrop-class":"z-[70] items-end justify-center px-0 py-0 sm:items-center sm:px-4 sm:py-6","panel-class":"h-full max-w-3xl sm:h-[40rem] sm:max-h-[86vh]","header-class":"px-5 py-4","body-class":"min-h-0 flex flex-1 flex-col overflow-hidden",onClose:a[0]||(a[0]=l=>n("close"))},{title:Ye(()=>[h("div",lh,[h("div",ch,[le(c(Pr),{class:"h-4 w-4"}),h("span",null,A(c(r)("todoDialog.title")),1)]),h("p",dh,A(c(r)("todoDialog.intro")),1)])]),default:Ye(()=>[h("div",fh,[h("span",ph,A(c(r)("todoDialog.summary",{count:o.value.length})),1),h("span",hh,A(c(r)("todoDialog.summaryHint")),1)]),o.value.length?(C(),B("div",mh,[h("div",gh,[(C(!0),B(mt,null,It(o.value,l=>(C(),B("article",{key:l.id,class:"theme-card-idle-muted rounded-sm border border-dashed p-4"},[h("div",bh,[h("div",xh,[h("div",vh,[h("span",null,A(c(r)("todoDialog.itemTitle")),1),h("span",yh,[le(c(Tn),{class:"h-3.5 w-3.5"}),zu(" "+A(l.timeLabel),1)])]),h("p",kh,A(l.preview),1),h("div",_h,[h("span",Sh,A(c(r)("todoDialog.blockCount",{count:l.blockCount})),1),l.textCount?(C(),B("span",wh,[le(c(io),{class:"h-3.5 w-3.5"}),zu(" "+A(c(r)("todoDialog.textCount",{count:l.textCount})),1)])):we("",!0),l.importedCount?(C(),B("span",Th,[le(c(io),{class:"h-3.5 w-3.5"}),zu(" "+A(c(r)("todoDialog.importedCount",{count:l.importedCount})),1)])):we("",!0),l.imageCount?(C(),B("span",Ch,[le(c(_o),{class:"h-3.5 w-3.5"}),zu(" "+A(c(r)("todoDialog.imageCount",{count:l.imageCount})),1)])):we("",!0)])]),h("div",Eh,[h("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",onClick:d=>n("use",l.id)},[le(c(zs),{class:"h-4 w-4"}),h("span",null,A(c(r)("todoDialog.use")),1)],8,Ah),h("button",{type:"button",class:"tool-button tool-button-danger-subtle inline-flex items-center gap-2 px-3 py-2 text-xs",onClick:d=>n("delete",l.id)},[le(c(Vu),{class:"h-4 w-4"}),h("span",null,A(c(r)("todoDialog.delete")),1)],8,Dh)])])]))),128))])])):(C(),B("div",Ih,A(c(r)("todoDialog.empty")),1))]),_:1},8,["open"]))}},$h={class:"pointer-events-none fixed inset-x-0 top-4 z-40 flex justify-center px-4"},Mh={__name:"TopToast",props:{message:{type:String,default:""},type:{type:String,default:"success"}},setup(e){const t=e;function u(r="success"){return r==="warning"?"theme-status-warning":r==="error"?"theme-status-danger":r==="info"?"theme-status-info":"theme-status-success"}function n(r="success"){return r==="warning"?ko:r==="error"?Ws:r==="info"?Ks:Vs}return(r,o)=>(C(),Ee(Ju,{to:"body"},[h("div",$h,[le($r,{"enter-active-class":"transform transition duration-200 ease-out","enter-from-class":"-translate-y-3 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"transform transition duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"-translate-y-2 opacity-0"},{default:Ye(()=>[e.message?(C(),B("div",{key:0,class:Se(["app-top-toast flex max-w-md items-center gap-2 rounded-sm border px-4 py-2 text-sm shadow-[var(--theme-shadowPanel)] backdrop-blur",u(t.type)])},[(C(),Ee(ju(n(t.type)),{class:"h-4 w-4 shrink-0"})),h("span",null,A(e.message),1)],2)):we("",!0)]),_:1})])]))}};function Ph(e,t=!1){const u=U(!!t);let n=null,r=()=>{};function o(i){u.value=!!i}return pu(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;n=window.matchMedia(e),o(n.matches);const i=s=>{o(s.matches)};if(typeof n.addEventListener=="function"){n.addEventListener("change",i),r=()=>n==null?void 0:n.removeEventListener("change",i);return}typeof n.addListener=="function"&&(n.addListener(i),r=()=>n==null?void 0:n.removeListener(i))}),kt(()=>{r()}),{matches:u}}const Bh="(max-width: 1023px)",Sn="promptxWorkbenchMobileView";function no(e){return(e==null?void 0:e[Sn])==="detail"}function Rh({currentTaskSlug:e}){const{matches:t}=Ph(Bh),u=U("tasks"),n=U("activity");function r(p="tasks"){if(typeof window>"u")return;const m={...window.history.state||{}};p==="detail"?m[Sn]="detail":delete m[Sn],window.history.replaceState(m,"")}function o(){if(typeof window>"u")return;const p={...window.history.state||{},[Sn]:"detail"};window.history.pushState(p,"")}function i(p=null){if(!t.value){u.value="detail";return}if(!e.value){u.value="tasks",r("tasks");return}u.value=no(p)?"detail":"tasks"}function s(p){t.value=!!p,i(typeof window>"u"?null:window.history.state)}function a(p={}){const{pushHistory:m=!0}=p;if(u.value="detail",!!t.value){if(m){o();return}r("detail")}}function l(p={}){const{useHistory:m=!0}=p;if(!t.value){u.value="tasks";return}if(m&&typeof window<"u"&&no(window.history.state)){window.history.back();return}u.value="tasks",r("tasks")}function d(p){t.value&&(u.value=no(p.state)&&e.value?"detail":"tasks")}return pu(()=>{typeof window>"u"||window.addEventListener("popstate",d)}),kt(()=>{typeof window<"u"&&window.removeEventListener("popstate",d)}),De(t,p=>{s(p)},{immediate:!0}),De(e,()=>{typeof window>"u"||i(window.history.state)},{flush:"post"}),{enterMobileDetail:a,isMobileLayout:t,leaveMobileDetail:l,mobileDetailTab:n,mobileView:u}}const xo="PromptX";function Lh(e=""){const t=String(c(e)||"").trim();return t?`${xo} (${t})`:xo}function Nh(e=""){$s(()=>{typeof document>"u"||(document.title=Lh(e))}),kt(()=>{typeof document>"u"||(document.title=xo)})}const wu="success";function Oh(e,t){return e&&typeof e=="object"&&!Array.isArray(e)?{message:String(e.message||"").trim(),type:String(e.type||wu).trim()||wu,duration:Number(e.duration)>0?Number(e.duration):t}:{message:String(e||"").trim(),type:wu,duration:t}}function zh(e=2200){const t=U(""),u=U(wu);let n=null;function r(){n&&(window.clearTimeout(n),n=null),t.value="",u.value=wu}function o(i,s=e){const a=Oh(i,s);if(!a.message){r();return}t.value=a.message,u.value=a.type,n&&window.clearTimeout(n),n=window.setTimeout(()=>{t.value="",u.value=wu,n=null},a.duration)}return kt(()=>{n&&window.clearTimeout(n)}),{toastMessage:t,toastType:u,flashToast:o,clearToast:r}}function qh(e="",t=""){const u=String(e||"").trim();if(!u)return"";if(/^https?:\/\//i.test(u))return u;try{return new URL(u,t).toString()}catch{return u}}function jh(e,t){const u=[];for(const[n,r]of((e==null?void 0:e.blocks)||[]).entries()){if(r.type===Oe.TEXT||r.type===Oe.IMPORTED_TEXT){const o=String(r.content||"").trim();o&&u.push(o,"");continue}if(r.type===Oe.IMAGE){const o=qh(r.content,t);o&&u.push(o,"")}}return u.join(`
|
|
236
|
+
`).trim()}function Uh(e,t){return jh(e,t)}const vo="promptx:active-task-slug",Vh=150;function In(e=null){return!e||typeof e!="object"?null:{supported:!!e.supported,fileCount:Math.max(0,Number(e.fileCount)||0),additions:Math.max(0,Number(e.additions)||0),deletions:Math.max(0,Number(e.deletions)||0),statsComplete:!!e.statsComplete}}function nu(e=[]){return(e||[]).map(t=>{var u,n;return{...t,clientId:String((t==null?void 0:t.clientId)||(t==null?void 0:t.id)||((n=(u=globalThis.crypto)==null?void 0:u.randomUUID)==null?void 0:n.call(u))||`block-${Date.now()}-${Math.random().toString(36).slice(2,8)}`),meta:t!=null&&t.meta?{...t.meta}:{}}})}function vt(e=[]){return(e||[]).map(t=>({id:String((t==null?void 0:t.id)||"").trim(),createdAt:String((t==null?void 0:t.createdAt)||""),blocks:nu((t==null?void 0:t.blocks)||[])}))}function Ar(e={}){return{title:String(e.title||""),autoTitle:String(e.autoTitle||""),lastPromptPreview:String(e.lastPromptPreview||""),codexSessionId:String(e.codexSessionId||""),blocks:nu(e.blocks||[]),todoItems:vt(e.todoItems||[])}}function Ds(e=[]){return nu(e).filter(t=>(t==null?void 0:t.type)===Oe.IMAGE?!!String(t.content||"").trim():!!String((t==null?void 0:t.content)||"").trim())}function Hh(e=[]){return Ds(e).length>0}function Wh(){var t,u;const e=(u=(t=globalThis.crypto)==null?void 0:t.randomUUID)==null?void 0:u.call(t);return e?`todo-${e}`:`todo-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function Dr(){return nu([{type:Oe.TEXT,content:"",meta:{}}])}function yo(e=[],t=16){return yi(e,t)||""}function Kh(e=[],t=120){const u=e.find(n=>((n==null?void 0:n.type)==="text"||(n==null?void 0:n.type)==="imported_text")&&String(n.content||"").trim());return String((u==null?void 0:u.content)||"").replace(/\s+/g," ").trim().slice(0,t)}function Ir(e={},t=[]){const u=String((e==null?void 0:e.title)||"").trim();if(u)return u;const n=String((e==null?void 0:e.autoTitle)||"").trim();if(n)return n;const r=yo(t);if(r)return r;const o=String((e==null?void 0:e.preview)||"").trim();return o?o.slice(0,16):ze("workbench.untitledTask")}function Fn(e={}){return!!(e!=null&&e.running)}function Gh(e={},t=!1){return t&&!Fn(e)?"sending":Fn(e)?"running":"idle"}function Zh(e=""){return["queued","starting","running","stopping"].includes(String(e||"").trim())}function Fr(e="",t=72){return String(e||"").replace(/\s+/g," ").trim().slice(0,t)}function Xh(e=[],t=[]){const u=new Map((e||[]).map(s=>{const a=String((s==null?void 0:s.slug)||"").trim();return a?[a,s]:null}).filter(Boolean)),n=(t||[]).map(s=>{const a=String((s==null?void 0:s.slug)||"").trim(),l=String((s==null?void 0:s.codexSessionId)||"").trim();if(!a)return s;if(Object.prototype.hasOwnProperty.call(s,"workspaceDiffSummary"))return{...s,workspaceDiffSummary:In(s.workspaceDiffSummary)};if(!l)return{...s,workspaceDiffSummary:null};const d=u.get(a),p=String((d==null?void 0:d.codexSessionId)||"").trim();return p&&p===l?{...s,workspaceDiffSummary:In(d.workspaceDiffSummary)}:{...s,workspaceDiffSummary:null}}),r=new Map(n.map(s=>{const a=String((s==null?void 0:s.slug)||"").trim();return a?[a,s]:null}).filter(Boolean)),o=(e||[]).map(s=>{const a=String((s==null?void 0:s.slug)||"").trim();return a&&r.get(a)||null}).filter(Boolean);return[...n.filter(s=>{const a=String((s==null?void 0:s.slug)||"").trim();return a&&!u.has(a)}),...o]}function Yh(e=[],t=[]){const u=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(!n.length)return!1;if(u.length!==n.length)return!0;const r=new Map(u.map(o=>{const i=String((o==null?void 0:o.slug)||"").trim();return i?[i,o]:null}).filter(Boolean));return n.some(o=>{const i=String((o==null?void 0:o.slug)||"").trim();if(!i)return!0;const s=r.get(i);if(!s)return!0;const a=String((o==null?void 0:o.codexSessionId)||"").trim(),l=String((s==null?void 0:s.codexSessionId)||"").trim();return!!(a!==l||!!(o!=null&&o.running)!=!!(s!=null&&s.running)||a&&!Object.prototype.hasOwnProperty.call(s||{},"workspaceDiffSummary")||a&&(s==null?void 0:s.workspaceDiffSummary)==null)})}function bn(e){if(typeof window>"u")return;const t=String(e||"").trim();if(t){window.localStorage.setItem(vo,t);return}window.localStorage.removeItem(vo)}function Jh(){return typeof window>"u"?"":String(window.localStorage.getItem(vo)||"").trim()}function Qh(){if(typeof window>"u")return"";try{const e=new URL(window.location.href);return String(e.searchParams.get("task")||"").trim()}catch{return""}}function em(){if(!(typeof window>"u"))try{const e=new URL(window.location.href);if(!e.searchParams.has("task"))return;e.searchParams.delete("task");const t=`${e.pathname}${e.search}${e.hash}`;window.history.replaceState({},"",t||"/")}catch{}}function Ou(e){const t={slug:e.slug,title:String(e.title||""),autoTitle:String(e.autoTitle||""),lastPromptPreview:String(e.lastPromptPreview||""),codexSessionId:String(e.codexSessionId||""),codexRunCount:Math.max(0,Number(e.codexRunCount)||0),todoCount:Math.max(0,Number(e.todoCount)||0),running:!!e.running,preview:String(e.lastPromptPreview||""),updatedAt:e.updatedAt||e.createdAt||new Date().toISOString(),createdAt:e.createdAt||e.updatedAt||new Date().toISOString(),automation:e!=null&&e.automation?{enabled:!!e.automation.enabled,cron:String(e.automation.cron||""),nextTriggerAt:String(e.automation.nextTriggerAt||"")}:void 0,notification:e!=null&&e.notification?{enabled:!!e.notification.enabled,channelType:String(e.notification.channelType||""),triggerOn:String(e.notification.triggerOn||""),lastStatus:String(e.notification.lastStatus||""),lastSentAt:String(e.notification.lastSentAt||"")}:void 0};return Object.prototype.hasOwnProperty.call(e,"workspaceDiffSummary")&&(t.workspaceDiffSummary=In(e.workspaceDiffSummary)),t}function tm(e={}){const{clearToast:t=()=>{},flashToast:u=()=>{},scrollCurrentPanelToBottom:n=()=>{}}=e,r=Co(),o=Xr(),i=U(null),s=U([]),a=U({}),l=U({}),d=U({}),p=U(""),m=U({title:"",autoTitle:"",lastPromptPreview:"",codexSessionId:"",blocks:[],todoItems:[]}),_=U(!0),b=U(!1),E=U(!1),j=U(!1),y=U(!1),x=U(!1),D=U(""),P=U(!1),$=U("");let Z=null,w=null,J=0,Q=null,R=0,q=null,ne={};const re=de(()=>yo(m.value.blocks)),be=de(()=>Ir({title:m.value.title,autoTitle:m.value.autoTitle,preview:Kh(m.value.blocks)},m.value.blocks)),ce=de(()=>l.value[p.value]||""),O=de(()=>Gh(Re(p.value),d.value[p.value])),K=de(()=>O.value!=="idle"),F=de(()=>s.value.some(k=>Fn(k))||Object.values(d.value).some(Boolean)),ye=de(()=>Hh(m.value.blocks)),V=de(()=>vt(m.value.todoItems)),he=de(()=>be.value||ze("workbench.untitledTask")),G=de(()=>s.value.map(k=>et(k)));function X(k=""){return!k||!k.startsWith(r)?k:k.slice(r.length)}function Y(k=[]){return k.map(S=>({id:Number.isInteger(Number(S==null?void 0:S.id))?Number(S.id):null,type:S==null?void 0:S.type,content:(S==null?void 0:S.type)==="image"?X(S.content):S.content,meta:S!=null&&S.meta?{...S.meta}:{}}))}function ve(k=[]){return(k||[]).map(S=>({id:String((S==null?void 0:S.id)||"").trim(),createdAt:String((S==null?void 0:S.createdAt)||""),blocks:Y((S==null?void 0:S.blocks)||[])}))}function oe(k=m.value.title,S=m.value.autoTitle,z=m.value.lastPromptPreview,se=m.value.todoItems,ee=m.value.codexSessionId,ke=m.value.blocks){return JSON.stringify({title:String(k||""),autoTitle:String(S||""),lastPromptPreview:String(z||""),todoItems:ve(se),codexSessionId:String(ee||""),blocks:Y(ke)})}function ge(){return oe()!==$.value}function Te(){var k,S;return!!((S=(k=i.value)==null?void 0:k.isEditing)!=null&&S.call(k))}function Re(k){return s.value.find(S=>S.slug===k)||null}function Me(k){return k&&a.value[k]||null}function xe(k,S=""){const z=String(k||"").trim();z&&(ne={...ne,[z]:String(S||"").trim()})}function rt(k=""){var ee;const S=String(k||"").trim();if(!S)return!1;const z=String(((ee=Re(S))==null?void 0:ee.updatedAt)||"").trim(),se=String(ne[S]||"").trim();return!!(z&&se&&z===se)}function et(k){const S=Me(k.slug),z=k.slug===p.value?m.value.blocks:(S==null?void 0:S.blocks)||[],se=k.slug===p.value?m.value.title:(S==null?void 0:S.title)??k.title,ee=k.slug===p.value?m.value.autoTitle:(S==null?void 0:S.autoTitle)??k.autoTitle,ke=k.slug===p.value?vt(m.value.todoItems).length:vt((S==null?void 0:S.todoItems)||[]).length||Number(k.todoCount||0),tt=k.slug===p.value?m.value.lastPromptPreview||k.lastPromptPreview||"":(S==null?void 0:S.lastPromptPreview)||k.lastPromptPreview||"",Fe=k.slug===p.value?l.value[k.slug]||m.value.codexSessionId||k.codexSessionId||"":(S==null?void 0:S.codexSessionId)||k.codexSessionId||"";return{...k,title:se,autoTitle:ee,todoCount:ke,preview:tt,codexSessionId:Fe,sessionSelectionLocked:!!(Fe&&Number(k.codexRunCount||0)>0),sessionSelectionLockReason:Fe&&Number(k.codexRunCount||0)>0?ze("taskActions.sessionLocked"):"",displayTitle:Ir({title:se,autoTitle:ee,preview:tt},z),sending:Fn(k)}}function Ie(k,S={}){const{insertAtStart:z=!1}=S;if(!(k!=null&&k.slug))return;const se=[...s.value],ee=se.findIndex(ke=>ke.slug===k.slug);if(ee>=0){se.splice(ee,1,{...se[ee],...k}),s.value=se;return}z?se.unshift(k):se.push(k),s.value=se}function Ne(k,S){k&&(a.value={...a.value,[k]:Ar(S)})}function dt(k){return k?`${r}/api/tasks/${k}/raw`:`${r}/api/tasks/`}function Je(k=""){const S=String(k||"").trim();if(!S)return;const z=Re(S),se=o.getTaskRunChange(S);if(!z||!(se!=null&&se.status))return;const ee=Zh(se.status);!!z.running!==ee&&Ie({...z,running:ee})}function ft(k,S){d.value={...d.value,[k]:!!S}}function pt(k=s.value){const S={};(k||[]).forEach(z=>{z!=null&&z.slug&&(S[z.slug]=!!z.running)}),d.value=S}function He(k,S){k&&(l.value={...l.value,[k]:String(S||"").trim()})}async function St(k,S){const z=String(k||"").trim();if(!z)return;const se=String(S||"").trim(),ee=Re(z),ke=l.value[z]||(ee==null?void 0:ee.codexSessionId)||"";if(!!(ke&&Number((ee==null?void 0:ee.codexRunCount)||0)>0)&&se!==ke){D.value=ze("taskActions.sessionLocked");return}He(z,se);const Fe=Me(z);Fe&&Ne(z,{...Fe,codexSessionId:se}),ee&&Ie({...ee,codexSessionId:se,workspaceDiffSummary:se&&se===ke?ee.workspaceDiffSummary:null}),z===p.value&&(m.value={...m.value,codexSessionId:se});try{await Zi(z,se)}catch(Bt){He(z,ke),Fe&&Ne(z,{...Fe,codexSessionId:ke}),ee&&Ie({...ee,codexSessionId:ke}),z===p.value&&(m.value={...m.value,codexSessionId:ke}),D.value=Bt.message}}function Xe(){Z&&(window.clearTimeout(Z),Z=null)}function gt(){Q&&(window.clearTimeout(Q),Q=null)}function at(){Xe(),!(b.value||!p.value)&&(Z=window.setTimeout(()=>{We({auto:!0,silent:!0})},1500))}function lt(){if(!p.value)return;const k=Re(p.value)||{slug:p.value,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Ie({...k,title:String(m.value.title||""),autoTitle:String(m.value.autoTitle||""),lastPromptPreview:String(m.value.lastPromptPreview||""),todoCount:vt(m.value.todoItems).length,codexSessionId:String(l.value[p.value]||m.value.codexSessionId||""),preview:String(m.value.lastPromptPreview||"")})}function st(k={}){const S=String((k==null?void 0:k.slug)||"").trim();if(!S)return;const z=Ou(k);Ie(z),xe(S,z.updatedAt||k.updatedAt||""),S===p.value&&(Object.prototype.hasOwnProperty.call(k,"title")&&(m.value.title=String(k.title||"")),Object.prototype.hasOwnProperty.call(k,"autoTitle")&&(m.value.autoTitle=String(k.autoTitle||"")),Ne(S,{...m.value}))}function bt(k=[]){const S=new Map((k||[]).map(z=>{const se=String((z==null?void 0:z.slug)||"").trim();return se?[se,In(z.workspaceDiffSummary)]:null}).filter(Boolean));S.size&&(s.value=s.value.map(z=>S.has(z.slug)?{...z,workspaceDiffSummary:S.get(z.slug)}:z))}async function Ue(k=s.value){const S=Array.isArray(k)?k:[],z=S.filter(ee=>String((ee==null?void 0:ee.codexSessionId)||"").trim()),se=++R;if(!z.length){s.value=S.map(ee=>Object.prototype.hasOwnProperty.call(ee,"workspaceDiffSummary")?ee:{...ee,workspaceDiffSummary:null});return}try{const ee=await Li(S.length||30);if(se!==R)return;bt(ee.items||[])}catch{}}async function ct(k={}){const{silent:S=!1}=k;S||(_.value=!0,D.value="");try{const z=s.value,se=await Ri(),ee=Xh(z,(se.items||[]).map(Ou));s.value=ee,pt(ee),Yh(z,ee)&&Ue(ee)}catch(z){S||(D.value=z.message)}finally{S||(_.value=!1)}}async function it(k=""){const S=String(p.value||"").trim(),z=String(k||"").trim();if(!S)return;if(!s.value.some(ee=>ee.slug===S)){if(s.value.length){await Ce(s.value[0].slug,{force:!0,skipIfDirtyOnApply:!0});return}p.value="",bn(""),m.value={title:"",autoTitle:"",lastPromptPreview:"",codexSessionId:"",blocks:[],todoItems:[]},$.value=oe("","","",[],"",[]),P.value=!1;return}z&&z!==S||z&&(Te()||ge()||P.value||y.value||x.value||b.value||await Ce(S,{force:!0,skipIfDirtyOnApply:!0,skipIfEditingOnApply:!0}))}function fe(k=""){const S=String(k||"").trim();q===null?q=S:q!==S&&(q=""),!Q&&(Q=window.setTimeout(async()=>{const z=q;q=null,Q=null,await ct({silent:!0}),await it(z||"")},Vh))}async function Be(k){const S=await qr(k),z=(S.blocks||[]).map(ee=>({...ee,content:ee.type==="image"?vn(ee.content):ee.content}));return{state:{title:String(S.title||""),autoTitle:String(S.autoTitle||""),lastPromptPreview:String(S.lastPromptPreview||""),codexSessionId:String(S.codexSessionId||""),blocks:z,todoItems:vt(S.todoItems||[])},summary:Ou({...S,blocks:z}),updatedAt:String(S.updatedAt||"")}}async function Ce(k,S={}){const{focusEditor:z=!1,force:se=!1,skipIfDirtyOnApply:ee=!1,skipIfEditingOnApply:ke=!1,scrollPanelToBottom:tt=!1}=S,Fe=String(k||"").trim();if(!Fe)return!1;const Bt=++J;b.value=!0,D.value="",t();try{const Yt=String(p.value||"").trim(),gu=Me(Fe),ru=se&&gu&&rt(Fe);let Vt=se&&!ru?null:gu,Rt=null;if(!Vt){const Ke=await Be(Fe);Vt=(Ke==null?void 0:Ke.state)||null,Rt=(Ke==null?void 0:Ke.summary)||null,xe(Fe,(Ke==null?void 0:Ke.updatedAt)||(Rt==null?void 0:Rt.updatedAt)||"")}return Bt!==J||ee&&Fe===p.value&&(ge()||P.value)||ke&&Fe===p.value&&Te()?!1:(p.value=Fe,bn(Fe),m.value=Ar(Vt),Ne(Fe,Vt),Rt&&Ie(Rt),He(Fe,Vt.codexSessionId),$.value=oe(m.value.title,m.value.autoTitle,m.value.lastPromptPreview,m.value.todoItems,m.value.codexSessionId,m.value.blocks),P.value=!1,z&&$e(()=>{var Ke,bu;return(bu=(Ke=i.value)==null?void 0:Ke.focusEditor)==null?void 0:bu.call(Ke)}),(tt||Fe!==Yt)&&n(),!0)}catch(Yt){return Bt===J&&(D.value=Yt.message),!1}finally{Bt===J&&(b.value=!1)}}async function We(k={}){const{auto:S=!1,silent:z=!1}=k;return p.value?oe()===$.value?!0:w||(Xe(),y.value=!0,D.value="",w=(async()=>{try{const ee=await jr(p.value,{title:String(m.value.title||""),autoTitle:String(m.value.autoTitle||""),lastPromptPreview:String(m.value.lastPromptPreview||""),todoItems:vt(m.value.todoItems),codexSessionId:String(l.value[p.value]||m.value.codexSessionId||""),expiry:"none",visibility:"private",blocks:Y(m.value.blocks)}),ke={title:String(ee.title||""),autoTitle:String(ee.autoTitle||""),lastPromptPreview:String(ee.lastPromptPreview||""),todoItems:vt(ee.todoItems||m.value.todoItems||[]),codexSessionId:String(l.value[p.value]||ee.codexSessionId||""),blocks:nu(m.value.blocks)};return Ne(p.value,ke),$.value=oe(ke.title,ke.autoTitle,ke.lastPromptPreview,ke.todoItems,ke.codexSessionId,ke.blocks),P.value=!1,Ie(Ou(ee)),xe(p.value,ee.updatedAt||""),!S&&!z&&u({message:ze("taskActions.taskSaved"),type:"success"}),!0}catch(ee){return D.value=ee.message,!1}finally{y.value=!1,w=null,oe()!==$.value&&(P.value=!0,at())}})(),w):!1}async function xt(){return x.value?(D.value=ze("taskActions.fileProcessing"),!1):w||(P.value?We({auto:!1,silent:!0}):!0)}async function ue(){if(!await xt()&&p.value)return!1;E.value=!0,D.value="";try{const k=await Ni({title:"",expiry:"none",visibility:"private"}),S={title:String(k.title||""),autoTitle:String(k.autoTitle||""),lastPromptPreview:String(k.lastPromptPreview||""),codexSessionId:String(k.codexSessionId||""),blocks:nu(k.blocks||[]),todoItems:vt(k.todoItems||[])};return Ne(k.slug,S),Ie(Ou(k),{insertAtStart:!0}),await Ce(k.slug,{focusEditor:!0}),u({message:ze("taskActions.taskCreated"),type:"success"}),!0}catch(k){return D.value=k.message,!1}finally{E.value=!1}}async function pe(k){const S=String(k||"").trim();!S||S===p.value||!await xt()||await Ce(S)}async function N(){if(p.value){j.value=!0,D.value="";try{const k=p.value;await Oi(k),s.value=s.value.filter(ee=>ee.slug!==k);const S={...a.value};delete S[k],a.value=S;const z={...l.value};delete z[k],l.value=z;const se={...d.value};delete se[k],d.value=se,s.value.length?await Ce(s.value[0].slug,{focusEditor:!0}):(p.value="",bn(""),m.value={title:"",autoTitle:"",lastPromptPreview:"",codexSessionId:"",blocks:[],todoItems:[]},$.value=oe("","","",[],"",[]),P.value=!1,await ue())}catch(k){D.value=k.message}finally{j.value=!1}}}function T(k={}){const{silent:S=!1}=k;p.value&&(m.value={...m.value,blocks:Dr()},Ne(p.value,m.value),lt(),P.value=!0,$e(()=>{var z,se;(se=(z=i.value)==null?void 0:z.focusEditor)==null||se.call(z)}),S||u({message:ze("taskActions.taskCleared"),type:"info"}))}function L(){if(!p.value)return!1;const k=Ds(m.value.blocks);return k.length?(m.value={...m.value,blocks:Dr(),todoItems:[{id:Wh(),createdAt:new Date().toISOString(),blocks:k},...vt(m.value.todoItems)]},Ne(p.value,m.value),lt(),P.value=!0,$e(()=>{var S,z;(z=(S=i.value)==null?void 0:S.focusEditor)==null||z.call(S)}),u({message:ze("taskActions.todoAdded"),type:"success"}),!0):!1}function ae(k=""){const S=String(k||"").trim();if(!p.value||!S)return!1;const z=vt(m.value.todoItems).filter(se=>se.id!==S);return z.length===vt(m.value.todoItems).length?!1:(m.value={...m.value,todoItems:z},Ne(p.value,m.value),lt(),P.value=!0,!0)}function me(k=""){const S=String(k||"").trim();if(!p.value||!S)return null;const z=vt(m.value.todoItems).find(se=>se.id===S);return z?(m.value={...m.value,blocks:nu(z.blocks),todoItems:vt(m.value.todoItems).filter(se=>se.id!==S)},Ne(p.value,m.value),lt(),P.value=!0,$e(()=>{var se,ee;(ee=(se=i.value)==null?void 0:se.focusEditor)==null||ee.call(se)}),z):null}async function Ae(){var ee;if(await ct(),!s.value.length){await ue();return}const k=Qh();if(k){const ke=await Ce(k,{focusEditor:!0,force:!0});if(em(),ke)return}const S=((ee=s.value.find(ke=>!!(ke!=null&&ke.running)))==null?void 0:ee.slug)||"",z=Jh(),se=S||(s.value.some(ke=>ke.slug===z)?z:s.value[0].slug);await Ce(se,{focusEditor:!0,force:!0})}async function Et(k){var S,z,se;x.value=!0,D.value="";try{const ee=((z=(S=i.value)==null?void 0:S.isImportedBlockActive)==null?void 0:z.call(S))||!1,ke=[];for(const tt of k){const Fe=await zi(tt);ke.push({type:"image",content:vn(Fe.url),meta:{}})}(se=i.value)==null||se.insertUploadedBlocks(ke),u({message:ze("taskActions.imageInserted",{count:ke.length,appended:ee}),type:"success"})}catch(ee){D.value=ee.message}finally{x.value=!1}}async function Pt(k){var S,z,se;D.value="";try{const ee=((z=(S=i.value)==null?void 0:S.isImportedBlockActive)==null?void 0:z.call(S))||!1,ke=[];for(const tt of k){const Fe=await tt.text();Fe.trim()&&ke.push({type:"imported_text",content:Fe,meta:{fileName:tt.name||ze("workbench.untitledTask"),collapsed:!0}})}if(!ke.length){u({message:ze("taskActions.noTextImported"),type:"warning"});return}(se=i.value)==null||se.insertImportedBlocks(ke),u({message:ze("taskActions.importedBlocksInserted",{count:ke.length,appended:ee}),type:"success"})}catch{D.value=ze("taskActions.textImportFailed")}}async function $t(k){var S;x.value=!0,D.value="";try{let z=0,se=0;for(const ee of k){const ke=await qi(ee),tt=(ke.blocks||[]).map(Fe=>({...Fe,content:Fe.type==="image"?vn(Fe.content):Fe.content}));tt.length&&((S=i.value)==null||S.insertBlocks(tt),z+=tt.length,se+=Number(ke.pageCount||0))}if(!z){u({message:ze("taskActions.noPdfContent"),type:"warning"});return}u({message:ze("taskActions.pdfBlocksInserted",{blockCount:z,pageCount:se}),type:"success"})}catch(z){D.value=z.message||ze("taskActions.pdfImportFailed")}finally{x.value=!1}}function At(k){const S=k===p.value?m.value:Me(k);return S?Uh({title:String(S.title||""),blocks:Y(S.blocks||[])},dt(k)):""}function Iu(k){const S=k===p.value?m.value:Me(k);return S?nu(Y(S.blocks||[])):[]}async function mu(k){return x.value?(D.value=ze("taskActions.fileProcessingBeforeSend"),!1):k!==p.value?!0:y.value&&w?w:P.value?We({auto:!1,silent:!0}):!0}async function Zt(k){return await mu(k)?At(k):""}function Xt(k,S){const z=Fr(S);!z||k!==p.value||(m.value.lastPromptPreview=z,Ne(p.value,m.value),lt())}return De(m,()=>{if(b.value||!p.value)return;const k=yo(m.value.blocks);!String(m.value.title||"").trim()&&k&&k!==m.value.autoTitle&&(m.value.autoTitle=k),Ne(p.value,m.value),P.value=oe()!==$.value,lt(),P.value&&!y.value&&at()},{deep:!0}),De(p,k=>{k&&bn(k)}),kt(()=>{Xe(),gt()}),De(()=>o.listSyncVersion.value,()=>{Je(o.listSyncTaskSlug.value),fe(o.listSyncTaskSlug.value)}),{addCurrentDraftToTodo:L,applyTaskSettingsUpdate:st,buildPromptForTask:At,getPromptBlocksForTask:Iu,buildPromptPreview:Fr,clearCurrentTaskContent:T,createTaskAndSelect:ue,currentSelectedSessionId:ce,currentTaskSendState:O,currentTaskAutoTitle:re,currentTaskDisplayTitle:be,currentTaskSlug:p,draft:m,editorRef:i,error:D,handleImportPdfFiles:$t,handleImportTextFiles:Pt,handleTaskSendingChange:ft,handleTaskSessionChange:St,handleUpload:Et,hasCurrentDraftContent:ye,hasAnyTaskSending:F,hasUnsavedChanges:P,initializeWorkbench:Ae,isCurrentTaskSending:K,loadingTask:b,loadingTasks:_,pageTitle:he,prepareCodexPromptForTask:Zt,currentTodoItems:V,removeTodoItem:ae,removeCurrentTask:N,removingTask:j,renderedTasks:G,refreshTaskList:ct,saveTask:We,saving:y,selectTask:pe,selectedSessionMap:l,sendingTaskMap:d,taskDraftMap:a,tasks:s,useTodoItem:me,updateLastPromptPreview:Xt,uploading:x,creatingTask:E}}const um={class:"flex h-full min-h-0 flex-col overflow-hidden"},nm={key:0,class:"grid min-h-0 flex-1 gap-4 lg:grid-cols-[260px_minmax(0,1fr)] lg:grid-rows-1"},om={class:"grid min-h-0 gap-4 overflow-hidden lg:grid-cols-2 lg:grid-rows-1"},rm={class:"min-h-0 min-w-0 overflow-hidden"},sm={class:"min-h-0 min-w-0 overflow-hidden"},im={key:1,class:"min-h-0 flex-1 overflow-hidden"},am={key:1,class:"flex h-full min-h-0 flex-col gap-1.5 overflow-hidden"},lm={class:"workbench-mobile-tabs-panel shrink-0"},cm={class:"workbench-mobile-tabs grid grid-cols-2 gap-2"},dm={class:"min-h-0 flex-1 overflow-hidden"},fm={class:"h-full min-h-0"},pm={class:"h-full min-h-0"},hm={__name:"WorkbenchView",setup(e){const t=U(!1),u=U(!1),n=U(!1),r=U(!1),o=U(!1),i=U(!1),s=U(!1),a=U(!1),l=U(""),d=U(""),p=U(""),m=U(0),_=U("workspace"),b=U(""),{t:E}=_t(),{toastMessage:j,toastType:y,flashToast:x,clearToast:D}=zh(),P=ro(()=>so(()=>import("./TaskDiffReviewDialog-BaW1jx72.js"),__vite__mapDeps([3,1,2]))),$=ro(()=>so(()=>import("./WorkbenchSettingsDialog-fei-ilUn.js"),__vite__mapDeps([4,1,2]))),Z=U(null);function w(H){return H?Z.value:null}function J(){$e(()=>{var H,f;(f=(H=w(V.value))==null?void 0:H.scrollToBottom)==null||f.call(H)})}const{addCurrentDraftToTodo:Q,applyTaskSettingsUpdate:R,buildPromptForTask:q,getPromptBlocksForTask:ne,clearCurrentTaskContent:re,createTaskAndSelect:be,creatingTask:ce,currentSelectedSessionId:O,currentTaskSendState:K,currentTaskAutoTitle:F,currentTaskDisplayTitle:ye,currentTaskSlug:V,draft:he,editorRef:G,error:X,handleImportPdfFiles:Y,handleImportTextFiles:ve,handleTaskSendingChange:oe,handleTaskSessionChange:ge,handleUpload:Te,hasCurrentDraftContent:Re,hasUnsavedChanges:Me,initializeWorkbench:xe,isCurrentTaskSending:rt,loadingTask:et,loadingTasks:Ie,pageTitle:Ne,prepareCodexPromptForTask:dt,currentTodoItems:Je,removeTodoItem:ft,removeCurrentTask:pt,removingTask:He,renderedTasks:St,saveTask:Xe,saving:gt,selectTask:at,updateLastPromptPreview:lt,useTodoItem:st,uploading:bt}=tm({clearToast:D,flashToast:x,scrollCurrentPanelToBottom:J}),Ue=de(()=>St.value.find(H=>H.slug===V.value)||null),ct=de(()=>{var H,f;return!!((f=(H=Ue.value)==null?void 0:H.workspaceDiffSummary)!=null&&f.supported)}),it=de(()=>{const H=Ue.value;return H?()=>dt(H.slug):null}),fe=de(()=>{const H=Ue.value;return H?()=>ne(H.slug):null}),Be=de(()=>({creatingTask:ce.value,currentTaskAutoTitle:he.value.autoTitle||F.value,currentTaskSlug:V.value,draftTitle:he.value.title,editingTaskTitleSlug:p.value,error:X.value,isCurrentTaskSending:rt.value,loadingTask:et.value,loadingTasks:Ie.value,removingTask:He.value,tasks:St.value,uploading:bt.value})),Ce=de(()=>{var H,f,g,v,I;return{buildPromptBlocks:fe.value,buildPrompt:it.value,diffSupported:ct.value,selectedSessionId:((H=Ue.value)==null?void 0:H.codexSessionId)||"",sessionSelectionLockReason:((f=Ue.value)==null?void 0:f.sessionSelectionLockReason)||"",sessionSelectionLocked:!!((g=Ue.value)!=null&&g.sessionSelectionLocked),taskSlug:((v=Ue.value)==null?void 0:v.slug)||"",taskRunning:!!((I=Ue.value)!=null&&I.running)}}),We=de(()=>({canAddTodo:Re.value,codexSessionId:O.value,isCurrentTaskSending:rt.value,sendState:K.value,loading:et.value,todoCount:Je.value.length,uploading:bt.value})),xt=de(()=>({currentTaskAutoTitle:he.value.autoTitle||F.value,currentTaskSlug:V.value,editingTaskTitleSlug:p.value,title:ye.value,titleInputValue:he.value.title})),{enterMobileDetail:ue,isMobileLayout:pe,leaveMobileDetail:N,mobileDetailTab:T,mobileView:L}=Rh({currentTaskSlug:V});function ae(H){return H!=null&&H.sending||Number((H==null?void 0:H.codexRunCount)||0)>0?"activity":"input"}Nh(Ne);function me(H="workspace",f=""){_.value=H==="run"?"run":H==="task"?"task":"workspace",b.value=_.value==="run"?String(f||""):"",n.value=!0,m.value+=1}function Ae(){n.value=!1}function Et(){r.value=!0}function Pt(){r.value=!1}function $t(){V.value&&(o.value=!0)}function At(){o.value=!1}function Iu(){i.value=!0}function mu(){i.value=!1,Zt(),Xt()}function Zt(){s.value=!1,l.value=""}function Xt(){a.value=!1,d.value=""}function k(H){R(H)}function S(H){he.value.title=H}async function z(){p.value="",Me.value&&await Xe({auto:!1,silent:!0})}function se(H){H===V.value&&(p.value=H,$e(()=>{var g,v;const f=document.querySelector('[data-task-title-input="current"]');(g=f==null?void 0:f.focus)==null||g.call(f),(v=f==null?void 0:f.select)==null||v.call(f)}))}async function ee(H){if(pe.value){await Fu(H);return}if(H!==V.value){await Fu(H);return}se(H)}function ke(){u.value=!0}function tt(){He.value||(u.value=!1)}async function Fe(){await pt(),u.value=!1,pe.value&&N({useHistory:!1})}function Bt(){t.value=!0}function Yt(){t.value=!1}function gu(){t.value=!1,re()}function ru(H){const f=Ue.value;f&&oe(f.slug,H)}function Vt(H){const f=Ue.value;f&&ge(f.slug,H)}function Rt(H){x(H),!(!pe.value||!V.value)&&(T.value="activity")}async function Ke(){var H,f,g,v,I,W,te,_e;typeof document<"u"&&((f=(H=G.value)==null?void 0:H.isComposing)!=null&&f.call(H))&&((v=(g=document.activeElement)==null?void 0:g.blur)==null||v.call(g)),(W=(I=G.value)==null?void 0:I.flushPendingInput)==null||W.call(I),await $e(),(_e=(te=G.value)==null?void 0:te.flushPendingInput)==null||_e.call(te),await $e()}async function bu(){await Ke(),await navigator.clipboard.writeText(q(V.value)),x({message:E("workbench.promptCopied"),type:"info"})}async function Nn(){await be()&&pe.value&&(T.value="input",ue())}async function Fu(H){const f=String(H||"").trim();f&&(f!==V.value&&await at(f),pe.value&&V.value===f&&(T.value=ae(Ue.value),ue()))}async function On(){await Ke(),Q()}function zn(H){l.value=String(H||"").trim(),s.value=!!l.value}function qn(){l.value&&(ft(l.value),Zt())}async function su(H=d.value){const f=String(H||"").trim();return!f||!st(f)?!1:(Xt(),mu(),!0)}async function un(H){await Ke();const f=String(H||"").trim();if(f){if(!Re.value){await su(f);return}d.value=f,a.value=!0}}async function $u(){var v,I,W,te;const H=V.value;if(!H)return;const f=!!((I=(v=Ue.value)==null?void 0:v.automation)!=null&&I.enabled);await Ke(),lt(H,q(H)),!(!await((te=(W=w(H))==null?void 0:W.send)==null?void 0:te.call(W))||H!==V.value)&&(pe.value&&(T.value="activity"),f||re({silent:!0}),await Xe({auto:!1,silent:!0}))}function nn(){!pe.value||L.value!=="detail"||T.value!=="input"||!V.value||$e(()=>{var H,f;(f=(H=G.value)==null?void 0:H.focusEditor)==null||f.call(H)})}function Mu(H){!Me.value&&!bt.value&&!gt.value||(H.preventDefault(),H.returnValue="")}function Pu(H){if(!H.metaKey&&!H.ctrlKey&&H.shiftKey&&H.key==="Enter"){H.preventDefault(),$u();return}if(H.metaKey||H.ctrlKey){if(H.key.toLowerCase()==="s"){H.preventDefault(),Xe({auto:!1});return}H.shiftKey&&H.key==="Backspace"&&(H.preventDefault(),Bt())}}pu(()=>{xe(),window.addEventListener("beforeunload",Mu),window.addEventListener("keydown",Pu)}),kt(()=>{window.removeEventListener("beforeunload",Mu),window.removeEventListener("keydown",Pu)}),De([pe,L,T,V],([H,f,g,v])=>{!H||f!=="detail"||g!=="input"||!v||nn()});const Bu={"update:draftTitle":S,"cancel-title-edit":()=>{p.value=""},"create-task":Nn,"edit-task":$t,"delete-task":ke,"open-settings":Et,"select-task":Fu,"title-blur":z,"title-click":ee},on={"open-diff":({scope:H,runId:f})=>me(H,f),"project-created":()=>x({message:E("workbench.projectCreated"),type:"success"}),"selected-session-change":Vt,"sending-change":ru,toast:Rt},rn={"add-todo":On,"clear-request":Bt,"copy-request":bu,"file-feedback":H=>x({message:H,type:"warning"}),"import-pdf-files":Y,"import-text-files":ve,"manage-todo":Iu,"send-request":$u,"upload-files":Te},sn={"begin-edit":()=>se(V.value),back:N,"cancel-title-edit":()=>{p.value=""},"title-blur":z,"update:titleInputValue":S};return(H,f)=>(C(),B("div",um,[le(Mh,{message:c(j),type:c(y)},null,8,["message","type"]),le(fn,{open:t.value,title:c(E)("workbench.confirmClearTitle"),description:c(E)("workbench.confirmClearDescription"),"confirm-text":c(E)("workbench.confirmClearAction"),"cancel-text":c(E)("workbench.continueEditing"),onCancel:Yt,onConfirm:gu},null,8,["open","title","description","confirm-text","cancel-text"]),le(fn,{open:u.value,title:c(E)("workbench.confirmDeleteTitle"),description:c(E)("workbench.confirmDeleteDescription",{title:c(ye)}),"confirm-text":c(E)("workbench.confirmDeleteAction"),"cancel-text":c(E)("workbench.keepForNow"),loading:c(He),danger:"",onCancel:tt,onConfirm:Fe},null,8,["open","title","description","confirm-text","cancel-text","loading"]),le(fn,{open:s.value,title:c(E)("workbench.confirmDeleteTodoTitle"),description:c(E)("workbench.confirmDeleteTodoDescription"),"confirm-text":c(E)("workbench.confirmDeleteAction"),"cancel-text":c(E)("workbench.keepForNow"),danger:"",onCancel:Zt,onConfirm:qn},null,8,["open","title","description","confirm-text","cancel-text"]),le(fn,{open:a.value,title:c(E)("workbench.replaceEditorTitle"),description:c(E)("workbench.replaceEditorDescription"),"confirm-text":c(E)("workbench.confirmReplaceAction"),"cancel-text":c(E)("workbench.dontReplaceYet"),onCancel:Xt,onConfirm:f[0]||(f[0]=g=>su())},null,8,["open","title","description","confirm-text","cancel-text"]),le(Fh,{open:i.value,items:c(Je),onClose:mu,onDelete:zn,onUse:un},null,8,["open","items"]),le(c(P),{open:n.value,"task-slug":c(V),"task-title":c(ye),"preferred-scope":_.value,"preferred-run-id":b.value,"focus-token":m.value,onClose:Ae},null,8,["open","task-slug","task-title","preferred-scope","preferred-run-id","focus-token"]),le(c($),{open:r.value,onClose:Pt},null,8,["open"]),le(ml,{open:o.value,"task-slug":c(V),"task-title":c(ye),onClose:At,onSaved:k},null,8,["open","task-slug","task-title"]),c(pe)?(C(),B("div",im,[c(L)==="tasks"?(C(),Ee(Er,iu({key:0},Be.value,{mobile:""},au(Bu)),null,16)):(C(),B("div",am,[le(Lp,iu(xt.value,au(sn)),null,16),h("section",lm,[h("div",cm,[h("button",{type:"button",class:Se(["tool-button px-3 py-1.5 text-sm",c(T)==="activity"?"tool-button-accent-subtle":""]),onClick:f[2]||(f[2]=g=>T.value="activity")},A(c(E)("workbench.activity")),3),h("button",{type:"button",class:Se(["tool-button px-3 py-1.5 text-sm",c(T)==="input"?"tool-button-accent-subtle":""]),onClick:f[3]||(f[3]=g=>T.value="input")},A(c(E)("workbench.input")),3)])]),h("div",dm,[Qt(h("div",fm,[le(_r,iu({ref_key:"codexPanelRef",ref:Z},Ce.value,{"empty-message":c(E)("workbench.selectTask")},au(on)),null,16,["empty-message"])],512),[[Oo,c(T)==="activity"]]),Qt(h("div",pm,[le(Cr,iu({ref_key:"editorRef",ref:G,modelValue:c(he).blocks,"onUpdate:modelValue":f[4]||(f[4]=g=>c(he).blocks=g)},We.value,au(rn)),null,16,["modelValue"])],512),[[Oo,c(T)==="input"]])])]))])):(C(),B("div",nm,[le(Er,iu(Be.value,au(Bu)),null,16),h("div",om,[h("div",rm,[Ue.value?(C(),Ee(_r,iu({key:0,ref_key:"codexPanelRef",ref:Z},Ce.value,au(on)),null,16)):we("",!0)]),h("div",sm,[le(Cr,iu({ref_key:"editorRef",ref:G,modelValue:c(he).blocks,"onUpdate:modelValue":f[1]||(f[1]=g=>c(he).blocks=g)},We.value,au(rn)),null,16,["modelValue"])])])]))]))}},ym=Object.freeze(Object.defineProperty({__proto__:null,default:hm},Symbol.toStringTag,{value:"Module"}));export{Nr as A,jn as C,Uo as F,Ks as I,qt as L,Br as P,Zs as S,Vu as T,ym as W,Kt as _,Uu as a,Ph as b,Pe as c,js as d,ko as e,dn as f,vm as g,So as h,Ei as i,Ys as j,gm as k,Xi as l,Ge as m,Or as n,Us as o,bm as p,fn as q,Ve as r,xm as s,Hu as t,Xr as u,Os as v};
|