agent-tower 0.6.0-beta.13 → 0.6.0-beta.15
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/dist/executors/default-providers.json +1 -0
- package/dist/runtime/__tests__/acp-driver-lifecycle.test.js +232 -6
- package/dist/runtime/__tests__/acp-driver-lifecycle.test.js.map +1 -1
- package/dist/runtime/__tests__/acp-driver.test.js +24 -0
- package/dist/runtime/__tests__/acp-driver.test.js.map +1 -1
- package/dist/runtime/__tests__/runtime-coordinator.test.js +205 -7
- package/dist/runtime/__tests__/runtime-coordinator.test.js.map +1 -1
- package/dist/runtime/acp/acp-driver.d.ts.map +1 -1
- package/dist/runtime/acp/acp-driver.js +188 -61
- package/dist/runtime/acp/acp-driver.js.map +1 -1
- package/dist/runtime/acp/codex-provider-config.d.ts.map +1 -1
- package/dist/runtime/acp/codex-provider-config.js +4 -0
- package/dist/runtime/acp/codex-provider-config.js.map +1 -1
- package/dist/runtime/contracts.d.ts +12 -0
- package/dist/runtime/contracts.d.ts.map +1 -1
- package/dist/runtime/runtime-coordinator.d.ts +22 -1
- package/dist/runtime/runtime-coordinator.d.ts.map +1 -1
- package/dist/runtime/runtime-coordinator.js +214 -26
- package/dist/runtime/runtime-coordinator.js.map +1 -1
- package/dist/services/__tests__/session-manager.lifecycle.test.js +578 -68
- package/dist/services/__tests__/session-manager.lifecycle.test.js.map +1 -1
- package/dist/services/__tests__/session-manager.team-run.test.js +2 -1
- package/dist/services/__tests__/session-manager.team-run.test.js.map +1 -1
- package/dist/services/session-manager.d.ts +14 -8
- package/dist/services/session-manager.d.ts.map +1 -1
- package/dist/services/session-manager.js +359 -176
- package/dist/services/session-manager.js.map +1 -1
- package/dist/web/assets/{AgentDemoPage-aLGw8pYk.js → AgentDemoPage-04hKRdNk.js} +1 -1
- package/dist/web/assets/{AgentEnvironmentSettingsPage-BYcH_wMz.js → AgentEnvironmentSettingsPage-TnYB_gn_.js} +1 -1
- package/dist/web/assets/{AgentLogo-Dyqxcj5s.js → AgentLogo-BQ4AhPCM.js} +1 -1
- package/dist/web/assets/ConversationPage-GSAFcHuX.js +3 -0
- package/dist/web/assets/CreateTaskInput-DSl73Wwc.js +1 -0
- package/dist/web/assets/{DemoPage-m92AArTk.js → DemoPage-BKlcChAw.js} +1 -1
- package/dist/web/assets/{GeneralSettingsPage-P5HcwCXo.js → GeneralSettingsPage-sVFvK9Oe.js} +1 -1
- package/dist/web/assets/{Icons-BFOphLw-.js → Icons-DGahMuvC.js} +1 -1
- package/dist/web/assets/{LoadingPreviewPage-CfT4FIyb.js → LoadingPreviewPage-CZ2N3qZc.js} +1 -1
- package/dist/web/assets/{McpSettingsPage-BI_b78L_.js → McpSettingsPage-KZFzkxCs.js} +1 -1
- package/dist/web/assets/{MemberAvatar-1UlgMZMM.js → MemberAvatar-5bEbGww5.js} +1 -1
- package/dist/web/assets/{NotificationSettingsPage-CQCyq9QZ.js → NotificationSettingsPage-hVClKCOc.js} +1 -1
- package/dist/web/assets/{ProfileSettingsPage-ojhJXLWb.js → ProfileSettingsPage-BICdSvU4.js} +1 -1
- package/dist/web/assets/{ProjectKanbanPage-DK3rZJzY.js → ProjectKanbanPage-D62MacD4.js} +27 -27
- package/dist/web/assets/{ProjectSettingsPage-MGB631ia.js → ProjectSettingsPage-aMerK2A7.js} +1 -1
- package/dist/web/assets/{ProviderSettingsPage-CMZvEWMa.js → ProviderSettingsPage-Djd3iQfB.js} +1 -1
- package/dist/web/assets/{SettingsMasterDetail-9CnCBuNZ.js → SettingsMasterDetail-Czojx5vD.js} +1 -1
- package/dist/web/assets/{TeamSettingsPage-BUXKd5UF.js → TeamSettingsPage-B3-4MXXx.js} +1 -1
- package/dist/web/assets/{arc-2leUEhVa.js → arc-DzPiJSKL.js} +1 -1
- package/dist/web/assets/{architectureDiagram-3BPJPVTR-CDgYR44L.js → architectureDiagram-3BPJPVTR-EhKxHp4t.js} +1 -1
- package/dist/web/assets/{arrow-left-Jn-v17JF.js → arrow-left-2dTz1a0q.js} +1 -1
- package/dist/web/assets/{blockDiagram-GPEHLZMM-CzfIh31g.js → blockDiagram-GPEHLZMM-BHcWmA7M.js} +1 -1
- package/dist/web/assets/{c4Diagram-AAUBKEIU-BzzBXKEF.js → c4Diagram-AAUBKEIU-D59zNlIS.js} +1 -1
- package/dist/web/assets/channel-BpGJqMDu.js +1 -0
- package/dist/web/assets/check-CYQXIceH.js +1 -0
- package/dist/web/assets/{chevron-down-CpKODb7Y.js → chevron-down-BTGC8Sed.js} +1 -1
- package/dist/web/assets/{chevron-right-CBoUSXVq.js → chevron-right-BEw6jjbJ.js} +1 -1
- package/dist/web/assets/{chevron-up-KZ1hsL8y.js → chevron-up-D_Hmx6ug.js} +1 -1
- package/dist/web/assets/{chunk-2J33WTMH-GJE6LCGS.js → chunk-2J33WTMH-nk1Ieiq7.js} +1 -1
- package/dist/web/assets/{chunk-4BX2VUAB-Bw_ITp1Q.js → chunk-4BX2VUAB-xl3tQkpA.js} +1 -1
- package/dist/web/assets/{chunk-55IACEB6-DQ-XuWbD.js → chunk-55IACEB6-Bj12k-M-.js} +1 -1
- package/dist/web/assets/{chunk-727SXJPM-BgL49Dtw.js → chunk-727SXJPM-DeL4hVho.js} +1 -1
- package/dist/web/assets/{chunk-AQP2D5EJ-dRTVohoy.js → chunk-AQP2D5EJ-xyt_hZ7N.js} +1 -1
- package/dist/web/assets/{chunk-FMBD7UC4-BZtRjoH7.js → chunk-FMBD7UC4-DMpougEb.js} +1 -1
- package/dist/web/assets/{chunk-ND2GUHAM-CN3wND6y.js → chunk-ND2GUHAM-D2qjylxW.js} +1 -1
- package/dist/web/assets/{chunk-QZHKN3VN-CMwbobMj.js → chunk-QZHKN3VN-BjCtAePb.js} +1 -1
- package/dist/web/assets/{circle-alert-kELlE07n.js → circle-alert-BGbIBYEs.js} +1 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-M-OAZSzx.js +1 -0
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-M-OAZSzx.js +1 -0
- package/dist/web/assets/{code-block-OCS4YCEC-B1YC7dLa.js → code-block-OCS4YCEC-DnfSnuHM.js} +1 -1
- package/dist/web/assets/{confirm-dialog-DDWlvtJs.js → confirm-dialog-C8rPqdFE.js} +1 -1
- package/dist/web/assets/{cose-bilkent-S5V4N54A-C6xD7kmY.js → cose-bilkent-S5V4N54A-DD3H-OxN.js} +1 -1
- package/dist/web/assets/{cssMode-lB5vNGvS.js → cssMode-DR6Jf3-g.js} +1 -1
- package/dist/web/assets/{dagre-BM42HDAG-BqTCYMO6.js → dagre-BM42HDAG-Bw6aZrG9.js} +1 -1
- package/dist/web/assets/{diagram-2AECGRRQ-BsMq3s5l.js → diagram-2AECGRRQ-Bm8oLz0N.js} +1 -1
- package/dist/web/assets/{diagram-5GNKFQAL-l4izpv7Z.js → diagram-5GNKFQAL-CL9Xaz3k.js} +1 -1
- package/dist/web/assets/{diagram-KO2AKTUF-uWDq6Yzo.js → diagram-KO2AKTUF-KbdYV5XJ.js} +1 -1
- package/dist/web/assets/{diagram-LMA3HP47-Dbd4fnFa.js → diagram-LMA3HP47-CYo7CoGp.js} +1 -1
- package/dist/web/assets/{diagram-OG6HWLK6-BC-27mkr.js → diagram-OG6HWLK6-CFPSh1Sm.js} +1 -1
- package/dist/web/assets/{erDiagram-TEJ5UH35-DrCP0Xt8.js → erDiagram-TEJ5UH35-Dh9qfvJz.js} +1 -1
- package/dist/web/assets/{flowDiagram-I6XJVG4X-BqNsQuUr.js → flowDiagram-I6XJVG4X-8EMyvj0V.js} +1 -1
- package/dist/web/assets/{folder-picker-CBVEWiuS.js → folder-picker-iHGLWmJF.js} +1 -1
- package/dist/web/assets/{freemarker2-Bos_2jdw.js → freemarker2-Dhyh-DXo.js} +1 -1
- package/dist/web/assets/{ganttDiagram-6RSMTGT7-CZOrG-5M.js → ganttDiagram-6RSMTGT7-BE5FBwwf.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-PVQCEYII-Dp3i5ehs.js → gitGraphDiagram-PVQCEYII-Dx2x_Y6A.js} +1 -1
- package/dist/web/assets/{handlebars-C7Elz3nH.js → handlebars-BB4WaAAq.js} +1 -1
- package/dist/web/assets/{html-EvsHOk5n.js → html-BluMUCI1.js} +1 -1
- package/dist/web/assets/{htmlMode-CTlhNZgJ.js → htmlMode-Dk0meNHs.js} +1 -1
- package/dist/web/assets/{index-hPp73HMS.js → index-9oo7US_J.js} +4 -4
- package/dist/web/assets/{index-BGajgi5H.js → index-B0gHfTIK.js} +3 -3
- package/dist/web/assets/{infoDiagram-5YYISTIA-C6NnR_Zb.js → infoDiagram-5YYISTIA-0BPLGHMf.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-C1SOf-Ko.js → ishikawaDiagram-YF4QCWOH-BnoV5etH.js} +1 -1
- package/dist/web/assets/javascript-Cwz9LBET.js +1 -0
- package/dist/web/assets/{journeyDiagram-JHISSGLW--GKMSbPz.js → journeyDiagram-JHISSGLW-D8_dQMoV.js} +1 -1
- package/dist/web/assets/{jsonMode-Bbh3Gbb8.js → jsonMode-DWAIY3Zm.js} +1 -1
- package/dist/web/assets/{kanban-definition-UN3LZRKU-Car5iy0R.js → kanban-definition-UN3LZRKU-CcP-UBWq.js} +1 -1
- package/dist/web/assets/{layers-WOwm63Fo.js → layers-B4Hb2k1E.js} +1 -1
- package/dist/web/assets/{linear-ChUj9SvT.js → linear-CFeIj_93.js} +1 -1
- package/dist/web/assets/{liquid-BXFWITFq.js → liquid-DszhNRew.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-DQ2CrOBI.js → lspLanguageFeatures-DyajWL04.js} +1 -1
- package/dist/web/assets/{mdx-vHLpslzI.js → mdx-D3Dg3IU3.js} +1 -1
- package/dist/web/assets/{mermaid-NOHMQCX5-CzwPLFrI.js → mermaid-NOHMQCX5-De7jApSL.js} +4 -4
- package/dist/web/assets/{message-square-DgdFa1Kc.js → message-square-Dly_bein.js} +1 -1
- package/dist/web/assets/{mindmap-definition-RKZ34NQL-CfzbnHY_.js → mindmap-definition-RKZ34NQL-BBl0Q2SW.js} +1 -1
- package/dist/web/assets/{modal-QnCJhV9P.js → modal-CyT9BpRm.js} +1 -1
- package/dist/web/assets/{monaco-CbFQByO7.js → monaco-DBlH7Gvr.js} +3 -3
- package/dist/web/assets/{pencil-CNVU3zfM.js → pencil-BLlfV3fH.js} +1 -1
- package/dist/web/assets/{pieDiagram-4H26LBE5-CDqYJneU.js → pieDiagram-4H26LBE5-BVrsUXUt.js} +1 -1
- package/dist/web/assets/{python-BhFSY_J2.js → python-C1GF9JX6.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-W4KKPZXB-B6ChDIx2.js → quadrantDiagram-W4KKPZXB-Brnd7Z-x.js} +1 -1
- package/dist/web/assets/{razor-Cx_DrE-V.js → razor-CNwR1Ppb.js} +1 -1
- package/dist/web/assets/{requirementDiagram-4Y6WPE33-DefLT9NZ.js → requirementDiagram-4Y6WPE33-BEL5JUv5.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-5OEKKPKP-CQHnovPz.js → sankeyDiagram-5OEKKPKP-Dg3pq8MF.js} +1 -1
- package/dist/web/assets/{select-CmbeAAVh.js → select-BQuOHpgx.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-3UESZ5HK-DZuaKm7C.js → sequenceDiagram-3UESZ5HK-DvXxqwal.js} +1 -1
- package/dist/web/assets/{server-BUivqMYo.js → server-DmNZ4TcQ.js} +1 -1
- package/dist/web/assets/{stateDiagram-AJRCARHV-DvxpChEC.js → stateDiagram-AJRCARHV-BSXeM4wR.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-Cjr-lS2a.js +1 -0
- package/dist/web/assets/{switch-CiOyM13e.js → switch-BDzVWx67.js} +1 -1
- package/dist/web/assets/{textarea-D4HkYa3u.js → textarea-D4CrProF.js} +1 -1
- package/dist/web/assets/{timeline-definition-PNZ67QCA-BRu-tS-p.js → timeline-definition-PNZ67QCA-3rH0QWp7.js} +1 -1
- package/dist/web/assets/{trash-2-DPxBnxJM.js → trash-2-DHu1aC-u.js} +1 -1
- package/dist/web/assets/{tsMode-CHcZwUmC.js → tsMode-Z5KzKNgl.js} +1 -1
- package/dist/web/assets/{typescript-CvtjMxoq.js → typescript-Cg8IFK7o.js} +1 -1
- package/dist/web/assets/{upload-YmLtnZsU.js → upload-DQPwfdPh.js} +1 -1
- package/dist/web/assets/{use-profiles-OJAwfc90.js → use-profiles-DI5-xqHU.js} +1 -1
- package/dist/web/assets/{use-projects-iob5C7Xk.js → use-projects-Cs0-FMed.js} +1 -1
- package/dist/web/assets/{use-providers-Cj9S9_2q.js → use-providers-BoVFTPYO.js} +1 -1
- package/dist/web/assets/{useNormalizedLogs-BhN4AN4f.js → useNormalizedLogs-DhoOmBJo.js} +1 -1
- package/dist/web/assets/{vennDiagram-CIIHVFJN-CtZ_3Ld0.js → vennDiagram-CIIHVFJN-DAjUhsg9.js} +1 -1
- package/dist/web/assets/{wardley-L42UT6IY-h9yfTmIn.js → wardley-L42UT6IY-Db8PSpCZ.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-YWT4CUSO-CWXtZtix.js → wardleyDiagram-YWT4CUSO-DfXfIOXM.js} +1 -1
- package/dist/web/assets/{xml-DhyGRwiG.js → xml-UOLWFxtD.js} +1 -1
- package/dist/web/assets/{xychartDiagram-2RQKCTM6-BLuWVWlL.js → xychartDiagram-2RQKCTM6-C41mtVgh.js} +1 -1
- package/dist/web/assets/{yaml-Cpi6SvoR.js → yaml-CeY5SySy.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +2 -2
- package/dist/web/assets/ConversationPage-BBnK1qA_.js +0 -3
- package/dist/web/assets/CreateTaskInput-B11wGhDW.js +0 -1
- package/dist/web/assets/channel-XuYe6lH7.js +0 -1
- package/dist/web/assets/check-FwR4dMNY.js +0 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-DWSNJHiT.js +0 -1
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-DWSNJHiT.js +0 -1
- package/dist/web/assets/javascript-Desq1P0G.js +0 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-BbrRYMxK.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-block-OCS4YCEC-
|
|
2
|
-
import{k as yi,ab as Eu,r as C,j as m,aL as Hc,aM as Uc,ay as Ni,O as At,l as ar,u as sr,ac as jc,P as zc,X as $c,m as Yc,p as qc,aN as Vc}from"./index-BGajgi5H.js";import{C as Cn}from"./chevron-right-CBoUSXVq.js";import{C as bu}from"./chevron-down-CpKODb7Y.js";const Wc=[["path",{d:"M12 16v5",key:"zza2cw"}],["path",{d:"M16 14v7",key:"1g90b9"}],["path",{d:"M20 10v11",key:"1iqoj0"}],["path",{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15",key:"1fw8x9"}],["path",{d:"M4 18v3",key:"1yp0dc"}],["path",{d:"M8 14v7",key:"n3cwzv"}]],Gc=yi("chart-no-axes-combined",Wc);const Kc=[["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"}]],Qc=yi("file-text",Kc);const Xc=[["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"}]],Zc=yi("image",Xc);var xa;(function(e){e.TODO="TODO",e.IN_PROGRESS="IN_PROGRESS",e.IN_REVIEW="IN_REVIEW",e.DONE="DONE",e.CANCELLED="CANCELLED"})(xa||(xa={}));var _a;(function(e){e.ACTIVE="ACTIVE",e.MERGED="MERGED",e.ABANDONED="ABANDONED",e.HIBERNATED="HIBERNATED"})(_a||(_a={}));var Aa;(function(e){e.WORKTREE="WORKTREE",e.MAIN_DIRECTORY="MAIN_DIRECTORY"})(Aa||(Aa={}));var $;(function(e){e.CLAUDE_CODE="CLAUDE_CODE",e.GEMINI_CLI="GEMINI_CLI",e.CURSOR_AGENT="CURSOR_AGENT",e.CODEX="CODEX",e.QWEN_CODE="QWEN_CODE",e.KIRO_CLI="KIRO_CLI",e.OPENCODE="OPENCODE",e.PI_CODING_AGENT="PI_CODING_AGENT",e.GROK_BUILD="GROK_BUILD",e.MINION_CODE="MINION_CODE"})($||($={}));var Te;(function(e){e.CLI="CLI",e.ACP="ACP"})(Te||(Te={}));var ka;(function(e){e.PENDING="PENDING",e.RUNNING="RUNNING",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.CANCELLED="CANCELLED"})(ka||(ka={}));var Ca;(function(e){e.CHAT="CHAT",e.COMMIT_MSG="COMMIT_MSG"})(Ca||(Ca={}));var ya;(function(e){e.WORKSPACE="WORKSPACE",e.CONVERSATION="CONVERSATION"})(ya||(ya={}));var Na;(function(e){e.REBASE="REBASE",e.MERGE="MERGE"})(Na||(Na={}));var Z;(function(e){e.Action="Action",e.Assistant="Assistant",e.Info="Info",e.Tool="Tool",e.User="User",e.Cursor="Cursor",e.Error="Error",e.Warning="Warning"})(Z||(Z={}));function Jc(e){const t=e.metadata?.toolName||"Tool",n=e.metadata?.action,r=e.metadata?.status,i={file_read:"Read File",file_edit:"Edit File",command_run:"Run Command",search:"Search",web_fetch:"Fetch URL",tool:"Tool",task_create:"Create Task",plan_presentation:"Present Plan",todo_management:"Manage Todo",other:"Action"},a=e.metadata?.toolKind?t:n?i[n]:t;return r==="success"?`${a} ✓`:r==="failed"?`${a} ✗`:r==="pending_approval"?`${a} (待审批)`:a}function eh(e){switch(e.entryType){case"user_message":case"user_feedback":return{id:e.id,timestamp:e.timestamp,type:Z.User,content:e.content};case"assistant_message":return{id:e.id,timestamp:e.timestamp,type:Z.Assistant,content:e.content};case"next_action":return{id:e.id,timestamp:e.timestamp,type:Z.Action,content:e.content};case"thinking":return{id:e.id,timestamp:e.timestamp,type:Z.Info,title:"Thinking",content:e.content};case"tool_use":return{id:e.id,timestamp:e.timestamp,type:Z.Tool,title:Jc(e),content:e.content,isCollapsed:e.metadata?.status==="success",tool:{action:e.metadata?.action,name:e.metadata?.toolName,id:e.metadata?.toolId,kind:e.metadata?.toolKind,status:e.metadata?.status,content:e.metadata?.toolContent,locations:e.metadata?.toolLocations,inputSummary:e.metadata?.toolInputSummary,outputSummary:e.metadata?.toolOutputSummary}};case"error_message":return{id:e.id,timestamp:e.timestamp,type:Z.Error,content:e.content};case"warning_message":return{id:e.id,timestamp:e.timestamp,type:Z.Warning,content:e.content};case"system_message":return{id:e.id,timestamp:e.timestamp,type:Z.Info,content:e.content};case"loading":return{id:e.id,timestamp:e.timestamp,type:Z.Cursor,content:"",cursorActivity:{processingStartedAt:e.timestamp}};case"token_usage_info":if(e.metadata?.tokenUsage){const{totalTokens:t=0,modelContextWindow:n}=e.metadata.tokenUsage;return{id:e.id,timestamp:e.timestamp,type:Z.Info,content:e.content,tokenUsage:{totalTokens:t,modelContextWindow:n}}}return null;default:return null}}function i3(e){return e.map(eh).filter(t=>t!==null)}function a3(e){return{id:`cursor-${Date.now()}`,timestamp:e?.processingStartedAt??Date.now(),type:Z.Cursor,content:"",cursorActivity:e}}const th=["oss","ollama","lmstudio","amazon-bedrock"];function s3(e){return th.includes(e)}const u3={[$.CLAUDE_CODE]:{agentType:$.CLAUDE_CODE,apiBaseUrl:{kind:"env",path:"ANTHROPIC_BASE_URL",placeholder:"https://api.anthropic.com"},apiKey:{kind:"env",path:"ANTHROPIC_API_KEY"},model:{kind:"config",path:"model",placeholder:"claude-sonnet-4-20250514"},reasoningEffort:{kind:"config",path:"effort",options:["low","medium","high","xhigh","max"]},executionPermission:{kind:"config",path:"dangerouslySkipPermissions",riskKind:"skip-permissions"},settingsFormat:"json"},[$.CODEX]:{agentType:$.CODEX,apiBaseUrl:{kind:"settings",path:"openai_base_url",placeholder:"https://api.openai.com/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model",placeholder:"gpt-5.3-codex"},reasoningEffort:{kind:"settings",path:"model_reasoning_effort",options:["minimal","low","medium","high","xhigh"]},executionPermission:{kind:"config",path:"dangerouslyBypassApprovalsAndSandbox",riskKind:"bypass-approvals-and-sandbox"},fastMode:{kind:"config",path:"fastMode"},disableResponsesWebsocket:{kind:"config",path:"disableResponsesWebsocket"},settingsFormat:"toml"},[$.GEMINI_CLI]:{agentType:$.GEMINI_CLI,apiKey:{kind:"env",path:"GEMINI_API_KEY"},model:{kind:"config",path:"model",placeholder:"gemini-2.5-pro"},executionPermission:{kind:"config",path:"yolo",riskKind:"auto-approve"}},[$.CURSOR_AGENT]:{agentType:$.CURSOR_AGENT,model:{kind:"config",path:"model"},executionPermission:{kind:"config",path:"force",riskKind:"force-execution"}},[$.QWEN_CODE]:{agentType:$.QWEN_CODE,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://dashscope.aliyuncs.com/compatible-mode/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model",placeholder:"qwen3-coder-plus"},executionPermission:{kind:"config",path:"yolo",riskKind:"auto-approve"}},[$.KIRO_CLI]:{agentType:$.KIRO_CLI,model:{kind:"config",path:"model"},reasoningEffort:{kind:"config",path:"effort",options:["low","medium","high","xhigh","max"]},executionPermission:{kind:"config",path:"trustAllTools",riskKind:"auto-approve"}},[$.OPENCODE]:{agentType:$.OPENCODE,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://api.openai.com/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model"},executionPermission:{kind:"config",path:"autoApprove",riskKind:"auto-approve"}},[$.PI_CODING_AGENT]:{agentType:$.PI_CODING_AGENT,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://api.openai.com/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model"},reasoningEffort:{kind:"config",path:"effort",options:["minimal","low","medium","high","xhigh"]},executionPermission:{kind:"config",path:"autoApprove",riskKind:"auto-approve"}},[$.GROK_BUILD]:{agentType:$.GROK_BUILD,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://api.x.ai/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model"},executionPermission:{kind:"config",path:"alwaysApprove",riskKind:"auto-approve"}},[$.MINION_CODE]:{agentType:$.MINION_CODE,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://api.openai.com/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model"},executionPermission:{kind:"config",path:"dangerouslySkipPermissions",riskKind:"skip-permissions"}}},o3={[$.CLAUDE_CODE]:[Te.CLI,Te.ACP],[$.GEMINI_CLI]:[Te.CLI,Te.ACP],[$.CURSOR_AGENT]:[Te.CLI,Te.ACP],[$.CODEX]:[Te.CLI,Te.ACP],[$.QWEN_CODE]:[Te.ACP],[$.KIRO_CLI]:[Te.ACP],[$.OPENCODE]:[Te.ACP],[$.PI_CODING_AGENT]:[Te.ACP],[$.GROK_BUILD]:[Te.ACP],[$.MINION_CODE]:[Te.ACP]},nh=Object.freeze(Object.values($).filter(e=>e!==$.MINION_CODE));new Set(nh);const rh=/^[ \t]{0,3}::agent-download\{file="([^"\r\n]+)"\}[ \t]*$/,ih=/^[a-zA-Z]:[\\/]/,ah=1024;function Tu(e){if(!e||e.length>ah||e!==e.trim()||e.includes("\\")||/[\0-\x1f\x7f]/.test(e)||e.startsWith("/")||ih.test(e))return null;const t=e.split("/");return t.some(n=>!n||n==="."||n==="..")?null:t.join("/")}function sh(e){const t=e.match(rh);return t?Tu(t[1]):null}const ur=(function(e){if(e==null)return ch;if(typeof e=="function")return or(e);if(typeof e=="object")return Array.isArray(e)?uh(e):oh(e);if(typeof e=="string")return lh(e);throw new Error("Expected function, string, or object as test")});function uh(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ur(e[n]);return or(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function oh(e){const t=e;return or(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function lh(e){return or(t);function t(n){return n&&n.type===e}}function or(e){return t;function t(n,r,i){return!!(hh(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function ch(){return!0}function hh(e){return e!==null&&typeof e=="object"&&"type"in e}const xu=[],tn=!0,Vr=!1,Wn="skip";function Ii(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=ur(i),s=r?-1:1;u(e,void 0,[])();function u(o,c,h){const d=o&&typeof o=="object"?o:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(o.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=xu,E,A,N;if((!t||a(o,c,h[h.length-1]||void 0))&&(p=dh(n(o,h)),p[0]===Vr))return p;if("children"in o&&o.children){const k=o;if(k.children&&p[0]!==Wn)for(A=(r?k.children.length:-1)+s,N=h.concat(k);A>-1&&A<k.children.length;){const O=k.children[A];if(E=u(O,A,N)(),E[0]===Vr)return E;A=typeof E[1]=="number"?E[1]:A+s}}return p}}}function dh(e){return Array.isArray(e)?e:typeof e=="number"?[tn,e]:e==null?xu:[e]}function st(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),Ii(e,a,u,i);function u(o,c){const h=c[c.length-1],d=h?h.children.indexOf(o):void 0;return s(o,d,h)}}function fh({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:s="text-gray-500"}){const u=t.length&&!t.every(c=>c==="*"),o=n.length&&!n.every(c=>c==="*");if(!e&&(u||o))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return c=>{const h=Eh(e,t,n,r,i,a,s);st(c,h)}}function Ia(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function ph(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const mh=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),gh=new Set(["javascript:","data:","file:","vbscript:"]);function Sa(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const h=e.substring(5);if(h&&h.length>0&&h!=="invalid")return e}}catch{return null}return null}const s=Ia(e,n);if(!s||gh.has(s.protocol)||!(mh.has(s.protocol)||a.includes(s.protocol)||a.includes("*")))return null;if(s.protocol==="mailto:"||!s.protocol.match(/^https?:$/))return s.href;const o=ph(e);return s&&t.some(c=>{const h=Ia(c,n);return!h||h.origin!==s.origin?!1:s.href.startsWith(h.href)})?o?s.pathname+s.search+s.hash:s.href:t.includes("*")?s.protocol!=="https:"&&s.protocol!=="http:"?null:o?s.pathname+s.search+s.hash:s.href:null}const Cr=Symbol("node-seen"),Eh=(e,t,n,r,i,a,s)=>{const u=(o,c,h)=>{if(o.type!=="element"||o[Cr])return tn;if(o.tagName==="a"){const d=Sa(o.properties.href,t,e,!1,!1,i);return d===null?(o[Cr]=!0,st(o,u),h&&typeof c=="number"&&(h.children[c]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(o.properties.href),class:s},children:[...o.children,{type:"text",value:" [blocked]"}]}),Wn):(o.properties.href=d,o.properties.target="_blank",o.properties.rel="noopener noreferrer",tn)}if(o.tagName==="img"){const d=Sa(o.properties.src,n,e,r,!0,i);return d===null?(o[Cr]=!0,st(o,u),h&&typeof c=="number"&&(h.children[c]={type:"element",tagName:"span",properties:{class:a},children:[{type:"text",value:"[Image blocked: "+String(o.properties.alt||"No description")+"]"}]}),Wn):(o.properties.src=d,tn)}return tn};return u},_u=-1,lr=0,an=1,Gn=2,Si=3,wi=4,Li=5,Oi=6,Au=7,ku=8,wa=typeof self=="object"?self:globalThis,bh=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case lr:case _u:return n(s,i);case an:{const u=n([],i);for(const o of s)u.push(r(o));return u}case Gn:{const u=n({},i);for(const[o,c]of s)u[r(o)]=r(c);return u}case Si:return n(new Date(s),i);case wi:{const{source:u,flags:o}=s;return n(new RegExp(u,o),i)}case Li:{const u=n(new Map,i);for(const[o,c]of s)u.set(r(o),r(c));return u}case Oi:{const u=n(new Set,i);for(const o of s)u.add(r(o));return u}case Au:{const{name:u,message:o}=s;return n(new wa[u](o),i)}case ku:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new wa[a](s),i)};return r},La=e=>bh(new Map,e)(0),Lt="",{toString:Th}={},{keys:xh}=Object,Wt=e=>{const t=typeof e;if(t!=="object"||!e)return[lr,t];const n=Th.call(e).slice(8,-1);switch(n){case"Array":return[an,Lt];case"Object":return[Gn,Lt];case"Date":return[Si,Lt];case"RegExp":return[wi,Lt];case"Map":return[Li,Lt];case"Set":return[Oi,Lt];case"DataView":return[an,n]}return n.includes("Array")?[an,n]:n.includes("Error")?[Au,n]:[Gn,n]},Pn=([e,t])=>e===lr&&(t==="function"||t==="symbol"),_h=(e,t,n,r)=>{const i=(s,u)=>{const o=r.push(s)-1;return n.set(u,o),o},a=s=>{if(n.has(s))return n.get(s);let[u,o]=Wt(s);switch(u){case lr:{let h=s;switch(o){case"bigint":u=ku,h=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+o);h=null;break;case"undefined":return i([_u],s)}return i([u,h],s)}case an:{if(o){let f=s;return o==="DataView"?f=new Uint8Array(s.buffer):o==="ArrayBuffer"&&(f=new Uint8Array(s)),i([o,[...f]],s)}const h=[],d=i([u,h],s);for(const f of s)h.push(a(f));return d}case Gn:{if(o)switch(o){case"BigInt":return i([o,s.toString()],s);case"Boolean":case"Number":case"String":return i([o,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const h=[],d=i([u,h],s);for(const f of xh(s))(e||!Pn(Wt(s[f])))&&h.push([a(f),a(s[f])]);return d}case Si:return i([u,s.toISOString()],s);case wi:{const{source:h,flags:d}=s;return i([u,{source:h,flags:d}],s)}case Li:{const h=[],d=i([u,h],s);for(const[f,p]of s)(e||!(Pn(Wt(f))||Pn(Wt(p))))&&h.push([a(f),a(p)]);return d}case Oi:{const h=[],d=i([u,h],s);for(const f of s)(e||!Pn(Wt(f)))&&h.push(a(f));return d}}const{message:c}=s;return i([u,{name:o,message:c}],s)};return a},Oa=(e,{json:t,lossy:n}={})=>{const r=[];return _h(!(t||n),!!t,new Map,r)(e),r},bt=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?La(Oa(e,t)):structuredClone(e):(e,t)=>La(Oa(e,t));class yn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yn.prototype.normal={};yn.prototype.property={};yn.prototype.space=void 0;function Cu(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new yn(n,r,t)}function bn(e){return e.toLowerCase()}class Se{constructor(t,n){this.attribute=n,this.property=t}}Se.prototype.attribute="";Se.prototype.booleanish=!1;Se.prototype.boolean=!1;Se.prototype.commaOrSpaceSeparated=!1;Se.prototype.commaSeparated=!1;Se.prototype.defined=!1;Se.prototype.mustUseProperty=!1;Se.prototype.number=!1;Se.prototype.overloadedBoolean=!1;Se.prototype.property="";Se.prototype.spaceSeparated=!1;Se.prototype.space=void 0;let Ah=0;const Q=kt(),me=kt(),Wr=kt(),M=kt(),le=kt(),Mt=kt(),Re=kt();function kt(){return 2**++Ah}const Gr=Object.freeze(Object.defineProperty({__proto__:null,boolean:Q,booleanish:me,commaOrSpaceSeparated:Re,commaSeparated:Mt,number:M,overloadedBoolean:Wr,spaceSeparated:le},Symbol.toStringTag,{value:"Module"})),yr=Object.keys(Gr);class Ri extends Se{constructor(t,n,r,i){let a=-1;if(super(t,n),Ra(this,"space",i),typeof r=="number")for(;++a<yr.length;){const s=yr[a];Ra(this,yr[a],(r&Gr[s])===Gr[s])}}}Ri.prototype.defined=!0;function Ra(e,t,n){n&&(e[t]=n)}function Ht(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Ri(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[bn(r)]=r,n[bn(a.attribute)]=r}return new yn(t,n,e.space)}const yu=Ht({properties:{ariaActiveDescendant:null,ariaAtomic:me,ariaAutoComplete:null,ariaBusy:me,ariaChecked:me,ariaColCount:M,ariaColIndex:M,ariaColSpan:M,ariaControls:le,ariaCurrent:null,ariaDescribedBy:le,ariaDetails:null,ariaDisabled:me,ariaDropEffect:le,ariaErrorMessage:null,ariaExpanded:me,ariaFlowTo:le,ariaGrabbed:me,ariaHasPopup:null,ariaHidden:me,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:le,ariaLevel:M,ariaLive:null,ariaModal:me,ariaMultiLine:me,ariaMultiSelectable:me,ariaOrientation:null,ariaOwns:le,ariaPlaceholder:null,ariaPosInSet:M,ariaPressed:me,ariaReadOnly:me,ariaRelevant:null,ariaRequired:me,ariaRoleDescription:le,ariaRowCount:M,ariaRowIndex:M,ariaRowSpan:M,ariaSelected:me,ariaSetSize:M,ariaSort:null,ariaValueMax:M,ariaValueMin:M,ariaValueNow:M,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Nu(e,t){return t in e?e[t]:t}function Iu(e,t){return Nu(e,t.toLowerCase())}const kh=Ht({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Mt,acceptCharset:le,accessKey:le,action:null,allow:null,allowFullScreen:Q,allowPaymentRequest:Q,allowUserMedia:Q,alt:null,as:null,async:Q,autoCapitalize:null,autoComplete:le,autoFocus:Q,autoPlay:Q,blocking:le,capture:null,charSet:null,checked:Q,cite:null,className:le,cols:M,colSpan:null,content:null,contentEditable:me,controls:Q,controlsList:le,coords:M|Mt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Q,defer:Q,dir:null,dirName:null,disabled:Q,download:Wr,draggable:me,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Q,formTarget:null,headers:le,height:M,hidden:Wr,high:M,href:null,hrefLang:null,htmlFor:le,httpEquiv:le,id:null,imageSizes:null,imageSrcSet:null,inert:Q,inputMode:null,integrity:null,is:null,isMap:Q,itemId:null,itemProp:le,itemRef:le,itemScope:Q,itemType:le,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Q,low:M,manifest:null,max:null,maxLength:M,media:null,method:null,min:null,minLength:M,multiple:Q,muted:Q,name:null,nonce:null,noModule:Q,noValidate:Q,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Q,optimum:M,pattern:null,ping:le,placeholder:null,playsInline:Q,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Q,referrerPolicy:null,rel:le,required:Q,reversed:Q,rows:M,rowSpan:M,sandbox:le,scope:null,scoped:Q,seamless:Q,selected:Q,shadowRootClonable:Q,shadowRootDelegatesFocus:Q,shadowRootMode:null,shape:null,size:M,sizes:null,slot:null,span:M,spellCheck:me,src:null,srcDoc:null,srcLang:null,srcSet:null,start:M,step:null,style:null,tabIndex:M,target:null,title:null,translate:null,type:null,typeMustMatch:Q,useMap:null,value:me,width:M,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:le,axis:null,background:null,bgColor:null,border:M,borderColor:null,bottomMargin:M,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Q,declare:Q,event:null,face:null,frame:null,frameBorder:null,hSpace:M,leftMargin:M,link:null,longDesc:null,lowSrc:null,marginHeight:M,marginWidth:M,noResize:Q,noHref:Q,noShade:Q,noWrap:Q,object:null,profile:null,prompt:null,rev:null,rightMargin:M,rules:null,scheme:null,scrolling:me,standby:null,summary:null,text:null,topMargin:M,valueType:null,version:null,vAlign:null,vLink:null,vSpace:M,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Q,disableRemotePlayback:Q,prefix:null,property:null,results:M,security:null,unselectable:null},space:"html",transform:Iu}),Ch=Ht({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Re,accentHeight:M,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:M,amplitude:M,arabicForm:null,ascent:M,attributeName:null,attributeType:null,azimuth:M,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:M,by:null,calcMode:null,capHeight:M,className:le,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:M,diffuseConstant:M,direction:null,display:null,dur:null,divisor:M,dominantBaseline:null,download:Q,dx:null,dy:null,edgeMode:null,editable:null,elevation:M,enableBackground:null,end:null,event:null,exponent:M,externalResourcesRequired:null,fill:null,fillOpacity:M,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Mt,g2:Mt,glyphName:Mt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:M,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:M,horizOriginX:M,horizOriginY:M,id:null,ideographic:M,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:M,k:M,k1:M,k2:M,k3:M,k4:M,kernelMatrix:Re,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:M,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:M,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:M,overlineThickness:M,paintOrder:null,panose1:null,path:null,pathLength:M,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:le,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:M,pointsAtY:M,pointsAtZ:M,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Re,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Re,rev:Re,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Re,requiredFeatures:Re,requiredFonts:Re,requiredFormats:Re,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:M,specularExponent:M,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:M,strikethroughThickness:M,string:null,stroke:null,strokeDashArray:Re,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:M,strokeOpacity:M,strokeWidth:null,style:null,surfaceScale:M,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Re,tabIndex:M,tableValues:null,target:null,targetX:M,targetY:M,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Re,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:M,underlineThickness:M,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:M,values:null,vAlphabetic:M,vMathematical:M,vectorEffect:null,vHanging:M,vIdeographic:M,version:null,vertAdvY:M,vertOriginX:M,vertOriginY:M,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:M,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Nu}),Su=Ht({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),wu=Ht({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Iu}),Lu=Ht({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),yh={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Nh=/[A-Z]/g,Da=/-[a-z]/g,Ih=/^data[-\w.:]+$/i;function cr(e,t){const n=bn(t);let r=t,i=Se;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ih.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Da,wh);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Da.test(a)){let s=a.replace(Nh,Sh);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Ri}return new i(r,t)}function Sh(e){return"-"+e.toLowerCase()}function wh(e){return e.charAt(1).toUpperCase()}const Nn=Cu([yu,kh,Su,wu,Lu],"html"),ot=Cu([yu,Ch,Su,wu,Lu],"svg");function Pa(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(i,r).trim();(s||!a)&&t.push(s),i=r+1,r=n.indexOf(",",i)}return t}function Ou(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ma=/[#.]/g;function Lh(e,t){const n=e||"",r={};let i=0,a,s;for(;i<n.length;){Ma.lastIndex=i;const u=Ma.exec(n),o=n.slice(i,u?u.index:n.length);o&&(a?a==="#"?r.id=o:Array.isArray(r.className)?r.className.push(o):r.className=[o]:s=o,i+=o.length),u&&(a=u[0],i++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function va(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Ru(e){return e.join(" ").trim()}function Du(e,t,n){const r=n?Ph(n):void 0;function i(a,s,...u){let o;if(a==null){o={type:"root",children:[]};const c=s;u.unshift(c)}else{o=Lh(a,t);const c=o.tagName.toLowerCase(),h=r?r.get(c):void 0;if(o.tagName=h||c,Oh(s))u.unshift(s);else for(const[d,f]of Object.entries(s))Rh(e,o.properties,d,f)}for(const c of u)Kr(o.children,c);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return i}function Oh(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Rh(e,t,n,r){const i=cr(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?i.spaceSeparated?a=va(r):i.commaSeparated?a=Pa(r):i.commaOrSpaceSeparated?a=va(Pa(r).join(" ")):a=Ba(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?Dh(r):String(r);if(Array.isArray(a)){const s=[];for(const u of a)s.push(Ba(i,i.property,u));a=s}i.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Kr(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Kr(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Kr(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Ba(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||bn(n)===bn(t)))return!0}return n}function Dh(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Ph(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const Mh=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],vh=Du(Nn,"div"),Bh=Du(ot,"g",Mh);function Fh(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let s=0;for(;;){let u=n[s];if(u===void 0){const o=Fa(t,n[s-1]);u=o===-1?t.length+1:o+1,n[s]=u}if(u>a)return{line:s+1,column:a-(s>0?n[s-1]:0)+1,offset:a};s++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const u=n[n.length-1],o=Fa(t,u),c=o===-1?t.length+1:o+1;if(u===c)break;n.push(c)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function Fa(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-block-OCS4YCEC-DnfSnuHM.js","assets/index-B0gHfTIK.js","assets/index-CVgeXPf_.css","assets/chevron-right-BEw6jjbJ.js","assets/chevron-down-BTGC8Sed.js","assets/index-9oo7US_J.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{k as yi,ab as Eu,r as C,j as m,aL as Hc,aM as Uc,ay as Ni,O as At,l as ar,u as sr,ac as jc,P as zc,X as $c,m as Yc,p as qc,aN as Vc}from"./index-B0gHfTIK.js";import{C as Cn}from"./chevron-right-BEw6jjbJ.js";import{C as bu}from"./chevron-down-BTGC8Sed.js";const Wc=[["path",{d:"M12 16v5",key:"zza2cw"}],["path",{d:"M16 14v7",key:"1g90b9"}],["path",{d:"M20 10v11",key:"1iqoj0"}],["path",{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15",key:"1fw8x9"}],["path",{d:"M4 18v3",key:"1yp0dc"}],["path",{d:"M8 14v7",key:"n3cwzv"}]],Gc=yi("chart-no-axes-combined",Wc);const Kc=[["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"}]],Qc=yi("file-text",Kc);const Xc=[["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"}]],Zc=yi("image",Xc);var xa;(function(e){e.TODO="TODO",e.IN_PROGRESS="IN_PROGRESS",e.IN_REVIEW="IN_REVIEW",e.DONE="DONE",e.CANCELLED="CANCELLED"})(xa||(xa={}));var _a;(function(e){e.ACTIVE="ACTIVE",e.MERGED="MERGED",e.ABANDONED="ABANDONED",e.HIBERNATED="HIBERNATED"})(_a||(_a={}));var Aa;(function(e){e.WORKTREE="WORKTREE",e.MAIN_DIRECTORY="MAIN_DIRECTORY"})(Aa||(Aa={}));var $;(function(e){e.CLAUDE_CODE="CLAUDE_CODE",e.GEMINI_CLI="GEMINI_CLI",e.CURSOR_AGENT="CURSOR_AGENT",e.CODEX="CODEX",e.QWEN_CODE="QWEN_CODE",e.KIRO_CLI="KIRO_CLI",e.OPENCODE="OPENCODE",e.PI_CODING_AGENT="PI_CODING_AGENT",e.GROK_BUILD="GROK_BUILD",e.MINION_CODE="MINION_CODE"})($||($={}));var Te;(function(e){e.CLI="CLI",e.ACP="ACP"})(Te||(Te={}));var ka;(function(e){e.PENDING="PENDING",e.RUNNING="RUNNING",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.CANCELLED="CANCELLED"})(ka||(ka={}));var Ca;(function(e){e.CHAT="CHAT",e.COMMIT_MSG="COMMIT_MSG"})(Ca||(Ca={}));var ya;(function(e){e.WORKSPACE="WORKSPACE",e.CONVERSATION="CONVERSATION"})(ya||(ya={}));var Na;(function(e){e.REBASE="REBASE",e.MERGE="MERGE"})(Na||(Na={}));var Z;(function(e){e.Action="Action",e.Assistant="Assistant",e.Info="Info",e.Tool="Tool",e.User="User",e.Cursor="Cursor",e.Error="Error",e.Warning="Warning"})(Z||(Z={}));function Jc(e){const t=e.metadata?.toolName||"Tool",n=e.metadata?.action,r=e.metadata?.status,i={file_read:"Read File",file_edit:"Edit File",command_run:"Run Command",search:"Search",web_fetch:"Fetch URL",tool:"Tool",task_create:"Create Task",plan_presentation:"Present Plan",todo_management:"Manage Todo",other:"Action"},a=e.metadata?.toolKind?t:n?i[n]:t;return r==="success"?`${a} ✓`:r==="failed"?`${a} ✗`:r==="pending_approval"?`${a} (待审批)`:a}function eh(e){switch(e.entryType){case"user_message":case"user_feedback":return{id:e.id,timestamp:e.timestamp,type:Z.User,content:e.content};case"assistant_message":return{id:e.id,timestamp:e.timestamp,type:Z.Assistant,content:e.content};case"next_action":return{id:e.id,timestamp:e.timestamp,type:Z.Action,content:e.content};case"thinking":return{id:e.id,timestamp:e.timestamp,type:Z.Info,title:"Thinking",content:e.content};case"tool_use":return{id:e.id,timestamp:e.timestamp,type:Z.Tool,title:Jc(e),content:e.content,isCollapsed:e.metadata?.status==="success",tool:{action:e.metadata?.action,name:e.metadata?.toolName,id:e.metadata?.toolId,kind:e.metadata?.toolKind,status:e.metadata?.status,content:e.metadata?.toolContent,locations:e.metadata?.toolLocations,inputSummary:e.metadata?.toolInputSummary,outputSummary:e.metadata?.toolOutputSummary}};case"error_message":return{id:e.id,timestamp:e.timestamp,type:Z.Error,content:e.content};case"warning_message":return{id:e.id,timestamp:e.timestamp,type:Z.Warning,content:e.content};case"system_message":return{id:e.id,timestamp:e.timestamp,type:Z.Info,content:e.content};case"loading":return{id:e.id,timestamp:e.timestamp,type:Z.Cursor,content:"",cursorActivity:{processingStartedAt:e.timestamp}};case"token_usage_info":if(e.metadata?.tokenUsage){const{totalTokens:t=0,modelContextWindow:n}=e.metadata.tokenUsage;return{id:e.id,timestamp:e.timestamp,type:Z.Info,content:e.content,tokenUsage:{totalTokens:t,modelContextWindow:n}}}return null;default:return null}}function i3(e){return e.map(eh).filter(t=>t!==null)}function a3(e){return{id:`cursor-${Date.now()}`,timestamp:e?.processingStartedAt??Date.now(),type:Z.Cursor,content:"",cursorActivity:e}}const th=["oss","ollama","lmstudio","amazon-bedrock"];function s3(e){return th.includes(e)}const u3={[$.CLAUDE_CODE]:{agentType:$.CLAUDE_CODE,apiBaseUrl:{kind:"env",path:"ANTHROPIC_BASE_URL",placeholder:"https://api.anthropic.com"},apiKey:{kind:"env",path:"ANTHROPIC_API_KEY"},model:{kind:"config",path:"model",placeholder:"claude-sonnet-4-20250514"},reasoningEffort:{kind:"config",path:"effort",options:["low","medium","high","xhigh","max"]},executionPermission:{kind:"config",path:"dangerouslySkipPermissions",riskKind:"skip-permissions"},settingsFormat:"json"},[$.CODEX]:{agentType:$.CODEX,apiBaseUrl:{kind:"settings",path:"openai_base_url",placeholder:"https://api.openai.com/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model",placeholder:"gpt-5.3-codex"},reasoningEffort:{kind:"settings",path:"model_reasoning_effort",options:["minimal","low","medium","high","xhigh"]},executionPermission:{kind:"config",path:"dangerouslyBypassApprovalsAndSandbox",riskKind:"bypass-approvals-and-sandbox"},fastMode:{kind:"config",path:"fastMode"},disableResponsesWebsocket:{kind:"config",path:"disableResponsesWebsocket"},settingsFormat:"toml"},[$.GEMINI_CLI]:{agentType:$.GEMINI_CLI,apiKey:{kind:"env",path:"GEMINI_API_KEY"},model:{kind:"config",path:"model",placeholder:"gemini-2.5-pro"},executionPermission:{kind:"config",path:"yolo",riskKind:"auto-approve"}},[$.CURSOR_AGENT]:{agentType:$.CURSOR_AGENT,model:{kind:"config",path:"model"},executionPermission:{kind:"config",path:"force",riskKind:"force-execution"}},[$.QWEN_CODE]:{agentType:$.QWEN_CODE,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://dashscope.aliyuncs.com/compatible-mode/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model",placeholder:"qwen3-coder-plus"},executionPermission:{kind:"config",path:"yolo",riskKind:"auto-approve"}},[$.KIRO_CLI]:{agentType:$.KIRO_CLI,model:{kind:"config",path:"model"},reasoningEffort:{kind:"config",path:"effort",options:["low","medium","high","xhigh","max"]},executionPermission:{kind:"config",path:"trustAllTools",riskKind:"auto-approve"}},[$.OPENCODE]:{agentType:$.OPENCODE,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://api.openai.com/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model"},executionPermission:{kind:"config",path:"autoApprove",riskKind:"auto-approve"}},[$.PI_CODING_AGENT]:{agentType:$.PI_CODING_AGENT,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://api.openai.com/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model"},reasoningEffort:{kind:"config",path:"effort",options:["minimal","low","medium","high","xhigh"]},executionPermission:{kind:"config",path:"autoApprove",riskKind:"auto-approve"}},[$.GROK_BUILD]:{agentType:$.GROK_BUILD,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://api.x.ai/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model"},executionPermission:{kind:"config",path:"alwaysApprove",riskKind:"auto-approve"}},[$.MINION_CODE]:{agentType:$.MINION_CODE,apiBaseUrl:{kind:"env",path:"OPENAI_BASE_URL",placeholder:"https://api.openai.com/v1"},apiKey:{kind:"env",path:"OPENAI_API_KEY"},model:{kind:"config",path:"model"},executionPermission:{kind:"config",path:"dangerouslySkipPermissions",riskKind:"skip-permissions"}}},o3={[$.CLAUDE_CODE]:[Te.CLI,Te.ACP],[$.GEMINI_CLI]:[Te.CLI,Te.ACP],[$.CURSOR_AGENT]:[Te.CLI,Te.ACP],[$.CODEX]:[Te.CLI,Te.ACP],[$.QWEN_CODE]:[Te.ACP],[$.KIRO_CLI]:[Te.ACP],[$.OPENCODE]:[Te.ACP],[$.PI_CODING_AGENT]:[Te.ACP],[$.GROK_BUILD]:[Te.ACP],[$.MINION_CODE]:[Te.ACP]},nh=Object.freeze(Object.values($).filter(e=>e!==$.MINION_CODE));new Set(nh);const rh=/^[ \t]{0,3}::agent-download\{file="([^"\r\n]+)"\}[ \t]*$/,ih=/^[a-zA-Z]:[\\/]/,ah=1024;function Tu(e){if(!e||e.length>ah||e!==e.trim()||e.includes("\\")||/[\0-\x1f\x7f]/.test(e)||e.startsWith("/")||ih.test(e))return null;const t=e.split("/");return t.some(n=>!n||n==="."||n==="..")?null:t.join("/")}function sh(e){const t=e.match(rh);return t?Tu(t[1]):null}const ur=(function(e){if(e==null)return ch;if(typeof e=="function")return or(e);if(typeof e=="object")return Array.isArray(e)?uh(e):oh(e);if(typeof e=="string")return lh(e);throw new Error("Expected function, string, or object as test")});function uh(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ur(e[n]);return or(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function oh(e){const t=e;return or(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function lh(e){return or(t);function t(n){return n&&n.type===e}}function or(e){return t;function t(n,r,i){return!!(hh(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function ch(){return!0}function hh(e){return e!==null&&typeof e=="object"&&"type"in e}const xu=[],tn=!0,Vr=!1,Wn="skip";function Ii(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=ur(i),s=r?-1:1;u(e,void 0,[])();function u(o,c,h){const d=o&&typeof o=="object"?o:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(o.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=xu,E,A,N;if((!t||a(o,c,h[h.length-1]||void 0))&&(p=dh(n(o,h)),p[0]===Vr))return p;if("children"in o&&o.children){const k=o;if(k.children&&p[0]!==Wn)for(A=(r?k.children.length:-1)+s,N=h.concat(k);A>-1&&A<k.children.length;){const O=k.children[A];if(E=u(O,A,N)(),E[0]===Vr)return E;A=typeof E[1]=="number"?E[1]:A+s}}return p}}}function dh(e){return Array.isArray(e)?e:typeof e=="number"?[tn,e]:e==null?xu:[e]}function st(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),Ii(e,a,u,i);function u(o,c){const h=c[c.length-1],d=h?h.children.indexOf(o):void 0;return s(o,d,h)}}function fh({defaultOrigin:e="",allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a="inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm",blockedLinkClass:s="text-gray-500"}){const u=t.length&&!t.every(c=>c==="*"),o=n.length&&!n.every(c=>c==="*");if(!e&&(u||o))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return c=>{const h=Eh(e,t,n,r,i,a,s);st(c,h)}}function Ia(e,t){if(typeof e!="string")return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith("/")||e.startsWith("./")||e.startsWith("../"))try{return new URL(e,"http://example.com")}catch{return null}return null}}function ph(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const mh=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),gh=new Set(["javascript:","data:","file:","vbscript:"]);function Sa(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e=="string"&&e.startsWith("#")&&!i)try{if(new URL(e,"http://example.com").hash===e)return e}catch{}if(typeof e=="string"&&e.startsWith("data:"))return i&&r&&e.startsWith("data:image/")?e:null;if(typeof e=="string"&&e.startsWith("blob:")){try{if(new URL(e).protocol==="blob:"&&e.length>5){const h=e.substring(5);if(h&&h.length>0&&h!=="invalid")return e}}catch{return null}return null}const s=Ia(e,n);if(!s||gh.has(s.protocol)||!(mh.has(s.protocol)||a.includes(s.protocol)||a.includes("*")))return null;if(s.protocol==="mailto:"||!s.protocol.match(/^https?:$/))return s.href;const o=ph(e);return s&&t.some(c=>{const h=Ia(c,n);return!h||h.origin!==s.origin?!1:s.href.startsWith(h.href)})?o?s.pathname+s.search+s.hash:s.href:t.includes("*")?s.protocol!=="https:"&&s.protocol!=="http:"?null:o?s.pathname+s.search+s.hash:s.href:null}const Cr=Symbol("node-seen"),Eh=(e,t,n,r,i,a,s)=>{const u=(o,c,h)=>{if(o.type!=="element"||o[Cr])return tn;if(o.tagName==="a"){const d=Sa(o.properties.href,t,e,!1,!1,i);return d===null?(o[Cr]=!0,st(o,u),h&&typeof c=="number"&&(h.children[c]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(o.properties.href),class:s},children:[...o.children,{type:"text",value:" [blocked]"}]}),Wn):(o.properties.href=d,o.properties.target="_blank",o.properties.rel="noopener noreferrer",tn)}if(o.tagName==="img"){const d=Sa(o.properties.src,n,e,r,!0,i);return d===null?(o[Cr]=!0,st(o,u),h&&typeof c=="number"&&(h.children[c]={type:"element",tagName:"span",properties:{class:a},children:[{type:"text",value:"[Image blocked: "+String(o.properties.alt||"No description")+"]"}]}),Wn):(o.properties.src=d,tn)}return tn};return u},_u=-1,lr=0,an=1,Gn=2,Si=3,wi=4,Li=5,Oi=6,Au=7,ku=8,wa=typeof self=="object"?self:globalThis,bh=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case lr:case _u:return n(s,i);case an:{const u=n([],i);for(const o of s)u.push(r(o));return u}case Gn:{const u=n({},i);for(const[o,c]of s)u[r(o)]=r(c);return u}case Si:return n(new Date(s),i);case wi:{const{source:u,flags:o}=s;return n(new RegExp(u,o),i)}case Li:{const u=n(new Map,i);for(const[o,c]of s)u.set(r(o),r(c));return u}case Oi:{const u=n(new Set,i);for(const o of s)u.add(r(o));return u}case Au:{const{name:u,message:o}=s;return n(new wa[u](o),i)}case ku:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new wa[a](s),i)};return r},La=e=>bh(new Map,e)(0),Lt="",{toString:Th}={},{keys:xh}=Object,Wt=e=>{const t=typeof e;if(t!=="object"||!e)return[lr,t];const n=Th.call(e).slice(8,-1);switch(n){case"Array":return[an,Lt];case"Object":return[Gn,Lt];case"Date":return[Si,Lt];case"RegExp":return[wi,Lt];case"Map":return[Li,Lt];case"Set":return[Oi,Lt];case"DataView":return[an,n]}return n.includes("Array")?[an,n]:n.includes("Error")?[Au,n]:[Gn,n]},Pn=([e,t])=>e===lr&&(t==="function"||t==="symbol"),_h=(e,t,n,r)=>{const i=(s,u)=>{const o=r.push(s)-1;return n.set(u,o),o},a=s=>{if(n.has(s))return n.get(s);let[u,o]=Wt(s);switch(u){case lr:{let h=s;switch(o){case"bigint":u=ku,h=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+o);h=null;break;case"undefined":return i([_u],s)}return i([u,h],s)}case an:{if(o){let f=s;return o==="DataView"?f=new Uint8Array(s.buffer):o==="ArrayBuffer"&&(f=new Uint8Array(s)),i([o,[...f]],s)}const h=[],d=i([u,h],s);for(const f of s)h.push(a(f));return d}case Gn:{if(o)switch(o){case"BigInt":return i([o,s.toString()],s);case"Boolean":case"Number":case"String":return i([o,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const h=[],d=i([u,h],s);for(const f of xh(s))(e||!Pn(Wt(s[f])))&&h.push([a(f),a(s[f])]);return d}case Si:return i([u,s.toISOString()],s);case wi:{const{source:h,flags:d}=s;return i([u,{source:h,flags:d}],s)}case Li:{const h=[],d=i([u,h],s);for(const[f,p]of s)(e||!(Pn(Wt(f))||Pn(Wt(p))))&&h.push([a(f),a(p)]);return d}case Oi:{const h=[],d=i([u,h],s);for(const f of s)(e||!Pn(Wt(f)))&&h.push(a(f));return d}}const{message:c}=s;return i([u,{name:o,message:c}],s)};return a},Oa=(e,{json:t,lossy:n}={})=>{const r=[];return _h(!(t||n),!!t,new Map,r)(e),r},bt=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?La(Oa(e,t)):structuredClone(e):(e,t)=>La(Oa(e,t));class yn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}yn.prototype.normal={};yn.prototype.property={};yn.prototype.space=void 0;function Cu(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new yn(n,r,t)}function bn(e){return e.toLowerCase()}class Se{constructor(t,n){this.attribute=n,this.property=t}}Se.prototype.attribute="";Se.prototype.booleanish=!1;Se.prototype.boolean=!1;Se.prototype.commaOrSpaceSeparated=!1;Se.prototype.commaSeparated=!1;Se.prototype.defined=!1;Se.prototype.mustUseProperty=!1;Se.prototype.number=!1;Se.prototype.overloadedBoolean=!1;Se.prototype.property="";Se.prototype.spaceSeparated=!1;Se.prototype.space=void 0;let Ah=0;const Q=kt(),me=kt(),Wr=kt(),M=kt(),le=kt(),Mt=kt(),Re=kt();function kt(){return 2**++Ah}const Gr=Object.freeze(Object.defineProperty({__proto__:null,boolean:Q,booleanish:me,commaOrSpaceSeparated:Re,commaSeparated:Mt,number:M,overloadedBoolean:Wr,spaceSeparated:le},Symbol.toStringTag,{value:"Module"})),yr=Object.keys(Gr);class Ri extends Se{constructor(t,n,r,i){let a=-1;if(super(t,n),Ra(this,"space",i),typeof r=="number")for(;++a<yr.length;){const s=yr[a];Ra(this,yr[a],(r&Gr[s])===Gr[s])}}}Ri.prototype.defined=!0;function Ra(e,t,n){n&&(e[t]=n)}function Ht(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Ri(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[bn(r)]=r,n[bn(a.attribute)]=r}return new yn(t,n,e.space)}const yu=Ht({properties:{ariaActiveDescendant:null,ariaAtomic:me,ariaAutoComplete:null,ariaBusy:me,ariaChecked:me,ariaColCount:M,ariaColIndex:M,ariaColSpan:M,ariaControls:le,ariaCurrent:null,ariaDescribedBy:le,ariaDetails:null,ariaDisabled:me,ariaDropEffect:le,ariaErrorMessage:null,ariaExpanded:me,ariaFlowTo:le,ariaGrabbed:me,ariaHasPopup:null,ariaHidden:me,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:le,ariaLevel:M,ariaLive:null,ariaModal:me,ariaMultiLine:me,ariaMultiSelectable:me,ariaOrientation:null,ariaOwns:le,ariaPlaceholder:null,ariaPosInSet:M,ariaPressed:me,ariaReadOnly:me,ariaRelevant:null,ariaRequired:me,ariaRoleDescription:le,ariaRowCount:M,ariaRowIndex:M,ariaRowSpan:M,ariaSelected:me,ariaSetSize:M,ariaSort:null,ariaValueMax:M,ariaValueMin:M,ariaValueNow:M,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Nu(e,t){return t in e?e[t]:t}function Iu(e,t){return Nu(e,t.toLowerCase())}const kh=Ht({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Mt,acceptCharset:le,accessKey:le,action:null,allow:null,allowFullScreen:Q,allowPaymentRequest:Q,allowUserMedia:Q,alt:null,as:null,async:Q,autoCapitalize:null,autoComplete:le,autoFocus:Q,autoPlay:Q,blocking:le,capture:null,charSet:null,checked:Q,cite:null,className:le,cols:M,colSpan:null,content:null,contentEditable:me,controls:Q,controlsList:le,coords:M|Mt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Q,defer:Q,dir:null,dirName:null,disabled:Q,download:Wr,draggable:me,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Q,formTarget:null,headers:le,height:M,hidden:Wr,high:M,href:null,hrefLang:null,htmlFor:le,httpEquiv:le,id:null,imageSizes:null,imageSrcSet:null,inert:Q,inputMode:null,integrity:null,is:null,isMap:Q,itemId:null,itemProp:le,itemRef:le,itemScope:Q,itemType:le,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Q,low:M,manifest:null,max:null,maxLength:M,media:null,method:null,min:null,minLength:M,multiple:Q,muted:Q,name:null,nonce:null,noModule:Q,noValidate:Q,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Q,optimum:M,pattern:null,ping:le,placeholder:null,playsInline:Q,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Q,referrerPolicy:null,rel:le,required:Q,reversed:Q,rows:M,rowSpan:M,sandbox:le,scope:null,scoped:Q,seamless:Q,selected:Q,shadowRootClonable:Q,shadowRootDelegatesFocus:Q,shadowRootMode:null,shape:null,size:M,sizes:null,slot:null,span:M,spellCheck:me,src:null,srcDoc:null,srcLang:null,srcSet:null,start:M,step:null,style:null,tabIndex:M,target:null,title:null,translate:null,type:null,typeMustMatch:Q,useMap:null,value:me,width:M,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:le,axis:null,background:null,bgColor:null,border:M,borderColor:null,bottomMargin:M,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Q,declare:Q,event:null,face:null,frame:null,frameBorder:null,hSpace:M,leftMargin:M,link:null,longDesc:null,lowSrc:null,marginHeight:M,marginWidth:M,noResize:Q,noHref:Q,noShade:Q,noWrap:Q,object:null,profile:null,prompt:null,rev:null,rightMargin:M,rules:null,scheme:null,scrolling:me,standby:null,summary:null,text:null,topMargin:M,valueType:null,version:null,vAlign:null,vLink:null,vSpace:M,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Q,disableRemotePlayback:Q,prefix:null,property:null,results:M,security:null,unselectable:null},space:"html",transform:Iu}),Ch=Ht({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Re,accentHeight:M,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:M,amplitude:M,arabicForm:null,ascent:M,attributeName:null,attributeType:null,azimuth:M,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:M,by:null,calcMode:null,capHeight:M,className:le,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:M,diffuseConstant:M,direction:null,display:null,dur:null,divisor:M,dominantBaseline:null,download:Q,dx:null,dy:null,edgeMode:null,editable:null,elevation:M,enableBackground:null,end:null,event:null,exponent:M,externalResourcesRequired:null,fill:null,fillOpacity:M,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Mt,g2:Mt,glyphName:Mt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:M,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:M,horizOriginX:M,horizOriginY:M,id:null,ideographic:M,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:M,k:M,k1:M,k2:M,k3:M,k4:M,kernelMatrix:Re,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:M,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:M,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:M,overlineThickness:M,paintOrder:null,panose1:null,path:null,pathLength:M,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:le,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:M,pointsAtY:M,pointsAtZ:M,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Re,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Re,rev:Re,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Re,requiredFeatures:Re,requiredFonts:Re,requiredFormats:Re,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:M,specularExponent:M,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:M,strikethroughThickness:M,string:null,stroke:null,strokeDashArray:Re,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:M,strokeOpacity:M,strokeWidth:null,style:null,surfaceScale:M,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Re,tabIndex:M,tableValues:null,target:null,targetX:M,targetY:M,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Re,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:M,underlineThickness:M,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:M,values:null,vAlphabetic:M,vMathematical:M,vectorEffect:null,vHanging:M,vIdeographic:M,version:null,vertAdvY:M,vertOriginX:M,vertOriginY:M,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:M,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Nu}),Su=Ht({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),wu=Ht({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Iu}),Lu=Ht({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),yh={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Nh=/[A-Z]/g,Da=/-[a-z]/g,Ih=/^data[-\w.:]+$/i;function cr(e,t){const n=bn(t);let r=t,i=Se;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ih.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Da,wh);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Da.test(a)){let s=a.replace(Nh,Sh);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Ri}return new i(r,t)}function Sh(e){return"-"+e.toLowerCase()}function wh(e){return e.charAt(1).toUpperCase()}const Nn=Cu([yu,kh,Su,wu,Lu],"html"),ot=Cu([yu,Ch,Su,wu,Lu],"svg");function Pa(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(i,r).trim();(s||!a)&&t.push(s),i=r+1,r=n.indexOf(",",i)}return t}function Ou(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Ma=/[#.]/g;function Lh(e,t){const n=e||"",r={};let i=0,a,s;for(;i<n.length;){Ma.lastIndex=i;const u=Ma.exec(n),o=n.slice(i,u?u.index:n.length);o&&(a?a==="#"?r.id=o:Array.isArray(r.className)?r.className.push(o):r.className=[o]:s=o,i+=o.length),u&&(a=u[0],i++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function va(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Ru(e){return e.join(" ").trim()}function Du(e,t,n){const r=n?Ph(n):void 0;function i(a,s,...u){let o;if(a==null){o={type:"root",children:[]};const c=s;u.unshift(c)}else{o=Lh(a,t);const c=o.tagName.toLowerCase(),h=r?r.get(c):void 0;if(o.tagName=h||c,Oh(s))u.unshift(s);else for(const[d,f]of Object.entries(s))Rh(e,o.properties,d,f)}for(const c of u)Kr(o.children,c);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return i}function Oh(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Rh(e,t,n,r){const i=cr(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?i.spaceSeparated?a=va(r):i.commaSeparated?a=Pa(r):i.commaOrSpaceSeparated?a=va(Pa(r).join(" ")):a=Ba(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?Dh(r):String(r);if(Array.isArray(a)){const s=[];for(const u of a)s.push(Ba(i,i.property,u));a=s}i.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Kr(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Kr(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Kr(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Ba(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||bn(n)===bn(t)))return!0}return n}function Dh(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Ph(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const Mh=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],vh=Du(Nn,"div"),Bh=Du(ot,"g",Mh);function Fh(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let s=0;for(;;){let u=n[s];if(u===void 0){const o=Fa(t,n[s-1]);u=o===-1?t.length+1:o+1,n[s]=u}if(u>a)return{line:s+1,column:a-(s>0?n[s-1]:0)+1,offset:a};s++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const u=n[n.length-1],o=Fa(t,u),c=o===-1?t.length+1:o+1;if(u===c)break;n.push(c)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function Fa(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
3
3
|
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const mt={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Pu={}.hasOwnProperty,Hh=Object.prototype;function Uh(e,t){const n=t||{};return Di({file:n.file||void 0,location:!1,schema:n.space==="svg"?ot:Nn,verbose:n.verbose||!1},e)}function Di(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},$n(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Mu(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const a=String(e.file),s=Fh(a),u=s.toPoint(0),o=s.toPoint(a.length);n.position={start:u,end:o}}return n}case"#documentType":{const r=t;return n={type:"doctype"},$n(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},$n(e,r,n),n}default:return n=jh(e,t),n}}function Mu(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=Di(e,t[n]);r.push(i)}return r}function jh(e,t){const n=e.schema;e.schema=t.namespaceURI===mt.svg?ot:Nn;let r=-1;const i={};for(;++r<t.attrs.length;){const u=t.attrs[r],o=(u.prefix?u.prefix+":":"")+u.name;Pu.call(Hh,o)||(i[o]=u.value)}const s=(e.schema.space==="svg"?Bh:vh)(t.tagName,i,Mu(e,t.childNodes));if($n(e,t,s),s.tagName==="template"){const u=t,o=u.sourceCodeLocation,c=o&&o.startTag&&Dt(o.startTag),h=o&&o.endTag&&Dt(o.endTag),d=Di(e,u.content);c&&h&&e.file&&(d.position={start:c.end,end:h.start}),s.content=d}return e.schema=n,s}function $n(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=zh(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function zh(e,t,n){const r=Dt(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const a={};let s;if(n.attrs)for(s in n.attrs)Pu.call(n.attrs,s)&&(a[cr(e.schema,s).property]=Dt(n.attrs[s]));n.startTag;const u=Dt(n.startTag),o=n.endTag?Dt(n.endTag):void 0,c={opening:u};o&&(c.closing=o),c.properties=a,t.data={position:c}}}return r}function Dt(e){const t=Ha({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Ha({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Ha(e){return e.line&&e.column?e:void 0}const Ua={}.hasOwnProperty;function vu(e,t){const n=t||{};function r(i,...a){let s=r.invalid;const u=r.handlers;if(i&&Ua.call(i,e)){const o=String(i[e]);s=Ua.call(u,o)?u[o]:r.unknown}if(s)return s.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const $h={},Yh={}.hasOwnProperty,Bu=vu("type",{handlers:{root:Vh,element:Xh,text:Kh,comment:Qh,doctype:Gh}});function qh(e,t){const r=(t||$h).space;return Bu(e,r==="svg"?ot:Nn)}function Vh(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Pi(e.children,n,t),Ut(e,n),n}function Wh(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Pi(e.children,n,t),Ut(e,n),n}function Gh(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ut(e,t),t}function Kh(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ut(e,t),t}function Qh(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ut(e,t),t}function Xh(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=ot);const i=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&Yh.call(e.properties,a)){const o=Zh(r,a,e.properties[a]);o&&i.push(o)}}const s=r.space,u={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:mt[s],childNodes:[],parentNode:null};return u.childNodes=Pi(e.children,u,r),Ut(e,u),e.tagName==="template"&&e.content&&(u.content=Wh(e.content,r)),u}function Zh(e,t,n){const r=cr(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Ou(n):Ru(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=i.name.indexOf(":");a<0?i.prefix="":(i.name=i.name.slice(a+1),i.prefix=r.attribute.slice(0,a)),i.namespace=mt[r.space]}return i}function Pi(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const a=Bu(e[r],n);a.parentNode=t,i.push(a)}return i}function Ut(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const Jh=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],ed=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),ce="�";var g;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(g||(g={}));const Ne={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Fu(e){return e>=55296&&e<=57343}function td(e){return e>=56320&&e<=57343}function nd(e,t){return(e-55296)*1024+9216+t}function Hu(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Uu(e){return e>=64976&&e<=65007||ed.has(e)}var S;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(S||(S={}));const rd=65536;class id{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=rd,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:a}=this,s=i+n,u=a+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:u,endOffset:u}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(td(n))return this.pos++,this._addGap(),nd(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,g.EOF;return this._err(S.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,g.EOF;const r=this.html.charCodeAt(n);return r===g.CARRIAGE_RETURN?g.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,g.EOF;let t=this.html.charCodeAt(this.pos);return t===g.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,g.LINE_FEED):t===g.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Fu(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===g.LINE_FEED||t===g.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Hu(t)?this._err(S.controlCharacterInInputStream):Uu(t)&&this._err(S.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var J;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(J||(J={}));function ju(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const ad=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))),sd=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]]);function ud(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=sd.get(e))!==null&&t!==void 0?t:e}var Ee;(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"})(Ee||(Ee={}));const od=32;var at;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(at||(at={}));function Qr(e){return e>=Ee.ZERO&&e<=Ee.NINE}function ld(e){return e>=Ee.UPPER_A&&e<=Ee.UPPER_F||e>=Ee.LOWER_A&&e<=Ee.LOWER_F}function cd(e){return e>=Ee.UPPER_A&&e<=Ee.UPPER_Z||e>=Ee.LOWER_A&&e<=Ee.LOWER_Z||Qr(e)}function hd(e){return e===Ee.EQUALS||cd(e)}var ge;(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"})(ge||(ge={}));var Ze;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ze||(Ze={}));class dd{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=ge.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ze.Strict}startEntity(t){this.decodeMode=t,this.state=ge.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case ge.EntityStart:return t.charCodeAt(n)===Ee.NUM?(this.state=ge.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=ge.NamedEntity,this.stateNamedEntity(t,n));case ge.NumericStart:return this.stateNumericStart(t,n);case ge.NumericDecimal:return this.stateNumericDecimal(t,n);case ge.NumericHex:return this.stateNumericHex(t,n);case ge.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|od)===Ee.LOWER_X?(this.state=ge.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=ge.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const a=r-n;this.result=this.result*Math.pow(i,a)+Number.parseInt(t.substr(n,a),i),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Qr(i)||ld(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Qr(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Ee.SEMI)this.consumed+=1;else if(this.decodeMode===Ze.Strict)return 0;return this.emitCodePoint(ud(this.result),this.consumed),this.errors&&(t!==Ee.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],a=(i&at.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=fd(r,i,this.treeIndex+Math.max(1,a),s),this.treeIndex<0)return this.result===0||this.decodeMode===Ze.Attribute&&(a===0||hd(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],a=(i&at.VALUE_LENGTH)>>14,a!==0){if(s===Ee.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==Ze.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&at.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~at.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case ge.NamedEntity:return this.result!==0&&(this.decodeMode!==Ze.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ge.NumericDecimal:return this.emitNumericEntity(0,2);case ge.NumericHex:return this.emitNumericEntity(0,3);case ge.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ge.EntityStart:return 0}}}function fd(e,t,n,r){const i=(t&at.BRANCH_LENGTH)>>7,a=t&at.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){const o=r-a;return o<0||o>=i?-1:e[n+o]-1}let s=n,u=s+i-1;for(;s<=u;){const o=s+u>>>1,c=e[o];if(c<r)s=o+1;else if(c>r)u=o-1;else return e[o+i]}return-1}var D;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(D||(D={}));var gt;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(gt||(gt={}));var Me;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(Me||(Me={}));var y;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(y||(y={}));var l;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(l||(l={}));const pd=new Map([[y.A,l.A],[y.ADDRESS,l.ADDRESS],[y.ANNOTATION_XML,l.ANNOTATION_XML],[y.APPLET,l.APPLET],[y.AREA,l.AREA],[y.ARTICLE,l.ARTICLE],[y.ASIDE,l.ASIDE],[y.B,l.B],[y.BASE,l.BASE],[y.BASEFONT,l.BASEFONT],[y.BGSOUND,l.BGSOUND],[y.BIG,l.BIG],[y.BLOCKQUOTE,l.BLOCKQUOTE],[y.BODY,l.BODY],[y.BR,l.BR],[y.BUTTON,l.BUTTON],[y.CAPTION,l.CAPTION],[y.CENTER,l.CENTER],[y.CODE,l.CODE],[y.COL,l.COL],[y.COLGROUP,l.COLGROUP],[y.DD,l.DD],[y.DESC,l.DESC],[y.DETAILS,l.DETAILS],[y.DIALOG,l.DIALOG],[y.DIR,l.DIR],[y.DIV,l.DIV],[y.DL,l.DL],[y.DT,l.DT],[y.EM,l.EM],[y.EMBED,l.EMBED],[y.FIELDSET,l.FIELDSET],[y.FIGCAPTION,l.FIGCAPTION],[y.FIGURE,l.FIGURE],[y.FONT,l.FONT],[y.FOOTER,l.FOOTER],[y.FOREIGN_OBJECT,l.FOREIGN_OBJECT],[y.FORM,l.FORM],[y.FRAME,l.FRAME],[y.FRAMESET,l.FRAMESET],[y.H1,l.H1],[y.H2,l.H2],[y.H3,l.H3],[y.H4,l.H4],[y.H5,l.H5],[y.H6,l.H6],[y.HEAD,l.HEAD],[y.HEADER,l.HEADER],[y.HGROUP,l.HGROUP],[y.HR,l.HR],[y.HTML,l.HTML],[y.I,l.I],[y.IMG,l.IMG],[y.IMAGE,l.IMAGE],[y.INPUT,l.INPUT],[y.IFRAME,l.IFRAME],[y.KEYGEN,l.KEYGEN],[y.LABEL,l.LABEL],[y.LI,l.LI],[y.LINK,l.LINK],[y.LISTING,l.LISTING],[y.MAIN,l.MAIN],[y.MALIGNMARK,l.MALIGNMARK],[y.MARQUEE,l.MARQUEE],[y.MATH,l.MATH],[y.MENU,l.MENU],[y.META,l.META],[y.MGLYPH,l.MGLYPH],[y.MI,l.MI],[y.MO,l.MO],[y.MN,l.MN],[y.MS,l.MS],[y.MTEXT,l.MTEXT],[y.NAV,l.NAV],[y.NOBR,l.NOBR],[y.NOFRAMES,l.NOFRAMES],[y.NOEMBED,l.NOEMBED],[y.NOSCRIPT,l.NOSCRIPT],[y.OBJECT,l.OBJECT],[y.OL,l.OL],[y.OPTGROUP,l.OPTGROUP],[y.OPTION,l.OPTION],[y.P,l.P],[y.PARAM,l.PARAM],[y.PLAINTEXT,l.PLAINTEXT],[y.PRE,l.PRE],[y.RB,l.RB],[y.RP,l.RP],[y.RT,l.RT],[y.RTC,l.RTC],[y.RUBY,l.RUBY],[y.S,l.S],[y.SCRIPT,l.SCRIPT],[y.SEARCH,l.SEARCH],[y.SECTION,l.SECTION],[y.SELECT,l.SELECT],[y.SOURCE,l.SOURCE],[y.SMALL,l.SMALL],[y.SPAN,l.SPAN],[y.STRIKE,l.STRIKE],[y.STRONG,l.STRONG],[y.STYLE,l.STYLE],[y.SUB,l.SUB],[y.SUMMARY,l.SUMMARY],[y.SUP,l.SUP],[y.TABLE,l.TABLE],[y.TBODY,l.TBODY],[y.TEMPLATE,l.TEMPLATE],[y.TEXTAREA,l.TEXTAREA],[y.TFOOT,l.TFOOT],[y.TD,l.TD],[y.TH,l.TH],[y.THEAD,l.THEAD],[y.TITLE,l.TITLE],[y.TR,l.TR],[y.TRACK,l.TRACK],[y.TT,l.TT],[y.U,l.U],[y.UL,l.UL],[y.SVG,l.SVG],[y.VAR,l.VAR],[y.WBR,l.WBR],[y.XMP,l.XMP]]);function jt(e){var t;return(t=pd.get(e))!==null&&t!==void 0?t:l.UNKNOWN}const P=l,md={[D.HTML]:new Set([P.ADDRESS,P.APPLET,P.AREA,P.ARTICLE,P.ASIDE,P.BASE,P.BASEFONT,P.BGSOUND,P.BLOCKQUOTE,P.BODY,P.BR,P.BUTTON,P.CAPTION,P.CENTER,P.COL,P.COLGROUP,P.DD,P.DETAILS,P.DIR,P.DIV,P.DL,P.DT,P.EMBED,P.FIELDSET,P.FIGCAPTION,P.FIGURE,P.FOOTER,P.FORM,P.FRAME,P.FRAMESET,P.H1,P.H2,P.H3,P.H4,P.H5,P.H6,P.HEAD,P.HEADER,P.HGROUP,P.HR,P.HTML,P.IFRAME,P.IMG,P.INPUT,P.LI,P.LINK,P.LISTING,P.MAIN,P.MARQUEE,P.MENU,P.META,P.NAV,P.NOEMBED,P.NOFRAMES,P.NOSCRIPT,P.OBJECT,P.OL,P.P,P.PARAM,P.PLAINTEXT,P.PRE,P.SCRIPT,P.SECTION,P.SELECT,P.SOURCE,P.STYLE,P.SUMMARY,P.TABLE,P.TBODY,P.TD,P.TEMPLATE,P.TEXTAREA,P.TFOOT,P.TH,P.THEAD,P.TITLE,P.TR,P.TRACK,P.UL,P.WBR,P.XMP]),[D.MATHML]:new Set([P.MI,P.MO,P.MN,P.MS,P.MTEXT,P.ANNOTATION_XML]),[D.SVG]:new Set([P.TITLE,P.FOREIGN_OBJECT,P.DESC]),[D.XLINK]:new Set,[D.XML]:new Set,[D.XMLNS]:new Set},Xr=new Set([P.H1,P.H2,P.H3,P.H4,P.H5,P.H6]);y.STYLE,y.SCRIPT,y.XMP,y.IFRAME,y.NOEMBED,y.NOFRAMES,y.PLAINTEXT;var b;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(b||(b={}));const pe={DATA:b.DATA,RCDATA:b.RCDATA,RAWTEXT:b.RAWTEXT,SCRIPT_DATA:b.SCRIPT_DATA,PLAINTEXT:b.PLAINTEXT,CDATA_SECTION:b.CDATA_SECTION};function gd(e){return e>=g.DIGIT_0&&e<=g.DIGIT_9}function nn(e){return e>=g.LATIN_CAPITAL_A&&e<=g.LATIN_CAPITAL_Z}function Ed(e){return e>=g.LATIN_SMALL_A&&e<=g.LATIN_SMALL_Z}function nt(e){return Ed(e)||nn(e)}function ja(e){return nt(e)||gd(e)}function Mn(e){return e+32}function zu(e){return e===g.SPACE||e===g.LINE_FEED||e===g.TABULATION||e===g.FORM_FEED}function za(e){return zu(e)||e===g.SOLIDUS||e===g.GREATER_THAN_SIGN}function bd(e){return e===g.NULL?S.nullCharacterReference:e>1114111?S.characterReferenceOutsideUnicodeRange:Fu(e)?S.surrogateCharacterReference:Uu(e)?S.noncharacterCharacterReference:Hu(e)||e===g.CARRIAGE_RETURN?S.controlCharacterReference:null}class Td{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=b.DATA,this.returnState=b.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new id(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new dd(ad,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(S.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(S.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=bd(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:J.START_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:J.END_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:J.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:J.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(ju(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(S.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=jt(t.tagName),t.type===J.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(S.endTagWithAttributes),t.selfClosing&&this._err(S.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case J.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case J.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case J.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:J.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=zu(t)?J.WHITESPACE_CHARACTER:t===g.NULL?J.NULL_CHARACTER:J.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(J.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=b.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Ze.Attribute:Ze.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===b.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===b.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===b.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case b.DATA:{this._stateData(t);break}case b.RCDATA:{this._stateRcdata(t);break}case b.RAWTEXT:{this._stateRawtext(t);break}case b.SCRIPT_DATA:{this._stateScriptData(t);break}case b.PLAINTEXT:{this._statePlaintext(t);break}case b.TAG_OPEN:{this._stateTagOpen(t);break}case b.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case b.TAG_NAME:{this._stateTagName(t);break}case b.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case b.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case b.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case b.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case b.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case b.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case b.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case b.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case b.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case b.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case b.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case b.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case b.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case b.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case b.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case b.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case b.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case b.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case b.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case b.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case b.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case b.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case b.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case b.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case b.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case b.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case b.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case b.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case b.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case b.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case b.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case b.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case b.BOGUS_COMMENT:{this._stateBogusComment(t);break}case b.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case b.COMMENT_START:{this._stateCommentStart(t);break}case b.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case b.COMMENT:{this._stateComment(t);break}case b.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case b.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case b.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case b.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case b.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case b.COMMENT_END:{this._stateCommentEnd(t);break}case b.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case b.DOCTYPE:{this._stateDoctype(t);break}case b.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case b.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case b.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case b.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case b.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case b.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case b.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case b.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case b.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case b.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case b.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case b.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case b.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case b.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case b.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case b.CDATA_SECTION:{this._stateCdataSection(t);break}case b.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case b.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case b.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case b.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case g.LESS_THAN_SIGN:{this.state=b.TAG_OPEN;break}case g.AMPERSAND:{this._startCharacterReference();break}case g.NULL:{this._err(S.unexpectedNullCharacter),this._emitCodePoint(t);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case g.AMPERSAND:{this._startCharacterReference();break}case g.LESS_THAN_SIGN:{this.state=b.RCDATA_LESS_THAN_SIGN;break}case g.NULL:{this._err(S.unexpectedNullCharacter),this._emitChars(ce);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case g.LESS_THAN_SIGN:{this.state=b.RAWTEXT_LESS_THAN_SIGN;break}case g.NULL:{this._err(S.unexpectedNullCharacter),this._emitChars(ce);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case g.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_LESS_THAN_SIGN;break}case g.NULL:{this._err(S.unexpectedNullCharacter),this._emitChars(ce);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case g.NULL:{this._err(S.unexpectedNullCharacter),this._emitChars(ce);break}case g.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(nt(t))this._createStartTagToken(),this.state=b.TAG_NAME,this._stateTagName(t);else switch(t){case g.EXCLAMATION_MARK:{this.state=b.MARKUP_DECLARATION_OPEN;break}case g.SOLIDUS:{this.state=b.END_TAG_OPEN;break}case g.QUESTION_MARK:{this._err(S.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=b.BOGUS_COMMENT,this._stateBogusComment(t);break}case g.EOF:{this._err(S.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(S.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=b.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(nt(t))this._createEndTagToken(),this.state=b.TAG_NAME,this._stateTagName(t);else switch(t){case g.GREATER_THAN_SIGN:{this._err(S.missingEndTagName),this.state=b.DATA;break}case g.EOF:{this._err(S.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(S.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=b.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=b.BEFORE_ATTRIBUTE_NAME;break}case g.SOLIDUS:{this.state=b.SELF_CLOSING_START_TAG;break}case g.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentTagToken();break}case g.NULL:{this._err(S.unexpectedNullCharacter),n.tagName+=ce;break}case g.EOF:{this._err(S.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(nn(t)?Mn(t):t)}}_stateRcdataLessThanSign(t){t===g.SOLIDUS?this.state=b.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=b.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){nt(t)?(this.state=b.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=b.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=b.BEFORE_ATTRIBUTE_NAME,!1;case g.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=b.SELF_CLOSING_START_TAG,!1;case g.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=b.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=b.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===g.SOLIDUS?this.state=b.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=b.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){nt(t)?(this.state=b.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=b.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=b.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case g.SOLIDUS:{this.state=b.SCRIPT_DATA_END_TAG_OPEN;break}case g.EXCLAMATION_MARK:{this.state=b.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=b.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){nt(t)?(this.state=b.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=b.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=b.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===g.HYPHEN_MINUS?(this.state=b.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=b.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===g.HYPHEN_MINUS?(this.state=b.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=b.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case g.HYPHEN_MINUS:{this.state=b.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case g.NULL:{this._err(S.unexpectedNullCharacter),this._emitChars(ce);break}case g.EOF:{this._err(S.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case g.HYPHEN_MINUS:{this.state=b.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case g.NULL:{this._err(S.unexpectedNullCharacter),this.state=b.SCRIPT_DATA_ESCAPED,this._emitChars(ce);break}case g.EOF:{this._err(S.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=b.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case g.HYPHEN_MINUS:{this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case g.GREATER_THAN_SIGN:{this.state=b.SCRIPT_DATA,this._emitChars(">");break}case g.NULL:{this._err(S.unexpectedNullCharacter),this.state=b.SCRIPT_DATA_ESCAPED,this._emitChars(ce);break}case g.EOF:{this._err(S.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=b.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===g.SOLIDUS?this.state=b.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:nt(t)?(this._emitChars("<"),this.state=b.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=b.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){nt(t)?(this.state=b.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=b.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=b.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Ne.SCRIPT,!1)&&za(this.preprocessor.peek(Ne.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Ne.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=b.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case g.HYPHEN_MINUS:{this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case g.NULL:{this._err(S.unexpectedNullCharacter),this._emitChars(ce);break}case g.EOF:{this._err(S.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case g.HYPHEN_MINUS:{this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case g.NULL:{this._err(S.unexpectedNullCharacter),this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(ce);break}case g.EOF:{this._err(S.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case g.HYPHEN_MINUS:{this._emitChars("-");break}case g.LESS_THAN_SIGN:{this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case g.GREATER_THAN_SIGN:{this.state=b.SCRIPT_DATA,this._emitChars(">");break}case g.NULL:{this._err(S.unexpectedNullCharacter),this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(ce);break}case g.EOF:{this._err(S.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===g.SOLIDUS?(this.state=b.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Ne.SCRIPT,!1)&&za(this.preprocessor.peek(Ne.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Ne.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=b.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=b.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.SOLIDUS:case g.GREATER_THAN_SIGN:case g.EOF:{this.state=b.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case g.EQUALS_SIGN:{this._err(S.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=b.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=b.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:case g.SOLIDUS:case g.GREATER_THAN_SIGN:case g.EOF:{this._leaveAttrName(),this.state=b.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case g.EQUALS_SIGN:{this._leaveAttrName(),this.state=b.BEFORE_ATTRIBUTE_VALUE;break}case g.QUOTATION_MARK:case g.APOSTROPHE:case g.LESS_THAN_SIGN:{this._err(S.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case g.NULL:{this._err(S.unexpectedNullCharacter),this.currentAttr.name+=ce;break}default:this.currentAttr.name+=String.fromCodePoint(nn(t)?Mn(t):t)}}_stateAfterAttributeName(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.SOLIDUS:{this.state=b.SELF_CLOSING_START_TAG;break}case g.EQUALS_SIGN:{this.state=b.BEFORE_ATTRIBUTE_VALUE;break}case g.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentTagToken();break}case g.EOF:{this._err(S.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=b.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.QUOTATION_MARK:{this.state=b.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case g.APOSTROPHE:{this.state=b.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(S.missingAttributeValue),this.state=b.DATA,this.emitCurrentTagToken();break}default:this.state=b.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case g.QUOTATION_MARK:{this.state=b.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case g.AMPERSAND:{this._startCharacterReference();break}case g.NULL:{this._err(S.unexpectedNullCharacter),this.currentAttr.value+=ce;break}case g.EOF:{this._err(S.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case g.APOSTROPHE:{this.state=b.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case g.AMPERSAND:{this._startCharacterReference();break}case g.NULL:{this._err(S.unexpectedNullCharacter),this.currentAttr.value+=ce;break}case g.EOF:{this._err(S.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this._leaveAttrValue(),this.state=b.BEFORE_ATTRIBUTE_NAME;break}case g.AMPERSAND:{this._startCharacterReference();break}case g.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=b.DATA,this.emitCurrentTagToken();break}case g.NULL:{this._err(S.unexpectedNullCharacter),this.currentAttr.value+=ce;break}case g.QUOTATION_MARK:case g.APOSTROPHE:case g.LESS_THAN_SIGN:case g.EQUALS_SIGN:case g.GRAVE_ACCENT:{this._err(S.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case g.EOF:{this._err(S.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this._leaveAttrValue(),this.state=b.BEFORE_ATTRIBUTE_NAME;break}case g.SOLIDUS:{this._leaveAttrValue(),this.state=b.SELF_CLOSING_START_TAG;break}case g.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=b.DATA,this.emitCurrentTagToken();break}case g.EOF:{this._err(S.eofInTag),this._emitEOFToken();break}default:this._err(S.missingWhitespaceBetweenAttributes),this.state=b.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case g.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=b.DATA,this.emitCurrentTagToken();break}case g.EOF:{this._err(S.eofInTag),this._emitEOFToken();break}default:this._err(S.unexpectedSolidusInTag),this.state=b.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case g.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentComment(n);break}case g.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case g.NULL:{this._err(S.unexpectedNullCharacter),n.data+=ce;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Ne.DASH_DASH,!0)?(this._createCommentToken(Ne.DASH_DASH.length+1),this.state=b.COMMENT_START):this._consumeSequenceIfMatch(Ne.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Ne.DOCTYPE.length+1),this.state=b.DOCTYPE):this._consumeSequenceIfMatch(Ne.CDATA_START,!0)?this.inForeignNode?this.state=b.CDATA_SECTION:(this._err(S.cdataInHtmlContent),this._createCommentToken(Ne.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=b.BOGUS_COMMENT):this._ensureHibernation()||(this._err(S.incorrectlyOpenedComment),this._createCommentToken(2),this.state=b.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case g.HYPHEN_MINUS:{this.state=b.COMMENT_START_DASH;break}case g.GREATER_THAN_SIGN:{this._err(S.abruptClosingOfEmptyComment),this.state=b.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=b.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case g.HYPHEN_MINUS:{this.state=b.COMMENT_END;break}case g.GREATER_THAN_SIGN:{this._err(S.abruptClosingOfEmptyComment),this.state=b.DATA,this.emitCurrentComment(n);break}case g.EOF:{this._err(S.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=b.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case g.HYPHEN_MINUS:{this.state=b.COMMENT_END_DASH;break}case g.LESS_THAN_SIGN:{n.data+="<",this.state=b.COMMENT_LESS_THAN_SIGN;break}case g.NULL:{this._err(S.unexpectedNullCharacter),n.data+=ce;break}case g.EOF:{this._err(S.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case g.EXCLAMATION_MARK:{n.data+="!",this.state=b.COMMENT_LESS_THAN_SIGN_BANG;break}case g.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=b.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===g.HYPHEN_MINUS?this.state=b.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=b.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===g.HYPHEN_MINUS?this.state=b.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=b.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==g.GREATER_THAN_SIGN&&t!==g.EOF&&this._err(S.nestedComment),this.state=b.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case g.HYPHEN_MINUS:{this.state=b.COMMENT_END;break}case g.EOF:{this._err(S.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=b.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case g.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentComment(n);break}case g.EXCLAMATION_MARK:{this.state=b.COMMENT_END_BANG;break}case g.HYPHEN_MINUS:{n.data+="-";break}case g.EOF:{this._err(S.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=b.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case g.HYPHEN_MINUS:{n.data+="--!",this.state=b.COMMENT_END_DASH;break}case g.GREATER_THAN_SIGN:{this._err(S.incorrectlyClosedComment),this.state=b.DATA,this.emitCurrentComment(n);break}case g.EOF:{this._err(S.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=b.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=b.BEFORE_DOCTYPE_NAME;break}case g.GREATER_THAN_SIGN:{this.state=b.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case g.EOF:{this._err(S.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(S.missingWhitespaceBeforeDoctypeName),this.state=b.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(nn(t))this._createDoctypeToken(String.fromCharCode(Mn(t))),this.state=b.DOCTYPE_NAME;else switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.NULL:{this._err(S.unexpectedNullCharacter),this._createDoctypeToken(ce),this.state=b.DOCTYPE_NAME;break}case g.GREATER_THAN_SIGN:{this._err(S.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=b.DATA;break}case g.EOF:{this._err(S.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=b.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=b.AFTER_DOCTYPE_NAME;break}case g.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentDoctype(n);break}case g.NULL:{this._err(S.unexpectedNullCharacter),n.name+=ce;break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(nn(t)?Mn(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Ne.PUBLIC,!1)?this.state=b.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Ne.SYSTEM,!1)?this.state=b.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(S.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=b.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case g.QUOTATION_MARK:{this._err(S.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=b.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{this._err(S.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=b.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(S.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=b.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(S.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.QUOTATION_MARK:{n.publicId="",this.state=b.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{n.publicId="",this.state=b.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(S.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=b.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(S.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case g.QUOTATION_MARK:{this.state=b.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case g.NULL:{this._err(S.unexpectedNullCharacter),n.publicId+=ce;break}case g.GREATER_THAN_SIGN:{this._err(S.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=b.DATA;break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case g.APOSTROPHE:{this.state=b.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case g.NULL:{this._err(S.unexpectedNullCharacter),n.publicId+=ce;break}case g.GREATER_THAN_SIGN:{this._err(S.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=b.DATA;break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=b.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case g.GREATER_THAN_SIGN:{this.state=b.DATA,this.emitCurrentDoctype(n);break}case g.QUOTATION_MARK:{this._err(S.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{this._err(S.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(S.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=b.DATA;break}case g.QUOTATION_MARK:{n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(S.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:{this.state=b.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case g.QUOTATION_MARK:{this._err(S.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{this._err(S.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(S.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=b.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(S.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.QUOTATION_MARK:{n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case g.APOSTROPHE:{n.systemId="",this.state=b.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case g.GREATER_THAN_SIGN:{this._err(S.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=b.DATA,this.emitCurrentDoctype(n);break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(S.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case g.QUOTATION_MARK:{this.state=b.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case g.NULL:{this._err(S.unexpectedNullCharacter),n.systemId+=ce;break}case g.GREATER_THAN_SIGN:{this._err(S.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=b.DATA;break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case g.APOSTROPHE:{this.state=b.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case g.NULL:{this._err(S.unexpectedNullCharacter),n.systemId+=ce;break}case g.GREATER_THAN_SIGN:{this._err(S.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=b.DATA;break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case g.SPACE:case g.LINE_FEED:case g.TABULATION:case g.FORM_FEED:break;case g.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=b.DATA;break}case g.EOF:{this._err(S.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(S.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=b.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case g.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=b.DATA;break}case g.NULL:{this._err(S.unexpectedNullCharacter);break}case g.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case g.RIGHT_SQUARE_BRACKET:{this.state=b.CDATA_SECTION_BRACKET;break}case g.EOF:{this._err(S.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===g.RIGHT_SQUARE_BRACKET?this.state=b.CDATA_SECTION_END:(this._emitChars("]"),this.state=b.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case g.GREATER_THAN_SIGN:{this.state=b.DATA;break}case g.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=b.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(g.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&ja(this.preprocessor.peek(1))?b.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){ja(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===g.SEMICOLON&&this._err(S.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const $u=new Set([l.DD,l.DT,l.LI,l.OPTGROUP,l.OPTION,l.P,l.RB,l.RP,l.RT,l.RTC]),$a=new Set([...$u,l.CAPTION,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]),Kn=new Set([l.APPLET,l.CAPTION,l.HTML,l.MARQUEE,l.OBJECT,l.TABLE,l.TD,l.TEMPLATE,l.TH]),xd=new Set([...Kn,l.OL,l.UL]),_d=new Set([...Kn,l.BUTTON]),Ya=new Set([l.ANNOTATION_XML,l.MI,l.MN,l.MO,l.MS,l.MTEXT]),qa=new Set([l.DESC,l.FOREIGN_OBJECT,l.TITLE]),Ad=new Set([l.TR,l.TEMPLATE,l.HTML]),kd=new Set([l.TBODY,l.TFOOT,l.THEAD,l.TEMPLATE,l.HTML]),Cd=new Set([l.TABLE,l.TEMPLATE,l.HTML]),yd=new Set([l.TD,l.TH]);class Nd{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=l.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===l.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===D.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==D.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Xr,D.HTML)}popUntilTableCellPopped(){this.popUntilPopped(yd,D.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(Cd,D.HTML)}clearBackToTableBodyContext(){this.clearBackTo(kd,D.HTML)}clearBackToTableRowContext(){this.clearBackTo(Ad,D.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===l.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===l.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case D.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case D.SVG:{if(qa.has(i))return!1;break}case D.MATHML:{if(Ya.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Kn)}hasInListItemScope(t){return this.hasInDynamicScope(t,xd)}hasInButtonScope(t){return this.hasInDynamicScope(t,_d)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case D.HTML:{if(Xr.has(n))return!0;if(Kn.has(n))return!1;break}case D.SVG:{if(qa.has(n))return!1;break}case D.MATHML:{if(Ya.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===D.HTML)switch(this.tagIDs[n]){case t:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===D.HTML)switch(this.tagIDs[t]){case l.TBODY:case l.THEAD:case l.TFOOT:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===D.HTML)switch(this.tagIDs[n]){case t:return!0;case l.OPTION:case l.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&$u.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&$a.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&$a.has(this.currentTagId);)this.pop()}}const Nr=3;var qe;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(qe||(qe={}));const Va={type:qe.Marker};class Id{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,a=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let u=0;u<this.entries.length;u++){const o=this.entries[u];if(o.type===qe.Marker)break;const{element:c}=o;if(this.treeAdapter.getTagName(c)===a&&this.treeAdapter.getNamespaceURI(c)===s){const h=this.treeAdapter.getAttrList(c);h.length===i&&r.push({idx:u,attrs:h})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Nr)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Nr)return;const i=new Map(n.map(s=>[s.name,s.value]));let a=0;for(let s=0;s<r.length;s++){const u=r[s];u.attrs.every(o=>i.get(o.name)===o.value)&&(a+=1,a>=Nr&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(Va)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:qe.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:qe.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(Va);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===qe.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===qe.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===qe.Element&&n.element===t)}}const rt={createDocument(){return{nodeName:"#document",mode:Me.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(a=>a.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};rt.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(rt.isTextNode(n)){n.value+=t;return}}rt.appendChild(e,rt.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&rt.isTextNode(r)?r.value+=t:rt.insertBefore(e,rt.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Yu="html",Sd="about:legacy-compat",wd="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",qu=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],Ld=[...qu,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Od=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Vu=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Rd=[...Vu,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Wa(e,t){return t.some(n=>e.startsWith(n))}function Dd(e){return e.name===Yu&&e.publicId===null&&(e.systemId===null||e.systemId===Sd)}function Pd(e){if(e.name!==Yu)return Me.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===wd)return Me.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Od.has(n))return Me.QUIRKS;let r=t===null?Ld:qu;if(Wa(n,r))return Me.QUIRKS;if(r=t===null?Vu:Rd,Wa(n,r))return Me.LIMITED_QUIRKS}return Me.NO_QUIRKS}const Ga={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Md="definitionurl",vd="definitionURL",Bd=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),Fd=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:D.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:D.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:D.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:D.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:D.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:D.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:D.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:D.XML}],["xml:space",{prefix:"xml",name:"space",namespace:D.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:D.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:D.XMLNS}]]),Hd=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),Ud=new Set([l.B,l.BIG,l.BLOCKQUOTE,l.BODY,l.BR,l.CENTER,l.CODE,l.DD,l.DIV,l.DL,l.DT,l.EM,l.EMBED,l.H1,l.H2,l.H3,l.H4,l.H5,l.H6,l.HEAD,l.HR,l.I,l.IMG,l.LI,l.LISTING,l.MENU,l.META,l.NOBR,l.OL,l.P,l.PRE,l.RUBY,l.S,l.SMALL,l.SPAN,l.STRONG,l.STRIKE,l.SUB,l.SUP,l.TABLE,l.TT,l.U,l.UL,l.VAR]);function jd(e){const t=e.tagID;return t===l.FONT&&e.attrs.some(({name:r})=>r===gt.COLOR||r===gt.SIZE||r===gt.FACE)||Ud.has(t)}function Wu(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Md){e.attrs[t].name=vd;break}}function Gu(e){for(let t=0;t<e.attrs.length;t++){const n=Bd.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Mi(e){for(let t=0;t<e.attrs.length;t++){const n=Fd.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function zd(e){const t=Hd.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=jt(e.tagName))}function $d(e,t){return t===D.MATHML&&(e===l.MI||e===l.MO||e===l.MN||e===l.MS||e===l.MTEXT)}function Yd(e,t,n){if(t===D.MATHML&&e===l.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===gt.ENCODING){const i=n[r].value.toLowerCase();return i===Ga.TEXT_HTML||i===Ga.APPLICATION_XML}}return t===D.SVG&&(e===l.FOREIGN_OBJECT||e===l.DESC||e===l.TITLE)}function qd(e,t,n,r){return(!r||r===D.HTML)&&Yd(e,t,n)||(!r||r===D.MATHML)&&$d(e,t)}const Vd="hidden",Wd=8,Gd=3;var T;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(T||(T={}));const Kd={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Ku=new Set([l.TABLE,l.TBODY,l.TFOOT,l.THEAD,l.TR]),Ka={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:rt,onParseError:null};class Qa{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=T.INITIAL,this.originalInsertionMode=T.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Ka,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new Td(this.options,this),this.activeFormattingElements=new Id(this.treeAdapter),this.fragmentContextID=r?jt(this.treeAdapter.getTagName(r)):l.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new Nd(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...Ka,...n};t??(t=r.treeAdapter.createElement(y.TEMPLATE,D.HTML,[]));const i=r.treeAdapter.createElement("documentmock",D.HTML,[]),a=new this(r,i,t);return a.fragmentContextID===l.TEMPLATE&&a.tmplInsertionModeStack.unshift(T.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const a=(i=t.location)!==null&&i!==void 0?i:Kd,s={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(s)}onItemPush(t,n,r){var i,a;(a=(i=this.treeAdapter).onItemPush)===null||a===void 0||a.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===D.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,D.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=T.TEXT}switchToPlaintextParsing(){this.insertionMode=T.TEXT,this.originalInsertionMode=T.IN_BODY,this.tokenizer.state=pe.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===y.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==D.HTML))switch(this.fragmentContextID){case l.TITLE:case l.TEXTAREA:{this.tokenizer.state=pe.RCDATA;break}case l.STYLE:case l.XMP:case l.IFRAME:case l.NOEMBED:case l.NOFRAMES:case l.NOSCRIPT:{this.tokenizer.state=pe.RAWTEXT;break}case l.SCRIPT:{this.tokenizer.state=pe.SCRIPT_DATA;break}case l.PLAINTEXT:{this.tokenizer.state=pe.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const s=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));s&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,D.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,D.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(y.HTML,D.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,l.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),a=r?i.lastIndexOf(r):i.length,s=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:o,endCol:c,endOffset:h}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:o,endCol:c,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),a=n.type===J.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===l.SVG&&this.treeAdapter.getTagName(n)===y.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===D.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===l.MGLYPH||t.tagID===l.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,D.HTML)}_processToken(t){switch(t.type){case J.CHARACTER:{this.onCharacter(t);break}case J.NULL_CHARACTER:{this.onNullCharacter(t);break}case J.COMMENT:{this.onComment(t);break}case J.DOCTYPE:{this.onDoctype(t);break}case J.START_TAG:{this._processStartTag(t);break}case J.END_TAG:{this.onEndTag(t);break}case J.EOF:{this.onEof(t);break}case J.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return qd(t,i,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===qe.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const a=this.activeFormattingElements.entries[i];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=T.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(l.P),this.openElements.popUntilTagNamePopped(l.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case l.TR:{this.insertionMode=T.IN_ROW;return}case l.TBODY:case l.THEAD:case l.TFOOT:{this.insertionMode=T.IN_TABLE_BODY;return}case l.CAPTION:{this.insertionMode=T.IN_CAPTION;return}case l.COLGROUP:{this.insertionMode=T.IN_COLUMN_GROUP;return}case l.TABLE:{this.insertionMode=T.IN_TABLE;return}case l.BODY:{this.insertionMode=T.IN_BODY;return}case l.FRAMESET:{this.insertionMode=T.IN_FRAMESET;return}case l.SELECT:{this._resetInsertionModeForSelect(t);return}case l.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case l.HTML:{this.insertionMode=this.headElement?T.AFTER_HEAD:T.BEFORE_HEAD;return}case l.TD:case l.TH:{if(t>0){this.insertionMode=T.IN_CELL;return}break}case l.HEAD:{if(t>0){this.insertionMode=T.IN_HEAD;return}break}}this.insertionMode=T.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===l.TEMPLATE)break;if(r===l.TABLE){this.insertionMode=T.IN_SELECT_IN_TABLE;return}}this.insertionMode=T.IN_SELECT}_isElementCausesFosterParenting(t){return Ku.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case l.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===D.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case l.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return md[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){N0(this,t);return}switch(this.insertionMode){case T.INITIAL:{Gt(this,t);break}case T.BEFORE_HTML:{sn(this,t);break}case T.BEFORE_HEAD:{un(this,t);break}case T.IN_HEAD:{on(this,t);break}case T.IN_HEAD_NO_SCRIPT:{ln(this,t);break}case T.AFTER_HEAD:{cn(this,t);break}case T.IN_BODY:case T.IN_CAPTION:case T.IN_CELL:case T.IN_TEMPLATE:{Xu(this,t);break}case T.TEXT:case T.IN_SELECT:case T.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case T.IN_TABLE:case T.IN_TABLE_BODY:case T.IN_ROW:{Ir(this,t);break}case T.IN_TABLE_TEXT:{ro(this,t);break}case T.IN_COLUMN_GROUP:{Qn(this,t);break}case T.AFTER_BODY:{Xn(this,t);break}case T.AFTER_AFTER_BODY:{Yn(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){y0(this,t);return}switch(this.insertionMode){case T.INITIAL:{Gt(this,t);break}case T.BEFORE_HTML:{sn(this,t);break}case T.BEFORE_HEAD:{un(this,t);break}case T.IN_HEAD:{on(this,t);break}case T.IN_HEAD_NO_SCRIPT:{ln(this,t);break}case T.AFTER_HEAD:{cn(this,t);break}case T.TEXT:{this._insertCharacters(t);break}case T.IN_TABLE:case T.IN_TABLE_BODY:case T.IN_ROW:{Ir(this,t);break}case T.IN_COLUMN_GROUP:{Qn(this,t);break}case T.AFTER_BODY:{Xn(this,t);break}case T.AFTER_AFTER_BODY:{Yn(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Zr(this,t);return}switch(this.insertionMode){case T.INITIAL:case T.BEFORE_HTML:case T.BEFORE_HEAD:case T.IN_HEAD:case T.IN_HEAD_NO_SCRIPT:case T.AFTER_HEAD:case T.IN_BODY:case T.IN_TABLE:case T.IN_CAPTION:case T.IN_COLUMN_GROUP:case T.IN_TABLE_BODY:case T.IN_ROW:case T.IN_CELL:case T.IN_SELECT:case T.IN_SELECT_IN_TABLE:case T.IN_TEMPLATE:case T.IN_FRAMESET:case T.AFTER_FRAMESET:{Zr(this,t);break}case T.IN_TABLE_TEXT:{Kt(this,t);break}case T.AFTER_BODY:{nf(this,t);break}case T.AFTER_AFTER_BODY:case T.AFTER_AFTER_FRAMESET:{rf(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case T.INITIAL:{af(this,t);break}case T.BEFORE_HEAD:case T.IN_HEAD:case T.IN_HEAD_NO_SCRIPT:case T.AFTER_HEAD:{this._err(t,S.misplacedDoctype);break}case T.IN_TABLE_TEXT:{Kt(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,S.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?I0(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case T.INITIAL:{Gt(this,t);break}case T.BEFORE_HTML:{sf(this,t);break}case T.BEFORE_HEAD:{of(this,t);break}case T.IN_HEAD:{$e(this,t);break}case T.IN_HEAD_NO_SCRIPT:{hf(this,t);break}case T.AFTER_HEAD:{ff(this,t);break}case T.IN_BODY:{_e(this,t);break}case T.IN_TABLE:{Bt(this,t);break}case T.IN_TABLE_TEXT:{Kt(this,t);break}case T.IN_CAPTION:{l0(this,t);break}case T.IN_COLUMN_GROUP:{Fi(this,t);break}case T.IN_TABLE_BODY:{fr(this,t);break}case T.IN_ROW:{pr(this,t);break}case T.IN_CELL:{d0(this,t);break}case T.IN_SELECT:{so(this,t);break}case T.IN_SELECT_IN_TABLE:{p0(this,t);break}case T.IN_TEMPLATE:{g0(this,t);break}case T.AFTER_BODY:{b0(this,t);break}case T.IN_FRAMESET:{T0(this,t);break}case T.AFTER_FRAMESET:{_0(this,t);break}case T.AFTER_AFTER_BODY:{k0(this,t);break}case T.AFTER_AFTER_FRAMESET:{C0(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?S0(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case T.INITIAL:{Gt(this,t);break}case T.BEFORE_HTML:{uf(this,t);break}case T.BEFORE_HEAD:{lf(this,t);break}case T.IN_HEAD:{cf(this,t);break}case T.IN_HEAD_NO_SCRIPT:{df(this,t);break}case T.AFTER_HEAD:{pf(this,t);break}case T.IN_BODY:{dr(this,t);break}case T.TEXT:{Jf(this,t);break}case T.IN_TABLE:{Tn(this,t);break}case T.IN_TABLE_TEXT:{Kt(this,t);break}case T.IN_CAPTION:{c0(this,t);break}case T.IN_COLUMN_GROUP:{h0(this,t);break}case T.IN_TABLE_BODY:{Jr(this,t);break}case T.IN_ROW:{ao(this,t);break}case T.IN_CELL:{f0(this,t);break}case T.IN_SELECT:{uo(this,t);break}case T.IN_SELECT_IN_TABLE:{m0(this,t);break}case T.IN_TEMPLATE:{E0(this,t);break}case T.AFTER_BODY:{lo(this,t);break}case T.IN_FRAMESET:{x0(this,t);break}case T.AFTER_FRAMESET:{A0(this,t);break}case T.AFTER_AFTER_BODY:{Yn(this,t);break}}}onEof(t){switch(this.insertionMode){case T.INITIAL:{Gt(this,t);break}case T.BEFORE_HTML:{sn(this,t);break}case T.BEFORE_HEAD:{un(this,t);break}case T.IN_HEAD:{on(this,t);break}case T.IN_HEAD_NO_SCRIPT:{ln(this,t);break}case T.AFTER_HEAD:{cn(this,t);break}case T.IN_BODY:case T.IN_TABLE:case T.IN_CAPTION:case T.IN_COLUMN_GROUP:case T.IN_TABLE_BODY:case T.IN_ROW:case T.IN_CELL:case T.IN_SELECT:case T.IN_SELECT_IN_TABLE:{to(this,t);break}case T.TEXT:{e0(this,t);break}case T.IN_TABLE_TEXT:{Kt(this,t);break}case T.IN_TEMPLATE:{oo(this,t);break}case T.AFTER_BODY:case T.IN_FRAMESET:case T.AFTER_FRAMESET:case T.AFTER_AFTER_BODY:case T.AFTER_AFTER_FRAMESET:{Bi(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===g.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case T.IN_HEAD:case T.IN_HEAD_NO_SCRIPT:case T.AFTER_HEAD:case T.TEXT:case T.IN_COLUMN_GROUP:case T.IN_SELECT:case T.IN_SELECT_IN_TABLE:case T.IN_FRAMESET:case T.AFTER_FRAMESET:{this._insertCharacters(t);break}case T.IN_BODY:case T.IN_CAPTION:case T.IN_CELL:case T.IN_TEMPLATE:case T.AFTER_BODY:case T.AFTER_AFTER_BODY:case T.AFTER_AFTER_FRAMESET:{Qu(this,t);break}case T.IN_TABLE:case T.IN_TABLE_BODY:case T.IN_ROW:{Ir(this,t);break}case T.IN_TABLE_TEXT:{no(this,t);break}}}}function Qd(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):eo(e,t),n}function Xd(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function Zd(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,s=i;s!==n;a++,s=i){i=e.openElements.getCommonAncestor(s);const u=e.activeFormattingElements.getElementEntry(s),o=u&&a>=Gd;!u||o?(o&&e.activeFormattingElements.removeEntry(u),e.openElements.remove(s)):(s=Jd(e,u),r===t&&(e.activeFormattingElements.bookmark=u),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function Jd(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function ef(e,t,n){const r=e.treeAdapter.getTagName(t),i=jt(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);i===l.TEMPLATE&&a===D.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function tf(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function vi(e,t){for(let n=0;n<Wd;n++){const r=Qd(e,t);if(!r)break;const i=Xd(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const a=Zd(e,i,r.element),s=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),s&&ef(e,s,a),tf(e,i,r)}}function Zr(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function nf(e,t){e._appendCommentNode(t,e.openElements.items[0])}function rf(e,t){e._appendCommentNode(t,e.document)}function Bi(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&e._setEndLocation(a,t)}}}}function af(e,t){e._setDocumentType(t);const n=t.forceQuirks?Me.QUIRKS:Pd(t);Dd(t)||e._err(t,S.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=T.BEFORE_HTML}function Gt(e,t){e._err(t,S.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Me.QUIRKS),e.insertionMode=T.BEFORE_HTML,e._processToken(t)}function sf(e,t){t.tagID===l.HTML?(e._insertElement(t,D.HTML),e.insertionMode=T.BEFORE_HEAD):sn(e,t)}function uf(e,t){const n=t.tagID;(n===l.HTML||n===l.HEAD||n===l.BODY||n===l.BR)&&sn(e,t)}function sn(e,t){e._insertFakeRootElement(),e.insertionMode=T.BEFORE_HEAD,e._processToken(t)}function of(e,t){switch(t.tagID){case l.HTML:{_e(e,t);break}case l.HEAD:{e._insertElement(t,D.HTML),e.headElement=e.openElements.current,e.insertionMode=T.IN_HEAD;break}default:un(e,t)}}function lf(e,t){const n=t.tagID;n===l.HEAD||n===l.BODY||n===l.HTML||n===l.BR?un(e,t):e._err(t,S.endTagWithoutMatchingOpenElement)}function un(e,t){e._insertFakeElement(y.HEAD,l.HEAD),e.headElement=e.openElements.current,e.insertionMode=T.IN_HEAD,e._processToken(t)}function $e(e,t){switch(t.tagID){case l.HTML:{_e(e,t);break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:{e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.TITLE:{e._switchToTextParsing(t,pe.RCDATA);break}case l.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,pe.RAWTEXT):(e._insertElement(t,D.HTML),e.insertionMode=T.IN_HEAD_NO_SCRIPT);break}case l.NOFRAMES:case l.STYLE:{e._switchToTextParsing(t,pe.RAWTEXT);break}case l.SCRIPT:{e._switchToTextParsing(t,pe.SCRIPT_DATA);break}case l.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=T.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(T.IN_TEMPLATE);break}case l.HEAD:{e._err(t,S.misplacedStartTagForHeadElement);break}default:on(e,t)}}function cf(e,t){switch(t.tagID){case l.HEAD:{e.openElements.pop(),e.insertionMode=T.AFTER_HEAD;break}case l.BODY:case l.BR:case l.HTML:{on(e,t);break}case l.TEMPLATE:{Ct(e,t);break}default:e._err(t,S.endTagWithoutMatchingOpenElement)}}function Ct(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==l.TEMPLATE&&e._err(t,S.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,S.endTagWithoutMatchingOpenElement)}function on(e,t){e.openElements.pop(),e.insertionMode=T.AFTER_HEAD,e._processToken(t)}function hf(e,t){switch(t.tagID){case l.HTML:{_e(e,t);break}case l.BASEFONT:case l.BGSOUND:case l.HEAD:case l.LINK:case l.META:case l.NOFRAMES:case l.STYLE:{$e(e,t);break}case l.NOSCRIPT:{e._err(t,S.nestedNoscriptInHead);break}default:ln(e,t)}}function df(e,t){switch(t.tagID){case l.NOSCRIPT:{e.openElements.pop(),e.insertionMode=T.IN_HEAD;break}case l.BR:{ln(e,t);break}default:e._err(t,S.endTagWithoutMatchingOpenElement)}}function ln(e,t){const n=t.type===J.EOF?S.openElementsLeftAfterEof:S.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=T.IN_HEAD,e._processToken(t)}function ff(e,t){switch(t.tagID){case l.HTML:{_e(e,t);break}case l.BODY:{e._insertElement(t,D.HTML),e.framesetOk=!1,e.insertionMode=T.IN_BODY;break}case l.FRAMESET:{e._insertElement(t,D.HTML),e.insertionMode=T.IN_FRAMESET;break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{e._err(t,S.abandonedHeadElementChild),e.openElements.push(e.headElement,l.HEAD),$e(e,t),e.openElements.remove(e.headElement);break}case l.HEAD:{e._err(t,S.misplacedStartTagForHeadElement);break}default:cn(e,t)}}function pf(e,t){switch(t.tagID){case l.BODY:case l.HTML:case l.BR:{cn(e,t);break}case l.TEMPLATE:{Ct(e,t);break}default:e._err(t,S.endTagWithoutMatchingOpenElement)}}function cn(e,t){e._insertFakeElement(y.BODY,l.BODY),e.insertionMode=T.IN_BODY,hr(e,t)}function hr(e,t){switch(t.type){case J.CHARACTER:{Xu(e,t);break}case J.WHITESPACE_CHARACTER:{Qu(e,t);break}case J.COMMENT:{Zr(e,t);break}case J.START_TAG:{_e(e,t);break}case J.END_TAG:{dr(e,t);break}case J.EOF:{to(e,t);break}}}function Qu(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Xu(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function mf(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function gf(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Ef(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_FRAMESET)}function bf(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML)}function Tf(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Xr.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,D.HTML)}function xf(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function _f(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),n||(e.formElement=e.openElements.current))}function Af(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===l.LI&&i===l.LI||(n===l.DD||n===l.DT)&&(i===l.DD||i===l.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==l.ADDRESS&&i!==l.DIV&&i!==l.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML)}function kf(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),e.tokenizer.state=pe.PLAINTEXT}function Cf(e,t){e.openElements.hasInScope(l.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.framesetOk=!1}function yf(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(y.A);n&&(vi(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Nf(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function If(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(l.NOBR)&&(vi(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,D.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Sf(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function wf(e,t){e.treeAdapter.getDocumentMode(e.document)!==Me.QUIRKS&&e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),e.framesetOk=!1,e.insertionMode=T.IN_TABLE}function Zu(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,D.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ju(e){const t=ju(e,gt.TYPE);return t!=null&&t.toLowerCase()===Vd}function Lf(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,D.HTML),Ju(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function Of(e,t){e._appendElement(t,D.HTML),t.ackSelfClosing=!0}function Rf(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._appendElement(t,D.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Df(e,t){t.tagName=y.IMG,t.tagID=l.IMG,Zu(e,t)}function Pf(e,t){e._insertElement(t,D.HTML),e.skipNextNewLine=!0,e.tokenizer.state=pe.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=T.TEXT}function Mf(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,pe.RAWTEXT)}function vf(e,t){e.framesetOk=!1,e._switchToTextParsing(t,pe.RAWTEXT)}function Xa(e,t){e._switchToTextParsing(t,pe.RAWTEXT)}function Bf(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===T.IN_TABLE||e.insertionMode===T.IN_CAPTION||e.insertionMode===T.IN_TABLE_BODY||e.insertionMode===T.IN_ROW||e.insertionMode===T.IN_CELL?T.IN_SELECT_IN_TABLE:T.IN_SELECT}function Ff(e,t){e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML)}function Hf(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,D.HTML)}function Uf(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(l.RTC),e._insertElement(t,D.HTML)}function jf(e,t){e._reconstructActiveFormattingElements(),Wu(t),Mi(t),t.selfClosing?e._appendElement(t,D.MATHML):e._insertElement(t,D.MATHML),t.ackSelfClosing=!0}function zf(e,t){e._reconstructActiveFormattingElements(),Gu(t),Mi(t),t.selfClosing?e._appendElement(t,D.SVG):e._insertElement(t,D.SVG),t.ackSelfClosing=!0}function Za(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML)}function _e(e,t){switch(t.tagID){case l.I:case l.S:case l.B:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.SMALL:case l.STRIKE:case l.STRONG:{Nf(e,t);break}case l.A:{yf(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{Tf(e,t);break}case l.P:case l.DL:case l.OL:case l.UL:case l.DIV:case l.DIR:case l.NAV:case l.MAIN:case l.MENU:case l.ASIDE:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.DETAILS:case l.ADDRESS:case l.ARTICLE:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{bf(e,t);break}case l.LI:case l.DD:case l.DT:{Af(e,t);break}case l.BR:case l.IMG:case l.WBR:case l.AREA:case l.EMBED:case l.KEYGEN:{Zu(e,t);break}case l.HR:{Rf(e,t);break}case l.RB:case l.RTC:{Hf(e,t);break}case l.RT:case l.RP:{Uf(e,t);break}case l.PRE:case l.LISTING:{xf(e,t);break}case l.XMP:{Mf(e,t);break}case l.SVG:{zf(e,t);break}case l.HTML:{mf(e,t);break}case l.BASE:case l.LINK:case l.META:case l.STYLE:case l.TITLE:case l.SCRIPT:case l.BGSOUND:case l.BASEFONT:case l.TEMPLATE:{$e(e,t);break}case l.BODY:{gf(e,t);break}case l.FORM:{_f(e,t);break}case l.NOBR:{If(e,t);break}case l.MATH:{jf(e,t);break}case l.TABLE:{wf(e,t);break}case l.INPUT:{Lf(e,t);break}case l.PARAM:case l.TRACK:case l.SOURCE:{Of(e,t);break}case l.IMAGE:{Df(e,t);break}case l.BUTTON:{Cf(e,t);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{Sf(e,t);break}case l.IFRAME:{vf(e,t);break}case l.SELECT:{Bf(e,t);break}case l.OPTION:case l.OPTGROUP:{Ff(e,t);break}case l.NOEMBED:case l.NOFRAMES:{Xa(e,t);break}case l.FRAMESET:{Ef(e,t);break}case l.TEXTAREA:{Pf(e,t);break}case l.NOSCRIPT:{e.options.scriptingEnabled?Xa(e,t):Za(e,t);break}case l.PLAINTEXT:{kf(e,t);break}case l.COL:case l.TH:case l.TD:case l.TR:case l.HEAD:case l.FRAME:case l.TBODY:case l.TFOOT:case l.THEAD:case l.CAPTION:case l.COLGROUP:break;default:Za(e,t)}}function $f(e,t){if(e.openElements.hasInScope(l.BODY)&&(e.insertionMode=T.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Yf(e,t){e.openElements.hasInScope(l.BODY)&&(e.insertionMode=T.AFTER_BODY,lo(e,t))}function qf(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Vf(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(l.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(l.FORM):n&&e.openElements.remove(n))}function Wf(e){e.openElements.hasInButtonScope(l.P)||e._insertFakeElement(y.P,l.P),e._closePElement()}function Gf(e){e.openElements.hasInListItemScope(l.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(l.LI),e.openElements.popUntilTagNamePopped(l.LI))}function Kf(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Qf(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Xf(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Zf(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(y.BR,l.BR),e.openElements.pop(),e.framesetOk=!1}function eo(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const a=e.openElements.items[i],s=e.openElements.tagIDs[i];if(r===s&&(r!==l.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(a,s))break}}function dr(e,t){switch(t.tagID){case l.A:case l.B:case l.I:case l.S:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.NOBR:case l.SMALL:case l.STRIKE:case l.STRONG:{vi(e,t);break}case l.P:{Wf(e);break}case l.DL:case l.UL:case l.OL:case l.DIR:case l.DIV:case l.NAV:case l.PRE:case l.MAIN:case l.MENU:case l.ASIDE:case l.BUTTON:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.ADDRESS:case l.ARTICLE:case l.DETAILS:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.LISTING:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{qf(e,t);break}case l.LI:{Gf(e);break}case l.DD:case l.DT:{Kf(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{Qf(e);break}case l.BR:{Zf(e);break}case l.BODY:{$f(e,t);break}case l.HTML:{Yf(e,t);break}case l.FORM:{Vf(e);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{Xf(e,t);break}case l.TEMPLATE:{Ct(e,t);break}default:eo(e,t)}}function to(e,t){e.tmplInsertionModeStack.length>0?oo(e,t):Bi(e,t)}function Jf(e,t){var n;t.tagID===l.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function e0(e,t){e._err(t,S.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Ir(e,t){if(e.openElements.currentTagId!==void 0&&Ku.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=T.IN_TABLE_TEXT,t.type){case J.CHARACTER:{ro(e,t);break}case J.WHITESPACE_CHARACTER:{no(e,t);break}}else In(e,t)}function t0(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_CAPTION}function n0(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_COLUMN_GROUP}function r0(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(y.COLGROUP,l.COLGROUP),e.insertionMode=T.IN_COLUMN_GROUP,Fi(e,t)}function i0(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_TABLE_BODY}function a0(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(y.TBODY,l.TBODY),e.insertionMode=T.IN_TABLE_BODY,fr(e,t)}function s0(e,t){e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function u0(e,t){Ju(t)?e._appendElement(t,D.HTML):In(e,t),t.ackSelfClosing=!0}function o0(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,D.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Bt(e,t){switch(t.tagID){case l.TD:case l.TH:case l.TR:{a0(e,t);break}case l.STYLE:case l.SCRIPT:case l.TEMPLATE:{$e(e,t);break}case l.COL:{r0(e,t);break}case l.FORM:{o0(e,t);break}case l.TABLE:{s0(e,t);break}case l.TBODY:case l.TFOOT:case l.THEAD:{i0(e,t);break}case l.INPUT:{u0(e,t);break}case l.CAPTION:{t0(e,t);break}case l.COLGROUP:{n0(e,t);break}default:In(e,t)}}function Tn(e,t){switch(t.tagID){case l.TABLE:{e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode());break}case l.TEMPLATE:{Ct(e,t);break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:In(e,t)}}function In(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,hr(e,t),e.fosterParentingEnabled=n}function no(e,t){e.pendingCharacterTokens.push(t)}function ro(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Kt(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)In(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const io=new Set([l.CAPTION,l.COL,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]);function l0(e,t){const n=t.tagID;io.has(n)?e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=T.IN_TABLE,Bt(e,t)):_e(e,t)}function c0(e,t){const n=t.tagID;switch(n){case l.CAPTION:case l.TABLE:{e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=T.IN_TABLE,n===l.TABLE&&Tn(e,t));break}case l.BODY:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:dr(e,t)}}function Fi(e,t){switch(t.tagID){case l.HTML:{_e(e,t);break}case l.COL:{e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.TEMPLATE:{$e(e,t);break}default:Qn(e,t)}}function h0(e,t){switch(t.tagID){case l.COLGROUP:{e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=T.IN_TABLE);break}case l.TEMPLATE:{Ct(e,t);break}case l.COL:break;default:Qn(e,t)}}function Qn(e,t){e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=T.IN_TABLE,e._processToken(t))}function fr(e,t){switch(t.tagID){case l.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_ROW;break}case l.TH:case l.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(y.TR,l.TR),e.insertionMode=T.IN_ROW,pr(e,t);break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE,Bt(e,t));break}default:Bt(e,t)}}function Jr(e,t){const n=t.tagID;switch(t.tagID){case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE);break}case l.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE,Tn(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:case l.TR:break;default:Tn(e,t)}}function pr(e,t){switch(t.tagID){case l.TH:case l.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_CELL,e.activeFormattingElements.insertMarker();break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE_BODY,fr(e,t));break}default:Bt(e,t)}}function ao(e,t){switch(t.tagID){case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE_BODY);break}case l.TABLE:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE_BODY,Jr(e,t));break}case l.TBODY:case l.TFOOT:case l.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(l.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=T.IN_TABLE_BODY,Jr(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:break;default:Tn(e,t)}}function d0(e,t){const n=t.tagID;io.has(n)?(e.openElements.hasInTableScope(l.TD)||e.openElements.hasInTableScope(l.TH))&&(e._closeTableCell(),pr(e,t)):_e(e,t)}function f0(e,t){const n=t.tagID;switch(n){case l.TD:case l.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=T.IN_ROW);break}case l.TABLE:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),ao(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:break;default:dr(e,t)}}function so(e,t){switch(t.tagID){case l.HTML:{_e(e,t);break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._insertElement(t,D.HTML);break}case l.OPTGROUP:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._insertElement(t,D.HTML);break}case l.HR:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.INPUT:case l.KEYGEN:case l.TEXTAREA:case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),t.tagID!==l.SELECT&&e._processStartTag(t));break}case l.SCRIPT:case l.TEMPLATE:{$e(e,t);break}}}function uo(e,t){switch(t.tagID){case l.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===l.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===l.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop();break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop();break}case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode());break}case l.TEMPLATE:{Ct(e,t);break}}}function p0(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e._processStartTag(t)):so(e,t)}function m0(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e.onEndTag(t)):uo(e,t)}function g0(e,t){switch(t.tagID){case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{$e(e,t);break}case l.CAPTION:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.tmplInsertionModeStack[0]=T.IN_TABLE,e.insertionMode=T.IN_TABLE,Bt(e,t);break}case l.COL:{e.tmplInsertionModeStack[0]=T.IN_COLUMN_GROUP,e.insertionMode=T.IN_COLUMN_GROUP,Fi(e,t);break}case l.TR:{e.tmplInsertionModeStack[0]=T.IN_TABLE_BODY,e.insertionMode=T.IN_TABLE_BODY,fr(e,t);break}case l.TD:case l.TH:{e.tmplInsertionModeStack[0]=T.IN_ROW,e.insertionMode=T.IN_ROW,pr(e,t);break}default:e.tmplInsertionModeStack[0]=T.IN_BODY,e.insertionMode=T.IN_BODY,_e(e,t)}}function E0(e,t){t.tagID===l.TEMPLATE&&Ct(e,t)}function oo(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Bi(e,t)}function b0(e,t){t.tagID===l.HTML?_e(e,t):Xn(e,t)}function lo(e,t){var n;if(t.tagID===l.HTML){if(e.fragmentContext||(e.insertionMode=T.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===l.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else Xn(e,t)}function Xn(e,t){e.insertionMode=T.IN_BODY,hr(e,t)}function T0(e,t){switch(t.tagID){case l.HTML:{_e(e,t);break}case l.FRAMESET:{e._insertElement(t,D.HTML);break}case l.FRAME:{e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.NOFRAMES:{$e(e,t);break}}}function x0(e,t){t.tagID===l.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==l.FRAMESET&&(e.insertionMode=T.AFTER_FRAMESET))}function _0(e,t){switch(t.tagID){case l.HTML:{_e(e,t);break}case l.NOFRAMES:{$e(e,t);break}}}function A0(e,t){t.tagID===l.HTML&&(e.insertionMode=T.AFTER_AFTER_FRAMESET)}function k0(e,t){t.tagID===l.HTML?_e(e,t):Yn(e,t)}function Yn(e,t){e.insertionMode=T.IN_BODY,hr(e,t)}function C0(e,t){switch(t.tagID){case l.HTML:{_e(e,t);break}case l.NOFRAMES:{$e(e,t);break}}}function y0(e,t){t.chars=ce,e._insertCharacters(t)}function N0(e,t){e._insertCharacters(t),e.framesetOk=!1}function co(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==D.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function I0(e,t){if(jd(t))co(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===D.MATHML?Wu(t):r===D.SVG&&(zd(t),Gu(t)),Mi(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function S0(e,t){if(t.tagID===l.P||t.tagID===l.BR){co(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===D.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}y.AREA,y.BASE,y.BASEFONT,y.BGSOUND,y.BR,y.COL,y.EMBED,y.FRAME,y.HR,y.IMG,y.INPUT,y.KEYGEN,y.LINK,y.META,y.PARAM,y.SOURCE,y.TRACK,y.WBR;const mr=ho("end"),Ve=ho("start");function ho(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function fo(e){const t=Ve(e),n=mr(e);if(t&&n)return{start:t,end:n}}const w0=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,L0=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Ja={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function po(e,t){const n=U0(e),r=vu("type",{handlers:{root:O0,element:R0,text:D0,comment:go,doctype:P0,raw:v0},unknown:B0}),i={parser:n?new Qa(Ja):Qa.getFragmentParser(void 0,Ja),handle(u){r(u,i)},stitches:!1,options:t||{}};r(e,i),zt(i,Ve());const a=n?i.parser.document:i.parser.getFragment(),s=Uh(a,{file:i.options.file});return i.stitches&&st(s,"comment",function(u,o,c){const h=u;if(h.value.stitch&&c&&o!==void 0){const d=c.children;return d[o]=h.value.stitch,o}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function mo(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function O0(e,t){mo(e.children,t)}function R0(e,t){F0(e,t),mo(e.children,t),H0(e,t)}function D0(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:J.CHARACTER,chars:e.value,location:Sn(e)};zt(t,Ve(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function P0(e,t){const n={type:J.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Sn(e)};zt(t,Ve(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function M0(e,t){t.stitches=!0;const n=j0(e);if("children"in e&&"children"in n){const r=po({type:"root",children:e.children},t.options);n.children=r.children}go({type:"comment",value:{stitch:n}},t)}function go(e,t){const n=e.value,r={type:J.COMMENT,data:n,location:Sn(e)};zt(t,Ve(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function v0(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Eo(t,Ve(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(w0,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function B0(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))M0(n,t);else{let r="";throw L0.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function zt(e,t){Eo(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=pe.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function Eo(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function F0(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===pe.PLAINTEXT)return;zt(t,Ve(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:mt.html;i===mt.html&&n==="svg"&&(i=mt.svg);const a=qh({...e,children:[]},{space:i===mt.svg?"svg":"html"}),s={type:J.START_TAG,tagName:n,tagID:jt(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Sn(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function H0(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Jh.includes(n)||t.parser.tokenizer.state===pe.PLAINTEXT)return;zt(t,mr(e));const r={type:J.END_TAG,tagName:n,tagID:jt(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Sn(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===pe.RCDATA||t.parser.tokenizer.state===pe.RAWTEXT||t.parser.tokenizer.state===pe.SCRIPT_DATA)&&(t.parser.tokenizer.state=pe.DATA)}function U0(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Sn(e){const t=Ve(e)||{line:void 0,column:void 0,offset:void 0},n=mr(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function j0(e){return"children"in e?bt({...e,children:[]}):bt(e)}function ei(e){return function(t,n){return po(t,{...e,file:n})}}const dt=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],hn={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...dt,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...dt],h2:[["className","sr-only"]],img:[...dt,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...dt,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...dt],table:[...dt],ul:[...dt,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},it={}.hasOwnProperty;function z0(e,t){let n={type:"root",children:[]};const r={schema:t?{...hn,...t}:hn,stack:[]},i=bo(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function bo(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return $0(e,n);case"doctype":return Y0(e,n);case"element":return q0(e,n);case"root":return V0(e,n);case"text":return W0(e,n)}}}function $0(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return wn(a,t),a}}function Y0(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return wn(n,t),n}}function q0(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=To(e,t.children),i=G0(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&it.call(e.schema.ancestors,n))){const u=e.schema.ancestors[n];let o=-1;for(a=!1;++o<u.length;)e.stack.includes(u[o])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const s={type:"element",tagName:n,properties:i,children:r};return wn(s,t),s}function V0(e,t){const r={type:"root",children:To(e,t.children)};return wn(r,t),r}function W0(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return wn(r,t),r}function To(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const a=bo(e,r[i]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function G0(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&it.call(r,n)?r[n]:void 0,s=r&&it.call(r,"*")?r["*"]:void 0,u=t&&typeof t=="object"?t:{},o={};let c;for(c in u)if(it.call(u,c)){const h=u[c];let d=es(e,ts(a,c),c,h);d==null&&(d=es(e,ts(s,c),c,h)),d!=null&&(o[c]=d)}if(i&&it.call(i,n)){const h=i[n];for(c in h)it.call(h,c)&&!it.call(o,c)&&(o[c]=h[c])}return o}function es(e,t,n,r){return t?Array.isArray(r)?K0(e,t,n,r):xo(e,t,n,r):void 0}function K0(e,t,n,r){let i=-1;const a=[];for(;++i<r.length;){const s=xo(e,t,n,r[i]);(typeof s=="number"||typeof s=="string")&&a.push(s)}return a}function xo(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&Q0(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,a=0;for(;++a<t.length;){const s=t[a];if(s&&typeof s=="object"&&"flags"in s){if(s.test(String(r))){i=!0;break}}else if(s===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Q0(e,t,n){const r=e.schema.protocols&&it.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),a=i.indexOf(":"),s=i.indexOf("?"),u=i.indexOf("#"),o=i.indexOf("/");if(a<0||o>-1&&a>o||s>-1&&a>s||u>-1&&a>u)return!0;let c=-1;for(;++c<r.length;){const h=r[c];if(a===h.length&&i.slice(0,h.length)===h)return!0}return!1}function wn(e,t){const n=fo(t);t.data&&(e.data=bt(t.data)),n&&(e.position=n)}function ts(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],a=typeof i=="string"?i:i[0];if(a===t)return i;a==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function _o(e){return function(t){return z0(t,e)}}function ns(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Ce=lt(/[A-Za-z]/),xe=lt(/[\dA-Za-z]/),X0=lt(/[#-'*+\--9=?A-Z^-~]/);function Zn(e){return e!==null&&(e<32||e===127)}const ti=lt(/\d/),Z0=lt(/[\dA-Fa-f]/),J0=lt(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function oe(e){return e!==null&&(e<0||e===32)}function ee(e){return e===-2||e===-1||e===32}const gr=lt(new RegExp("\\p{P}|\\p{S}","u")),Tt=lt(/\s/);function lt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ep(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function tp(e,t,n){const i=ur((n||{}).ignore||[]),a=np(t);let s=-1;for(;++s<a.length;)Ii(e,"text",u);function u(c,h){let d=-1,f;for(;++d<h.length;){const p=h[d],E=f?f.children:void 0;if(i(p,E?E.indexOf(p):void 0,f))return;f=p}if(f)return o(c,h)}function o(c,h){const d=h[h.length-1],f=a[s][0],p=a[s][1];let E=0;const N=d.children.indexOf(c);let k=!1,O=[];f.lastIndex=0;let L=f.exec(c.value);for(;L;){const H=L.index,j={index:L.index,input:L.input,stack:[...h,c]};let w=p(...L,j);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?f.lastIndex=H+1:(E!==H&&O.push({type:"text",value:c.value.slice(E,H)}),Array.isArray(w)?O.push(...w):w&&O.push(w),E=H+L[0].length,k=!0),!f.global)break;L=f.exec(c.value)}return k?(E<c.value.length&&O.push({type:"text",value:c.value.slice(E)}),d.children.splice(N,1,...O)):O=[c],N+O.length}}function np(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([rp(i[0]),ip(i[1])])}return t}function rp(e){return typeof e=="string"?new RegExp(ep(e),"g"):e}function ip(e){return typeof e=="function"?e:function(){return e}}const Sr="phrasing",wr=["autolink","link","image","label"];function ap(){return{transforms:[dp],enter:{literalAutolink:up,literalAutolinkEmail:Lr,literalAutolinkHttp:Lr,literalAutolinkWww:Lr},exit:{literalAutolink:hp,literalAutolinkEmail:cp,literalAutolinkHttp:op,literalAutolinkWww:lp}}}function sp(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Sr,notInConstruct:wr},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Sr,notInConstruct:wr},{character:":",before:"[ps]",after:"\\/",inConstruct:Sr,notInConstruct:wr}]}}function up(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Lr(e){this.config.enter.autolinkProtocol.call(this,e)}function op(e){this.config.exit.autolinkProtocol.call(this,e)}function lp(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function cp(e){this.config.exit.autolinkEmail.call(this,e)}function hp(e){this.exit(e)}function dp(e){tp(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,fp],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),pp]],{ignore:["link","linkReference"]})}function fp(e,t,n,r,i){let a="";if(!Ao(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!mp(n)))return!1;const s=gp(n+r);if(!s[0])return!1;const u={type:"link",title:null,url:a+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[u,{type:"text",value:s[1]}]:u}function pp(e,t,n,r){return!Ao(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function mp(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function gp(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ns(e,"(");let a=ns(e,")");for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function Ao(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Tt(n)||gr(n))&&(!t||n!==47)}function ze(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}ko.peek=yp;function Ep(){this.buffer()}function bp(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Tp(){this.buffer()}function xp(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function _p(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ze(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ap(e){this.exit(e)}function kp(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ze(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Cp(e){this.exit(e)}function yp(){return"["}function ko(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const s=n.enter("footnoteReference"),u=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),u(),s(),a+=i.move("]"),a}function Np(){return{enter:{gfmFootnoteCallString:Ep,gfmFootnoteCall:bp,gfmFootnoteDefinitionLabelString:Tp,gfmFootnoteDefinition:xp},exit:{gfmFootnoteCallString:_p,gfmFootnoteCall:Ap,gfmFootnoteDefinitionLabelString:kp,gfmFootnoteDefinition:Cp}}}function Ip(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:ko},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,s){const u=a.createTracker(s);let o=u.move("[^");const c=a.enter("footnoteDefinition"),h=a.enter("label");return o+=u.move(a.safe(a.associationId(r),{before:o,after:"]"})),h(),o+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),o+=u.move((t?`
|
|
4
4
|
`:" ")+a.indentLines(a.containerFlow(r,u.current()),t?Co:Sp))),c(),o}}function Sp(e,t,n){return t===0?e:Co(e,t,n)}function Co(e,t,n){return(n?"":" ")+e}const wp=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];yo.peek=Pp;function Lp(){return{canContainEols:["delete"],enter:{strikethrough:Rp},exit:{strikethrough:Dp}}}function Op(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wp}],handlers:{delete:yo}}}function Rp(e){this.enter({type:"delete",children:[]},e)}function Dp(e){this.exit(e)}function yo(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function Pp(){return"~"}function Mp(e){return e.length}function vp(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Mp,a=[],s=[],u=[],o=[];let c=0,h=-1;for(;++h<e.length;){const A=[],N=[];let k=-1;for(e[h].length>c&&(c=e[h].length);++k<e[h].length;){const O=Bp(e[h][k]);if(n.alignDelimiters!==!1){const L=i(O);N[k]=L,(o[k]===void 0||L>o[k])&&(o[k]=L)}A.push(O)}s[h]=A,u[h]=N}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)a[d]=rs(r[d]);else{const A=rs(r);for(;++d<c;)a[d]=A}d=-1;const f=[],p=[];for(;++d<c;){const A=a[d];let N="",k="";A===99?(N=":",k=":"):A===108?N=":":A===114&&(k=":");let O=n.alignDelimiters===!1?1:Math.max(1,o[d]-N.length-k.length);const L=N+"-".repeat(O)+k;n.alignDelimiters!==!1&&(O=N.length+O+k.length,O>o[d]&&(o[d]=O),p[d]=O),f[d]=L}s.splice(1,0,f),u.splice(1,0,p),h=-1;const E=[];for(;++h<s.length;){const A=s[h],N=u[h];d=-1;const k=[];for(;++d<c;){const O=A[d]||"";let L="",H="";if(n.alignDelimiters!==!1){const j=o[d]-(N[d]||0),w=a[d];w===114?L=" ".repeat(j):w===99?j%2?(L=" ".repeat(j/2+.5),H=" ".repeat(j/2-.5)):(L=" ".repeat(j/2),H=L):H=" ".repeat(j)}n.delimiterStart!==!1&&!d&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&O==="")&&(n.delimiterStart!==!1||d)&&k.push(" "),n.alignDelimiters!==!1&&k.push(L),k.push(O),n.alignDelimiters!==!1&&k.push(H),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&k.push("|")}E.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return E.join(`
|
|
5
5
|
`)}function Bp(e){return e==null?"":String(e)}function rs(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Fp(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const s=n.indentLines(n.containerFlow(e,a.current()),Hp);return i(),s}function Hp(e,t,n){return">"+(n?"":" ")+e}function Up(e,t){return is(e,t.inConstruct,!0)&&!is(e,t.notInConstruct,!1)}function is(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function as(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
@@ -113,8 +113,8 @@ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error
|
|
|
113
113
|
`||h==="\r"){o=!0;break}if(!o)return u;let c=[];for(let h of u)h===" "?c.push("\\t"):h===`
|
|
114
114
|
`?c.push("\\n"):h==="\r"?c.push("\\r"):c.push(h);return c.join("")},i=t.length>0?n.length+1:n.length,a=new Array(i),s=0;t.length>0&&(a[s]=t.map(r).join(" "),s+=1);for(let u of n)a[s]=u.map(r).join(" "),s+=1;return a.join(`
|
|
115
115
|
`)},qr=e=>{let t=!1;for(let r of e)if(r==="\\"||r==="|"){t=!0;break}if(!t)return e;let n=[];for(let r of e)r==="\\"?n.push("\\\\"):r==="|"?n.push("\\|"):n.push(r);return n.join("")},cx=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,a=t.map(u=>qr(u));r[i]=`| ${a.join(" | ")} |`,i+=1;let s=new Array(t.length);for(let u=0;u<t.length;u+=1)s[u]="---";r[i]=`| ${s.join(" | ")} |`,i+=1;for(let u of n)if(u.length<t.length){let o=new Array(t.length);for(let c=0;c<t.length;c+=1)o[c]=c<u.length?qr(u[c]):"";r[i]=`| ${o.join(" | ")} |`,i+=1}else{let o=u.map(c=>qr(c));r[i]=`| ${o.join(" | ")} |`,i+=1}return r.join(`
|
|
116
|
-
`)},hx=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let[a,s]=C.useState(!1),[u,o]=C.useState(!1),c=C.useRef(null),h=C.useRef(0),{isAnimating:d}=C.useContext(Fe),f=async E=>{var A,N;if(typeof window>"u"||!((A=navigator?.clipboard)!=null&&A.write)){r?.(new Error("Clipboard API not available"));return}try{let k=(N=c.current)==null?void 0:N.closest('[data-streamdown="table-wrapper"]'),O=k?.querySelector("table");if(!O){r?.(new Error("Table not found"));return}let L=Pl(O),H=E==="csv"?Ml(L):lx(L),j=new ClipboardItem({"text/plain":new Blob([H],{type:"text/plain"}),"text/html":new Blob([O.outerHTML],{type:"text/html"})});await navigator.clipboard.write([j]),o(!0),s(!1),n?.(E),h.current=window.setTimeout(()=>o(!1),i)}catch(k){r?.(k)}};C.useEffect(()=>{let E=A=>{let N=A.composedPath();c.current&&!N.includes(c.current)&&s(!1)};return document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E),window.clearTimeout(h.current)}},[]);let p=u?aa:sa;return m.jsxs("div",{className:"relative",ref:c,children:[m.jsx("button",{className:V("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>s(!a),title:"Copy table",type:"button",children:e??m.jsx(p,{size:14})}),a?m.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[m.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),m.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},dx=({children:e,className:t,onDownload:n,onError:r})=>{let[i,a]=C.useState(!1),s=C.useRef(null),{isAnimating:u}=C.useContext(Fe),o=c=>{var h;try{let d=(h=s.current)==null?void 0:h.closest('[data-streamdown="table-wrapper"]'),f=d?.querySelector("table");if(!f){r?.(new Error("Table not found"));return}let p=Pl(f),E=c==="csv"?Ml(p):cx(p);vt(`table.${c==="csv"?"csv":"md"}`,E,c==="csv"?"text/csv":"text/markdown"),a(!1),n?.(c)}catch(d){r?.(d)}};return C.useEffect(()=>{let c=h=>{let d=h.composedPath();s.current&&!d.includes(s.current)&&a(!1)};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[]),m.jsxs("div",{className:"relative",ref:s,children:[m.jsx("button",{className:V("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:()=>a(!i),title:"Download table",type:"button",children:e??m.jsx(_r,{size:14})}),i?m.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[m.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>o("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),m.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>o("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},fx=({children:e,className:t,showControls:n,...r})=>m.jsxs("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[n?m.jsxs("div",{className:"flex items-center justify-end gap-1",children:[m.jsx(hx,{}),m.jsx(dx,{})]}):null,m.jsx("div",{className:"overflow-x-auto overscroll-y-auto",children:m.jsx("table",{className:V("w-full border-collapse border border-border",t),"data-streamdown":"table",...r,children:e})})]}),px=C.lazy(()=>Ni(()=>import("./code-block-OCS4YCEC-B1YC7dLa.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeBlock}))),mx=C.lazy(()=>Ni(()=>Promise.resolve().then(()=>e3),void 0).then(e=>({default:e.Mermaid}))),gx=/language-([^\s]+)/;function Ar(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function fe(e,t){return e.className===t.className&&Ar(e.node,t.node)}var fi=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,Un=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},oa=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("ol",{className:V("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e}),(e,t)=>fe(e,t));oa.displayName="MarkdownOl";var vl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("li",{className:V("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e}),(e,t)=>e.className===t.className&&Ar(e.node,t.node));vl.displayName="MarkdownLi";var Bl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("ul",{className:V("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e}),(e,t)=>fe(e,t));Bl.displayName="MarkdownUl";var Fl=C.memo(({className:e,node:t,...n})=>m.jsx("hr",{className:V("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n}),(e,t)=>fe(e,t));Fl.displayName="MarkdownHr";var Hl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("span",{className:V("font-semibold",t),"data-streamdown":"strong",...r,children:e}),(e,t)=>fe(e,t));Hl.displayName="MarkdownStrong";var Ex=({children:e,className:t,href:n,node:r,...i})=>{let{linkSafety:a}=C.useContext(Fe),[s,u]=C.useState(!1),o=n==="streamdown:incomplete-link",c=C.useCallback(async p=>{if(!(!(a!=null&&a.enabled&&n)||o)){if(p.preventDefault(),a.onLinkCheck&&await a.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}u(!0)}},[a,n,o]),h=C.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),d=C.useCallback(()=>{u(!1)},[]),f={url:n??"",isOpen:s,onClose:d,onConfirm:h};return a!=null&&a.enabled&&n?m.jsxs(m.Fragment,{children:[m.jsx("button",{className:V("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":o,"data-streamdown":"link",onClick:c,type:"button",children:e}),a.renderModal?a.renderModal(f):m.jsx(rx,{...f})]}):m.jsx("a",{className:V("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":o,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},Ul=C.memo(Ex,(e,t)=>fe(e,t)&&e.href===t.href);Ul.displayName="MarkdownA";var jl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("h1",{className:V("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e}),(e,t)=>fe(e,t));jl.displayName="MarkdownH1";var zl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("h2",{className:V("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e}),(e,t)=>fe(e,t));zl.displayName="MarkdownH2";var $l=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("h3",{className:V("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e}),(e,t)=>fe(e,t));$l.displayName="MarkdownH3";var Yl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("h4",{className:V("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e}),(e,t)=>fe(e,t));Yl.displayName="MarkdownH4";var ql=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("h5",{className:V("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e}),(e,t)=>fe(e,t));ql.displayName="MarkdownH5";var Vl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("h6",{className:V("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e}),(e,t)=>fe(e,t));Vl.displayName="MarkdownH6";var Wl=C.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=C.useContext(Fe),a=fi(i,"table");return m.jsx(fx,{className:t,showControls:a,...r,children:e})},(e,t)=>fe(e,t));Wl.displayName="MarkdownTable";var Gl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("thead",{className:V("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e}),(e,t)=>fe(e,t));Gl.displayName="MarkdownThead";var Kl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("tbody",{className:V("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...r,children:e}),(e,t)=>fe(e,t));Kl.displayName="MarkdownTbody";var Ql=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("tr",{className:V("border-border border-b",t),"data-streamdown":"table-row",...r,children:e}),(e,t)=>fe(e,t));Ql.displayName="MarkdownTr";var Xl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("th",{className:V("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e}),(e,t)=>fe(e,t));Xl.displayName="MarkdownTh";var Zl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("td",{className:V("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e}),(e,t)=>fe(e,t));Zl.displayName="MarkdownTd";var Jl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("blockquote",{className:V("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e}),(e,t)=>fe(e,t));Jl.displayName="MarkdownBlockquote";var ec=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("sup",{className:V("text-sm",t),"data-streamdown":"superscript",...r,children:e}),(e,t)=>fe(e,t));ec.displayName="MarkdownSup";var tc=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("sub",{className:V("text-sm",t),"data-streamdown":"subscript",...r,children:e}),(e,t)=>fe(e,t));tc.displayName="MarkdownSub";var nc=C.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=s=>{var u,o;if(!C.isValidElement(s))return!1;let c=Array.isArray(s.props.children)?s.props.children:[s.props.children],h=!1,d=!1;for(let f of c)if(f){if(typeof f=="string")f.trim()!==""&&(h=!0);else if(C.isValidElement(f))if(((u=f.props)==null?void 0:u["data-footnote-backref"])!==void 0)d=!0;else{let p=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let E of p){if(typeof E=="string"&&E.trim()!==""){h=!0;break}if(C.isValidElement(E)&&((o=E.props)==null?void 0:o["data-footnote-backref"])===void 0){h=!0;break}}}}return d&&!h},a=Array.isArray(e)?e.map(s=>{if(!C.isValidElement(s))return s;if(s.type===oa){let u=(Array.isArray(s.props.children)?s.props.children:[s.props.children]).filter(o=>!i(o));return u.length===0?null:{...s,props:{...s.props,children:u}}}return s}):e;return(Array.isArray(a)?a.some(s=>s!==null):a!==null)?m.jsx("section",{className:t,...r,children:a}):null}return m.jsx("section",{className:t,...r,children:e})},(e,t)=>fe(e,t));nc.displayName="MarkdownSection";var bx=({node:e,className:t,children:n,...r})=>{var i;let a=!("data-block"in r),{mermaid:s,controls:u}=C.useContext(Fe),o=ua();if(a)return m.jsx("code",{className:V("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let c=t?.match(gx),h=(i=c?.at(1))!=null?i:"",d="";if(C.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?d=n.props.children:typeof n=="string"&&(d=n),h==="mermaid"&&o){let p=fi(u,"mermaid"),E=Un(u,"download"),A=Un(u,"copy"),N=Un(u,"fullscreen"),k=Un(u,"panZoom"),O=p&&(E||A||N);return m.jsx(C.Suspense,{fallback:m.jsx(Xs,{}),children:m.jsxs("div",{className:V("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[O?m.jsxs("div",{className:"flex items-center justify-end gap-2",children:[E?m.jsx(ax,{chart:d,config:s?.config}):null,A?m.jsx(Ks,{code:d}):null,N?m.jsx(ox,{chart:d,config:s?.config}):null]}):null,m.jsx(mx,{chart:d,config:s?.config,showControls:k})]})})}let f=fi(u,"code");return m.jsx(C.Suspense,{fallback:m.jsx(Xs,{}),children:m.jsx(px,{className:V("overflow-x-auto border-border border-t",t),code:d,language:h,children:f?m.jsxs(m.Fragment,{children:[m.jsx(Z2,{code:d,language:h}),m.jsx(Ks,{})]}):null})})},rc=C.memo(bx,(e,t)=>e.className===t.className&&Ar(e.node,t.node));rc.displayName="MarkdownCode";var ic=C.memo(ex,(e,t)=>e.className===t.className&&Ar(e.node,t.node));ic.displayName="MarkdownImg";var ac=C.memo(({children:e,className:t,node:n,...r})=>{let i=(Array.isArray(e)?e:[e]).filter(a=>a!=null&&a!=="");if(i.length===1&&C.isValidElement(i[0])){let a=i[0].props.node,s=a?.tagName;if(s==="img")return m.jsx(m.Fragment,{children:e});if(s==="code"&&"data-block"in i[0].props)return m.jsx(m.Fragment,{children:e})}return m.jsx("p",{className:t,...r,children:e})},(e,t)=>fe(e,t));ac.displayName="MarkdownParagraph";var Tx={ol:oa,li:vl,ul:Bl,hr:Fl,strong:Hl,a:Ul,h1:jl,h2:zl,h3:$l,h4:Yl,h5:ql,h6:Vl,table:Wl,thead:Gl,tbody:Kl,tr:Ql,th:Xl,td:Zl,blockquote:Jl,code:rc,img:ic,pre:({children:e})=>C.isValidElement(e)?C.cloneElement(e,{"data-block":"true"}):e,sup:ec,sub:tc,p:ac,section:nc},xx=()=>e=>{st(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},Zs=[],Js={allowDangerousHtml:!0},jn=new WeakMap,_x=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let h="default";return this.keyCache.set(e,h),h}let a=h=>{if(!h||h.length===0)return"";let d="";for(let f=0;f<h.length;f+=1){let p=h[f];if(f>0&&(d+=","),Array.isArray(p)){let[E,A]=p;if(typeof E=="function"){let N=jn.get(E);N||(N=E.name,jn.set(E,N)),d+=N}else d+=String(E);d+=":",d+=JSON.stringify(A)}else if(typeof p=="function"){let E=jn.get(p);E||(E=p.name,jn.set(p,E)),d+=E}else d+=String(p)}return d},s=a(n),u=a(r),o=i?JSON.stringify(i):"",c=`${u}::${s}::${o}`;return this.keyCache.set(e,c),c}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},eu=new _x,sc=e=>{let t=Ax(e),n=e.children||"";return wx(t.runSync(t.parse(n),n),e)},Ax=e=>{let t=eu.get(e);if(t)return t;let n=Cx(e);return eu.set(e,n),n},kx=e=>e.some(t=>Array.isArray(t)?t[0]===ei:t===ei),Cx=e=>{let t=e.rehypePlugins||Zs,n=e.remarkPlugins||Zs,r=kx(t)?n:[...n,xx],i=e.remarkRehypeOptions?{...Js,...e.remarkRehypeOptions}:Js;return WT().use(Vb).use(r).use(ST,i).use(t)},yx=e=>e,Nx=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},Ix=(e,t)=>{var n;for(let r in vr)if(Object.hasOwn(vr,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],a=vr[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},Sx=(e,t,n,r,i,a)=>{let s=!1;return r?s=!r.includes(e.tagName):i&&(s=i.includes(e.tagName)),!s&&a&&typeof t=="number"&&(s=!a(e,t,n)),s},wx=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:s,urlTransform:u}=t;if(n||r||i||a||u){let o=u||yx;st(e,(c,h,d)=>{if(c.type==="raw"&&d&&typeof h=="number")return Nx(d,h,a,c.value),h;if(c.type==="element"&&(Ix(c,o),Sx(c,h,d,r,i,n)&&d&&typeof h=="number"))return s&&c.children?d.children.splice(h,1,...c.children):d.children.splice(h,1),h})}return eb(e,{Fragment:m.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0})},Lx=/\[\^[\w-]{1,200}\](?!:)/,Ox=/\[\^[\w-]{1,200}\]:/,Rx=/<\/(\w+)>/,Dx=/<(\w+)[\s>]/,Px=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mx=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},vx=e=>{let t=Lx.test(e),n=Ox.test(e);if(t||n)return[e];let r=Be.lex(e,{gfm:!0}),i=[],a=[],s=!1;for(let u of r){let o=u.raw,c=i.length;if(a.length>0){if(i[c-1]+=o,u.type==="html"){let h=o.match(Rx);if(h){let d=h[1];a.at(-1)===d&&a.pop()}}continue}if(u.type==="html"&&u.block){let h=o.match(Dx);if(h){let d=h[1];o.includes(`</${d}>`)||Px.has(d.toLowerCase())||a.push(d)}}if(c>0&&!s){let h=i[c-1];if(Mx(h)%2===1){i[c-1]=h+o;continue}}i.push(o),u.type!=="space"&&(s=u.type==="code")}return i},tu,nu,Vn={...hn,protocols:{...hn.protocols,href:[...(nu=(tu=hn.protocols)==null?void 0:tu.href)!=null?nu:[],"tel"]}},pi={raw:ei,sanitize:[_o,Vn],harden:[fh,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},Bx={gfm:[Lg,{}]},ru=Object.values(pi),Fx=Object.values(Bx),Hx={block:" ▋",circle:" ●"},Ux={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},Fe=C.createContext(Ux),uc=C.memo(({content:e,shouldParseIncompleteMarkdown:t,index:n,...r})=>m.jsx(sc,{...r,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var a,s;return((a=e.components)==null?void 0:a[i])!==((s=t.components)==null?void 0:s[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});uc.displayName="Block";var jx=["github-light","github-dark"],oc=C.memo(({children:e,mode:t="streaming",parseIncompleteMarkdown:n=!0,components:r,rehypePlugins:i=ru,remarkPlugins:a=Fx,className:s,shikiTheme:u=jx,mermaid:o,controls:c=!0,isAnimating:h=!1,animated:d,BlockComponent:f=uc,parseMarkdownIntoBlocksFn:p=vx,caret:E,plugins:A,remend:N,linkSafety:k={enabled:!0},allowedTags:O,...L})=>{let H=C.useId(),[j,w]=C.useTransition(),G=C.useMemo(()=>typeof e!="string"?"":t==="streaming"&&n?FE(e,N):e,[e,t,n,N]),W=C.useMemo(()=>p(G),[G,p]),[X,I]=C.useState(W);C.useEffect(()=>{t==="streaming"?w(()=>{I(W)}):I(W)},[W,t]);let U=t==="streaming"?X:W,v=C.useMemo(()=>U.map((ae,x)=>`${H}-${x}`),[U.length,H]),q=C.useMemo(()=>d?d===!0?hi():hi(d):null,[d]),z=C.useMemo(()=>{var ae,x;return{shikiTheme:(x=(ae=A?.code)==null?void 0:ae.getThemes())!=null?x:u,controls:c,isAnimating:h,mode:t,mermaid:o,linkSafety:k}},[u,c,h,t,o,k,A?.code]),F=C.useMemo(()=>({...Tx,...r}),[r]),ie=C.useMemo(()=>{let ae=[];return A!=null&&A.cjk&&(ae=[...ae,...A.cjk.remarkPluginsBefore]),ae=[...ae,...a],A!=null&&A.cjk&&(ae=[...ae,...A.cjk.remarkPluginsAfter]),A!=null&&A.math&&(ae=[...ae,A.math.remarkPlugin]),ae},[a,A?.math,A?.cjk]),he=C.useMemo(()=>{var ae;let x=i;if(O&&Object.keys(O).length>0&&i===ru){let Le={...Vn,tagNames:[...(ae=Vn.tagNames)!=null?ae:[],...Object.keys(O)],attributes:{...Vn.attributes,...O}};x=[pi.raw,[_o,Le],pi.harden]}return A!=null&&A.math&&(x=[...x,A.math.rehypePlugin]),q&&h&&(x=[...x,q.rehypePlugin]),x},[i,A?.math,q,h,O]),we=C.useMemo(()=>E&&h?{"--streamdown-caret":`"${Hx[E]}"`}:void 0,[E,h]);return t==="static"?m.jsx(di.Provider,{value:A??null,children:m.jsx(Fe.Provider,{value:z,children:m.jsx("div",{className:V("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",s),children:m.jsx(sc,{components:F,rehypePlugins:he,remarkPlugins:ie,...L,children:e})})})}):m.jsx(di.Provider,{value:A??null,children:m.jsx(Fe.Provider,{value:z,children:m.jsxs("div",{className:V("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",E?"*:last:after:inline *:last:after:align-baseline *:last:after:content-[var(--streamdown-caret)]":null,s),style:we,children:[U.length===0&&E&&h&&m.jsx("span",{}),U.map((ae,x)=>m.jsx(f,{components:F,content:ae,index:x,rehypePlugins:he,remarkPlugins:ie,shouldParseIncompleteMarkdown:n,...L},v[x]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);oc.displayName="Streamdown";var zx=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:s=1,fullscreen:u=!1})=>{let o=C.useRef(null),c=C.useRef(null),[h,d]=C.useState(s),[f,p]=C.useState({x:0,y:0}),[E,A]=C.useState(!1),[N,k]=C.useState({x:0,y:0}),[O,L]=C.useState({x:0,y:0}),H=C.useCallback(v=>{d(q=>Math.max(n,Math.min(r,q+v)))},[n,r]),j=C.useCallback(()=>{H(i)},[H,i]),w=C.useCallback(()=>{H(-i)},[H,i]),G=C.useCallback(()=>{d(s),p({x:0,y:0})},[s]),W=C.useCallback(v=>{v.preventDefault();let q=v.deltaY>0?-i:i;H(q)},[H,i]),X=C.useCallback(v=>{if(v.button!==0||v.isPrimary===!1)return;A(!0),k({x:v.clientX,y:v.clientY}),L(f);let q=v.currentTarget;q instanceof HTMLElement&&q.setPointerCapture(v.pointerId)},[f]),I=C.useCallback(v=>{if(!E)return;v.preventDefault();let q=v.clientX-N.x,z=v.clientY-N.y;p({x:O.x+q,y:O.y+z})},[E,N,O]),U=C.useCallback(v=>{A(!1);let q=v.currentTarget;q instanceof HTMLElement&&q.releasePointerCapture(v.pointerId)},[]);return C.useEffect(()=>{let v=o.current;if(v)return v.addEventListener("wheel",W,{passive:!1}),()=>{v.removeEventListener("wheel",W)}},[W]),C.useEffect(()=>{let v=c.current;if(v&&E)return document.body.style.userSelect="none",v.addEventListener("pointermove",I,{passive:!1}),v.addEventListener("pointerup",U),v.addEventListener("pointercancel",U),()=>{document.body.style.userSelect="",v.removeEventListener("pointermove",I),v.removeEventListener("pointerup",U),v.removeEventListener("pointercancel",U)}},[E,I,U]),m.jsxs("div",{className:V("relative flex flex-col",u?"h-full w-full":"min-h-28 w-full",t),ref:o,style:{cursor:E?"grabbing":"grab"},children:[a?m.jsxs("div",{className:V("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",u?"bottom-4 left-4":"bottom-2 left-2"),children:[m.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:h>=r,onClick:j,title:"Zoom in",type:"button",children:m.jsx(K2,{size:16})}),m.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:h<=n,onClick:w,title:"Zoom out",type:"button",children:m.jsx(Q2,{size:16})}),m.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:G,title:"Reset zoom and pan",type:"button",children:m.jsx(G2,{size:16})})]}):null,m.jsx("div",{className:V("flex-1 origin-center transition-transform duration-150 ease-out",u?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:X,ref:c,role:"application",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${h})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},lc=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[a,s]=C.useState(null),[u,o]=C.useState(!1),[c,h]=C.useState(""),[d,f]=C.useState(""),[p,E]=C.useState(0),{mermaid:A}=C.useContext(Fe),N=ua(),k=A?.errorComponent,{shouldRender:O,containerRef:L}=B2({immediate:r});if(C.useEffect(()=>{if(O){if(!N){s("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{s(null),o(!0);let j=N.getMermaid(n),w=e.split("").reduce((X,I)=>(X<<5)-X+I.charCodeAt(0)|0,0),G=`mermaid-${Math.abs(w)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:W}=await j.render(G,e);h(W),f(W)}catch(j){if(!(d||c)){let w=j instanceof Error?j.message:"Failed to render Mermaid chart";s(w)}}finally{o(!1)}})()}},[e,n,p,O,N]),!(O||c||d))return m.jsx("div",{className:V("my-4 min-h-[200px]",t),ref:L});if(u&&!c&&!d)return m.jsx("div",{className:V("my-4 flex justify-center p-4",t),ref:L,children:m.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[m.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),m.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(a&&!c&&!d){let j=()=>E(w=>w+1);return k?m.jsx("div",{ref:L,children:m.jsx(k,{chart:e,error:a,retry:j})}):m.jsxs("div",{className:V("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:L,children:[m.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",a]}),m.jsxs("details",{className:"mt-2",children:[m.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),m.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]})}let H=c||d;return m.jsx("div",{className:V("size-full",t),"data-streamdown":"mermaid",ref:L,children:m.jsx(zx,{className:V(r?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:m.jsx("div",{"aria-label":"Mermaid chart",className:V("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:H},role:"img"})})})};function $x({content:e,children:t,className:n="",side:r="top",align:i="center"}){const a=r==="bottom"?"top-full mt-2":"bottom-full mb-2",s=r==="bottom"?"bottom-full border-b-neutral-900":"top-full border-t-neutral-900",u=i==="start"?"left-0":i==="end"?"right-0":"left-1/2 -translate-x-1/2",o=i==="start"?"left-4":i==="end"?"right-4":"left-1/2 -translate-x-1/2";return m.jsxs("div",{className:`group/tooltip relative inline-block ${n}`,children:[t,m.jsxs("div",{className:`invisible absolute ${a} ${u} max-w-[260px] px-3 py-2 bg-neutral-900 text-white text-xs leading-relaxed rounded-lg opacity-0 group-hover/tooltip:visible group-hover/tooltip:opacity-100 group-focus-within/tooltip:visible group-focus-within/tooltip:opacity-100 transition-opacity pointer-events-none whitespace-normal z-[100] shadow-lg`,children:[e,m.jsx("div",{className:`absolute ${s} ${o} border-4 border-transparent`})]})]})}const cc=/^[a-zA-Z]:[\\/]/,Yx=/[/\\](attachments|conversations)[/\\]/,qx=/^\/(Users|home|tmp|private|var|opt|mnt|Volumes)(\/|$)/;function iu(e){return e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")}function Vx(e){const t=e.match(/^(.*)#L([1-9]\d*)(?:C([1-9]\d*))?$/i);if(t)return{path:t[1],line:Number(t[2]),column:t[3]?Number(t[3]):void 0};const n=e.match(/^(.*?):(\d+)(?::(\d+))?$/);if(n&&n[1]){const r=Number(n[2]),i=n[3]?Number(n[3]):void 0;if(r>0&&(!n[3]||i&&i>0))return{path:n[1],line:r,column:i}}return{path:e}}function Wx(e,t){if(!t)return null;const n=iu(e),r=iu(t).replace(/\/$/,"");return n===r?null:n.startsWith(`${r}/`)?n.slice(r.length+1):n.startsWith("./")?n.slice(2):!n.startsWith("/")&&!cc.test(e)&&!n.startsWith("../")?n:null}function Gx(e){return`${At()}/attachments/by-path?path=${encodeURIComponent(e)}`}function hc(e,t){if(/^https?:\/\//i.test(e))return{type:"external",url:e};if(/^(mailto|tel):/i.test(e))return{type:"external",url:e};if(e.startsWith("/api/")||e.startsWith("#"))return{type:"internal",url:e};const n=Vx(e),r=Wx(n.path,t);return r?{type:"workspace-file",path:r,line:n.line,column:n.column}:Yx.test(e)?{type:"attachment",path:e,url:Gx(e)}:qx.test(e)||cc.test(e)?{type:"unknown-local",path:e}:{type:"internal",url:e}}function Kx(e,t){const n=new URLSearchParams({workingDir:e,path:t});return`${At()}/files/image?${n.toString()}`}function Qx(e){const t=new URLSearchParams({path:e});return`${At()}/files/image?${t.toString()}`}const dc="/__agent-tower/message-intent/codex-inline-vis",fc="/__agent-tower/message-intent/agent-download",Xx=/^[ \t]{0,3}::codex-inline-vis\{file="([^"\r\n]+)"\}[ \t]*$/,pc=/^[a-z0-9][a-z0-9-]*\.html$/,Zx=/^[ \t]{0,3}(`{3,}|~{3,})/;function Jx(e,t){const n=t[0]==="`"?"`":"~";return new RegExp(`^[ \\t]{0,3}${n}{${t.length},}[ \\t]*$`).test(e)}function e_(e){let t=null;return e.split(/\r?\n/).map(n=>{if(t)return Jx(n,t)&&(t=null),n;const r=n.match(Zx);if(r)return t=r[1],n;const i=n.match(Xx);if(i&&pc.test(i[1])){const u=`${dc}?file=${encodeURIComponent(i[1])}`;return`[${i[1]}](${u})`}const a=sh(n);if(!a)return n;const s=`${fc}?file=${encodeURIComponent(a)}`;return`[${a}](${s})`}).join(`
|
|
117
|
-
`)}function t_(e){try{const t=new URL(e,"http://agent-tower.local"),n=t.searchParams.get("file");if(!n)return null;if(t.pathname===dc&&pc.test(n))return{type:"codex-inline-visualization",file:n};if(t.pathname===fc){const r=Tu(n);return r?{type:"agent-download",file:r}:null}return null}catch{return null}}function h3(e,t){return`${At()}/sessions/${encodeURIComponent(e)}/visualizations/${encodeURIComponent(t)}`}function n_(e,t){const n=new URLSearchParams({path:t});return`${At()}/sessions/${encodeURIComponent(e)}/artifacts/download?${n.toString()}`}const mc=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0"]);function r_(e){return/^\d+$/.test(e)?`http://127.0.0.1:${e}`:/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(e)?e:`http://${e}`}function mi(e){try{return new URL(r_(e.trim()))}catch{return null}}function au(e){return mc.has(e.hostname.toLowerCase())?"loopback":e.hostname.toLowerCase()}function su(e){return e.port?e.port:e.protocol==="https:"?"443":"80"}function i_(e,t){return e.protocol===t.protocol&&au(e)===au(t)&&su(e)===su(t)}function gc(e){return!e||e==="/"?"":e.endsWith("/")?e.slice(0,-1):e}function a_(e,t){return t?e===t||e.startsWith(`${t}/`):!0}function zn(e,t){return t?{kind:"target",target:t.origin,path:`${t.pathname}${t.search}${t.hash}`}:{kind:"target",target:e,path:null}}function uu(e,t){try{const i=new URL(e),a=i.searchParams.get("__agent_tower_preview_token"),s=new URL(t.startsWith("/")?t:`/${t}`,"http://preview.local");return i.pathname=s.pathname,i.search=s.search,i.hash=s.hash,a&&i.searchParams.set("__agent_tower_preview_token",a),i.toString()}catch{}const n=e.endsWith("/")?e:`${e}/`,r=t.startsWith("/")?t.slice(1):t;return`${n}${r}`}function d3(e,t,n){const r=e.trim();if(!r)return null;if(r.startsWith("/"))return n?{kind:"proxy",url:uu(n,r)}:null;const i=mi(r);if(!i)return zn(r,null);if(!t||!n)return zn(r,i);const a=mi(t);if(!a||!i_(i,a))return zn(r,i);const s=gc(a.pathname);if(!a_(i.pathname,s))return zn(r,i);const u=i.pathname.slice(s.length)||"/";return{kind:"proxy",url:uu(n,`${u}${i.search}${i.hash}`)}}function f3(e,t,n,r){if(!e||!t)return null;try{const i=new URL(e),a=new URL(t,r),s=new URL(n,r),u=a.pathname==="/"?"":a.pathname.endsWith("/")?a.pathname.slice(0,-1):a.pathname;if(s.origin!==a.origin||u&&s.pathname!==u&&!s.pathname.startsWith(`${u}/`))return s.toString();const o=s.pathname.slice(u.length)||"/",c=gc(i.pathname);return i.pathname=`${c}${o}`.replace(/\/{2,}/g,"/")||"/",i.search=s.search,i.hash=s.hash,i.toString()}catch{return null}}function s_(e){const t=mi(e);return!!(t&&mc.has(t.hostname.toLowerCase()))}const Ec=({src:e,alt:t,className:n,node:r,...i})=>m.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-block",children:m.jsx("img",{src:e,alt:t,...i,className:ar("max-w-[300px] max-h-[200px] object-contain rounded-lg border border-neutral-200 cursor-pointer hover:opacity-90 active:opacity-90 transition-opacity",n)})}),u_=({href:e="",children:t,node:n,onClick:r,className:i,...a})=>{const{t:s}=sr(),{workingDir:u,onOpenWorkspaceFile:o,onOpenPreviewUrl:c,onOpenVisualization:h,downloadSessionId:d}=a,f=t_(e),p=hc(e,u),E={...a};delete E.workingDir,delete E.onOpenWorkspaceFile,delete E.onOpenPreviewUrl,delete E.onOpenVisualization,delete E.downloadSessionId;const A=ar("text-blue-600 underline decoration-blue-300 underline-offset-2 transition-colors hover:text-blue-700 hover:decoration-blue-500",i);if(f?.type==="codex-inline-visualization")return h?m.jsxs("button",{type:"button",onClick:()=>h(f.file),title:s("Open visualization"),className:"inline-flex max-w-full items-center gap-1.5 align-middle font-medium text-blue-600 underline decoration-blue-300 underline-offset-2 transition-colors hover:text-blue-700 hover:decoration-blue-500",children:[m.jsx(Gc,{className:"size-4 shrink-0","aria-hidden":!0}),m.jsx("span",{className:"truncate",children:f.file})]}):m.jsx("code",{title:f.file,children:f.file});if(f?.type==="agent-download")return d?m.jsxs("a",{href:n_(d,f.file),download:f.file.split("/").at(-1),title:s("Download file"),className:"inline-flex max-w-full items-center gap-1.5 align-middle font-medium text-blue-600 underline decoration-blue-300 underline-offset-2 transition-colors hover:text-blue-700 hover:decoration-blue-500",children:[m.jsx(jc,{className:"size-4 shrink-0","aria-hidden":!0}),m.jsx("span",{className:"truncate",children:f.file.split("/").at(-1)})]}):m.jsx("code",{title:f.file,children:f.file});if(c&&s_(e)){const k=O=>{r?.(O),!O.defaultPrevented&&(O.preventDefault(),c(e))};return m.jsx("a",{href:e,onClick:k,className:A,...E,children:t})}if(p.type==="workspace-file"&&o){const k=O=>{r?.(O),!O.defaultPrevented&&(O.preventDefault(),o(p.path,p.line,p.column))};return m.jsx("a",{href:e,onClick:k,className:A,...E,children:t})}if(p.type==="unknown-local"||p.type==="workspace-file"){const k=p.path;return m.jsx("code",{title:k,children:t})}const N=p.url;return m.jsx("a",{href:N,onClick:r,className:A,...E,children:t})},o_=({children:e,className:t,node:n,...r})=>m.jsx("li",{className:ar("py-0 pl-0 [&>p]:inline",t),...r,children:e}),l_={img:Ec,li:o_};function c_({workingDir:e,onOpenWorkspaceFile:t,onOpenPreviewUrl:n,onOpenVisualization:r,downloadSessionId:i}){return{...l_,a:a=>m.jsx(u_,{...a,workingDir:e,onOpenWorkspaceFile:t,onOpenPreviewUrl:n,onOpenVisualization:r,downloadSessionId:i}),img:a=>{const s=hc(a.src??"",e),u=s.type==="workspace-file"&&e?Kx(e,s.path):s.type==="attachment"?s.url:s.type==="unknown-local"?Qx(s.path):a.src;return m.jsx(Ec,{...a,src:u})}}}const h_={mermaid:{download:!0,copy:!0,fullscreen:!0,panZoom:!0}},d_=/(^|\n)(```|~~~)[^\S\r\n]*mermaid(?:[\s\r\n]|$)/i;let gi=null;function f_(e){return d_.test(e)}function p_(){return gi??=Ni(async()=>{const{mermaid:e}=await import("./index-
|
|
116
|
+
`)},hx=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let[a,s]=C.useState(!1),[u,o]=C.useState(!1),c=C.useRef(null),h=C.useRef(0),{isAnimating:d}=C.useContext(Fe),f=async E=>{var A,N;if(typeof window>"u"||!((A=navigator?.clipboard)!=null&&A.write)){r?.(new Error("Clipboard API not available"));return}try{let k=(N=c.current)==null?void 0:N.closest('[data-streamdown="table-wrapper"]'),O=k?.querySelector("table");if(!O){r?.(new Error("Table not found"));return}let L=Pl(O),H=E==="csv"?Ml(L):lx(L),j=new ClipboardItem({"text/plain":new Blob([H],{type:"text/plain"}),"text/html":new Blob([O.outerHTML],{type:"text/html"})});await navigator.clipboard.write([j]),o(!0),s(!1),n?.(E),h.current=window.setTimeout(()=>o(!1),i)}catch(k){r?.(k)}};C.useEffect(()=>{let E=A=>{let N=A.composedPath();c.current&&!N.includes(c.current)&&s(!1)};return document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E),window.clearTimeout(h.current)}},[]);let p=u?aa:sa;return m.jsxs("div",{className:"relative",ref:c,children:[m.jsx("button",{className:V("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:d,onClick:()=>s(!a),title:"Copy table",type:"button",children:e??m.jsx(p,{size:14})}),a?m.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[m.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),m.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},dx=({children:e,className:t,onDownload:n,onError:r})=>{let[i,a]=C.useState(!1),s=C.useRef(null),{isAnimating:u}=C.useContext(Fe),o=c=>{var h;try{let d=(h=s.current)==null?void 0:h.closest('[data-streamdown="table-wrapper"]'),f=d?.querySelector("table");if(!f){r?.(new Error("Table not found"));return}let p=Pl(f),E=c==="csv"?Ml(p):cx(p);vt(`table.${c==="csv"?"csv":"md"}`,E,c==="csv"?"text/csv":"text/markdown"),a(!1),n?.(c)}catch(d){r?.(d)}};return C.useEffect(()=>{let c=h=>{let d=h.composedPath();s.current&&!d.includes(s.current)&&a(!1)};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[]),m.jsxs("div",{className:"relative",ref:s,children:[m.jsx("button",{className:V("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:u,onClick:()=>a(!i),title:"Download table",type:"button",children:e??m.jsx(_r,{size:14})}),i?m.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[m.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>o("csv"),title:"Download table as CSV",type:"button",children:"CSV"}),m.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>o("markdown"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},fx=({children:e,className:t,showControls:n,...r})=>m.jsxs("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[n?m.jsxs("div",{className:"flex items-center justify-end gap-1",children:[m.jsx(hx,{}),m.jsx(dx,{})]}):null,m.jsx("div",{className:"overflow-x-auto overscroll-y-auto",children:m.jsx("table",{className:V("w-full border-collapse border border-border",t),"data-streamdown":"table",...r,children:e})})]}),px=C.lazy(()=>Ni(()=>import("./code-block-OCS4YCEC-DnfSnuHM.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeBlock}))),mx=C.lazy(()=>Ni(()=>Promise.resolve().then(()=>e3),void 0).then(e=>({default:e.Mermaid}))),gx=/language-([^\s]+)/;function Ar(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function fe(e,t){return e.className===t.className&&Ar(e.node,t.node)}var fi=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,Un=(e,t)=>{if(typeof e=="boolean")return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},oa=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("ol",{className:V("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e}),(e,t)=>fe(e,t));oa.displayName="MarkdownOl";var vl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("li",{className:V("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e}),(e,t)=>e.className===t.className&&Ar(e.node,t.node));vl.displayName="MarkdownLi";var Bl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("ul",{className:V("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e}),(e,t)=>fe(e,t));Bl.displayName="MarkdownUl";var Fl=C.memo(({className:e,node:t,...n})=>m.jsx("hr",{className:V("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n}),(e,t)=>fe(e,t));Fl.displayName="MarkdownHr";var Hl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("span",{className:V("font-semibold",t),"data-streamdown":"strong",...r,children:e}),(e,t)=>fe(e,t));Hl.displayName="MarkdownStrong";var Ex=({children:e,className:t,href:n,node:r,...i})=>{let{linkSafety:a}=C.useContext(Fe),[s,u]=C.useState(!1),o=n==="streamdown:incomplete-link",c=C.useCallback(async p=>{if(!(!(a!=null&&a.enabled&&n)||o)){if(p.preventDefault(),a.onLinkCheck&&await a.onLinkCheck(n)){window.open(n,"_blank","noreferrer");return}u(!0)}},[a,n,o]),h=C.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),d=C.useCallback(()=>{u(!1)},[]),f={url:n??"",isOpen:s,onClose:d,onConfirm:h};return a!=null&&a.enabled&&n?m.jsxs(m.Fragment,{children:[m.jsx("button",{className:V("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":o,"data-streamdown":"link",onClick:c,type:"button",children:e}),a.renderModal?a.renderModal(f):m.jsx(rx,{...f})]}):m.jsx("a",{className:V("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":o,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},Ul=C.memo(Ex,(e,t)=>fe(e,t)&&e.href===t.href);Ul.displayName="MarkdownA";var jl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("h1",{className:V("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e}),(e,t)=>fe(e,t));jl.displayName="MarkdownH1";var zl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("h2",{className:V("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e}),(e,t)=>fe(e,t));zl.displayName="MarkdownH2";var $l=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("h3",{className:V("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e}),(e,t)=>fe(e,t));$l.displayName="MarkdownH3";var Yl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("h4",{className:V("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e}),(e,t)=>fe(e,t));Yl.displayName="MarkdownH4";var ql=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("h5",{className:V("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e}),(e,t)=>fe(e,t));ql.displayName="MarkdownH5";var Vl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("h6",{className:V("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e}),(e,t)=>fe(e,t));Vl.displayName="MarkdownH6";var Wl=C.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=C.useContext(Fe),a=fi(i,"table");return m.jsx(fx,{className:t,showControls:a,...r,children:e})},(e,t)=>fe(e,t));Wl.displayName="MarkdownTable";var Gl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("thead",{className:V("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e}),(e,t)=>fe(e,t));Gl.displayName="MarkdownThead";var Kl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("tbody",{className:V("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...r,children:e}),(e,t)=>fe(e,t));Kl.displayName="MarkdownTbody";var Ql=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("tr",{className:V("border-border border-b",t),"data-streamdown":"table-row",...r,children:e}),(e,t)=>fe(e,t));Ql.displayName="MarkdownTr";var Xl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("th",{className:V("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...r,children:e}),(e,t)=>fe(e,t));Xl.displayName="MarkdownTh";var Zl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("td",{className:V("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e}),(e,t)=>fe(e,t));Zl.displayName="MarkdownTd";var Jl=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("blockquote",{className:V("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...r,children:e}),(e,t)=>fe(e,t));Jl.displayName="MarkdownBlockquote";var ec=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("sup",{className:V("text-sm",t),"data-streamdown":"superscript",...r,children:e}),(e,t)=>fe(e,t));ec.displayName="MarkdownSup";var tc=C.memo(({children:e,className:t,node:n,...r})=>m.jsx("sub",{className:V("text-sm",t),"data-streamdown":"subscript",...r,children:e}),(e,t)=>fe(e,t));tc.displayName="MarkdownSub";var nc=C.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=s=>{var u,o;if(!C.isValidElement(s))return!1;let c=Array.isArray(s.props.children)?s.props.children:[s.props.children],h=!1,d=!1;for(let f of c)if(f){if(typeof f=="string")f.trim()!==""&&(h=!0);else if(C.isValidElement(f))if(((u=f.props)==null?void 0:u["data-footnote-backref"])!==void 0)d=!0;else{let p=Array.isArray(f.props.children)?f.props.children:[f.props.children];for(let E of p){if(typeof E=="string"&&E.trim()!==""){h=!0;break}if(C.isValidElement(E)&&((o=E.props)==null?void 0:o["data-footnote-backref"])===void 0){h=!0;break}}}}return d&&!h},a=Array.isArray(e)?e.map(s=>{if(!C.isValidElement(s))return s;if(s.type===oa){let u=(Array.isArray(s.props.children)?s.props.children:[s.props.children]).filter(o=>!i(o));return u.length===0?null:{...s,props:{...s.props,children:u}}}return s}):e;return(Array.isArray(a)?a.some(s=>s!==null):a!==null)?m.jsx("section",{className:t,...r,children:a}):null}return m.jsx("section",{className:t,...r,children:e})},(e,t)=>fe(e,t));nc.displayName="MarkdownSection";var bx=({node:e,className:t,children:n,...r})=>{var i;let a=!("data-block"in r),{mermaid:s,controls:u}=C.useContext(Fe),o=ua();if(a)return m.jsx("code",{className:V("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...r,children:n});let c=t?.match(gx),h=(i=c?.at(1))!=null?i:"",d="";if(C.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?d=n.props.children:typeof n=="string"&&(d=n),h==="mermaid"&&o){let p=fi(u,"mermaid"),E=Un(u,"download"),A=Un(u,"copy"),N=Un(u,"fullscreen"),k=Un(u,"panZoom"),O=p&&(E||A||N);return m.jsx(C.Suspense,{fallback:m.jsx(Xs,{}),children:m.jsxs("div",{className:V("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[O?m.jsxs("div",{className:"flex items-center justify-end gap-2",children:[E?m.jsx(ax,{chart:d,config:s?.config}):null,A?m.jsx(Ks,{code:d}):null,N?m.jsx(ox,{chart:d,config:s?.config}):null]}):null,m.jsx(mx,{chart:d,config:s?.config,showControls:k})]})})}let f=fi(u,"code");return m.jsx(C.Suspense,{fallback:m.jsx(Xs,{}),children:m.jsx(px,{className:V("overflow-x-auto border-border border-t",t),code:d,language:h,children:f?m.jsxs(m.Fragment,{children:[m.jsx(Z2,{code:d,language:h}),m.jsx(Ks,{})]}):null})})},rc=C.memo(bx,(e,t)=>e.className===t.className&&Ar(e.node,t.node));rc.displayName="MarkdownCode";var ic=C.memo(ex,(e,t)=>e.className===t.className&&Ar(e.node,t.node));ic.displayName="MarkdownImg";var ac=C.memo(({children:e,className:t,node:n,...r})=>{let i=(Array.isArray(e)?e:[e]).filter(a=>a!=null&&a!=="");if(i.length===1&&C.isValidElement(i[0])){let a=i[0].props.node,s=a?.tagName;if(s==="img")return m.jsx(m.Fragment,{children:e});if(s==="code"&&"data-block"in i[0].props)return m.jsx(m.Fragment,{children:e})}return m.jsx("p",{className:t,...r,children:e})},(e,t)=>fe(e,t));ac.displayName="MarkdownParagraph";var Tx={ol:oa,li:vl,ul:Bl,hr:Fl,strong:Hl,a:Ul,h1:jl,h2:zl,h3:$l,h4:Yl,h5:ql,h6:Vl,table:Wl,thead:Gl,tbody:Kl,tr:Ql,th:Xl,td:Zl,blockquote:Jl,code:rc,img:ic,pre:({children:e})=>C.isValidElement(e)?C.cloneElement(e,{"data-block":"true"}):e,sup:ec,sub:tc,p:ac,section:nc},xx=()=>e=>{st(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},Zs=[],Js={allowDangerousHtml:!0},jn=new WeakMap,_x=class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let h="default";return this.keyCache.set(e,h),h}let a=h=>{if(!h||h.length===0)return"";let d="";for(let f=0;f<h.length;f+=1){let p=h[f];if(f>0&&(d+=","),Array.isArray(p)){let[E,A]=p;if(typeof E=="function"){let N=jn.get(E);N||(N=E.name,jn.set(E,N)),d+=N}else d+=String(E);d+=":",d+=JSON.stringify(A)}else if(typeof p=="function"){let E=jn.get(p);E||(E=p.name,jn.set(p,E)),d+=E}else d+=String(p)}return d},s=a(n),u=a(r),o=i?JSON.stringify(i):"",c=`${u}::${s}::${o}`;return this.keyCache.set(e,c),c}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(n,t)}clear(){this.cache.clear()}},eu=new _x,sc=e=>{let t=Ax(e),n=e.children||"";return wx(t.runSync(t.parse(n),n),e)},Ax=e=>{let t=eu.get(e);if(t)return t;let n=Cx(e);return eu.set(e,n),n},kx=e=>e.some(t=>Array.isArray(t)?t[0]===ei:t===ei),Cx=e=>{let t=e.rehypePlugins||Zs,n=e.remarkPlugins||Zs,r=kx(t)?n:[...n,xx],i=e.remarkRehypeOptions?{...Js,...e.remarkRehypeOptions}:Js;return WT().use(Vb).use(r).use(ST,i).use(t)},yx=e=>e,Nx=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},Ix=(e,t)=>{var n;for(let r in vr)if(Object.hasOwn(vr,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],a=vr[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},Sx=(e,t,n,r,i,a)=>{let s=!1;return r?s=!r.includes(e.tagName):i&&(s=i.includes(e.tagName)),!s&&a&&typeof t=="number"&&(s=!a(e,t,n)),s},wx=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:s,urlTransform:u}=t;if(n||r||i||a||u){let o=u||yx;st(e,(c,h,d)=>{if(c.type==="raw"&&d&&typeof h=="number")return Nx(d,h,a,c.value),h;if(c.type==="element"&&(Ix(c,o),Sx(c,h,d,r,i,n)&&d&&typeof h=="number"))return s&&c.children?d.children.splice(h,1,...c.children):d.children.splice(h,1),h})}return eb(e,{Fragment:m.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0})},Lx=/\[\^[\w-]{1,200}\](?!:)/,Ox=/\[\^[\w-]{1,200}\]:/,Rx=/<\/(\w+)>/,Dx=/<(\w+)[\s>]/,Px=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mx=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]==="$"&&e[n+1]==="$"&&(t+=1,n+=1);return t},vx=e=>{let t=Lx.test(e),n=Ox.test(e);if(t||n)return[e];let r=Be.lex(e,{gfm:!0}),i=[],a=[],s=!1;for(let u of r){let o=u.raw,c=i.length;if(a.length>0){if(i[c-1]+=o,u.type==="html"){let h=o.match(Rx);if(h){let d=h[1];a.at(-1)===d&&a.pop()}}continue}if(u.type==="html"&&u.block){let h=o.match(Dx);if(h){let d=h[1];o.includes(`</${d}>`)||Px.has(d.toLowerCase())||a.push(d)}}if(c>0&&!s){let h=i[c-1];if(Mx(h)%2===1){i[c-1]=h+o;continue}}i.push(o),u.type!=="space"&&(s=u.type==="code")}return i},tu,nu,Vn={...hn,protocols:{...hn.protocols,href:[...(nu=(tu=hn.protocols)==null?void 0:tu.href)!=null?nu:[],"tel"]}},pi={raw:ei,sanitize:[_o,Vn],harden:[fh,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},Bx={gfm:[Lg,{}]},ru=Object.values(pi),Fx=Object.values(Bx),Hx={block:" ▋",circle:" ●"},Ux={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},Fe=C.createContext(Ux),uc=C.memo(({content:e,shouldParseIncompleteMarkdown:t,index:n,...r})=>m.jsx(sc,{...r,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(i=>{var a,s;return((a=e.components)==null?void 0:a[i])!==((s=t.components)==null?void 0:s[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});uc.displayName="Block";var jx=["github-light","github-dark"],oc=C.memo(({children:e,mode:t="streaming",parseIncompleteMarkdown:n=!0,components:r,rehypePlugins:i=ru,remarkPlugins:a=Fx,className:s,shikiTheme:u=jx,mermaid:o,controls:c=!0,isAnimating:h=!1,animated:d,BlockComponent:f=uc,parseMarkdownIntoBlocksFn:p=vx,caret:E,plugins:A,remend:N,linkSafety:k={enabled:!0},allowedTags:O,...L})=>{let H=C.useId(),[j,w]=C.useTransition(),G=C.useMemo(()=>typeof e!="string"?"":t==="streaming"&&n?FE(e,N):e,[e,t,n,N]),W=C.useMemo(()=>p(G),[G,p]),[X,I]=C.useState(W);C.useEffect(()=>{t==="streaming"?w(()=>{I(W)}):I(W)},[W,t]);let U=t==="streaming"?X:W,v=C.useMemo(()=>U.map((ae,x)=>`${H}-${x}`),[U.length,H]),q=C.useMemo(()=>d?d===!0?hi():hi(d):null,[d]),z=C.useMemo(()=>{var ae,x;return{shikiTheme:(x=(ae=A?.code)==null?void 0:ae.getThemes())!=null?x:u,controls:c,isAnimating:h,mode:t,mermaid:o,linkSafety:k}},[u,c,h,t,o,k,A?.code]),F=C.useMemo(()=>({...Tx,...r}),[r]),ie=C.useMemo(()=>{let ae=[];return A!=null&&A.cjk&&(ae=[...ae,...A.cjk.remarkPluginsBefore]),ae=[...ae,...a],A!=null&&A.cjk&&(ae=[...ae,...A.cjk.remarkPluginsAfter]),A!=null&&A.math&&(ae=[...ae,A.math.remarkPlugin]),ae},[a,A?.math,A?.cjk]),he=C.useMemo(()=>{var ae;let x=i;if(O&&Object.keys(O).length>0&&i===ru){let Le={...Vn,tagNames:[...(ae=Vn.tagNames)!=null?ae:[],...Object.keys(O)],attributes:{...Vn.attributes,...O}};x=[pi.raw,[_o,Le],pi.harden]}return A!=null&&A.math&&(x=[...x,A.math.rehypePlugin]),q&&h&&(x=[...x,q.rehypePlugin]),x},[i,A?.math,q,h,O]),we=C.useMemo(()=>E&&h?{"--streamdown-caret":`"${Hx[E]}"`}:void 0,[E,h]);return t==="static"?m.jsx(di.Provider,{value:A??null,children:m.jsx(Fe.Provider,{value:z,children:m.jsx("div",{className:V("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",s),children:m.jsx(sc,{components:F,rehypePlugins:he,remarkPlugins:ie,...L,children:e})})})}):m.jsx(di.Provider,{value:A??null,children:m.jsx(Fe.Provider,{value:z,children:m.jsxs("div",{className:V("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",E?"*:last:after:inline *:last:after:align-baseline *:last:after:content-[var(--streamdown-caret)]":null,s),style:we,children:[U.length===0&&E&&h&&m.jsx("span",{}),U.map((ae,x)=>m.jsx(f,{components:F,content:ae,index:x,rehypePlugins:he,remarkPlugins:ie,shouldParseIncompleteMarkdown:n,...L},v[x]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);oc.displayName="Streamdown";var zx=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:s=1,fullscreen:u=!1})=>{let o=C.useRef(null),c=C.useRef(null),[h,d]=C.useState(s),[f,p]=C.useState({x:0,y:0}),[E,A]=C.useState(!1),[N,k]=C.useState({x:0,y:0}),[O,L]=C.useState({x:0,y:0}),H=C.useCallback(v=>{d(q=>Math.max(n,Math.min(r,q+v)))},[n,r]),j=C.useCallback(()=>{H(i)},[H,i]),w=C.useCallback(()=>{H(-i)},[H,i]),G=C.useCallback(()=>{d(s),p({x:0,y:0})},[s]),W=C.useCallback(v=>{v.preventDefault();let q=v.deltaY>0?-i:i;H(q)},[H,i]),X=C.useCallback(v=>{if(v.button!==0||v.isPrimary===!1)return;A(!0),k({x:v.clientX,y:v.clientY}),L(f);let q=v.currentTarget;q instanceof HTMLElement&&q.setPointerCapture(v.pointerId)},[f]),I=C.useCallback(v=>{if(!E)return;v.preventDefault();let q=v.clientX-N.x,z=v.clientY-N.y;p({x:O.x+q,y:O.y+z})},[E,N,O]),U=C.useCallback(v=>{A(!1);let q=v.currentTarget;q instanceof HTMLElement&&q.releasePointerCapture(v.pointerId)},[]);return C.useEffect(()=>{let v=o.current;if(v)return v.addEventListener("wheel",W,{passive:!1}),()=>{v.removeEventListener("wheel",W)}},[W]),C.useEffect(()=>{let v=c.current;if(v&&E)return document.body.style.userSelect="none",v.addEventListener("pointermove",I,{passive:!1}),v.addEventListener("pointerup",U),v.addEventListener("pointercancel",U),()=>{document.body.style.userSelect="",v.removeEventListener("pointermove",I),v.removeEventListener("pointerup",U),v.removeEventListener("pointercancel",U)}},[E,I,U]),m.jsxs("div",{className:V("relative flex flex-col",u?"h-full w-full":"min-h-28 w-full",t),ref:o,style:{cursor:E?"grabbing":"grab"},children:[a?m.jsxs("div",{className:V("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",u?"bottom-4 left-4":"bottom-2 left-2"),children:[m.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:h>=r,onClick:j,title:"Zoom in",type:"button",children:m.jsx(K2,{size:16})}),m.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:h<=n,onClick:w,title:"Zoom out",type:"button",children:m.jsx(Q2,{size:16})}),m.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:G,title:"Reset zoom and pan",type:"button",children:m.jsx(G2,{size:16})})]}):null,m.jsx("div",{className:V("flex-1 origin-center transition-transform duration-150 ease-out",u?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:X,ref:c,role:"application",style:{transform:`translate(${f.x}px, ${f.y}px) scale(${h})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},lc=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[a,s]=C.useState(null),[u,o]=C.useState(!1),[c,h]=C.useState(""),[d,f]=C.useState(""),[p,E]=C.useState(0),{mermaid:A}=C.useContext(Fe),N=ua(),k=A?.errorComponent,{shouldRender:O,containerRef:L}=B2({immediate:r});if(C.useEffect(()=>{if(O){if(!N){s("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{s(null),o(!0);let j=N.getMermaid(n),w=e.split("").reduce((X,I)=>(X<<5)-X+I.charCodeAt(0)|0,0),G=`mermaid-${Math.abs(w)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:W}=await j.render(G,e);h(W),f(W)}catch(j){if(!(d||c)){let w=j instanceof Error?j.message:"Failed to render Mermaid chart";s(w)}}finally{o(!1)}})()}},[e,n,p,O,N]),!(O||c||d))return m.jsx("div",{className:V("my-4 min-h-[200px]",t),ref:L});if(u&&!c&&!d)return m.jsx("div",{className:V("my-4 flex justify-center p-4",t),ref:L,children:m.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[m.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),m.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(a&&!c&&!d){let j=()=>E(w=>w+1);return k?m.jsx("div",{ref:L,children:m.jsx(k,{chart:e,error:a,retry:j})}):m.jsxs("div",{className:V("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:L,children:[m.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",a]}),m.jsxs("details",{className:"mt-2",children:[m.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),m.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]})}let H=c||d;return m.jsx("div",{className:V("size-full",t),"data-streamdown":"mermaid",ref:L,children:m.jsx(zx,{className:V(r?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:m.jsx("div",{"aria-label":"Mermaid chart",className:V("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:H},role:"img"})})})};function $x({content:e,children:t,className:n="",side:r="top",align:i="center"}){const a=r==="bottom"?"top-full mt-2":"bottom-full mb-2",s=r==="bottom"?"bottom-full border-b-neutral-900":"top-full border-t-neutral-900",u=i==="start"?"left-0":i==="end"?"right-0":"left-1/2 -translate-x-1/2",o=i==="start"?"left-4":i==="end"?"right-4":"left-1/2 -translate-x-1/2";return m.jsxs("div",{className:`group/tooltip relative inline-block ${n}`,children:[t,m.jsxs("div",{className:`invisible absolute ${a} ${u} max-w-[260px] px-3 py-2 bg-neutral-900 text-white text-xs leading-relaxed rounded-lg opacity-0 group-hover/tooltip:visible group-hover/tooltip:opacity-100 group-focus-within/tooltip:visible group-focus-within/tooltip:opacity-100 transition-opacity pointer-events-none whitespace-normal z-[100] shadow-lg`,children:[e,m.jsx("div",{className:`absolute ${s} ${o} border-4 border-transparent`})]})]})}const cc=/^[a-zA-Z]:[\\/]/,Yx=/[/\\](attachments|conversations)[/\\]/,qx=/^\/(Users|home|tmp|private|var|opt|mnt|Volumes)(\/|$)/;function iu(e){return e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")}function Vx(e){const t=e.match(/^(.*)#L([1-9]\d*)(?:C([1-9]\d*))?$/i);if(t)return{path:t[1],line:Number(t[2]),column:t[3]?Number(t[3]):void 0};const n=e.match(/^(.*?):(\d+)(?::(\d+))?$/);if(n&&n[1]){const r=Number(n[2]),i=n[3]?Number(n[3]):void 0;if(r>0&&(!n[3]||i&&i>0))return{path:n[1],line:r,column:i}}return{path:e}}function Wx(e,t){if(!t)return null;const n=iu(e),r=iu(t).replace(/\/$/,"");return n===r?null:n.startsWith(`${r}/`)?n.slice(r.length+1):n.startsWith("./")?n.slice(2):!n.startsWith("/")&&!cc.test(e)&&!n.startsWith("../")?n:null}function Gx(e){return`${At()}/attachments/by-path?path=${encodeURIComponent(e)}`}function hc(e,t){if(/^https?:\/\//i.test(e))return{type:"external",url:e};if(/^(mailto|tel):/i.test(e))return{type:"external",url:e};if(e.startsWith("/api/")||e.startsWith("#"))return{type:"internal",url:e};const n=Vx(e),r=Wx(n.path,t);return r?{type:"workspace-file",path:r,line:n.line,column:n.column}:Yx.test(e)?{type:"attachment",path:e,url:Gx(e)}:qx.test(e)||cc.test(e)?{type:"unknown-local",path:e}:{type:"internal",url:e}}function Kx(e,t){const n=new URLSearchParams({workingDir:e,path:t});return`${At()}/files/image?${n.toString()}`}function Qx(e){const t=new URLSearchParams({path:e});return`${At()}/files/image?${t.toString()}`}const dc="/__agent-tower/message-intent/codex-inline-vis",fc="/__agent-tower/message-intent/agent-download",Xx=/^[ \t]{0,3}::codex-inline-vis\{file="([^"\r\n]+)"\}[ \t]*$/,pc=/^[a-z0-9][a-z0-9-]*\.html$/,Zx=/^[ \t]{0,3}(`{3,}|~{3,})/;function Jx(e,t){const n=t[0]==="`"?"`":"~";return new RegExp(`^[ \\t]{0,3}${n}{${t.length},}[ \\t]*$`).test(e)}function e_(e){let t=null;return e.split(/\r?\n/).map(n=>{if(t)return Jx(n,t)&&(t=null),n;const r=n.match(Zx);if(r)return t=r[1],n;const i=n.match(Xx);if(i&&pc.test(i[1])){const u=`${dc}?file=${encodeURIComponent(i[1])}`;return`[${i[1]}](${u})`}const a=sh(n);if(!a)return n;const s=`${fc}?file=${encodeURIComponent(a)}`;return`[${a}](${s})`}).join(`
|
|
117
|
+
`)}function t_(e){try{const t=new URL(e,"http://agent-tower.local"),n=t.searchParams.get("file");if(!n)return null;if(t.pathname===dc&&pc.test(n))return{type:"codex-inline-visualization",file:n};if(t.pathname===fc){const r=Tu(n);return r?{type:"agent-download",file:r}:null}return null}catch{return null}}function h3(e,t){return`${At()}/sessions/${encodeURIComponent(e)}/visualizations/${encodeURIComponent(t)}`}function n_(e,t){const n=new URLSearchParams({path:t});return`${At()}/sessions/${encodeURIComponent(e)}/artifacts/download?${n.toString()}`}const mc=new Set(["localhost","127.0.0.1","::1","[::1]","0.0.0.0"]);function r_(e){return/^\d+$/.test(e)?`http://127.0.0.1:${e}`:/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(e)?e:`http://${e}`}function mi(e){try{return new URL(r_(e.trim()))}catch{return null}}function au(e){return mc.has(e.hostname.toLowerCase())?"loopback":e.hostname.toLowerCase()}function su(e){return e.port?e.port:e.protocol==="https:"?"443":"80"}function i_(e,t){return e.protocol===t.protocol&&au(e)===au(t)&&su(e)===su(t)}function gc(e){return!e||e==="/"?"":e.endsWith("/")?e.slice(0,-1):e}function a_(e,t){return t?e===t||e.startsWith(`${t}/`):!0}function zn(e,t){return t?{kind:"target",target:t.origin,path:`${t.pathname}${t.search}${t.hash}`}:{kind:"target",target:e,path:null}}function uu(e,t){try{const i=new URL(e),a=i.searchParams.get("__agent_tower_preview_token"),s=new URL(t.startsWith("/")?t:`/${t}`,"http://preview.local");return i.pathname=s.pathname,i.search=s.search,i.hash=s.hash,a&&i.searchParams.set("__agent_tower_preview_token",a),i.toString()}catch{}const n=e.endsWith("/")?e:`${e}/`,r=t.startsWith("/")?t.slice(1):t;return`${n}${r}`}function d3(e,t,n){const r=e.trim();if(!r)return null;if(r.startsWith("/"))return n?{kind:"proxy",url:uu(n,r)}:null;const i=mi(r);if(!i)return zn(r,null);if(!t||!n)return zn(r,i);const a=mi(t);if(!a||!i_(i,a))return zn(r,i);const s=gc(a.pathname);if(!a_(i.pathname,s))return zn(r,i);const u=i.pathname.slice(s.length)||"/";return{kind:"proxy",url:uu(n,`${u}${i.search}${i.hash}`)}}function f3(e,t,n,r){if(!e||!t)return null;try{const i=new URL(e),a=new URL(t,r),s=new URL(n,r),u=a.pathname==="/"?"":a.pathname.endsWith("/")?a.pathname.slice(0,-1):a.pathname;if(s.origin!==a.origin||u&&s.pathname!==u&&!s.pathname.startsWith(`${u}/`))return s.toString();const o=s.pathname.slice(u.length)||"/",c=gc(i.pathname);return i.pathname=`${c}${o}`.replace(/\/{2,}/g,"/")||"/",i.search=s.search,i.hash=s.hash,i.toString()}catch{return null}}function s_(e){const t=mi(e);return!!(t&&mc.has(t.hostname.toLowerCase()))}const Ec=({src:e,alt:t,className:n,node:r,...i})=>m.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-block",children:m.jsx("img",{src:e,alt:t,...i,className:ar("max-w-[300px] max-h-[200px] object-contain rounded-lg border border-neutral-200 cursor-pointer hover:opacity-90 active:opacity-90 transition-opacity",n)})}),u_=({href:e="",children:t,node:n,onClick:r,className:i,...a})=>{const{t:s}=sr(),{workingDir:u,onOpenWorkspaceFile:o,onOpenPreviewUrl:c,onOpenVisualization:h,downloadSessionId:d}=a,f=t_(e),p=hc(e,u),E={...a};delete E.workingDir,delete E.onOpenWorkspaceFile,delete E.onOpenPreviewUrl,delete E.onOpenVisualization,delete E.downloadSessionId;const A=ar("text-blue-600 underline decoration-blue-300 underline-offset-2 transition-colors hover:text-blue-700 hover:decoration-blue-500",i);if(f?.type==="codex-inline-visualization")return h?m.jsxs("button",{type:"button",onClick:()=>h(f.file),title:s("Open visualization"),className:"inline-flex max-w-full items-center gap-1.5 align-middle font-medium text-blue-600 underline decoration-blue-300 underline-offset-2 transition-colors hover:text-blue-700 hover:decoration-blue-500",children:[m.jsx(Gc,{className:"size-4 shrink-0","aria-hidden":!0}),m.jsx("span",{className:"truncate",children:f.file})]}):m.jsx("code",{title:f.file,children:f.file});if(f?.type==="agent-download")return d?m.jsxs("a",{href:n_(d,f.file),download:f.file.split("/").at(-1),title:s("Download file"),className:"inline-flex max-w-full items-center gap-1.5 align-middle font-medium text-blue-600 underline decoration-blue-300 underline-offset-2 transition-colors hover:text-blue-700 hover:decoration-blue-500",children:[m.jsx(jc,{className:"size-4 shrink-0","aria-hidden":!0}),m.jsx("span",{className:"truncate",children:f.file.split("/").at(-1)})]}):m.jsx("code",{title:f.file,children:f.file});if(c&&s_(e)){const k=O=>{r?.(O),!O.defaultPrevented&&(O.preventDefault(),c(e))};return m.jsx("a",{href:e,onClick:k,className:A,...E,children:t})}if(p.type==="workspace-file"&&o){const k=O=>{r?.(O),!O.defaultPrevented&&(O.preventDefault(),o(p.path,p.line,p.column))};return m.jsx("a",{href:e,onClick:k,className:A,...E,children:t})}if(p.type==="unknown-local"||p.type==="workspace-file"){const k=p.path;return m.jsx("code",{title:k,children:t})}const N=p.url;return m.jsx("a",{href:N,onClick:r,className:A,...E,children:t})},o_=({children:e,className:t,node:n,...r})=>m.jsx("li",{className:ar("py-0 pl-0 [&>p]:inline",t),...r,children:e}),l_={img:Ec,li:o_};function c_({workingDir:e,onOpenWorkspaceFile:t,onOpenPreviewUrl:n,onOpenVisualization:r,downloadSessionId:i}){return{...l_,a:a=>m.jsx(u_,{...a,workingDir:e,onOpenWorkspaceFile:t,onOpenPreviewUrl:n,onOpenVisualization:r,downloadSessionId:i}),img:a=>{const s=hc(a.src??"",e),u=s.type==="workspace-file"&&e?Kx(e,s.path):s.type==="attachment"?s.url:s.type==="unknown-local"?Qx(s.path):a.src;return m.jsx(Ec,{...a,src:u})}}}const h_={mermaid:{download:!0,copy:!0,fullscreen:!0,panZoom:!0}},d_=/(^|\n)(```|~~~)[^\S\r\n]*mermaid(?:[\s\r\n]|$)/i;let gi=null;function f_(e){return d_.test(e)}function p_(){return gi??=Ni(async()=>{const{mermaid:e}=await import("./index-9oo7US_J.js").then(t=>t.bm);return{mermaid:e}},__vite__mapDeps([5,1,2])).then(({mermaid:e})=>({mermaid:e})),gi}function m_(e){const t=f_(e),[n,r]=C.useState();return C.useEffect(()=>{if(!t){r(void 0);return}let i=!0;return p_().then(a=>{i&&r(a)}).catch(()=>{gi=null,i&&r(void 0)}),()=>{i=!1}},[t]),t?n:void 0}function bc(e){if(e.tool?.status)return e.tool.status;if(e.title?.endsWith("✓"))return"success";if(e.title?.endsWith("✗"))return"failed";if(e.title?.includes("待审批"))return"pending_approval"}function g_(e){return bc(e)==="success"}function E_(e){const t=bc(e);return t==="failed"||t==="timed_out"}function la(e){return e.title==="Thinking"||e.content.startsWith("Thinking:")}function b_(e){return e.type===Z.Tool&&!!e.children?.length}function T_(e){return e.type!==Z.Cursor&&!e.children?.length&&e.content.trim()===""}function ca(e){return!!e.tokenUsage||T_(e)}function x_(e){const t=e.tool?.status;return t==="pending_approval"||t==="denied"}function __(e){return e.type===Z.Cursor||e.type===Z.User||e.type===Z.Assistant||e.type===Z.Error||e.type===Z.Warning?!0:e.type===Z.Info&&e.tokenUsage?!1:x_(e)}function ou(e){return la(e)?!0:b_(e)||e.type!==Z.Tool&&e.type!==Z.Action?!1:!__(e)}function Tc(e){return!la(e)&&(e.type===Z.Tool||e.type===Z.Action)}function A_(e){const t=e.filter(i=>!ca(i)),n=[];let r=0;for(;r<t.length;){const i=t[r];if(ou(i)){const a=[i];let s=r+1;for(;s<t.length;){const u=t[s];if(ou(u))a.push(u),s++;else break}a.some(Tc)?n.push({kind:"execution-group",logs:a,key:a[0].id}):a.forEach(u=>n.push({kind:"single",log:u,key:u.id})),r=s}else n.push({kind:"single",log:i,key:i.id}),r++}return n}function k_(e){const t=[];let n,r=[];const i=()=>{!n&&r.length===0||t.push({key:n?`turn-${n.id}`:`turn-${r[0]?.id??t.length}`,user:n,agentLogs:r})};for(const a of e)a.type===Z.User?(i(),n=a,r=[]):r.push(a);return i(),t}function C_(e){let t=-1;for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.content.trim()){if(r.type===Z.Assistant)return n;t===-1&&r.type===Z.Error&&(t=n)}}return t}function y_(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))return null;const n=Math.max(0,t-e),r=n===0?0:Math.max(1,Math.round(n/1e3)),i=Math.floor(r/3600),a=Math.floor(r%3600/60),s=r%60;return i>0?`${i}h${a>0?` ${a}m`:""}`:a>0?`${a}m${s>0?` ${s}s`:""}`:`${s}s`}function lu(e,t){const n=e.agentLogs.reduce((a,s)=>Number.isFinite(s.cursorActivity?.processingStartedAt)?s.cursorActivity?.processingStartedAt:a,void 0),r=e.user?.timestamp??n??e.agentLogs.find(a=>Number.isFinite(a.timestamp))?.timestamp,i=e.agentLogs.reduce((a,s)=>Number.isFinite(s.timestamp)?a===void 0?s.timestamp:Math.max(a,s.timestamp):a,void 0);return y_(r,t??i)}const ha=C.memo(({content:e,className:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:a,downloadSessionId:s})=>{const u=C.useMemo(()=>a||s?e_(e):e,[e,s,a]),o=m_(u),c=C.useMemo(()=>c_({workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:a,downloadSessionId:s}),[s,i,a,r,n]);return m.jsx(oc,{className:ar("session-log-message-markdown",t),components:c,plugins:o,controls:o?h_:void 0,children:u})});ha.displayName="MarkdownMessage";const xc=C.memo(({content:e,compact:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i})=>m.jsx("div",{className:t?"flex justify-end mb-4 mt-2":"flex justify-end mb-8 mt-4",children:m.jsx("div",{className:`relative bg-neutral-200 text-neutral-900 rounded-2xl rounded-tr-sm max-w-[85%] min-w-0 leading-relaxed ${t?"px-3.5 py-2.5 text-[13px]":"px-5 py-3.5 text-sm"}`,children:m.jsx(ha,{content:e,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i})})}));xc.displayName="UserMessage";const da=C.memo(({content:e,isOpenDefault:t=!0})=>{const[n,r]=C.useState(t),i=C.useRef(null),[a,s]=C.useState(0);C.useEffect(()=>{i.current&&s(i.current.scrollHeight)},[e,n]);const u=C.useMemo(()=>{const c=e.replace(/^Thinking:\s*/i,"").trim().split(`
|
|
118
118
|
`)[0]||"";return c.length>80?c.slice(0,80)+"…":c},[e]);return m.jsxs("div",{className:"my-1.5",children:[m.jsxs("button",{onClick:()=>r(!n),className:"group flex items-center gap-1.5 py-1 text-xs text-neutral-400 hover:text-neutral-500 transition-colors select-none w-full text-left",children:[m.jsx("span",{className:"shrink-0 w-3.5 h-3.5 flex items-center justify-center transition-transform duration-200",style:{transform:n?"rotate(90deg)":"rotate(0deg)"},children:m.jsx(Cn,{size:11,strokeWidth:2})}),m.jsx("span",{className:"font-medium",children:"Thinking"}),!n&&u&&m.jsx("span",{className:"truncate text-neutral-300 ml-1 font-normal",children:u})]}),m.jsx("div",{className:"overflow-hidden relative",style:{maxHeight:n?a+16:0},children:m.jsx("div",{ref:i,className:"pl-5 pt-1 pb-2 before:absolute before:left-[7px] before:top-1 before:bottom-2 before:w-px before:bg-neutral-100",children:m.jsx("div",{className:"text-xs text-neutral-400 leading-relaxed whitespace-pre-wrap min-w-0",children:e.replace(/^Thinking:\s*/i,"").trim()})})})]})});da.displayName="ThinkingBlock";function N_(e,t=140){return(e.split(`
|
|
119
119
|
`)[0]||"").slice(0,t)}function cu(e){const t=e.title?.replace(/\s*[✓✗]$/,"").replace(/\s*\(待审批\)$/,"");return e.tool?.kind?e.tool.name||t||"Tool":N_(e.content,140)||e.tool?.name||t||"Tool"}const Ei=C.memo(({title:e,content:t,type:n})=>{const[r,i]=C.useState(!1);if(n===Z.Action)return m.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 text-xs text-neutral-400",children:[m.jsx("span",{className:"shrink-0 w-1 h-1 rounded-full bg-neutral-300"}),m.jsx("span",{children:t})]});const s=e.endsWith("✓"),u=e.endsWith("✗"),o=u?"text-red-400":s?"text-emerald-400":"text-neutral-400",c=t?.split(`
|
|
120
120
|
`)[0]||"",h=c!==e?c:"";return m.jsxs("div",{className:"my-2",children:[m.jsxs("button",{onClick:()=>i(!r),className:"group flex items-center gap-1.5 py-1 text-xs w-full text-left transition-colors",children:[m.jsx("span",{className:`shrink-0 w-3.5 h-3.5 flex items-center justify-center ${o}`,children:u?m.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:m.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}):s?m.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:m.jsx("path",{d:"M2 5.5l2 2 4-4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):m.jsx("span",{className:"w-1 h-1 rounded-full bg-neutral-300"})}),m.jsx("span",{className:"font-medium text-neutral-500 shrink-0",children:e.replace(/\s*[✓✗]$/,"")}),h&&m.jsx("span",{className:"truncate text-neutral-300 font-mono",children:h}),t&&m.jsx("span",{className:"ml-auto shrink-0 opacity-0 group-hover:opacity-100 transition-opacity text-neutral-300",children:r?m.jsx(bu,{size:10}):m.jsx(Cn,{size:10})})]}),r&&t&&m.jsx("div",{className:"ml-5 mt-0.5 mb-1.5 rounded-md bg-neutral-50 border border-neutral-100 overflow-x-auto",children:m.jsx("code",{className:"block p-2.5 text-[11px] font-mono text-neutral-500 leading-relaxed whitespace-pre-wrap break-all",children:t})})]})});Ei.displayName="ToolBlock";const bi=C.memo(({logs:e})=>{const{t}=sr(),[n,r]=C.useState(!1),i=e.filter(Tc),a=i.map(u=>cu(u)),s=i.length;return m.jsxs("div",{className:"my-2",children:[m.jsxs("button",{type:"button",onClick:()=>r(!n),"aria-expanded":n,className:"group flex items-center gap-1.5 py-1 text-xs w-full text-left transition-colors",children:[m.jsx("span",{className:"shrink-0 w-3.5 h-3.5 flex items-center justify-center transition-transform duration-200",style:{transform:n?"rotate(90deg)":"rotate(0deg)"},children:m.jsx(Cn,{size:11,strokeWidth:2,className:"text-neutral-400"})}),m.jsx("span",{className:"font-medium text-neutral-500 shrink-0",children:t("工具调用")}),m.jsx("span",{className:"shrink-0 inline-flex items-center gap-1",children:m.jsx("span",{className:"inline-flex items-center justify-center px-1.5 py-0.5 rounded-full bg-neutral-100 text-neutral-400 text-[10px] font-medium leading-none tabular-nums",children:s})}),!n&&m.jsxs("span",{className:"truncate text-neutral-300 font-mono",children:[a.slice(0,3).join(", "),i.length>3?" …":""]})]}),n&&m.jsx("div",{className:"ml-5 mt-0.5 mb-1.5",children:e.map(u=>la(u)?m.jsx(da,{content:u.content,isOpenDefault:!1},u.id):m.jsx(_c,{log:u,title:cu(u)},u.id))})]})});bi.displayName="ExecutionDetailsGroup";const _c=C.memo(({log:e,title:t})=>{const[n,r]=C.useState(!1),i=!!e.content.trim()&&e.content.trim()!==t.trim(),a=g_(e),s=E_(e)||e.type===Z.Error;return m.jsxs("div",{children:[m.jsxs("button",{type:"button",onClick:()=>i&&r(!n),"aria-expanded":i?n:void 0,className:`group flex items-center gap-1.5 py-0.5 text-xs w-full text-left ${i?"cursor-pointer":"cursor-default"}`,children:[m.jsx("span",{className:"shrink-0 w-3.5 h-3.5 flex items-center justify-center",children:s?m.jsx("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",children:m.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"rgb(248 113 113)",strokeWidth:"1.5",strokeLinecap:"round"})}):a?m.jsx("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",children:m.jsx("path",{d:"M2 5.5l2 2 4-4.5",stroke:"rgb(52 211 153)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):m.jsx("span",{className:"w-1 h-1 rounded-full bg-neutral-300"})}),m.jsx("span",{className:"truncate text-neutral-400 font-mono",children:t}),i&&m.jsx("span",{className:"ml-auto shrink-0 opacity-0 group-hover:opacity-100 transition-opacity text-neutral-300",children:n?m.jsx(bu,{size:10}):m.jsx(Cn,{size:10})})]}),n&&i&&m.jsx("div",{className:"ml-5 mt-0.5 mb-1 rounded-md bg-neutral-50 border border-neutral-100 overflow-x-auto",children:m.jsx("code",{className:"block p-2.5 text-[11px] font-mono text-neutral-500 leading-relaxed whitespace-pre-wrap break-all",children:e.content})})]})});_c.displayName="ToolGroupItem";const Ac=C.memo(({content:e,compact:t})=>m.jsx("div",{className:`text-neutral-900 whitespace-pre-wrap min-w-0 ${t?"text-[13px] leading-5":"text-sm leading-6"}`,children:e}));Ac.displayName="AgentText";const kc=C.memo(({content:e,compact:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:a,downloadSessionId:s})=>m.jsx("div",{className:`text-neutral-900 min-w-0 ${t?"text-[13px] leading-5":"text-sm leading-6"}`,children:m.jsx(ha,{className:"space-y-2",content:e,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:a,downloadSessionId:s})}));kc.displayName="AssistantMessage";const Cc=C.memo(({content:e})=>m.jsx("div",{className:"my-2 rounded-lg border border-red-200 bg-red-50 px-4 py-3",children:m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx("svg",{className:"shrink-0 mt-0.5 w-4 h-4 text-red-500",viewBox:"0 0 16 16",fill:"currentColor",children:m.jsx("path",{fillRule:"evenodd",d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM7.25 5a.75.75 0 011.5 0v3a.75.75 0 01-1.5 0V5zm.75 6.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})}),m.jsx("pre",{className:"text-xs text-red-700 leading-relaxed whitespace-pre-wrap break-all min-w-0",children:e})]})}));Cc.displayName="ErrorMessage";const yc=C.memo(({content:e})=>m.jsx("div",{className:"my-2 rounded-lg border border-amber-200 bg-amber-50/70 px-4 py-3",children:m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx("svg",{className:"shrink-0 mt-0.5 w-4 h-4 text-amber-500",viewBox:"0 0 16 16",fill:"currentColor",children:m.jsx("path",{fillRule:"evenodd",d:"M7.13 2.05a1 1 0 011.74 0l5.55 9.87A1 1 0 0113.55 13H2.45a1 1 0 01-.87-1.08l5.55-9.87zM7.25 6a.75.75 0 011.5 0v2.5a.75.75 0 01-1.5 0V6zM8 11.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})}),m.jsx("pre",{className:"text-xs text-amber-800 leading-relaxed whitespace-pre-wrap break-all min-w-0",children:e})]})}));yc.displayName="WarningMessage";const Ti=C.memo(({logs:e,duration:t,collapsible:n,onBeforeToggle:r,workingDir:i,onOpenWorkspaceFile:a,onOpenPreviewUrl:s,onOpenVisualization:u,downloadSessionId:o})=>{const{t:c}=sr(),[h,d]=C.useState(!1),f=t?c("已处理 {duration}",{duration:t}):c("已处理"),p=m.jsxs(m.Fragment,{children:[m.jsx("span",{children:f}),n&&m.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center transition-transform duration-200 motion-reduce:transition-none",style:{transform:h?"rotate(90deg)":"rotate(0deg)"},children:m.jsx(Cn,{size:14,strokeWidth:2})})]});return m.jsxs("div",{className:"mb-3 mt-1",children:[n?m.jsx("button",{type:"button","aria-expanded":h,onClick:()=>{r?.(),d(E=>!E)},className:"group flex w-full items-center gap-1.5 border-b border-neutral-100 py-2 text-left text-sm leading-6 text-neutral-500 transition-colors hover:text-neutral-700",children:p}):m.jsx("div",{role:"status",className:"flex w-full items-center gap-1.5 border-b border-neutral-100 py-2 text-sm leading-6 text-neutral-500",children:p}),n&&m.jsx("div",{"data-processed-content":!0,"aria-hidden":!h,inert:!h,className:`grid overflow-hidden transition-[grid-template-rows,opacity] duration-200 ease-out motion-reduce:transition-none ${h?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:m.jsx("div",{className:"min-h-0 overflow-hidden",children:m.jsx("div",{className:"pb-1 pt-2",children:En(e,i,a,s,u,o)})})})]})});Ti.displayName="ProcessedGroup";function hu(e,t){const n=Math.max(0,Math.floor(e/1e3));if(n<60)return t("{count} 秒",{count:n});const r=Math.floor(n/60),i=n%60;if(r<60)return t("{minutes} 分 {seconds} 秒",{minutes:r,seconds:i});const a=Math.floor(r/60),s=r%60;return t("{hours} 小时 {minutes} 分",{hours:a,minutes:s})}const Nc=C.memo(({activity:e})=>{const{t}=sr(),n=C.useRef(Date.now()),[r,i]=C.useState(()=>Date.now()),a=e?.processingStartedAt??n.current;C.useEffect(()=>{const c=window.setInterval(()=>i(Date.now()),1e3);return()=>window.clearInterval(c)},[]);const s=hu(r-a,t),u=e?.lastOutputAt==null?null:hu(r-e.lastOutputAt,t),o=t("正在思考");return m.jsx($x,{align:"start",content:m.jsxs("div",{className:"flex min-w-max flex-col gap-0.5",children:[m.jsx("span",{children:t("已处理 {duration}",{duration:s})}),m.jsx("span",{className:"text-neutral-300",children:u?t("最后一次输出于 {duration}前",{duration:u}):t("等待首次输出")})]}),children:m.jsx("span",{tabIndex:0,"aria-label":o,className:"inline-flex cursor-help select-none py-1 text-sm font-normal outline-none focus-visible:ring-2 focus-visible:ring-ring/50",children:m.jsx("span",{className:"agent-thinking-shimmer","aria-hidden":"true",children:Array.from(o).map((c,h)=>m.jsx("span",{className:"agent-thinking-char",style:{animationDelay:`${h*45}ms`},children:c},`${c}-${h}`))})})})});Nc.displayName="ThinkingIndicator";function I_(e,t,n,r,i,a,s){if(e.kind==="execution-group")return m.jsx(bi,{logs:e.logs});const u=e.log;if(u.type===Z.Tool&&u.children?.length)return m.jsx(bi,{logs:u.children});if(ca(u))return null;if(u.title==="Thinking"||u.content.startsWith("Thinking:"))return m.jsx(da,{content:u.content,isOpenDefault:!0});switch(u.type){case Z.User:return m.jsx(xc,{content:u.content,compact:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i});case Z.Tool:return m.jsx(Ei,{type:u.type,title:u.title||"Tool",content:u.content});case Z.Action:return m.jsx(Ei,{type:u.type,title:"Action",content:u.content});case Z.Assistant:return m.jsx(kc,{content:u.content,compact:t,workingDir:n,onOpenWorkspaceFile:r,onOpenPreviewUrl:i,onOpenVisualization:a,downloadSessionId:s});case Z.Info:return u.tokenUsage?null:m.jsx(Ac,{content:u.content,compact:t});case Z.Error:return m.jsx(Cc,{content:u.content});case Z.Warning:return m.jsx(yc,{content:u.content});case Z.Cursor:return m.jsx(Nc,{activity:u.cursorActivity});default:return null}}function En(e,t,n,r,i,a){return A_(e).map(s=>{const u=I_(s,!1,t,n,r,i,a);return u?m.jsx("div",{children:u},s.key):null})}function S_(e,t,n,r,i,a,s,u,o){const c=e.user?En([e.user],i,a,s,u,o):null;if(!t)return m.jsxs(m.Fragment,{children:[c,m.jsx(Ti,{logs:[],duration:lu(e,n),collapsible:!1}),En(e.agentLogs,i,a,s,u,o)]});if(e.agentLogs.length===0)return c;const h=C_(e.agentLogs),d=h>=0?e.agentLogs.slice(0,h):e.agentLogs,f=h>=0?e.agentLogs.slice(h):[],p=d.some(E=>!ca(E));return m.jsxs(m.Fragment,{children:[c,m.jsx(Ti,{logs:d,duration:lu(e,n),collapsible:p,onBeforeToggle:r,workingDir:i,onOpenWorkspaceFile:a,onOpenPreviewUrl:s,onOpenVisualization:u,downloadSessionId:o}),En(f,i,a,s,u,o)]})}const p3=C.forwardRef(function({logs:t,isOutputActive:n,lastExitAt:r,onUserToggleDetails:i,scrollElementRef:a,workingDir:s,onOpenWorkspaceFile:u,onOpenPreviewUrl:o,onOpenVisualization:c,downloadSessionId:h},d){const f=C.useMemo(()=>n===void 0?null:k_(t),[n,t]),[p,E]=C.useState(()=>Date.now());return C.useEffect(()=>{if(!n)return;const A=()=>E(Date.now()),N=window.setTimeout(A,0),k=window.setInterval(A,1e3);return()=>{window.clearTimeout(N),window.clearInterval(k)}},[n]),C.useImperativeHandle(d,()=>({scrollToBottom:(A="instant")=>{a?.current&&a.current.scrollTo({top:a.current.scrollHeight,behavior:A})}}),[a]),m.jsx("div",{className:"w-full mx-auto pb-4 min-w-0",style:{overflowWrap:"anywhere"},children:f?f.map((A,N)=>m.jsx("div",{children:S_(A,N<f.length-1||!n,N===f.length-1?n?p:r:void 0,i,s,u,o,c,h)},A.key)):En(t,s,u,o,c,h)})}),w_=At();function L_(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function m3({files:e,onRemove:t}){return e.length===0?null:m.jsx("div",{"aria-label":"Attachments",className:"flex flex-wrap gap-2 px-4 pt-3 pb-1",children:e.map(n=>m.jsx(O_,{item:n,onRemove:t},n.tempId))})}function O_({item:e,onRemove:t}){const n=e.file.type.startsWith("image/"),r=e.status==="error",i=e.status==="uploading";return m.jsxs("div",{className:`relative group flex items-center gap-2 px-3 py-2 rounded-lg border text-xs max-w-[200px] ${r?"border-red-200 bg-red-50 text-red-600":"border-neutral-200 bg-neutral-50 text-neutral-700"}`,children:[n&&e.status==="done"&&e.attachment?m.jsx("img",{src:`${w_}${e.attachment.url}`,alt:e.file.name,className:"w-8 h-8 rounded object-cover flex-shrink-0"}):m.jsx("span",{className:"flex-shrink-0",children:i?m.jsx(zc,{size:16,className:"animate-spin text-neutral-400"}):n?m.jsx(Zc,{size:16,className:"text-neutral-400"}):m.jsx(Qc,{size:16,className:"text-neutral-400"})}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"truncate font-medium",children:e.file.name}),r?m.jsx("div",{className:"truncate text-red-500",children:e.error}):m.jsx("div",{className:"text-neutral-400",children:L_(e.file.size)})]}),m.jsx("button",{onClick:()=>t(e.tempId),className:"absolute -top-1.5 -right-1.5 hidden group-hover:flex items-center justify-center w-5 h-5 rounded-full bg-neutral-700 text-white hover:bg-neutral-900 transition-colors",children:m.jsx($c,{size:10})})]})}const R_=At();async function D_(e){const t=new FormData;t.append("file",e);const n=await fetch(`${R_}/attachments/upload`,{method:"POST",body:t});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||`Upload failed (${n.status})`)}return n.json()}let P_=0;function g3(){const[e,t]=C.useState([]),n=C.useRef(e);n.current=e;const r=C.useCallback(async d=>{const f=d.map(p=>({tempId:`tmp-${++P_}`,file:p,progress:0,status:"uploading"}));t(p=>[...p,...f]),await Promise.allSettled(f.map(async p=>{try{const E=await D_(p.file);t(A=>A.map(N=>N.tempId===p.tempId?{...N,status:"done",progress:100,attachment:E}:N))}catch(E){t(A=>A.map(N=>N.tempId===p.tempId?{...N,status:"error",error:E instanceof Error?E.message:"Upload failed"}:N))}}))},[]),i=C.useCallback(()=>n.current.filter(d=>d.status==="done"&&d.attachment).map(d=>d.attachment),[]),a=C.useCallback(d=>{t(f=>f.filter(p=>p.tempId!==d))},[]),s=C.useCallback(()=>{t([])},[]),u=C.useCallback(d=>{d.length!==0&&t(f=>{const p=new Set(f.map(A=>A.attachment?.id??A.tempId)),E=d.filter(A=>{const N=A.attachment?.id??A.tempId;return p.has(N)?!1:(p.add(N),!0)});return E.length>0?[...f,...E]:f})},[]),o=C.useCallback(()=>{const d=i();return d.length===0?"":d.map(f=>`${f.mimeType.startsWith("image/")?"!":""}[${f.originalName}](${f.storagePath})`).join(`
|