flow-mindmap 0.5.8 → 0.5.10

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.
@@ -1,19 +1,19 @@
1
- (function(Ce,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Ce=typeof globalThis<"u"?globalThis:Ce||self,e(Ce.FlowMind={},Ce.Vue))})(this,function(Ce,e){"use strict";var Hh=Object.defineProperty;var Wh=(Ce,e,vn)=>e in Ce?Hh(Ce,e,{enumerable:!0,configurable:!0,writable:!0,value:vn}):Ce[e]=vn;var $e=(Ce,e,vn)=>Wh(Ce,typeof e!="symbol"?e+"":e,vn);var ei;const vn=["width","height","stroke-width"],Ea={key:4,points:"6 9 12 15 18 9"},xa={key:5,points:"9 6 15 12 9 18"},_e=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{width:t.size??16,height:t.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[t.name==="add"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=e.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="minus"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[3]||(n[3]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="delete"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n[5]||(n[5]=e.createStaticVNode('<polyline points="4 7 20 7"></polyline><path d="M9 7 V5 a1 1 0 0 1 1 -1 h4 a1 1 0 0 1 1 1 V7"></path><path d="M6 7 l1 12 a1 1 0 0 0 1 1 h8 a1 1 0 0 0 1 -1 l1 -12"></path><line x1="10" y1="11" x2="10" y2="18"></line><line x1="14" y1="11" x2="14" y2="18"></line>',5))],64)):t.name==="edit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[n[6]||(n[6]=e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):t.name==="collapse"?(e.openBlock(),e.createElementBlock("polyline",Ea)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",xa)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="database"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createElementVNode("ellipse",{cx:"12",cy:"6",rx:"7",ry:"2.5"},null,-1)),n[24]||(n[24]=e.createElementVNode("path",{d:"M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[26]||(n[26]=e.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1)),n[27]||(n[27]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[28]||(n[28]=e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M6 15 V9 L9 12 L12 9 V15"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M15 15 V9 L18 12 V9 M15 12 L18 15"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[31]||(n[31]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[32]||(n[32]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[33]||(n[33]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[35]||(n[35]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[36]||(n[36]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[37]||(n[37]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[38]||(n[38]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[39]||(n[39]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[40]||(n[40]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[41]||(n[41]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[42]||(n[42]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[43]||(n[43]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[44]||(n[44]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[45]||(n[45]=e.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[46]||(n[46]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[47]||(n[47]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[48]||(n[48]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[50]||(n[50]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[51]||(n[51]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[52]||(n[52]=e.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[54]||(n[54]=e.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[55]||(n[55]=e.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[56]||(n[56]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[57]||(n[57]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[58]||(n[58]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[60]||(n[60]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[61]||(n[61]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[62]||(n[62]=e.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[65]||(n[65]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[66]||(n[66]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="search"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[67]||(n[67]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="json"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[69]||(n[69]=e.createElementVNode("path",{d:"M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14"},null,-1)),n[70]||(n[70]=e.createElementVNode("path",{d:"M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14"},null,-1))],64)):t.name==="svg-export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:33},[n[71]||(n[71]=e.createElementVNode("path",{d:"M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[72]||(n[72]=e.createElementVNode("polyline",{points:"14 3 14 7 18 7"},null,-1)),n[73]||(n[73]=e.createElementVNode("polyline",{points:"8 14 6 16 8 18"},null,-1)),n[74]||(n[74]=e.createElementVNode("polyline",{points:"14 14 16 16 14 18"},null,-1))],64)):e.createCommentVNode("",!0)],8,vn))}}),rr="data:image/svg+xml,%3csvg%20t='1780822312364'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7459'%20width='200'%20height='200'%3e%3cpath%20d='M329.16%20292.571h658.286V512H329.16zM329.16%200h658.286v219.429H329.16z'%20fill='%239AA1A2'%20p-id='7460'%3e%3c/path%3e%3cpath%20d='M44.927%20146.286a46.519%2046.519%200%200%201%2038.107-73.143h319.269v73.143H109.73V791.99l-48.713%205.705-24.43-651.41h8.339z'%20fill='%239AA1A2'%20p-id='7461'%3e%3c/path%3e%3cpath%20d='M363.83%20877.714H179.51c-78.775%200-142.921-66.12-142.921-147.31V112.787c0-21.943%2017.188-39.643%2038.473-39.643%2021.211%200%2033.5%2017.774%2033.5%2039.643v617.619c0%2037.522%2028.013%2076.58%2064.438%2076.58h190.903c21.211%200%2038.766%2013.97%2038.766%2035.84%200%2021.943-17.555%2034.89-38.766%2034.89z'%20fill='%239AA1A2'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M432.95%20438.857H179.51c-78.775%200-81.043-18.578-81.043-62.903l10.094-90.624c0%2020.48%2013.458%2080.677%2049.884%2080.677h210.139c21.211%200%20120.613%204.023%20120.613%2016.018%200%2011.922-35.036%2056.832-56.32%2056.832zM640.017%20749.714V640a54.857%2054.857%200%200%201%20109.714%200v109.714h109.715a54.857%2054.857%200%200%201%200%20109.715H749.73v109.714a54.857%2054.857%200%200%201-109.714%200V859.429H530.303a54.857%2054.857%200%200%201%200-109.715h109.714z'%20fill='%239AA1A2'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e",lr="data:image/svg+xml,%3csvg%20t='1780822464335'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8457'%20width='200'%20height='200'%3e%3cpath%20d='M512%20804.571h512V1024H512V804.571zM0%200h658.286v219.429H0V0z'%20fill='%239AA1A2'%20p-id='8458'%3e%3c/path%3e%3cpath%20d='M619.813%20950.857h-184.32c-78.775%200-142.922-66.121-142.922-147.31V185.93c0-21.943%2017.189-39.643%2038.474-39.643%2021.211%200%2033.353%2017.773%2033.353%2039.643v617.618c0%2037.523%2034.743%2073.728%2071.095%2073.728h184.32c21.211%200%2038.473%2012.069%2038.473%2033.939%200%2021.943-17.189%2039.643-38.473%2039.643z'%20fill='%239AA1A2'%20p-id='8459'%3e%3c/path%3e%3cpath%20d='M676.571%20457.143V347.429a54.857%2054.857%200%200%201%20109.715%200v109.714H896a54.857%2054.857%200%200%201%200%20109.714H786.286v109.714a54.857%2054.857%200%200%201-109.715%200V566.857H566.857a54.857%2054.857%200%200%201%200-109.714h109.714z'%20fill='%239AA1A2'%20p-id='8460'%3e%3c/path%3e%3c/svg%3e",ar=[22,15,13,12],sr=[700,600,500,400],wa=[46,36,30,26],Na=[120,80,60,44],Sa=[.8,.8,.8,.8],Ta=1,Ca=ar.length-1;function Ma(t,o){return Math.round(fi(t,o)*Sa[Ao(t)])}function Ao(t){return Math.min(Ca,Math.max(0,t))}function fi(t,o=14){return Math.round(ar[Ao(t)]*o/14*10)/10}function Aa(t,o=14){return Math.round(wa[Ao(t)]*o/14)}const io=60,_a=30,Ra=.75,zn=14,vt=24;function cr(t){return Math.max(_a,Math.round(io*Math.pow(Ra,t)))}let mi=null;function Ba(){if(mi)return mi;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(mi=t,t):{font:"",measureText:()=>({width:0})}}const dr=new Map;function ur(t,o,n){const i=`${n}|${o}|${t}`,a=dr.get(i);if(a!==void 0)return a;const c=Ba();c.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=t.split(`
2
- `);let f=0;for(const d of s){const p=c.measureText(d).width;p>f&&(f=p)}return dr.set(i,f),f}const va=24,za=400,Ia=8,fr=16,mr=4,pr=200;function Oa(t,o,n){return Math.min(n,Math.max(o,t))}function La(t,o,n,i,a){const c=Ao(o),s=fi(o,n),f=Math.min(ur(t.text||"",s,sr[c]),pr),d=Ma(o,n),p=Math.ceil(f+d*2+Ta*2),h=(t.text||"").split(`
3
- `);let y=0;for(const de of h){const ye=ur(de,s,sr[c]);y+=Math.max(1,Math.ceil(ye/pr))}y=Math.max(1,y);const D=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6+Math.ceil(s*1.2*(y-1)):Aa(o,n)+Math.ceil(s*1.2*(y-1));let _=0;if(t.link&&(_+=fr),t.note&&(_+=fr),_>0){const de=(t.link?1:0)+(t.note?1:0);_+=mr*de}const F=14,R=2;let M=0;t.markers&&t.markers.length>0&&(M=t.markers.length*F+(t.markers.length-1)*R+mr);const k=18,u=4,N=t.tags&&t.tags.length>0?k:0,$=p+_+M,j=(()=>{const de=Math.round(Na[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const ye=a==null?void 0:a[t.id];return Math.max(de,ye??240)}return de})(),q=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),x=i==null?void 0:i[t.id],ae=q?Math.max(24,x??Math.max(70,Math.ceil(s*5))):0,fe=ae>0?10:0;if(!t.image){const de=Math.max(j,$),ye=Math.ceil(D+fe+ae+(N>0?u+N:0));return{w:de,h:ye}}const me=Oa(t.image.width,va,za),J=Math.max(j,$,Math.ceil(me+d*2)),ge=Math.ceil(t.image.height+Ia+D+fe+ae+(N>0?u+N:0));return{w:J,h:ge}}function Da(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,a=o.baseFontSize??14,c=gr(t,0,null,1,"right",a,o.richHeights,o.richWidths);return $a(c),Va(c,n,i),c.x=0,c.y=0,Pa(c,i)}function Va(t,o,n=!1){if(o==="mindmap"){const i=t.children;if(i.length!==0)if(i.length===1)i[0]._dir="right",i[0].side=1,i[0]._dirRight=1;else{const f=i.reduce((y,C)=>y+C._subtreeH,0);let d=1,p=Math.abs(i[0]._subtreeH-(f-i[0]._subtreeH)),h=0;for(let y=0;y<i.length-1;y++){h+=i[y]._subtreeH;const C=Math.abs(h-(f-h));C<p&&(p=C,d=y+1)}for(let y=0;y<d;y++)i[y]._dir="right",i[y].side=1,i[y]._dirRight=1;for(let y=d;y<i.length;y++)i[y]._dir="left",i[y].side=-1,i[y]._dirRight=-1}const a=t.children.filter(f=>f.side===1),c=t.children.filter(f=>f.side===-1),s=(f,d)=>{const p=d==="right"?1:-1;f._dir=d,f.side=p,f._dirRight=p;for(const h of f.children)s(h,d)};for(const f of a)s(f,"right");for(const f of c)s(f,"left");if(a.length>0){const f={...t,children:a};_o(f,"right",io,!0,n)}if(c.length>0){const f={...t,children:c};_o(f,"left",io,!0,n)}}else if(o==="tree"){const i=a=>{a.side=1,a._dir="right";for(const c of a.children)i(c)};for(const a of t.children)a._dir="right";_o(t,"right",io,!0,n),i(t)}else{for(const i of t.children)i._dir="down";hr(t,io,n)}}function _o(t,o,n,i,a=!1){if(t.children.length===0)return;const c=t.children.reduce((h,y,C)=>h+y._subtreeH+(C>0?zn:0),0),s=o==="right"?1:-1,f=i?s:1;let d=t.y-f*c/2;const p=cr(t.depth);t.children.forEach(h=>{a||(h.x=t.x+s*(t.width/2+p+h.width/2),h.y=d+f*h._subtreeH/2),h._dir=o,d+=f*(h._subtreeH+zn),_o(h,o,n,!1,a)})}function hr(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,f,d)=>s+f._subtreeW+(d>0?zn*2:0),0);let a=t.x-i/2;const c=cr(t.depth);t.children.forEach(s=>{n||(s.x=a+s._subtreeW/2,s.y=t.y+t.height/2+c+s.height/2),s._dir="down",a+=s._subtreeW+zn*2,hr(s,o,n)})}function gr(t,o,n,i,a,c,s,f){const d=La(t,o,c,s,f),p={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:fi(o,c),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:a,_dirRight:i,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return p;const h=t.children.length,y=Math.ceil(h/2);return p.children=t.children.map((C,D)=>{const _=o===0?D<y?1:-1:i;return gr(C,o+1,p,_,a,c,s,f)}),p}function $a(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const a of i.children)o.push(a)}for(let n=o.length-1;n>=0;n--){const i=o[n];if(i.collapsed||i.children.length===0){i._subtreeH=i.height,i._subtreeW=i.width;continue}let a=0,c=0;for(const s of i.children)a+=s._subtreeH,c+=s._subtreeW;i.children.length>1&&(a+=zn*(i.children.length-1),c+=zn*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,a),i._subtreeW=Math.max(i.width,c)}}function Pa(t,o=!1){const n=[t];let i=1/0,a=-1/0,c=1/0,s=-1/0;for(;n.length;){const p=n.pop(),h=p.width/2,y=p.height/2;p.x-h<i&&(i=p.x-h),p.x+h>a&&(a=p.x+h),p.y-y<c&&(c=p.y-y),p.y+y>s&&(s=p.y+y),n.push(...p.children)}if(o)return{root:t,width:a-i+vt*2,height:s-c+vt*2,vbX:i-vt,vbY:c-vt,vbW:a-i+vt*2,vbH:s-c+vt*2};const f=vt-c,d=[t];for(;d.length;){const p=d.pop();p.y+=f,d.push(...p.children)}return c+=f,s+=f,{root:t,width:a-i+vt*2,height:s+vt,vbX:i-vt,vbY:0,vbW:a-i+vt*2,vbH:s+vt}}const cn=[{id:"default",name:"默认",colors:["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc"]},{id:"classic",name:"经典",colors:["#ef4444","#f59e0b","#10b981","#3b82f6","#6366f1","#8b5cf6","#ec4899","#14b8a6"]},{id:"vivid",name:"活力",colors:["#dc2626","#ea580c","#ca8a04","#16a34a","#0891b2","#2563eb","#7c3aed","#db2777"]},{id:"dev",name:"代码",colors:["#f472b6","#a78bfa","#60a5fa","#38bdf8","#22d3ee","#34d399","#facc15","#fb923c"]},{id:"mint",name:"薄荷",colors:["#5eead4","#67e8f9","#93c5fd","#c4b5fd","#fbcfe8","#fde68a","#a7f3d0","#bae6fd"]}];function Fa(t,o=[]){return[...cn,...o].find(i=>i.id===t)??cn[0]}function Ua(t,o=8){const n=[],i=new Set,a=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let c;for(;(c=a.exec(t))!==null;){const s=c[0];let f=null;if(s.startsWith("#")?f=Ha(s):s.startsWith("rgb")?f=Wa(s):f=Ga[s.toLowerCase()]??null,!f)continue;const d=f.toLowerCase();if(!i.has(d)&&(i.add(d),n.push(d),n.length>=o))break}return n}function Ha(t){const o=t.startsWith("#")?t.slice(1):t;if(!/^[0-9a-fA-F]+$/.test(o))return null;let n;if(o.length===3)n=o.split("").map(i=>i+i).join("");else if(o.length===4)n=o.slice(0,3).split("").map(i=>i+i).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function Wa(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const i=[];for(let a=0;a<3;a++){const c=n[a];if(c.endsWith("%")){const s=parseFloat(c);if(!isFinite(s))return null;i.push(Math.round(s/100*255))}else{const s=parseInt(c,10);if(!isFinite(s)||s<0||s>255)return null;i.push(s)}}return"#"+i.map(a=>a.toString(16).padStart(2,"0")).join("").toLowerCase()}const Ga={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function Kt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function zt(t){return JSON.parse(JSON.stringify(t))}function he(t,o){if(t.id===o)return t;for(const n of t.children){const i=he(n,o);if(i)return i}return null}function Ft(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const a=Ft(i,o,t);if(a!==null)return a}return null}function Ro(t,o){const n=t.children.findIndex(i=>i.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const i of t.children)if(Ro(i,o))return!0;return!1}function ja(t,o,n){const i=he(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function Ka(t,o,n,i){if(!Ft(t,o)||o===n||he(he(t,o),n))return!1;const a=Ft(t,o),c=a.children.findIndex(p=>p.id===o);if(c<0)return!1;const[s]=a.children.splice(c,1);if(i==="child"){const p=he(t,n);return p?(p.children.push(s),!0):(a.children.splice(c,0,s),!1)}const f=Ft(t,n);if(!f)return a.children.splice(c,0,s),!1;let d=f.children.findIndex(p=>p.id===n);return d<0?(a.children.splice(c,0,s),!1):(i==="after"&&(d+=1),f.children.splice(d,0,s),!0)}function br(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const a of t.children){const c=a.text.match(o);if(c)if(c[1]){const s=parseInt(c[1],10);s>n&&(n=s)}else i=!0}return n===0&&!i?vo:n>0?`新节点 ${n+1}`:"新节点 2"}function kr(t,o,n){const i=he(t,o);if(!i)return null;const a={id:Kt(),text:n??br(i),children:[]};return i.children.push(a),a}function yr(t,o,n){const i=Ft(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Kt(),text:n??br(i),children:[]};return i.children.splice(a+1,0,c),c}function Ya(t,o,n){const i=Ft(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Kt(),text:n,children:[]};return i.children.splice(a,0,c),c}function qa(t,o){const n=Ft(t,o);if(!n)return null;const i=n.children.findIndex(s=>s.id===o);if(i<0)return null;const a=n.children[i],c=zt(a);return Bo(c),n.children.splice(i+1,0,c),c}function Bo(t){t.id=Kt();for(const o of t.children)Bo(o)}function Er(t,o){const n=he(t,o);if(!n||n.id===t.id)return null;const i=zt(n);return Bo(i),i}const vo="新节点";function In(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:Kt(),text:o,children:[]},a=[i],c=[-1/0],s=[],f=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,h=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let y=!1,C=[],D=null;function _(M){C.push(M)}function F(){if(D&&C.length>0){for(;C.length>0&&C[0].trim()==="";)C.shift();for(;C.length>0&&C[C.length-1].trim()==="";)C.pop();const M=C.join(`
4
- `);M&&(D.note={text:M})}y=!1,C=[]}for(const M of n){if(y){const j=M.match(h);if(j&&j[1][0]==="`"){F();continue}_(M);continue}const k=M.match(f);if(k){const j=k[1].length,q=k[2].trim();s.push({level:j,text:q,body:""}),D=s[s.length-1];continue}const u=M.match(h);if(u&&u[2]==="note"){y=!0,C=[];continue}const N=M.match(d);if(N&&D){const j=N[2],q=160,x=120;D.image={src:j,naturalW:q,naturalH:x,width:q,height:x};continue}const $=M.match(p);if($&&D){D.link={url:$[2]},D.text=$[1];continue}if(M.trim().length>0&&D){const j=M.trim();D.body=D.body?D.body+`
5
- `+j:j}}y&&F();function R(M){for(;a.length>1;){const $=a.length-1,j=c[$];if(j!==void 0&&j<M.level)break;a.pop(),c.pop()}const k=a[a.length-1],u=M.text,N={id:Kt(),text:u,children:[]};M.image&&(N.image={...M.image}),M.link&&(N.link={url:M.link.url}),M.note&&(N.note={text:M.note.text}),M.body&&(N.note={text:M.body}),k.children.push(N),a.push(N),c.push(M.level)}for(const M of s)R(M);if(s.length>0&&s[0].level===1){const M=i.children[0];M&&(i.text=M.text,i.id=M.id,M.image&&(i.image={...M.image}),M.link&&(i.link={url:M.link.url}),M.note&&(i.note={text:M.note.text}),i.children=M.children)}return i}function On(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
1
+ (function(Te,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Te=typeof globalThis<"u"?globalThis:Te||self,e(Te.FlowMind={},Te.Vue))})(this,function(Te,e){"use strict";var Yh=Object.defineProperty;var qh=(Te,e,zn)=>e in Te?Yh(Te,e,{enumerable:!0,configurable:!0,writable:!0,value:zn}):Te[e]=zn;var Ve=(Te,e,zn)=>qh(Te,typeof e!="symbol"?e+"":e,zn);var ti;const zn=["width","height","stroke-width"],Ta={key:4,points:"6 9 12 15 18 9"},Ca={key:5,points:"9 6 15 12 9 18"},_e=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{width:t.size??16,height:t.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[t.name==="add"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=e.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="minus"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[3]||(n[3]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="delete"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n[5]||(n[5]=e.createStaticVNode('<polyline points="4 7 20 7"></polyline><path d="M9 7 V5 a1 1 0 0 1 1 -1 h4 a1 1 0 0 1 1 1 V7"></path><path d="M6 7 l1 12 a1 1 0 0 0 1 1 h8 a1 1 0 0 0 1 -1 l1 -12"></path><line x1="10" y1="11" x2="10" y2="18"></line><line x1="14" y1="11" x2="14" y2="18"></line>',5))],64)):t.name==="edit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[n[6]||(n[6]=e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):t.name==="collapse"?(e.openBlock(),e.createElementBlock("polyline",Ta)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Ca)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="database"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createElementVNode("ellipse",{cx:"12",cy:"6",rx:"7",ry:"2.5"},null,-1)),n[24]||(n[24]=e.createElementVNode("path",{d:"M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[26]||(n[26]=e.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1)),n[27]||(n[27]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[28]||(n[28]=e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M6 15 V9 L9 12 L12 9 V15"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M15 15 V9 L18 12 V9 M15 12 L18 15"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[31]||(n[31]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[32]||(n[32]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[33]||(n[33]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[35]||(n[35]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[36]||(n[36]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[37]||(n[37]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[38]||(n[38]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[39]||(n[39]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[40]||(n[40]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[41]||(n[41]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[42]||(n[42]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[43]||(n[43]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[44]||(n[44]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[45]||(n[45]=e.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[46]||(n[46]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[47]||(n[47]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[48]||(n[48]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[50]||(n[50]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[51]||(n[51]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[52]||(n[52]=e.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[54]||(n[54]=e.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[55]||(n[55]=e.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[56]||(n[56]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[57]||(n[57]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[58]||(n[58]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[60]||(n[60]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[61]||(n[61]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[62]||(n[62]=e.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[65]||(n[65]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[66]||(n[66]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="search"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[67]||(n[67]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="json"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[69]||(n[69]=e.createElementVNode("path",{d:"M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14"},null,-1)),n[70]||(n[70]=e.createElementVNode("path",{d:"M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14"},null,-1))],64)):t.name==="svg-export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:33},[n[71]||(n[71]=e.createElementVNode("path",{d:"M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[72]||(n[72]=e.createElementVNode("polyline",{points:"14 3 14 7 18 7"},null,-1)),n[73]||(n[73]=e.createElementVNode("polyline",{points:"8 14 6 16 8 18"},null,-1)),n[74]||(n[74]=e.createElementVNode("polyline",{points:"14 14 16 16 14 18"},null,-1))],64)):e.createCommentVNode("",!0)],8,zn))}}),sr="data:image/svg+xml,%3csvg%20t='1780822312364'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7459'%20width='200'%20height='200'%3e%3cpath%20d='M329.16%20292.571h658.286V512H329.16zM329.16%200h658.286v219.429H329.16z'%20fill='%239AA1A2'%20p-id='7460'%3e%3c/path%3e%3cpath%20d='M44.927%20146.286a46.519%2046.519%200%200%201%2038.107-73.143h319.269v73.143H109.73V791.99l-48.713%205.705-24.43-651.41h8.339z'%20fill='%239AA1A2'%20p-id='7461'%3e%3c/path%3e%3cpath%20d='M363.83%20877.714H179.51c-78.775%200-142.921-66.12-142.921-147.31V112.787c0-21.943%2017.188-39.643%2038.473-39.643%2021.211%200%2033.5%2017.774%2033.5%2039.643v617.619c0%2037.522%2028.013%2076.58%2064.438%2076.58h190.903c21.211%200%2038.766%2013.97%2038.766%2035.84%200%2021.943-17.555%2034.89-38.766%2034.89z'%20fill='%239AA1A2'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M432.95%20438.857H179.51c-78.775%200-81.043-18.578-81.043-62.903l10.094-90.624c0%2020.48%2013.458%2080.677%2049.884%2080.677h210.139c21.211%200%20120.613%204.023%20120.613%2016.018%200%2011.922-35.036%2056.832-56.32%2056.832zM640.017%20749.714V640a54.857%2054.857%200%200%201%20109.714%200v109.714h109.715a54.857%2054.857%200%200%201%200%20109.715H749.73v109.714a54.857%2054.857%200%200%201-109.714%200V859.429H530.303a54.857%2054.857%200%200%201%200-109.715h109.714z'%20fill='%239AA1A2'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e",cr="data:image/svg+xml,%3csvg%20t='1780822464335'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8457'%20width='200'%20height='200'%3e%3cpath%20d='M512%20804.571h512V1024H512V804.571zM0%200h658.286v219.429H0V0z'%20fill='%239AA1A2'%20p-id='8458'%3e%3c/path%3e%3cpath%20d='M619.813%20950.857h-184.32c-78.775%200-142.922-66.121-142.922-147.31V185.93c0-21.943%2017.189-39.643%2038.474-39.643%2021.211%200%2033.353%2017.773%2033.353%2039.643v617.618c0%2037.523%2034.743%2073.728%2071.095%2073.728h184.32c21.211%200%2038.473%2012.069%2038.473%2033.939%200%2021.943-17.189%2039.643-38.473%2039.643z'%20fill='%239AA1A2'%20p-id='8459'%3e%3c/path%3e%3cpath%20d='M676.571%20457.143V347.429a54.857%2054.857%200%200%201%20109.715%200v109.714H896a54.857%2054.857%200%200%201%200%20109.714H786.286v109.714a54.857%2054.857%200%200%201-109.715%200V566.857H566.857a54.857%2054.857%200%200%201%200-109.714h109.714z'%20fill='%239AA1A2'%20p-id='8460'%3e%3c/path%3e%3c/svg%3e",dr=[22,15,13,12],ur=[700,600,500,400],Ma=[46,36,30,26],Aa=[120,80,60,44],_a=[.8,.8,.8,.8],Ra=1,va=dr.length-1;function Ba(t,o){return Math.round(pi(t,o)*_a[_o(t)])}function _o(t){return Math.min(va,Math.max(0,t))}function pi(t,o=14){return Math.round(dr[_o(t)]*o/14*10)/10}function za(t,o=14){return Math.round(Ma[_o(t)]*o/14)}const io=60,Ia=30,Oa=.75,In=14,vt=24;function fr(t){return Math.max(Ia,Math.round(io*Math.pow(Oa,t)))}let hi=null;function La(){if(hi)return hi;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(hi=t,t):{font:"",measureText:()=>({width:0})}}const mr=new Map;function pr(t,o,n){const i=`${n}|${o}|${t}`,a=mr.get(i);if(a!==void 0)return a;const c=La();c.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=t.split(`
2
+ `);let u=0;for(const d of s){const p=c.measureText(d).width;p>u&&(u=p)}return mr.set(i,u),u}const Da=24,Va=400,$a=8,hr=16,gr=4,br=200;function Pa(t,o,n){return Math.min(n,Math.max(o,t))}function Fa(t,o,n,i,a){const c=_o(o),s=pi(o,n),u=Math.min(pr(t.text||"",s,ur[c]),br),d=Ba(o,n),p=Math.ceil(u+d*2+Ra*2),h=(t.text||"").split(`
3
+ `);let x=0;for(const ce of h){const ue=pr(ce,s,ur[c]);x+=Math.max(1,Math.ceil(ue/br))}x=Math.max(1,x);const $=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6+Math.ceil(s*1.2*(x-1)):za(o,n)+Math.ceil(s*1.2*(x-1));let R=0;if(t.link&&(R+=hr),t.note&&(R+=hr),R>0){const ce=(t.link?1:0)+(t.note?1:0);R+=gr*ce}const F=14,I=2;let A=0;t.markers&&t.markers.length>0&&(A=t.markers.length*F+(t.markers.length-1)*I+gr);const y=18,k=4,m=t.tags&&t.tags.length>0?y:0,P=p+R+A,G=(()=>{const ce=Math.round(Aa[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const ue=a==null?void 0:a[t.id];return Math.max(ce,ue??240)}return ce})(),Y=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),N=i==null?void 0:i[t.id],re=Y?Math.max(24,N??Math.max(70,Math.ceil(s*5))):0,pe=re>0?10:0;if(!t.image){const ce=Math.max(G,P),ue=Math.ceil($+pe+re+(m>0?k+m:0));return{w:ce,h:ue}}const de=Pa(t.image.width,Da,Va),xe=Math.max(G,P,Math.ceil(de+d*2)),ee=Math.ceil(t.image.height+$a+$+pe+re+(m>0?k+m:0));return{w:xe,h:ee}}function Ua(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,a=o.baseFontSize??14,c=yr(t,0,null,1,"right",a,o.richHeights,o.richWidths);return Wa(c),Ha(c,n,i),c.x=0,c.y=0,Ga(c,i)}function Ha(t,o,n=!1){if(o==="mindmap"){const i=t.children;if(i.length!==0)if(i.length===1)i[0]._dir="right",i[0].side=1,i[0]._dirRight=1;else{const u=i.reduce((x,C)=>x+C._subtreeH,0);let d=1,p=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),h=0;for(let x=0;x<i.length-1;x++){h+=i[x]._subtreeH;const C=Math.abs(h-(u-h));C<p&&(p=C,d=x+1)}for(let x=0;x<d;x++)i[x]._dir="right",i[x].side=1,i[x]._dirRight=1;for(let x=d;x<i.length;x++)i[x]._dir="left",i[x].side=-1,i[x]._dirRight=-1}const a=t.children.filter(u=>u.side===1),c=t.children.filter(u=>u.side===-1),s=(u,d)=>{const p=d==="right"?1:-1;u._dir=d,u.side=p,u._dirRight=p;for(const h of u.children)s(h,d)};for(const u of a)s(u,"right");for(const u of c)s(u,"left");if(a.length>0){const u={...t,children:a};Ro(u,"right",io,!0,n)}if(c.length>0){const u={...t,children:c};Ro(u,"left",io,!0,n)}}else if(o==="tree"){const i=a=>{a.side=1,a._dir="right";for(const c of a.children)i(c)};for(const a of t.children)a._dir="right";Ro(t,"right",io,!0,n),i(t)}else{for(const i of t.children)i._dir="down";kr(t,io,n)}}function Ro(t,o,n,i,a=!1){if(t.children.length===0)return;const c=t.children.reduce((h,x,C)=>h+x._subtreeH+(C>0?In:0),0),s=o==="right"?1:-1,u=i?s:1;let d=t.y-u*c/2;const p=fr(t.depth);t.children.forEach(h=>{a||(h.x=t.x+s*(t.width/2+p+h.width/2),h.y=d+u*h._subtreeH/2),h._dir=o,d+=u*(h._subtreeH+In),Ro(h,o,n,!1,a)})}function kr(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,u,d)=>s+u._subtreeW+(d>0?In*2:0),0);let a=t.x-i/2;const c=fr(t.depth);t.children.forEach(s=>{n||(s.x=a+s._subtreeW/2,s.y=t.y+t.height/2+c+s.height/2),s._dir="down",a+=s._subtreeW+In*2,kr(s,o,n)})}function yr(t,o,n,i,a,c,s,u){const d=Fa(t,o,c,s,u),p={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:pi(o,c),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:a,_dirRight:i,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return p;const h=t.children.length,x=Math.ceil(h/2);return p.children=t.children.map((C,$)=>{const R=o===0?$<x?1:-1:i;return yr(C,o+1,p,R,a,c,s,u)}),p}function Wa(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const a of i.children)o.push(a)}for(let n=o.length-1;n>=0;n--){const i=o[n];if(i.collapsed||i.children.length===0){i._subtreeH=i.height,i._subtreeW=i.width;continue}let a=0,c=0;for(const s of i.children)a+=s._subtreeH,c+=s._subtreeW;i.children.length>1&&(a+=In*(i.children.length-1),c+=In*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,a),i._subtreeW=Math.max(i.width,c)}}function Ga(t,o=!1){const n=[t];let i=1/0,a=-1/0,c=1/0,s=-1/0;for(;n.length;){const p=n.pop(),h=p.width/2,x=p.height/2;p.x-h<i&&(i=p.x-h),p.x+h>a&&(a=p.x+h),p.y-x<c&&(c=p.y-x),p.y+x>s&&(s=p.y+x),n.push(...p.children)}if(o)return{root:t,width:a-i+vt*2,height:s-c+vt*2,vbX:i-vt,vbY:c-vt,vbW:a-i+vt*2,vbH:s-c+vt*2};const u=vt-c,d=[t];for(;d.length;){const p=d.pop();p.y+=u,d.push(...p.children)}return c+=u,s+=u,{root:t,width:a-i+vt*2,height:s+vt,vbX:i-vt,vbY:0,vbW:a-i+vt*2,vbH:s+vt}}const cn=[{id:"default",name:"默认",colors:["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc"]},{id:"classic",name:"经典",colors:["#ef4444","#f59e0b","#10b981","#3b82f6","#6366f1","#8b5cf6","#ec4899","#14b8a6"]},{id:"vivid",name:"活力",colors:["#dc2626","#ea580c","#ca8a04","#16a34a","#0891b2","#2563eb","#7c3aed","#db2777"]},{id:"dev",name:"代码",colors:["#f472b6","#a78bfa","#60a5fa","#38bdf8","#22d3ee","#34d399","#facc15","#fb923c"]},{id:"mint",name:"薄荷",colors:["#5eead4","#67e8f9","#93c5fd","#c4b5fd","#fbcfe8","#fde68a","#a7f3d0","#bae6fd"]}];function ja(t,o=[]){return[...cn,...o].find(i=>i.id===t)??cn[0]}function Ka(t,o=8){const n=[],i=new Set,a=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let c;for(;(c=a.exec(t))!==null;){const s=c[0];let u=null;if(s.startsWith("#")?u=Ya(s):s.startsWith("rgb")?u=qa(s):u=Xa[s.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!i.has(d)&&(i.add(d),n.push(d),n.length>=o))break}return n}function Ya(t){const o=t.startsWith("#")?t.slice(1):t;if(!/^[0-9a-fA-F]+$/.test(o))return null;let n;if(o.length===3)n=o.split("").map(i=>i+i).join("");else if(o.length===4)n=o.slice(0,3).split("").map(i=>i+i).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function qa(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const i=[];for(let a=0;a<3;a++){const c=n[a];if(c.endsWith("%")){const s=parseFloat(c);if(!isFinite(s))return null;i.push(Math.round(s/100*255))}else{const s=parseInt(c,10);if(!isFinite(s)||s<0||s>255)return null;i.push(s)}}return"#"+i.map(a=>a.toString(16).padStart(2,"0")).join("").toLowerCase()}const Xa={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function Kt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Bt(t){return JSON.parse(JSON.stringify(t))}function be(t,o){if(t.id===o)return t;for(const n of t.children){const i=be(n,o);if(i)return i}return null}function zt(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const a=zt(i,o,t);if(a!==null)return a}return null}function vo(t,o){const n=t.children.findIndex(i=>i.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const i of t.children)if(vo(i,o))return!0;return!1}function Za(t,o,n){const i=be(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function gi(t,o,n,i){if(!zt(t,o)||o===n||be(be(t,o),n))return!1;const a=zt(t,o),c=a.children.findIndex(p=>p.id===o);if(c<0)return!1;const[s]=a.children.splice(c,1);if(i==="child"){const p=be(t,n);return p?(p.children.push(s),!0):(a.children.splice(c,0,s),!1)}const u=zt(t,n);if(!u)return a.children.splice(c,0,s),!1;let d=u.children.findIndex(p=>p.id===n);return d<0?(a.children.splice(c,0,s),!1):(i==="after"&&(d+=1),u.children.splice(d,0,s),!0)}function Er(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const a of t.children){const c=a.text.match(o);if(c)if(c[1]){const s=parseInt(c[1],10);s>n&&(n=s)}else i=!0}return n===0&&!i?zo:n>0?`新节点 ${n+1}`:"新节点 2"}function bi(t,o,n){const i=be(t,o);if(!i)return null;const a={id:Kt(),text:n??Er(i),children:[]};return i.children.push(a),a}function xr(t,o,n){const i=zt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Kt(),text:n??Er(i),children:[]};return i.children.splice(a+1,0,c),c}function Ja(t,o,n){const i=zt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Kt(),text:n,children:[]};return i.children.splice(a,0,c),c}function Qa(t,o){const n=zt(t,o);if(!n)return null;const i=n.children.findIndex(s=>s.id===o);if(i<0)return null;const a=n.children[i],c=Bt(a);return Bo(c),n.children.splice(i+1,0,c),c}function Bo(t){t.id=Kt();for(const o of t.children)Bo(o)}function wr(t,o){const n=be(t,o);if(!n||n.id===t.id)return null;const i=Bt(n);return Bo(i),i}function Nr(t){return t.children.reduce((o,n)=>o+1+Nr(n),0)}const zo="新节点";function On(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:Kt(),text:o,children:[]},a=[i],c=[-1/0],s=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,h=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let x=!1,C=[],$=null;function R(A){C.push(A)}function F(){if($&&C.length>0){for(;C.length>0&&C[0].trim()==="";)C.shift();for(;C.length>0&&C[C.length-1].trim()==="";)C.pop();const A=C.join(`
4
+ `);A&&($.note={text:A})}x=!1,C=[]}for(const A of n){if(x){const G=A.match(h);if(G&&G[1][0]==="`"){F();continue}R(A);continue}const y=A.match(u);if(y){const G=y[1].length,Y=y[2].trim();s.push({level:G,text:Y,body:""}),$=s[s.length-1];continue}const k=A.match(h);if(k&&k[2]==="note"){x=!0,C=[];continue}const m=A.match(d);if(m&&$){const G=m[2],Y=160,N=120;$.image={src:G,naturalW:Y,naturalH:N,width:Y,height:N};continue}const P=A.match(p);if(P&&$){$.link={url:P[2]},$.text=P[1];continue}if(A.trim().length>0&&$){const G=A.trim();$.body=$.body?$.body+`
5
+ `+G:G}}x&&F();function I(A){for(;a.length>1;){const P=a.length-1,G=c[P];if(G!==void 0&&G<A.level)break;a.pop(),c.pop()}const y=a[a.length-1],k=A.text,m={id:Kt(),text:k,children:[]};A.image&&(m.image={...A.image}),A.link&&(m.link={url:A.link.url}),A.note&&(m.note={text:A.note.text}),A.body&&(m.note={text:A.body}),y.children.push(m),a.push(m),c.push(A.level)}for(const A of s)I(A);if(s.length>0&&s[0].level===1){const A=i.children[0];A&&(i.text=A.text,i.id=A.id,A.image&&(i.image={...A.image}),A.link&&(i.link={url:A.link.url}),A.note&&(i.note={text:A.note.text}),i.children=A.children)}return i}function Ln(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
6
6
  `;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
7
7
  `),t.image&&(n+=`![image](${t.image.src})
8
8
  `),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
9
- `);for(const i of t.children)n+=On(i,o+1);return n}function Xa(t){var p,h;const o=t.split(/\r?\n/),n=[];let i=0;const a=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,f=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const y=o[i],C=y.match(c);if(C){const u=C[1][0],N=C[2]||"",$=[y];for(i++;i<o.length;){const q=o[i].match(c);if(q&&q[1][0]===u){$.push(o[i]),i++;break}$.push(o[i]),i++}const j=$.slice(1,-1).join(`
10
- `).trim();n.push({kind:"code",text:((p=j.split(`
11
- `)[0])==null?void 0:p.slice(0,80))||"(空代码块)",raw:$.join(`
12
- `),lang:N});continue}const D=y.match(a);if(D){n.push({kind:"heading",level:D[1].length,text:D[2].trim(),raw:y}),i++;continue}if(/^\s*\|/.test(y)){const u=[];let N=i,$=!1;for(;N<o.length&&/^\s*\|/.test(o[N]);)u.push(o[N]),s.test(o[N])&&($=!0),N++;if($&&u.length>=2){n.push({kind:"table",text:((h=u[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:h.trim())||"表格",raw:u.join(`
13
- `)}),i=N;continue}}const _=y.match(f),F=y.match(d);if(_||F){let u=i;for(;u<o.length;){const N=o[u].match(f),$=o[u].match(d);if(!(N||$))break;const j=o[u].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();j.length>0&&n.push({kind:"list",text:j.slice(0,80)||"(列表项)",raw:o[u]}),u++}i=u;continue}if(y.trim()===""){i++;continue}const R=[y];let M=i+1;for(;M<o.length;){const u=o[M];if(u.trim()===""||a.test(u)||c.test(u)||f.test(u)||d.test(u)||/^\s*\|/.test(u))break;R.push(u),M++}const k=R.join(" ").trim();n.push({kind:"paragraph",text:k.slice(0,80)||"(空段落)",raw:R.join(`
14
- `)}),i=M}return n}function Za(t,o="导入的导图"){const n=Xa(t||""),i={id:Kt(),text:o,children:[]},a=[i],c=[0];let s=!1;function f(d){if(d.kind==="heading"){const h=d.level;for(;a.length>1&&c[c.length-1]>=h;)a.pop(),c.pop();if(!s&&h===1){s=!0,i.text=d.text,c[0]=1;return}const y={id:Kt(),text:d.text,children:[]};a[a.length-1].children.push(y),a.push(y),c.push(h);return}const p={id:Kt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};a[a.length-1].children.push(p)}for(const d of n)f(d);return i}function Ja(t){return t.richContent?t.richContent.raw+`
15
- `:""}function Qa(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,a=e.ref(1),c=e.ref(0),s=e.ref(0),f=e.ref(!1),d=e.ref(!1),p=e.reactive({x:0,y:0,ox:0,oy:0}),h=e.ref(!1),y=e.reactive({x:0,y:0}),C=e.reactive({x:0,y:0,width:0,height:0}),D=e.ref(0);let _=null;function F(J){_=J}function R(J){J.preventDefault();const ge=t.getContainer();if(!ge)return;const de=-J.deltaY*.001,ye=Math.min(n,Math.max(o,a.value*(1+de))),b=ge.getBoundingClientRect(),L=J.clientX-b.left,G=J.clientY-b.top,ee=(L-c.value)/a.value,be=(G-s.value)/a.value;a.value=ye,c.value=L-ee*ye,s.value=G-be*ye}function M(){a.value=Math.min(n,a.value*i)}function k(){a.value=Math.max(o,a.value/i)}function u(J){var de;J.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(f.value=!0,d.value=!1,p.x=J.clientX,p.y=J.clientY,p.ox=c.value,p.oy=s.value,window.addEventListener("mousemove",N),window.addEventListener("mouseup",$),(de=J.preventDefault)==null||de.call(J))}function N(J){if(!f.value)return;const ge=J.clientX-p.x,de=J.clientY-p.y;(Math.abs(ge)>3||Math.abs(de)>3)&&(d.value=!0),c.value=p.ox+ge,s.value=p.oy+de}function $(){f.value=!1,window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",$)}function j(J,ge,de){h.value=!0,y.x=J,y.y=ge,C.x=J,C.y=ge,C.width=0,C.height=0,C.shiftKey=!!(de!=null&&de.shift),D.value++,window.addEventListener("mousemove",ae),window.addEventListener("mouseup",x)}function q(J,ge){if(!h.value)return;const de=Math.min(y.x,J),ye=Math.min(y.y,ge),b=Math.max(y.x,J),L=Math.max(y.y,ge);C.x=de,C.y=ye,C.width=b-de,C.height=L-ye,D.value++}function x(){h.value=!1,window.removeEventListener("mousemove",ae),window.removeEventListener("mouseup",x),_&&_()}function ae(J){if(!h.value)return;const ge=t.getContainer();if(!ge)return;const de=ge.getBoundingClientRect(),ye=(J.clientX-de.left-c.value)/a.value,b=(J.clientY-de.top-s.value)/a.value;q(ye,b)}function fe(J,ge,de,ye=60){const b=t.getContainer();if(!b)return;const L=b.getBoundingClientRect(),G=(L.width-ye*2)/J,ee=(L.height-ye*2)/ge,be=Math.min(1,Math.max(.3,Math.min(G,ee)));a.value=be,c.value=L.width/2,s.value=L.height/2-de*be}function me(J,ge,de,ye,b=80){const L=t.getContainer();if(!L)return;const G=L.getBoundingClientRect();let ee=a.value;(de*ee<40||ye*ee<40)&&(ee=Math.min(n,Math.max(1,60/Math.min(de,ye)))),a.value=ee,c.value=G.width/2-J*ee,s.value=G.height/2-ge*ee}return{scale:a,offsetX:c,offsetY:s,isPanning:f,panMoved:d,onWheel:R,zoomIn:M,zoomOut:k,startPan:u,startMarquee:j,updateMarquee:q,isMarquee:h,marquee:C,marqueeVersion:D,setOnMarqueeEnd:F,resetView:fe,centerOn:me}}const es=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function xr(t){return es?t.metaKey:t.ctrlKey}function ts(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const a=t.getSelectedIds();return a.length>0?a[0]:null}function n(i){var f,d,p;const a=i.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable)||t.isReadonly()||t.isEditing())return;const c=t.getSelectedId(),s=o();if(s){if(xr(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const h=(f=t.defaultTargetId)==null?void 0:f.call(t);c&&c!==h&&(i.preventDefault(),t.onDuplicate(c));return}if(i.key==="c"||i.key==="C"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCopy(h));return}if(i.key==="x"||i.key==="X"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCut(h));return}if(i.key==="v"||i.key==="V"){if(!t.hasClipboard())return;i.preventDefault();const h=t.getSelectedIds();t.onPaste(h.length>0?h[0]:null);return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(xr(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(s);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const h=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==h&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else(i.key==="Delete"||i.key==="Backspace")&&c&&c!==((p=t.defaultTargetId)==null?void 0:p.call(t))?(i.preventDefault(),t.onRemove(c)):i.key==="F2"&&c?(i.preventDefault(),t.onStartEdit(c)):i.key==="Escape"?(i.preventDefault(),t.onClearSelection()):i.key==="ArrowDown"?(i.preventDefault(),t.onNavigate(0,1)):i.key==="ArrowUp"?(i.preventDefault(),t.onNavigate(0,-1)):i.key==="ArrowRight"?(i.preventDefault(),t.onNavigate(1,0)):i.key==="ArrowLeft"&&(i.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function ns(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function a(){return n<o.value.length-1}function c(p){const h=JSON.stringify(p);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(h),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function s(){return i()?(n--,JSON.parse(o.value[n])):null}function f(){return a()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:a,record:c,undo:s,redo:f,reset:d}}const os={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},is={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,i=os[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${i}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function rs(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),i=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${i.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const ls={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:rs(t)}))},as={label:"旗帜",markers:[{id:"flag-red",label:"红旗",color:"#ef4444"},{id:"flag-orange",label:"橙旗",color:"#f97316"},{id:"flag-yellow",label:"黄旗",color:"#eab308"},{id:"flag-green",label:"绿旗",color:"#22c55e"},{id:"flag-blue",label:"蓝旗",color:"#3b82f6"},{id:"flag-gray",label:"灰旗",color:"#94a3b8"}].map(t=>({id:t.id,label:t.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${t.color}" stroke="${t.color}" stroke-width="1" stroke-linejoin="round"/>`}))},pi=[is,ls,as,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],zo={};for(const t of pi)for(const o of t.markers)zo[o.id]=o;function ss(t){return zo[t]}function Io(t){var o;return((o=zo[t])==null?void 0:o.svg)??""}function wr(t){var o;return((o=zo[t])==null?void 0:o.label)??t}function hi(t){let o=0;for(let i=0;i<t.length;i++)o=(o<<5)-o+t.charCodeAt(i),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const cs={key:5,class:"zm-marker-picker"},ds={class:"zm-marker-group-label"},us={class:"zm-marker-grid"},fs=["title","onClick","innerHTML"],ms=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let k=n.x+2,u=n.y+2;if(n.container){const N=n.container.getBoundingClientRect(),$=180,q=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;k+$>N.right&&(k=Math.max(N.left+4,n.x-$-2)),u+q>N.bottom&&(u=Math.max(N.top+4,n.y-q-2)),k<N.left+2&&(k=N.left+2),u<N.top+2&&(u=N.top+2)}return{left:k,top:u}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),f=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),p=e.computed(()=>n.nodeTags.length>0),h=e.ref(!1);function y(){h.value=!h.value}function C(k){return n.nodeMarkers.includes(k)}function D(k){i("toggleMarker",k)}function _(k){const u=k.target;u&&u.closest(".zm-node-menu")||i("close")}function F(k){k.key==="Escape"&&i("close")}function R(){i("close")}window.addEventListener("mousedown",_,!0),window.addEventListener("keydown",F,!0),window.addEventListener("wheel",R,!0),window.addEventListener("scroll",R,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",_,!0),window.removeEventListener("keydown",F,!0),window.removeEventListener("wheel",R,!0),window.removeEventListener("scroll",R,!0)});function M(k){k(),i("close")}return(k,u)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:u[13]||(u[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:u[0]||(u[0]=e.withModifiers(N=>M(()=>i("pickImage")),["stop"]))},[e.createVNode(_e,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"替换图片":"添加图片"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:u[1]||(u[1]=e.withModifiers(N=>M(()=>i("removeImage")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),u[14]||(u[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:u[2]||(u[2]=e.withModifiers(N=>M(()=>i("setLink")),["stop"]))},[e.createVNode(_e,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:u[3]||(u[3]=e.withModifiers(N=>M(()=>i("removeLink")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),u[15]||(u[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:u[4]||(u[4]=e.withModifiers(N=>M(()=>i("addCode")),["stop"]))},[u[16]||(u[16]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:u[5]||(u[5]=e.withModifiers(N=>M(()=>i("removeCode")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),u[17]||(u[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:u[6]||(u[6]=e.withModifiers(N=>M(()=>i("addTable")),["stop"]))},[u[18]||(u[18]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:u[7]||(u[7]=e.withModifiers(N=>M(()=>i("removeTable")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),u[19]||(u[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:u[8]||(u[8]=e.withModifiers(N=>M(()=>i("editNote")),["stop"]))},[e.createVNode(_e,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(f.value?"编辑笔记":"添加笔记"),1)]),f.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:u[9]||(u[9]=e.withModifiers(N=>M(()=>i("removeNote")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),u[20]||(u[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),u[25]||(u[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(y,["stop"])},[u[21]||(u[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),u[22]||(u[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":h.value}])},"›",2)]),h.value?(e.openBlock(),e.createElementBlock("div",cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(pi),N=>(e.openBlock(),e.createElementBlock("div",{key:N.label,class:"zm-marker-group"},[e.createElementVNode("div",ds,e.toDisplayString(N.label),1),e.createElementVNode("div",us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.markers,$=>(e.openBlock(),e.createElementBlock("button",{key:$.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":C($.id)}]),title:$.label,onClick:e.withModifiers(j=>D($.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(Io)($.id)+"</svg>"},null,10,fs))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:u[10]||(u[10]=e.withModifiers(N=>i("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:u[11]||(u[11]=e.withModifiers(N=>M(()=>i("addTag")),["stop"]))},[u[23]||(u[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(p.value?"编辑标签":"添加标签"),1)]),p.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:u[12]||(u[12]=e.withModifiers(N=>M(()=>i("removeTags")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),u[24]||(u[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ps=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let M=n.x+2,k=n.y+2;if(n.container){const u=n.container.getBoundingClientRect(),N=160,$=4+4*28+5;M+N>u.right&&(M=Math.max(u.left+4,n.x-N-2)),k+$>u.bottom&&(k=Math.max(u.top+4,n.y-$-2)),M<u.left+2&&(M=u.left+2),k<u.top+2&&(k=u.top+2)}return{left:M,top:k}}),c=e.ref(null),s=e.ref(null),f=e.ref(null),d=e.computed(()=>{const M=c.value==="import"?s.value:c.value==="export"?f.value:null;if(!M)return{left:"-9999px",top:"-9999px",display:"none"};const k=M.getBoundingClientRect(),u=window.innerWidth,N=window.innerHeight,$=176,j=4+3*28;let q=k.right;q+$>u-4&&(q=Math.max(4,k.left-$));let x=k.top-4;return x+j>N-4&&(x=Math.max(4,N-j-4)),{left:q+"px",top:x+"px",display:"block"}});let p=null,h=null;function y(M){h&&(clearTimeout(h),h=null),p=setTimeout(()=>{c.value=M},60)}function C(){p&&(clearTimeout(p),p=null),h=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{p&&clearTimeout(p),h&&clearTimeout(h)});function D(M){const k=M.target;k&&k.closest(".zm-canvas-menu")||i("close")}function _(M){M.key==="Escape"&&i("close")}function F(){i("close")}window.addEventListener("mousedown",D,!0),window.addEventListener("keydown",_,!0),window.addEventListener("wheel",F,!0),window.addEventListener("scroll",F,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",D,!0),window.removeEventListener("keydown",_,!0),window.removeEventListener("wheel",F,!0),window.removeEventListener("scroll",F,!0)});function R(M){M(),i("close")}return(M,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:k[11]||(k[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[0]||(k[0]=e.withModifiers(u=>R(()=>i("openData")),["stop"]))},[e.createVNode(_e,{name:"database",size:13,stroke:1.6}),k[12]||(k[12]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:s,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="import"}]),onMouseenter:k[5]||(k[5]=u=>y("import")),onMouseleave:C},[e.createVNode(_e,{name:"import",size:13,stroke:1.6}),k[16]||(k[16]=e.createElementVNode("span",null,"导入",-1)),k[17]||(k[17]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),c.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:k[4]||(k[4]=u=>y("import")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[1]||(k[1]=e.withModifiers(u=>R(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(_e,{name:"markdown",size:13,stroke:1.6}),k[13]||(k[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[2]||(k[2]=e.withModifiers(u=>R(()=>i("openImport","json")),["stop"]))},[e.createVNode(_e,{name:"json",size:13,stroke:1.6}),k[14]||(k[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[3]||(k[3]=e.withModifiers(u=>R(()=>i("openImport","txt")),["stop"]))},[e.createVNode(_e,{name:"txt",size:13,stroke:1.6}),k[15]||(k[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[6]||(k[6]=e.withModifiers(u=>R(()=>i("openSettings")),["stop"]))},[e.createVNode(_e,{name:"settings",size:13,stroke:1.6}),k[18]||(k[18]=e.createElementVNode("span",null,"设置",-1))]),k[23]||(k[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:f,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="export"}]),onMouseenter:k[10]||(k[10]=u=>y("export")),onMouseleave:C},[e.createVNode(_e,{name:"export",size:13,stroke:1.6}),k[21]||(k[21]=e.createElementVNode("span",null,"导出",-1)),k[22]||(k[22]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),c.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:k[9]||(k[9]=u=>y("export")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[7]||(k[7]=e.withModifiers(u=>R(()=>i("exportPng")),["stop"]))},[e.createVNode(_e,{name:"image",size:13,stroke:1.6}),k[19]||(k[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:k[8]||(k[8]=e.withModifiers(u=>R(()=>i("exportSvg")),["stop"]))},[e.createVNode(_e,{name:"svg-export",size:13,stroke:1.6}),k[20]||(k[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),hs=["aria-hidden"],gs=["aria-hidden"],bs={key:0,class:"zm-drawer-header"},ks={key:0,class:"zm-drawer-title"},ys={class:"zm-drawer-body"},Es=["aria-hidden"],xs={key:0,class:"zm-drawer-header"},ws={key:0,class:"zm-drawer-title"},Ns={class:"zm-drawer-body"},It=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function i(){n("update:open",!1)}function a(){n("update:open",!1)}return(c,s)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:s[0]||(s[0]=f=>t.closeOnBackdrop&&a())},null,8,hs)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",bs,[t.title?(e.openBlock(),e.createElementBlock("h3",ks,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[1]||(s[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",ys,[e.renderSlot(c.$slots,"default")])],14,gs)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",xs,[t.title?(e.openBlock(),e.createElementBlock("h3",ws,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[2]||(s[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ns,[e.renderSlot(c.$slots,"default")])],14,Es)):e.createCommentVNode("",!0)]),_:3}))}}),Ss={class:"zm-outline-root"},Ts={class:"zm-outline-search"},Cs={key:0,class:"zm-outline-search-count"},Ms={key:1,class:"zm-outline-search-count zm-outline-search-empty"},As={class:"zm-outline-actions"},_s={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Rs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Bs={key:1,d:"M5 12 L10 17 L19 7"},vs={class:"zm-outline"},zs=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Is=["title","onClick"],Os={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ls={key:0,points:"6 9 12 15 18 9"},Ds={key:1,points:"9 6 15 12 9 18"},Vs={key:1,class:"zm-outline-dot"},$s={key:2,class:"zm-outline-index"},Ps={key:4,class:"zm-outline-text"},Fs=["onClick"],Us=["src"],Hs=["onClick"],Ws=["src"],Gs=["title","onClick"],js={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ks={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ys={key:1,d:"M5 12 L10 17 L19 7"},Oo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1},showIndex:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null),s=e.ref(-1),f=e.computed(()=>{const w=a.value.trim().toLowerCase();if(!w)return new Set;const P=new Set,H=ie=>{var xe;(ie.text.toLowerCase().includes(w)||(xe=ie.note)!=null&&xe.text&&ie.note.text.toLowerCase().includes(w))&&P.add(ie.id);for(const Je of ie.children)H(Je)};return H(n.data),P}),d=e.computed(()=>{if(f.value.size===0)return new Set;const w=new Set,P=H=>{let ie=f.value.has(H.id);for(const xe of H.children)P(xe)&&(ie=!0);return ie&&w.add(H.id),ie};return P(n.data),w}),p=e.computed(()=>{const w=[],P=H=>{f.value.has(H.id)&&w.push(H.id);for(const ie of H.children)P(ie)};return P(n.data),w}),h=e.computed(()=>a.value.trim().length>0),y=e.computed(()=>{const w=[],P=d.value,H=(ie,xe,Je)=>{if(h.value&&!P.has(ie.id))return;const Tt=ie.children.length>0,it=h.value?!1:n.collapsedIds.has(ie.id);w.push({id:ie.id,text:ie.text||"(无标题)",depth:xe,siblingIndex:Je,hasChildren:Tt,collapsed:it,node:ie}),Tt&&!it&&ie.children.forEach((nn,Qe)=>H(nn,xe+1,Qe))};return H(n.data,0,0),w});function C(){s.value=p.value.length>0?0:-1}function D(){const w=p.value;w.length!==0&&(s.value=(s.value+1)%w.length,R(s.value))}function _(){const w=p.value;w.length!==0&&(s.value=(s.value-1+w.length)%w.length,R(s.value))}function F(w){w.key==="Enter"?(w.preventDefault(),w.shiftKey?_():D()):w.key==="Escape"&&(w.preventDefault(),a.value="",s.value=-1)}function R(w){const P=p.value[w];if(!P)return;const H=y.value.find(ie=>ie.id===P);H&&i("select",H.node),e.nextTick(()=>{const ie=document.querySelector(`[data-outline-id="${P}"]`);ie==null||ie.scrollIntoView({block:"nearest",behavior:"smooth"})})}function M(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var w;return(w=c.value)==null?void 0:w.focus()})});const k=e.ref(null),u=e.ref("");let N=null;function $(w){n.readonly||(k.value=w.id,u.value=w.text,e.nextTick(()=>{N=document.querySelector(".zm-outline-input"),N==null||N.focus(),N==null||N.select()}))}function j(){k.value!=null&&(i("edit",{id:k.value,text:u.value.trim()||"(无标题)"}),q())}function q(){k.value=null,u.value="",N=null}function x(w){w.key==="Enter"?(w.preventDefault(),j()):w.key==="Escape"&&(w.preventDefault(),q())}e.onBeforeUnmount(q);const ae=e.ref(null),fe=e.ref(null),me=e.ref(null);function J(w,P){if(n.readonly){w.preventDefault();return}ae.value={id:P.id,text:P.text},w.dataTransfer&&(w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",P.id))}function ge(){ae.value=null,fe.value=null,me.value=null}function de(w,P){if(!ae.value)return;w.preventDefault(),w.dataTransfer&&(w.dataTransfer.dropEffect="move");const H=L(w);fe.value=P.id,me.value=H}function ye(w){fe.value===w.id&&(fe.value=null,me.value=null)}function b(w,P){w.preventDefault();const H=ae.value;if(!H)return;const ie=L(w);H.id!==P.id&&i("move",{srcId:H.id,targetId:P.id,position:ie}),ge()}function L(w,P){const ie=w.currentTarget.getBoundingClientRect(),xe=w.clientY-ie.top,Je=ie.height;return xe<Je*.3?"before":xe>Je*.7?"after":"child"}const G=e.ref(null);let ee=null;async function be(w){try{return await navigator.clipboard.writeText(w),!0}catch{const P=document.createElement("textarea");P.value=w,document.body.appendChild(P),P.select();let H=!1;try{H=document.execCommand("copy")}finally{document.body.removeChild(P)}return H}}async function O(w,P,H){w.stopPropagation(),await be(P)&&(G.value=H,ee&&clearTimeout(ee),ee=setTimeout(()=>G.value=null,1200))}const B=e.computed(()=>{const w=[],P=(H,ie)=>{const xe=" ".repeat(ie),Je=ie===0?"":"- ";w.push(xe+Je+(H.text||""));for(const Tt of H.children)P(Tt,ie+1)};return P(n.data,0),w.join(`
16
- `)}),oe=e.ref(!1);let te=null;async function V(){await be(B.value)&&(oe.value=!0,te&&clearTimeout(te),te=setTimeout(()=>oe.value=!1,1200))}return(w,P)=>(e.openBlock(),e.createElementBlock("div",Ss,[e.createElementVNode("div",Ts,[P[3]||(P[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:c,"onUpdate:modelValue":P[0]||(P[0]=H=>a.value=H),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:C,onKeydown:F},null,544),[[e.vModelText,a.value]]),p.value.length>0?(e.openBlock(),e.createElementBlock("span",Cs,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(p.value.length),1)):h.value?(e.openBlock(),e.createElementBlock("span",Ms,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:M},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",As,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":oe.value}]),title:"复制完整大纲为纯文本",onClick:V},[(e.openBlock(),e.createElementBlock("svg",_s,[oe.value?(e.openBlock(),e.createElementBlock("path",Bs)):(e.openBlock(),e.createElementBlock("rect",Rs)),P[4]||(P[4]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(oe.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,H=>(e.openBlock(),e.createElementBlock("li",{key:H.id,"data-outline-id":H.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":H.id===t.selectedId,"is-root":H.depth===0,"is-editing":k.value===H.id,"is-search-hit":f.value.has(H.id),"is-search-current":p.value[s.value]===H.id,"is-drag-over-before":fe.value===H.id&&me.value==="before","is-drag-over-after":fe.value===H.id&&me.value==="after","is-drag-over-child":fe.value===H.id&&me.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+H.depth*16+"px"}),draggable:"true",onClick:ie=>i("select",H.node),onDblclick:ie=>$(H),onDragstart:ie=>J(ie,H),onDragend:ge,onDragover:ie=>de(ie,H),onDragleave:()=>ye(H),onDrop:ie=>b(ie,H)},[H.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:H.collapsed?"展开":"折叠",onClick:e.withModifiers(ie=>i("toggleCollapse",H.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Os,[H.collapsed?(e.openBlock(),e.createElementBlock("polyline",Ds)):(e.openBlock(),e.createElementBlock("polyline",Ls))]))],8,Is)):(e.openBlock(),e.createElementBlock("span",Vs)),n.showIndex?(e.openBlock(),e.createElementBlock("span",$s,e.toDisplayString(H.siblingIndex+1)+".",1)):e.createCommentVNode("",!0),k.value===H.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,"onUpdate:modelValue":P[1]||(P[1]=ie=>u.value=ie),class:"zm-outline-input",onBlur:j,onKeydown:x,onClick:P[2]||(P[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]):(e.openBlock(),e.createElementBlock("span",Ps,e.toDisplayString(H.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(ie=>i("addSibling",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(rr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Us)],8,Fs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(ie=>i("addChild",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Ws)],8,Hs)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":G.value===H.id}]),title:G.value===H.id?"已复制":"复制节点文本",onClick:ie=>O(ie,H.text,H.id)},[(e.openBlock(),e.createElementBlock("svg",js,[G.value!==H.id?(e.openBlock(),e.createElementBlock("rect",Ks)):(e.openBlock(),e.createElementBlock("path",Ys)),P[5]||(P[5]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Gs)],46,zs))),128))])]))}}),qs={key:0,class:"zm-jtv-root"},Xs={key:0,class:"zm-jtv-key"},Zs={key:1,class:"zm-jtv-colon"},Js={key:2,class:"zm-jtv-key zm-jtv-bracket"},Qs={key:3,class:"zm-jtv-size"},ec={key:4,class:"zm-jtv-bracket"},tc={key:5,class:"zm-jtv-brace"},nc={key:0,class:"zm-jtv-children"},oc={class:"zm-jtv-key"},ic={key:0,class:"zm-jtv-key"},rc=["src","alt"],lc=["href"],ac=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),i=e.computed(()=>n.value==="object"),a=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!a.value);const c=e.computed(()=>{if(a.value)return`Array(${o.value.length})`;if(i.value){const k=o.value,u=Object.keys(k);return`Object(${u.length} ${u.length===1?"key":"keys"})`}return""}),s=e.computed(()=>a.value?o.value.map((k,u)=>({key:String(u),value:k})):i.value?Object.entries(o.value).map(([k,u])=>({key:k,value:u})):[]),f=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(f.value));function p(k,u,N){k!=="<root>"&&(N<2||u===null||typeof u!="object"||o.collapsedPaths.has(k)||o.collapsedPaths.add(k))}o.isRoot||p(f.value,o.value,o.depth);function h(){d.value?o.collapsedPaths.delete(f.value):o.collapsedPaths.add(f.value)}function y(k){return f.value===""?k:`${f.value}.${k}`}function C(k){if(!o.query)return!0;const u=o.query.toLowerCase();return typeof k=="string"?k.toLowerCase().includes(u):k===null?"null".includes(u):String(k).toLowerCase().includes(u)}function D(k){return o.query?k.toLowerCase().includes(o.query.toLowerCase()):!0}function _(k,u){return!o.query||D(k)?!0:u===null||typeof u!="object"?C(u):!0}function F(k){return k===null?"null":typeof k=="string"?k.length>80?`"${k.slice(0,80)}..."`:`"${k}"`:typeof k=="boolean"?k?"true":"false":typeof k=="number"?String(k):typeof k>"u"?"undefined":JSON.stringify(k)}function R(k){if(typeof k!="string")return!1;const u=k.trim();return!!(u.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(u)||/^https?:\/\/.+/i.test(u)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(u))}function M(k){if(!o.query)return null;const u=k.toLowerCase().indexOf(o.query.toLowerCase());return u<0?null:{before:k.slice(0,u),match:k.slice(u,u+o.query.length),after:k.slice(u+o.query.length)}}return(k,u)=>{var $,j,q,x,ae,fe;const N=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,me=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:me.key,class:"zm-jtv-row"},[e.createVNode(N,{"key-name":me.key,value:me.value,path:y(me.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,_(me.key,me.value)]])),128))])):i.value||a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:h},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Xs,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Zs,":")),a.value?(e.openBlock(),e.createElementBlock("span",Js,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",Qs,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",ec,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",tc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,me=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:me.key,class:"zm-jtv-row"},[e.createVNode(N,{"key-name":me.key,value:me.value,path:y(me.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,_(me.key,me.value)]])),128))])),!d.value&&a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&i.value&&!a.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[u[2]||(u[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",oc,e.toDisplayString(t.keyName),1),u[3]||(u[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),D(t.keyName)&&M(t.keyName)?(e.openBlock(),e.createElementBlock("span",ic,[e.createElementVNode("span",null,e.toDisplayString(($=M(t.keyName))==null?void 0:$.before),1),e.createElementVNode("mark",null,e.toDisplayString((j=M(t.keyName))==null?void 0:j.match),1),e.createElementVNode("span",null,e.toDisplayString((q=M(t.keyName))==null?void 0:q.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[M(F(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((x=M(F(t.value)))==null?void 0:x.before),1),e.createElementVNode("mark",null,e.toDisplayString((ae=M(F(t.value)))==null?void 0:ae.match),1),e.createElementVNode("span",null,e.toDisplayString((fe=M(F(t.value)))==null?void 0:fe.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(F(t.value)),1)],64))],2),R(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:u[1]||(u[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,rc),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:u[0]||(u[0]=e.withModifiers(()=>{},["stop"]))},"open",8,lc)])):e.createCommentVNode("",!0)],4))}}}),sc={class:"zm-data-panel"},cc={class:"zm-data-header"},dc={class:"zm-data-title"},uc={class:"zm-data-title-meta"},fc={class:"zm-data-toolbar"},mc=["title"],pc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},hc={key:1,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},gc={key:0,class:"zm-data-paste"},bc={class:"zm-data-tabs"},kc=["placeholder"],yc={key:0,class:"zm-data-error"},Ec={class:"zm-data-paste-actions"},xc=["disabled"],wc={class:"zm-data-tree"},Lo=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>JSON.stringify(n.data,null,2)),c=e.ref(""),s=e.ref(null),f=e.ref(!1),d=e.ref("json"),p=e.ref("idle"),h=e.ref(new Set),y=e.ref("");e.watch(()=>n.pendingMode,u=>{u&&(f.value=!0,d.value=u,i("consumed-mode"))},{immediate:!0});async function C(){try{await navigator.clipboard.writeText(a.value),p.value="copied",setTimeout(()=>p.value="idle",1500)}catch{const u=document.createElement("textarea");u.value=a.value,document.body.appendChild(u),u.select();try{document.execCommand("copy"),p.value="copied",setTimeout(()=>p.value="idle",1500)}finally{document.body.removeChild(u)}}}function D(){const u=new Blob([a.value],{type:"application/json"}),N=URL.createObjectURL(u),$=document.createElement("a");$.href=N,$.download=`${n.data.text||"mindmap"}.json`,$.click(),URL.revokeObjectURL(N)}function _(){s.value=null;const u=c.value.trim();if(u){if(d.value==="markdown"||d.value==="txt"){try{const N=In(u);i("import",N),c.value="",f.value=!1}catch(N){s.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+N.message}return}try{const N=JSON.parse(u);if(!N.id||!Array.isArray(N.children)){s.value="JSON 缺少 id 或 children 字段";return}i("import",N),c.value="",f.value=!1}catch(N){s.value="JSON 解析失败:"+N.message}}}function F(u){return 1+u.children.reduce((N,$)=>N+F($),0)}const R=e.computed(()=>F(n.data)),M=e.computed(()=>a.value.length);function k(){const u=document.createElement("input");u.type="file",u.accept="application/json",u.onchange=()=>{var j;const N=(j=u.files)==null?void 0:j[0];if(!N)return;const $=new FileReader;$.onload=()=>{typeof $.result=="string"&&(c.value=$.result,_())},$.readAsText(N)},u.click()}return(u,N)=>(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("div",cc,[e.createElementVNode("div",dc,[N[8]||(N[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",uc,e.toDisplayString(R.value)+" 节点 · "+e.toDisplayString(M.value)+" chars",1)])]),e.createElementVNode("div",fc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":p.value==="copied"}]),title:p.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:C},[p.value==="idle"?(e.openBlock(),e.createElementBlock("svg",pc,[...N[9]||(N[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",hc,[...N[10]||(N[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),N[11]||(N[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,mc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:D},[...N[12]||(N[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:k},[...N[13]||(N[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":f.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:N[0]||(N[0]=$=>f.value=!f.value)},[...N[14]||(N[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),N[16]||(N[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":y.value.length>0}])},[N[15]||(N[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":N[1]||(N[1]=$=>y.value=$),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,y.value]]),y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:N[2]||(N[2]=$=>y.value="")},"×")):e.createCommentVNode("",!0)],2)]),f.value?(e.openBlock(),e.createElementBlock("div",gc,[e.createElementVNode("div",bc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:N[3]||(N[3]=$=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:N[4]||(N[4]=$=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":N[5]||(N[5]=$=>c.value=$),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,kc),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",yc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ec,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:_},"应用",8,xc),e.createElementVNode("button",{class:"zm-data-btn",onClick:N[6]||(N[6]=$=>{c.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:N[7]||(N[7]=$=>f.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",wc,[e.createVNode(ac,{value:t.data,query:y.value,"collapsed-paths":h.value},null,8,["value","query","collapsed-paths"])]),N[17]||(N[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),Nc={class:"zm-md-panel"},Sc={key:0,class:"zm-md-error"},Tc={class:"zm-md-split"},Cc={class:"zm-md-edit"},Mc={class:"zm-md-preview"},Ac={class:"zm-md-preview-body"},_c={class:"zm-md-footer"},Rc=["disabled"],Bc=`# flow-mindmap 思维导图
9
+ `);for(const i of t.children)n+=Ln(i,o+1);return n}function es(t){var p,h;const o=t.split(/\r?\n/),n=[];let i=0;const a=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const x=o[i],C=x.match(c);if(C){const k=C[1][0],m=C[2]||"",P=[x];for(i++;i<o.length;){const Y=o[i].match(c);if(Y&&Y[1][0]===k){P.push(o[i]),i++;break}P.push(o[i]),i++}const G=P.slice(1,-1).join(`
10
+ `).trim();n.push({kind:"code",text:((p=G.split(`
11
+ `)[0])==null?void 0:p.slice(0,80))||"(空代码块)",raw:P.join(`
12
+ `),lang:m});continue}const $=x.match(a);if($){n.push({kind:"heading",level:$[1].length,text:$[2].trim(),raw:x}),i++;continue}if(/^\s*\|/.test(x)){const k=[];let m=i,P=!1;for(;m<o.length&&/^\s*\|/.test(o[m]);)k.push(o[m]),s.test(o[m])&&(P=!0),m++;if(P&&k.length>=2){n.push({kind:"table",text:((h=k[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:h.trim())||"表格",raw:k.join(`
13
+ `)}),i=m;continue}}const R=x.match(u),F=x.match(d);if(R||F){let k=i;for(;k<o.length;){const m=o[k].match(u),P=o[k].match(d);if(!(m||P))break;const G=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();G.length>0&&n.push({kind:"list",text:G.slice(0,80)||"(列表项)",raw:o[k]}),k++}i=k;continue}if(x.trim()===""){i++;continue}const I=[x];let A=i+1;for(;A<o.length;){const k=o[A];if(k.trim()===""||a.test(k)||c.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;I.push(k),A++}const y=I.join(" ").trim();n.push({kind:"paragraph",text:y.slice(0,80)||"(空段落)",raw:I.join(`
14
+ `)}),i=A}return n}function ts(t,o="导入的导图"){const n=es(t||""),i={id:Kt(),text:o,children:[]},a=[i],c=[0];let s=!1;function u(d){if(d.kind==="heading"){const h=d.level;for(;a.length>1&&c[c.length-1]>=h;)a.pop(),c.pop();if(!s&&h===1){s=!0,i.text=d.text,c[0]=1;return}const x={id:Kt(),text:d.text,children:[]};a[a.length-1].children.push(x),a.push(x),c.push(h);return}const p={id:Kt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};a[a.length-1].children.push(p)}for(const d of n)u(d);return i}function ns(t){return t.richContent?t.richContent.raw+`
15
+ `:""}function os(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,a=e.ref(1),c=e.ref(0),s=e.ref(0),u=e.ref(!1),d=e.ref(!1),p=e.reactive({x:0,y:0,ox:0,oy:0}),h=e.ref(!1),x=e.reactive({x:0,y:0}),C=e.reactive({x:0,y:0,width:0,height:0}),$=e.ref(0);let R=null;function F(ee){R=ee}function I(ee){ee.preventDefault();const ce=t.getContainer();if(!ce)return;const ue=-ee.deltaY*.001,g=Math.min(n,Math.max(o,a.value*(1+ue))),V=ce.getBoundingClientRect(),W=ee.clientX-V.left,te=ee.clientY-V.top,fe=(W-c.value)/a.value,L=(te-s.value)/a.value;a.value=g,c.value=W-fe*g,s.value=te-L*g}function A(){a.value=Math.min(n,a.value*i)}function y(){a.value=Math.max(o,a.value/i)}function k(ee){var ue;ee.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,p.x=ee.clientX,p.y=ee.clientY,p.ox=c.value,p.oy=s.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",P),(ue=ee.preventDefault)==null||ue.call(ee))}function m(ee){if(!u.value)return;const ce=ee.clientX-p.x,ue=ee.clientY-p.y;(Math.abs(ce)>3||Math.abs(ue)>3)&&(d.value=!0),c.value=p.ox+ce,s.value=p.oy+ue}function P(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",P)}function G(ee,ce,ue){h.value=!0,x.x=ee,x.y=ce,C.x=ee,C.y=ce,C.width=0,C.height=0,C.shiftKey=!!(ue!=null&&ue.shift),$.value++,window.addEventListener("mousemove",re),window.addEventListener("mouseup",N)}function Y(ee,ce){if(!h.value)return;const ue=Math.min(x.x,ee),g=Math.min(x.y,ce),V=Math.max(x.x,ee),W=Math.max(x.y,ce);C.x=ue,C.y=g,C.width=V-ue,C.height=W-g,$.value++}function N(){h.value=!1,window.removeEventListener("mousemove",re),window.removeEventListener("mouseup",N),R&&R()}function re(ee){if(!h.value)return;const ce=t.getContainer();if(!ce)return;const ue=ce.getBoundingClientRect(),g=(ee.clientX-ue.left-c.value)/a.value,V=(ee.clientY-ue.top-s.value)/a.value;Y(g,V)}function pe(ee,ce,ue,g=60){const V=t.getContainer();if(!V)return;const W=V.getBoundingClientRect(),te=(W.width-g*2)/ee,fe=(W.height-g*2)/ce,L=Math.min(1,Math.max(.3,Math.min(te,fe)));a.value=L,c.value=W.width/2,s.value=W.height/2-ue*L}function de(){const ee=t.getContainer();if(!ee)return;const ce=ee.getBoundingClientRect(),ue=ce.width/2,g=ce.height/2,V=(ue-c.value)/a.value,W=(g-s.value)/a.value;a.value=1,c.value=ue-V,s.value=g-W}function xe(ee,ce,ue,g,V=80){const W=t.getContainer();if(!W)return;const te=W.getBoundingClientRect();let fe=a.value;(ue*fe<40||g*fe<40)&&(fe=Math.min(n,Math.max(1,60/Math.min(ue,g)))),a.value=fe,c.value=te.width/2-ee*fe,s.value=te.height/2-ce*fe}return{scale:a,offsetX:c,offsetY:s,isPanning:u,panMoved:d,onWheel:I,zoomIn:A,zoomOut:y,zoomTo100:de,startPan:k,startMarquee:G,updateMarquee:Y,isMarquee:h,marquee:C,marqueeVersion:$,setOnMarqueeEnd:F,resetView:pe,centerOn:xe}}const is=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Sr(t){return is?t.metaKey:t.ctrlKey}function rs(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const a=t.getSelectedIds();return a.length>0?a[0]:null}function n(i){var u,d,p;const a=i.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable)||t.isReadonly()||t.isEditing())return;const c=t.getSelectedId(),s=o();if(s){if(Sr(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const h=(u=t.defaultTargetId)==null?void 0:u.call(t);c&&c!==h&&(i.preventDefault(),t.onDuplicate(c));return}if(i.key==="c"||i.key==="C"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCopy(h));return}if(i.key==="x"||i.key==="X"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCut(h));return}if(i.key==="v"||i.key==="V"){if(!t.hasClipboard())return;i.preventDefault();const h=t.getSelectedIds();t.onPaste(h.length>0?h[0]:null);return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(Sr(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(s);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const h=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==h&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else if((i.key==="Delete"||i.key==="Backspace")&&c&&c!==((p=t.defaultTargetId)==null?void 0:p.call(t)))i.preventDefault(),t.onRemove(c);else if(i.key==="F2"&&c)i.preventDefault(),t.onStartEdit(c);else if(i.key==="Escape")i.preventDefault(),t.onClearSelection();else if(i.altKey&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey){if(i.key==="ArrowUp"){i.preventDefault(),t.onMoveSibling(-1);return}else if(i.key==="ArrowDown"){i.preventDefault(),t.onMoveSibling(1);return}}else i.key==="ArrowDown"?(i.preventDefault(),t.onNavigate(0,1)):i.key==="ArrowUp"?(i.preventDefault(),t.onNavigate(0,-1)):i.key==="ArrowRight"?(i.preventDefault(),t.onNavigate(1,0)):i.key==="ArrowLeft"&&(i.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function ls(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function a(){return n<o.value.length-1}function c(p){const h=JSON.stringify(p);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(h),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function s(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return a()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:a,record:c,undo:s,redo:u,reset:d}}const as={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},ss={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,i=as[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${i}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function cs(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),i=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${i.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const ds={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:cs(t)}))},us={label:"旗帜",markers:[{id:"flag-red",label:"红旗",color:"#ef4444"},{id:"flag-orange",label:"橙旗",color:"#f97316"},{id:"flag-yellow",label:"黄旗",color:"#eab308"},{id:"flag-green",label:"绿旗",color:"#22c55e"},{id:"flag-blue",label:"蓝旗",color:"#3b82f6"},{id:"flag-gray",label:"灰旗",color:"#94a3b8"}].map(t=>({id:t.id,label:t.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${t.color}" stroke="${t.color}" stroke-width="1" stroke-linejoin="round"/>`}))},ki=[ss,ds,us,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],Io={};for(const t of ki)for(const o of t.markers)Io[o.id]=o;function fs(t){return Io[t]}function Oo(t){var o;return((o=Io[t])==null?void 0:o.svg)??""}function Tr(t){var o;return((o=Io[t])==null?void 0:o.label)??t}function yi(t){let o=0;for(let i=0;i<t.length;i++)o=(o<<5)-o+t.charCodeAt(i),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const ms={key:5,class:"zm-marker-picker"},ps={class:"zm-marker-group-label"},hs={class:"zm-marker-grid"},gs=["title","onClick","innerHTML"],bs=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let y=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),P=180,Y=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;y+P>m.right&&(y=Math.max(m.left+4,n.x-P-2)),k+Y>m.bottom&&(k=Math.max(m.top+4,n.y-Y-2)),y<m.left+2&&(y=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:y,top:k}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),p=e.computed(()=>n.nodeTags.length>0),h=e.ref(!1);function x(){h.value=!h.value}function C(y){return n.nodeMarkers.includes(y)}function $(y){i("toggleMarker",y)}function R(y){const k=y.target;k&&k.closest(".zm-node-menu")||i("close")}function F(y){y.key==="Escape"&&i("close")}function I(){i("close")}window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",F,!0),window.addEventListener("wheel",I,!0),window.addEventListener("scroll",I,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",F,!0),window.removeEventListener("wheel",I,!0),window.removeEventListener("scroll",I,!0)});function A(y){y(),i("close")}return(y,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:k[13]||(k[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[0]||(k[0]=e.withModifiers(m=>A(()=>i("pickImage")),["stop"]))},[e.createVNode(_e,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"替换图片":"添加图片"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:k[1]||(k[1]=e.withModifiers(m=>A(()=>i("removeImage")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[14]||(k[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[2]||(k[2]=e.withModifiers(m=>A(()=>i("setLink")),["stop"]))},[e.createVNode(_e,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:k[3]||(k[3]=e.withModifiers(m=>A(()=>i("removeLink")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[15]||(k[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[4]||(k[4]=e.withModifiers(m=>A(()=>i("addCode")),["stop"]))},[k[16]||(k[16]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:k[5]||(k[5]=e.withModifiers(m=>A(()=>i("removeCode")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[17]||(k[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[6]||(k[6]=e.withModifiers(m=>A(()=>i("addTable")),["stop"]))},[k[18]||(k[18]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:k[7]||(k[7]=e.withModifiers(m=>A(()=>i("removeTable")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[19]||(k[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[8]||(k[8]=e.withModifiers(m=>A(()=>i("editNote")),["stop"]))},[e.createVNode(_e,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:k[9]||(k[9]=e.withModifiers(m=>A(()=>i("removeNote")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[20]||(k[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),k[25]||(k[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(x,["stop"])},[k[21]||(k[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),k[22]||(k[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":h.value}])},"›",2)]),h.value?(e.openBlock(),e.createElementBlock("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ki),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",ps,e.toDisplayString(m.label),1),e.createElementVNode("div",hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":C(P.id)}]),title:P.label,onClick:e.withModifiers(G=>$(P.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(Oo)(P.id)+"</svg>"},null,10,gs))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>i("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>A(()=>i("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(p.value?"编辑标签":"添加标签"),1)]),p.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>A(()=>i("removeTags")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ks=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let A=n.x+2,y=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,P=4+4*28+5;A+m>k.right&&(A=Math.max(k.left+4,n.x-m-2)),y+P>k.bottom&&(y=Math.max(k.top+4,n.y-P-2)),A<k.left+2&&(A=k.left+2),y<k.top+2&&(y=k.top+2)}return{left:A,top:y}}),c=e.ref(null),s=e.ref(null),u=e.ref(null),d=e.computed(()=>{const A=c.value==="import"?s.value:c.value==="export"?u.value:null;if(!A)return{left:"-9999px",top:"-9999px",display:"none"};const y=A.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,P=176,G=4+3*28;let Y=y.right;Y+P>k-4&&(Y=Math.max(4,y.left-P));let N=y.top-4;return N+G>m-4&&(N=Math.max(4,m-G-4)),{left:Y+"px",top:N+"px",display:"block"}});let p=null,h=null;function x(A){h&&(clearTimeout(h),h=null),p=setTimeout(()=>{c.value=A},60)}function C(){p&&(clearTimeout(p),p=null),h=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{p&&clearTimeout(p),h&&clearTimeout(h)});function $(A){const y=A.target;y&&y.closest(".zm-canvas-menu")||i("close")}function R(A){A.key==="Escape"&&i("close")}function F(){i("close")}window.addEventListener("mousedown",$,!0),window.addEventListener("keydown",R,!0),window.addEventListener("wheel",F,!0),window.addEventListener("scroll",F,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",$,!0),window.removeEventListener("keydown",R,!0),window.removeEventListener("wheel",F,!0),window.removeEventListener("scroll",F,!0)});function I(A){A(),i("close")}return(A,y)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:y[11]||(y[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[0]||(y[0]=e.withModifiers(k=>I(()=>i("openData")),["stop"]))},[e.createVNode(_e,{name:"database",size:13,stroke:1.6}),y[12]||(y[12]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:s,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="import"}]),onMouseenter:y[5]||(y[5]=k=>x("import")),onMouseleave:C},[e.createVNode(_e,{name:"import",size:13,stroke:1.6}),y[16]||(y[16]=e.createElementVNode("span",null,"导入",-1)),y[17]||(y[17]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),c.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:y[4]||(y[4]=k=>x("import")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[1]||(y[1]=e.withModifiers(k=>I(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(_e,{name:"markdown",size:13,stroke:1.6}),y[13]||(y[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[2]||(y[2]=e.withModifiers(k=>I(()=>i("openImport","json")),["stop"]))},[e.createVNode(_e,{name:"json",size:13,stroke:1.6}),y[14]||(y[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[3]||(y[3]=e.withModifiers(k=>I(()=>i("openImport","txt")),["stop"]))},[e.createVNode(_e,{name:"txt",size:13,stroke:1.6}),y[15]||(y[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[6]||(y[6]=e.withModifiers(k=>I(()=>i("openSettings")),["stop"]))},[e.createVNode(_e,{name:"settings",size:13,stroke:1.6}),y[18]||(y[18]=e.createElementVNode("span",null,"设置",-1))]),y[23]||(y[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:u,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="export"}]),onMouseenter:y[10]||(y[10]=k=>x("export")),onMouseleave:C},[e.createVNode(_e,{name:"export",size:13,stroke:1.6}),y[21]||(y[21]=e.createElementVNode("span",null,"导出",-1)),y[22]||(y[22]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),c.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:y[9]||(y[9]=k=>x("export")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[7]||(y[7]=e.withModifiers(k=>I(()=>i("exportPng")),["stop"]))},[e.createVNode(_e,{name:"image",size:13,stroke:1.6}),y[19]||(y[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[8]||(y[8]=e.withModifiers(k=>I(()=>i("exportSvg")),["stop"]))},[e.createVNode(_e,{name:"svg-export",size:13,stroke:1.6}),y[20]||(y[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),ys=["aria-hidden"],Es=["aria-hidden"],xs={key:0,class:"zm-drawer-header"},ws={key:0,class:"zm-drawer-title"},Ns={class:"zm-drawer-body"},Ss=["aria-hidden"],Ts={key:0,class:"zm-drawer-header"},Cs={key:0,class:"zm-drawer-title"},Ms={class:"zm-drawer-body"},It=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function i(){n("update:open",!1)}function a(){n("update:open",!1)}return(c,s)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:s[0]||(s[0]=u=>t.closeOnBackdrop&&a())},null,8,ys)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",xs,[t.title?(e.openBlock(),e.createElementBlock("h3",ws,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[1]||(s[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ns,[e.renderSlot(c.$slots,"default")])],14,Es)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",Ts,[t.title?(e.openBlock(),e.createElementBlock("h3",Cs,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[2]||(s[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ms,[e.renderSlot(c.$slots,"default")])],14,Ss)):e.createCommentVNode("",!0)]),_:3}))}}),As={class:"zm-outline-root"},_s={class:"zm-outline-search"},Rs={key:0,class:"zm-outline-search-count"},vs={key:1,class:"zm-outline-search-count zm-outline-search-empty"},Bs={class:"zm-outline-actions"},zs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Is={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Os={key:1,d:"M5 12 L10 17 L19 7"},Ls={class:"zm-outline"},Ds=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Vs=["title","onClick"],$s={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ps={key:0,points:"6 9 12 15 18 9"},Fs={key:1,points:"9 6 15 12 9 18"},Us={key:1,class:"zm-outline-dot"},Hs={key:2,class:"zm-outline-index"},Ws={key:4,class:"zm-outline-text"},Gs=["onClick"],js=["src"],Ks=["onClick"],Ys=["src"],qs=["title","onClick"],Xs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Zs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Js={key:1,d:"M5 12 L10 17 L19 7"},Lo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1},showIndex:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null),s=e.ref(-1),u=e.computed(()=>{const S=a.value.trim().toLowerCase();if(!S)return new Set;const U=new Set,H=ne=>{var ye;(ne.text.toLowerCase().includes(S)||(ye=ne.note)!=null&&ye.text&&ne.note.text.toLowerCase().includes(S))&&U.add(ne.id);for(const Qe of ne.children)H(Qe)};return H(n.data),U}),d=e.computed(()=>{if(u.value.size===0)return new Set;const S=new Set,U=H=>{let ne=u.value.has(H.id);for(const ye of H.children)U(ye)&&(ne=!0);return ne&&S.add(H.id),ne};return U(n.data),S}),p=e.computed(()=>{const S=[],U=H=>{u.value.has(H.id)&&S.push(H.id);for(const ne of H.children)U(ne)};return U(n.data),S}),h=e.computed(()=>a.value.trim().length>0),x=e.computed(()=>{const S=[],U=d.value,H=(ne,ye,Qe)=>{if(h.value&&!U.has(ne.id))return;const ut=ne.children.length>0,et=h.value?!1:n.collapsedIds.has(ne.id);S.push({id:ne.id,text:ne.text||"(无标题)",depth:ye,siblingIndex:Qe,hasChildren:ut,collapsed:et,node:ne}),ut&&!et&&ne.children.forEach((en,tt)=>H(en,ye+1,tt))};return H(n.data,0,0),S});function C(){s.value=p.value.length>0?0:-1}function $(){const S=p.value;S.length!==0&&(s.value=(s.value+1)%S.length,I(s.value))}function R(){const S=p.value;S.length!==0&&(s.value=(s.value-1+S.length)%S.length,I(s.value))}function F(S){S.key==="Enter"?(S.preventDefault(),S.shiftKey?R():$()):S.key==="Escape"&&(S.preventDefault(),a.value="",s.value=-1)}function I(S){const U=p.value[S];if(!U)return;const H=x.value.find(ne=>ne.id===U);H&&i("select",H.node),e.nextTick(()=>{const ne=document.querySelector(`[data-outline-id="${U}"]`);ne==null||ne.scrollIntoView({block:"nearest",behavior:"smooth"})})}function A(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var S;return(S=c.value)==null?void 0:S.focus()})});const y=e.ref(null),k=e.ref("");let m=null;function P(S){n.readonly||(y.value=S.id,k.value=S.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function G(){y.value!=null&&(i("edit",{id:y.value,text:k.value.trim()||"(无标题)"}),Y())}function Y(){y.value=null,k.value="",m=null}function N(S){S.key==="Enter"?(S.preventDefault(),G()):S.key==="Escape"&&(S.preventDefault(),Y())}e.onBeforeUnmount(Y);const re=e.ref(null),pe=e.ref(null),de=e.ref(null);function xe(S,U){if(n.readonly){S.preventDefault();return}re.value={id:U.id,text:U.text},S.dataTransfer&&(S.dataTransfer.effectAllowed="move",S.dataTransfer.setData("text/plain",U.id))}function ee(){re.value=null,pe.value=null,de.value=null}function ce(S,U){if(!re.value)return;S.preventDefault(),S.dataTransfer&&(S.dataTransfer.dropEffect="move");const H=V(S);pe.value=U.id,de.value=H}function ue(S){pe.value===S.id&&(pe.value=null,de.value=null)}function g(S,U){S.preventDefault();const H=re.value;if(!H)return;const ne=V(S);H.id!==U.id&&i("move",{srcId:H.id,targetId:U.id,position:ne}),ee()}function V(S,U){const ne=S.currentTarget.getBoundingClientRect(),ye=S.clientY-ne.top,Qe=ne.height;return ye<Qe*.3?"before":ye>Qe*.7?"after":"child"}const W=e.ref(null);let te=null;async function fe(S){try{return await navigator.clipboard.writeText(S),!0}catch{const U=document.createElement("textarea");U.value=S,document.body.appendChild(U),U.select();let H=!1;try{H=document.execCommand("copy")}finally{document.body.removeChild(U)}return H}}async function L(S,U,H){S.stopPropagation(),await fe(U)&&(W.value=H,te&&clearTimeout(te),te=setTimeout(()=>W.value=null,1200))}const O=e.computed(()=>{const S=[],U=(H,ne)=>{const ye=" ".repeat(ne),Qe=ne===0?"":"- ";S.push(ye+Qe+(H.text||""));for(const ut of H.children)U(ut,ne+1)};return U(n.data,0),S.join(`
16
+ `)}),ae=e.ref(!1);let ke=null;async function B(){await fe(O.value)&&(ae.value=!0,ke&&clearTimeout(ke),ke=setTimeout(()=>ae.value=!1,1200))}return(S,U)=>(e.openBlock(),e.createElementBlock("div",As,[e.createElementVNode("div",_s,[U[3]||(U[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:c,"onUpdate:modelValue":U[0]||(U[0]=H=>a.value=H),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:C,onKeydown:F},null,544),[[e.vModelText,a.value]]),p.value.length>0?(e.openBlock(),e.createElementBlock("span",Rs,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(p.value.length),1)):h.value?(e.openBlock(),e.createElementBlock("span",vs,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:A},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":ae.value}]),title:"复制完整大纲为纯文本",onClick:B},[(e.openBlock(),e.createElementBlock("svg",zs,[ae.value?(e.openBlock(),e.createElementBlock("path",Os)):(e.openBlock(),e.createElementBlock("rect",Is)),U[4]||(U[4]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(ae.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,H=>(e.openBlock(),e.createElementBlock("li",{key:H.id,"data-outline-id":H.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":H.id===t.selectedId,"is-root":H.depth===0,"is-editing":y.value===H.id,"is-search-hit":u.value.has(H.id),"is-search-current":p.value[s.value]===H.id,"is-drag-over-before":pe.value===H.id&&de.value==="before","is-drag-over-after":pe.value===H.id&&de.value==="after","is-drag-over-child":pe.value===H.id&&de.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+H.depth*16+"px"}),draggable:"true",onClick:ne=>i("select",H.node),onDblclick:ne=>P(H),onDragstart:ne=>xe(ne,H),onDragend:ee,onDragover:ne=>ce(ne,H),onDragleave:()=>ue(H),onDrop:ne=>g(ne,H)},[H.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:H.collapsed?"展开":"折叠",onClick:e.withModifiers(ne=>i("toggleCollapse",H.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",$s,[H.collapsed?(e.openBlock(),e.createElementBlock("polyline",Fs)):(e.openBlock(),e.createElementBlock("polyline",Ps))]))],8,Vs)):(e.openBlock(),e.createElementBlock("span",Us)),n.showIndex?(e.openBlock(),e.createElementBlock("span",Hs,e.toDisplayString(H.siblingIndex+1)+".",1)):e.createCommentVNode("",!0),y.value===H.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,"onUpdate:modelValue":U[1]||(U[1]=ne=>k.value=ne),class:"zm-outline-input",onBlur:G,onKeydown:N,onClick:U[2]||(U[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Ws,e.toDisplayString(H.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(ne=>i("addSibling",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(sr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,js)],8,Gs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(ne=>i("addChild",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(cr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Ys)],8,Ks)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":W.value===H.id}]),title:W.value===H.id?"已复制":"复制节点文本",onClick:ne=>L(ne,H.text,H.id)},[(e.openBlock(),e.createElementBlock("svg",Xs,[W.value!==H.id?(e.openBlock(),e.createElementBlock("rect",Zs)):(e.openBlock(),e.createElementBlock("path",Js)),U[5]||(U[5]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,qs)],46,Ds))),128))])]))}}),Qs={key:0,class:"zm-jtv-root"},ec={key:0,class:"zm-jtv-key"},tc={key:1,class:"zm-jtv-colon"},nc={key:2,class:"zm-jtv-key zm-jtv-bracket"},oc={key:3,class:"zm-jtv-size"},ic={key:4,class:"zm-jtv-bracket"},rc={key:5,class:"zm-jtv-brace"},lc={key:0,class:"zm-jtv-children"},ac={class:"zm-jtv-key"},sc={key:0,class:"zm-jtv-key"},cc=["src","alt"],dc=["href"],uc=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),i=e.computed(()=>n.value==="object"),a=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!a.value);const c=e.computed(()=>{if(a.value)return`Array(${o.value.length})`;if(i.value){const y=o.value,k=Object.keys(y);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),s=e.computed(()=>a.value?o.value.map((y,k)=>({key:String(k),value:y})):i.value?Object.entries(o.value).map(([y,k])=>({key:y,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function p(y,k,m){y!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(y)||o.collapsedPaths.add(y))}o.isRoot||p(u.value,o.value,o.depth);function h(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function x(y){return u.value===""?y:`${u.value}.${y}`}function C(y){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof y=="string"?y.toLowerCase().includes(k):y===null?"null".includes(k):String(y).toLowerCase().includes(k)}function $(y){return o.query?y.toLowerCase().includes(o.query.toLowerCase()):!0}function R(y,k){return!o.query||$(y)?!0:k===null||typeof k!="object"?C(k):!0}function F(y){return y===null?"null":typeof y=="string"?y.length>80?`"${y.slice(0,80)}..."`:`"${y}"`:typeof y=="boolean"?y?"true":"false":typeof y=="number"?String(y):typeof y>"u"?"undefined":JSON.stringify(y)}function I(y){if(typeof y!="string")return!1;const k=y.trim();return!!(k.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k)||/^https?:\/\/.+/i.test(k)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k))}function A(y){if(!o.query)return null;const k=y.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:y.slice(0,k),match:y.slice(k,k+o.query.length),after:y.slice(k+o.query.length)}}return(y,k)=>{var P,G,Y,N,re,pe;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,de=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:de.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":de.key,value:de.value,path:x(de.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(de.key,de.value)]])),128))])):i.value||a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:h},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ec,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",tc,":")),a.value?(e.openBlock(),e.createElementBlock("span",nc,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",oc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",ic,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",rc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,de=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:de.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":de.key,value:de.value,path:x(de.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(de.key,de.value)]])),128))])),!d.value&&a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&i.value&&!a.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[k[2]||(k[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",ac,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),$(t.keyName)&&A(t.keyName)?(e.openBlock(),e.createElementBlock("span",sc,[e.createElementVNode("span",null,e.toDisplayString((P=A(t.keyName))==null?void 0:P.before),1),e.createElementVNode("mark",null,e.toDisplayString((G=A(t.keyName))==null?void 0:G.match),1),e.createElementVNode("span",null,e.toDisplayString((Y=A(t.keyName))==null?void 0:Y.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[A(F(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((N=A(F(t.value)))==null?void 0:N.before),1),e.createElementVNode("mark",null,e.toDisplayString((re=A(F(t.value)))==null?void 0:re.match),1),e.createElementVNode("span",null,e.toDisplayString((pe=A(F(t.value)))==null?void 0:pe.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(F(t.value)),1)],64))],2),I(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,cc),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:k[0]||(k[0]=e.withModifiers(()=>{},["stop"]))},"open",8,dc)])):e.createCommentVNode("",!0)],4))}}}),fc={class:"zm-data-panel"},mc={class:"zm-data-header"},pc={class:"zm-data-title"},hc={class:"zm-data-title-meta"},gc={class:"zm-data-toolbar"},bc=["title"],kc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},yc={key:1,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},Ec={key:0,class:"zm-data-paste"},xc={class:"zm-data-tabs"},wc=["placeholder"],Nc={key:0,class:"zm-data-error"},Sc={class:"zm-data-paste-actions"},Tc=["disabled"],Cc={class:"zm-data-tree"},Do=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>JSON.stringify(n.data,null,2)),c=e.ref(""),s=e.ref(null),u=e.ref(!1),d=e.ref("json"),p=e.ref("idle"),h=e.ref(new Set),x=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,i("consumed-mode"))},{immediate:!0});async function C(){try{await navigator.clipboard.writeText(a.value),p.value="copied",setTimeout(()=>p.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=a.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),p.value="copied",setTimeout(()=>p.value="idle",1500)}finally{document.body.removeChild(k)}}}function $(){const k=new Blob([a.value],{type:"application/json"}),m=URL.createObjectURL(k),P=document.createElement("a");P.href=m,P.download=`${n.data.text||"mindmap"}.json`,P.click(),URL.revokeObjectURL(m)}function R(){s.value=null;const k=c.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=On(k);i("import",m),c.value="",u.value=!1}catch(m){s.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){s.value="JSON 缺少 id 或 children 字段";return}i("import",m),c.value="",u.value=!1}catch(m){s.value="JSON 解析失败:"+m.message}}}function F(k){return 1+k.children.reduce((m,P)=>m+F(P),0)}const I=e.computed(()=>F(n.data)),A=e.computed(()=>a.value.length);function y(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var G;const m=(G=k.files)==null?void 0:G[0];if(!m)return;const P=new FileReader;P.onload=()=>{typeof P.result=="string"&&(c.value=P.result,R())},P.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",fc,[e.createElementVNode("div",mc,[e.createElementVNode("div",pc,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",hc,e.toDisplayString(I.value)+" 节点 · "+e.toDisplayString(A.value)+" chars",1)])]),e.createElementVNode("div",gc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":p.value==="copied"}]),title:p.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:C},[p.value==="idle"?(e.openBlock(),e.createElementBlock("svg",kc,[...m[9]||(m[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",yc,[...m[10]||(m[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),m[11]||(m[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,bc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:$},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:y},[...m[13]||(m[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:m[0]||(m[0]=P=>u.value=!u.value)},[...m[14]||(m[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),m[16]||(m[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":x.value.length>0}])},[m[15]||(m[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[1]||(m[1]=P=>x.value=P),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,x.value]]),x.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=P=>x.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",Ec,[e.createElementVNode("div",xc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=P=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=P=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=P=>c.value=P),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,wc),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",Nc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Sc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:R},"应用",8,Tc),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=P=>{c.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=P=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",Cc,[e.createVNode(uc,{value:t.data,query:x.value,"collapsed-paths":h.value},null,8,["value","query","collapsed-paths"])]),m[17]||(m[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),Mc={class:"zm-md-panel"},Ac={key:0,class:"zm-md-error"},_c={class:"zm-md-split"},Rc={class:"zm-md-edit"},vc={class:"zm-md-preview"},Bc={class:"zm-md-preview-body"},zc={class:"zm-md-footer"},Ic=["disabled"],Oc=`# flow-mindmap 思维导图
17
17
 
18
18
  [GitHub 仓库](https://github.com/xz333221/flow-mindmap)
19
19
 
@@ -52,67 +52,67 @@
52
52
 
53
53
  ## 开源协议
54
54
  [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
55
- `,Do=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(On(n.data)),c=e.ref(null),s=e.ref(null),f=e.computed(()=>{try{const R=In(a.value||"");return c.value=null,R}catch(R){return c.value=R.message,{id:"preview_fallback",text:a.value||"(空)",children:[]}}}),d=e.computed(()=>zt(f.value));let p=null;e.watch(a,()=>{p&&clearTimeout(p),p=setTimeout(()=>{var R;return(R=s.value)==null?void 0:R.resetView()},250)});function h(){try{const R=In(a.value||"");c.value=null,i("import",R)}catch(R){c.value=R.message}}function y(){a.value=On(n.data),c.value=null,e.nextTick(()=>{var R;return(R=s.value)==null?void 0:R.resetView()})}function C(){a.value="",c.value=null,e.nextTick(()=>{var R;return(R=s.value)==null?void 0:R.resetView()})}function D(){const R=document.createElement("input");R.type="file",R.accept=".md,text/markdown,text/plain",R.onchange=()=>{var u;const M=(u=R.files)==null?void 0:u[0];if(!M)return;const k=new FileReader;k.onload=()=>{typeof k.result=="string"&&(a.value=k.result,c.value=null,e.nextTick(()=>{var N;return(N=s.value)==null?void 0:N.resetView()}))},k.readAsText(M)},R.click()}function _(){const R=new Blob([a.value],{type:"text/markdown;charset=utf-8"}),M=URL.createObjectURL(R),k=document.createElement("a");k.href=M;const u=(n.data.text||"mindmap").trim()||"mindmap";k.download=`${u}.md`,k.click(),URL.revokeObjectURL(M)}function F(){a.value=Bc,c.value=null,e.nextTick(()=>{var R;return(R=s.value)==null?void 0:R.resetView()})}return(R,M)=>(e.openBlock(),e.createElementBlock("div",Nc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:D},[...M[1]||(M[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 4 V15"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"加载 .md",-1)])]),e.createElementVNode("button",{class:"zm-md-btn",title:"把当前导图导出为 .md",onClick:_},[...M[2]||(M[2]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 15 V4"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"导出 .md",-1)])]),M[3]||(M[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:F},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:y},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:C},"清空")]),c.value?(e.openBlock(),e.createElementBlock("div",Sc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Tc,[e.createElementVNode("div",Cc,[M[4]||(M[4]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"Markdown"),e.createElementVNode("span",{class:"zm-md-hint"},"# 根 · ## 一级 · ### 二级 …")],-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":M[0]||(M[0]=k=>a.value=k),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("div",Mc,[M[5]||(M[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Ac,[e.createVNode(Qo,{ref_key:"previewRef",ref:s,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",_c,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!a.value.trim(),onClick:h},"应用到导图",8,Rc)])]))}}),vc={class:"zm-settings-panel"},zc={class:"zm-settings-section"},Ic={class:"zm-settings-field"},Oc={class:"zm-settings-control"},Lc={class:"zm-color-input-wrap"},Dc=["value"],Vc={class:"zm-color-input-text"},$c={class:"zm-swatch-row zm-swatch-row--compact"},Pc=["title","onClick"],Fc={class:"zm-settings-field"},Uc=["value"],Hc={class:"zm-slider"},Wc=["value"],Gc={class:"zm-settings-field"},jc=["value"],Kc={class:"zm-slider"},Yc=["value"],qc={class:"zm-settings-field zm-line-style-field"},Xc={class:"zm-line-style-group"},Zc=["title","onClick"],Jc=["viewBox"],Qc={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ed={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},td={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},nd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},od={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},id={class:"zm-line-style-label"},rd={class:"zm-settings-field zm-line-style-field"},ld={class:"zm-line-style-group"},ad=["title","onClick"],sd=["viewBox"],cd={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},dd={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},ud={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},fd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},md={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},pd={class:"zm-line-style-label"},hd={key:0,class:"zm-settings-field"},gd={class:"zm-settings-label"},bd={class:"zm-settings-sub"},kd=["value"],yd={key:1,class:"zm-slider"},Ed=["value"],xd={class:"zm-settings-field zm-line-style-field"},wd={class:"zm-line-style-group"},Nd=["title","onClick"],Sd={viewBox:"0 0 28 18",width:"28",height:"18",preserveAspectRatio:"none"},Td={key:0,d:"M 8 9 L 0 9 M 20 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},Cd={key:1,d:"M 14 9 L 0 9 M 14 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},Md={key:2,d:"M 8 7 L 0 4 M 8 9 L 0 9 M 8 11 L 0 14 M 20 7 L 28 4 M 20 9 L 28 9 M 20 11 L 28 14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},Ad={class:"zm-line-style-label"},_d={class:"zm-settings-field"},Rd={key:2,class:"zm-palette-picker"},Bd={class:"zm-palette-list"},vd=["onClick"],zd={class:"zm-palette-option-name"},Id={class:"zm-palette-option-swatches"},Od={key:0,class:"zm-palette-custom-editor"},Ld=["value"],Dd={class:"zm-palette-custom-actions"},Vd={class:"zm-settings-field"},$d={key:3,class:"zm-settings-field"},Pd={class:"zm-settings-label"},Fd={class:"zm-settings-sub"},Ud=["value"],Hd={key:4,class:"zm-slider"},Wd=["value"],Gd={class:"zm-settings-field"},jd={class:"zm-settings-preview"},Kd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Yd=["x1","y1","x2","y2","stroke","stroke-width"],qd={key:0,class:"zm-settings-section"},Xd={class:"zm-settings-section-title"},Zd={key:0,class:"zm-settings-section-sub"},Jd={class:"zm-settings-field"},Qd={class:"zm-settings-value-tag"},eu={class:"zm-swatch-row"},tu=["title","onClick"],nu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},ou=["value"],iu={class:"zm-settings-field"},ru={class:"zm-settings-value-tag"},lu={class:"zm-swatch-row"},au=["title","onClick"],su={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},cu=["value"],du={class:"zm-settings-field"},uu=["value"],fu=["value"],mu={class:"zm-settings-field"},pu=["value"],hu={class:"zm-slider"},gu=["value"],bu={class:"zm-settings-section zm-settings-section--actions"},Vo=((t,o)=>{const n=t.__vccOpts||t;for(const[i,a]of o)n[i]=a;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{},nodeStyle:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,i=o;function a(q,x){i("update:settings",{[q]:x})}const c=[{value:"arc",label:"圆弧",viewBox:"0 0 28 14"},{value:"rounded-elbow",label:"圆角折线",viewBox:"0 0 28 14"},{value:"elbow",label:"折线",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"},{value:"curve",label:"S曲线",viewBox:"0 0 28 14"}],s=c,f=[{value:"edge",label:"左右中点"},{value:"center",label:"节点正中心"},{value:"proportional",label:"按比例计算"}],d=[{value:100,label:"100"},{value:200,label:"200"},{value:300,label:"300"},{value:400,label:"400 (常规)"},{value:500,label:"500"},{value:600,label:"600 (半粗)"},{value:700,label:"700 (粗体)"},{value:800,label:"800"},{value:900,label:"900"}];function p(q){i("update:nodeStyle",q)}const h=e.computed(()=>[...cn,...n.settings.customPalettes]),y=e.reactive({});function C(q){return y[q.id]===void 0&&(y[q.id]=q.colors.join(`
56
- `)),y[q.id]}function D(q){const x=y[q.id]??"",ae=Ua(x);if(ae.length===0){y[q.id]=q.colors.join(`
57
- `);return}const fe=n.settings.customPalettes.map(me=>me.id===q.id?{...me,colors:ae}:me);i("update:settings",{customPalettes:fe})}function _(){const q=h.value.find(J=>J.id===n.settings.branchPaletteId),x=q?[...q.colors]:[...cn[0].colors],ae="custom-";let fe=ae+(n.settings.customPalettes.length+1);for(;cn.some(J=>J.id===fe)||n.settings.customPalettes.some(J=>J.id===fe);)fe=ae+Math.random().toString(36).slice(2,7);const me={id:fe,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:x};i("update:settings",{customPalettes:[...n.settings.customPalettes,me],branchPaletteId:fe}),y[fe]=x.join(`
58
- `)}function F(q){const x=n.settings.customPalettes.filter(fe=>fe.id!==q.id),ae=n.settings.branchPaletteId===q.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:x,...ae!==n.settings.branchPaletteId?{branchPaletteId:ae}:{}}),delete y[q.id]}const R=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],M=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],k=[0,1,2,3],u=["#f87171","#fb923c","#34d399","#818cf8"];function N(q,x,ae,fe){if(x<=1)return ae;const me=q/(x-1);return ae+(fe-ae)*me}function $(q,x,ae,fe){const me=x*Math.pow(fe,q);return Math.max(ae,me)}const j=e.computed(()=>{const q=n.settings.lineWidthStart,x=n.settings.lineWidthEnd,ae=n.settings.taperedEdge,fe=k.length,me=8,J=192,ge=h.value.find(ye=>ye.id===n.settings.branchPaletteId),de=ge&&ge.colors.length?ge.colors:u;return k.map((ye,b)=>{const L=10+b*60/(fe-1);return{x1:me,y1:L,x2:J,y2:L,w:ae?$(ye,q,x,n.settings.lineWidthTaper):N(ye,fe,q,x),color:n.settings.rainbowBranch?de[b%de.length]:"#94a3b8"}})});return(q,x)=>{var ae,fe,me,J,ge,de,ye;return e.openBlock(),e.createElementBlock("div",vc,[e.createElementVNode("section",zc,[x[45]||(x[45]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Ic,[x[24]||(x[24]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Oc,[e.createElementVNode("label",Lc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:x[0]||(x[0]=b=>a("canvasBg",b.target.value))},null,40,Dc),e.createElementVNode("span",Vc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",$c,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(M,b=>e.createElementVNode("button",{key:"cbg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:L=>a("canvasBg",b)},null,14,Pc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:x[1]||(x[1]=b=>a("canvasBg",void 0))},"∅")]),x[46]||(x[46]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Fc,[x[25]||(x[25]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端 (根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:x[2]||(x[2]=b=>a("lineWidthStart",parseFloat(b.target.value)||0))},null,40,Uc)]),e.createElementVNode("div",Hc,[x[26]||(x[26]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:x[3]||(x[3]=b=>a("lineWidthStart",parseFloat(b.target.value)))},null,40,Wc)]),e.createElementVNode("div",Gc,[x[27]||(x[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端 (子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:x[4]||(x[4]=b=>a("lineWidthEnd",parseFloat(b.target.value)||0))},null,40,jc)]),e.createElementVNode("div",Kc,[x[28]||(x[28]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:x[5]||(x[5]=b=>a("lineWidthEnd",parseFloat(b.target.value)))},null,40,Yc)]),x[47]||(x[47]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",qc,[x[29]||(x[29]=e.createElementVNode("span",{class:"zm-settings-label"},"根节点线条",-1)),e.createElementVNode("div",Xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),b=>(e.openBlock(),e.createElementBlock("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.rootLineStyle===b.value}]),title:b.label,onClick:L=>a("rootLineStyle",b.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:b.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[b.value==="arc"?(e.openBlock(),e.createElementBlock("path",Qc)):b.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",ed)):b.value==="elbow"?(e.openBlock(),e.createElementBlock("path",td)):b.value==="curve"?(e.openBlock(),e.createElementBlock("path",nd)):(e.openBlock(),e.createElementBlock("line",od))],8,Jc)),e.createElementVNode("span",id,e.toDisplayString(b.label),1)],10,Zc))),128))])]),e.createElementVNode("div",rd,[x[30]||(x[30]=e.createElementVNode("span",{class:"zm-settings-label"},"其他节点线条",-1)),e.createElementVNode("div",ld,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,b=>e.createElementVNode("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===b.value}]),title:b.label,onClick:L=>a("lineStyle",b.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:b.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[b.value==="arc"?(e.openBlock(),e.createElementBlock("path",cd)):b.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",dd)):b.value==="elbow"?(e.openBlock(),e.createElementBlock("path",ud)):b.value==="curve"?(e.openBlock(),e.createElementBlock("path",fd)):(e.openBlock(),e.createElementBlock("line",md))],8,sd)),e.createElementVNode("span",pd,e.toDisplayString(b.label),1)],10,ad)),64))])]),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",hd,[e.createElementVNode("span",gd,[x[31]||(x[31]=e.createTextVNode("圆角大小 ",-1)),e.createElementVNode("span",bd,e.toDisplayString(t.settings.elbowRadius)+"px",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"2",max:"20",value:t.settings.elbowRadius,onChange:x[6]||(x[6]=b=>a("elbowRadius",parseFloat(b.target.value)||8))},null,40,kd)])):e.createCommentVNode("",!0),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",yd,[x[32]||(x[32]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"2",max:"20",step:"1",value:t.settings.elbowRadius,onInput:x[7]||(x[7]=b=>a("elbowRadius",parseFloat(b.target.value)))},null,40,Ed)])):e.createCommentVNode("",!0),e.createElementVNode("div",xd,[x[34]||(x[34]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",wd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(f,b=>e.createElementVNode("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===b.value}]),title:b.label,onClick:L=>a("lineOrigin",b.value)},[(e.openBlock(),e.createElementBlock("svg",Sd,[x[33]||(x[33]=e.createElementVNode("rect",{x:"8",y:"6",width:"12",height:"6",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.2",opacity:"0.5"},null,-1)),b.value==="edge"?(e.openBlock(),e.createElementBlock("path",Td)):b.value==="center"?(e.openBlock(),e.createElementBlock("path",Cd)):(e.openBlock(),e.createElementBlock("path",Md))])),e.createElementVNode("span",Ad,e.toDisplayString(b.label),1)],10,Nd)),64))])]),e.createElementVNode("div",_d,[x[36]||(x[36]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:x[8]||(x[8]=b=>a("rainbowBranch",!t.settings.rainbowBranch))},[...x[35]||(x[35]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Rd,[x[37]||(x[37]=e.createElementVNode("div",{class:"zm-settings-field"},[e.createElementVNode("span",{class:"zm-settings-label"},"配色方案")],-1)),e.createElementVNode("div",Bd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,b=>(e.openBlock(),e.createElementBlock("button",{key:b.id,class:e.normalizeClass(["zm-palette-option",{"is-active":t.settings.branchPaletteId===b.id}]),onClick:L=>a("branchPaletteId",b.id)},[e.createElementVNode("span",zd,e.toDisplayString(b.name),1),e.createElementVNode("span",Id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.colors,(L,G)=>(e.openBlock(),e.createElementBlock("span",{key:G,class:"zm-palette-option-swatch",style:e.normalizeStyle({background:L})},null,4))),128))])],10,vd))),128))]),t.settings.customPalettes.find(b=>b.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Od,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:C(t.settings.customPalettes.find(b=>b.id===t.settings.branchPaletteId)),onInput:x[9]||(x[9]=b=>y[t.settings.customPalettes.find(L=>L.id===t.settings.branchPaletteId).id]=b.target.value)},null,40,Ld),e.createElementVNode("div",Dd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:x[10]||(x[10]=b=>D(t.settings.customPalettes.find(L=>L.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:x[11]||(x[11]=b=>F(t.settings.customPalettes.find(L=>L.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:_},"+ 新建配色")])):e.createCommentVNode("",!0),x[48]||(x[48]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Vd,[x[39]||(x[39]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:x[12]||(x[12]=b=>a("taperedEdge",!t.settings.taperedEdge))},[...x[38]||(x[38]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",$d,[e.createElementVNode("span",Pd,[x[40]||(x[40]=e.createTextVNode("层级衰减 ",-1)),e.createElementVNode("span",Fd,e.toDisplayString(Math.round(t.settings.lineWidthTaper*100))+"%",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.05",min:"0.3",max:"1",value:t.settings.lineWidthTaper,onChange:x[13]||(x[13]=b=>a("lineWidthTaper",parseFloat(b.target.value)||.67))},null,40,Ud)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Hd,[x[41]||(x[41]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.3",max:"1",step:"0.01",value:t.settings.lineWidthTaper,onInput:x[14]||(x[14]=b=>a("lineWidthTaper",parseFloat(b.target.value)))},null,40,Wd)])):e.createCommentVNode("",!0),e.createElementVNode("div",Gd,[x[43]||(x[43]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:x[15]||(x[15]=b=>a("showOrderBadge",!t.settings.showOrderBadge))},[...x[42]||(x[42]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",jd,[(e.openBlock(),e.createElementBlock("svg",Kd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(b,L)=>(e.openBlock(),e.createElementBlock("line",{key:L,x1:b.x1,y1:b.y1,x2:b.x2,y2:b.y2,stroke:t.settings.rainbowBranch?b.color:"#94a3b8","stroke-width":b.w,"stroke-linecap":"butt"},null,8,Yd))),128))])),x[44]||(x[44]=e.createElementVNode("div",{class:"zm-settings-preview-labels"},[e.createElementVNode("span",null,"根"),e.createElementVNode("span",null,"1级"),e.createElementVNode("span",null,"2级"),e.createElementVNode("span",null,"3级")],-1))])]),t.hasSelection?(e.openBlock(),e.createElementBlock("section",qd,[e.createElementVNode("h4",Xd,[x[49]||(x[49]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Zd,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Jd,[x[50]||(x[50]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",Qd,e.toDisplayString(((ae=t.nodeStyle)==null?void 0:ae.bg)||"默认"),1)]),e.createElementVNode("div",eu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(R,b=>{var L;return e.createElementVNode("button",{key:"bg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":((L=t.nodeStyle)==null?void 0:L.bg)===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:G=>p({bg:b})},null,14,tu)}),64)),e.createElementVNode("label",nu,[e.createElementVNode("input",{type:"color",value:((fe=t.nodeStyle)==null?void 0:fe.bg)||"#ffffff",onInput:x[16]||(x[16]=b=>p({bg:b.target.value}))},null,40,ou)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[17]||(x[17]=b=>p({bg:void 0}))},"∅")]),e.createElementVNode("div",iu,[x[51]||(x[51]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",ru,e.toDisplayString(((me=t.nodeStyle)==null?void 0:me.textColor)||"默认"),1)]),e.createElementVNode("div",lu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(R,b=>{var L;return e.createElementVNode("button",{key:"fg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":((L=t.nodeStyle)==null?void 0:L.textColor)===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:G=>p({textColor:b})},null,14,au)}),64)),e.createElementVNode("label",su,[e.createElementVNode("input",{type:"color",value:((J=t.nodeStyle)==null?void 0:J.textColor)||"#1e2937",onInput:x[18]||(x[18]=b=>p({textColor:b.target.value}))},null,40,cu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[19]||(x[19]=b=>p({textColor:void 0}))},"∅")]),x[55]||(x[55]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",du,[x[52]||(x[52]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((ge=t.nodeStyle)==null?void 0:ge.fontWeight)??400,onChange:x[20]||(x[20]=b=>p({fontWeight:parseInt(b.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,b=>e.createElementVNode("option",{key:b.value,value:b.value},e.toDisplayString(b.label),9,fu)),64))],40,uu)]),e.createElementVNode("div",mu,[x[53]||(x[53]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((de=t.nodeStyle)==null?void 0:de.fontSize)??14,onChange:x[21]||(x[21]=b=>p({fontSize:parseInt(b.target.value)||14}))},null,40,pu)]),e.createElementVNode("div",hu,[x[54]||(x[54]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ye=t.nodeStyle)==null?void 0:ye.fontSize)??14,onInput:x[22]||(x[22]=b=>p({fontSize:parseInt(b.target.value)}))},null,40,gu)]),x[56]||(x[56]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",bu,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:x[23]||(x[23]=b=>i("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-f1937c03"]]),Nr=20;function ku(t,o){t.style.height="auto";const n=o.minRows*Nr,i=o.maxRows>0?o.maxRows*Nr:1/0,a=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=a+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function gi(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const c=t.value;c&&ku(c,n)}function a(){i()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",a),i())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>i()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",a)})}function yu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Sr(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(o=>{const n=t[o],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Sr(n)}),t}class Tr{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Cr(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function dn(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const a in i)n[a]=i[a]}),n}const Eu="</span>",Mr=t=>!!t.scope,xu=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((i,a)=>`${i}${"_".repeat(a+1)}`)].join(" ")}return`${o}${t}`};class wu{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Cr(o)}openNode(o){if(!Mr(o))return;const n=xu(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Mr(o)&&(this.buffer+=Eu)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ar=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class bi{constructor(){this.rootNode=Ar(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(o){this.top.children.push(o)}openNode(o){const n=Ar({scope:o});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,n){return typeof n=="string"?o.addText(n):n.children&&(o.openNode(n),n.children.forEach(i=>this._walk(o,i)),o.closeNode(n)),o}static _collapse(o){typeof o!="string"&&o.children&&(o.children.every(n=>typeof n=="string")?o.children=[o.children.join("")]:o.children.forEach(n=>{bi._collapse(n)}))}}class Nu extends bi{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const i=o.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new wu(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ro(t){return t?typeof t=="string"?t:t.source:null}function _r(t){return xn("(?=",t,")")}function Su(t){return xn("(?:",t,")*")}function Tu(t){return xn("(?:",t,")?")}function xn(...t){return t.map(n=>ro(n)).join("")}function Cu(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function ki(...t){return"("+(Cu(t).capture?"":"?:")+t.map(i=>ro(i)).join("|")+")"}function Rr(t){return new RegExp(t.toString()+"|").exec("").length-1}function Mu(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Au=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function yi(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const a=n;let c=ro(i),s="";for(;c.length>0;){const f=Au.exec(c);if(!f){s+=c;break}s+=c.substring(0,f.index),c=c.substring(f.index+f[0].length),f[0][0]==="\\"&&f[1]?s+="\\"+String(Number(f[1])+a):(s+=f[0],f[0]==="("&&n++)}return s}).map(i=>`(${i})`).join(o)}const _u=/\b\B/,Br="[a-zA-Z]\\w*",Ei="[a-zA-Z_]\\w*",vr="\\b\\d+(\\.\\d+)?",zr="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ir="\\b(0b[01]+)",Ru="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Bu=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=xn(o,/.*\b/,t.binary,/\b.*/)),dn({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},lo={begin:"\\\\[\\s\\S]",relevance:0},vu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[lo]},zu={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[lo]},Iu={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},$o=function(t,o,n={}){const i=dn({scope:"comment",begin:t,end:o,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=ki("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:xn(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},Ou=$o("//","$"),Lu=$o("/\\*","\\*/"),Du=$o("#","$"),Vu={scope:"number",begin:vr,relevance:0},$u={scope:"number",begin:zr,relevance:0},Pu={scope:"number",begin:Ir,relevance:0},Fu={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[lo,{begin:/\[/,end:/\]/,relevance:0,contains:[lo]}]},Uu={scope:"title",begin:Br,relevance:0},Hu={scope:"title",begin:Ei,relevance:0},Wu={begin:"\\.\\s*"+Ei,relevance:0};var Po=Object.freeze({__proto__:null,APOS_STRING_MODE:vu,BACKSLASH_ESCAPE:lo,BINARY_NUMBER_MODE:Pu,BINARY_NUMBER_RE:Ir,COMMENT:$o,C_BLOCK_COMMENT_MODE:Lu,C_LINE_COMMENT_MODE:Ou,C_NUMBER_MODE:$u,C_NUMBER_RE:zr,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(o,n)=>{n.data._beginMatch=o[1]},"on:end":(o,n)=>{n.data._beginMatch!==o[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:Du,IDENT_RE:Br,MATCH_NOTHING_RE:_u,METHOD_GUARD:Wu,NUMBER_MODE:Vu,NUMBER_RE:vr,PHRASAL_WORDS_MODE:Iu,QUOTE_STRING_MODE:zu,REGEXP_MODE:Fu,RE_STARTERS_RE:Ru,SHEBANG:Bu,TITLE_MODE:Uu,UNDERSCORE_IDENT_RE:Ei,UNDERSCORE_TITLE_MODE:Hu});function Gu(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function ju(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Ku(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Gu,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Yu(t,o){Array.isArray(t.illegal)&&(t.illegal=ki(...t.illegal))}function qu(t,o){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function Xu(t,o){t.relevance===void 0&&(t.relevance=1)}const Zu=(t,o)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(i=>{delete t[i]}),t.keywords=n.keywords,t.begin=xn(n.beforeMatch,_r(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Ju=["of","and","for","in","not","or","if","then","parent","list","value"],Qu="keyword";function Or(t,o,n=Qu){const i=Object.create(null);return typeof t=="string"?a(n,t.split(" ")):Array.isArray(t)?a(n,t):Object.keys(t).forEach(function(c){Object.assign(i,Or(t[c],o,c))}),i;function a(c,s){o&&(s=s.map(f=>f.toLowerCase())),s.forEach(function(f){const d=f.split("|");i[d[0]]=[c,ef(d[0],d[1])]})}}function ef(t,o){return o?Number(o):tf(t)?0:1}function tf(t){return Ju.includes(t.toLowerCase())}const Lr={},wn=t=>{console.error(t)},Dr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Ln=(t,o)=>{Lr[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Lr[`${t}/${o}`]=!0)},Fo=new Error;function Vr(t,o,{key:n}){let i=0;const a=t[n],c={},s={};for(let f=1;f<=o.length;f++)s[f+i]=a[f],c[f+i]=!0,i+=Rr(o[f-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function nf(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw wn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Fo;if(typeof t.beginScope!="object"||t.beginScope===null)throw wn("beginScope must be object"),Fo;Vr(t,t.begin,{key:"beginScope"}),t.begin=yi(t.begin,{joinWith:""})}}function of(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw wn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Fo;if(typeof t.endScope!="object"||t.endScope===null)throw wn("endScope must be object"),Fo;Vr(t,t.end,{key:"endScope"}),t.end=yi(t.end,{joinWith:""})}}function rf(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function lf(t){rf(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),nf(t),of(t)}function af(t){function o(s,f){return new RegExp(ro(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(f?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(f,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,f]),this.matchAt+=Rr(f)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const f=this.regexes.map(d=>d[1]);this.matcherRe=o(yi(f,{joinWith:"|"}),!0),this.lastIndex=0}exec(f){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(f);if(!d)return null;const p=d.findIndex((y,C)=>C>0&&y!==void 0),h=this.matchIndexes[p];return d.splice(0,p),Object.assign(d,h)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(f){if(this.multiRegexes[f])return this.multiRegexes[f];const d=new n;return this.rules.slice(f).forEach(([p,h])=>d.addRule(p,h)),d.compile(),this.multiRegexes[f]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(f,d){this.rules.push([f,d]),d.type==="begin"&&this.count++}exec(f){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let p=d.exec(f);if(this.resumingScanAtSamePosition()&&!(p&&p.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,p=h.exec(f)}return p&&(this.regexIndex+=p.position+1,this.regexIndex===this.count&&this.considerAll()),p}}function a(s){const f=new i;return s.contains.forEach(d=>f.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&f.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&f.addRule(s.illegal,{type:"illegal"}),f}function c(s,f){const d=s;if(s.isCompiled)return d;[ju,qu,lf,Zu].forEach(h=>h(s,f)),t.compilerExtensions.forEach(h=>h(s,f)),s.__beforeBegin=null,[Ku,Yu,Xu].forEach(h=>h(s,f)),s.isCompiled=!0;let p=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),p=s.keywords.$pattern,delete s.keywords.$pattern),p=p||/\w+/,s.keywords&&(s.keywords=Or(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(p,!0),f&&(s.begin||(s.begin=/\B|\b/),d.beginRe=o(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=o(d.end)),d.terminatorEnd=ro(d.end)||"",s.endsWithParent&&f.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+f.terminatorEnd)),s.illegal&&(d.illegalRe=o(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(h){return sf(h==="self"?s:h)})),s.contains.forEach(function(h){c(h,d)}),s.starts&&c(s.starts,f),d.matcher=a(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=dn(t.classNameAliases||{}),c(t)}function $r(t){return t?t.endsWithParent||$r(t.starts):!1}function sf(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return dn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:$r(t)?dn(t,{starts:t.starts?dn(t.starts):null}):Object.isFrozen(t)?dn(t):t}var cf="11.11.1";class df extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const xi=Cr,Pr=dn,Fr=Symbol("nomatch"),uf=7,Ur=function(t){const o=Object.create(null),n=Object.create(null),i=[];let a=!0;const c="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let f={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Nu};function d(b){return f.noHighlightRe.test(b)}function p(b){let L=b.className+" ";L+=b.parentNode?b.parentNode.className:"";const G=f.languageDetectRe.exec(L);if(G){const ee=x(G[1]);return ee||(Dr(c.replace("{}",G[1])),Dr("Falling back to no-highlight mode for this block.",b)),ee?G[1]:"no-highlight"}return L.split(/\s+/).find(ee=>d(ee)||x(ee))}function h(b,L,G){let ee="",be="";typeof L=="object"?(ee=b,G=L.ignoreIllegals,be=L.language):(Ln("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ln("10.7.0",`Please use highlight(code, options) instead.
59
- https://github.com/highlightjs/highlight.js/issues/2277`),be=b,ee=L),G===void 0&&(G=!0);const O={code:ee,language:be};de("before:highlight",O);const B=O.result?O.result:y(O.language,O.code,G);return B.code=O.code,de("after:highlight",B),B}function y(b,L,G,ee){const be=Object.create(null);function O(X,se){return X.keywords[se]}function B(){if(!ce.keywords){Ve.addText(Be);return}let X=0;ce.keywordPatternRe.lastIndex=0;let se=ce.keywordPatternRe.exec(Be),Ee="";for(;se;){Ee+=Be.substring(X,se.index);const Ae=Qe.case_insensitive?se[0].toLowerCase():se[0],He=O(ce,Ae);if(He){const[rt,yt]=He;if(Ve.addText(Ee),Ee="",be[Ae]=(be[Ae]||0)+1,be[Ae]<=uf&&(Lt+=yt),rt.startsWith("_"))Ee+=se[0];else{const _n=Qe.classNameAliases[rt]||rt;V(se[0],_n)}}else Ee+=se[0];X=ce.keywordPatternRe.lastIndex,se=ce.keywordPatternRe.exec(Be)}Ee+=Be.substring(X),Ve.addText(Ee)}function oe(){if(Be==="")return;let X=null;if(typeof ce.subLanguage=="string"){if(!o[ce.subLanguage]){Ve.addText(Be);return}X=y(ce.subLanguage,Be,!0,Ct[ce.subLanguage]),Ct[ce.subLanguage]=X._top}else X=D(Be,ce.subLanguage.length?ce.subLanguage:null);ce.relevance>0&&(Lt+=X.relevance),Ve.__addSublanguage(X._emitter,X.language)}function te(){ce.subLanguage!=null?oe():B(),Be=""}function V(X,se){X!==""&&(Ve.startScope(se),Ve.addText(X),Ve.endScope())}function w(X,se){let Ee=1;const Ae=se.length-1;for(;Ee<=Ae;){if(!X._emit[Ee]){Ee++;continue}const He=Qe.classNameAliases[X[Ee]]||X[Ee],rt=se[Ee];He?V(rt,He):(Be=rt,B(),Be=""),Ee++}}function P(X,se){return X.scope&&typeof X.scope=="string"&&Ve.openNode(Qe.classNameAliases[X.scope]||X.scope),X.beginScope&&(X.beginScope._wrap?(V(Be,Qe.classNameAliases[X.beginScope._wrap]||X.beginScope._wrap),Be=""):X.beginScope._multi&&(w(X.beginScope,se),Be="")),ce=Object.create(X,{parent:{value:ce}}),ce}function H(X,se,Ee){let Ae=Mu(X.endRe,Ee);if(Ae){if(X["on:end"]){const He=new Tr(X);X["on:end"](se,He),He.isMatchIgnored&&(Ae=!1)}if(Ae){for(;X.endsParent&&X.parent;)X=X.parent;return X}}if(X.endsWithParent)return H(X.parent,se,Ee)}function ie(X){return ce.matcher.regexIndex===0?(Be+=X[0],1):(Qt=!0,0)}function xe(X){const se=X[0],Ee=X.rule,Ae=new Tr(Ee),He=[Ee.__beforeBegin,Ee["on:begin"]];for(const rt of He)if(rt&&(rt(X,Ae),Ae.isMatchIgnored))return ie(se);return Ee.skip?Be+=se:(Ee.excludeBegin&&(Be+=se),te(),!Ee.returnBegin&&!Ee.excludeBegin&&(Be=se)),P(Ee,X),Ee.returnBegin?0:se.length}function Je(X){const se=X[0],Ee=L.substring(X.index),Ae=H(ce,X,Ee);if(!Ae)return Fr;const He=ce;ce.endScope&&ce.endScope._wrap?(te(),V(se,ce.endScope._wrap)):ce.endScope&&ce.endScope._multi?(te(),w(ce.endScope,X)):He.skip?Be+=se:(He.returnEnd||He.excludeEnd||(Be+=se),te(),He.excludeEnd&&(Be=se));do ce.scope&&Ve.closeNode(),!ce.skip&&!ce.subLanguage&&(Lt+=ce.relevance),ce=ce.parent;while(ce!==Ae.parent);return Ae.starts&&P(Ae.starts,X),He.returnEnd?0:se.length}function Tt(){const X=[];for(let se=ce;se!==Qe;se=se.parent)se.scope&&X.unshift(se.scope);X.forEach(se=>Ve.openNode(se))}let it={};function nn(X,se){const Ee=se&&se[0];if(Be+=X,Ee==null)return te(),0;if(it.type==="begin"&&se.type==="end"&&it.index===se.index&&Ee===""){if(Be+=L.slice(se.index,se.index+1),!a){const Ae=new Error(`0 width match regex (${b})`);throw Ae.languageName=b,Ae.badRule=it.rule,Ae}return 1}if(it=se,se.type==="begin")return xe(se);if(se.type==="illegal"&&!G){const Ae=new Error('Illegal lexeme "'+Ee+'" for mode "'+(ce.scope||"<unnamed>")+'"');throw Ae.mode=ce,Ae}else if(se.type==="end"){const Ae=Je(se);if(Ae!==Fr)return Ae}if(se.type==="illegal"&&Ee==="")return Be+=`
60
- `,1;if(gt>1e5&&gt>se.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Be+=Ee,Ee.length}const Qe=x(b);if(!Qe)throw wn(c.replace("{}",b)),new Error('Unknown language: "'+b+'"');const Zt=af(Qe);let Jt="",ce=ee||Zt;const Ct={},Ve=new f.__emitter(f);Tt();let Be="",Lt=0,tt=0,gt=0,Qt=!1;try{if(Qe.__emitTokens)Qe.__emitTokens(L,Ve);else{for(ce.matcher.considerAll();;){gt++,Qt?Qt=!1:ce.matcher.considerAll(),ce.matcher.lastIndex=tt;const X=ce.matcher.exec(L);if(!X)break;const se=L.substring(tt,X.index),Ee=nn(se,X);tt=X.index+Ee}nn(L.substring(tt))}return Ve.finalize(),Jt=Ve.toHTML(),{language:b,value:Jt,relevance:Lt,illegal:!1,_emitter:Ve,_top:ce}}catch(X){if(X.message&&X.message.includes("Illegal"))return{language:b,value:xi(L),illegal:!0,relevance:0,_illegalBy:{message:X.message,index:tt,context:L.slice(tt-100,tt+100),mode:X.mode,resultSoFar:Jt},_emitter:Ve};if(a)return{language:b,value:xi(L),illegal:!1,relevance:0,errorRaised:X,_emitter:Ve,_top:ce};throw X}}function C(b){const L={value:xi(b),illegal:!1,relevance:0,_top:s,_emitter:new f.__emitter(f)};return L._emitter.addText(b),L}function D(b,L){L=L||f.languages||Object.keys(o);const G=C(b),ee=L.filter(x).filter(fe).map(te=>y(te,b,!1));ee.unshift(G);const be=ee.sort((te,V)=>{if(te.relevance!==V.relevance)return V.relevance-te.relevance;if(te.language&&V.language){if(x(te.language).supersetOf===V.language)return 1;if(x(V.language).supersetOf===te.language)return-1}return 0}),[O,B]=be,oe=O;return oe.secondBest=B,oe}function _(b,L,G){const ee=L&&n[L]||G;b.classList.add("hljs"),b.classList.add(`language-${ee}`)}function F(b){let L=null;const G=p(b);if(d(G))return;if(de("before:highlightElement",{el:b,language:G}),b.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",b);return}if(b.children.length>0&&(f.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(b)),f.throwUnescapedHTML))throw new df("One of your code blocks includes unescaped HTML.",b.innerHTML);L=b;const ee=L.textContent,be=G?h(ee,{language:G,ignoreIllegals:!0}):D(ee);b.innerHTML=be.value,b.dataset.highlighted="yes",_(b,G,be.language),b.result={language:be.language,re:be.relevance,relevance:be.relevance},be.secondBest&&(b.secondBest={language:be.secondBest.language,relevance:be.secondBest.relevance}),de("after:highlightElement",{el:b,result:be,text:ee})}function R(b){f=Pr(f,b)}const M=()=>{N(),Ln("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function k(){N(),Ln("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let u=!1;function N(){function b(){N()}if(document.readyState==="loading"){u||window.addEventListener("DOMContentLoaded",b,!1),u=!0;return}document.querySelectorAll(f.cssSelector).forEach(F)}function $(b,L){let G=null;try{G=L(t)}catch(ee){if(wn("Language definition for '{}' could not be registered.".replace("{}",b)),a)wn(ee);else throw ee;G=s}G.name||(G.name=b),o[b]=G,G.rawDefinition=L.bind(null,t),G.aliases&&ae(G.aliases,{languageName:b})}function j(b){delete o[b];for(const L of Object.keys(n))n[L]===b&&delete n[L]}function q(){return Object.keys(o)}function x(b){return b=(b||"").toLowerCase(),o[b]||o[n[b]]}function ae(b,{languageName:L}){typeof b=="string"&&(b=[b]),b.forEach(G=>{n[G.toLowerCase()]=L})}function fe(b){const L=x(b);return L&&!L.disableAutodetect}function me(b){b["before:highlightBlock"]&&!b["before:highlightElement"]&&(b["before:highlightElement"]=L=>{b["before:highlightBlock"](Object.assign({block:L.el},L))}),b["after:highlightBlock"]&&!b["after:highlightElement"]&&(b["after:highlightElement"]=L=>{b["after:highlightBlock"](Object.assign({block:L.el},L))})}function J(b){me(b),i.push(b)}function ge(b){const L=i.indexOf(b);L!==-1&&i.splice(L,1)}function de(b,L){const G=b;i.forEach(function(ee){ee[G]&&ee[G](L)})}function ye(b){return Ln("10.7.0","highlightBlock will be removed entirely in v12.0"),Ln("10.7.0","Please use highlightElement now."),F(b)}Object.assign(t,{highlight:h,highlightAuto:D,highlightAll:N,highlightElement:F,highlightBlock:ye,configure:R,initHighlighting:M,initHighlightingOnLoad:k,registerLanguage:$,unregisterLanguage:j,listLanguages:q,getLanguage:x,registerAliases:ae,autoDetection:fe,inherit:Pr,addPlugin:J,removePlugin:ge}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=cf,t.regex={concat:xn,lookahead:_r,either:ki,optional:Tu,anyNumberOfTimes:Su};for(const b in Po)typeof Po[b]=="object"&&Sr(Po[b]);return Object.assign(t,Po),t},Dn=Ur({});Dn.newInstance=()=>Ur({});var ff=Dn;Dn.HighlightJS=Dn,Dn.default=Dn;const wi=yu(ff);function Ni(t){const o=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},f={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,a]};a.contains.push(f);const d={match:/\\"/},p={className:"string",begin:/'/,end:/'/},h={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],D=t.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},F=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],R=["true","false"],M={match:/(\/[a-z._-]+)+/},k=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],u=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],N=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],$=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:F,literal:R,built_in:[...k,...u,"set","shopt",...N,...$]},contains:[D,t.SHEBANG(),_,y,c,s,M,f,d,p,h,n]}}const mf=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),pf=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],hf=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],gf=[...pf,...hf],bf=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),kf=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),yf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ef=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function xf(t){const o=t.regex,n=mf(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",c=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",f=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+kf.join("|")+")"},{begin:":(:)?("+yf.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ef.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:bf.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+gf.join("|")+")\\b"}]}}function Hr(t){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}var Vn="[0-9](_*[0-9])*",Uo=`\\.(${Vn})`,Ho="[0-9a-fA-F](_*[0-9a-fA-F])*",Wr={className:"number",variants:[{begin:`(\\b(${Vn})((${Uo})|\\.)?|(${Uo}))[eE][+-]?(${Vn})[fFdD]?\\b`},{begin:`\\b(${Vn})((${Uo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Uo})[fFdD]?\\b`},{begin:`\\b(${Vn})[fFdD]\\b`},{begin:`\\b0[xX]((${Ho})\\.?|(${Ho})?\\.(${Ho}))[pP][+-]?(${Vn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ho})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Gr(t,o,n){return n===-1?"":t.replace(o,i=>Gr(t,o,n-1))}function wf(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Gr("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},p={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Wr,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Wr,p]}}const jr="[A-Za-z$_][0-9A-Za-z$_]*",Nf=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Sf=["true","false","null","undefined","NaN","Infinity"],Kr=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Yr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],qr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Tf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Cf=[].concat(qr,Kr,Yr);function Xr(t){const o=t.regex,n=(G,{after:ee})=>{const be="</"+G[0].slice(1);return G.input.indexOf(be,ee)!==-1},i=jr,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,ee)=>{const be=G[0].length+G.index,O=G.input[be];if(O==="<"||O===","){ee.ignoreMatch();return}O===">"&&(n(G,{after:be})||ee.ignoreMatch());let B;const oe=G.input.substring(be);if(B=oe.match(/^\s*=/)){ee.ignoreMatch();return}if((B=oe.match(/^\s+extends\s+/))&&B.index===0){ee.ignoreMatch();return}}},f={$pattern:jr,keyword:Nf,literal:Sf,built_in:Cf,"variable.language":Tf},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},D={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},R={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},k={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,D,_,F,R,{match:/\$\d+/},y];C.contains=u.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(u)});const N=[].concat(k,C.contains),$=N.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(N)}]),j={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:$},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Kr,...Yr]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},fe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[j],illegal:/%/},me={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function J(G){return o.concat("(?!",G.join("|"),")")}const ge={match:o.concat(/\b/,J([...qr,"super","import"].map(G=>`${G}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},de={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ye={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},j]},b="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(b)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[j]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,D,_,F,R,k,{match:/\$\d+/},y,x,{scope:"attr",match:i+o.lookahead(":"),relevance:0},L,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,t.REGEXP_MODE,{className:"function",begin:b,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},fe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[j,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},de,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[j]},ge,me,q,ye,{match:/\$[(.]/}]}}function Mf(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,a,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Zr(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},y=t.inherit(p,{contains:[]}),C=t.inherit(h,{contains:[]});p.contains.push(C),h.contains.push(y);let D=[n,d];return[p,h,y,C].forEach(M=>{M.contains=M.contains.concat(D)}),D=D.concat(p,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:D},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:D}]}]},n,c,p,h,{className:"quote",begin:"^>\\s+",contains:D,end:"$"},a,i,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Jr(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},h={begin:/\{\{/,relevance:0},y={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,h,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",D=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,_=`\\b|${i.join("|")}`,F={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${D}))[eE][+-]?(${C})[jJ]?(?=${_})`},{begin:`(${D})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${C})[jJ](?=${_})`}]},R={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},M={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",d,F,y,t.HASH_COMMENT_MODE]}]};return p.contains=[y,F,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[d,F,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,R,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[M]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[F,M,y]}]}}function Qr(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),a=o.concat(n,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,o.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",f=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:h,keyword:f,literal:d,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:h}},{className:"punctuation",begin:"->"},c]}}function Af(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],f=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],y=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],C=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],D=h,_=[...p,...d].filter($=>!h.includes($)),F={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},R={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},M={match:o.concat(/\b/,o.either(...D),/\s*\(/),relevance:0,keywords:{built_in:D}};function k($){return o.concat(/\b/,o.either(...$.map(j=>j.replace(/\s+/,"\\s+"))),/\b/)}const u={scope:"keyword",match:k(C),relevance:0};function N($,{exceptions:j,when:q}={}){const x=q;return j=j||[],$.map(ae=>ae.match(/\|\d+$/)||j.includes(ae)?ae:x(ae)?`${ae}|0`:ae)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:N(_,{when:$=>$.length<3}),literal:c,type:f,built_in:y},contains:[{scope:"type",match:k(s)},u,M,F,i,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,R]}}const Wo="[A-Za-z$_][0-9A-Za-z$_]*",el=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],tl=["true","false","null","undefined","NaN","Infinity"],nl=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ol=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],il=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],rl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ll=[].concat(il,nl,ol);function _f(t){const o=t.regex,n=(G,{after:ee})=>{const be="</"+G[0].slice(1);return G.input.indexOf(be,ee)!==-1},i=Wo,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,ee)=>{const be=G[0].length+G.index,O=G.input[be];if(O==="<"||O===","){ee.ignoreMatch();return}O===">"&&(n(G,{after:be})||ee.ignoreMatch());let B;const oe=G.input.substring(be);if(B=oe.match(/^\s*=/)){ee.ignoreMatch();return}if((B=oe.match(/^\s+extends\s+/))&&B.index===0){ee.ignoreMatch();return}}},f={$pattern:Wo,keyword:el,literal:tl,built_in:ll,"variable.language":rl},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},D={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},R={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},k={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,D,_,F,R,{match:/\$\d+/},y];C.contains=u.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(u)});const N=[].concat(k,C.contains),$=N.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(N)}]),j={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:$},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...nl,...ol]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},fe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[j],illegal:/%/},me={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function J(G){return o.concat("(?!",G.join("|"),")")}const ge={match:o.concat(/\b/,J([...il,"super","import"].map(G=>`${G}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},de={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ye={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},j]},b="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",L={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(b)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[j]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,D,_,F,R,k,{match:/\$\d+/},y,x,{scope:"attr",match:i+o.lookahead(":"),relevance:0},L,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[k,t.REGEXP_MODE,{className:"function",begin:b,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},fe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[j,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},de,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[j]},ge,me,q,ye,{match:/\$[(.]/}]}}function al(t){const o=t.regex,n=_f(t),i=Wo,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:Wo,keyword:el.concat(d),literal:tl,built_in:ll.concat(a),"variable.language":rl},h={className:"meta",begin:"@"+i},y=(F,R,M)=>{const k=F.contains.findIndex(u=>u.label===R);if(k===-1)throw new Error("can not find mode to replace");F.contains.splice(k,1,M)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(h);const C=n.contains.find(F=>F.scope==="attr"),D=Object.assign({},C,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,C,D]),n.contains=n.contains.concat([h,c,s,D]),y(n,"shebang",t.SHEBANG()),y(n,"use_strict",f);const _=n.contains.find(F=>F.label==="func.def");return _.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function sl(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(c,{begin:/\(/,end:/\)/}),f=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,d,f,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,s,d,f]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:p}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function cl(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,a]},f=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),C={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},D={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},_={begin:/\{/,end:/\}/,contains:[D],illegal:"\\n",relevance:0},F={begin:"\\[",end:"\\]",contains:[D],illegal:"\\n",relevance:0},R=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},C,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},_,F,c,s],M=[...R];return M.pop(),M.push(f),D.contains=M,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:R}}const Si={bash:Ni,sh:Ni,shell:Ni,css:xf,go:Hr,golang:Hr,java:wf,javascript:Xr,js:Xr,json:Mf,markdown:Zr,md:Zr,python:Jr,py:Jr,rust:Qr,rs:Qr,sql:Af,typescript:al,ts:al,xml:sl,html:sl,yaml:cl,yml:cl};for(const[t,o]of Object.entries(Si))wi.registerLanguage(t,o);function Go(t){const o=t.split(`
55
+ `,Vo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(Ln(n.data)),c=e.ref(null),s=e.ref(null),u=e.computed(()=>{try{const I=On(a.value||"");return c.value=null,I}catch(I){return c.value=I.message,{id:"preview_fallback",text:a.value||"(空)",children:[]}}}),d=e.computed(()=>Bt(u.value));let p=null;e.watch(a,()=>{p&&clearTimeout(p),p=setTimeout(()=>{var I;return(I=s.value)==null?void 0:I.resetView()},250)});function h(){try{const I=On(a.value||"");c.value=null,i("import",I)}catch(I){c.value=I.message}}function x(){a.value=Ln(n.data),c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}function C(){a.value="",c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}function $(){const I=document.createElement("input");I.type="file",I.accept=".md,text/markdown,text/plain",I.onchange=()=>{var k;const A=(k=I.files)==null?void 0:k[0];if(!A)return;const y=new FileReader;y.onload=()=>{typeof y.result=="string"&&(a.value=y.result,c.value=null,e.nextTick(()=>{var m;return(m=s.value)==null?void 0:m.resetView()}))},y.readAsText(A)},I.click()}function R(){const I=new Blob([a.value],{type:"text/markdown;charset=utf-8"}),A=URL.createObjectURL(I),y=document.createElement("a");y.href=A;const k=(n.data.text||"mindmap").trim()||"mindmap";y.download=`${k}.md`,y.click(),URL.revokeObjectURL(A)}function F(){a.value=Oc,c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}return(I,A)=>(e.openBlock(),e.createElementBlock("div",Mc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:$},[...A[1]||(A[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 4 V15"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"加载 .md",-1)])]),e.createElementVNode("button",{class:"zm-md-btn",title:"把当前导图导出为 .md",onClick:R},[...A[2]||(A[2]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 15 V4"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"导出 .md",-1)])]),A[3]||(A[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:F},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:x},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:C},"清空")]),c.value?(e.openBlock(),e.createElementBlock("div",Ac,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",_c,[e.createElementVNode("div",Rc,[A[4]||(A[4]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"Markdown"),e.createElementVNode("span",{class:"zm-md-hint"},"# 根 · ## 一级 · ### 二级 …")],-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":A[0]||(A[0]=y=>a.value=y),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("div",vc,[A[5]||(A[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Bc,[e.createVNode(ei,{ref_key:"previewRef",ref:s,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",zc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!a.value.trim(),onClick:h},"应用到导图",8,Ic)])]))}}),Lc={class:"zm-settings-panel"},Dc={class:"zm-settings-section"},Vc={class:"zm-settings-field"},$c={class:"zm-settings-control"},Pc={class:"zm-color-input-wrap"},Fc=["value"],Uc={class:"zm-color-input-text"},Hc={class:"zm-swatch-row zm-swatch-row--compact"},Wc=["title","onClick"],Gc={class:"zm-settings-field"},jc=["value"],Kc={class:"zm-slider"},Yc=["value"],qc={class:"zm-settings-field"},Xc=["value"],Zc={class:"zm-slider"},Jc=["value"],Qc={class:"zm-settings-field zm-line-style-field"},ed={class:"zm-line-style-group"},td=["title","onClick"],nd=["viewBox"],od={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},id={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},rd={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},ld={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},ad={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},sd={class:"zm-line-style-label"},cd={class:"zm-settings-field zm-line-style-field"},dd={class:"zm-line-style-group"},ud=["title","onClick"],fd=["viewBox"],md={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},pd={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},hd={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},gd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},bd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},kd={class:"zm-line-style-label"},yd={key:0,class:"zm-settings-field"},Ed={class:"zm-settings-label"},xd={class:"zm-settings-sub"},wd=["value"],Nd={key:1,class:"zm-slider"},Sd=["value"],Td={class:"zm-settings-field zm-line-style-field"},Cd={class:"zm-line-style-group"},Md=["title","onClick"],Ad={viewBox:"0 0 28 18",width:"28",height:"18",preserveAspectRatio:"none"},_d={key:0,d:"M 8 9 L 0 9 M 20 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},Rd={key:1,d:"M 14 9 L 0 9 M 14 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},vd={key:2,d:"M 8 7 L 0 4 M 8 9 L 0 9 M 8 11 L 0 14 M 20 7 L 28 4 M 20 9 L 28 9 M 20 11 L 28 14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},Bd={class:"zm-line-style-label"},zd={class:"zm-settings-field"},Id={key:2,class:"zm-palette-picker"},Od={class:"zm-palette-list"},Ld=["onClick"],Dd={class:"zm-palette-option-name"},Vd={class:"zm-palette-option-swatches"},$d={key:0,class:"zm-palette-custom-editor"},Pd=["value"],Fd={class:"zm-palette-custom-actions"},Ud={class:"zm-settings-field"},Hd={key:3,class:"zm-settings-field"},Wd={class:"zm-settings-label"},Gd={class:"zm-settings-sub"},jd=["value"],Kd={key:4,class:"zm-slider"},Yd=["value"],qd={class:"zm-settings-field"},Xd={class:"zm-settings-preview"},Zd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Jd=["x1","y1","x2","y2","stroke","stroke-width"],Qd={key:0,class:"zm-settings-section"},eu={class:"zm-settings-section-title"},tu={key:0,class:"zm-settings-section-sub"},nu={class:"zm-settings-field"},ou={class:"zm-settings-value-tag"},iu={class:"zm-swatch-row"},ru=["title","onClick"],lu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},au=["value"],su={class:"zm-settings-field"},cu={class:"zm-settings-value-tag"},du={class:"zm-swatch-row"},uu=["title","onClick"],fu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},mu=["value"],pu={class:"zm-settings-field"},hu=["value"],gu=["value"],bu={class:"zm-settings-field"},ku=["value"],yu={class:"zm-slider"},Eu=["value"],xu={class:"zm-settings-section zm-settings-section--actions"},$o=((t,o)=>{const n=t.__vccOpts||t;for(const[i,a]of o)n[i]=a;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{},nodeStyle:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,i=o;function a(Y,N){i("update:settings",{[Y]:N})}const c=[{value:"arc",label:"圆弧",viewBox:"0 0 28 14"},{value:"rounded-elbow",label:"圆角折线",viewBox:"0 0 28 14"},{value:"elbow",label:"折线",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"},{value:"curve",label:"S曲线",viewBox:"0 0 28 14"}],s=c,u=[{value:"edge",label:"左右中点"},{value:"center",label:"节点正中心"},{value:"proportional",label:"按比例计算"}],d=[{value:100,label:"100"},{value:200,label:"200"},{value:300,label:"300"},{value:400,label:"400 (常规)"},{value:500,label:"500"},{value:600,label:"600 (半粗)"},{value:700,label:"700 (粗体)"},{value:800,label:"800"},{value:900,label:"900"}];function p(Y){i("update:nodeStyle",Y)}const h=e.computed(()=>[...cn,...n.settings.customPalettes]),x=e.reactive({});function C(Y){return x[Y.id]===void 0&&(x[Y.id]=Y.colors.join(`
56
+ `)),x[Y.id]}function $(Y){const N=x[Y.id]??"",re=Ka(N);if(re.length===0){x[Y.id]=Y.colors.join(`
57
+ `);return}const pe=n.settings.customPalettes.map(de=>de.id===Y.id?{...de,colors:re}:de);i("update:settings",{customPalettes:pe})}function R(){const Y=h.value.find(xe=>xe.id===n.settings.branchPaletteId),N=Y?[...Y.colors]:[...cn[0].colors],re="custom-";let pe=re+(n.settings.customPalettes.length+1);for(;cn.some(xe=>xe.id===pe)||n.settings.customPalettes.some(xe=>xe.id===pe);)pe=re+Math.random().toString(36).slice(2,7);const de={id:pe,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:N};i("update:settings",{customPalettes:[...n.settings.customPalettes,de],branchPaletteId:pe}),x[pe]=N.join(`
58
+ `)}function F(Y){const N=n.settings.customPalettes.filter(pe=>pe.id!==Y.id),re=n.settings.branchPaletteId===Y.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:N,...re!==n.settings.branchPaletteId?{branchPaletteId:re}:{}}),delete x[Y.id]}const I=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],A=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],y=[0,1,2,3],k=["#f87171","#fb923c","#34d399","#818cf8"];function m(Y,N,re,pe){if(N<=1)return re;const de=Y/(N-1);return re+(pe-re)*de}function P(Y,N,re,pe){const de=N*Math.pow(pe,Y);return Math.max(re,de)}const G=e.computed(()=>{const Y=n.settings.lineWidthStart,N=n.settings.lineWidthEnd,re=n.settings.taperedEdge,pe=y.length,de=8,xe=192,ee=h.value.find(ue=>ue.id===n.settings.branchPaletteId),ce=ee&&ee.colors.length?ee.colors:k;return y.map((ue,g)=>{const V=10+g*60/(pe-1);return{x1:de,y1:V,x2:xe,y2:V,w:re?P(ue,Y,N,n.settings.lineWidthTaper):m(ue,pe,Y,N),color:n.settings.rainbowBranch?ce[g%ce.length]:"#94a3b8"}})});return(Y,N)=>{var re,pe,de,xe,ee,ce,ue;return e.openBlock(),e.createElementBlock("div",Lc,[e.createElementVNode("section",Dc,[N[45]||(N[45]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Vc,[N[24]||(N[24]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",$c,[e.createElementVNode("label",Pc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:N[0]||(N[0]=g=>a("canvasBg",g.target.value))},null,40,Fc),e.createElementVNode("span",Uc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",Hc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(A,g=>e.createElementVNode("button",{key:"cbg-"+g,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===g}]),style:e.normalizeStyle({background:g}),title:g,onClick:V=>a("canvasBg",g)},null,14,Wc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:N[1]||(N[1]=g=>a("canvasBg",void 0))},"∅")]),N[46]||(N[46]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Gc,[N[25]||(N[25]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端 (根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:N[2]||(N[2]=g=>a("lineWidthStart",parseFloat(g.target.value)||0))},null,40,jc)]),e.createElementVNode("div",Kc,[N[26]||(N[26]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:N[3]||(N[3]=g=>a("lineWidthStart",parseFloat(g.target.value)))},null,40,Yc)]),e.createElementVNode("div",qc,[N[27]||(N[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端 (子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:N[4]||(N[4]=g=>a("lineWidthEnd",parseFloat(g.target.value)||0))},null,40,Xc)]),e.createElementVNode("div",Zc,[N[28]||(N[28]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.1",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:N[5]||(N[5]=g=>a("lineWidthEnd",parseFloat(g.target.value)))},null,40,Jc)]),N[47]||(N[47]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Qc,[N[29]||(N[29]=e.createElementVNode("span",{class:"zm-settings-label"},"根节点线条",-1)),e.createElementVNode("div",ed,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.rootLineStyle===g.value}]),title:g.label,onClick:V=>a("rootLineStyle",g.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:g.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[g.value==="arc"?(e.openBlock(),e.createElementBlock("path",od)):g.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",id)):g.value==="elbow"?(e.openBlock(),e.createElementBlock("path",rd)):g.value==="curve"?(e.openBlock(),e.createElementBlock("path",ld)):(e.openBlock(),e.createElementBlock("line",ad))],8,nd)),e.createElementVNode("span",sd,e.toDisplayString(g.label),1)],10,td))),128))])]),e.createElementVNode("div",cd,[N[30]||(N[30]=e.createElementVNode("span",{class:"zm-settings-label"},"其他节点线条",-1)),e.createElementVNode("div",dd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,g=>e.createElementVNode("button",{key:g.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===g.value}]),title:g.label,onClick:V=>a("lineStyle",g.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:g.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[g.value==="arc"?(e.openBlock(),e.createElementBlock("path",md)):g.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",pd)):g.value==="elbow"?(e.openBlock(),e.createElementBlock("path",hd)):g.value==="curve"?(e.openBlock(),e.createElementBlock("path",gd)):(e.openBlock(),e.createElementBlock("line",bd))],8,fd)),e.createElementVNode("span",kd,e.toDisplayString(g.label),1)],10,ud)),64))])]),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",yd,[e.createElementVNode("span",Ed,[N[31]||(N[31]=e.createTextVNode("圆角大小 ",-1)),e.createElementVNode("span",xd,e.toDisplayString(t.settings.elbowRadius)+"px",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"2",max:"40",value:t.settings.elbowRadius,onChange:N[6]||(N[6]=g=>a("elbowRadius",parseFloat(g.target.value)||20))},null,40,wd)])):e.createCommentVNode("",!0),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",Nd,[N[32]||(N[32]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"2",max:"40",step:"1",value:t.settings.elbowRadius,onInput:N[7]||(N[7]=g=>a("elbowRadius",parseFloat(g.target.value)))},null,40,Sd)])):e.createCommentVNode("",!0),e.createElementVNode("div",Td,[N[34]||(N[34]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",Cd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,g=>e.createElementVNode("button",{key:g.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===g.value}]),title:g.label,onClick:V=>a("lineOrigin",g.value)},[(e.openBlock(),e.createElementBlock("svg",Ad,[N[33]||(N[33]=e.createElementVNode("rect",{x:"8",y:"6",width:"12",height:"6",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.2",opacity:"0.5"},null,-1)),g.value==="edge"?(e.openBlock(),e.createElementBlock("path",_d)):g.value==="center"?(e.openBlock(),e.createElementBlock("path",Rd)):(e.openBlock(),e.createElementBlock("path",vd))])),e.createElementVNode("span",Bd,e.toDisplayString(g.label),1)],10,Md)),64))])]),e.createElementVNode("div",zd,[N[36]||(N[36]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:N[8]||(N[8]=g=>a("rainbowBranch",!t.settings.rainbowBranch))},[...N[35]||(N[35]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Id,[N[37]||(N[37]=e.createElementVNode("div",{class:"zm-settings-field"},[e.createElementVNode("span",{class:"zm-settings-label"},"配色方案")],-1)),e.createElementVNode("div",Od,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,g=>(e.openBlock(),e.createElementBlock("button",{key:g.id,class:e.normalizeClass(["zm-palette-option",{"is-active":t.settings.branchPaletteId===g.id}]),onClick:V=>a("branchPaletteId",g.id)},[e.createElementVNode("span",Dd,e.toDisplayString(g.name),1),e.createElementVNode("span",Vd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.colors,(V,W)=>(e.openBlock(),e.createElementBlock("span",{key:W,class:"zm-palette-option-swatch",style:e.normalizeStyle({background:V})},null,4))),128))])],10,Ld))),128))]),t.settings.customPalettes.find(g=>g.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",$d,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:C(t.settings.customPalettes.find(g=>g.id===t.settings.branchPaletteId)),onInput:N[9]||(N[9]=g=>x[t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId).id]=g.target.value)},null,40,Pd),e.createElementVNode("div",Fd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:N[10]||(N[10]=g=>$(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:N[11]||(N[11]=g=>F(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:R},"+ 新建配色")])):e.createCommentVNode("",!0),N[48]||(N[48]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Ud,[N[39]||(N[39]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:N[12]||(N[12]=g=>a("taperedEdge",!t.settings.taperedEdge))},[...N[38]||(N[38]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("span",Wd,[N[40]||(N[40]=e.createTextVNode("层级衰减 ",-1)),e.createElementVNode("span",Gd,e.toDisplayString(Math.round(t.settings.lineWidthTaper*100))+"%",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.05",min:"0.1",max:"1",value:t.settings.lineWidthTaper,onChange:N[13]||(N[13]=g=>a("lineWidthTaper",parseFloat(g.target.value)||.67))},null,40,jd)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Kd,[N[41]||(N[41]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.1",max:"1",step:"0.01",value:t.settings.lineWidthTaper,onInput:N[14]||(N[14]=g=>a("lineWidthTaper",parseFloat(g.target.value)))},null,40,Yd)])):e.createCommentVNode("",!0),e.createElementVNode("div",qd,[N[43]||(N[43]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:N[15]||(N[15]=g=>a("showOrderBadge",!t.settings.showOrderBadge))},[...N[42]||(N[42]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Xd,[(e.openBlock(),e.createElementBlock("svg",Zd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(g,V)=>(e.openBlock(),e.createElementBlock("line",{key:V,x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,stroke:t.settings.rainbowBranch?g.color:"#94a3b8","stroke-width":g.w,"stroke-linecap":"butt"},null,8,Jd))),128))])),N[44]||(N[44]=e.createElementVNode("div",{class:"zm-settings-preview-labels"},[e.createElementVNode("span",null,"根"),e.createElementVNode("span",null,"1级"),e.createElementVNode("span",null,"2级"),e.createElementVNode("span",null,"3级")],-1))])]),t.hasSelection?(e.openBlock(),e.createElementBlock("section",Qd,[e.createElementVNode("h4",eu,[N[49]||(N[49]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",tu,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",nu,[N[50]||(N[50]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",ou,e.toDisplayString(((re=t.nodeStyle)==null?void 0:re.bg)||"默认"),1)]),e.createElementVNode("div",iu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(I,g=>{var V;return e.createElementVNode("button",{key:"bg-"+g,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.bg)===g}]),style:e.normalizeStyle({background:g}),title:g,onClick:W=>p({bg:g})},null,14,ru)}),64)),e.createElementVNode("label",lu,[e.createElementVNode("input",{type:"color",value:((pe=t.nodeStyle)==null?void 0:pe.bg)||"#ffffff",onInput:N[16]||(N[16]=g=>p({bg:g.target.value}))},null,40,au)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:N[17]||(N[17]=g=>p({bg:void 0}))},"∅")]),e.createElementVNode("div",su,[N[51]||(N[51]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",cu,e.toDisplayString(((de=t.nodeStyle)==null?void 0:de.textColor)||"默认"),1)]),e.createElementVNode("div",du,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(I,g=>{var V;return e.createElementVNode("button",{key:"fg-"+g,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.textColor)===g}]),style:e.normalizeStyle({background:g}),title:g,onClick:W=>p({textColor:g})},null,14,uu)}),64)),e.createElementVNode("label",fu,[e.createElementVNode("input",{type:"color",value:((xe=t.nodeStyle)==null?void 0:xe.textColor)||"#1e2937",onInput:N[18]||(N[18]=g=>p({textColor:g.target.value}))},null,40,mu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:N[19]||(N[19]=g=>p({textColor:void 0}))},"∅")]),N[55]||(N[55]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",pu,[N[52]||(N[52]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((ee=t.nodeStyle)==null?void 0:ee.fontWeight)??400,onChange:N[20]||(N[20]=g=>p({fontWeight:parseInt(g.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,g=>e.createElementVNode("option",{key:g.value,value:g.value},e.toDisplayString(g.label),9,gu)),64))],40,hu)]),e.createElementVNode("div",bu,[N[53]||(N[53]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((ce=t.nodeStyle)==null?void 0:ce.fontSize)??14,onChange:N[21]||(N[21]=g=>p({fontSize:parseInt(g.target.value)||14}))},null,40,ku)]),e.createElementVNode("div",yu,[N[54]||(N[54]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ue=t.nodeStyle)==null?void 0:ue.fontSize)??14,onInput:N[22]||(N[22]=g=>p({fontSize:parseInt(g.target.value)}))},null,40,Eu)]),N[56]||(N[56]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",xu,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:N[23]||(N[23]=g=>i("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-9698bb5c"]]),Cr=20;function wu(t,o){t.style.height="auto";const n=o.minRows*Cr,i=o.maxRows>0?o.maxRows*Cr:1/0,a=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=a+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function Ei(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const c=t.value;c&&wu(c,n)}function a(){i()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",a),i())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>i()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",a)})}function Nu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Mr(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(o=>{const n=t[o],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Mr(n)}),t}class Ar{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function _r(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function dn(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const a in i)n[a]=i[a]}),n}const Su="</span>",Rr=t=>!!t.scope,Tu=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((i,a)=>`${i}${"_".repeat(a+1)}`)].join(" ")}return`${o}${t}`};class Cu{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=_r(o)}openNode(o){if(!Rr(o))return;const n=Tu(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Rr(o)&&(this.buffer+=Su)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const vr=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class xi{constructor(){this.rootNode=vr(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(o){this.top.children.push(o)}openNode(o){const n=vr({scope:o});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,n){return typeof n=="string"?o.addText(n):n.children&&(o.openNode(n),n.children.forEach(i=>this._walk(o,i)),o.closeNode(n)),o}static _collapse(o){typeof o!="string"&&o.children&&(o.children.every(n=>typeof n=="string")?o.children=[o.children.join("")]:o.children.forEach(n=>{xi._collapse(n)}))}}class Mu extends xi{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const i=o.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new Cu(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ro(t){return t?typeof t=="string"?t:t.source:null}function Br(t){return wn("(?=",t,")")}function Au(t){return wn("(?:",t,")*")}function _u(t){return wn("(?:",t,")?")}function wn(...t){return t.map(n=>ro(n)).join("")}function Ru(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function wi(...t){return"("+(Ru(t).capture?"":"?:")+t.map(i=>ro(i)).join("|")+")"}function zr(t){return new RegExp(t.toString()+"|").exec("").length-1}function vu(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Bu=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ni(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const a=n;let c=ro(i),s="";for(;c.length>0;){const u=Bu.exec(c);if(!u){s+=c;break}s+=c.substring(0,u.index),c=c.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?s+="\\"+String(Number(u[1])+a):(s+=u[0],u[0]==="("&&n++)}return s}).map(i=>`(${i})`).join(o)}const zu=/\b\B/,Ir="[a-zA-Z]\\w*",Si="[a-zA-Z_]\\w*",Or="\\b\\d+(\\.\\d+)?",Lr="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Dr="\\b(0b[01]+)",Iu="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Ou=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=wn(o,/.*\b/,t.binary,/\b.*/)),dn({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},lo={begin:"\\\\[\\s\\S]",relevance:0},Lu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[lo]},Du={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[lo]},Vu={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Po=function(t,o,n={}){const i=dn({scope:"comment",begin:t,end:o,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=wi("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:wn(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},$u=Po("//","$"),Pu=Po("/\\*","\\*/"),Fu=Po("#","$"),Uu={scope:"number",begin:Or,relevance:0},Hu={scope:"number",begin:Lr,relevance:0},Wu={scope:"number",begin:Dr,relevance:0},Gu={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[lo,{begin:/\[/,end:/\]/,relevance:0,contains:[lo]}]},ju={scope:"title",begin:Ir,relevance:0},Ku={scope:"title",begin:Si,relevance:0},Yu={begin:"\\.\\s*"+Si,relevance:0};var Fo=Object.freeze({__proto__:null,APOS_STRING_MODE:Lu,BACKSLASH_ESCAPE:lo,BINARY_NUMBER_MODE:Wu,BINARY_NUMBER_RE:Dr,COMMENT:Po,C_BLOCK_COMMENT_MODE:Pu,C_LINE_COMMENT_MODE:$u,C_NUMBER_MODE:Hu,C_NUMBER_RE:Lr,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(o,n)=>{n.data._beginMatch=o[1]},"on:end":(o,n)=>{n.data._beginMatch!==o[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:Fu,IDENT_RE:Ir,MATCH_NOTHING_RE:zu,METHOD_GUARD:Yu,NUMBER_MODE:Uu,NUMBER_RE:Or,PHRASAL_WORDS_MODE:Vu,QUOTE_STRING_MODE:Du,REGEXP_MODE:Gu,RE_STARTERS_RE:Iu,SHEBANG:Ou,TITLE_MODE:ju,UNDERSCORE_IDENT_RE:Si,UNDERSCORE_TITLE_MODE:Ku});function qu(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Xu(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Zu(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=qu,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Ju(t,o){Array.isArray(t.illegal)&&(t.illegal=wi(...t.illegal))}function Qu(t,o){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function ef(t,o){t.relevance===void 0&&(t.relevance=1)}const tf=(t,o)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(i=>{delete t[i]}),t.keywords=n.keywords,t.begin=wn(n.beforeMatch,Br(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},nf=["of","and","for","in","not","or","if","then","parent","list","value"],of="keyword";function Vr(t,o,n=of){const i=Object.create(null);return typeof t=="string"?a(n,t.split(" ")):Array.isArray(t)?a(n,t):Object.keys(t).forEach(function(c){Object.assign(i,Vr(t[c],o,c))}),i;function a(c,s){o&&(s=s.map(u=>u.toLowerCase())),s.forEach(function(u){const d=u.split("|");i[d[0]]=[c,rf(d[0],d[1])]})}}function rf(t,o){return o?Number(o):lf(t)?0:1}function lf(t){return nf.includes(t.toLowerCase())}const $r={},Nn=t=>{console.error(t)},Pr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Dn=(t,o)=>{$r[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),$r[`${t}/${o}`]=!0)},Uo=new Error;function Fr(t,o,{key:n}){let i=0;const a=t[n],c={},s={};for(let u=1;u<=o.length;u++)s[u+i]=a[u],c[u+i]=!0,i+=zr(o[u-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function af(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Nn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Uo;if(typeof t.beginScope!="object"||t.beginScope===null)throw Nn("beginScope must be object"),Uo;Fr(t,t.begin,{key:"beginScope"}),t.begin=Ni(t.begin,{joinWith:""})}}function sf(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Nn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Uo;if(typeof t.endScope!="object"||t.endScope===null)throw Nn("endScope must be object"),Uo;Fr(t,t.end,{key:"endScope"}),t.end=Ni(t.end,{joinWith:""})}}function cf(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function df(t){cf(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),af(t),sf(t)}function uf(t){function o(s,u){return new RegExp(ro(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=zr(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(Ni(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const p=d.findIndex((x,C)=>C>0&&x!==void 0),h=this.matchIndexes[p];return d.splice(0,p),Object.assign(d,h)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([p,h])=>d.addRule(p,h)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let p=d.exec(u);if(this.resumingScanAtSamePosition()&&!(p&&p.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,p=h.exec(u)}return p&&(this.regexIndex+=p.position+1,this.regexIndex===this.count&&this.considerAll()),p}}function a(s){const u=new i;return s.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&u.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&u.addRule(s.illegal,{type:"illegal"}),u}function c(s,u){const d=s;if(s.isCompiled)return d;[Xu,Qu,df,tf].forEach(h=>h(s,u)),t.compilerExtensions.forEach(h=>h(s,u)),s.__beforeBegin=null,[Zu,Ju,ef].forEach(h=>h(s,u)),s.isCompiled=!0;let p=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),p=s.keywords.$pattern,delete s.keywords.$pattern),p=p||/\w+/,s.keywords&&(s.keywords=Vr(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(p,!0),u&&(s.begin||(s.begin=/\B|\b/),d.beginRe=o(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=o(d.end)),d.terminatorEnd=ro(d.end)||"",s.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+u.terminatorEnd)),s.illegal&&(d.illegalRe=o(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(h){return ff(h==="self"?s:h)})),s.contains.forEach(function(h){c(h,d)}),s.starts&&c(s.starts,u),d.matcher=a(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=dn(t.classNameAliases||{}),c(t)}function Ur(t){return t?t.endsWithParent||Ur(t.starts):!1}function ff(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return dn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Ur(t)?dn(t,{starts:t.starts?dn(t.starts):null}):Object.isFrozen(t)?dn(t):t}var mf="11.11.1";class pf extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Ti=_r,Hr=dn,Wr=Symbol("nomatch"),hf=7,Gr=function(t){const o=Object.create(null),n=Object.create(null),i=[];let a=!0;const c="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Mu};function d(g){return u.noHighlightRe.test(g)}function p(g){let V=g.className+" ";V+=g.parentNode?g.parentNode.className:"";const W=u.languageDetectRe.exec(V);if(W){const te=N(W[1]);return te||(Pr(c.replace("{}",W[1])),Pr("Falling back to no-highlight mode for this block.",g)),te?W[1]:"no-highlight"}return V.split(/\s+/).find(te=>d(te)||N(te))}function h(g,V,W){let te="",fe="";typeof V=="object"?(te=g,W=V.ignoreIllegals,fe=V.language):(Dn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Dn("10.7.0",`Please use highlight(code, options) instead.
59
+ https://github.com/highlightjs/highlight.js/issues/2277`),fe=g,te=V),W===void 0&&(W=!0);const L={code:te,language:fe};ce("before:highlight",L);const O=L.result?L.result:x(L.language,L.code,W);return O.code=L.code,ce("after:highlight",O),O}function x(g,V,W,te){const fe=Object.create(null);function L(q,le){return q.keywords[le]}function O(){if(!me.keywords){Ie.addText(Be);return}let q=0;me.keywordPatternRe.lastIndex=0;let le=me.keywordPatternRe.exec(Be),Ee="";for(;le;){Ee+=Be.substring(q,le.index);const Ae=tt.case_insensitive?le[0].toLowerCase():le[0],Ue=L(me,Ae);if(Ue){const[ot,St]=Ue;if(Ie.addText(Ee),Ee="",fe[Ae]=(fe[Ae]||0)+1,fe[Ae]<=hf&&(Dt+=St),ot.startsWith("_"))Ee+=le[0];else{const Rn=tt.classNameAliases[ot]||ot;B(le[0],Rn)}}else Ee+=le[0];q=me.keywordPatternRe.lastIndex,le=me.keywordPatternRe.exec(Be)}Ee+=Be.substring(q),Ie.addText(Ee)}function ae(){if(Be==="")return;let q=null;if(typeof me.subLanguage=="string"){if(!o[me.subLanguage]){Ie.addText(Be);return}q=x(me.subLanguage,Be,!0,ft[me.subLanguage]),ft[me.subLanguage]=q._top}else q=$(Be,me.subLanguage.length?me.subLanguage:null);me.relevance>0&&(Dt+=q.relevance),Ie.__addSublanguage(q._emitter,q.language)}function ke(){me.subLanguage!=null?ae():O(),Be=""}function B(q,le){q!==""&&(Ie.startScope(le),Ie.addText(q),Ie.endScope())}function S(q,le){let Ee=1;const Ae=le.length-1;for(;Ee<=Ae;){if(!q._emit[Ee]){Ee++;continue}const Ue=tt.classNameAliases[q[Ee]]||q[Ee],ot=le[Ee];Ue?B(ot,Ue):(Be=ot,O(),Be=""),Ee++}}function U(q,le){return q.scope&&typeof q.scope=="string"&&Ie.openNode(tt.classNameAliases[q.scope]||q.scope),q.beginScope&&(q.beginScope._wrap?(B(Be,tt.classNameAliases[q.beginScope._wrap]||q.beginScope._wrap),Be=""):q.beginScope._multi&&(S(q.beginScope,le),Be="")),me=Object.create(q,{parent:{value:me}}),me}function H(q,le,Ee){let Ae=vu(q.endRe,Ee);if(Ae){if(q["on:end"]){const Ue=new Ar(q);q["on:end"](le,Ue),Ue.isMatchIgnored&&(Ae=!1)}if(Ae){for(;q.endsParent&&q.parent;)q=q.parent;return q}}if(q.endsWithParent)return H(q.parent,le,Ee)}function ne(q){return me.matcher.regexIndex===0?(Be+=q[0],1):(kt=!0,0)}function ye(q){const le=q[0],Ee=q.rule,Ae=new Ar(Ee),Ue=[Ee.__beforeBegin,Ee["on:begin"]];for(const ot of Ue)if(ot&&(ot(q,Ae),Ae.isMatchIgnored))return ne(le);return Ee.skip?Be+=le:(Ee.excludeBegin&&(Be+=le),ke(),!Ee.returnBegin&&!Ee.excludeBegin&&(Be=le)),U(Ee,q),Ee.returnBegin?0:le.length}function Qe(q){const le=q[0],Ee=V.substring(q.index),Ae=H(me,q,Ee);if(!Ae)return Wr;const Ue=me;me.endScope&&me.endScope._wrap?(ke(),B(le,me.endScope._wrap)):me.endScope&&me.endScope._multi?(ke(),S(me.endScope,q)):Ue.skip?Be+=le:(Ue.returnEnd||Ue.excludeEnd||(Be+=le),ke(),Ue.excludeEnd&&(Be=le));do me.scope&&Ie.closeNode(),!me.skip&&!me.subLanguage&&(Dt+=me.relevance),me=me.parent;while(me!==Ae.parent);return Ae.starts&&U(Ae.starts,q),Ue.returnEnd?0:le.length}function ut(){const q=[];for(let le=me;le!==tt;le=le.parent)le.scope&&q.unshift(le.scope);q.forEach(le=>Ie.openNode(le))}let et={};function en(q,le){const Ee=le&&le[0];if(Be+=q,Ee==null)return ke(),0;if(et.type==="begin"&&le.type==="end"&&et.index===le.index&&Ee===""){if(Be+=V.slice(le.index,le.index+1),!a){const Ae=new Error(`0 width match regex (${g})`);throw Ae.languageName=g,Ae.badRule=et.rule,Ae}return 1}if(et=le,le.type==="begin")return ye(le);if(le.type==="illegal"&&!W){const Ae=new Error('Illegal lexeme "'+Ee+'" for mode "'+(me.scope||"<unnamed>")+'"');throw Ae.mode=me,Ae}else if(le.type==="end"){const Ae=Qe(le);if(Ae!==Wr)return Ae}if(le.type==="illegal"&&Ee==="")return Be+=`
60
+ `,1;if(Nt>1e5&&Nt>le.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Be+=Ee,Ee.length}const tt=N(g);if(!tt)throw Nn(c.replace("{}",g)),new Error('Unknown language: "'+g+'"');const tn=uf(tt);let Lt="",me=te||tn;const ft={},Ie=new u.__emitter(u);ut();let Be="",Dt=0,nt=0,Nt=0,kt=!1;try{if(tt.__emitTokens)tt.__emitTokens(V,Ie);else{for(me.matcher.considerAll();;){Nt++,kt?kt=!1:me.matcher.considerAll(),me.matcher.lastIndex=nt;const q=me.matcher.exec(V);if(!q)break;const le=V.substring(nt,q.index),Ee=en(le,q);nt=q.index+Ee}en(V.substring(nt))}return Ie.finalize(),Lt=Ie.toHTML(),{language:g,value:Lt,relevance:Dt,illegal:!1,_emitter:Ie,_top:me}}catch(q){if(q.message&&q.message.includes("Illegal"))return{language:g,value:Ti(V),illegal:!0,relevance:0,_illegalBy:{message:q.message,index:nt,context:V.slice(nt-100,nt+100),mode:q.mode,resultSoFar:Lt},_emitter:Ie};if(a)return{language:g,value:Ti(V),illegal:!1,relevance:0,errorRaised:q,_emitter:Ie,_top:me};throw q}}function C(g){const V={value:Ti(g),illegal:!1,relevance:0,_top:s,_emitter:new u.__emitter(u)};return V._emitter.addText(g),V}function $(g,V){V=V||u.languages||Object.keys(o);const W=C(g),te=V.filter(N).filter(pe).map(ke=>x(ke,g,!1));te.unshift(W);const fe=te.sort((ke,B)=>{if(ke.relevance!==B.relevance)return B.relevance-ke.relevance;if(ke.language&&B.language){if(N(ke.language).supersetOf===B.language)return 1;if(N(B.language).supersetOf===ke.language)return-1}return 0}),[L,O]=fe,ae=L;return ae.secondBest=O,ae}function R(g,V,W){const te=V&&n[V]||W;g.classList.add("hljs"),g.classList.add(`language-${te}`)}function F(g){let V=null;const W=p(g);if(d(W))return;if(ce("before:highlightElement",{el:g,language:W}),g.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",g);return}if(g.children.length>0&&(u.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(g)),u.throwUnescapedHTML))throw new pf("One of your code blocks includes unescaped HTML.",g.innerHTML);V=g;const te=V.textContent,fe=W?h(te,{language:W,ignoreIllegals:!0}):$(te);g.innerHTML=fe.value,g.dataset.highlighted="yes",R(g,W,fe.language),g.result={language:fe.language,re:fe.relevance,relevance:fe.relevance},fe.secondBest&&(g.secondBest={language:fe.secondBest.language,relevance:fe.secondBest.relevance}),ce("after:highlightElement",{el:g,result:fe,text:te})}function I(g){u=Hr(u,g)}const A=()=>{m(),Dn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){m(),Dn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function g(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",g,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(F)}function P(g,V){let W=null;try{W=V(t)}catch(te){if(Nn("Language definition for '{}' could not be registered.".replace("{}",g)),a)Nn(te);else throw te;W=s}W.name||(W.name=g),o[g]=W,W.rawDefinition=V.bind(null,t),W.aliases&&re(W.aliases,{languageName:g})}function G(g){delete o[g];for(const V of Object.keys(n))n[V]===g&&delete n[V]}function Y(){return Object.keys(o)}function N(g){return g=(g||"").toLowerCase(),o[g]||o[n[g]]}function re(g,{languageName:V}){typeof g=="string"&&(g=[g]),g.forEach(W=>{n[W.toLowerCase()]=V})}function pe(g){const V=N(g);return V&&!V.disableAutodetect}function de(g){g["before:highlightBlock"]&&!g["before:highlightElement"]&&(g["before:highlightElement"]=V=>{g["before:highlightBlock"](Object.assign({block:V.el},V))}),g["after:highlightBlock"]&&!g["after:highlightElement"]&&(g["after:highlightElement"]=V=>{g["after:highlightBlock"](Object.assign({block:V.el},V))})}function xe(g){de(g),i.push(g)}function ee(g){const V=i.indexOf(g);V!==-1&&i.splice(V,1)}function ce(g,V){const W=g;i.forEach(function(te){te[W]&&te[W](V)})}function ue(g){return Dn("10.7.0","highlightBlock will be removed entirely in v12.0"),Dn("10.7.0","Please use highlightElement now."),F(g)}Object.assign(t,{highlight:h,highlightAuto:$,highlightAll:m,highlightElement:F,highlightBlock:ue,configure:I,initHighlighting:A,initHighlightingOnLoad:y,registerLanguage:P,unregisterLanguage:G,listLanguages:Y,getLanguage:N,registerAliases:re,autoDetection:pe,inherit:Hr,addPlugin:xe,removePlugin:ee}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=mf,t.regex={concat:wn,lookahead:Br,either:wi,optional:_u,anyNumberOfTimes:Au};for(const g in Fo)typeof Fo[g]=="object"&&Mr(Fo[g]);return Object.assign(t,Fo),t},Vn=Gr({});Vn.newInstance=()=>Gr({});var gf=Vn;Vn.HighlightJS=Vn,Vn.default=Vn;const Ci=Nu(gf);function Mi(t){const o=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,a]};a.contains.push(u);const d={match:/\\"/},p={className:"string",begin:/'/,end:/'/},h={match:/\\'/},x={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],$=t.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),R={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},F=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],I=["true","false"],A={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],m=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],P=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:F,literal:I,built_in:[...y,...k,"set","shopt",...m,...P]},contains:[$,t.SHEBANG(),R,x,c,s,A,u,d,p,h,n]}}const bf=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),kf=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],yf=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Ef=[...kf,...yf],xf=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),wf=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Nf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Sf=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Tf(t){const o=t.regex,n=bf(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",c=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+wf.join("|")+")"},{begin:":(:)?("+Nf.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Sf.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:xf.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ef.join("|")+")\\b"}]}}function jr(t){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}var $n="[0-9](_*[0-9])*",Ho=`\\.(${$n})`,Wo="[0-9a-fA-F](_*[0-9a-fA-F])*",Kr={className:"number",variants:[{begin:`(\\b(${$n})((${Ho})|\\.)?|(${Ho}))[eE][+-]?(${$n})[fFdD]?\\b`},{begin:`\\b(${$n})((${Ho})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ho})[fFdD]?\\b`},{begin:`\\b(${$n})[fFdD]\\b`},{begin:`\\b0[xX]((${Wo})\\.?|(${Wo})?\\.(${Wo}))[pP][+-]?(${$n})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Wo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Yr(t,o,n){return n===-1?"":t.replace(o,i=>Yr(t,o,n-1))}function Cf(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Yr("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},p={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Kr,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Kr,p]}}const qr="[A-Za-z$_][0-9A-Za-z$_]*",Mf=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Af=["true","false","null","undefined","NaN","Infinity"],Xr=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Zr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Jr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],_f=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Rf=[].concat(Jr,Xr,Zr);function Qr(t){const o=t.regex,n=(W,{after:te})=>{const fe="</"+W[0].slice(1);return W.input.indexOf(fe,te)!==-1},i=qr,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,te)=>{const fe=W[0].length+W.index,L=W.input[fe];if(L==="<"||L===","){te.ignoreMatch();return}L===">"&&(n(W,{after:fe})||te.ignoreMatch());let O;const ae=W.input.substring(fe);if(O=ae.match(/^\s*=/)){te.ignoreMatch();return}if((O=ae.match(/^\s+extends\s+/))&&O.index===0){te.ignoreMatch();return}}},u={$pattern:qr,keyword:Mf,literal:Af,built_in:Rf,"variable.language":_f},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},y={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,I,{match:/\$\d+/},x];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},Y={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Xr,...Zr]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},de={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function xe(W){return o.concat("(?!",W.join("|"),")")}const ee={match:o.concat(/\b/,xe([...Jr,"super","import"].map(W=>`${W}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ue={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},g="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(g)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,I,y,{match:/\$\d+/},x,N,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,t.REGEXP_MODE,{className:"function",begin:g,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},ee,de,Y,ue,{match:/\$[(.]/}]}}function vf(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,a,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function el(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=t.inherit(p,{contains:[]}),C=t.inherit(h,{contains:[]});p.contains.push(C),h.contains.push(x);let $=[n,d];return[p,h,x,C].forEach(A=>{A.contains=A.contains.concat($)}),$=$.concat(p,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:$},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:$}]}]},n,c,p,h,{className:"quote",begin:"^>\\s+",contains:$,end:"$"},a,i,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function tl(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},h={begin:/\{\{/,relevance:0},x={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,h,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",$=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,R=`\\b|${i.join("|")}`,F={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${$}))[eE][+-]?(${C})[jJ]?(?=${R})`},{begin:`(${$})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${R})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${R})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${R})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${R})`},{begin:`\\b(${C})[jJ](?=${R})`}]},I={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,F,x,t.HASH_COMMENT_MODE]}]};return p.contains=[x,F,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,F,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,I,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[F,A,x]}]}}function nl(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),a=o.concat(n,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,o.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:h,keyword:u,literal:d,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:h}},{className:"punctuation",begin:"->"},c]}}function Bf(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],x=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],C=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],$=h,R=[...p,...d].filter(P=>!h.includes(P)),F={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},I={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:o.concat(/\b/,o.either(...$),/\s*\(/),relevance:0,keywords:{built_in:$}};function y(P){return o.concat(/\b/,o.either(...P.map(G=>G.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:y(C),relevance:0};function m(P,{exceptions:G,when:Y}={}){const N=Y;return G=G||[],P.map(re=>re.match(/\|\d+$/)||G.includes(re)?re:N(re)?`${re}|0`:re)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(R,{when:P=>P.length<3}),literal:c,type:u,built_in:x},contains:[{scope:"type",match:y(s)},k,A,F,i,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,I]}}const Go="[A-Za-z$_][0-9A-Za-z$_]*",ol=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],il=["true","false","null","undefined","NaN","Infinity"],rl=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ll=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],al=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],sl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],cl=[].concat(al,rl,ll);function zf(t){const o=t.regex,n=(W,{after:te})=>{const fe="</"+W[0].slice(1);return W.input.indexOf(fe,te)!==-1},i=Go,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,te)=>{const fe=W[0].length+W.index,L=W.input[fe];if(L==="<"||L===","){te.ignoreMatch();return}L===">"&&(n(W,{after:fe})||te.ignoreMatch());let O;const ae=W.input.substring(fe);if(O=ae.match(/^\s*=/)){te.ignoreMatch();return}if((O=ae.match(/^\s+extends\s+/))&&O.index===0){te.ignoreMatch();return}}},u={$pattern:Go,keyword:ol,literal:il,built_in:cl,"variable.language":sl},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},y={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,I,{match:/\$\d+/},x];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},Y={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},N={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...rl,...ll]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},de={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function xe(W){return o.concat("(?!",W.join("|"),")")}const ee={match:o.concat(/\b/,xe([...al,"super","import"].map(W=>`${W}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ue={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},g="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(g)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:N},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,I,y,{match:/\$\d+/},x,N,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,t.REGEXP_MODE,{className:"function",begin:g,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},ee,de,Y,ue,{match:/\$[(.]/}]}}function dl(t){const o=t.regex,n=zf(t),i=Go,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:Go,keyword:ol.concat(d),literal:il,built_in:cl.concat(a),"variable.language":sl},h={className:"meta",begin:"@"+i},x=(F,I,A)=>{const y=F.contains.findIndex(k=>k.label===I);if(y===-1)throw new Error("can not find mode to replace");F.contains.splice(y,1,A)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(h);const C=n.contains.find(F=>F.scope==="attr"),$=Object.assign({},C,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,C,$]),n.contains=n.contains.concat([h,c,s,$]),x(n,"shebang",t.SHEBANG()),x(n,"use_strict",u);const R=n.contains.find(F=>F.label==="func.def");return R.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function ul(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(c,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,d,u,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,s,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:p}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function fl(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,a]},u=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),C={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},$={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},R={begin:/\{/,end:/\}/,contains:[$],illegal:"\\n",relevance:0},F={begin:"\\[",end:"\\]",contains:[$],illegal:"\\n",relevance:0},I=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},C,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},R,F,c,s],A=[...I];return A.pop(),A.push(u),$.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:I}}const Ai={bash:Mi,sh:Mi,shell:Mi,css:Tf,go:jr,golang:jr,java:Cf,javascript:Qr,js:Qr,json:vf,markdown:el,md:el,python:tl,py:tl,rust:nl,rs:nl,sql:Bf,typescript:dl,ts:dl,xml:ul,html:ul,yaml:fl,yml:fl};for(const[t,o]of Object.entries(Ai))Ci.registerLanguage(t,o);function jo(t){const o=t.split(`
61
61
  `);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
62
- `).replace(/\n+$/,"")}function Nn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
63
- `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Si[n]?n:""}function Ti(t,o){const n=o&&Si[o]?o:"";try{return n?wi.highlight(t,{language:n,ignoreIllegals:!0}).value:wi.highlightAuto(t).value}catch{return Rf(t)}}function Ci(t){return t.split(`
64
- `).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function Rf(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Mi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Sn=Mi();function dl(t){Sn=t}var Tn={exec:()=>null};function $n(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),a=o[i];return a||(a=t(i),o[i]=a),a}}function Re(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(a,c)=>{let s=typeof c=="string"?c:c.source;return s=s.replace(dt.caret,"$1"),n=n.replace(a,s),i},getRegex:()=>new RegExp(n,o)};return i}var Bf=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),dt={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,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,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:$n(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:$n(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:$n(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:$n(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:$n(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:$n(t=>new RegExp(`^ {0,${t}}>`))},vf=/^(?:[ \t]*(?:\n|$))+/,zf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,If=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ao=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Of=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ai=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ul=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fl=Re(ul).replace(/bull/g,Ai).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(),Lf=Re(ul).replace(/bull/g,Ai).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(),_i=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Df=/^[^\n]+/,Ri=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Vf=Re(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ri).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$f=Re(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ai).getRegex(),jo="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",Bi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pf=Re("^ {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",Bi).replace("tag",jo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ml=Re(_i).replace("hr",ao).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[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",jo).getRegex(),Ff=Re(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ml).getRegex(),vi={blockquote:Ff,code:zf,def:Vf,fences:If,heading:Of,hr:ao,html:Pf,lheading:fl,list:$f,newline:vf,paragraph:ml,table:Tn,text:Df},pl=Re("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ao).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",jo).getRegex(),Uf={...vi,lheading:Lf,table:pl,paragraph:Re(_i).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pl).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",jo).getRegex()},Hf={...vi,html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bi).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:Tn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Re(_i).replace("hr",ao).replace("heading",` *#{1,6} *[^
65
- ]`).replace("lheading",fl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Wf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Gf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,hl=/^( {2,}|\\)\n(?!\s*$)/,jf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pn=/[\p{P}\p{S}]/u,Ko=/[\s\p{P}\p{S}]/u,zi=/[^\s\p{P}\p{S}]/u,Kf=Re(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ko).getRegex(),gl=/(?!~)[\p{P}\p{S}]/u,Yf=/(?!~)[\s\p{P}\p{S}]/u,qf=/(?:[^\s\p{P}\p{S}]|~)/u,Xf=Re(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Bf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),bl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Zf=Re(bl,"u").replace(/punct/g,Pn).getRegex(),Jf=Re(bl,"u").replace(/punct/g,gl).getRegex(),kl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Qf=Re(kl,"gu").replace(/notPunctSpace/g,zi).replace(/punctSpace/g,Ko).replace(/punct/g,Pn).getRegex(),em=Re(kl,"gu").replace(/notPunctSpace/g,qf).replace(/punctSpace/g,Yf).replace(/punct/g,gl).getRegex(),tm=Re("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,zi).replace(/punctSpace/g,Ko).replace(/punct/g,Pn).getRegex(),nm=Re(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Pn).getRegex(),om="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",im=Re(om,"gu").replace(/notPunctSpace/g,zi).replace(/punctSpace/g,Ko).replace(/punct/g,Pn).getRegex(),rm=Re(/\\(punct)/,"gu").replace(/punct/g,Pn).getRegex(),lm=Re(/^<(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(),am=Re(Bi).replace("(?:-->|$)","-->").getRegex(),sm=Re("^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",am).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Yo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,cm=Re(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Yo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),yl=Re(/^!?\[(label)\]\[(ref)\]/).replace("label",Yo).replace("ref",Ri).getRegex(),El=Re(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ri).getRegex(),dm=Re("reflink|nolink(?!\\()","g").replace("reflink",yl).replace("nolink",El).getRegex(),xl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ii={_backpedal:Tn,anyPunctuation:rm,autolink:lm,blockSkip:Xf,br:hl,code:Gf,del:Tn,delLDelim:Tn,delRDelim:Tn,emStrongLDelim:Zf,emStrongRDelimAst:Qf,emStrongRDelimUnd:tm,escape:Wf,link:cm,nolink:El,punctuation:Kf,reflink:yl,reflinkSearch:dm,tag:sm,text:jf,url:Tn},um={...Ii,link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",Yo).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Yo).getRegex()},Oi={...Ii,emStrongRDelimAst:em,emStrongLDelim:Jf,delLDelim:nm,delRDelim:im,url:Re(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",xl).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:Re(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",xl).getRegex()},fm={...Oi,br:Re(hl).replace("{2,}","*").getRegex(),text:Re(Oi.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qo={normal:vi,gfm:Uf,pedantic:Hf},so={normal:Ii,gfm:Oi,breaks:fm,pedantic:um},mm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},wl=t=>mm[t];function Yt(t,o){if(o){if(dt.escapeTest.test(t))return t.replace(dt.escapeReplace,wl)}else if(dt.escapeTestNoEncode.test(t))return t.replace(dt.escapeReplaceNoEncode,wl);return t}function Nl(t){try{t=encodeURI(t).replace(dt.percentDecode,"%")}catch{return null}return t}function Sl(t,o){var c;let n=t.replace(dt.findPipe,(s,f,d)=>{let p=!1,h=f;for(;--h>=0&&d[h]==="\\";)p=!p;return p?"|":" |"}),i=n.split(dt.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!((c=i.at(-1))!=null&&c.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;a<i.length;a++)i[a]=i[a].trim().replace(dt.slashPipe,"|");return i}function un(t,o,n){let i=t.length;if(i===0)return"";let a=0;for(;a<i&&t.charAt(i-a-1)===o;)a++;return t.slice(0,i-a)}function Tl(t){let o=t.split(`
66
- `),n=o.length-1;for(;n>=0&&dt.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
67
- `)}function pm(t,o){if(t.indexOf(o[1])===-1)return-1;let n=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===o[0])n++;else if(t[i]===o[1]&&(n--,n<0))return i;return n>0?-2:-1}function hm(t,o=0){let n=o,i="";for(let a of t)if(a===" "){let c=4-n%4;i+=" ".repeat(c),n+=c}else i+=a,n++;return i}function Cl(t,o,n,i,a){let c=o.href,s=o.title||null,f=t[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:c,title:s,text:f,tokens:i.inlineTokens(f)};return i.state.inLink=!1,d}function gm(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let a=i[1];return o.split(`
68
- `).map(c=>{let s=c.match(n.other.beginningSpace);if(s===null)return c;let[f]=s;return f.length>=a.length?c.slice(a.length):c}).join(`
69
- `)}var Xo=class{constructor(t){$e(this,"options");$e(this,"rules");$e(this,"lexer");this.options=t||Sn}space(t){let o=this.rules.block.newline.exec(t);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(t){let o=this.rules.block.code.exec(t);if(o){let n=this.options.pedantic?o[0]:Tl(o[0]),i=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:i}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],i=gm(n,o[3]||"",this.rules);return{type:"code",raw:n,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:i}}}heading(t){let o=this.rules.block.heading.exec(t);if(o){let n=o[2].trim();if(this.rules.other.endingHash.test(n)){let i=un(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:un(o[0],`
62
+ `).replace(/\n+$/,"")}function Sn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
63
+ `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Ai[n]?n:""}function _i(t,o){const n=o&&Ai[o]?o:"";try{return n?Ci.highlight(t,{language:n,ignoreIllegals:!0}).value:Ci.highlightAuto(t).value}catch{return If(t)}}function Ri(t){return t.split(`
64
+ `).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function If(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function vi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Tn=vi();function ml(t){Tn=t}var Cn={exec:()=>null};function Pn(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),a=o[i];return a||(a=t(i),o[i]=a),a}}function Re(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(a,c)=>{let s=typeof c=="string"?c:c.source;return s=s.replace(ct.caret,"$1"),n=n.replace(a,s),i},getRegex:()=>new RegExp(n,o)};return i}var Of=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ct={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,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,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Pn(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Pn(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Pn(t=>new RegExp(`^ {0,${t}}>`))},Lf=/^(?:[ \t]*(?:\n|$))+/,Df=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Vf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ao=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,$f=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Bi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hl=Re(pl).replace(/bull/g,Bi).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(),Pf=Re(pl).replace(/bull/g,Bi).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(),zi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ff=/^[^\n]+/,Ii=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Uf=Re(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ii).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Hf=Re(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Bi).getRegex(),Ko="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",Oi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Wf=Re("^ {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",Oi).replace("tag",Ko).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),gl=Re(zi).replace("hr",ao).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[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ko).getRegex(),Gf=Re(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",gl).getRegex(),Li={blockquote:Gf,code:Df,def:Uf,fences:Vf,heading:$f,hr:ao,html:Wf,lheading:hl,list:Hf,newline:Lf,paragraph:gl,table:Cn,text:Ff},bl=Re("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ao).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[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ko).getRegex(),jf={...Li,lheading:Pf,table:bl,paragraph:Re(zi).replace("hr",ao).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",bl).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ko).getRegex()},Kf={...Li,html:Re(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Oi).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:Cn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Re(zi).replace("hr",ao).replace("heading",` *#{1,6} *[^
65
+ ]`).replace("lheading",hl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Yf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,qf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,kl=/^( {2,}|\\)\n(?!\s*$)/,Xf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Fn=/[\p{P}\p{S}]/u,Yo=/[\s\p{P}\p{S}]/u,Di=/[^\s\p{P}\p{S}]/u,Zf=Re(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Yo).getRegex(),yl=/(?!~)[\p{P}\p{S}]/u,Jf=/(?!~)[\s\p{P}\p{S}]/u,Qf=/(?:[^\s\p{P}\p{S}]|~)/u,em=Re(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Of?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),El=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,tm=Re(El,"u").replace(/punct/g,Fn).getRegex(),nm=Re(El,"u").replace(/punct/g,yl).getRegex(),xl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",om=Re(xl,"gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Yo).replace(/punct/g,Fn).getRegex(),im=Re(xl,"gu").replace(/notPunctSpace/g,Qf).replace(/punctSpace/g,Jf).replace(/punct/g,yl).getRegex(),rm=Re("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Yo).replace(/punct/g,Fn).getRegex(),lm=Re(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Fn).getRegex(),am="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",sm=Re(am,"gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Yo).replace(/punct/g,Fn).getRegex(),cm=Re(/\\(punct)/,"gu").replace(/punct/g,Fn).getRegex(),dm=Re(/^<(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(),um=Re(Oi).replace("(?:-->|$)","-->").getRegex(),fm=Re("^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",um).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),qo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,mm=Re(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",qo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wl=Re(/^!?\[(label)\]\[(ref)\]/).replace("label",qo).replace("ref",Ii).getRegex(),Nl=Re(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ii).getRegex(),pm=Re("reflink|nolink(?!\\()","g").replace("reflink",wl).replace("nolink",Nl).getRegex(),Sl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Vi={_backpedal:Cn,anyPunctuation:cm,autolink:dm,blockSkip:em,br:kl,code:qf,del:Cn,delLDelim:Cn,delRDelim:Cn,emStrongLDelim:tm,emStrongRDelimAst:om,emStrongRDelimUnd:rm,escape:Yf,link:mm,nolink:Nl,punctuation:Zf,reflink:wl,reflinkSearch:pm,tag:fm,text:Xf,url:Cn},hm={...Vi,link:Re(/^!?\[(label)\]\((.*?)\)/).replace("label",qo).getRegex(),reflink:Re(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",qo).getRegex()},$i={...Vi,emStrongRDelimAst:im,emStrongLDelim:nm,delLDelim:lm,delRDelim:sm,url:Re(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Sl).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:Re(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Sl).getRegex()},gm={...$i,br:Re(kl).replace("{2,}","*").getRegex(),text:Re($i.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xo={normal:Li,gfm:jf,pedantic:Kf},so={normal:Vi,gfm:$i,breaks:gm,pedantic:hm},bm={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Tl=t=>bm[t];function Yt(t,o){if(o){if(ct.escapeTest.test(t))return t.replace(ct.escapeReplace,Tl)}else if(ct.escapeTestNoEncode.test(t))return t.replace(ct.escapeReplaceNoEncode,Tl);return t}function Cl(t){try{t=encodeURI(t).replace(ct.percentDecode,"%")}catch{return null}return t}function Ml(t,o){var c;let n=t.replace(ct.findPipe,(s,u,d)=>{let p=!1,h=u;for(;--h>=0&&d[h]==="\\";)p=!p;return p?"|":" |"}),i=n.split(ct.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!((c=i.at(-1))!=null&&c.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;a<i.length;a++)i[a]=i[a].trim().replace(ct.slashPipe,"|");return i}function un(t,o,n){let i=t.length;if(i===0)return"";let a=0;for(;a<i&&t.charAt(i-a-1)===o;)a++;return t.slice(0,i-a)}function Al(t){let o=t.split(`
66
+ `),n=o.length-1;for(;n>=0&&ct.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
67
+ `)}function km(t,o){if(t.indexOf(o[1])===-1)return-1;let n=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===o[0])n++;else if(t[i]===o[1]&&(n--,n<0))return i;return n>0?-2:-1}function ym(t,o=0){let n=o,i="";for(let a of t)if(a===" "){let c=4-n%4;i+=" ".repeat(c),n+=c}else i+=a,n++;return i}function _l(t,o,n,i,a){let c=o.href,s=o.title||null,u=t[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:c,title:s,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,d}function Em(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let a=i[1];return o.split(`
68
+ `).map(c=>{let s=c.match(n.other.beginningSpace);if(s===null)return c;let[u]=s;return u.length>=a.length?c.slice(a.length):c}).join(`
69
+ `)}var Zo=class{constructor(t){Ve(this,"options");Ve(this,"rules");Ve(this,"lexer");this.options=t||Tn}space(t){let o=this.rules.block.newline.exec(t);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(t){let o=this.rules.block.code.exec(t);if(o){let n=this.options.pedantic?o[0]:Al(o[0]),i=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:i}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],i=Em(n,o[3]||"",this.rules);return{type:"code",raw:n,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:i}}}heading(t){let o=this.rules.block.heading.exec(t);if(o){let n=o[2].trim();if(this.rules.other.endingHash.test(n)){let i=un(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:un(o[0],`
70
70
  `),depth:o[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:un(o[0],`
71
71
  `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=un(o[0],`
72
72
  `).split(`
73
- `),i="",a="",c=[];for(;n.length>0;){let s=!1,f=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))f.push(n[d]),s=!0;else if(!s)f.push(n[d]);else break;n=n.slice(d);let p=f.join(`
73
+ `),i="",a="",c=[];for(;n.length>0;){let s=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),s=!0;else if(!s)u.push(n[d]);else break;n=n.slice(d);let p=u.join(`
74
74
  `),h=p.replace(this.rules.other.blockquoteSetextReplace,`
75
75
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
76
76
  ${p}`:p,a=a?`${a}
77
- ${h}`:h;let y=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,c,!0),this.lexer.state.top=y,n.length===0)break;let C=c.at(-1);if((C==null?void 0:C.type)==="code")break;if((C==null?void 0:C.type)==="blockquote"){let D=C,_=D.raw+`
77
+ ${h}`:h;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,c,!0),this.lexer.state.top=x,n.length===0)break;let C=c.at(-1);if((C==null?void 0:C.type)==="code")break;if((C==null?void 0:C.type)==="blockquote"){let $=C,R=$.raw+`
78
78
  `+n.join(`
79
- `),F=this.blockquote(_);c[c.length-1]=F,i=i.substring(0,i.length-D.raw.length)+F.raw,a=a.substring(0,a.length-D.text.length)+F.text;break}else if((C==null?void 0:C.type)==="list"){let D=C,_=D.raw+`
79
+ `),F=this.blockquote(R);c[c.length-1]=F,i=i.substring(0,i.length-$.raw.length)+F.raw,a=a.substring(0,a.length-$.text.length)+F.text;break}else if((C==null?void 0:C.type)==="list"){let $=C,R=$.raw+`
80
80
  `+n.join(`
81
- `),F=this.list(_);c[c.length-1]=F,i=i.substring(0,i.length-C.raw.length)+F.raw,a=a.substring(0,a.length-D.raw.length)+F.raw,n=_.substring(c.at(-1).raw.length).split(`
82
- `);continue}}return{type:"blockquote",raw:i,tokens:c,text:a}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,p="",h="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;p=o[0],t=t.substring(p.length);let y=hm(o[2].split(`
81
+ `),F=this.list(R);c[c.length-1]=F,i=i.substring(0,i.length-C.raw.length)+F.raw,a=a.substring(0,a.length-$.raw.length)+F.raw,n=R.substring(c.at(-1).raw.length).split(`
82
+ `);continue}}return{type:"blockquote",raw:i,tokens:c,text:a}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,p="",h="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;p=o[0],t=t.substring(p.length);let x=ym(o[2].split(`
83
83
  `,1)[0],o[1].length),C=t.split(`
84
- `,1)[0],D=!y.trim(),_=0;if(this.options.pedantic?(_=2,h=y.trimStart()):D?_=o[1].length+1:(_=y.search(this.rules.other.nonSpaceChar),_=_>4?1:_,h=y.slice(_),_+=o[1].length),D&&this.rules.other.blankLine.test(C)&&(p+=C+`
85
- `,t=t.substring(C.length+1),d=!0),!d){let F=this.rules.other.nextBulletRegex(_),R=this.rules.other.hrRegex(_),M=this.rules.other.fencesBeginRegex(_),k=this.rules.other.headingBeginRegex(_),u=this.rules.other.htmlBeginRegex(_),N=this.rules.other.blockquoteBeginRegex(_);for(;t;){let $=t.split(`
86
- `,1)[0],j;if(C=$,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),j=C):j=C.replace(this.rules.other.tabCharGlobal," "),M.test(C)||k.test(C)||u.test(C)||N.test(C)||F.test(C)||R.test(C))break;if(j.search(this.rules.other.nonSpaceChar)>=_||!C.trim())h+=`
87
- `+j.slice(_);else{if(D||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||M.test(y)||k.test(y)||R.test(y))break;h+=`
88
- `+C}D=!C.trim(),p+=$+`
89
- `,t=t.substring($.length+1),y=j.slice(_)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(s=!0)),a.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),a.raw+=p}let f=a.items.at(-1);if(f)f.raw=f.raw.trimEnd(),f.text=f.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let d of a.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let p=d.tokens[0];if(d.task&&((p==null?void 0:p.type)==="text"||(p==null?void 0:p.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let y={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=y.checked,a.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=y.raw+d.tokens[0].raw,d.tokens[0].text=y.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(y)):d.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):d.tokens.unshift(y)}}else d.task&&(d.task=!1);if(!a.loose){let h=d.tokens.filter(C=>C.type==="space"),y=h.length>0&&h.some(C=>this.rules.other.anyLine.test(C.raw));a.loose=y}}if(a.loose)for(let d of a.items){d.loose=!0;for(let p of d.tokens)p.type==="text"&&(p.type="paragraph")}return a}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Tl(o[0]);return{type:"html",block:!0,raw:n,pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:n}}}def(t){let o=this.rules.block.def.exec(t);if(o){let n=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:un(o[0],`
90
- `),href:i,title:a}}}table(t){var s;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=Sl(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(s=o[3])!=null&&s.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
84
+ `,1)[0],$=!x.trim(),R=0;if(this.options.pedantic?(R=2,h=x.trimStart()):$?R=o[1].length+1:(R=x.search(this.rules.other.nonSpaceChar),R=R>4?1:R,h=x.slice(R),R+=o[1].length),$&&this.rules.other.blankLine.test(C)&&(p+=C+`
85
+ `,t=t.substring(C.length+1),d=!0),!d){let F=this.rules.other.nextBulletRegex(R),I=this.rules.other.hrRegex(R),A=this.rules.other.fencesBeginRegex(R),y=this.rules.other.headingBeginRegex(R),k=this.rules.other.htmlBeginRegex(R),m=this.rules.other.blockquoteBeginRegex(R);for(;t;){let P=t.split(`
86
+ `,1)[0],G;if(C=P,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),G=C):G=C.replace(this.rules.other.tabCharGlobal," "),A.test(C)||y.test(C)||k.test(C)||m.test(C)||F.test(C)||I.test(C))break;if(G.search(this.rules.other.nonSpaceChar)>=R||!C.trim())h+=`
87
+ `+G.slice(R);else{if($||x.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(x)||y.test(x)||I.test(x))break;h+=`
88
+ `+C}$=!C.trim(),p+=P+`
89
+ `,t=t.substring(P.length+1),x=G.slice(R)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(s=!0)),a.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),a.raw+=p}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let d of a.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let p=d.tokens[0];if(d.task&&((p==null?void 0:p.type)==="text"||(p==null?void 0:p.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let x=this.lexer.inlineQueue.length-1;x>=0;x--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[x].src)){this.lexer.inlineQueue[x].src=this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask,"");break}let h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let x={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=x.checked,a.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=x.raw+d.tokens[0].raw,d.tokens[0].text=x.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(x)):d.tokens.unshift({type:"paragraph",raw:x.raw,text:x.raw,tokens:[x]}):d.tokens.unshift(x)}}else d.task&&(d.task=!1);if(!a.loose){let h=d.tokens.filter(C=>C.type==="space"),x=h.length>0&&h.some(C=>this.rules.other.anyLine.test(C.raw));a.loose=x}}if(a.loose)for(let d of a.items){d.loose=!0;for(let p of d.tokens)p.type==="text"&&(p.type="paragraph")}return a}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Al(o[0]);return{type:"html",block:!0,raw:n,pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:n}}}def(t){let o=this.rules.block.def.exec(t);if(o){let n=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:un(o[0],`
90
+ `),href:i,title:a}}}table(t){var s;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=Ml(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(s=o[3])!=null&&s.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
91
91
  `):[],c={type:"table",raw:un(o[0],`
92
- `),header:[],align:[],rows:[]};if(n.length===i.length){for(let f of i)this.rules.other.tableAlignRight.test(f)?c.align.push("right"):this.rules.other.tableAlignCenter.test(f)?c.align.push("center"):this.rules.other.tableAlignLeft.test(f)?c.align.push("left"):c.align.push(null);for(let f=0;f<n.length;f++)c.header.push({text:n[f],tokens:this.lexer.inline(n[f]),header:!0,align:c.align[f]});for(let f of a)c.rows.push(Sl(f,c.header.length).map((d,p)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:c.align[p]})));return c}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:un(o[0],`
92
+ `),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?c.align.push("right"):this.rules.other.tableAlignCenter.test(u)?c.align.push("center"):this.rules.other.tableAlignLeft.test(u)?c.align.push("left"):c.align.push(null);for(let u=0;u<n.length;u++)c.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:c.align[u]});for(let u of a)c.rows.push(Ml(u,c.header.length).map((d,p)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:c.align[p]})));return c}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:un(o[0],`
93
93
  `),depth:o[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let o=this.rules.block.paragraph.exec(t);if(o){let n=o[1].charAt(o[1].length-1)===`
94
- `?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let c=un(n.slice(0,-1),"\\");if((n.length-c.length)%2===0)return}else{let c=pm(o[2],"()");if(c===-2)return;if(c>-1){let s=(o[0].indexOf("!")===0?5:4)+o[1].length+c;o[2]=o[2].substring(0,c),o[0]=o[0].substring(0,s).trim(),o[3]=""}}let i=o[2],a="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(i);c&&(i=c[1],a=c[3])}else a=o[3]?o[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Cl(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(t,o){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=o[i.toLowerCase()];if(!a){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return Cl(n,a,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,f=a,d=0,p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,o=o.slice(-1*t.length+a);(i=p.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c)continue;if(s=[...c].length,i[3]||i[4]){f+=s;continue}else if((i[5]||i[6])&&a%3&&!((a+s)%3)){d+=s;continue}if(f-=s,f>0)continue;s=Math.min(s,s+f+d);let h=[...i[0]][0].length,y=t.slice(0,a+i.index+h+s);if(Math.min(a,s)%2){let D=y.slice(1,-1);return{type:"em",raw:y,text:D,tokens:this.lexer.inlineTokens(D)}}let C=y.slice(2,-2);return{type:"strong",raw:y,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:o[0],text:n}}}br(t){let o=this.rules.inline.br.exec(t);if(o)return{type:"br",raw:o[0]}}del(t,o,n=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,f=a,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+a);(i=d.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c||(s=[...c].length,s!==a))continue;if(i[3]||i[4]){f+=s;continue}if(f-=s,f>0)continue;s=Math.min(s,s+f);let p=[...i[0]][0].length,h=t.slice(0,a+i.index+p+s),y=h.slice(a,-a);return{type:"del",raw:h,text:y,tokens:this.lexer.inlineTokens(y)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,i;return o[2]==="@"?(n=o[1],i="mailto:"+n):(n=o[1],i=n),{type:"link",raw:o[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let i,a;if(o[2]==="@")i=o[0],a="mailto:"+i;else{let c;do c=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(c!==o[0]);i=o[0],o[1]==="www."?a="http://"+o[0]:a=o[0]}return{type:"link",raw:o[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let o=this.rules.inline.text.exec(t);if(o){let n=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:n}}}},Ut=class or{constructor(o){$e(this,"tokens");$e(this,"options");$e(this,"state");$e(this,"inlineQueue");$e(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Sn,this.options.tokenizer=this.options.tokenizer||new Xo,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:dt,block:qo.normal,inline:so.normal};this.options.pedantic?(n.block=qo.pedantic,n.inline=so.pedantic):this.options.gfm&&(n.block=qo.gfm,this.options.breaks?n.inline=so.breaks:n.inline=so.gfm),this.tokenizer.rules=n}static get rules(){return{block:qo,inline:so}}static lex(o,n){return new or(n).lex(o)}static lexInline(o,n){return new or(n).inlineTokens(o)}lex(o){o=o.replace(dt.carriageReturn,`
95
- `),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],i=!1){var c,s,f;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(dt.tabCharGlobal," ").replace(dt.spaceLine,""));let a=1/0;for(;o;){if(o.length<a)a=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((s=(c=this.options.extensions)==null?void 0:c.block)!=null&&s.some(h=>(d=h.call({lexer:this},o,n))?(o=o.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.space(o)){o=o.substring(d.raw.length);let h=n.at(-1);d.raw.length===1&&h!==void 0?h.raw+=`
94
+ `?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let c=un(n.slice(0,-1),"\\");if((n.length-c.length)%2===0)return}else{let c=km(o[2],"()");if(c===-2)return;if(c>-1){let s=(o[0].indexOf("!")===0?5:4)+o[1].length+c;o[2]=o[2].substring(0,c),o[0]=o[0].substring(0,s).trim(),o[3]=""}}let i=o[2],a="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(i);c&&(i=c[1],a=c[3])}else a=o[3]?o[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),_l(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(t,o){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=o[i.toLowerCase()];if(!a){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return _l(n,a,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,u=a,d=0,p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,o=o.slice(-1*t.length+a);(i=p.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c)continue;if(s=[...c].length,i[3]||i[4]){u+=s;continue}else if((i[5]||i[6])&&a%3&&!((a+s)%3)){d+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+d);let h=[...i[0]][0].length,x=t.slice(0,a+i.index+h+s);if(Math.min(a,s)%2){let $=x.slice(1,-1);return{type:"em",raw:x,text:$,tokens:this.lexer.inlineTokens($)}}let C=x.slice(2,-2);return{type:"strong",raw:x,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:o[0],text:n}}}br(t){let o=this.rules.inline.br.exec(t);if(o)return{type:"br",raw:o[0]}}del(t,o,n=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,u=a,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+a);(i=d.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c||(s=[...c].length,s!==a))continue;if(i[3]||i[4]){u+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u);let p=[...i[0]][0].length,h=t.slice(0,a+i.index+p+s),x=h.slice(a,-a);return{type:"del",raw:h,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,i;return o[2]==="@"?(n=o[1],i="mailto:"+n):(n=o[1],i=n),{type:"link",raw:o[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let i,a;if(o[2]==="@")i=o[0],a="mailto:"+i;else{let c;do c=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(c!==o[0]);i=o[0],o[1]==="www."?a="http://"+o[0]:a=o[0]}return{type:"link",raw:o[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let o=this.rules.inline.text.exec(t);if(o){let n=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:n}}}},Ht=class lr{constructor(o){Ve(this,"tokens");Ve(this,"options");Ve(this,"state");Ve(this,"inlineQueue");Ve(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Tn,this.options.tokenizer=this.options.tokenizer||new Zo,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:ct,block:Xo.normal,inline:so.normal};this.options.pedantic?(n.block=Xo.pedantic,n.inline=so.pedantic):this.options.gfm&&(n.block=Xo.gfm,this.options.breaks?n.inline=so.breaks:n.inline=so.gfm),this.tokenizer.rules=n}static get rules(){return{block:Xo,inline:so}}static lex(o,n){return new lr(n).lex(o)}static lexInline(o,n){return new lr(n).inlineTokens(o)}lex(o){o=o.replace(ct.carriageReturn,`
95
+ `),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],i=!1){var c,s,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(ct.tabCharGlobal," ").replace(ct.spaceLine,""));let a=1/0;for(;o;){if(o.length<a)a=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((s=(c=this.options.extensions)==null?void 0:c.block)!=null&&s.some(h=>(d=h.call({lexer:this},o,n))?(o=o.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.space(o)){o=o.substring(d.raw.length);let h=n.at(-1);d.raw.length===1&&h!==void 0?h.raw+=`
96
96
  `:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
97
97
  `)?"":`
98
98
  `)+d.raw,h.text+=`
99
99
  `+d.text,this.inlineQueue.at(-1).src=h.text):n.push(d);continue}if(d=this.tokenizer.fences(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.heading(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.hr(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.blockquote(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.list(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.html(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.def(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
100
100
  `)?"":`
101
101
  `)+d.raw,h.text+=`
102
- `+d.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let p=o;if((f=this.options.extensions)!=null&&f.startBlock){let h=1/0,y=o.slice(1),C;this.options.extensions.startBlock.forEach(D=>{C=D.call({lexer:this},y),typeof C=="number"&&C>=0&&(h=Math.min(h,C))}),h<1/0&&h>=0&&(p=o.substring(0,h+1))}if(this.state.top&&(d=this.tokenizer.paragraph(p))){let h=n.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
102
+ `+d.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let p=o;if((u=this.options.extensions)!=null&&u.startBlock){let h=1/0,x=o.slice(1),C;this.options.extensions.startBlock.forEach($=>{C=$.call({lexer:this},x),typeof C=="number"&&C>=0&&(h=Math.min(h,C))}),h<1/0&&h>=0&&(p=o.substring(0,h+1))}if(this.state.top&&(d=this.tokenizer.paragraph(p))){let h=n.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
103
103
  `)?"":`
104
104
  `)+d.raw,h.text+=`
105
105
  `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d),i=p.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
106
106
  `)?"":`
107
107
  `)+d.raw,h.text+=`
108
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var p,h,y,C,D;this.tokenizer.lexer=this;let i=o,a=null;if(this.tokens.links){let _=Object.keys(this.tokens.links);if(_.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)_.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let c;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)c=a[2]?a[2].length:0,i=i.slice(0,a.index+c)+"["+"a".repeat(a[0].length-c-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((h=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:h.call({lexer:this},i))??i;let s=!1,f="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}s||(f=""),s=!1;let _;if((C=(y=this.options.extensions)==null?void 0:y.inline)!=null&&C.some(R=>(_=R.call({lexer:this},o,n))?(o=o.substring(_.raw.length),n.push(_),!0):!1))continue;if(_=this.tokenizer.escape(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.tag(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.link(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(_.raw.length);let R=n.at(-1);_.type==="text"&&(R==null?void 0:R.type)==="text"?(R.raw+=_.raw,R.text+=_.text):n.push(_);continue}if(_=this.tokenizer.emStrong(o,i,f)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.codespan(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.br(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.del(o,i,f)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.autolink(o)){o=o.substring(_.raw.length),n.push(_);continue}if(!this.state.inLink&&(_=this.tokenizer.url(o))){o=o.substring(_.raw.length),n.push(_);continue}let F=o;if((D=this.options.extensions)!=null&&D.startInline){let R=1/0,M=o.slice(1),k;this.options.extensions.startInline.forEach(u=>{k=u.call({lexer:this},M),typeof k=="number"&&k>=0&&(R=Math.min(R,k))}),R<1/0&&R>=0&&(F=o.substring(0,R+1))}if(_=this.tokenizer.inlineText(F)){o=o.substring(_.raw.length),_.raw.slice(-1)!=="_"&&(f=_.raw.slice(-1)),s=!0;let R=n.at(-1);(R==null?void 0:R.type)==="text"?(R.raw+=_.raw,R.text+=_.text):n.push(_);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return n}infiniteLoopError(o){let n="Infinite loop on byte: "+o;if(this.options.silent)console.error(n);else throw new Error(n)}},co=class{constructor(t){$e(this,"options");$e(this,"parser");this.options=t||Sn}space(t){return""}code({text:t,lang:o,escaped:n}){var c;let i=(c=(o||"").match(dt.notSpaceStart))==null?void 0:c[0],a=t.replace(dt.endingNewline,"")+`
108
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var p,h,x,C,$;this.tokenizer.lexer=this;let i=o,a=null;if(this.tokens.links){let R=Object.keys(this.tokens.links);if(R.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)R.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let c;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)c=a[2]?a[2].length:0,i=i.slice(0,a.index+c)+"["+"a".repeat(a[0].length-c-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((h=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:h.call({lexer:this},i))??i;let s=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}s||(u=""),s=!1;let R;if((C=(x=this.options.extensions)==null?void 0:x.inline)!=null&&C.some(I=>(R=I.call({lexer:this},o,n))?(o=o.substring(R.raw.length),n.push(R),!0):!1))continue;if(R=this.tokenizer.escape(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.tag(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.link(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(R.raw.length);let I=n.at(-1);R.type==="text"&&(I==null?void 0:I.type)==="text"?(I.raw+=R.raw,I.text+=R.text):n.push(R);continue}if(R=this.tokenizer.emStrong(o,i,u)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.codespan(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.br(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.del(o,i,u)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.autolink(o)){o=o.substring(R.raw.length),n.push(R);continue}if(!this.state.inLink&&(R=this.tokenizer.url(o))){o=o.substring(R.raw.length),n.push(R);continue}let F=o;if(($=this.options.extensions)!=null&&$.startInline){let I=1/0,A=o.slice(1),y;this.options.extensions.startInline.forEach(k=>{y=k.call({lexer:this},A),typeof y=="number"&&y>=0&&(I=Math.min(I,y))}),I<1/0&&I>=0&&(F=o.substring(0,I+1))}if(R=this.tokenizer.inlineText(F)){o=o.substring(R.raw.length),R.raw.slice(-1)!=="_"&&(u=R.raw.slice(-1)),s=!0;let I=n.at(-1);(I==null?void 0:I.type)==="text"?(I.raw+=R.raw,I.text+=R.text):n.push(R);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return n}infiniteLoopError(o){let n="Infinite loop on byte: "+o;if(this.options.silent)console.error(n);else throw new Error(n)}},co=class{constructor(t){Ve(this,"options");Ve(this,"parser");this.options=t||Tn}space(t){return""}code({text:t,lang:o,escaped:n}){var c;let i=(c=(o||"").match(ct.notSpaceStart))==null?void 0:c[0],a=t.replace(ct.endingNewline,"")+`
109
109
  `;return i?'<pre><code class="language-'+Yt(i)+'">'+(n?a:Yt(a,!0))+`</code></pre>
110
110
  `:"<pre><code>"+(n?a:Yt(a,!0))+`</code></pre>
111
111
  `}blockquote({tokens:t}){return`<blockquote>
112
112
  ${this.parser.parse(t)}</blockquote>
113
113
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
114
114
  `}hr(t){return`<hr>
115
- `}list(t){let o=t.ordered,n=t.start,i="";for(let s=0;s<t.items.length;s++){let f=t.items[s];i+=this.listitem(f)}let a=o?"ol":"ul",c=o&&n!==1?' start="'+n+'"':"";return"<"+a+c+`>
115
+ `}list(t){let o=t.ordered,n=t.start,i="";for(let s=0;s<t.items.length;s++){let u=t.items[s];i+=this.listitem(u)}let a=o?"ol":"ul",c=o&&n!==1?' start="'+n+'"':"";return"<"+a+c+`>
116
116
  `+i+"</"+a+`>
117
117
  `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
118
118
  `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
@@ -123,20 +123,20 @@ ${this.parser.parse(t)}</blockquote>
123
123
  `}tablerow({text:t}){return`<tr>
124
124
  ${t}</tr>
125
125
  `}tablecell(t){let o=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+o+`</${n}>
126
- `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Yt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let i=this.parser.parseInline(n),a=Nl(t);if(a===null)return i;t=a;let c='<a href="'+t+'"';return o&&(c+=' title="'+Yt(o)+'"'),c+=">"+i+"</a>",c}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=Nl(t);if(a===null)return Yt(n);t=a;let c=`<img src="${t}" alt="${Yt(n)}"`;return o&&(c+=` title="${Yt(o)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Yt(t.text)}},Li=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Ht=class ir{constructor(o){$e(this,"options");$e(this,"renderer");$e(this,"textRenderer");this.options=o||Sn,this.options.renderer=this.options.renderer||new co,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Li}static parse(o,n){return new ir(n).parse(o)}static parseInline(o,n){return new ir(n).parseInline(o)}parse(o){var i,a;this.renderer.parser=this;let n="";for(let c=0;c<o.length;c++){let s=o[c];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[s.type]){let d=s,p=this.options.extensions.renderers[d.type].call({parser:this},d);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=p||"";continue}}let f=s;switch(f.type){case"space":{n+=this.renderer.space(f);break}case"hr":{n+=this.renderer.hr(f);break}case"heading":{n+=this.renderer.heading(f);break}case"code":{n+=this.renderer.code(f);break}case"table":{n+=this.renderer.table(f);break}case"blockquote":{n+=this.renderer.blockquote(f);break}case"list":{n+=this.renderer.list(f);break}case"checkbox":{n+=this.renderer.checkbox(f);break}case"html":{n+=this.renderer.html(f);break}case"def":{n+=this.renderer.def(f);break}case"paragraph":{n+=this.renderer.paragraph(f);break}case"text":{n+=this.renderer.text(f);break}default:{let d='Token with "'+f.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var a,c;this.renderer.parser=this;let i="";for(let s=0;s<o.length;s++){let f=o[s];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[f.type]){let p=this.options.extensions.renderers[f.type].call({parser:this},f);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(f.type)){i+=p||"";continue}}let d=f;switch(d.type){case"escape":{i+=n.text(d);break}case"html":{i+=n.html(d);break}case"link":{i+=n.link(d);break}case"image":{i+=n.image(d);break}case"checkbox":{i+=n.checkbox(d);break}case"strong":{i+=n.strong(d);break}case"em":{i+=n.em(d);break}case"codespan":{i+=n.codespan(d);break}case"br":{i+=n.br(d);break}case"del":{i+=n.del(d);break}case"text":{i+=n.text(d);break}default:{let p='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return i}},uo=(ei=class{constructor(t){$e(this,"options");$e(this,"block");this.options=t||Sn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Ut.lex:Ut.lexInline}provideParser(t=this.block){return t?Ht.parse:Ht.parseInline}},$e(ei,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),$e(ei,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ei),Ml=class{constructor(...t){$e(this,"defaults",Mi());$e(this,"options",this.setOptions);$e(this,"parse",this.parseMarkdown(!0));$e(this,"parseInline",this.parseMarkdown(!1));$e(this,"Parser",Ht);$e(this,"Renderer",co);$e(this,"TextRenderer",Li);$e(this,"Lexer",Ut);$e(this,"Tokenizer",Xo);$e(this,"Hooks",uo);this.use(...t)}walkTokens(t,o){var i,a;let n=[];for(let c of t)switch(n=n.concat(o.call(this,c)),c.type){case"table":{let s=c;for(let f of s.header)n=n.concat(this.walkTokens(f.tokens,o));for(let f of s.rows)for(let d of f)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let s=c;n=n.concat(this.walkTokens(s.items,o));break}default:{let s=c;(a=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[s.type]?this.defaults.extensions.childTokens[s.type].forEach(f=>{let d=s[f].flat(1/0);n=n.concat(this.walkTokens(d,o))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,o)))}}return n}use(...t){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let c=o.renderers[a.name];c?o.renderers[a.name]=function(...s){let f=a.renderer.apply(this,s);return f===!1&&(f=c.apply(this,s)),f}:o.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 c=o[a.level];c?c.unshift(a.tokenizer):o[a.level]=[a.tokenizer],a.start&&(a.level==="block"?o.startBlock?o.startBlock.push(a.start):o.startBlock=[a.start]:a.level==="inline"&&(o.startInline?o.startInline.push(a.start):o.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(o.childTokens[a.name]=a.childTokens)}),i.extensions=o),n.renderer){let a=this.defaults.renderer||new co(this.defaults);for(let c in n.renderer){if(!(c in a))throw new Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;let s=c,f=n.renderer[s],d=a[s];a[s]=(...p)=>{let h=f.apply(a,p);return h===!1&&(h=d.apply(a,p)),h||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Xo(this.defaults);for(let c in n.tokenizer){if(!(c in a))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;let s=c,f=n.tokenizer[s],d=a[s];a[s]=(...p)=>{let h=f.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new uo;for(let c in n.hooks){if(!(c in a))throw new Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;let s=c,f=n.hooks[s],d=a[s];uo.passThroughHooks.has(c)?a[s]=p=>{if(this.defaults.async&&uo.passThroughHooksRespectAsync.has(c))return(async()=>{let y=await f.call(a,p);return d.call(a,y)})();let h=f.call(a,p);return d.call(a,h)}:a[s]=(...p)=>{if(this.defaults.async)return(async()=>{let y=await f.apply(a,p);return y===!1&&(y=await d.apply(a,p)),y})();let h=f.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,c=n.walkTokens;i.walkTokens=function(s){let f=[];return f.push(c.call(this,s)),a&&(f=f.concat(a.call(this,s))),f}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return Ut.lex(t,o??this.defaults)}parser(t,o){return Ht.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},a={...this.defaults,...i},c=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return c(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 o>"u"||o===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", 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(o):o,f=await(a.hooks?await a.hooks.provideLexer(t):t?Ut.lex:Ut.lexInline)(s,a),d=a.hooks?await a.hooks.processAllTokens(f):f;a.walkTokens&&await Promise.all(this.walkTokens(d,a.walkTokens));let p=await(a.hooks?await a.hooks.provideParser(t):t?Ht.parse:Ht.parseInline)(d,a);return a.hooks?await a.hooks.postprocess(p):p})().catch(c);try{a.hooks&&(o=a.hooks.preprocess(o));let s=(a.hooks?a.hooks.provideLexer(t):t?Ut.lex:Ut.lexInline)(o,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let f=(a.hooks?a.hooks.provideParser(t):t?Ht.parse:Ht.parseInline)(s,a);return a.hooks&&(f=a.hooks.postprocess(f)),f}catch(s){return c(s)}}}onError(t,o){return n=>{if(n.message+=`
127
- Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Yt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Cn=new Ml;function De(t,o){return Cn.parse(t,o)}De.options=De.setOptions=function(t){return Cn.setOptions(t),De.defaults=Cn.defaults,dl(De.defaults),De},De.getDefaults=Mi,De.defaults=Sn,De.use=function(...t){return Cn.use(...t),De.defaults=Cn.defaults,dl(De.defaults),De},De.walkTokens=function(t,o){return Cn.walkTokens(t,o)},De.parseInline=Cn.parseInline,De.Parser=Ht,De.parser=Ht.parse,De.Renderer=co,De.TextRenderer=Li,De.Lexer=Ut,De.lexer=Ut.lex,De.Tokenizer=Xo,De.Hooks=uo,De.parse=De,De.options,De.setOptions,De.use,De.walkTokens,De.parseInline,Ht.parse,Ut.lex;/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */function Al(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,i=Array(o);n<o;n++)i[n]=t[n];return i}function bm(t){if(Array.isArray(t))return t}function km(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,a,c,s,f=[],d=!0,p=!1;try{if(c=(n=n.call(t)).next,o!==0)for(;!(d=(i=c.call(n)).done)&&(f.push(i.value),f.length!==o);d=!0);}catch(h){p=!0,a=h}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(p)throw a}}return f}}function ym(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
128
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Em(t,o){return bm(t)||km(t,o)||xm(t,o)||ym()}function xm(t,o){if(t){if(typeof t=="string")return Al(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Al(t,o):void 0}}const _l=Object.entries,Rl=Object.setPrototypeOf,wm=Object.isFrozen,Nm=Object.getPrototypeOf,Sm=Object.getOwnPropertyDescriptor;let pt=Object.freeze,Ot=Object.seal,Fn=Object.create,Bl=typeof Reflect<"u"&&Reflect,Di=Bl.apply,Vi=Bl.construct;pt||(pt=function(o){return o}),Ot||(Ot=function(o){return o}),Di||(Di=function(o,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),c=2;c<i;c++)a[c-2]=arguments[c];return o.apply(n,a)}),Vi||(Vi=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return new o(...i)});const Mn=et(Array.prototype.forEach),Tm=et(Array.prototype.lastIndexOf),vl=et(Array.prototype.pop),Un=et(Array.prototype.push),Cm=et(Array.prototype.splice),ht=Array.isArray,fo=et(String.prototype.toLowerCase),$i=et(String.prototype.toString),zl=et(String.prototype.match),Hn=et(String.prototype.replace),Il=et(String.prototype.indexOf),Mm=et(String.prototype.trim),Am=et(Number.prototype.toString),_m=et(Boolean.prototype.toString),Ol=typeof BigInt>"u"?null:et(BigInt.prototype.toString),Ll=typeof Symbol>"u"?null:et(Symbol.prototype.toString),je=et(Object.prototype.hasOwnProperty),mo=et(Object.prototype.toString),lt=et(RegExp.prototype.test),Wn=Rm(TypeError);function et(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return Di(t,o,i)}}function Rm(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Vi(t,n)}}function we(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo;if(Rl&&Rl(t,null),!ht(o))return t;let i=o.length;for(;i--;){let a=o[i];if(typeof a=="string"){const c=n(a);c!==a&&(wm(o)||(o[i]=c),a=c)}t[a]=!0}return t}function Bm(t){for(let o=0;o<t.length;o++)je(t,o)||(t[o]=null);return t}function ut(t){const o=Fn(null);for(const i of _l(t)){var n=Em(i,2);const a=n[0],c=n[1];je(t,a)&&(ht(c)?o[a]=Bm(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=ut(c):o[a]=c)}return o}function vm(t){switch(typeof t){case"string":return t;case"number":return Am(t);case"boolean":return _m(t);case"bigint":return Ol?Ol(t):"0";case"symbol":return Ll?Ll(t):"Symbol()";case"undefined":return mo(t);case"function":case"object":{if(t===null)return mo(t);const o=t,n=qt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:mo(i)}return mo(t)}default:return mo(t)}}function qt(t,o){for(;t!==null;){const i=Sm(t,o);if(i){if(i.get)return et(i.get);if(typeof i.value=="function")return et(i.value)}t=Nm(t)}function n(){return null}return n}function zm(t){try{return lt(t,""),!0}catch{return!1}}const Dl=pt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Pi=pt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Fi=pt(["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"]),Im=pt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ui=pt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Om=pt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Vl=pt(["#text"]),$l=pt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Hi=pt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Pl=pt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Zo=pt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Lm=Ot(/{{[\w\W]*|^[\w\W]*}}/g),Dm=Ot(/<%[\w\W]*|^[\w\W]*%>/g),Vm=Ot(/\${[\w\W]*/g),$m=Ot(/^data-[\-\w.\u00B7-\uFFFF]+$/),Pm=Ot(/^aria-[\-\w]+$/),Fl=Ot(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fm=Ot(/^(?:\w+script|data):/i),Um=Ot(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hm=Ot(/^html$/i),Wm=Ot(/^[a-z][.\w]*(-[.\w]+)+$/i),Xt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Gm=function(){return typeof window>"u"?null:window},jm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(i=n.getAttribute(a));const c="dompurify"+(i?"#"+i:"");try{return o.createPolicy(c,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Ul=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Hl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gm();const o=le=>Hl(le);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Xt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,a=i.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,s=t.Node,f=t.Element,d=t.NodeFilter,p=t.NamedNodeMap;p===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,y=t.trustedTypes,C=f.prototype,D=qt(C,"cloneNode"),_=qt(C,"remove"),F=qt(C,"nextSibling"),R=qt(C,"childNodes"),M=qt(C,"parentNode"),k=qt(C,"shadowRoot"),u=qt(C,"attributes"),N=s&&s.prototype?qt(s.prototype,"nodeType"):null,$=s&&s.prototype?qt(s.prototype,"nodeName"):null;if(typeof c=="function"){const le=n.createElement("template");le.content&&le.content.ownerDocument&&(n=le.content.ownerDocument)}let j,q="",x=0;const ae=function(g){if(x>0)throw Wn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');x++;try{return j.createHTML(g)}finally{x--}},fe=n,me=fe.implementation,J=fe.createNodeIterator,ge=fe.createDocumentFragment,de=fe.getElementsByTagName,ye=i.importNode;let b=Ul();o.isSupported=typeof _l=="function"&&typeof M=="function"&&me&&me.createHTMLDocument!==void 0;const L=Lm,G=Dm,ee=Vm,be=$m,O=Pm,B=Fm,oe=Um,te=Wm;let V=Fl,w=null;const P=we({},[...Dl,...Pi,...Fi,...Ui,...Vl]);let H=null;const ie=we({},[...$l,...Hi,...Pl,...Zo]);let xe=Object.seal(Fn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Je=null,Tt=null;const it=Object.seal(Fn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nn=!0,Qe=!0,Zt=!1,Jt=!0,ce=!1,Ct=!0,Ve=!1,Be=!1,Lt=!1,tt=!1,gt=!1,Qt=!1,X=!0,se=!1;const Ee="user-content-";let Ae=!0,He=!1,rt={},yt=null;const _n=we({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ti=null;const ni=we({},["audio","video","img","source","image","track"]);let po=null;const oi=we({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),jn="http://www.w3.org/1998/Math/MathML",Kn="http://www.w3.org/2000/svg",Dt="http://www.w3.org/1999/xhtml";let mn=Dt,ho=!1,go=null;const Wi=we({},[jn,Kn,Dt],$i);let bo=we({},["mi","mo","mn","ms","mtext"]),ko=we({},["annotation-xml"]);const Gi=we({},["title","style","font","a","script"]);let pn=null;const ji=["application/xhtml+xml","text/html"],ii="text/html";let Ge=null,on=null;const Ki=n.createElement("form"),yo=function(g){return g instanceof RegExp||g instanceof Function},Yn=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(on&&on===g)return;(!g||typeof g!="object")&&(g={}),g=ut(g),pn=ji.indexOf(g.PARSER_MEDIA_TYPE)===-1?ii:g.PARSER_MEDIA_TYPE,Ge=pn==="application/xhtml+xml"?$i:fo,w=je(g,"ALLOWED_TAGS")&&ht(g.ALLOWED_TAGS)?we({},g.ALLOWED_TAGS,Ge):P,H=je(g,"ALLOWED_ATTR")&&ht(g.ALLOWED_ATTR)?we({},g.ALLOWED_ATTR,Ge):ie,go=je(g,"ALLOWED_NAMESPACES")&&ht(g.ALLOWED_NAMESPACES)?we({},g.ALLOWED_NAMESPACES,$i):Wi,po=je(g,"ADD_URI_SAFE_ATTR")&&ht(g.ADD_URI_SAFE_ATTR)?we(ut(oi),g.ADD_URI_SAFE_ATTR,Ge):oi,ti=je(g,"ADD_DATA_URI_TAGS")&&ht(g.ADD_DATA_URI_TAGS)?we(ut(ni),g.ADD_DATA_URI_TAGS,Ge):ni,yt=je(g,"FORBID_CONTENTS")&&ht(g.FORBID_CONTENTS)?we({},g.FORBID_CONTENTS,Ge):_n,Je=je(g,"FORBID_TAGS")&&ht(g.FORBID_TAGS)?we({},g.FORBID_TAGS,Ge):ut({}),Tt=je(g,"FORBID_ATTR")&&ht(g.FORBID_ATTR)?we({},g.FORBID_ATTR,Ge):ut({}),rt=je(g,"USE_PROFILES")?g.USE_PROFILES&&typeof g.USE_PROFILES=="object"?ut(g.USE_PROFILES):g.USE_PROFILES:!1,nn=g.ALLOW_ARIA_ATTR!==!1,Qe=g.ALLOW_DATA_ATTR!==!1,Zt=g.ALLOW_UNKNOWN_PROTOCOLS||!1,Jt=g.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ce=g.SAFE_FOR_TEMPLATES||!1,Ct=g.SAFE_FOR_XML!==!1,Ve=g.WHOLE_DOCUMENT||!1,tt=g.RETURN_DOM||!1,gt=g.RETURN_DOM_FRAGMENT||!1,Qt=g.RETURN_TRUSTED_TYPE||!1,Lt=g.FORCE_BODY||!1,X=g.SANITIZE_DOM!==!1,se=g.SANITIZE_NAMED_PROPS||!1,Ae=g.KEEP_CONTENT!==!1,He=g.IN_PLACE||!1,V=zm(g.ALLOWED_URI_REGEXP)?g.ALLOWED_URI_REGEXP:Fl,mn=typeof g.NAMESPACE=="string"?g.NAMESPACE:Dt,bo=je(g,"MATHML_TEXT_INTEGRATION_POINTS")&&g.MATHML_TEXT_INTEGRATION_POINTS&&typeof g.MATHML_TEXT_INTEGRATION_POINTS=="object"?ut(g.MATHML_TEXT_INTEGRATION_POINTS):we({},["mi","mo","mn","ms","mtext"]),ko=je(g,"HTML_INTEGRATION_POINTS")&&g.HTML_INTEGRATION_POINTS&&typeof g.HTML_INTEGRATION_POINTS=="object"?ut(g.HTML_INTEGRATION_POINTS):we({},["annotation-xml"]);const I=je(g,"CUSTOM_ELEMENT_HANDLING")&&g.CUSTOM_ELEMENT_HANDLING&&typeof g.CUSTOM_ELEMENT_HANDLING=="object"?ut(g.CUSTOM_ELEMENT_HANDLING):Fn(null);if(xe=Fn(null),je(I,"tagNameCheck")&&yo(I.tagNameCheck)&&(xe.tagNameCheck=I.tagNameCheck),je(I,"attributeNameCheck")&&yo(I.attributeNameCheck)&&(xe.attributeNameCheck=I.attributeNameCheck),je(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(xe.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),ce&&(Qe=!1),gt&&(tt=!0),rt&&(w=we({},Vl),H=Fn(null),rt.html===!0&&(we(w,Dl),we(H,$l)),rt.svg===!0&&(we(w,Pi),we(H,Hi),we(H,Zo)),rt.svgFilters===!0&&(we(w,Fi),we(H,Hi),we(H,Zo)),rt.mathMl===!0&&(we(w,Ui),we(H,Pl),we(H,Zo))),it.tagCheck=null,it.attributeCheck=null,je(g,"ADD_TAGS")&&(typeof g.ADD_TAGS=="function"?it.tagCheck=g.ADD_TAGS:ht(g.ADD_TAGS)&&(w===P&&(w=ut(w)),we(w,g.ADD_TAGS,Ge))),je(g,"ADD_ATTR")&&(typeof g.ADD_ATTR=="function"?it.attributeCheck=g.ADD_ATTR:ht(g.ADD_ATTR)&&(H===ie&&(H=ut(H)),we(H,g.ADD_ATTR,Ge))),je(g,"ADD_URI_SAFE_ATTR")&&ht(g.ADD_URI_SAFE_ATTR)&&we(po,g.ADD_URI_SAFE_ATTR,Ge),je(g,"FORBID_CONTENTS")&&ht(g.FORBID_CONTENTS)&&(yt===_n&&(yt=ut(yt)),we(yt,g.FORBID_CONTENTS,Ge)),je(g,"ADD_FORBID_CONTENTS")&&ht(g.ADD_FORBID_CONTENTS)&&(yt===_n&&(yt=ut(yt)),we(yt,g.ADD_FORBID_CONTENTS,Ge)),Ae&&(w["#text"]=!0),Ve&&we(w,["html","head","body"]),w.table&&(we(w,["tbody"]),delete Je.tbody),g.TRUSTED_TYPES_POLICY){if(typeof g.TRUSTED_TYPES_POLICY.createHTML!="function")throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof g.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Wn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Q=j;j=g.TRUSTED_TYPES_POLICY;try{q=ae("")}catch(ve){throw j=Q,ve}}else j===void 0&&g.TRUSTED_TYPES_POLICY!==null&&(j=jm(y,a)),j&&typeof q=="string"&&(q=ae(""));(b.uponSanitizeElement.length>0||b.uponSanitizeAttribute.length>0)&&w===P&&(w=ut(w)),b.uponSanitizeAttribute.length>0&&H===ie&&(H=ut(H)),pt&&pt(g),on=g},hn=we({},[...Pi,...Fi,...Im]),ri=we({},[...Ui,...Om]),Yi=function(g){let I=M(g);(!I||!I.tagName)&&(I={namespaceURI:mn,tagName:"template"});const Q=fo(g.tagName),ve=fo(I.tagName);return go[g.namespaceURI]?g.namespaceURI===Kn?I.namespaceURI===Dt?Q==="svg":I.namespaceURI===jn?Q==="svg"&&(ve==="annotation-xml"||bo[ve]):!!hn[Q]:g.namespaceURI===jn?I.namespaceURI===Dt?Q==="math":I.namespaceURI===Kn?Q==="math"&&ko[ve]:!!ri[Q]:g.namespaceURI===Dt?I.namespaceURI===Kn&&!ko[ve]||I.namespaceURI===jn&&!bo[ve]?!1:!ri[Q]&&(Gi[Q]||!hn[Q]):!!(pn==="application/xhtml+xml"&&go[g.namespaceURI]):!1},Et=function(g){Un(o.removed,{element:g});try{M(g).removeChild(g)}catch{_(g)}},en=function(g,I){try{Un(o.removed,{attribute:I.getAttributeNode(g),from:I})}catch{Un(o.removed,{attribute:null,from:I})}if(I.removeAttribute(g),g==="is")if(tt||gt)try{Et(I)}catch{}else try{I.setAttribute(g,"")}catch{}},qn=function(g){let I=null,Q=null;if(Lt)g="<remove></remove>"+g;else{const Oe=zl(g,/^[\r\n\t ]+/);Q=Oe&&Oe[0]}pn==="application/xhtml+xml"&&mn===Dt&&(g='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+g+"</body></html>");const ve=j?ae(g):g;if(mn===Dt)try{I=new h().parseFromString(ve,pn)}catch{}if(!I||!I.documentElement){I=me.createDocument(mn,"template",null);try{I.documentElement.innerHTML=ho?q:ve}catch{}}const Ne=I.body||I.documentElement;return g&&Q&&Ne.insertBefore(n.createTextNode(Q),Ne.childNodes[0]||null),mn===Dt?de.call(I,Ve?"html":"body")[0]:Ve?I.documentElement:Ne},Xn=function(g){return J.call(g.ownerDocument||g,g,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Eo=function(g){var I,Q;g.normalize();const ve=J.call(g.ownerDocument||g,g,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let Ne=ve.nextNode();for(;Ne;){let Ke=Ne.data;Mn([L,G,ee],at=>{Ke=Hn(Ke,at," ")}),Ne.data=Ke,Ne=ve.nextNode()}const Oe=(I=(Q=g.querySelectorAll)===null||Q===void 0?void 0:Q.call(g,"template"))!==null&&I!==void 0?I:[];Mn(Array.from(Oe),Ke=>{gn(Ke.content)&&Eo(Ke.content)})},Zn=function(g){const I=$?$(g):null;return typeof I!="string"||Ge(I)!=="form"?!1:typeof g.nodeName!="string"||typeof g.textContent!="string"||typeof g.removeChild!="function"||g.attributes!==u(g)||typeof g.removeAttribute!="function"||typeof g.setAttribute!="function"||typeof g.namespaceURI!="string"||typeof g.insertBefore!="function"||typeof g.hasChildNodes!="function"||g.nodeType!==N(g)||g.childNodes!==R(g)},gn=function(g){if(!N||typeof g!="object"||g===null)return!1;try{return N(g)===Xt.documentFragment}catch{return!1}},bn=function(g){if(!N||typeof g!="object"||g===null)return!1;try{return typeof N(g)=="number"}catch{return!1}};function Mt(le,g,I){Mn(le,Q=>{Q.call(o,g,I,on)})}const Wt=function(g){let I=null;if(Mt(b.beforeSanitizeElements,g,null),Zn(g))return Et(g),!0;const Q=Ge($?$(g):g.nodeName);if(Mt(b.uponSanitizeElement,g,{tagName:Q,allowedTags:w}),Ct&&g.hasChildNodes()&&!bn(g.firstElementChild)&&lt(/<[/\w!]/g,g.innerHTML)&&lt(/<[/\w!]/g,g.textContent)||Ct&&g.namespaceURI===Dt&&Q==="style"&&bn(g.firstElementChild)||g.nodeType===Xt.progressingInstruction||Ct&&g.nodeType===Xt.comment&&lt(/<[/\w]/g,g.data))return Et(g),!0;if(Je[Q]||!(it.tagCheck instanceof Function&&it.tagCheck(Q))&&!w[Q]){if(!Je[Q]&&li(Q)&&(xe.tagNameCheck instanceof RegExp&&lt(xe.tagNameCheck,Q)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(Q)))return!1;if(Ae&&!yt[Q]){const Ne=M(g),Oe=R(g);if(Oe&&Ne){const Ke=Oe.length;for(let at=Ke-1;at>=0;--at){const At=D(Oe[at],!0);Ne.insertBefore(At,F(g))}}}return Et(g),!0}return(N?N(g):g.nodeType)===Xt.element&&!Yi(g)||(Q==="noscript"||Q==="noembed"||Q==="noframes")&&lt(/<\/no(script|embed|frames)/i,g.innerHTML)?(Et(g),!0):(ce&&g.nodeType===Xt.text&&(I=g.textContent,Mn([L,G,ee],Ne=>{I=Hn(I,Ne," ")}),g.textContent!==I&&(Un(o.removed,{element:g.cloneNode()}),g.textContent=I)),Mt(b.afterSanitizeElements,g,null),!1)},Ie=function(g,I,Q){if(Tt[I]||X&&(I==="id"||I==="name")&&(Q in n||Q in Ki))return!1;const ve=H[I]||it.attributeCheck instanceof Function&&it.attributeCheck(I,g);if(!(Qe&&!Tt[I]&&lt(be,I))){if(!(nn&&lt(O,I))){if(!ve||Tt[I]){if(!(li(g)&&(xe.tagNameCheck instanceof RegExp&&lt(xe.tagNameCheck,g)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(g))&&(xe.attributeNameCheck instanceof RegExp&&lt(xe.attributeNameCheck,I)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(I,g))||I==="is"&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&lt(xe.tagNameCheck,Q)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(Q))))return!1}else if(!po[I]){if(!lt(V,Hn(Q,oe,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&g!=="script"&&Il(Q,"data:")===0&&ti[g])){if(!(Zt&&!lt(B,Hn(Q,oe,"")))){if(Q)return!1}}}}}}return!0},Te=we({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),li=function(g){return!Te[fo(g)]&&lt(te,g)},bt=function(g){Mt(b.beforeSanitizeAttributes,g,null);const I=g.attributes;if(!I||Zn(g))return;const Q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let ve=I.length;for(;ve--;){const Ne=I[ve],Oe=Ne.name,Ke=Ne.namespaceURI,at=Ne.value,At=Ge(Oe),Jn=at;let Pe=Oe==="value"?Jn:Mm(Jn);if(Q.attrName=At,Q.attrValue=Pe,Q.keepAttr=!0,Q.forceKeepAttr=void 0,Mt(b.uponSanitizeAttribute,g,Q),Pe=Q.attrValue,se&&(At==="id"||At==="name")&&Il(Pe,Ee)!==0&&(en(Oe,g),Pe=Ee+Pe),Ct&&lt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Pe)){en(Oe,g);continue}if(At==="attributename"&&zl(Pe,"href")){en(Oe,g);continue}if(Q.forceKeepAttr)continue;if(!Q.keepAttr){en(Oe,g);continue}if(!Jt&&lt(/\/>/i,Pe)){en(Oe,g);continue}ce&&Mn([L,G,ee],wo=>{Pe=Hn(Pe,wo," ")});const xo=Ge(g.nodeName);if(!Ie(xo,At,Pe)){en(Oe,g);continue}if(j&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!Ke)switch(y.getAttributeType(xo,At)){case"TrustedHTML":{Pe=ae(Pe);break}case"TrustedScriptURL":{Pe=j.createScriptURL(Pe);break}}if(Pe!==Jn)try{Ke?g.setAttributeNS(Ke,Oe,Pe):g.setAttribute(Oe,Pe),Zn(g)?Et(g):vl(o.removed)}catch{en(Oe,g)}}Mt(b.afterSanitizeAttributes,g,null)},kn=function(g){let I=null;const Q=Xn(g);for(Mt(b.beforeSanitizeShadowDOM,g,null);I=Q.nextNode();)if(Mt(b.uponSanitizeShadowNode,I,null),Wt(I),bt(I),gn(I.content)&&kn(I.content),(N?N(I):I.nodeType)===Xt.element){const Ne=k?k(I):I.shadowRoot;gn(Ne)&&(U(Ne),kn(Ne))}Mt(b.afterSanitizeShadowDOM,g,null)},U=function(g){const I=N?N(g):g.nodeType;if(I===Xt.element){const Ne=k?k(g):g.shadowRoot;gn(Ne)&&(U(Ne),kn(Ne))}const Q=R?R(g):g.childNodes;if(!Q)return;const ve=[];Mn(Q,Ne=>{Un(ve,Ne)});for(const Ne of ve)U(Ne);if(I===Xt.element){const Ne=$?$(g):null;if(typeof Ne=="string"&&Ge(Ne)==="template"){const Oe=g.content;gn(Oe)&&U(Oe)}}};return o.sanitize=function(le){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,Q=null,ve=null,Ne=null;if(ho=!le,ho&&(le="<!-->"),typeof le!="string"&&!bn(le)&&(le=vm(le),typeof le!="string"))throw Wn("dirty is not a string, aborting");if(!o.isSupported)return le;if(Be||Yn(g),o.removed=[],typeof le=="string"&&(He=!1),He){const at=$?$(le):le.nodeName;if(typeof at=="string"){const At=Ge(at);if(!w[At]||Je[At])throw Wn("root node is forbidden and cannot be sanitized in-place")}if(Zn(le))throw Wn("root node is clobbered and cannot be sanitized in-place");U(le)}else if(bn(le))I=qn("<!---->"),Q=I.ownerDocument.importNode(le,!0),Q.nodeType===Xt.element&&Q.nodeName==="BODY"||Q.nodeName==="HTML"?I=Q:I.appendChild(Q),U(Q);else{if(!tt&&!ce&&!Ve&&le.indexOf("<")===-1)return j&&Qt?ae(le):le;if(I=qn(le),!I)return tt?null:Qt?q:""}I&&Lt&&Et(I.firstChild);const Oe=Xn(He?le:I);for(;ve=Oe.nextNode();)Wt(ve),bt(ve),gn(ve.content)&&kn(ve.content);if(He)return ce&&Eo(le),le;if(tt){if(ce&&Eo(I),gt)for(Ne=ge.call(I.ownerDocument);I.firstChild;)Ne.appendChild(I.firstChild);else Ne=I;return(H.shadowroot||H.shadowrootmode)&&(Ne=ye.call(i,Ne,!0)),Ne}let Ke=Ve?I.outerHTML:I.innerHTML;return Ve&&w["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&lt(Hm,I.ownerDocument.doctype.name)&&(Ke="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
129
- `+Ke),ce&&Mn([L,G,ee],at=>{Ke=Hn(Ke,at," ")}),j&&Qt?ae(Ke):Ke},o.setConfig=function(){let le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yn(le),Be=!0},o.clearConfig=function(){on=null,Be=!1},o.isValidAttribute=function(le,g,I){on||Yn({});const Q=Ge(le),ve=Ge(g);return Ie(Q,ve,I)},o.addHook=function(le,g){typeof g=="function"&&Un(b[le],g)},o.removeHook=function(le,g){if(g!==void 0){const I=Tm(b[le],g);return I===-1?void 0:Cm(b[le],I,1)[0]}return vl(b[le])},o.removeHooks=function(le){b[le]=[]},o.removeAllHooks=function(){b=Ul()},o}var Km=Hl();const Ym=new Ml({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new co;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),a=Ti(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${a}</code></pre>`},t})()}),qm=["p","br","strong","em","del","s","u","a","ul","ol","li","h1","h2","h3","h4","h5","h6","blockquote","code","pre","hr","table","thead","tbody","tr","th","td","img","span","input"],Xm=["href","title","target","rel","src","alt","class","checked","type","disabled"],Zm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Jm(t){if(!t)return"";const o=Ym.parse(t,{async:!1});return Km.sanitize(o,{ALLOWED_TAGS:qm,ALLOWED_ATTR:Xm,ALLOWED_URI_REGEXP:Zm})}const Qm={class:"zm-note-panel"},ep={key:0,class:"zm-note-empty"},tp={class:"zm-note-header"},np={class:"zm-note-title-row"},op={class:"zm-note-name"},ip={class:"zm-note-meta"},rp={class:"zm-note-scroll"},lp={class:"zm-note-section"},ap={class:"zm-note-section-head"},sp={class:"zm-note-split"},cp=["disabled"],dp={key:0,class:"zm-note-preview"},up=["innerHTML"],fp={key:1,class:"zm-note-preview-hint"},mp={key:0,class:"zm-note-section-actions"},pp={key:0,class:"zm-note-add-row"},hp={key:1,class:"zm-note-section"},gp=["disabled"],bp=["href","title"],kp={key:2,class:"zm-note-section"},yp=["disabled"],Ep=["src","alt"],xp={key:3,class:"zm-note-section"},wp={class:"zm-note-section-head"},Np={key:0,class:"zm-note-section-tag"},Sp=["disabled"],Tp={key:0,class:"zm-note-code"},Cp=["innerHTML"],Mp={key:4,class:"zm-note-section"},Ap=["disabled"],_p={key:0,class:"zm-note-table"},Jo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null);gi(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),f=e.computed(()=>Jm(a.value)),d=e.ref(!0);function p(){d.value=!d.value}e.watch(()=>{var O,B,oe;return[(O=n.selectedNode)==null?void 0:O.id,(oe=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:oe.text]},()=>{var O,B;a.value=((B=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:B.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const O=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(O){O.focus();const B=O.value.length;O.setSelectionRange(B,B)}});function h(){var oe,te;if(n.readonly)return;const O=a.value,B=((te=(oe=n.selectedNode)==null?void 0:oe.note)==null?void 0:te.text)??"";O!==B&&i("apply",O)}function y(O){var B,oe;n.readonly||(O.key==="Escape"?(O.preventDefault(),a.value=((oe=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:oe.text)??"",O.target.blur()):O.key==="Enter"&&(O.ctrlKey||O.metaKey)&&(O.preventDefault(),h(),O.target.blur()))}function C(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",i("remove"))}const D=e.computed(()=>{var O,B;return!!((B=(O=n.selectedNode)==null?void 0:O.link)!=null&&B.url)}),_=e.computed(()=>{var O,B;return!!((B=(O=n.selectedNode)==null?void 0:O.image)!=null&&B.src)}),F=e.computed(()=>{var O,B;return(B=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:B.kind}),R=e.computed(()=>F.value==="code"),M=e.computed(()=>F.value==="table"),k=e.ref(!1),u=e.ref(!1),N=e.ref(!1),$=e.ref(!1);e.watch(()=>{var O;return(O=n.selectedNode)==null?void 0:O.id},()=>{k.value=!1,u.value=!1,N.value=!1,$.value=!1});const j=e.ref("");e.watch(()=>{var O,B,oe;return[(O=n.selectedNode)==null?void 0:O.id,(oe=(B=n.selectedNode)==null?void 0:B.link)==null?void 0:oe.url]},()=>{var O,B;j.value=((B=(O=n.selectedNode)==null?void 0:O.link)==null?void 0:B.url)??""},{immediate:!0});function q(){var oe,te;if(n.readonly)return;const O=j.value.trim(),B=((te=(oe=n.selectedNode)==null?void 0:oe.link)==null?void 0:te.url)??"";O!==B&&i("set-link",O)}const x=e.ref("");e.watch(()=>{var O,B,oe;return[(O=n.selectedNode)==null?void 0:O.id,(oe=(B=n.selectedNode)==null?void 0:B.image)==null?void 0:oe.src]},()=>{var O,B;x.value=((B=(O=n.selectedNode)==null?void 0:O.image)==null?void 0:B.src)??""},{immediate:!0});function ae(){var oe,te;if(n.readonly)return;const O=x.value.trim(),B=((te=(oe=n.selectedNode)==null?void 0:oe.image)==null?void 0:te.src)??"";O!==B&&i("set-image",O)}function fe(O){const B=O.target;B.style.display="none"}function me(O){const B=O.target;B.style.display=""}const J=e.ref(""),ge=e.ref(null);gi(ge,{minRows:4,maxRows:18}),e.watch(()=>{var O,B,oe;return[(O=n.selectedNode)==null?void 0:O.id,(oe=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:oe.raw]},()=>{var O,B;J.value=((B=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:B.raw)??""},{immediate:!0});const de=e.computed(()=>Ti(Go(J.value),Nn(J.value)));function ye(){var te,V;if(n.readonly)return;const O=J.value,B=((V=(te=n.selectedNode)==null?void 0:te.richContent)==null?void 0:V.raw)??"";if(O===B)return;const oe=Nn(O)||void 0;i("set-rich",O?{kind:"code",raw:O,lang:oe}:null)}const b=e.ref(""),L=e.ref(null);gi(L,{minRows:4,maxRows:14}),e.watch(()=>{var O,B,oe;return[(O=n.selectedNode)==null?void 0:O.id,(oe=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:oe.raw]},()=>{var O,B;b.value=((B=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:B.raw)??""},{immediate:!0});function G(){var oe,te;if(n.readonly)return;const O=b.value,B=((te=(oe=n.selectedNode)==null?void 0:oe.richContent)==null?void 0:te.raw)??"";O!==B&&i("set-rich",O?{kind:"table",raw:O}:null)}const ee=e.computed(()=>Ci(b.value)),be=e.computed(()=>{const O=[];return s.value||O.push(`${a.value.length} 字`),D.value&&O.push("1 链接"),_.value&&O.push("1 图片"),R.value&&O.push("代码块"),M.value&&O.push("表格"),O.length===0?"节点没有额外内容":O.join(" · ")});return(O,B)=>{var oe,te,V,w;return e.openBlock(),e.createElementBlock("div",Qm,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",tp,[e.createElementVNode("div",np,[B[12]||(B[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",op,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",ip,e.toDisplayString(be.value),1)]),e.createElementVNode("div",rp,[e.createElementVNode("section",lp,[e.createElementVNode("header",ap,[B[13]||(B[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),B[14]||(B[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:p},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",sp,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":B[0]||(B[0]=P=>a.value=P),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:h,onKeydown:y},null,40,cp),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",dp,[s.value?(e.openBlock(),e.createElementBlock("div",fp," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:f.value},null,8,up))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",mp,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:C},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",pp,[!D.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:B[1]||(B[1]=P=>k.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!_.value&&!u.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:B[2]||(B[2]=P=>u.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!R.value&&!N.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:B[3]||(B[3]=P=>N.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!M.value&&!$.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:B[4]||(B[4]=P=>$.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),D.value||k.value?(e.openBlock(),e.createElementBlock("section",hp,[B[15]||(B[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[5]||(B[5]=P=>j.value=P),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:q,onKeydown:B[6]||(B[6]=e.withKeys(e.withModifiers(P=>P.target.blur(),["prevent"]),["enter"]))},null,40,gp),[[e.vModelText,j.value]]),D.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(oe=t.selectedNode.link)==null?void 0:oe.url,target:"_blank",rel:"noopener noreferrer",title:(te=t.selectedNode.link)==null?void 0:te.url},e.toDisplayString((V=t.selectedNode.link)==null?void 0:V.url),9,bp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||u.value?(e.openBlock(),e.createElementBlock("section",kp,[B[16]||(B[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[7]||(B[7]=P=>x.value=P),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ae,onKeydown:B[8]||(B[8]=e.withKeys(e.withModifiers(P=>P.target.blur(),["prevent"]),["enter"]))},null,40,yp),[[e.vModelText,x.value]]),_.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(w=t.selectedNode.image)==null?void 0:w.src,alt:t.selectedNode.text,onError:fe,onLoad:me},null,40,Ep)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||N.value?(e.openBlock(),e.createElementBlock("section",xp,[e.createElementVNode("header",wp,[B[17]||(B[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(Nn)(J.value)?(e.openBlock(),e.createElementBlock("span",Np,e.toDisplayString(e.unref(Nn)(J.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:ge,"onUpdate:modelValue":B[9]||(B[9]=P=>J.value=P),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:ye},null,40,Sp),[[e.vModelText,J.value]]),J.value.trim()?(e.openBlock(),e.createElementBlock("pre",Tp,[e.createElementVNode("code",{innerHTML:de.value},null,8,Cp)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),M.value||$.value?(e.openBlock(),e.createElementBlock("section",Mp,[B[18]||(B[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:L,"onUpdate:modelValue":B[10]||(B[10]=P=>b.value=P),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
126
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Yt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let i=this.parser.parseInline(n),a=Cl(t);if(a===null)return i;t=a;let c='<a href="'+t+'"';return o&&(c+=' title="'+Yt(o)+'"'),c+=">"+i+"</a>",c}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=Cl(t);if(a===null)return Yt(n);t=a;let c=`<img src="${t}" alt="${Yt(n)}"`;return o&&(c+=` title="${Yt(o)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Yt(t.text)}},Pi=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},Wt=class ar{constructor(o){Ve(this,"options");Ve(this,"renderer");Ve(this,"textRenderer");this.options=o||Tn,this.options.renderer=this.options.renderer||new co,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Pi}static parse(o,n){return new ar(n).parse(o)}static parseInline(o,n){return new ar(n).parseInline(o)}parse(o){var i,a;this.renderer.parser=this;let n="";for(let c=0;c<o.length;c++){let s=o[c];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[s.type]){let d=s,p=this.options.extensions.renderers[d.type].call({parser:this},d);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=p||"";continue}}let u=s;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var a,c;this.renderer.parser=this;let i="";for(let s=0;s<o.length;s++){let u=o[s];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[u.type]){let p=this.options.extensions.renderers[u.type].call({parser:this},u);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=p||"";continue}}let d=u;switch(d.type){case"escape":{i+=n.text(d);break}case"html":{i+=n.html(d);break}case"link":{i+=n.link(d);break}case"image":{i+=n.image(d);break}case"checkbox":{i+=n.checkbox(d);break}case"strong":{i+=n.strong(d);break}case"em":{i+=n.em(d);break}case"codespan":{i+=n.codespan(d);break}case"br":{i+=n.br(d);break}case"del":{i+=n.del(d);break}case"text":{i+=n.text(d);break}default:{let p='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return i}},uo=(ti=class{constructor(t){Ve(this,"options");Ve(this,"block");this.options=t||Tn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Ht.lex:Ht.lexInline}provideParser(t=this.block){return t?Wt.parse:Wt.parseInline}},Ve(ti,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ve(ti,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ti),Rl=class{constructor(...t){Ve(this,"defaults",vi());Ve(this,"options",this.setOptions);Ve(this,"parse",this.parseMarkdown(!0));Ve(this,"parseInline",this.parseMarkdown(!1));Ve(this,"Parser",Wt);Ve(this,"Renderer",co);Ve(this,"TextRenderer",Pi);Ve(this,"Lexer",Ht);Ve(this,"Tokenizer",Zo);Ve(this,"Hooks",uo);this.use(...t)}walkTokens(t,o){var i,a;let n=[];for(let c of t)switch(n=n.concat(o.call(this,c)),c.type){case"table":{let s=c;for(let u of s.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of s.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let s=c;n=n.concat(this.walkTokens(s.items,o));break}default:{let s=c;(a=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[s.type]?this.defaults.extensions.childTokens[s.type].forEach(u=>{let d=s[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,o)))}}return n}use(...t){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let c=o.renderers[a.name];c?o.renderers[a.name]=function(...s){let u=a.renderer.apply(this,s);return u===!1&&(u=c.apply(this,s)),u}:o.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 c=o[a.level];c?c.unshift(a.tokenizer):o[a.level]=[a.tokenizer],a.start&&(a.level==="block"?o.startBlock?o.startBlock.push(a.start):o.startBlock=[a.start]:a.level==="inline"&&(o.startInline?o.startInline.push(a.start):o.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(o.childTokens[a.name]=a.childTokens)}),i.extensions=o),n.renderer){let a=this.defaults.renderer||new co(this.defaults);for(let c in n.renderer){if(!(c in a))throw new Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;let s=c,u=n.renderer[s],d=a[s];a[s]=(...p)=>{let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Zo(this.defaults);for(let c in n.tokenizer){if(!(c in a))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;let s=c,u=n.tokenizer[s],d=a[s];a[s]=(...p)=>{let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new uo;for(let c in n.hooks){if(!(c in a))throw new Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;let s=c,u=n.hooks[s],d=a[s];uo.passThroughHooks.has(c)?a[s]=p=>{if(this.defaults.async&&uo.passThroughHooksRespectAsync.has(c))return(async()=>{let x=await u.call(a,p);return d.call(a,x)})();let h=u.call(a,p);return d.call(a,h)}:a[s]=(...p)=>{if(this.defaults.async)return(async()=>{let x=await u.apply(a,p);return x===!1&&(x=await d.apply(a,p)),x})();let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,c=n.walkTokens;i.walkTokens=function(s){let u=[];return u.push(c.call(this,s)),a&&(u=u.concat(a.call(this,s))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return Ht.lex(t,o??this.defaults)}parser(t,o){return Wt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},a={...this.defaults,...i},c=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return c(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 o>"u"||o===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", 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(o):o,u=await(a.hooks?await a.hooks.provideLexer(t):t?Ht.lex:Ht.lexInline)(s,a),d=a.hooks?await a.hooks.processAllTokens(u):u;a.walkTokens&&await Promise.all(this.walkTokens(d,a.walkTokens));let p=await(a.hooks?await a.hooks.provideParser(t):t?Wt.parse:Wt.parseInline)(d,a);return a.hooks?await a.hooks.postprocess(p):p})().catch(c);try{a.hooks&&(o=a.hooks.preprocess(o));let s=(a.hooks?a.hooks.provideLexer(t):t?Ht.lex:Ht.lexInline)(o,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let u=(a.hooks?a.hooks.provideParser(t):t?Wt.parse:Wt.parseInline)(s,a);return a.hooks&&(u=a.hooks.postprocess(u)),u}catch(s){return c(s)}}}onError(t,o){return n=>{if(n.message+=`
127
+ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Yt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Mn=new Rl;function De(t,o){return Mn.parse(t,o)}De.options=De.setOptions=function(t){return Mn.setOptions(t),De.defaults=Mn.defaults,ml(De.defaults),De},De.getDefaults=vi,De.defaults=Tn,De.use=function(...t){return Mn.use(...t),De.defaults=Mn.defaults,ml(De.defaults),De},De.walkTokens=function(t,o){return Mn.walkTokens(t,o)},De.parseInline=Mn.parseInline,De.Parser=Wt,De.parser=Wt.parse,De.Renderer=co,De.TextRenderer=Pi,De.Lexer=Ht,De.lexer=Ht.lex,De.Tokenizer=Zo,De.Hooks=uo,De.parse=De,De.options,De.setOptions,De.use,De.walkTokens,De.parseInline,Wt.parse,Ht.lex;/*! @license DOMPurify 3.4.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.8/LICENSE */function vl(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,i=Array(o);n<o;n++)i[n]=t[n];return i}function xm(t){if(Array.isArray(t))return t}function wm(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,a,c,s,u=[],d=!0,p=!1;try{if(c=(n=n.call(t)).next,o!==0)for(;!(d=(i=c.call(n)).done)&&(u.push(i.value),u.length!==o);d=!0);}catch(h){p=!0,a=h}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(p)throw a}}return u}}function Nm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
128
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sm(t,o){return xm(t)||wm(t,o)||Tm(t,o)||Nm()}function Tm(t,o){if(t){if(typeof t=="string")return vl(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vl(t,o):void 0}}const Bl=Object.entries,zl=Object.setPrototypeOf,Cm=Object.isFrozen,Mm=Object.getPrototypeOf,Am=Object.getOwnPropertyDescriptor;let gt=Object.freeze,Ot=Object.seal,Un=Object.create,Il=typeof Reflect<"u"&&Reflect,Fi=Il.apply,Ui=Il.construct;gt||(gt=function(o){return o}),Ot||(Ot=function(o){return o}),Fi||(Fi=function(o,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),c=2;c<i;c++)a[c-2]=arguments[c];return o.apply(n,a)}),Ui||(Ui=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return new o(...i)});const An=Ze(Array.prototype.forEach),_m=Ze(Array.prototype.lastIndexOf),Ol=Ze(Array.prototype.pop),Hn=Ze(Array.prototype.push),Rm=Ze(Array.prototype.splice),bt=Array.isArray,fo=Ze(String.prototype.toLowerCase),Hi=Ze(String.prototype.toString),Ll=Ze(String.prototype.match),Wn=Ze(String.prototype.replace),Dl=Ze(String.prototype.indexOf),vm=Ze(String.prototype.trim),Bm=Ze(Number.prototype.toString),zm=Ze(Boolean.prototype.toString),Vl=typeof BigInt>"u"?null:Ze(BigInt.prototype.toString),$l=typeof Symbol>"u"?null:Ze(Symbol.prototype.toString),je=Ze(Object.prototype.hasOwnProperty),mo=Ze(Object.prototype.toString),lt=Ze(RegExp.prototype.test),Gn=Im(TypeError);function Ze(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return Fi(t,o,i)}}function Im(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Ui(t,n)}}function Se(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo;if(zl&&zl(t,null),!bt(o))return t;let i=o.length;for(;i--;){let a=o[i];if(typeof a=="string"){const c=n(a);c!==a&&(Cm(o)||(o[i]=c),a=c)}t[a]=!0}return t}function Om(t){for(let o=0;o<t.length;o++)je(t,o)||(t[o]=null);return t}function dt(t){const o=Un(null);for(const i of Bl(t)){var n=Sm(i,2);const a=n[0],c=n[1];je(t,a)&&(bt(c)?o[a]=Om(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=dt(c):o[a]=c)}return o}function Lm(t){switch(typeof t){case"string":return t;case"number":return Bm(t);case"boolean":return zm(t);case"bigint":return Vl?Vl(t):"0";case"symbol":return $l?$l(t):"Symbol()";case"undefined":return mo(t);case"function":case"object":{if(t===null)return mo(t);const o=t,n=qt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:mo(i)}return mo(t)}default:return mo(t)}}function qt(t,o){for(;t!==null;){const i=Am(t,o);if(i){if(i.get)return Ze(i.get);if(typeof i.value=="function")return Ze(i.value)}t=Mm(t)}function n(){return null}return n}function Dm(t){try{return lt(t,""),!0}catch{return!1}}const Pl=gt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wi=gt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Gi=gt(["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"]),Vm=gt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ji=gt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),$m=gt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Fl=gt(["#text"]),Ul=gt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Ki=gt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Hl=gt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Jo=gt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Pm=Ot(/{{[\w\W]*|^[\w\W]*}}/g),Fm=Ot(/<%[\w\W]*|^[\w\W]*%>/g),Um=Ot(/\${[\w\W]*/g),Hm=Ot(/^data-[\-\w.\u00B7-\uFFFF]+$/),Wm=Ot(/^aria-[\-\w]+$/),Wl=Ot(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gm=Ot(/^(?:\w+script|data):/i),jm=Ot(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Km=Ot(/^html$/i),Ym=Ot(/^[a-z][.\w]*(-[.\w]+)+$/i),Xt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},qm=function(){return typeof window>"u"?null:window},Xm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(i=n.getAttribute(a));const c="dompurify"+(i?"#"+i:"");try{return o.createPolicy(c,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Gl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function jl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qm();const o=_=>jl(_);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Xt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,a=i.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,s=t.Node,u=t.Element,d=t.NodeFilter,p=t.NamedNodeMap;p===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,x=t.trustedTypes,C=u.prototype,$=qt(C,"cloneNode"),R=qt(C,"remove"),F=qt(C,"nextSibling"),I=qt(C,"childNodes"),A=qt(C,"parentNode"),y=qt(C,"shadowRoot"),k=qt(C,"attributes"),m=s&&s.prototype?qt(s.prototype,"nodeType"):null,P=s&&s.prototype?qt(s.prototype,"nodeName"):null;if(typeof c=="function"){const _=n.createElement("template");_.content&&_.content.ownerDocument&&(n=_.content.ownerDocument)}let G,Y="",N=0;const re=function(b){if(N>0)throw Gn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');N++;try{return G.createHTML(b)}finally{N--}},pe=n,de=pe.implementation,xe=pe.createNodeIterator,ee=pe.createDocumentFragment,ce=pe.getElementsByTagName,ue=i.importNode;let g=Gl();o.isSupported=typeof Bl=="function"&&typeof A=="function"&&de&&de.createHTMLDocument!==void 0;const V=Pm,W=Fm,te=Um,fe=Hm,L=Wm,O=Gm,ae=jm,ke=Ym;let B=Wl,S=null;const U=Se({},[...Pl,...Wi,...Gi,...ji,...Fl]);let H=null;const ne=Se({},[...Ul,...Ki,...Hl,...Jo]);let ye=Object.seal(Un(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Qe=null,ut=null;const et=Object.seal(Un(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let en=!0,tt=!0,tn=!1,Lt=!0,me=!1,ft=!0,Ie=!1,Be=!1,Dt=!1,nt=!1,Nt=!1,kt=!1,q=!0,le=!1;const Ee="user-content-";let Ae=!0,Ue=!1,ot={},St=null;const Rn=Se({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ni=null;const oi=Se({},["audio","video","img","source","image","track"]);let po=null;const ii=Se({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kn="http://www.w3.org/1998/Math/MathML",Yn="http://www.w3.org/2000/svg",Vt="http://www.w3.org/1999/xhtml";let mn=Vt,ho=!1,go=null;const Yi=Se({},[Kn,Yn,Vt],Hi);let bo=Se({},["mi","mo","mn","ms","mtext"]),ko=Se({},["annotation-xml"]);const qi=Se({},["title","style","font","a","script"]);let vn=null;const ri=["application/xhtml+xml","text/html"],Xi="text/html";let He=null,pn=null;const li=n.createElement("form"),ai=function(b){return b instanceof RegExp||b instanceof Function},qn=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pn&&pn===b)return;(!b||typeof b!="object")&&(b={}),b=dt(b),vn=ri.indexOf(b.PARSER_MEDIA_TYPE)===-1?Xi:b.PARSER_MEDIA_TYPE,He=vn==="application/xhtml+xml"?Hi:fo,S=je(b,"ALLOWED_TAGS")&&bt(b.ALLOWED_TAGS)?Se({},b.ALLOWED_TAGS,He):U,H=je(b,"ALLOWED_ATTR")&&bt(b.ALLOWED_ATTR)?Se({},b.ALLOWED_ATTR,He):ne,go=je(b,"ALLOWED_NAMESPACES")&&bt(b.ALLOWED_NAMESPACES)?Se({},b.ALLOWED_NAMESPACES,Hi):Yi,po=je(b,"ADD_URI_SAFE_ATTR")&&bt(b.ADD_URI_SAFE_ATTR)?Se(dt(ii),b.ADD_URI_SAFE_ATTR,He):ii,ni=je(b,"ADD_DATA_URI_TAGS")&&bt(b.ADD_DATA_URI_TAGS)?Se(dt(oi),b.ADD_DATA_URI_TAGS,He):oi,St=je(b,"FORBID_CONTENTS")&&bt(b.FORBID_CONTENTS)?Se({},b.FORBID_CONTENTS,He):Rn,Qe=je(b,"FORBID_TAGS")&&bt(b.FORBID_TAGS)?Se({},b.FORBID_TAGS,He):dt({}),ut=je(b,"FORBID_ATTR")&&bt(b.FORBID_ATTR)?Se({},b.FORBID_ATTR,He):dt({}),ot=je(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?dt(b.USE_PROFILES):b.USE_PROFILES:!1,en=b.ALLOW_ARIA_ATTR!==!1,tt=b.ALLOW_DATA_ATTR!==!1,tn=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Lt=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=b.SAFE_FOR_TEMPLATES||!1,ft=b.SAFE_FOR_XML!==!1,Ie=b.WHOLE_DOCUMENT||!1,nt=b.RETURN_DOM||!1,Nt=b.RETURN_DOM_FRAGMENT||!1,kt=b.RETURN_TRUSTED_TYPE||!1,Dt=b.FORCE_BODY||!1,q=b.SANITIZE_DOM!==!1,le=b.SANITIZE_NAMED_PROPS||!1,Ae=b.KEEP_CONTENT!==!1,Ue=b.IN_PLACE||!1,B=Dm(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:Wl,mn=typeof b.NAMESPACE=="string"?b.NAMESPACE:Vt,bo=je(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?dt(b.MATHML_TEXT_INTEGRATION_POINTS):Se({},["mi","mo","mn","ms","mtext"]),ko=je(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?dt(b.HTML_INTEGRATION_POINTS):Se({},["annotation-xml"]);const D=je(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?dt(b.CUSTOM_ELEMENT_HANDLING):Un(null);if(ye=Un(null),je(D,"tagNameCheck")&&ai(D.tagNameCheck)&&(ye.tagNameCheck=D.tagNameCheck),je(D,"attributeNameCheck")&&ai(D.attributeNameCheck)&&(ye.attributeNameCheck=D.attributeNameCheck),je(D,"allowCustomizedBuiltInElements")&&typeof D.allowCustomizedBuiltInElements=="boolean"&&(ye.allowCustomizedBuiltInElements=D.allowCustomizedBuiltInElements),me&&(tt=!1),Nt&&(nt=!0),ot&&(S=Se({},Fl),H=Un(null),ot.html===!0&&(Se(S,Pl),Se(H,Ul)),ot.svg===!0&&(Se(S,Wi),Se(H,Ki),Se(H,Jo)),ot.svgFilters===!0&&(Se(S,Gi),Se(H,Ki),Se(H,Jo)),ot.mathMl===!0&&(Se(S,ji),Se(H,Hl),Se(H,Jo))),et.tagCheck=null,et.attributeCheck=null,je(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?et.tagCheck=b.ADD_TAGS:bt(b.ADD_TAGS)&&(S===U&&(S=dt(S)),Se(S,b.ADD_TAGS,He))),je(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?et.attributeCheck=b.ADD_ATTR:bt(b.ADD_ATTR)&&(H===ne&&(H=dt(H)),Se(H,b.ADD_ATTR,He))),je(b,"ADD_URI_SAFE_ATTR")&&bt(b.ADD_URI_SAFE_ATTR)&&Se(po,b.ADD_URI_SAFE_ATTR,He),je(b,"FORBID_CONTENTS")&&bt(b.FORBID_CONTENTS)&&(St===Rn&&(St=dt(St)),Se(St,b.FORBID_CONTENTS,He)),je(b,"ADD_FORBID_CONTENTS")&&bt(b.ADD_FORBID_CONTENTS)&&(St===Rn&&(St=dt(St)),Se(St,b.ADD_FORBID_CONTENTS,He)),Ae&&(S["#text"]=!0),Ie&&Se(S,["html","head","body"]),S.table&&(Se(S,["tbody"]),delete Qe.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const X=G;G=b.TRUSTED_TYPES_POLICY;try{Y=re("")}catch(ze){throw G=X,ze}}else G===void 0&&b.TRUSTED_TYPES_POLICY!==null&&(G=Xm(x,a)),G&&typeof Y=="string"&&(Y=re(""));(g.uponSanitizeElement.length>0||g.uponSanitizeAttribute.length>0)&&S===U&&(S=dt(S)),g.uponSanitizeAttribute.length>0&&H===ne&&(H=dt(H)),gt&&gt(b),pn=b},yo=Se({},[...Wi,...Gi,...Vm]),hn=Se({},[...ji,...$m]),Zi=function(b){let D=A(b);(!D||!D.tagName)&&(D={namespaceURI:mn,tagName:"template"});const X=fo(b.tagName),ze=fo(D.tagName);return go[b.namespaceURI]?b.namespaceURI===Yn?D.namespaceURI===Vt?X==="svg":D.namespaceURI===Kn?X==="svg"&&(ze==="annotation-xml"||bo[ze]):!!yo[X]:b.namespaceURI===Kn?D.namespaceURI===Vt?X==="math":D.namespaceURI===Yn?X==="math"&&ko[ze]:!!hn[X]:b.namespaceURI===Vt?D.namespaceURI===Yn&&!ko[ze]||D.namespaceURI===Kn&&!bo[ze]?!1:!hn[X]&&(qi[X]||!yo[X]):!!(vn==="application/xhtml+xml"&&go[b.namespaceURI]):!1},Tt=function(b){Hn(o.removed,{element:b});try{A(b).removeChild(b)}catch{R(b)}},Zt=function(b,D){try{Hn(o.removed,{attribute:D.getAttributeNode(b),from:D})}catch{Hn(o.removed,{attribute:null,from:D})}if(D.removeAttribute(b),b==="is")if(nt||Nt)try{Tt(D)}catch{}else try{D.setAttribute(b,"")}catch{}},Eo=function(b){let D=null,X=null;if(Dt)b="<remove></remove>"+b;else{const Le=Ll(b,/^[\r\n\t ]+/);X=Le&&Le[0]}vn==="application/xhtml+xml"&&mn===Vt&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const ze=G?re(b):b;if(mn===Vt)try{D=new h().parseFromString(ze,vn)}catch{}if(!D||!D.documentElement){D=de.createDocument(mn,"template",null);try{D.documentElement.innerHTML=ho?Y:ze}catch{}}const Ne=D.body||D.documentElement;return b&&X&&Ne.insertBefore(n.createTextNode(X),Ne.childNodes[0]||null),mn===Vt?ce.call(D,Ie?"html":"body")[0]:Ie?D.documentElement:Ne},Xn=function(b){return xe.call(b.ownerDocument||b,b,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Bn=function(b){var D,X;b.normalize();const ze=xe.call(b.ownerDocument||b,b,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let Ne=ze.nextNode();for(;Ne;){let qe=Ne.data;An([V,W,te],Et=>{qe=Wn(qe,Et," ")}),Ne.data=qe,Ne=ze.nextNode()}const Le=(D=(X=b.querySelectorAll)===null||X===void 0?void 0:X.call(b,"template"))!==null&&D!==void 0?D:[];An(Array.from(Le),qe=>{gn(qe.content)&&Bn(qe.content)})},Zn=function(b){const D=P?P(b):null;return typeof D!="string"||He(D)!=="form"?!1:typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||b.attributes!==k(b)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function"||b.nodeType!==m(b)||b.childNodes!==I(b)},gn=function(b){if(!m||typeof b!="object"||b===null)return!1;try{return m(b)===Xt.documentFragment}catch{return!1}},Jn=function(b){if(!m||typeof b!="object"||b===null)return!1;try{return typeof m(b)=="number"}catch{return!1}};function Ct(_,b,D){An(_,X=>{X.call(o,b,D,pn)})}const Qn=function(b){let D=null;if(Ct(g.beforeSanitizeElements,b,null),Zn(b))return Tt(b),!0;const X=He(P?P(b):b.nodeName);if(Ct(g.uponSanitizeElement,b,{tagName:X,allowedTags:S}),ft&&b.hasChildNodes()&&!Jn(b.firstElementChild)&&lt(/<[/\w!]/g,b.innerHTML)&&lt(/<[/\w!]/g,b.textContent)||ft&&b.namespaceURI===Vt&&X==="style"&&Jn(b.firstElementChild)||b.nodeType===Xt.progressingInstruction||ft&&b.nodeType===Xt.comment&&lt(/<[/\w]/g,b.data))return Tt(b),!0;if(Qe[X]||!(et.tagCheck instanceof Function&&et.tagCheck(X))&&!S[X]){if(!Qe[X]&&we(X)&&(ye.tagNameCheck instanceof RegExp&&lt(ye.tagNameCheck,X)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(X)))return!1;if(Ae&&!St[X]){const Ne=A(b),Le=I(b);if(Le&&Ne){const qe=Le.length;for(let Et=qe-1;Et>=0;--Et){const mt=$(Le[Et],!0);Ne.insertBefore(mt,F(b))}}}return Tt(b),!0}return(m?m(b):b.nodeType)===Xt.element&&!Zi(b)||(X==="noscript"||X==="noembed"||X==="noframes")&&lt(/<\/no(script|embed|frames)/i,b.innerHTML)?(Tt(b),!0):(me&&b.nodeType===Xt.text&&(D=b.textContent,An([V,W,te],Ne=>{D=Wn(D,Ne," ")}),b.textContent!==D&&(Hn(o.removed,{element:b.cloneNode()}),b.textContent=D)),Ct(g.afterSanitizeElements,b,null),!1)},Gt=function(b,D,X){if(ut[D]||q&&(D==="id"||D==="name")&&(X in n||X in li))return!1;const ze=H[D]||et.attributeCheck instanceof Function&&et.attributeCheck(D,b);if(!(tt&&!ut[D]&&lt(fe,D))){if(!(en&&lt(L,D))){if(!ze||ut[D]){if(!(we(b)&&(ye.tagNameCheck instanceof RegExp&&lt(ye.tagNameCheck,b)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(b))&&(ye.attributeNameCheck instanceof RegExp&&lt(ye.attributeNameCheck,D)||ye.attributeNameCheck instanceof Function&&ye.attributeNameCheck(D,b))||D==="is"&&ye.allowCustomizedBuiltInElements&&(ye.tagNameCheck instanceof RegExp&&lt(ye.tagNameCheck,X)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(X))))return!1}else if(!po[D]){if(!lt(B,Wn(X,ae,""))){if(!((D==="src"||D==="xlink:href"||D==="href")&&b!=="script"&&Dl(X,"data:")===0&&ni[b])){if(!(tn&&!lt(O,Wn(X,ae,"")))){if(X)return!1}}}}}}return!0},Oe=Se({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),we=function(b){return!Oe[fo(b)]&&lt(ke,b)},si=function(b){Ct(g.beforeSanitizeAttributes,b,null);const D=b.attributes;if(!D||Zn(b))return;const X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let ze=D.length;for(;ze--;){const Ne=D[ze],Le=Ne.name,qe=Ne.namespaceURI,Et=Ne.value,mt=He(Le),xo=Et;let Xe=Le==="value"?xo:vm(xo);if(X.attrName=mt,X.attrValue=Xe,X.keepAttr=!0,X.forceKeepAttr=void 0,Ct(g.uponSanitizeAttribute,b,X),Xe=X.attrValue,le&&(mt==="id"||mt==="name")&&Dl(Xe,Ee)!==0&&(Zt(Le,b),Xe=Ee+Xe),ft&&lt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Xe)){Zt(Le,b);continue}if(mt==="attributename"&&Ll(Xe,"href")){Zt(Le,b);continue}if(X.forceKeepAttr)continue;if(!X.keepAttr){Zt(Le,b);continue}if(!Lt&&lt(/\/>/i,Xe)){Zt(Le,b);continue}me&&An([V,W,te],wo=>{Xe=Wn(Xe,wo," ")});const nn=He(b.nodeName);if(!Gt(nn,mt,Xe)){Zt(Le,b);continue}if(G&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!qe)switch(x.getAttributeType(nn,mt)){case"TrustedHTML":{Xe=re(Xe);break}case"TrustedScriptURL":{Xe=G.createScriptURL(Xe);break}}if(Xe!==xo)try{qe?b.setAttributeNS(qe,Le,Xe):b.setAttribute(Le,Xe),Zn(b)?Tt(b):Ol(o.removed)}catch{Zt(Le,b)}}Ct(g.afterSanitizeAttributes,b,null)},yt=function(b){let D=null;const X=Xn(b);for(Ct(g.beforeSanitizeShadowDOM,b,null);D=X.nextNode();)if(Ct(g.uponSanitizeShadowNode,D,null),Qn(D),si(D),gn(D.content)&&yt(D.content),(m?m(D):D.nodeType)===Xt.element){const Ne=y?y(D):D.shadowRoot;gn(Ne)&&(Jt(Ne),yt(Ne))}Ct(g.afterSanitizeShadowDOM,b,null)},Jt=function(b){const D=m?m(b):b.nodeType;if(D===Xt.element){const Ne=y?y(b):b.shadowRoot;gn(Ne)&&(Jt(Ne),yt(Ne))}const X=I?I(b):b.childNodes;if(!X)return;const ze=[];An(X,Ne=>{Hn(ze,Ne)});for(const Ne of ze)Jt(Ne);if(D===Xt.element){const Ne=P?P(b):null;if(typeof Ne=="string"&&He(Ne)==="template"){const Le=b.content;gn(Le)&&Jt(Le)}}};return o.sanitize=function(_){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},D=null,X=null,ze=null,Ne=null;if(ho=!_,ho&&(_="<!-->"),typeof _!="string"&&!Jn(_)&&(_=Lm(_),typeof _!="string"))throw Gn("dirty is not a string, aborting");if(!o.isSupported)return _;if(Be||qn(b),o.removed=[],typeof _=="string"&&(Ue=!1),Ue){const Et=P?P(_):_.nodeName;if(typeof Et=="string"){const mt=He(Et);if(!S[mt]||Qe[mt])throw Gn("root node is forbidden and cannot be sanitized in-place")}if(Zn(_))throw Gn("root node is clobbered and cannot be sanitized in-place");Jt(_)}else if(Jn(_))D=Eo("<!---->"),X=D.ownerDocument.importNode(_,!0),X.nodeType===Xt.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?D=X:D.appendChild(X),Jt(X);else{if(!nt&&!me&&!Ie&&_.indexOf("<")===-1)return G&&kt?re(_):_;if(D=Eo(_),!D)return nt?null:kt?Y:""}D&&Dt&&Tt(D.firstChild);const Le=Xn(Ue?_:D);for(;ze=Le.nextNode();)Qn(ze),si(ze),gn(ze.content)&&yt(ze.content);if(Ue)return me&&Bn(_),_;if(nt){if(me&&Bn(D),Nt)for(Ne=ee.call(D.ownerDocument);D.firstChild;)Ne.appendChild(D.firstChild);else Ne=D;return(H.shadowroot||H.shadowrootmode)&&(Ne=ue.call(i,Ne,!0)),Ne}let qe=Ie?D.outerHTML:D.innerHTML;return Ie&&S["!doctype"]&&D.ownerDocument&&D.ownerDocument.doctype&&D.ownerDocument.doctype.name&&lt(Km,D.ownerDocument.doctype.name)&&(qe="<!DOCTYPE "+D.ownerDocument.doctype.name+`>
129
+ `+qe),me&&An([V,W,te],Et=>{qe=Wn(qe,Et," ")}),G&&kt?re(qe):qe},o.setConfig=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qn(_),Be=!0},o.clearConfig=function(){pn=null,Be=!1},o.isValidAttribute=function(_,b,D){pn||qn({});const X=He(_),ze=He(b);return Gt(X,ze,D)},o.addHook=function(_,b){typeof b=="function"&&Hn(g[_],b)},o.removeHook=function(_,b){if(b!==void 0){const D=_m(g[_],b);return D===-1?void 0:Rm(g[_],D,1)[0]}return Ol(g[_])},o.removeHooks=function(_){g[_]=[]},o.removeAllHooks=function(){g=Gl()},o}var Zm=jl();const Jm=new Rl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new co;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),a=_i(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${a}</code></pre>`},t})()}),Qm=["p","br","strong","em","del","s","u","a","ul","ol","li","h1","h2","h3","h4","h5","h6","blockquote","code","pre","hr","table","thead","tbody","tr","th","td","img","span","input"],ep=["href","title","target","rel","src","alt","class","checked","type","disabled"],tp=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function np(t){if(!t)return"";const o=Jm.parse(t,{async:!1});return Zm.sanitize(o,{ALLOWED_TAGS:Qm,ALLOWED_ATTR:ep,ALLOWED_URI_REGEXP:tp})}const op={class:"zm-note-panel"},ip={key:0,class:"zm-note-empty"},rp={class:"zm-note-header"},lp={class:"zm-note-title-row"},ap={class:"zm-note-name"},sp={class:"zm-note-meta"},cp={class:"zm-note-scroll"},dp={class:"zm-note-section"},up={class:"zm-note-section-head"},fp={class:"zm-note-split"},mp=["disabled"],pp={key:0,class:"zm-note-preview"},hp=["innerHTML"],gp={key:1,class:"zm-note-preview-hint"},bp={key:0,class:"zm-note-section-actions"},kp={key:0,class:"zm-note-add-row"},yp={key:1,class:"zm-note-section"},Ep=["disabled"],xp=["href","title"],wp={key:2,class:"zm-note-section"},Np=["disabled"],Sp=["src","alt"],Tp={key:3,class:"zm-note-section"},Cp={class:"zm-note-section-head"},Mp={key:0,class:"zm-note-section-tag"},Ap=["disabled"],_p={key:0,class:"zm-note-code"},Rp=["innerHTML"],vp={key:4,class:"zm-note-section"},Bp=["disabled"],zp={key:0,class:"zm-note-table"},Qo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null);Ei(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),u=e.computed(()=>np(a.value)),d=e.ref(!0);function p(){d.value=!d.value}e.watch(()=>{var L,O,ae;return[(L=n.selectedNode)==null?void 0:L.id,(ae=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:ae.text]},()=>{var L,O;a.value=((O=(L=n.selectedNode)==null?void 0:L.note)==null?void 0:O.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const L=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(L){L.focus();const O=L.value.length;L.setSelectionRange(O,O)}});function h(){var ae,ke;if(n.readonly)return;const L=a.value,O=((ke=(ae=n.selectedNode)==null?void 0:ae.note)==null?void 0:ke.text)??"";L!==O&&i("apply",L)}function x(L){var O,ae;n.readonly||(L.key==="Escape"?(L.preventDefault(),a.value=((ae=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:ae.text)??"",L.target.blur()):L.key==="Enter"&&(L.ctrlKey||L.metaKey)&&(L.preventDefault(),h(),L.target.blur()))}function C(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",i("remove"))}const $=e.computed(()=>{var L,O;return!!((O=(L=n.selectedNode)==null?void 0:L.link)!=null&&O.url)}),R=e.computed(()=>{var L,O;return!!((O=(L=n.selectedNode)==null?void 0:L.image)!=null&&O.src)}),F=e.computed(()=>{var L,O;return(O=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:O.kind}),I=e.computed(()=>F.value==="code"),A=e.computed(()=>F.value==="table"),y=e.ref(!1),k=e.ref(!1),m=e.ref(!1),P=e.ref(!1);e.watch(()=>{var L;return(L=n.selectedNode)==null?void 0:L.id},()=>{y.value=!1,k.value=!1,m.value=!1,P.value=!1});const G=e.ref("");e.watch(()=>{var L,O,ae;return[(L=n.selectedNode)==null?void 0:L.id,(ae=(O=n.selectedNode)==null?void 0:O.link)==null?void 0:ae.url]},()=>{var L,O;G.value=((O=(L=n.selectedNode)==null?void 0:L.link)==null?void 0:O.url)??""},{immediate:!0});function Y(){var ae,ke;if(n.readonly)return;const L=G.value.trim(),O=((ke=(ae=n.selectedNode)==null?void 0:ae.link)==null?void 0:ke.url)??"";L!==O&&i("set-link",L)}const N=e.ref("");e.watch(()=>{var L,O,ae;return[(L=n.selectedNode)==null?void 0:L.id,(ae=(O=n.selectedNode)==null?void 0:O.image)==null?void 0:ae.src]},()=>{var L,O;N.value=((O=(L=n.selectedNode)==null?void 0:L.image)==null?void 0:O.src)??""},{immediate:!0});function re(){var ae,ke;if(n.readonly)return;const L=N.value.trim(),O=((ke=(ae=n.selectedNode)==null?void 0:ae.image)==null?void 0:ke.src)??"";L!==O&&i("set-image",L)}function pe(L){const O=L.target;O.style.display="none"}function de(L){const O=L.target;O.style.display=""}const xe=e.ref(""),ee=e.ref(null);Ei(ee,{minRows:4,maxRows:18}),e.watch(()=>{var L,O,ae;return[(L=n.selectedNode)==null?void 0:L.id,(ae=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:ae.raw]},()=>{var L,O;xe.value=((O=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:O.raw)??""},{immediate:!0});const ce=e.computed(()=>_i(jo(xe.value),Sn(xe.value)));function ue(){var ke,B;if(n.readonly)return;const L=xe.value,O=((B=(ke=n.selectedNode)==null?void 0:ke.richContent)==null?void 0:B.raw)??"";if(L===O)return;const ae=Sn(L)||void 0;i("set-rich",L?{kind:"code",raw:L,lang:ae}:null)}const g=e.ref(""),V=e.ref(null);Ei(V,{minRows:4,maxRows:14}),e.watch(()=>{var L,O,ae;return[(L=n.selectedNode)==null?void 0:L.id,(ae=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:ae.raw]},()=>{var L,O;g.value=((O=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:O.raw)??""},{immediate:!0});function W(){var ae,ke;if(n.readonly)return;const L=g.value,O=((ke=(ae=n.selectedNode)==null?void 0:ae.richContent)==null?void 0:ke.raw)??"";L!==O&&i("set-rich",L?{kind:"table",raw:L}:null)}const te=e.computed(()=>Ri(g.value)),fe=e.computed(()=>{const L=[];return s.value||L.push(`${a.value.length} 字`),$.value&&L.push("1 链接"),R.value&&L.push("1 图片"),I.value&&L.push("代码块"),A.value&&L.push("表格"),L.length===0?"节点没有额外内容":L.join(" · ")});return(L,O)=>{var ae,ke,B,S;return e.openBlock(),e.createElementBlock("div",op,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",rp,[e.createElementVNode("div",lp,[O[12]||(O[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",ap,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",sp,e.toDisplayString(fe.value),1)]),e.createElementVNode("div",cp,[e.createElementVNode("section",dp,[e.createElementVNode("header",up,[O[13]||(O[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),O[14]||(O[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:p},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",fp,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":O[0]||(O[0]=U=>a.value=U),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:h,onKeydown:x},null,40,mp),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",pp,[s.value?(e.openBlock(),e.createElementBlock("div",gp," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,hp))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",bp,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:C},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",kp,[!$.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:O[1]||(O[1]=U=>y.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!R.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:O[2]||(O[2]=U=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!I.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:O[3]||(O[3]=U=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!A.value&&!P.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:O[4]||(O[4]=U=>P.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),$.value||y.value?(e.openBlock(),e.createElementBlock("section",yp,[O[15]||(O[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":O[5]||(O[5]=U=>G.value=U),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:Y,onKeydown:O[6]||(O[6]=e.withKeys(e.withModifiers(U=>U.target.blur(),["prevent"]),["enter"]))},null,40,Ep),[[e.vModelText,G.value]]),$.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(ae=t.selectedNode.link)==null?void 0:ae.url,target:"_blank",rel:"noopener noreferrer",title:(ke=t.selectedNode.link)==null?void 0:ke.url},e.toDisplayString((B=t.selectedNode.link)==null?void 0:B.url),9,xp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||k.value?(e.openBlock(),e.createElementBlock("section",wp,[O[16]||(O[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":O[7]||(O[7]=U=>N.value=U),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:re,onKeydown:O[8]||(O[8]=e.withKeys(e.withModifiers(U=>U.target.blur(),["prevent"]),["enter"]))},null,40,Np),[[e.vModelText,N.value]]),R.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(S=t.selectedNode.image)==null?void 0:S.src,alt:t.selectedNode.text,onError:pe,onLoad:de},null,40,Sp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),I.value||m.value?(e.openBlock(),e.createElementBlock("section",Tp,[e.createElementVNode("header",Cp,[O[17]||(O[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(Sn)(xe.value)?(e.openBlock(),e.createElementBlock("span",Mp,e.toDisplayString(e.unref(Sn)(xe.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:ee,"onUpdate:modelValue":O[9]||(O[9]=U=>xe.value=U),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:ue},null,40,Ap),[[e.vModelText,xe.value]]),xe.value.trim()?(e.openBlock(),e.createElementBlock("pre",_p,[e.createElementVNode("code",{innerHTML:ce.value},null,8,Rp)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),A.value||P.value?(e.openBlock(),e.createElementBlock("section",vp,[O[18]||(O[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:V,"onUpdate:modelValue":O[10]||(O[10]=U=>g.value=U),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
130
130
  | --- | --- |
131
- | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:G},null,40,Ap),[[e.vModelText,b.value]]),ee.value.length?(e.openBlock(),e.createElementBlock("table",_p,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,(P,H)=>(e.openBlock(),e.createElementBlock("tr",{key:H},[H===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(P,(ie,xe)=>(e.openBlock(),e.createElementBlock("th",{key:`h${xe}`},e.toDisplayString(ie),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(P,(ie,xe)=>(e.openBlock(),e.createElementBlock("td",{key:`c${xe}`},e.toDisplayString(ie),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",ep,[...B[11]||(B[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Rp=["viewBox","width","height"],Bp={class:"zm-edges"},vp=["d","fill"],zp=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Ip=["src","width","height","alt"],Op=["onDblclick"],Lp={key:0,class:"zm-rich-code"},Dp=["innerHTML"],Vp={key:1,class:"zm-rich-table"},$p={key:2,class:"zm-text"},Pp={key:0,class:"zm-node-markers"},Fp=["title","innerHTML"],Up={class:"zm-text-label"},Hp=["href","title"],Wp=["title","onClick"],Gp={key:4,class:"zm-node-tags"},jp=["title"],Kp=["title","onClick"],Yp=["onClick"],qp=["onMousedown"],Xp=["onClick"],Zp=["title"],Jp={class:"zm-tb-tip zm-tb-zoom"},Qp=["src"],eh=["src"],An=24,Gn=400,fn=160,Wl=4,Qo=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1},builtInDrawers:{type:Boolean,default:!0}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const i=t,a=n,c=e.ref(null),s=e.ref(null),f=e.ref(""),d=e.ref(new Set),p=e.computed(()=>d.value.values().next().value??null),h=e.ref(new Set),y=e.ref(!1),C=e.ref(null),D=e.ref(0),_=e.ref(0),F=e.ref(null),R=e.ref(null),M=e.ref(null),k=e.ref(""),u=e.ref(zt(i.data)),N=e.ref({}),$=e.ref({}),j=e.ref(i.markdown!==void 0);let q=!1;e.watch(()=>i.markdown,r=>{if(r===void 0){j.value=!1;return}j.value=!0;const l=In(r||"");q=!0,u.value=zt(l),d.value=new Set,h.value=new Set,Te(),e.nextTick(()=>{q=!1,rn()})}),e.watch(u,()=>{j.value&&!q&&a("markdownChange",On(u.value))},{deep:!0});const x=e.computed(()=>U.showOrderBadge===!0),ae=e.ref(new Map),fe=ae.value;function me(r,l){const m={};l.bg&&(m.bg=l.bg),l.textColor&&(m.textColor=l.textColor),l.borderColor&&(m.borderColor=l.borderColor),l.fontWeight&&(m.fontWeight=l.fontWeight),l.fontSize&&(m.fontSize=l.fontSize),Object.keys(m).length===0?fe.delete(r):fe.set(r,m),ae.value=new Map(fe)}function J(r){return fe.get(r)??{}}function ge(r,l){const m=he(u.value,r);m&&(m.image={src:l.src,naturalW:l.naturalW,naturalH:l.naturalH,width:b(l.width,An,Gn),height:b(l.height,An,Gn)},Ie(),Te(),a("change",u.value))}function de(r){const l=he(u.value,r);!l||!l.image||(delete l.image,Ie(),Te(),a("change",u.value))}function ye(r,l){const m=l.trim();if(!he(u.value,r))return;if(!m){de(r);return}const E=new Image;E.onload=()=>{const z=he(u.value,r);if(!z)return;const A=E.naturalWidth&&E.naturalHeight?E.naturalWidth/E.naturalHeight:1,v=b(E.naturalWidth||fn,An,Gn),K=Math.round(v/A);z.image={src:m,naturalW:E.naturalWidth||v,naturalH:E.naturalHeight||K,width:v,height:K},Ie(),Te(),a("change",u.value)},E.onerror=()=>{},E.src=m}function b(r,l,m){return Math.min(m,Math.max(l,r))}function L(r,l){const m=new FileReader;m.onload=()=>{if(typeof m.result!="string")return;const T=m.result,E=new window.Image;E.onload=()=>{const z=E.naturalWidth||fn,A=E.naturalHeight||fn,v=b(z,An,fn),K=b(Math.round(A*v/z),An,Gn);l({src:T,naturalW:z,naturalH:A,width:v,height:K})},E.onerror=()=>{l({src:T,naturalW:fn,naturalH:fn,width:fn,height:fn})},E.src=T},m.readAsDataURL(r)}function G(r){const l=document.createElement("input");l.type="file",l.accept="image/*",l.style.display="none",l.onchange=()=>{var T;const m=(T=l.files)==null?void 0:T[0];m&&(L(m,E=>ge(r,E)),document.body.removeChild(l))},document.body.appendChild(l),l.click()}function ee(r,l){const m=l.trim(),T=he(u.value,r);T&&(m?T.link={url:m}:delete T.link,Ie(),Te(),a("change",u.value))}function be(r){ee(r,"")}function O(r,l){const m=he(u.value,r);m&&(l?m.note={text:l}:delete m.note,Ie(),Te(),a("change",u.value))}function B(r){O(r,"")}function oe(r,l){const m=he(u.value,r);m&&(l?m.richContent=l:delete m.richContent,Ie(),Te(),a("change",u.value))}const te=e.ref(null),V=e.ref(null),w=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||y.value)?"is-visible":""].filter(Boolean).join(" ")),P=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||y.value)?"is-visible":""].filter(Boolean).join(" "));function H(r,l){i.previewMode||(r.preventDefault(),r.stopPropagation(),V.value=null,d.value=new Set([l.id]),st(),te.value={nodeId:l.id,x:r.clientX,y:r.clientY})}function ie(){te.value=null}function xe(r){const l=r.target;if(!(l!=null&&l.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(ci&&pe.panMoved.value){ci=!1,r.preventDefault();return}r.preventDefault(),te.value&&(te.value=null),V.value={x:r.clientX,y:r.clientY}}}function Je(){V.value=null}function Tt(){Je(),i.builtInDrawers&&(tt(),Ct.value=!0),a("canvas-settings")}function it(){Je(),i.builtInDrawers&&(tt(),Zt.value=!0),a("canvas-data")}function nn(r){Je(),i.builtInDrawers&&(tt(),Be.value=r,Zt.value=!0),a("canvas-import",r)}const Qe=e.ref(!1),Zt=e.ref(!1),Jt=e.ref(!1),ce=e.ref(!1),Ct=e.ref(!1),Ve=e.ref(0),Be=e.ref(null),Lt=e.ref(new Set);function tt(){Zt.value=!1,Jt.value=!1,ce.value=!1,Ct.value=!1}const gt=e.computed(()=>{const r=p.value;return r?he(u.value,r)??null:null}),Qt=e.computed(()=>gt.value?J(gt.value.id):{});function X(r){r.autoBalanceOnChange!==void 0&&(U.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(U.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(U.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(U.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(U.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(U.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(U.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(U.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(U.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(U.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(U.lineWidthTaper=Math.max(.3,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(U.elbowRadius=Math.max(2,Math.min(20,r.elbowRadius))),r.showOrderBadge!==void 0&&(U.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(U.canvasBg=r.canvasBg)}function se(r){gt.value&&me(gt.value.id,r)}function Ee(){const r={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0};U.autoBalanceOnChange=r.autoBalanceOnChange,U.lineWidthStart=r.lineWidthStart,U.lineWidthEnd=r.lineWidthEnd,U.rainbowBranch=r.rainbowBranch,U.branchPaletteId=r.branchPaletteId,U.customPalettes=r.customPalettes,U.lineStyle=r.lineStyle,U.rootLineStyle=r.rootLineStyle,U.lineOrigin=r.lineOrigin,U.layoutMode=r.layoutMode,U.taperedEdge=r.taperedEdge,U.lineWidthTaper=r.lineWidthTaper,U.elbowRadius=r.elbowRadius,U.showOrderBadge=r.showOrderBadge,U.canvasBg=r.canvasBg}function Ae(){Be.value=null}function He(r){const l=p.value;l&&O(l,r)}function rt(){const r=p.value;r&&B(r)}function yt(r){const l=p.value;l&&ee(l,r)}function _n(r){const l=p.value;l&&ye(l,r)}function ti(r){const l=p.value;l&&oe(l,r)}function ni(r){const l=document.querySelector(`[data-node-id="${r.id}"]`);l&&l.click()}function po(r){ua(r.id,r.text)}function oi(r){no(r)}function jn(r){ai(r)}function Kn(r){Ji(r.srcId,r.targetId,r.position)}function Dt(r){const l=new Set(Lt.value);l.has(r)?l.delete(r):l.add(r),Lt.value=l}function mn(){i.builtInDrawers&&(Qe.value=!Qe.value),a("canvas-outline")}function ho(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&G(r)}function go(){var T,E,z;const r=(T=te.value)==null?void 0:T.nodeId;if(!r)return;const l=((z=(E=he(u.value,r))==null?void 0:E.link)==null?void 0:z.url)??"",m=window.prompt("输入链接 URL(留空取消)",l);m!==null&&ee(r,m)}function Wi(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&be(r)}function bo(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&on(r)}function ko(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&B(r)}function Gi(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&de(r)}function pn(){var ke,S;const r=(ke=te.value)==null?void 0:ke.nodeId;if(!r)return;const l=(S=he(u.value,r))==null?void 0:S.richContent,m=(l==null?void 0:l.kind)==="code"?Go(l.raw):"",T=(l==null?void 0:l.kind)==="code"&&l.lang||"",E=T?"```"+T+`
132
- `:"```\n",A=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",m?E+m+(m.endsWith("```")?"":"\n```"):E+"// 你的代码"+"\n```");if(A===null)return;const v=A.trim();if(!v){oe(r,null);return}const K=/^```([^\s`]*)/.exec(v),Y=K?K[1]:void 0;oe(r,{kind:"code",raw:v,lang:Y})}function ji(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&oe(r,null)}function ii(){var A,v;const r=(A=te.value)==null?void 0:A.nodeId;if(!r)return;const l=(v=he(u.value,r))==null?void 0:v.richContent,m=(l==null?void 0:l.kind)==="table"?l.raw:"",E=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",m||`| 列1 | 列2 | 列3 |
131
+ | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:W},null,40,Bp),[[e.vModelText,g.value]]),te.value.length?(e.openBlock(),e.createElementBlock("table",zp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(U,H)=>(e.openBlock(),e.createElementBlock("tr",{key:H},[H===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(U,(ne,ye)=>(e.openBlock(),e.createElementBlock("th",{key:`h${ye}`},e.toDisplayString(ne),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(U,(ne,ye)=>(e.openBlock(),e.createElementBlock("td",{key:`c${ye}`},e.toDisplayString(ne),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",ip,[...O[11]||(O[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Ip=["viewBox","width","height"],Op={class:"zm-edges"},Lp=["d","fill"],Dp=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Vp=["src","width","height","alt"],$p=["onDblclick"],Pp={key:0,class:"zm-rich-code"},Fp=["innerHTML"],Up={key:1,class:"zm-rich-table"},Hp={key:2,class:"zm-text"},Wp={key:0,class:"zm-node-markers"},Gp=["title","innerHTML"],jp={class:"zm-text-label"},Kp=["href","title"],Yp=["title","onClick"],qp={key:4,class:"zm-node-tags"},Xp=["title"],Zp=["title","onClick"],Jp=["onClick"],Qp=["onMousedown"],eh=["onClick"],th=["title"],nh=["src"],oh=["src"],_n=24,jn=400,fn=160,Kl=4,ei=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1},builtInDrawers:{type:Boolean,default:!0}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const i=t,a=n,c=e.ref(null),s=e.ref(null),u=e.ref(""),d=e.ref(new Set),p=e.computed(()=>d.value.values().next().value??null),h=e.ref(new Set),x=e.ref(!1),C=e.ref(null),$=e.ref(0),R=e.ref(0),F=e.computed(()=>{const r=C.value;if(!r||!r.currentTargetId||!r.dropPosition||r.dropPosition==="child")return null;const l=on.value.find(v=>v.id===r.currentTargetId);if(!l)return null;const f=l.width/2,w=l.height/2;if(l._dir==="down"){const v=r.dropPosition==="before"?l.x-f:l.x+f;return{x1:v,y1:l.y-w,x2:v,y2:l.y+w,horizontal:!1}}const E=r.dropPosition==="before"?l.y-w:l.y+w;return{x1:l.x-f,y1:E,x2:l.x+f,y2:E,horizontal:!0}}),I=e.ref(null),A=e.ref(null),y=e.ref(null),k=e.ref(""),m=e.ref(Bt(i.data)),P=e.ref({}),G=e.ref({}),Y=e.ref(i.markdown!==void 0);let N=!1;e.watch(()=>i.markdown,r=>{if(r===void 0){Y.value=!1;return}Y.value=!0;const l=On(r||"");N=!0,m.value=Bt(l),d.value=new Set,h.value=new Set,we(),e.nextTick(()=>{N=!1,rn()})}),e.watch(m,()=>{Y.value&&!N&&a("markdownChange",Ln(m.value))},{deep:!0});const re=e.computed(()=>_.showOrderBadge===!0),pe=e.ref(new Map),de=pe.value;function xe(r,l){const f={};l.bg&&(f.bg=l.bg),l.textColor&&(f.textColor=l.textColor),l.borderColor&&(f.borderColor=l.borderColor),l.fontWeight&&(f.fontWeight=l.fontWeight),l.fontSize&&(f.fontSize=l.fontSize),Object.keys(f).length===0?de.delete(r):de.set(r,f),pe.value=new Map(de)}function ee(r){return de.get(r)??{}}function ce(r,l){const f=be(m.value,r);f&&(f.image={src:l.src,naturalW:l.naturalW,naturalH:l.naturalH,width:V(l.width,_n,jn),height:V(l.height,_n,jn)},Oe(),we(),a("change",m.value))}function ue(r){const l=be(m.value,r);!l||!l.image||(delete l.image,Oe(),we(),a("change",m.value))}function g(r,l){const f=l.trim();if(!be(m.value,r))return;if(!f){ue(r);return}const E=new Image;E.onload=()=>{const v=be(m.value,r);if(!v)return;const M=E.naturalWidth&&E.naturalHeight?E.naturalWidth/E.naturalHeight:1,z=V(E.naturalWidth||fn,_n,jn),Z=Math.round(z/M);v.image={src:f,naturalW:E.naturalWidth||z,naturalH:E.naturalHeight||Z,width:z,height:Z},Oe(),we(),a("change",m.value)},E.onerror=()=>{},E.src=f}function V(r,l,f){return Math.min(f,Math.max(l,r))}function W(r,l){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const w=f.result,E=new window.Image;E.onload=()=>{const v=E.naturalWidth||fn,M=E.naturalHeight||fn,z=V(v,_n,fn),Z=V(Math.round(M*z/v),_n,jn);l({src:w,naturalW:v,naturalH:M,width:z,height:Z})},E.onerror=()=>{l({src:w,naturalW:fn,naturalH:fn,width:fn,height:fn})},E.src=w},f.readAsDataURL(r)}function te(r){const l=document.createElement("input");l.type="file",l.accept="image/*",l.style.display="none",l.onchange=()=>{var w;const f=(w=l.files)==null?void 0:w[0];f&&(W(f,E=>ce(r,E)),document.body.removeChild(l))},document.body.appendChild(l),l.click()}function fe(r,l){const f=l.trim(),w=be(m.value,r);w&&(f?w.link={url:f}:delete w.link,Oe(),we(),a("change",m.value))}function L(r){fe(r,"")}function O(r,l){const f=be(m.value,r);f&&(l?f.note={text:l}:delete f.note,Oe(),we(),a("change",m.value))}function ae(r){O(r,"")}function ke(r,l){const f=be(m.value,r);f&&(l?f.richContent=l:delete f.richContent,Oe(),we(),a("change",m.value))}const B=e.ref(null),S=e.ref(null),U=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||x.value)?"is-visible":""].filter(Boolean).join(" ")),H=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||x.value)?"is-visible":""].filter(Boolean).join(" "));function ne(r,l){i.previewMode||(r.preventDefault(),r.stopPropagation(),S.value=null,d.value=new Set([l.id]),at(),B.value={nodeId:l.id,x:r.clientX,y:r.clientY})}function ye(){B.value=null}function Qe(r){const l=r.target;if(!(l!=null&&l.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(ui&&he.panMoved.value){ui=!1,r.preventDefault();return}r.preventDefault(),B.value&&(B.value=null),S.value={x:r.clientX,y:r.clientY}}}function ut(){S.value=null}function et(){ut(),i.builtInDrawers&&(Nt(),Ie.value=!0),a("canvas-settings")}function en(){ut(),i.builtInDrawers&&(Nt(),Lt.value=!0),a("canvas-data")}function tt(r){ut(),i.builtInDrawers&&(Nt(),Dt.value=r,Lt.value=!0),a("canvas-import",r)}const tn=e.ref(!1),Lt=e.ref(!1),me=e.ref(!1),ft=e.ref(!1),Ie=e.ref(!1),Be=e.ref(0),Dt=e.ref(null),nt=e.ref(new Set);function Nt(){Lt.value=!1,me.value=!1,ft.value=!1,Ie.value=!1}const kt=e.computed(()=>{const r=p.value;return r?be(m.value,r)??null:null}),q=e.computed(()=>kt.value?ee(kt.value.id):{});function le(r){r.autoBalanceOnChange!==void 0&&(_.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(_.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(_.lineWidthEnd=Math.max(.1,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(_.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(_.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(_.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(_.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(_.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(_.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(_.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(_.lineWidthTaper=Math.max(.1,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(_.elbowRadius=Math.max(2,Math.min(40,r.elbowRadius))),r.showOrderBadge!==void 0&&(_.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(_.canvasBg=r.canvasBg)}function Ee(r){kt.value&&xe(kt.value.id,r)}function Ae(){const r={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0};_.autoBalanceOnChange=r.autoBalanceOnChange,_.lineWidthStart=r.lineWidthStart,_.lineWidthEnd=r.lineWidthEnd,_.rainbowBranch=r.rainbowBranch,_.branchPaletteId=r.branchPaletteId,_.customPalettes=r.customPalettes,_.lineStyle=r.lineStyle,_.rootLineStyle=r.rootLineStyle,_.lineOrigin=r.lineOrigin,_.layoutMode=r.layoutMode,_.taperedEdge=r.taperedEdge,_.lineWidthTaper=r.lineWidthTaper,_.elbowRadius=r.elbowRadius,_.showOrderBadge=r.showOrderBadge,_.canvasBg=r.canvasBg}function Ue(){Dt.value=null}function ot(r){const l=p.value;l&&O(l,r)}function St(){const r=p.value;r&&ae(r)}function Rn(r){const l=p.value;l&&fe(l,r)}function ni(r){const l=p.value;l&&g(l,r)}function oi(r){const l=p.value;l&&ke(l,r)}function po(r){const l=document.querySelector(`[data-node-id="${r.id}"]`);l&&l.click()}function ii(r){ha(r.id,r.text)}function Kn(r){no(r)}function Yn(r){ci(r)}function Vt(r){tr(r.srcId,r.targetId,r.position)}function mn(r){const l=new Set(nt.value);l.has(r)?l.delete(r):l.add(r),nt.value=l}function ho(){i.builtInDrawers&&(tn.value=!tn.value),a("canvas-outline")}function go(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&te(r)}function Yi(){var w,E,v;const r=(w=B.value)==null?void 0:w.nodeId;if(!r)return;const l=((v=(E=be(m.value,r))==null?void 0:E.link)==null?void 0:v.url)??"",f=window.prompt("输入链接 URL(留空取消)",l);f!==null&&fe(r,f)}function bo(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&L(r)}function ko(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&li(r)}function qi(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&ae(r)}function vn(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&ue(r)}function ri(){var oe,T;const r=(oe=B.value)==null?void 0:oe.nodeId;if(!r)return;const l=(T=be(m.value,r))==null?void 0:T.richContent,f=(l==null?void 0:l.kind)==="code"?jo(l.raw):"",w=(l==null?void 0:l.kind)==="code"&&l.lang||"",E=w?"```"+w+`
132
+ `:"```\n",M=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?E+f+(f.endsWith("```")?"":"\n```"):E+"// 你的代码"+"\n```");if(M===null)return;const z=M.trim();if(!z){ke(r,null);return}const Z=/^```([^\s`]*)/.exec(z),j=Z?Z[1]:void 0;ke(r,{kind:"code",raw:z,lang:j})}function Xi(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&ke(r,null)}function He(){var M,z;const r=(M=B.value)==null?void 0:M.nodeId;if(!r)return;const l=(z=be(m.value,r))==null?void 0:z.richContent,f=(l==null?void 0:l.kind)==="table"?l.raw:"",E=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
133
133
  | --- | --- | --- |
134
- | a | b | c |`);if(E===null)return;const z=E.trim();if(!z){oe(r,null);return}oe(r,{kind:"table",raw:z})}function Ge(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&oe(r,null)}function on(r){i.previewMode||(d.value=new Set([r]),st(),i.builtInDrawers&&(tt(),ce.value=!0,Ve.value++),a("edit-note",r))}function Ki(r,l=60){const m=r.replace(/\s+/g," ").trim();return m.length<=l?m||"点击编辑笔记":m.slice(0,l)+"…"}function yo(r){var E;if(i.previewMode||s.value)return;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const m=p.value;if(!m)return;const T=(E=r.clipboardData)==null?void 0:E.items;if(T)for(let z=0;z<T.length;z++){const A=T[z];if(A.kind==="file"&&A.type.startsWith("image/")){const v=A.getAsFile();if(!v)continue;r.preventDefault();const K=he(u.value,m);if(K!=null&&K.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;L(v,Y=>ge(m,Y));return}}}e.onMounted(()=>{window.addEventListener("paste",yo),window.addEventListener("keydown",Yn),Te()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",yo),window.removeEventListener("keydown",Yn)});function Yn(r){if((r.metaKey||r.ctrlKey)&&(r.key==="f"||r.key==="F")){const m=r.target;if(m&&(m.tagName==="INPUT"||m.tagName==="TEXTAREA"||m.isContentEditable))return;r.preventDefault(),a("canvas-outline")}}const hn=e.ref(null),ri=e.computed(()=>{var r;return((r=hn.value)==null?void 0:r.nodeId)??null});function Yi(r,l){if(!l.image)return;r.preventDefault(),r.stopPropagation();const m=l.image.naturalW||l.image.width,T=l.image.naturalH||l.image.height,E=T>0?T/m:1;hn.value={nodeId:l.id,startX:r.clientX,startY:r.clientY,startW:l.image.width,startH:l.image.height,naturalW:m,naturalH:T,ratio:E,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",Et),window.addEventListener("mouseup",en)}function Et(r){var K,Y;const l=hn.value;if(!l)return;const m=pe.scale.value||1,T=r.clientX-l.startX,E=b(l.startW+T/m,An,Gn),z=b(E*l.ratio,An,Gn);l.pendingW=E,l.pendingH=z;const A=(K=c.value)==null?void 0:K.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);A&&(A.style.width=`${E}px`,A.style.height=`${z}px`);const v=(Y=c.value)==null?void 0:Y.querySelector(`[data-node-id="${l.nodeId}"]`);v&&(v.style.minWidth=`${Math.max(80,Math.ceil(E+28))}px`,v.style.height=`${Math.ceil(z+8+30)}px`)}function en(){const r=hn.value;if(window.removeEventListener("mousemove",Et),window.removeEventListener("mouseup",en),hn.value=null,!r)return;const l=he(u.value,r.nodeId);!l||!l.image||(ge(r.nodeId,{src:l.image.src,naturalW:l.image.naturalW,naturalH:l.image.naturalH,width:r.pendingW,height:r.pendingH}),d.value=new Set([r.nodeId]),st(),Xn=!0)}const qn=e.ref(null);let Xn=!1;function Eo(r){qn.value=r}function Zn(r){qn.value===r&&(qn.value=null),R.value&&(R.value=null)}function gn(r,l){var ue;if(!l.text||l.text.length<14)return;const T=r.currentTarget.getBoundingClientRect(),E=(ue=c.value)==null?void 0:ue.getBoundingClientRect();if(!E)return;const z=10,A=240,v=T.top-E.top>60,K=T.left-E.left+T.width/2,Y=z+A/2,ke=E.width-A/2-z,S=Math.max(Y,Math.min(K,ke)),ne=v?T.top-E.top-8:T.bottom-E.top+8;R.value={text:l.text,x:S,y:ne,above:v}}const bn=e.ref(0),Mt=e.ref(!1),Wt=ns(100);function Ie(){Wt.record({data:u.value,selectedIds:[...d.value]})}function Te(){h.value=new Set(h.value),bn.value++,e.nextTick().then(()=>e.nextTick()).then(()=>li()).then(()=>{bn.value++})}function li(){const r=document.querySelectorAll(".zm-rich"),l={},m={};r.forEach(T=>{let E=T,z=null;for(;E&&!z;)z=E.getAttribute("data-node-id"),E=E.parentElement;if(!z)return;const A=T.offsetHeight,v=T.scrollWidth,K=Math.round(A*2)/2,Y=Math.round(v*2)/2;l[z]=K,m[z]=Y,N.value[z],$.value[z]}),N.value=l,$.value=m}const bt=e.computed(()=>{var r,l,m,T,E,z,A,v,K,Y;return{rootBg:((r=i.theme)==null?void 0:r.rootBg)??"#1f2937",rootText:((l=i.theme)==null?void 0:l.rootText)??"#ffffff",branchBg:((m=i.theme)==null?void 0:m.branchBg)??"#ffffff",branchText:((T=i.theme)==null?void 0:T.branchText)??"#1f2937",lineColor:((E=i.theme)==null?void 0:E.lineColor)??"#94a3b8",bgColor:((z=i.theme)==null?void 0:z.bgColor)??"#f8fafc",fontSize:((A=i.theme)==null?void 0:A.fontSize)??14,lineWidthStart:((v=i.theme)==null?void 0:v.lineWidthStart)??2.2,lineWidthEnd:((K=i.theme)==null?void 0:K.lineWidthEnd)??.8,rainbowBranch:((Y=i.theme)==null?void 0:Y.rainbowBranch)??!1}}),kn=e.computed(()=>U.canvasBg||bt.value.bgColor),U=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0});function le(r){return r?U.rootLineStyle:U.lineStyle}function g(r){return U.taperedEdge?Q(r):ve(r)}function I(r){return U.taperedEdge?U.lineWidthEnd:ve(r)}function Q(r){const l=U.lineWidthTaper,m=U.lineWidthStart*Math.pow(l,r);return Math.max(U.lineWidthEnd,m)}function ve(r){if(r<=0)return U.lineWidthStart;if(r>=3)return U.lineWidthEnd;const l=r/3;return U.lineWidthStart+(U.lineWidthEnd-U.lineWidthStart)*l}function Ne(r,l,m,T){const E=1-r,z=E*E*E*l.x+3*E*E*r*m.x1+3*E*r*r*m.x2+r*r*r*T.x,A=E*E*E*l.y+3*E*E*r*m.y1+3*E*r*r*m.y2+r*r*r*T.y;return{x:z,y:A}}function Oe(r,l,m,T){const E=1-r,z=E*E*l.x+2*E*r*m.x+r*r*T.x,A=E*E*l.y+2*E*r*m.y+r*r*T.y;return{x:z,y:A}}function Ke(r,l,m,T,E=32,z="curve",A="right"){if(z==="curve"){let v;if(A==="right"||A==="left"){const ue=Math.abs(l.x-r.x)*.45,W=A==="right"?1:-1;v={x1:r.x+W*ue,y1:r.y,x2:l.x-W*ue,y2:l.y}}else{const ue=Math.abs(l.y-r.y)*.45;v={x1:r.x,y1:r.y+ue,x2:l.x,y2:l.y-ue}}const K=ne=>{const ue=1-ne,W=-3*ue*ue*r.x+3*(ue*ue-2*ue*ne)*v.x1+3*(2*ue*ne-ne*ne)*v.x2+3*ne*ne*l.x,Se=-3*ue*ue*r.y+3*(ue*ue-2*ue*ne)*v.y1+3*(2*ue*ne-ne*ne)*v.y2+3*ne*ne*l.y;return{dx:W,dy:Se}},Y=[],ke=[];for(let ne=0;ne<=E;ne++){const ue=ne/E,W=ne===0?r:ne===E?l:Ne(ue,r,v,l),Se=K(ue);let ze=Math.hypot(Se.dx,Se.dy);ze<1e-6&&(ze=1);const Me=-Se.dy/ze,re=Se.dx/ze,Le=(m+(T-m)*ue)/2;Y.push({x:W.x+Me*Le,y:W.y+re*Le}),ke.push({x:W.x-Me*Le,y:W.y-re*Le})}let S=`M ${Y[0].x.toFixed(2)} ${Y[0].y.toFixed(2)}`;for(let ne=1;ne<=E;ne++)S+=` L ${Y[ne].x.toFixed(2)} ${Y[ne].y.toFixed(2)}`;for(let ne=E;ne>=0;ne--)S+=` L ${ke[ne].x.toFixed(2)} ${ke[ne].y.toFixed(2)}`;return S+=" Z",S}if(z==="arc"){let v;A==="right"||A==="left"?v={x:(r.x+l.x)/2,y:l.y}:v={x:l.x,y:(r.y+l.y)/2};const K=W=>{const Se=1-W,ze=2*Se*(v.x-r.x)+2*W*(l.x-v.x),Me=2*Se*(v.y-r.y)+2*W*(l.y-v.y);return{dx:ze,dy:Me}},Y=[],ke=[];for(let W=0;W<=E;W++){const Se=W/E,ze=W===0?r:W===E?l:Oe(Se,r,v,l),Me=K(Se);let re=Math.hypot(Me.dx,Me.dy);re<1e-6&&(re=1);const Le=-Me.dy/re,nt=Me.dx/re,Z=(m+(T-m)*Se)/2;Y.push({x:ze.x+Le*Z,y:ze.y+nt*Z}),ke.push({x:ze.x-Le*Z,y:ze.y-nt*Z})}const S=m/2,ne=T/2;let ue=`M ${Y[0].x.toFixed(2)} ${Y[0].y.toFixed(2)}`;for(let W=1;W<=E;W++)ue+=` L ${Y[W].x.toFixed(2)} ${Y[W].y.toFixed(2)}`;ue+=` A ${ne.toFixed(2)} ${ne.toFixed(2)} 0 0 0 ${ke[E].x.toFixed(2)} ${ke[E].y.toFixed(2)}`;for(let W=E-1;W>=0;W--)ue+=` L ${ke[W].x.toFixed(2)} ${ke[W].y.toFixed(2)}`;return ue+=` A ${S.toFixed(2)} ${S.toFixed(2)} 0 0 0 ${Y[0].x.toFixed(2)} ${Y[0].y.toFixed(2)}`,ue+=" Z",ue}if(z==="elbow"){const v=[];if(A==="down"){const re=(r.y+l.y)/2;v.push(r,{x:r.x,y:re},{x:l.x,y:re},l)}else{const re=(r.x+l.x)/2;v.push(r,{x:re,y:r.y},{x:re,y:l.y},l)}const K=[];let Y=0;for(let re=0;re<v.length-1;re++){const Le=Math.hypot(v[re+1].x-v[re].x,v[re+1].y-v[re].y);K.push(Le),Y+=Le}const ke=[m/2];let S=0;for(let re=0;re<K.length-1;re++){S+=K[re];const Le=Y>0?S/Y:0;ke.push((m+(T-m)*Le)/2)}ke.push(T/2);const ne=[];for(let re=0;re<v.length-1;re++){const Le=v[re+1].x-v[re].x,nt=v[re+1].y-v[re].y;let Z=Math.hypot(Le,nt);Z<1e-6&&(Z=1),ne.push({x:-nt/Z,y:Le/Z})}const ue=[],W=[];ue.push({x:v[0].x+ne[0].x*ke[0],y:v[0].y+ne[0].y*ke[0]}),W.push({x:v[0].x-ne[0].x*ke[0],y:v[0].y-ne[0].y*ke[0]});for(let re=1;re<v.length-1;re++){const Le=ne[re-1],nt=ne[re],Z=ke[re];ue.push({x:v[re].x+Le.x*Z+nt.x*Z,y:v[re].y+Le.y*Z+nt.y*Z}),W.push({x:v[re].x-Le.x*Z-nt.x*Z,y:v[re].y-Le.y*Z-nt.y*Z})}const Se=ne[ne.length-1],ze=ke[ke.length-1];ue.push({x:v[v.length-1].x+Se.x*ze,y:v[v.length-1].y+Se.y*ze}),W.push({x:v[v.length-1].x-Se.x*ze,y:v[v.length-1].y-Se.y*ze});let Me=`M ${ue[0].x.toFixed(2)} ${ue[0].y.toFixed(2)}`;for(let re=1;re<ue.length;re++)Me+=` L ${ue[re].x.toFixed(2)} ${ue[re].y.toFixed(2)}`;for(let re=W.length-1;re>=0;re--)Me+=` L ${W[re].x.toFixed(2)} ${W[re].y.toFixed(2)}`;return Me+=" Z",Me}if(z==="rounded-elbow"){let v=function(Z,Ye,xt){const Vt={x:Z.pos.x-Ye*Z.d1.x,y:Z.pos.y-Ye*Z.d1.y},Rn={x:Z.pos.x+Ye*Z.d2.x,y:Z.pos.y+Ye*Z.d2.y},wt={x:Z.pos.x+Ye*(Z.d2.x-Z.d1.x),y:Z.pos.y+Ye*(Z.d2.y-Z.d1.y)},Bn=Math.atan2(Vt.y-wt.y,Vt.x-wt.x);let We=Math.atan2(Rn.y-wt.y,Rn.x-wt.x)-Bn;for(;We>Math.PI;)We-=2*Math.PI;for(;We<-Math.PI;)We+=2*Math.PI;const qe=[];for(let St=1;St<xt;St++){const Fe=St/xt,jt=Bn+We*Fe;qe.push({x:wt.x+Ye*Math.cos(jt),y:wt.y+Ye*Math.sin(jt)})}return qe};const K=[];let Y;if(A==="down"){const Z=(r.y+l.y)/2,Ye=Math.sign(Z-r.y)||1,xt=Math.sign(l.x-r.x)||1,Vt=Math.sign(l.y-Z)||1;Y=[{pos:{x:r.x,y:Z},d1:{x:0,y:Ye},d2:{x:xt,y:0}},{pos:{x:l.x,y:Z},d1:{x:xt,y:0},d2:{x:0,y:Vt}}]}else{const Z=(r.x+l.x)/2,Ye=Math.sign(Z-r.x)||1,xt=Math.sign(l.y-r.y)||1,Vt=Math.sign(l.x-Z)||1;Y=[{pos:{x:Z,y:r.y},d1:{x:Ye,y:0},d2:{x:0,y:xt}},{pos:{x:Z,y:l.y},d1:{x:0,y:xt},d2:{x:Vt,y:0}}]}const ke=Math.hypot(Y[0].pos.x-r.x,Y[0].pos.y-r.y),S=Math.hypot(Y[1].pos.x-Y[0].pos.x,Y[1].pos.y-Y[0].pos.y),ne=Math.hypot(l.x-Y[1].pos.x,l.y-Y[1].pos.y),ue=Math.min(ke,S,ne,U.elbowRadius)*.45,W=Math.max(2,ue);K.push(r),K.push({x:Y[0].pos.x-W*Y[0].d1.x,y:Y[0].pos.y-W*Y[0].d1.y});for(const Z of v(Y[0],W,7))K.push(Z);K.push({x:Y[1].pos.x-W*Y[1].d1.x,y:Y[1].pos.y-W*Y[1].d1.y});for(const Z of v(Y[1],W,7))K.push(Z);K.push(l);const Se=[];let ze=0;for(let Z=0;Z<K.length-1;Z++){const Ye=Math.hypot(K[Z+1].x-K[Z].x,K[Z+1].y-K[Z].y);Se.push(Ye),ze+=Ye}const Me=[],re=[];let Le=0;for(let Z=0;Z<K.length;Z++){const Ye=K[Math.max(0,Z-1)],xt=K[Math.min(K.length-1,Z+1)],Vt=xt.x-Ye.x,Rn=xt.y-Ye.y;let wt=Math.hypot(Vt,Rn);wt<1e-6&&(wt=1);const Bn=-Rn/wt,Nt=Vt/wt;Z>0&&(Le+=Se[Z-1]);const We=ze>0?Le/ze:0,qe=(m+(T-m)*We)/2;Me.push({x:K[Z].x+Bn*qe,y:K[Z].y+Nt*qe}),re.push({x:K[Z].x-Bn*qe,y:K[Z].y-Nt*qe})}let nt=`M ${Me[0].x.toFixed(2)} ${Me[0].y.toFixed(2)}`;for(let Z=1;Z<Me.length;Z++)nt+=` L ${Me[Z].x.toFixed(2)} ${Me[Z].y.toFixed(2)}`;nt+=` L ${re[Me.length-1].x.toFixed(2)} ${re[Me.length-1].y.toFixed(2)}`;for(let Z=re.length-2;Z>=0;Z--)nt+=` L ${re[Z].x.toFixed(2)} ${re[Z].y.toFixed(2)}`;return nt+=" Z",nt}{const v=l.x-r.x,K=l.y-r.y;let Y=Math.hypot(v,K);Y<1e-6&&(Y=1);const ke=-K/Y,S=v/Y,ne=m/2,ue=T/2,W={x:r.x+ke*ne,y:r.y+S*ne},Se={x:r.x-ke*ne,y:r.y-S*ne},ze={x:l.x-ke*ue,y:l.y-S*ue},Me={x:l.x+ke*ue,y:l.y+S*ue};return`M ${W.x.toFixed(2)} ${W.y.toFixed(2)} L ${Me.x.toFixed(2)} ${Me.y.toFixed(2)} L ${ze.x.toFixed(2)} ${ze.y.toFixed(2)} L ${Se.x.toFixed(2)} ${Se.y.toFixed(2)} Z`}}const at=e.computed(()=>ft.value.root.children),At=cn[0].colors,Jn=e.computed(()=>Fa(U.branchPaletteId,U.customPalettes)),Pe=e.computed(()=>{const r=new Map;if(!U.rainbowBranch)return r;const l=i.lineColors,m=l&&l.length>0?l:Jn.value.colors.length>0?Jn.value.colors:At;for(let E=0;E<at.value.length;E++){const z=at.value[E];r.set(z.id,m[E%m.length])}const T=(E,z)=>{r.set(E.id,z);for(const A of E.children)T(A,z)};for(let E=0;E<at.value.length;E++){const z=at.value[E];T(z,m[E%m.length])}return r});function xo(r,l){return U.rainbowBranch?Pe.value.get(l.id)??bt.value.lineColor:bt.value.lineColor}function wo(r){const l=J(r.id);if(l.bg)return l.bg;if(r.isRoot)return bt.value.rootBg;if(U.rainbowBranch){const m=Pe.value.get(r.id);if(m)return lh(m,.18)}return bt.value.branchBg}function Qn(r){const l=J(r.id);if(l.textColor)return l.textColor;if(r.isRoot)return bt.value.rootText;if(U.rainbowBranch){const m=Pe.value.get(r.id);if(m)return Yl(m,.55)}return bt.value.branchText}function eo(r){const l=J(r.id);if(l.borderColor)return l.borderColor;if(r.isRoot)return bt.value.rootBg;if(U.rainbowBranch){const m=Pe.value.get(r.id);if(m)return Yl(m,.3)}return bt.value.lineColor}function jl(r){const l=J(r.id);return l.fontWeight?l.fontWeight:r.isRoot?700:r.depth<=1?600:r.depth===2?500:400}function Kl(r){return J(r.id).fontSize??r.fontSize??bt.value.fontSize}function lh(r,l){const m=r.replace("#",""),T=m.length===6?m:m.split("").map(v=>v+v).join(""),E=parseInt(T.slice(0,2),16),z=parseInt(T.slice(2,4),16),A=parseInt(T.slice(4,6),16);return`rgba(${E}, ${z}, ${A}, ${l})`}function Yl(r,l){const m=r.replace("#",""),T=m.length===6?m:m.split("").map(v=>v+v).join(""),E=Math.round(parseInt(T.slice(0,2),16)*(1-l)),z=Math.round(parseInt(T.slice(2,4),16)*(1-l)),A=Math.round(parseInt(T.slice(4,6),16)*(1-l));return`rgb(${E}, ${z}, ${A})`}const pe=Qa({getContainer:()=>c.value});pe.setOnMarqueeEnd(Nh),ts({isEditing:()=>s.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>p.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>u.value.id,onAddChild:no,onAddSibling:ai,onAddSiblingBefore:ph,onRemove:aa,onStartEdit:No,onClearSelection:()=>{d.value=new Set,st()},onDuplicate:ea,onCopy:ia,onCut:ra,onPaste:la,hasClipboard:()=>!!F.value&&F.value.nodes.length>0,onUndo:Xi,onRedo:Zi,onNavigate:hh,onSelectRoot:()=>{d.value=new Set([u.value.id]),st()}});const ft=e.computed(()=>{const r=zt(u.value);return Zl(r),Da(r,{mode:U.layoutMode,baseFontSize:bt.value.fontSize,richHeights:N.value,richWidths:$.value})}),ql=e.ref([]),to=e.computed(()=>(bn.value,ql.value));e.watch(ft,r=>{const l=[],m=T=>{l.push(T);for(const E of T.children)m(E)};m(r.root),ql.value=l},{immediate:!0});const Xl=e.computed(()=>{const r=[];for(const l of to.value)for(const m of l.children)r.push({from:l,to:m,key:`${l.id}->${m.id}`});return r}),ah=e.computed(()=>`${ft.value.vbX} ${ft.value.vbY} ${ft.value.vbW} ${ft.value.vbH}`);function Zl(r){if(h.value.has(r.id)){r.children=[],r.collapsed=!0;return}r.collapsed=!1;for(const l of r.children)Zl(l)}function No(r){const l=he(u.value,r);l&&(s.value=r,f.value=l.text,d.value=new Set([r]),st(),e.nextTick(()=>{const m=document.querySelector(".zm-input");m==null||m.focus(),m==null||m.select(),Jl(m)}))}function qi(){if(!s.value)return;const r=he(u.value,s.value);r&&r.text!==(f.value.trim()||" ")&&(r.text=f.value.trim()||" ",Ie(),a("change",u.value)),s.value=null}function sh(){s.value=null}function Jl(r){r&&(r.style.height="auto",r.style.height=r.scrollHeight+"px")}function ch(r){Jl(r.target)}function dh(r){if(i.previewMode)return;const l=he(u.value,r);l!=null&&l.richContent&&(M.value=r,k.value=l.richContent.raw,e.nextTick(()=>{const m=document.querySelector(".zm-node .zm-rich textarea");m==null||m.focus()}))}function Ql(){if(!M.value)return;const r=M.value,l=he(u.value,r),m=k.value;if(l&&l.richContent&&l.richContent.raw!==m)if(l.richContent.kind==="code"){const T=Nn(m)||void 0;oe(r,{kind:"code",raw:m,lang:T})}else oe(r,{kind:"table",raw:m});M.value=null}function uh(){M.value=null}function fh(r){r.key==="Escape"?(r.preventDefault(),uh()):r.key==="Enter"&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),Ql())}function mh(r){const l=r.metaKey||r.ctrlKey;l&&(r.key==="z"||r.key==="Z")&&!r.shiftKey?(r.preventDefault(),Xi()):(l&&r.shiftKey&&(r.key==="z"||r.key==="Z")||l&&(r.key==="y"||r.key==="Y")&&!r.shiftKey)&&(r.preventDefault(),Zi())}function no(r){const l=kr(u.value,r,vo);l&&(Ie(),Te(),a("change",u.value),e.nextTick(()=>No(l.id)))}function ai(r){if(r===u.value.id){no(r);return}const l=yr(u.value,r,vo);l&&(Ie(),Te(),a("change",u.value),e.nextTick(()=>No(l.id)))}function ph(r){if(r===u.value.id){no(r);return}const l=Ya(u.value,r,vo);l&&(Ie(),Te(),a("change",u.value),e.nextTick(()=>No(l.id)))}function ea(r){if(r===u.value.id)return;const l=qa(u.value,r);l&&(Ie(),d.value=new Set([l.id]),st(),a("change",u.value),Te())}function ta(r){const l=[],m=new Set;for(const T of r)T!==u.value.id&&(m.has(T)||he(u.value,T)&&(m.add(T),l.push(T)));return l}function na(r){const l=new Set(r),m=[],T=E=>{l.has(E.id)&&m.push(E.id);for(const z of E.children)T(z)};return T(u.value),m}function oa(r){var l;try{(l=navigator.clipboard)==null||l.writeText(r)}catch{}}function ia(r){const l=na(ta(r));if(l.length===0)return;const m=[];for(const T of l){const E=Er(u.value,T);E&&m.push(E)}m.length!==0&&(F.value={nodes:m,originalIds:new Set(l)},oa(m.map(T=>T.text).join(`
135
- `)),Te())}function ra(r){const l=na(ta(r));if(l.length===0)return;const m=[];for(const T of l){const E=Er(u.value,T);E&&m.push(E)}if(m.length!==0){Ie();for(const T of l)Ro(u.value,T);d.value=new Set,st(),F.value={nodes:m,originalIds:new Set(l)},oa(m.map(T=>T.text).join(`
136
- `)),Te(),a("change",u.value)}}function la(r){const l=F.value;if(!l||l.nodes.length===0)return;const m=r??u.value.id,T=he(u.value,m);if(T){for(const E of l.originalIds){const z=he(u.value,E);if(z&&he(z,m))return}Ie();for(const E of l.nodes){const z=zt(E);Bo(z),T.children.push(z)}F.value=null,Te(),a("change",u.value)}}function Xi(){const r=Wt.undo();r&&(u.value=r.data,d.value=new Set(r.selectedIds??[]),st(),Te(),a("change",u.value))}function Zi(){const r=Wt.redo();r&&(u.value=r.data,d.value=new Set(r.selectedIds??[]),st(),Te(),a("change",u.value))}function st(){const r=[];for(const l of d.value){const m=he(u.value,l);m&&r.push(m)}if(i.builtInDrawers&&!i.previewMode&&r.length>0){const l=r[0];!ce.value&&ha(l.id)&&(tt(),ce.value=!0)}else i.builtInDrawers&&r.length===0&&(ce.value=!1);a("select",r.length>0?r:null)}function hh(r,l){const m=p.value??u.value.id,T=he(u.value,m);if(!T)return;let E=null;if(l===1){const z=Ft(u.value,T.id);if(z){const A=z.children.findIndex(v=>v.id===T.id);A>=0&&A<z.children.length-1&&(E=z.children[A+1].id)}}else if(l===-1){const z=Ft(u.value,T.id);if(z){const A=z.children.findIndex(v=>v.id===T.id);A>0&&(E=z.children[A-1].id)}}else if(r===1){const z=Ft(u.value,T.id);z&&(E=z.id)}else r===-1&&T.children.length>0&&(E=T.children[0].id);E&&(d.value=new Set([E]),st())}function aa(r){if(r!==u.value.id&&Ro(u.value,r)){if(Ie(),d.value.has(r)){const l=new Set(d.value);l.delete(r),d.value=l,st()}Te(),a("change",u.value)}}function sa(r){h.value.has(r)?h.value.delete(r):h.value.add(r),Te()}function ca(r){const l=[{n:u.value,depth:1}];for(;l.length;){const{n:m,depth:T}=l.pop();r(m,T);for(let E=m.children.length-1;E>=0;E--)l.push({n:m.children[E],depth:T+1})}}function gh(){h.value=new Set,ca(r=>{r.children.length>0&&h.value.add(r.id)}),Te()}function da(r){h.value=new Set,ca((l,m)=>{m>r&&l.children.length>0&&h.value.add(l.id)}),Te()}function bh(){h.value=new Set,Te()}function ua(r,l){ja(u.value,r,l)&&(Ie(),Te(),a("change",u.value))}function Ji(r,l,m){return Ka(u.value,r,l,m)?(Ie(),Te(),a("change",u.value),!0):!1}function kh(r,l){if(r.stopPropagation(),r.shiftKey){const m=new Set(d.value);m.has(l.id)?m.delete(l.id):m.add(l.id),d.value=m}else d.value=new Set([l.id]);st()}function yh(r,l,m){let T=null;for(const E of to.value){if(E.id===m)continue;const z=E.width/2,A=E.height/2;r>=E.x-z&&r<=E.x+z&&l>=E.y-A&&l<=E.y+A&&(T=E)}return T}let Gt=null;function Eh(r,l){if(i.previewMode||l.isRoot||r.button!==0)return;const m=r.target;if(m!=null&&m.closest(".zm-img-resize-handle"))return;r.stopPropagation();const T=c.value.getBoundingClientRect(),E=l.x*pe.scale.value+pe.offsetX.value,z=l.y*pe.scale.value+pe.offsetY.value,A=r.clientX-T.left-E,v=r.clientY-T.top-z;Gt={srcId:l.id,srcText:l.text,pointerOffsetX:A,pointerOffsetY:v,startX:r.clientX,startY:r.clientY},window.addEventListener("pointermove",fa),window.addEventListener("pointerup",si),window.addEventListener("pointercancel",si)}function fa(r){if(Gt){const A=r.clientX-Gt.startX,v=r.clientY-Gt.startY;if(Math.abs(A)<=Wl&&Math.abs(v)<=Wl)return;C.value={srcId:Gt.srcId,srcText:Gt.srcText,pointerOffsetX:Gt.pointerOffsetX,pointerOffsetY:Gt.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),Gt=null}const l=C.value;if(!l)return;const m=c.value.getBoundingClientRect();D.value=r.clientX-m.left-l.pointerOffsetX,_.value=r.clientY-m.top-l.pointerOffsetY;const T=(r.clientX-m.left-pe.offsetX.value)/pe.scale.value,E=(r.clientY-m.top-pe.offsetY.value)/pe.scale.value,z=yh(T,E,l.srcId);l.currentTargetId=(z==null?void 0:z.id)??null}function si(r){if(window.removeEventListener("pointermove",fa),window.removeEventListener("pointerup",si),window.removeEventListener("pointercancel",si),Gt){Gt=null;return}const l=C.value;l&&(l.currentTargetId&&(Ji(l.srcId,l.currentTargetId,"child"),d.value=new Set([l.srcId]),st()),C.value=null,D.value=0,_.value=0,document.body.classList.remove("is-dragging"))}let ci=!1;function xh(r){const l=r.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(r.button===2){ci=!0,pe.startPan(r);return}if(ci=!1,r.button!==0)return;const m=c.value.getBoundingClientRect(),T=(r.clientX-m.left-pe.offsetX.value)/pe.scale.value,E=(r.clientY-m.top-pe.offsetY.value)/pe.scale.value;pe.startMarquee(T,E,{shift:r.shiftKey})}function wh(r){if(Xn){Xn=!1;return}const l=r.target;if(!l||l.closest(".zm-node"))return;const m=pe.marquee;m.width>=4||m.height>=4||d.value.size>0&&(d.value=new Set,st())}function Nh(){const r=pe.marquee;if(r.width<4&&r.height<4)return;const l=r.x,m=r.y,T=r.x+r.width,E=r.y+r.height,z=[];for(const A of to.value){const v=A.width/2,K=A.height/2,Y=A.x-v,ke=A.x+v,S=A.y-K,ne=A.y+K;Y<=T&&ke>=l&&S<=E&&ne>=m&&z.push(A.id)}d.value=r.shiftKey?new Set([...d.value,...z]):new Set(z),st()}function ma(r){return h.value.has(r)}function Sh(r){const l=he(u.value,r.id);return!!l&&l.children.length>0}function Qi(r){const l=he(u.value,r);return l?l.children.length:0}function pa(r){if(!he(u.value,r))return 0;const T=[u.value];for(;T.length;){const E=T.pop(),z=E.children.findIndex(A=>A.id===r);if(z>=0)return z;for(const A of E.children)T.push(A)}return 0}function di(r,l,m,T){const E=(T==null?void 0:T._dir)??r._dir;if(l==="out"&&r.isRoot&&U.lineOrigin==="center")return{x:r.x,y:r.y};if(l==="out"&&r.isRoot&&U.lineOrigin==="proportional"&&T){const v=ft.value.root.children;if(E==="down"){const ue=v.reduce((Me,re)=>Math.max(Me,Math.abs(re.x-r.x)),1),W=Math.min(1,Math.abs(T.x-r.x)/ue),Se=r.y+r.height/2,ze=r.y;return{x:r.x,y:Se+(ze-Se)*W}}const K=v.reduce((ue,W)=>Math.max(ue,Math.abs(W.y-r.y)),1),Y=Math.min(1,Math.abs(T.y-r.y)/K),ke=m!==void 0?m:r.side,S=r.x+ke*(r.width/2),ne=r.x;return{x:S+(ne-S)*Y,y:r.y}}if(E==="down")return l==="out"?{x:r.x,y:r.y+r.height/2}:{x:r.x,y:r.y-r.height/2};let z;l==="in"?z=-r.side:m!==void 0?z=m:z=r.side;const A=l==="in"?r._richInsetX??0:0;return{x:r.x+z*(r.width/2-A),y:r.y}}function rn(){const r=ft.value;pe.resetView(r.width,r.height,r.root.y)}function Th(){Mt.value=!0,Ie(),Te(),e.nextTick(()=>rn())}function er(r){U.layoutMode!==r&&(U.layoutMode=r,Te(),e.nextTick(()=>rn()))}function Ch(){return JSON.stringify(u.value,null,2)}function ha(r){const l=he(u.value,r);return l?!!(l.note&&l.note.text||l.link&&l.link.url||l.image&&l.image.src||l.richContent&&l.richContent.raw||l.markers&&l.markers.length>0||l.tags&&l.tags.length>0):!1}function Mh(r){try{const l=JSON.parse(r);return!l.id||!Array.isArray(l.children)?!1:(Wt.reset(),u.value=zt(l),d.value=new Set,h.value=new Set,Te(),e.nextTick(()=>rn()),a("change",u.value),!0)}catch{return!1}}const ga=e.ref(""),ln=e.ref([]),So=e.ref(-1);function Ah(r){ga.value=r;const l=r.trim();if(!l){ln.value=[],So.value=-1;return}const m=l.toLowerCase(),T=[],E=z=>{var A;(z.text.toLowerCase().includes(m)||(A=z.note)!=null&&A.text&&z.note.text.toLowerCase().includes(m))&&T.push(z.id);for(const v of z.children)E(v)};E(u.value),ln.value=T,So.value=T.length>0?0:-1,T.length>0&&(vh(T),e.nextTick(()=>zh(0)))}function _h(r){return ln.value.includes(r)}function Rh(r){return So.value>=0&&ln.value[So.value]===r}function Bh(r){return ga.value.trim().length>0&&ln.value.length>0&&!ln.value.includes(r)}function vh(r){if(r.length===0)return;const l=new Set(r),m=new Set,T=E=>{let z=l.has(E.id);for(const A of E.children)T(A)&&(z=!0);return z&&E.children.length>0&&h.value.has(E.id)&&m.add(E.id),z};if(T(u.value),m.size>0){for(const E of m)h.value.delete(E);Te()}}function zh(r){const l=ln.value[r];if(!l)return;const m=to.value.find(T=>T.id===l);m&&(d.value=new Set([l]),st(),pe.centerOn(m.x,m.y,m.width,m.height))}function Ih(r,l){const m=he(u.value,r);m&&(m.markers||(m.markers=[]),!m.markers.includes(l)&&(m.markers.push(l),Ie(),Te(),a("change",u.value)))}function Oh(r,l){const m=he(u.value,r);if(!m||!m.markers)return;const T=m.markers.indexOf(l);T<0||(m.markers.splice(T,1),m.markers.length===0&&delete m.markers,Ie(),Te(),a("change",u.value))}function ba(r,l){const m=he(u.value,r);if(!m)return!1;m.markers||(m.markers=[]);const T=m.markers.indexOf(l);return T>=0?(m.markers.splice(T,1),m.markers.length===0&&delete m.markers,Ie(),Te(),a("change",u.value),!1):(m.markers.push(l),Ie(),Te(),a("change",u.value),!0)}function Lh(r){const l=he(u.value,r);return l!=null&&l.markers?[...l.markers]:[]}function Dh(r){var m;const l=(m=te.value)==null?void 0:m.nodeId;l&&ba(l,r)}function Vh(){var m;const r=(m=te.value)==null?void 0:m.nodeId;if(!r)return;const l=he(u.value,r);!l||!l.markers||(delete l.markers,Ie(),Te(),a("change",u.value),ie())}function tr(r,l){const m=he(u.value,r);m&&(l.length===0?m.tags&&delete m.tags:m.tags=[...l],Ie(),Te(),a("change",u.value))}function $h(r){const l=he(u.value,r);return l!=null&&l.tags?[...l.tags]:[]}function Ph(){var z,A;const r=(z=te.value)==null?void 0:z.nodeId;if(!r)return;const l=he(u.value,r),m=((A=l==null?void 0:l.tags)==null?void 0:A.join(", "))??"",T=window.prompt("输入标签(多个用逗号分隔)",m);if(T===null)return;const E=T.split(/[,,]/).map(v=>v.trim()).filter(v=>v.length>0);tr(r,E),ie()}function Fh(){var l;const r=(l=te.value)==null?void 0:l.nodeId;r&&(tr(r,[]),ie())}function ka(){const r=ft.value,l="http://www.w3.org/2000/svg",m=document.createElementNS(l,"svg");m.setAttribute("xmlns",l),m.setAttribute("viewBox",`${r.vbX} ${r.vbY} ${r.vbW} ${r.vbH}`),m.setAttribute("width",String(r.vbW)),m.setAttribute("height",String(r.vbH));const T=document.createElementNS(l,"rect");T.setAttribute("x",String(r.vbX)),T.setAttribute("y",String(r.vbY)),T.setAttribute("width",String(r.vbW)),T.setAttribute("height",String(r.vbH)),T.setAttribute("fill",kn.value),m.appendChild(T);for(const A of Xl.value){const v=document.createElementNS(l,"path");v.setAttribute("d",Ke(di(A.from,"out",A.to.side,A.to),di(A.to,"in"),g(A.from.depth),I(A.to.depth),32,le(A.from.isRoot),A.to._dir)),v.setAttribute("fill",xo(A.from,A.to)),v.setAttribute("stroke","none"),m.appendChild(v)}const E="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function z(A,v){let K=0;for(const Y of A)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(Y)?K+=v:K+=v*.55;return K}for(const A of to.value){const v=A.x-A.width/2,K=A.y-A.height/2,Y=document.createElementNS(l,"rect");Y.setAttribute("x",String(v)),Y.setAttribute("y",String(K)),Y.setAttribute("width",String(A.width)),Y.setAttribute("height",String(A.height)),Y.setAttribute("rx","8"),Y.setAttribute("fill",wo(A)),Y.setAttribute("stroke",eo(A)),Y.setAttribute("stroke-width","1"),m.appendChild(Y);const ke=!!(A.tags&&A.tags.length>0),S=!!(A.markers&&A.markers.length>0),ne=!!A.image,ue=!!(A.richContent&&(A.richContent.kind==="code"||A.richContent.kind==="table"));let W=0,Se=0;if(ue){const We=A.richContent,qe=A.fontSize*.78*.92,St=6,Fe=4,jt=2,yn=6;if(We.kind==="code"){const _t=Go(We.raw),kt=Nn(We.raw),Rt=_t.split(`
137
- `),tn=qe*1.35;let $t=0;for(const Ue of Rt)$t=Math.max($t,z(Ue,qe));Se=Math.min($t+St*2+4,A.width-4),W=Rt.length*tn+Fe*2+jt;const ot=A.x-Se/2;let mt=K+4;ne&&(mt=K+A.image.height+yn);const Bt=document.createElementNS(l,"rect");if(Bt.setAttribute("x",String(ot)),Bt.setAttribute("y",String(mt)),Bt.setAttribute("width",String(Se)),Bt.setAttribute("height",String(W-jt)),Bt.setAttribute("rx","6"),Bt.setAttribute("fill","rgba(255,255,255,0.55)"),Bt.setAttribute("stroke",eo(A)),Bt.setAttribute("stroke-width","1"),m.appendChild(Bt),kt){const Ue=document.createElementNS(l,"text");Ue.setAttribute("x",String(ot+Se-St)),Ue.setAttribute("y",String(mt+Fe+4)),Ue.setAttribute("text-anchor","end"),Ue.setAttribute("fill",Qn(A)),Ue.setAttribute("font-size",String(qe*.8)),Ue.setAttribute("font-family",E),Ue.setAttribute("opacity","0.5"),Ue.textContent=kt,m.appendChild(Ue)}const Co="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Ue=0;Ue<Rt.length;Ue++){const ct=document.createElementNS(l,"text");ct.setAttribute("x",String(ot+St)),ct.setAttribute("y",String(mt+Fe+(Ue+.5)*tn+2)),ct.setAttribute("dominant-baseline","central"),ct.setAttribute("fill",Qn(A)),ct.setAttribute("font-size",String(qe)),ct.setAttribute("font-family",Co);let Pt=Rt[Ue];const Xe=Math.floor((Se-St*2)/(qe*.6));Pt.length>Xe&&(Pt=Pt.substring(0,Xe-1)+"…"),ct.textContent=Pt,m.appendChild(ct)}}else if(We.kind==="table"){const _t=Ci(We.raw);if(_t.length>0){const kt=qe*1.35,Rt=6,tn=3,$t=_t[0].length,ot=[];for(let Xe=0;Xe<$t;Xe++){let an=0;for(const En of _t)Xe<En.length&&(an=Math.max(an,z(En[Xe],qe)));ot.push(an+Rt*2)}Se=Math.min(ot.reduce((Xe,an)=>Xe+an,0),A.width-4);const mt=Se/ot.reduce((Xe,an)=>Xe+an,0);for(let Xe=0;Xe<$t;Xe++)ot[Xe]*=mt;W=_t.length*(kt+tn*2)+jt;const Bt=A.x-Se/2;let Co=K+4;ne&&(Co=K+A.image.height+yn);const Ue=document.createElementNS(l,"rect");Ue.setAttribute("x",String(Bt)),Ue.setAttribute("y",String(Co)),Ue.setAttribute("width",String(Se)),Ue.setAttribute("height",String(W-jt)),Ue.setAttribute("rx","6"),Ue.setAttribute("fill","rgba(255,255,255,0.55)"),Ue.setAttribute("stroke",eo(A)),Ue.setAttribute("stroke-width","1"),m.appendChild(Ue);let ct=Bt,Pt=Co;for(let Xe=0;Xe<_t.length;Xe++){const an=_t[Xe],En=kt+tn*2;ct=Bt;for(let Mo=0;Mo<$t;Mo++){const oo=ot[Mo],Uh=an[Mo]||"";if(Mo<$t-1){const Ze=document.createElementNS(l,"line");Ze.setAttribute("x1",String(ct+oo)),Ze.setAttribute("y1",String(Pt)),Ze.setAttribute("x2",String(ct+oo)),Ze.setAttribute("y2",String(Pt+En)),Ze.setAttribute("stroke",eo(A)),Ze.setAttribute("stroke-width","1"),m.appendChild(Ze)}if(Xe<_t.length-1){const Ze=document.createElementNS(l,"line");Ze.setAttribute("x1",String(ct)),Ze.setAttribute("y1",String(Pt+En)),Ze.setAttribute("x2",String(ct+oo)),Ze.setAttribute("y2",String(Pt+En)),Ze.setAttribute("stroke",eo(A)),Ze.setAttribute("stroke-width","1"),m.appendChild(Ze)}if(Xe===0){const Ze=document.createElementNS(l,"rect");Ze.setAttribute("x",String(ct)),Ze.setAttribute("y",String(Pt)),Ze.setAttribute("width",String(oo)),Ze.setAttribute("height",String(En)),Ze.setAttribute("fill","rgba(255,255,255,0.4)"),m.appendChild(Ze)}const sn=document.createElementNS(l,"text");sn.setAttribute("x",String(ct+Rt)),sn.setAttribute("y",String(Pt+tn+kt/2+2)),sn.setAttribute("dominant-baseline","central"),sn.setAttribute("fill",Qn(A)),sn.setAttribute("font-size",String(qe)),sn.setAttribute("font-family",E),Xe===0&&sn.setAttribute("font-weight","600");let ui=Uh;const nr=Math.floor((oo-Rt*2)/(qe*.55));ui.length>nr&&nr>2&&(ui=ui.substring(0,nr-1)+"…"),sn.textContent=ui,m.appendChild(sn),ct+=oo}Pt+=En}}}}let ze=0;if(ne){const We=A.image,qe=K+4,St=A.x-We.width/2,Fe=document.createElementNS(l,"image");Fe.setAttribute("x",String(St)),Fe.setAttribute("y",String(qe)),Fe.setAttribute("width",String(We.width)),Fe.setAttribute("height",String(We.height)),Fe.setAttribute("href",We.src),Fe.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",We.src),Fe.setAttribute("preserveAspectRatio","xMidYMid meet"),m.appendChild(Fe),ze=We.height+6}let Me=A.y;const re=ze+W;re>0?Me=K+re+(A.height-re)/2:ke&&(Me=A.y-8);const Le=14,nt=2,Z=4,Ye=S?A.markers.length:0,xt=Ye>0?Ye*Le+(Ye-1)*nt+Z:0,Vt=z(A.text,A.fontSize),Rn=xt+Vt,wt=A.x-Rn/2;if(S){let We=wt;for(const qe of A.markers){const St=Io(qe);if(St){const Fe=document.createElementNS(l,"svg");Fe.setAttribute("x",String(We)),Fe.setAttribute("y",String(Me-Le/2)),Fe.setAttribute("width",String(Le)),Fe.setAttribute("height",String(Le)),Fe.setAttribute("viewBox","0 0 24 24"),Fe.setAttribute("color",Qn(A));const yn=new DOMParser().parseFromString(`<svg xmlns="${l}">${St}</svg>`,"image/svg+xml");if(!yn.querySelector("parsererror"))for(;yn.documentElement.firstChild;)Fe.appendChild(yn.documentElement.firstChild);m.appendChild(Fe)}We+=Le+nt}}const Bn=S?wt+xt+Vt/2:A.x,Nt=document.createElementNS(l,"text");if(Nt.setAttribute("x",String(Bn)),Nt.setAttribute("y",String(Me)),Nt.setAttribute("text-anchor","middle"),Nt.setAttribute("dominant-baseline","central"),Nt.setAttribute("fill",Qn(A)),Nt.setAttribute("font-size",String(Kl(A))),Nt.setAttribute("font-weight",String(jl(A))),Nt.setAttribute("font-family",E),Nt.textContent=A.text,m.appendChild(Nt),ke){const Fe=A.y+10,jt=A.tags.map(kt=>z(kt,10)+12),yn=jt.reduce((kt,Rt)=>kt+Rt+3,-3);let _t=A.x-yn/2;for(let kt=0;kt<A.tags.length;kt++){const Rt=A.tags[kt],tn=hi(Rt),$t=jt[kt],ot=document.createElementNS(l,"rect");ot.setAttribute("x",String(_t)),ot.setAttribute("y",String(Fe-16/2)),ot.setAttribute("width",String($t)),ot.setAttribute("height",String(16)),ot.setAttribute("rx",String(16/2)),ot.setAttribute("fill",tn.background),ot.setAttribute("stroke",tn.borderColor),ot.setAttribute("stroke-width","1"),m.appendChild(ot);const mt=document.createElementNS(l,"text");mt.setAttribute("x",String(_t+$t/2)),mt.setAttribute("y",String(Fe)),mt.setAttribute("text-anchor","middle"),mt.setAttribute("dominant-baseline","central"),mt.setAttribute("fill",tn.color),mt.setAttribute("font-size",String(10)),mt.setAttribute("font-family",E),mt.textContent=Rt,m.appendChild(mt),_t+=$t+3}}}return m}function To(){const r=ka();let m=new XMLSerializer().serializeToString(r);m.startsWith("<?xml")||(m=`<?xml version="1.0" encoding="UTF-8"?>
138
- `+m);const T=new Blob([m],{type:"image/svg+xml;charset=utf-8"}),E=URL.createObjectURL(T),z=document.createElement("a");z.href=E,z.download=`${u.value.text||"mindmap"}.svg`,z.click(),URL.revokeObjectURL(E)}function ya(r=2){const l=ka(),m=ft.value;let E=new XMLSerializer().serializeToString(l);E.startsWith("<?xml")||(E=`<?xml version="1.0" encoding="UTF-8"?>
139
- `+E);const z=new Blob([E],{type:"image/svg+xml;charset=utf-8"}),A=URL.createObjectURL(z),v=new window.Image;v.onload=()=>{const K=document.createElement("canvas");K.width=Math.ceil(m.vbW*r),K.height=Math.ceil(m.vbH*r);const Y=K.getContext("2d");if(!Y){URL.revokeObjectURL(A);return}Y.fillStyle=kn.value,Y.fillRect(0,0,K.width,K.height),Y.drawImage(v,0,0,K.width,K.height),URL.revokeObjectURL(A);try{K.toBlob(ke=>{if(!ke){To();return}const S=URL.createObjectURL(ke),ne=document.createElement("a");ne.href=S,ne.download=`${u.value.text||"mindmap"}.png`,ne.click(),URL.revokeObjectURL(S)},"image/png")}catch(ke){console.warn("PNG export failed, falling back to SVG:",ke),To()}},v.onerror=()=>{URL.revokeObjectURL(A),To()},v.src=A}return o({addChild:r=>no(r),addSibling:r=>ai(r),removeNode:r=>aa(r),duplicateNode:r=>ea(r),setNodeText:(r,l)=>ua(r,l),moveNode:(r,l,m)=>Ji(r,l,m),lineWidthForDepth:g,endWidthForDepth:I,getData:()=>u.value,nodeHasContent:r=>ha(r),getSelectedIds:()=>[...d.value],copyNodes:r=>ia(r),cutNodes:r=>ra(r),pasteNodes:r=>la(r),setData:r=>{Wt.reset(),u.value=zt(r),d.value=new Set,h.value=new Set,Te(),Ie(),e.nextTick(()=>rn())},resetView:()=>rn(),exportData:Ch,importData:Mh,getMarkdown:()=>On(u.value),setMarkdown:(r,l=!0)=>{const m=In(r||"");l&&(j.value=!0),q=!l,Wt.reset(),u.value=zt(m),d.value=new Set,h.value=new Set,Te(),Ie(),e.nextTick(()=>{q=!1,rn()}),a("change",u.value)},setBalanced:r=>{Mt.value=r},isBalanced:()=>Mt.value,balance:()=>Th(),applyNodeStyle:(r,l)=>me(r,l),getNodeStyle:r=>J(r),applyNodeImage:(r,l)=>ge(r,l),applyNodeImageByUrl:(r,l)=>ye(r,l),removeNodeImage:r=>de(r),applyNodeLink:(r,l)=>ee(r,l),removeNodeLink:r=>be(r),applyNodeNote:(r,l)=>O(r,l),removeNodeNote:r=>B(r),applyNodeRichContent:(r,l)=>oe(r,l),addNodeMarker:(r,l)=>Ih(r,l),removeNodeMarker:(r,l)=>Oh(r,l),toggleNodeMarker:(r,l)=>ba(r,l),getNodeMarkers:r=>Lh(r),setNodeTags:(r,l)=>tr(r,l),getNodeTags:r=>$h(r),exportPNG:r=>ya(r),exportSVG:()=>To(),searchNodes:r=>(Ah(r),[...ln.value]),undo:()=>Xi(),redo:()=>Zi(),canUndo:()=>Wt.canUndo(),canRedo:()=>Wt.canRedo(),applySettings:r=>{r.autoBalanceOnChange!==void 0&&(U.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(U.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(U.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(U.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(U.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(U.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(U.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(U.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(U.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(U.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(U.lineWidthTaper=Math.max(.3,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(U.elbowRadius=Math.max(2,Math.min(20,r.elbowRadius))),r.showOrderBadge!==void 0&&(U.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(U.canvasBg=r.canvasBg)},getSettings:()=>({autoBalanceOnChange:U.autoBalanceOnChange,lineWidthStart:U.lineWidthStart,lineWidthEnd:U.lineWidthEnd,rainbowBranch:U.rainbowBranch,branchPaletteId:U.branchPaletteId,customPalettes:U.customPalettes,lineStyle:U.lineStyle,rootLineStyle:U.rootLineStyle,lineOrigin:U.lineOrigin,layoutMode:U.layoutMode,taperedEdge:U.taperedEdge,lineWidthTaper:U.lineWidthTaper,elbowRadius:U.elbowRadius,showOrderBadge:U.showOrderBadge,canvasBg:U.canvasBg}),setBranchPalette:r=>{if(!r)return;[...cn,...U.customPalettes].find(m=>m.id===r)&&(U.branchPaletteId=r)},getBranchPalette:()=>U.branchPaletteId,getBranchPalettes:()=>[...cn,...U.customPalettes],getSearchResults:()=>[...ln.value],getSearchIndex:()=>So.value}),e.watch(()=>i.data,r=>{u.value=zt(r),Te()},{deep:!1}),e.onMounted(()=>{Ie(),e.nextTick(()=>rn())}),(r,l)=>{var m,T,E,z,A,v,K,Y,ke;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:kn.value,fontSize:bt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:xh,onContextmenu:xe,onWheel:l[25]||(l[25]=(...S)=>e.unref(pe).onWheel&&e.unref(pe).onWheel(...S)),onMouseenter:l[26]||(l[26]=S=>y.value=!0),onMouseleave:l[27]||(l[27]=S=>y.value=!1),onClick:wh},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:ft.value.vbX*e.unref(pe).scale.value+e.unref(pe).offsetX.value+"px",top:ft.value.vbY*e.unref(pe).scale.value+e.unref(pe).offsetY.value+"px",width:ft.value.vbW*e.unref(pe).scale.value+"px",height:ft.value.vbH*e.unref(pe).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:ah.value,preserveAspectRatio:"xMinYMin meet",width:ft.value.vbW*e.unref(pe).scale.value,height:ft.value.vbH*e.unref(pe).scale.value},[e.createElementVNode("g",Bp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xl.value,S=>(e.openBlock(),e.createElementBlock("path",{key:S.key,d:Ke(di(S.from,"out",S.to.side,S.to),di(S.to,"in"),g(S.from.depth),I(S.to.depth),32,le(S.from.isRoot),S.to._dir),fill:xo(S.from,S.to),stroke:"none"},null,8,vp))),128))])],8,Rp))],4),e.unref(pe).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(pe).marquee.x*e.unref(pe).scale.value+e.unref(pe).offsetX.value+"px",top:e.unref(pe).marquee.y*e.unref(pe).scale.value+e.unref(pe).offsetY.value+"px",width:e.unref(pe).marquee.width*e.unref(pe).scale.value+"px",height:e.unref(pe).marquee.height*e.unref(pe).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:D.value+"px",top:_.value+"px",transform:`scale(${e.unref(pe).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(C.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(pe).offsetX.value}px, ${e.unref(pe).offsetY.value}px) scale(${e.unref(pe).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,S=>{var ne,ue;return e.openBlock(),e.createElementBlock("div",{key:S.id,class:e.normalizeClass(["zm-node",{"is-root":S.isRoot,"is-selected":p.value===S.id,"is-selected-secondary":p.value!==S.id&&d.value.has(S.id),"is-editing":s.value===S.id,"has-image":!!S.image,"is-resizing":ri.value===S.id,"is-dragging-source":((ne=C.value)==null?void 0:ne.srcId)===S.id,"is-drop-target":((ue=C.value)==null?void 0:ue.currentTargetId)===S.id,"is-search-hit":_h(S.id),"is-search-current":Rh(S.id),"is-search-dimmed":Bh(S.id)}]),"data-node-id":S.id,style:e.normalizeStyle({left:S.x+"px",top:S.y+"px",width:S.width+"px",minWidth:S.width+"px",height:S.height+"px",fontSize:Kl(S)+"px",background:wo(S),color:Qn(S),borderColor:eo(S),fontWeight:jl(S),transform:"translate(-50%, -50%)"}),onClick:W=>kh(W,S),onPointerdown:W=>Eh(W,S),onDblclick:W=>{W.stopPropagation(),t.previewMode||No(S.id)},onContextmenu:W=>H(W,S),onMouseenter:W=>{Eo(S.id),gn(W,S)},onMouseleave:W=>Zn(S.id)},[S.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:S.image.src,width:S.image.width,height:S.image.height,alt:S.text,draggable:"false"},null,8,Ip)):e.createCommentVNode("",!0),S.richContent&&(S.richContent.kind==="code"||S.richContent.kind==="table")&&s.value!==S.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":S.richContent.kind==="table"||S.richContent.kind==="code"}]),onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(W=>dh(S.id),["stop"]),onMousedown:l[2]||(l[2]=e.withModifiers(()=>{},["stop"]))},[M.value===S.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":l[0]||(l[0]=W=>k.value=W),class:"zm-rich-edit",spellcheck:"false",onBlur:Ql,onKeydown:fh},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[S.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Lp,[e.createElementVNode("code",{innerHTML:e.unref(Ti)(e.unref(Go)(S.richContent.raw),e.unref(Nn)(S.richContent.raw))},null,8,Dp)])):S.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Vp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ci)(S.richContent.raw),(W,Se)=>(e.openBlock(),e.createElementBlock("tr",{key:Se},[Se===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(W,(ze,Me)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Me}`},e.toDisplayString(ze),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(W,(ze,Me)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Me}`},e.toDisplayString(ze),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Op)):e.createCommentVNode("",!0),s.value!==S.id?(e.openBlock(),e.createElementBlock("span",$p,[S.markers&&S.markers.length>0?(e.openBlock(),e.createElementBlock("span",Pp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.markers,W=>(e.openBlock(),e.createElementBlock("span",{key:W,class:"zm-node-marker",title:e.unref(wr)(W),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(Io)(W)+"</svg>"},null,8,Fp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",Up,e.toDisplayString(S.text),1),S.link&&s.value!==S.id?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:S.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${S.link.url}`,onClick:l[3]||(l[3]=e.withModifiers(()=>{},["stop"])),onMousedown:l[4]||(l[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"link",size:11,stroke:2})],40,Hp)):e.createCommentVNode("",!0),S.note&&s.value!==S.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:Ki(S.note.text),onClick:e.withModifiers(W=>on(S.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"note",size:11,stroke:2})],40,Wp)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:3,class:"zm-input","onUpdate:modelValue":l[6]||(l[6]=W=>f.value=W),autofocus:"",rows:"1",onBlur:l[7]||(l[7]=W=>qi()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(W=>qi(),["exact","prevent"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(W=>qi(),["prevent"]),["tab"])),e.withKeys(sh,["esc"]),mh],onInput:ch,onMousedown:l[10]||(l[10]=e.withModifiers(()=>{},["stop"])),onClick:l[11]||(l[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,f.value]]),S.tags&&S.tags.length>0&&s.value!==S.id?(e.openBlock(),e.createElementBlock("div",Gp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.tags,W=>(e.openBlock(),e.createElementBlock("span",{key:W,class:"zm-node-tag",style:e.normalizeStyle(e.unref(hi)(W))},e.toDisplayString(W),5))),128))])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${pa(S.id)+1} 个`},e.toDisplayString(pa(S.id)+1),9,jp)):e.createCommentVNode("",!0),ma(S.id)&&Qi(S.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":S.side===-1}]),style:e.normalizeStyle({background:Pe.value.get(S.id)??"#64748b"}),title:`展开 ${Qi(S.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(W=>sa(S.id),["stop"])},e.toDisplayString(Qi(S.id)),47,Kp)):e.createCommentVNode("",!0),Sh(S)&&!ma(S.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":S.side===-1}]),style:e.normalizeStyle({color:Pe.value.get(S.id)??"#64748b",borderColor:Pe.value.get(S.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(W=>sa(S.id),["stop"])},[e.createVNode(_e,{name:"minus",size:10,stroke:2.4})],46,Yp)):e.createCommentVNode("",!0),S.image&&p.value===S.id&&s.value!==S.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(W=>Yi(W,S),["stop"])},null,40,qp)):e.createCommentVNode("",!0),S.image&&p.value===S.id&&s.value!==S.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(W=>de(S.id),["stop"])},[e.createVNode(_e,{name:"x",size:10,stroke:2.2})],40,Xp)):e.createCommentVNode("",!0)],46,zp)}),128))],4),R.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!R.value.above}]),style:e.normalizeStyle({left:R.value.x+"px",top:R.value.y+"px"})},e.toDisplayString(R.value.text),7)):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createBlock(ms,{key:3,x:te.value.x,y:te.value.y,container:c.value,"has-image":!!((m=e.unref(he)(u.value,te.value.nodeId))!=null&&m.image),"has-link":!!((T=e.unref(he)(u.value,te.value.nodeId))!=null&&T.link),"has-note":!!((E=e.unref(he)(u.value,te.value.nodeId))!=null&&E.note),"has-code":((A=(z=e.unref(he)(u.value,te.value.nodeId))==null?void 0:z.richContent)==null?void 0:A.kind)==="code","has-table":((K=(v=e.unref(he)(u.value,te.value.nodeId))==null?void 0:v.richContent)==null?void 0:K.kind)==="table","node-markers":((Y=e.unref(he)(u.value,te.value.nodeId))==null?void 0:Y.markers)??[],"node-tags":((ke=e.unref(he)(u.value,te.value.nodeId))==null?void 0:ke.tags)??[],onPickImage:ho,onRemoveImage:Gi,onSetLink:go,onRemoveLink:Wi,onEditNote:bo,onRemoveNote:ko,onAddCode:pn,onEditCode:pn,onRemoveCode:ji,onAddTable:ii,onEditTable:ii,onRemoveTable:Ge,onToggleMarker:Dh,onClearMarkers:Vh,onAddTag:Ph,onRemoveTags:Fh,onClose:ie},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createBlock(ps,{key:4,x:V.value.x,y:V.value.y,container:c.value,onOpenSettings:Tt,onOpenData:it,onOpenImport:nn,onExportPng:ya,onExportSvg:To,onClose:Je},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(w.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:l[15]||(l[15]=S=>a("canvas-toggle-preview"))},[e.createVNode(_e,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Zp),e.createElementVNode("button",{class:e.normalizeClass(P.value),title:"显示大纲视图",onClick:mn},[e.createVNode(_e,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":y.value}])},[e.createElementVNode("span",Jp,e.toDisplayString(Math.round(e.unref(pe).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[16]||(l[16]=(...S)=>e.unref(pe).zoomIn&&e.unref(pe).zoomIn(...S))},[e.createVNode(_e,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[17]||(l[17]=(...S)=>e.unref(pe).zoomOut&&e.unref(pe).zoomOut(...S))},[e.createVNode(_e,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:rn},[e.createVNode(_e,{name:"reset"})]),l[37]||(l[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:gh},[e.createVNode(_e,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[18]||(l[18]=S=>da(1))},[e.createVNode(_e,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[19]||(l[19]=S=>da(2))},[e.createVNode(_e,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:bh},[e.createVNode(_e,{name:"expand-all"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[35]||(l[35]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:l[20]||(l[20]=S=>p.value&&no(p.value))},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Qp)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[21]||(l[21]=S=>p.value&&ai(p.value))},[e.createElementVNode("img",{src:e.unref(rr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,eh)]),l[36]||(l[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:U.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[22]||(l[22]=S=>er("mindmap"))},[e.createVNode(_e,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:U.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[23]||(l[23]=S=>er("tree"))},[e.createVNode(_e,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:U.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[24]||(l[24]=S=>er("org"))},[e.createVNode(_e,{name:"org"})],2)],64))],2)],544),i.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(It,{side:"left",scope:"canvas",width:300,open:Qe.value&&!t.previewMode,title:"大纲","onUpdate:open":l[28]||(l[28]=S=>Qe.value=S)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:u.value,"selected-id":p.value,"collapsed-ids":Lt.value,"show-index":x.value,onSelect:ni,onToggleCollapse:Dt,onEdit:po,onAddChild:oi,onAddSibling:jn,onMove:Kn},null,8,["data","selected-id","collapsed-ids","show-index"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:360,open:Zt.value&&!t.previewMode,title:"数据","onUpdate:open":l[30]||(l[30]=S=>Zt.value=S)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:u.value,"pending-mode":Be.value,onImport:l[29]||(l[29]=S=>u.value=S),onConsumedMode:Ae},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:420,open:Jt.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[32]||(l[32]=S=>Jt.value=S)},{default:e.withCtx(()=>[e.createVNode(Do,{data:u.value,onImport:l[31]||(l[31]=S=>u.value=S)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:360,open:ce.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[33]||(l[33]=S=>ce.value=S)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":gt.value,"focus-tick":Ve.value,onApply:He,onRemove:rt,onSetLink:yt,onSetImage:_n,onSetRich:ti},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:340,open:Ct.value&&!t.previewMode,title:"设置","onUpdate:open":l[34]||(l[34]=S=>Ct.value=S)},{default:e.withCtx(()=>{var S;return[e.createVNode(Vo,{settings:U,"has-selection":p.value!==null,"selected-node-text":(S=gt.value)==null?void 0:S.text,"node-style":Qt.value,"onUpdate:settings":X,"onUpdate:nodeStyle":se,onReset:Ee},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),th={class:"zm-app"},nh={class:"zm-app-main"},oh={class:"zm-app-canvas"},Gl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
134
+ | a | b | c |`);if(E===null)return;const v=E.trim();if(!v){ke(r,null);return}ke(r,{kind:"table",raw:v})}function pn(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&ke(r,null)}function li(r){i.previewMode||(d.value=new Set([r]),at(),i.builtInDrawers&&(Nt(),ft.value=!0,Be.value++),a("edit-note",r))}function ai(r,l=60){const f=r.replace(/\s+/g," ").trim();return f.length<=l?f||"点击编辑笔记":f.slice(0,l)+"…"}function qn(r){var M,z;if(i.previewMode||s.value)return;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const f=p.value;if(!f)return;const w=(M=r.clipboardData)==null?void 0:M.items;if(!w)return;for(let Z=0;Z<w.length;Z++){const j=w[Z];if(j.kind==="file"&&j.type.startsWith("image/")){const oe=j.getAsFile();if(!oe)continue;r.preventDefault();const T=be(m.value,f);if(T!=null&&T.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;W(oe,J=>ce(f,J));return}}if(I.value&&I.value.nodes.length>0)return;let E=null;for(let Z=0;Z<w.length;Z++){const j=w[Z];if(j.kind==="string"&&j.type==="text/plain"){E=((z=r.clipboardData)==null?void 0:z.getData("text/plain"))??null;break}}if(!E)return;const v=E.split(/\r?\n/).map(Z=>Z.replace(/^\s*[-*+]\s+/,"").trim()).filter(Z=>Z.length>0);if(v.length!==0){r.preventDefault(),Oe();for(const Z of v)bi(m.value,f,Z);we(),a("change",m.value)}}e.onMounted(()=>{window.addEventListener("paste",qn),window.addEventListener("keydown",yo),we()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",qn),window.removeEventListener("keydown",yo)});function yo(r){if((r.metaKey||r.ctrlKey)&&(r.key==="f"||r.key==="F")){const f=r.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;r.preventDefault(),a("canvas-outline")}}const hn=e.ref(null),Zi=e.computed(()=>{var r;return((r=hn.value)==null?void 0:r.nodeId)??null});function Tt(r,l){if(!l.image)return;r.preventDefault(),r.stopPropagation();const f=l.image.naturalW||l.image.width,w=l.image.naturalH||l.image.height,E=w>0?w/f:1;hn.value={nodeId:l.id,startX:r.clientX,startY:r.clientY,startW:l.image.width,startH:l.image.height,naturalW:f,naturalH:w,ratio:E,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",Zt),window.addEventListener("mouseup",Eo)}function Zt(r){var Z,j;const l=hn.value;if(!l)return;const f=he.scale.value||1,w=r.clientX-l.startX,E=V(l.startW+w/f,_n,jn),v=V(E*l.ratio,_n,jn);l.pendingW=E,l.pendingH=v;const M=(Z=c.value)==null?void 0:Z.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);M&&(M.style.width=`${E}px`,M.style.height=`${v}px`);const z=(j=c.value)==null?void 0:j.querySelector(`[data-node-id="${l.nodeId}"]`);z&&(z.style.minWidth=`${Math.max(80,Math.ceil(E+28))}px`,z.style.height=`${Math.ceil(v+8+30)}px`)}function Eo(){const r=hn.value;if(window.removeEventListener("mousemove",Zt),window.removeEventListener("mouseup",Eo),hn.value=null,!r)return;const l=be(m.value,r.nodeId);!l||!l.image||(ce(r.nodeId,{src:l.image.src,naturalW:l.image.naturalW,naturalH:l.image.naturalH,width:r.pendingW,height:r.pendingH}),d.value=new Set([r.nodeId]),at(),Bn=!0)}const Xn=e.ref(null);let Bn=!1;function Zn(r){Xn.value=r}function gn(r){Xn.value===r&&(Xn.value=null),A.value&&(A.value=null)}function Jn(r,l){var se;if(!l.text||l.text.length<14)return;const w=r.currentTarget.getBoundingClientRect(),E=(se=c.value)==null?void 0:se.getBoundingClientRect();if(!E)return;const v=10,M=240,z=w.top-E.top>60,Z=w.left-E.left+w.width/2,j=v+M/2,oe=E.width-M/2-v,T=Math.max(j,Math.min(Z,oe)),J=z?w.top-E.top-8:w.bottom-E.top+8;A.value={text:l.text,x:T,y:J,above:z}}const Ct=e.ref(0),Qn=e.ref(!1),Gt=ls(100);function Oe(){Gt.record({data:m.value,selectedIds:[...d.value]})}function we(){h.value=new Set(h.value),Ct.value++,e.nextTick().then(()=>e.nextTick()).then(()=>si()).then(()=>{Ct.value++})}function si(){const r=document.querySelectorAll(".zm-rich"),l={},f={};r.forEach(w=>{let E=w,v=null;for(;E&&!v;)v=E.getAttribute("data-node-id"),E=E.parentElement;if(!v)return;const M=w.offsetHeight,z=w.scrollWidth,Z=Math.round(M*2)/2,j=Math.round(z*2)/2;l[v]=Z,f[v]=j,P.value[v],G.value[v]}),P.value=l,G.value=f}const yt=e.computed(()=>{var r,l,f,w,E,v,M,z,Z,j;return{rootBg:((r=i.theme)==null?void 0:r.rootBg)??"#1f2937",rootText:((l=i.theme)==null?void 0:l.rootText)??"#ffffff",branchBg:((f=i.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((w=i.theme)==null?void 0:w.branchText)??"#1f2937",lineColor:((E=i.theme)==null?void 0:E.lineColor)??"#94a3b8",bgColor:((v=i.theme)==null?void 0:v.bgColor)??"#f8fafc",fontSize:((M=i.theme)==null?void 0:M.fontSize)??14,lineWidthStart:((z=i.theme)==null?void 0:z.lineWidthStart)??2.2,lineWidthEnd:((Z=i.theme)==null?void 0:Z.lineWidthEnd)??.8,rainbowBranch:((j=i.theme)==null?void 0:j.rainbowBranch)??!1}}),Jt=e.computed(()=>_.canvasBg||yt.value.bgColor),_=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0});function b(r){return r?_.rootLineStyle:_.lineStyle}function D(r){return _.taperedEdge?ze(r):Ne(r)}function X(r){return _.taperedEdge?_.lineWidthEnd:Ne(r)}function ze(r){const l=_.lineWidthTaper,f=_.lineWidthStart*Math.pow(l,r);return Math.max(_.lineWidthEnd,f)}function Ne(r){if(r<=0)return _.lineWidthStart;if(r>=3)return _.lineWidthEnd;const l=r/3;return _.lineWidthStart+(_.lineWidthEnd-_.lineWidthStart)*l}function Le(r,l,f,w){const E=1-r,v=E*E*E*l.x+3*E*E*r*f.x1+3*E*r*r*f.x2+r*r*r*w.x,M=E*E*E*l.y+3*E*E*r*f.y1+3*E*r*r*f.y2+r*r*r*w.y;return{x:v,y:M}}function qe(r,l,f,w){const E=1-r,v=E*E*l.x+2*E*r*f.x+r*r*w.x,M=E*E*l.y+2*E*r*f.y+r*r*w.y;return{x:v,y:M}}function Et(r,l,f,w,E=32,v="curve",M="right"){if(v==="curve"){let z;if(M==="right"||M==="left"){const se=Math.abs(l.x-r.x)*.45,ge=M==="right"?1:-1;z={x1:r.x+ge*se,y1:r.y,x2:l.x-ge*se,y2:l.y}}else{const se=Math.abs(l.y-r.y)*.45;z={x1:r.x,y1:r.y+se,x2:l.x,y2:l.y-se}}const Z=J=>{const se=1-J,ge=-3*se*se*r.x+3*(se*se-2*se*J)*z.x1+3*(2*se*J-J*J)*z.x2+3*J*J*l.x,Me=-3*se*se*r.y+3*(se*se-2*se*J)*z.y1+3*(2*se*J-J*J)*z.y2+3*J*J*l.y;return{dx:ge,dy:Me}},j=[],oe=[];for(let J=0;J<=E;J++){const se=J/E,ge=J===0?r:J===E?l:Le(se,r,z,l),Me=Z(se);let Ce=Math.hypot(Me.dx,Me.dy);Ce<1e-6&&(Ce=1);const ve=-Me.dy/Ce,Q=Me.dx/Ce,ie=(f+(w-f)*se)/2;j.push({x:ge.x+ve*ie,y:ge.y+Q*ie}),oe.push({x:ge.x-ve*ie,y:ge.y-Q*ie})}let T=`M ${j[0].x.toFixed(2)} ${j[0].y.toFixed(2)}`;for(let J=1;J<=E;J++)T+=` L ${j[J].x.toFixed(2)} ${j[J].y.toFixed(2)}`;for(let J=E;J>=0;J--)T+=` L ${oe[J].x.toFixed(2)} ${oe[J].y.toFixed(2)}`;return T+=" Z",T}if(v==="arc"){let z;M==="right"||M==="left"?z={x:(r.x+l.x)/2,y:l.y}:z={x:l.x,y:(r.y+l.y)/2};const Z=ge=>{const Me=1-ge,Ce=2*Me*(z.x-r.x)+2*ge*(l.x-z.x),ve=2*Me*(z.y-r.y)+2*ge*(l.y-z.y);return{dx:Ce,dy:ve}},j=[],oe=[];for(let ge=0;ge<=E;ge++){const Me=ge/E,Ce=ge===0?r:ge===E?l:qe(Me,r,z,l),ve=Z(Me);let Q=Math.hypot(ve.dx,ve.dy);Q<1e-6&&(Q=1);const ie=-ve.dy/Q,Fe=ve.dx/Q,K=(f+(w-f)*Me)/2;j.push({x:Ce.x+ie*K,y:Ce.y+Fe*K}),oe.push({x:Ce.x-ie*K,y:Ce.y-Fe*K})}const T=f/2,J=w/2;let se=`M ${j[0].x.toFixed(2)} ${j[0].y.toFixed(2)}`;for(let ge=1;ge<=E;ge++)se+=` L ${j[ge].x.toFixed(2)} ${j[ge].y.toFixed(2)}`;se+=` A ${J.toFixed(2)} ${J.toFixed(2)} 0 0 0 ${oe[E].x.toFixed(2)} ${oe[E].y.toFixed(2)}`;for(let ge=E-1;ge>=0;ge--)se+=` L ${oe[ge].x.toFixed(2)} ${oe[ge].y.toFixed(2)}`;return se+=` A ${T.toFixed(2)} ${T.toFixed(2)} 0 0 0 ${j[0].x.toFixed(2)} ${j[0].y.toFixed(2)}`,se+=" Z",se}if(v==="elbow"){const z=[];if(M==="down"){const Q=(r.y+l.y)/2;z.push(r,{x:r.x,y:Q},{x:l.x,y:Q},l)}else{const Q=(r.x+l.x)/2;z.push(r,{x:Q,y:r.y},{x:Q,y:l.y},l)}const Z=[];let j=0;for(let Q=0;Q<z.length-1;Q++){const ie=Math.hypot(z[Q+1].x-z[Q].x,z[Q+1].y-z[Q].y);Z.push(ie),j+=ie}const oe=[f/2];let T=0;for(let Q=0;Q<Z.length-1;Q++){T+=Z[Q];const ie=j>0?T/j:0;oe.push((f+(w-f)*ie)/2)}oe.push(w/2);const J=[];for(let Q=0;Q<z.length-1;Q++){const ie=z[Q+1].x-z[Q].x,Fe=z[Q+1].y-z[Q].y;let K=Math.hypot(ie,Fe);K<1e-6&&(K=1),J.push({x:-Fe/K,y:ie/K})}const se=[],ge=[];se.push({x:z[0].x+J[0].x*oe[0],y:z[0].y+J[0].y*oe[0]}),ge.push({x:z[0].x-J[0].x*oe[0],y:z[0].y-J[0].y*oe[0]});for(let Q=1;Q<z.length-1;Q++){const ie=J[Q-1],Fe=J[Q],K=oe[Q];se.push({x:z[Q].x+ie.x*K+Fe.x*K,y:z[Q].y+ie.y*K+Fe.y*K}),ge.push({x:z[Q].x-ie.x*K-Fe.x*K,y:z[Q].y-ie.y*K-Fe.y*K})}const Me=J[J.length-1],Ce=oe[oe.length-1];se.push({x:z[z.length-1].x+Me.x*Ce,y:z[z.length-1].y+Me.y*Ce}),ge.push({x:z[z.length-1].x-Me.x*Ce,y:z[z.length-1].y-Me.y*Ce});let ve=`M ${se[0].x.toFixed(2)} ${se[0].y.toFixed(2)}`;for(let Q=1;Q<se.length;Q++)ve+=` L ${se[Q].x.toFixed(2)} ${se[Q].y.toFixed(2)}`;for(let Q=ge.length-1;Q>=0;Q--)ve+=` L ${ge[Q].x.toFixed(2)} ${ge[Q].y.toFixed(2)}`;return ve+=" Z",ve}if(v==="rounded-elbow"&&!(M==="down"?Math.abs(r.x-l.x)<.5:Math.abs(r.y-l.y)<.5)){let Z=function(K,We,xt){const $t={x:K.pos.x-We*K.d1.x,y:K.pos.y-We*K.d1.y},bn={x:K.pos.x+We*K.d2.x,y:K.pos.y+We*K.d2.y},Mt={x:K.pos.x+We*(K.d2.x-K.d1.x),y:K.pos.y+We*(K.d2.y-K.d1.y)},kn=Math.atan2($t.y-Mt.y,$t.x-Mt.x);let it=Math.atan2(bn.y-Mt.y,bn.x-Mt.x)-kn;for(;it>Math.PI;)it-=2*Math.PI;for(;it<-Math.PI;)it+=2*Math.PI;const Ge=[];for(let rt=1;rt<xt;rt++){const Pt=rt/xt,$e=kn+it*Pt;Ge.push({x:Mt.x+We*Math.cos($e),y:Mt.y+We*Math.sin($e)})}return Ge};const j=[];let oe;if(M==="down"){const K=(r.y+l.y)/2,We=Math.sign(K-r.y)||1,xt=Math.sign(l.x-r.x)||1,$t=Math.sign(l.y-K)||1;oe=[{pos:{x:r.x,y:K},d1:{x:0,y:We},d2:{x:xt,y:0}},{pos:{x:l.x,y:K},d1:{x:xt,y:0},d2:{x:0,y:$t}}]}else{const K=(r.x+l.x)/2,We=Math.sign(K-r.x)||1,xt=Math.sign(l.y-r.y)||1,$t=Math.sign(l.x-K)||1;oe=[{pos:{x:K,y:r.y},d1:{x:We,y:0},d2:{x:0,y:xt}},{pos:{x:K,y:l.y},d1:{x:0,y:xt},d2:{x:$t,y:0}}]}const T=Math.hypot(oe[1].pos.x-oe[0].pos.x,oe[1].pos.y-oe[0].pos.y),J=Math.hypot(l.x-oe[1].pos.x,l.y-oe[1].pos.y),se=Math.min(T,J,_.elbowRadius)*.5,ge=Math.max(2,se);j.push(r),j.push(oe[0].pos),j.push({x:oe[1].pos.x-ge*oe[1].d1.x,y:oe[1].pos.y-ge*oe[1].d1.y});for(const K of Z(oe[1],ge,7))j.push(K);j.push(l);const Me=[];let Ce=0;for(let K=0;K<j.length-1;K++){const We=Math.hypot(j[K+1].x-j[K].x,j[K+1].y-j[K].y);Me.push(We),Ce+=We}const ve=[],Q=[];let ie=0;for(let K=0;K<j.length;K++){const We=j[Math.max(0,K-1)],xt=j[Math.min(j.length-1,K+1)],$t=xt.x-We.x,bn=xt.y-We.y;let Mt=Math.hypot($t,bn);Mt<1e-6&&(Mt=1);const kn=-bn/Mt,Co=$t/Mt;K>0&&(ie+=Me[K-1]);const it=Ce>0?ie/Ce:0,Ge=(f+(w-f)*it)/2;ve.push({x:j[K].x+kn*Ge,y:j[K].y+Co*Ge}),Q.push({x:j[K].x-kn*Ge,y:j[K].y-Co*Ge})}let Fe=`M ${ve[0].x.toFixed(2)} ${ve[0].y.toFixed(2)}`;for(let K=1;K<ve.length;K++)Fe+=` L ${ve[K].x.toFixed(2)} ${ve[K].y.toFixed(2)}`;Fe+=` L ${Q[ve.length-1].x.toFixed(2)} ${Q[ve.length-1].y.toFixed(2)}`;for(let K=Q.length-2;K>=0;K--)Fe+=` L ${Q[K].x.toFixed(2)} ${Q[K].y.toFixed(2)}`;return Fe+=" Z",Fe}{const z=l.x-r.x,Z=l.y-r.y;let j=Math.hypot(z,Z);j<1e-6&&(j=1);const oe=-Z/j,T=z/j,J=f/2,se=w/2,ge={x:r.x+oe*J,y:r.y+T*J},Me={x:r.x-oe*J,y:r.y-T*J},Ce={x:l.x-oe*se,y:l.y-T*se},ve={x:l.x+oe*se,y:l.y+T*se};return`M ${ge.x.toFixed(2)} ${ge.y.toFixed(2)} L ${ve.x.toFixed(2)} ${ve.y.toFixed(2)} L ${Ce.x.toFixed(2)} ${Ce.y.toFixed(2)} L ${Me.x.toFixed(2)} ${Me.y.toFixed(2)} Z`}}const mt=e.computed(()=>pt.value.root.children),xo=cn[0].colors,Xe=e.computed(()=>ja(_.branchPaletteId,_.customPalettes)),nn=e.computed(()=>{const r=new Map;if(!_.rainbowBranch)return r;const l=i.lineColors,f=l&&l.length>0?l:Xe.value.colors.length>0?Xe.value.colors:xo;for(let E=0;E<mt.value.length;E++){const v=mt.value[E];r.set(v.id,f[E%f.length])}const w=(E,v)=>{r.set(E.id,v);for(const M of E.children)w(M,v)};for(let E=0;E<mt.value.length;E++){const v=mt.value[E];w(v,f[E%f.length])}return r});function wo(r,l){return _.rainbowBranch?nn.value.get(l.id)??yt.value.lineColor:yt.value.lineColor}function ql(r){const l=ee(r.id);if(l.bg)return l.bg;if(r.isRoot)return yt.value.rootBg;if(r.depth>=3)return"transparent";const f=r.depth===1?.15:.08;if(_.rainbowBranch){const w=nn.value.get(r.id);if(w)return Jl(w,f)}return Jl(yt.value.rootBg,f)}function eo(r){const l=ee(r.id);if(l.textColor)return l.textColor;if(r.isRoot)return yt.value.rootText;if(_.rainbowBranch){const f=nn.value.get(r.id);if(f)return ch(f,.55)}return yt.value.branchText}function to(r){const l=ee(r.id);return l.borderColor?l.borderColor:"transparent"}function Xl(r){const l=ee(r.id);return l.fontWeight?l.fontWeight:r.isRoot?700:r.depth<=1?600:r.depth===2?500:400}function Zl(r){return ee(r.id).fontSize??r.fontSize??yt.value.fontSize}function Jl(r,l){const f=r.replace("#",""),w=f.length===6?f:f.split("").map(z=>z+z).join(""),E=parseInt(w.slice(0,2),16),v=parseInt(w.slice(2,4),16),M=parseInt(w.slice(4,6),16);return`rgba(${E}, ${v}, ${M}, ${l})`}function ch(r,l){const f=r.replace("#",""),w=f.length===6?f:f.split("").map(z=>z+z).join(""),E=Math.round(parseInt(w.slice(0,2),16)*(1-l)),v=Math.round(parseInt(w.slice(2,4),16)*(1-l)),M=Math.round(parseInt(w.slice(4,6),16)*(1-l));return`rgb(${E}, ${v}, ${M})`}const he=os({getContainer:()=>c.value});he.setOnMarqueeEnd(Ah),rs({isEditing:()=>s.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>p.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:no,onAddSibling:ci,onAddSiblingBefore:bh,onRemove:ua,onStartEdit:No,onClearSelection:()=>{d.value=new Set,at()},onDuplicate:ia,onCopy:sa,onCut:ca,onPaste:da,hasClipboard:()=>!!I.value&&I.value.nodes.length>0,onUndo:Qi,onRedo:er,onNavigate:kh,onMoveSibling:xh,onSelectRoot:()=>{d.value=new Set([m.value.id]),at()}});const pt=e.computed(()=>{const r=Bt(m.value);return ta(r),Ua(r,{mode:_.layoutMode,baseFontSize:yt.value.fontSize,richHeights:P.value,richWidths:G.value})}),Ql=e.ref([]),on=e.computed(()=>(Ct.value,Ql.value));e.watch(pt,r=>{const l=[],f=w=>{l.push(w);for(const E of w.children)f(E)};f(r.root),Ql.value=l},{immediate:!0});const ea=e.computed(()=>{const r=[];for(const l of on.value)for(const f of l.children)r.push({from:l,to:f,key:`${l.id}->${f.id}`});return r}),dh=e.computed(()=>`${pt.value.vbX} ${pt.value.vbY} ${pt.value.vbW} ${pt.value.vbH}`);function ta(r){if(h.value.has(r.id)){r.children=[],r.collapsed=!0;return}r.collapsed=!1;for(const l of r.children)ta(l)}function No(r){const l=be(m.value,r);l&&(s.value=r,u.value=l.text,d.value=new Set([r]),at(),e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select(),na(f)}))}function Ji(){if(!s.value)return;const r=be(m.value,s.value);r&&r.text!==(u.value.trim()||" ")&&(r.text=u.value.trim()||" ",Oe(),a("change",m.value)),s.value=null}function uh(){s.value=null}function na(r){r&&(r.style.height="auto",r.style.height=r.scrollHeight+"px")}function fh(r){na(r.target)}function mh(r){if(i.previewMode)return;const l=be(m.value,r);l!=null&&l.richContent&&(y.value=r,k.value=l.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function oa(){if(!y.value)return;const r=y.value,l=be(m.value,r),f=k.value;if(l&&l.richContent&&l.richContent.raw!==f)if(l.richContent.kind==="code"){const w=Sn(f)||void 0;ke(r,{kind:"code",raw:f,lang:w})}else ke(r,{kind:"table",raw:f});y.value=null}function ph(){y.value=null}function hh(r){r.key==="Escape"?(r.preventDefault(),ph()):r.key==="Enter"&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),oa())}function gh(r){const l=r.metaKey||r.ctrlKey;l&&(r.key==="z"||r.key==="Z")&&!r.shiftKey?(r.preventDefault(),Qi()):(l&&r.shiftKey&&(r.key==="z"||r.key==="Z")||l&&(r.key==="y"||r.key==="Y")&&!r.shiftKey)&&(r.preventDefault(),er())}function no(r){const l=bi(m.value,r,zo);l&&(Oe(),we(),a("change",m.value),e.nextTick(()=>No(l.id)))}function ci(r){if(r===m.value.id){no(r);return}const l=xr(m.value,r,zo);l&&(Oe(),we(),a("change",m.value),e.nextTick(()=>No(l.id)))}function bh(r){if(r===m.value.id){no(r);return}const l=Ja(m.value,r,zo);l&&(Oe(),we(),a("change",m.value),e.nextTick(()=>No(l.id)))}function ia(r){if(r===m.value.id)return;const l=Qa(m.value,r);l&&(Oe(),d.value=new Set([l.id]),at(),a("change",m.value),we())}function ra(r){const l=[],f=new Set;for(const w of r)w!==m.value.id&&(f.has(w)||be(m.value,w)&&(f.add(w),l.push(w)));return l}function la(r){const l=new Set(r),f=[],w=E=>{l.has(E.id)&&f.push(E.id);for(const v of E.children)w(v)};return w(m.value),f}function aa(r){var l;try{(l=navigator.clipboard)==null||l.writeText(r)}catch{}}function sa(r){const l=la(ra(r));if(l.length===0)return;const f=[];for(const w of l){const E=wr(m.value,w);E&&f.push(E)}f.length!==0&&(I.value={nodes:f,originalIds:new Set(l)},aa(f.map(w=>w.text).join(`
135
+ `)),we())}function ca(r){const l=la(ra(r));if(l.length===0)return;const f=[];for(const w of l){const E=wr(m.value,w);E&&f.push(E)}if(f.length!==0){Oe();for(const w of l)vo(m.value,w);d.value=new Set,at(),I.value={nodes:f,originalIds:new Set(l)},aa(f.map(w=>w.text).join(`
136
+ `)),we(),a("change",m.value)}}function da(r){const l=I.value;if(!l||l.nodes.length===0)return;const f=r??m.value.id,w=be(m.value,f);if(w){for(const E of l.originalIds){const v=be(m.value,E);if(v&&be(v,f))return}Oe();for(const E of l.nodes){const v=Bt(E);Bo(v),w.children.push(v)}I.value=null,we(),a("change",m.value)}}function Qi(){const r=Gt.undo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),at(),we(),a("change",m.value))}function er(){const r=Gt.redo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),at(),we(),a("change",m.value))}function at(){const r=[];for(const l of d.value){const f=be(m.value,l);f&&r.push(f)}if(i.builtInDrawers&&!i.previewMode&&r.length>0){const l=r[0];!ft.value&&Ea(l.id)&&(Nt(),ft.value=!0)}else i.builtInDrawers&&r.length===0&&(ft.value=!1);a("select",r.length>0?r:null)}function kh(r,l){const f=p.value??m.value.id,w=be(m.value,f);if(!w)return;let E=null;if(l===1){const v=zt(m.value,w.id);if(v){const M=v.children.findIndex(z=>z.id===w.id);M>=0&&M<v.children.length-1&&(E=v.children[M+1].id)}}else if(l===-1){const v=zt(m.value,w.id);if(v){const M=v.children.findIndex(z=>z.id===w.id);M>0&&(E=v.children[M-1].id)}}else if(r===1){const v=zt(m.value,w.id);v&&(E=v.id)}else r===-1&&w.children.length>0&&(E=w.children[0].id);E&&(d.value=new Set([E]),at())}function ua(r){if(r!==m.value.id&&vo(m.value,r)){if(Oe(),d.value.has(r)){const l=new Set(d.value);l.delete(r),d.value=l,at()}we(),a("change",m.value)}}function fa(r){h.value.has(r)?h.value.delete(r):h.value.add(r),we()}function ma(r){const l=[{n:m.value,depth:1}];for(;l.length;){const{n:f,depth:w}=l.pop();r(f,w);for(let E=f.children.length-1;E>=0;E--)l.push({n:f.children[E],depth:w+1})}}function yh(){h.value=new Set,ma(r=>{r.children.length>0&&h.value.add(r.id)}),we()}function pa(r){h.value=new Set,ma((l,f)=>{f>r&&l.children.length>0&&h.value.add(l.id)}),we()}function Eh(){h.value=new Set,we()}function ha(r,l){Za(m.value,r,l)&&(Oe(),we(),a("change",m.value))}function tr(r,l,f){return gi(m.value,r,l,f)?(Oe(),we(),a("change",m.value),!0):!1}function xh(r){const l=p.value;if(!l)return;const f=m.value;if(l===f.id)return;const w=zt(f,l);if(!w)return;const E=w.children.findIndex(z=>z.id===l);if(E<0)return;let v=r;const M=on.value.find(z=>z.id===l);if(M&&ba(M)&&(v=-r),v<0){if(E===0)return;const z=w.children[E-1].id;gi(f,l,z,"before")}else{if(E>=w.children.length-1)return;const z=w.children[E+1].id;gi(f,l,z,"after")}Oe(),we(),a("change",f)}function wh(r,l){if(r.stopPropagation(),r.shiftKey){const f=new Set(d.value);f.has(l.id)?f.delete(l.id):f.add(l.id),d.value=f}else d.value=new Set([l.id]);at()}function Nh(r,l,f){let w=null;for(const E of on.value){if(E.id===f)continue;const v=E.width/2,M=E.height/2;r>=E.x-v&&r<=E.x+v&&l>=E.y-M&&l<=E.y+M&&(w=E)}return w}let jt=null;function Sh(r,l){if(i.previewMode||l.isRoot||r.button!==0)return;const f=r.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;r.stopPropagation();const w=c.value.getBoundingClientRect(),E=l.x*he.scale.value+he.offsetX.value,v=l.y*he.scale.value+he.offsetY.value,M=r.clientX-w.left-E,z=r.clientY-w.top-v;jt={srcId:l.id,srcText:l.text,pointerOffsetX:M,pointerOffsetY:z,startX:r.clientX,startY:r.clientY},window.addEventListener("pointermove",ga),window.addEventListener("pointerup",di),window.addEventListener("pointercancel",di)}function ga(r){if(jt){const M=r.clientX-jt.startX,z=r.clientY-jt.startY;if(Math.abs(M)<=Kl&&Math.abs(z)<=Kl)return;C.value={srcId:jt.srcId,srcText:jt.srcText,pointerOffsetX:jt.pointerOffsetX,pointerOffsetY:jt.pointerOffsetY,currentTargetId:null,dropPosition:null},document.body.classList.add("is-dragging"),jt=null}const l=C.value;if(!l)return;const f=c.value.getBoundingClientRect();$.value=r.clientX-f.left-l.pointerOffsetX,R.value=r.clientY-f.top-l.pointerOffsetY;const w=(r.clientX-f.left-he.offsetX.value)/he.scale.value,E=(r.clientY-f.top-he.offsetY.value)/he.scale.value,v=Nh(w,E,l.srcId);l.currentTargetId=(v==null?void 0:v.id)??null,v?l.dropPosition=Th(w,E,v):l.dropPosition=null}function Th(r,l,f){if(f.isRoot)return"child";const w=f.width/2,E=f.height/2;if(f._dir==="down"){const M=r-f.x;return M<-w*.3?"before":M>w*.3?"after":"child"}const v=l-f.y;return v<-E*.3?"before":v>E*.3?"after":"child"}function ba(r){var l;return!!((l=r.parent)!=null&&l.isRoot)&&r._dir==="left"}function di(r){if(window.removeEventListener("pointermove",ga),window.removeEventListener("pointerup",di),window.removeEventListener("pointercancel",di),jt){jt=null;return}const l=C.value;if(l){if(l.currentTargetId&&l.dropPosition){let f=l.dropPosition;if(f!=="child"){const w=on.value.find(E=>E.id===l.currentTargetId);w&&ba(w)&&(f=f==="before"?"after":"before")}tr(l.srcId,l.currentTargetId,f),d.value=new Set([l.srcId]),at()}C.value=null,$.value=0,R.value=0,document.body.classList.remove("is-dragging")}}let ui=!1;function Ch(r){const l=r.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(r.button===2){ui=!0,he.startPan(r);return}if(ui=!1,r.button!==0)return;const f=c.value.getBoundingClientRect(),w=(r.clientX-f.left-he.offsetX.value)/he.scale.value,E=(r.clientY-f.top-he.offsetY.value)/he.scale.value;he.startMarquee(w,E,{shift:r.shiftKey})}function Mh(r){if(Bn){Bn=!1;return}const l=r.target;if(!l||l.closest(".zm-node"))return;const f=he.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,at())}function Ah(){const r=he.marquee;if(r.width<4&&r.height<4)return;const l=r.x,f=r.y,w=r.x+r.width,E=r.y+r.height,v=[];for(const M of on.value){const z=M.width/2,Z=M.height/2,j=M.x-z,oe=M.x+z,T=M.y-Z,J=M.y+Z;j<=w&&oe>=l&&T<=E&&J>=f&&v.push(M.id)}d.value=r.shiftKey?new Set([...d.value,...v]):new Set(v),at()}function ka(r){return h.value.has(r)}function _h(r){const l=be(m.value,r.id);return!!l&&l.children.length>0}function nr(r){const l=be(m.value,r);return l?Nr(l):0}function ya(r){if(!be(m.value,r))return 0;const w=[m.value];for(;w.length;){const E=w.pop(),v=E.children.findIndex(M=>M.id===r);if(v>=0)return v;for(const M of E.children)w.push(M)}return 0}function fi(r,l,f,w){const E=(w==null?void 0:w._dir)??r._dir;if(l==="out"&&r.isRoot&&_.lineOrigin==="center")return{x:r.x,y:r.y};if(l==="out"&&r.isRoot&&_.lineOrigin==="proportional"&&w){const z=pt.value.root.children;if(E==="down"){const se=z.reduce((ve,Q)=>Math.max(ve,Math.abs(Q.x-r.x)),1),ge=Math.min(1,Math.abs(w.x-r.x)/se),Me=r.y+r.height/2,Ce=r.y;return{x:r.x,y:Me+(Ce-Me)*ge}}const Z=z.reduce((se,ge)=>Math.max(se,Math.abs(ge.y-r.y)),1),j=Math.min(1,Math.abs(w.y-r.y)/Z),oe=f!==void 0?f:r.side,T=r.x+oe*(r.width/2),J=r.x;return{x:T+(J-T)*j,y:r.y}}if(E==="down")return l==="out"?{x:r.x,y:r.y+r.height/2}:{x:r.x,y:r.y-r.height/2};let v;l==="in"?v=-r.side:f!==void 0?v=f:v=r.side;const M=l==="in"?r._richInsetX??0:0;return{x:r.x+v*(r.width/2-M),y:r.y}}function rn(){const r=pt.value;he.resetView(r.width,r.height,r.root.y)}function Rh(){Qn.value=!0,Oe(),we(),e.nextTick(()=>rn())}function or(r){_.layoutMode!==r&&(_.layoutMode=r,we(),e.nextTick(()=>rn()))}function vh(){return JSON.stringify(m.value,null,2)}function Ea(r){const l=be(m.value,r);return l?!!(l.note&&l.note.text||l.link&&l.link.url||l.image&&l.image.src||l.richContent&&l.richContent.raw||l.markers&&l.markers.length>0||l.tags&&l.tags.length>0):!1}function Bh(r){try{const l=JSON.parse(r);return!l.id||!Array.isArray(l.children)?!1:(Gt.reset(),m.value=Bt(l),d.value=new Set,h.value=new Set,we(),e.nextTick(()=>rn()),a("change",m.value),!0)}catch{return!1}}const xa=e.ref(""),ln=e.ref([]),So=e.ref(-1);function zh(r){xa.value=r;const l=r.trim();if(!l){ln.value=[],So.value=-1;return}const f=l.toLowerCase(),w=[],E=v=>{var M;(v.text.toLowerCase().includes(f)||(M=v.note)!=null&&M.text&&v.note.text.toLowerCase().includes(f))&&w.push(v.id);for(const z of v.children)E(z)};E(m.value),ln.value=w,So.value=w.length>0?0:-1,w.length>0&&(Dh(w),e.nextTick(()=>Vh(0)))}function Ih(r){return ln.value.includes(r)}function Oh(r){return So.value>=0&&ln.value[So.value]===r}function Lh(r){return xa.value.trim().length>0&&ln.value.length>0&&!ln.value.includes(r)}function Dh(r){if(r.length===0)return;const l=new Set(r),f=new Set,w=E=>{let v=l.has(E.id);for(const M of E.children)w(M)&&(v=!0);return v&&E.children.length>0&&h.value.has(E.id)&&f.add(E.id),v};if(w(m.value),f.size>0){for(const E of f)h.value.delete(E);we()}}function Vh(r){const l=ln.value[r];if(!l)return;const f=on.value.find(w=>w.id===l);f&&(d.value=new Set([l]),at(),he.centerOn(f.x,f.y,f.width,f.height))}function $h(r,l){const f=be(m.value,r);f&&(f.markers||(f.markers=[]),!f.markers.includes(l)&&(f.markers.push(l),Oe(),we(),a("change",m.value)))}function Ph(r,l){const f=be(m.value,r);if(!f||!f.markers)return;const w=f.markers.indexOf(l);w<0||(f.markers.splice(w,1),f.markers.length===0&&delete f.markers,Oe(),we(),a("change",m.value))}function wa(r,l){const f=be(m.value,r);if(!f)return!1;f.markers||(f.markers=[]);const w=f.markers.indexOf(l);return w>=0?(f.markers.splice(w,1),f.markers.length===0&&delete f.markers,Oe(),we(),a("change",m.value),!1):(f.markers.push(l),Oe(),we(),a("change",m.value),!0)}function Fh(r){const l=be(m.value,r);return l!=null&&l.markers?[...l.markers]:[]}function Uh(r){var f;const l=(f=B.value)==null?void 0:f.nodeId;l&&wa(l,r)}function Hh(){var f;const r=(f=B.value)==null?void 0:f.nodeId;if(!r)return;const l=be(m.value,r);!l||!l.markers||(delete l.markers,Oe(),we(),a("change",m.value),ye())}function ir(r,l){const f=be(m.value,r);f&&(l.length===0?f.tags&&delete f.tags:f.tags=[...l],Oe(),we(),a("change",m.value))}function Wh(r){const l=be(m.value,r);return l!=null&&l.tags?[...l.tags]:[]}function Gh(){var v,M;const r=(v=B.value)==null?void 0:v.nodeId;if(!r)return;const l=be(m.value,r),f=((M=l==null?void 0:l.tags)==null?void 0:M.join(", "))??"",w=window.prompt("输入标签(多个用逗号分隔)",f);if(w===null)return;const E=w.split(/[,,]/).map(z=>z.trim()).filter(z=>z.length>0);ir(r,E),ye()}function jh(){var l;const r=(l=B.value)==null?void 0:l.nodeId;r&&(ir(r,[]),ye())}function Na(){const r=pt.value,l="http://www.w3.org/2000/svg",f=document.createElementNS(l,"svg");f.setAttribute("xmlns",l),f.setAttribute("viewBox",`${r.vbX} ${r.vbY} ${r.vbW} ${r.vbH}`),f.setAttribute("width",String(r.vbW)),f.setAttribute("height",String(r.vbH));const w=document.createElementNS(l,"rect");w.setAttribute("x",String(r.vbX)),w.setAttribute("y",String(r.vbY)),w.setAttribute("width",String(r.vbW)),w.setAttribute("height",String(r.vbH)),w.setAttribute("fill",Jt.value),f.appendChild(w);for(const M of ea.value){const z=document.createElementNS(l,"path");z.setAttribute("d",Et(fi(M.from,"out",M.to.side,M.to),fi(M.to,"in"),D(M.from.depth),X(M.to.depth),32,b(M.from.isRoot),M.to._dir)),z.setAttribute("fill",wo(M.from,M.to)),z.setAttribute("stroke","none"),f.appendChild(z)}const E="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function v(M,z){let Z=0;for(const j of M)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(j)?Z+=z:Z+=z*.55;return Z}for(const M of on.value){const z=M.x-M.width/2,Z=M.y-M.height/2,j=document.createElementNS(l,"rect");j.setAttribute("x",String(z)),j.setAttribute("y",String(Z)),j.setAttribute("width",String(M.width)),j.setAttribute("height",String(M.height)),j.setAttribute("rx","8"),j.setAttribute("fill",ql(M));const oe=to(M);oe!=="transparent"&&(j.setAttribute("stroke",oe),j.setAttribute("stroke-width","1")),f.appendChild(j);const T=!!(M.tags&&M.tags.length>0),J=!!(M.markers&&M.markers.length>0),se=!!M.image,ge=!!(M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table"));let Me=0,Ce=0;if(ge){const Ge=M.richContent,rt=M.fontSize*.78*.92,Pt=6,$e=4,yn=2,En=6;if(Ge.kind==="code"){const At=jo(Ge.raw),wt=Sn(Ge.raw),_t=At.split(`
137
+ `),Qt=rt*1.35;let Ft=0;for(const Pe of _t)Ft=Math.max(Ft,v(Pe,rt));Ce=Math.min(Ft+Pt*2+4,M.width-4),Me=_t.length*Qt+$e*2+yn;const Je=M.x-Ce/2;let ht=Z+4;se&&(ht=Z+M.image.height+En);const Rt=document.createElementNS(l,"rect");if(Rt.setAttribute("x",String(Je)),Rt.setAttribute("y",String(ht)),Rt.setAttribute("width",String(Ce)),Rt.setAttribute("height",String(Me-yn)),Rt.setAttribute("rx","6"),Rt.setAttribute("fill","rgba(255,255,255,0.55)"),Rt.setAttribute("stroke",to(M)),Rt.setAttribute("stroke-width","1"),f.appendChild(Rt),wt){const Pe=document.createElementNS(l,"text");Pe.setAttribute("x",String(Je+Ce-Pt)),Pe.setAttribute("y",String(ht+$e+4)),Pe.setAttribute("text-anchor","end"),Pe.setAttribute("fill",eo(M)),Pe.setAttribute("font-size",String(rt*.8)),Pe.setAttribute("font-family",E),Pe.setAttribute("opacity","0.5"),Pe.textContent=wt,f.appendChild(Pe)}const Mo="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Pe=0;Pe<_t.length;Pe++){const st=document.createElementNS(l,"text");st.setAttribute("x",String(Je+Pt)),st.setAttribute("y",String(ht+$e+(Pe+.5)*Qt+2)),st.setAttribute("dominant-baseline","central"),st.setAttribute("fill",eo(M)),st.setAttribute("font-size",String(rt)),st.setAttribute("font-family",Mo);let Ut=_t[Pe];const Ke=Math.floor((Ce-Pt*2)/(rt*.6));Ut.length>Ke&&(Ut=Ut.substring(0,Ke-1)+"…"),st.textContent=Ut,f.appendChild(st)}}else if(Ge.kind==="table"){const At=Ri(Ge.raw);if(At.length>0){const wt=rt*1.35,_t=6,Qt=3,Ft=At[0].length,Je=[];for(let Ke=0;Ke<Ft;Ke++){let an=0;for(const xn of At)Ke<xn.length&&(an=Math.max(an,v(xn[Ke],rt)));Je.push(an+_t*2)}Ce=Math.min(Je.reduce((Ke,an)=>Ke+an,0),M.width-4);const ht=Ce/Je.reduce((Ke,an)=>Ke+an,0);for(let Ke=0;Ke<Ft;Ke++)Je[Ke]*=ht;Me=At.length*(wt+Qt*2)+yn;const Rt=M.x-Ce/2;let Mo=Z+4;se&&(Mo=Z+M.image.height+En);const Pe=document.createElementNS(l,"rect");Pe.setAttribute("x",String(Rt)),Pe.setAttribute("y",String(Mo)),Pe.setAttribute("width",String(Ce)),Pe.setAttribute("height",String(Me-yn)),Pe.setAttribute("rx","6"),Pe.setAttribute("fill","rgba(255,255,255,0.55)"),Pe.setAttribute("stroke",to(M)),Pe.setAttribute("stroke-width","1"),f.appendChild(Pe);let st=Rt,Ut=Mo;for(let Ke=0;Ke<At.length;Ke++){const an=At[Ke],xn=wt+Qt*2;st=Rt;for(let Ao=0;Ao<Ft;Ao++){const oo=Je[Ao],Kh=an[Ao]||"";if(Ao<Ft-1){const Ye=document.createElementNS(l,"line");Ye.setAttribute("x1",String(st+oo)),Ye.setAttribute("y1",String(Ut)),Ye.setAttribute("x2",String(st+oo)),Ye.setAttribute("y2",String(Ut+xn)),Ye.setAttribute("stroke",to(M)),Ye.setAttribute("stroke-width","1"),f.appendChild(Ye)}if(Ke<At.length-1){const Ye=document.createElementNS(l,"line");Ye.setAttribute("x1",String(st)),Ye.setAttribute("y1",String(Ut+xn)),Ye.setAttribute("x2",String(st+oo)),Ye.setAttribute("y2",String(Ut+xn)),Ye.setAttribute("stroke",to(M)),Ye.setAttribute("stroke-width","1"),f.appendChild(Ye)}if(Ke===0){const Ye=document.createElementNS(l,"rect");Ye.setAttribute("x",String(st)),Ye.setAttribute("y",String(Ut)),Ye.setAttribute("width",String(oo)),Ye.setAttribute("height",String(xn)),Ye.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(Ye)}const sn=document.createElementNS(l,"text");sn.setAttribute("x",String(st+_t)),sn.setAttribute("y",String(Ut+Qt+wt/2+2)),sn.setAttribute("dominant-baseline","central"),sn.setAttribute("fill",eo(M)),sn.setAttribute("font-size",String(rt)),sn.setAttribute("font-family",E),Ke===0&&sn.setAttribute("font-weight","600");let mi=Kh;const rr=Math.floor((oo-_t*2)/(rt*.55));mi.length>rr&&rr>2&&(mi=mi.substring(0,rr-1)+"…"),sn.textContent=mi,f.appendChild(sn),st+=oo}Ut+=xn}}}}let ve=0;if(se){const Ge=M.image,rt=Z+4,Pt=M.x-Ge.width/2,$e=document.createElementNS(l,"image");$e.setAttribute("x",String(Pt)),$e.setAttribute("y",String(rt)),$e.setAttribute("width",String(Ge.width)),$e.setAttribute("height",String(Ge.height)),$e.setAttribute("href",Ge.src),$e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",Ge.src),$e.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild($e),ve=Ge.height+6}let Q=M.y;const ie=ve+Me;ie>0?Q=Z+ie+(M.height-ie)/2:T&&(Q=M.y-8);const Fe=14,K=2,We=4,xt=J?M.markers.length:0,$t=xt>0?xt*Fe+(xt-1)*K+We:0,bn=v(M.text,M.fontSize),Mt=$t+bn,kn=M.x-Mt/2;if(J){let Ge=kn;for(const rt of M.markers){const Pt=Oo(rt);if(Pt){const $e=document.createElementNS(l,"svg");$e.setAttribute("x",String(Ge)),$e.setAttribute("y",String(Q-Fe/2)),$e.setAttribute("width",String(Fe)),$e.setAttribute("height",String(Fe)),$e.setAttribute("viewBox","0 0 24 24"),$e.setAttribute("color",eo(M));const En=new DOMParser().parseFromString(`<svg xmlns="${l}">${Pt}</svg>`,"image/svg+xml");if(!En.querySelector("parsererror"))for(;En.documentElement.firstChild;)$e.appendChild(En.documentElement.firstChild);f.appendChild($e)}Ge+=Fe+K}}const Co=J?kn+$t+bn/2:M.x,it=document.createElementNS(l,"text");if(it.setAttribute("x",String(Co)),it.setAttribute("y",String(Q)),it.setAttribute("text-anchor","middle"),it.setAttribute("dominant-baseline","central"),it.setAttribute("fill",eo(M)),it.setAttribute("font-size",String(Zl(M))),it.setAttribute("font-weight",String(Xl(M))),it.setAttribute("font-family",E),it.textContent=M.text,f.appendChild(it),T){const $e=M.y+10,yn=M.tags.map(wt=>v(wt,10)+12),En=yn.reduce((wt,_t)=>wt+_t+3,-3);let At=M.x-En/2;for(let wt=0;wt<M.tags.length;wt++){const _t=M.tags[wt],Qt=yi(_t),Ft=yn[wt],Je=document.createElementNS(l,"rect");Je.setAttribute("x",String(At)),Je.setAttribute("y",String($e-16/2)),Je.setAttribute("width",String(Ft)),Je.setAttribute("height",String(16)),Je.setAttribute("rx",String(16/2)),Je.setAttribute("fill",Qt.background),Je.setAttribute("stroke",Qt.borderColor),Je.setAttribute("stroke-width","1"),f.appendChild(Je);const ht=document.createElementNS(l,"text");ht.setAttribute("x",String(At+Ft/2)),ht.setAttribute("y",String($e)),ht.setAttribute("text-anchor","middle"),ht.setAttribute("dominant-baseline","central"),ht.setAttribute("fill",Qt.color),ht.setAttribute("font-size",String(10)),ht.setAttribute("font-family",E),ht.textContent=_t,f.appendChild(ht),At+=Ft+3}}}return f}function To(){const r=Na();let f=new XMLSerializer().serializeToString(r);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
138
+ `+f);const w=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),E=URL.createObjectURL(w),v=document.createElement("a");v.href=E,v.download=`${m.value.text||"mindmap"}.svg`,v.click(),URL.revokeObjectURL(E)}function Sa(r=2){const l=Na(),f=pt.value;let E=new XMLSerializer().serializeToString(l);E.startsWith("<?xml")||(E=`<?xml version="1.0" encoding="UTF-8"?>
139
+ `+E);const v=new Blob([E],{type:"image/svg+xml;charset=utf-8"}),M=URL.createObjectURL(v),z=new window.Image;z.onload=()=>{const Z=document.createElement("canvas");Z.width=Math.ceil(f.vbW*r),Z.height=Math.ceil(f.vbH*r);const j=Z.getContext("2d");if(!j){URL.revokeObjectURL(M);return}j.fillStyle=Jt.value,j.fillRect(0,0,Z.width,Z.height),j.drawImage(z,0,0,Z.width,Z.height),URL.revokeObjectURL(M);try{Z.toBlob(oe=>{if(!oe){To();return}const T=URL.createObjectURL(oe),J=document.createElement("a");J.href=T,J.download=`${m.value.text||"mindmap"}.png`,J.click(),URL.revokeObjectURL(T)},"image/png")}catch(oe){console.warn("PNG export failed, falling back to SVG:",oe),To()}},z.onerror=()=>{URL.revokeObjectURL(M),To()},z.src=M}return o({addChild:r=>no(r),addSibling:r=>ci(r),removeNode:r=>ua(r),duplicateNode:r=>ia(r),setNodeText:(r,l)=>ha(r,l),moveNode:(r,l,f)=>tr(r,l,f),lineWidthForDepth:D,endWidthForDepth:X,getData:()=>m.value,nodeHasContent:r=>Ea(r),getSelectedIds:()=>[...d.value],copyNodes:r=>sa(r),cutNodes:r=>ca(r),pasteNodes:r=>da(r),setData:r=>{Gt.reset(),m.value=Bt(r),d.value=new Set,h.value=new Set,we(),Oe(),e.nextTick(()=>rn())},resetView:()=>rn(),exportData:vh,importData:Bh,getMarkdown:()=>Ln(m.value),setMarkdown:(r,l=!0)=>{const f=On(r||"");l&&(Y.value=!0),N=!l,Gt.reset(),m.value=Bt(f),d.value=new Set,h.value=new Set,we(),Oe(),e.nextTick(()=>{N=!1,rn()}),a("change",m.value)},setBalanced:r=>{Qn.value=r},isBalanced:()=>Qn.value,balance:()=>Rh(),applyNodeStyle:(r,l)=>xe(r,l),getNodeStyle:r=>ee(r),applyNodeImage:(r,l)=>ce(r,l),applyNodeImageByUrl:(r,l)=>g(r,l),removeNodeImage:r=>ue(r),applyNodeLink:(r,l)=>fe(r,l),removeNodeLink:r=>L(r),applyNodeNote:(r,l)=>O(r,l),removeNodeNote:r=>ae(r),applyNodeRichContent:(r,l)=>ke(r,l),addNodeMarker:(r,l)=>$h(r,l),removeNodeMarker:(r,l)=>Ph(r,l),toggleNodeMarker:(r,l)=>wa(r,l),getNodeMarkers:r=>Fh(r),setNodeTags:(r,l)=>ir(r,l),getNodeTags:r=>Wh(r),exportPNG:r=>Sa(r),exportSVG:()=>To(),searchNodes:r=>(zh(r),[...ln.value]),undo:()=>Qi(),redo:()=>er(),canUndo:()=>Gt.canUndo(),canRedo:()=>Gt.canRedo(),applySettings:r=>{r.autoBalanceOnChange!==void 0&&(_.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(_.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(_.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(_.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(_.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(_.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(_.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(_.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(_.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(_.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(_.lineWidthTaper=Math.max(.1,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(_.elbowRadius=Math.max(2,Math.min(40,r.elbowRadius))),r.showOrderBadge!==void 0&&(_.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(_.canvasBg=r.canvasBg)},getSettings:()=>({autoBalanceOnChange:_.autoBalanceOnChange,lineWidthStart:_.lineWidthStart,lineWidthEnd:_.lineWidthEnd,rainbowBranch:_.rainbowBranch,branchPaletteId:_.branchPaletteId,customPalettes:_.customPalettes,lineStyle:_.lineStyle,rootLineStyle:_.rootLineStyle,lineOrigin:_.lineOrigin,layoutMode:_.layoutMode,taperedEdge:_.taperedEdge,lineWidthTaper:_.lineWidthTaper,elbowRadius:_.elbowRadius,showOrderBadge:_.showOrderBadge,canvasBg:_.canvasBg}),setBranchPalette:r=>{if(!r)return;[...cn,..._.customPalettes].find(f=>f.id===r)&&(_.branchPaletteId=r)},getBranchPalette:()=>_.branchPaletteId,getBranchPalettes:()=>[...cn,..._.customPalettes],getSearchResults:()=>[...ln.value],getSearchIndex:()=>So.value}),e.watch(()=>i.data,r=>{m.value=Bt(r),we()},{deep:!1}),e.onMounted(()=>{Oe(),e.nextTick(()=>rn())}),(r,l)=>{var f,w,E,v,M,z,Z,j,oe;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Jt.value,fontSize:yt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:Ch,onContextmenu:Qe,onWheel:l[26]||(l[26]=(...T)=>e.unref(he).onWheel&&e.unref(he).onWheel(...T)),onMouseenter:l[27]||(l[27]=T=>x.value=!0),onMouseleave:l[28]||(l[28]=T=>x.value=!1),onClick:Mh},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:pt.value.vbX*e.unref(he).scale.value+e.unref(he).offsetX.value+"px",top:pt.value.vbY*e.unref(he).scale.value+e.unref(he).offsetY.value+"px",width:pt.value.vbW*e.unref(he).scale.value+"px",height:pt.value.vbH*e.unref(he).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:dh.value,preserveAspectRatio:"xMinYMin meet",width:pt.value.vbW*e.unref(he).scale.value,height:pt.value.vbH*e.unref(he).scale.value},[e.createElementVNode("g",Op,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ea.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:Et(fi(T.from,"out",T.to.side,T.to),fi(T.to,"in"),D(T.from.depth),X(T.to.depth),32,b(T.from.isRoot),T.to._dir),fill:wo(T.from,T.to),stroke:"none"},null,8,Lp))),128))])],8,Ip))],4),e.unref(he).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(he).marquee.x*e.unref(he).scale.value+e.unref(he).offsetX.value+"px",top:e.unref(he).marquee.y*e.unref(he).scale.value+e.unref(he).offsetY.value+"px",width:e.unref(he).marquee.width*e.unref(he).scale.value+"px",height:e.unref(he).marquee.height*e.unref(he).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:$.value+"px",top:R.value+"px",transform:`scale(${e.unref(he).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(C.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(he).offsetX.value}px, ${e.unref(he).offsetY.value}px) scale(${e.unref(he).scale.value})`})},[F.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drop-indicator",style:e.normalizeStyle({left:F.value.x1+"px",top:F.value.y1+"px",width:F.value.horizontal?F.value.x2-F.value.x1+"px":"3px",height:F.value.horizontal?"3px":F.value.y2-F.value.y1+"px",transform:F.value.horizontal?"translateY(-1.5px)":"translateX(-1.5px)"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on.value,T=>{var J,se,ge,Me,Ce,ve,Q;return e.openBlock(),e.createElementBlock("div",{key:T.id,class:e.normalizeClass(["zm-node",{"is-root":T.isRoot,"is-selected":p.value===T.id,"is-selected-secondary":p.value!==T.id&&d.value.has(T.id),"is-editing":s.value===T.id,"has-image":!!T.image,"is-resizing":Zi.value===T.id,"is-dragging-source":((J=C.value)==null?void 0:J.srcId)===T.id,"is-drop-target":((se=C.value)==null?void 0:se.currentTargetId)===T.id&&((ge=C.value)==null?void 0:ge.dropPosition)==="child","is-drop-target-before":((Me=C.value)==null?void 0:Me.currentTargetId)===T.id&&((Ce=C.value)==null?void 0:Ce.dropPosition)==="before","is-drop-target-after":((ve=C.value)==null?void 0:ve.currentTargetId)===T.id&&((Q=C.value)==null?void 0:Q.dropPosition)==="after","is-search-hit":Ih(T.id),"is-search-current":Oh(T.id),"is-search-dimmed":Lh(T.id)}]),"data-node-id":T.id,style:e.normalizeStyle({left:T.x+"px",top:T.y+"px",width:T.width+"px",minWidth:T.width+"px",height:T.height+"px",fontSize:Zl(T)+"px",background:ql(T),color:eo(T),borderColor:to(T),fontWeight:Xl(T),transform:"translate(-50%, -50%)"}),onClick:ie=>wh(ie,T),onPointerdown:ie=>Sh(ie,T),onDblclick:ie=>{ie.stopPropagation(),t.previewMode||No(T.id)},onContextmenu:ie=>ne(ie,T),onMouseenter:ie=>{Zn(T.id),Jn(ie,T)},onMouseleave:ie=>gn(T.id)},[T.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:T.image.src,width:T.image.width,height:T.image.height,alt:T.text,draggable:"false"},null,8,Vp)):e.createCommentVNode("",!0),T.richContent&&(T.richContent.kind==="code"||T.richContent.kind==="table")&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":T.richContent.kind==="table"||T.richContent.kind==="code"}]),onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ie=>mh(T.id),["stop"]),onMousedown:l[2]||(l[2]=e.withModifiers(()=>{},["stop"]))},[y.value===T.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":l[0]||(l[0]=ie=>k.value=ie),class:"zm-rich-edit",spellcheck:"false",onBlur:oa,onKeydown:hh},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Pp,[e.createElementVNode("code",{innerHTML:e.unref(_i)(e.unref(jo)(T.richContent.raw),e.unref(Sn)(T.richContent.raw))},null,8,Fp)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Up,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ri)(T.richContent.raw),(ie,Fe)=>(e.openBlock(),e.createElementBlock("tr",{key:Fe},[Fe===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ie,(K,We)=>(e.openBlock(),e.createElementBlock("th",{key:`h${We}`},e.toDisplayString(K),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ie,(K,We)=>(e.openBlock(),e.createElementBlock("td",{key:`c${We}`},e.toDisplayString(K),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,$p)):e.createCommentVNode("",!0),s.value!==T.id?(e.openBlock(),e.createElementBlock("span",Hp,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",Wp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.markers,ie=>(e.openBlock(),e.createElementBlock("span",{key:ie,class:"zm-node-marker",title:e.unref(Tr)(ie),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(Oo)(ie)+"</svg>"},null,8,Gp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",jp,e.toDisplayString(T.text),1),T.link&&s.value!==T.id?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:T.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${T.link.url}`,onClick:l[3]||(l[3]=e.withModifiers(()=>{},["stop"])),onMousedown:l[4]||(l[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"link",size:11,stroke:2})],40,Kp)):e.createCommentVNode("",!0),T.note&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:ai(T.note.text),onClick:e.withModifiers(ie=>li(T.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"note",size:11,stroke:2})],40,Yp)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:3,class:"zm-input","onUpdate:modelValue":l[6]||(l[6]=ie=>u.value=ie),autofocus:"",rows:"1",onBlur:l[7]||(l[7]=ie=>Ji()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(ie=>Ji(),["exact","prevent"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(ie=>Ji(),["prevent"]),["tab"])),e.withKeys(uh,["esc"]),gh],onInput:fh,onMousedown:l[10]||(l[10]=e.withModifiers(()=>{},["stop"])),onClick:l[11]||(l[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),T.tags&&T.tags.length>0&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",qp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.tags,ie=>(e.openBlock(),e.createElementBlock("span",{key:ie,class:"zm-node-tag",style:e.normalizeStyle(e.unref(yi)(ie))},e.toDisplayString(ie),5))),128))])):e.createCommentVNode("",!0),re.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${ya(T.id)+1} 个`},e.toDisplayString(ya(T.id)+1),9,Xp)):e.createCommentVNode("",!0),ka(T.id)&&nr(T.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({background:nn.value.get(T.id)??"#64748b"}),title:`展开 ${nr(T.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ie=>fa(T.id),["stop"])},e.toDisplayString(nr(T.id)),47,Zp)):e.createCommentVNode("",!0),_h(T)&&!ka(T.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({color:nn.value.get(T.id)??"#64748b",borderColor:nn.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ie=>fa(T.id),["stop"])},[e.createVNode(_e,{name:"minus",size:10,stroke:2.4})],46,Jp)):e.createCommentVNode("",!0),T.image&&p.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ie=>Tt(ie,T),["stop"])},null,40,Qp)):e.createCommentVNode("",!0),T.image&&p.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ie=>ue(T.id),["stop"])},[e.createVNode(_e,{name:"x",size:10,stroke:2.2})],40,eh)):e.createCommentVNode("",!0)],46,Dp)}),128))],4),A.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!A.value.above}]),style:e.normalizeStyle({left:A.value.x+"px",top:A.value.y+"px"})},e.toDisplayString(A.value.text),7)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(bs,{key:3,x:B.value.x,y:B.value.y,container:c.value,"has-image":!!((f=e.unref(be)(m.value,B.value.nodeId))!=null&&f.image),"has-link":!!((w=e.unref(be)(m.value,B.value.nodeId))!=null&&w.link),"has-note":!!((E=e.unref(be)(m.value,B.value.nodeId))!=null&&E.note),"has-code":((M=(v=e.unref(be)(m.value,B.value.nodeId))==null?void 0:v.richContent)==null?void 0:M.kind)==="code","has-table":((Z=(z=e.unref(be)(m.value,B.value.nodeId))==null?void 0:z.richContent)==null?void 0:Z.kind)==="table","node-markers":((j=e.unref(be)(m.value,B.value.nodeId))==null?void 0:j.markers)??[],"node-tags":((oe=e.unref(be)(m.value,B.value.nodeId))==null?void 0:oe.tags)??[],onPickImage:go,onRemoveImage:vn,onSetLink:Yi,onRemoveLink:bo,onEditNote:ko,onRemoveNote:qi,onAddCode:ri,onEditCode:ri,onRemoveCode:Xi,onAddTable:He,onEditTable:He,onRemoveTable:pn,onToggleMarker:Uh,onClearMarkers:Hh,onAddTag:Gh,onRemoveTags:jh,onClose:ye},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createBlock(ks,{key:4,x:S.value.x,y:S.value.y,container:c.value,onOpenSettings:et,onOpenData:en,onOpenImport:tt,onExportPng:Sa,onExportSvg:To,onClose:ut},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(U.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:l[15]||(l[15]=T=>a("canvas-toggle-preview"))},[e.createVNode(_e,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,th),e.createElementVNode("button",{class:e.normalizeClass(H.value),title:"显示大纲视图",onClick:ho},[e.createVNode(_e,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":x.value}])},[e.createElementVNode("span",{class:"zm-tb-tip zm-tb-zoom",title:"点击重置为 100%",onClick:l[16]||(l[16]=T=>e.unref(he).zoomTo100())},e.toDisplayString(Math.round(e.unref(he).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[17]||(l[17]=(...T)=>e.unref(he).zoomIn&&e.unref(he).zoomIn(...T))},[e.createVNode(_e,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[18]||(l[18]=(...T)=>e.unref(he).zoomOut&&e.unref(he).zoomOut(...T))},[e.createVNode(_e,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:rn},[e.createVNode(_e,{name:"reset"})]),l[38]||(l[38]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:yh},[e.createVNode(_e,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[19]||(l[19]=T=>pa(1))},[e.createVNode(_e,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[20]||(l[20]=T=>pa(2))},[e.createVNode(_e,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:Eh},[e.createVNode(_e,{name:"expand-all"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[36]||(l[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:l[21]||(l[21]=T=>p.value&&no(p.value))},[e.createElementVNode("img",{src:e.unref(cr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,nh)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[22]||(l[22]=T=>p.value&&ci(p.value))},[e.createElementVNode("img",{src:e.unref(sr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,oh)]),l[37]||(l[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[23]||(l[23]=T=>or("mindmap"))},[e.createVNode(_e,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[24]||(l[24]=T=>or("tree"))},[e.createVNode(_e,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[25]||(l[25]=T=>or("org"))},[e.createVNode(_e,{name:"org"})],2)],64))],2)],544),i.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(It,{side:"left",scope:"canvas",width:300,open:tn.value&&!t.previewMode,title:"大纲","onUpdate:open":l[29]||(l[29]=T=>tn.value=T)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:m.value,"selected-id":p.value,"collapsed-ids":nt.value,"show-index":re.value,onSelect:po,onToggleCollapse:mn,onEdit:ii,onAddChild:Kn,onAddSibling:Yn,onMove:Vt},null,8,["data","selected-id","collapsed-ids","show-index"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:360,open:Lt.value&&!t.previewMode,title:"数据","onUpdate:open":l[31]||(l[31]=T=>Lt.value=T)},{default:e.withCtx(()=>[e.createVNode(Do,{data:m.value,"pending-mode":Dt.value,onImport:l[30]||(l[30]=T=>m.value=T),onConsumedMode:Ue},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:420,open:me.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[33]||(l[33]=T=>me.value=T)},{default:e.withCtx(()=>[e.createVNode(Vo,{data:m.value,onImport:l[32]||(l[32]=T=>m.value=T)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:360,open:ft.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[34]||(l[34]=T=>ft.value=T)},{default:e.withCtx(()=>[e.createVNode(Qo,{"selected-node":kt.value,"focus-tick":Be.value,onApply:ot,onRemove:St,onSetLink:Rn,onSetImage:ni,onSetRich:oi},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",scope:"canvas",width:340,open:Ie.value&&!t.previewMode,title:"设置","onUpdate:open":l[35]||(l[35]=T=>Ie.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode($o,{settings:_,"has-selection":p.value!==null,"selected-node-text":(T=kt.value)==null?void 0:T.text,"node-style":q.value,"onUpdate:settings":le,"onUpdate:nodeStyle":Ee,onReset:Ae},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),ih={class:"zm-app"},rh={class:"zm-app-main"},lh={class:"zm-app-canvas"},Yl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
140
140
  所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},children:[{id:"r_image",text:"嵌入图片",image:{src:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 40" width="80" height="40"><rect width="80" height="40" rx="6" fill="#6366f1"/><text x="40" y="24" text-anchor="middle" fill="#fff" font-family="sans-serif" font-size="12" font-weight="600">LOGO</text></svg>'),naturalW:80,naturalH:40,width:80,height:40},children:[{id:"r_image_a",text:"节点上方的图标 / logo",children:[]},{id:"r_image_b",text:"remote URL 或 data: URL",children:[]},{id:"r_image_c",text:"可拖拽改尺寸",children:[]}]},{id:"r_code",text:"代码块",richContent:{kind:"code",lang:"ts",raw:'```ts\nimport { MindMap } from "flow-mindmap"\nconst tree = MindMap.parse(md)\n```'},note:{text:`代码块以 richContent 形式携带,
141
141
  渲染在节点标题上方,自动支持语言 tag。`},link:{url:"https://flow-mindmap.example/docs/api"},children:[{id:"r_code_a",text:"等宽字体,自动换行",richContent:{kind:"code",lang:"js",raw:"```js\nconst sum = (a, b) => a + b\nconsole.log(sum(1, 2)) // 3\n```"},children:[]},{id:"r_code_b",text:"保留原始 ```lang 标签",richContent:{kind:"code",lang:"bash",raw:"```bash\nnpm install flow-mindmap\nnpm run dev\n```"},children:[]},{id:"r_code_c",text:"max-height 截断,框内可滚",richContent:{kind:"code",lang:"ts",raw:`\`\`\`ts
142
142
  interface Node {
@@ -167,4 +167,4 @@ function walk(n: Node) {
167
167
  | --- | --- | --- | --- | --- |
168
168
  | 1 | 2 | 3 | 4 | 5 |
169
169
  | 6 | 7 | 8 | 9 | 10 |`},children:[]}]},{id:"r_note",text:"笔记 (note)",note:{text:`节点右上角的便签图标。
170
- 鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?i:typeof location<"u"&&location.hash==="#stress"?a:(typeof location<"u"&&location.hash==="#rich",o)}const i={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},a=(()=>{const V=(H,ie)=>({id:H,text:ie,children:[]}),w=[V("s_l1","左一"),V("s_l2","左二"),V("s_l3","左三"),V("s_l4","左四"),V("s_l5","左五"),V("s_l6","左六"),V("s_l7","左七")],P=[V("s_r1","右一"),V("s_r2","右二"),V("s_r3","右三"),V("s_r4","右四"),V("s_r5","右五"),V("s_r6","右六"),V("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...w,...P]}})(),c=e.ref(o),s=e.ref(null),f=e.ref(new Set),d=e.ref(!1),p=e.ref(!1),h=e.ref(!1),y=e.ref(!1),C=e.ref(0),D=e.ref(!1),_=e.ref(!1),F=e.ref(null);function R(){c.value=n()}function M(){p.value=!0,h.value=!1,y.value=!1}function k(V){M()}const u=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0}),N=e.computed(()=>{var V;return s.value?((V=F.value)==null?void 0:V.getNodeStyle(s.value.id))??{}:{}});function $(V){var w;Object.assign(u,V),(w=F.value)==null||w.applySettings(V)}function j(V){var w;s.value&&((w=F.value)==null||w.applyNodeStyle(s.value.id,V))}function q(){var w;const V={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0};Object.assign(u,V),(w=F.value)==null||w.applySettings(V)}function x(V){if(V.key==="Escape"){if(D.value){D.value=!1,V.stopPropagation();return}_.value&&(_.value=!1,V.stopPropagation())}}e.onMounted(()=>{var V;document.addEventListener("keydown",x),window.addEventListener("hashchange",R),(V=F.value)==null||V.applySettings({rainbowBranch:u.rainbowBranch,branchPaletteId:u.branchPaletteId,customPalettes:u.customPalettes,lineWidthStart:u.lineWidthStart,lineWidthEnd:u.lineWidthEnd,lineStyle:u.lineStyle,rootLineStyle:u.rootLineStyle,lineOrigin:u.lineOrigin})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",x),window.removeEventListener("hashchange",R)});function ae(V){c.value=V}function fe(V){var P;const w=V&&V.length>0?V[0]:null;s.value=w,w?!y.value&&((P=F.value)!=null&&P.nodeHasContent(w.id))&&(p.value=!1,h.value=!1,y.value=!0):y.value=!1}e.watch(c,V=>{if(!s.value)return;const w=J(V,s.value.id);w?w!==s.value&&(s.value=w):s.value=null},{deep:!1});function me(V){if(!s.value||s.value.id!==V){const w=J(c.value,V);w&&(s.value=w)}p.value=!1,h.value=!1,y.value=!0,C.value++}function J(V,w){if(V.id===w)return V;for(const P of V.children){const H=J(P,w);if(H)return H}return null}function ge(V){var w;s.value&&((w=F.value)==null||w.applyNodeNote(s.value.id,V))}function de(){var V;s.value&&((V=F.value)==null||V.removeNodeNote(s.value.id))}function ye(V){var w;s.value&&((w=F.value)==null||w.applyNodeLink(s.value.id,V))}function b(V){var w;s.value&&((w=F.value)==null||w.applyNodeImageByUrl(s.value.id,V))}function L(V){var w;s.value&&((w=F.value)==null||w.applyNodeRichContent(s.value.id,V))}function G(V){const w=document.querySelector(`[data-node-id="${V.id}"]`);w&&w.click()}function ee(V){const w=new Set(f.value);w.has(V)?w.delete(V):w.add(V),f.value=w}function be(V){var w;(w=F.value)==null||w.setNodeText(V.id,V.text)}function O(V){var w;(w=F.value)==null||w.addChild(V)}function B(V){var w;(w=F.value)==null||w.addSibling(V)}function oe(V){var w;(w=F.value)==null||w.moveNode(V.srcId,V.targetId,V.position)}const te=e.computed(()=>{var V;return((V=s.value)==null?void 0:V.id)??null});return(V,w)=>(e.openBlock(),e.createElementBlock("div",th,[e.createVNode(It,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":w[0]||(w[0]=P=>d.value=P)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:c.value,"selected-id":te.value,"collapsed-ids":f.value,onSelect:G,onToggleCollapse:ee,onEdit:be,onAddChild:O,onAddSibling:B,onMove:oe},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",nh,[_.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:w[1]||(w[1]=P=>_.value=!1)},[...w[11]||(w[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",oh,[e.createVNode(Qo,{ref_key:"mindMapRef",ref:F,data:c.value,"preview-mode":_.value,"built-in-drawers":!1,onChange:ae,onSelect:fe,onEditNote:me,onCanvasSettings:w[2]||(w[2]=P=>D.value=!0),onCanvasData:M,onCanvasImport:k,onCanvasTogglePreview:w[3]||(w[3]=P=>_.value=!_.value),onCanvasOutline:w[4]||(w[4]=P=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(It,{side:"right",width:360,open:p.value&&!_.value,title:"数据","onUpdate:open":w[6]||(w[6]=P=>p.value=P)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:c.value,onImport:w[5]||(w[5]=P=>c.value=P)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",width:420,open:h.value&&!_.value,title:"Markdown","onUpdate:open":w[8]||(w[8]=P=>h.value=P)},{default:e.withCtx(()=>[e.createVNode(Do,{data:c.value,onImport:w[7]||(w[7]=P=>c.value=P)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",width:360,open:y.value&&!_.value,title:"节点内容","onUpdate:open":w[9]||(w[9]=P=>y.value=P)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":s.value,readonly:!1,"focus-tick":C.value,onApply:ge,onRemove:de,onSetLink:ye,onSetImage:b,onSetRich:L},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",width:340,open:D.value&&!_.value,title:"设置","onUpdate:open":w[10]||(w[10]=P=>D.value=P)},{default:e.withCtx(()=>{var P;return[e.createVNode(Vo,{settings:u,"has-selection":s.value!==null,"selected-node-text":(P=s.value)==null?void 0:P.text,"node-style":N.value,"onUpdate:settings":$,"onUpdate:nodeStyle":j,onReset:q},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),ih="0.5.8",rh={install(t){t.component("FlowMindMap",Qo),t.component("FlowMindMapOutline",Oo),t.component("FlowMindMapDrawer",It),t.component("FlowMindMapDataPanel",Lo),t.component("FlowMindMapMarkdownPanel",Do),t.component("FlowMindMapSettingsPanel",Vo),t.component("FlowMindMapNotePanel",Jo),t.component("FlowMindMapApp",Gl)}};Ce.DataPanel=Lo,Ce.Drawer=It,Ce.MARKER_LIB=pi,Ce.MarkdownPanel=Do,Ce.MindMap=Qo,Ce.MindMapApp=Gl,Ce.NotePanel=Jo,Ce.Outline=Oo,Ce.SettingsPanel=Vo,Ce.VERSION=ih,Ce.addChild=kr,Ce.addSibling=yr,Ce.clone=zt,Ce.default=rh,Ce.findNode=he,Ce.findParent=Ft,Ce.markdownToMindMap=In,Ce.markdownToRichMindMap=Za,Ce.markerDef=ss,Ce.markerLabel=wr,Ce.markerSvg=Io,Ce.mindMapToMarkdown=On,Ce.removeNode=Ro,Ce.richBlockToMarkdown=Ja,Ce.tagColor=hi,Ce.uid=Kt,Object.defineProperties(Ce,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
170
+ 鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?i:typeof location<"u"&&location.hash==="#stress"?a:(typeof location<"u"&&location.hash==="#rich",o)}const i={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},a=(()=>{const B=(H,ne)=>({id:H,text:ne,children:[]}),S=[B("s_l1","左一"),B("s_l2","左二"),B("s_l3","左三"),B("s_l4","左四"),B("s_l5","左五"),B("s_l6","左六"),B("s_l7","左七")],U=[B("s_r1","右一"),B("s_r2","右二"),B("s_r3","右三"),B("s_r4","右四"),B("s_r5","右五"),B("s_r6","右六"),B("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...S,...U]}})(),c=e.ref(o),s=e.ref(null),u=e.ref(new Set),d=e.ref(!1),p=e.ref(!1),h=e.ref(!1),x=e.ref(!1),C=e.ref(0),$=e.ref(!1),R=e.ref(!1),F=e.ref(null);function I(){c.value=n()}function A(){p.value=!0,h.value=!1,x.value=!1}function y(B){A()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.1,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0}),m=e.computed(()=>{var B;return s.value?((B=F.value)==null?void 0:B.getNodeStyle(s.value.id))??{}:{}});function P(B){var S;Object.assign(k,B),(S=F.value)==null||S.applySettings(B)}function G(B){var S;s.value&&((S=F.value)==null||S.applyNodeStyle(s.value.id,B))}function Y(){var S;const B={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.1,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,B),(S=F.value)==null||S.applySettings(B)}function N(B){if(B.key==="Escape"){if($.value){$.value=!1,B.stopPropagation();return}R.value&&(R.value=!1,B.stopPropagation())}}e.onMounted(()=>{var B;document.addEventListener("keydown",N),window.addEventListener("hashchange",I),(B=F.value)==null||B.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle,rootLineStyle:k.rootLineStyle,lineOrigin:k.lineOrigin})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",N),window.removeEventListener("hashchange",I)});function re(B){c.value=B}function pe(B){var U;const S=B&&B.length>0?B[0]:null;s.value=S,S?!x.value&&((U=F.value)!=null&&U.nodeHasContent(S.id))&&(p.value=!1,h.value=!1,x.value=!0):x.value=!1}e.watch(c,B=>{if(!s.value)return;const S=xe(B,s.value.id);S?S!==s.value&&(s.value=S):s.value=null},{deep:!1});function de(B){if(!s.value||s.value.id!==B){const S=xe(c.value,B);S&&(s.value=S)}p.value=!1,h.value=!1,x.value=!0,C.value++}function xe(B,S){if(B.id===S)return B;for(const U of B.children){const H=xe(U,S);if(H)return H}return null}function ee(B){var S;s.value&&((S=F.value)==null||S.applyNodeNote(s.value.id,B))}function ce(){var B;s.value&&((B=F.value)==null||B.removeNodeNote(s.value.id))}function ue(B){var S;s.value&&((S=F.value)==null||S.applyNodeLink(s.value.id,B))}function g(B){var S;s.value&&((S=F.value)==null||S.applyNodeImageByUrl(s.value.id,B))}function V(B){var S;s.value&&((S=F.value)==null||S.applyNodeRichContent(s.value.id,B))}function W(B){const S=document.querySelector(`[data-node-id="${B.id}"]`);S&&S.click()}function te(B){const S=new Set(u.value);S.has(B)?S.delete(B):S.add(B),u.value=S}function fe(B){var S;(S=F.value)==null||S.setNodeText(B.id,B.text)}function L(B){var S;(S=F.value)==null||S.addChild(B)}function O(B){var S;(S=F.value)==null||S.addSibling(B)}function ae(B){var S;(S=F.value)==null||S.moveNode(B.srcId,B.targetId,B.position)}const ke=e.computed(()=>{var B;return((B=s.value)==null?void 0:B.id)??null});return(B,S)=>(e.openBlock(),e.createElementBlock("div",ih,[e.createVNode(It,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":S[0]||(S[0]=U=>d.value=U)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:c.value,"selected-id":ke.value,"collapsed-ids":u.value,onSelect:W,onToggleCollapse:te,onEdit:fe,onAddChild:L,onAddSibling:O,onMove:ae},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",rh,[R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:S[1]||(S[1]=U=>R.value=!1)},[...S[11]||(S[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",lh,[e.createVNode(ei,{ref_key:"mindMapRef",ref:F,data:c.value,"preview-mode":R.value,"built-in-drawers":!1,onChange:re,onSelect:pe,onEditNote:de,onCanvasSettings:S[2]||(S[2]=U=>$.value=!0),onCanvasData:A,onCanvasImport:y,onCanvasTogglePreview:S[3]||(S[3]=U=>R.value=!R.value),onCanvasOutline:S[4]||(S[4]=U=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(It,{side:"right",width:360,open:p.value&&!R.value,title:"数据","onUpdate:open":S[6]||(S[6]=U=>p.value=U)},{default:e.withCtx(()=>[e.createVNode(Do,{data:c.value,onImport:S[5]||(S[5]=U=>c.value=U)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",width:420,open:h.value&&!R.value,title:"Markdown","onUpdate:open":S[8]||(S[8]=U=>h.value=U)},{default:e.withCtx(()=>[e.createVNode(Vo,{data:c.value,onImport:S[7]||(S[7]=U=>c.value=U)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",width:360,open:x.value&&!R.value,title:"节点内容","onUpdate:open":S[9]||(S[9]=U=>x.value=U)},{default:e.withCtx(()=>[e.createVNode(Qo,{"selected-node":s.value,readonly:!1,"focus-tick":C.value,onApply:ee,onRemove:ce,onSetLink:ue,onSetImage:g,onSetRich:V},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(It,{side:"right",width:340,open:$.value&&!R.value,title:"设置","onUpdate:open":S[10]||(S[10]=U=>$.value=U)},{default:e.withCtx(()=>{var U;return[e.createVNode($o,{settings:k,"has-selection":s.value!==null,"selected-node-text":(U=s.value)==null?void 0:U.text,"node-style":m.value,"onUpdate:settings":P,"onUpdate:nodeStyle":G,onReset:Y},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),ah="0.5.10",sh={install(t){t.component("FlowMindMap",ei),t.component("FlowMindMapOutline",Lo),t.component("FlowMindMapDrawer",It),t.component("FlowMindMapDataPanel",Do),t.component("FlowMindMapMarkdownPanel",Vo),t.component("FlowMindMapSettingsPanel",$o),t.component("FlowMindMapNotePanel",Qo),t.component("FlowMindMapApp",Yl)}};Te.DataPanel=Do,Te.Drawer=It,Te.MARKER_LIB=ki,Te.MarkdownPanel=Vo,Te.MindMap=ei,Te.MindMapApp=Yl,Te.NotePanel=Qo,Te.Outline=Lo,Te.SettingsPanel=$o,Te.VERSION=ah,Te.addChild=bi,Te.addSibling=xr,Te.clone=Bt,Te.default=sh,Te.findNode=be,Te.findParent=zt,Te.markdownToMindMap=On,Te.markdownToRichMindMap=ts,Te.markerDef=fs,Te.markerLabel=Tr,Te.markerSvg=Oo,Te.mindMapToMarkdown=Ln,Te.removeNode=vo,Te.richBlockToMarkdown=ns,Te.tagColor=yi,Te.uid=Kt,Object.defineProperties(Te,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});