agent-tower 0.5.2 → 0.5.3-beta.1
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/cli.js +14 -0
- package/dist/cli.js.map +1 -1
- package/dist/executors/__tests__/base.executor.test.js +12 -0
- package/dist/executors/__tests__/base.executor.test.js.map +1 -1
- package/dist/executors/execution-env.d.ts +1 -1
- package/dist/executors/execution-env.d.ts.map +1 -1
- package/dist/executors/execution-env.js +4 -0
- package/dist/executors/execution-env.js.map +1 -1
- package/dist/routes/conversations.d.ts +3 -0
- package/dist/routes/conversations.d.ts.map +1 -0
- package/dist/routes/conversations.js +102 -0
- package/dist/routes/conversations.js.map +1 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +3 -0
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/sessions.d.ts.map +1 -1
- package/dist/routes/sessions.js +37 -21
- package/dist/routes/sessions.js.map +1 -1
- package/dist/services/__tests__/conversation.service.test.d.ts +2 -0
- package/dist/services/__tests__/conversation.service.test.d.ts.map +1 -0
- package/dist/services/__tests__/conversation.service.test.js +102 -0
- package/dist/services/__tests__/conversation.service.test.js.map +1 -0
- package/dist/services/commit-message.service.d.ts.map +1 -1
- package/dist/services/commit-message.service.js +4 -0
- package/dist/services/commit-message.service.js.map +1 -1
- package/dist/services/conversation.service.d.ts +26 -0
- package/dist/services/conversation.service.d.ts.map +1 -0
- package/dist/services/conversation.service.js +224 -0
- package/dist/services/conversation.service.js.map +1 -0
- package/dist/services/session-manager.d.ts +69 -13
- package/dist/services/session-manager.d.ts.map +1 -1
- package/dist/services/session-manager.js +107 -42
- package/dist/services/session-manager.js.map +1 -1
- package/dist/services/task.service.d.ts +2 -2
- package/dist/services/terminal-manager.d.ts.map +1 -1
- package/dist/services/terminal-manager.js +2 -0
- package/dist/services/terminal-manager.js.map +1 -1
- package/dist/services/workspace.service.d.ts +9 -7
- package/dist/services/workspace.service.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -1
- package/dist/web/agent-icons/claude-code.svg +1 -0
- package/dist/web/agent-icons/codex.svg +1 -0
- package/dist/web/agent-icons/cursor-agent.svg +1 -0
- package/dist/web/agent-icons/gemini-cli.svg +1 -0
- package/dist/web/assets/AgentDemoPage-Cc1sKLmE.js +1 -0
- package/dist/web/assets/AgentLogo-DQId6FqS.js +1 -0
- package/dist/web/assets/ConversationPage-BXDIbwTR.js +3 -0
- package/dist/web/assets/CreateTaskInput-CDynnXvO.js +2 -0
- package/dist/web/assets/{DemoPage-Xc4QRNUj.js → DemoPage-BeL28u5_.js} +2 -2
- package/dist/web/assets/{GeneralSettingsPage-DWKl6BHA.js → GeneralSettingsPage-CFc1CWWl.js} +1 -1
- package/dist/web/assets/Icons-EVcY239B.js +1 -0
- package/dist/web/assets/LoadingPreviewPage-CRwEvHz_.js +1 -0
- package/dist/web/assets/{McpSettingsPage-BHEMUq7Z.js → McpSettingsPage-BujDKp8T.js} +1 -1
- package/dist/web/assets/{MemberAvatar-b_WKLu8w.js → MemberAvatar-Bvlu6rk3.js} +1 -1
- package/dist/web/assets/NotificationSettingsPage-Dsn-5Uft.js +1 -0
- package/dist/web/assets/ProfileSettingsPage-CuhQBP_t.js +3 -0
- package/dist/web/assets/ProjectKanbanPage-DiEo6BK_.js +89 -0
- package/dist/web/assets/ProjectSettingsPage-Cj46vZYF.js +2 -0
- package/dist/web/assets/ProviderSettingsPage-G7pPagR6.js +54 -0
- package/dist/web/assets/{SettingsMasterDetail-Cx9Ylq9N.js → SettingsMasterDetail-_vE8P7ke.js} +1 -1
- package/dist/web/assets/TeamSettingsPage-CC_QgVbE.js +1 -0
- package/dist/web/assets/arc-DWusz5nt.js +1 -0
- package/dist/web/assets/architectureDiagram-3BPJPVTR-BzUiKOFe.js +36 -0
- package/dist/web/assets/{arrow-left-DcUokonk.js → arrow-left-C_pxdzZL.js} +1 -1
- package/dist/web/assets/{blockDiagram-GPEHLZMM-DEDpa_4t.js → blockDiagram-GPEHLZMM-BGx2sLYW.js} +1 -1
- package/dist/web/assets/{c4Diagram-AAUBKEIU-BgS3ci_x.js → c4Diagram-AAUBKEIU-BCihVD7R.js} +1 -1
- package/dist/web/assets/channel-BBvaRDfe.js +1 -0
- package/dist/web/assets/check-C7Na6M49.js +1 -0
- package/dist/web/assets/{chevron-down-DuDzRplH.js → chevron-down-DuZqUX3d.js} +1 -1
- package/dist/web/assets/{chevron-right-BezhysME.js → chevron-right-BTjA7BSq.js} +1 -1
- package/dist/web/assets/{chevron-up-DtQ85g91.js → chevron-up-BeZXjQ4W.js} +1 -1
- package/dist/web/assets/{chunk-2J33WTMH-BnpAjP2E.js → chunk-2J33WTMH-BVhYZ0vK.js} +1 -1
- package/dist/web/assets/{chunk-4BX2VUAB-DNUdFpBR.js → chunk-4BX2VUAB-amtolJb4.js} +1 -1
- package/dist/web/assets/{chunk-55IACEB6-CTj6ihx_.js → chunk-55IACEB6-Bi5q9Evi.js} +1 -1
- package/dist/web/assets/{chunk-727SXJPM-yKiHVB7X.js → chunk-727SXJPM-Bb_qV3PR.js} +1 -1
- package/dist/web/assets/{chunk-AQP2D5EJ-njbMVjqc.js → chunk-AQP2D5EJ-BhFBU2pH.js} +1 -1
- package/dist/web/assets/{chunk-FMBD7UC4-h0jEUL75.js → chunk-FMBD7UC4-CbBz10YF.js} +1 -1
- package/dist/web/assets/{chunk-ND2GUHAM-DjMFJZNr.js → chunk-ND2GUHAM-B930BNNl.js} +1 -1
- package/dist/web/assets/{chunk-QZHKN3VN-odAhWIp4.js → chunk-QZHKN3VN-YlRfC0oD.js} +1 -1
- package/dist/web/assets/{circle-alert-IhLKVEi9.js → circle-alert-DCm2E91k.js} +1 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-XuAtffBc.js +1 -0
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-XuAtffBc.js +1 -0
- package/dist/web/assets/code-block-OCS4YCEC-ImXQka3_.js +2 -0
- package/dist/web/assets/{confirm-dialog-Amksh2QM.js → confirm-dialog-Cc27tq8j.js} +1 -1
- package/dist/web/assets/{cose-bilkent-S5V4N54A-Ds62_zKQ.js → cose-bilkent-S5V4N54A-Di3PzbLp.js} +1 -1
- package/dist/web/assets/{dagre-BM42HDAG-De9CyhMh.js → dagre-BM42HDAG-DD7qiU9m.js} +1 -1
- package/dist/web/assets/{diagram-2AECGRRQ-Db7DRtzA.js → diagram-2AECGRRQ-Bgr-CjRi.js} +1 -1
- package/dist/web/assets/{diagram-5GNKFQAL-DXeGI1-M.js → diagram-5GNKFQAL-CvRORhH2.js} +1 -1
- package/dist/web/assets/{diagram-KO2AKTUF-Llle6qEC.js → diagram-KO2AKTUF-CkVyLyvM.js} +1 -1
- package/dist/web/assets/{diagram-LMA3HP47-BcK1LGRh.js → diagram-LMA3HP47-B-CPQQuU.js} +1 -1
- package/dist/web/assets/{diagram-OG6HWLK6-0_sJ3YRD.js → diagram-OG6HWLK6-DXow9CgH.js} +1 -1
- package/dist/web/assets/{erDiagram-TEJ5UH35-BjT0k23c.js → erDiagram-TEJ5UH35-BPLJJwjL.js} +1 -1
- package/dist/web/assets/{flowDiagram-I6XJVG4X-kaKS6P_m.js → flowDiagram-I6XJVG4X-ggyugmK6.js} +1 -1
- package/dist/web/assets/folder-B35uD7uF.js +1 -0
- package/dist/web/assets/folder-picker-DFxfUtH5.js +1 -0
- package/dist/web/assets/{ganttDiagram-6RSMTGT7-CW8IoCY6.js → ganttDiagram-6RSMTGT7-317n6mcW.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-PVQCEYII-C5-QVJMh.js → gitGraphDiagram-PVQCEYII-DTUyiJew.js} +1 -1
- package/dist/web/assets/{index-Du7RXa9t.js → index-BwKL3rKp.js} +5 -5
- package/dist/web/assets/index-DgO-2xBV.css +1 -0
- package/dist/web/assets/index-OY1TIdAK.js +120 -0
- package/dist/web/assets/{infoDiagram-5YYISTIA-CG7QnPme.js → infoDiagram-5YYISTIA-1GXYdkvW.js} +1 -1
- package/dist/web/assets/{input-BxcpVmsb.js → input-6lLP89Y3.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-DitLiYai.js → ishikawaDiagram-YF4QCWOH-DSGxwLxL.js} +1 -1
- package/dist/web/assets/{journeyDiagram-JHISSGLW-EKXFhiai.js → journeyDiagram-JHISSGLW-Bk9wMzSo.js} +1 -1
- package/dist/web/assets/{kanban-definition-UN3LZRKU-Ckbr1P9R.js → kanban-definition-UN3LZRKU-BW3QAONh.js} +4 -4
- package/dist/web/assets/{layers-Dqjek9Kd.js → layers-CDcLPjE5.js} +1 -1
- package/dist/web/assets/{linear-HA2k3O-l.js → linear-DTyT0tZy.js} +1 -1
- package/dist/web/assets/{loader-circle-B4v8mirO.js → loader-circle-DDrZegLO.js} +1 -1
- package/dist/web/assets/mermaid-NOHMQCX5-CeIvIbfU.js +122 -0
- package/dist/web/assets/{message-square-B-2bz9LU.js → message-square-CunpcgQi.js} +1 -1
- package/dist/web/assets/{mindmap-definition-RKZ34NQL-ByCTUtXz.js → mindmap-definition-RKZ34NQL-CMuh1LCP.js} +2 -2
- package/dist/web/assets/modal-D8uSzIAd.js +1 -0
- package/dist/web/assets/{pencil-DzjmtIoi.js → pencil-BTaYfjKo.js} +1 -1
- package/dist/web/assets/{pieDiagram-4H26LBE5-DeQnXQoJ.js → pieDiagram-4H26LBE5-8PB3-bCK.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-W4KKPZXB--ocdxSbH.js → quadrantDiagram-W4KKPZXB-Dpf14KEr.js} +1 -1
- package/dist/web/assets/{requirementDiagram-4Y6WPE33-CJq21gDX.js → requirementDiagram-4Y6WPE33-ClTLx63o.js} +1 -1
- package/dist/web/assets/{rotate-ccw-BhUVdZv6.js → rotate-ccw-bVmcWqcA.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-5OEKKPKP-U373GNMv.js → sankeyDiagram-5OEKKPKP-ChlGi0jn.js} +1 -1
- package/dist/web/assets/select-tNVeGe-v.js +1 -0
- package/dist/web/assets/{sequenceDiagram-3UESZ5HK-BuH8el8s.js → sequenceDiagram-3UESZ5HK-6tJ810tk.js} +1 -1
- package/dist/web/assets/{stateDiagram-AJRCARHV-CqZ_L1ch.js → stateDiagram-AJRCARHV-Cc5dwA5r.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-EVHRu9u3.js +1 -0
- package/dist/web/assets/{switch-DsjSr4nv.js → switch-7jE2n-KP.js} +1 -1
- package/dist/web/assets/{terminal-JXRig8oL.js → terminal-D5iU4zAj.js} +1 -1
- package/dist/web/assets/{textarea-BzeEPT1A.js → textarea-DVa2Yvj4.js} +1 -1
- package/dist/web/assets/{timeline-definition-PNZ67QCA-BIrIbCOG.js → timeline-definition-PNZ67QCA-q32Hcn4m.js} +3 -3
- package/dist/web/assets/trash-2-z7TLHqpU.js +1 -0
- package/dist/web/assets/{upload-BwkqnAVE.js → upload-DeI535ZH.js} +1 -1
- package/dist/web/assets/{use-profiles-DcyUHq0p.js → use-profiles-BS_Mkp5d.js} +1 -1
- package/dist/web/assets/{use-providers-BWgjPVX8.js → use-providers-CWfLQ--R.js} +1 -1
- package/dist/web/assets/useNormalizedLogs-DW37m6Ji.js +1 -0
- package/dist/web/assets/{vennDiagram-CIIHVFJN-Dmk1mluX.js → vennDiagram-CIIHVFJN-VxBXMI4P.js} +5 -5
- package/dist/web/assets/{wardley-L42UT6IY-CEY4M7Op.js → wardley-L42UT6IY-BvNOQGfh.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-YWT4CUSO-CiK-Q213.js → wardleyDiagram-YWT4CUSO-DMTZkLB4.js} +1 -1
- package/dist/web/assets/{xychartDiagram-2RQKCTM6-C5rj3Hpu.js → xychartDiagram-2RQKCTM6-BaJ2kymJ.js} +1 -1
- package/dist/web/index.html +2 -2
- package/node_modules/@agent-tower/shared/dist/types.d.ts +41 -1
- package/node_modules/@agent-tower/shared/dist/types.d.ts.map +1 -1
- package/node_modules/@agent-tower/shared/dist/types.js +8 -0
- package/node_modules/@agent-tower/shared/dist/types.js.map +1 -1
- package/node_modules/@prisma/client/.prisma/client/edge.js +21 -6
- package/node_modules/@prisma/client/.prisma/client/index-browser.js +14 -0
- package/node_modules/@prisma/client/.prisma/client/index.d.ts +1789 -211
- package/node_modules/@prisma/client/.prisma/client/index.js +21 -6
- package/node_modules/@prisma/client/.prisma/client/package.json +1 -1
- package/node_modules/@prisma/client/.prisma/client/schema.prisma +34 -14
- package/node_modules/@prisma/client/.prisma/client/wasm.js +14 -0
- package/package.json +1 -1
- package/prisma/migrations/20260618000000_add_conversations/migration.sql +79 -0
- package/prisma/schema.prisma +22 -2
- package/dist/web/assets/AgentDemoPage-DAdN5g19.js +0 -1
- package/dist/web/assets/NotificationSettingsPage-C2KeYegv.js +0 -1
- package/dist/web/assets/ProfileSettingsPage-CVOCVwVK.js +0 -3
- package/dist/web/assets/ProjectKanbanPage-J_5GxZQ7.js +0 -90
- package/dist/web/assets/ProjectSettingsPage-CP3V8oAJ.js +0 -2
- package/dist/web/assets/ProviderSettingsPage-DQ_IDUUZ.js +0 -54
- package/dist/web/assets/TeamSettingsPage-BHE2x82g.js +0 -1
- package/dist/web/assets/arc-D31VhUJX.js +0 -1
- package/dist/web/assets/architectureDiagram-3BPJPVTR-Ak9jpJ8q.js +0 -36
- package/dist/web/assets/channel-BLjA9Brq.js +0 -1
- package/dist/web/assets/check-DyTLNLlk.js +0 -1
- package/dist/web/assets/classDiagram-4FO5ZUOK-DHqakOiv.js +0 -1
- package/dist/web/assets/classDiagram-v2-Q7XG4LA2-DHqakOiv.js +0 -1
- package/dist/web/assets/code-block-OCS4YCEC-4ofbxqu2.js +0 -2
- package/dist/web/assets/folder-picker-CbAfVBHD.js +0 -1
- package/dist/web/assets/index-Bd5HU-dB.js +0 -13
- package/dist/web/assets/index-LbQD7FZK.css +0 -1
- package/dist/web/assets/log-adapter-CtvxzS4j.js +0 -1
- package/dist/web/assets/mermaid-NOHMQCX5-C2N-Y-YP.js +0 -122
- package/dist/web/assets/modal-C6m1dmin.js +0 -1
- package/dist/web/assets/select-CCf5nwYs.js +0 -1
- package/dist/web/assets/stateDiagram-v2-BHNVJYJU-DkD_6IX-.js +0 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-block-OCS4YCEC-ImXQka3_.js","assets/index-OY1TIdAK.js","assets/index-DgO-2xBV.css","assets/chevron-right-BTjA7BSq.js","assets/chevron-down-DuZqUX3d.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as Ku,r as y,j as E,aG as hc,aH as fc,aq as Xu,g as Zu,u as dc,aI as pc}from"./index-OY1TIdAK.js";import{C as er}from"./chevron-right-BTjA7BSq.js";import{C as Ju}from"./chevron-down-DuZqUX3d.js";var ua;(function(e){e.TODO="TODO",e.IN_PROGRESS="IN_PROGRESS",e.IN_REVIEW="IN_REVIEW",e.DONE="DONE",e.CANCELLED="CANCELLED"})(ua||(ua={}));var sa;(function(e){e.ACTIVE="ACTIVE",e.MERGED="MERGED",e.ABANDONED="ABANDONED",e.HIBERNATED="HIBERNATED"})(sa||(sa={}));var oa;(function(e){e.WORKTREE="WORKTREE",e.MAIN_DIRECTORY="MAIN_DIRECTORY"})(oa||(oa={}));var ze;(function(e){e.CLAUDE_CODE="CLAUDE_CODE",e.GEMINI_CLI="GEMINI_CLI",e.CURSOR_AGENT="CURSOR_AGENT",e.CODEX="CODEX"})(ze||(ze={}));var la;(function(e){e.PENDING="PENDING",e.RUNNING="RUNNING",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.CANCELLED="CANCELLED"})(la||(la={}));var ca;(function(e){e.CHAT="CHAT",e.COMMIT_MSG="COMMIT_MSG"})(ca||(ca={}));var ha;(function(e){e.WORKSPACE="WORKSPACE",e.CONVERSATION="CONVERSATION"})(ha||(ha={}));var fa;(function(e){e.REBASE="REBASE",e.MERGE="MERGE"})(fa||(fa={}));var re;(function(e){e.Action="Action",e.Assistant="Assistant",e.Info="Info",e.Tool="Tool",e.User="User",e.Cursor="Cursor",e.Error="Error"})(re||(re={}));function mc(e){const t=e.metadata?.toolName||"Tool",n=e.metadata?.action,r=e.metadata?.status,a=n?{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"}[n]:t;return r==="success"?`${a} ✓`:r==="failed"?`${a} ✗`:r==="pending_approval"?`${a} (待审批)`:a}function gc(e){switch(e.entryType){case"user_message":case"user_feedback":return{id:e.id,type:re.User,content:e.content};case"assistant_message":return{id:e.id,type:re.Assistant,content:e.content};case"next_action":return{id:e.id,type:re.Action,content:e.content};case"thinking":return{id:e.id,type:re.Info,title:"Thinking",content:e.content};case"tool_use":return{id:e.id,type:re.Tool,title:mc(e),content:e.content,isCollapsed:e.metadata?.status==="success",tool:{action:e.metadata?.action,name:e.metadata?.toolName,id:e.metadata?.toolId,status:e.metadata?.status}};case"error_message":return{id:e.id,type:re.Error,content:e.content};case"system_message":return{id:e.id,type:re.Info,content:e.content};case"loading":return{id:e.id,type:re.Cursor,content:""};case"token_usage_info":if(e.metadata?.tokenUsage){const{totalTokens:t=0,modelContextWindow:n}=e.metadata.tokenUsage;return{id:e.id,type:re.Info,content:e.content,tokenUsage:{totalTokens:t,modelContextWindow:n}}}return null;default:return null}}function Px(e){return e.map(gc).filter(t=>t!==null)}function Mx(){return{id:`cursor-${Date.now()}`,type:re.Cursor,content:""}}const tr=(function(e){if(e==null)return xc;if(typeof e=="function")return nr(e);if(typeof e=="object")return Array.isArray(e)?Ec(e):bc(e);if(typeof e=="string")return Tc(e);throw new Error("Expected function, string, or object as test")});function Ec(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=tr(e[n]);return nr(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function bc(e){const t=e;return nr(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Tc(e){return nr(t);function t(n){return n&&n.type===e}}function nr(e){return t;function t(n,r,i){return!!(_c(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function xc(){return!0}function _c(e){return e!==null&&typeof e=="object"&&"type"in e}const es=[],Jt=!0,Ur=!1,zn="skip";function gi(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=tr(i),u=r?-1:1;s(e,void 0,[])();function s(o,c,h){const f=o&&typeof o=="object"?o:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(o.type+(p?"<"+p+">":""))+")"})}return d;function d(){let p=es,b,A,S;if((!t||a(o,c,h[h.length-1]||void 0))&&(p=Ac(n(o,h)),p[0]===Ur))return p;if("children"in o&&o.children){const C=o;if(C.children&&p[0]!==zn)for(A=(r?C.children.length:-1)+u,S=h.concat(C);A>-1&&A<C.children.length;){const R=C.children[A];if(b=s(R,A,S)(),b[0]===Ur)return b;A=typeof b[1]=="number"?b[1]:A+u}}return p}}}function Ac(e){return Array.isArray(e)?e:typeof e=="number"?[Jt,e]:e==null?es:[e]}function at(e,t,n,r){let i,a,u;typeof t=="function"&&typeof n!="function"?(a=void 0,u=t,i=n):(a=t,u=n,i=r),gi(e,a,s,i);function s(o,c){const h=c[c.length-1],f=h?h.children.indexOf(o):void 0;return u(o,f,h)}}function kc({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:u="text-gray-500"}){const s=t.length&&!t.every(c=>c==="*"),o=n.length&&!n.every(c=>c==="*");if(!e&&(s||o))throw new Error("defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided");return c=>{const h=Ic(e,t,n,r,i,a,u);at(c,h)}}function da(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 Cc(e){return typeof e!="string"?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}const yc=new Set(["https:","http:","irc:","ircs:","mailto:","xmpp:","blob:"]),Nc=new Set(["javascript:","data:","file:","vbscript:"]);function pa(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 u=da(e,n);if(!u||Nc.has(u.protocol)||!(yc.has(u.protocol)||a.includes(u.protocol)||a.includes("*")))return null;if(u.protocol==="mailto:"||!u.protocol.match(/^https?:$/))return u.href;const o=Cc(e);return u&&t.some(c=>{const h=da(c,n);return!h||h.origin!==u.origin?!1:u.href.startsWith(h.href)})?o?u.pathname+u.search+u.hash:u.href:t.includes("*")?u.protocol!=="https:"&&u.protocol!=="http:"?null:o?u.pathname+u.search+u.hash:u.href:null}const br=Symbol("node-seen"),Ic=(e,t,n,r,i,a,u)=>{const s=(o,c,h)=>{if(o.type!=="element"||o[br])return Jt;if(o.tagName==="a"){const f=pa(o.properties.href,t,e,!1,!1,i);return f===null?(o[br]=!0,at(o,s),h&&typeof c=="number"&&(h.children[c]={type:"element",tagName:"span",properties:{title:"Blocked URL: "+String(o.properties.href),class:u},children:[...o.children,{type:"text",value:" [blocked]"}]}),zn):(o.properties.href=f,o.properties.target="_blank",o.properties.rel="noopener noreferrer",Jt)}if(o.tagName==="img"){const f=pa(o.properties.src,n,e,r,!0,i);return f===null?(o[br]=!0,at(o,s),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")+"]"}]}),zn):(o.properties.src=f,Jt)}return Jt};return s},ts=-1,rr=0,nn=1,$n=2,Ei=3,bi=4,Ti=5,xi=6,ns=7,rs=8,ma=typeof self=="object"?self:globalThis,Sc=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,u]=t[i];switch(a){case rr:case ts:return n(u,i);case nn:{const s=n([],i);for(const o of u)s.push(r(o));return s}case $n:{const s=n({},i);for(const[o,c]of u)s[r(o)]=r(c);return s}case Ei:return n(new Date(u),i);case bi:{const{source:s,flags:o}=u;return n(new RegExp(s,o),i)}case Ti:{const s=n(new Map,i);for(const[o,c]of u)s.set(r(o),r(c));return s}case xi:{const s=n(new Set,i);for(const o of u)s.add(r(o));return s}case ns:{const{name:s,message:o}=u;return n(new ma[s](o),i)}case rs:return n(BigInt(u),i);case"BigInt":return n(Object(BigInt(u)),i);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:s}=new Uint8Array(u);return n(new DataView(s),u)}}return n(new ma[a](u),i)};return r},ga=e=>Sc(new Map,e)(0),St="",{toString:wc}={},{keys:Lc}=Object,qt=e=>{const t=typeof e;if(t!=="object"||!e)return[rr,t];const n=wc.call(e).slice(8,-1);switch(n){case"Array":return[nn,St];case"Object":return[$n,St];case"Date":return[Ei,St];case"RegExp":return[bi,St];case"Map":return[Ti,St];case"Set":return[xi,St];case"DataView":return[nn,n]}return n.includes("Array")?[nn,n]:n.includes("Error")?[ns,n]:[$n,n]},Ln=([e,t])=>e===rr&&(t==="function"||t==="symbol"),Oc=(e,t,n,r)=>{const i=(u,s)=>{const o=r.push(u)-1;return n.set(s,o),o},a=u=>{if(n.has(u))return n.get(u);let[s,o]=qt(u);switch(s){case rr:{let h=u;switch(o){case"bigint":s=rs,h=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+o);h=null;break;case"undefined":return i([ts],u)}return i([s,h],u)}case nn:{if(o){let d=u;return o==="DataView"?d=new Uint8Array(u.buffer):o==="ArrayBuffer"&&(d=new Uint8Array(u)),i([o,[...d]],u)}const h=[],f=i([s,h],u);for(const d of u)h.push(a(d));return f}case $n:{if(o)switch(o){case"BigInt":return i([o,u.toString()],u);case"Boolean":case"Number":case"String":return i([o,u.valueOf()],u)}if(t&&"toJSON"in u)return a(u.toJSON());const h=[],f=i([s,h],u);for(const d of Lc(u))(e||!Ln(qt(u[d])))&&h.push([a(d),a(u[d])]);return f}case Ei:return i([s,u.toISOString()],u);case bi:{const{source:h,flags:f}=u;return i([s,{source:h,flags:f}],u)}case Ti:{const h=[],f=i([s,h],u);for(const[d,p]of u)(e||!(Ln(qt(d))||Ln(qt(p))))&&h.push([a(d),a(p)]);return f}case xi:{const h=[],f=i([s,h],u);for(const d of u)(e||!Ln(qt(d)))&&h.push(a(d));return f}}const{message:c}=u;return i([s,{name:o,message:c}],u)};return a},Ea=(e,{json:t,lossy:n}={})=>{const r=[];return Oc(!(t||n),!!t,new Map,r)(e),r},Et=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?ga(Ea(e,t)):structuredClone(e):(e,t)=>ga(Ea(e,t));class _n{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}_n.prototype.normal={};_n.prototype.property={};_n.prototype.space=void 0;function is(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new _n(n,r,t)}function mn(e){return e.toLowerCase()}class Ne{constructor(t,n){this.attribute=n,this.property=t}}Ne.prototype.attribute="";Ne.prototype.booleanish=!1;Ne.prototype.boolean=!1;Ne.prototype.commaOrSpaceSeparated=!1;Ne.prototype.commaSeparated=!1;Ne.prototype.defined=!1;Ne.prototype.mustUseProperty=!1;Ne.prototype.number=!1;Ne.prototype.overloadedBoolean=!1;Ne.prototype.property="";Ne.prototype.spaceSeparated=!1;Ne.prototype.space=void 0;let Rc=0;const Q=_t(),pe=_t(),jr=_t(),M=_t(),oe=_t(),Dt=_t(),Le=_t();function _t(){return 2**++Rc}const zr=Object.freeze(Object.defineProperty({__proto__:null,boolean:Q,booleanish:pe,commaOrSpaceSeparated:Le,commaSeparated:Dt,number:M,overloadedBoolean:jr,spaceSeparated:oe},Symbol.toStringTag,{value:"Module"})),Tr=Object.keys(zr);class _i extends Ne{constructor(t,n,r,i){let a=-1;if(super(t,n),ba(this,"space",i),typeof r=="number")for(;++a<Tr.length;){const u=Tr[a];ba(this,Tr[a],(r&zr[u])===zr[u])}}}_i.prototype.defined=!0;function ba(e,t,n){n&&(e[t]=n)}function Bt(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new _i(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[mn(r)]=r,n[mn(a.attribute)]=r}return new _n(t,n,e.space)}const as=Bt({properties:{ariaActiveDescendant:null,ariaAtomic:pe,ariaAutoComplete:null,ariaBusy:pe,ariaChecked:pe,ariaColCount:M,ariaColIndex:M,ariaColSpan:M,ariaControls:oe,ariaCurrent:null,ariaDescribedBy:oe,ariaDetails:null,ariaDisabled:pe,ariaDropEffect:oe,ariaErrorMessage:null,ariaExpanded:pe,ariaFlowTo:oe,ariaGrabbed:pe,ariaHasPopup:null,ariaHidden:pe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:oe,ariaLevel:M,ariaLive:null,ariaModal:pe,ariaMultiLine:pe,ariaMultiSelectable:pe,ariaOrientation:null,ariaOwns:oe,ariaPlaceholder:null,ariaPosInSet:M,ariaPressed:pe,ariaReadOnly:pe,ariaRelevant:null,ariaRequired:pe,ariaRoleDescription:oe,ariaRowCount:M,ariaRowIndex:M,ariaRowSpan:M,ariaSelected:pe,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 us(e,t){return t in e?e[t]:t}function ss(e,t){return us(e,t.toLowerCase())}const Dc=Bt({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Dt,acceptCharset:oe,accessKey:oe,action:null,allow:null,allowFullScreen:Q,allowPaymentRequest:Q,allowUserMedia:Q,alt:null,as:null,async:Q,autoCapitalize:null,autoComplete:oe,autoFocus:Q,autoPlay:Q,blocking:oe,capture:null,charSet:null,checked:Q,cite:null,className:oe,cols:M,colSpan:null,content:null,contentEditable:pe,controls:Q,controlsList:oe,coords:M|Dt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Q,defer:Q,dir:null,dirName:null,disabled:Q,download:jr,draggable:pe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Q,formTarget:null,headers:oe,height:M,hidden:jr,high:M,href:null,hrefLang:null,htmlFor:oe,httpEquiv:oe,id:null,imageSizes:null,imageSrcSet:null,inert:Q,inputMode:null,integrity:null,is:null,isMap:Q,itemId:null,itemProp:oe,itemRef:oe,itemScope:Q,itemType:oe,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:oe,placeholder:null,playsInline:Q,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Q,referrerPolicy:null,rel:oe,required:Q,reversed:Q,rows:M,rowSpan:M,sandbox:oe,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:pe,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:pe,width:M,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:oe,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:pe,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:ss}),Pc=Bt({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:Le,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:oe,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:Dt,g2:Dt,glyphName:Dt,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:Le,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:oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:M,pointsAtY:M,pointsAtZ:M,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Le,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Le,rev:Le,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Le,requiredFeatures:Le,requiredFonts:Le,requiredFormats:Le,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:Le,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:Le,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:Le,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:us}),os=Bt({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()}}),ls=Bt({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ss}),cs=Bt({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Mc={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"},vc=/[A-Z]/g,Ta=/-[a-z]/g,Bc=/^data[-\w.:]+$/i;function ir(e,t){const n=mn(t);let r=t,i=Ne;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Bc.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Ta,Hc);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Ta.test(a)){let u=a.replace(vc,Fc);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}i=_i}return new i(r,t)}function Fc(e){return"-"+e.toLowerCase()}function Hc(e){return e.charAt(1).toUpperCase()}const An=is([as,Dc,os,ls,cs],"html"),st=is([as,Pc,os,ls,cs],"svg");function xa(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const u=n.slice(i,r).trim();(u||!a)&&t.push(u),i=r+1,r=n.indexOf(",",i)}return t}function hs(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const _a=/[#.]/g;function Uc(e,t){const n=e||"",r={};let i=0,a,u;for(;i<n.length;){_a.lastIndex=i;const s=_a.exec(n),o=n.slice(i,s?s.index:n.length);o&&(a?a==="#"?r.id=o:Array.isArray(r.className)?r.className.push(o):r.className=[o]:u=o,i+=o.length),s&&(a=s[0],i++)}return{type:"element",tagName:u||t||"div",properties:r,children:[]}}function Aa(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function fs(e){return e.join(" ").trim()}function ds(e,t,n){const r=n?Yc(n):void 0;function i(a,u,...s){let o;if(a==null){o={type:"root",children:[]};const c=u;s.unshift(c)}else{o=Uc(a,t);const c=o.tagName.toLowerCase(),h=r?r.get(c):void 0;if(o.tagName=h||c,jc(u))s.unshift(u);else for(const[f,d]of Object.entries(u))zc(e,o.properties,f,d)}for(const c of s)$r(o.children,c);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return i}function jc(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 u of a)if(typeof u!="number"&&typeof u!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function zc(e,t,n,r){const i=ir(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=Aa(r):i.commaSeparated?a=xa(r):i.commaOrSpaceSeparated?a=Aa(xa(r).join(" ")):a=ka(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?$c(r):String(r);if(Array.isArray(a)){const u=[];for(const s of a)u.push(ka(i,i.property,s));a=u}i.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function $r(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)$r(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?$r(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function ka(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||mn(n)===mn(t)))return!0}return n}function $c(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function Yc(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const qc=["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"],Vc=ds(An,"div"),Wc=ds(st,"g",qc);function Gc(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let u=0;for(;;){let s=n[u];if(s===void 0){const o=Ca(t,n[u-1]);s=o===-1?t.length+1:o+1,n[u]=s}if(s>a)return{line:u+1,column:a-(u>0?n[u-1]:0)+1,offset:a};u++}}}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 s=n[n.length-1],o=Ca(t,s),c=o===-1?t.length+1:o+1;if(s===c)break;n.push(c)}const u=(a.line>1?n[a.line-2]:0)+a.column-1;if(u<n[a.line-1])return u}}}function Ca(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
3
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const pt={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/"},ps={}.hasOwnProperty,Qc=Object.prototype;function Kc(e,t){const n=t||{};return Ai({file:n.file||void 0,location:!1,schema:n.space==="svg"?st:An,verbose:n.verbose||!1},e)}function Ai(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Fn(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:ms(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const a=String(e.file),u=Gc(a),s=u.toPoint(0),o=u.toPoint(a.length);n.position={start:s,end:o}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Fn(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Fn(e,r,n),n}default:return n=Xc(e,t),n}}function ms(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=Ai(e,t[n]);r.push(i)}return r}function Xc(e,t){const n=e.schema;e.schema=t.namespaceURI===pt.svg?st:An;let r=-1;const i={};for(;++r<t.attrs.length;){const s=t.attrs[r],o=(s.prefix?s.prefix+":":"")+s.name;ps.call(Qc,o)||(i[o]=s.value)}const u=(e.schema.space==="svg"?Wc:Vc)(t.tagName,i,ms(e,t.childNodes));if(Fn(e,t,u),u.tagName==="template"){const s=t,o=s.sourceCodeLocation,c=o&&o.startTag&&Ot(o.startTag),h=o&&o.endTag&&Ot(o.endTag),f=Ai(e,s.content);c&&h&&e.file&&(f.position={start:c.end,end:h.start}),u.content=f}return e.schema=n,u}function Fn(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=Zc(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function Zc(e,t,n){const r=Ot(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 u;if(n.attrs)for(u in n.attrs)ps.call(n.attrs,u)&&(a[ir(e.schema,u).property]=Ot(n.attrs[u]));n.startTag;const s=Ot(n.startTag),o=n.endTag?Ot(n.endTag):void 0,c={opening:s};o&&(c.closing=o),c.properties=a,t.data={position:c}}}return r}function Ot(e){const t=ya({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=ya({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function ya(e){return e.line&&e.column?e:void 0}const Na={}.hasOwnProperty;function gs(e,t){const n=t||{};function r(i,...a){let u=r.invalid;const s=r.handlers;if(i&&Na.call(i,e)){const o=String(i[e]);u=Na.call(s,o)?s[o]:r.unknown}if(u)return u.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Jc={},eh={}.hasOwnProperty,Es=gs("type",{handlers:{root:nh,element:sh,text:ah,comment:uh,doctype:ih}});function th(e,t){const r=(t||Jc).space;return Es(e,r==="svg"?st:An)}function nh(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=ki(e.children,n,t),Ft(e,n),n}function rh(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=ki(e.children,n,t),Ft(e,n),n}function ih(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Ft(e,t),t}function ah(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Ft(e,t),t}function uh(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Ft(e,t),t}function sh(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=st);const i=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&eh.call(e.properties,a)){const o=oh(r,a,e.properties[a]);o&&i.push(o)}}const u=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:pt[u],childNodes:[],parentNode:null};return s.childNodes=ki(e.children,s,r),Ft(e,s),e.tagName==="template"&&e.content&&(s.content=rh(e.content,r)),s}function oh(e,t,n){const r=ir(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?hs(n):fs(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=pt[r.space]}return i}function ki(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const a=Es(e[r],n);a.parentNode=t,i.push(a)}return i}function Ft(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 lh=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],ch=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]),le="�";var m;(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"})(m||(m={}));const Ce={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function bs(e){return e>=55296&&e<=57343}function hh(e){return e>=56320&&e<=57343}function fh(e,t){return(e-55296)*1024+9216+t}function Ts(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function xs(e){return e>=64976&&e<=65007||ch.has(e)}var I;(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"})(I||(I={}));const dh=65536;class ph{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=dh,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,u=i+n,s=a+n;return{code:t,startLine:r,endLine:r,startCol:u,endCol:u,startOffset:s,endOffset:s}}_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(hh(n))return this.pos++,this._addGap(),fh(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,m.EOF;return this._err(I.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,m.EOF;const r=this.html.charCodeAt(n);return r===m.CARRIAGE_RETURN?m.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,m.EOF;let t=this.html.charCodeAt(this.pos);return t===m.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,m.LINE_FEED):t===m.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,bs(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===m.LINE_FEED||t===m.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Ts(t)?this._err(I.controlCharacterInInputStream):xs(t)&&this._err(I.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var X;(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"})(X||(X={}));function _s(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 mh=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))),gh=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 Eh(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=gh.get(e))!==null&&t!==void 0?t:e}var ge;(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"})(ge||(ge={}));const bh=32;var it;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(it||(it={}));function Yr(e){return e>=ge.ZERO&&e<=ge.NINE}function Th(e){return e>=ge.UPPER_A&&e<=ge.UPPER_F||e>=ge.LOWER_A&&e<=ge.LOWER_F}function xh(e){return e>=ge.UPPER_A&&e<=ge.UPPER_Z||e>=ge.LOWER_A&&e<=ge.LOWER_Z||Yr(e)}function _h(e){return e===ge.EQUALS||xh(e)}var me;(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"})(me||(me={}));var Xe;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Xe||(Xe={}));class Ah{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=me.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Xe.Strict}startEntity(t){this.decodeMode=t,this.state=me.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case me.EntityStart:return t.charCodeAt(n)===ge.NUM?(this.state=me.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=me.NamedEntity,this.stateNamedEntity(t,n));case me.NumericStart:return this.stateNumericStart(t,n);case me.NumericDecimal:return this.stateNumericDecimal(t,n);case me.NumericHex:return this.stateNumericHex(t,n);case me.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|bh)===ge.LOWER_X?(this.state=me.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=me.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(Yr(i)||Th(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(Yr(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===ge.SEMI)this.consumed+=1;else if(this.decodeMode===Xe.Strict)return 0;return this.emitCodePoint(Eh(this.result),this.consumed),this.errors&&(t!==ge.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&it.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const u=t.charCodeAt(n);if(this.treeIndex=kh(r,i,this.treeIndex+Math.max(1,a),u),this.treeIndex<0)return this.result===0||this.decodeMode===Xe.Attribute&&(a===0||_h(u))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],a=(i&it.VALUE_LENGTH)>>14,a!==0){if(u===ge.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==Xe.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]&it.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]&~it.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case me.NamedEntity:return this.result!==0&&(this.decodeMode!==Xe.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case me.NumericDecimal:return this.emitNumericEntity(0,2);case me.NumericHex:return this.emitNumericEntity(0,3);case me.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case me.EntityStart:return 0}}}function kh(e,t,n,r){const i=(t&it.BRANCH_LENGTH)>>7,a=t&it.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 u=n,s=u+i-1;for(;u<=s;){const o=u+s>>>1,c=e[o];if(c<r)u=o+1;else if(c>r)s=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 mt;(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"})(mt||(mt={}));var De;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(De||(De={}));var k;(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"})(k||(k={}));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 Ch=new Map([[k.A,l.A],[k.ADDRESS,l.ADDRESS],[k.ANNOTATION_XML,l.ANNOTATION_XML],[k.APPLET,l.APPLET],[k.AREA,l.AREA],[k.ARTICLE,l.ARTICLE],[k.ASIDE,l.ASIDE],[k.B,l.B],[k.BASE,l.BASE],[k.BASEFONT,l.BASEFONT],[k.BGSOUND,l.BGSOUND],[k.BIG,l.BIG],[k.BLOCKQUOTE,l.BLOCKQUOTE],[k.BODY,l.BODY],[k.BR,l.BR],[k.BUTTON,l.BUTTON],[k.CAPTION,l.CAPTION],[k.CENTER,l.CENTER],[k.CODE,l.CODE],[k.COL,l.COL],[k.COLGROUP,l.COLGROUP],[k.DD,l.DD],[k.DESC,l.DESC],[k.DETAILS,l.DETAILS],[k.DIALOG,l.DIALOG],[k.DIR,l.DIR],[k.DIV,l.DIV],[k.DL,l.DL],[k.DT,l.DT],[k.EM,l.EM],[k.EMBED,l.EMBED],[k.FIELDSET,l.FIELDSET],[k.FIGCAPTION,l.FIGCAPTION],[k.FIGURE,l.FIGURE],[k.FONT,l.FONT],[k.FOOTER,l.FOOTER],[k.FOREIGN_OBJECT,l.FOREIGN_OBJECT],[k.FORM,l.FORM],[k.FRAME,l.FRAME],[k.FRAMESET,l.FRAMESET],[k.H1,l.H1],[k.H2,l.H2],[k.H3,l.H3],[k.H4,l.H4],[k.H5,l.H5],[k.H6,l.H6],[k.HEAD,l.HEAD],[k.HEADER,l.HEADER],[k.HGROUP,l.HGROUP],[k.HR,l.HR],[k.HTML,l.HTML],[k.I,l.I],[k.IMG,l.IMG],[k.IMAGE,l.IMAGE],[k.INPUT,l.INPUT],[k.IFRAME,l.IFRAME],[k.KEYGEN,l.KEYGEN],[k.LABEL,l.LABEL],[k.LI,l.LI],[k.LINK,l.LINK],[k.LISTING,l.LISTING],[k.MAIN,l.MAIN],[k.MALIGNMARK,l.MALIGNMARK],[k.MARQUEE,l.MARQUEE],[k.MATH,l.MATH],[k.MENU,l.MENU],[k.META,l.META],[k.MGLYPH,l.MGLYPH],[k.MI,l.MI],[k.MO,l.MO],[k.MN,l.MN],[k.MS,l.MS],[k.MTEXT,l.MTEXT],[k.NAV,l.NAV],[k.NOBR,l.NOBR],[k.NOFRAMES,l.NOFRAMES],[k.NOEMBED,l.NOEMBED],[k.NOSCRIPT,l.NOSCRIPT],[k.OBJECT,l.OBJECT],[k.OL,l.OL],[k.OPTGROUP,l.OPTGROUP],[k.OPTION,l.OPTION],[k.P,l.P],[k.PARAM,l.PARAM],[k.PLAINTEXT,l.PLAINTEXT],[k.PRE,l.PRE],[k.RB,l.RB],[k.RP,l.RP],[k.RT,l.RT],[k.RTC,l.RTC],[k.RUBY,l.RUBY],[k.S,l.S],[k.SCRIPT,l.SCRIPT],[k.SEARCH,l.SEARCH],[k.SECTION,l.SECTION],[k.SELECT,l.SELECT],[k.SOURCE,l.SOURCE],[k.SMALL,l.SMALL],[k.SPAN,l.SPAN],[k.STRIKE,l.STRIKE],[k.STRONG,l.STRONG],[k.STYLE,l.STYLE],[k.SUB,l.SUB],[k.SUMMARY,l.SUMMARY],[k.SUP,l.SUP],[k.TABLE,l.TABLE],[k.TBODY,l.TBODY],[k.TEMPLATE,l.TEMPLATE],[k.TEXTAREA,l.TEXTAREA],[k.TFOOT,l.TFOOT],[k.TD,l.TD],[k.TH,l.TH],[k.THEAD,l.THEAD],[k.TITLE,l.TITLE],[k.TR,l.TR],[k.TRACK,l.TRACK],[k.TT,l.TT],[k.U,l.U],[k.UL,l.UL],[k.SVG,l.SVG],[k.VAR,l.VAR],[k.WBR,l.WBR],[k.XMP,l.XMP]]);function Ht(e){var t;return(t=Ch.get(e))!==null&&t!==void 0?t:l.UNKNOWN}const P=l,yh={[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},qr=new Set([P.H1,P.H2,P.H3,P.H4,P.H5,P.H6]);k.STYLE,k.SCRIPT,k.XMP,k.IFRAME,k.NOEMBED,k.NOFRAMES,k.PLAINTEXT;var g;(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"})(g||(g={}));const de={DATA:g.DATA,RCDATA:g.RCDATA,RAWTEXT:g.RAWTEXT,SCRIPT_DATA:g.SCRIPT_DATA,PLAINTEXT:g.PLAINTEXT,CDATA_SECTION:g.CDATA_SECTION};function Nh(e){return e>=m.DIGIT_0&&e<=m.DIGIT_9}function en(e){return e>=m.LATIN_CAPITAL_A&&e<=m.LATIN_CAPITAL_Z}function Ih(e){return e>=m.LATIN_SMALL_A&&e<=m.LATIN_SMALL_Z}function tt(e){return Ih(e)||en(e)}function Ia(e){return tt(e)||Nh(e)}function On(e){return e+32}function As(e){return e===m.SPACE||e===m.LINE_FEED||e===m.TABULATION||e===m.FORM_FEED}function Sa(e){return As(e)||e===m.SOLIDUS||e===m.GREATER_THAN_SIGN}function Sh(e){return e===m.NULL?I.nullCharacterReference:e>1114111?I.characterReferenceOutsideUnicodeRange:bs(e)?I.surrogateCharacterReference:xs(e)?I.noncharacterCharacterReference:Ts(e)||e===m.CARRIAGE_RETURN?I.controlCharacterReference:null}class wh{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=g.DATA,this.returnState=g.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new ph(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Ah(mh,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(I.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(I.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=Sh(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:X.START_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:X.END_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:X.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:X.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(_s(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(I.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=Ht(t.tagName),t.type===X.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(I.endTagWithAttributes),t.selfClosing&&this._err(I.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 X.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case X.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case X.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:X.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=As(t)?X.WHITESPACE_CHARACTER:t===m.NULL?X.NULL_CHARACTER:X.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(X.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=g.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Xe.Attribute:Xe.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===g.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===g.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===g.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case g.DATA:{this._stateData(t);break}case g.RCDATA:{this._stateRcdata(t);break}case g.RAWTEXT:{this._stateRawtext(t);break}case g.SCRIPT_DATA:{this._stateScriptData(t);break}case g.PLAINTEXT:{this._statePlaintext(t);break}case g.TAG_OPEN:{this._stateTagOpen(t);break}case g.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case g.TAG_NAME:{this._stateTagName(t);break}case g.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case g.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case g.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case g.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case g.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case g.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case g.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case g.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case g.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case g.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case g.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case g.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case g.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case g.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case g.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case g.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case g.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case g.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case g.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case g.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case g.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case g.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case g.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case g.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case g.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case g.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case g.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case g.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case g.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case g.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case g.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case g.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case g.BOGUS_COMMENT:{this._stateBogusComment(t);break}case g.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case g.COMMENT_START:{this._stateCommentStart(t);break}case g.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case g.COMMENT:{this._stateComment(t);break}case g.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case g.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case g.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case g.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case g.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case g.COMMENT_END:{this._stateCommentEnd(t);break}case g.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case g.DOCTYPE:{this._stateDoctype(t);break}case g.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case g.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case g.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case g.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case g.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case g.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case g.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case g.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case g.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case g.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case g.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case g.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case g.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case g.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case g.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case g.CDATA_SECTION:{this._stateCdataSection(t);break}case g.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case g.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case g.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case g.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case m.LESS_THAN_SIGN:{this.state=g.TAG_OPEN;break}case m.AMPERSAND:{this._startCharacterReference();break}case m.NULL:{this._err(I.unexpectedNullCharacter),this._emitCodePoint(t);break}case m.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case m.AMPERSAND:{this._startCharacterReference();break}case m.LESS_THAN_SIGN:{this.state=g.RCDATA_LESS_THAN_SIGN;break}case m.NULL:{this._err(I.unexpectedNullCharacter),this._emitChars(le);break}case m.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case m.LESS_THAN_SIGN:{this.state=g.RAWTEXT_LESS_THAN_SIGN;break}case m.NULL:{this._err(I.unexpectedNullCharacter),this._emitChars(le);break}case m.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case m.LESS_THAN_SIGN:{this.state=g.SCRIPT_DATA_LESS_THAN_SIGN;break}case m.NULL:{this._err(I.unexpectedNullCharacter),this._emitChars(le);break}case m.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case m.NULL:{this._err(I.unexpectedNullCharacter),this._emitChars(le);break}case m.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(tt(t))this._createStartTagToken(),this.state=g.TAG_NAME,this._stateTagName(t);else switch(t){case m.EXCLAMATION_MARK:{this.state=g.MARKUP_DECLARATION_OPEN;break}case m.SOLIDUS:{this.state=g.END_TAG_OPEN;break}case m.QUESTION_MARK:{this._err(I.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=g.BOGUS_COMMENT,this._stateBogusComment(t);break}case m.EOF:{this._err(I.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(I.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=g.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(tt(t))this._createEndTagToken(),this.state=g.TAG_NAME,this._stateTagName(t);else switch(t){case m.GREATER_THAN_SIGN:{this._err(I.missingEndTagName),this.state=g.DATA;break}case m.EOF:{this._err(I.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(I.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=g.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:{this.state=g.BEFORE_ATTRIBUTE_NAME;break}case m.SOLIDUS:{this.state=g.SELF_CLOSING_START_TAG;break}case m.GREATER_THAN_SIGN:{this.state=g.DATA,this.emitCurrentTagToken();break}case m.NULL:{this._err(I.unexpectedNullCharacter),n.tagName+=le;break}case m.EOF:{this._err(I.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(en(t)?On(t):t)}}_stateRcdataLessThanSign(t){t===m.SOLIDUS?this.state=g.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=g.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){tt(t)?(this.state=g.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=g.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 m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=g.BEFORE_ATTRIBUTE_NAME,!1;case m.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=g.SELF_CLOSING_START_TAG,!1;case m.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=g.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=g.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===m.SOLIDUS?this.state=g.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=g.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){tt(t)?(this.state=g.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=g.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=g.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case m.SOLIDUS:{this.state=g.SCRIPT_DATA_END_TAG_OPEN;break}case m.EXCLAMATION_MARK:{this.state=g.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=g.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){tt(t)?(this.state=g.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=g.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=g.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===m.HYPHEN_MINUS?(this.state=g.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=g.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===m.HYPHEN_MINUS?(this.state=g.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=g.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case m.HYPHEN_MINUS:{this.state=g.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case m.LESS_THAN_SIGN:{this.state=g.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case m.NULL:{this._err(I.unexpectedNullCharacter),this._emitChars(le);break}case m.EOF:{this._err(I.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case m.HYPHEN_MINUS:{this.state=g.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case m.LESS_THAN_SIGN:{this.state=g.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case m.NULL:{this._err(I.unexpectedNullCharacter),this.state=g.SCRIPT_DATA_ESCAPED,this._emitChars(le);break}case m.EOF:{this._err(I.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=g.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case m.HYPHEN_MINUS:{this._emitChars("-");break}case m.LESS_THAN_SIGN:{this.state=g.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case m.GREATER_THAN_SIGN:{this.state=g.SCRIPT_DATA,this._emitChars(">");break}case m.NULL:{this._err(I.unexpectedNullCharacter),this.state=g.SCRIPT_DATA_ESCAPED,this._emitChars(le);break}case m.EOF:{this._err(I.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=g.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===m.SOLIDUS?this.state=g.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:tt(t)?(this._emitChars("<"),this.state=g.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=g.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){tt(t)?(this.state=g.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=g.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=g.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Ce.SCRIPT,!1)&&Sa(this.preprocessor.peek(Ce.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Ce.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=g.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=g.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case m.HYPHEN_MINUS:{this.state=g.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case m.LESS_THAN_SIGN:{this.state=g.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case m.NULL:{this._err(I.unexpectedNullCharacter),this._emitChars(le);break}case m.EOF:{this._err(I.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case m.HYPHEN_MINUS:{this.state=g.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case m.LESS_THAN_SIGN:{this.state=g.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case m.NULL:{this._err(I.unexpectedNullCharacter),this.state=g.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(le);break}case m.EOF:{this._err(I.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=g.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case m.HYPHEN_MINUS:{this._emitChars("-");break}case m.LESS_THAN_SIGN:{this.state=g.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case m.GREATER_THAN_SIGN:{this.state=g.SCRIPT_DATA,this._emitChars(">");break}case m.NULL:{this._err(I.unexpectedNullCharacter),this.state=g.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(le);break}case m.EOF:{this._err(I.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=g.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===m.SOLIDUS?(this.state=g.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=g.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Ce.SCRIPT,!1)&&Sa(this.preprocessor.peek(Ce.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Ce.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=g.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=g.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:break;case m.SOLIDUS:case m.GREATER_THAN_SIGN:case m.EOF:{this.state=g.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case m.EQUALS_SIGN:{this._err(I.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=g.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=g.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:case m.SOLIDUS:case m.GREATER_THAN_SIGN:case m.EOF:{this._leaveAttrName(),this.state=g.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case m.EQUALS_SIGN:{this._leaveAttrName(),this.state=g.BEFORE_ATTRIBUTE_VALUE;break}case m.QUOTATION_MARK:case m.APOSTROPHE:case m.LESS_THAN_SIGN:{this._err(I.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case m.NULL:{this._err(I.unexpectedNullCharacter),this.currentAttr.name+=le;break}default:this.currentAttr.name+=String.fromCodePoint(en(t)?On(t):t)}}_stateAfterAttributeName(t){switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:break;case m.SOLIDUS:{this.state=g.SELF_CLOSING_START_TAG;break}case m.EQUALS_SIGN:{this.state=g.BEFORE_ATTRIBUTE_VALUE;break}case m.GREATER_THAN_SIGN:{this.state=g.DATA,this.emitCurrentTagToken();break}case m.EOF:{this._err(I.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=g.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:break;case m.QUOTATION_MARK:{this.state=g.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case m.APOSTROPHE:{this.state=g.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case m.GREATER_THAN_SIGN:{this._err(I.missingAttributeValue),this.state=g.DATA,this.emitCurrentTagToken();break}default:this.state=g.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case m.QUOTATION_MARK:{this.state=g.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case m.AMPERSAND:{this._startCharacterReference();break}case m.NULL:{this._err(I.unexpectedNullCharacter),this.currentAttr.value+=le;break}case m.EOF:{this._err(I.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case m.APOSTROPHE:{this.state=g.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case m.AMPERSAND:{this._startCharacterReference();break}case m.NULL:{this._err(I.unexpectedNullCharacter),this.currentAttr.value+=le;break}case m.EOF:{this._err(I.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:{this._leaveAttrValue(),this.state=g.BEFORE_ATTRIBUTE_NAME;break}case m.AMPERSAND:{this._startCharacterReference();break}case m.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=g.DATA,this.emitCurrentTagToken();break}case m.NULL:{this._err(I.unexpectedNullCharacter),this.currentAttr.value+=le;break}case m.QUOTATION_MARK:case m.APOSTROPHE:case m.LESS_THAN_SIGN:case m.EQUALS_SIGN:case m.GRAVE_ACCENT:{this._err(I.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case m.EOF:{this._err(I.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:{this._leaveAttrValue(),this.state=g.BEFORE_ATTRIBUTE_NAME;break}case m.SOLIDUS:{this._leaveAttrValue(),this.state=g.SELF_CLOSING_START_TAG;break}case m.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=g.DATA,this.emitCurrentTagToken();break}case m.EOF:{this._err(I.eofInTag),this._emitEOFToken();break}default:this._err(I.missingWhitespaceBetweenAttributes),this.state=g.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case m.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=g.DATA,this.emitCurrentTagToken();break}case m.EOF:{this._err(I.eofInTag),this._emitEOFToken();break}default:this._err(I.unexpectedSolidusInTag),this.state=g.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case m.GREATER_THAN_SIGN:{this.state=g.DATA,this.emitCurrentComment(n);break}case m.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case m.NULL:{this._err(I.unexpectedNullCharacter),n.data+=le;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Ce.DASH_DASH,!0)?(this._createCommentToken(Ce.DASH_DASH.length+1),this.state=g.COMMENT_START):this._consumeSequenceIfMatch(Ce.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Ce.DOCTYPE.length+1),this.state=g.DOCTYPE):this._consumeSequenceIfMatch(Ce.CDATA_START,!0)?this.inForeignNode?this.state=g.CDATA_SECTION:(this._err(I.cdataInHtmlContent),this._createCommentToken(Ce.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=g.BOGUS_COMMENT):this._ensureHibernation()||(this._err(I.incorrectlyOpenedComment),this._createCommentToken(2),this.state=g.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case m.HYPHEN_MINUS:{this.state=g.COMMENT_START_DASH;break}case m.GREATER_THAN_SIGN:{this._err(I.abruptClosingOfEmptyComment),this.state=g.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=g.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case m.HYPHEN_MINUS:{this.state=g.COMMENT_END;break}case m.GREATER_THAN_SIGN:{this._err(I.abruptClosingOfEmptyComment),this.state=g.DATA,this.emitCurrentComment(n);break}case m.EOF:{this._err(I.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=g.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case m.HYPHEN_MINUS:{this.state=g.COMMENT_END_DASH;break}case m.LESS_THAN_SIGN:{n.data+="<",this.state=g.COMMENT_LESS_THAN_SIGN;break}case m.NULL:{this._err(I.unexpectedNullCharacter),n.data+=le;break}case m.EOF:{this._err(I.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case m.EXCLAMATION_MARK:{n.data+="!",this.state=g.COMMENT_LESS_THAN_SIGN_BANG;break}case m.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=g.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===m.HYPHEN_MINUS?this.state=g.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=g.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===m.HYPHEN_MINUS?this.state=g.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=g.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==m.GREATER_THAN_SIGN&&t!==m.EOF&&this._err(I.nestedComment),this.state=g.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case m.HYPHEN_MINUS:{this.state=g.COMMENT_END;break}case m.EOF:{this._err(I.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=g.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case m.GREATER_THAN_SIGN:{this.state=g.DATA,this.emitCurrentComment(n);break}case m.EXCLAMATION_MARK:{this.state=g.COMMENT_END_BANG;break}case m.HYPHEN_MINUS:{n.data+="-";break}case m.EOF:{this._err(I.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=g.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case m.HYPHEN_MINUS:{n.data+="--!",this.state=g.COMMENT_END_DASH;break}case m.GREATER_THAN_SIGN:{this._err(I.incorrectlyClosedComment),this.state=g.DATA,this.emitCurrentComment(n);break}case m.EOF:{this._err(I.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=g.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:{this.state=g.BEFORE_DOCTYPE_NAME;break}case m.GREATER_THAN_SIGN:{this.state=g.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case m.EOF:{this._err(I.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(I.missingWhitespaceBeforeDoctypeName),this.state=g.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(en(t))this._createDoctypeToken(String.fromCharCode(On(t))),this.state=g.DOCTYPE_NAME;else switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:break;case m.NULL:{this._err(I.unexpectedNullCharacter),this._createDoctypeToken(le),this.state=g.DOCTYPE_NAME;break}case m.GREATER_THAN_SIGN:{this._err(I.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=g.DATA;break}case m.EOF:{this._err(I.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=g.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:{this.state=g.AFTER_DOCTYPE_NAME;break}case m.GREATER_THAN_SIGN:{this.state=g.DATA,this.emitCurrentDoctype(n);break}case m.NULL:{this._err(I.unexpectedNullCharacter),n.name+=le;break}case m.EOF:{this._err(I.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(en(t)?On(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:break;case m.GREATER_THAN_SIGN:{this.state=g.DATA,this.emitCurrentDoctype(n);break}case m.EOF:{this._err(I.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Ce.PUBLIC,!1)?this.state=g.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Ce.SYSTEM,!1)?this.state=g.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(I.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=g.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:{this.state=g.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case m.QUOTATION_MARK:{this._err(I.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=g.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case m.APOSTROPHE:{this._err(I.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=g.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case m.GREATER_THAN_SIGN:{this._err(I.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=g.DATA,this.emitCurrentDoctype(n);break}case m.EOF:{this._err(I.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(I.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=g.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:break;case m.QUOTATION_MARK:{n.publicId="",this.state=g.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case m.APOSTROPHE:{n.publicId="",this.state=g.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case m.GREATER_THAN_SIGN:{this._err(I.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=g.DATA,this.emitCurrentDoctype(n);break}case m.EOF:{this._err(I.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(I.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=g.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case m.QUOTATION_MARK:{this.state=g.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case m.NULL:{this._err(I.unexpectedNullCharacter),n.publicId+=le;break}case m.GREATER_THAN_SIGN:{this._err(I.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=g.DATA;break}case m.EOF:{this._err(I.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 m.APOSTROPHE:{this.state=g.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case m.NULL:{this._err(I.unexpectedNullCharacter),n.publicId+=le;break}case m.GREATER_THAN_SIGN:{this._err(I.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=g.DATA;break}case m.EOF:{this._err(I.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 m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:{this.state=g.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case m.GREATER_THAN_SIGN:{this.state=g.DATA,this.emitCurrentDoctype(n);break}case m.QUOTATION_MARK:{this._err(I.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=g.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case m.APOSTROPHE:{this._err(I.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=g.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case m.EOF:{this._err(I.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(I.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=g.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:break;case m.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=g.DATA;break}case m.QUOTATION_MARK:{n.systemId="",this.state=g.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case m.APOSTROPHE:{n.systemId="",this.state=g.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case m.EOF:{this._err(I.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(I.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=g.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:{this.state=g.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case m.QUOTATION_MARK:{this._err(I.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=g.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case m.APOSTROPHE:{this._err(I.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=g.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case m.GREATER_THAN_SIGN:{this._err(I.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=g.DATA,this.emitCurrentDoctype(n);break}case m.EOF:{this._err(I.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(I.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=g.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:break;case m.QUOTATION_MARK:{n.systemId="",this.state=g.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case m.APOSTROPHE:{n.systemId="",this.state=g.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case m.GREATER_THAN_SIGN:{this._err(I.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=g.DATA,this.emitCurrentDoctype(n);break}case m.EOF:{this._err(I.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(I.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=g.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case m.QUOTATION_MARK:{this.state=g.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case m.NULL:{this._err(I.unexpectedNullCharacter),n.systemId+=le;break}case m.GREATER_THAN_SIGN:{this._err(I.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=g.DATA;break}case m.EOF:{this._err(I.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 m.APOSTROPHE:{this.state=g.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case m.NULL:{this._err(I.unexpectedNullCharacter),n.systemId+=le;break}case m.GREATER_THAN_SIGN:{this._err(I.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=g.DATA;break}case m.EOF:{this._err(I.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 m.SPACE:case m.LINE_FEED:case m.TABULATION:case m.FORM_FEED:break;case m.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=g.DATA;break}case m.EOF:{this._err(I.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(I.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=g.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case m.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=g.DATA;break}case m.NULL:{this._err(I.unexpectedNullCharacter);break}case m.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case m.RIGHT_SQUARE_BRACKET:{this.state=g.CDATA_SECTION_BRACKET;break}case m.EOF:{this._err(I.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===m.RIGHT_SQUARE_BRACKET?this.state=g.CDATA_SECTION_END:(this._emitChars("]"),this.state=g.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case m.GREATER_THAN_SIGN:{this.state=g.DATA;break}case m.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=g.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(m.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Ia(this.preprocessor.peek(1))?g.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Ia(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===m.SEMICOLON&&this._err(I.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const ks=new Set([l.DD,l.DT,l.LI,l.OPTGROUP,l.OPTION,l.P,l.RB,l.RP,l.RT,l.RTC]),wa=new Set([...ks,l.CAPTION,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]),Yn=new Set([l.APPLET,l.CAPTION,l.HTML,l.MARQUEE,l.OBJECT,l.TABLE,l.TD,l.TEMPLATE,l.TH]),Lh=new Set([...Yn,l.OL,l.UL]),Oh=new Set([...Yn,l.BUTTON]),La=new Set([l.ANNOTATION_XML,l.MI,l.MN,l.MO,l.MS,l.MTEXT]),Oa=new Set([l.DESC,l.FOREIGN_OBJECT,l.TITLE]),Rh=new Set([l.TR,l.TEMPLATE,l.HTML]),Dh=new Set([l.TBODY,l.TFOOT,l.THEAD,l.TEMPLATE,l.HTML]),Ph=new Set([l.TABLE,l.TEMPLATE,l.HTML]),Mh=new Set([l.TD,l.TH]);class vh{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(qr,D.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Mh,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(Ph,D.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Dh,D.HTML)}clearBackToTableRowContext(){this.clearBackTo(Rh,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(Oa.has(i))return!1;break}case D.MATHML:{if(La.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Yn)}hasInListItemScope(t){return this.hasInDynamicScope(t,Lh)}hasInButtonScope(t){return this.hasInDynamicScope(t,Oh)}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(qr.has(n))return!0;if(Yn.has(n))return!1;break}case D.SVG:{if(Oa.has(n))return!1;break}case D.MATHML:{if(La.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&&ks.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&wa.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&wa.has(this.currentTagId);)this.pop()}}const xr=3;var Ye;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Ye||(Ye={}));const Ra={type:Ye.Marker};class Bh{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,a=this.treeAdapter.getTagName(t),u=this.treeAdapter.getNamespaceURI(t);for(let s=0;s<this.entries.length;s++){const o=this.entries[s];if(o.type===Ye.Marker)break;const{element:c}=o;if(this.treeAdapter.getTagName(c)===a&&this.treeAdapter.getNamespaceURI(c)===u){const h=this.treeAdapter.getAttrList(c);h.length===i&&r.push({idx:s,attrs:h})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<xr)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<xr)return;const i=new Map(n.map(u=>[u.name,u.value]));let a=0;for(let u=0;u<r.length;u++){const s=r[u];s.attrs.every(o=>i.get(o.name)===o.value)&&(a+=1,a>=xr&&this.entries.splice(s.idx,1))}}insertMarker(){this.entries.unshift(Ra)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Ye.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ye.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(Ra);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Ye.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Ye.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Ye.Element&&n.element===t)}}const nt={createDocument(){return{nodeName:"#document",mode:De.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};nt.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(nt.isTextNode(n)){n.value+=t;return}}nt.appendChild(e,nt.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&nt.isTextNode(r)?r.value+=t:nt.insertBefore(e,nt.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}}},Cs="html",Fh="about:legacy-compat",Hh="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",ys=["+//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//"],Uh=[...ys,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],jh=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Ns=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],zh=[...Ns,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Da(e,t){return t.some(n=>e.startsWith(n))}function $h(e){return e.name===Cs&&e.publicId===null&&(e.systemId===null||e.systemId===Fh)}function Yh(e){if(e.name!==Cs)return De.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Hh)return De.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),jh.has(n))return De.QUIRKS;let r=t===null?Uh:ys;if(Da(n,r))return De.QUIRKS;if(r=t===null?Ns:zh,Da(n,r))return De.LIMITED_QUIRKS}return De.NO_QUIRKS}const Pa={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},qh="definitionurl",Vh="definitionURL",Wh=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])),Gh=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}]]),Qh=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])),Kh=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 Xh(e){const t=e.tagID;return t===l.FONT&&e.attrs.some(({name:r})=>r===mt.COLOR||r===mt.SIZE||r===mt.FACE)||Kh.has(t)}function Is(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===qh){e.attrs[t].name=Vh;break}}function Ss(e){for(let t=0;t<e.attrs.length;t++){const n=Wh.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Ci(e){for(let t=0;t<e.attrs.length;t++){const n=Gh.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 Zh(e){const t=Qh.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Ht(e.tagName))}function Jh(e,t){return t===D.MATHML&&(e===l.MI||e===l.MO||e===l.MN||e===l.MS||e===l.MTEXT)}function ef(e,t,n){if(t===D.MATHML&&e===l.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===mt.ENCODING){const i=n[r].value.toLowerCase();return i===Pa.TEXT_HTML||i===Pa.APPLICATION_XML}}return t===D.SVG&&(e===l.FOREIGN_OBJECT||e===l.DESC||e===l.TITLE)}function tf(e,t,n,r){return(!r||r===D.HTML)&&ef(e,t,n)||(!r||r===D.MATHML)&&Jh(e,t)}const nf="hidden",rf=8,af=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 uf={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},ws=new Set([l.TABLE,l.TBODY,l.TFOOT,l.THEAD,l.TR]),Ma={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:nt,onParseError:null};class va{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={...Ma,...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 wh(this.options,this),this.activeFormattingElements=new Bh(this.treeAdapter),this.fragmentContextID=r?Ht(this.treeAdapter.getTagName(r)):l.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new vh(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={...Ma,...n};t??(t=r.treeAdapter.createElement(k.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:uf,u={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(u)}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,u;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,u=this.fragmentContextID):{current:a,currentTagId:u}=this.openElements,this._setContextModes(a,u)}}_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=de.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)===k.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=de.RCDATA;break}case l.STYLE:case l.XMP:case l.IFRAME:case l.NOEMBED:case l.NOFRAMES:case l.NOSCRIPT:{this.tokenizer.state=de.RAWTEXT;break}case l.SCRIPT:{this.tokenizer.state=de.SCRIPT_DATA;break}case l.PLAINTEXT:{this.tokenizer.state=de.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 u=this.treeAdapter.getChildNodes(this.document).find(s=>this.treeAdapter.isDocumentTypeNode(s));u&&this.treeAdapter.setNodeSourceCodeLocation(u,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(k.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,u=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(u)){const{endLine:o,endCol:c,endOffset:h}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(u,{endLine:o,endCol:c,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(u,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===X.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)===k.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 X.CHARACTER:{this.onCharacter(t);break}case X.NULL_CHARACTER:{this.onNullCharacter(t);break}case X.COMMENT:{this.onComment(t);break}case X.DOCTYPE:{this.onDoctype(t);break}case X.START_TAG:{this._processStartTag(t);break}case X.END_TAG:{this.onEndTag(t);break}case X.EOF:{this.onEof(t);break}case X.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return tf(t,i,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===Ye.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 ws.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 yh[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){vd(this,t);return}switch(this.insertionMode){case T.INITIAL:{Vt(this,t);break}case T.BEFORE_HTML:{rn(this,t);break}case T.BEFORE_HEAD:{an(this,t);break}case T.IN_HEAD:{un(this,t);break}case T.IN_HEAD_NO_SCRIPT:{sn(this,t);break}case T.AFTER_HEAD:{on(this,t);break}case T.IN_BODY:case T.IN_CAPTION:case T.IN_CELL:case T.IN_TEMPLATE:{Os(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:{_r(this,t);break}case T.IN_TABLE_TEXT:{Bs(this,t);break}case T.IN_COLUMN_GROUP:{qn(this,t);break}case T.AFTER_BODY:{Vn(this,t);break}case T.AFTER_AFTER_BODY:{Hn(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Md(this,t);return}switch(this.insertionMode){case T.INITIAL:{Vt(this,t);break}case T.BEFORE_HTML:{rn(this,t);break}case T.BEFORE_HEAD:{an(this,t);break}case T.IN_HEAD:{un(this,t);break}case T.IN_HEAD_NO_SCRIPT:{sn(this,t);break}case T.AFTER_HEAD:{on(this,t);break}case T.TEXT:{this._insertCharacters(t);break}case T.IN_TABLE:case T.IN_TABLE_BODY:case T.IN_ROW:{_r(this,t);break}case T.IN_COLUMN_GROUP:{qn(this,t);break}case T.AFTER_BODY:{Vn(this,t);break}case T.AFTER_AFTER_BODY:{Hn(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Vr(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:{Vr(this,t);break}case T.IN_TABLE_TEXT:{Wt(this,t);break}case T.AFTER_BODY:{df(this,t);break}case T.AFTER_AFTER_BODY:case T.AFTER_AFTER_FRAMESET:{pf(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case T.INITIAL:{mf(this,t);break}case T.BEFORE_HEAD:case T.IN_HEAD:case T.IN_HEAD_NO_SCRIPT:case T.AFTER_HEAD:{this._err(t,I.misplacedDoctype);break}case T.IN_TABLE_TEXT:{Wt(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,I.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Bd(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case T.INITIAL:{Vt(this,t);break}case T.BEFORE_HTML:{gf(this,t);break}case T.BEFORE_HEAD:{bf(this,t);break}case T.IN_HEAD:{je(this,t);break}case T.IN_HEAD_NO_SCRIPT:{_f(this,t);break}case T.AFTER_HEAD:{kf(this,t);break}case T.IN_BODY:{Te(this,t);break}case T.IN_TABLE:{Mt(this,t);break}case T.IN_TABLE_TEXT:{Wt(this,t);break}case T.IN_CAPTION:{Td(this,t);break}case T.IN_COLUMN_GROUP:{Ii(this,t);break}case T.IN_TABLE_BODY:{sr(this,t);break}case T.IN_ROW:{or(this,t);break}case T.IN_CELL:{Ad(this,t);break}case T.IN_SELECT:{Us(this,t);break}case T.IN_SELECT_IN_TABLE:{Cd(this,t);break}case T.IN_TEMPLATE:{Nd(this,t);break}case T.AFTER_BODY:{Sd(this,t);break}case T.IN_FRAMESET:{wd(this,t);break}case T.AFTER_FRAMESET:{Od(this,t);break}case T.AFTER_AFTER_BODY:{Dd(this,t);break}case T.AFTER_AFTER_FRAMESET:{Pd(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Fd(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case T.INITIAL:{Vt(this,t);break}case T.BEFORE_HTML:{Ef(this,t);break}case T.BEFORE_HEAD:{Tf(this,t);break}case T.IN_HEAD:{xf(this,t);break}case T.IN_HEAD_NO_SCRIPT:{Af(this,t);break}case T.AFTER_HEAD:{Cf(this,t);break}case T.IN_BODY:{ur(this,t);break}case T.TEXT:{ld(this,t);break}case T.IN_TABLE:{gn(this,t);break}case T.IN_TABLE_TEXT:{Wt(this,t);break}case T.IN_CAPTION:{xd(this,t);break}case T.IN_COLUMN_GROUP:{_d(this,t);break}case T.IN_TABLE_BODY:{Wr(this,t);break}case T.IN_ROW:{Hs(this,t);break}case T.IN_CELL:{kd(this,t);break}case T.IN_SELECT:{js(this,t);break}case T.IN_SELECT_IN_TABLE:{yd(this,t);break}case T.IN_TEMPLATE:{Id(this,t);break}case T.AFTER_BODY:{$s(this,t);break}case T.IN_FRAMESET:{Ld(this,t);break}case T.AFTER_FRAMESET:{Rd(this,t);break}case T.AFTER_AFTER_BODY:{Hn(this,t);break}}}onEof(t){switch(this.insertionMode){case T.INITIAL:{Vt(this,t);break}case T.BEFORE_HTML:{rn(this,t);break}case T.BEFORE_HEAD:{an(this,t);break}case T.IN_HEAD:{un(this,t);break}case T.IN_HEAD_NO_SCRIPT:{sn(this,t);break}case T.AFTER_HEAD:{on(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:{Ms(this,t);break}case T.TEXT:{cd(this,t);break}case T.IN_TABLE_TEXT:{Wt(this,t);break}case T.IN_TEMPLATE:{zs(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:{Ni(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===m.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:{Ls(this,t);break}case T.IN_TABLE:case T.IN_TABLE_BODY:case T.IN_ROW:{_r(this,t);break}case T.IN_TABLE_TEXT:{vs(this,t);break}}}}function sf(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):Ps(e,t),n}function of(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 lf(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,u=i;u!==n;a++,u=i){i=e.openElements.getCommonAncestor(u);const s=e.activeFormattingElements.getElementEntry(u),o=s&&a>=af;!s||o?(o&&e.activeFormattingElements.removeEntry(s),e.openElements.remove(u)):(u=cf(e,s),r===t&&(e.activeFormattingElements.bookmark=s),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(u,r),r=u)}return r}function cf(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 hf(e,t,n){const r=e.treeAdapter.getTagName(t),i=Ht(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 ff(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 yi(e,t){for(let n=0;n<rf;n++){const r=sf(e,t);if(!r)break;const i=of(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const a=lf(e,i,r.element),u=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),u&&hf(e,u,a),ff(e,i,r)}}function Vr(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function df(e,t){e._appendCommentNode(t,e.openElements.items[0])}function pf(e,t){e._appendCommentNode(t,e.document)}function Ni(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],u=e.treeAdapter.getNodeSourceCodeLocation(a);u&&!u.endTag&&e._setEndLocation(a,t)}}}}function mf(e,t){e._setDocumentType(t);const n=t.forceQuirks?De.QUIRKS:Yh(t);$h(t)||e._err(t,I.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=T.BEFORE_HTML}function Vt(e,t){e._err(t,I.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,De.QUIRKS),e.insertionMode=T.BEFORE_HTML,e._processToken(t)}function gf(e,t){t.tagID===l.HTML?(e._insertElement(t,D.HTML),e.insertionMode=T.BEFORE_HEAD):rn(e,t)}function Ef(e,t){const n=t.tagID;(n===l.HTML||n===l.HEAD||n===l.BODY||n===l.BR)&&rn(e,t)}function rn(e,t){e._insertFakeRootElement(),e.insertionMode=T.BEFORE_HEAD,e._processToken(t)}function bf(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.HEAD:{e._insertElement(t,D.HTML),e.headElement=e.openElements.current,e.insertionMode=T.IN_HEAD;break}default:an(e,t)}}function Tf(e,t){const n=t.tagID;n===l.HEAD||n===l.BODY||n===l.HTML||n===l.BR?an(e,t):e._err(t,I.endTagWithoutMatchingOpenElement)}function an(e,t){e._insertFakeElement(k.HEAD,l.HEAD),e.headElement=e.openElements.current,e.insertionMode=T.IN_HEAD,e._processToken(t)}function je(e,t){switch(t.tagID){case l.HTML:{Te(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,de.RCDATA);break}case l.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,de.RAWTEXT):(e._insertElement(t,D.HTML),e.insertionMode=T.IN_HEAD_NO_SCRIPT);break}case l.NOFRAMES:case l.STYLE:{e._switchToTextParsing(t,de.RAWTEXT);break}case l.SCRIPT:{e._switchToTextParsing(t,de.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,I.misplacedStartTagForHeadElement);break}default:un(e,t)}}function xf(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:{un(e,t);break}case l.TEMPLATE:{At(e,t);break}default:e._err(t,I.endTagWithoutMatchingOpenElement)}}function At(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==l.TEMPLATE&&e._err(t,I.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,I.endTagWithoutMatchingOpenElement)}function un(e,t){e.openElements.pop(),e.insertionMode=T.AFTER_HEAD,e._processToken(t)}function _f(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.BASEFONT:case l.BGSOUND:case l.HEAD:case l.LINK:case l.META:case l.NOFRAMES:case l.STYLE:{je(e,t);break}case l.NOSCRIPT:{e._err(t,I.nestedNoscriptInHead);break}default:sn(e,t)}}function Af(e,t){switch(t.tagID){case l.NOSCRIPT:{e.openElements.pop(),e.insertionMode=T.IN_HEAD;break}case l.BR:{sn(e,t);break}default:e._err(t,I.endTagWithoutMatchingOpenElement)}}function sn(e,t){const n=t.type===X.EOF?I.openElementsLeftAfterEof:I.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=T.IN_HEAD,e._processToken(t)}function kf(e,t){switch(t.tagID){case l.HTML:{Te(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,I.abandonedHeadElementChild),e.openElements.push(e.headElement,l.HEAD),je(e,t),e.openElements.remove(e.headElement);break}case l.HEAD:{e._err(t,I.misplacedStartTagForHeadElement);break}default:on(e,t)}}function Cf(e,t){switch(t.tagID){case l.BODY:case l.HTML:case l.BR:{on(e,t);break}case l.TEMPLATE:{At(e,t);break}default:e._err(t,I.endTagWithoutMatchingOpenElement)}}function on(e,t){e._insertFakeElement(k.BODY,l.BODY),e.insertionMode=T.IN_BODY,ar(e,t)}function ar(e,t){switch(t.type){case X.CHARACTER:{Os(e,t);break}case X.WHITESPACE_CHARACTER:{Ls(e,t);break}case X.COMMENT:{Vr(e,t);break}case X.START_TAG:{Te(e,t);break}case X.END_TAG:{ur(e,t);break}case X.EOF:{Ms(e,t);break}}}function Ls(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Os(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function yf(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Nf(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function If(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 Sf(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML)}function wf(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&qr.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,D.HTML)}function Lf(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Of(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 Rf(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 Df(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),e.tokenizer.state=de.PLAINTEXT}function Pf(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 Mf(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(k.A);n&&(yi(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 vf(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Bf(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(l.NOBR)&&(yi(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,D.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Ff(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Hf(e,t){e.treeAdapter.getDocumentMode(e.document)!==De.QUIRKS&&e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,D.HTML),e.framesetOk=!1,e.insertionMode=T.IN_TABLE}function Rs(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,D.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Ds(e){const t=_s(e,mt.TYPE);return t!=null&&t.toLowerCase()===nf}function Uf(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,D.HTML),Ds(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function jf(e,t){e._appendElement(t,D.HTML),t.ackSelfClosing=!0}function zf(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._appendElement(t,D.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function $f(e,t){t.tagName=k.IMG,t.tagID=l.IMG,Rs(e,t)}function Yf(e,t){e._insertElement(t,D.HTML),e.skipNextNewLine=!0,e.tokenizer.state=de.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=T.TEXT}function qf(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,de.RAWTEXT)}function Vf(e,t){e.framesetOk=!1,e._switchToTextParsing(t,de.RAWTEXT)}function Ba(e,t){e._switchToTextParsing(t,de.RAWTEXT)}function Wf(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 Gf(e,t){e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML)}function Qf(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,D.HTML)}function Kf(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(l.RTC),e._insertElement(t,D.HTML)}function Xf(e,t){e._reconstructActiveFormattingElements(),Is(t),Ci(t),t.selfClosing?e._appendElement(t,D.MATHML):e._insertElement(t,D.MATHML),t.ackSelfClosing=!0}function Zf(e,t){e._reconstructActiveFormattingElements(),Ss(t),Ci(t),t.selfClosing?e._appendElement(t,D.SVG):e._insertElement(t,D.SVG),t.ackSelfClosing=!0}function Fa(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,D.HTML)}function Te(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:{vf(e,t);break}case l.A:{Mf(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{wf(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:{Sf(e,t);break}case l.LI:case l.DD:case l.DT:{Rf(e,t);break}case l.BR:case l.IMG:case l.WBR:case l.AREA:case l.EMBED:case l.KEYGEN:{Rs(e,t);break}case l.HR:{zf(e,t);break}case l.RB:case l.RTC:{Qf(e,t);break}case l.RT:case l.RP:{Kf(e,t);break}case l.PRE:case l.LISTING:{Lf(e,t);break}case l.XMP:{qf(e,t);break}case l.SVG:{Zf(e,t);break}case l.HTML:{yf(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:{je(e,t);break}case l.BODY:{Nf(e,t);break}case l.FORM:{Of(e,t);break}case l.NOBR:{Bf(e,t);break}case l.MATH:{Xf(e,t);break}case l.TABLE:{Hf(e,t);break}case l.INPUT:{Uf(e,t);break}case l.PARAM:case l.TRACK:case l.SOURCE:{jf(e,t);break}case l.IMAGE:{$f(e,t);break}case l.BUTTON:{Pf(e,t);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{Ff(e,t);break}case l.IFRAME:{Vf(e,t);break}case l.SELECT:{Wf(e,t);break}case l.OPTION:case l.OPTGROUP:{Gf(e,t);break}case l.NOEMBED:case l.NOFRAMES:{Ba(e,t);break}case l.FRAMESET:{If(e,t);break}case l.TEXTAREA:{Yf(e,t);break}case l.NOSCRIPT:{e.options.scriptingEnabled?Ba(e,t):Fa(e,t);break}case l.PLAINTEXT:{Df(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:Fa(e,t)}}function Jf(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 ed(e,t){e.openElements.hasInScope(l.BODY)&&(e.insertionMode=T.AFTER_BODY,$s(e,t))}function td(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function nd(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 rd(e){e.openElements.hasInButtonScope(l.P)||e._insertFakeElement(k.P,l.P),e._closePElement()}function id(e){e.openElements.hasInListItemScope(l.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(l.LI),e.openElements.popUntilTagNamePopped(l.LI))}function ad(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function ud(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function sd(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function od(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(k.BR,l.BR),e.openElements.pop(),e.framesetOk=!1}function Ps(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const a=e.openElements.items[i],u=e.openElements.tagIDs[i];if(r===u&&(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,u))break}}function ur(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:{yi(e,t);break}case l.P:{rd(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:{td(e,t);break}case l.LI:{id(e);break}case l.DD:case l.DT:{ad(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{ud(e);break}case l.BR:{od(e);break}case l.BODY:{Jf(e,t);break}case l.HTML:{ed(e,t);break}case l.FORM:{nd(e);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{sd(e,t);break}case l.TEMPLATE:{At(e,t);break}default:Ps(e,t)}}function Ms(e,t){e.tmplInsertionModeStack.length>0?zs(e,t):Ni(e,t)}function ld(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 cd(e,t){e._err(t,I.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function _r(e,t){if(e.openElements.currentTagId!==void 0&&ws.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 X.CHARACTER:{Bs(e,t);break}case X.WHITESPACE_CHARACTER:{vs(e,t);break}}else kn(e,t)}function hd(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_CAPTION}function fd(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_COLUMN_GROUP}function dd(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(k.COLGROUP,l.COLGROUP),e.insertionMode=T.IN_COLUMN_GROUP,Ii(e,t)}function pd(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,D.HTML),e.insertionMode=T.IN_TABLE_BODY}function md(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(k.TBODY,l.TBODY),e.insertionMode=T.IN_TABLE_BODY,sr(e,t)}function gd(e,t){e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Ed(e,t){Ds(t)?e._appendElement(t,D.HTML):kn(e,t),t.ackSelfClosing=!0}function bd(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,D.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Mt(e,t){switch(t.tagID){case l.TD:case l.TH:case l.TR:{md(e,t);break}case l.STYLE:case l.SCRIPT:case l.TEMPLATE:{je(e,t);break}case l.COL:{dd(e,t);break}case l.FORM:{bd(e,t);break}case l.TABLE:{gd(e,t);break}case l.TBODY:case l.TFOOT:case l.THEAD:{pd(e,t);break}case l.INPUT:{Ed(e,t);break}case l.CAPTION:{hd(e,t);break}case l.COLGROUP:{fd(e,t);break}default:kn(e,t)}}function gn(e,t){switch(t.tagID){case l.TABLE:{e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode());break}case l.TEMPLATE:{At(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:kn(e,t)}}function kn(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,ar(e,t),e.fosterParentingEnabled=n}function vs(e,t){e.pendingCharacterTokens.push(t)}function Bs(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Wt(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)kn(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Fs=new Set([l.CAPTION,l.COL,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]);function Td(e,t){const n=t.tagID;Fs.has(n)?e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=T.IN_TABLE,Mt(e,t)):Te(e,t)}function xd(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&&gn(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:ur(e,t)}}function Ii(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.COL:{e._appendElement(t,D.HTML),t.ackSelfClosing=!0;break}case l.TEMPLATE:{je(e,t);break}default:qn(e,t)}}function _d(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:{At(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 sr(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(k.TR,l.TR),e.insertionMode=T.IN_ROW,or(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,Mt(e,t));break}default:Mt(e,t)}}function Wr(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,gn(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:gn(e,t)}}function or(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,sr(e,t));break}default:Mt(e,t)}}function Hs(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,Wr(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,Wr(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:gn(e,t)}}function Ad(e,t){const n=t.tagID;Fs.has(n)?(e.openElements.hasInTableScope(l.TD)||e.openElements.hasInTableScope(l.TH))&&(e._closeTableCell(),or(e,t)):Te(e,t)}function kd(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(),Hs(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:break;default:ur(e,t)}}function Us(e,t){switch(t.tagID){case l.HTML:{Te(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:{je(e,t);break}}}function js(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:{At(e,t);break}}}function Cd(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)):Us(e,t)}function yd(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)):js(e,t)}function Nd(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:{je(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,Mt(e,t);break}case l.COL:{e.tmplInsertionModeStack[0]=T.IN_COLUMN_GROUP,e.insertionMode=T.IN_COLUMN_GROUP,Ii(e,t);break}case l.TR:{e.tmplInsertionModeStack[0]=T.IN_TABLE_BODY,e.insertionMode=T.IN_TABLE_BODY,sr(e,t);break}case l.TD:case l.TH:{e.tmplInsertionModeStack[0]=T.IN_ROW,e.insertionMode=T.IN_ROW,or(e,t);break}default:e.tmplInsertionModeStack[0]=T.IN_BODY,e.insertionMode=T.IN_BODY,Te(e,t)}}function Id(e,t){t.tagID===l.TEMPLATE&&At(e,t)}function zs(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ni(e,t)}function Sd(e,t){t.tagID===l.HTML?Te(e,t):Vn(e,t)}function $s(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 Vn(e,t)}function Vn(e,t){e.insertionMode=T.IN_BODY,ar(e,t)}function wd(e,t){switch(t.tagID){case l.HTML:{Te(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:{je(e,t);break}}}function Ld(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 Od(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.NOFRAMES:{je(e,t);break}}}function Rd(e,t){t.tagID===l.HTML&&(e.insertionMode=T.AFTER_AFTER_FRAMESET)}function Dd(e,t){t.tagID===l.HTML?Te(e,t):Hn(e,t)}function Hn(e,t){e.insertionMode=T.IN_BODY,ar(e,t)}function Pd(e,t){switch(t.tagID){case l.HTML:{Te(e,t);break}case l.NOFRAMES:{je(e,t);break}}}function Md(e,t){t.chars=le,e._insertCharacters(t)}function vd(e,t){e._insertCharacters(t),e.framesetOk=!1}function Ys(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 Bd(e,t){if(Xh(t))Ys(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===D.MATHML?Is(t):r===D.SVG&&(Zh(t),Ss(t)),Ci(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Fd(e,t){if(t.tagID===l.P||t.tagID===l.BR){Ys(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}}}k.AREA,k.BASE,k.BASEFONT,k.BGSOUND,k.BR,k.COL,k.EMBED,k.FRAME,k.HR,k.IMG,k.INPUT,k.KEYGEN,k.LINK,k.META,k.PARAM,k.SOURCE,k.TRACK,k.WBR;const lr=qs("end"),qe=qs("start");function qs(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 Vs(e){const t=qe(e),n=lr(e);if(t&&n)return{start:t,end:n}}const Hd=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Ud=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Ha={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Ws(e,t){const n=Kd(e),r=gs("type",{handlers:{root:jd,element:zd,text:$d,comment:Qs,doctype:Yd,raw:Vd},unknown:Wd}),i={parser:n?new va(Ha):va.getFragmentParser(void 0,Ha),handle(s){r(s,i)},stitches:!1,options:t||{}};r(e,i),Ut(i,qe());const a=n?i.parser.document:i.parser.getFragment(),u=Kc(a,{file:i.options.file});return i.stitches&&at(u,"comment",function(s,o,c){const h=s;if(h.value.stitch&&c&&o!==void 0){const f=c.children;return f[o]=h.value.stitch,o}}),u.type==="root"&&u.children.length===1&&u.children[0].type===e.type?u.children[0]:u}function Gs(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function jd(e,t){Gs(e.children,t)}function zd(e,t){Gd(e,t),Gs(e.children,t),Qd(e,t)}function $d(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:X.CHARACTER,chars:e.value,location:Cn(e)};Ut(t,qe(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Yd(e,t){const n={type:X.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Cn(e)};Ut(t,qe(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function qd(e,t){t.stitches=!0;const n=Xd(e);if("children"in e&&"children"in n){const r=Ws({type:"root",children:e.children},t.options);n.children=r.children}Qs({type:"comment",value:{stitch:n}},t)}function Qs(e,t){const n=e.value,r={type:X.COMMENT,data:n,location:Cn(e)};Ut(t,qe(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Vd(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,Ks(t,qe(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Hd,"<$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 Wd(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))qd(n,t);else{let r="";throw Ud.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 Ut(e,t){Ks(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=de.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 Ks(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 Gd(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===de.PLAINTEXT)return;Ut(t,qe(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:pt.html;i===pt.html&&n==="svg"&&(i=pt.svg);const a=th({...e,children:[]},{space:i===pt.svg?"svg":"html"}),u={type:X.START_TAG,tagName:n,tagID:Ht(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Cn(e)};t.parser.currentToken=u,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Qd(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&lh.includes(n)||t.parser.tokenizer.state===de.PLAINTEXT)return;Ut(t,lr(e));const r={type:X.END_TAG,tagName:n,tagID:Ht(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Cn(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===de.RCDATA||t.parser.tokenizer.state===de.RAWTEXT||t.parser.tokenizer.state===de.SCRIPT_DATA)&&(t.parser.tokenizer.state=de.DATA)}function Kd(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Cn(e){const t=qe(e)||{line:void 0,column:void 0,offset:void 0},n=lr(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 Xd(e){return"children"in e?Et({...e,children:[]}):Et(e)}function Gr(e){return function(t,n){return Ws(t,{...e,file:n})}}const ht=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],ln={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...ht,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...ht],h2:[["className","sr-only"]],img:[...ht,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...ht,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...ht],table:[...ht],ul:[...ht,["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"]},rt={}.hasOwnProperty;function Zd(e,t){let n={type:"root",children:[]};const r={schema:t?{...ln,...t}:ln,stack:[]},i=Xs(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function Xs(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return Jd(e,n);case"doctype":return e0(e,n);case"element":return t0(e,n);case"root":return n0(e,n);case"text":return r0(e,n)}}}function Jd(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 yn(a,t),a}}function e0(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return yn(n,t),n}}function t0(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Zs(e,t.children),i=i0(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&&rt.call(e.schema.ancestors,n))){const s=e.schema.ancestors[n];let o=-1;for(a=!1;++o<s.length;)e.stack.includes(s[o])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const u={type:"element",tagName:n,properties:i,children:r};return yn(u,t),u}function n0(e,t){const r={type:"root",children:Zs(e,t.children)};return yn(r,t),r}function r0(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return yn(r,t),r}function Zs(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const a=Xs(e,r[i]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function i0(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&rt.call(r,n)?r[n]:void 0,u=r&&rt.call(r,"*")?r["*"]:void 0,s=t&&typeof t=="object"?t:{},o={};let c;for(c in s)if(rt.call(s,c)){const h=s[c];let f=Ua(e,ja(a,c),c,h);f==null&&(f=Ua(e,ja(u,c),c,h)),f!=null&&(o[c]=f)}if(i&&rt.call(i,n)){const h=i[n];for(c in h)rt.call(h,c)&&!rt.call(o,c)&&(o[c]=h[c])}return o}function Ua(e,t,n,r){return t?Array.isArray(r)?a0(e,t,n,r):Js(e,t,n,r):void 0}function a0(e,t,n,r){let i=-1;const a=[];for(;++i<r.length;){const u=Js(e,t,n,r[i]);(typeof u=="number"||typeof u=="string")&&a.push(u)}return a}function Js(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&u0(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,a=0;for(;++a<t.length;){const u=t[a];if(u&&typeof u=="object"&&"flags"in u){if(u.test(String(r))){i=!0;break}}else if(u===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 u0(e,t,n){const r=e.schema.protocols&&rt.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(":"),u=i.indexOf("?"),s=i.indexOf("#"),o=i.indexOf("/");if(a<0||o>-1&&a>o||u>-1&&a>u||s>-1&&a>s)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 yn(e,t){const n=Vs(t);t.data&&(e.data=Et(t.data)),n&&(e.position=n)}function ja(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 eo(e){return function(t){return Zd(t,e)}}function za(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 Ae=ot(/[A-Za-z]/),be=ot(/[\dA-Za-z]/),s0=ot(/[#-'*+\--9=?A-Z^-~]/);function Wn(e){return e!==null&&(e<32||e===127)}const Qr=ot(/\d/),o0=ot(/[\dA-Fa-f]/),l0=ot(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function se(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}const cr=ot(new RegExp("\\p{P}|\\p{S}","u")),bt=ot(/\s/);function ot(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function c0(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function h0(e,t,n){const i=tr((n||{}).ignore||[]),a=f0(t);let u=-1;for(;++u<a.length;)gi(e,"text",s);function s(c,h){let f=-1,d;for(;++f<h.length;){const p=h[f],b=d?d.children:void 0;if(i(p,b?b.indexOf(p):void 0,d))return;d=p}if(d)return o(c,h)}function o(c,h){const f=h[h.length-1],d=a[u][0],p=a[u][1];let b=0;const S=f.children.indexOf(c);let C=!1,R=[];d.lastIndex=0;let L=d.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?d.lastIndex=H+1:(b!==H&&R.push({type:"text",value:c.value.slice(b,H)}),Array.isArray(w)?R.push(...w):w&&R.push(w),b=H+L[0].length,C=!0),!d.global)break;L=d.exec(c.value)}return C?(b<c.value.length&&R.push({type:"text",value:c.value.slice(b)}),f.children.splice(S,1,...R)):R=[c],S+R.length}}function f0(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([d0(i[0]),p0(i[1])])}return t}function d0(e){return typeof e=="string"?new RegExp(c0(e),"g"):e}function p0(e){return typeof e=="function"?e:function(){return e}}const Ar="phrasing",kr=["autolink","link","image","label"];function m0(){return{transforms:[A0],enter:{literalAutolink:E0,literalAutolinkEmail:Cr,literalAutolinkHttp:Cr,literalAutolinkWww:Cr},exit:{literalAutolink:_0,literalAutolinkEmail:x0,literalAutolinkHttp:b0,literalAutolinkWww:T0}}}function g0(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ar,notInConstruct:kr},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ar,notInConstruct:kr},{character:":",before:"[ps]",after:"\\/",inConstruct:Ar,notInConstruct:kr}]}}function E0(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Cr(e){this.config.enter.autolinkProtocol.call(this,e)}function b0(e){this.config.exit.autolinkProtocol.call(this,e)}function T0(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 x0(e){this.config.exit.autolinkEmail.call(this,e)}function _0(e){this.exit(e)}function A0(e){h0(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,k0],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),C0]],{ignore:["link","linkReference"]})}function k0(e,t,n,r,i){let a="";if(!to(i)||(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!y0(n)))return!1;const u=N0(n+r);if(!u[0])return!1;const s={type:"link",title:null,url:a+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[s,{type:"text",value:u[1]}]:s}function C0(e,t,n,r){return!to(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function y0(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 N0(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=za(e,"(");let a=za(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 to(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||bt(n)||cr(n))&&(!t||n!==47)}function Ue(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}no.peek=M0;function I0(){this.buffer()}function S0(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function w0(){this.buffer()}function L0(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function O0(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ue(this.sliceSerialize(e)).toLowerCase(),n.label=t}function R0(e){this.exit(e)}function D0(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ue(this.sliceSerialize(e)).toLowerCase(),n.label=t}function P0(e){this.exit(e)}function M0(){return"["}function no(e,t,n,r){const i=n.createTracker(r);let a=i.move("[^");const u=n.enter("footnoteReference"),s=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),s(),u(),a+=i.move("]"),a}function v0(){return{enter:{gfmFootnoteCallString:I0,gfmFootnoteCall:S0,gfmFootnoteDefinitionLabelString:w0,gfmFootnoteDefinition:L0},exit:{gfmFootnoteCallString:O0,gfmFootnoteCall:R0,gfmFootnoteDefinitionLabelString:D0,gfmFootnoteDefinition:P0}}}function B0(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:no},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,a,u){const s=a.createTracker(u);let o=s.move("[^");const c=a.enter("footnoteDefinition"),h=a.enter("label");return o+=s.move(a.safe(a.associationId(r),{before:o,after:"]"})),h(),o+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),o+=s.move((t?`
|
|
4
|
+
`:" ")+a.indentLines(a.containerFlow(r,s.current()),t?ro:F0))),c(),o}}function F0(e,t,n){return t===0?e:ro(e,t,n)}function ro(e,t,n){return(n?"":" ")+e}const H0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];io.peek=Y0;function U0(){return{canContainEols:["delete"],enter:{strikethrough:z0},exit:{strikethrough:$0}}}function j0(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:H0}],handlers:{delete:io}}}function z0(e){this.enter({type:"delete",children:[]},e)}function $0(e){this.exit(e)}function io(e,t,n,r){const i=n.createTracker(r),a=n.enter("strikethrough");let u=i.move("~~");return u+=n.containerPhrasing(e,{...i.current(),before:u,after:"~"}),u+=i.move("~~"),a(),u}function Y0(){return"~"}function q0(e){return e.length}function V0(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||q0,a=[],u=[],s=[],o=[];let c=0,h=-1;for(;++h<e.length;){const A=[],S=[];let C=-1;for(e[h].length>c&&(c=e[h].length);++C<e[h].length;){const R=W0(e[h][C]);if(n.alignDelimiters!==!1){const L=i(R);S[C]=L,(o[C]===void 0||L>o[C])&&(o[C]=L)}A.push(R)}u[h]=A,s[h]=S}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<c;)a[f]=$a(r[f]);else{const A=$a(r);for(;++f<c;)a[f]=A}f=-1;const d=[],p=[];for(;++f<c;){const A=a[f];let S="",C="";A===99?(S=":",C=":"):A===108?S=":":A===114&&(C=":");let R=n.alignDelimiters===!1?1:Math.max(1,o[f]-S.length-C.length);const L=S+"-".repeat(R)+C;n.alignDelimiters!==!1&&(R=S.length+R+C.length,R>o[f]&&(o[f]=R),p[f]=R),d[f]=L}u.splice(1,0,d),s.splice(1,0,p),h=-1;const b=[];for(;++h<u.length;){const A=u[h],S=s[h];f=-1;const C=[];for(;++f<c;){const R=A[f]||"";let L="",H="";if(n.alignDelimiters!==!1){const j=o[f]-(S[f]||0),w=a[f];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&&!f&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&R==="")&&(n.delimiterStart!==!1||f)&&C.push(" "),n.alignDelimiters!==!1&&C.push(L),C.push(R),n.alignDelimiters!==!1&&C.push(H),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||f!==c-1)&&C.push("|")}b.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return b.join(`
|
|
5
|
+
`)}function W0(e){return e==null?"":String(e)}function $a(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 G0(e,t,n,r){const i=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const u=n.indentLines(n.containerFlow(e,a.current()),Q0);return i(),u}function Q0(e,t,n){return">"+(n?"":" ")+e}function K0(e,t){return Ya(e,t.inConstruct,!0)&&!Ya(e,t.notInConstruct,!1)}function Ya(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 qa(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
6
|
+
`&&K0(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
7
|
+
`}function X0(e,t){const n=String(e);let r=n.indexOf(t),i=r,a=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++a>u&&(u=a):a=1,i=r+t.length,r=n.indexOf(t,i);return u}function Z0(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function J0(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function ep(e,t,n,r){const i=J0(n),a=e.value||"",u=i==="`"?"GraveAccent":"Tilde";if(Z0(e,n)){const f=n.enter("codeIndented"),d=n.indentLines(a,tp);return f(),d}const s=n.createTracker(r),o=i.repeat(Math.max(X0(a,i)+1,3)),c=n.enter("codeFenced");let h=s.move(o);if(e.lang){const f=n.enter(`codeFencedLang${u}`);h+=s.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...s.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${u}`);h+=s.move(" "),h+=s.move(n.safe(e.meta,{before:h,after:`
|
|
8
|
+
`,encode:["`"],...s.current()})),f()}return h+=s.move(`
|
|
9
|
+
`),a&&(h+=s.move(a+`
|
|
10
|
+
`)),h+=s.move(o),c(),h}function tp(e,t,n){return(n?"":" ")+e}function Si(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function np(e,t,n,r){const i=Si(n),a=i==='"'?"Quote":"Apostrophe",u=n.enter("definition");let s=n.enter("label");const o=n.createTracker(r);let c=o.move("[");return c+=o.move(n.safe(n.associationId(e),{before:c,after:"]",...o.current()})),c+=o.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(s=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":`
|
|
11
|
+
`,...o.current()}))),s(),e.title&&(s=n.enter(`title${a}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),s()),u(),c}function rp(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function En(e){return"&#x"+e.toString(16).toUpperCase()+";"}function vt(e){if(e===null||se(e)||bt(e))return 1;if(cr(e))return 2}function Gn(e,t,n){const r=vt(e),i=vt(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ao.peek=ip;function ao(e,t,n,r){const i=rp(n),a=n.enter("emphasis"),u=n.createTracker(r),s=u.move(i);let o=u.move(n.containerPhrasing(e,{after:i,before:s,...u.current()}));const c=o.charCodeAt(0),h=Gn(r.before.charCodeAt(r.before.length-1),c,i);h.inside&&(o=En(c)+o.slice(1));const f=o.charCodeAt(o.length-1),d=Gn(r.after.charCodeAt(0),f,i);d.inside&&(o=o.slice(0,-1)+En(f));const p=u.move(i);return a(),n.attentionEncodeSurroundingInfo={after:d.outside,before:h.outside},s+o+p}function ip(e,t,n){return n.options.emphasis||"*"}const ap={};function wi(e,t){const n=ap,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return uo(e,r,i)}function uo(e,t,n){if(up(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Va(e.children,t,n)}return Array.isArray(e)?Va(e,t,n):""}function Va(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=uo(e[i],t,n);return r.join("")}function up(e){return!!(e&&typeof e=="object")}function sp(e,t){let n=!1;return at(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Ur}),!!((!e.depth||e.depth<3)&&wi(e)&&(t.options.setext||n))}function op(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(sp(e,n)){const h=n.enter("headingSetext"),f=n.enter("phrasing"),d=n.containerPhrasing(e,{...a.current(),before:`
|
|
12
|
+
`,after:`
|
|
13
|
+
`});return f(),h(),d+`
|
|
14
|
+
`+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
|
|
15
|
+
`))+1))}const u="#".repeat(i),s=n.enter("headingAtx"),o=n.enter("phrasing");a.move(u+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
16
|
+
`,...a.current()});return/^[\t ]/.test(c)&&(c=En(c.charCodeAt(0))+c.slice(1)),c=c?u+" "+c:u,n.options.closeAtx&&(c+=" "+u),o(),s(),c}so.peek=lp;function so(e){return e.value||""}function lp(){return"<"}oo.peek=cp;function oo(e,t,n,r){const i=Si(n),a=i==='"'?"Quote":"Apostrophe",u=n.enter("image");let s=n.enter("label");const o=n.createTracker(r);let c=o.move("![");return c+=o.move(n.safe(e.alt,{before:c,after:"]",...o.current()})),c+=o.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(s=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),s(),e.title&&(s=n.enter(`title${a}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),s()),c+=o.move(")"),u(),c}function cp(){return"!"}lo.peek=hp;function lo(e,t,n,r){const i=e.referenceType,a=n.enter("imageReference");let u=n.enter("label");const s=n.createTracker(r);let o=s.move("![");const c=n.safe(e.alt,{before:o,after:"]",...s.current()});o+=s.move(c+"]["),u();const h=n.stack;n.stack=[],u=n.enter("reference");const f=n.safe(n.associationId(e),{before:o,after:"]",...s.current()});return u(),n.stack=h,a(),i==="full"||!c||c!==f?o+=s.move(f+"]"):i==="shortcut"?o=o.slice(0,-1):o+=s.move("]"),o}function hp(){return"!"}co.peek=fp;function co(e,t,n){let r=e.value||"",i="`",a=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const u=n.unsafe[a],s=n.compilePattern(u);let o;if(u.atBreak)for(;o=s.exec(r);){let c=o.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(o.index+1)}}return i+r+i}function fp(){return"`"}function ho(e,t){const n=wi(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}fo.peek=dp;function fo(e,t,n,r){const i=Si(n),a=i==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let s,o;if(ho(e,n)){const h=n.stack;n.stack=[],s=n.enter("autolink");let f=u.move("<");return f+=u.move(n.containerPhrasing(e,{before:f,after:">",...u.current()})),f+=u.move(">"),s(),n.stack=h,f}s=n.enter("link"),o=n.enter("label");let c=u.move("[");return c+=u.move(n.containerPhrasing(e,{before:c,after:"](",...u.current()})),c+=u.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(o=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),o(),e.title&&(o=n.enter(`title${a}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),o()),c+=u.move(")"),s(),c}function dp(e,t,n){return ho(e,n)?"<":"["}po.peek=pp;function po(e,t,n,r){const i=e.referenceType,a=n.enter("linkReference");let u=n.enter("label");const s=n.createTracker(r);let o=s.move("[");const c=n.containerPhrasing(e,{before:o,after:"]",...s.current()});o+=s.move(c+"]["),u();const h=n.stack;n.stack=[],u=n.enter("reference");const f=n.safe(n.associationId(e),{before:o,after:"]",...s.current()});return u(),n.stack=h,a(),i==="full"||!c||c!==f?o+=s.move(f+"]"):i==="shortcut"?o=o.slice(0,-1):o+=s.move("]"),o}function pp(){return"["}function Li(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function mp(e){const t=Li(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gp(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function mo(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ep(e,t,n,r){const i=n.enter("list"),a=n.bulletCurrent;let u=e.ordered?gp(n):Li(n);const s=e.ordered?u==="."?")":".":mp(n);let o=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(o=!0),mo(n)===u&&h){let f=-1;for(;++f<e.children.length;){const d=e.children[f];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){o=!0;break}}}}o&&(u=s),n.bulletCurrent=u;const c=n.containerFlow(e,r);return n.bulletLastUsed=u,n.bulletCurrent=a,i(),c}function bp(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Tp(e,t,n,r){const i=bp(n);let a=n.bulletCurrent||Li(n);t&&t.type==="list"&&t.ordered&&(a=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let u=a.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const s=n.createTracker(r);s.move(a+" ".repeat(u-a.length)),s.shift(u);const o=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),h);return o(),c;function h(f,d,p){return d?(p?"":" ".repeat(u))+f:(p?a:a+" ".repeat(u-a.length))+f}}function xp(e,t,n,r){const i=n.enter("paragraph"),a=n.enter("phrasing"),u=n.containerPhrasing(e,r);return a(),i(),u}const _p=tr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ap(e,t,n,r){return(e.children.some(function(u){return _p(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function kp(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}go.peek=Cp;function go(e,t,n,r){const i=kp(n),a=n.enter("strong"),u=n.createTracker(r),s=u.move(i+i);let o=u.move(n.containerPhrasing(e,{after:i,before:s,...u.current()}));const c=o.charCodeAt(0),h=Gn(r.before.charCodeAt(r.before.length-1),c,i);h.inside&&(o=En(c)+o.slice(1));const f=o.charCodeAt(o.length-1),d=Gn(r.after.charCodeAt(0),f,i);d.inside&&(o=o.slice(0,-1)+En(f));const p=u.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:d.outside,before:h.outside},s+o+p}function Cp(e,t,n){return n.options.strong||"*"}function yp(e,t,n,r){return n.safe(e.value,r)}function Np(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Ip(e,t,n){const r=(mo(n)+(n.options.ruleSpaces?" ":"")).repeat(Np(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Eo={blockquote:G0,break:qa,code:ep,definition:np,emphasis:ao,hardBreak:qa,heading:op,html:so,image:oo,imageReference:lo,inlineCode:co,link:fo,linkReference:po,list:Ep,listItem:Tp,paragraph:xp,root:Ap,strong:go,text:yp,thematicBreak:Ip},Wa=document.createElement("i");function Oi(e){const t="&"+e+";";Wa.innerHTML=t;const n=Wa.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function bo(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}const Sp=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wp(e){return e.replace(Sp,Lp)}function Lp(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return bo(n.slice(a?2:1),a?16:10)}return Oi(n)||e}function Op(){return{enter:{table:Rp,tableData:Ga,tableHeader:Ga,tableRow:Pp},exit:{codeText:Mp,table:Dp,tableData:yr,tableHeader:yr,tableRow:yr}}}function Rp(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Dp(e){this.exit(e),this.data.inTable=void 0}function Pp(e){this.enter({type:"tableRow",children:[]},e)}function yr(e){this.exit(e)}function Ga(e){this.enter({type:"tableCell",children:[]},e)}function Mp(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vp));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vp(e,t){return t==="|"?t:e}function Bp(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
17
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:u,tableCell:o,tableRow:s}};function u(p,b,A,S){return c(h(p,A,S),p.align)}function s(p,b,A,S){const C=f(p,A,S),R=c([C]);return R.slice(0,R.indexOf(`
|
|
18
|
+
`))}function o(p,b,A,S){const C=A.enter("tableCell"),R=A.enter("phrasing"),L=A.containerPhrasing(p,{...S,before:a,after:a});return R(),C(),L}function c(p,b){return V0(p,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function h(p,b,A){const S=p.children;let C=-1;const R=[],L=b.enter("table");for(;++C<S.length;)R[C]=f(S[C],b,A);return L(),R}function f(p,b,A){const S=p.children;let C=-1;const R=[],L=b.enter("tableRow");for(;++C<S.length;)R[C]=o(S[C],p,b,A);return L(),R}function d(p,b,A){let S=Eo.inlineCode(p,b,A);return A.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function Fp(){return{exit:{taskListCheckValueChecked:Qa,taskListCheckValueUnchecked:Qa,paragraph:Up}}}function Hp(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:jp}}}function Qa(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Up(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,u;for(;++a<i.length;){const s=i[a];if(s.type==="paragraph"){u=s;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function jp(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);a&&s.move(u);let o=Eo.listItem(e,t,n,{...r,...s.current()});return a&&(o=o.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),o;function c(h){return h+u}}function zp(){return[m0(),v0(),U0(),Op(),Fp()]}function $p(e){return{extensions:[g0(),B0(e),j0(),Bp(e),Hp()]}}function Re(e,t,n,r){const i=e.length;let a=0,u;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);a<r.length;)u=r.slice(a,a+1e4),u.unshift(t,0),e.splice(...u),a+=1e4,t+=1e4}function Pe(e,t){return e.length>0?(Re(e,e.length,0,t),e):t}const Ka={}.hasOwnProperty;function To(e){const t={};let n=-1;for(;++n<e.length;)Yp(t,e[n]);return t}function Yp(e,t){let n;for(n in t){const i=(Ka.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let u;if(a)for(u in a){Ka.call(i,u)||(i[u]=[]);const s=a[u];qp(i[u],Array.isArray(s)?s:s?[s]:[])}}}function qp(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Re(e,0,0,r)}const Vp={tokenize:Zp,partial:!0},xo={tokenize:Jp,partial:!0},_o={tokenize:em,partial:!0},Ao={tokenize:tm,partial:!0},Wp={tokenize:nm,partial:!0},ko={name:"wwwAutolink",tokenize:Kp,previous:yo},Co={name:"protocolAutolink",tokenize:Xp,previous:No},Ze={name:"emailAutolink",tokenize:Qp,previous:Io},Ve={};function Gp(){return{text:Ve}}let ft=48;for(;ft<123;)Ve[ft]=Ze,ft++,ft===58?ft=65:ft===91&&(ft=97);Ve[43]=Ze;Ve[45]=Ze;Ve[46]=Ze;Ve[95]=Ze;Ve[72]=[Ze,Co];Ve[104]=[Ze,Co];Ve[87]=[Ze,ko];Ve[119]=[Ze,ko];function Qp(e,t,n){const r=this;let i,a;return u;function u(f){return!Kr(f)||!Io.call(r,r.previous)||Ri(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(f))}function s(f){return Kr(f)?(e.consume(f),s):f===64?(e.consume(f),o):n(f)}function o(f){return f===46?e.check(Wp,h,c)(f):f===45||f===95||be(f)?(a=!0,e.consume(f),o):h(f)}function c(f){return e.consume(f),i=!0,o}function h(f){return a&&i&&Ae(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function Kp(e,t,n){const r=this;return i;function i(u){return u!==87&&u!==119||!yo.call(r,r.previous)||Ri(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Vp,e.attempt(xo,e.attempt(_o,a),n),n)(u))}function a(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function Xp(e,t,n){const r=this;let i="",a=!1;return u;function u(f){return(f===72||f===104)&&No.call(r,r.previous)&&!Ri(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),s):n(f)}function s(f){if(Ae(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),s;if(f===58){const d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(f),o}return n(f)}function o(f){return f===47?(e.consume(f),a?c:(a=!0,o)):n(f)}function c(f){return f===null||Wn(f)||se(f)||bt(f)||cr(f)?n(f):e.attempt(xo,e.attempt(_o,h),n)(f)}function h(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Zp(e,t,n){let r=0;return i;function i(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),i):u===46&&r===3?(e.consume(u),a):n(u)}function a(u){return u===null?n(u):t(u)}}function Jp(e,t,n){let r,i,a;return u;function u(c){return c===46||c===95?e.check(Ao,o,s)(c):c===null||se(c)||bt(c)||c!==45&&cr(c)?o(c):(a=!0,e.consume(c),u)}function s(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),u}function o(c){return i||r||!a?n(c):t(c)}}function em(e,t){let n=0,r=0;return i;function i(u){return u===40?(n++,e.consume(u),i):u===41&&r<n?a(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(Ao,t,a)(u):u===null||se(u)||bt(u)?t(u):(e.consume(u),i)}function a(u){return u===41&&r++,e.consume(u),i}}function tm(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),a):s===93?(e.consume(s),i):s===60||s===null||se(s)||bt(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||se(s)||bt(s)?t(s):r(s)}function a(s){return Ae(s)?u(s):n(s)}function u(s){return s===59?(e.consume(s),r):Ae(s)?(e.consume(s),u):n(s)}}function nm(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return be(a)?n(a):t(a)}}function yo(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||se(e)}function No(e){return!Ae(e)}function Io(e){return!(e===47||Kr(e))}function Kr(e){return e===43||e===45||e===46||e===95||be(e)}function Ri(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function jt(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let u="";if(a===37&&be(e.charCodeAt(n+1))&&be(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(u=String.fromCharCode(a));else if(a>55295&&a<57344){const s=e.charCodeAt(n+1);a<56320&&s>56319&&s<57344?(u=String.fromCharCode(a,s),i=1):u="�"}else u=String.fromCharCode(a);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+i+1,u=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function hr(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Xr={name:"attention",resolveAll:rm,tokenize:im};function rm(e,t){let n=-1,r,i,a,u,s,o,c,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;o=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},d={...e[n][1].start};Xa(f,-o),Xa(d,o),u={type:o>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},s={type:o>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:d},a={type:o>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:o>1?"strong":"emphasis",start:{...u.start},end:{...s.end}},e[r][1].end={...u.start},e[n][1].start={...s.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Pe(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Pe(c,[["enter",i,t],["enter",u,t],["exit",u,t],["enter",a,t]]),c=Pe(c,hr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Pe(c,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,c=Pe(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Re(e,r-1,n-r+3,c),n=r+c.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function im(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=vt(r);let a;return u;function u(o){return a=o,e.enter("attentionSequence"),s(o)}function s(o){if(o===a)return e.consume(o),s;const c=e.exit("attentionSequence"),h=vt(o),f=!h||h===2&&i||n.includes(o),d=!i||i===2&&h||n.includes(r);return c._open=!!(a===42?f:f&&(i||!d)),c._close=!!(a===42?d:d&&(h||!f)),t(o)}}function Xa(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const am={name:"autolink",tokenize:um};function um(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return Ae(p)?(e.consume(p),u):p===64?n(p):c(p)}function u(p){return p===43||p===45||p===46||be(p)?(r=1,s(p)):c(p)}function s(p){return p===58?(e.consume(p),r=0,o):(p===43||p===45||p===46||be(p))&&r++<32?(e.consume(p),s):(r=0,c(p))}function o(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Wn(p)?n(p):(e.consume(p),o)}function c(p){return p===64?(e.consume(p),h):s0(p)?(e.consume(p),c):n(p)}function h(p){return be(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,h):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):d(p)}function d(p){if((p===45||be(p))&&r++<63){const b=p===45?d:f;return e.consume(p),b}return n(p)}}function ee(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return u;function u(o){return Z(o)?(e.enter(n),s(o)):t(o)}function s(o){return Z(o)&&a++<i?(e.consume(o),s):(e.exit(n),t(o))}}const Nn={partial:!0,tokenize:sm};function sm(e,t,n){return r;function r(a){return Z(a)?ee(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||$(a)?t(a):n(a)}}const So={continuation:{tokenize:lm},exit:cm,name:"blockQuote",tokenize:om};function om(e,t,n){const r=this;return i;function i(u){if(u===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),a}return n(u)}function a(u){return Z(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function lm(e,t,n){const r=this;return i;function i(u){return Z(u)?ee(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):a(u)}function a(u){return e.attempt(So,t,n)(u)}}function cm(e){e.exit("blockQuote")}const wo={name:"characterEscape",tokenize:hm};function hm(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return l0(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const Lo={name:"characterReference",tokenize:fm};function fm(e,t,n){const r=this;let i=0,a,u;return s;function s(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),o}function o(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),a=31,u=be,h(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,u=o0,h):(e.enter("characterReferenceValue"),a=7,u=Qr,h(f))}function h(f){if(f===59&&i){const d=e.exit("characterReferenceValue");return u===be&&!Oi(r.sliceSerialize(d))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(f)&&i++<a?(e.consume(f),h):n(f)}}const Za={partial:!0,tokenize:pm},Ja={concrete:!0,name:"codeFenced",tokenize:dm};function dm(e,t,n){const r=this,i={partial:!0,tokenize:j};let a=0,u=0,s;return o;function o(w){return c(w)}function c(w){const W=r.events[r.events.length-1];return a=W&&W[1].type==="linePrefix"?W[2].sliceSerialize(W[1],!0).length:0,s=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(w)}function h(w){return w===s?(u++,e.consume(w),h):u<3?n(w):(e.exit("codeFencedFenceSequence"),Z(w)?ee(e,f,"whitespace")(w):f(w))}function f(w){return w===null||$(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(Za,A,H)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===null||$(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(w)):Z(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ee(e,p,"whitespace")(w)):w===96&&w===s?n(w):(e.consume(w),d)}function p(w){return w===null||$(w)?f(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(w))}function b(w){return w===null||$(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(w)):w===96&&w===s?n(w):(e.consume(w),b)}function A(w){return e.attempt(i,H,S)(w)}function S(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),C}function C(w){return a>0&&Z(w)?ee(e,R,"linePrefix",a+1)(w):R(w)}function R(w){return w===null||$(w)?e.check(Za,A,H)(w):(e.enter("codeFlowValue"),L(w))}function L(w){return w===null||$(w)?(e.exit("codeFlowValue"),R(w)):(e.consume(w),L)}function H(w){return e.exit("codeFenced"),t(w)}function j(w,W,V){let K=0;return N;function N(F){return w.enter("lineEnding"),w.consume(F),w.exit("lineEnding"),U}function U(F){return w.enter("codeFencedFence"),Z(F)?ee(w,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):v(F)}function v(F){return F===s?(w.enter("codeFencedFenceSequence"),Y(F)):V(F)}function Y(F){return F===s?(K++,w.consume(F),Y):K>=u?(w.exit("codeFencedFenceSequence"),Z(F)?ee(w,z,"whitespace")(F):z(F)):V(F)}function z(F){return F===null||$(F)?(w.exit("codeFencedFence"),W(F)):V(F)}}}function pm(e,t,n){const r=this;return i;function i(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a)}function a(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const Nr={name:"codeIndented",tokenize:gm},mm={partial:!0,tokenize:Em};function gm(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ee(e,a,"linePrefix",5)(c)}function a(c){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?u(c):n(c)}function u(c){return c===null?o(c):$(c)?e.attempt(mm,u,o)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||$(c)?(e.exit("codeFlowValue"),u(c)):(e.consume(c),s)}function o(c){return e.exit("codeIndented"),t(c)}}function Em(e,t,n){const r=this;return i;function i(u){return r.parser.lazy[r.now().line]?n(u):$(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),i):ee(e,a,"linePrefix",5)(u)}function a(u){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(u):$(u)?i(u):n(u)}}const bm={name:"codeText",previous:xm,resolve:Tm,tokenize:_m};function Tm(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function xm(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _m(e,t,n){let r=0,i,a;return u;function u(f){return e.enter("codeText"),e.enter("codeTextSequence"),s(f)}function s(f){return f===96?(e.consume(f),r++,s):(e.exit("codeTextSequence"),o(f))}function o(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),o):f===96?(a=e.enter("codeTextSequence"),i=0,h(f)):$(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),o):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||$(f)?(e.exit("codeTextData"),o(f)):(e.consume(f),c)}function h(f){return f===96?(e.consume(f),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",c(f))}}class Am{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Gt(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Gt(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Gt(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Gt(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Gt(this.left,n.reverse())}}}function Gt(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Oo(e){const t={};let n=-1,r,i,a,u,s,o,c;const h=new Am(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(o=r[1]._tokenizer.events,a=0,a<o.length&&o[a][1].type==="lineEndingBlank"&&(a+=2),a<o.length&&o[a][1].type==="content"))for(;++a<o.length&&o[a][1].type!=="content";)o[a][1].type==="chunkText"&&(o[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,km(h,n)),n=t[n],c=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(u=h.get(a),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),u[1].type="lineEnding",i=a);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},s=h.slice(i,n),s.unshift(r),h.splice(i,n-i+1,s))}}return Re(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function km(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let u=n._tokenizer;u||(u=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const s=u.events,o=[],c={};let h,f,d=-1,p=n,b=0,A=0;const S=[A];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(h=r.sliceStream(p),p.next||h.push(null),f&&u.defineSkip(p.start),p._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(h),p._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++d<s.length;)s[d][0]==="exit"&&s[d-1][0]==="enter"&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(A=d+1,S.push(A),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(u.events=[],p?(p._tokenizer=void 0,p.previous=void 0):S.pop(),d=S.length;d--;){const C=s.slice(S[d],S[d+1]),R=a.pop();o.push([R,R+C.length-1]),e.splice(R,2,C)}for(o.reverse(),d=-1;++d<o.length;)c[b+o[d][0]]=b+o[d][1],b+=o[d][1]-o[d][0]-1;return c}const Cm={resolve:Nm,tokenize:Im},ym={partial:!0,tokenize:Sm};function Nm(e){return Oo(e),e}function Im(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?a(s):$(s)?e.check(ym,u,a)(s):(e.consume(s),i)}function a(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function u(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Sm(e,t,n){const r=this;return i;function i(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),ee(e,a,"linePrefix")}function a(u){if(u===null||$(u))return n(u);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function Ro(e,t,n,r,i,a,u,s,o){const c=o||Number.POSITIVE_INFINITY;let h=0;return f;function f(C){return C===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(C),e.exit(a),d):C===null||C===32||C===41||Wn(C)?n(C):(e.enter(r),e.enter(u),e.enter(s),e.enter("chunkString",{contentType:"string"}),A(C))}function d(C){return C===62?(e.enter(a),e.consume(C),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),p(C))}function p(C){return C===62?(e.exit("chunkString"),e.exit(s),d(C)):C===null||C===60||$(C)?n(C):(e.consume(C),C===92?b:p)}function b(C){return C===60||C===62||C===92?(e.consume(C),p):p(C)}function A(C){return!h&&(C===null||C===41||se(C))?(e.exit("chunkString"),e.exit(s),e.exit(u),e.exit(r),t(C)):h<c&&C===40?(e.consume(C),h++,A):C===41?(e.consume(C),h--,A):C===null||C===32||C===40||Wn(C)?n(C):(e.consume(C),C===92?S:A)}function S(C){return C===40||C===41||C===92?(e.consume(C),A):A(C)}}function Do(e,t,n,r,i,a){const u=this;let s=0,o;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(a),h}function h(p){return s>999||p===null||p===91||p===93&&!o||p===94&&!s&&"_hiddenFootnoteSupport"in u.parser.constructs?n(p):p===93?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):$(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||$(p)||s++>999?(e.exit("chunkString"),h(p)):(e.consume(p),o||(o=!Z(p)),p===92?d:f)}function d(p){return p===91||p===92||p===93?(e.consume(p),s++,f):f(p)}}function Po(e,t,n,r,i,a){let u;return s;function s(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),u=d===40?41:d,o):n(d)}function o(d){return d===u?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(e.enter(a),c(d))}function c(d){return d===u?(e.exit(a),o(u)):d===null?n(d):$(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),ee(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(d))}function h(d){return d===u||d===null||$(d)?(e.exit("chunkString"),c(d)):(e.consume(d),d===92?f:h)}function f(d){return d===u||d===92?(e.consume(d),h):h(d)}}function cn(e,t){let n;return r;function r(i){return $(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Z(i)?ee(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const wm={name:"definition",tokenize:Om},Lm={partial:!0,tokenize:Rm};function Om(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),u(p)}function u(p){return Do.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function s(p){return i=Ue(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),o):n(p)}function o(p){return se(p)?cn(e,c)(p):c(p)}function c(p){return Ro(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function h(p){return e.attempt(Lm,f,f)(p)}function f(p){return Z(p)?ee(e,d,"whitespace")(p):d(p)}function d(p){return p===null||$(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function Rm(e,t,n){return r;function r(s){return se(s)?cn(e,i)(s):n(s)}function i(s){return Po(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Z(s)?ee(e,u,"whitespace")(s):u(s)}function u(s){return s===null||$(s)?t(s):n(s)}}const Dm={name:"hardBreakEscape",tokenize:Pm};function Pm(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return $(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Mm={name:"headingAtx",resolve:vm,tokenize:Bm};function vm(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Re(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Bm(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),a(h)}function a(h){return e.enter("atxHeadingSequence"),u(h)}function u(h){return h===35&&r++<6?(e.consume(h),u):h===null||se(h)?(e.exit("atxHeadingSequence"),s(h)):n(h)}function s(h){return h===35?(e.enter("atxHeadingSequence"),o(h)):h===null||$(h)?(e.exit("atxHeading"),t(h)):Z(h)?ee(e,s,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function o(h){return h===35?(e.consume(h),o):(e.exit("atxHeadingSequence"),s(h))}function c(h){return h===null||h===35||se(h)?(e.exit("atxHeadingText"),s(h)):(e.consume(h),c)}}const Fm=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],eu=["pre","script","style","textarea"],Hm={concrete:!0,name:"htmlFlow",resolveTo:zm,tokenize:$m},Um={partial:!0,tokenize:qm},jm={partial:!0,tokenize:Ym};function zm(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function $m(e,t,n){const r=this;let i,a,u,s,o;return c;function c(_){return h(_)}function h(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),f}function f(_){return _===33?(e.consume(_),d):_===47?(e.consume(_),a=!0,A):_===63?(e.consume(_),i=3,r.interrupt?t:x):Ae(_)?(e.consume(_),u=String.fromCharCode(_),S):n(_)}function d(_){return _===45?(e.consume(_),i=2,p):_===91?(e.consume(_),i=5,s=0,b):Ae(_)?(e.consume(_),i=4,r.interrupt?t:x):n(_)}function p(_){return _===45?(e.consume(_),r.interrupt?t:x):n(_)}function b(_){const Be="CDATA[";return _===Be.charCodeAt(s++)?(e.consume(_),s===Be.length?r.interrupt?t:v:b):n(_)}function A(_){return Ae(_)?(e.consume(_),u=String.fromCharCode(_),S):n(_)}function S(_){if(_===null||_===47||_===62||se(_)){const Be=_===47,lt=u.toLowerCase();return!Be&&!a&&eu.includes(lt)?(i=1,r.interrupt?t(_):v(_)):Fm.includes(u.toLowerCase())?(i=6,Be?(e.consume(_),C):r.interrupt?t(_):v(_)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):a?R(_):L(_))}return _===45||be(_)?(e.consume(_),u+=String.fromCharCode(_),S):n(_)}function C(_){return _===62?(e.consume(_),r.interrupt?t:v):n(_)}function R(_){return Z(_)?(e.consume(_),R):N(_)}function L(_){return _===47?(e.consume(_),N):_===58||_===95||Ae(_)?(e.consume(_),H):Z(_)?(e.consume(_),L):N(_)}function H(_){return _===45||_===46||_===58||_===95||be(_)?(e.consume(_),H):j(_)}function j(_){return _===61?(e.consume(_),w):Z(_)?(e.consume(_),j):L(_)}function w(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),o=_,W):Z(_)?(e.consume(_),w):V(_)}function W(_){return _===o?(e.consume(_),o=null,K):_===null||$(_)?n(_):(e.consume(_),W)}function V(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||se(_)?j(_):(e.consume(_),V)}function K(_){return _===47||_===62||Z(_)?L(_):n(_)}function N(_){return _===62?(e.consume(_),U):n(_)}function U(_){return _===null||$(_)?v(_):Z(_)?(e.consume(_),U):n(_)}function v(_){return _===45&&i===2?(e.consume(_),ne):_===60&&i===1?(e.consume(_),ce):_===62&&i===4?(e.consume(_),Se):_===63&&i===3?(e.consume(_),x):_===93&&i===5?(e.consume(_),ie):$(_)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Um,We,Y)(_)):_===null||$(_)?(e.exit("htmlFlowData"),Y(_)):(e.consume(_),v)}function Y(_){return e.check(jm,z,We)(_)}function z(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),F}function F(_){return _===null||$(_)?Y(_):(e.enter("htmlFlowData"),v(_))}function ne(_){return _===45?(e.consume(_),x):v(_)}function ce(_){return _===47?(e.consume(_),u="",Ie):v(_)}function Ie(_){if(_===62){const Be=u.toLowerCase();return eu.includes(Be)?(e.consume(_),Se):v(_)}return Ae(_)&&u.length<8?(e.consume(_),u+=String.fromCharCode(_),Ie):v(_)}function ie(_){return _===93?(e.consume(_),x):v(_)}function x(_){return _===62?(e.consume(_),Se):_===45&&i===2?(e.consume(_),x):v(_)}function Se(_){return _===null||$(_)?(e.exit("htmlFlowData"),We(_)):(e.consume(_),Se)}function We(_){return e.exit("htmlFlow"),t(_)}}function Ym(e,t,n){const r=this;return i;function i(u){return $(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):n(u)}function a(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function qm(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Nn,t,n)}}const Vm={name:"htmlText",tokenize:Wm};function Wm(e,t,n){const r=this;let i,a,u;return s;function s(x){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(x),o}function o(x){return x===33?(e.consume(x),c):x===47?(e.consume(x),j):x===63?(e.consume(x),L):Ae(x)?(e.consume(x),V):n(x)}function c(x){return x===45?(e.consume(x),h):x===91?(e.consume(x),a=0,b):Ae(x)?(e.consume(x),R):n(x)}function h(x){return x===45?(e.consume(x),p):n(x)}function f(x){return x===null?n(x):x===45?(e.consume(x),d):$(x)?(u=f,ce(x)):(e.consume(x),f)}function d(x){return x===45?(e.consume(x),p):f(x)}function p(x){return x===62?ne(x):x===45?d(x):f(x)}function b(x){const Se="CDATA[";return x===Se.charCodeAt(a++)?(e.consume(x),a===Se.length?A:b):n(x)}function A(x){return x===null?n(x):x===93?(e.consume(x),S):$(x)?(u=A,ce(x)):(e.consume(x),A)}function S(x){return x===93?(e.consume(x),C):A(x)}function C(x){return x===62?ne(x):x===93?(e.consume(x),C):A(x)}function R(x){return x===null||x===62?ne(x):$(x)?(u=R,ce(x)):(e.consume(x),R)}function L(x){return x===null?n(x):x===63?(e.consume(x),H):$(x)?(u=L,ce(x)):(e.consume(x),L)}function H(x){return x===62?ne(x):L(x)}function j(x){return Ae(x)?(e.consume(x),w):n(x)}function w(x){return x===45||be(x)?(e.consume(x),w):W(x)}function W(x){return $(x)?(u=W,ce(x)):Z(x)?(e.consume(x),W):ne(x)}function V(x){return x===45||be(x)?(e.consume(x),V):x===47||x===62||se(x)?K(x):n(x)}function K(x){return x===47?(e.consume(x),ne):x===58||x===95||Ae(x)?(e.consume(x),N):$(x)?(u=K,ce(x)):Z(x)?(e.consume(x),K):ne(x)}function N(x){return x===45||x===46||x===58||x===95||be(x)?(e.consume(x),N):U(x)}function U(x){return x===61?(e.consume(x),v):$(x)?(u=U,ce(x)):Z(x)?(e.consume(x),U):K(x)}function v(x){return x===null||x===60||x===61||x===62||x===96?n(x):x===34||x===39?(e.consume(x),i=x,Y):$(x)?(u=v,ce(x)):Z(x)?(e.consume(x),v):(e.consume(x),z)}function Y(x){return x===i?(e.consume(x),i=void 0,F):x===null?n(x):$(x)?(u=Y,ce(x)):(e.consume(x),Y)}function z(x){return x===null||x===34||x===39||x===60||x===61||x===96?n(x):x===47||x===62||se(x)?K(x):(e.consume(x),z)}function F(x){return x===47||x===62||se(x)?K(x):n(x)}function ne(x){return x===62?(e.consume(x),e.exit("htmlTextData"),e.exit("htmlText"),t):n(x)}function ce(x){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Ie}function Ie(x){return Z(x)?ee(e,ie,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):ie(x)}function ie(x){return e.enter("htmlTextData"),u(x)}}const Di={name:"labelEnd",resolveAll:Xm,resolveTo:Zm,tokenize:Jm},Gm={tokenize:e1},Qm={tokenize:t1},Km={tokenize:n1};function Xm(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Re(e,0,e.length,n),e}function Zm(e,t){let n=e.length,r=0,i,a,u,s;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(u=n);const o={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[a][1].start},end:{...e[u][1].end}},h={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[u-2][1].start}};return s=[["enter",o,t],["enter",c,t]],s=Pe(s,e.slice(a+1,a+r+3)),s=Pe(s,[["enter",h,t]]),s=Pe(s,hr(t.parser.constructs.insideSpan.null,e.slice(a+r+4,u-3),t)),s=Pe(s,[["exit",h,t],e[u-2],e[u-1],["exit",c,t]]),s=Pe(s,e.slice(u+1)),s=Pe(s,[["exit",o,t]]),Re(e,a,e.length,s),e}function Jm(e,t,n){const r=this;let i=r.events.length,a,u;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(d){return a?a._inactive?f(d):(u=r.parser.defined.includes(Ue(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),o):n(d)}function o(d){return d===40?e.attempt(Gm,h,u?h:f)(d):d===91?e.attempt(Qm,h,u?c:f)(d):u?h(d):f(d)}function c(d){return e.attempt(Km,h,f)(d)}function h(d){return t(d)}function f(d){return a._balanced=!0,n(d)}}function e1(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return se(f)?cn(e,a)(f):a(f)}function a(f){return f===41?h(f):Ro(e,u,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function u(f){return se(f)?cn(e,o)(f):h(f)}function s(f){return n(f)}function o(f){return f===34||f===39||f===40?Po(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):h(f)}function c(f){return se(f)?cn(e,h)(f):h(f)}function h(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function t1(e,t,n){const r=this;return i;function i(s){return Do.call(r,e,a,u,"reference","referenceMarker","referenceString")(s)}function a(s){return r.parser.defined.includes(Ue(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function u(s){return n(s)}}function n1(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const r1={name:"labelStartImage",resolveAll:Di.resolveAll,tokenize:i1};function i1(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),a}function a(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),u):n(s)}function u(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const a1={name:"labelStartLink",resolveAll:Di.resolveAll,tokenize:u1};function u1(e,t,n){const r=this;return i;function i(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),a}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Ir={name:"lineEnding",tokenize:s1};function s1(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ee(e,t,"linePrefix")}}const Un={name:"thematicBreak",tokenize:o1};function o1(e,t,n){let r=0,i;return a;function a(c){return e.enter("thematicBreak"),u(c)}function u(c){return i=c,s(c)}function s(c){return c===i?(e.enter("thematicBreakSequence"),o(c)):r>=3&&(c===null||$(c))?(e.exit("thematicBreak"),t(c)):n(c)}function o(c){return c===i?(e.consume(c),r++,o):(e.exit("thematicBreakSequence"),Z(c)?ee(e,s,"whitespace")(c):s(c))}}const ye={continuation:{tokenize:f1},exit:p1,name:"list",tokenize:h1},l1={partial:!0,tokenize:m1},c1={partial:!0,tokenize:d1};function h1(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,u=0;return s;function s(p){const b=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Qr(p)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Un,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(p)}return n(p)}function o(p){return Qr(p)&&++u<10?(e.consume(p),o):(!r.interrupt||u<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Nn,r.interrupt?n:h,e.attempt(l1,d,f))}function h(p){return r.containerState.initialBlankLine=!0,a++,d(p)}function f(p){return Z(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),d):n(p)}function d(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function f1(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Nn,i,a);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ee(e,t,"listItemIndent",r.containerState.size+1)(s)}function a(s){return r.containerState.furtherBlankLines||!Z(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(c1,t,u)(s))}function u(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,ee(e,e.attempt(ye,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function d1(e,t,n){const r=this;return ee(e,i,"listItemIndent",r.containerState.size+1);function i(a){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(a):n(a)}}function p1(e){e.exit(this.containerState.type)}function m1(e,t,n){const r=this;return ee(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const u=r.events[r.events.length-1];return!Z(a)&&u&&u[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const tu={name:"setextUnderline",resolveTo:g1,tokenize:E1};function g1(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",u,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=u,e.push(["exit",u,t]),e}function E1(e,t,n){const r=this;let i;return a;function a(c){let h=r.events.length,f;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){f=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,u(c)):n(c)}function u(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Z(c)?ee(e,o,"lineSuffix")(c):o(c))}function o(c){return c===null||$(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const b1={tokenize:N1,partial:!0};function T1(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:k1,continuation:{tokenize:C1},exit:y1}},text:{91:{name:"gfmFootnoteCall",tokenize:A1},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:x1,resolveTo:_1}}}}function x1(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;i--;){const o=r.events[i][1];if(o.type==="labelImage"){u=o;break}if(o.type==="gfmFootnoteCall"||o.type==="labelLink"||o.type==="label"||o.type==="image"||o.type==="link")break}return s;function s(o){if(!u||!u._balanced)return n(o);const c=Ue(r.sliceSerialize({start:u.end,end:r.now()}));return c.codePointAt(0)!==94||!a.includes(c.slice(1))?n(o):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o))}}function _1(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",u,t],["exit",u,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function A1(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,u;return s;function s(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),o}function o(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(f){if(a>999||f===93&&!u||f===null||f===91||se(f))return n(f);if(f===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return i.includes(Ue(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return se(f)||(u=!0),a++,e.consume(f),f===92?h:c}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function k1(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,u=0,s;return o;function o(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(b)}function h(b){if(u>999||b===93&&!s||b===null||b===91||se(b))return n(b);if(b===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return a=Ue(r.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return se(b)||(s=!0),u++,e.consume(b),b===92?f:h}function f(b){return b===91||b===92||b===93?(e.consume(b),u++,h):h(b)}function d(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(a)||i.push(a),ee(e,p,"gfmFootnoteDefinitionWhitespace")):n(b)}function p(b){return t(b)}}function C1(e,t,n){return e.check(Nn,t,e.attempt(b1,t,n))}function y1(e){e.exit("gfmFootnoteDefinition")}function N1(e,t,n){const r=this;return ee(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(a):n(a)}}function I1(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(u,s){let o=-1;for(;++o<u.length;)if(u[o][0]==="enter"&&u[o][1].type==="strikethroughSequenceTemporary"&&u[o][1]._close){let c=o;for(;c--;)if(u[c][0]==="exit"&&u[c][1].type==="strikethroughSequenceTemporary"&&u[c][1]._open&&u[o][1].end.offset-u[o][1].start.offset===u[c][1].end.offset-u[c][1].start.offset){u[o][1].type="strikethroughSequence",u[c][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},u[c][1].start),end:Object.assign({},u[o][1].end)},f={type:"strikethroughText",start:Object.assign({},u[c][1].end),end:Object.assign({},u[o][1].start)},d=[["enter",h,s],["enter",u[c][1],s],["exit",u[c][1],s],["enter",f,s]],p=s.parser.constructs.insideSpan.null;p&&Re(d,d.length,0,hr(p,u.slice(c+1,o),s)),Re(d,d.length,0,[["exit",f,s],["enter",u[o][1],s],["exit",u[o][1],s],["exit",h,s]]),Re(u,c-1,o-c+3,d),o=c+d.length-2;break}}for(o=-1;++o<u.length;)u[o][1].type==="strikethroughSequenceTemporary"&&(u[o][1].type="data");return u}function a(u,s,o){const c=this.previous,h=this.events;let f=0;return d;function d(b){return c===126&&h[h.length-1][1].type!=="characterEscape"?o(b):(u.enter("strikethroughSequenceTemporary"),p(b))}function p(b){const A=vt(c);if(b===126)return f>1?o(b):(u.consume(b),f++,p);if(f<2&&!n)return o(b);const S=u.exit("strikethroughSequenceTemporary"),C=vt(b);return S._open=!C||C===2&&!!A,S._close=!A||A===2&&!!C,s(b)}}}class S1{constructor(){this.map=[]}add(t,n,r){w1(this,t,n,r)}consume(t){if(this.map.sort(function(a,u){return a[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function w1(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function L1(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function O1(){return{flow:{null:{name:"table",tokenize:R1,resolveAll:D1}}}}function R1(e,t,n){const r=this;let i=0,a=0,u;return s;function s(N){let U=r.events.length-1;for(;U>-1;){const z=r.events[U][1].type;if(z==="lineEnding"||z==="linePrefix")U--;else break}const v=U>-1?r.events[U][1].type:null,Y=v==="tableHead"||v==="tableRow"?w:o;return Y===w&&r.parser.lazy[r.now().line]?n(N):Y(N)}function o(N){return e.enter("tableHead"),e.enter("tableRow"),c(N)}function c(N){return N===124||(u=!0,a+=1),h(N)}function h(N){return N===null?n(N):$(N)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),p):n(N):Z(N)?ee(e,h,"whitespace")(N):(a+=1,u&&(u=!1,i+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),u=!0,h):(e.enter("data"),f(N)))}function f(N){return N===null||N===124||se(N)?(e.exit("data"),h(N)):(e.consume(N),N===92?d:f)}function d(N){return N===92||N===124?(e.consume(N),f):f(N)}function p(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),u=!1,Z(N)?ee(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):b(N))}function b(N){return N===45||N===58?S(N):N===124?(u=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),A):j(N)}function A(N){return Z(N)?ee(e,S,"whitespace")(N):S(N)}function S(N){return N===58?(a+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),C):N===45?(a+=1,C(N)):N===null||$(N)?H(N):j(N)}function C(N){return N===45?(e.enter("tableDelimiterFiller"),R(N)):j(N)}function R(N){return N===45?(e.consume(N),R):N===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),L):(e.exit("tableDelimiterFiller"),L(N))}function L(N){return Z(N)?ee(e,H,"whitespace")(N):H(N)}function H(N){return N===124?b(N):N===null||$(N)?!u||i!==a?j(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):j(N)}function j(N){return n(N)}function w(N){return e.enter("tableRow"),W(N)}function W(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),W):N===null||$(N)?(e.exit("tableRow"),t(N)):Z(N)?ee(e,W,"whitespace")(N):(e.enter("data"),V(N))}function V(N){return N===null||N===124||se(N)?(e.exit("data"),W(N)):(e.consume(N),N===92?K:V)}function K(N){return N===92||N===124?(e.consume(N),V):V(N)}}function D1(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],u=[0,0,0,0],s=!1,o=0,c,h,f;const d=new S1;for(;++n<e.length;){const p=e[n],b=p[1];p[0]==="enter"?b.type==="tableHead"?(s=!1,o!==0&&(nu(d,t,o,c,h),h=void 0,o=0),c={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},d.add(n,0,[["enter",c,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],u=[0,n+1,0,0],s&&(s=!1,h={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},d.add(n,0,[["enter",h,t]])),i=b.type==="tableDelimiterRow"?2:h?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(a[1]!==0&&(u[0]=u[1],f=Rn(d,t,a,i,void 0,f),a=[0,0,0,0]),u[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(u[0]=u[1],f=Rn(d,t,a,i,void 0,f)),a=u,u=[a[1],n,0,0])):b.type==="tableHead"?(s=!0,o=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(o=n,a[1]!==0?(u[0]=u[1],f=Rn(d,t,a,i,n,f)):u[1]!==0&&(f=Rn(d,t,u,i,n,f)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(u[3]=n)}for(o!==0&&nu(d,t,o,c,h),d.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=L1(t.events,n))}return e}function Rn(e,t,n,r,i,a){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(a.end=Object.assign({},Lt(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const o=Lt(t.events,n[1]);if(a={type:u,start:Object.assign({},o),end:Object.assign({},o)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const c=Lt(t.events,n[2]),h=Lt(t.events,n[3]),f={type:s,start:Object.assign({},c),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const d=t.events[n[2]],p=t.events[n[3]];if(d[1].end=Object.assign({},p[1].end),d[1].type="chunkText",d[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,A=n[3]-n[2]-1;e.add(b,A,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(a.end=Object.assign({},Lt(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function nu(e,t,n,r,i){const a=[],u=Lt(t.events,n);i&&(i.end=Object.assign({},u),a.push(["exit",i,t])),r.end=Object.assign({},u),a.push(["exit",r,t]),e.add(n+1,0,a)}function Lt(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const P1={name:"tasklistCheck",tokenize:v1};function M1(){return{text:{91:P1}}}function v1(e,t,n){const r=this;return i;function i(o){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(o):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),a)}function a(o){return se(o)?(e.enter("taskListCheckValueUnchecked"),e.consume(o),e.exit("taskListCheckValueUnchecked"),u):o===88||o===120?(e.enter("taskListCheckValueChecked"),e.consume(o),e.exit("taskListCheckValueChecked"),u):n(o)}function u(o){return o===93?(e.enter("taskListCheckMarker"),e.consume(o),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(o)}function s(o){return $(o)?t(o):Z(o)?e.check({tokenize:B1},t,n)(o):n(o)}}function B1(e,t,n){return ee(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function F1(e){return To([Gp(),T1(),I1(e),O1(),M1()])}const H1={};function U1(e){const t=this,n=e||H1,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(F1(n)),a.push(zp()),u.push($p(n))}var j1=Object.defineProperty,z1=Object.defineProperties,$1=Object.getOwnPropertyDescriptors,ru=Object.getOwnPropertySymbols,Y1=Object.prototype.hasOwnProperty,q1=Object.prototype.propertyIsEnumerable,iu=(e,t,n)=>t in e?j1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mo=(e,t)=>{for(var n in t||(t={}))Y1.call(t,n)&&iu(e,n,t[n]);if(ru)for(var n of ru(t))q1.call(t,n)&&iu(e,n,t[n]);return e},vo=(e,t)=>z1(e,$1(t)),V1=/(\*\*)([^*]*\*?)$/,W1=/(__)([^_]*?)$/,G1=/(\*\*\*)([^*]*?)$/,Q1=/(\*)([^*]*?)$/,K1=/(_)([^_]*?)$/,X1=/(`)([^`]*?)$/,Z1=/(~~)([^~]*?)$/,kt=/^[\s_~*`]*$/,Bo=/^[\s]*[-*+][\s]+$/,J1=/[\p{L}\p{N}_]/u,eg=/^```[^`\n]*```?$/,tg=/^\*{4,}$/,ng=/(__)([^_]+)_$/,rg=/(~~)([^~]+)~$/,ig=/__/g,au=/~~/g,ut=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:J1.test(e)},Tt=(e,t)=>{let n=!1;for(let r=0;r<t;r+=1)e[r]==="`"&&e[r+1]==="`"&&e[r+2]==="`"&&(n=!n,r+=2);return n},ag=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},Fo=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},fr=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},ug=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
19
|
+
`)return!1}return!1},Ho=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?ug(e,t):!1;if(e[n]===`
|
|
20
|
+
`)return!1}return!1},Pi=(e,t,n)=>{let r=0;for(let o=t-1;o>=0;o-=1)if(e[o]===`
|
|
21
|
+
`){r=o+1;break}let i=e.length;for(let o=t;o<e.length;o+=1)if(e[o]===`
|
|
22
|
+
`){i=o;break}let a=e.substring(r,i),u=0,s=!1;for(let o of a)if(o===n)u+=1;else if(o!==" "&&o!==" "){s=!0;break}return u>=3&&!s},sg=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,og=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(sg,(t,n,r,i)=>Tt(e,i)?t:`${n}\\>${r}`),lg=(e,t,n)=>{if(n!==" "&&n!==" ")return!1;let r=0;for(let i=t-1;i>=0;i-=1)if(e[i]===`
|
|
23
|
+
`){r=i+1;break}for(let i=r;i<t;i+=1)if(e[i]!==" "&&e[i]!==" ")return!1;return!0},cg=(e,t,n,r)=>n==="\\"||e.includes("$")&&fr(e,t)?!0:n!=="*"&&r==="*"?(t<e.length-2?e[t+2]:"")!=="*":!!(n==="*"||n&&r&&ut(n)&&ut(r)||(!n||n===" "||n===" "||n===`
|
|
24
|
+
`)&&(!r||r===" "||r===" "||r===`
|
|
25
|
+
`)||lg(e,t,r)),Uo=e=>{let t=0,n=e.length;for(let r=0;r<n;r+=1){if(e[r]!=="*")continue;let i=r>0?e[r-1]:"",a=r<n-1?e[r+1]:"";cg(e,r,i,a)||(t+=1)}return t},hg=(e,t,n,r)=>!!(n==="\\"||e.includes("$")&&fr(e,t)||Ho(e,t)||n==="_"||r==="_"||n&&r&&ut(n)&&ut(r)),fg=e=>{let t=0,n=e.length;for(let r=0;r<n;r+=1){if(e[r]!=="_")continue;let i=r>0?e[r-1]:"",a=r<n-1?e[r+1]:"";hg(e,r,i,a)||(t+=1)}return t},dg=e=>{let t=0,n=0;for(let r=0;r<e.length;r+=1)e[r]==="*"?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0);return n>=3&&(t+=Math.floor(n/3)),t},pg=(e,t,n)=>{if(!t||kt.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
26
|
+
`),i=r===-1?0:r+1,a=e.substring(i,n);return Bo.test(a)&&t.includes(`
|
|
27
|
+
`)?!0:Pi(e,n,"*")},mg=e=>{let t=e.match(V1);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Tt(e,r)||pg(e,n,r)?e:(e.match(/\*\*/g)||[]).length%2===1?n.endsWith("*")?`${e}*`:`${e}**`:e},gg=(e,t,n)=>{if(!t||kt.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
28
|
+
`),i=r===-1?0:r+1,a=e.substring(i,n);return Bo.test(a)&&t.includes(`
|
|
29
|
+
`)?!0:Pi(e,n,"_")},Eg=e=>{let t=e.match(W1);if(!t){let i=e.match(ng);if(i){let a=e.lastIndexOf(i[1]);if(!Tt(e,a)&&(e.match(ig)||[]).length%2===1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return Tt(e,r)||gg(e,n,r)?e:(e.match(/__/g)||[]).length%2===1?`${e}__`:e},bg=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="*"&&e[t-1]!=="*"&&e[t+1]!=="*"&&e[t-1]!=="\\"&&!fr(e,t)){let n=t>0?e[t-1]:"",r=t<e.length-1?e[t+1]:"";if((!n||n===" "||n===" "||n===`
|
|
30
|
+
`)&&(!r||r===" "||r===" "||r===`
|
|
31
|
+
`)||n&&r&&ut(n)&&ut(r))continue;return t}return-1},Tg=e=>{if(!e.match(Q1))return e;let t=bg(e);if(t===-1||Tt(e,t))return e;let n=e.substring(t+1);return!n||kt.test(n)?e:Uo(e)%2===1?`${e}*`:e},jo=e=>{for(let t=0;t<e.length;t+=1)if(e[t]==="_"&&e[t-1]!=="_"&&e[t+1]!=="_"&&e[t-1]!=="\\"&&!fr(e,t)&&!Ho(e,t)){let n=t>0?e[t-1]:"",r=t<e.length-1?e[t+1]:"";if(n&&r&&ut(n)&&ut(r))continue;return t}return-1},xg=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
32
|
+
`;)t-=1;if(t<e.length){let n=e.slice(0,t),r=e.slice(t);return`${n}_${r}`}return`${e}_`},_g=e=>{if(!e.endsWith("**"))return null;let t=e.slice(0,-2);if((t.match(/\*\*/g)||[]).length%2!==1)return null;let n=t.indexOf("**"),r=jo(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},Ag=e=>{if(!e.match(K1))return e;let t=jo(e);if(t===-1||Tt(e,t))return e;let n=e.substring(t+1);if(!n||kt.test(n))return e;if(fg(e)%2===1){let r=_g(e);return r!==null?r:xg(e)}return e},kg=e=>{let t=(e.match(/\*\*/g)||[]).length,n=Uo(e);return t%2===0&&n%2===0},Cg=(e,t,n)=>!t||kt.test(t)||Tt(e,n)?!0:Pi(e,n,"*"),yg=e=>{if(tg.test(e))return e;let t=e.match(G1);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return Cg(e,n,r)?e:dg(e)%2===1?kg(e)?e:`${e}***`:e},bn=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},Ng=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},Ig=e=>{let t=0;for(let n=0;n<e.length;n+=1)e[n]==="`"&&!Ng(e,n)&&(t+=1);return t},Sg=/<[a-zA-Z/][^>]*$/,wg=e=>{let t=e.match(Sg);return!t||t.index===void 0||bn(e,t.index)?e:e.substring(0,t.index).trimEnd()},Lg=e=>!e.match(eg)||e.includes(`
|
|
33
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,Og=e=>(e.match(/```/g)||[]).length%2===1,Rg=e=>{let t=Lg(e);if(t!==null)return t;let n=e.match(X1);if(n&&!Og(e)){let r=n[2];if(!r||kt.test(r))return e;if(Ig(e)%2===1)return`${e}\``}return e},Dg=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",Pg=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!Dg(e,r)&&(n=!n),!n&&e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},Mg=e=>{let t=e.indexOf("$$");return t!==-1&&e.indexOf(`
|
|
34
|
+
`,t)!==-1&&!e.endsWith(`
|
|
35
|
+
`)?`${e}
|
|
36
|
+
$$`:`${e}$$`},vg=e=>Pg(e)%2===0?e:Mg(e),Bg=(e,t,n)=>{if(e.substring(t+2).includes(")"))return null;let r=ag(e,t);if(r===-1||bn(e,r))return null;let i=r>0&&e[r-1]==="!",a=i?r-1:r,u=e.substring(0,a);if(i)return u;let s=e.substring(r+1,t);return n==="text-only"?`${u}${s}`:`${u}[${s}](streamdown:incomplete-link)`},uu=(e,t)=>{for(let n=0;n<=t;n++)if(e[n]==="["&&!bn(e,n)){if(n>0&&e[n-1]==="!")continue;let r=Fo(e,n);if(r===-1)return n;if(r+1<e.length&&e[r+1]==="("){let i=e.indexOf(")",r+2);i!==-1&&(n=i)}}return-1},Fg=(e,t,n)=>{let r=t>0&&e[t-1]==="!",i=r?t-1:t,a=e.substring(t+1);if(!a.includes("]")){let u=e.substring(0,i);if(r)return u;if(n==="text-only"){let s=uu(e,t);return s!==-1?e.substring(0,s)+e.substring(s+1):`${u}${a}`}return`${e}](streamdown:incomplete-link)`}if(Fo(e,t)===-1){let u=e.substring(0,i);if(r)return u;if(n==="text-only"){let s=uu(e,t);if(s!==-1)return e.substring(0,s)+e.substring(s+1);let o=e.substring(t+1);return`${u}${o}`}return`${e}](streamdown:incomplete-link)`}return null},zo=(e,t="protocol")=>{let n=e.lastIndexOf("](");if(n!==-1&&!bn(e,n)){let r=Bg(e,n,t);if(r!==null)return r}for(let r=e.length-1;r>=0;r-=1)if(e[r]==="["&&!bn(e,r)){let i=Fg(e,r,t);if(i!==null)return i}return e},Hg=/^-{1,2}$/,Ug=/^[\s]*-{1,2}[\s]+$/,jg=/^={1,2}$/,zg=/^[\s]*={1,2}[\s]+$/,$g=e=>{if(!e||typeof e!="string")return e;let t=e.lastIndexOf(`
|
|
37
|
+
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(Hg.test(i)&&!n.match(Ug)){let a=r.split(`
|
|
38
|
+
`).at(-1);if(a&&a.trim().length>0)return`${e}`}if(jg.test(i)&&!n.match(zg)){let a=r.split(`
|
|
39
|
+
`).at(-1);if(a&&a.trim().length>0)return`${e}`}return e},Yg=e=>{let t=e.match(Z1);if(t){let n=t[2];if(!n||kt.test(n))return e;if((e.match(au)||[]).length%2===1)return`${e}~~`}else if(e.match(rg)&&(e.match(au)||[]).length%2===1)return`${e}~`;return e},Sr=e=>e!==!1,_e={COMPARISON_OPERATORS:-10,HTML_TAGS:-5,SETEXT_HEADINGS:0,LINKS:10,BOLD_ITALIC:20,BOLD:30,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,DEFAULT:100},qg=[{handler:{name:"comparisonOperators",handle:og,priority:_e.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:wg,priority:_e.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:$g,priority:_e.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:zo,priority:_e.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:yg,priority:_e.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:mg,priority:_e.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:Eg,priority:_e.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:Tg,priority:_e.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:Ag,priority:_e.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:Rg,priority:_e.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:Yg,priority:_e.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:vg,priority:_e.KATEX},optionKey:"katex"}],Vg=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return qg.filter(({handler:r,optionKey:i})=>r.name==="links"?Sr(e?.links)||Sr(e?.images):Sr(e?.[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:vo(Mo({},r),{handle:a=>zo(a,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},Wg=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=Vg(t),a=((n=t?.handlers)!=null?n:[]).map(s=>{var o;return{handler:vo(Mo({},s),{priority:(o=s.priority)!=null?o:_e.DEFAULT}),earlyReturn:void 0}}),u=[...i,...a].sort((s,o)=>{var c,h;return((c=s.handler.priority)!=null?c:_e.DEFAULT)-((h=o.handler.priority)!=null?h:_e.DEFAULT)});for(let{handler:s,earlyReturn:o}of u)if(r=s.handle(r),o!=null&&o(r))return r;return r},Gg=Wg;const Qg=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Kg=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xg={};function su(e,t){return(Xg.jsx?Kg:Qg).test(e)}const Zg=/[ \t\n\f\r]/g;function Jg(e){return typeof e=="object"?e.type==="text"?ou(e.value):!1:ou(e)}function ou(e){return e.replace(Zg,"")===""}var wt={},wr,lu;function eE(){if(lu)return wr;lu=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,s=/^\s+|\s+$/g,o=`
|
|
40
|
+
`,c="/",h="*",f="",d="comment",p="declaration";function b(S,C){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];C=C||{};var R=1,L=1;function H(z){var F=z.match(t);F&&(R+=F.length);var ne=z.lastIndexOf(o);L=~ne?z.length-ne:L+z.length}function j(){var z={line:R,column:L};return function(F){return F.position=new w(z),K(),F}}function w(z){this.start=z,this.end={line:R,column:L},this.source=C.source}w.prototype.content=S;function W(z){var F=new Error(C.source+":"+R+":"+L+": "+z);if(F.reason=z,F.filename=C.source,F.line=R,F.column=L,F.source=S,!C.silent)throw F}function V(z){var F=z.exec(S);if(F){var ne=F[0];return H(ne),S=S.slice(ne.length),F}}function K(){V(n)}function N(z){var F;for(z=z||[];F=U();)F!==!1&&z.push(F);return z}function U(){var z=j();if(!(c!=S.charAt(0)||h!=S.charAt(1))){for(var F=2;f!=S.charAt(F)&&(h!=S.charAt(F)||c!=S.charAt(F+1));)++F;if(F+=2,f===S.charAt(F-1))return W("End of comment missing");var ne=S.slice(2,F-2);return L+=2,H(ne),S=S.slice(F),L+=2,z({type:d,comment:ne})}}function v(){var z=j(),F=V(r);if(F){if(U(),!V(i))return W("property missing ':'");var ne=V(a),ce=z({type:p,property:A(F[0].replace(e,f)),value:ne?A(ne[0].replace(e,f)):f});return V(u),ce}}function Y(){var z=[];N(z);for(var F;F=v();)F!==!1&&(z.push(F),N(z));return z}return K(),Y()}function A(S){return S?S.replace(s,f):f}return wr=b,wr}var cu;function tE(){if(cu)return wt;cu=1;var e=wt&&wt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wt,"__esModule",{value:!0}),wt.default=n;const t=e(eE());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const u=(0,t.default)(r),s=typeof i=="function";return u.forEach(o=>{if(o.type!=="declaration")return;const{property:c,value:h}=o;s?i(c,h,o):h&&(a=a||{},a[c]=h)}),a}return wt}var Qt={},hu;function nE(){if(hu)return Qt;hu=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(c){return!c||n.test(c)||e.test(c)},u=function(c,h){return h.toUpperCase()},s=function(c,h){return"".concat(h,"-")},o=function(c,h){return h===void 0&&(h={}),a(c)?c:(c=c.toLowerCase(),h.reactCompat?c=c.replace(i,s):c=c.replace(r,s),c.replace(t,u))};return Qt.camelCase=o,Qt}var Kt,fu;function rE(){if(fu)return Kt;fu=1;var e=Kt&&Kt.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(tE()),n=nE();function r(i,a){var u={};return!i||typeof i!="string"||(0,t.default)(i,function(s,o){s&&o&&(u[(0,n.camelCase)(s,a)]=o)}),u}return r.default=r,Kt=r,Kt}var iE=rE();const aE=Ku(iE);function hn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?du(e.position):"start"in e||"end"in e?du(e):"line"in e||"column"in e?Zr(e):""}function Zr(e){return pu(e&&e.line)+":"+pu(e&&e.column)}function du(e){return Zr(e&&e.start)+"-"+Zr(e&&e.end)}function pu(e){return e&&typeof e=="number"?e:1}class xe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},u=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(u=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const o=r.indexOf(":");o===-1?a.ruleId=r:(a.source=r.slice(0,o),a.ruleId=r.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const s=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=hn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=u&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}xe.prototype.file="";xe.prototype.name="";xe.prototype.reason="";xe.prototype.message="";xe.prototype.stack="";xe.prototype.column=void 0;xe.prototype.line=void 0;xe.prototype.ancestors=void 0;xe.prototype.cause=void 0;xe.prototype.fatal=void 0;xe.prototype.place=void 0;xe.prototype.ruleId=void 0;xe.prototype.source=void 0;const Mi={}.hasOwnProperty,uE=new Map,sE=/[A-Z]/g,oE=new Set(["table","tbody","thead","tfoot","tr"]),lE=new Set(["td","th"]),$o="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cE(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=bE(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=EE(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?st:An,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Yo(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Yo(e,t,n){if(t.type==="element")return hE(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return fE(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return pE(e,t,n);if(t.type==="mdxjsEsm")return dE(e,t);if(t.type==="root")return mE(e,t,n);if(t.type==="text")return gE(e,t)}function hE(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=st,e.schema=i),e.ancestors.push(t);const a=Vo(e,t.tagName,!1),u=TE(e,t);let s=Bi(e,t);return oE.has(t.tagName)&&(s=s.filter(function(o){return typeof o=="string"?!Jg(o):!0})),qo(e,u,a,t),vi(u,s),e.ancestors.pop(),e.schema=r,e.create(t,a,u,n)}function fE(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Tn(e,t.position)}function dE(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Tn(e,t.position)}function pE(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=st,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:Vo(e,t.name,!0),u=xE(e,t),s=Bi(e,t);return qo(e,u,a,t),vi(u,s),e.ancestors.pop(),e.schema=r,e.create(t,a,u,n)}function mE(e,t,n){const r={};return vi(r,Bi(e,t)),e.create(t,e.Fragment,r,n)}function gE(e,t){return t.value}function qo(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function vi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function EE(e,t,n){return r;function r(i,a,u,s){const c=Array.isArray(u.children)?n:t;return s?c(a,u,s):c(a,u)}}function bE(e,t){return n;function n(r,i,a,u){const s=Array.isArray(a.children),o=qe(r);return t(i,a,u,s,{columnNumber:o?o.column-1:void 0,fileName:e,lineNumber:o?o.line:void 0},void 0)}}function TE(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Mi.call(t.properties,i)){const a=_E(e,i,t.properties[i]);if(a){const[u,s]=a;e.tableCellAlignToStyle&&u==="align"&&typeof s=="string"&&lE.has(t.tagName)?r=s:n[u]=s}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function xE(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const u=a.expression;u.type;const s=u.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else Tn(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,a=e.evaluater.evaluateExpression(s.expression)}else Tn(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Bi(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:uE;for(;++r<t.children.length;){const a=t.children[r];let u;if(e.passKeys){const o=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(o){const c=i.get(o)||0;u=o+"-"+c,i.set(o,c+1)}}const s=Yo(e,a,u);s!==void 0&&n.push(s)}return n}function _E(e,t,n){const r=ir(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?hs(n):fs(n)),r.property==="style"){let i=typeof n=="object"?n:AE(e,String(n));return e.stylePropertyNameCase==="css"&&(i=kE(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Mc[r.property]||r.property:r.attribute,n]}}function AE(e,t){try{return aE(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new xe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=$o+"#cannot-parse-style-attribute",i}}function Vo(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,u;for(;++a<i.length;){const s=su(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};u=u?{type:"MemberExpression",object:u,property:s,computed:!!(a&&s.type==="Literal"),optional:!1}:s}r=u}else r=su(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Mi.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Tn(e)}function Tn(e,t){const n=new xe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=$o+"#cannot-handle-mdx-estrees-without-createevaluater",n}function kE(e){const t={};let n;for(n in e)Mi.call(e,n)&&(t[CE(n)]=e[n]);return t}function CE(e){let t=e.replace(sE,yE);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function yE(e){return"-"+e.toLowerCase()}const Lr={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},NE={tokenize:IE};function IE(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ee(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),a(s)}function a(s){const o=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=o),n=o,u(s)}function u(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return $(s)?(e.consume(s),e.exit("chunkText"),a):(e.consume(s),u)}}const SE={tokenize:wE},mu={tokenize:LE};function wE(e){const t=this,n=[];let r=0,i,a,u;return s;function s(L){if(r<n.length){const H=n[r];return t.containerState=H[1],e.attempt(H[0].continuation,o,c)(L)}return c(L)}function o(L){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&R();const H=t.events.length;let j=H,w;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){w=t.events[j][1].end;break}C(r);let W=H;for(;W<t.events.length;)t.events[W][1].end={...w},W++;return Re(t.events,j+1,0,t.events.slice(H)),t.events.length=W,c(L)}return s(L)}function c(L){if(r===n.length){if(!i)return d(L);if(i.currentConstruct&&i.currentConstruct.concrete)return b(L);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(mu,h,f)(L)}function h(L){return i&&R(),C(r),d(L)}function f(L){return t.parser.lazy[t.now().line]=r!==n.length,u=t.now().offset,b(L)}function d(L){return t.containerState={},e.attempt(mu,p,b)(L)}function p(L){return r++,n.push([t.currentConstruct,t.containerState]),d(L)}function b(L){if(L===null){i&&R(),C(0),e.consume(L);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),A(L)}function A(L){if(L===null){S(e.exit("chunkFlow"),!0),C(0),e.consume(L);return}return $(L)?(e.consume(L),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(L),A)}function S(L,H){const j=t.sliceStream(L);if(H&&j.push(null),L.previous=a,a&&(a.next=L),a=L,i.defineSkip(L.start),i.write(j),t.parser.lazy[L.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<u&&(!i.events[w][1].end||i.events[w][1].end.offset>u))return;const W=t.events.length;let V=W,K,N;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){if(K){N=t.events[V][1].end;break}K=!0}for(C(r),w=W;w<t.events.length;)t.events[w][1].end={...N},w++;Re(t.events,V+1,0,t.events.slice(W)),t.events.length=w}}function C(L){let H=n.length;for(;H-- >L;){const j=n[H];t.containerState=j[1],j[0].exit.call(t,e)}n.length=L}function R(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function LE(e,t,n){return ee(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}const OE={tokenize:RE};function RE(e){const t=this,n=e.attempt(Nn,r,e.attempt(this.parser.constructs.flowInitial,i,ee(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Cm,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const DE={resolveAll:Go()},PE=Wo("string"),ME=Wo("text");function Wo(e){return{resolveAll:Go(e==="text"?vE:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,u,s);return u;function u(h){return c(h)?a(h):s(h)}function s(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),o}function o(h){return c(h)?(n.exit("data"),a(h)):(n.consume(h),o)}function c(h){if(h===null)return!0;const f=i[h];let d=-1;if(f)for(;++d<f.length;){const p=f[d];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Go(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function vE(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,u=-1,s=0,o;for(;a--;){const c=i[a];if(typeof c=="string"){for(u=c.length;c.charCodeAt(u-1)===32;)s++,u--;if(u)break;u=-1}else if(c===-2)o=!0,s++;else if(c!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const c={type:n===e.length||o||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?u:r.start._bufferIndex+u,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const BE={42:ye,43:ye,45:ye,48:ye,49:ye,50:ye,51:ye,52:ye,53:ye,54:ye,55:ye,56:ye,57:ye,62:So},FE={91:wm},HE={[-2]:Nr,[-1]:Nr,32:Nr},UE={35:Mm,42:Un,45:[tu,Un],60:Hm,61:tu,95:Un,96:Ja,126:Ja},jE={38:Lo,92:wo},zE={[-5]:Ir,[-4]:Ir,[-3]:Ir,33:r1,38:Lo,42:Xr,60:[am,Vm],91:a1,92:[Dm,wo],93:Di,95:Xr,96:bm},$E={null:[Xr,DE]},YE={null:[42,95]},qE={null:[]},VE=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:YE,contentInitial:FE,disable:qE,document:BE,flow:UE,flowInitial:HE,insideSpan:$E,string:jE,text:zE},Symbol.toStringTag,{value:"Module"}));function WE(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let u=[],s=[];const o={attempt:W(j),check:W(w),consume:R,enter:L,exit:H,interrupt:W(w,{interrupt:!0})},c={code:null,containerState:{},defineSkip:A,events:[],now:b,parser:e,previous:null,sliceSerialize:d,sliceStream:p,write:f};let h=t.tokenize.call(c,o);return t.resolveAll&&a.push(t),c;function f(U){return u=Pe(u,U),S(),u[u.length-1]!==null?[]:(V(t,0),c.events=hr(a,c.events,c),c.events)}function d(U,v){return QE(p(U),v)}function p(U){return GE(u,U)}function b(){const{_bufferIndex:U,_index:v,line:Y,column:z,offset:F}=r;return{_bufferIndex:U,_index:v,line:Y,column:z,offset:F}}function A(U){i[U.line]=U.column,N()}function S(){let U;for(;r._index<u.length;){const v=u[r._index];if(typeof v=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<v.length;)C(v.charCodeAt(r._bufferIndex));else C(v)}}function C(U){h=h(U)}function R(U){$(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,N()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=U}function L(U,v){const Y=v||{};return Y.type=U,Y.start=b(),c.events.push(["enter",Y,c]),s.push(Y),Y}function H(U){const v=s.pop();return v.end=b(),c.events.push(["exit",v,c]),v}function j(U,v){V(U,v.from)}function w(U,v){v.restore()}function W(U,v){return Y;function Y(z,F,ne){let ce,Ie,ie,x;return Array.isArray(z)?We(z):"tokenize"in z?We([z]):Se(z);function Se(Ee){return zt;function zt(Je){const yt=Je!==null&&Ee[Je],Nt=Je!==null&&Ee.null,wn=[...Array.isArray(yt)?yt:yt?[yt]:[],...Array.isArray(Nt)?Nt:Nt?[Nt]:[]];return We(wn)(Je)}}function We(Ee){return ce=Ee,Ie=0,Ee.length===0?ne:_(Ee[Ie])}function _(Ee){return zt;function zt(Je){return x=K(),ie=Ee,Ee.partial||(c.currentConstruct=Ee),Ee.name&&c.parser.constructs.disable.null.includes(Ee.name)?lt():Ee.tokenize.call(v?Object.assign(Object.create(c),v):c,o,Be,lt)(Je)}}function Be(Ee){return U(ie,x),F}function lt(Ee){return x.restore(),++Ie<ce.length?_(ce[Ie]):ne}}}function V(U,v){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&Re(c.events,v,c.events.length-v,U.resolve(c.events.slice(v),c)),U.resolveTo&&(c.events=U.resolveTo(c.events,c))}function K(){const U=b(),v=c.previous,Y=c.currentConstruct,z=c.events.length,F=Array.from(s);return{from:z,restore:ne};function ne(){r=U,c.previous=v,c.currentConstruct=Y,c.events.length=z,s=F,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function GE(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let u;if(n===i)u=[e[n].slice(r,a)];else{if(u=e.slice(n,i),r>-1){const s=u[0];typeof s=="string"?u[0]=s.slice(r):u.shift()}a>0&&u.push(e[i].slice(0,a))}return u}function QE(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let u;if(typeof a=="string")u=a;else switch(a){case-5:{u="\r";break}case-4:{u=`
|
|
41
|
+
`;break}case-3:{u=`\r
|
|
42
|
+
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&i)continue;u=" ";break}default:u=String.fromCharCode(a)}i=a===-2,r.push(u)}return r.join("")}function KE(e){const r={constructs:To([VE,...(e||{}).extensions||[]]),content:i(NE),defined:[],document:i(SE),flow:i(OE),lazy:{},string:i(PE),text:i(ME)};return r;function i(a){return u;function u(s){return WE(r,a,s)}}}function XE(e){for(;!Oo(e););return e}const gu=/[\0\t\n\r]/g;function ZE(){let e=1,t="",n=!0,r;return i;function i(a,u,s){const o=[];let c,h,f,d,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(u||void 0).decode(a)),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(gu.lastIndex=f,c=gu.exec(a),d=c&&c.index!==void 0?c.index:a.length,p=a.charCodeAt(d),!c){t=a.slice(f);break}if(p===10&&f===d&&r)o.push(-3),r=void 0;else switch(r&&(o.push(-5),r=void 0),f<d&&(o.push(a.slice(f,d)),e+=d-f),p){case 0:{o.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,o.push(-2);e++<h;)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:r=!0,e=1}f=d+1}return s&&(r&&o.push(-5),t&&o.push(t),o.push(null)),o}}const Qo={}.hasOwnProperty;function JE(e,t,n){return typeof t!="string"&&(n=t,t=void 0),eb(n)(XE(KE(n).document().write(ZE()(e,t,!0))))}function eb(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ia),autolinkProtocol:K,autolinkEmail:K,atxHeading:a(ta),blockQuote:a(Nt),characterEscape:K,characterReference:K,codeFenced:a(wn),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:a(wn,u),codeText:a(nc,u),codeTextData:K,data:K,codeFlowValue:K,definition:a(rc),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:a(ic),hardBreakEscape:a(na),hardBreakTrailing:a(na),htmlFlow:a(ra,u),htmlFlowData:K,htmlText:a(ra,u),htmlTextData:K,image:a(ac),label:u,link:a(ia),listItem:a(uc),listItemValue:d,listOrdered:a(aa,f),listUnordered:a(aa),paragraph:a(sc),reference:_,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:a(ta),strong:a(oc),thematicBreak:a(cc)},exit:{atxHeading:o(),atxHeadingSequence:j,autolink:o(),autolinkEmail:yt,autolinkProtocol:Je,blockQuote:o(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:lt,characterReferenceMarkerNumeric:lt,characterReferenceValue:Ee,characterReference:zt,codeFenced:o(S),codeFencedFence:A,codeFencedFenceInfo:p,codeFencedFenceMeta:b,codeFlowValue:N,codeIndented:o(C),codeText:o(F),codeTextData:N,data:N,definition:o(),definitionDestinationString:H,definitionLabelString:R,definitionTitleString:L,emphasis:o(),hardBreakEscape:o(v),hardBreakTrailing:o(v),htmlFlow:o(Y),htmlFlowData:N,htmlText:o(z),htmlTextData:N,image:o(ce),label:ie,labelText:Ie,lineEnding:U,link:o(ne),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:Be,resourceDestinationString:x,resourceTitleString:Se,resource:We,setextHeading:o(V),setextHeadingLineSequence:W,setextHeadingText:w,strong:o(),thematicBreak:o()}};Ko(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(O){let B={type:"root",children:[]};const G={stack:[B],tokenStack:[],config:t,enter:s,exit:c,buffer:u,resume:h,data:n},J=[];let ue=-1;for(;++ue<O.length;)if(O[ue][1].type==="listOrdered"||O[ue][1].type==="listUnordered")if(O[ue][0]==="enter")J.push(ue);else{const Fe=J.pop();ue=i(O,Fe,ue)}for(ue=-1;++ue<O.length;){const Fe=t[O[ue][0]];Qo.call(Fe,O[ue][1].type)&&Fe[O[ue][1].type].call(Object.assign({sliceSerialize:O[ue][2].sliceSerialize},G),O[ue][1])}if(G.tokenStack.length>0){const Fe=G.tokenStack[G.tokenStack.length-1];(Fe[1]||Eu).call(G,void 0,Fe[0])}for(B.position={start:et(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:et(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},ue=-1;++ue<t.transforms.length;)B=t.transforms[ue](B)||B;return B}function i(O,B,G){let J=B-1,ue=-1,Fe=!1,ct,Ge,$t,Yt;for(;++J<=G;){const we=O[J];switch(we[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{we[0]==="enter"?ue++:ue--,Yt=void 0;break}case"lineEndingBlank":{we[0]==="enter"&&(ct&&!Yt&&!ue&&!$t&&($t=J),Yt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Yt=void 0}if(!ue&&we[0]==="enter"&&we[1].type==="listItemPrefix"||ue===-1&&we[0]==="exit"&&(we[1].type==="listUnordered"||we[1].type==="listOrdered")){if(ct){let It=J;for(Ge=void 0;It--;){const Qe=O[It];if(Qe[1].type==="lineEnding"||Qe[1].type==="lineEndingBlank"){if(Qe[0]==="exit")continue;Ge&&(O[Ge][1].type="lineEndingBlank",Fe=!0),Qe[1].type="lineEnding",Ge=It}else if(!(Qe[1].type==="linePrefix"||Qe[1].type==="blockQuotePrefix"||Qe[1].type==="blockQuotePrefixWhitespace"||Qe[1].type==="blockQuoteMarker"||Qe[1].type==="listItemIndent"))break}$t&&(!Ge||$t<Ge)&&(ct._spread=!0),ct.end=Object.assign({},Ge?O[Ge][1].start:we[1].end),O.splice(Ge||J,0,["exit",ct,we[2]]),J++,G++}if(we[1].type==="listItemPrefix"){const It={type:"listItem",_spread:!1,start:Object.assign({},we[1].start),end:void 0};ct=It,O.splice(J,0,["enter",It,we[2]]),J++,G++,$t=void 0,Yt=!0}}}return O[B][1]._spread=Fe,G}function a(O,B){return G;function G(J){s.call(this,O(J),J),B&&B.call(this,J)}}function u(){this.stack.push({type:"fragment",children:[]})}function s(O,B,G){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([B,G||void 0]),O.position={start:et(B.start),end:void 0}}function o(O){return B;function B(G){O&&O.call(this,G),c.call(this,G)}}function c(O,B){const G=this.stack.pop(),J=this.tokenStack.pop();if(J)J[0].type!==O.type&&(B?B.call(this,O,J[0]):(J[1]||Eu).call(this,O,J[0]));else throw new Error("Cannot close `"+O.type+"` ("+hn({start:O.start,end:O.end})+"): it’s not open");G.position.end=et(O.end)}function h(){return wi(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function d(O){if(this.data.expectingFirstListItemValue){const B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function p(){const O=this.resume(),B=this.stack[this.stack.length-1];B.lang=O}function b(){const O=this.resume(),B=this.stack[this.stack.length-1];B.meta=O}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/(\r?\n|\r)$/g,"")}function R(O){const B=this.resume(),G=this.stack[this.stack.length-1];G.label=B,G.identifier=Ue(this.sliceSerialize(O)).toLowerCase()}function L(){const O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function H(){const O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function j(O){const B=this.stack[this.stack.length-1];if(!B.depth){const G=this.sliceSerialize(O).length;B.depth=G}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function W(O){const B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function K(O){const G=this.stack[this.stack.length-1].children;let J=G[G.length-1];(!J||J.type!=="text")&&(J=lc(),J.position={start:et(O.start),end:void 0},G.push(J)),this.stack.push(J)}function N(O){const B=this.stack.pop();B.value+=this.sliceSerialize(O),B.position.end=et(O.end)}function U(O){const B=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=B.children[B.children.length-1];G.position.end=et(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(B.type)&&(K.call(this,O),N.call(this,O))}function v(){this.data.atHardBreak=!0}function Y(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function z(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function F(){const O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function ne(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function ce(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function Ie(O){const B=this.sliceSerialize(O),G=this.stack[this.stack.length-2];G.label=wp(B),G.identifier=Ue(B).toLowerCase()}function ie(){const O=this.stack[this.stack.length-1],B=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const J=O.children;G.children=J}else G.alt=B}function x(){const O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function Se(){const O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function We(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function Be(O){const B=this.resume(),G=this.stack[this.stack.length-1];G.label=B,G.identifier=Ue(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function lt(O){this.data.characterReferenceType=O.type}function Ee(O){const B=this.sliceSerialize(O),G=this.data.characterReferenceType;let J;G?(J=bo(B,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):J=Oi(B);const ue=this.stack[this.stack.length-1];ue.value+=J}function zt(O){const B=this.stack.pop();B.position.end=et(O.end)}function Je(O){N.call(this,O);const B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(O)}function yt(O){N.call(this,O);const B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(O)}function Nt(){return{type:"blockquote",children:[]}}function wn(){return{type:"code",lang:null,meta:null,value:""}}function nc(){return{type:"inlineCode",value:""}}function rc(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ic(){return{type:"emphasis",children:[]}}function ta(){return{type:"heading",depth:0,children:[]}}function na(){return{type:"break"}}function ra(){return{type:"html",value:""}}function ac(){return{type:"image",title:null,url:"",alt:null}}function ia(){return{type:"link",title:null,url:"",children:[]}}function aa(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function uc(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function sc(){return{type:"paragraph",children:[]}}function oc(){return{type:"strong",children:[]}}function lc(){return{type:"text",value:""}}function cc(){return{type:"thematicBreak"}}}function et(e){return{line:e.line,column:e.column,offset:e.offset}}function Ko(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Ko(e,r):tb(e,r)}}function tb(e,t){let n;for(n in t)if(Qo.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Eu(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hn({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hn({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hn({start:t.start,end:t.end})+") is still open")}function nb(e){const t=this;t.parser=n;function n(r){return JE(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function rb(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function ib(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
43
|
+
`}]}function ab(e,t){const n=t.value?t.value+`
|
|
44
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function ub(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sb(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ob(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=jt(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let u,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=a+1,s+=1,e.footnoteCounts.set(r,s);const o={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,o);const c={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,c),e.applyData(t,c)}function lb(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cb(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Xo(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const u=i[i.length-1];return u&&u.type==="text"?u.value+=r:i.push({type:"text",value:r}),i}function hb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Xo(e,t);const i={src:jt(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function fb(e,t){const n={src:jt(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function db(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function pb(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Xo(e,t);const i={href:jt(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function mb(e,t){const n={href:jt(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function gb(e,t,n){const r=e.all(t),i=n?Eb(n):Zo(t),a={},u=[];if(typeof t.checked=="boolean"){const h=r[0];let f;h&&h.type==="element"&&h.tagName==="p"?f=h:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const h=r[s];(i||s!==0||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
45
|
+
`}),h.type==="element"&&h.tagName==="p"&&!i?u.push(...h.children):u.push(h)}const o=r[r.length-1];o&&(i||o.type!=="element"||o.tagName!=="p")&&u.push({type:"text",value:`
|
|
46
|
+
`});const c={type:"element",tagName:"li",properties:a,children:u};return e.patch(t,c),e.applyData(t,c)}function Eb(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Zo(n[r])}return t}function Zo(e){const t=e.spread;return t??e.children.length>1}function bb(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const u=r[i];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Tb(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xb(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function _b(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ab(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],u),i.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=qe(t.children[1]),o=lr(t.children[t.children.length-1]);s&&o&&(u.position={start:s,end:o}),i.push(u)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function kb(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,s=u?u.length:t.children.length;let o=-1;const c=[];for(;++o<s;){const f=t.children[o],d={},p=u?u[o]:void 0;p&&(d.align=p);let b={type:"element",tagName:a,properties:d,children:[]};f&&(b.children=e.all(f),e.patch(f,b),b=e.applyData(f,b)),c.push(b)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,h),e.applyData(t,h)}function Cb(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const bu=9,Tu=32;function yb(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(xu(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(xu(t.slice(i),i>0,!1)),a.join("")}function xu(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===bu||a===Tu;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===bu||a===Tu;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Nb(e,t){const n={type:"text",value:yb(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ib(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Sb={blockquote:rb,break:ib,code:ab,delete:ub,emphasis:sb,footnoteReference:ob,heading:lb,html:cb,imageReference:hb,image:fb,inlineCode:db,linkReference:pb,link:mb,listItem:gb,list:bb,paragraph:Tb,root:xb,strong:_b,table:Ab,tableCell:Cb,tableRow:kb,text:Nb,thematicBreak:Ib,toml:Dn,yaml:Dn,definition:Dn,footnoteDefinition:Dn};function Dn(){}function wb(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Lb(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ob(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||wb,r=e.options.footnoteBackLabel||Lb,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let o=-1;for(;++o<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[o]);if(!c)continue;const h=e.all(c),f=String(c.identifier).toUpperCase(),d=jt(f.toLowerCase());let p=0;const b=[],A=e.footnoteCounts.get(f);for(;A!==void 0&&++p<=A;){b.length>0&&b.push({type:"text",value:" "});let R=typeof n=="string"?n:n(o,p);typeof R=="string"&&(R={type:"text",value:R}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(o,p),className:["data-footnote-backref"]},children:Array.isArray(R)?R:[R]})}const S=h[h.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const R=S.children[S.children.length-1];R&&R.type==="text"?R.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...b)}else h.push(...b);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(h,!0)};e.patch(c,C),s.push(C)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Et(u),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
47
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
|
|
48
|
+
`}]}}const Jr={}.hasOwnProperty,Rb={};function Db(e,t){const n=t||Rb,r=new Map,i=new Map,a=new Map,u={...Sb,...n.handlers},s={all:c,applyData:Mb,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:u,one:o,options:n,patch:Pb,wrap:Bb};return at(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const f=h.type==="definition"?r:i,d=String(h.identifier).toUpperCase();f.has(d)||f.set(d,h)}}),s;function o(h,f){const d=h.type,p=s.handlers[d];if(Jr.call(s.handlers,d)&&p)return p(s,h,f);if(s.options.passThrough&&s.options.passThrough.includes(d)){if("children"in h){const{children:A,...S}=h,C=Et(S);return C.children=s.all(h),C}return Et(h)}return(s.options.unknownHandler||vb)(s,h,f)}function c(h){const f=[];if("children"in h){const d=h.children;let p=-1;for(;++p<d.length;){const b=s.one(d[p],h);if(b){if(p&&d[p-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=_u(b.value)),!Array.isArray(b)&&b.type==="element")){const A=b.children[0];A&&A.type==="text"&&(A.value=_u(A.value))}Array.isArray(b)?f.push(...b):f.push(b)}}}return f}}function Pb(e,t){e.position&&(t.position=Vs(e))}function Mb(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const u="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:u}}n.type==="element"&&a&&Object.assign(n.properties,Et(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function vb(e,t){const n=t.data||{},r="value"in t&&!(Jr.call(n,"hProperties")||Jr.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Bb(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
49
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
50
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
51
|
+
`}),n}function _u(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Au(e,t){const n=Db(e,t),r=n.one(e,void 0),i=Ob(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
52
|
+
`},i),a}function Fb(e,t){return e&&"run"in e?async function(n,r){const i=Au(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Au(n,{file:r,...e||t})}}function ku(e){if(e)throw e}var Or,Cu;function Hb(){if(Cu)return Or;Cu=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},a=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var h=e.call(c,"constructor"),f=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!h&&!f)return!1;var d;for(d in c);return typeof d>"u"||e.call(c,d)},u=function(c,h){n&&h.name==="__proto__"?n(c,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):c[h.name]=h.newValue},s=function(c,h){if(h==="__proto__")if(e.call(c,h)){if(r)return r(c,h).value}else return;return c[h]};return Or=function o(){var c,h,f,d,p,b,A=arguments[0],S=1,C=arguments.length,R=!1;for(typeof A=="boolean"&&(R=A,A=arguments[1]||{},S=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});S<C;++S)if(c=arguments[S],c!=null)for(h in c)f=s(A,h),d=s(c,h),A!==d&&(R&&d&&(a(d)||(p=i(d)))?(p?(p=!1,b=f&&i(f)?f:[]):b=f&&a(f)?f:{},u(A,{name:h,newValue:o(R,b,d)})):typeof d<"u"&&u(A,{name:h,newValue:d}));return A},Or}var Ub=Hb();const Rr=Ku(Ub);function ei(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function jb(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const u=i.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);s(null,...i);function s(o,...c){const h=e[++a];let f=-1;if(o){u(o);return}for(;++f<i.length;)(c[f]===null||c[f]===void 0)&&(c[f]=i[f]);i=c,h?zb(h,s)(...c):u(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function zb(e,t){let n;return r;function r(...u){const s=e.length>u.length;let o;s&&u.push(i);try{o=e.apply(this,u)}catch(c){const h=c;if(s&&n)throw h;return i(h)}s||(o&&o.then&&typeof o.then=="function"?o.then(a,i):o instanceof Error?i(o):a(o))}function i(u,...s){n||(n=!0,t(u,...s))}function a(u){i(null,u)}}const $e={basename:$b,dirname:Yb,extname:qb,join:Vb,sep:"/"};function $b(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');In(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else u<0&&(a=!0,u=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function Yb(e){if(In(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function qb(e){In(e);let t=e.length,n=-1,r=0,i=-1,a=0,u;for(;t--;){const s=e.codePointAt(t);if(s===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Vb(...e){let t=-1,n;for(;++t<e.length;)In(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Wb(n)}function Wb(e){In(e);const t=e.codePointAt(0)===47;let n=Gb(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Gb(e,t){let n="",r=0,i=-1,a=0,u=-1,s,o;for(;++u<=e.length;){if(u<e.length)s=e.codePointAt(u);else{if(s===47)break;s=47}if(s===47){if(!(i===u-1||a===1))if(i!==u-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(o=n.lastIndexOf("/"),o!==n.length-1){o<0?(n="",r=0):(n=n.slice(0,o),r=n.length-1-n.lastIndexOf("/")),i=u,a=0;continue}}else if(n.length>0){n="",r=0,i=u,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,u):n=e.slice(i+1,u),r=u-i-1;i=u,a=0}else s===46&&a>-1?a++:a=-1}return n}function In(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Qb={cwd:Kb};function Kb(){return"/"}function ti(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Xb(e){if(typeof e=="string")e=new URL(e);else if(!ti(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Zb(e)}function Zb(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Dr=["history","path","basename","stem","extname","dirname"];class Jb{constructor(t){let n;t?ti(t)?n={path:t}:typeof t=="string"||eT(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Qb.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Dr.length;){const a=Dr[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Dr.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$e.basename(this.path):void 0}set basename(t){Mr(t,"basename"),Pr(t,"basename"),this.path=$e.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$e.dirname(this.path):void 0}set dirname(t){yu(this.basename,"dirname"),this.path=$e.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$e.extname(this.path):void 0}set extname(t){if(Pr(t,"extname"),yu(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=$e.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ti(t)&&(t=Xb(t)),Mr(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$e.basename(this.path,this.extname):void 0}set stem(t){Mr(t,"stem"),Pr(t,"stem"),this.path=$e.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new xe(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Pr(e,t){if(e&&e.includes($e.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$e.sep+"`")}function Mr(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function yu(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function eT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tT=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),nT={}.hasOwnProperty;class Fi extends tT{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=jb()}copy(){const t=new Fi;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Rr(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Fr("data",this.frozen),this.namespace[t]=n,this):nT.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Fr("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Pn(t),r=this.parser||this.Parser;return vr("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),vr("process",this.parser||this.Parser),Br("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,u){const s=Pn(t),o=r.parse(s);r.run(o,s,function(h,f,d){if(h||!f||!d)return c(h);const p=f,b=r.stringify(p,d);aT(b)?d.value=b:d.result=b,c(h,d)});function c(h,f){h||!f?u(h):a?a(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),vr("processSync",this.parser||this.Parser),Br("processSync",this.compiler||this.Compiler),this.process(t,i),Iu("processSync","process",n),r;function i(a,u){n=!0,ku(a),r=u}}run(t,n,r){Nu(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(u,s){const o=Pn(n);i.run(t,o,c);function c(h,f,d){const p=f||t;h?s(h):u?u(p):r(void 0,p,d)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),Iu("runSync","run",r),i;function a(u,s){ku(u),i=s,r=!0}}stringify(t,n){this.freeze();const r=Pn(n),i=this.compiler||this.Compiler;return Br("stringify",i),Nu(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Fr("use",this.frozen),t!=null)if(typeof t=="function")o(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(c){if(typeof c=="function")o(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[h,...f]=c;o(h,f)}else u(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function u(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(i.settings=Rr(!0,i.settings,c.settings))}function s(c){let h=-1;if(c!=null)if(Array.isArray(c))for(;++h<c.length;){const f=c[h];a(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function o(c,h){let f=-1,d=-1;for(;++f<r.length;)if(r[f][0]===c){d=f;break}if(d===-1)r.push([c,...h]);else if(h.length>0){let[p,...b]=h;const A=r[d][1];ei(A)&&ei(p)&&(p=Rr(!0,A,p)),r[d]=[c,p,...b]}}}}const rT=new Fi().freeze();function vr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Br(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Fr(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Nu(e){if(!ei(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Iu(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Pn(e){return iT(e)?e:new Jb(e)}function iT(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function aT(e){return typeof e=="string"||uT(e)}function uT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}function Hi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ct=Hi();function Jo(e){Ct=e}var fn={exec:()=>null};function te(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,a)=>{let u=typeof a=="string"?a:a.source;return u=u.replace(ke.caret,"$1"),n=n.replace(i,u),r},getRegex:()=>new RegExp(n,t)};return r}var sT=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ke={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},oT=/^(?:[ \t]*(?:\n|$))+/,lT=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cT=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Sn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,hT=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ui=/(?:[*+-]|\d{1,9}[.)])/,el=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,tl=te(el).replace(/bull/g,Ui).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),fT=te(el).replace(/bull/g,Ui).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ji=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,dT=/^[^\n]+/,zi=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,pT=te(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",zi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),mT=te(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ui).getRegex(),dr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",$i=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gT=te("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",$i).replace("tag",dr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),nl=te(ji).replace("hr",Sn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dr).getRegex(),ET=te(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",nl).getRegex(),Yi={blockquote:ET,code:lT,def:pT,fences:cT,heading:hT,hr:Sn,html:gT,lheading:tl,list:mT,newline:oT,paragraph:nl,table:fn,text:dT},Su=te("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Sn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dr).getRegex(),bT={...Yi,lheading:fT,table:Su,paragraph:te(ji).replace("hr",Sn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Su).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",dr).getRegex()},TT={...Yi,html:te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$i).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:te(ji).replace("hr",Sn).replace("heading",` *#{1,6} *[^
|
|
53
|
+
]`).replace("lheading",tl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},xT=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_T=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,rl=/^( {2,}|\\)\n(?!\s*$)/,AT=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,pr=/[\p{P}\p{S}]/u,qi=/[\s\p{P}\p{S}]/u,il=/[^\s\p{P}\p{S}]/u,kT=te(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,qi).getRegex(),al=/(?!~)[\p{P}\p{S}]/u,CT=/(?!~)[\s\p{P}\p{S}]/u,yT=/(?:[^\s\p{P}\p{S}]|~)/u,NT=te(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",sT?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ul=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,IT=te(ul,"u").replace(/punct/g,pr).getRegex(),ST=te(ul,"u").replace(/punct/g,al).getRegex(),sl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wT=te(sl,"gu").replace(/notPunctSpace/g,il).replace(/punctSpace/g,qi).replace(/punct/g,pr).getRegex(),LT=te(sl,"gu").replace(/notPunctSpace/g,yT).replace(/punctSpace/g,CT).replace(/punct/g,al).getRegex(),OT=te("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,il).replace(/punctSpace/g,qi).replace(/punct/g,pr).getRegex(),RT=te(/\\(punct)/,"gu").replace(/punct/g,pr).getRegex(),DT=te(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),PT=te($i).replace("(?:-->|$)","-->").getRegex(),MT=te("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",PT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,vT=te(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Qn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ol=te(/^!?\[(label)\]\[(ref)\]/).replace("label",Qn).replace("ref",zi).getRegex(),ll=te(/^!?\[(ref)\](?:\[\])?/).replace("ref",zi).getRegex(),BT=te("reflink|nolink(?!\\()","g").replace("reflink",ol).replace("nolink",ll).getRegex(),wu=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Vi={_backpedal:fn,anyPunctuation:RT,autolink:DT,blockSkip:NT,br:rl,code:_T,del:fn,emStrongLDelim:IT,emStrongRDelimAst:wT,emStrongRDelimUnd:OT,escape:xT,link:vT,nolink:ll,punctuation:kT,reflink:ol,reflinkSearch:BT,tag:MT,text:AT,url:fn},FT={...Vi,link:te(/^!?\[(label)\]\((.*?)\)/).replace("label",Qn).getRegex(),reflink:te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qn).getRegex()},ni={...Vi,emStrongRDelimAst:LT,emStrongLDelim:ST,url:te(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",wu).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:te(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",wu).getRegex()},HT={...ni,br:te(rl).replace("{2,}","*").getRegex(),text:te(ni.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Mn={normal:Yi,gfm:bT,pedantic:TT},Xt={normal:Vi,gfm:ni,breaks:HT,pedantic:FT},UT={"&":"&","<":"<",">":">",'"':""","'":"'"},Lu=e=>UT[e];function Ke(e,t){if(t){if(ke.escapeTest.test(e))return e.replace(ke.escapeReplace,Lu)}else if(ke.escapeTestNoEncode.test(e))return e.replace(ke.escapeReplaceNoEncode,Lu);return e}function Ou(e){try{e=encodeURI(e).replace(ke.percentDecode,"%")}catch{return null}return e}function Ru(e,t){let n=e.replace(ke.findPipe,(a,u,s)=>{let o=!1,c=u;for(;--c>=0&&s[c]==="\\";)o=!o;return o?"|":" |"}),r=n.split(ke.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(ke.slashPipe,"|");return r}function Zt(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function jT(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Du(e,t,n,r,i){let a=t.href,u=t.title||null,s=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let o={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:u,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,o}function zT(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
54
|
+
`).map(a=>{let u=a.match(n.other.beginningSpace);if(u===null)return a;let[s]=u;return s.length>=i.length?a.slice(i.length):a}).join(`
|
|
55
|
+
`)}var Kn=class{options;rules;lexer;constructor(e){this.options=e||Ct}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Zt(n,`
|
|
56
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=zT(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=Zt(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Zt(t[0],`
|
|
57
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Zt(t[0],`
|
|
58
|
+
`).split(`
|
|
59
|
+
`),r="",i="",a=[];for(;n.length>0;){let u=!1,s=[],o;for(o=0;o<n.length;o++)if(this.rules.other.blockquoteStart.test(n[o]))s.push(n[o]),u=!0;else if(!u)s.push(n[o]);else break;n=n.slice(o);let c=s.join(`
|
|
60
|
+
`),h=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
61
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
62
|
+
${c}`:c,i=i?`${i}
|
|
63
|
+
${h}`:h;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,a,!0),this.lexer.state.top=f,n.length===0)break;let d=a.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let p=d,b=p.raw+`
|
|
64
|
+
`+n.join(`
|
|
65
|
+
`),A=this.blockquote(b);a[a.length-1]=A,r=r.substring(0,r.length-p.raw.length)+A.raw,i=i.substring(0,i.length-p.text.length)+A.text;break}else if(d?.type==="list"){let p=d,b=p.raw+`
|
|
66
|
+
`+n.join(`
|
|
67
|
+
`),A=this.list(b);a[a.length-1]=A,r=r.substring(0,r.length-d.raw.length)+A.raw,i=i.substring(0,i.length-p.raw.length)+A.raw,n=b.substring(a.at(-1).raw.length).split(`
|
|
68
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:a,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let a=this.rules.other.listItemRegex(n),u=!1;for(;e;){let o=!1,c="",h="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let f=t[2].split(`
|
|
69
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,A=>" ".repeat(3*A.length)),d=e.split(`
|
|
70
|
+
`,1)[0],p=!f.trim(),b=0;if(this.options.pedantic?(b=2,h=f.trimStart()):p?b=t[1].length+1:(b=t[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,h=f.slice(b),b+=t[1].length),p&&this.rules.other.blankLine.test(d)&&(c+=d+`
|
|
71
|
+
`,e=e.substring(d.length+1),o=!0),!o){let A=this.rules.other.nextBulletRegex(b),S=this.rules.other.hrRegex(b),C=this.rules.other.fencesBeginRegex(b),R=this.rules.other.headingBeginRegex(b),L=this.rules.other.htmlBeginRegex(b);for(;e;){let H=e.split(`
|
|
72
|
+
`,1)[0],j;if(d=H,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),j=d):j=d.replace(this.rules.other.tabCharGlobal," "),C.test(d)||R.test(d)||L.test(d)||A.test(d)||S.test(d))break;if(j.search(this.rules.other.nonSpaceChar)>=b||!d.trim())h+=`
|
|
73
|
+
`+j.slice(b);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(f)||R.test(f)||S.test(f))break;h+=`
|
|
74
|
+
`+d}!p&&!d.trim()&&(p=!0),c+=H+`
|
|
75
|
+
`,e=e.substring(H.length+1),f=j.slice(b)}}i.loose||(u?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(u=!0)),i.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),i.raw+=c}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let o of i.items){if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),o.task){if(o.text=o.text.replace(this.rules.other.listReplaceTask,""),o.tokens[0]?.type==="text"||o.tokens[0]?.type==="paragraph"){o.tokens[0].raw=o.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),o.tokens[0].text=o.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}}let c=this.rules.other.listTaskCheckbox.exec(o.raw);if(c){let h={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};o.checked=h.checked,i.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=h.raw+o.tokens[0].raw,o.tokens[0].text=h.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(h)):o.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):o.tokens.unshift(h)}}if(!i.loose){let c=o.tokens.filter(f=>f.type==="space"),h=c.length>0&&c.some(f=>this.rules.other.anyLine.test(f.raw));i.loose=h}}if(i.loose)for(let o of i.items){o.loose=!0;for(let c of o.tokens)c.type==="text"&&(c.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Ru(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
76
|
+
`):[],a={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let u of r)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u<n.length;u++)a.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:a.align[u]});for(let u of i)a.rows.push(Ru(u,a.header.length).map((s,o)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:a.align[o]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
77
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=Zt(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=jT(t[2],"()");if(a===-2)return;if(a>-1){let u=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(r);a&&(r=a[1],i=a[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Du(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return Du(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,u,s=i,o=0,c=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+i);(r=c.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(u=[...a].length,r[3]||r[4]){s+=u;continue}else if((r[5]||r[6])&&i%3&&!((i+u)%3)){o+=u;continue}if(s-=u,s>0)continue;u=Math.min(u,u+s+o);let h=[...r[0]][0].length,f=e.slice(0,i+r.index+h+u);if(Math.min(i,u)%2){let p=f.slice(1,-1);return{type:"em",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}let d=f.slice(2,-2);return{type:"strong",raw:f,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(i!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Me=class ri{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ct,this.options.tokenizer=this.options.tokenizer||new Kn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:ke,block:Mn.normal,inline:Xt.normal};this.options.pedantic?(n.block=Mn.pedantic,n.inline=Xt.pedantic):this.options.gfm&&(n.block=Mn.gfm,this.options.breaks?n.inline=Xt.breaks:n.inline=Xt.gfm),this.tokenizer.rules=n}static get rules(){return{block:Mn,inline:Xt}}static lex(t,n){return new ri(n).lex(t)}static lexInline(t,n){return new ri(n).inlineTokens(t)}lex(t){t=t.replace(ke.carriageReturn,`
|
|
78
|
+
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){for(this.options.pedantic&&(t=t.replace(ke.tabCharGlobal," ").replace(ke.spaceLine,""));t;){let i;if(this.options.extensions?.block?.some(u=>(i=u.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length);let u=n.at(-1);i.raw.length===1&&u!==void 0?u.raw+=`
|
|
79
|
+
`:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length);let u=n.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
80
|
+
`)?"":`
|
|
81
|
+
`)+i.raw,u.text+=`
|
|
82
|
+
`+i.text,this.inlineQueue.at(-1).src=u.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length);let u=n.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
83
|
+
`)?"":`
|
|
84
|
+
`)+i.raw,u.text+=`
|
|
85
|
+
`+i.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}let a=t;if(this.options.extensions?.startBlock){let u=1/0,s=t.slice(1),o;this.options.extensions.startBlock.forEach(c=>{o=c.call({lexer:this},s),typeof o=="number"&&o>=0&&(u=Math.min(u,o))}),u<1/0&&u>=0&&(a=t.substring(0,u+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let u=n.at(-1);r&&u?.type==="paragraph"?(u.raw+=(u.raw.endsWith(`
|
|
86
|
+
`)?"":`
|
|
87
|
+
`)+i.raw,u.text+=`
|
|
88
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(i),r=a.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length);let u=n.at(-1);u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
89
|
+
`)?"":`
|
|
90
|
+
`)+i.raw,u.text+=`
|
|
91
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(i);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r=t,i=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)o.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)a=i[2]?i[2].length:0,r=r.slice(0,i.index+a)+"["+"a".repeat(i[0].length-a-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let u=!1,s="";for(;t;){u||(s=""),u=!1;let o;if(this.options.extensions?.inline?.some(h=>(o=h.call({lexer:this},t,n))?(t=t.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let h=n.at(-1);o.type==="text"&&h?.type==="text"?(h.raw+=o.raw,h.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(t,r,s)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(t)){t=t.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),n.push(o);continue}let c=t;if(this.options.extensions?.startInline){let h=1/0,f=t.slice(1),d;this.options.extensions.startInline.forEach(p=>{d=p.call({lexer:this},f),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(c=t.substring(0,h+1))}if(o=this.tokenizer.inlineText(c)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(s=o.raw.slice(-1)),u=!0;let h=n.at(-1);h?.type==="text"?(h.raw+=o.raw,h.text+=o.text):n.push(o);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}},Xn=class{options;parser;constructor(e){this.options=e||Ct}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(ke.notSpaceStart)?.[0],i=e.replace(ke.endingNewline,"")+`
|
|
92
|
+
`;return r?'<pre><code class="language-'+Ke(r)+'">'+(n?i:Ke(i,!0))+`</code></pre>
|
|
93
|
+
`:"<pre><code>"+(n?i:Ke(i,!0))+`</code></pre>
|
|
94
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
95
|
+
${this.parser.parse(e)}</blockquote>
|
|
96
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
97
|
+
`}hr(e){return`<hr>
|
|
98
|
+
`}list(e){let t=e.ordered,n=e.start,r="";for(let u=0;u<e.items.length;u++){let s=e.items[u];r+=this.listitem(s)}let i=t?"ol":"ul",a=t&&n!==1?' start="'+n+'"':"";return"<"+i+a+`>
|
|
99
|
+
`+r+"</"+i+`>
|
|
100
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
101
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
102
|
+
`}table(e){let t="",n="";for(let i=0;i<e.header.length;i++)n+=this.tablecell(e.header[i]);t+=this.tablerow({text:n});let r="";for(let i=0;i<e.rows.length;i++){let a=e.rows[i];n="";for(let u=0;u<a.length;u++)n+=this.tablecell(a[u]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
103
|
+
<thead>
|
|
104
|
+
`+t+`</thead>
|
|
105
|
+
`+r+`</table>
|
|
106
|
+
`}tablerow({text:e}){return`<tr>
|
|
107
|
+
${e}</tr>
|
|
108
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
109
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ke(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Ou(e);if(i===null)return r;e=i;let a='<a href="'+e+'"';return t&&(a+=' title="'+Ke(t)+'"'),a+=">"+r+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Ou(e);if(i===null)return Ke(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${Ke(t)}"`),a+=">",a}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ke(e.text)}},Wi=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},He=class ii{options;renderer;textRenderer;constructor(t){this.options=t||Ct,this.options.renderer=this.options.renderer||new Xn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Wi}static parse(t,n){return new ii(n).parse(t)}static parseInline(t,n){return new ii(n).parseInline(t)}parse(t){let n="";for(let r=0;r<t.length;r++){let i=t[r];if(this.options.extensions?.renderers?.[i.type]){let u=i,s=this.options.extensions.renderers[u.type].call({parser:this},u);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){n+=s||"";continue}}let a=i;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let u='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}parseInline(t,n=this.renderer){let r="";for(let i=0;i<t.length;i++){let a=t[i];if(this.options.extensions?.renderers?.[a.type]){let s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=s||"";continue}}let u=a;switch(u.type){case"escape":{r+=n.text(u);break}case"html":{r+=n.html(u);break}case"link":{r+=n.link(u);break}case"image":{r+=n.image(u);break}case"checkbox":{r+=n.checkbox(u);break}case"strong":{r+=n.strong(u);break}case"em":{r+=n.em(u);break}case"codespan":{r+=n.codespan(u);break}case"br":{r+=n.br(u);break}case"del":{r+=n.del(u);break}case"text":{r+=n.text(u);break}default:{let s='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}},tn=class{options;block;constructor(e){this.options=e||Ct}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Me.lex:Me.lexInline}provideParser(){return this.block?He.parse:He.parseInline}},$T=class{defaults=Hi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=He;Renderer=Xn;TextRenderer=Wi;Lexer=Me;Tokenizer=Kn;Hooks=tn;constructor(...t){this.use(...t)}walkTokens(t,n){let r=[];for(let i of t)switch(r=r.concat(n.call(this,i)),i.type){case"table":{let a=i;for(let u of a.header)r=r.concat(this.walkTokens(u.tokens,n));for(let u of a.rows)for(let s of u)r=r.concat(this.walkTokens(s.tokens,n));break}case"list":{let a=i;r=r.concat(this.walkTokens(a.items,n));break}default:{let a=i;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(u=>{let s=a[u].flat(1/0);r=r.concat(this.walkTokens(s,n))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,n)))}}return r}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let u=n.renderers[a.name];u?n.renderers[a.name]=function(...s){let o=a.renderer.apply(this,s);return o===!1&&(o=u.apply(this,s)),o}:n.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let u=n[a.level];u?u.unshift(a.tokenizer):n[a.level]=[a.tokenizer],a.start&&(a.level==="block"?n.startBlock?n.startBlock.push(a.start):n.startBlock=[a.start]:a.level==="inline"&&(n.startInline?n.startInline.push(a.start):n.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(n.childTokens[a.name]=a.childTokens)}),i.extensions=n),r.renderer){let a=this.defaults.renderer||new Xn(this.defaults);for(let u in r.renderer){if(!(u in a))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;let s=u,o=r.renderer[s],c=a[s];a[s]=(...h)=>{let f=o.apply(a,h);return f===!1&&(f=c.apply(a,h)),f||""}}i.renderer=a}if(r.tokenizer){let a=this.defaults.tokenizer||new Kn(this.defaults);for(let u in r.tokenizer){if(!(u in a))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;let s=u,o=r.tokenizer[s],c=a[s];a[s]=(...h)=>{let f=o.apply(a,h);return f===!1&&(f=c.apply(a,h)),f}}i.tokenizer=a}if(r.hooks){let a=this.defaults.hooks||new tn;for(let u in r.hooks){if(!(u in a))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;let s=u,o=r.hooks[s],c=a[s];tn.passThroughHooks.has(u)?a[s]=h=>{if(this.defaults.async&&tn.passThroughHooksRespectAsync.has(u))return(async()=>{let d=await o.call(a,h);return c.call(a,d)})();let f=o.call(a,h);return c.call(a,f)}:a[s]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(a,h);return d===!1&&(d=await c.apply(a,h)),d})();let f=o.apply(a,h);return f===!1&&(f=c.apply(a,h)),f}}i.hooks=a}if(r.walkTokens){let a=this.defaults.walkTokens,u=r.walkTokens;i.walkTokens=function(s){let o=[];return o.push(u.call(this,s)),a&&(o=o.concat(a.call(this,s))),o}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return Me.lex(t,n??this.defaults)}parser(t,n){return He.parse(t,n??this.defaults)}parseMarkdown(t){return(n,r)=>{let i={...r},a={...this.defaults,...i},u=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return u(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return u(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return u(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let s=a.hooks?await a.hooks.preprocess(n):n,o=await(a.hooks?await a.hooks.provideLexer():t?Me.lex:Me.lexInline)(s,a),c=a.hooks?await a.hooks.processAllTokens(o):o;a.walkTokens&&await Promise.all(this.walkTokens(c,a.walkTokens));let h=await(a.hooks?await a.hooks.provideParser():t?He.parse:He.parseInline)(c,a);return a.hooks?await a.hooks.postprocess(h):h})().catch(u);try{a.hooks&&(n=a.hooks.preprocess(n));let s=(a.hooks?a.hooks.provideLexer():t?Me.lex:Me.lexInline)(n,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let o=(a.hooks?a.hooks.provideParser():t?He.parse:He.parseInline)(s,a);return a.hooks&&(o=a.hooks.postprocess(o)),o}catch(s){return u(s)}}}onError(t,n){return r=>{if(r.message+=`
|
|
110
|
+
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Ke(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},xt=new $T;function ae(e,t){return xt.parse(e,t)}ae.options=ae.setOptions=function(e){return xt.setOptions(e),ae.defaults=xt.defaults,Jo(ae.defaults),ae};ae.getDefaults=Hi;ae.defaults=Ct;ae.use=function(...e){return xt.use(...e),ae.defaults=xt.defaults,Jo(ae.defaults),ae};ae.walkTokens=function(e,t){return xt.walkTokens(e,t)};ae.parseInline=xt.parseInline;ae.Parser=He;ae.parser=He.parse;ae.Renderer=Xn;ae.TextRenderer=Wi;ae.Lexer=Me;ae.lexer=Me.lex;ae.Tokenizer=Kn;ae.Hooks=tn;ae.parse=ae;ae.options;ae.setOptions;ae.use;ae.walkTokens;ae.parseInline;He.parse;Me.lex;var YT=300,qT="300px",VT=500;function WT(e={}){let{immediate:t=!1,debounceDelay:n=YT,rootMargin:r=qT,idleTimeout:i=VT}=e,[a,u]=y.useState(!1),s=y.useRef(null),o=y.useRef(null),c=y.useRef(null),h=y.useMemo(()=>p=>{let b=Date.now();return window.setTimeout(()=>{p({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-b))})},1)},[]),f=y.useMemo(()=>typeof window<"u"&&window.requestIdleCallback?(p,b)=>window.requestIdleCallback(p,b):h,[h]),d=y.useMemo(()=>typeof window<"u"&&window.cancelIdleCallback?p=>window.cancelIdleCallback(p):p=>{clearTimeout(p)},[]);return y.useEffect(()=>{if(t){u(!0);return}let p=s.current;if(!p)return;o.current&&(clearTimeout(o.current),o.current=null),c.current&&(d(c.current),c.current=null);let b=()=>{o.current&&(clearTimeout(o.current),o.current=null),c.current&&(d(c.current),c.current=null)},A=L=>{c.current=f(H=>{H.timeRemaining()>0||H.didTimeout?(u(!0),L.disconnect()):c.current=f(()=>{u(!0),L.disconnect()},{timeout:i/2})},{timeout:i})},S=L=>{b(),o.current=window.setTimeout(()=>{var H,j;let w=L.takeRecords();(w.length===0||(j=(H=w.at(-1))==null?void 0:H.isIntersecting)!=null&&j)&&A(L)},n)},C=(L,H)=>{L.isIntersecting?S(H):b()},R=new IntersectionObserver(L=>{for(let H of L)C(H,R)},{rootMargin:r,threshold:0});return R.observe(p),()=>{o.current&&clearTimeout(o.current),c.current&&d(c.current),R.disconnect()}},[t,n,r,i,d,f]),{shouldRender:a,containerRef:s}}var cl=/\s/,GT=/^\s+$/,QT=new Set(["code","pre","svg","math","annotation"]),KT=e=>typeof e=="object"&&e!==null&&"type"in e&&e.type==="element",XT=e=>e.some(t=>KT(t)&&QT.has(t.tagName)),ZT=e=>{let t=[],n="",r=!1;for(let i of e){let a=cl.test(i);a!==r&&n&&(t.push(n),n=""),n+=i,r=a}return n&&t.push(n),t},JT=e=>{let t=[],n="";for(let r of e)cl.test(r)?n+=r:(n&&(t.push(n),n=""),t.push(r));return n&&t.push(n),t},e2=(e,t,n,r)=>({type:"element",tagName:"span",properties:{"data-sd-animate":!0,style:`--sd-animation:sd-${t};--sd-duration:${n}ms;--sd-easing:${r}`},children:[{type:"text",value:e}]}),t2=(e,t,n)=>{let r=t.at(-1);if(!(r&&"children"in r))return;if(XT(t))return zn;let i=r,a=i.children.indexOf(e);if(a===-1)return;let u=e.value;if(!u.trim())return;let s=(n.sep==="char"?JT(u):ZT(u)).map(o=>GT.test(o)?{type:"text",value:o}:e2(o,n.animation,n.duration,n.easing));return i.children.splice(a,1,...s),a+s.length};function ai(e){var t,n,r,i;let a={animation:(t=e?.animation)!=null?t:"fadeIn",duration:(n=e?.duration)!=null?n:150,easing:(r=e?.easing)!=null?r:"ease",sep:(i=e?.sep)!=null?i:"word"};return{name:"animate",type:"animate",rehypePlugin:()=>u=>{gi(u,"text",(s,o)=>t2(s,o,a))}}}ai();var Gi=e=>E.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:E.jsx("path",{clipRule:"evenodd",d:"M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z",fill:"currentColor",fillRule:"evenodd"})}),Qi=e=>E.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:E.jsx("path",{clipRule:"evenodd",d:"M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z",fill:"currentColor",fillRule:"evenodd"})}),mr=e=>E.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:E.jsx("path",{clipRule:"evenodd",d:"M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z",fill:"currentColor",fillRule:"evenodd"})}),n2=e=>E.jsxs("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:[E.jsx("path",{d:"M8 0V4",stroke:"currentColor",strokeWidth:"1.5"}),E.jsx("path",{d:"M8 16V12",opacity:"0.5",stroke:"currentColor",strokeWidth:"1.5"}),E.jsx("path",{d:"M3.29773 1.52783L5.64887 4.7639",opacity:"0.9",stroke:"currentColor",strokeWidth:"1.5"}),E.jsx("path",{d:"M12.7023 1.52783L10.3511 4.7639",opacity:"0.1",stroke:"currentColor",strokeWidth:"1.5"}),E.jsx("path",{d:"M12.7023 14.472L10.3511 11.236",opacity:"0.4",stroke:"currentColor",strokeWidth:"1.5"}),E.jsx("path",{d:"M3.29773 14.472L5.64887 11.236",opacity:"0.6",stroke:"currentColor",strokeWidth:"1.5"}),E.jsx("path",{d:"M15.6085 5.52783L11.8043 6.7639",opacity:"0.2",stroke:"currentColor",strokeWidth:"1.5"}),E.jsx("path",{d:"M0.391602 10.472L4.19583 9.23598",opacity:"0.7",stroke:"currentColor",strokeWidth:"1.5"}),E.jsx("path",{d:"M15.6085 10.4722L11.8043 9.2361",opacity:"0.3",stroke:"currentColor",strokeWidth:"1.5"}),E.jsx("path",{d:"M0.391602 5.52783L4.19583 6.7639",opacity:"0.8",stroke:"currentColor",strokeWidth:"1.5"})]}),r2=e=>E.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:E.jsx("path",{clipRule:"evenodd",d:"M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z",fill:"currentColor",fillRule:"evenodd"})}),i2=e=>E.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:E.jsx("path",{clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z",fill:"currentColor",fillRule:"evenodd"})}),hl=e=>E.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:E.jsx("path",{clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z",fill:"currentColor",fillRule:"evenodd"})}),Pu=e=>E.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:E.jsx("path",{clipRule:"evenodd",d:"M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z",fill:"currentColor",fillRule:"evenodd"})}),a2=e=>E.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:E.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),u2=e=>E.jsx("svg",{color:"currentColor",height:16,strokeLinejoin:"round",viewBox:"0 0 16 16",width:16,...e,children:E.jsx("path",{clipRule:"evenodd",d:"M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z",fill:"currentColor",fillRule:"evenodd"})}),q=(...e)=>hc(fc(e)),Pt=(e,t,n)=>{let r=typeof t=="string"?new Blob([t],{type:n}):t,i=URL.createObjectURL(r),a=document.createElement("a");a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)},s2=y.createContext({code:""}),fl=()=>y.useContext(s2),Mu=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...u})=>{let[s,o]=y.useState(!1),c=y.useRef(0),{code:h}=fl(),{isAnimating:f}=y.useContext(ve),d=a??h,p=async()=>{var A;if(typeof window>"u"||!((A=navigator?.clipboard)!=null&&A.writeText)){t?.(new Error("Clipboard API not available"));return}try{s||(await navigator.clipboard.writeText(d),o(!0),e?.(),c.current=window.setTimeout(()=>o(!1),n))}catch(S){t?.(S)}};y.useEffect(()=>()=>{window.clearTimeout(c.current)},[]);let b=s?Gi:Qi;return E.jsx("button",{className:q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-copy-button",disabled:f,onClick:p,title:"Copy Code",type:"button",...u,children:r??E.jsx(b,{size:14})})},vu={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},o2=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...u})=>{let{code:s}=fl(),{isAnimating:o}=y.useContext(ve),c=a??s,h=`file.${n&&n in vu?vu[n]:"txt"}`,f="text/plain",d=()=>{try{Pt(h,c,f),e?.()}catch(p){t?.(p)}};return E.jsx("button",{className:q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),"data-streamdown":"code-block-download-button",disabled:o,onClick:d,title:"Download file",type:"button",...u,children:r??E.jsx(mr,{size:14})})},Bu=()=>E.jsxs("div",{className:"w-full divide-y divide-border overflow-hidden rounded-xl border border-border",children:[E.jsx("div",{className:"h-[46px] w-full bg-muted/80"}),E.jsx("div",{className:"flex w-full items-center justify-center p-4",children:E.jsx(n2,{className:"size-4 animate-spin"})})]}),l2=/\.[^/.]+$/,c2=({node:e,className:t,src:n,alt:r,...i})=>{let a=async()=>{if(n)try{let u=await(await fetch(n)).blob(),s=new URL(n,window.location.origin).pathname.split("/").pop()||"",o=s.split(".").pop(),c=s.includes(".")&&o!==void 0&&o.length<=4,h="";if(c)h=s;else{let f=u.type,d="png";f.includes("jpeg")||f.includes("jpg")?d="jpg":f.includes("png")?d="png":f.includes("svg")?d="svg":f.includes("gif")?d="gif":f.includes("webp")&&(d="webp"),h=`${(r||s||"image").replace(l2,"")}.${d}`}Pt(h,u,u.type)}catch{window.open(n,"_blank")}};return n?E.jsxs("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[E.jsx("img",{alt:r,className:q("max-w-full rounded-lg",t),"data-streamdown":"image",src:n,...i}),E.jsx("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),E.jsx("button",{className:q("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:a,title:"Download image",type:"button",children:E.jsx(mr,{size:14})})]}):null},dn=0,h2=()=>{dn+=1,dn===1&&(document.body.style.overflow="hidden")},f2=()=>{dn=Math.max(0,dn-1),dn===0&&(document.body.style.overflow="")},d2=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let[i,a]=y.useState(!1),u=y.useCallback(async()=>{try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)}catch{}},[e]),s=y.useCallback(()=>{r(),n()},[r,n]);return y.useEffect(()=>{if(t){h2();let o=c=>{c.key==="Escape"&&n()};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),f2()}}},[t,n]),t?E.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm","data-streamdown":"link-safety-modal",onClick:n,onKeyDown:o=>{o.key==="Escape"&&n()},role:"button",tabIndex:0,children:E.jsxs("div",{className:"relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg",onClick:o=>o.stopPropagation(),onKeyDown:o=>o.stopPropagation(),role:"presentation",children:[E.jsx("button",{className:"absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:n,title:"Close",type:"button",children:E.jsx(hl,{size:16})}),E.jsxs("div",{className:"flex flex-col gap-2",children:[E.jsxs("div",{className:"flex items-center gap-2 font-semibold text-lg",children:[E.jsx(Pu,{size:20}),E.jsx("span",{children:"Open external link?"})]}),E.jsx("p",{className:"text-muted-foreground text-sm",children:"You're about to visit an external website."})]}),E.jsx("div",{className:q("break-all rounded-md bg-muted p-3 font-mono text-sm",e.length>100&&"max-h-32 overflow-y-auto"),children:e}),E.jsxs("div",{className:"flex gap-2",children:[E.jsx("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted",onClick:u,type:"button",children:i?E.jsxs(E.Fragment,{children:[E.jsx(Gi,{size:14}),E.jsx("span",{children:"Copied"})]}):E.jsxs(E.Fragment,{children:[E.jsx(Qi,{size:14}),E.jsx("span",{children:"Copy link"})]})}),E.jsxs("button",{className:"flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90",onClick:s,type:"button",children:[E.jsx(Pu,{size:14}),E.jsx("span",{children:"Open link"})]})]})]})}):null},ui=y.createContext(null),dl=()=>y.useContext(ui),Bx=()=>{var e;let t=dl();return(e=t?.code)!=null?e:null},Ki=()=>{var e;let t=dl();return(e=t?.mermaid)!=null?e:null},p2=(e,t)=>{var n;let r=(n=void 0)!=null?n:5;return new Promise((i,a)=>{let u="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(e))),s=new Image;s.crossOrigin="anonymous",s.onload=()=>{let o=document.createElement("canvas"),c=s.width*r,h=s.height*r;o.width=c,o.height=h;let f=o.getContext("2d");if(!f){a(new Error("Failed to create 2D canvas context for PNG export"));return}f.drawImage(s,0,0,c,h),o.toBlob(d=>{if(!d){a(new Error("Failed to create PNG blob"));return}i(d)},"image/png")},s.onerror=()=>a(new Error("Failed to load SVG image")),s.src=u})},m2=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let[u,s]=y.useState(!1),o=y.useRef(null),{isAnimating:c}=y.useContext(ve),h=Ki(),f=async d=>{try{if(d==="mmd"){Pt("diagram.mmd",e,"text/plain"),s(!1),r?.(d);return}if(!h){a?.(new Error("Mermaid plugin not available"));return}let p=h.getMermaid(i),b=e.split("").reduce((C,R)=>(C<<5)-C+R.charCodeAt(0)|0,0),A=`mermaid-${Math.abs(b)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:S}=await p.render(A,e);if(!S){a?.(new Error("SVG not found. Please wait for the diagram to render."));return}if(d==="svg"){Pt("diagram.svg",S,"image/svg+xml"),s(!1),r?.(d);return}if(d==="png"){let C=await p2(S);Pt("diagram.png",C,"image/png"),r?.(d),s(!1);return}}catch(p){a?.(p)}};return y.useEffect(()=>{let d=p=>{let b=p.composedPath();o.current&&!b.includes(o.current)&&s(!1)};return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[]),E.jsxs("div",{className:"relative",ref:o,children:[E.jsx("button",{className:q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",n),disabled:c,onClick:()=>s(!u),title:"Download diagram",type:"button",children:t??E.jsx(mr,{size:14})}),u?E.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:[E.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("svg"),title:"Download diagram as SVG",type:"button",children:"SVG"}),E.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("png"),title:"Download diagram as PNG",type:"button",children:"PNG"}),E.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>f("mmd"),title:"Download diagram as MMD",type:"button",children:"MMD"})]}):null]})},pn=0,g2=()=>{pn+=1,pn===1&&(document.body.style.overflow="hidden")},E2=()=>{pn=Math.max(0,pn-1),pn===0&&(document.body.style.overflow="")},b2=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let[u,s]=y.useState(!1),{isAnimating:o,controls:c}=y.useContext(ve),h=(()=>{if(typeof c=="boolean")return c;let d=c.mermaid;return d===!1?!1:d===!0||d===void 0?!0:d.panZoom!==!1})(),f=()=>{s(!u)};return y.useEffect(()=>{if(u){g2();let d=p=>{p.key==="Escape"&&s(!1)};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d),E2()}}},[u]),y.useEffect(()=>{u?n?.():r&&r()},[u,n,r]),E.jsxs(E.Fragment,{children:[E.jsx("button",{className:q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",i),disabled:o,onClick:f,title:"View fullscreen",type:"button",...a,children:E.jsx(r2,{size:14})}),u?E.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm",onClick:f,onKeyDown:d=>{d.key==="Escape"&&f()},role:"button",tabIndex:0,children:[E.jsx("button",{className:"absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground",onClick:f,title:"Exit fullscreen",type:"button",children:E.jsx(hl,{size:20})}),E.jsx("div",{className:"flex size-full items-center justify-center p-4",onClick:d=>d.stopPropagation(),onKeyDown:d=>d.stopPropagation(),role:"presentation",children:E.jsx(zl,{chart:e,className:"size-full [&_svg]:h-auto [&_svg]:w-auto",config:t,fullscreen:!0,showControls:h})})]}):null]})},pl=e=>{var t,n;let r=[],i=[],a=e.querySelectorAll("thead th");for(let s of a)r.push(((t=s.textContent)==null?void 0:t.trim())||"");let u=e.querySelectorAll("tbody tr");for(let s of u){let o=[],c=s.querySelectorAll("td");for(let h of c)o.push(((n=h.textContent)==null?void 0:n.trim())||"");i.push(o)}return{headers:r,rows:i}},ml=e=>{let{headers:t,rows:n}=e,r=s=>{let o=!1,c=!1;for(let h of s){if(h==='"'){o=!0,c=!0;break}(h===","||h===`
|
|
111
|
+
`)&&(o=!0)}return o?c?`"${s.replace(/"/g,'""')}"`:`"${s}"`:s},i=t.length>0?n.length+1:n.length,a=new Array(i),u=0;t.length>0&&(a[u]=t.map(r).join(","),u+=1);for(let s of n)a[u]=s.map(r).join(","),u+=1;return a.join(`
|
|
112
|
+
`)},T2=e=>{let{headers:t,rows:n}=e,r=s=>{let o=!1;for(let h of s)if(h===" "||h===`
|
|
113
|
+
`||h==="\r"){o=!0;break}if(!o)return s;let c=[];for(let h of s)h===" "?c.push("\\t"):h===`
|
|
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),u=0;t.length>0&&(a[u]=t.map(r).join(" "),u+=1);for(let s of n)a[u]=s.map(r).join(" "),u+=1;return a.join(`
|
|
115
|
+
`)},Hr=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("")},x2=e=>{let{headers:t,rows:n}=e;if(t.length===0)return"";let r=new Array(n.length+2),i=0,a=t.map(s=>Hr(s));r[i]=`| ${a.join(" | ")} |`,i+=1;let u=new Array(t.length);for(let s=0;s<t.length;s+=1)u[s]="---";r[i]=`| ${u.join(" | ")} |`,i+=1;for(let s of n)if(s.length<t.length){let o=new Array(t.length);for(let c=0;c<t.length;c+=1)o[c]=c<s.length?Hr(s[c]):"";r[i]=`| ${o.join(" | ")} |`,i+=1}else{let o=s.map(c=>Hr(c));r[i]=`| ${o.join(" | ")} |`,i+=1}return r.join(`
|
|
116
|
+
`)},_2=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let[a,u]=y.useState(!1),[s,o]=y.useState(!1),c=y.useRef(null),h=y.useRef(0),{isAnimating:f}=y.useContext(ve),d=async b=>{var A,S;if(typeof window>"u"||!((A=navigator?.clipboard)!=null&&A.write)){r?.(new Error("Clipboard API not available"));return}try{let C=(S=c.current)==null?void 0:S.closest('[data-streamdown="table-wrapper"]'),R=C?.querySelector("table");if(!R){r?.(new Error("Table not found"));return}let L=pl(R),H=b==="csv"?ml(L):T2(L),j=new ClipboardItem({"text/plain":new Blob([H],{type:"text/plain"}),"text/html":new Blob([R.outerHTML],{type:"text/html"})});await navigator.clipboard.write([j]),o(!0),u(!1),n?.(b),h.current=window.setTimeout(()=>o(!1),i)}catch(C){r?.(C)}};y.useEffect(()=>{let b=A=>{let S=A.composedPath();c.current&&!S.includes(c.current)&&u(!1)};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b),window.clearTimeout(h.current)}},[]);let p=s?Gi:Qi;return E.jsxs("div",{className:"relative",ref:c,children:[E.jsx("button",{className:q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:f,onClick:()=>u(!a),title:"Copy table",type:"button",children:e??E.jsx(p,{size:14})}),a?E.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:[E.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("csv"),title:"Copy table as CSV",type:"button",children:"CSV"}),E.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>d("tsv"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},A2=({children:e,className:t,onDownload:n,onError:r})=>{let[i,a]=y.useState(!1),u=y.useRef(null),{isAnimating:s}=y.useContext(ve),o=c=>{var h;try{let f=(h=u.current)==null?void 0:h.closest('[data-streamdown="table-wrapper"]'),d=f?.querySelector("table");if(!d){r?.(new Error("Table not found"));return}let p=pl(d),b=c==="csv"?ml(p):x2(p);Pt(`table.${c==="csv"?"csv":"md"}`,b,c==="csv"?"text/csv":"text/markdown"),a(!1),n?.(c)}catch(f){r?.(f)}};return y.useEffect(()=>{let c=h=>{let f=h.composedPath();u.current&&!f.includes(u.current)&&a(!1)};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[]),E.jsxs("div",{className:"relative",ref:u,children:[E.jsx("button",{className:q("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:s,onClick:()=>a(!i),title:"Download table",type:"button",children:e??E.jsx(mr,{size:14})}),i?E.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:[E.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"}),E.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]})},k2=({children:e,className:t,showControls:n,...r})=>E.jsxs("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[n?E.jsxs("div",{className:"flex items-center justify-end gap-1",children:[E.jsx(_2,{}),E.jsx(A2,{})]}):null,E.jsx("div",{className:"overflow-x-auto overscroll-y-auto",children:E.jsx("table",{className:q("w-full border-collapse border border-border",t),"data-streamdown":"table",...r,children:e})})]}),C2=y.lazy(()=>Xu(()=>import("./code-block-OCS4YCEC-ImXQka3_.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeBlock}))),y2=y.lazy(()=>Xu(()=>Promise.resolve().then(()=>Lx),void 0).then(e=>({default:e.Mermaid}))),N2=/language-([^\s]+)/;function gr(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&&gr(e.node,t.node)}var si=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,vn=(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},Xi=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("ol",{className:q("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...r,children:e}),(e,t)=>fe(e,t));Xi.displayName="MarkdownOl";var gl=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("li",{className:q("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...r,children:e}),(e,t)=>e.className===t.className&&gr(e.node,t.node));gl.displayName="MarkdownLi";var El=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("ul",{className:q("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...r,children:e}),(e,t)=>fe(e,t));El.displayName="MarkdownUl";var bl=y.memo(({className:e,node:t,...n})=>E.jsx("hr",{className:q("my-6 border-border",e),"data-streamdown":"horizontal-rule",...n}),(e,t)=>fe(e,t));bl.displayName="MarkdownHr";var Tl=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("span",{className:q("font-semibold",t),"data-streamdown":"strong",...r,children:e}),(e,t)=>fe(e,t));Tl.displayName="MarkdownStrong";var I2=({children:e,className:t,href:n,node:r,...i})=>{let{linkSafety:a}=y.useContext(ve),[u,s]=y.useState(!1),o=n==="streamdown:incomplete-link",c=y.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}s(!0)}},[a,n,o]),h=y.useCallback(()=>{n&&window.open(n,"_blank","noreferrer")},[n]),f=y.useCallback(()=>{s(!1)},[]),d={url:n??"",isOpen:u,onClose:f,onConfirm:h};return a!=null&&a.enabled&&n?E.jsxs(E.Fragment,{children:[E.jsx("button",{className:q("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(d):E.jsx(d2,{...d})]}):E.jsx("a",{className:q("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":o,"data-streamdown":"link",href:n,rel:"noreferrer",target:"_blank",...i,children:e})},xl=y.memo(I2,(e,t)=>fe(e,t)&&e.href===t.href);xl.displayName="MarkdownA";var _l=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("h1",{className:q("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...r,children:e}),(e,t)=>fe(e,t));_l.displayName="MarkdownH1";var Al=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("h2",{className:q("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...r,children:e}),(e,t)=>fe(e,t));Al.displayName="MarkdownH2";var kl=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("h3",{className:q("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...r,children:e}),(e,t)=>fe(e,t));kl.displayName="MarkdownH3";var Cl=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("h4",{className:q("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...r,children:e}),(e,t)=>fe(e,t));Cl.displayName="MarkdownH4";var yl=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("h5",{className:q("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...r,children:e}),(e,t)=>fe(e,t));yl.displayName="MarkdownH5";var Nl=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("h6",{className:q("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...r,children:e}),(e,t)=>fe(e,t));Nl.displayName="MarkdownH6";var Il=y.memo(({children:e,className:t,node:n,...r})=>{let{controls:i}=y.useContext(ve),a=si(i,"table");return E.jsx(k2,{className:t,showControls:a,...r,children:e})},(e,t)=>fe(e,t));Il.displayName="MarkdownTable";var Sl=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("thead",{className:q("bg-muted/80",t),"data-streamdown":"table-header",...r,children:e}),(e,t)=>fe(e,t));Sl.displayName="MarkdownThead";var wl=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("tbody",{className:q("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...r,children:e}),(e,t)=>fe(e,t));wl.displayName="MarkdownTbody";var Ll=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("tr",{className:q("border-border border-b",t),"data-streamdown":"table-row",...r,children:e}),(e,t)=>fe(e,t));Ll.displayName="MarkdownTr";var Ol=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("th",{className:q("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));Ol.displayName="MarkdownTh";var Rl=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("td",{className:q("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...r,children:e}),(e,t)=>fe(e,t));Rl.displayName="MarkdownTd";var Dl=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("blockquote",{className:q("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));Dl.displayName="MarkdownBlockquote";var Pl=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("sup",{className:q("text-sm",t),"data-streamdown":"superscript",...r,children:e}),(e,t)=>fe(e,t));Pl.displayName="MarkdownSup";var Ml=y.memo(({children:e,className:t,node:n,...r})=>E.jsx("sub",{className:q("text-sm",t),"data-streamdown":"subscript",...r,children:e}),(e,t)=>fe(e,t));Ml.displayName="MarkdownSub";var vl=y.memo(({children:e,className:t,node:n,...r})=>{if("data-footnotes"in r){let i=u=>{var s,o;if(!y.isValidElement(u))return!1;let c=Array.isArray(u.props.children)?u.props.children:[u.props.children],h=!1,f=!1;for(let d of c)if(d){if(typeof d=="string")d.trim()!==""&&(h=!0);else if(y.isValidElement(d))if(((s=d.props)==null?void 0:s["data-footnote-backref"])!==void 0)f=!0;else{let p=Array.isArray(d.props.children)?d.props.children:[d.props.children];for(let b of p){if(typeof b=="string"&&b.trim()!==""){h=!0;break}if(y.isValidElement(b)&&((o=b.props)==null?void 0:o["data-footnote-backref"])===void 0){h=!0;break}}}}return f&&!h},a=Array.isArray(e)?e.map(u=>{if(!y.isValidElement(u))return u;if(u.type===Xi){let s=(Array.isArray(u.props.children)?u.props.children:[u.props.children]).filter(o=>!i(o));return s.length===0?null:{...u,props:{...u.props,children:s}}}return u}):e;return(Array.isArray(a)?a.some(u=>u!==null):a!==null)?E.jsx("section",{className:t,...r,children:a}):null}return E.jsx("section",{className:t,...r,children:e})},(e,t)=>fe(e,t));vl.displayName="MarkdownSection";var S2=({node:e,className:t,children:n,...r})=>{var i;let a=!("data-block"in r),{mermaid:u,controls:s}=y.useContext(ve),o=Ki();if(a)return E.jsx("code",{className:q("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(N2),h=(i=c?.at(1))!=null?i:"",f="";if(y.isValidElement(n)&&n.props&&typeof n.props=="object"&&"children"in n.props&&typeof n.props.children=="string"?f=n.props.children:typeof n=="string"&&(f=n),h==="mermaid"&&o){let p=si(s,"mermaid"),b=vn(s,"download"),A=vn(s,"copy"),S=vn(s,"fullscreen"),C=vn(s,"panZoom"),R=p&&(b||A||S);return E.jsx(y.Suspense,{fallback:E.jsx(Bu,{}),children:E.jsxs("div",{className:q("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[R?E.jsxs("div",{className:"flex items-center justify-end gap-2",children:[b?E.jsx(m2,{chart:f,config:u?.config}):null,A?E.jsx(Mu,{code:f}):null,S?E.jsx(b2,{chart:f,config:u?.config}):null]}):null,E.jsx(y2,{chart:f,config:u?.config,showControls:C})]})})}let d=si(s,"code");return E.jsx(y.Suspense,{fallback:E.jsx(Bu,{}),children:E.jsx(C2,{className:q("overflow-x-auto border-border border-t",t),code:f,language:h,children:d?E.jsxs(E.Fragment,{children:[E.jsx(o2,{code:f,language:h}),E.jsx(Mu,{})]}):null})})},Bl=y.memo(S2,(e,t)=>e.className===t.className&&gr(e.node,t.node));Bl.displayName="MarkdownCode";var Fl=y.memo(c2,(e,t)=>e.className===t.className&&gr(e.node,t.node));Fl.displayName="MarkdownImg";var Hl=y.memo(({children:e,className:t,node:n,...r})=>{let i=(Array.isArray(e)?e:[e]).filter(a=>a!=null&&a!=="");if(i.length===1&&y.isValidElement(i[0])){let a=i[0].props.node,u=a?.tagName;if(u==="img")return E.jsx(E.Fragment,{children:e});if(u==="code"&&"data-block"in i[0].props)return E.jsx(E.Fragment,{children:e})}return E.jsx("p",{className:t,...r,children:e})},(e,t)=>fe(e,t));Hl.displayName="MarkdownParagraph";var w2={ol:Xi,li:gl,ul:El,hr:bl,strong:Tl,a:xl,h1:_l,h2:Al,h3:kl,h4:Cl,h5:yl,h6:Nl,table:Il,thead:Sl,tbody:wl,tr:Ll,th:Ol,td:Rl,blockquote:Dl,code:Bl,img:Fl,pre:({children:e})=>y.isValidElement(e)?y.cloneElement(e,{"data-block":"true"}):e,sup:Pl,sub:Ml,p:Hl,section:vl},L2=()=>e=>{at(e,"html",(t,n,r)=>{!r||typeof n!="number"||(r.children[n]={type:"text",value:t.value})})},Fu=[],Hu={allowDangerousHtml:!0},Bn=new WeakMap,O2=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 f="";for(let d=0;d<h.length;d+=1){let p=h[d];if(d>0&&(f+=","),Array.isArray(p)){let[b,A]=p;if(typeof b=="function"){let S=Bn.get(b);S||(S=b.name,Bn.set(b,S)),f+=S}else f+=String(b);f+=":",f+=JSON.stringify(A)}else if(typeof p=="function"){let b=Bn.get(p);b||(b=p.name,Bn.set(p,b)),f+=b}else f+=String(p)}return f},u=a(n),s=a(r),o=i?JSON.stringify(i):"",c=`${s}::${u}::${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()}},Uu=new O2,Ul=e=>{let t=R2(e),n=e.children||"";return H2(t.runSync(t.parse(n),n),e)},R2=e=>{let t=Uu.get(e);if(t)return t;let n=P2(e);return Uu.set(e,n),n},D2=e=>e.some(t=>Array.isArray(t)?t[0]===Gr:t===Gr),P2=e=>{let t=e.rehypePlugins||Fu,n=e.remarkPlugins||Fu,r=D2(t)?n:[...n,L2],i=e.remarkRehypeOptions?{...Hu,...e.remarkRehypeOptions}:Hu;return rT().use(nb).use(r).use(Fb,i).use(t)},M2=e=>e,v2=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:"text",value:r}},B2=(e,t)=>{var n;for(let r in Lr)if(Object.hasOwn(Lr,r)&&Object.hasOwn(e.properties,r)){let i=e.properties[r],a=Lr[r];(a===null||a.includes(e.tagName))&&(e.properties[r]=(n=t(String(i||""),r,e))!=null?n:void 0)}},F2=(e,t,n,r,i,a)=>{let u=!1;return r?u=!r.includes(e.tagName):i&&(u=i.includes(e.tagName)),!u&&a&&typeof t=="number"&&(u=!a(e,t,n)),u},H2=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:u,urlTransform:s}=t;if(n||r||i||a||s){let o=s||M2;at(e,(c,h,f)=>{if(c.type==="raw"&&f&&typeof h=="number")return v2(f,h,a,c.value),h;if(c.type==="element"&&(B2(c,o),F2(c,h,f,r,i,n)&&f&&typeof h=="number"))return u&&c.children?f.children.splice(h,1,...c.children):f.children.splice(h,1),h})}return cE(e,{Fragment:E.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:E.jsx,jsxs:E.jsxs,passKeys:!0,passNode:!0})},U2=/\[\^[\w-]{1,200}\](?!:)/,j2=/\[\^[\w-]{1,200}\]:/,z2=/<\/(\w+)>/,$2=/<(\w+)[\s>]/,Y2=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),q2=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},V2=e=>{let t=U2.test(e),n=j2.test(e);if(t||n)return[e];let r=Me.lex(e,{gfm:!0}),i=[],a=[],u=!1;for(let s of r){let o=s.raw,c=i.length;if(a.length>0){if(i[c-1]+=o,s.type==="html"){let h=o.match(z2);if(h){let f=h[1];a.at(-1)===f&&a.pop()}}continue}if(s.type==="html"&&s.block){let h=o.match($2);if(h){let f=h[1];o.includes(`</${f}>`)||Y2.has(f.toLowerCase())||a.push(f)}}if(c>0&&!u){let h=i[c-1];if(q2(h)%2===1){i[c-1]=h+o;continue}}i.push(o),s.type!=="space"&&(u=s.type==="code")}return i},ju,zu,jn={...ln,protocols:{...ln.protocols,href:[...(zu=(ju=ln.protocols)==null?void 0:ju.href)!=null?zu:[],"tel"]}},oi={raw:Gr,sanitize:[eo,jn],harden:[kc,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},W2={gfm:[U1,{}]},$u=Object.values(oi),G2=Object.values(W2),Q2={block:" ▋",circle:" ●"},K2={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},ve=y.createContext(K2),jl=y.memo(({content:e,shouldParseIncompleteMarkdown:t,index:n,...r})=>E.jsx(Ul,{...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,u;return((a=e.components)==null?void 0:a[i])!==((u=t.components)==null?void 0:u[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});jl.displayName="Block";var X2=["github-light","github-dark"],Zi=y.memo(({children:e,mode:t="streaming",parseIncompleteMarkdown:n=!0,components:r,rehypePlugins:i=$u,remarkPlugins:a=G2,className:u,shikiTheme:s=X2,mermaid:o,controls:c=!0,isAnimating:h=!1,animated:f,BlockComponent:d=jl,parseMarkdownIntoBlocksFn:p=V2,caret:b,plugins:A,remend:S,linkSafety:C={enabled:!0},allowedTags:R,...L})=>{let H=y.useId(),[j,w]=y.useTransition(),W=y.useMemo(()=>typeof e!="string"?"":t==="streaming"&&n?Gg(e,S):e,[e,t,n,S]),V=y.useMemo(()=>p(W),[W,p]),[K,N]=y.useState(V);y.useEffect(()=>{t==="streaming"?w(()=>{N(V)}):N(V)},[V,t]);let U=t==="streaming"?K:V,v=y.useMemo(()=>U.map((ie,x)=>`${H}-${x}`),[U.length,H]),Y=y.useMemo(()=>f?f===!0?ai():ai(f):null,[f]),z=y.useMemo(()=>{var ie,x;return{shikiTheme:(x=(ie=A?.code)==null?void 0:ie.getThemes())!=null?x:s,controls:c,isAnimating:h,mode:t,mermaid:o,linkSafety:C}},[s,c,h,t,o,C,A?.code]),F=y.useMemo(()=>({...w2,...r}),[r]),ne=y.useMemo(()=>{let ie=[];return A!=null&&A.cjk&&(ie=[...ie,...A.cjk.remarkPluginsBefore]),ie=[...ie,...a],A!=null&&A.cjk&&(ie=[...ie,...A.cjk.remarkPluginsAfter]),A!=null&&A.math&&(ie=[...ie,A.math.remarkPlugin]),ie},[a,A?.math,A?.cjk]),ce=y.useMemo(()=>{var ie;let x=i;if(R&&Object.keys(R).length>0&&i===$u){let Se={...jn,tagNames:[...(ie=jn.tagNames)!=null?ie:[],...Object.keys(R)],attributes:{...jn.attributes,...R}};x=[oi.raw,[eo,Se],oi.harden]}return A!=null&&A.math&&(x=[...x,A.math.rehypePlugin]),Y&&h&&(x=[...x,Y.rehypePlugin]),x},[i,A?.math,Y,h,R]),Ie=y.useMemo(()=>b&&h?{"--streamdown-caret":`"${Q2[b]}"`}:void 0,[b,h]);return t==="static"?E.jsx(ui.Provider,{value:A??null,children:E.jsx(ve.Provider,{value:z,children:E.jsx("div",{className:q("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",u),children:E.jsx(Ul,{components:F,rehypePlugins:ce,remarkPlugins:ne,...L,children:e})})})}):E.jsx(ui.Provider,{value:A??null,children:E.jsx(ve.Provider,{value:z,children:E.jsxs("div",{className:q("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",b?"*:last:after:inline *:last:after:align-baseline *:last:after:content-[var(--streamdown-caret)]":null,u),style:Ie,children:[U.length===0&&b&&h&&E.jsx("span",{}),U.map((ie,x)=>E.jsx(d,{components:F,content:ie,index:x,rehypePlugins:ce,remarkPlugins:ne,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);Zi.displayName="Streamdown";var Z2=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:u=1,fullscreen:s=!1})=>{let o=y.useRef(null),c=y.useRef(null),[h,f]=y.useState(u),[d,p]=y.useState({x:0,y:0}),[b,A]=y.useState(!1),[S,C]=y.useState({x:0,y:0}),[R,L]=y.useState({x:0,y:0}),H=y.useCallback(v=>{f(Y=>Math.max(n,Math.min(r,Y+v)))},[n,r]),j=y.useCallback(()=>{H(i)},[H,i]),w=y.useCallback(()=>{H(-i)},[H,i]),W=y.useCallback(()=>{f(u),p({x:0,y:0})},[u]),V=y.useCallback(v=>{v.preventDefault();let Y=v.deltaY>0?-i:i;H(Y)},[H,i]),K=y.useCallback(v=>{if(v.button!==0||v.isPrimary===!1)return;A(!0),C({x:v.clientX,y:v.clientY}),L(d);let Y=v.currentTarget;Y instanceof HTMLElement&&Y.setPointerCapture(v.pointerId)},[d]),N=y.useCallback(v=>{if(!b)return;v.preventDefault();let Y=v.clientX-S.x,z=v.clientY-S.y;p({x:R.x+Y,y:R.y+z})},[b,S,R]),U=y.useCallback(v=>{A(!1);let Y=v.currentTarget;Y instanceof HTMLElement&&Y.releasePointerCapture(v.pointerId)},[]);return y.useEffect(()=>{let v=o.current;if(v)return v.addEventListener("wheel",V,{passive:!1}),()=>{v.removeEventListener("wheel",V)}},[V]),y.useEffect(()=>{let v=c.current;if(v&&b)return document.body.style.userSelect="none",v.addEventListener("pointermove",N,{passive:!1}),v.addEventListener("pointerup",U),v.addEventListener("pointercancel",U),()=>{document.body.style.userSelect="",v.removeEventListener("pointermove",N),v.removeEventListener("pointerup",U),v.removeEventListener("pointercancel",U)}},[b,N,U]),E.jsxs("div",{className:q("relative flex flex-col",s?"h-full w-full":"min-h-28 w-full",t),ref:o,style:{cursor:b?"grabbing":"grab"},children:[a?E.jsxs("div",{className:q("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",s?"bottom-4 left-4":"bottom-2 left-2"),children:[E.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:E.jsx(a2,{size:16})}),E.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:E.jsx(u2,{size:16})}),E.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:W,title:"Reset zoom and pan",type:"button",children:E.jsx(i2,{size:16})})]}):null,E.jsx("div",{className:q("flex-1 origin-center transition-transform duration-150 ease-out",s?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:K,ref:c,role:"application",style:{transform:`translate(${d.x}px, ${d.y}px) scale(${h})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},zl=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let[a,u]=y.useState(null),[s,o]=y.useState(!1),[c,h]=y.useState(""),[f,d]=y.useState(""),[p,b]=y.useState(0),{mermaid:A}=y.useContext(ve),S=Ki(),C=A?.errorComponent,{shouldRender:R,containerRef:L}=WT({immediate:r});if(y.useEffect(()=>{if(R){if(!S){u("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{u(null),o(!0);let j=S.getMermaid(n),w=e.split("").reduce((K,N)=>(K<<5)-K+N.charCodeAt(0)|0,0),W=`mermaid-${Math.abs(w)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:V}=await j.render(W,e);h(V),d(V)}catch(j){if(!(f||c)){let w=j instanceof Error?j.message:"Failed to render Mermaid chart";u(w)}}finally{o(!1)}})()}},[e,n,p,R,S]),!(R||c||f))return E.jsx("div",{className:q("my-4 min-h-[200px]",t),ref:L});if(s&&!c&&!f)return E.jsx("div",{className:q("my-4 flex justify-center p-4",t),ref:L,children:E.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[E.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),E.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(a&&!c&&!f){let j=()=>b(w=>w+1);return C?E.jsx("div",{ref:L,children:E.jsx(C,{chart:e,error:a,retry:j})}):E.jsxs("div",{className:q("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:L,children:[E.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",a]}),E.jsxs("details",{className:"mt-2",children:[E.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),E.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]})}let H=c||f;return E.jsx("div",{className:q("size-full",t),"data-streamdown":"mermaid",ref:L,children:E.jsx(Z2,{className:q(r?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:E.jsx("div",{"aria-label":"Mermaid chart",className:q("flex justify-center",r?"size-full items-center":null),dangerouslySetInnerHTML:{__html:H},role:"img"})})})};const J2=({src:e,alt:t,className:n,node:r,...i})=>E.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-block",children:E.jsx("img",{src:e,alt:t,...i,className:Zu("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)})}),ex=({children:e,className:t,node:n,...r})=>E.jsx("li",{className:Zu("py-0 pl-0 [&>p]:inline",t),...r,children:e}),$l={img:J2,li:ex},Fx={mermaid:{download:!0,copy:!0,fullscreen:!0,panZoom:!0}};function Yl(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 tx(e){return Yl(e)==="success"}function nx(e){const t=Yl(e);return t==="failed"||t==="timed_out"}function rx(e){return e.title==="Thinking"||e.content.startsWith("Thinking:")}function ix(e){return e.type===re.Tool&&!!e.children?.length}function ax(e){return e.type!==re.Cursor&&!e.children?.length&&e.content.trim()===""}function ql(e){return!!e.tokenUsage||ax(e)}function ux(e){const t=e.tool?.status;return t==="pending_approval"||t==="denied"}function sx(e){return e.type===re.Cursor||e.type===re.User||e.type===re.Assistant||rx(e)||e.type===re.Error?!0:e.type===re.Info&&e.tokenUsage?!1:ux(e)}function Yu(e){return ix(e)||e.type!==re.Tool&&e.type!==re.Action?!1:!sx(e)}function ox(e){const t=e.filter(i=>!ql(i)),n=[];let r=0;for(;r<t.length;){const i=t[r];if(Yu(i)){const a=[i];let u=r+1;for(;u<t.length;){const s=t[u];if(Yu(s))a.push(s),u++;else break}n.push({kind:"execution-group",logs:a,key:a[0].id}),r=u}else n.push({kind:"single",log:i,key:i.id}),r++}return n}const lx="/api",Vl=e=>e.includes("://")||e.startsWith("/api/")?e:e.startsWith("/")?`${lx}/attachments/by-path?path=${encodeURIComponent(e)}`:e,Wl=y.memo(({content:e,compact:t})=>E.jsx("div",{className:t?"flex justify-end mb-4 mt-2":"flex justify-end mb-8 mt-4",children:E.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:E.jsx(Zi,{urlTransform:Vl,components:$l,children:e})})}));Wl.displayName="UserMessage";const Gl=y.memo(({content:e,isOpenDefault:t=!0})=>{const[n,r]=y.useState(t),i=y.useRef(null),[a,u]=y.useState(0);y.useEffect(()=>{i.current&&u(i.current.scrollHeight)},[e,n]);const s=y.useMemo(()=>{const c=e.replace(/^Thinking:\s*/i,"").trim().split(`
|
|
117
|
+
`)[0]||"";return c.length>80?c.slice(0,80)+"…":c},[e]);return E.jsxs("div",{className:"my-1.5",children:[E.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:[E.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:E.jsx(er,{size:11,strokeWidth:2})}),E.jsx("span",{className:"font-medium",children:"Thinking"}),!n&&s&&E.jsx("span",{className:"truncate text-neutral-300 ml-1 font-normal",children:s})]}),E.jsx("div",{className:"overflow-hidden relative",style:{maxHeight:n?a+16:0},children:E.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:E.jsx("div",{className:"text-xs text-neutral-400 leading-relaxed whitespace-pre-wrap min-w-0",children:e.replace(/^Thinking:\s*/i,"").trim()})})})]})});Gl.displayName="ThinkingBlock";const li=y.memo(({title:e,content:t,type:n})=>{const[r,i]=y.useState(!1);if(n===re.Action)return E.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 text-xs text-neutral-400",children:[E.jsx("span",{className:"shrink-0 w-1 h-1 rounded-full bg-neutral-300"}),E.jsx("span",{children:t})]});const u=e.endsWith("✓"),s=e.endsWith("✗"),o=s?"text-red-400":u?"text-emerald-400":"text-neutral-400",c=t?.split(`
|
|
118
|
+
`)[0]||"",h=c!==e?c:"";return E.jsxs("div",{className:"my-2",children:[E.jsxs("button",{onClick:()=>i(!r),className:"group flex items-center gap-1.5 py-1 text-xs w-full text-left transition-colors",children:[E.jsx("span",{className:`shrink-0 w-3.5 h-3.5 flex items-center justify-center ${o}`,children:s?E.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:E.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}):u?E.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:E.jsx("path",{d:"M2 5.5l2 2 4-4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):E.jsx("span",{className:"w-1 h-1 rounded-full bg-neutral-300"})}),E.jsx("span",{className:"font-medium text-neutral-500 shrink-0",children:e.replace(/\s*[✓✗]$/,"")}),h&&E.jsx("span",{className:"truncate text-neutral-300 font-mono",children:h}),t&&E.jsx("span",{className:"ml-auto shrink-0 opacity-0 group-hover:opacity-100 transition-opacity text-neutral-300",children:r?E.jsx(Ju,{size:10}):E.jsx(er,{size:10})})]}),r&&t&&E.jsx("div",{className:"ml-5 mt-0.5 mb-1.5 rounded-md bg-neutral-50 border border-neutral-100 overflow-x-auto",children:E.jsx("code",{className:"block p-2.5 text-[11px] font-mono text-neutral-500 leading-relaxed whitespace-pre-wrap break-all",children:t})})]})});li.displayName="ToolBlock";const ci=y.memo(({logs:e})=>{const{t}=dc(),[n,r]=y.useState(!1),i=e.map(u=>{const s=u.content.split(`
|
|
119
|
+
`)[0]||"",o=s.match(/([^/\\]+\.[a-zA-Z0-9]+)/);return o?o[1]:s.slice(0,40)}),a=e.length;return E.jsxs("div",{className:"my-2",children:[E.jsxs("button",{onClick:()=>r(!n),className:"group flex items-center gap-1.5 py-1 text-xs w-full text-left transition-colors",children:[E.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:E.jsx(er,{size:11,strokeWidth:2,className:"text-neutral-400"})}),E.jsx("span",{className:"font-medium text-neutral-500 shrink-0",children:t("工具调用")}),E.jsx("span",{className:"shrink-0 inline-flex items-center gap-1",children:E.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:a})}),!n&&E.jsxs("span",{className:"truncate text-neutral-300 font-mono",children:[i.slice(0,3).join(", "),e.length>3?" …":""]})]}),n&&E.jsx("div",{className:"ml-5 mt-0.5 mb-1.5",children:e.map(u=>{const s=u.content.split(`
|
|
120
|
+
`)[0]||"";return E.jsx(Ql,{log:u,firstLine:s},u.id)})})]})});ci.displayName="ExecutionDetailsGroup";const Ql=y.memo(({log:e,firstLine:t})=>{const[n,r]=y.useState(!1),i=e.content.includes(`
|
|
121
|
+
`),a=tx(e),u=nx(e)||e.type===re.Error;return E.jsxs("div",{children:[E.jsxs("button",{onClick:()=>i&&r(!n),className:`group flex items-center gap-1.5 py-0.5 text-xs w-full text-left ${i?"cursor-pointer":"cursor-default"}`,children:[E.jsx("span",{className:"shrink-0 w-3.5 h-3.5 flex items-center justify-center",children:u?E.jsx("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",children:E.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"rgb(248 113 113)",strokeWidth:"1.5",strokeLinecap:"round"})}):a?E.jsx("svg",{width:"8",height:"8",viewBox:"0 0 10 10",fill:"none",children:E.jsx("path",{d:"M2 5.5l2 2 4-4.5",stroke:"rgb(52 211 153)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):E.jsx("span",{className:"w-1 h-1 rounded-full bg-neutral-300"})}),E.jsx("span",{className:"truncate text-neutral-400 font-mono",children:t}),i&&E.jsx("span",{className:"ml-auto shrink-0 opacity-0 group-hover:opacity-100 transition-opacity text-neutral-300",children:n?E.jsx(Ju,{size:10}):E.jsx(er,{size:10})})]}),n&&E.jsx("div",{className:"ml-5 mt-0.5 mb-1 rounded-md bg-neutral-50 border border-neutral-100 overflow-x-auto",children:E.jsx("code",{className:"block p-2.5 text-[11px] font-mono text-neutral-500 leading-relaxed whitespace-pre-wrap break-all",children:e.content})})]})});Ql.displayName="ToolGroupItem";const Kl=y.memo(({content:e,compact:t})=>E.jsx("div",{className:`text-neutral-900 whitespace-pre-wrap min-w-0 ${t?"text-[13px] leading-5":"text-sm leading-6"}`,children:e}));Kl.displayName="AgentText";const Xl=y.memo(({content:e,compact:t})=>E.jsx("div",{className:`text-neutral-900 min-w-0 ${t?"text-[13px] leading-5":"text-sm leading-6"}`,children:E.jsx(Zi,{className:"space-y-2",urlTransform:Vl,components:$l,children:e})}));Xl.displayName="AssistantMessage";const Zl=y.memo(({content:e})=>E.jsx("div",{className:"my-2 rounded-lg border border-red-200 bg-red-50 px-4 py-3",children:E.jsxs("div",{className:"flex items-start gap-2",children:[E.jsx("svg",{className:"shrink-0 mt-0.5 w-4 h-4 text-red-500",viewBox:"0 0 16 16",fill:"currentColor",children:E.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"})}),E.jsx("pre",{className:"text-xs text-red-700 leading-relaxed whitespace-pre-wrap break-all min-w-0",children:e})]})}));Zl.displayName="ErrorMessage";function cx(e,t){if(e.kind==="execution-group")return E.jsx(ci,{logs:e.logs});const n=e.log;if(n.type===re.Tool&&n.children?.length)return E.jsx(ci,{logs:n.children});if(ql(n))return null;if(n.title==="Thinking"||n.content.startsWith("Thinking:"))return E.jsx(Gl,{content:n.content,isOpenDefault:!0});switch(n.type){case re.User:return E.jsx(Wl,{content:n.content,compact:t});case re.Tool:return E.jsx(li,{type:n.type,title:n.title||"Tool",content:n.content});case re.Action:return E.jsx(li,{type:n.type,title:"Action",content:n.content});case re.Assistant:return E.jsx(Xl,{content:n.content,compact:t});case re.Info:return n.tokenUsage?null:E.jsx(Kl,{content:n.content,compact:t});case re.Error:return E.jsx(Zl,{content:n.content});case re.Cursor:return E.jsx("div",{className:"h-4 w-1.5 bg-neutral-400 animate-pulse rounded-sm mt-1 inline-block align-middle"});default:return null}}const Hx=y.forwardRef(function({logs:t,scrollElementRef:n},r){const i=y.useMemo(()=>ox(t),[t]);return y.useImperativeHandle(r,()=>({scrollToBottom:(a="instant")=>{n?.current&&n.current.scrollTo({top:n.current.scrollHeight,behavior:a})}}),[n]),E.jsx("div",{className:"w-full mx-auto pb-4 min-w-0",style:{overflowWrap:"anywhere"},children:i.map(a=>{const u=cx(a);return u?E.jsx("div",{children:u},a.key):null})})});var hx=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)i.hasOwnProperty(a)&&(r[a]=i[a])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),fx=Object.prototype.hasOwnProperty;function hi(e,t){return fx.call(e,t)}function fi(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n<t.length;n++)t[n]=""+n;return t}if(Object.keys)return Object.keys(e);var r=[];for(var i in e)hi(e,i)&&r.push(i);return r}function Oe(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function di(e){for(var t=0,n=e.length,r;t<n;){if(r=e.charCodeAt(t),r>=48&&r<=57){t++;continue}return!1}return!0}function dt(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function Jl(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function pi(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t<n;t++)if(pi(e[t]))return!0}else if(typeof e=="object"){for(var r=fi(e),i=r.length,a=0;a<i;a++)if(pi(e[r[a]]))return!0}}return!1}function qu(e,t){var n=[e];for(var r in t){var i=typeof t[r]=="object"?JSON.stringify(t[r],null,2):t[r];typeof i<"u"&&n.push(r+": "+i)}return n.join(`
|
|
122
|
+
`)}var ec=(function(e){hx(t,e);function t(n,r,i,a,u){var s=this.constructor,o=e.call(this,qu(n,{name:r,index:i,operation:a,tree:u}))||this;return o.name=r,o.index=i,o.operation=a,o.tree=u,Object.setPrototypeOf(o,s.prototype),o.message=qu(n,{name:r,index:i,operation:a,tree:u}),o}return t})(Error),he=ec,dx=Oe,Rt={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=Zn(n,this.path);r&&(r=Oe(r));var i=gt(n,{op:"remove",path:this.from}).removed;return gt(n,{op:"add",path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=Zn(n,this.from);return gt(n,{op:"add",path:this.path,value:Oe(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:xn(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},px={add:function(e,t,n){return di(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){var r=e.splice(t,1);return{newDocument:n,removed:r[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:Rt.move,copy:Rt.copy,test:Rt.test,_get:Rt._get};function Zn(e,t){if(t=="")return e;var n={op:"_get",path:t};return gt(e,n),n.value}function gt(e,t,n,r,i,a){if(n===void 0&&(n=!1),r===void 0&&(r=!0),i===void 0&&(i=!0),a===void 0&&(a=0),n&&(typeof n=="function"?n(t,0,e,t.path):Jn(t,0)),t.path===""){var u={newDocument:e};if(t.op==="add")return u.newDocument=t.value,u;if(t.op==="replace")return u.newDocument=t.value,u.removed=e,u;if(t.op==="move"||t.op==="copy")return u.newDocument=Zn(e,t.from),t.op==="move"&&(u.removed=e),u;if(t.op==="test"){if(u.test=xn(e,t.value),u.test===!1)throw new he("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return u.newDocument=e,u}else{if(t.op==="remove")return u.removed=e,u.newDocument=null,u;if(t.op==="_get")return t.value=e,u;if(n)throw new he("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e);return u}}else{r||(e=Oe(e));var s=t.path||"",o=s.split("/"),c=e,h=1,f=o.length,d=void 0,p=void 0,b=void 0;for(typeof n=="function"?b=n:b=Jn;;){if(p=o[h],p&&p.indexOf("~")!=-1&&(p=Jl(p)),i&&(p=="__proto__"||p=="prototype"&&h>0&&o[h-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[p]===void 0?d=o.slice(0,h).join("/"):h==f-1&&(d=t.path),d!==void 0&&b(t,0,e,d)),h++,Array.isArray(c)){if(p==="-")p=c.length;else{if(n&&!di(p))throw new he("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e);di(p)&&(p=~~p)}if(h>=f){if(n&&t.op==="add"&&p>c.length)throw new he("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);var u=px[t.op].call(t,c,p,e);if(u.test===!1)throw new he("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return u}}else if(h>=f){var u=Rt[t.op].call(t,c,p,e);if(u.test===!1)throw new he("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return u}if(c=c[p],n&&h<f&&(!c||typeof c!="object"))throw new he("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}}function Er(e,t,n,r,i){if(r===void 0&&(r=!0),i===void 0&&(i=!0),n&&!Array.isArray(t))throw new he("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(e=Oe(e));for(var a=new Array(t.length),u=0,s=t.length;u<s;u++)a[u]=gt(e,t[u],n,!0,i,u),e=a[u].newDocument;return a.newDocument=e,a}function mx(e,t,n){var r=gt(e,t);if(r.test===!1)throw new he("Test operation failed","TEST_OPERATION_FAILED",n,t,e);return r.newDocument}function Jn(e,t,n,r){if(typeof e!="object"||e===null||Array.isArray(e))throw new he("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,n);if(Rt[e.op]){if(typeof e.path!="string")throw new he("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,n);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new he('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new he("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new he("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&pi(e.value))throw new he("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var i=e.path.split("/").length,a=r.split("/").length;if(i!==a+1&&i!==a)throw new he("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==r)throw new he("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var u={op:"_get",path:e.from,value:void 0},s=tc([u],n);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE")throw new he("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new he("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function tc(e,t,n){try{if(!Array.isArray(e))throw new he("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Er(Oe(t),Oe(e),n||!0);else{n=n||Jn;for(var r=0;r<e.length;r++)n(e[r],r,t,void 0)}}catch(i){if(i instanceof he)return i;throw i}}function xn(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Array.isArray(e),r=Array.isArray(t),i,a,u;if(n&&r){if(a=e.length,a!=t.length)return!1;for(i=a;i--!==0;)if(!xn(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var s=Object.keys(e);if(a=s.length,a!==Object.keys(t).length)return!1;for(i=a;i--!==0;)if(!t.hasOwnProperty(s[i]))return!1;for(i=a;i--!==0;)if(u=s[i],!xn(e[u],t[u]))return!1;return!0}return e!==e&&t!==t}const gx=Object.freeze(Object.defineProperty({__proto__:null,JsonPatchError:he,_areEquals:xn,applyOperation:gt,applyPatch:Er,applyReducer:mx,deepClone:dx,getValueByPointer:Zn,validate:tc,validator:Jn},Symbol.toStringTag,{value:"Module"}));var Ji=new WeakMap,Ex=(function(){function e(t){this.observers=new Map,this.obj=t}return e})(),bx=(function(){function e(t,n){this.callback=t,this.observer=n}return e})();function Tx(e){return Ji.get(e)}function xx(e,t){return e.observers.get(t)}function _x(e,t){e.observers.delete(t.callback)}function Ax(e,t){t.unobserve()}function kx(e,t){var n=[],r,i=Tx(e);if(!i)i=new Ex(e),Ji.set(e,i);else{var a=xx(i,t);r=a&&a.observer}if(r)return r;if(r={},i.value=Oe(e),t){r.callback=t,r.next=null;var u=function(){mi(r)},s=function(){clearTimeout(r.next),r.next=setTimeout(u)};typeof window<"u"&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return r.patches=n,r.object=e,r.unobserve=function(){mi(r),clearTimeout(r.next),_x(i,r),typeof window<"u"&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},i.observers.set(t,new bx(t,r)),r}function mi(e,t){t===void 0&&(t=!1);var n=Ji.get(e.object);ea(n.value,e.object,e.patches,"",t),e.patches.length&&Er(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function ea(e,t,n,r,i){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=fi(t),u=fi(e),s=!1,o=u.length-1;o>=0;o--){var c=u[o],h=e[c];if(hi(t,c)&&!(t[c]===void 0&&h!==void 0&&Array.isArray(t)===!1)){var f=t[c];typeof h=="object"&&h!=null&&typeof f=="object"&&f!=null&&Array.isArray(h)===Array.isArray(f)?ea(h,f,n,r+"/"+dt(c),i):h!==f&&(i&&n.push({op:"test",path:r+"/"+dt(c),value:Oe(h)}),n.push({op:"replace",path:r+"/"+dt(c),value:Oe(f)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:"test",path:r+"/"+dt(c),value:Oe(h)}),n.push({op:"remove",path:r+"/"+dt(c)}),s=!0):(i&&n.push({op:"test",path:r,value:e}),n.push({op:"replace",path:r,value:t}))}if(!(!s&&a.length==u.length))for(var o=0;o<a.length;o++){var c=a[o];!hi(e,c)&&t[c]!==void 0&&n.push({op:"add",path:r+"/"+dt(c),value:Oe(t[c])})}}}function Cx(e,t,n){n===void 0&&(n=!1);var r=[];return ea(e,t,r,"",n),r}const yx=Object.freeze(Object.defineProperty({__proto__:null,compare:Cx,generate:mi,observe:kx,unobserve:Ax},Symbol.toStringTag,{value:"Module"}));Object.assign({},gx,yx,{JsonPatchError:ec,deepClone:Oe,escapePathComponent:dt,unescapePathComponent:Jl});const Ux={entries:[],isTruncated:!1},Nx=50,Vu=500;function Wu(e){return typeof e?.seq=="number"?e.seq:0}function Gu(e){return e?.entries.at(-1)?.id}function Qu(e){const t=e?.entries.at(-1);if(t)return JSON.stringify(t)}function jx(e){return{...e,entries:Array.isArray(e.entries)?e.entries:[],isTruncated:!1}}function zx(e,t){if(!e||e.isTruncated)return!0;const n=Wu(e),r=Wu(t);if(r>n)return!0;if(r<n)return!1;if(t.entries.length>e.entries.length)return!0;if(t.entries.length<e.entries.length)return!1;const i=Gu(e),a=Gu(t);if(a&&i&&a!==i)return!0;const u=Qu(e),s=Qu(t);return!!(s&&u&&s!==u)}function Ix(e,t){for(;t.length>Nx;){const n=t[0];t=t.slice(1);const{[n]:r,...i}=e;e=i}return{conversations:e,accessOrder:t}}const $x=pc((e,t)=>({conversations:{},accessOrder:[],setConversation:(n,r)=>{e(i=>{const a=i.accessOrder.filter(s=>s!==n);a.push(n);const u={...i.conversations,[n]:{...r,isTruncated:r.isTruncated??!1}};return Ix(u,a)})},applyPatch:(n,r,i)=>{const a=t().conversations[n];if(!a)return!1;if(typeof i=="number"&&typeof a.seq=="number"&&i<=a.seq)return!0;try{const s={...Er(a,r,!0,!1).newDocument,seq:typeof i=="number"?i:a.seq,isTruncated:a.isTruncated??!1};return e(o=>({conversations:{...o.conversations,[n]:s}})),!0}catch(u){return console.error("[sessionLogStore] applyPatch failed:",u),!1}},touchAccess:n=>{e(r=>{const i=r.accessOrder.indexOf(n);if(i===-1||i===r.accessOrder.length-1)return r;const a=[...r.accessOrder];return a.splice(i,1),a.push(n),{accessOrder:a}})},truncateSession:n=>{e(r=>{const i=r.conversations[n];return!i||i.entries.length<=Vu?r:{conversations:{...r.conversations,[n]:{...i,entries:i.entries.slice(-Vu),isTruncated:!0}}}})},removeSession:n=>{e(r=>{const{[n]:i,...a}=r.conversations;return{conversations:a,accessOrder:r.accessOrder.filter(u=>u!==n)}})},getConversation:n=>t().conversations[n],clear:()=>{e({conversations:{},accessOrder:[]})}})),Sx={[ze.CLAUDE_CODE]:{agentType:ze.CLAUDE_CODE,label:"Claude Code",logoSrc:"/agent-icons/claude-code.svg"},[ze.GEMINI_CLI]:{agentType:ze.GEMINI_CLI,label:"Gemini CLI",logoSrc:"/agent-icons/gemini-cli.svg"},[ze.CURSOR_AGENT]:{agentType:ze.CURSOR_AGENT,label:"Cursor Agent",logoSrc:"/agent-icons/cursor-agent.svg"},[ze.CODEX]:{agentType:ze.CODEX,label:"Codex",logoSrc:"/agent-icons/codex.svg"}};function wx(e){return e?Sx[e]??null:null}function Yx(e,t){return wx(e)?.label??t??(e?String(e):"")}const Lx=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:zl},Symbol.toStringTag,{value:"Module"}));export{ze as A,fa as C,Ux as E,s2 as I,ve as L,Zi as Q,la as S,ua as T,oa as W,Bx as Z,q as a,Hx as b,Er as c,Px as d,Mx as e,Yx as f,wx as g,Fx as h,$l as i,sa as j,jx as n,zx as s,$x as u};
|