flow-mindmap 0.4.1 → 0.4.3

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,29 +1,26 @@
1
- (function(Ae,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Ae=typeof globalThis<"u"?globalThis:Ae||self,e(Ae.FlowMind={},Ae.Vue))})(this,function(Ae,e){"use strict";var Km=Object.defineProperty;var qm=(Ae,e,Ut)=>e in Ae?Km(Ae,e,{enumerable:!0,configurable:!0,writable:!0,value:Ut}):Ae[e]=Ut;var _e=(Ae,e,Ut)=>qm(Ae,typeof e!="symbol"?e+"":e,Ut);var Xn;const Ut=["width","height","stroke-width"],Wr={key:4,points:"6 9 12 15 18 9"},Gr={key:5,points:"9 6 15 12 9 18"},Ee=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",Wr)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Gr)):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==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[24]||(n[24]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[26]||(n[26]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[27]||(n[27]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[28]||(n[28]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[30]||(n[30]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[31]||(n[31]=e.createElementVNode("path",{d:"M3 17 V7 L7 13 L11 7 V17"},null,-1)),n[32]||(n[32]=e.createElementVNode("path",{d:"M14 7 V17"},null,-1)),n[33]||(n[33]=e.createElementVNode("path",{d:"M14 7 L18 12 L22 7"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"14",y1:"17",x2:"22",y2:"17"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[35]||(n[35]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[36]||(n[36]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[37]||(n[37]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[38]||(n[38]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[39]||(n[39]=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[40]||(n[40]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[41]||(n[41]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[42]||(n[42]=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[43]||(n[43]=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[44]||(n[44]=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:21},[n[45]||(n[45]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[46]||(n[46]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[47]||(n[47]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[48]||(n[48]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=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:23},[n[50]||(n[50]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[51]||(n[51]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[52]||(n[52]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[54]||(n[54]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[55]||(n[55]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[56]||(n[56]=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:26},[n[57]||(n[57]=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:27},[n[58]||(n[58]=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:28},[n[59]||(n[59]=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:29},[n[60]||(n[60]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[61]||(n[61]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[62]||(n[62]=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:30},[n[63]||(n[63]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[65]||(n[65]=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[66]||(n[66]=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:32},[n[67]||(n[67]=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[68]||(n[68]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[69]||(n[69]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[70]||(n[70]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):e.createCommentVNode("",!0)],8,Ut))}}),ei="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",ti="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",ni=[18,15,13,12],jr=[700,600,500,400],Kr=[52,40,32,28],qr=[120,80,60,44],Yr=[.8,.8,.8,.8],Zr=ni.length-1;function Xr(t,o){return Math.round(fo(t,o)*Yr[On(t)])}function On(t){return Math.min(Zr,Math.max(0,t))}function fo(t,o=14){return Math.round(ni[On(t)]*o/14*10)/10}function Jr(t,o=14){return Math.round(Kr[On(t)]*o/14)}const In=60,Ft=14,rt=24;let po=null;function Qr(){if(po)return po;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(po=t,t):{font:"",measureText:()=>({width:0})}}const oi=new Map;function el(t,o,n){const i=`${n}|${o}|${t}`,r=oi.get(i);if(r!==void 0)return r;const a=Qr();a.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=a.measureText(t).width;return oi.set(i,c),c}const tl=24,nl=400,ol=8,ii=16,il=4,rl=200;function ll(t,o,n){return Math.min(n,Math.max(o,t))}function al(t,o,n,i,r){const a=On(o),c=fo(o,n),u=Math.min(el(t.text||"",c,jr[a]),rl),s=Xr(o,n),m=Math.ceil(u+s*2),g=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:Jr(o,n);let y=0;if(t.link&&(y+=ii),t.note&&(y+=ii),y>0){const h=(t.link?1:0)+(t.note?1:0);y+=il*h}const w=m+y,k=(()=>{const h=Math.round(qr[a]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const O=r==null?void 0:r[t.id];return Math.max(h,O??240)}return h})(),b=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),_=i==null?void 0:i[t.id],x=b?Math.max(24,_??Math.max(70,Math.ceil(c*5))):0,R=x>0?10:0;if(!t.image){const h=Math.max(k,w),O=Math.ceil(g+R+x);return{w:h,h:O}}const S=ll(t.image.width,tl,nl),A=Math.max(k,w,Math.ceil(S+s*2)),C=Math.ceil(t.image.height+ol+g+R+x);return{w:A,h:C}}function sl(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,r=o.baseFontSize??14,a=li(t,0,null,1,"right",r,o.richHeights,o.richWidths);return dl(a),cl(a,n,i),a.x=0,a.y=0,ul(a,i)}function cl(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((g,y)=>g+y._subtreeH,0);let s=1,m=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),p=0;for(let g=0;g<i.length-1;g++){p+=i[g]._subtreeH;const y=Math.abs(p-(u-p));y<m&&(m=y,s=g+1)}for(let g=0;g<s;g++)i[g]._dir="right",i[g].side=1,i[g]._dirRight=1;for(let g=s;g<i.length;g++)i[g]._dir="left",i[g].side=-1,i[g]._dirRight=-1}const r=t.children.filter(u=>u.side===1),a=t.children.filter(u=>u.side===-1),c=(u,s)=>{const m=s==="right"?1:-1;u._dir=s,u.side=m,u._dirRight=m;for(const p of u.children)c(p,s)};for(const u of r)c(u,"right");for(const u of a)c(u,"left");if(r.length>0){const u={...t,children:r};vn(u,"right",In,!0,n)}if(a.length>0){const u={...t,children:a};vn(u,"left",In,!0,n)}}else if(o==="tree"){const i=r=>{r.side=1,r._dir="right";for(const a of r.children)i(a)};for(const r of t.children)r._dir="right";vn(t,"right",In,!0,n),i(t)}else{for(const i of t.children)i._dir="down";ri(t,In,n)}}function vn(t,o,n,i,r=!1){if(t.children.length===0)return;const a=t.children.reduce((m,p,g)=>m+p._subtreeH+(g>0?Ft:0),0),c=o==="right"?1:-1,u=i?c:1;let s=t.y-u*a/2;t.children.forEach(m=>{r||(m.x=t.x+c*(t.width/2+n+m.width/2),m.y=s+u*m._subtreeH/2),m._dir=o,s+=u*(m._subtreeH+Ft),vn(m,o,n,!1,r)})}function ri(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((a,c,u)=>a+c._subtreeW+(u>0?Ft*2:0),0);let r=t.x-i/2;t.children.forEach(a=>{n||(a.x=r+a._subtreeW/2,a.y=t.y+t.height/2+o+a.height/2),a._dir="down",r+=a._subtreeW+Ft*2,ri(a,o,n)})}function li(t,o,n,i,r,a,c,u){const s=al(t,o,a,c,u),m={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:s.w,height:s.h,fontSize:fo(o,a),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:r,_dirRight:i,_subtreeH:s.h,_subtreeW:s.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,children:[],parent:n};if(t.collapsed)return m;const p=t.children.length,g=Math.ceil(p/2);return m.children=t.children.map((y,w)=>{const k=o===0?w<g?1:-1:i;return li(y,o+1,m,k,r,a,c,u)}),m}function dl(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const r of i.children)o.push(r)}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 r=0,a=0;for(const c of i.children)r+=c._subtreeH,a+=c._subtreeW;i.children.length>1&&(r+=Ft*(i.children.length-1),a+=Ft*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,r),i._subtreeW=Math.max(i.width,a)}}function ul(t,o=!1){const n=[t];let i=1/0,r=-1/0,a=1/0,c=-1/0;for(;n.length;){const m=n.pop(),p=m.width/2,g=m.height/2;m.x-p<i&&(i=m.x-p),m.x+p>r&&(r=m.x+p),m.y-g<a&&(a=m.y-g),m.y+g>c&&(c=m.y+g),n.push(...m.children)}if(o)return{root:t,width:r-i+rt*2,height:c-a+rt*2,vbX:i-rt,vbY:a-rt,vbW:r-i+rt*2,vbH:c-a+rt*2};const u=rt-a,s=[t];for(;s.length;){const m=s.pop();m.y+=u,s.push(...m.children)}return a+=u,c+=u,{root:t,width:r-i+rt*2,height:c+rt,vbX:i-rt,vbY:0,vbW:r-i+rt*2,vbH:c+rt}}const Nt=[{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 ml(t,o=[]){return[...Nt,...o].find(i=>i.id===t)??Nt[0]}function fl(t,o=8){const n=[],i=new Set,r=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let a;for(;(a=r.exec(t))!==null;){const c=a[0];let u=null;if(c.startsWith("#")?u=pl(c):c.startsWith("rgb")?u=gl(c):u=hl[c.toLowerCase()]??null,!u)continue;const s=u.toLowerCase();if(!i.has(s)&&(i.add(s),n.push(s),n.length>=o))break}return n}function pl(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 gl(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 r=0;r<3;r++){const a=n[r];if(a.endsWith("%")){const c=parseFloat(a);if(!isFinite(c))return null;i.push(Math.round(c/100*255))}else{const c=parseInt(a,10);if(!isFinite(c)||c<0||c>255)return null;i.push(c)}}return"#"+i.map(r=>r.toString(16).padStart(2,"0")).join("").toLowerCase()}const hl={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 ft(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function pt(t){return JSON.parse(JSON.stringify(t))}function pe(t,o){if(t.id===o)return t;for(const n of t.children){const i=pe(n,o);if(i)return i}return null}function ct(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const r=ct(i,o,t);if(r!==null)return r}return null}function go(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(go(i,o))return!0;return!1}function bl(t,o,n){const i=pe(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function kl(t,o,n,i){if(!ct(t,o)||o===n||pe(pe(t,o),n))return!1;const r=ct(t,o),a=r.children.findIndex(m=>m.id===o);if(a<0)return!1;const[c]=r.children.splice(a,1);if(i==="child"){const m=pe(t,n);return m?(m.children.push(c),!0):(r.children.splice(a,0,c),!1)}const u=ct(t,n);if(!u)return r.children.splice(a,0,c),!1;let s=u.children.findIndex(m=>m.id===n);return s<0?(r.children.splice(a,0,c),!1):(i==="after"&&(s+=1),u.children.splice(s,0,c),!0)}function ai(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const r of t.children){const a=r.text.match(o);if(a)if(a[1]){const c=parseInt(a[1],10);c>n&&(n=c)}else i=!0}return n===0&&!i?Ln:n>0?`新节点 ${n+1}`:"新节点 2"}function si(t,o,n){const i=pe(t,o);if(!i)return null;const r={id:ft(),text:n??ai(i),children:[]};return i.children.push(r),r}function ci(t,o,n){const i=ct(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const a={id:ft(),text:n??ai(i),children:[]};return i.children.splice(r+1,0,a),a}function yl(t,o,n){const i=ct(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const a={id:ft(),text:n,children:[]};return i.children.splice(r,0,a),a}function El(t,o){const n=ct(t,o);if(!n)return null;const i=n.children.findIndex(c=>c.id===o);if(i<0)return null;const r=n.children[i],a=pt(r);return di(a),n.children.splice(i+1,0,a),a}function di(t){t.id=ft();for(const o of t.children)di(o)}const Ln="新节点";function Ht(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:ft(),text:o,children:[]},r=[i],a=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,s=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,m=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let g=!1,y=[],w=null;function k(x){y.push(x)}function b(){if(w&&y.length>0){for(;y.length>0&&y[0].trim()==="";)y.shift();for(;y.length>0&&y[y.length-1].trim()==="";)y.pop();const x=y.join(`
2
- `);x&&(w.note={text:x})}g=!1,y=[]}for(const x of n){if(g){const h=x.match(p);if(h&&h[1][0]==="`"){b();continue}k(x);continue}const R=x.match(u);if(R){const h=R[1].length,O=R[2].trim();c.push({level:h,text:O,body:""}),w=c[c.length-1];continue}const S=x.match(p);if(S&&S[2]==="note"){g=!0,y=[];continue}const A=x.match(s);if(A&&w){const h=A[2],O=160,W=120;w.image={src:h,naturalW:O,naturalH:W,width:O,height:W};continue}const C=x.match(m);if(C&&w){w.link={url:C[2]},w.text=C[1];continue}if(x.trim().length>0&&w){const h=x.trim();w.body=w.body?w.body+`
3
- `+h:h}}g&&b();function _(x){for(;r.length>1;){const C=r.length-1,h=a[C];if(h!==void 0&&h<x.level)break;r.pop(),a.pop()}const R=r[r.length-1],S=x.text,A={id:ft(),text:S,children:[]};x.image&&(A.image={...x.image}),x.link&&(A.link={url:x.link.url}),x.note&&(A.note={text:x.note.text}),x.body&&(A.note={text:x.body}),R.children.push(A),r.push(A),a.push(x.level)}for(const x of c)_(x);if(c.length>0&&c[0].level===1){const x=i.children[0];x&&(i.text=x.text,i.id=x.id,x.image&&(i.image={...x.image}),x.link&&(i.link={url:x.link.url}),x.note&&(i.note={text:x.note.text}),i.children=x.children)}return i}function Wt(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
1
+ (function(Ee,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Ee=typeof globalThis<"u"?globalThis:Ee||self,e(Ee.FlowMind={},Ee.Vue))})(this,function(Ee,e){"use strict";var Jm=Object.defineProperty;var Qm=(Ee,e,Ft)=>e in Ee?Jm(Ee,e,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):Ee[e]=Ft;var Ae=(Ee,e,Ft)=>Qm(Ee,typeof e!="symbol"?e+"":e,Ft);var Xn;const Ft=["width","height","stroke-width"],qr={key:4,points:"6 9 12 15 18 9"},Yr={key:5,points:"9 6 15 12 9 18"},xe=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",qr)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Yr)):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==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[24]||(n[24]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[26]||(n[26]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[27]||(n[27]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[28]||(n[28]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[30]||(n[30]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[31]||(n[31]=e.createElementVNode("path",{d:"M3 17 V7 L7 13 L11 7 V17"},null,-1)),n[32]||(n[32]=e.createElementVNode("path",{d:"M14 7 V17"},null,-1)),n[33]||(n[33]=e.createElementVNode("path",{d:"M14 7 L18 12 L22 7"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"14",y1:"17",x2:"22",y2:"17"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[35]||(n[35]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[36]||(n[36]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[37]||(n[37]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[38]||(n[38]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[39]||(n[39]=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[40]||(n[40]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[41]||(n[41]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[42]||(n[42]=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[43]||(n[43]=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[44]||(n[44]=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:21},[n[45]||(n[45]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[46]||(n[46]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[47]||(n[47]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[48]||(n[48]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=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:23},[n[50]||(n[50]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[51]||(n[51]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[52]||(n[52]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[54]||(n[54]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[55]||(n[55]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[56]||(n[56]=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:26},[n[57]||(n[57]=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:27},[n[58]||(n[58]=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:28},[n[59]||(n[59]=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:29},[n[60]||(n[60]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[61]||(n[61]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[62]||(n[62]=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:30},[n[63]||(n[63]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[65]||(n[65]=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[66]||(n[66]=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:32},[n[67]||(n[67]=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[68]||(n[68]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[69]||(n[69]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[70]||(n[70]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):e.createCommentVNode("",!0)],8,Ft))}}),ii="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",ri="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",li=[18,15,13,12],Zr=[700,600,500,400],Xr=[52,40,32,28],Jr=[120,80,60,44],Qr=[.8,.8,.8,.8],el=li.length-1;function tl(t,o){return Math.round(fo(t,o)*Qr[In(t)])}function In(t){return Math.min(el,Math.max(0,t))}function fo(t,o=14){return Math.round(li[In(t)]*o/14*10)/10}function nl(t,o=14){return Math.round(Xr[In(t)]*o/14)}const vn=60,Ut=14,rt=24;let po=null;function ol(){if(po)return po;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(po=t,t):{font:"",measureText:()=>({width:0})}}const ai=new Map;function il(t,o,n){const i=`${n}|${o}|${t}`,r=ai.get(i);if(r!==void 0)return r;const a=ol();a.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=a.measureText(t).width;return ai.set(i,s),s}const rl=24,ll=400,al=8,si=16,sl=4,cl=200;function dl(t,o,n){return Math.min(n,Math.max(o,t))}function ul(t,o,n,i,r){const a=In(o),s=fo(o,n),u=Math.min(il(t.text||"",s,Zr[a]),cl),c=tl(o,n),m=Math.ceil(u+c*2),g=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6:nl(o,n);let y=0;if(t.link&&(y+=si),t.note&&(y+=si),y>0){const h=(t.link?1:0)+(t.note?1:0);y+=sl*h}const w=m+y,k=(()=>{const h=Math.round(Jr[a]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const O=r==null?void 0:r[t.id];return Math.max(h,O??240)}return h})(),b=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),_=i==null?void 0:i[t.id],x=b?Math.max(24,_??Math.max(70,Math.ceil(s*5))):0,M=x>0?10:0;if(!t.image){const h=Math.max(k,w),O=Math.ceil(g+M+x);return{w:h,h:O}}const S=dl(t.image.width,rl,ll),A=Math.max(k,w,Math.ceil(S+c*2)),C=Math.ceil(t.image.height+al+g+M+x);return{w:A,h:C}}function ml(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,r=o.baseFontSize??14,a=di(t,0,null,1,"right",r,o.richHeights,o.richWidths);return pl(a),fl(a,n,i),a.x=0,a.y=0,gl(a,i)}function fl(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((g,y)=>g+y._subtreeH,0);let c=1,m=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),p=0;for(let g=0;g<i.length-1;g++){p+=i[g]._subtreeH;const y=Math.abs(p-(u-p));y<m&&(m=y,c=g+1)}for(let g=0;g<c;g++)i[g]._dir="right",i[g].side=1,i[g]._dirRight=1;for(let g=c;g<i.length;g++)i[g]._dir="left",i[g].side=-1,i[g]._dirRight=-1}const r=t.children.filter(u=>u.side===1),a=t.children.filter(u=>u.side===-1),s=(u,c)=>{const m=c==="right"?1:-1;u._dir=c,u.side=m,u._dirRight=m;for(const p of u.children)s(p,c)};for(const u of r)s(u,"right");for(const u of a)s(u,"left");if(r.length>0){const u={...t,children:r};Ln(u,"right",vn,!0,n)}if(a.length>0){const u={...t,children:a};Ln(u,"left",vn,!0,n)}}else if(o==="tree"){const i=r=>{r.side=1,r._dir="right";for(const a of r.children)i(a)};for(const r of t.children)r._dir="right";Ln(t,"right",vn,!0,n),i(t)}else{for(const i of t.children)i._dir="down";ci(t,vn,n)}}function Ln(t,o,n,i,r=!1){if(t.children.length===0)return;const a=t.children.reduce((m,p,g)=>m+p._subtreeH+(g>0?Ut:0),0),s=o==="right"?1:-1,u=i?s:1;let c=t.y-u*a/2;t.children.forEach(m=>{r||(m.x=t.x+s*(t.width/2+n+m.width/2),m.y=c+u*m._subtreeH/2),m._dir=o,c+=u*(m._subtreeH+Ut),Ln(m,o,n,!1,r)})}function ci(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((a,s,u)=>a+s._subtreeW+(u>0?Ut*2:0),0);let r=t.x-i/2;t.children.forEach(a=>{n||(a.x=r+a._subtreeW/2,a.y=t.y+t.height/2+o+a.height/2),a._dir="down",r+=a._subtreeW+Ut*2,ci(a,o,n)})}function di(t,o,n,i,r,a,s,u){const c=ul(t,o,a,s,u),m={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:c.w,height:c.h,fontSize:fo(o,a),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:r,_dirRight:i,_subtreeH:c.h,_subtreeW:c.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,children:[],parent:n};if(t.collapsed)return m;const p=t.children.length,g=Math.ceil(p/2);return m.children=t.children.map((y,w)=>{const k=o===0?w<g?1:-1:i;return di(y,o+1,m,k,r,a,s,u)}),m}function pl(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const r of i.children)o.push(r)}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 r=0,a=0;for(const s of i.children)r+=s._subtreeH,a+=s._subtreeW;i.children.length>1&&(r+=Ut*(i.children.length-1),a+=Ut*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,r),i._subtreeW=Math.max(i.width,a)}}function gl(t,o=!1){const n=[t];let i=1/0,r=-1/0,a=1/0,s=-1/0;for(;n.length;){const m=n.pop(),p=m.width/2,g=m.height/2;m.x-p<i&&(i=m.x-p),m.x+p>r&&(r=m.x+p),m.y-g<a&&(a=m.y-g),m.y+g>s&&(s=m.y+g),n.push(...m.children)}if(o)return{root:t,width:r-i+rt*2,height:s-a+rt*2,vbX:i-rt,vbY:a-rt,vbW:r-i+rt*2,vbH:s-a+rt*2};const u=rt-a,c=[t];for(;c.length;){const m=c.pop();m.y+=u,c.push(...m.children)}return a+=u,s+=u,{root:t,width:r-i+rt*2,height:s+rt,vbX:i-rt,vbY:0,vbW:r-i+rt*2,vbH:s+rt}}const Nt=[{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 hl(t,o=[]){return[...Nt,...o].find(i=>i.id===t)??Nt[0]}function bl(t,o=8){const n=[],i=new Set,r=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let a;for(;(a=r.exec(t))!==null;){const s=a[0];let u=null;if(s.startsWith("#")?u=kl(s):s.startsWith("rgb")?u=yl(s):u=El[s.toLowerCase()]??null,!u)continue;const c=u.toLowerCase();if(!i.has(c)&&(i.add(c),n.push(c),n.length>=o))break}return n}function kl(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 yl(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 r=0;r<3;r++){const a=n[r];if(a.endsWith("%")){const s=parseFloat(a);if(!isFinite(s))return null;i.push(Math.round(s/100*255))}else{const s=parseInt(a,10);if(!isFinite(s)||s<0||s>255)return null;i.push(s)}}return"#"+i.map(r=>r.toString(16).padStart(2,"0")).join("").toLowerCase()}const El={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 ft(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function pt(t){return JSON.parse(JSON.stringify(t))}function pe(t,o){if(t.id===o)return t;for(const n of t.children){const i=pe(n,o);if(i)return i}return null}function ct(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const r=ct(i,o,t);if(r!==null)return r}return null}function go(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(go(i,o))return!0;return!1}function xl(t,o,n){const i=pe(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function wl(t,o,n,i){if(!ct(t,o)||o===n||pe(pe(t,o),n))return!1;const r=ct(t,o),a=r.children.findIndex(m=>m.id===o);if(a<0)return!1;const[s]=r.children.splice(a,1);if(i==="child"){const m=pe(t,n);return m?(m.children.push(s),!0):(r.children.splice(a,0,s),!1)}const u=ct(t,n);if(!u)return r.children.splice(a,0,s),!1;let c=u.children.findIndex(m=>m.id===n);return c<0?(r.children.splice(a,0,s),!1):(i==="after"&&(c+=1),u.children.splice(c,0,s),!0)}function ui(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const r of t.children){const a=r.text.match(o);if(a)if(a[1]){const s=parseInt(a[1],10);s>n&&(n=s)}else i=!0}return n===0&&!i?Dn:n>0?`新节点 ${n+1}`:"新节点 2"}function mi(t,o,n){const i=pe(t,o);if(!i)return null;const r={id:ft(),text:n??ui(i),children:[]};return i.children.push(r),r}function fi(t,o,n){const i=ct(t,o);if(!i)return null;const r=i.children.findIndex(s=>s.id===o);if(r<0)return null;const a={id:ft(),text:n??ui(i),children:[]};return i.children.splice(r+1,0,a),a}function Nl(t,o,n){const i=ct(t,o);if(!i)return null;const r=i.children.findIndex(s=>s.id===o);if(r<0)return null;const a={id:ft(),text:n,children:[]};return i.children.splice(r,0,a),a}function Sl(t,o){const n=ct(t,o);if(!n)return null;const i=n.children.findIndex(s=>s.id===o);if(i<0)return null;const r=n.children[i],a=pt(r);return pi(a),n.children.splice(i+1,0,a),a}function pi(t){t.id=ft();for(const o of t.children)pi(o)}const Dn="新节点";function Ht(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:ft(),text:o,children:[]},r=[i],a=[-1/0],s=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,m=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let g=!1,y=[],w=null;function k(x){y.push(x)}function b(){if(w&&y.length>0){for(;y.length>0&&y[0].trim()==="";)y.shift();for(;y.length>0&&y[y.length-1].trim()==="";)y.pop();const x=y.join(`
2
+ `);x&&(w.note={text:x})}g=!1,y=[]}for(const x of n){if(g){const h=x.match(p);if(h&&h[1][0]==="`"){b();continue}k(x);continue}const M=x.match(u);if(M){const h=M[1].length,O=M[2].trim();s.push({level:h,text:O,body:""}),w=s[s.length-1];continue}const S=x.match(p);if(S&&S[2]==="note"){g=!0,y=[];continue}const A=x.match(c);if(A&&w){const h=A[2],O=160,W=120;w.image={src:h,naturalW:O,naturalH:W,width:O,height:W};continue}const C=x.match(m);if(C&&w){w.link={url:C[2]},w.text=C[1];continue}if(x.trim().length>0&&w){const h=x.trim();w.body=w.body?w.body+`
3
+ `+h:h}}g&&b();function _(x){for(;r.length>1;){const C=r.length-1,h=a[C];if(h!==void 0&&h<x.level)break;r.pop(),a.pop()}const M=r[r.length-1],S=x.text,A={id:ft(),text:S,children:[]};x.image&&(A.image={...x.image}),x.link&&(A.link={url:x.link.url}),x.note&&(A.note={text:x.note.text}),x.body&&(A.note={text:x.body}),M.children.push(A),r.push(A),a.push(x.level)}for(const x of s)_(x);if(s.length>0&&s[0].level===1){const x=i.children[0];x&&(i.text=x.text,i.id=x.id,x.image&&(i.image={...x.image}),x.link&&(i.link={url:x.link.url}),x.note&&(i.note={text:x.note.text}),i.children=x.children)}return i}function Wt(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
4
4
  `;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
5
5
  `),t.image&&(n+=`![image](${t.image.src})
6
6
  `),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
7
- `);for(const i of t.children)n+=Wt(i,o+1);return n}function xl(t){var m,p;const o=t.split(/\r?\n/),n=[];let i=0;const r=/^(#{1,6})\s+(.+?)\s*#*\s*$/,a=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,c=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,s=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const g=o[i],y=g.match(a);if(y){const S=y[1][0],A=y[2]||"",C=[g];for(i++;i<o.length;){const O=o[i].match(a);if(O&&O[1][0]===S){C.push(o[i]),i++;break}C.push(o[i]),i++}const h=C.slice(1,-1).join(`
7
+ `);for(const i of t.children)n+=Wt(i,o+1);return n}function Tl(t){var m,p;const o=t.split(/\r?\n/),n=[];let i=0;const r=/^(#{1,6})\s+(.+?)\s*#*\s*$/,a=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,c=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const g=o[i],y=g.match(a);if(y){const S=y[1][0],A=y[2]||"",C=[g];for(i++;i<o.length;){const O=o[i].match(a);if(O&&O[1][0]===S){C.push(o[i]),i++;break}C.push(o[i]),i++}const h=C.slice(1,-1).join(`
8
8
  `).trim();n.push({kind:"code",text:((m=h.split(`
9
9
  `)[0])==null?void 0:m.slice(0,80))||"(空代码块)",raw:C.join(`
10
- `),lang:A});continue}const w=g.match(r);if(w){n.push({kind:"heading",level:w[1].length,text:w[2].trim(),raw:g}),i++;continue}if(/^\s*\|/.test(g)){const S=[];let A=i,C=!1;for(;A<o.length&&/^\s*\|/.test(o[A]);)S.push(o[A]),c.test(o[A])&&(C=!0),A++;if(C&&S.length>=2){n.push({kind:"table",text:((p=S[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:p.trim())||"表格",raw:S.join(`
11
- `)}),i=A;continue}}const k=g.match(u),b=g.match(s);if(k||b){let S=i;for(;S<o.length;){const A=o[S].match(u),C=o[S].match(s);if(!(A||C))break;const h=o[S].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();h.length>0&&n.push({kind:"list",text:h.slice(0,80)||"(列表项)",raw:o[S]}),S++}i=S;continue}if(g.trim()===""){i++;continue}const _=[g];let x=i+1;for(;x<o.length;){const S=o[x];if(S.trim()===""||r.test(S)||a.test(S)||u.test(S)||s.test(S)||/^\s*\|/.test(S))break;_.push(S),x++}const R=_.join(" ").trim();n.push({kind:"paragraph",text:R.slice(0,80)||"(空段落)",raw:_.join(`
12
- `)}),i=x}return n}function wl(t,o="导入的导图"){const n=xl(t||""),i={id:ft(),text:o,children:[]},r=[i],a=[0];let c=!1;function u(s){if(s.kind==="heading"){const p=s.level;for(;r.length>1&&a[a.length-1]>=p;)r.pop(),a.pop();if(!c&&p===1){c=!0,i.text=s.text,a[0]=1;return}const g={id:ft(),text:s.text,children:[]};r[r.length-1].children.push(g),r.push(g),a.push(p);return}const m={id:ft(),text:s.text,children:[],richContent:{kind:s.kind,raw:s.raw,lang:s.lang}};r[r.length-1].children.push(m)}for(const s of n)u(s);return i}function Nl(t){return t.richContent?t.richContent.raw+`
13
- `:""}function Sl(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,r=e.ref(1),a=e.ref(0),c=e.ref(0),u=e.ref(!1),s=e.reactive({x:0,y:0,ox:0,oy:0}),m=e.ref(!1),p=e.reactive({x:0,y:0}),g=e.reactive({x:0,y:0,width:0,height:0}),y=e.ref(0);let w=null;function k(K){w=K}function b(K){K.preventDefault();const te=t.getContainer();if(!te)return;const le=-K.deltaY*.001,G=Math.min(n,Math.max(o,r.value*(1+le))),Y=te.getBoundingClientRect(),U=K.clientX-Y.left,N=K.clientY-Y.top,$=(U-a.value)/r.value,L=(N-c.value)/r.value;r.value=G,a.value=U-$*G,c.value=N-L*G}function _(){r.value=Math.min(n,r.value*i)}function x(){r.value=Math.max(o,r.value/i)}function R(K){var le;K.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,s.x=K.clientX,s.y=K.clientY,s.ox=a.value,s.oy=c.value,window.addEventListener("mousemove",S),window.addEventListener("mouseup",A),(le=K.preventDefault)==null||le.call(K))}function S(K){u.value&&(a.value=s.ox+(K.clientX-s.x),c.value=s.oy+(K.clientY-s.y))}function A(){u.value=!1,window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",A)}function C(K,te){m.value=!0,p.x=K,p.y=te,g.x=K,g.y=te,g.width=0,g.height=0,y.value++,window.addEventListener("mousemove",W),window.addEventListener("mouseup",O)}function h(K,te){if(!m.value)return;const le=Math.min(p.x,K),G=Math.min(p.y,te),Y=Math.max(p.x,K),U=Math.max(p.y,te);g.x=le,g.y=G,g.width=Y-le,g.height=U-G,y.value++}function O(){m.value=!1,window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",O),w&&w()}function W(K){if(!m.value)return;const te=t.getContainer();if(!te)return;const le=te.getBoundingClientRect(),G=(K.clientX-le.left-a.value)/r.value,Y=(K.clientY-le.top-c.value)/r.value;h(G,Y)}function oe(K,te,le,G=60){const Y=t.getContainer();if(!Y)return;const U=Y.getBoundingClientRect(),N=(U.width-G*2)/K,$=(U.height-G*2)/te,L=Math.min(1,Math.max(.3,Math.min(N,$)));r.value=L,a.value=U.width/2,c.value=U.height/2-le*L}return{scale:r,offsetX:a,offsetY:c,isPanning:u,onWheel:b,zoomIn:_,zoomOut:x,startPan:R,startMarquee:C,updateMarquee:h,isMarquee:m,marquee:g,marqueeVersion:y,setOnMarqueeEnd:k,resetView:oe}}const Tl=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function ui(t){return Tl?t.metaKey:t.ctrlKey}function Cl(t){function o(){const i=t.getSelectedId();return i||(t.defaultTargetId?t.defaultTargetId():t.getRootId())}function n(i){const r=i.target;if(r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||t.isReadonly()||t.isEditing())return;const a=t.getSelectedId(),c=o();if(c){if(ui(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){a&&a!==t.getRootId()&&(i.preventDefault(),t.onDuplicate(a));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(ui(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}i.key==="Tab"?(i.preventDefault(),t.onAddChild(c)):i.key==="Enter"?(i.preventDefault(),i.shiftKey?a&&a!==t.getRootId()&&t.onAddSiblingBefore(a):t.onAddSibling(c)):(i.key==="Delete"||i.key==="Backspace")&&a&&a!==t.getRootId()?(i.preventDefault(),t.onRemove(a)):i.key==="F2"&&a?(i.preventDefault(),t.onStartEdit(a)):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 _l(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function r(){return n<o.value.length-1}function a(m){const p=JSON.stringify(m);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(p),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function c(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return r()?(n++,JSON.parse(o.value[n])):null}function s(){o.value=[],n=-1}return{canUndo:i,canRedo:r,record:a,undo:c,redo:u,reset:s}}const Al=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}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let y=n.x+2,w=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),b=180,x=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+b>k.right&&(y=Math.max(k.left+4,n.x-b-2)),w+x>k.bottom&&(w=Math.max(k.top+4,n.y-x-2)),y<k.left+2&&(y=k.left+2),w<k.top+2&&(w=k.top+2)}return{left:y,top:w}}),a=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote);function s(y){const w=y.target;w&&w.closest(".zm-node-menu")||i("close")}function m(y){y.key==="Escape"&&i("close")}function p(){i("close")}window.addEventListener("mousedown",s,!0),window.addEventListener("keydown",m,!0),window.addEventListener("wheel",p,!0),window.addEventListener("scroll",p,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",s,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener("wheel",p,!0),window.removeEventListener("scroll",p,!0)});function g(y){y(),i("close")}return(y,w)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:w[10]||(w[10]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[0]||(w[0]=e.withModifiers(k=>g(()=>i("pickImage")),["stop"]))},[e.createVNode(Ee,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(a.value?"替换图片":"添加图片"),1)]),a.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:w[1]||(w[1]=e.withModifiers(k=>g(()=>i("removeImage")),["stop"]))},[e.createVNode(Ee,{name:"x",size:13}),w[11]||(w[11]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[2]||(w[2]=e.withModifiers(k=>g(()=>i("setLink")),["stop"]))},[e.createVNode(Ee,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"编辑链接":"添加链接"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:w[3]||(w[3]=e.withModifiers(k=>g(()=>i("removeLink")),["stop"]))},[e.createVNode(Ee,{name:"x",size:13}),w[12]||(w[12]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[4]||(w[4]=e.withModifiers(k=>g(()=>i("addCode")),["stop"]))},[w[13]||(w[13]=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:w[5]||(w[5]=e.withModifiers(k=>g(()=>i("removeCode")),["stop"]))},[e.createVNode(Ee,{name:"x",size:13}),w[14]||(w[14]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[6]||(w[6]=e.withModifiers(k=>g(()=>i("addTable")),["stop"]))},[w[15]||(w[15]=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:w[7]||(w[7]=e.withModifiers(k=>g(()=>i("removeTable")),["stop"]))},[e.createVNode(Ee,{name:"x",size:13}),w[16]||(w[16]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[8]||(w[8]=e.withModifiers(k=>g(()=>i("editNote")),["stop"]))},[e.createVNode(Ee,{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:w[9]||(w[9]=e.withModifiers(k=>g(()=>i("removeNote")),["stop"]))},[e.createVNode(Ee,{name:"x",size:13}),w[17]||(w[17]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0)],36))}}),Rl=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let _=n.x+2,x=n.y+2;if(n.container){const R=n.container.getBoundingClientRect(),S=160,A=4+3*28;_+S>R.right&&(_=Math.max(R.left+4,n.x-S-2)),x+A>R.bottom&&(x=Math.max(R.top+4,n.y-A-2)),_<R.left+2&&(_=R.left+2),x<R.top+2&&(x=R.top+2)}return{left:_,top:x}}),a=e.ref(!1),c=e.ref(null),u=e.computed(()=>{if(!c.value)return{left:"-9999px",top:"-9999px",display:"none"};const _=c.value.getBoundingClientRect(),x=window.innerWidth,R=window.innerHeight,S=176,A=4+3*28;let C=_.right;C+S>x-4&&(C=Math.max(4,_.left-S));let h=_.top-4;return h+A>R-4&&(h=Math.max(4,R-A-4)),{left:C+"px",top:h+"px",display:"block"}});let s=null,m=null;function p(){m&&(clearTimeout(m),m=null),s=setTimeout(()=>{a.value=!0},60)}function g(){s&&(clearTimeout(s),s=null),m=setTimeout(()=>{a.value=!1},120)}e.onBeforeUnmount(()=>{s&&clearTimeout(s),m&&clearTimeout(m)});function y(_){const x=_.target;x&&x.closest(".zm-canvas-menu")||i("close")}function w(_){_.key==="Escape"&&i("close")}function k(){i("close")}window.addEventListener("mousedown",y,!0),window.addEventListener("keydown",w,!0),window.addEventListener("wheel",k,!0),window.addEventListener("scroll",k,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",y,!0),window.removeEventListener("keydown",w,!0),window.removeEventListener("wheel",k,!0),window.removeEventListener("scroll",k,!0)});function b(_){_(),i("close")}return(_,x)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:x[5]||(x[5]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[0]||(x[0]=e.withModifiers(R=>b(()=>i("openData")),["stop"]))},[e.createVNode(Ee,{name:"data",size:13}),x[6]||(x[6]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:c,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":a.value}]),onMouseenter:p,onMouseleave:g},[e.createVNode(Ee,{name:"import",size:13}),x[10]||(x[10]=e.createElementVNode("span",null,"导入",-1)),x[11]||(x[11]=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)),a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(u.value),onMouseenter:p,onMouseleave:g},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(R=>b(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(Ee,{name:"markdown",size:13}),x[7]||(x[7]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[2]||(x[2]=e.withModifiers(R=>b(()=>i("openImport","json")),["stop"]))},[e.createVNode(Ee,{name:"data",size:13}),x[8]||(x[8]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[3]||(x[3]=e.withModifiers(R=>b(()=>i("openImport","txt")),["stop"]))},[e.createVNode(Ee,{name:"note",size:13}),x[9]||(x[9]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[4]||(x[4]=e.withModifiers(R=>b(()=>i("openSettings")),["stop"]))},[e.createVNode(Ee,{name:"settings",size:13}),x[12]||(x[12]=e.createElementVNode("span",null,"设置",-1))])],36))}});function Ml(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function mi(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)&&mi(n)}),t}class fi{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function pi(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function At(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const Bl="</span>",gi=t=>!!t.scope,zl=(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,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${o}${t}`};class Ol{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=pi(o)}openNode(o){if(!gi(o))return;const n=zl(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){gi(o)&&(this.buffer+=Bl)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const hi=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class ho{constructor(){this.rootNode=hi(),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=hi({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=>{ho._collapse(n)}))}}class Il extends ho{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 Ol(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function gn(t){return t?typeof t=="string"?t:t.source:null}function bi(t){return Ot("(?=",t,")")}function vl(t){return Ot("(?:",t,")*")}function Ll(t){return Ot("(?:",t,")?")}function Ot(...t){return t.map(n=>gn(n)).join("")}function Dl(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function bo(...t){return"("+(Dl(t).capture?"":"?:")+t.map(i=>gn(i)).join("|")+")"}function ki(t){return new RegExp(t.toString()+"|").exec("").length-1}function Vl(t,o){const n=t&&t.exec(o);return n&&n.index===0}const $l=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ko(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const r=n;let a=gn(i),c="";for(;a.length>0;){const u=$l.exec(a);if(!u){c+=a;break}c+=a.substring(0,u.index),a=a.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?c+="\\"+String(Number(u[1])+r):(c+=u[0],u[0]==="("&&n++)}return c}).map(i=>`(${i})`).join(o)}const Pl=/\b\B/,yi="[a-zA-Z]\\w*",yo="[a-zA-Z_]\\w*",Ei="\\b\\d+(\\.\\d+)?",xi="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",wi="\\b(0b[01]+)",Ul="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Fl=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Ot(o,/.*\b/,t.binary,/\b.*/)),At({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},hn={begin:"\\\\[\\s\\S]",relevance:0},Hl={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[hn]},Wl={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[hn]},Gl={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/},Dn=function(t,o,n={}){const i=At({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 r=bo("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:Ot(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},jl=Dn("//","$"),Kl=Dn("/\\*","\\*/"),ql=Dn("#","$"),Yl={scope:"number",begin:Ei,relevance:0},Zl={scope:"number",begin:xi,relevance:0},Xl={scope:"number",begin:wi,relevance:0},Jl={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[hn,{begin:/\[/,end:/\]/,relevance:0,contains:[hn]}]},Ql={scope:"title",begin:yi,relevance:0},ea={scope:"title",begin:yo,relevance:0},ta={begin:"\\.\\s*"+yo,relevance:0};var Vn=Object.freeze({__proto__:null,APOS_STRING_MODE:Hl,BACKSLASH_ESCAPE:hn,BINARY_NUMBER_MODE:Xl,BINARY_NUMBER_RE:wi,COMMENT:Dn,C_BLOCK_COMMENT_MODE:Kl,C_LINE_COMMENT_MODE:jl,C_NUMBER_MODE:Zl,C_NUMBER_RE:xi,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:ql,IDENT_RE:yi,MATCH_NOTHING_RE:Pl,METHOD_GUARD:ta,NUMBER_MODE:Yl,NUMBER_RE:Ei,PHRASAL_WORDS_MODE:Gl,QUOTE_STRING_MODE:Wl,REGEXP_MODE:Jl,RE_STARTERS_RE:Ul,SHEBANG:Fl,TITLE_MODE:Ql,UNDERSCORE_IDENT_RE:yo,UNDERSCORE_TITLE_MODE:ea});function na(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function oa(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function ia(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=na,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function ra(t,o){Array.isArray(t.illegal)&&(t.illegal=bo(...t.illegal))}function la(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 aa(t,o){t.relevance===void 0&&(t.relevance=1)}const sa=(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=Ot(n.beforeMatch,bi(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},ca=["of","and","for","in","not","or","if","then","parent","list","value"],da="keyword";function Ni(t,o,n=da){const i=Object.create(null);return typeof t=="string"?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(a){Object.assign(i,Ni(t[a],o,a))}),i;function r(a,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const s=u.split("|");i[s[0]]=[a,ua(s[0],s[1])]})}}function ua(t,o){return o?Number(o):ma(t)?0:1}function ma(t){return ca.includes(t.toLowerCase())}const Si={},It=t=>{console.error(t)},Ti=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Gt=(t,o)=>{Si[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Si[`${t}/${o}`]=!0)},$n=new Error;function Ci(t,o,{key:n}){let i=0;const r=t[n],a={},c={};for(let u=1;u<=o.length;u++)c[u+i]=r[u],a[u+i]=!0,i+=ki(o[u-1]);t[n]=c,t[n]._emit=a,t[n]._multi=!0}function fa(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw It("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),$n;if(typeof t.beginScope!="object"||t.beginScope===null)throw It("beginScope must be object"),$n;Ci(t,t.begin,{key:"beginScope"}),t.begin=ko(t.begin,{joinWith:""})}}function pa(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw It("skip, excludeEnd, returnEnd not compatible with endScope: {}"),$n;if(typeof t.endScope!="object"||t.endScope===null)throw It("endScope must be object"),$n;Ci(t,t.end,{key:"endScope"}),t.end=ko(t.end,{joinWith:""})}}function ga(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function ha(t){ga(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),fa(t),pa(t)}function ba(t){function o(c,u){return new RegExp(gn(c),"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,s){s.position=this.position++,this.matchIndexes[this.matchAt]=s,this.regexes.push([s,u]),this.matchAt+=ki(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(s=>s[1]);this.matcherRe=o(ko(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const s=this.matcherRe.exec(u);if(!s)return null;const m=s.findIndex((g,y)=>y>0&&g!==void 0),p=this.matchIndexes[m];return s.splice(0,m),Object.assign(s,p)}}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 s=new n;return this.rules.slice(u).forEach(([m,p])=>s.addRule(m,p)),s.compile(),this.multiRegexes[u]=s,s}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,s){this.rules.push([u,s]),s.type==="begin"&&this.count++}exec(u){const s=this.getMatcher(this.regexIndex);s.lastIndex=this.lastIndex;let m=s.exec(u);if(this.resumingScanAtSamePosition()&&!(m&&m.index===this.lastIndex)){const p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,m=p.exec(u)}return m&&(this.regexIndex+=m.position+1,this.regexIndex===this.count&&this.considerAll()),m}}function r(c){const u=new i;return c.contains.forEach(s=>u.addRule(s.begin,{rule:s,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function a(c,u){const s=c;if(c.isCompiled)return s;[oa,la,ha,sa].forEach(p=>p(c,u)),t.compilerExtensions.forEach(p=>p(c,u)),c.__beforeBegin=null,[ia,ra,aa].forEach(p=>p(c,u)),c.isCompiled=!0;let m=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),m=c.keywords.$pattern,delete c.keywords.$pattern),m=m||/\w+/,c.keywords&&(c.keywords=Ni(c.keywords,t.case_insensitive)),s.keywordPatternRe=o(m,!0),u&&(c.begin||(c.begin=/\B|\b/),s.beginRe=o(s.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(s.endRe=o(s.end)),s.terminatorEnd=gn(s.end)||"",c.endsWithParent&&u.terminatorEnd&&(s.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(s.illegalRe=o(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(p){return ka(p==="self"?c:p)})),c.contains.forEach(function(p){a(p,s)}),c.starts&&a(c.starts,u),s.matcher=r(s),s}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=At(t.classNameAliases||{}),a(t)}function _i(t){return t?t.endsWithParent||_i(t.starts):!1}function ka(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return At(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:_i(t)?At(t,{starts:t.starts?At(t.starts):null}):Object.isFrozen(t)?At(t):t}var ya="11.11.1";class Ea extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Eo=pi,Ai=At,Ri=Symbol("nomatch"),xa=7,Mi=function(t){const o=Object.create(null),n=Object.create(null),i=[];let r=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",c={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:Il};function s(N){return u.noHighlightRe.test(N)}function m(N){let $=N.className+" ";$+=N.parentNode?N.parentNode.className:"";const L=u.languageDetectRe.exec($);if(L){const j=W(L[1]);return j||(Ti(a.replace("{}",L[1])),Ti("Falling back to no-highlight mode for this block.",N)),j?L[1]:"no-highlight"}return $.split(/\s+/).find(j=>s(j)||W(j))}function p(N,$,L){let j="",X="";typeof $=="object"?(j=N,L=$.ignoreIllegals,X=$.language):(Gt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Gt("10.7.0",`Please use highlight(code, options) instead.
14
- https://github.com/highlightjs/highlight.js/issues/2277`),X=N,j=$),L===void 0&&(L=!0);const ge={code:j,language:X};Y("before:highlight",ge);const Be=ge.result?ge.result:g(ge.language,ge.code,L);return Be.code=ge.code,Y("after:highlight",Be),Be}function g(N,$,L,j){const X=Object.create(null);function ge(F,Z){return F.keywords[Z]}function Be(){if(!ee.keywords){Re.addText(ye);return}let F=0;ee.keywordPatternRe.lastIndex=0;let Z=ee.keywordPatternRe.exec(ye),se="";for(;Z;){se+=ye.substring(F,Z.index);const he=Ge.case_insensitive?Z[0].toLowerCase():Z[0],Me=ge(ee,he);if(Me){const[He,et]=Me;if(Re.addText(se),se="",X[he]=(X[he]||0)+1,X[he]<=xa&&(kt+=et),He.startsWith("_"))se+=Z[0];else{const Pt=Ge.classNameAliases[He]||He;v(Z[0],Pt)}}else se+=Z[0];F=ee.keywordPatternRe.lastIndex,Z=ee.keywordPatternRe.exec(ye)}se+=ye.substring(F),Re.addText(se)}function Fe(){if(ye==="")return;let F=null;if(typeof ee.subLanguage=="string"){if(!o[ee.subLanguage]){Re.addText(ye);return}F=g(ee.subLanguage,ye,!0,mt[ee.subLanguage]),mt[ee.subLanguage]=F._top}else F=w(ye,ee.subLanguage.length?ee.subLanguage:null);ee.relevance>0&&(kt+=F.relevance),Re.__addSublanguage(F._emitter,F.language)}function Le(){ee.subLanguage!=null?Fe():Be(),ye=""}function v(F,Z){F!==""&&(Re.startScope(Z),Re.addText(F),Re.endScope())}function B(F,Z){let se=1;const he=Z.length-1;for(;se<=he;){if(!F._emit[se]){se++;continue}const Me=Ge.classNameAliases[F[se]]||F[se],He=Z[se];Me?v(He,Me):(ye=He,Be(),ye=""),se++}}function ie(F,Z){return F.scope&&typeof F.scope=="string"&&Re.openNode(Ge.classNameAliases[F.scope]||F.scope),F.beginScope&&(F.beginScope._wrap?(v(ye,Ge.classNameAliases[F.beginScope._wrap]||F.beginScope._wrap),ye=""):F.beginScope._multi&&(B(F.beginScope,Z),ye="")),ee=Object.create(F,{parent:{value:ee}}),ee}function ae(F,Z,se){let he=Vl(F.endRe,se);if(he){if(F["on:end"]){const Me=new fi(F);F["on:end"](Z,Me),Me.isMatchIgnored&&(he=!1)}if(he){for(;F.endsParent&&F.parent;)F=F.parent;return F}}if(F.endsWithParent)return ae(F.parent,Z,se)}function D(F){return ee.matcher.regexIndex===0?(ye+=F[0],1):(yt=!0,0)}function T(F){const Z=F[0],se=F.rule,he=new fi(se),Me=[se.__beforeBegin,se["on:begin"]];for(const He of Me)if(He&&(He(F,he),he.isMatchIgnored))return D(Z);return se.skip?ye+=Z:(se.excludeBegin&&(ye+=Z),Le(),!se.returnBegin&&!se.excludeBegin&&(ye=Z)),ie(se,F),se.returnBegin?0:Z.length}function ue(F){const Z=F[0],se=$.substring(F.index),he=ae(ee,F,se);if(!he)return Ri;const Me=ee;ee.endScope&&ee.endScope._wrap?(Le(),v(Z,ee.endScope._wrap)):ee.endScope&&ee.endScope._multi?(Le(),B(ee.endScope,F)):Me.skip?ye+=Z:(Me.returnEnd||Me.excludeEnd||(ye+=Z),Le(),Me.excludeEnd&&(ye=Z));do ee.scope&&Re.closeNode(),!ee.skip&&!ee.subLanguage&&(kt+=ee.relevance),ee=ee.parent;while(ee!==he.parent);return he.starts&&ie(he.starts,F),Me.returnEnd?0:Z.length}function me(){const F=[];for(let Z=ee;Z!==Ge;Z=Z.parent)Z.scope&&F.unshift(Z.scope);F.forEach(Z=>Re.openNode(Z))}let De={};function Ze(F,Z){const se=Z&&Z[0];if(ye+=F,se==null)return Le(),0;if(De.type==="begin"&&Z.type==="end"&&De.index===Z.index&&se===""){if(ye+=$.slice(Z.index,Z.index+1),!r){const he=new Error(`0 width match regex (${N})`);throw he.languageName=N,he.badRule=De.rule,he}return 1}if(De=Z,Z.type==="begin")return T(Z);if(Z.type==="illegal"&&!L){const he=new Error('Illegal lexeme "'+se+'" for mode "'+(ee.scope||"<unnamed>")+'"');throw he.mode=ee,he}else if(Z.type==="end"){const he=ue(Z);if(he!==Ri)return he}if(Z.type==="illegal"&&se==="")return ye+=`
15
- `,1;if(Qe>1e5&&Qe>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ye+=se,se.length}const Ge=W(N);if(!Ge)throw It(a.replace("{}",N)),new Error('Unknown language: "'+N+'"');const nn=ba(Ge);let St="",ee=j||nn;const mt={},Re=new u.__emitter(u);me();let ye="",kt=0,je=0,Qe=0,yt=!1;try{if(Ge.__emitTokens)Ge.__emitTokens($,Re);else{for(ee.matcher.considerAll();;){Qe++,yt?yt=!1:ee.matcher.considerAll(),ee.matcher.lastIndex=je;const F=ee.matcher.exec($);if(!F)break;const Z=$.substring(je,F.index),se=Ze(Z,F);je=F.index+se}Ze($.substring(je))}return Re.finalize(),St=Re.toHTML(),{language:N,value:St,relevance:kt,illegal:!1,_emitter:Re,_top:ee}}catch(F){if(F.message&&F.message.includes("Illegal"))return{language:N,value:Eo($),illegal:!0,relevance:0,_illegalBy:{message:F.message,index:je,context:$.slice(je-100,je+100),mode:F.mode,resultSoFar:St},_emitter:Re};if(r)return{language:N,value:Eo($),illegal:!1,relevance:0,errorRaised:F,_emitter:Re,_top:ee};throw F}}function y(N){const $={value:Eo(N),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return $._emitter.addText(N),$}function w(N,$){$=$||u.languages||Object.keys(o);const L=y(N),j=$.filter(W).filter(K).map(Le=>g(Le,N,!1));j.unshift(L);const X=j.sort((Le,v)=>{if(Le.relevance!==v.relevance)return v.relevance-Le.relevance;if(Le.language&&v.language){if(W(Le.language).supersetOf===v.language)return 1;if(W(v.language).supersetOf===Le.language)return-1}return 0}),[ge,Be]=X,Fe=ge;return Fe.secondBest=Be,Fe}function k(N,$,L){const j=$&&n[$]||L;N.classList.add("hljs"),N.classList.add(`language-${j}`)}function b(N){let $=null;const L=m(N);if(s(L))return;if(Y("before:highlightElement",{el:N,language:L}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.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(N)),u.throwUnescapedHTML))throw new Ea("One of your code blocks includes unescaped HTML.",N.innerHTML);$=N;const j=$.textContent,X=L?p(j,{language:L,ignoreIllegals:!0}):w(j);N.innerHTML=X.value,N.dataset.highlighted="yes",k(N,L,X.language),N.result={language:X.language,re:X.relevance,relevance:X.relevance},X.secondBest&&(N.secondBest={language:X.secondBest.language,relevance:X.secondBest.relevance}),Y("after:highlightElement",{el:N,result:X,text:j})}function _(N){u=Ai(u,N)}const x=()=>{A(),Gt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function R(){A(),Gt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function A(){function N(){A()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",N,!1),S=!0;return}document.querySelectorAll(u.cssSelector).forEach(b)}function C(N,$){let L=null;try{L=$(t)}catch(j){if(It("Language definition for '{}' could not be registered.".replace("{}",N)),r)It(j);else throw j;L=c}L.name||(L.name=N),o[N]=L,L.rawDefinition=$.bind(null,t),L.aliases&&oe(L.aliases,{languageName:N})}function h(N){delete o[N];for(const $ of Object.keys(n))n[$]===N&&delete n[$]}function O(){return Object.keys(o)}function W(N){return N=(N||"").toLowerCase(),o[N]||o[n[N]]}function oe(N,{languageName:$}){typeof N=="string"&&(N=[N]),N.forEach(L=>{n[L.toLowerCase()]=$})}function K(N){const $=W(N);return $&&!$.disableAutodetect}function te(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=$=>{N["before:highlightBlock"](Object.assign({block:$.el},$))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=$=>{N["after:highlightBlock"](Object.assign({block:$.el},$))})}function le(N){te(N),i.push(N)}function G(N){const $=i.indexOf(N);$!==-1&&i.splice($,1)}function Y(N,$){const L=N;i.forEach(function(j){j[L]&&j[L]($)})}function U(N){return Gt("10.7.0","highlightBlock will be removed entirely in v12.0"),Gt("10.7.0","Please use highlightElement now."),b(N)}Object.assign(t,{highlight:p,highlightAuto:w,highlightAll:A,highlightElement:b,highlightBlock:U,configure:_,initHighlighting:x,initHighlightingOnLoad:R,registerLanguage:C,unregisterLanguage:h,listLanguages:O,getLanguage:W,registerAliases:oe,autoDetection:K,inherit:Ai,addPlugin:le,removePlugin:G}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=ya,t.regex={concat:Ot,lookahead:bi,either:bo,optional:Ll,anyNumberOfTimes:vl};for(const N in Vn)typeof Vn[N]=="object"&&mi(Vn[N]);return Object.assign(t,Vn),t},jt=Mi({});jt.newInstance=()=>Mi({});var wa=jt;jt.HighlightJS=jt,jt.default=jt;const xo=Ml(wa);function wo(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 r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},a=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={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,r]};r.contains.push(u);const s={match:/\\"/},m={className:"string",begin:/'/,end:/'/},p={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],w=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),k={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],_=["true","false"],x={match:/(\/[a-z._-]+)+/},R=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["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"],C=["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:b,literal:_,built_in:[...R,...S,"set","shopt",...A,...C]},contains:[w,t.SHEBANG(),k,g,a,c,x,u,s,m,p,n]}}const Na=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_-]*/}}),Sa=["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"],Ta=["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"],Ca=[...Sa,...Ta],_a=["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(),Aa=["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(),Ra=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ma=["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 Ba(t){const o=t.regex,n=Na(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",a=/@-?\w[\w]*(-\w+)*/,c="[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:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Aa.join("|")+")"},{begin:":(:)?("+Ra.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ma.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:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:_a.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ca.join("|")+")\\b"}]}}function Bi(t){const a={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:a,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:a,illegal:/["']/}]}]}}var Kt="[0-9](_*[0-9])*",Pn=`\\.(${Kt})`,Un="[0-9a-fA-F](_*[0-9a-fA-F])*",zi={className:"number",variants:[{begin:`(\\b(${Kt})((${Pn})|\\.)?|(${Pn}))[eE][+-]?(${Kt})[fFdD]?\\b`},{begin:`\\b(${Kt})((${Pn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Pn})[fFdD]?\\b`},{begin:`\\b(${Kt})[fFdD]\\b`},{begin:`\\b0[xX]((${Un})\\.?|(${Un})?\\.(${Un}))[pP][+-]?(${Kt})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Un})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Oi(t,o,n){return n===-1?"":t.replace(o,i=>Oi(t,o,n-1))}function za(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Oi("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),s={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"]},m={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={className:"params",begin:/\(/,end:/\)/,keywords:s,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:s,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:[p,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:s,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:s,relevance:0,contains:[m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,zi,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},zi,m]}}const Ii="[A-Za-z$_][0-9A-Za-z$_]*",Oa=["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"],Ia=["true","false","null","undefined","NaN","Infinity"],vi=["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"],Li=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Di=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],va=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],La=[].concat(Di,vi,Li);function Vi(t){const o=t.regex,n=(L,{after:j})=>{const X="</"+L[0].slice(1);return L.input.indexOf(X,j)!==-1},i=Ii,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,j)=>{const X=L[0].length+L.index,ge=L.input[X];if(ge==="<"||ge===","){j.ignoreMatch();return}ge===">"&&(n(L,{after:X})||j.ignoreMatch());let Be;const Fe=L.input.substring(X);if(Be=Fe.match(/^\s*=/)){j.ignoreMatch();return}if((Be=Fe.match(/^\s+extends\s+/))&&Be.index===0){j.ignoreMatch();return}}},u={$pattern:Ii,keyword:Oa,literal:Ia,built_in:La,"variable.language":va},s="[0-9](_?[0-9])*",m=`\\.(${s})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${s})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},R={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]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,{match:/\$\d+/},g];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const A=[].concat(R,y.contains),C=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),h={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:C},O={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"}}]},W={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:{_:[...vi,...Li]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[h],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(L){return o.concat("(?!",L.join("|"),")")}const G={match:o.concat(/\b/,le([...Di,"super","import"].map(L=>`${L}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},h]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[h]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,R,{match:/\$\d+/},g,W,{scope:"attr",match:i+o.lookahead(":"),relevance:0},$,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,t.REGEXP_MODE,{className:"function",begin:N,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:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[h,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[h]},G,te,O,U,{match:/\$[(.]/}]}}function Da(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,r,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function $i(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={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}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={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+.-]*/,s={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}]},m={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=t.inherit(m,{contains:[]}),y=t.inherit(p,{contains:[]});m.contains.push(y),p.contains.push(g);let w=[n,s];return[m,p,g,y].forEach(x=>{x.contains=x.contains.concat(w)}),w=w.concat(m,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:w},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:w}]}]},n,a,m,p,{className:"quote",begin:"^>\\s+",contains:w,end:"$"},r,i,s,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Pi(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"]},s={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},p={begin:/\{\{/,relevance:0},g={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,s,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,s,p,m]},{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,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,m]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",w=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,k=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${w}))[eE][+-]?(${y})[jJ]?(?=${k})`},{begin:`(${w})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${k})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${k})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${k})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${k})`},{begin:`\\b(${y})[jJ](?=${k})`}]},_={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",s,b,g,t.HASH_COMMENT_MODE]}]};return m.contains=[g,b,s],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[s,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,_,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{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:[b,x,g]}]}}function Ui(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),r=o.concat(n,t.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,o.lookahead(/\s*\(/))},c="([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"],s=["true","false","Some","None","Ok","Err"],m=["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!"],p=["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:p,keyword:u,literal:s,built_in:m},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_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],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:m,type:p}},{className:"punctuation",begin:"->"},a]}}function Va(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],c=["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"],s=["add","asc","collation","desc","final","first","last","view"],m=["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"],p=["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"],g=["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"],y=["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"],w=p,k=[...m,...s].filter(C=>!p.includes(C)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},_={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:o.concat(/\b/,o.either(...w),/\s*\(/),relevance:0,keywords:{built_in:w}};function R(C){return o.concat(/\b/,o.either(...C.map(h=>h.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:R(y),relevance:0};function A(C,{exceptions:h,when:O}={}){const W=O;return h=h||[],C.map(oe=>oe.match(/\|\d+$/)||h.includes(oe)?oe:W(oe)?`${oe}|0`:oe)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(k,{when:C=>C.length<3}),literal:a,type:u,built_in:g},contains:[{scope:"type",match:R(c)},S,x,b,i,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,_]}}const Fn="[A-Za-z$_][0-9A-Za-z$_]*",Fi=["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"],Hi=["true","false","null","undefined","NaN","Infinity"],Wi=["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"],Gi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ji=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ki=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],qi=[].concat(ji,Wi,Gi);function $a(t){const o=t.regex,n=(L,{after:j})=>{const X="</"+L[0].slice(1);return L.input.indexOf(X,j)!==-1},i=Fn,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,j)=>{const X=L[0].length+L.index,ge=L.input[X];if(ge==="<"||ge===","){j.ignoreMatch();return}ge===">"&&(n(L,{after:X})||j.ignoreMatch());let Be;const Fe=L.input.substring(X);if(Be=Fe.match(/^\s*=/)){j.ignoreMatch();return}if((Be=Fe.match(/^\s+extends\s+/))&&Be.index===0){j.ignoreMatch();return}}},u={$pattern:Fn,keyword:Fi,literal:Hi,built_in:qi,"variable.language":Ki},s="[0-9](_?[0-9])*",m=`\\.(${s})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${s})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},R={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]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,{match:/\$\d+/},g];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const A=[].concat(R,y.contains),C=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),h={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:C},O={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"}}]},W={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:{_:[...Wi,...Gi]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[h],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(L){return o.concat("(?!",L.join("|"),")")}const G={match:o.concat(/\b/,le([...ji,"super","import"].map(L=>`${L}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},U={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},h]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[h]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,R,{match:/\$\d+/},g,W,{scope:"attr",match:i+o.lookahead(":"),relevance:0},$,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[R,t.REGEXP_MODE,{className:"function",begin:N,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:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[h,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[h]},G,te,O,U,{match:/\$[(.]/}]}}function Yi(t){const o=t.regex,n=$a(t),i=Fn,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},s=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:Fn,keyword:Fi.concat(s),literal:Hi,built_in:qi.concat(r),"variable.language":Ki},p={className:"meta",begin:"@"+i},g=(b,_,x)=>{const R=b.contains.findIndex(S=>S.label===_);if(R===-1)throw new Error("can not find mode to replace");b.contains.splice(R,1,x)};Object.assign(n.keywords,m),n.exports.PARAMS_CONTAINS.push(p);const y=n.contains.find(b=>b.scope==="attr"),w=Object.assign({},y,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,w]),n.contains=n.contains.concat([p,a,c,w]),g(n,"shebang",t.SHEBANG()),g(n,"use_strict",u);const k=n.contains.find(b=>b.label==="func.def");return k.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Zi(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,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(a,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),s=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),m={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:[r]},{begin:/'/,end:/'/,contains:[r]},{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:[a,s,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,c,s,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[s]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],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:m}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Xi(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]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},u=t.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={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"},w={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},k={begin:/\{/,end:/\}/,contains:[w],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[w],illegal:"\\n",relevance:0},_=[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}},y,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},k,b,a,c],x=[..._];return x.pop(),x.push(u),w.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:_}}const No={bash:wo,sh:wo,shell:wo,css:Ba,go:Bi,golang:Bi,java:za,javascript:Vi,js:Vi,json:Da,markdown:$i,md:$i,python:Pi,py:Pi,rust:Ui,rs:Ui,sql:Va,typescript:Yi,ts:Yi,xml:Zi,html:Zi,yaml:Xi,yml:Xi};for(const[t,o]of Object.entries(No))xo.registerLanguage(t,o);function So(t){const o=t.split(`
10
+ `),lang:A});continue}const w=g.match(r);if(w){n.push({kind:"heading",level:w[1].length,text:w[2].trim(),raw:g}),i++;continue}if(/^\s*\|/.test(g)){const S=[];let A=i,C=!1;for(;A<o.length&&/^\s*\|/.test(o[A]);)S.push(o[A]),s.test(o[A])&&(C=!0),A++;if(C&&S.length>=2){n.push({kind:"table",text:((p=S[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:p.trim())||"表格",raw:S.join(`
11
+ `)}),i=A;continue}}const k=g.match(u),b=g.match(c);if(k||b){let S=i;for(;S<o.length;){const A=o[S].match(u),C=o[S].match(c);if(!(A||C))break;const h=o[S].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();h.length>0&&n.push({kind:"list",text:h.slice(0,80)||"(列表项)",raw:o[S]}),S++}i=S;continue}if(g.trim()===""){i++;continue}const _=[g];let x=i+1;for(;x<o.length;){const S=o[x];if(S.trim()===""||r.test(S)||a.test(S)||u.test(S)||c.test(S)||/^\s*\|/.test(S))break;_.push(S),x++}const M=_.join(" ").trim();n.push({kind:"paragraph",text:M.slice(0,80)||"(空段落)",raw:_.join(`
12
+ `)}),i=x}return n}function Cl(t,o="导入的导图"){const n=Tl(t||""),i={id:ft(),text:o,children:[]},r=[i],a=[0];let s=!1;function u(c){if(c.kind==="heading"){const p=c.level;for(;r.length>1&&a[a.length-1]>=p;)r.pop(),a.pop();if(!s&&p===1){s=!0,i.text=c.text,a[0]=1;return}const g={id:ft(),text:c.text,children:[]};r[r.length-1].children.push(g),r.push(g),a.push(p);return}const m={id:ft(),text:c.text,children:[],richContent:{kind:c.kind,raw:c.raw,lang:c.lang}};r[r.length-1].children.push(m)}for(const c of n)u(c);return i}function _l(t){return t.richContent?t.richContent.raw+`
13
+ `:""}function Al(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,r=e.ref(1),a=e.ref(0),s=e.ref(0),u=e.ref(!1),c=e.reactive({x:0,y:0,ox:0,oy:0}),m=e.ref(!1),p=e.reactive({x:0,y:0}),g=e.reactive({x:0,y:0,width:0,height:0}),y=e.ref(0);let w=null;function k(K){w=K}function b(K){K.preventDefault();const te=t.getContainer();if(!te)return;const le=-K.deltaY*.001,G=Math.min(n,Math.max(o,r.value*(1+le))),Y=te.getBoundingClientRect(),F=K.clientX-Y.left,N=K.clientY-Y.top,$=(F-a.value)/r.value,L=(N-s.value)/r.value;r.value=G,a.value=F-$*G,s.value=N-L*G}function _(){r.value=Math.min(n,r.value*i)}function x(){r.value=Math.max(o,r.value/i)}function M(K){var le;K.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,c.x=K.clientX,c.y=K.clientY,c.ox=a.value,c.oy=s.value,window.addEventListener("mousemove",S),window.addEventListener("mouseup",A),(le=K.preventDefault)==null||le.call(K))}function S(K){u.value&&(a.value=c.ox+(K.clientX-c.x),s.value=c.oy+(K.clientY-c.y))}function A(){u.value=!1,window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",A)}function C(K,te){m.value=!0,p.x=K,p.y=te,g.x=K,g.y=te,g.width=0,g.height=0,y.value++,window.addEventListener("mousemove",W),window.addEventListener("mouseup",O)}function h(K,te){if(!m.value)return;const le=Math.min(p.x,K),G=Math.min(p.y,te),Y=Math.max(p.x,K),F=Math.max(p.y,te);g.x=le,g.y=G,g.width=Y-le,g.height=F-G,y.value++}function O(){m.value=!1,window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",O),w&&w()}function W(K){if(!m.value)return;const te=t.getContainer();if(!te)return;const le=te.getBoundingClientRect(),G=(K.clientX-le.left-a.value)/r.value,Y=(K.clientY-le.top-s.value)/r.value;h(G,Y)}function oe(K,te,le,G=60){const Y=t.getContainer();if(!Y)return;const F=Y.getBoundingClientRect(),N=(F.width-G*2)/K,$=(F.height-G*2)/te,L=Math.min(1,Math.max(.3,Math.min(N,$)));r.value=L,a.value=F.width/2,s.value=F.height/2-le*L}return{scale:r,offsetX:a,offsetY:s,isPanning:u,onWheel:b,zoomIn:_,zoomOut:x,startPan:M,startMarquee:C,updateMarquee:h,isMarquee:m,marquee:g,marqueeVersion:y,setOnMarqueeEnd:k,resetView:oe}}const Ml=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function gi(t){return Ml?t.metaKey:t.ctrlKey}function Rl(t){function o(){const i=t.getSelectedId();return i||(t.defaultTargetId?t.defaultTargetId():t.getRootId())}function n(i){const r=i.target;if(r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||t.isReadonly()||t.isEditing())return;const a=t.getSelectedId(),s=o();if(s){if(gi(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){a&&a!==t.getRootId()&&(i.preventDefault(),t.onDuplicate(a));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(gi(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}i.key==="Tab"?(i.preventDefault(),t.onAddChild(s)):i.key==="Enter"?(i.preventDefault(),i.shiftKey?a&&a!==t.getRootId()&&t.onAddSiblingBefore(a):t.onAddSibling(s)):(i.key==="Delete"||i.key==="Backspace")&&a&&a!==t.getRootId()?(i.preventDefault(),t.onRemove(a)):i.key==="F2"&&a?(i.preventDefault(),t.onStartEdit(a)):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 Bl(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function r(){return n<o.value.length-1}function a(m){const p=JSON.stringify(m);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(p),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 r()?(n++,JSON.parse(o.value[n])):null}function c(){o.value=[],n=-1}return{canUndo:i,canRedo:r,record:a,undo:s,redo:u,reset:c}}const zl=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}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let y=n.x+2,w=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),b=180,x=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+b>k.right&&(y=Math.max(k.left+4,n.x-b-2)),w+x>k.bottom&&(w=Math.max(k.top+4,n.y-x-2)),y<k.left+2&&(y=k.left+2),w<k.top+2&&(w=k.top+2)}return{left:y,top:w}}),a=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote);function c(y){const w=y.target;w&&w.closest(".zm-node-menu")||i("close")}function m(y){y.key==="Escape"&&i("close")}function p(){i("close")}window.addEventListener("mousedown",c,!0),window.addEventListener("keydown",m,!0),window.addEventListener("wheel",p,!0),window.addEventListener("scroll",p,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",c,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener("wheel",p,!0),window.removeEventListener("scroll",p,!0)});function g(y){y(),i("close")}return(y,w)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:w[10]||(w[10]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[0]||(w[0]=e.withModifiers(k=>g(()=>i("pickImage")),["stop"]))},[e.createVNode(xe,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(a.value?"替换图片":"添加图片"),1)]),a.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:w[1]||(w[1]=e.withModifiers(k=>g(()=>i("removeImage")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[11]||(w[11]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[2]||(w[2]=e.withModifiers(k=>g(()=>i("setLink")),["stop"]))},[e.createVNode(xe,{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:w[3]||(w[3]=e.withModifiers(k=>g(()=>i("removeLink")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[12]||(w[12]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[4]||(w[4]=e.withModifiers(k=>g(()=>i("addCode")),["stop"]))},[w[13]||(w[13]=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:w[5]||(w[5]=e.withModifiers(k=>g(()=>i("removeCode")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[14]||(w[14]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[6]||(w[6]=e.withModifiers(k=>g(()=>i("addTable")),["stop"]))},[w[15]||(w[15]=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:w[7]||(w[7]=e.withModifiers(k=>g(()=>i("removeTable")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[16]||(w[16]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[8]||(w[8]=e.withModifiers(k=>g(()=>i("editNote")),["stop"]))},[e.createVNode(xe,{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:w[9]||(w[9]=e.withModifiers(k=>g(()=>i("removeNote")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[17]||(w[17]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0)],36))}}),Ol=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let _=n.x+2,x=n.y+2;if(n.container){const M=n.container.getBoundingClientRect(),S=160,A=4+3*28;_+S>M.right&&(_=Math.max(M.left+4,n.x-S-2)),x+A>M.bottom&&(x=Math.max(M.top+4,n.y-A-2)),_<M.left+2&&(_=M.left+2),x<M.top+2&&(x=M.top+2)}return{left:_,top:x}}),a=e.ref(!1),s=e.ref(null),u=e.computed(()=>{if(!s.value)return{left:"-9999px",top:"-9999px",display:"none"};const _=s.value.getBoundingClientRect(),x=window.innerWidth,M=window.innerHeight,S=176,A=4+3*28;let C=_.right;C+S>x-4&&(C=Math.max(4,_.left-S));let h=_.top-4;return h+A>M-4&&(h=Math.max(4,M-A-4)),{left:C+"px",top:h+"px",display:"block"}});let c=null,m=null;function p(){m&&(clearTimeout(m),m=null),c=setTimeout(()=>{a.value=!0},60)}function g(){c&&(clearTimeout(c),c=null),m=setTimeout(()=>{a.value=!1},120)}e.onBeforeUnmount(()=>{c&&clearTimeout(c),m&&clearTimeout(m)});function y(_){const x=_.target;x&&x.closest(".zm-canvas-menu")||i("close")}function w(_){_.key==="Escape"&&i("close")}function k(){i("close")}window.addEventListener("mousedown",y,!0),window.addEventListener("keydown",w,!0),window.addEventListener("wheel",k,!0),window.addEventListener("scroll",k,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",y,!0),window.removeEventListener("keydown",w,!0),window.removeEventListener("wheel",k,!0),window.removeEventListener("scroll",k,!0)});function b(_){_(),i("close")}return(_,x)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:x[5]||(x[5]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[0]||(x[0]=e.withModifiers(M=>b(()=>i("openData")),["stop"]))},[e.createVNode(xe,{name:"data",size:13}),x[6]||(x[6]=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":a.value}]),onMouseenter:p,onMouseleave:g},[e.createVNode(xe,{name:"import",size:13}),x[10]||(x[10]=e.createElementVNode("span",null,"导入",-1)),x[11]||(x[11]=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)),a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(u.value),onMouseenter:p,onMouseleave:g},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(M=>b(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(xe,{name:"markdown",size:13}),x[7]||(x[7]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[2]||(x[2]=e.withModifiers(M=>b(()=>i("openImport","json")),["stop"]))},[e.createVNode(xe,{name:"data",size:13}),x[8]||(x[8]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[3]||(x[3]=e.withModifiers(M=>b(()=>i("openImport","txt")),["stop"]))},[e.createVNode(xe,{name:"note",size:13}),x[9]||(x[9]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[4]||(x[4]=e.withModifiers(M=>b(()=>i("openSettings")),["stop"]))},[e.createVNode(xe,{name:"settings",size:13}),x[12]||(x[12]=e.createElementVNode("span",null,"设置",-1))])],36))}});function Il(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function hi(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)&&hi(n)}),t}class bi{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ki(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function At(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const vl="</span>",yi=t=>!!t.scope,Ll=(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,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${o}${t}`};class Dl{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=ki(o)}openNode(o){if(!yi(o))return;const n=Ll(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){yi(o)&&(this.buffer+=vl)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ei=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class ho{constructor(){this.rootNode=Ei(),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=Ei({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=>{ho._collapse(n)}))}}class Vl extends ho{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 Dl(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function hn(t){return t?typeof t=="string"?t:t.source:null}function xi(t){return Ot("(?=",t,")")}function $l(t){return Ot("(?:",t,")*")}function Pl(t){return Ot("(?:",t,")?")}function Ot(...t){return t.map(n=>hn(n)).join("")}function Fl(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function bo(...t){return"("+(Fl(t).capture?"":"?:")+t.map(i=>hn(i)).join("|")+")"}function wi(t){return new RegExp(t.toString()+"|").exec("").length-1}function Ul(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Hl=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ko(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const r=n;let a=hn(i),s="";for(;a.length>0;){const u=Hl.exec(a);if(!u){s+=a;break}s+=a.substring(0,u.index),a=a.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?s+="\\"+String(Number(u[1])+r):(s+=u[0],u[0]==="("&&n++)}return s}).map(i=>`(${i})`).join(o)}const Wl=/\b\B/,Ni="[a-zA-Z]\\w*",yo="[a-zA-Z_]\\w*",Si="\\b\\d+(\\.\\d+)?",Ti="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ci="\\b(0b[01]+)",Gl="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",jl=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Ot(o,/.*\b/,t.binary,/\b.*/)),At({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},bn={begin:"\\\\[\\s\\S]",relevance:0},Kl={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[bn]},ql={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[bn]},Yl={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/},Vn=function(t,o,n={}){const i=At({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 r=bo("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:Ot(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},Zl=Vn("//","$"),Xl=Vn("/\\*","\\*/"),Jl=Vn("#","$"),Ql={scope:"number",begin:Si,relevance:0},ea={scope:"number",begin:Ti,relevance:0},ta={scope:"number",begin:Ci,relevance:0},na={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[bn,{begin:/\[/,end:/\]/,relevance:0,contains:[bn]}]},oa={scope:"title",begin:Ni,relevance:0},ia={scope:"title",begin:yo,relevance:0},ra={begin:"\\.\\s*"+yo,relevance:0};var $n=Object.freeze({__proto__:null,APOS_STRING_MODE:Kl,BACKSLASH_ESCAPE:bn,BINARY_NUMBER_MODE:ta,BINARY_NUMBER_RE:Ci,COMMENT:Vn,C_BLOCK_COMMENT_MODE:Xl,C_LINE_COMMENT_MODE:Zl,C_NUMBER_MODE:ea,C_NUMBER_RE:Ti,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:Jl,IDENT_RE:Ni,MATCH_NOTHING_RE:Wl,METHOD_GUARD:ra,NUMBER_MODE:Ql,NUMBER_RE:Si,PHRASAL_WORDS_MODE:Yl,QUOTE_STRING_MODE:ql,REGEXP_MODE:na,RE_STARTERS_RE:Gl,SHEBANG:jl,TITLE_MODE:oa,UNDERSCORE_IDENT_RE:yo,UNDERSCORE_TITLE_MODE:ia});function la(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function aa(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function sa(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=la,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function ca(t,o){Array.isArray(t.illegal)&&(t.illegal=bo(...t.illegal))}function da(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 ua(t,o){t.relevance===void 0&&(t.relevance=1)}const ma=(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=Ot(n.beforeMatch,xi(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},fa=["of","and","for","in","not","or","if","then","parent","list","value"],pa="keyword";function _i(t,o,n=pa){const i=Object.create(null);return typeof t=="string"?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(a){Object.assign(i,_i(t[a],o,a))}),i;function r(a,s){o&&(s=s.map(u=>u.toLowerCase())),s.forEach(function(u){const c=u.split("|");i[c[0]]=[a,ga(c[0],c[1])]})}}function ga(t,o){return o?Number(o):ha(t)?0:1}function ha(t){return fa.includes(t.toLowerCase())}const Ai={},It=t=>{console.error(t)},Mi=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Gt=(t,o)=>{Ai[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Ai[`${t}/${o}`]=!0)},Pn=new Error;function Ri(t,o,{key:n}){let i=0;const r=t[n],a={},s={};for(let u=1;u<=o.length;u++)s[u+i]=r[u],a[u+i]=!0,i+=wi(o[u-1]);t[n]=s,t[n]._emit=a,t[n]._multi=!0}function ba(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw It("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Pn;if(typeof t.beginScope!="object"||t.beginScope===null)throw It("beginScope must be object"),Pn;Ri(t,t.begin,{key:"beginScope"}),t.begin=ko(t.begin,{joinWith:""})}}function ka(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw It("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Pn;if(typeof t.endScope!="object"||t.endScope===null)throw It("endScope must be object"),Pn;Ri(t,t.end,{key:"endScope"}),t.end=ko(t.end,{joinWith:""})}}function ya(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Ea(t){ya(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),ba(t),ka(t)}function xa(t){function o(s,u){return new RegExp(hn(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,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,u]),this.matchAt+=wi(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(c=>c[1]);this.matcherRe=o(ko(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(u);if(!c)return null;const m=c.findIndex((g,y)=>y>0&&g!==void 0),p=this.matchIndexes[m];return c.splice(0,m),Object.assign(c,p)}}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 c=new n;return this.rules.slice(u).forEach(([m,p])=>c.addRule(m,p)),c.compile(),this.multiRegexes[u]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,c){this.rules.push([u,c]),c.type==="begin"&&this.count++}exec(u){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let m=c.exec(u);if(this.resumingScanAtSamePosition()&&!(m&&m.index===this.lastIndex)){const p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,m=p.exec(u)}return m&&(this.regexIndex+=m.position+1,this.regexIndex===this.count&&this.considerAll()),m}}function r(s){const u=new i;return s.contains.forEach(c=>u.addRule(c.begin,{rule:c,type:"begin"})),s.terminatorEnd&&u.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&u.addRule(s.illegal,{type:"illegal"}),u}function a(s,u){const c=s;if(s.isCompiled)return c;[aa,da,Ea,ma].forEach(p=>p(s,u)),t.compilerExtensions.forEach(p=>p(s,u)),s.__beforeBegin=null,[sa,ca,ua].forEach(p=>p(s,u)),s.isCompiled=!0;let m=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),m=s.keywords.$pattern,delete s.keywords.$pattern),m=m||/\w+/,s.keywords&&(s.keywords=_i(s.keywords,t.case_insensitive)),c.keywordPatternRe=o(m,!0),u&&(s.begin||(s.begin=/\B|\b/),c.beginRe=o(c.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(c.endRe=o(c.end)),c.terminatorEnd=hn(c.end)||"",s.endsWithParent&&u.terminatorEnd&&(c.terminatorEnd+=(s.end?"|":"")+u.terminatorEnd)),s.illegal&&(c.illegalRe=o(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(p){return wa(p==="self"?s:p)})),s.contains.forEach(function(p){a(p,c)}),s.starts&&a(s.starts,u),c.matcher=r(c),c}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=At(t.classNameAliases||{}),a(t)}function Bi(t){return t?t.endsWithParent||Bi(t.starts):!1}function wa(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return At(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Bi(t)?At(t,{starts:t.starts?At(t.starts):null}):Object.isFrozen(t)?At(t):t}var Na="11.11.1";class Sa extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Eo=ki,zi=At,Oi=Symbol("nomatch"),Ta=7,Ii=function(t){const o=Object.create(null),n=Object.create(null),i=[];let r=!0;const a="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:Vl};function c(N){return u.noHighlightRe.test(N)}function m(N){let $=N.className+" ";$+=N.parentNode?N.parentNode.className:"";const L=u.languageDetectRe.exec($);if(L){const j=W(L[1]);return j||(Mi(a.replace("{}",L[1])),Mi("Falling back to no-highlight mode for this block.",N)),j?L[1]:"no-highlight"}return $.split(/\s+/).find(j=>c(j)||W(j))}function p(N,$,L){let j="",X="";typeof $=="object"?(j=N,L=$.ignoreIllegals,X=$.language):(Gt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Gt("10.7.0",`Please use highlight(code, options) instead.
14
+ https://github.com/highlightjs/highlight.js/issues/2277`),X=N,j=$),L===void 0&&(L=!0);const ge={code:j,language:X};Y("before:highlight",ge);const Be=ge.result?ge.result:g(ge.language,ge.code,L);return Be.code=ge.code,Y("after:highlight",Be),Be}function g(N,$,L,j){const X=Object.create(null);function ge(U,Z){return U.keywords[Z]}function Be(){if(!ee.keywords){Me.addText(ye);return}let U=0;ee.keywordPatternRe.lastIndex=0;let Z=ee.keywordPatternRe.exec(ye),se="";for(;Z;){se+=ye.substring(U,Z.index);const he=Ge.case_insensitive?Z[0].toLowerCase():Z[0],Re=ge(ee,he);if(Re){const[He,et]=Re;if(Me.addText(se),se="",X[he]=(X[he]||0)+1,X[he]<=Ta&&(kt+=et),He.startsWith("_"))se+=Z[0];else{const Pt=Ge.classNameAliases[He]||He;v(Z[0],Pt)}}else se+=Z[0];U=ee.keywordPatternRe.lastIndex,Z=ee.keywordPatternRe.exec(ye)}se+=ye.substring(U),Me.addText(se)}function Ue(){if(ye==="")return;let U=null;if(typeof ee.subLanguage=="string"){if(!o[ee.subLanguage]){Me.addText(ye);return}U=g(ee.subLanguage,ye,!0,mt[ee.subLanguage]),mt[ee.subLanguage]=U._top}else U=w(ye,ee.subLanguage.length?ee.subLanguage:null);ee.relevance>0&&(kt+=U.relevance),Me.__addSublanguage(U._emitter,U.language)}function Le(){ee.subLanguage!=null?Ue():Be(),ye=""}function v(U,Z){U!==""&&(Me.startScope(Z),Me.addText(U),Me.endScope())}function B(U,Z){let se=1;const he=Z.length-1;for(;se<=he;){if(!U._emit[se]){se++;continue}const Re=Ge.classNameAliases[U[se]]||U[se],He=Z[se];Re?v(He,Re):(ye=He,Be(),ye=""),se++}}function ie(U,Z){return U.scope&&typeof U.scope=="string"&&Me.openNode(Ge.classNameAliases[U.scope]||U.scope),U.beginScope&&(U.beginScope._wrap?(v(ye,Ge.classNameAliases[U.beginScope._wrap]||U.beginScope._wrap),ye=""):U.beginScope._multi&&(B(U.beginScope,Z),ye="")),ee=Object.create(U,{parent:{value:ee}}),ee}function ae(U,Z,se){let he=Ul(U.endRe,se);if(he){if(U["on:end"]){const Re=new bi(U);U["on:end"](Z,Re),Re.isMatchIgnored&&(he=!1)}if(he){for(;U.endsParent&&U.parent;)U=U.parent;return U}}if(U.endsWithParent)return ae(U.parent,Z,se)}function D(U){return ee.matcher.regexIndex===0?(ye+=U[0],1):(yt=!0,0)}function T(U){const Z=U[0],se=U.rule,he=new bi(se),Re=[se.__beforeBegin,se["on:begin"]];for(const He of Re)if(He&&(He(U,he),he.isMatchIgnored))return D(Z);return se.skip?ye+=Z:(se.excludeBegin&&(ye+=Z),Le(),!se.returnBegin&&!se.excludeBegin&&(ye=Z)),ie(se,U),se.returnBegin?0:Z.length}function ue(U){const Z=U[0],se=$.substring(U.index),he=ae(ee,U,se);if(!he)return Oi;const Re=ee;ee.endScope&&ee.endScope._wrap?(Le(),v(Z,ee.endScope._wrap)):ee.endScope&&ee.endScope._multi?(Le(),B(ee.endScope,U)):Re.skip?ye+=Z:(Re.returnEnd||Re.excludeEnd||(ye+=Z),Le(),Re.excludeEnd&&(ye=Z));do ee.scope&&Me.closeNode(),!ee.skip&&!ee.subLanguage&&(kt+=ee.relevance),ee=ee.parent;while(ee!==he.parent);return he.starts&&ie(he.starts,U),Re.returnEnd?0:Z.length}function me(){const U=[];for(let Z=ee;Z!==Ge;Z=Z.parent)Z.scope&&U.unshift(Z.scope);U.forEach(Z=>Me.openNode(Z))}let De={};function Ze(U,Z){const se=Z&&Z[0];if(ye+=U,se==null)return Le(),0;if(De.type==="begin"&&Z.type==="end"&&De.index===Z.index&&se===""){if(ye+=$.slice(Z.index,Z.index+1),!r){const he=new Error(`0 width match regex (${N})`);throw he.languageName=N,he.badRule=De.rule,he}return 1}if(De=Z,Z.type==="begin")return T(Z);if(Z.type==="illegal"&&!L){const he=new Error('Illegal lexeme "'+se+'" for mode "'+(ee.scope||"<unnamed>")+'"');throw he.mode=ee,he}else if(Z.type==="end"){const he=ue(Z);if(he!==Oi)return he}if(Z.type==="illegal"&&se==="")return ye+=`
15
+ `,1;if(Qe>1e5&&Qe>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ye+=se,se.length}const Ge=W(N);if(!Ge)throw It(a.replace("{}",N)),new Error('Unknown language: "'+N+'"');const on=xa(Ge);let St="",ee=j||on;const mt={},Me=new u.__emitter(u);me();let ye="",kt=0,je=0,Qe=0,yt=!1;try{if(Ge.__emitTokens)Ge.__emitTokens($,Me);else{for(ee.matcher.considerAll();;){Qe++,yt?yt=!1:ee.matcher.considerAll(),ee.matcher.lastIndex=je;const U=ee.matcher.exec($);if(!U)break;const Z=$.substring(je,U.index),se=Ze(Z,U);je=U.index+se}Ze($.substring(je))}return Me.finalize(),St=Me.toHTML(),{language:N,value:St,relevance:kt,illegal:!1,_emitter:Me,_top:ee}}catch(U){if(U.message&&U.message.includes("Illegal"))return{language:N,value:Eo($),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:je,context:$.slice(je-100,je+100),mode:U.mode,resultSoFar:St},_emitter:Me};if(r)return{language:N,value:Eo($),illegal:!1,relevance:0,errorRaised:U,_emitter:Me,_top:ee};throw U}}function y(N){const $={value:Eo(N),illegal:!1,relevance:0,_top:s,_emitter:new u.__emitter(u)};return $._emitter.addText(N),$}function w(N,$){$=$||u.languages||Object.keys(o);const L=y(N),j=$.filter(W).filter(K).map(Le=>g(Le,N,!1));j.unshift(L);const X=j.sort((Le,v)=>{if(Le.relevance!==v.relevance)return v.relevance-Le.relevance;if(Le.language&&v.language){if(W(Le.language).supersetOf===v.language)return 1;if(W(v.language).supersetOf===Le.language)return-1}return 0}),[ge,Be]=X,Ue=ge;return Ue.secondBest=Be,Ue}function k(N,$,L){const j=$&&n[$]||L;N.classList.add("hljs"),N.classList.add(`language-${j}`)}function b(N){let $=null;const L=m(N);if(c(L))return;if(Y("before:highlightElement",{el:N,language:L}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.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(N)),u.throwUnescapedHTML))throw new Sa("One of your code blocks includes unescaped HTML.",N.innerHTML);$=N;const j=$.textContent,X=L?p(j,{language:L,ignoreIllegals:!0}):w(j);N.innerHTML=X.value,N.dataset.highlighted="yes",k(N,L,X.language),N.result={language:X.language,re:X.relevance,relevance:X.relevance},X.secondBest&&(N.secondBest={language:X.secondBest.language,relevance:X.secondBest.relevance}),Y("after:highlightElement",{el:N,result:X,text:j})}function _(N){u=zi(u,N)}const x=()=>{A(),Gt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function M(){A(),Gt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function A(){function N(){A()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",N,!1),S=!0;return}document.querySelectorAll(u.cssSelector).forEach(b)}function C(N,$){let L=null;try{L=$(t)}catch(j){if(It("Language definition for '{}' could not be registered.".replace("{}",N)),r)It(j);else throw j;L=s}L.name||(L.name=N),o[N]=L,L.rawDefinition=$.bind(null,t),L.aliases&&oe(L.aliases,{languageName:N})}function h(N){delete o[N];for(const $ of Object.keys(n))n[$]===N&&delete n[$]}function O(){return Object.keys(o)}function W(N){return N=(N||"").toLowerCase(),o[N]||o[n[N]]}function oe(N,{languageName:$}){typeof N=="string"&&(N=[N]),N.forEach(L=>{n[L.toLowerCase()]=$})}function K(N){const $=W(N);return $&&!$.disableAutodetect}function te(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=$=>{N["before:highlightBlock"](Object.assign({block:$.el},$))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=$=>{N["after:highlightBlock"](Object.assign({block:$.el},$))})}function le(N){te(N),i.push(N)}function G(N){const $=i.indexOf(N);$!==-1&&i.splice($,1)}function Y(N,$){const L=N;i.forEach(function(j){j[L]&&j[L]($)})}function F(N){return Gt("10.7.0","highlightBlock will be removed entirely in v12.0"),Gt("10.7.0","Please use highlightElement now."),b(N)}Object.assign(t,{highlight:p,highlightAuto:w,highlightAll:A,highlightElement:b,highlightBlock:F,configure:_,initHighlighting:x,initHighlightingOnLoad:M,registerLanguage:C,unregisterLanguage:h,listLanguages:O,getLanguage:W,registerAliases:oe,autoDetection:K,inherit:zi,addPlugin:le,removePlugin:G}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=Na,t.regex={concat:Ot,lookahead:xi,either:bo,optional:Pl,anyNumberOfTimes:$l};for(const N in $n)typeof $n[N]=="object"&&hi($n[N]);return Object.assign(t,$n),t},jt=Ii({});jt.newInstance=()=>Ii({});var Ca=jt;jt.HighlightJS=jt,jt.default=jt;const xo=Il(Ca);function wo(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 r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},a=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,r]};r.contains.push(u);const c={match:/\\"/},m={className:"string",begin:/'/,end:/'/},p={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],w=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),k={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],_=["true","false"],x={match:/(\/[a-z._-]+)+/},M=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["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"],C=["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:b,literal:_,built_in:[...M,...S,"set","shopt",...A,...C]},contains:[w,t.SHEBANG(),k,g,a,s,x,u,c,m,p,n]}}const _a=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_-]*/}}),Aa=["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"],Ma=["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"],Ra=[...Aa,...Ma],Ba=["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(),za=["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(),Oa=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ia=["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 va(t){const o=t.regex,n=_a(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",a=/@-?\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:":("+za.join("|")+")"},{begin:":(:)?("+Oa.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ia.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:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:Ba.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ra.join("|")+")\\b"}]}}function vi(t){const a={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:a,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:a,illegal:/["']/}]}]}}var Kt="[0-9](_*[0-9])*",Fn=`\\.(${Kt})`,Un="[0-9a-fA-F](_*[0-9a-fA-F])*",Li={className:"number",variants:[{begin:`(\\b(${Kt})((${Fn})|\\.)?|(${Fn}))[eE][+-]?(${Kt})[fFdD]?\\b`},{begin:`\\b(${Kt})((${Fn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Fn})[fFdD]?\\b`},{begin:`\\b(${Kt})[fFdD]\\b`},{begin:`\\b0[xX]((${Un})\\.?|(${Un})?\\.(${Un}))[pP][+-]?(${Kt})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Un})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Di(t,o,n){return n===-1?"":t.replace(o,i=>Di(t,o,n-1))}function La(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Di("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={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"]},m={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,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:[p,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:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Li,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Li,m]}}const Vi="[A-Za-z$_][0-9A-Za-z$_]*",Da=["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"],Va=["true","false","null","undefined","NaN","Infinity"],$i=["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"],Pi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Fi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$a=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Pa=[].concat(Fi,$i,Pi);function Ui(t){const o=t.regex,n=(L,{after:j})=>{const X="</"+L[0].slice(1);return L.input.indexOf(X,j)!==-1},i=Vi,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,j)=>{const X=L[0].length+L.index,ge=L.input[X];if(ge==="<"||ge===","){j.ignoreMatch();return}ge===">"&&(n(L,{after:X})||j.ignoreMatch());let Be;const Ue=L.input.substring(X);if(Be=Ue.match(/^\s*=/)){j.ignoreMatch();return}if((Be=Ue.match(/^\s+extends\s+/))&&Be.index===0){j.ignoreMatch();return}}},u={$pattern:Vi,keyword:Da,literal:Va,built_in:Pa,"variable.language":$a},c="[0-9](_?[0-9])*",m=`\\.(${c})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${c})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},M={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]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,{match:/\$\d+/},g];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const A=[].concat(M,y.contains),C=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),h={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:C},O={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"}}]},W={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:{_:[...$i,...Pi]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[h],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(L){return o.concat("(?!",L.join("|"),")")}const G={match:o.concat(/\b/,le([...Fi,"super","import"].map(L=>`${L}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},h]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[h]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,M,{match:/\$\d+/},g,W,{scope:"attr",match:i+o.lookahead(":"),relevance:0},$,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,t.REGEXP_MODE,{className:"function",begin:N,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:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[h,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[h]},G,te,O,F,{match:/\$[(.]/}]}}function Fa(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,r,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Hi(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={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}]},a={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+.-]*/,c={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}]},m={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=t.inherit(m,{contains:[]}),y=t.inherit(p,{contains:[]});m.contains.push(y),p.contains.push(g);let w=[n,c];return[m,p,g,y].forEach(x=>{x.contains=x.contains.concat(w)}),w=w.concat(m,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:w},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:w}]}]},n,a,m,p,{className:"quote",begin:"^>\\s+",contains:w,end:"$"},r,i,c,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Wi(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"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},p={begin:/\{\{/,relevance:0},g={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,c,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,c,p,m]},{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,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,m]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",w=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,k=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${w}))[eE][+-]?(${y})[jJ]?(?=${k})`},{begin:`(${w})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${k})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${k})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${k})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${k})`},{begin:`\\b(${y})[jJ](?=${k})`}]},_={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",c,b,g,t.HASH_COMMENT_MODE]}]};return m.contains=[g,b,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[c,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,_,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{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:[b,x,g]}]}}function Gi(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),r=o.concat(n,t.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,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"],c=["true","false","Some","None","Ok","Err"],m=["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!"],p=["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:p,keyword:u,literal:c,built_in:m},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:m,type:p}},{className:"punctuation",begin:"->"},a]}}function Ua(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["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"],c=["add","asc","collation","desc","final","first","last","view"],m=["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"],p=["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"],g=["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"],y=["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"],w=p,k=[...m,...c].filter(C=>!p.includes(C)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},_={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:o.concat(/\b/,o.either(...w),/\s*\(/),relevance:0,keywords:{built_in:w}};function M(C){return o.concat(/\b/,o.either(...C.map(h=>h.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:M(y),relevance:0};function A(C,{exceptions:h,when:O}={}){const W=O;return h=h||[],C.map(oe=>oe.match(/\|\d+$/)||h.includes(oe)?oe:W(oe)?`${oe}|0`:oe)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(k,{when:C=>C.length<3}),literal:a,type:u,built_in:g},contains:[{scope:"type",match:M(s)},S,x,b,i,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,_]}}const Hn="[A-Za-z$_][0-9A-Za-z$_]*",ji=["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"],Ki=["true","false","null","undefined","NaN","Infinity"],qi=["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"],Yi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Zi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Xi=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ji=[].concat(Zi,qi,Yi);function Ha(t){const o=t.regex,n=(L,{after:j})=>{const X="</"+L[0].slice(1);return L.input.indexOf(X,j)!==-1},i=Hn,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,j)=>{const X=L[0].length+L.index,ge=L.input[X];if(ge==="<"||ge===","){j.ignoreMatch();return}ge===">"&&(n(L,{after:X})||j.ignoreMatch());let Be;const Ue=L.input.substring(X);if(Be=Ue.match(/^\s*=/)){j.ignoreMatch();return}if((Be=Ue.match(/^\s+extends\s+/))&&Be.index===0){j.ignoreMatch();return}}},u={$pattern:Hn,keyword:ji,literal:Ki,built_in:Ji,"variable.language":Xi},c="[0-9](_?[0-9])*",m=`\\.(${c})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${c})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\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},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},M={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]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,{match:/\$\d+/},g];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const A=[].concat(M,y.contains),C=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),h={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:C},O={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"}}]},W={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:{_:[...qi,...Yi]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[h],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(L){return o.concat("(?!",L.join("|"),")")}const G={match:o.concat(/\b/,le([...Zi,"super","import"].map(L=>`${L}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},h]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[h]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,M,{match:/\$\d+/},g,W,{scope:"attr",match:i+o.lookahead(":"),relevance:0},$,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,t.REGEXP_MODE,{className:"function",begin:N,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:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[h,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[h]},G,te,O,F,{match:/\$[(.]/}]}}function Qi(t){const o=t.regex,n=Ha(t),i=Hn,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:Hn,keyword:ji.concat(c),literal:Ki,built_in:Ji.concat(r),"variable.language":Xi},p={className:"meta",begin:"@"+i},g=(b,_,x)=>{const M=b.contains.findIndex(S=>S.label===_);if(M===-1)throw new Error("can not find mode to replace");b.contains.splice(M,1,x)};Object.assign(n.keywords,m),n.exports.PARAMS_CONTAINS.push(p);const y=n.contains.find(b=>b.scope==="attr"),w=Object.assign({},y,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,w]),n.contains=n.contains.concat([p,a,s,w]),g(n,"shebang",t.SHEBANG()),g(n,"use_strict",u);const k=n.contains.find(b=>b.label==="func.def");return k.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function er(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,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(a,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),c=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),m={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:[r]},{begin:/'/,end:/'/,contains:[r]},{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:[a,c,u,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,s,c,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],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:m}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function tr(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]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={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,r]},u=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={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"},w={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},k={begin:/\{/,end:/\}/,contains:[w],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[w],illegal:"\\n",relevance:0},_=[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}},y,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},k,b,a,s],x=[..._];return x.pop(),x.push(u),w.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:_}}const No={bash:wo,sh:wo,shell:wo,css:va,go:vi,golang:vi,java:La,javascript:Ui,js:Ui,json:Fa,markdown:Hi,md:Hi,python:Wi,py:Wi,rust:Gi,rs:Gi,sql:Ua,typescript:Qi,ts:Qi,xml:er,html:er,yaml:tr,yml:tr};for(const[t,o]of Object.entries(No))xo.registerLanguage(t,o);function So(t){const o=t.split(`
16
16
  `);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
17
17
  `).replace(/\n+$/,"")}function qt(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
18
- `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&No[n]?n:""}function To(t,o){const n=o&&No[o]?o:"";try{return n?xo.highlight(t,{language:n,ignoreIllegals:!0}).value:xo.highlightAuto(t).value}catch{return Pa(t)}}function Ji(t){return t.split(`
19
- `).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 Pa(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Qi(t,o,n){if(t.length<=1)return t.slice();const[i,...r]=t,a=r.map(m=>m[o]??""),c=a.length>0&&a.every(m=>m.trim()!==""&&!Number.isNaN(Number(m))),u=n==="asc"?1:-1,s=r.slice().sort((m,p)=>{const g=m[o]??"",y=p[o]??"";return c?(Number(g)-Number(y))*u:g.localeCompare(y,"zh-Hans-CN",{numeric:!0})*u});return[i,...s]}const Ua=["viewBox","width","height"],Fa={class:"zm-edges"},Ha=["d","fill"],Wa=["data-node-id","onClick","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Ga=["src","width","height","alt"],ja=["onDblclick"],Ka={key:0,class:"zm-rich-code"},qa=["innerHTML"],Ya={key:1,class:"zm-rich-table"},Za=["onClick"],Xa={class:"zm-rich-sort-mark","aria-hidden":"true"},Ja={key:2,class:"zm-text"},Qa={class:"zm-text-label"},es=["href","title"],ts=["title","onClick"],ns=["title"],os=["title","onClick"],is=["onClick"],rs=["onMousedown"],ls=["onClick"],as=["title"],ss={class:"zm-tb-tip zm-tb-zoom"},cs=["src"],ds=["src"],vt=24,Yt=400,Rt=160,Hn=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1}},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,r=n,a=e.ref(null),c=e.ref(null),u=e.ref(""),s=e.ref(null),m=e.ref(new Set),p=e.ref(!1),g=e.ref(null),y=e.ref(null),w=e.ref(""),k=e.ref(new Map),b=e.ref(pt(i.data)),_=e.ref({}),x=e.ref({}),R=e.ref(i.markdown!==void 0);let S=!1;e.watch(()=>i.markdown,l=>{if(l===void 0){R.value=!1;return}R.value=!0;const d=Ht(l||"");S=!0,b.value=pt(d),s.value=null,m.value=new Set,xe(),e.nextTick(()=>{S=!1,Ct()})}),e.watch(b,()=>{R.value&&!S&&r("markdownChange",Wt(b.value))},{deep:!0});const A=e.computed(()=>Q.showOrderBadge===!0),C=e.ref(new Map),h=C.value;function O(l,d){const E={};d.bg&&(E.bg=d.bg),d.textColor&&(E.textColor=d.textColor),d.borderColor&&(E.borderColor=d.borderColor),d.fontWeight&&(E.fontWeight=d.fontWeight),Object.keys(E).length===0?h.delete(l):h.set(l,E),C.value=new Map(h)}function W(l){return h.get(l)??{}}function oe(l,d){const E=pe(b.value,l);E&&(E.image={src:d.src,naturalW:d.naturalW,naturalH:d.naturalH,width:le(d.width,vt,Yt),height:le(d.height,vt,Yt)},Ve(),xe(),r("change",b.value))}function K(l){const d=pe(b.value,l);!d||!d.image||(delete d.image,Ve(),xe(),r("change",b.value))}function te(l,d){const E=d.trim();if(!pe(b.value,l))return;if(!E){K(l);return}const I=new Image;I.onload=()=>{const P=pe(b.value,l);if(!P)return;const q=I.naturalWidth&&I.naturalHeight?I.naturalWidth/I.naturalHeight:1,re=le(I.naturalWidth||Rt,vt,Yt),Ne=Math.round(re/q);P.image={src:E,naturalW:I.naturalWidth||re,naturalH:I.naturalHeight||Ne,width:re,height:Ne},Ve(),xe(),r("change",b.value)},I.onerror=()=>{},I.src=E}function le(l,d,E){return Math.min(E,Math.max(d,l))}function G(l,d){const E=new FileReader;E.onload=()=>{if(typeof E.result!="string")return;const V=E.result,I=new window.Image;I.onload=()=>{const P=I.naturalWidth||Rt,q=I.naturalHeight||Rt,re=le(P,vt,Rt),Ne=le(Math.round(q*re/P),vt,Yt);d({src:V,naturalW:P,naturalH:q,width:re,height:Ne})},I.onerror=()=>{d({src:V,naturalW:Rt,naturalH:Rt,width:Rt,height:Rt})},I.src=V},E.readAsDataURL(l)}function Y(l){const d=document.createElement("input");d.type="file",d.accept="image/*",d.style.display="none",d.onchange=()=>{var V;const E=(V=d.files)==null?void 0:V[0];E&&(G(E,I=>oe(l,I)),document.body.removeChild(d))},document.body.appendChild(d),d.click()}function U(l,d){const E=d.trim(),V=pe(b.value,l);V&&(E?V.link={url:E}:delete V.link,Ve(),xe(),r("change",b.value))}function N(l){U(l,"")}function $(l,d){const E=pe(b.value,l);E&&(d?E.note={text:d}:delete E.note,Ve(),xe(),r("change",b.value))}function L(l){$(l,"")}function j(l,d){const E=pe(b.value,l);E&&(d?E.richContent=d:delete E.richContent,Ve(),xe(),r("change",b.value))}const X=e.ref(null),ge=e.ref(null),Be=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||p.value)?"is-visible":""].filter(Boolean).join(" ")),Fe=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||p.value)?"is-visible":""].filter(Boolean).join(" "));function Le(l,d){i.previewMode||(l.preventDefault(),l.stopPropagation(),ge.value=null,s.value=d.id,r("select",pe(b.value,d.id)),X.value={nodeId:d.id,x:l.clientX,y:l.clientY})}function v(){X.value=null}function B(l){const d=l.target;d!=null&&d.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline")||(l.preventDefault(),X.value&&(X.value=null),ge.value={x:l.clientX,y:l.clientY})}function ie(){ge.value=null}function ae(){ie(),r("canvas-settings")}function D(){ie(),r("canvas-data")}function T(l){ie(),r("canvas-import",l)}function ue(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&Y(l)}function me(){var V,I,P;const l=(V=X.value)==null?void 0:V.nodeId;if(!l)return;const d=((P=(I=pe(b.value,l))==null?void 0:I.link)==null?void 0:P.url)??"",E=window.prompt("输入链接 URL(留空取消)",d);E!==null&&U(l,E)}function De(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&N(l)}function Ze(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&ye(l)}function Ge(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&L(l)}function nn(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&K(l)}function St(){var fe,it;const l=(fe=X.value)==null?void 0:fe.nodeId;if(!l)return;const d=(it=pe(b.value,l))==null?void 0:it.richContent,E=(d==null?void 0:d.kind)==="code"?So(d.raw):"",V=(d==null?void 0:d.kind)==="code"&&d.lang||"",I=V?"```"+V+`
20
- `:"```\n",q=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",E?I+E+(E.endsWith("```")?"":"\n```"):I+"// 你的代码"+"\n```");if(q===null)return;const re=q.trim();if(!re){j(l,null);return}const Ne=/^```([^\s`]*)/.exec(re),M=Ne?Ne[1]:void 0;j(l,{kind:"code",raw:re,lang:M})}function ee(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&j(l,null)}function mt(){var q,re;const l=(q=X.value)==null?void 0:q.nodeId;if(!l)return;const d=(re=pe(b.value,l))==null?void 0:re.richContent,E=(d==null?void 0:d.kind)==="table"?d.raw:"",I=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",E||`| 列1 | 列2 | 列3 |
18
+ `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&No[n]?n:""}function To(t,o){const n=o&&No[o]?o:"";try{return n?xo.highlight(t,{language:n,ignoreIllegals:!0}).value:xo.highlightAuto(t).value}catch{return Wa(t)}}function nr(t){return t.split(`
19
+ `).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 Wa(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function or(t,o,n){if(t.length<=1)return t.slice();const[i,...r]=t,a=r.map(m=>m[o]??""),s=a.length>0&&a.every(m=>m.trim()!==""&&!Number.isNaN(Number(m))),u=n==="asc"?1:-1,c=r.slice().sort((m,p)=>{const g=m[o]??"",y=p[o]??"";return s?(Number(g)-Number(y))*u:g.localeCompare(y,"zh-Hans-CN",{numeric:!0})*u});return[i,...c]}const Ga=["viewBox","width","height"],ja={class:"zm-edges"},Ka=["d","fill"],qa=["data-node-id","onClick","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Ya=["src","width","height","alt"],Za=["onDblclick"],Xa={key:0,class:"zm-rich-code"},Ja=["innerHTML"],Qa={key:1,class:"zm-rich-table"},es=["onClick"],ts={class:"zm-rich-sort-mark","aria-hidden":"true"},ns={key:2,class:"zm-text"},os={class:"zm-text-label"},is=["href","title"],rs=["title","onClick"],ls=["title"],as=["title","onClick"],ss=["onClick"],cs=["onMousedown"],ds=["onClick"],us=["title"],ms={class:"zm-tb-tip zm-tb-zoom"},fs=["src"],ps=["src"],vt=24,Yt=400,Mt=160,Wn=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1}},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,r=n,a=e.ref(null),s=e.ref(null),u=e.ref(""),c=e.ref(null),m=e.ref(new Set),p=e.ref(!1),g=e.ref(null),y=e.ref(null),w=e.ref(""),k=e.ref(new Map),b=e.ref(pt(i.data)),_=e.ref({}),x=e.ref({}),M=e.ref(i.markdown!==void 0);let S=!1;e.watch(()=>i.markdown,l=>{if(l===void 0){M.value=!1;return}M.value=!0;const d=Ht(l||"");S=!0,b.value=pt(d),c.value=null,m.value=new Set,we(),e.nextTick(()=>{S=!1,Ct()})}),e.watch(b,()=>{M.value&&!S&&r("markdownChange",Wt(b.value))},{deep:!0});const A=e.computed(()=>Q.showOrderBadge===!0),C=e.ref(new Map),h=C.value;function O(l,d){const E={};d.bg&&(E.bg=d.bg),d.textColor&&(E.textColor=d.textColor),d.borderColor&&(E.borderColor=d.borderColor),d.fontWeight&&(E.fontWeight=d.fontWeight),Object.keys(E).length===0?h.delete(l):h.set(l,E),C.value=new Map(h)}function W(l){return h.get(l)??{}}function oe(l,d){const E=pe(b.value,l);E&&(E.image={src:d.src,naturalW:d.naturalW,naturalH:d.naturalH,width:le(d.width,vt,Yt),height:le(d.height,vt,Yt)},Ve(),we(),r("change",b.value))}function K(l){const d=pe(b.value,l);!d||!d.image||(delete d.image,Ve(),we(),r("change",b.value))}function te(l,d){const E=d.trim();if(!pe(b.value,l))return;if(!E){K(l);return}const I=new Image;I.onload=()=>{const P=pe(b.value,l);if(!P)return;const q=I.naturalWidth&&I.naturalHeight?I.naturalWidth/I.naturalHeight:1,re=le(I.naturalWidth||Mt,vt,Yt),Se=Math.round(re/q);P.image={src:E,naturalW:I.naturalWidth||re,naturalH:I.naturalHeight||Se,width:re,height:Se},Ve(),we(),r("change",b.value)},I.onerror=()=>{},I.src=E}function le(l,d,E){return Math.min(E,Math.max(d,l))}function G(l,d){const E=new FileReader;E.onload=()=>{if(typeof E.result!="string")return;const V=E.result,I=new window.Image;I.onload=()=>{const P=I.naturalWidth||Mt,q=I.naturalHeight||Mt,re=le(P,vt,Mt),Se=le(Math.round(q*re/P),vt,Yt);d({src:V,naturalW:P,naturalH:q,width:re,height:Se})},I.onerror=()=>{d({src:V,naturalW:Mt,naturalH:Mt,width:Mt,height:Mt})},I.src=V},E.readAsDataURL(l)}function Y(l){const d=document.createElement("input");d.type="file",d.accept="image/*",d.style.display="none",d.onchange=()=>{var V;const E=(V=d.files)==null?void 0:V[0];E&&(G(E,I=>oe(l,I)),document.body.removeChild(d))},document.body.appendChild(d),d.click()}function F(l,d){const E=d.trim(),V=pe(b.value,l);V&&(E?V.link={url:E}:delete V.link,Ve(),we(),r("change",b.value))}function N(l){F(l,"")}function $(l,d){const E=pe(b.value,l);E&&(d?E.note={text:d}:delete E.note,Ve(),we(),r("change",b.value))}function L(l){$(l,"")}function j(l,d){const E=pe(b.value,l);E&&(d?E.richContent=d:delete E.richContent,Ve(),we(),r("change",b.value))}const X=e.ref(null),ge=e.ref(null),Be=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||p.value)?"is-visible":""].filter(Boolean).join(" ")),Ue=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||p.value)?"is-visible":""].filter(Boolean).join(" "));function Le(l,d){i.previewMode||(l.preventDefault(),l.stopPropagation(),ge.value=null,c.value=d.id,r("select",pe(b.value,d.id)),X.value={nodeId:d.id,x:l.clientX,y:l.clientY})}function v(){X.value=null}function B(l){const d=l.target;d!=null&&d.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline")||(l.preventDefault(),X.value&&(X.value=null),ge.value={x:l.clientX,y:l.clientY})}function ie(){ge.value=null}function ae(){ie(),r("canvas-settings")}function D(){ie(),r("canvas-data")}function T(l){ie(),r("canvas-import",l)}function ue(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&Y(l)}function me(){var V,I,P;const l=(V=X.value)==null?void 0:V.nodeId;if(!l)return;const d=((P=(I=pe(b.value,l))==null?void 0:I.link)==null?void 0:P.url)??"",E=window.prompt("输入链接 URL(留空取消)",d);E!==null&&F(l,E)}function De(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&N(l)}function Ze(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&ye(l)}function Ge(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&L(l)}function on(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&K(l)}function St(){var fe,it;const l=(fe=X.value)==null?void 0:fe.nodeId;if(!l)return;const d=(it=pe(b.value,l))==null?void 0:it.richContent,E=(d==null?void 0:d.kind)==="code"?So(d.raw):"",V=(d==null?void 0:d.kind)==="code"&&d.lang||"",I=V?"```"+V+`
20
+ `:"```\n",q=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",E?I+E+(E.endsWith("```")?"":"\n```"):I+"// 你的代码"+"\n```");if(q===null)return;const re=q.trim();if(!re){j(l,null);return}const Se=/^```([^\s`]*)/.exec(re),R=Se?Se[1]:void 0;j(l,{kind:"code",raw:re,lang:R})}function ee(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&j(l,null)}function mt(){var q,re;const l=(q=X.value)==null?void 0:q.nodeId;if(!l)return;const d=(re=pe(b.value,l))==null?void 0:re.richContent,E=(d==null?void 0:d.kind)==="table"?d.raw:"",I=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",E||`| 列1 | 列2 | 列3 |
21
21
  | --- | --- | --- |
22
- | a | b | c |`);if(I===null)return;const P=I.trim();if(!P){j(l,null);return}j(l,{kind:"table",raw:P})}function Re(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&j(l,null)}function ye(l){i.previewMode||r("edit-note",l)}function kt(l,d=60){const E=l.replace(/\s+/g," ").trim();return E.length<=d?E||"点击编辑笔记":E.slice(0,d)+"…"}function je(l){var I;if(i.previewMode||c.value)return;const d=l.target;if(d&&(d.tagName==="INPUT"||d.tagName==="TEXTAREA"||d.isContentEditable))return;const E=s.value;if(!E)return;const V=(I=l.clipboardData)==null?void 0:I.items;if(V)for(let P=0;P<V.length;P++){const q=V[P];if(q.kind==="file"&&q.type.startsWith("image/")){const re=q.getAsFile();if(!re)continue;l.preventDefault();const Ne=pe(b.value,E);if(Ne!=null&&Ne.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;G(re,M=>oe(E,M));return}}}e.onMounted(()=>{window.addEventListener("paste",je),xe()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",je)});const Qe=e.ref(null),yt=e.computed(()=>{var l;return((l=Qe.value)==null?void 0:l.nodeId)??null});function F(l,d){if(!d.image)return;l.preventDefault(),l.stopPropagation();const E=d.image.naturalW||d.image.width,V=d.image.naturalH||d.image.height,I=V>0?V/E:1;Qe.value={nodeId:d.id,startX:l.clientX,startY:l.clientY,startW:d.image.width,startH:d.image.height,naturalW:E,naturalH:V,ratio:I,pendingW:d.image.width,pendingH:d.image.height},window.addEventListener("mousemove",Z),window.addEventListener("mouseup",se)}function Z(l){var Ne,M;const d=Qe.value;if(!d)return;const E=ne.scale.value||1,V=l.clientX-d.startX,I=le(d.startW+V/E,vt,Yt),P=le(I*d.ratio,vt,Yt);d.pendingW=I,d.pendingH=P;const q=(Ne=a.value)==null?void 0:Ne.querySelector(`[data-node-id="${d.nodeId}"] .zm-node-img`);q&&(q.style.width=`${I}px`,q.style.height=`${P}px`);const re=(M=a.value)==null?void 0:M.querySelector(`[data-node-id="${d.nodeId}"]`);re&&(re.style.minWidth=`${Math.max(80,Math.ceil(I+28))}px`,re.style.height=`${Math.ceil(P+8+30)}px`)}function se(){const l=Qe.value;if(window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",se),Qe.value=null,!l)return;const d=pe(b.value,l.nodeId);!d||!d.image||(oe(l.nodeId,{src:d.image.src,naturalW:d.image.naturalW,naturalH:d.image.naturalH,width:l.pendingW,height:l.pendingH}),s.value=l.nodeId,r("select",d),Me=!0)}const he=e.ref(null);let Me=!1;function He(l){he.value=l}function et(l){he.value===l&&(he.value=null),g.value&&(g.value=null)}function Pt(l,d){var Ke;if(!d.text||d.text.length<14)return;const V=l.currentTarget.getBoundingClientRect(),I=(Ke=a.value)==null?void 0:Ke.getBoundingClientRect();if(!I)return;const P=10,q=240,re=V.top-I.top>60,Ne=V.left-I.left+V.width/2,M=P+q/2,fe=I.width-q/2-P,it=Math.max(M,Math.min(Ne,fe)),st=re?V.top-I.top-8:V.bottom-I.top+8;g.value={text:d.text,x:it,y:st,above:re}}const on=e.ref(0),rn=e.ref(!1),at=_l(100);function Ve(){at.record({data:b.value})}function xe(){m.value=new Set(m.value),on.value++,e.nextTick().then(()=>e.nextTick()).then(()=>ln()).then(()=>{on.value++})}function ln(){const l=document.querySelectorAll(".zm-rich"),d={},E={};l.forEach(V=>{let I=V,P=null;for(;I&&!P;)P=I.getAttribute("data-node-id"),I=I.parentElement;if(!P)return;const q=V.offsetHeight,re=V.scrollWidth,Ne=Math.round(q*2)/2,M=Math.round(re*2)/2;d[P]=Ne,E[P]=M,_.value[P],x.value[P]}),_.value=d,x.value=E}const Ie=e.computed(()=>{var l,d,E,V,I,P,q,re,Ne,M;return{rootBg:((l=i.theme)==null?void 0:l.rootBg)??"#1f2937",rootText:((d=i.theme)==null?void 0:d.rootText)??"#ffffff",branchBg:((E=i.theme)==null?void 0:E.branchBg)??"#ffffff",branchText:((V=i.theme)==null?void 0:V.branchText)??"#1f2937",lineColor:((I=i.theme)==null?void 0:I.lineColor)??"#94a3b8",bgColor:((P=i.theme)==null?void 0:P.bgColor)??"#f8fafc",fontSize:((q=i.theme)==null?void 0:q.fontSize)??14,lineWidthStart:((re=i.theme)==null?void 0:re.lineWidthStart)??2.2,lineWidthEnd:((Ne=i.theme)==null?void 0:Ne.lineWidthEnd)??.8,rainbowBranch:((M=i.theme)==null?void 0:M.rainbowBranch)??!1}}),Q=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function an(l){return Q.taperedEdge?Go(l):cn(l)}function sn(l){return Q.taperedEdge?Q.lineWidthEnd:cn(l)}function Go(l){return l<=0?Q.lineWidthStart:l===1?Math.max(1.5,Q.lineWidthStart*.67):l===2?Math.max(.8,Q.lineWidthStart*.42):Q.lineWidthEnd}function cn(l){if(l<=0)return Q.lineWidthStart;if(l>=3)return Q.lineWidthEnd;const d=l/3;return Q.lineWidthStart+(Q.lineWidthEnd-Q.lineWidthStart)*d}function Nn(l,d,E,V){const I=1-l,P=I*I*I*d.x+3*I*I*l*E.x1+3*I*l*l*E.x2+l*l*l*V.x,q=I*I*I*d.y+3*I*I*l*E.y1+3*I*l*l*E.y2+l*l*l*V.y;return{x:P,y:q}}function jo(l,d,E,V,I=32,P="curve",q="right"){if(P==="curve"){let wt;if(q==="right"||q==="left"){const ve=Math.abs(d.x-l.x)*.45,_t=q==="right"?1:-1;wt={x1:l.x+_t*ve,y1:l.y,x2:d.x-_t*ve,y2:d.y}}else{const ve=Math.abs(d.y-l.y)*.45;wt={x1:l.x,y1:l.y+ve,x2:d.x,y2:d.y-ve}}const Ur=Se=>{const ve=1-Se,_t=-3*ve*ve*l.x+3*(ve*ve-2*ve*Se)*wt.x1+3*(2*ve*Se-Se*Se)*wt.x2+3*Se*Se*d.x,pn=-3*ve*ve*l.y+3*(ve*ve-2*ve*Se)*wt.y1+3*(2*ve*Se-Se*Se)*wt.y2+3*Se*Se*d.y;return{dx:_t,dy:pn}},zn=[],Xo=[];for(let Se=0;Se<=I;Se++){const ve=Se/I,_t=Se===0?l:Se===I?d:Nn(ve,l,wt,d),pn=Ur(ve);let uo=Math.hypot(pn.dx,pn.dy);uo<1e-6&&(uo=1);const Fr=-pn.dy/uo,Hr=pn.dx/uo,mo=(E+(V-E)*ve)/2;zn.push({x:_t.x+Fr*mo,y:_t.y+Hr*mo}),Xo.push({x:_t.x-Fr*mo,y:_t.y-Hr*mo})}let co=`M ${zn[0].x.toFixed(2)} ${zn[0].y.toFixed(2)}`;for(let Se=1;Se<=I;Se++)co+=` L ${zn[Se].x.toFixed(2)} ${zn[Se].y.toFixed(2)}`;for(let Se=I;Se>=0;Se--)co+=` L ${Xo[Se].x.toFixed(2)} ${Xo[Se].y.toFixed(2)}`;return co+=" Z",co}const re=d.x-l.x,Ne=d.y-l.y;let M=Math.hypot(re,Ne);M<1e-6&&(M=1);const fe=-Ne/M,it=re/M,st=E/2,Ke=V/2,An={x:l.x+fe*st,y:l.y+it*st},Rn={x:l.x-fe*st,y:l.y-it*st},Mn={x:d.x-fe*Ke,y:d.y-it*Ke},Bn={x:d.x+fe*Ke,y:d.y+it*Ke};return`M ${An.x.toFixed(2)} ${An.y.toFixed(2)} L ${Bn.x.toFixed(2)} ${Bn.y.toFixed(2)} L ${Mn.x.toFixed(2)} ${Mn.y.toFixed(2)} L ${Rn.x.toFixed(2)} ${Rn.y.toFixed(2)} Z`}const Et=e.computed(()=>$e.value.root.children),Ko=Nt[0].colors,Jn=e.computed(()=>ml(Q.branchPaletteId,Q.customPalettes)),Te=e.computed(()=>{const l=new Map;if(!Q.rainbowBranch)return l;const d=i.lineColors,E=d&&d.length>0?d:Jn.value.colors.length>0?Jn.value.colors:Ko;for(let I=0;I<Et.value.length;I++){const P=Et.value[I];l.set(P.id,E[I%E.length])}const V=(I,P)=>{l.set(I.id,P);for(const q of I.children)V(q,P)};for(let I=0;I<Et.value.length;I++){const P=Et.value[I];V(P,E[I%E.length])}return l});function Bt(l,d){return Q.rainbowBranch?Te.value.get(d.id)??Ie.value.lineColor:Ie.value.lineColor}function qo(l){const d=W(l.id);if(d.bg)return d.bg;if(l.isRoot)return Ie.value.rootBg;if(Q.rainbowBranch){const E=Te.value.get(l.id);if(E)return to(E,.18)}return Ie.value.branchBg}function Qn(l){const d=W(l.id);if(d.textColor)return d.textColor;if(l.isRoot)return Ie.value.rootText;if(Q.rainbowBranch){const E=Te.value.get(l.id);if(E)return no(E,.55)}return Ie.value.branchText}function Sn(l){const d=W(l.id);if(d.borderColor)return d.borderColor;if(l.isRoot)return Ie.value.rootBg;if(Q.rainbowBranch){const E=Te.value.get(l.id);if(E)return no(E,.3)}return Ie.value.lineColor}function eo(l){return W(l.id).fontWeight??(l.isRoot?600:400)}function to(l,d){const E=l.replace("#",""),V=E.length===6?E:E.split("").map(re=>re+re).join(""),I=parseInt(V.slice(0,2),16),P=parseInt(V.slice(2,4),16),q=parseInt(V.slice(4,6),16);return`rgba(${I}, ${P}, ${q}, ${d})`}function no(l,d){const E=l.replace("#",""),V=E.length===6?E:E.split("").map(re=>re+re).join(""),I=Math.round(parseInt(V.slice(0,2),16)*(1-d)),P=Math.round(parseInt(V.slice(2,4),16)*(1-d)),q=Math.round(parseInt(V.slice(4,6),16)*(1-d));return`rgb(${I}, ${P}, ${q})`}const ne=Sl({getContainer:()=>a.value});ne.setOnMarqueeEnd(Fm),Cl({isEditing:()=>c.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>s.value,getRootId:()=>b.value.id,defaultTargetId:()=>b.value.id,onAddChild:z,onAddSibling:H,onAddSiblingBefore:ke,onRemove:ot,onStartEdit:xt,onClearSelection:()=>{s.value=null,r("select",null)},onDuplicate:ce,onUndo:we,onRedo:ze,onNavigate:nt,onSelectRoot:()=>{s.value=b.value.id;const l=pe(b.value,b.value.id);l&&r("select",l)}});const $e=e.computed(()=>{const l=pt(b.value);return Tt(l),sl(l,{mode:Q.layoutMode,baseFontSize:Ie.value.fontSize,richHeights:_.value,richWidths:x.value})}),Tn=e.ref([]),dn=e.computed(()=>(on.value,Tn.value));e.watch($e,l=>{const d=[],E=V=>{d.push(V);for(const I of V.children)E(I)};E(l.root),Tn.value=d},{immediate:!0});const Cn=e.computed(()=>{const l=[];for(const d of dn.value)for(const E of d.children)l.push({from:d,to:E,key:`${d.id}->${E.id}`});return l}),un=e.computed(()=>`${$e.value.vbX} ${$e.value.vbY} ${$e.value.vbW} ${$e.value.vbH}`);function Tt(l){if(m.value.has(l.id)){l.children=[],l.collapsed=!0;return}l.collapsed=!1;for(const d of l.children)Tt(d)}function xt(l){const d=pe(b.value,l);d&&(c.value=l,u.value=d.text,e.nextTick(()=>{const E=document.querySelector(".zm-input");E==null||E.focus(),E==null||E.select()}))}function tt(l={}){if(!c.value)return;const d=pe(b.value,c.value);d&&d.text!==(u.value.trim()||" ")&&(d.text=u.value.trim()||" ",Ve(),r("change",b.value));const E=c.value;c.value=null,l.addChild?e.nextTick(()=>z(E)):l.addSibling==="after"?e.nextTick(()=>H(E)):l.addSibling==="before"&&e.nextTick(()=>ke(E))}function oo(){c.value=null}function io(l){if(i.previewMode)return;const d=pe(b.value,l);d!=null&&d.richContent&&(y.value=l,w.value=d.richContent.raw,e.nextTick(()=>{const E=document.querySelector(".zm-node .zm-rich textarea");E==null||E.focus()}))}function ro(){if(!y.value)return;const l=y.value,d=pe(b.value,l),E=w.value;if(d&&d.richContent&&d.richContent.raw!==E)if(d.richContent.kind==="code"){const V=qt(E)||void 0;j(l,{kind:"code",raw:E,lang:V})}else j(l,{kind:"table",raw:E});y.value=null}function lo(){y.value=null}function ao(l){l.key==="Escape"?(l.preventDefault(),lo()):l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),ro())}function mn(l,d){const E=k.value.get(l);!E||E.col!==d?k.value.set(l,{col:d,dir:"asc"}):E.dir==="asc"?k.value.set(l,{col:d,dir:"desc"}):k.value.delete(l)}function zt(l,d){const E=k.value.get(l);return!E||d.length<=1?d:Qi(d,E.col,E.dir)}function J(l,d){const E=k.value.get(l);return!E||E.col!==d?"↕":E.dir==="asc"?"▲":"▼"}function f(l){const d=l.metaKey||l.ctrlKey;d&&(l.key==="z"||l.key==="Z")&&!l.shiftKey?(l.preventDefault(),we()):(d&&l.shiftKey&&(l.key==="z"||l.key==="Z")||d&&(l.key==="y"||l.key==="Y")&&!l.shiftKey)&&(l.preventDefault(),ze())}function z(l){const d=si(b.value,l,Ln);d&&(Ve(),xe(),r("change",b.value),e.nextTick(()=>xt(d.id)))}function H(l){if(l===b.value.id){z(l);return}const d=ci(b.value,l,Ln);d&&(Ve(),xe(),r("change",b.value),e.nextTick(()=>xt(d.id)))}function ke(l){if(l===b.value.id){z(l);return}const d=yl(b.value,l,Ln);d&&(Ve(),xe(),r("change",b.value),e.nextTick(()=>xt(d.id)))}function ce(l){if(l===b.value.id)return;const d=El(b.value,l);d&&(Ve(),s.value=d.id,r("change",b.value),xe())}function we(){const l=at.undo();l&&(b.value=l.data,s.value=null,r("select",null),xe(),r("change",b.value))}function ze(){const l=at.redo();l&&(b.value=l.data,s.value=null,r("select",null),xe(),r("change",b.value))}function nt(l,d){const E=s.value??b.value.id,V=pe(b.value,E);if(!V)return;let I=null;if(d===1){const P=ct(b.value,V.id);if(P){const q=P.children.findIndex(re=>re.id===V.id);q>=0&&q<P.children.length-1&&(I=P.children[q+1].id)}}else if(d===-1){const P=ct(b.value,V.id);if(P){const q=P.children.findIndex(re=>re.id===V.id);q>0&&(I=P.children[q-1].id)}}else if(l===1){const P=ct(b.value,V.id);P&&(I=P.id)}else l===-1&&V.children.length>0&&(I=V.children[0].id);if(I){s.value=I;const P=pe(b.value,I);P&&r("select",P)}}function ot(l){l!==b.value.id&&go(b.value,l)&&(Ve(),s.value===l&&(s.value=null),xe(),r("change",b.value))}function fn(l){m.value.has(l)?m.value.delete(l):m.value.add(l),xe()}function Pe(l){const d=[{n:b.value,depth:1}];for(;d.length;){const{n:E,depth:V}=d.pop();l(E,V);for(let I=E.children.length-1;I>=0;I--)d.push({n:E.children[I],depth:V+1})}}function so(){m.value=new Set,Pe(l=>{l.children.length>0&&m.value.add(l.id)}),xe()}function _n(l){m.value=new Set,Pe((d,E)=>{E>l&&d.children.length>0&&m.value.add(d.id)}),xe()}function Lm(){m.value=new Set,xe()}function Dm(l,d){bl(b.value,l,d)&&(Ve(),xe(),r("change",b.value))}function Vm(l,d,E){return kl(b.value,l,d,E)?(Ve(),xe(),r("change",b.value),!0):!1}function $m(l,d){l.stopPropagation(),s.value=d.id;const E=pe(b.value,d.id);r("select",E)}function Pm(l){const d=l.target;if(!d||d.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(l.button===2){ne.startPan(l);return}if(l.button!==0)return;const E=a.value.getBoundingClientRect(),V=(l.clientX-E.left-ne.offsetX.value)/ne.scale.value,I=(l.clientY-E.top-ne.offsetY.value)/ne.scale.value;ne.startMarquee(V,I)}function Um(l){if(Me){Me=!1;return}const d=l.target;if(!d||d.closest(".zm-node"))return;const E=ne.marquee;E.width>=4||E.height>=4||s.value!==null&&(s.value=null,r("select",null))}function Fm(){const l=ne.marquee;if(l.width<4&&l.height<4)return;const d=l.x,E=l.y,V=l.x+l.width,I=l.y+l.height,P=[];for(const q of dn.value){const re=q.width/2,Ne=q.height/2,M=q.x-re,fe=q.x+re,it=q.y-Ne,st=q.y+Ne;M<=V&&fe>=d&&it<=I&&st>=E&&P.push(q.id)}if(P.length>0){s.value=P[0];const q=pe(b.value,P[0]);q&&r("select",q)}}function Lr(l){return m.value.has(l)}function Hm(l){const d=pe(b.value,l.id);return!!d&&d.children.length>0}function Yo(l){const d=pe(b.value,l);return d?d.children.length:0}function Dr(l){if(!pe(b.value,l))return 0;const V=[b.value];for(;V.length;){const I=V.pop(),P=I.children.findIndex(q=>q.id===l);if(P>=0)return P;for(const q of I.children)V.push(q)}return 0}function Vr(l,d,E,V){if(((V==null?void 0:V._dir)??l._dir)==="down")return d==="out"?{x:l.x,y:l.y+l.height/2}:{x:l.x,y:l.y-l.height/2};let P;d==="in"?P=-l.side:E!==void 0?P=E:P=l.side;const q=d==="in"?l._richInsetX??0:0;return{x:l.x+P*(l.width/2-q),y:l.y}}function Ct(){const l=$e.value;ne.resetView(l.width,l.height,l.root.y)}function Wm(){rn.value=!0,Ve(),xe(),e.nextTick(()=>Ct())}function Zo(l){Q.layoutMode!==l&&(Q.layoutMode=l,xe(),e.nextTick(()=>Ct()))}function $r(){return JSON.stringify(b.value,null,2)}function Pr(l){try{const d=JSON.parse(l);return!d.id||!Array.isArray(d.children)?!1:(at.reset(),b.value=pt(d),s.value=null,m.value=new Set,xe(),e.nextTick(()=>Ct()),r("change",b.value),!0)}catch{return!1}}function Gm(){const l=document.createElement("input");l.type="file",l.accept="application/json",l.onchange=()=>{var V;const d=(V=l.files)==null?void 0:V[0];if(!d)return;const E=new FileReader;E.onload=()=>{typeof E.result=="string"&&(Pr(E.result)||alert("导入失败:JSON 格式无效"))},E.readAsText(d)},l.click()}function jm(){const l=new Blob([$r()],{type:"application/json"}),d=URL.createObjectURL(l),E=document.createElement("a");E.href=d,E.download=`${b.value.text||"mindmap"}.json`,E.click(),URL.revokeObjectURL(d)}return o({addChild:l=>z(l),addSibling:l=>H(l),removeNode:l=>ot(l),duplicateNode:l=>ce(l),setNodeText:(l,d)=>Dm(l,d),moveNode:(l,d,E)=>Vm(l,d,E),lineWidthForDepth:an,endWidthForDepth:sn,getData:()=>b.value,setData:l=>{at.reset(),b.value=pt(l),s.value=null,m.value=new Set,xe(),Ve(),e.nextTick(()=>Ct())},resetView:()=>Ct(),exportData:$r,importData:Pr,getMarkdown:()=>Wt(b.value),setMarkdown:(l,d=!0)=>{const E=Ht(l||"");d&&(R.value=!0),S=!d,at.reset(),b.value=pt(E),s.value=null,m.value=new Set,xe(),Ve(),e.nextTick(()=>{S=!1,Ct()}),r("change",b.value)},setBalanced:l=>{rn.value=l},isBalanced:()=>rn.value,balance:()=>Wm(),applyNodeStyle:(l,d)=>O(l,d),getNodeStyle:l=>W(l),applyNodeImage:(l,d)=>oe(l,d),applyNodeImageByUrl:(l,d)=>te(l,d),removeNodeImage:l=>K(l),applyNodeLink:(l,d)=>U(l,d),removeNodeLink:l=>N(l),applyNodeNote:(l,d)=>$(l,d),removeNodeNote:l=>L(l),applyNodeRichContent:(l,d)=>j(l,d),undo:()=>we(),redo:()=>ze(),canUndo:()=>at.canUndo(),canRedo:()=>at.canRedo(),applySettings:l=>{l.autoBalanceOnChange!==void 0&&(Q.autoBalanceOnChange=l.autoBalanceOnChange),l.lineWidthStart!==void 0&&(Q.lineWidthStart=Math.max(.5,Math.min(20,l.lineWidthStart))),l.lineWidthEnd!==void 0&&(Q.lineWidthEnd=Math.max(.3,Math.min(10,l.lineWidthEnd))),l.rainbowBranch!==void 0&&(Q.rainbowBranch=l.rainbowBranch),l.branchPaletteId!==void 0&&(Q.branchPaletteId=l.branchPaletteId),l.customPalettes!==void 0&&(Q.customPalettes=l.customPalettes),l.lineStyle!==void 0&&(Q.lineStyle=l.lineStyle),l.taperedEdge!==void 0&&(Q.taperedEdge=l.taperedEdge),l.showOrderBadge!==void 0&&(Q.showOrderBadge=l.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:Q.autoBalanceOnChange,lineWidthStart:Q.lineWidthStart,lineWidthEnd:Q.lineWidthEnd,rainbowBranch:Q.rainbowBranch,branchPaletteId:Q.branchPaletteId,customPalettes:Q.customPalettes,lineStyle:Q.lineStyle,layoutMode:Q.layoutMode,taperedEdge:Q.taperedEdge,showOrderBadge:Q.showOrderBadge}),setBranchPalette:l=>{if(!l)return;[...Nt,...Q.customPalettes].find(E=>E.id===l)&&(Q.branchPaletteId=l)},getBranchPalette:()=>Q.branchPaletteId,getBranchPalettes:()=>[...Nt,...Q.customPalettes]}),e.watch(()=>i.data,l=>{b.value=pt(l),xe()},{deep:!1}),e.onMounted(()=>{Ve(),e.nextTick(()=>Ct())}),(l,d)=>{var E,V,I,P,q,re,Ne;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Ie.value.bgColor,fontSize:Ie.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:a,class:"zm-canvas",onMousedown:Pm,onContextmenu:B,onWheel:d[27]||(d[27]=(...M)=>e.unref(ne).onWheel&&e.unref(ne).onWheel(...M)),onMouseenter:d[28]||(d[28]=M=>p.value=!0),onMouseleave:d[29]||(d[29]=M=>p.value=!1),onClick:Um},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:$e.value.vbX*e.unref(ne).scale.value+e.unref(ne).offsetX.value+"px",top:$e.value.vbY*e.unref(ne).scale.value+e.unref(ne).offsetY.value+"px",width:$e.value.vbW*e.unref(ne).scale.value+"px",height:$e.value.vbH*e.unref(ne).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:un.value,preserveAspectRatio:"xMinYMin meet",width:$e.value.vbW*e.unref(ne).scale.value,height:$e.value.vbH*e.unref(ne).scale.value},[e.createElementVNode("g",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,M=>(e.openBlock(),e.createElementBlock("path",{key:M.key,d:jo(Vr(M.from,"out",M.to.side,M.to),Vr(M.to,"in"),an(M.from.depth),sn(M.to.depth),32,Q.lineStyle,M.to._dir),fill:Bt(M.from,M.to),stroke:"none"},null,8,Ha))),128))])],8,Ua))],4),e.unref(ne).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(ne).marquee.x*e.unref(ne).scale.value+e.unref(ne).offsetX.value+"px",top:e.unref(ne).marquee.y*e.unref(ne).scale.value+e.unref(ne).offsetY.value+"px",width:e.unref(ne).marquee.width*e.unref(ne).scale.value+"px",height:e.unref(ne).marquee.height*e.unref(ne).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(ne).offsetX.value}px, ${e.unref(ne).offsetY.value}px) scale(${e.unref(ne).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dn.value,M=>(e.openBlock(),e.createElementBlock("div",{key:M.id,class:e.normalizeClass(["zm-node",{"is-root":M.isRoot,"is-selected":s.value===M.id,"is-editing":c.value===M.id,"has-image":!!M.image,"is-resizing":yt.value===M.id}]),"data-node-id":M.id,style:e.normalizeStyle({left:M.x+"px",top:M.y+"px",width:M.width+"px",minWidth:M.width+"px",height:M.height+"px",fontSize:M.fontSize+"px",background:qo(M),color:Qn(M),borderColor:Sn(M),fontWeight:eo(M),transform:"translate(-50%, -50%)"}),onClick:fe=>$m(fe,M),onDblclick:fe=>{fe.stopPropagation(),t.previewMode||xt(M.id)},onContextmenu:fe=>Le(fe,M),onMouseenter:fe=>{He(M.id),Pt(fe,M)},onMouseleave:fe=>et(M.id)},[M.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:M.image.src,width:M.image.width,height:M.image.height,alt:M.text,draggable:"false"},null,8,Ga)):e.createCommentVNode("",!0),M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table")&&c.value!==M.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":M.richContent.kind==="table"||M.richContent.kind==="code"}]),onClick:d[1]||(d[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(fe=>io(M.id),["stop"]),onMousedown:d[2]||(d[2]=e.withModifiers(()=>{},["stop"]))},[y.value===M.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":d[0]||(d[0]=fe=>w.value=fe),class:"zm-rich-edit",spellcheck:"false",onBlur:ro,onKeydown:ao},null,544)),[[e.vModelText,w.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[M.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Ka,[e.createElementVNode("code",{innerHTML:e.unref(To)(e.unref(So)(M.richContent.raw),e.unref(qt)(M.richContent.raw))},null,8,qa)])):M.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Ya,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt(M.id,e.unref(Ji)(M.richContent.raw)),(fe,it)=>(e.openBlock(),e.createElementBlock("tr",{key:it},[it===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(fe,(st,Ke)=>{var An,Rn,Mn,Bn,wt;return e.openBlock(),e.createElementBlock("th",{key:`h${Ke}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((An=k.value.get(M.id))==null?void 0:An.col)===Ke,"is-asc":((Rn=k.value.get(M.id))==null?void 0:Rn.col)===Ke&&((Mn=k.value.get(M.id))==null?void 0:Mn.dir)==="asc","is-desc":((Bn=k.value.get(M.id))==null?void 0:Bn.col)===Ke&&((wt=k.value.get(M.id))==null?void 0:wt.dir)==="desc"}]),onClick:e.withModifiers(Ur=>mn(M.id,Ke),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(st),1),e.createElementVNode("span",Xa,e.toDisplayString(J(M.id,Ke)),1)],10,Za)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(fe,(st,Ke)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ke}`},e.toDisplayString(st),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,ja)):e.createCommentVNode("",!0),c.value!==M.id?(e.openBlock(),e.createElementBlock("span",Ja,[e.createElementVNode("span",Qa,e.toDisplayString(M.text),1),M.link&&!c.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-node-link",href:M.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${M.link.url}`,onClick:d[3]||(d[3]=e.withModifiers(()=>{},["stop"])),onMousedown:d[4]||(d[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Ee,{name:"link",size:11,stroke:2})],40,es)):e.createCommentVNode("",!0),M.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:kt(M.note.text),onClick:e.withModifiers(fe=>ye(M.id),["stop"]),onMousedown:d[5]||(d[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Ee,{name:"note",size:11,stroke:2})],40,ts)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":d[6]||(d[6]=fe=>u.value=fe),autofocus:"",onBlur:d[7]||(d[7]=fe=>tt()),onKeydown:[d[8]||(d[8]=e.withKeys(e.withModifiers(fe=>tt({addSibling:"after"}),["exact"]),["enter"])),d[9]||(d[9]=e.withKeys(e.withModifiers(fe=>tt({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),d[10]||(d[10]=e.withKeys(e.withModifiers(fe=>tt({addChild:!0}),["prevent"]),["tab"])),e.withKeys(oo,["esc"]),f],onMousedown:d[11]||(d[11]=e.withModifiers(()=>{},["stop"])),onClick:d[12]||(d[12]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),A.value?(e.openBlock(),e.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${Dr(M.id)+1} 个`},e.toDisplayString(Dr(M.id)+1),9,ns)):e.createCommentVNode("",!0),Lr(M.id)&&Yo(M.id)>0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":M.side===-1}]),style:e.normalizeStyle({background:Te.value.get(M.id)??"#64748b"}),title:`展开 ${Yo(M.id)} 个子节点`,onMousedown:d[13]||(d[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(fe=>fn(M.id),["stop"])},e.toDisplayString(Yo(M.id)),47,os)):e.createCommentVNode("",!0),Hm(M)&&!Lr(M.id)?(e.openBlock(),e.createElementBlock("button",{key:6,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":M.side===-1}]),style:e.normalizeStyle({color:Te.value.get(M.id)??"#64748b",borderColor:Te.value.get(M.id)??"#64748b"}),title:"折叠",onMousedown:d[14]||(d[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(fe=>fn(M.id),["stop"])},[e.createVNode(Ee,{name:"minus",size:10,stroke:2.4})],46,is)):e.createCommentVNode("",!0),M.image&&s.value===M.id&&c.value!==M.id?(e.openBlock(),e.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(fe=>F(fe,M),["stop"])},null,40,rs)):e.createCommentVNode("",!0),M.image&&s.value===M.id&&c.value!==M.id?(e.openBlock(),e.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:d[15]||(d[15]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(fe=>K(M.id),["stop"])},[e.createVNode(Ee,{name:"x",size:9,stroke:2.2})],40,ls)):e.createCommentVNode("",!0)],46,Wa))),128))],4),g.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-tooltip",{"is-below":!g.value.above}]),style:e.normalizeStyle({left:g.value.x+"px",top:g.value.y+"px"})},e.toDisplayString(g.value.text),7)):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createBlock(Al,{key:2,x:X.value.x,y:X.value.y,container:a.value,"has-image":!!((E=e.unref(pe)(b.value,X.value.nodeId))!=null&&E.image),"has-link":!!((V=e.unref(pe)(b.value,X.value.nodeId))!=null&&V.link),"has-note":!!((I=e.unref(pe)(b.value,X.value.nodeId))!=null&&I.note),"has-code":((q=(P=e.unref(pe)(b.value,X.value.nodeId))==null?void 0:P.richContent)==null?void 0:q.kind)==="code","has-table":((Ne=(re=e.unref(pe)(b.value,X.value.nodeId))==null?void 0:re.richContent)==null?void 0:Ne.kind)==="table",onPickImage:ue,onRemoveImage:nn,onSetLink:me,onRemoveLink:De,onEditNote:Ze,onRemoveNote:Ge,onAddCode:St,onEditCode:St,onRemoveCode:ee,onAddTable:mt,onEditTable:mt,onRemoveTable:Re,onClose:v},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):e.createCommentVNode("",!0),ge.value?(e.openBlock(),e.createBlock(Rl,{key:3,x:ge.value.x,y:ge.value.y,container:a.value,onOpenSettings:ae,onOpenData:D,onOpenImport:T,onClose:ie},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(Be.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:d[16]||(d[16]=M=>r("canvas-toggle-preview"))},[e.createVNode(Ee,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,as),e.createElementVNode("button",{class:e.normalizeClass(Fe.value),title:"显示大纲视图",onClick:d[17]||(d[17]=M=>r("canvas-outline"))},[e.createVNode(Ee,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":p.value}])},[e.createElementVNode("span",ss,e.toDisplayString(Math.round(e.unref(ne).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:d[18]||(d[18]=(...M)=>e.unref(ne).zoomIn&&e.unref(ne).zoomIn(...M))},[e.createVNode(Ee,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:d[19]||(d[19]=(...M)=>e.unref(ne).zoomOut&&e.unref(ne).zoomOut(...M))},[e.createVNode(Ee,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Ct},[e.createVNode(Ee,{name:"reset"})]),d[33]||(d[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:so},[e.createVNode(Ee,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:d[20]||(d[20]=M=>_n(1))},[e.createVNode(Ee,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:d[21]||(d[21]=M=>_n(2))},[e.createVNode(Ee,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:Lm},[e.createVNode(Ee,{name:"expand-all"})]),d[34]||(d[34]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:jm},[e.createVNode(Ee,{name:"export"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[d[30]||(d[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:d[22]||(d[22]=M=>s.value&&z(s.value))},[e.createElementVNode("img",{src:e.unref(ti),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,cs)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:d[23]||(d[23]=M=>s.value&&H(s.value))},[e.createElementVNode("img",{src:e.unref(ei),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,ds)]),d[31]||(d[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:d[24]||(d[24]=M=>Zo("mindmap"))},[e.createVNode(Ee,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:d[25]||(d[25]=M=>Zo("tree"))},[e.createVNode(Ee,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:d[26]||(d[26]=M=>Zo("org"))},[e.createVNode(Ee,{name:"org"})],2),d[32]||(d[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:Gm},[e.createVNode(Ee,{name:"import"})])],64))],2)],544)],4)}}}),us={class:"zm-outline-root"},ms={class:"zm-outline-actions"},fs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ps={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},gs={key:1,d:"M5 12 L10 17 L19 7"},hs={class:"zm-outline"},bs=["onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],ks=["title","onClick"],ys={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Es={key:0,points:"6 9 12 15 18 9"},xs={key:1,points:"9 6 15 12 9 18"},ws={key:1,class:"zm-outline-dot"},Ns={class:"zm-outline-index"},Ss={key:3,class:"zm-outline-text"},Ts=["onClick"],Cs=["src"],_s=["onClick"],As=["src"],Rs=["title","onClick"],Ms={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Bs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},zs={key:1,d:"M5 12 L10 17 L19 7"},Co=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{const G=[],Y=(U,N,$)=>{const L=U.children.length>0,j=n.collapsedIds.has(U.id);G.push({id:U.id,text:U.text||"(无标题)",depth:N,siblingIndex:$,hasChildren:L,collapsed:j,node:U}),L&&!j&&U.children.forEach((X,ge)=>Y(X,N+1,ge))};return Y(n.data,0,0),G}),a=e.ref(null),c=e.ref("");let u=null;function s(G){n.readonly||(a.value=G.id,c.value=G.text,e.nextTick(()=>{u=document.querySelector(".zm-outline-input"),u==null||u.focus(),u==null||u.select()}))}function m(){a.value!=null&&(i("edit",{id:a.value,text:c.value.trim()||"(无标题)"}),p())}function p(){a.value=null,c.value="",u=null}function g(G){G.key==="Enter"?(G.preventDefault(),m()):G.key==="Escape"&&(G.preventDefault(),p())}e.onBeforeUnmount(p);const y=e.ref(null),w=e.ref(null),k=e.ref(null);function b(G,Y){if(n.readonly){G.preventDefault();return}y.value={id:Y.id,text:Y.text},G.dataTransfer&&(G.dataTransfer.effectAllowed="move",G.dataTransfer.setData("text/plain",Y.id))}function _(){y.value=null,w.value=null,k.value=null}function x(G,Y){if(!y.value)return;G.preventDefault(),G.dataTransfer&&(G.dataTransfer.dropEffect="move");const U=A(G);w.value=Y.id,k.value=U}function R(G){w.value===G.id&&(w.value=null,k.value=null)}function S(G,Y){G.preventDefault();const U=y.value;if(!U)return;const N=A(G);U.id!==Y.id&&i("move",{srcId:U.id,targetId:Y.id,position:N}),_()}function A(G,Y){const N=G.currentTarget.getBoundingClientRect(),$=G.clientY-N.top,L=N.height;return $<L*.3?"before":$>L*.7?"after":"child"}const C=e.ref(null);let h=null;async function O(G){try{return await navigator.clipboard.writeText(G),!0}catch{const Y=document.createElement("textarea");Y.value=G,document.body.appendChild(Y),Y.select();let U=!1;try{U=document.execCommand("copy")}finally{document.body.removeChild(Y)}return U}}async function W(G,Y,U){G.stopPropagation(),await O(Y)&&(C.value=U,h&&clearTimeout(h),h=setTimeout(()=>C.value=null,1200))}const oe=e.computed(()=>{const G=[],Y=(U,N)=>{const $=" ".repeat(N),L=N===0?"":"- ";G.push($+L+(U.text||""));for(const j of U.children)Y(j,N+1)};return Y(n.data,0),G.join(`
23
- `)}),K=e.ref(!1);let te=null;async function le(){await O(oe.value)&&(K.value=!0,te&&clearTimeout(te),te=setTimeout(()=>K.value=!1,1200))}return(G,Y)=>(e.openBlock(),e.createElementBlock("div",us,[e.createElementVNode("div",ms,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":K.value}]),title:"复制完整大纲为纯文本",onClick:le},[(e.openBlock(),e.createElementBlock("svg",fs,[K.value?(e.openBlock(),e.createElementBlock("path",gs)):(e.openBlock(),e.createElementBlock("rect",ps)),Y[2]||(Y[2]=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(K.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,U=>(e.openBlock(),e.createElementBlock("li",{key:U.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":U.id===t.selectedId,"is-root":U.depth===0,"is-editing":a.value===U.id,"is-drag-over-before":w.value===U.id&&k.value==="before","is-drag-over-after":w.value===U.id&&k.value==="after","is-drag-over-child":w.value===U.id&&k.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+U.depth*16+"px"}),draggable:"true",onClick:N=>i("select",U.node),onDblclick:N=>s(U),onDragstart:N=>b(N,U),onDragend:_,onDragover:N=>x(N,U),onDragleave:()=>R(U),onDrop:N=>S(N,U)},[U.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:U.collapsed?"展开":"折叠",onClick:e.withModifiers(N=>i("toggleCollapse",U.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",ys,[U.collapsed?(e.openBlock(),e.createElementBlock("polyline",xs)):(e.openBlock(),e.createElementBlock("polyline",Es))]))],8,ks)):(e.openBlock(),e.createElementBlock("span",ws)),e.createElementVNode("span",Ns,e.toDisplayString(U.siblingIndex+1)+".",1),a.value===U.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":Y[0]||(Y[0]=N=>c.value=N),class:"zm-outline-input",onBlur:m,onKeydown:g,onClick:Y[1]||(Y[1]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,c.value]]):(e.openBlock(),e.createElementBlock("span",Ss,e.toDisplayString(U.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(N=>i("addSibling",U.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ei),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Cs)],8,Ts)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(N=>i("addChild",U.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ti),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,As)],8,_s)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":C.value===U.id}]),title:C.value===U.id?"已复制":"复制节点文本",onClick:N=>W(N,U.text,U.id)},[(e.openBlock(),e.createElementBlock("svg",Ms,[C.value!==U.id?(e.openBlock(),e.createElementBlock("rect",Bs)):(e.openBlock(),e.createElementBlock("path",zs)),Y[3]||(Y[3]=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,Rs)],46,bs))),128))])]))}}),Os=["aria-hidden"],Is={key:0,class:"zm-drawer-header"},vs={key:0,class:"zm-drawer-title"},Ls={class:"zm-drawer-body"},Wn=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""}},emits:["update:open"],setup(t,{emit:o}){const n=o;function i(){n("update:open",!1)}return(r,a)=>(e.openBlock(),e.createBlock(e.Transition,{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||r.$slots.header?(e.openBlock(),e.createElementBlock("div",Is,[t.title?(e.openBlock(),e.createElementBlock("h3",vs,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"header"),e.createElementVNode("button",{class:"zm-drawer-close",title:"关闭",onClick:i},[...a[0]||(a[0]=[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.createElementVNode("div",Ls,[e.renderSlot(r.$slots,"default")])],14,Os)):e.createCommentVNode("",!0)]),_:3}))}}),Ds={key:0,class:"zm-jtv-root"},Vs={key:0,class:"zm-jtv-key"},$s={key:1,class:"zm-jtv-colon"},Ps={key:2,class:"zm-jtv-key zm-jtv-bracket"},Us={key:3,class:"zm-jtv-size"},Fs={key:4,class:"zm-jtv-bracket"},Hs={key:5,class:"zm-jtv-brace"},Ws={key:0,class:"zm-jtv-children"},Gs={class:"zm-jtv-key"},js={key:0,class:"zm-jtv-key"},Ks=["src","alt"],qs=["href"],Ys=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"),r=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!r.value);const a=e.computed(()=>{if(r.value)return`Array(${o.value.length})`;if(i.value){const R=o.value,S=Object.keys(R);return`Object(${S.length} ${S.length===1?"key":"keys"})`}return""}),c=e.computed(()=>r.value?o.value.map((R,S)=>({key:String(S),value:R})):i.value?Object.entries(o.value).map(([R,S])=>({key:R,value:S})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),s=e.computed(()=>o.collapsedPaths.has(u.value));function m(R,S,A){R!=="<root>"&&(A<2||S===null||typeof S!="object"||o.collapsedPaths.has(R)||o.collapsedPaths.add(R))}o.isRoot||m(u.value,o.value,o.depth);function p(){s.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function g(R){return u.value===""?R:`${u.value}.${R}`}function y(R){if(!o.query)return!0;const S=o.query.toLowerCase();return typeof R=="string"?R.toLowerCase().includes(S):R===null?"null".includes(S):String(R).toLowerCase().includes(S)}function w(R){return o.query?R.toLowerCase().includes(o.query.toLowerCase()):!0}function k(R,S){return!o.query||w(R)?!0:S===null||typeof S!="object"?y(S):!0}function b(R){return R===null?"null":typeof R=="string"?R.length>80?`"${R.slice(0,80)}..."`:`"${R}"`:typeof R=="boolean"?R?"true":"false":typeof R=="number"?String(R):typeof R>"u"?"undefined":JSON.stringify(R)}function _(R){if(typeof R!="string")return!1;const S=R.trim();return!!(S.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(S)||/^https?:\/\/.+/i.test(S)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(S))}function x(R){if(!o.query)return null;const S=R.toLowerCase().indexOf(o.query.toLowerCase());return S<0?null:{before:R.slice(0,S),match:R.slice(S,S+o.query.length),after:R.slice(S+o.query.length)}}return(R,S)=>{var C,h,O,W,oe,K;const A=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Ds,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,te=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:te.key,class:"zm-jtv-row"},[e.createVNode(A,{"key-name":te.key,value:te.value,path:g(te.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,k(te.key,te.value)]])),128))])):i.value||r.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":s.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:p},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(s.value?"▶":"▼"),1),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Vs,e.toDisplayString(t.keyName),1)),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",$s,":")),r.value?(e.openBlock(),e.createElementBlock("span",Ps,"[")):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("span",Us,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0),s.value&&r.value?(e.openBlock(),e.createElementBlock("span",Fs,"]")):e.createCommentVNode("",!0),s.value&&i.value?(e.openBlock(),e.createElementBlock("span",Hs,"}")):e.createCommentVNode("",!0)],4),s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,te=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:te.key,class:"zm-jtv-row"},[e.createVNode(A,{"key-name":te.key,value:te.value,path:g(te.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,k(te.key,te.value)]])),128))])),!s.value&&r.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),!s.value&&i.value&&!r.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"})},[S[2]||(S[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",Gs,e.toDisplayString(t.keyName),1),S[3]||(S[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),w(t.keyName)&&x(t.keyName)?(e.openBlock(),e.createElementBlock("span",js,[e.createElementVNode("span",null,e.toDisplayString((C=x(t.keyName))==null?void 0:C.before),1),e.createElementVNode("mark",null,e.toDisplayString((h=x(t.keyName))==null?void 0:h.match),1),e.createElementVNode("span",null,e.toDisplayString((O=x(t.keyName))==null?void 0:O.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[x(b(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((W=x(b(t.value)))==null?void 0:W.before),1),e.createElementVNode("mark",null,e.toDisplayString((oe=x(b(t.value)))==null?void 0:oe.match),1),e.createElementVNode("span",null,e.toDisplayString((K=x(b(t.value)))==null?void 0:K.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(b(t.value)),1)],64))],2),_(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:S[1]||(S[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,Ks),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:S[0]||(S[0]=e.withModifiers(()=>{},["stop"]))},"open",8,qs)])):e.createCommentVNode("",!0)],4))}}}),Zs={class:"zm-data-panel"},Xs={class:"zm-data-header"},Js={class:"zm-data-title"},Qs={class:"zm-data-title-meta"},ec={class:"zm-data-toolbar"},tc=["title"],nc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},oc={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"},ic={key:0,class:"zm-data-paste"},rc={class:"zm-data-tabs"},lc=["placeholder"],ac={key:0,class:"zm-data-error"},sc={class:"zm-data-paste-actions"},cc=["disabled"],dc={class:"zm-data-tree"},uc=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>JSON.stringify(n.data,null,2)),a=e.ref(""),c=e.ref(null),u=e.ref(!1),s=e.ref("json"),m=e.ref("idle"),p=e.ref(new Set),g=e.ref("");e.watch(()=>n.pendingMode,S=>{S&&(u.value=!0,s.value=S,i("consumed-mode"))},{immediate:!0});async function y(){try{await navigator.clipboard.writeText(r.value),m.value="copied",setTimeout(()=>m.value="idle",1500)}catch{const S=document.createElement("textarea");S.value=r.value,document.body.appendChild(S),S.select();try{document.execCommand("copy"),m.value="copied",setTimeout(()=>m.value="idle",1500)}finally{document.body.removeChild(S)}}}function w(){const S=new Blob([r.value],{type:"application/json"}),A=URL.createObjectURL(S),C=document.createElement("a");C.href=A,C.download=`${n.data.text||"mindmap"}.json`,C.click(),URL.revokeObjectURL(A)}function k(){c.value=null;const S=a.value.trim();if(S){if(s.value==="markdown"||s.value==="txt"){try{const A=Ht(S);i("import",A),a.value="",u.value=!1}catch(A){c.value=(s.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+A.message}return}try{const A=JSON.parse(S);if(!A.id||!Array.isArray(A.children)){c.value="JSON 缺少 id 或 children 字段";return}i("import",A),a.value="",u.value=!1}catch(A){c.value="JSON 解析失败:"+A.message}}}function b(S){return 1+S.children.reduce((A,C)=>A+b(C),0)}const _=e.computed(()=>b(n.data)),x=e.computed(()=>r.value.length);function R(){const S=document.createElement("input");S.type="file",S.accept="application/json",S.onchange=()=>{var h;const A=(h=S.files)==null?void 0:h[0];if(!A)return;const C=new FileReader;C.onload=()=>{typeof C.result=="string"&&(a.value=C.result,k())},C.readAsText(A)},S.click()}return(S,A)=>(e.openBlock(),e.createElementBlock("div",Zs,[e.createElementVNode("div",Xs,[e.createElementVNode("div",Js,[A[8]||(A[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",Qs,e.toDisplayString(_.value)+" 节点 · "+e.toDisplayString(x.value)+" chars",1)])]),e.createElementVNode("div",ec,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":m.value==="copied"}]),title:m.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:y},[m.value==="idle"?(e.openBlock(),e.createElementBlock("svg",nc,[...A[9]||(A[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",oc,[...A[10]||(A[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),A[11]||(A[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,tc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:w},[...A[12]||(A[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:R},[...A[13]||(A[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:A[0]||(A[0]=C=>u.value=!u.value)},[...A[14]||(A[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),A[16]||(A[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":g.value.length>0}])},[A[15]||(A[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":A[1]||(A[1]=C=>g.value=C),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,g.value]]),g.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:A[2]||(A[2]=C=>g.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",ic,[e.createElementVNode("div",rc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":s.value==="json"}]),onClick:A[3]||(A[3]=C=>s.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":s.value==="markdown"}]),onClick:A[4]||(A[4]=C=>s.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":A[5]||(A[5]=C=>a.value=C),placeholder:s.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,lc),[[e.vModelText,a.value]]),c.value?(e.openBlock(),e.createElementBlock("div",ac,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",sc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!a.value,onClick:k},"应用",8,cc),e.createElementVNode("button",{class:"zm-data-btn",onClick:A[6]||(A[6]=C=>{a.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:A[7]||(A[7]=C=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",dc,[e.createVNode(Ys,{value:t.data,query:g.value,"collapsed-paths":p.value},null,8,["value","query","collapsed-paths"])]),A[17]||(A[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-settings-panel"},fc={key:0,class:"zm-settings-section"},pc={class:"zm-settings-row"},gc=["value"],hc={class:"zm-slider"},bc=["value"],kc={class:"zm-settings-row"},yc=["value"],Ec={class:"zm-slider"},xc=["value"],wc={class:"zm-settings-row"},Nc={class:"zm-line-style-group"},Sc=["title","onClick"],Tc=["viewBox"],Cc={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},_c={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Ac={class:"zm-line-style-label"},Rc={class:"zm-settings-row"},Mc={key:0,class:"zm-palette-picker"},Bc={class:"zm-palette-grid"},zc=["title","onClick"],Oc={class:"zm-palette-card-name"},Ic={class:"zm-palette-card-swatches"},vc={key:0,class:"zm-palette-customs"},Lc=["title","onClick"],Dc={class:"zm-palette-card-name"},Vc={class:"zm-palette-card-swatches"},$c=["value","onInput"],Pc={class:"zm-palette-custom-actions"},Uc=["onClick"],Fc=["onClick"],Hc={class:"zm-settings-row"},Wc={class:"zm-settings-row"},Gc={class:"zm-settings-preview"},jc={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Kc=["x1","y1","x2","y2","stroke","stroke-width"],qc={key:1,class:"zm-settings-section"},Yc={class:"zm-settings-row"},Zc={class:"zm-settings-value-tag"},Xc={class:"zm-settings-row"},Jc={class:"zm-settings-value-tag"},Qc={class:"zm-settings-row"},ed={class:"zm-settings-value-tag"},td={class:"zm-settings-row"},nd={key:2,class:"zm-settings-section"},od={class:"zm-settings-section-title"},id={key:0,class:"zm-settings-section-sub"},rd={class:"zm-settings-row"},ld={class:"zm-settings-value-tag"},ad={class:"zm-swatch-row"},sd=["title","onClick"],cd={class:"zm-settings-row"},dd={class:"zm-settings-value-tag"},ud={class:"zm-swatch-row"},md=["title","onClick"],fd={class:"zm-settings-row"},pd={class:"zm-settings-section"},gd=((t,o)=>{const n=t.__vccOpts||t;for(const[i,r]of o)n[i]=r;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,i=o;function r(C,h){i("update:settings",{[C]:h})}e.computed(()=>{const C=n.settings.lineWidthStart;return C<1.2?"细":C<2.5?"中":C<4?"粗":"极粗"}),e.computed(()=>{const C=n.settings.lineWidthEnd;return C<.6?"极细":C<1.2?"细":C<2?"中":"粗"});const a=[{value:"curve",label:"圆弧",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"}],c=e.reactive({fontWeight:400});function u(){i("update:nodeStyle",{...c})}function s(){c.bg=void 0,c.textColor=void 0,c.borderColor=void 0,c.fontWeight=400,i("update:nodeStyle",{...c})}const m=e.reactive({});function p(C){return m[C.id]===void 0&&(m[C.id]=C.colors.join(`
24
- `)),m[C.id]}function g(C){const h=m[C.id]??"",O=fl(h);if(O.length===0){m[C.id]=C.colors.join(`
25
- `);return}const W=n.settings.customPalettes.map(oe=>oe.id===C.id?{...oe,colors:O}:oe);i("update:settings",{customPalettes:W})}function y(){const C=k.value.find(K=>K.id===n.settings.branchPaletteId),h=C?[...C.colors]:[...Nt[0].colors],O="custom-";let W=O+(n.settings.customPalettes.length+1);for(;Nt.some(K=>K.id===W)||n.settings.customPalettes.some(K=>K.id===W);)W=O+Math.random().toString(36).slice(2,7);const oe={id:W,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:h};i("update:settings",{customPalettes:[...n.settings.customPalettes,oe],branchPaletteId:W}),m[W]=h.join(`
26
- `)}function w(C){const h=n.settings.customPalettes.filter(W=>W.id!==C.id),O=n.settings.branchPaletteId===C.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:h,...O!==n.settings.branchPaletteId?{branchPaletteId:O}:{}}),delete m[C.id]}const k=e.computed(()=>[...Nt,...n.settings.customPalettes]),b=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],_=[0,1,2,3],x=["#f87171","#fb923c","#34d399","#818cf8"];function R(C,h,O,W){if(h<=1)return O;const oe=C/(h-1);return O+(W-O)*oe}function S(C,h,O){return C<=0?h:C===1?Math.max(1.5,h*.67):C===2?Math.max(.8,h*.42):O}const A=e.computed(()=>{const C=n.settings.lineWidthStart,h=n.settings.lineWidthEnd,O=n.settings.taperedEdge,W=_.length,oe=8,K=192,te=k.value.find(G=>G.id===n.settings.branchPaletteId),le=te&&te.colors.length?te.colors:x;return _.map((G,Y)=>{const U=10+Y*60/(W-1);return{x1:oe,y1:U,x2:K,y2:U,w:O?S(G,C,h):R(G,W,C,h),color:n.settings.rainbowBranch?le[Y%le.length]:"#94a3b8"}})});return(C,h)=>(e.openBlock(),e.createElementBlock("div",mc,[t.hasSelection?(e.openBlock(),e.createElementBlock("section",qc,[h[32]||(h[32]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Yc,[h[27]||(h[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端",-1)),e.createElementVNode("span",Zc,e.toDisplayString(t.settings.lineWidthStart.toFixed(1)),1)]),e.createElementVNode("div",Xc,[h[28]||(h[28]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端",-1)),e.createElementVNode("span",Jc,e.toDisplayString(t.settings.lineWidthEnd.toFixed(1)),1)]),e.createElementVNode("div",Qc,[h[29]||(h[29]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("span",ed,e.toDisplayString(t.settings.lineStyle==="curve"?"圆弧":"直线"),1)]),e.createElementVNode("label",td,[h[31]||(h[31]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:h[7]||(h[7]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...h[30]||(h[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[33]||(h[33]=e.createElementVNode("p",{class:"zm-settings-hint"},"画布级别的设置会影响整张图。",-1))])):(e.openBlock(),e.createElementBlock("section",fc,[h[23]||(h[23]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",pc,[h[12]||(h[12]=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:h[0]||(h[0]=O=>r("lineWidthStart",parseFloat(O.target.value)||0))},null,40,gc)]),e.createElementVNode("div",hc,[e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:h[1]||(h[1]=O=>r("lineWidthStart",parseFloat(O.target.value)))},null,40,bc)]),e.createElementVNode("div",kc,[h[13]||(h[13]=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:h[2]||(h[2]=O=>r("lineWidthEnd",parseFloat(O.target.value)||0))},null,40,yc)]),e.createElementVNode("div",Ec,[e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:h[3]||(h[3]=O=>r("lineWidthEnd",parseFloat(O.target.value)))},null,40,xc)]),e.createElementVNode("div",wc,[h[14]||(h[14]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",Nc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,O=>e.createElementVNode("button",{key:O.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===O.value}]),title:O.label,onClick:W=>r("lineStyle",O.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:O.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[O.value==="curve"?(e.openBlock(),e.createElementBlock("path",Cc)):(e.openBlock(),e.createElementBlock("line",_c))],8,Tc)),e.createElementVNode("span",Ac,e.toDisplayString(O.label),1)],10,Sc)),64))])]),e.createElementVNode("label",Rc,[h[16]||(h[16]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:h[4]||(h[4]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...h[15]||(h[15]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[24]||(h[24]=e.createElementVNode("p",{class:"zm-settings-hint"},"关闭时所有线条使用统一的 lineColor。",-1)),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Mc,[h[17]||(h[17]=e.createElementVNode("h5",{class:"zm-palette-picker-title"},"配色方案",-1)),e.createElementVNode("div",Bc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Nt),O=>(e.openBlock(),e.createElementBlock("button",{key:O.id,type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===O.id}]),title:O.name,onClick:W=>r("branchPaletteId",O.id)},[e.createElementVNode("span",Oc,e.toDisplayString(O.name),1),e.createElementVNode("span",Ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(W,oe)=>(e.openBlock(),e.createElementBlock("span",{key:oe,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:W})},null,4))),128))])],10,zc))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("div",vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,O=>(e.openBlock(),e.createElementBlock("div",{key:O.id,class:"zm-palette-custom"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===O.id}]),title:O.name,onClick:W=>r("branchPaletteId",O.id)},[e.createElementVNode("span",Dc,e.toDisplayString(O.name),1),e.createElementVNode("span",Vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(W,oe)=>(e.openBlock(),e.createElementBlock("span",{key:oe,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:W})},null,4))),128))])],10,Lc),e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"2",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:p(O),onInput:W=>m[O.id]=W.target.value},null,40,$c),e.createElementVNode("div",Pc,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:W=>g(O)},"保存",8,Uc),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:W=>w(O)},"删除",8,Fc)])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:y},"+ 新建配色")])):e.createCommentVNode("",!0),e.createElementVNode("label",Hc,[h[19]||(h[19]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:h[5]||(h[5]=O=>r("taperedEdge",!t.settings.taperedEdge))},[...h[18]||(h[18]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[25]||(h[25]=e.createElementVNode("p",{class:"zm-settings-hint"}," 开启时每条边都从根部粗端收回到细端子端,父子边之间可能形成粗细跳变; 关闭时整棵树从最粗平滑过渡到最细,所有边连成一条带子。 ",-1)),e.createElementVNode("label",Wc,[h[21]||(h[21]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:h[6]||(h[6]=O=>r("showOrderBadge",!t.settings.showOrderBadge))},[...h[20]||(h[20]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[26]||(h[26]=e.createElementVNode("p",{class:"zm-settings-hint"}," 在每个节点右上角标注它是同级中的第几个 (1, 2, 3, ...), 方便对比画布位置与数据顺序。 ",-1)),e.createElementVNode("div",Gc,[(e.openBlock(),e.createElementBlock("svg",jc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,(O,W)=>(e.openBlock(),e.createElementBlock("line",{key:W,x1:O.x1,y1:O.y1,x2:O.x2,y2:O.y2,stroke:t.settings.rainbowBranch?O.color:"#94a3b8","stroke-width":O.w,"stroke-linecap":"butt"},null,8,Kc))),128))])),h[22]||(h[22]=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",nd,[e.createElementVNode("h4",od,[h[34]||(h[34]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",id,"“"+e.toDisplayString(t.selectedNodeText)+"”",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",rd,[h[35]||(h[35]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",ld,e.toDisplayString(c.bg||"默认"),1)]),e.createElementVNode("div",ad,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(b,O=>e.createElementVNode("button",{key:"bg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:W=>c.bg=O},null,12,sd)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:h[8]||(h[8]=O=>c.bg=void 0)},"∅")]),e.createElementVNode("div",cd,[h[36]||(h[36]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",dd,e.toDisplayString(c.textColor||"默认"),1)]),e.createElementVNode("div",ud,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(b,O=>e.createElementVNode("button",{key:"fg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:W=>c.textColor=O},null,12,md)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:h[9]||(h[9]=O=>c.textColor=void 0)},"∅")]),e.createElementVNode("div",fd,[h[38]||(h[38]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":c.fontWeight===600}]),onClick:h[10]||(h[10]=O=>c.fontWeight=c.fontWeight===600?400:600)},[...h[37]||(h[37]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",{class:"zm-data-paste-actions"},[e.createElementVNode("button",{class:"zm-data-btn is-primary",onClick:u},"应用到该节点"),e.createElementVNode("button",{class:"zm-data-btn",onClick:s},"清除该节点样式")]),h[39]||(h[39]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",pd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:h[11]||(h[11]=O=>i("reset"))},"恢复默认设置")])]))}}),[["__scopeId","data-v-17ef65d1"]]),hd={class:"zm-md-panel"},bd={key:0,class:"zm-md-error"},kd={class:"zm-md-split"},yd={class:"zm-md-edit"},Ed={class:"zm-md-preview"},xd={class:"zm-md-preview-body"},wd={class:"zm-md-footer"},Nd=["disabled"],Sd=`# flow-mindmap 思维导图
22
+ | a | b | c |`);if(I===null)return;const P=I.trim();if(!P){j(l,null);return}j(l,{kind:"table",raw:P})}function Me(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&j(l,null)}function ye(l){i.previewMode||r("edit-note",l)}function kt(l,d=60){const E=l.replace(/\s+/g," ").trim();return E.length<=d?E||"点击编辑笔记":E.slice(0,d)+"…"}function je(l){var I;if(i.previewMode||s.value)return;const d=l.target;if(d&&(d.tagName==="INPUT"||d.tagName==="TEXTAREA"||d.isContentEditable))return;const E=c.value;if(!E)return;const V=(I=l.clipboardData)==null?void 0:I.items;if(V)for(let P=0;P<V.length;P++){const q=V[P];if(q.kind==="file"&&q.type.startsWith("image/")){const re=q.getAsFile();if(!re)continue;l.preventDefault();const Se=pe(b.value,E);if(Se!=null&&Se.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;G(re,R=>oe(E,R));return}}}e.onMounted(()=>{window.addEventListener("paste",je),we()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",je)});const Qe=e.ref(null),yt=e.computed(()=>{var l;return((l=Qe.value)==null?void 0:l.nodeId)??null});function U(l,d){if(!d.image)return;l.preventDefault(),l.stopPropagation();const E=d.image.naturalW||d.image.width,V=d.image.naturalH||d.image.height,I=V>0?V/E:1;Qe.value={nodeId:d.id,startX:l.clientX,startY:l.clientY,startW:d.image.width,startH:d.image.height,naturalW:E,naturalH:V,ratio:I,pendingW:d.image.width,pendingH:d.image.height},window.addEventListener("mousemove",Z),window.addEventListener("mouseup",se)}function Z(l){var Se,R;const d=Qe.value;if(!d)return;const E=ne.scale.value||1,V=l.clientX-d.startX,I=le(d.startW+V/E,vt,Yt),P=le(I*d.ratio,vt,Yt);d.pendingW=I,d.pendingH=P;const q=(Se=a.value)==null?void 0:Se.querySelector(`[data-node-id="${d.nodeId}"] .zm-node-img`);q&&(q.style.width=`${I}px`,q.style.height=`${P}px`);const re=(R=a.value)==null?void 0:R.querySelector(`[data-node-id="${d.nodeId}"]`);re&&(re.style.minWidth=`${Math.max(80,Math.ceil(I+28))}px`,re.style.height=`${Math.ceil(P+8+30)}px`)}function se(){const l=Qe.value;if(window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",se),Qe.value=null,!l)return;const d=pe(b.value,l.nodeId);!d||!d.image||(oe(l.nodeId,{src:d.image.src,naturalW:d.image.naturalW,naturalH:d.image.naturalH,width:l.pendingW,height:l.pendingH}),c.value=l.nodeId,r("select",d),Re=!0)}const he=e.ref(null);let Re=!1;function He(l){he.value=l}function et(l){he.value===l&&(he.value=null),g.value&&(g.value=null)}function Pt(l,d){var Ke;if(!d.text||d.text.length<14)return;const V=l.currentTarget.getBoundingClientRect(),I=(Ke=a.value)==null?void 0:Ke.getBoundingClientRect();if(!I)return;const P=10,q=240,re=V.top-I.top>60,Se=V.left-I.left+V.width/2,R=P+q/2,fe=I.width-q/2-P,it=Math.max(R,Math.min(Se,fe)),st=re?V.top-I.top-8:V.bottom-I.top+8;g.value={text:d.text,x:it,y:st,above:re}}const rn=e.ref(0),ln=e.ref(!1),at=Bl(100);function Ve(){at.record({data:b.value})}function we(){m.value=new Set(m.value),rn.value++,e.nextTick().then(()=>e.nextTick()).then(()=>an()).then(()=>{rn.value++})}function an(){const l=document.querySelectorAll(".zm-rich"),d={},E={};l.forEach(V=>{let I=V,P=null;for(;I&&!P;)P=I.getAttribute("data-node-id"),I=I.parentElement;if(!P)return;const q=V.offsetHeight,re=V.scrollWidth,Se=Math.round(q*2)/2,R=Math.round(re*2)/2;d[P]=Se,E[P]=R,_.value[P],x.value[P]}),_.value=d,x.value=E}const Ie=e.computed(()=>{var l,d,E,V,I,P,q,re,Se,R;return{rootBg:((l=i.theme)==null?void 0:l.rootBg)??"#1f2937",rootText:((d=i.theme)==null?void 0:d.rootText)??"#ffffff",branchBg:((E=i.theme)==null?void 0:E.branchBg)??"#ffffff",branchText:((V=i.theme)==null?void 0:V.branchText)??"#1f2937",lineColor:((I=i.theme)==null?void 0:I.lineColor)??"#94a3b8",bgColor:((P=i.theme)==null?void 0:P.bgColor)??"#f8fafc",fontSize:((q=i.theme)==null?void 0:q.fontSize)??14,lineWidthStart:((re=i.theme)==null?void 0:re.lineWidthStart)??2.2,lineWidthEnd:((Se=i.theme)==null?void 0:Se.lineWidthEnd)??.8,rainbowBranch:((R=i.theme)==null?void 0:R.rainbowBranch)??!1}}),Q=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function sn(l){return Q.taperedEdge?Yo(l):dn(l)}function cn(l){return Q.taperedEdge?Q.lineWidthEnd:dn(l)}function Yo(l){return l<=0?Q.lineWidthStart:l===1?Math.max(1.5,Q.lineWidthStart*.67):l===2?Math.max(.8,Q.lineWidthStart*.42):Q.lineWidthEnd}function dn(l){if(l<=0)return Q.lineWidthStart;if(l>=3)return Q.lineWidthEnd;const d=l/3;return Q.lineWidthStart+(Q.lineWidthEnd-Q.lineWidthStart)*d}function Sn(l,d,E,V){const I=1-l,P=I*I*I*d.x+3*I*I*l*E.x1+3*I*l*l*E.x2+l*l*l*V.x,q=I*I*I*d.y+3*I*I*l*E.y1+3*I*l*l*E.y2+l*l*l*V.y;return{x:P,y:q}}function Zo(l,d,E,V,I=32,P="curve",q="right"){if(P==="curve"){let wt;if(q==="right"||q==="left"){const ve=Math.abs(d.x-l.x)*.45,_t=q==="right"?1:-1;wt={x1:l.x+_t*ve,y1:l.y,x2:d.x-_t*ve,y2:d.y}}else{const ve=Math.abs(d.y-l.y)*.45;wt={x1:l.x,y1:l.y+ve,x2:d.x,y2:d.y-ve}}const Gr=Te=>{const ve=1-Te,_t=-3*ve*ve*l.x+3*(ve*ve-2*ve*Te)*wt.x1+3*(2*ve*Te-Te*Te)*wt.x2+3*Te*Te*d.x,gn=-3*ve*ve*l.y+3*(ve*ve-2*ve*Te)*wt.y1+3*(2*ve*Te-Te*Te)*wt.y2+3*Te*Te*d.y;return{dx:_t,dy:gn}},On=[],ti=[];for(let Te=0;Te<=I;Te++){const ve=Te/I,_t=Te===0?l:Te===I?d:Sn(ve,l,wt,d),gn=Gr(ve);let uo=Math.hypot(gn.dx,gn.dy);uo<1e-6&&(uo=1);const jr=-gn.dy/uo,Kr=gn.dx/uo,mo=(E+(V-E)*ve)/2;On.push({x:_t.x+jr*mo,y:_t.y+Kr*mo}),ti.push({x:_t.x-jr*mo,y:_t.y-Kr*mo})}let co=`M ${On[0].x.toFixed(2)} ${On[0].y.toFixed(2)}`;for(let Te=1;Te<=I;Te++)co+=` L ${On[Te].x.toFixed(2)} ${On[Te].y.toFixed(2)}`;for(let Te=I;Te>=0;Te--)co+=` L ${ti[Te].x.toFixed(2)} ${ti[Te].y.toFixed(2)}`;return co+=" Z",co}const re=d.x-l.x,Se=d.y-l.y;let R=Math.hypot(re,Se);R<1e-6&&(R=1);const fe=-Se/R,it=re/R,st=E/2,Ke=V/2,Mn={x:l.x+fe*st,y:l.y+it*st},Rn={x:l.x-fe*st,y:l.y-it*st},Bn={x:d.x-fe*Ke,y:d.y-it*Ke},zn={x:d.x+fe*Ke,y:d.y+it*Ke};return`M ${Mn.x.toFixed(2)} ${Mn.y.toFixed(2)} L ${zn.x.toFixed(2)} ${zn.y.toFixed(2)} L ${Bn.x.toFixed(2)} ${Bn.y.toFixed(2)} L ${Rn.x.toFixed(2)} ${Rn.y.toFixed(2)} Z`}const Et=e.computed(()=>$e.value.root.children),Xo=Nt[0].colors,Jn=e.computed(()=>hl(Q.branchPaletteId,Q.customPalettes)),Ce=e.computed(()=>{const l=new Map;if(!Q.rainbowBranch)return l;const d=i.lineColors,E=d&&d.length>0?d:Jn.value.colors.length>0?Jn.value.colors:Xo;for(let I=0;I<Et.value.length;I++){const P=Et.value[I];l.set(P.id,E[I%E.length])}const V=(I,P)=>{l.set(I.id,P);for(const q of I.children)V(q,P)};for(let I=0;I<Et.value.length;I++){const P=Et.value[I];V(P,E[I%E.length])}return l});function Bt(l,d){return Q.rainbowBranch?Ce.value.get(d.id)??Ie.value.lineColor:Ie.value.lineColor}function Jo(l){const d=W(l.id);if(d.bg)return d.bg;if(l.isRoot)return Ie.value.rootBg;if(Q.rainbowBranch){const E=Ce.value.get(l.id);if(E)return to(E,.18)}return Ie.value.branchBg}function Qn(l){const d=W(l.id);if(d.textColor)return d.textColor;if(l.isRoot)return Ie.value.rootText;if(Q.rainbowBranch){const E=Ce.value.get(l.id);if(E)return no(E,.55)}return Ie.value.branchText}function Tn(l){const d=W(l.id);if(d.borderColor)return d.borderColor;if(l.isRoot)return Ie.value.rootBg;if(Q.rainbowBranch){const E=Ce.value.get(l.id);if(E)return no(E,.3)}return Ie.value.lineColor}function eo(l){return W(l.id).fontWeight??(l.isRoot?600:400)}function to(l,d){const E=l.replace("#",""),V=E.length===6?E:E.split("").map(re=>re+re).join(""),I=parseInt(V.slice(0,2),16),P=parseInt(V.slice(2,4),16),q=parseInt(V.slice(4,6),16);return`rgba(${I}, ${P}, ${q}, ${d})`}function no(l,d){const E=l.replace("#",""),V=E.length===6?E:E.split("").map(re=>re+re).join(""),I=Math.round(parseInt(V.slice(0,2),16)*(1-d)),P=Math.round(parseInt(V.slice(2,4),16)*(1-d)),q=Math.round(parseInt(V.slice(4,6),16)*(1-d));return`rgb(${I}, ${P}, ${q})`}const ne=Al({getContainer:()=>a.value});ne.setOnMarqueeEnd(Km),Rl({isEditing:()=>s.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>c.value,getRootId:()=>b.value.id,defaultTargetId:()=>b.value.id,onAddChild:z,onAddSibling:H,onAddSiblingBefore:ke,onRemove:ot,onStartEdit:xt,onClearSelection:()=>{c.value=null,r("select",null)},onDuplicate:ce,onUndo:Ne,onRedo:ze,onNavigate:nt,onSelectRoot:()=>{c.value=b.value.id;const l=pe(b.value,b.value.id);l&&r("select",l)}});const $e=e.computed(()=>{const l=pt(b.value);return Tt(l),ml(l,{mode:Q.layoutMode,baseFontSize:Ie.value.fontSize,richHeights:_.value,richWidths:x.value})}),Cn=e.ref([]),un=e.computed(()=>(rn.value,Cn.value));e.watch($e,l=>{const d=[],E=V=>{d.push(V);for(const I of V.children)E(I)};E(l.root),Cn.value=d},{immediate:!0});const _n=e.computed(()=>{const l=[];for(const d of un.value)for(const E of d.children)l.push({from:d,to:E,key:`${d.id}->${E.id}`});return l}),mn=e.computed(()=>`${$e.value.vbX} ${$e.value.vbY} ${$e.value.vbW} ${$e.value.vbH}`);function Tt(l){if(m.value.has(l.id)){l.children=[],l.collapsed=!0;return}l.collapsed=!1;for(const d of l.children)Tt(d)}function xt(l){const d=pe(b.value,l);d&&(s.value=l,u.value=d.text,e.nextTick(()=>{const E=document.querySelector(".zm-input");E==null||E.focus(),E==null||E.select()}))}function tt(l={}){if(!s.value)return;const d=pe(b.value,s.value);d&&d.text!==(u.value.trim()||" ")&&(d.text=u.value.trim()||" ",Ve(),r("change",b.value));const E=s.value;s.value=null,l.addChild?e.nextTick(()=>z(E)):l.addSibling==="after"?e.nextTick(()=>H(E)):l.addSibling==="before"&&e.nextTick(()=>ke(E))}function oo(){s.value=null}function io(l){if(i.previewMode)return;const d=pe(b.value,l);d!=null&&d.richContent&&(y.value=l,w.value=d.richContent.raw,e.nextTick(()=>{const E=document.querySelector(".zm-node .zm-rich textarea");E==null||E.focus()}))}function ro(){if(!y.value)return;const l=y.value,d=pe(b.value,l),E=w.value;if(d&&d.richContent&&d.richContent.raw!==E)if(d.richContent.kind==="code"){const V=qt(E)||void 0;j(l,{kind:"code",raw:E,lang:V})}else j(l,{kind:"table",raw:E});y.value=null}function lo(){y.value=null}function ao(l){l.key==="Escape"?(l.preventDefault(),lo()):l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),ro())}function fn(l,d){const E=k.value.get(l);!E||E.col!==d?k.value.set(l,{col:d,dir:"asc"}):E.dir==="asc"?k.value.set(l,{col:d,dir:"desc"}):k.value.delete(l)}function zt(l,d){const E=k.value.get(l);return!E||d.length<=1?d:or(d,E.col,E.dir)}function J(l,d){const E=k.value.get(l);return!E||E.col!==d?"↕":E.dir==="asc"?"▲":"▼"}function f(l){const d=l.metaKey||l.ctrlKey;d&&(l.key==="z"||l.key==="Z")&&!l.shiftKey?(l.preventDefault(),Ne()):(d&&l.shiftKey&&(l.key==="z"||l.key==="Z")||d&&(l.key==="y"||l.key==="Y")&&!l.shiftKey)&&(l.preventDefault(),ze())}function z(l){const d=mi(b.value,l,Dn);d&&(Ve(),we(),r("change",b.value),e.nextTick(()=>xt(d.id)))}function H(l){if(l===b.value.id){z(l);return}const d=fi(b.value,l,Dn);d&&(Ve(),we(),r("change",b.value),e.nextTick(()=>xt(d.id)))}function ke(l){if(l===b.value.id){z(l);return}const d=Nl(b.value,l,Dn);d&&(Ve(),we(),r("change",b.value),e.nextTick(()=>xt(d.id)))}function ce(l){if(l===b.value.id)return;const d=Sl(b.value,l);d&&(Ve(),c.value=d.id,r("change",b.value),we())}function Ne(){const l=at.undo();l&&(b.value=l.data,c.value=null,r("select",null),we(),r("change",b.value))}function ze(){const l=at.redo();l&&(b.value=l.data,c.value=null,r("select",null),we(),r("change",b.value))}function nt(l,d){const E=c.value??b.value.id,V=pe(b.value,E);if(!V)return;let I=null;if(d===1){const P=ct(b.value,V.id);if(P){const q=P.children.findIndex(re=>re.id===V.id);q>=0&&q<P.children.length-1&&(I=P.children[q+1].id)}}else if(d===-1){const P=ct(b.value,V.id);if(P){const q=P.children.findIndex(re=>re.id===V.id);q>0&&(I=P.children[q-1].id)}}else if(l===1){const P=ct(b.value,V.id);P&&(I=P.id)}else l===-1&&V.children.length>0&&(I=V.children[0].id);if(I){c.value=I;const P=pe(b.value,I);P&&r("select",P)}}function ot(l){l!==b.value.id&&go(b.value,l)&&(Ve(),c.value===l&&(c.value=null),we(),r("change",b.value))}function pn(l){m.value.has(l)?m.value.delete(l):m.value.add(l),we()}function Pe(l){const d=[{n:b.value,depth:1}];for(;d.length;){const{n:E,depth:V}=d.pop();l(E,V);for(let I=E.children.length-1;I>=0;I--)d.push({n:E.children[I],depth:V+1})}}function so(){m.value=new Set,Pe(l=>{l.children.length>0&&m.value.add(l.id)}),we()}function An(l){m.value=new Set,Pe((d,E)=>{E>l&&d.children.length>0&&m.value.add(d.id)}),we()}function Fm(){m.value=new Set,we()}function Um(l,d){xl(b.value,l,d)&&(Ve(),we(),r("change",b.value))}function Hm(l,d,E){return wl(b.value,l,d,E)?(Ve(),we(),r("change",b.value),!0):!1}function Wm(l,d){l.stopPropagation(),c.value=d.id;const E=pe(b.value,d.id);r("select",E)}function Gm(l){const d=l.target;if(!d||d.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(l.button===2){ne.startPan(l);return}if(l.button!==0)return;const E=a.value.getBoundingClientRect(),V=(l.clientX-E.left-ne.offsetX.value)/ne.scale.value,I=(l.clientY-E.top-ne.offsetY.value)/ne.scale.value;ne.startMarquee(V,I)}function jm(l){if(Re){Re=!1;return}const d=l.target;if(!d||d.closest(".zm-node"))return;const E=ne.marquee;E.width>=4||E.height>=4||c.value!==null&&(c.value=null,r("select",null))}function Km(){const l=ne.marquee;if(l.width<4&&l.height<4)return;const d=l.x,E=l.y,V=l.x+l.width,I=l.y+l.height,P=[];for(const q of un.value){const re=q.width/2,Se=q.height/2,R=q.x-re,fe=q.x+re,it=q.y-Se,st=q.y+Se;R<=V&&fe>=d&&it<=I&&st>=E&&P.push(q.id)}if(P.length>0){c.value=P[0];const q=pe(b.value,P[0]);q&&r("select",q)}}function Pr(l){return m.value.has(l)}function qm(l){const d=pe(b.value,l.id);return!!d&&d.children.length>0}function Qo(l){const d=pe(b.value,l);return d?d.children.length:0}function Fr(l){if(!pe(b.value,l))return 0;const V=[b.value];for(;V.length;){const I=V.pop(),P=I.children.findIndex(q=>q.id===l);if(P>=0)return P;for(const q of I.children)V.push(q)}return 0}function Ur(l,d,E,V){if(((V==null?void 0:V._dir)??l._dir)==="down")return d==="out"?{x:l.x,y:l.y+l.height/2}:{x:l.x,y:l.y-l.height/2};let P;d==="in"?P=-l.side:E!==void 0?P=E:P=l.side;const q=d==="in"?l._richInsetX??0:0;return{x:l.x+P*(l.width/2-q),y:l.y}}function Ct(){const l=$e.value;ne.resetView(l.width,l.height,l.root.y)}function Ym(){ln.value=!0,Ve(),we(),e.nextTick(()=>Ct())}function ei(l){Q.layoutMode!==l&&(Q.layoutMode=l,we(),e.nextTick(()=>Ct()))}function Hr(){return JSON.stringify(b.value,null,2)}function Wr(l){try{const d=JSON.parse(l);return!d.id||!Array.isArray(d.children)?!1:(at.reset(),b.value=pt(d),c.value=null,m.value=new Set,we(),e.nextTick(()=>Ct()),r("change",b.value),!0)}catch{return!1}}function Zm(){const l=document.createElement("input");l.type="file",l.accept="application/json",l.onchange=()=>{var V;const d=(V=l.files)==null?void 0:V[0];if(!d)return;const E=new FileReader;E.onload=()=>{typeof E.result=="string"&&(Wr(E.result)||alert("导入失败:JSON 格式无效"))},E.readAsText(d)},l.click()}function Xm(){const l=new Blob([Hr()],{type:"application/json"}),d=URL.createObjectURL(l),E=document.createElement("a");E.href=d,E.download=`${b.value.text||"mindmap"}.json`,E.click(),URL.revokeObjectURL(d)}return o({addChild:l=>z(l),addSibling:l=>H(l),removeNode:l=>ot(l),duplicateNode:l=>ce(l),setNodeText:(l,d)=>Um(l,d),moveNode:(l,d,E)=>Hm(l,d,E),lineWidthForDepth:sn,endWidthForDepth:cn,getData:()=>b.value,setData:l=>{at.reset(),b.value=pt(l),c.value=null,m.value=new Set,we(),Ve(),e.nextTick(()=>Ct())},resetView:()=>Ct(),exportData:Hr,importData:Wr,getMarkdown:()=>Wt(b.value),setMarkdown:(l,d=!0)=>{const E=Ht(l||"");d&&(M.value=!0),S=!d,at.reset(),b.value=pt(E),c.value=null,m.value=new Set,we(),Ve(),e.nextTick(()=>{S=!1,Ct()}),r("change",b.value)},setBalanced:l=>{ln.value=l},isBalanced:()=>ln.value,balance:()=>Ym(),applyNodeStyle:(l,d)=>O(l,d),getNodeStyle:l=>W(l),applyNodeImage:(l,d)=>oe(l,d),applyNodeImageByUrl:(l,d)=>te(l,d),removeNodeImage:l=>K(l),applyNodeLink:(l,d)=>F(l,d),removeNodeLink:l=>N(l),applyNodeNote:(l,d)=>$(l,d),removeNodeNote:l=>L(l),applyNodeRichContent:(l,d)=>j(l,d),undo:()=>Ne(),redo:()=>ze(),canUndo:()=>at.canUndo(),canRedo:()=>at.canRedo(),applySettings:l=>{l.autoBalanceOnChange!==void 0&&(Q.autoBalanceOnChange=l.autoBalanceOnChange),l.lineWidthStart!==void 0&&(Q.lineWidthStart=Math.max(.5,Math.min(20,l.lineWidthStart))),l.lineWidthEnd!==void 0&&(Q.lineWidthEnd=Math.max(.3,Math.min(10,l.lineWidthEnd))),l.rainbowBranch!==void 0&&(Q.rainbowBranch=l.rainbowBranch),l.branchPaletteId!==void 0&&(Q.branchPaletteId=l.branchPaletteId),l.customPalettes!==void 0&&(Q.customPalettes=l.customPalettes),l.lineStyle!==void 0&&(Q.lineStyle=l.lineStyle),l.taperedEdge!==void 0&&(Q.taperedEdge=l.taperedEdge),l.showOrderBadge!==void 0&&(Q.showOrderBadge=l.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:Q.autoBalanceOnChange,lineWidthStart:Q.lineWidthStart,lineWidthEnd:Q.lineWidthEnd,rainbowBranch:Q.rainbowBranch,branchPaletteId:Q.branchPaletteId,customPalettes:Q.customPalettes,lineStyle:Q.lineStyle,layoutMode:Q.layoutMode,taperedEdge:Q.taperedEdge,showOrderBadge:Q.showOrderBadge}),setBranchPalette:l=>{if(!l)return;[...Nt,...Q.customPalettes].find(E=>E.id===l)&&(Q.branchPaletteId=l)},getBranchPalette:()=>Q.branchPaletteId,getBranchPalettes:()=>[...Nt,...Q.customPalettes]}),e.watch(()=>i.data,l=>{b.value=pt(l),we()},{deep:!1}),e.onMounted(()=>{Ve(),e.nextTick(()=>Ct())}),(l,d)=>{var E,V,I,P,q,re,Se;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Ie.value.bgColor,fontSize:Ie.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:a,class:"zm-canvas",onMousedown:Gm,onContextmenu:B,onWheel:d[27]||(d[27]=(...R)=>e.unref(ne).onWheel&&e.unref(ne).onWheel(...R)),onMouseenter:d[28]||(d[28]=R=>p.value=!0),onMouseleave:d[29]||(d[29]=R=>p.value=!1),onClick:jm},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:$e.value.vbX*e.unref(ne).scale.value+e.unref(ne).offsetX.value+"px",top:$e.value.vbY*e.unref(ne).scale.value+e.unref(ne).offsetY.value+"px",width:$e.value.vbW*e.unref(ne).scale.value+"px",height:$e.value.vbH*e.unref(ne).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:mn.value,preserveAspectRatio:"xMinYMin meet",width:$e.value.vbW*e.unref(ne).scale.value,height:$e.value.vbH*e.unref(ne).scale.value},[e.createElementVNode("g",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.value,R=>(e.openBlock(),e.createElementBlock("path",{key:R.key,d:Zo(Ur(R.from,"out",R.to.side,R.to),Ur(R.to,"in"),sn(R.from.depth),cn(R.to.depth),32,Q.lineStyle,R.to._dir),fill:Bt(R.from,R.to),stroke:"none"},null,8,Ka))),128))])],8,Ga))],4),e.unref(ne).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(ne).marquee.x*e.unref(ne).scale.value+e.unref(ne).offsetX.value+"px",top:e.unref(ne).marquee.y*e.unref(ne).scale.value+e.unref(ne).offsetY.value+"px",width:e.unref(ne).marquee.width*e.unref(ne).scale.value+"px",height:e.unref(ne).marquee.height*e.unref(ne).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(ne).offsetX.value}px, ${e.unref(ne).offsetY.value}px) scale(${e.unref(ne).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un.value,R=>(e.openBlock(),e.createElementBlock("div",{key:R.id,class:e.normalizeClass(["zm-node",{"is-root":R.isRoot,"is-selected":c.value===R.id,"is-editing":s.value===R.id,"has-image":!!R.image,"is-resizing":yt.value===R.id}]),"data-node-id":R.id,style:e.normalizeStyle({left:R.x+"px",top:R.y+"px",width:R.width+"px",minWidth:R.width+"px",height:R.height+"px",fontSize:R.fontSize+"px",background:Jo(R),color:Qn(R),borderColor:Tn(R),fontWeight:eo(R),transform:"translate(-50%, -50%)"}),onClick:fe=>Wm(fe,R),onDblclick:fe=>{fe.stopPropagation(),t.previewMode||xt(R.id)},onContextmenu:fe=>Le(fe,R),onMouseenter:fe=>{He(R.id),Pt(fe,R)},onMouseleave:fe=>et(R.id)},[R.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:R.image.src,width:R.image.width,height:R.image.height,alt:R.text,draggable:"false"},null,8,Ya)):e.createCommentVNode("",!0),R.richContent&&(R.richContent.kind==="code"||R.richContent.kind==="table")&&s.value!==R.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":R.richContent.kind==="table"||R.richContent.kind==="code"}]),onClick:d[1]||(d[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(fe=>io(R.id),["stop"]),onMousedown:d[2]||(d[2]=e.withModifiers(()=>{},["stop"]))},[y.value===R.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":d[0]||(d[0]=fe=>w.value=fe),class:"zm-rich-edit",spellcheck:"false",onBlur:ro,onKeydown:ao},null,544)),[[e.vModelText,w.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[R.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Xa,[e.createElementVNode("code",{innerHTML:e.unref(To)(e.unref(So)(R.richContent.raw),e.unref(qt)(R.richContent.raw))},null,8,Ja)])):R.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Qa,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt(R.id,e.unref(nr)(R.richContent.raw)),(fe,it)=>(e.openBlock(),e.createElementBlock("tr",{key:it},[it===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(fe,(st,Ke)=>{var Mn,Rn,Bn,zn,wt;return e.openBlock(),e.createElementBlock("th",{key:`h${Ke}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((Mn=k.value.get(R.id))==null?void 0:Mn.col)===Ke,"is-asc":((Rn=k.value.get(R.id))==null?void 0:Rn.col)===Ke&&((Bn=k.value.get(R.id))==null?void 0:Bn.dir)==="asc","is-desc":((zn=k.value.get(R.id))==null?void 0:zn.col)===Ke&&((wt=k.value.get(R.id))==null?void 0:wt.dir)==="desc"}]),onClick:e.withModifiers(Gr=>fn(R.id,Ke),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(st),1),e.createElementVNode("span",ts,e.toDisplayString(J(R.id,Ke)),1)],10,es)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(fe,(st,Ke)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ke}`},e.toDisplayString(st),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Za)):e.createCommentVNode("",!0),s.value!==R.id?(e.openBlock(),e.createElementBlock("span",ns,[e.createElementVNode("span",os,e.toDisplayString(R.text),1),R.link&&!s.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-node-link",href:R.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${R.link.url}`,onClick:d[3]||(d[3]=e.withModifiers(()=>{},["stop"])),onMousedown:d[4]||(d[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"link",size:11,stroke:2})],40,is)):e.createCommentVNode("",!0),R.note&&!s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:kt(R.note.text),onClick:e.withModifiers(fe=>ye(R.id),["stop"]),onMousedown:d[5]||(d[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"note",size:11,stroke:2})],40,rs)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":d[6]||(d[6]=fe=>u.value=fe),autofocus:"",onBlur:d[7]||(d[7]=fe=>tt()),onKeydown:[d[8]||(d[8]=e.withKeys(e.withModifiers(fe=>tt({addSibling:"after"}),["exact"]),["enter"])),d[9]||(d[9]=e.withKeys(e.withModifiers(fe=>tt({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),d[10]||(d[10]=e.withKeys(e.withModifiers(fe=>tt({addChild:!0}),["prevent"]),["tab"])),e.withKeys(oo,["esc"]),f],onMousedown:d[11]||(d[11]=e.withModifiers(()=>{},["stop"])),onClick:d[12]||(d[12]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),A.value?(e.openBlock(),e.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${Fr(R.id)+1} 个`},e.toDisplayString(Fr(R.id)+1),9,ls)):e.createCommentVNode("",!0),Pr(R.id)&&Qo(R.id)>0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":R.side===-1}]),style:e.normalizeStyle({background:Ce.value.get(R.id)??"#64748b"}),title:`展开 ${Qo(R.id)} 个子节点`,onMousedown:d[13]||(d[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(fe=>pn(R.id),["stop"])},e.toDisplayString(Qo(R.id)),47,as)):e.createCommentVNode("",!0),qm(R)&&!Pr(R.id)?(e.openBlock(),e.createElementBlock("button",{key:6,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":R.side===-1}]),style:e.normalizeStyle({color:Ce.value.get(R.id)??"#64748b",borderColor:Ce.value.get(R.id)??"#64748b"}),title:"折叠",onMousedown:d[14]||(d[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(fe=>pn(R.id),["stop"])},[e.createVNode(xe,{name:"minus",size:10,stroke:2.4})],46,ss)):e.createCommentVNode("",!0),R.image&&c.value===R.id&&s.value!==R.id?(e.openBlock(),e.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(fe=>U(fe,R),["stop"])},null,40,cs)):e.createCommentVNode("",!0),R.image&&c.value===R.id&&s.value!==R.id?(e.openBlock(),e.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:d[15]||(d[15]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(fe=>K(R.id),["stop"])},[e.createVNode(xe,{name:"x",size:9,stroke:2.2})],40,ds)):e.createCommentVNode("",!0)],46,qa))),128))],4),g.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-tooltip",{"is-below":!g.value.above}]),style:e.normalizeStyle({left:g.value.x+"px",top:g.value.y+"px"})},e.toDisplayString(g.value.text),7)):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createBlock(zl,{key:2,x:X.value.x,y:X.value.y,container:a.value,"has-image":!!((E=e.unref(pe)(b.value,X.value.nodeId))!=null&&E.image),"has-link":!!((V=e.unref(pe)(b.value,X.value.nodeId))!=null&&V.link),"has-note":!!((I=e.unref(pe)(b.value,X.value.nodeId))!=null&&I.note),"has-code":((q=(P=e.unref(pe)(b.value,X.value.nodeId))==null?void 0:P.richContent)==null?void 0:q.kind)==="code","has-table":((Se=(re=e.unref(pe)(b.value,X.value.nodeId))==null?void 0:re.richContent)==null?void 0:Se.kind)==="table",onPickImage:ue,onRemoveImage:on,onSetLink:me,onRemoveLink:De,onEditNote:Ze,onRemoveNote:Ge,onAddCode:St,onEditCode:St,onRemoveCode:ee,onAddTable:mt,onEditTable:mt,onRemoveTable:Me,onClose:v},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):e.createCommentVNode("",!0),ge.value?(e.openBlock(),e.createBlock(Ol,{key:3,x:ge.value.x,y:ge.value.y,container:a.value,onOpenSettings:ae,onOpenData:D,onOpenImport:T,onClose:ie},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(Be.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:d[16]||(d[16]=R=>r("canvas-toggle-preview"))},[e.createVNode(xe,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,us),e.createElementVNode("button",{class:e.normalizeClass(Ue.value),title:"显示大纲视图",onClick:d[17]||(d[17]=R=>r("canvas-outline"))},[e.createVNode(xe,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":p.value}])},[e.createElementVNode("span",ms,e.toDisplayString(Math.round(e.unref(ne).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:d[18]||(d[18]=(...R)=>e.unref(ne).zoomIn&&e.unref(ne).zoomIn(...R))},[e.createVNode(xe,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:d[19]||(d[19]=(...R)=>e.unref(ne).zoomOut&&e.unref(ne).zoomOut(...R))},[e.createVNode(xe,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Ct},[e.createVNode(xe,{name:"reset"})]),d[33]||(d[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:so},[e.createVNode(xe,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:d[20]||(d[20]=R=>An(1))},[e.createVNode(xe,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:d[21]||(d[21]=R=>An(2))},[e.createVNode(xe,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:Fm},[e.createVNode(xe,{name:"expand-all"})]),d[34]||(d[34]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:Xm},[e.createVNode(xe,{name:"export"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[d[30]||(d[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:d[22]||(d[22]=R=>c.value&&z(c.value))},[e.createElementVNode("img",{src:e.unref(ri),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,fs)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:d[23]||(d[23]=R=>c.value&&H(c.value))},[e.createElementVNode("img",{src:e.unref(ii),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,ps)]),d[31]||(d[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:d[24]||(d[24]=R=>ei("mindmap"))},[e.createVNode(xe,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:d[25]||(d[25]=R=>ei("tree"))},[e.createVNode(xe,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:d[26]||(d[26]=R=>ei("org"))},[e.createVNode(xe,{name:"org"})],2),d[32]||(d[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:Zm},[e.createVNode(xe,{name:"import"})])],64))],2)],544)],4)}}}),gs={class:"zm-outline-root"},hs={class:"zm-outline-actions"},bs={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"},Es={class:"zm-outline"},xs=["onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],ws=["title","onClick"],Ns={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ss={key:0,points:"6 9 12 15 18 9"},Ts={key:1,points:"9 6 15 12 9 18"},Cs={key:1,class:"zm-outline-dot"},_s={class:"zm-outline-index"},As={key:3,class:"zm-outline-text"},Ms=["onClick"],Rs=["src"],Bs=["onClick"],zs=["src"],Os=["title","onClick"],Is={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},vs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ls={key:1,d:"M5 12 L10 17 L19 7"},Co=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{const G=[],Y=(F,N,$)=>{const L=F.children.length>0,j=n.collapsedIds.has(F.id);G.push({id:F.id,text:F.text||"(无标题)",depth:N,siblingIndex:$,hasChildren:L,collapsed:j,node:F}),L&&!j&&F.children.forEach((X,ge)=>Y(X,N+1,ge))};return Y(n.data,0,0),G}),a=e.ref(null),s=e.ref("");let u=null;function c(G){n.readonly||(a.value=G.id,s.value=G.text,e.nextTick(()=>{u=document.querySelector(".zm-outline-input"),u==null||u.focus(),u==null||u.select()}))}function m(){a.value!=null&&(i("edit",{id:a.value,text:s.value.trim()||"(无标题)"}),p())}function p(){a.value=null,s.value="",u=null}function g(G){G.key==="Enter"?(G.preventDefault(),m()):G.key==="Escape"&&(G.preventDefault(),p())}e.onBeforeUnmount(p);const y=e.ref(null),w=e.ref(null),k=e.ref(null);function b(G,Y){if(n.readonly){G.preventDefault();return}y.value={id:Y.id,text:Y.text},G.dataTransfer&&(G.dataTransfer.effectAllowed="move",G.dataTransfer.setData("text/plain",Y.id))}function _(){y.value=null,w.value=null,k.value=null}function x(G,Y){if(!y.value)return;G.preventDefault(),G.dataTransfer&&(G.dataTransfer.dropEffect="move");const F=A(G);w.value=Y.id,k.value=F}function M(G){w.value===G.id&&(w.value=null,k.value=null)}function S(G,Y){G.preventDefault();const F=y.value;if(!F)return;const N=A(G);F.id!==Y.id&&i("move",{srcId:F.id,targetId:Y.id,position:N}),_()}function A(G,Y){const N=G.currentTarget.getBoundingClientRect(),$=G.clientY-N.top,L=N.height;return $<L*.3?"before":$>L*.7?"after":"child"}const C=e.ref(null);let h=null;async function O(G){try{return await navigator.clipboard.writeText(G),!0}catch{const Y=document.createElement("textarea");Y.value=G,document.body.appendChild(Y),Y.select();let F=!1;try{F=document.execCommand("copy")}finally{document.body.removeChild(Y)}return F}}async function W(G,Y,F){G.stopPropagation(),await O(Y)&&(C.value=F,h&&clearTimeout(h),h=setTimeout(()=>C.value=null,1200))}const oe=e.computed(()=>{const G=[],Y=(F,N)=>{const $=" ".repeat(N),L=N===0?"":"- ";G.push($+L+(F.text||""));for(const j of F.children)Y(j,N+1)};return Y(n.data,0),G.join(`
23
+ `)}),K=e.ref(!1);let te=null;async function le(){await O(oe.value)&&(K.value=!0,te&&clearTimeout(te),te=setTimeout(()=>K.value=!1,1200))}return(G,Y)=>(e.openBlock(),e.createElementBlock("div",gs,[e.createElementVNode("div",hs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":K.value}]),title:"复制完整大纲为纯文本",onClick:le},[(e.openBlock(),e.createElementBlock("svg",bs,[K.value?(e.openBlock(),e.createElementBlock("path",ys)):(e.openBlock(),e.createElementBlock("rect",ks)),Y[2]||(Y[2]=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(K.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,F=>(e.openBlock(),e.createElementBlock("li",{key:F.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":F.id===t.selectedId,"is-root":F.depth===0,"is-editing":a.value===F.id,"is-drag-over-before":w.value===F.id&&k.value==="before","is-drag-over-after":w.value===F.id&&k.value==="after","is-drag-over-child":w.value===F.id&&k.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+F.depth*16+"px"}),draggable:"true",onClick:N=>i("select",F.node),onDblclick:N=>c(F),onDragstart:N=>b(N,F),onDragend:_,onDragover:N=>x(N,F),onDragleave:()=>M(F),onDrop:N=>S(N,F)},[F.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:F.collapsed?"展开":"折叠",onClick:e.withModifiers(N=>i("toggleCollapse",F.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Ns,[F.collapsed?(e.openBlock(),e.createElementBlock("polyline",Ts)):(e.openBlock(),e.createElementBlock("polyline",Ss))]))],8,ws)):(e.openBlock(),e.createElementBlock("span",Cs)),e.createElementVNode("span",_s,e.toDisplayString(F.siblingIndex+1)+".",1),a.value===F.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":Y[0]||(Y[0]=N=>s.value=N),class:"zm-outline-input",onBlur:m,onKeydown:g,onClick:Y[1]||(Y[1]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,s.value]]):(e.openBlock(),e.createElementBlock("span",As,e.toDisplayString(F.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(N=>i("addSibling",F.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ii),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Rs)],8,Ms)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(N=>i("addChild",F.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ri),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,zs)],8,Bs)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":C.value===F.id}]),title:C.value===F.id?"已复制":"复制节点文本",onClick:N=>W(N,F.text,F.id)},[(e.openBlock(),e.createElementBlock("svg",Is,[C.value!==F.id?(e.openBlock(),e.createElementBlock("rect",vs)):(e.openBlock(),e.createElementBlock("path",Ls)),Y[3]||(Y[3]=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,Os)],46,xs))),128))])]))}}),Ds=["aria-hidden"],Vs=["aria-hidden"],$s={key:0,class:"zm-drawer-header"},Ps={key:0,class:"zm-drawer-title"},Fs={class:"zm-drawer-body"},Us=["aria-hidden"],Hs={key:0,class:"zm-drawer-header"},Ws={key:0,class:"zm-drawer-title"},Gs={class:"zm-drawer-body"},Zt=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 r(){n("update:open",!1)}return(a,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&&r())},null,8,Ds)):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||a.$slots.header?(e.openBlock(),e.createElementBlock("div",$s,[t.title?(e.openBlock(),e.createElementBlock("h3",Ps,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(a.$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",Fs,[e.renderSlot(a.$slots,"default")])],14,Vs)):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||a.$slots.header?(e.openBlock(),e.createElementBlock("div",Hs,[t.title?(e.openBlock(),e.createElementBlock("h3",Ws,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(a.$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",Gs,[e.renderSlot(a.$slots,"default")])],14,Us)):e.createCommentVNode("",!0)]),_:3}))}}),js={key:0,class:"zm-jtv-root"},Ks={key:0,class:"zm-jtv-key"},qs={key:1,class:"zm-jtv-colon"},Ys={key:2,class:"zm-jtv-key zm-jtv-bracket"},Zs={key:3,class:"zm-jtv-size"},Xs={key:4,class:"zm-jtv-bracket"},Js={key:5,class:"zm-jtv-brace"},Qs={key:0,class:"zm-jtv-children"},ec={class:"zm-jtv-key"},tc={key:0,class:"zm-jtv-key"},nc=["src","alt"],oc=["href"],ic=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"),r=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!r.value);const a=e.computed(()=>{if(r.value)return`Array(${o.value.length})`;if(i.value){const M=o.value,S=Object.keys(M);return`Object(${S.length} ${S.length===1?"key":"keys"})`}return""}),s=e.computed(()=>r.value?o.value.map((M,S)=>({key:String(S),value:M})):i.value?Object.entries(o.value).map(([M,S])=>({key:M,value:S})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),c=e.computed(()=>o.collapsedPaths.has(u.value));function m(M,S,A){M!=="<root>"&&(A<2||S===null||typeof S!="object"||o.collapsedPaths.has(M)||o.collapsedPaths.add(M))}o.isRoot||m(u.value,o.value,o.depth);function p(){c.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function g(M){return u.value===""?M:`${u.value}.${M}`}function y(M){if(!o.query)return!0;const S=o.query.toLowerCase();return typeof M=="string"?M.toLowerCase().includes(S):M===null?"null".includes(S):String(M).toLowerCase().includes(S)}function w(M){return o.query?M.toLowerCase().includes(o.query.toLowerCase()):!0}function k(M,S){return!o.query||w(M)?!0:S===null||typeof S!="object"?y(S):!0}function b(M){return M===null?"null":typeof M=="string"?M.length>80?`"${M.slice(0,80)}..."`:`"${M}"`:typeof M=="boolean"?M?"true":"false":typeof M=="number"?String(M):typeof M>"u"?"undefined":JSON.stringify(M)}function _(M){if(typeof M!="string")return!1;const S=M.trim();return!!(S.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(S)||/^https?:\/\/.+/i.test(S)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(S))}function x(M){if(!o.query)return null;const S=M.toLowerCase().indexOf(o.query.toLowerCase());return S<0?null:{before:M.slice(0,S),match:M.slice(S,S+o.query.length),after:M.slice(S+o.query.length)}}return(M,S)=>{var C,h,O,W,oe,K;const A=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,te=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:te.key,class:"zm-jtv-row"},[e.createVNode(A,{"key-name":te.key,value:te.value,path:g(te.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,k(te.key,te.value)]])),128))])):i.value||r.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":c.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:p},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(c.value?"▶":"▼"),1),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Ks,e.toDisplayString(t.keyName),1)),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",qs,":")),r.value?(e.openBlock(),e.createElementBlock("span",Ys,"[")):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("span",Zs,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0),c.value&&r.value?(e.openBlock(),e.createElementBlock("span",Xs,"]")):e.createCommentVNode("",!0),c.value&&i.value?(e.openBlock(),e.createElementBlock("span",Js,"}")):e.createCommentVNode("",!0)],4),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,te=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:te.key,class:"zm-jtv-row"},[e.createVNode(A,{"key-name":te.key,value:te.value,path:g(te.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,k(te.key,te.value)]])),128))])),!c.value&&r.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),!c.value&&i.value&&!r.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"})},[S[2]||(S[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",ec,e.toDisplayString(t.keyName),1),S[3]||(S[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),w(t.keyName)&&x(t.keyName)?(e.openBlock(),e.createElementBlock("span",tc,[e.createElementVNode("span",null,e.toDisplayString((C=x(t.keyName))==null?void 0:C.before),1),e.createElementVNode("mark",null,e.toDisplayString((h=x(t.keyName))==null?void 0:h.match),1),e.createElementVNode("span",null,e.toDisplayString((O=x(t.keyName))==null?void 0:O.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[x(b(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((W=x(b(t.value)))==null?void 0:W.before),1),e.createElementVNode("mark",null,e.toDisplayString((oe=x(b(t.value)))==null?void 0:oe.match),1),e.createElementVNode("span",null,e.toDisplayString((K=x(b(t.value)))==null?void 0:K.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(b(t.value)),1)],64))],2),_(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:S[1]||(S[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,nc),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:S[0]||(S[0]=e.withModifiers(()=>{},["stop"]))},"open",8,oc)])):e.createCommentVNode("",!0)],4))}}}),rc={class:"zm-data-panel"},lc={class:"zm-data-header"},ac={class:"zm-data-title"},sc={class:"zm-data-title-meta"},cc={class:"zm-data-toolbar"},dc=["title"],uc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},mc={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"},fc={key:0,class:"zm-data-paste"},pc={class:"zm-data-tabs"},gc=["placeholder"],hc={key:0,class:"zm-data-error"},bc={class:"zm-data-paste-actions"},kc=["disabled"],yc={class:"zm-data-tree"},_o=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>JSON.stringify(n.data,null,2)),a=e.ref(""),s=e.ref(null),u=e.ref(!1),c=e.ref("json"),m=e.ref("idle"),p=e.ref(new Set),g=e.ref("");e.watch(()=>n.pendingMode,S=>{S&&(u.value=!0,c.value=S,i("consumed-mode"))},{immediate:!0});async function y(){try{await navigator.clipboard.writeText(r.value),m.value="copied",setTimeout(()=>m.value="idle",1500)}catch{const S=document.createElement("textarea");S.value=r.value,document.body.appendChild(S),S.select();try{document.execCommand("copy"),m.value="copied",setTimeout(()=>m.value="idle",1500)}finally{document.body.removeChild(S)}}}function w(){const S=new Blob([r.value],{type:"application/json"}),A=URL.createObjectURL(S),C=document.createElement("a");C.href=A,C.download=`${n.data.text||"mindmap"}.json`,C.click(),URL.revokeObjectURL(A)}function k(){s.value=null;const S=a.value.trim();if(S){if(c.value==="markdown"||c.value==="txt"){try{const A=Ht(S);i("import",A),a.value="",u.value=!1}catch(A){s.value=(c.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+A.message}return}try{const A=JSON.parse(S);if(!A.id||!Array.isArray(A.children)){s.value="JSON 缺少 id 或 children 字段";return}i("import",A),a.value="",u.value=!1}catch(A){s.value="JSON 解析失败:"+A.message}}}function b(S){return 1+S.children.reduce((A,C)=>A+b(C),0)}const _=e.computed(()=>b(n.data)),x=e.computed(()=>r.value.length);function M(){const S=document.createElement("input");S.type="file",S.accept="application/json",S.onchange=()=>{var h;const A=(h=S.files)==null?void 0:h[0];if(!A)return;const C=new FileReader;C.onload=()=>{typeof C.result=="string"&&(a.value=C.result,k())},C.readAsText(A)},S.click()}return(S,A)=>(e.openBlock(),e.createElementBlock("div",rc,[e.createElementVNode("div",lc,[e.createElementVNode("div",ac,[A[8]||(A[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",sc,e.toDisplayString(_.value)+" 节点 · "+e.toDisplayString(x.value)+" chars",1)])]),e.createElementVNode("div",cc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":m.value==="copied"}]),title:m.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:y},[m.value==="idle"?(e.openBlock(),e.createElementBlock("svg",uc,[...A[9]||(A[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",mc,[...A[10]||(A[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),A[11]||(A[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,dc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:w},[...A[12]||(A[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:M},[...A[13]||(A[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:A[0]||(A[0]=C=>u.value=!u.value)},[...A[14]||(A[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),A[16]||(A[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":g.value.length>0}])},[A[15]||(A[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":A[1]||(A[1]=C=>g.value=C),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,g.value]]),g.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:A[2]||(A[2]=C=>g.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",fc,[e.createElementVNode("div",pc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":c.value==="json"}]),onClick:A[3]||(A[3]=C=>c.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":c.value==="markdown"}]),onClick:A[4]||(A[4]=C=>c.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":A[5]||(A[5]=C=>a.value=C),placeholder:c.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,gc),[[e.vModelText,a.value]]),s.value?(e.openBlock(),e.createElementBlock("div",hc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",bc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!a.value,onClick:k},"应用",8,kc),e.createElementVNode("button",{class:"zm-data-btn",onClick:A[6]||(A[6]=C=>{a.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:A[7]||(A[7]=C=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",yc,[e.createVNode(ic,{value:t.data,query:g.value,"collapsed-paths":p.value},null,8,["value","query","collapsed-paths"])]),A[17]||(A[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))]))}}),Ec={class:"zm-md-panel"},xc={key:0,class:"zm-md-error"},wc={class:"zm-md-split"},Nc={class:"zm-md-edit"},Sc={class:"zm-md-preview"},Tc={class:"zm-md-preview-body"},Cc={class:"zm-md-footer"},_c=["disabled"],Ac=`# flow-mindmap 思维导图
27
24
 
28
25
  [GitHub 仓库](https://github.com/xz333221/flow-mindmap)
29
26
 
@@ -62,16 +59,19 @@ https://github.com/highlightjs/highlight.js/issues/2277`),X=N,j=$),L===void 0&&(
62
59
 
63
60
  ## 开源协议
64
61
  [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
65
- `,Td=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,r=e.ref(Wt(n.data)),a=e.ref(null),c=e.ref(null),u=e.computed(()=>{try{const _=Ht(r.value||"");return a.value=null,_}catch(_){return a.value=_.message,{id:"preview_fallback",text:r.value||"(空)",children:[]}}}),s=e.computed(()=>pt(u.value));let m=null;e.watch(r,()=>{m&&clearTimeout(m),m=setTimeout(()=>{var _;return(_=c.value)==null?void 0:_.resetView()},250)});function p(){try{const _=Ht(r.value||"");a.value=null,i("import",_)}catch(_){a.value=_.message}}function g(){r.value=Wt(n.data),a.value=null,e.nextTick(()=>{var _;return(_=c.value)==null?void 0:_.resetView()})}function y(){r.value="",a.value=null,e.nextTick(()=>{var _;return(_=c.value)==null?void 0:_.resetView()})}function w(){const _=document.createElement("input");_.type="file",_.accept=".md,text/markdown,text/plain",_.onchange=()=>{var S;const x=(S=_.files)==null?void 0:S[0];if(!x)return;const R=new FileReader;R.onload=()=>{typeof R.result=="string"&&(r.value=R.result,a.value=null,e.nextTick(()=>{var A;return(A=c.value)==null?void 0:A.resetView()}))},R.readAsText(x)},_.click()}function k(){const _=new Blob([r.value],{type:"text/markdown;charset=utf-8"}),x=URL.createObjectURL(_),R=document.createElement("a");R.href=x;const S=(n.data.text||"mindmap").trim()||"mindmap";R.download=`${S}.md`,R.click(),URL.revokeObjectURL(x)}function b(){r.value=Sd,a.value=null,e.nextTick(()=>{var _;return(_=c.value)==null?void 0:_.resetView()})}return(_,x)=>(e.openBlock(),e.createElementBlock("div",hd,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:w},[...x[1]||(x[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:k},[...x[2]||(x[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)])]),x[3]||(x[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:b},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:g},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:y},"清空")]),a.value?(e.openBlock(),e.createElementBlock("div",bd,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",kd,[e.createElementVNode("div",yd,[x[4]||(x[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":x[0]||(x[0]=R=>r.value=R),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("div",Ed,[x[5]||(x[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",xd,[e.createVNode(Hn,{ref_key:"previewRef",ref:c,data:s.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",wd,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!r.value.trim(),onClick:p},"应用到导图",8,Nd)])]))}}),er=20;function Cd(t,o){t.style.height="auto";const n=o.minRows*er,i=o.maxRows>0?o.maxRows*er:1/0,r=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=r+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function _o(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const a=t.value;a&&Cd(a,n)}function r(){i()}e.onMounted(async()=>{await e.nextTick();const a=t.value;a&&(a.addEventListener("input",r),i())}),e.watch(()=>{var a;return(a=t.value)==null?void 0:a.value},()=>i()),e.onBeforeUnmount(()=>{const a=t.value;a&&a.removeEventListener("input",r)})}function Ao(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lt=Ao();function tr(t){Lt=t}var Dt={exec:()=>null};function Zt(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),r=o[i];return r||(r=t(i),o[i]=r),r}}function be(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(r,a)=>{let c=typeof a=="string"?a:a.source;return c=c.replace(qe.caret,"$1"),n=n.replace(r,c),i},getRegex:()=>new RegExp(n,o)};return i}var _d=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),qe={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:Zt(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Zt(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Zt(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Zt(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Zt(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Zt(t=>new RegExp(`^ {0,${t}}>`))},Ad=/^(?:[ \t]*(?:\n|$))+/,Rd=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Md=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,bn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Bd=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ro=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,nr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,or=be(nr).replace(/bull/g,Ro).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(),zd=be(nr).replace(/bull/g,Ro).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(),Mo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Od=/^[^\n]+/,Bo=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Id=be(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Bo).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),vd=be(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ro).getRegex(),Gn="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",zo=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ld=be("^ {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",zo).replace("tag",Gn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ir=be(Mo).replace("hr",bn).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",Gn).getRegex(),Dd=be(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ir).getRegex(),Oo={blockquote:Dd,code:Rd,def:Id,fences:Md,heading:Bd,hr:bn,html:Ld,lheading:or,list:vd,newline:Ad,paragraph:ir,table:Dt,text:Od},rr=be("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",bn).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",Gn).getRegex(),Vd={...Oo,lheading:zd,table:rr,paragraph:be(Mo).replace("hr",bn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",rr).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",Gn).getRegex()},$d={...Oo,html:be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zo).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:Dt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:be(Mo).replace("hr",bn).replace("heading",` *#{1,6} *[^
66
- ]`).replace("lheading",or).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Pd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ud=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,lr=/^( {2,}|\\)\n(?!\s*$)/,Fd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Xt=/[\p{P}\p{S}]/u,jn=/[\s\p{P}\p{S}]/u,Io=/[^\s\p{P}\p{S}]/u,Hd=be(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,jn).getRegex(),ar=/(?!~)[\p{P}\p{S}]/u,Wd=/(?!~)[\s\p{P}\p{S}]/u,Gd=/(?:[^\s\p{P}\p{S}]|~)/u,jd=be(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",_d?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),sr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Kd=be(sr,"u").replace(/punct/g,Xt).getRegex(),qd=be(sr,"u").replace(/punct/g,ar).getRegex(),cr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Yd=be(cr,"gu").replace(/notPunctSpace/g,Io).replace(/punctSpace/g,jn).replace(/punct/g,Xt).getRegex(),Zd=be(cr,"gu").replace(/notPunctSpace/g,Gd).replace(/punctSpace/g,Wd).replace(/punct/g,ar).getRegex(),Xd=be("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Io).replace(/punctSpace/g,jn).replace(/punct/g,Xt).getRegex(),Jd=be(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Xt).getRegex(),Qd="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",eu=be(Qd,"gu").replace(/notPunctSpace/g,Io).replace(/punctSpace/g,jn).replace(/punct/g,Xt).getRegex(),tu=be(/\\(punct)/,"gu").replace(/punct/g,Xt).getRegex(),nu=be(/^<(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(),ou=be(zo).replace("(?:-->|$)","-->").getRegex(),iu=be("^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",ou).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Kn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ru=be(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Kn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),dr=be(/^!?\[(label)\]\[(ref)\]/).replace("label",Kn).replace("ref",Bo).getRegex(),ur=be(/^!?\[(ref)\](?:\[\])?/).replace("ref",Bo).getRegex(),lu=be("reflink|nolink(?!\\()","g").replace("reflink",dr).replace("nolink",ur).getRegex(),mr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,vo={_backpedal:Dt,anyPunctuation:tu,autolink:nu,blockSkip:jd,br:lr,code:Ud,del:Dt,delLDelim:Dt,delRDelim:Dt,emStrongLDelim:Kd,emStrongRDelimAst:Yd,emStrongRDelimUnd:Xd,escape:Pd,link:ru,nolink:ur,punctuation:Hd,reflink:dr,reflinkSearch:lu,tag:iu,text:Fd,url:Dt},au={...vo,link:be(/^!?\[(label)\]\((.*?)\)/).replace("label",Kn).getRegex(),reflink:be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Kn).getRegex()},Lo={...vo,emStrongRDelimAst:Zd,emStrongLDelim:qd,delLDelim:Jd,delRDelim:eu,url:be(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",mr).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:be(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",mr).getRegex()},su={...Lo,br:be(lr).replace("{2,}","*").getRegex(),text:be(Lo.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qn={normal:Oo,gfm:Vd,pedantic:$d},kn={normal:vo,gfm:Lo,breaks:su,pedantic:au},cu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fr=t=>cu[t];function gt(t,o){if(o){if(qe.escapeTest.test(t))return t.replace(qe.escapeReplace,fr)}else if(qe.escapeTestNoEncode.test(t))return t.replace(qe.escapeReplaceNoEncode,fr);return t}function pr(t){try{t=encodeURI(t).replace(qe.percentDecode,"%")}catch{return null}return t}function gr(t,o){var a;let n=t.replace(qe.findPipe,(c,u,s)=>{let m=!1,p=u;for(;--p>=0&&s[p]==="\\";)m=!m;return m?"|":" |"}),i=n.split(qe.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!((a=i.at(-1))!=null&&a.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(qe.slashPipe,"|");return i}function Mt(t,o,n){let i=t.length;if(i===0)return"";let r=0;for(;r<i&&t.charAt(i-r-1)===o;)r++;return t.slice(0,i-r)}function hr(t){let o=t.split(`
62
+ `,Ao=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,r=e.ref(Wt(n.data)),a=e.ref(null),s=e.ref(null),u=e.computed(()=>{try{const _=Ht(r.value||"");return a.value=null,_}catch(_){return a.value=_.message,{id:"preview_fallback",text:r.value||"(空)",children:[]}}}),c=e.computed(()=>pt(u.value));let m=null;e.watch(r,()=>{m&&clearTimeout(m),m=setTimeout(()=>{var _;return(_=s.value)==null?void 0:_.resetView()},250)});function p(){try{const _=Ht(r.value||"");a.value=null,i("import",_)}catch(_){a.value=_.message}}function g(){r.value=Wt(n.data),a.value=null,e.nextTick(()=>{var _;return(_=s.value)==null?void 0:_.resetView()})}function y(){r.value="",a.value=null,e.nextTick(()=>{var _;return(_=s.value)==null?void 0:_.resetView()})}function w(){const _=document.createElement("input");_.type="file",_.accept=".md,text/markdown,text/plain",_.onchange=()=>{var S;const x=(S=_.files)==null?void 0:S[0];if(!x)return;const M=new FileReader;M.onload=()=>{typeof M.result=="string"&&(r.value=M.result,a.value=null,e.nextTick(()=>{var A;return(A=s.value)==null?void 0:A.resetView()}))},M.readAsText(x)},_.click()}function k(){const _=new Blob([r.value],{type:"text/markdown;charset=utf-8"}),x=URL.createObjectURL(_),M=document.createElement("a");M.href=x;const S=(n.data.text||"mindmap").trim()||"mindmap";M.download=`${S}.md`,M.click(),URL.revokeObjectURL(x)}function b(){r.value=Ac,a.value=null,e.nextTick(()=>{var _;return(_=s.value)==null?void 0:_.resetView()})}return(_,x)=>(e.openBlock(),e.createElementBlock("div",Ec,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:w},[...x[1]||(x[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:k},[...x[2]||(x[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)])]),x[3]||(x[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:b},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:g},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:y},"清空")]),a.value?(e.openBlock(),e.createElementBlock("div",xc,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",wc,[e.createElementVNode("div",Nc,[x[4]||(x[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":x[0]||(x[0]=M=>r.value=M),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("div",Sc,[x[5]||(x[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Tc,[e.createVNode(Wn,{ref_key:"previewRef",ref:s,data:c.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Cc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!r.value.trim(),onClick:p},"应用到导图",8,_c)])]))}}),Mc={class:"zm-settings-panel"},Rc={key:0,class:"zm-settings-section"},Bc={class:"zm-settings-row"},zc=["value"],Oc={class:"zm-slider"},Ic=["value"],vc={class:"zm-settings-row"},Lc=["value"],Dc={class:"zm-slider"},Vc=["value"],$c={class:"zm-settings-row"},Pc={class:"zm-line-style-group"},Fc=["title","onClick"],Uc=["viewBox"],Hc={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Wc={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Gc={class:"zm-line-style-label"},jc={class:"zm-settings-row"},Kc={key:0,class:"zm-palette-picker"},qc={class:"zm-palette-grid"},Yc=["title","onClick"],Zc={class:"zm-palette-card-name"},Xc={class:"zm-palette-card-swatches"},Jc={key:0,class:"zm-palette-customs"},Qc=["title","onClick"],ed={class:"zm-palette-card-name"},td={class:"zm-palette-card-swatches"},nd=["value","onInput"],od={class:"zm-palette-custom-actions"},id=["onClick"],rd=["onClick"],ld={class:"zm-settings-row"},ad={class:"zm-settings-row"},sd={class:"zm-settings-preview"},cd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},dd=["x1","y1","x2","y2","stroke","stroke-width"],ud={key:1,class:"zm-settings-section"},md={class:"zm-settings-row"},fd={class:"zm-settings-value-tag"},pd={class:"zm-settings-row"},gd={class:"zm-settings-value-tag"},hd={class:"zm-settings-row"},bd={class:"zm-settings-value-tag"},kd={class:"zm-settings-row"},yd={key:2,class:"zm-settings-section"},Ed={class:"zm-settings-section-title"},xd={key:0,class:"zm-settings-section-sub"},wd={class:"zm-settings-row"},Nd={class:"zm-settings-value-tag"},Sd={class:"zm-swatch-row"},Td=["title","onClick"],Cd={class:"zm-settings-row"},_d={class:"zm-settings-value-tag"},Ad={class:"zm-swatch-row"},Md=["title","onClick"],Rd={class:"zm-settings-row"},Bd={class:"zm-settings-section"},Mo=((t,o)=>{const n=t.__vccOpts||t;for(const[i,r]of o)n[i]=r;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,i=o;function r(C,h){i("update:settings",{[C]:h})}e.computed(()=>{const C=n.settings.lineWidthStart;return C<1.2?"细":C<2.5?"中":C<4?"粗":"极粗"}),e.computed(()=>{const C=n.settings.lineWidthEnd;return C<.6?"极细":C<1.2?"细":C<2?"中":"粗"});const a=[{value:"curve",label:"圆弧",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"}],s=e.reactive({fontWeight:400});function u(){i("update:nodeStyle",{...s})}function c(){s.bg=void 0,s.textColor=void 0,s.borderColor=void 0,s.fontWeight=400,i("update:nodeStyle",{...s})}const m=e.reactive({});function p(C){return m[C.id]===void 0&&(m[C.id]=C.colors.join(`
63
+ `)),m[C.id]}function g(C){const h=m[C.id]??"",O=bl(h);if(O.length===0){m[C.id]=C.colors.join(`
64
+ `);return}const W=n.settings.customPalettes.map(oe=>oe.id===C.id?{...oe,colors:O}:oe);i("update:settings",{customPalettes:W})}function y(){const C=k.value.find(K=>K.id===n.settings.branchPaletteId),h=C?[...C.colors]:[...Nt[0].colors],O="custom-";let W=O+(n.settings.customPalettes.length+1);for(;Nt.some(K=>K.id===W)||n.settings.customPalettes.some(K=>K.id===W);)W=O+Math.random().toString(36).slice(2,7);const oe={id:W,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:h};i("update:settings",{customPalettes:[...n.settings.customPalettes,oe],branchPaletteId:W}),m[W]=h.join(`
65
+ `)}function w(C){const h=n.settings.customPalettes.filter(W=>W.id!==C.id),O=n.settings.branchPaletteId===C.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:h,...O!==n.settings.branchPaletteId?{branchPaletteId:O}:{}}),delete m[C.id]}const k=e.computed(()=>[...Nt,...n.settings.customPalettes]),b=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],_=[0,1,2,3],x=["#f87171","#fb923c","#34d399","#818cf8"];function M(C,h,O,W){if(h<=1)return O;const oe=C/(h-1);return O+(W-O)*oe}function S(C,h,O){return C<=0?h:C===1?Math.max(1.5,h*.67):C===2?Math.max(.8,h*.42):O}const A=e.computed(()=>{const C=n.settings.lineWidthStart,h=n.settings.lineWidthEnd,O=n.settings.taperedEdge,W=_.length,oe=8,K=192,te=k.value.find(G=>G.id===n.settings.branchPaletteId),le=te&&te.colors.length?te.colors:x;return _.map((G,Y)=>{const F=10+Y*60/(W-1);return{x1:oe,y1:F,x2:K,y2:F,w:O?S(G,C,h):M(G,W,C,h),color:n.settings.rainbowBranch?le[Y%le.length]:"#94a3b8"}})});return(C,h)=>(e.openBlock(),e.createElementBlock("div",Mc,[t.hasSelection?(e.openBlock(),e.createElementBlock("section",ud,[h[32]||(h[32]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",md,[h[27]||(h[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端",-1)),e.createElementVNode("span",fd,e.toDisplayString(t.settings.lineWidthStart.toFixed(1)),1)]),e.createElementVNode("div",pd,[h[28]||(h[28]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端",-1)),e.createElementVNode("span",gd,e.toDisplayString(t.settings.lineWidthEnd.toFixed(1)),1)]),e.createElementVNode("div",hd,[h[29]||(h[29]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("span",bd,e.toDisplayString(t.settings.lineStyle==="curve"?"圆弧":"直线"),1)]),e.createElementVNode("label",kd,[h[31]||(h[31]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:h[7]||(h[7]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...h[30]||(h[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[33]||(h[33]=e.createElementVNode("p",{class:"zm-settings-hint"},"画布级别的设置会影响整张图。",-1))])):(e.openBlock(),e.createElementBlock("section",Rc,[h[23]||(h[23]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Bc,[h[12]||(h[12]=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:h[0]||(h[0]=O=>r("lineWidthStart",parseFloat(O.target.value)||0))},null,40,zc)]),e.createElementVNode("div",Oc,[e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:h[1]||(h[1]=O=>r("lineWidthStart",parseFloat(O.target.value)))},null,40,Ic)]),e.createElementVNode("div",vc,[h[13]||(h[13]=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:h[2]||(h[2]=O=>r("lineWidthEnd",parseFloat(O.target.value)||0))},null,40,Lc)]),e.createElementVNode("div",Dc,[e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:h[3]||(h[3]=O=>r("lineWidthEnd",parseFloat(O.target.value)))},null,40,Vc)]),e.createElementVNode("div",$c,[h[14]||(h[14]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",Pc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,O=>e.createElementVNode("button",{key:O.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===O.value}]),title:O.label,onClick:W=>r("lineStyle",O.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:O.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[O.value==="curve"?(e.openBlock(),e.createElementBlock("path",Hc)):(e.openBlock(),e.createElementBlock("line",Wc))],8,Uc)),e.createElementVNode("span",Gc,e.toDisplayString(O.label),1)],10,Fc)),64))])]),e.createElementVNode("label",jc,[h[16]||(h[16]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:h[4]||(h[4]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...h[15]||(h[15]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[24]||(h[24]=e.createElementVNode("p",{class:"zm-settings-hint"},"关闭时所有线条使用统一的 lineColor。",-1)),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Kc,[h[17]||(h[17]=e.createElementVNode("h5",{class:"zm-palette-picker-title"},"配色方案",-1)),e.createElementVNode("div",qc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Nt),O=>(e.openBlock(),e.createElementBlock("button",{key:O.id,type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===O.id}]),title:O.name,onClick:W=>r("branchPaletteId",O.id)},[e.createElementVNode("span",Zc,e.toDisplayString(O.name),1),e.createElementVNode("span",Xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(W,oe)=>(e.openBlock(),e.createElementBlock("span",{key:oe,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:W})},null,4))),128))])],10,Yc))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("div",Jc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,O=>(e.openBlock(),e.createElementBlock("div",{key:O.id,class:"zm-palette-custom"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===O.id}]),title:O.name,onClick:W=>r("branchPaletteId",O.id)},[e.createElementVNode("span",ed,e.toDisplayString(O.name),1),e.createElementVNode("span",td,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(W,oe)=>(e.openBlock(),e.createElementBlock("span",{key:oe,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:W})},null,4))),128))])],10,Qc),e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"2",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:p(O),onInput:W=>m[O.id]=W.target.value},null,40,nd),e.createElementVNode("div",od,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:W=>g(O)},"保存",8,id),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:W=>w(O)},"删除",8,rd)])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:y},"+ 新建配色")])):e.createCommentVNode("",!0),e.createElementVNode("label",ld,[h[19]||(h[19]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:h[5]||(h[5]=O=>r("taperedEdge",!t.settings.taperedEdge))},[...h[18]||(h[18]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[25]||(h[25]=e.createElementVNode("p",{class:"zm-settings-hint"}," 开启时每条边都从根部粗端收回到细端子端,父子边之间可能形成粗细跳变; 关闭时整棵树从最粗平滑过渡到最细,所有边连成一条带子。 ",-1)),e.createElementVNode("label",ad,[h[21]||(h[21]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:h[6]||(h[6]=O=>r("showOrderBadge",!t.settings.showOrderBadge))},[...h[20]||(h[20]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[26]||(h[26]=e.createElementVNode("p",{class:"zm-settings-hint"}," 在每个节点右上角标注它是同级中的第几个 (1, 2, 3, ...), 方便对比画布位置与数据顺序。 ",-1)),e.createElementVNode("div",sd,[(e.openBlock(),e.createElementBlock("svg",cd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,(O,W)=>(e.openBlock(),e.createElementBlock("line",{key:W,x1:O.x1,y1:O.y1,x2:O.x2,y2:O.y2,stroke:t.settings.rainbowBranch?O.color:"#94a3b8","stroke-width":O.w,"stroke-linecap":"butt"},null,8,dd))),128))])),h[22]||(h[22]=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",yd,[e.createElementVNode("h4",Ed,[h[34]||(h[34]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",xd,"“"+e.toDisplayString(t.selectedNodeText)+"”",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",wd,[h[35]||(h[35]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",Nd,e.toDisplayString(s.bg||"默认"),1)]),e.createElementVNode("div",Sd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(b,O=>e.createElementVNode("button",{key:"bg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:W=>s.bg=O},null,12,Td)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:h[8]||(h[8]=O=>s.bg=void 0)},"∅")]),e.createElementVNode("div",Cd,[h[36]||(h[36]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",_d,e.toDisplayString(s.textColor||"默认"),1)]),e.createElementVNode("div",Ad,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(b,O=>e.createElementVNode("button",{key:"fg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:W=>s.textColor=O},null,12,Md)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:h[9]||(h[9]=O=>s.textColor=void 0)},"∅")]),e.createElementVNode("div",Rd,[h[38]||(h[38]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":s.fontWeight===600}]),onClick:h[10]||(h[10]=O=>s.fontWeight=s.fontWeight===600?400:600)},[...h[37]||(h[37]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",{class:"zm-data-paste-actions"},[e.createElementVNode("button",{class:"zm-data-btn is-primary",onClick:u},"应用到该节点"),e.createElementVNode("button",{class:"zm-data-btn",onClick:c},"清除该节点样式")]),h[39]||(h[39]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Bd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:h[11]||(h[11]=O=>i("reset"))},"恢复默认设置")])]))}}),[["__scopeId","data-v-17ef65d1"]]),ir=20;function zd(t,o){t.style.height="auto";const n=o.minRows*ir,i=o.maxRows>0?o.maxRows*ir:1/0,r=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=r+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function Ro(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const a=t.value;a&&zd(a,n)}function r(){i()}e.onMounted(async()=>{await e.nextTick();const a=t.value;a&&(a.addEventListener("input",r),i())}),e.watch(()=>{var a;return(a=t.value)==null?void 0:a.value},()=>i()),e.onBeforeUnmount(()=>{const a=t.value;a&&a.removeEventListener("input",r)})}function Bo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lt=Bo();function rr(t){Lt=t}var Dt={exec:()=>null};function Xt(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),r=o[i];return r||(r=t(i),o[i]=r),r}}function be(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(r,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(qe.caret,"$1"),n=n.replace(r,s),i},getRegex:()=>new RegExp(n,o)};return i}var Od=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),qe={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:Xt(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Xt(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Xt(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Xt(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Xt(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Xt(t=>new RegExp(`^ {0,${t}}>`))},Id=/^(?:[ \t]*(?:\n|$))+/,vd=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ld=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,kn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Dd=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,lr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ar=be(lr).replace(/bull/g,zo).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(),Vd=be(lr).replace(/bull/g,zo).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(),Oo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$d=/^[^\n]+/,Io=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Pd=be(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Io).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Fd=be(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,zo).getRegex(),Gn="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",vo=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ud=be("^ {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",vo).replace("tag",Gn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sr=be(Oo).replace("hr",kn).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",Gn).getRegex(),Hd=be(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sr).getRegex(),Lo={blockquote:Hd,code:vd,def:Pd,fences:Ld,heading:Dd,hr:kn,html:Ud,lheading:ar,list:Fd,newline:Id,paragraph:sr,table:Dt,text:$d},cr=be("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",kn).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",Gn).getRegex(),Wd={...Lo,lheading:Vd,table:cr,paragraph:be(Oo).replace("hr",kn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",cr).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",Gn).getRegex()},Gd={...Lo,html:be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vo).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:Dt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:be(Oo).replace("hr",kn).replace("heading",` *#{1,6} *[^
66
+ ]`).replace("lheading",ar).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Kd=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,dr=/^( {2,}|\\)\n(?!\s*$)/,qd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Jt=/[\p{P}\p{S}]/u,jn=/[\s\p{P}\p{S}]/u,Do=/[^\s\p{P}\p{S}]/u,Yd=be(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,jn).getRegex(),ur=/(?!~)[\p{P}\p{S}]/u,Zd=/(?!~)[\s\p{P}\p{S}]/u,Xd=/(?:[^\s\p{P}\p{S}]|~)/u,Jd=be(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Od?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),mr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Qd=be(mr,"u").replace(/punct/g,Jt).getRegex(),eu=be(mr,"u").replace(/punct/g,ur).getRegex(),fr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",tu=be(fr,"gu").replace(/notPunctSpace/g,Do).replace(/punctSpace/g,jn).replace(/punct/g,Jt).getRegex(),nu=be(fr,"gu").replace(/notPunctSpace/g,Xd).replace(/punctSpace/g,Zd).replace(/punct/g,ur).getRegex(),ou=be("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Do).replace(/punctSpace/g,jn).replace(/punct/g,Jt).getRegex(),iu=be(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Jt).getRegex(),ru="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",lu=be(ru,"gu").replace(/notPunctSpace/g,Do).replace(/punctSpace/g,jn).replace(/punct/g,Jt).getRegex(),au=be(/\\(punct)/,"gu").replace(/punct/g,Jt).getRegex(),su=be(/^<(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(),cu=be(vo).replace("(?:-->|$)","-->").getRegex(),du=be("^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",cu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Kn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,uu=be(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Kn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pr=be(/^!?\[(label)\]\[(ref)\]/).replace("label",Kn).replace("ref",Io).getRegex(),gr=be(/^!?\[(ref)\](?:\[\])?/).replace("ref",Io).getRegex(),mu=be("reflink|nolink(?!\\()","g").replace("reflink",pr).replace("nolink",gr).getRegex(),hr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Vo={_backpedal:Dt,anyPunctuation:au,autolink:su,blockSkip:Jd,br:dr,code:Kd,del:Dt,delLDelim:Dt,delRDelim:Dt,emStrongLDelim:Qd,emStrongRDelimAst:tu,emStrongRDelimUnd:ou,escape:jd,link:uu,nolink:gr,punctuation:Yd,reflink:pr,reflinkSearch:mu,tag:du,text:qd,url:Dt},fu={...Vo,link:be(/^!?\[(label)\]\((.*?)\)/).replace("label",Kn).getRegex(),reflink:be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Kn).getRegex()},$o={...Vo,emStrongRDelimAst:nu,emStrongLDelim:eu,delLDelim:iu,delRDelim:lu,url:be(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",hr).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:be(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",hr).getRegex()},pu={...$o,br:be(dr).replace("{2,}","*").getRegex(),text:be($o.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qn={normal:Lo,gfm:Wd,pedantic:Gd},yn={normal:Vo,gfm:$o,breaks:pu,pedantic:fu},gu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},br=t=>gu[t];function gt(t,o){if(o){if(qe.escapeTest.test(t))return t.replace(qe.escapeReplace,br)}else if(qe.escapeTestNoEncode.test(t))return t.replace(qe.escapeReplaceNoEncode,br);return t}function kr(t){try{t=encodeURI(t).replace(qe.percentDecode,"%")}catch{return null}return t}function yr(t,o){var a;let n=t.replace(qe.findPipe,(s,u,c)=>{let m=!1,p=u;for(;--p>=0&&c[p]==="\\";)m=!m;return m?"|":" |"}),i=n.split(qe.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!((a=i.at(-1))!=null&&a.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(qe.slashPipe,"|");return i}function Rt(t,o,n){let i=t.length;if(i===0)return"";let r=0;for(;r<i&&t.charAt(i-r-1)===o;)r++;return t.slice(0,i-r)}function Er(t){let o=t.split(`
67
67
  `),n=o.length-1;for(;n>=0&&qe.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
68
- `)}function du(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 uu(t,o=0){let n=o,i="";for(let r of t)if(r===" "){let a=4-n%4;i+=" ".repeat(a),n+=a}else i+=r,n++;return i}function br(t,o,n,i,r){let a=o.href,c=o.title||null,u=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let s={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:c,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,s}function mu(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let r=i[1];return o.split(`
69
- `).map(a=>{let c=a.match(n.other.beginningSpace);if(c===null)return a;let[u]=c;return u.length>=r.length?a.slice(r.length):a}).join(`
70
- `)}var Yn=class{constructor(t){_e(this,"options");_e(this,"rules");_e(this,"lexer");this.options=t||Lt}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]:hr(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=mu(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=Mt(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:Mt(o[0],`
71
- `),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:Mt(o[0],`
72
- `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=Mt(o[0],`
68
+ `)}function hu(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 bu(t,o=0){let n=o,i="";for(let r of t)if(r===" "){let a=4-n%4;i+=" ".repeat(a),n+=a}else i+=r,n++;return i}function xr(t,o,n,i,r){let a=o.href,s=o.title||null,u=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let c={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:s,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,c}function ku(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let r=i[1];return o.split(`
69
+ `).map(a=>{let s=a.match(n.other.beginningSpace);if(s===null)return a;let[u]=s;return u.length>=r.length?a.slice(r.length):a}).join(`
70
+ `)}var Yn=class{constructor(t){Ae(this,"options");Ae(this,"rules");Ae(this,"lexer");this.options=t||Lt}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]:Er(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=ku(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=Rt(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:Rt(o[0],`
71
+ `),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:Rt(o[0],`
72
+ `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=Rt(o[0],`
73
73
  `).split(`
74
- `),i="",r="",a=[];for(;n.length>0;){let c=!1,u=[],s;for(s=0;s<n.length;s++)if(this.rules.other.blockquoteStart.test(n[s]))u.push(n[s]),c=!0;else if(!c)u.push(n[s]);else break;n=n.slice(s);let m=u.join(`
74
+ `),i="",r="",a=[];for(;n.length>0;){let s=!1,u=[],c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))u.push(n[c]),s=!0;else if(!s)u.push(n[c]);else break;n=n.slice(c);let m=u.join(`
75
75
  `),p=m.replace(this.rules.other.blockquoteSetextReplace,`
76
76
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
77
77
  ${m}`:m,r=r?`${r}
@@ -80,56 +80,56 @@ ${p}`:p;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
80
80
  `),b=this.blockquote(k);a[a.length-1]=b,i=i.substring(0,i.length-w.raw.length)+b.raw,r=r.substring(0,r.length-w.text.length)+b.text;break}else if((y==null?void 0:y.type)==="list"){let w=y,k=w.raw+`
81
81
  `+n.join(`
82
82
  `),b=this.list(k);a[a.length-1]=b,i=i.substring(0,i.length-y.raw.length)+b.raw,r=r.substring(0,r.length-w.raw.length)+b.raw,n=k.substring(a.at(-1).raw.length).split(`
83
- `);continue}}return{type:"blockquote",raw:i,tokens:a,text:r}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,r={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 a=this.rules.other.listItemRegex(n),c=!1;for(;t;){let s=!1,m="",p="";if(!(o=a.exec(t))||this.rules.block.hr.test(t))break;m=o[0],t=t.substring(m.length);let g=uu(o[2].split(`
83
+ `);continue}}return{type:"blockquote",raw:i,tokens:a,text:r}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,r={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 a=this.rules.other.listItemRegex(n),s=!1;for(;t;){let c=!1,m="",p="";if(!(o=a.exec(t))||this.rules.block.hr.test(t))break;m=o[0],t=t.substring(m.length);let g=bu(o[2].split(`
84
84
  `,1)[0],o[1].length),y=t.split(`
85
85
  `,1)[0],w=!g.trim(),k=0;if(this.options.pedantic?(k=2,p=g.trimStart()):w?k=o[1].length+1:(k=g.search(this.rules.other.nonSpaceChar),k=k>4?1:k,p=g.slice(k),k+=o[1].length),w&&this.rules.other.blankLine.test(y)&&(m+=y+`
86
- `,t=t.substring(y.length+1),s=!0),!s){let b=this.rules.other.nextBulletRegex(k),_=this.rules.other.hrRegex(k),x=this.rules.other.fencesBeginRegex(k),R=this.rules.other.headingBeginRegex(k),S=this.rules.other.htmlBeginRegex(k),A=this.rules.other.blockquoteBeginRegex(k);for(;t;){let C=t.split(`
87
- `,1)[0],h;if(y=C,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),h=y):h=y.replace(this.rules.other.tabCharGlobal," "),x.test(y)||R.test(y)||S.test(y)||A.test(y)||b.test(y)||_.test(y))break;if(h.search(this.rules.other.nonSpaceChar)>=k||!y.trim())p+=`
88
- `+h.slice(k);else{if(w||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(g)||R.test(g)||_.test(g))break;p+=`
86
+ `,t=t.substring(y.length+1),c=!0),!c){let b=this.rules.other.nextBulletRegex(k),_=this.rules.other.hrRegex(k),x=this.rules.other.fencesBeginRegex(k),M=this.rules.other.headingBeginRegex(k),S=this.rules.other.htmlBeginRegex(k),A=this.rules.other.blockquoteBeginRegex(k);for(;t;){let C=t.split(`
87
+ `,1)[0],h;if(y=C,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),h=y):h=y.replace(this.rules.other.tabCharGlobal," "),x.test(y)||M.test(y)||S.test(y)||A.test(y)||b.test(y)||_.test(y))break;if(h.search(this.rules.other.nonSpaceChar)>=k||!y.trim())p+=`
88
+ `+h.slice(k);else{if(w||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(g)||M.test(g)||_.test(g))break;p+=`
89
89
  `+y}w=!y.trim(),m+=C+`
90
- `,t=t.substring(C.length+1),g=h.slice(k)}}r.loose||(c?r.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0)),r.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),r.raw+=m}let u=r.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let s of r.items){this.lexer.state.top=!1,s.tokens=this.lexer.blockTokens(s.text,[]);let m=s.tokens[0];if(s.task&&((m==null?void 0:m.type)==="text"||(m==null?void 0:m.type)==="paragraph")){s.text=s.text.replace(this.rules.other.listReplaceTask,""),m.raw=m.raw.replace(this.rules.other.listReplaceTask,""),m.text=m.text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(s.raw);if(p){let g={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};s.checked=g.checked,r.loose?s.tokens[0]&&["paragraph","text"].includes(s.tokens[0].type)&&"tokens"in s.tokens[0]&&s.tokens[0].tokens?(s.tokens[0].raw=g.raw+s.tokens[0].raw,s.tokens[0].text=g.raw+s.tokens[0].text,s.tokens[0].tokens.unshift(g)):s.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):s.tokens.unshift(g)}}else s.task&&(s.task=!1);if(!r.loose){let p=s.tokens.filter(y=>y.type==="space"),g=p.length>0&&p.some(y=>this.rules.other.anyLine.test(y.raw));r.loose=g}}if(r.loose)for(let s of r.items){s.loose=!0;for(let m of s.tokens)m.type==="text"&&(m.type="paragraph")}return r}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=hr(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"):"",r=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:Mt(o[0],`
91
- `),href:i,title:r}}}table(t){var c;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=gr(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(c=o[3])!=null&&c.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
92
- `):[],a={type:"table",raw:Mt(o[0],`
93
- `),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u<n.length;u++)a.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:a.align[u]});for(let u of r)a.rows.push(gr(u,a.header.length).map((s,m)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:a.align[m]})));return a}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:Mt(o[0],`
90
+ `,t=t.substring(C.length+1),g=h.slice(k)}}r.loose||(s?r.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(s=!0)),r.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),r.raw+=m}let u=r.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let c of r.items){this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]);let m=c.tokens[0];if(c.task&&((m==null?void 0:m.type)==="text"||(m==null?void 0:m.type)==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),m.raw=m.raw.replace(this.rules.other.listReplaceTask,""),m.text=m.text.replace(this.rules.other.listReplaceTask,"");for(let g=this.lexer.inlineQueue.length-1;g>=0;g--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[g].src)){this.lexer.inlineQueue[g].src=this.lexer.inlineQueue[g].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(c.raw);if(p){let g={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};c.checked=g.checked,r.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=g.raw+c.tokens[0].raw,c.tokens[0].text=g.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(g)):c.tokens.unshift({type:"paragraph",raw:g.raw,text:g.raw,tokens:[g]}):c.tokens.unshift(g)}}else c.task&&(c.task=!1);if(!r.loose){let p=c.tokens.filter(y=>y.type==="space"),g=p.length>0&&p.some(y=>this.rules.other.anyLine.test(y.raw));r.loose=g}}if(r.loose)for(let c of r.items){c.loose=!0;for(let m of c.tokens)m.type==="text"&&(m.type="paragraph")}return r}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Er(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"):"",r=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:Rt(o[0],`
91
+ `),href:i,title:r}}}table(t){var s;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=yr(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(s=o[3])!=null&&s.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
92
+ `):[],a={type:"table",raw:Rt(o[0],`
93
+ `),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u<n.length;u++)a.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:a.align[u]});for(let u of r)a.rows.push(yr(u,a.header.length).map((c,m)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:a.align[m]})));return a}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:Rt(o[0],`
94
94
  `),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)===`
95
- `?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 a=Mt(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=du(o[2],"()");if(a===-2)return;if(a>-1){let c=(o[0].indexOf("!")===0?5:4)+o[1].length+a;o[2]=o[2].substring(0,a),o[0]=o[0].substring(0,c).trim(),o[3]=""}}let i=o[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],r=a[3])}else r=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)),br(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.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," "),r=o[i.toLowerCase()];if(!r){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return br(n,r,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 r=[...i[0]].length-1,a,c,u=r,s=0,m=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,o=o.slice(-1*t.length+r);(i=m.exec(o))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(c=[...a].length,i[3]||i[4]){u+=c;continue}else if((i[5]||i[6])&&r%3&&!((r+c)%3)){s+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+s);let p=[...i[0]][0].length,g=t.slice(0,r+i.index+p+c);if(Math.min(r,c)%2){let w=g.slice(1,-1);return{type:"em",raw:g,text:w,tokens:this.lexer.inlineTokens(w)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}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),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(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 r=[...i[0]].length-1,a,c,u=r,s=this.rules.inline.delRDelim;for(s.lastIndex=0,o=o.slice(-1*t.length+r);(i=s.exec(o))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(c=[...a].length,c!==r))continue;if(i[3]||i[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let m=[...i[0]][0].length,p=t.slice(0,r+i.index+m+c),g=p.slice(r,-r);return{type:"del",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}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,r;if(o[2]==="@")i=o[0],r="mailto:"+i;else{let a;do a=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(a!==o[0]);i=o[0],o[1]==="www."?r="http://"+o[0]:r=o[0]}return{type:"link",raw:o[0],text:i,href:r,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}}}},dt=class Jo{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||Lt,this.options.tokenizer=this.options.tokenizer||new Yn,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:qe,block:qn.normal,inline:kn.normal};this.options.pedantic?(n.block=qn.pedantic,n.inline=kn.pedantic):this.options.gfm&&(n.block=qn.gfm,this.options.breaks?n.inline=kn.breaks:n.inline=kn.gfm),this.tokenizer.rules=n}static get rules(){return{block:qn,inline:kn}}static lex(o,n){return new Jo(n).lex(o)}static lexInline(o,n){return new Jo(n).inlineTokens(o)}lex(o){o=o.replace(qe.carriageReturn,`
96
- `),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 a,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(qe.tabCharGlobal," ").replace(qe.spaceLine,""));let r=1/0;for(;o;){if(o.length<r)r=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let s;if((c=(a=this.options.extensions)==null?void 0:a.block)!=null&&c.some(p=>(s=p.call({lexer:this},o,n))?(o=o.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(o)){o=o.substring(s.raw.length);let p=n.at(-1);s.raw.length===1&&p!==void 0?p.raw+=`
97
- `:n.push(s);continue}if(s=this.tokenizer.code(o)){o=o.substring(s.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
95
+ `?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 a=Rt(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=hu(o[2],"()");if(a===-2)return;if(a>-1){let s=(o[0].indexOf("!")===0?5:4)+o[1].length+a;o[2]=o[2].substring(0,a),o[0]=o[0].substring(0,s).trim(),o[3]=""}}let i=o[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],r=a[3])}else r=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)),xr(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.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," "),r=o[i.toLowerCase()];if(!r){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return xr(n,r,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 r=[...i[0]].length-1,a,s,u=r,c=0,m=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,o=o.slice(-1*t.length+r);(i=m.exec(o))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(s=[...a].length,i[3]||i[4]){u+=s;continue}else if((i[5]||i[6])&&r%3&&!((r+s)%3)){c+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+c);let p=[...i[0]][0].length,g=t.slice(0,r+i.index+p+s);if(Math.min(r,s)%2){let w=g.slice(1,-1);return{type:"em",raw:g,text:w,tokens:this.lexer.inlineTokens(w)}}let y=g.slice(2,-2);return{type:"strong",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}}}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),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(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 r=[...i[0]].length-1,a,s,u=r,c=this.rules.inline.delRDelim;for(c.lastIndex=0,o=o.slice(-1*t.length+r);(i=c.exec(o))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(s=[...a].length,s!==r))continue;if(i[3]||i[4]){u+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u);let m=[...i[0]][0].length,p=t.slice(0,r+i.index+m+s),g=p.slice(r,-r);return{type:"del",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}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,r;if(o[2]==="@")i=o[0],r="mailto:"+i;else{let a;do a=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(a!==o[0]);i=o[0],o[1]==="www."?r="http://"+o[0]:r=o[0]}return{type:"link",raw:o[0],text:i,href:r,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}}}},dt=class ni{constructor(o){Ae(this,"tokens");Ae(this,"options");Ae(this,"state");Ae(this,"inlineQueue");Ae(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Lt,this.options.tokenizer=this.options.tokenizer||new Yn,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:qe,block:qn.normal,inline:yn.normal};this.options.pedantic?(n.block=qn.pedantic,n.inline=yn.pedantic):this.options.gfm&&(n.block=qn.gfm,this.options.breaks?n.inline=yn.breaks:n.inline=yn.gfm),this.tokenizer.rules=n}static get rules(){return{block:qn,inline:yn}}static lex(o,n){return new ni(n).lex(o)}static lexInline(o,n){return new ni(n).inlineTokens(o)}lex(o){o=o.replace(qe.carriageReturn,`
96
+ `),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 a,s,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(qe.tabCharGlobal," ").replace(qe.spaceLine,""));let r=1/0;for(;o;){if(o.length<r)r=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let c;if((s=(a=this.options.extensions)==null?void 0:a.block)!=null&&s.some(p=>(c=p.call({lexer:this},o,n))?(o=o.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.space(o)){o=o.substring(c.raw.length);let p=n.at(-1);c.raw.length===1&&p!==void 0?p.raw+=`
97
+ `:n.push(c);continue}if(c=this.tokenizer.code(o)){o=o.substring(c.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
98
98
  `)?"":`
99
- `)+s.raw,p.text+=`
100
- `+s.text,this.inlineQueue.at(-1).src=p.text):n.push(s);continue}if(s=this.tokenizer.fences(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(o)){o=o.substring(s.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
99
+ `)+c.raw,p.text+=`
100
+ `+c.text,this.inlineQueue.at(-1).src=p.text):n.push(c);continue}if(c=this.tokenizer.fences(o)){o=o.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.heading(o)){o=o.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.hr(o)){o=o.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.blockquote(o)){o=o.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.list(o)){o=o.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.html(o)){o=o.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.def(o)){o=o.substring(c.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
101
101
  `)?"":`
102
- `)+s.raw,p.text+=`
103
- `+s.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(o)){o=o.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(o)){o=o.substring(s.raw.length),n.push(s);continue}let m=o;if((u=this.options.extensions)!=null&&u.startBlock){let p=1/0,g=o.slice(1),y;this.options.extensions.startBlock.forEach(w=>{y=w.call({lexer:this},g),typeof y=="number"&&y>=0&&(p=Math.min(p,y))}),p<1/0&&p>=0&&(m=o.substring(0,p+1))}if(this.state.top&&(s=this.tokenizer.paragraph(m))){let p=n.at(-1);i&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
102
+ `)+c.raw,p.text+=`
103
+ `+c.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title},n.push(c));continue}if(c=this.tokenizer.table(o)){o=o.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.lheading(o)){o=o.substring(c.raw.length),n.push(c);continue}let m=o;if((u=this.options.extensions)!=null&&u.startBlock){let p=1/0,g=o.slice(1),y;this.options.extensions.startBlock.forEach(w=>{y=w.call({lexer:this},g),typeof y=="number"&&y>=0&&(p=Math.min(p,y))}),p<1/0&&p>=0&&(m=o.substring(0,p+1))}if(this.state.top&&(c=this.tokenizer.paragraph(m))){let p=n.at(-1);i&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
104
104
  `)?"":`
105
- `)+s.raw,p.text+=`
106
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(s),i=m.length!==o.length,o=o.substring(s.raw.length);continue}if(s=this.tokenizer.text(o)){o=o.substring(s.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
105
+ `)+c.raw,p.text+=`
106
+ `+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(c),i=m.length!==o.length,o=o.substring(c.raw.length);continue}if(c=this.tokenizer.text(o)){o=o.substring(c.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
107
107
  `)?"":`
108
- `)+s.raw,p.text+=`
109
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(s);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 m,p,g,y,w;this.tokenizer.lexer=this;let i=o,r=null;if(this.tokens.links){let k=Object.keys(this.tokens.links);if(k.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)k.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)a=r[2]?r[2].length:0,i=i.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((p=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:p.call({lexer:this},i))??i;let c=!1,u="",s=1/0;for(;o;){if(o.length<s)s=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}c||(u=""),c=!1;let k;if((y=(g=this.options.extensions)==null?void 0:g.inline)!=null&&y.some(_=>(k=_.call({lexer:this},o,n))?(o=o.substring(k.raw.length),n.push(k),!0):!1))continue;if(k=this.tokenizer.escape(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.tag(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.link(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(k.raw.length);let _=n.at(-1);k.type==="text"&&(_==null?void 0:_.type)==="text"?(_.raw+=k.raw,_.text+=k.text):n.push(k);continue}if(k=this.tokenizer.emStrong(o,i,u)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.codespan(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.br(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.del(o,i,u)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.autolink(o)){o=o.substring(k.raw.length),n.push(k);continue}if(!this.state.inLink&&(k=this.tokenizer.url(o))){o=o.substring(k.raw.length),n.push(k);continue}let b=o;if((w=this.options.extensions)!=null&&w.startInline){let _=1/0,x=o.slice(1),R;this.options.extensions.startInline.forEach(S=>{R=S.call({lexer:this},x),typeof R=="number"&&R>=0&&(_=Math.min(_,R))}),_<1/0&&_>=0&&(b=o.substring(0,_+1))}if(k=this.tokenizer.inlineText(b)){o=o.substring(k.raw.length),k.raw.slice(-1)!=="_"&&(u=k.raw.slice(-1)),c=!0;let _=n.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=k.raw,_.text+=k.text):n.push(k);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)}},yn=class{constructor(t){_e(this,"options");_e(this,"parser");this.options=t||Lt}space(t){return""}code({text:t,lang:o,escaped:n}){var a;let i=(a=(o||"").match(qe.notSpaceStart))==null?void 0:a[0],r=t.replace(qe.endingNewline,"")+`
108
+ `)+c.raw,p.text+=`
109
+ `+c.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(c);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 m,p,g,y,w;this.tokenizer.lexer=this;let i=o,r=null;if(this.tokens.links){let k=Object.keys(this.tokens.links);if(k.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)k.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)a=r[2]?r[2].length:0,i=i.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((p=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:p.call({lexer:this},i))??i;let s=!1,u="",c=1/0;for(;o;){if(o.length<c)c=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}s||(u=""),s=!1;let k;if((y=(g=this.options.extensions)==null?void 0:g.inline)!=null&&y.some(_=>(k=_.call({lexer:this},o,n))?(o=o.substring(k.raw.length),n.push(k),!0):!1))continue;if(k=this.tokenizer.escape(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.tag(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.link(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(k.raw.length);let _=n.at(-1);k.type==="text"&&(_==null?void 0:_.type)==="text"?(_.raw+=k.raw,_.text+=k.text):n.push(k);continue}if(k=this.tokenizer.emStrong(o,i,u)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.codespan(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.br(o)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.del(o,i,u)){o=o.substring(k.raw.length),n.push(k);continue}if(k=this.tokenizer.autolink(o)){o=o.substring(k.raw.length),n.push(k);continue}if(!this.state.inLink&&(k=this.tokenizer.url(o))){o=o.substring(k.raw.length),n.push(k);continue}let b=o;if((w=this.options.extensions)!=null&&w.startInline){let _=1/0,x=o.slice(1),M;this.options.extensions.startInline.forEach(S=>{M=S.call({lexer:this},x),typeof M=="number"&&M>=0&&(_=Math.min(_,M))}),_<1/0&&_>=0&&(b=o.substring(0,_+1))}if(k=this.tokenizer.inlineText(b)){o=o.substring(k.raw.length),k.raw.slice(-1)!=="_"&&(u=k.raw.slice(-1)),s=!0;let _=n.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=k.raw,_.text+=k.text):n.push(k);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)}},En=class{constructor(t){Ae(this,"options");Ae(this,"parser");this.options=t||Lt}space(t){return""}code({text:t,lang:o,escaped:n}){var a;let i=(a=(o||"").match(qe.notSpaceStart))==null?void 0:a[0],r=t.replace(qe.endingNewline,"")+`
110
110
  `;return i?'<pre><code class="language-'+gt(i)+'">'+(n?r:gt(r,!0))+`</code></pre>
111
111
  `:"<pre><code>"+(n?r:gt(r,!0))+`</code></pre>
112
112
  `}blockquote({tokens:t}){return`<blockquote>
113
113
  ${this.parser.parse(t)}</blockquote>
114
114
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
115
115
  `}hr(t){return`<hr>
116
- `}list(t){let o=t.ordered,n=t.start,i="";for(let c=0;c<t.items.length;c++){let u=t.items[c];i+=this.listitem(u)}let r=o?"ol":"ul",a=o&&n!==1?' start="'+n+'"':"";return"<"+r+a+`>
116
+ `}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 r=o?"ol":"ul",a=o&&n!==1?' start="'+n+'"':"";return"<"+r+a+`>
117
117
  `+i+"</"+r+`>
118
118
  `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
119
119
  `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
120
- `}table(t){let o="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);o+=this.tablerow({text:n});let i="";for(let r=0;r<t.rows.length;r++){let a=t.rows[r];n="";for(let c=0;c<a.length;c++)n+=this.tablecell(a[c]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
120
+ `}table(t){let o="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);o+=this.tablerow({text:n});let i="";for(let r=0;r<t.rows.length;r++){let a=t.rows[r];n="";for(let s=0;s<a.length;s++)n+=this.tablecell(a[s]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
121
121
  <thead>
122
122
  `+o+`</thead>
123
123
  `+i+`</table>
124
124
  `}tablerow({text:t}){return`<tr>
125
125
  ${t}</tr>
126
126
  `}tablecell(t){let o=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+o+`</${n}>
127
- `}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>${gt(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),r=pr(t);if(r===null)return i;t=r;let a='<a href="'+t+'"';return o&&(a+=' title="'+gt(o)+'"'),a+=">"+i+"</a>",a}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=pr(t);if(r===null)return gt(n);t=r;let a=`<img src="${t}" alt="${gt(n)}"`;return o&&(a+=` title="${gt(o)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:gt(t.text)}},Do=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}},ut=class Qo{constructor(o){_e(this,"options");_e(this,"renderer");_e(this,"textRenderer");this.options=o||Lt,this.options.renderer=this.options.renderer||new yn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Do}static parse(o,n){return new Qo(n).parse(o)}static parseInline(o,n){return new Qo(n).parseInline(o)}parse(o){var i,r;this.renderer.parser=this;let n="";for(let a=0;a<o.length;a++){let c=o[a];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[c.type]){let s=c,m=this.options.extensions.renderers[s.type].call({parser:this},s);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){n+=m||"";continue}}let u=c;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 s='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(o,n=this.renderer){var r,a;this.renderer.parser=this;let i="";for(let c=0;c<o.length;c++){let u=o[c];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[u.type]){let m=this.options.extensions.renderers[u.type].call({parser:this},u);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=m||"";continue}}let s=u;switch(s.type){case"escape":{i+=n.text(s);break}case"html":{i+=n.html(s);break}case"link":{i+=n.link(s);break}case"image":{i+=n.image(s);break}case"checkbox":{i+=n.checkbox(s);break}case"strong":{i+=n.strong(s);break}case"em":{i+=n.em(s);break}case"codespan":{i+=n.codespan(s);break}case"br":{i+=n.br(s);break}case"del":{i+=n.del(s);break}case"text":{i+=n.text(s);break}default:{let m='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return i}},En=(Xn=class{constructor(t){_e(this,"options");_e(this,"block");this.options=t||Lt}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?dt.lex:dt.lexInline}provideParser(t=this.block){return t?ut.parse:ut.parseInline}},_e(Xn,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),_e(Xn,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Xn),kr=class{constructor(...t){_e(this,"defaults",Ao());_e(this,"options",this.setOptions);_e(this,"parse",this.parseMarkdown(!0));_e(this,"parseInline",this.parseMarkdown(!1));_e(this,"Parser",ut);_e(this,"Renderer",yn);_e(this,"TextRenderer",Do);_e(this,"Lexer",dt);_e(this,"Tokenizer",Yn);_e(this,"Hooks",En);this.use(...t)}walkTokens(t,o){var i,r;let n=[];for(let a of t)switch(n=n.concat(o.call(this,a)),a.type){case"table":{let c=a;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of c.rows)for(let s of u)n=n.concat(this.walkTokens(s.tokens,o));break}case"list":{let c=a;n=n.concat(this.walkTokens(c.items,o));break}default:{let c=a;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let s=c[u].flat(1/0);n=n.concat(this.walkTokens(s,o))}):c.tokens&&(n=n.concat(this.walkTokens(c.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(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let a=o.renderers[r.name];a?o.renderers[r.name]=function(...c){let u=r.renderer.apply(this,c);return u===!1&&(u=a.apply(this,c)),u}:o.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=o[r.level];a?a.unshift(r.tokenizer):o[r.level]=[r.tokenizer],r.start&&(r.level==="block"?o.startBlock?o.startBlock.push(r.start):o.startBlock=[r.start]:r.level==="inline"&&(o.startInline?o.startInline.push(r.start):o.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(o.childTokens[r.name]=r.childTokens)}),i.extensions=o),n.renderer){let r=this.defaults.renderer||new yn(this.defaults);for(let a in n.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let c=a,u=n.renderer[c],s=r[c];r[c]=(...m)=>{let p=u.apply(r,m);return p===!1&&(p=s.apply(r,m)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Yn(this.defaults);for(let a in n.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let c=a,u=n.tokenizer[c],s=r[c];r[c]=(...m)=>{let p=u.apply(r,m);return p===!1&&(p=s.apply(r,m)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new En;for(let a in n.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let c=a,u=n.hooks[c],s=r[c];En.passThroughHooks.has(a)?r[c]=m=>{if(this.defaults.async&&En.passThroughHooksRespectAsync.has(a))return(async()=>{let g=await u.call(r,m);return s.call(r,g)})();let p=u.call(r,m);return s.call(r,p)}:r[c]=(...m)=>{if(this.defaults.async)return(async()=>{let g=await u.apply(r,m);return g===!1&&(g=await s.apply(r,m)),g})();let p=u.apply(r,m);return p===!1&&(p=s.apply(r,m)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(c){let u=[];return u.push(a.call(this,c)),r&&(u=u.concat(r.call(this,c))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return dt.lex(t,o??this.defaults)}parser(t,o){return ut.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},r={...this.defaults,...i},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&i.async===!1)return a(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 a(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let c=r.hooks?await r.hooks.preprocess(o):o,u=await(r.hooks?await r.hooks.provideLexer(t):t?dt.lex:dt.lexInline)(c,r),s=r.hooks?await r.hooks.processAllTokens(u):u;r.walkTokens&&await Promise.all(this.walkTokens(s,r.walkTokens));let m=await(r.hooks?await r.hooks.provideParser(t):t?ut.parse:ut.parseInline)(s,r);return r.hooks?await r.hooks.postprocess(m):m})().catch(a);try{r.hooks&&(o=r.hooks.preprocess(o));let c=(r.hooks?r.hooks.provideLexer(t):t?dt.lex:dt.lexInline)(o,r);r.hooks&&(c=r.hooks.processAllTokens(c)),r.walkTokens&&this.walkTokens(c,r.walkTokens);let u=(r.hooks?r.hooks.provideParser(t):t?ut.parse:ut.parseInline)(c,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(c){return a(c)}}}onError(t,o){return n=>{if(n.message+=`
128
- Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+gt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Vt=new kr;function Ce(t,o){return Vt.parse(t,o)}Ce.options=Ce.setOptions=function(t){return Vt.setOptions(t),Ce.defaults=Vt.defaults,tr(Ce.defaults),Ce},Ce.getDefaults=Ao,Ce.defaults=Lt,Ce.use=function(...t){return Vt.use(...t),Ce.defaults=Vt.defaults,tr(Ce.defaults),Ce},Ce.walkTokens=function(t,o){return Vt.walkTokens(t,o)},Ce.parseInline=Vt.parseInline,Ce.Parser=ut,Ce.parser=ut.parse,Ce.Renderer=yn,Ce.TextRenderer=Do,Ce.Lexer=dt,Ce.lexer=dt.lex,Ce.Tokenizer=Yn,Ce.Hooks=En,Ce.parse=Ce,Ce.options,Ce.setOptions,Ce.use,Ce.walkTokens,Ce.parseInline,ut.parse,dt.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 yr(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 fu(t){if(Array.isArray(t))return t}function pu(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,r,a,c,u=[],s=!0,m=!1;try{if(a=(n=n.call(t)).next,o!==0)for(;!(s=(i=a.call(n)).done)&&(u.push(i.value),u.length!==o);s=!0);}catch(p){m=!0,r=p}finally{try{if(!s&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw r}}return u}}function gu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
129
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hu(t,o){return fu(t)||pu(t,o)||bu(t,o)||gu()}function bu(t,o){if(t){if(typeof t=="string")return yr(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)?yr(t,o):void 0}}const Er=Object.entries,xr=Object.setPrototypeOf,ku=Object.isFrozen,yu=Object.getPrototypeOf,Eu=Object.getOwnPropertyDescriptor;let Xe=Object.freeze,lt=Object.seal,Jt=Object.create,wr=typeof Reflect<"u"&&Reflect,Vo=wr.apply,$o=wr.construct;Xe||(Xe=function(o){return o}),lt||(lt=function(o){return o}),Vo||(Vo=function(o,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];return o.apply(n,r)}),$o||($o=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new o(...i)});const $t=Ue(Array.prototype.forEach),xu=Ue(Array.prototype.lastIndexOf),Nr=Ue(Array.prototype.pop),Qt=Ue(Array.prototype.push),wu=Ue(Array.prototype.splice),Je=Array.isArray,xn=Ue(String.prototype.toLowerCase),Po=Ue(String.prototype.toString),Sr=Ue(String.prototype.match),en=Ue(String.prototype.replace),Tr=Ue(String.prototype.indexOf),Nu=Ue(String.prototype.trim),Su=Ue(Number.prototype.toString),Tu=Ue(Boolean.prototype.toString),Cr=typeof BigInt>"u"?null:Ue(BigInt.prototype.toString),_r=typeof Symbol>"u"?null:Ue(Symbol.prototype.toString),Oe=Ue(Object.prototype.hasOwnProperty),wn=Ue(Object.prototype.toString),We=Ue(RegExp.prototype.test),tn=Cu(TypeError);function Ue(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Vo(t,o,i)}}function Cu(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return $o(t,n)}}function de(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xn;if(xr&&xr(t,null),!Je(o))return t;let i=o.length;for(;i--;){let r=o[i];if(typeof r=="string"){const a=n(r);a!==r&&(ku(o)||(o[i]=a),r=a)}t[r]=!0}return t}function _u(t){for(let o=0;o<t.length;o++)Oe(t,o)||(t[o]=null);return t}function Ye(t){const o=Jt(null);for(const i of Er(t)){var n=hu(i,2);const r=n[0],a=n[1];Oe(t,r)&&(Je(a)?o[r]=_u(a):a&&typeof a=="object"&&a.constructor===Object?o[r]=Ye(a):o[r]=a)}return o}function Au(t){switch(typeof t){case"string":return t;case"number":return Su(t);case"boolean":return Tu(t);case"bigint":return Cr?Cr(t):"0";case"symbol":return _r?_r(t):"Symbol()";case"undefined":return wn(t);case"function":case"object":{if(t===null)return wn(t);const o=t,n=ht(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:wn(i)}return wn(t)}default:return wn(t)}}function ht(t,o){for(;t!==null;){const i=Eu(t,o);if(i){if(i.get)return Ue(i.get);if(typeof i.value=="function")return Ue(i.value)}t=yu(t)}function n(){return null}return n}function Ru(t){try{return We(t,""),!0}catch{return!1}}const Ar=Xe(["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"]),Uo=Xe(["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"]),Fo=Xe(["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"]),Mu=Xe(["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"]),Ho=Xe(["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"]),Bu=Xe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Rr=Xe(["#text"]),Mr=Xe(["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"]),Wo=Xe(["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"]),Br=Xe(["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"]),Zn=Xe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zu=lt(/{{[\w\W]*|^[\w\W]*}}/g),Ou=lt(/<%[\w\W]*|^[\w\W]*%>/g),Iu=lt(/\${[\w\W]*/g),vu=lt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Lu=lt(/^aria-[\-\w]+$/),zr=lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Du=lt(/^(?:\w+script|data):/i),Vu=lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$u=lt(/^html$/i),Pu=lt(/^[a-z][.\w]*(-[.\w]+)+$/i),bt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Uu=function(){return typeof window>"u"?null:window},Fu=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));const a="dompurify"+(i?"#"+i:"");try{return o.createPolicy(a,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},Or=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ir(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Uu();const o=J=>Ir(J);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==bt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,r=i.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,c=t.Node,u=t.Element,s=t.NodeFilter,m=t.NamedNodeMap;m===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const p=t.DOMParser,g=t.trustedTypes,y=u.prototype,w=ht(y,"cloneNode"),k=ht(y,"remove"),b=ht(y,"nextSibling"),_=ht(y,"childNodes"),x=ht(y,"parentNode"),R=ht(y,"shadowRoot"),S=ht(y,"attributes"),A=c&&c.prototype?ht(c.prototype,"nodeType"):null,C=c&&c.prototype?ht(c.prototype,"nodeName"):null;if(typeof a=="function"){const J=n.createElement("template");J.content&&J.content.ownerDocument&&(n=J.content.ownerDocument)}let h,O="",W=0;const oe=function(f){if(W>0)throw tn('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.');W++;try{return h.createHTML(f)}finally{W--}},K=n,te=K.implementation,le=K.createNodeIterator,G=K.createDocumentFragment,Y=K.getElementsByTagName,U=i.importNode;let N=Or();o.isSupported=typeof Er=="function"&&typeof x=="function"&&te&&te.createHTMLDocument!==void 0;const $=zu,L=Ou,j=Iu,X=vu,ge=Lu,Be=Du,Fe=Vu,Le=Pu;let v=zr,B=null;const ie=de({},[...Ar,...Uo,...Fo,...Ho,...Rr]);let ae=null;const D=de({},[...Mr,...Wo,...Br,...Zn]);let T=Object.seal(Jt(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}})),ue=null,me=null;const De=Object.seal(Jt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ze=!0,Ge=!0,nn=!1,St=!0,ee=!1,mt=!0,Re=!1,ye=!1,kt=!1,je=!1,Qe=!1,yt=!1,F=!0,Z=!1;const se="user-content-";let he=!0,Me=!1,He={},et=null;const Pt=de({},["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 on=null;const rn=de({},["audio","video","img","source","image","track"]);let at=null;const Ve=de({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xe="http://www.w3.org/1998/Math/MathML",ln="http://www.w3.org/2000/svg",Ie="http://www.w3.org/1999/xhtml";let Q=Ie,an=!1,sn=null;const Go=de({},[xe,ln,Ie],Po);let cn=de({},["mi","mo","mn","ms","mtext"]),Nn=de({},["annotation-xml"]);const jo=de({},["title","style","font","a","script"]);let Et=null;const Ko=["application/xhtml+xml","text/html"],Jn="text/html";let Te=null,Bt=null;const qo=n.createElement("form"),Qn=function(f){return f instanceof RegExp||f instanceof Function},Sn=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Bt&&Bt===f)return;(!f||typeof f!="object")&&(f={}),f=Ye(f),Et=Ko.indexOf(f.PARSER_MEDIA_TYPE)===-1?Jn:f.PARSER_MEDIA_TYPE,Te=Et==="application/xhtml+xml"?Po:xn,B=Oe(f,"ALLOWED_TAGS")&&Je(f.ALLOWED_TAGS)?de({},f.ALLOWED_TAGS,Te):ie,ae=Oe(f,"ALLOWED_ATTR")&&Je(f.ALLOWED_ATTR)?de({},f.ALLOWED_ATTR,Te):D,sn=Oe(f,"ALLOWED_NAMESPACES")&&Je(f.ALLOWED_NAMESPACES)?de({},f.ALLOWED_NAMESPACES,Po):Go,at=Oe(f,"ADD_URI_SAFE_ATTR")&&Je(f.ADD_URI_SAFE_ATTR)?de(Ye(Ve),f.ADD_URI_SAFE_ATTR,Te):Ve,on=Oe(f,"ADD_DATA_URI_TAGS")&&Je(f.ADD_DATA_URI_TAGS)?de(Ye(rn),f.ADD_DATA_URI_TAGS,Te):rn,et=Oe(f,"FORBID_CONTENTS")&&Je(f.FORBID_CONTENTS)?de({},f.FORBID_CONTENTS,Te):Pt,ue=Oe(f,"FORBID_TAGS")&&Je(f.FORBID_TAGS)?de({},f.FORBID_TAGS,Te):Ye({}),me=Oe(f,"FORBID_ATTR")&&Je(f.FORBID_ATTR)?de({},f.FORBID_ATTR,Te):Ye({}),He=Oe(f,"USE_PROFILES")?f.USE_PROFILES&&typeof f.USE_PROFILES=="object"?Ye(f.USE_PROFILES):f.USE_PROFILES:!1,Ze=f.ALLOW_ARIA_ATTR!==!1,Ge=f.ALLOW_DATA_ATTR!==!1,nn=f.ALLOW_UNKNOWN_PROTOCOLS||!1,St=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ee=f.SAFE_FOR_TEMPLATES||!1,mt=f.SAFE_FOR_XML!==!1,Re=f.WHOLE_DOCUMENT||!1,je=f.RETURN_DOM||!1,Qe=f.RETURN_DOM_FRAGMENT||!1,yt=f.RETURN_TRUSTED_TYPE||!1,kt=f.FORCE_BODY||!1,F=f.SANITIZE_DOM!==!1,Z=f.SANITIZE_NAMED_PROPS||!1,he=f.KEEP_CONTENT!==!1,Me=f.IN_PLACE||!1,v=Ru(f.ALLOWED_URI_REGEXP)?f.ALLOWED_URI_REGEXP:zr,Q=typeof f.NAMESPACE=="string"?f.NAMESPACE:Ie,cn=Oe(f,"MATHML_TEXT_INTEGRATION_POINTS")&&f.MATHML_TEXT_INTEGRATION_POINTS&&typeof f.MATHML_TEXT_INTEGRATION_POINTS=="object"?Ye(f.MATHML_TEXT_INTEGRATION_POINTS):de({},["mi","mo","mn","ms","mtext"]),Nn=Oe(f,"HTML_INTEGRATION_POINTS")&&f.HTML_INTEGRATION_POINTS&&typeof f.HTML_INTEGRATION_POINTS=="object"?Ye(f.HTML_INTEGRATION_POINTS):de({},["annotation-xml"]);const z=Oe(f,"CUSTOM_ELEMENT_HANDLING")&&f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING=="object"?Ye(f.CUSTOM_ELEMENT_HANDLING):Jt(null);if(T=Jt(null),Oe(z,"tagNameCheck")&&Qn(z.tagNameCheck)&&(T.tagNameCheck=z.tagNameCheck),Oe(z,"attributeNameCheck")&&Qn(z.attributeNameCheck)&&(T.attributeNameCheck=z.attributeNameCheck),Oe(z,"allowCustomizedBuiltInElements")&&typeof z.allowCustomizedBuiltInElements=="boolean"&&(T.allowCustomizedBuiltInElements=z.allowCustomizedBuiltInElements),ee&&(Ge=!1),Qe&&(je=!0),He&&(B=de({},Rr),ae=Jt(null),He.html===!0&&(de(B,Ar),de(ae,Mr)),He.svg===!0&&(de(B,Uo),de(ae,Wo),de(ae,Zn)),He.svgFilters===!0&&(de(B,Fo),de(ae,Wo),de(ae,Zn)),He.mathMl===!0&&(de(B,Ho),de(ae,Br),de(ae,Zn))),De.tagCheck=null,De.attributeCheck=null,Oe(f,"ADD_TAGS")&&(typeof f.ADD_TAGS=="function"?De.tagCheck=f.ADD_TAGS:Je(f.ADD_TAGS)&&(B===ie&&(B=Ye(B)),de(B,f.ADD_TAGS,Te))),Oe(f,"ADD_ATTR")&&(typeof f.ADD_ATTR=="function"?De.attributeCheck=f.ADD_ATTR:Je(f.ADD_ATTR)&&(ae===D&&(ae=Ye(ae)),de(ae,f.ADD_ATTR,Te))),Oe(f,"ADD_URI_SAFE_ATTR")&&Je(f.ADD_URI_SAFE_ATTR)&&de(at,f.ADD_URI_SAFE_ATTR,Te),Oe(f,"FORBID_CONTENTS")&&Je(f.FORBID_CONTENTS)&&(et===Pt&&(et=Ye(et)),de(et,f.FORBID_CONTENTS,Te)),Oe(f,"ADD_FORBID_CONTENTS")&&Je(f.ADD_FORBID_CONTENTS)&&(et===Pt&&(et=Ye(et)),de(et,f.ADD_FORBID_CONTENTS,Te)),he&&(B["#text"]=!0),Re&&de(B,["html","head","body"]),B.table&&(de(B,["tbody"]),delete ue.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw tn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw tn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const H=h;h=f.TRUSTED_TYPES_POLICY;try{O=oe("")}catch(ke){throw h=H,ke}}else h===void 0&&f.TRUSTED_TYPES_POLICY!==null&&(h=Fu(g,r)),h&&typeof O=="string"&&(O=oe(""));(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&B===ie&&(B=Ye(B)),N.uponSanitizeAttribute.length>0&&ae===D&&(ae=Ye(ae)),Xe&&Xe(f),Bt=f},eo=de({},[...Uo,...Fo,...Mu]),to=de({},[...Ho,...Bu]),no=function(f){let z=x(f);(!z||!z.tagName)&&(z={namespaceURI:Q,tagName:"template"});const H=xn(f.tagName),ke=xn(z.tagName);return sn[f.namespaceURI]?f.namespaceURI===ln?z.namespaceURI===Ie?H==="svg":z.namespaceURI===xe?H==="svg"&&(ke==="annotation-xml"||cn[ke]):!!eo[H]:f.namespaceURI===xe?z.namespaceURI===Ie?H==="math":z.namespaceURI===ln?H==="math"&&Nn[ke]:!!to[H]:f.namespaceURI===Ie?z.namespaceURI===ln&&!Nn[ke]||z.namespaceURI===xe&&!cn[ke]?!1:!to[H]&&(jo[H]||!eo[H]):!!(Et==="application/xhtml+xml"&&sn[f.namespaceURI]):!1},ne=function(f){Qt(o.removed,{element:f});try{x(f).removeChild(f)}catch{k(f)}},$e=function(f,z){try{Qt(o.removed,{attribute:z.getAttributeNode(f),from:z})}catch{Qt(o.removed,{attribute:null,from:z})}if(z.removeAttribute(f),f==="is")if(je||Qe)try{ne(z)}catch{}else try{z.setAttribute(f,"")}catch{}},Tn=function(f){let z=null,H=null;if(kt)f="<remove></remove>"+f;else{const we=Sr(f,/^[\r\n\t ]+/);H=we&&we[0]}Et==="application/xhtml+xml"&&Q===Ie&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const ke=h?oe(f):f;if(Q===Ie)try{z=new p().parseFromString(ke,Et)}catch{}if(!z||!z.documentElement){z=te.createDocument(Q,"template",null);try{z.documentElement.innerHTML=an?O:ke}catch{}}const ce=z.body||z.documentElement;return f&&H&&ce.insertBefore(n.createTextNode(H),ce.childNodes[0]||null),Q===Ie?Y.call(z,Re?"html":"body")[0]:Re?z.documentElement:ce},dn=function(f){return le.call(f.ownerDocument||f,f,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT|s.SHOW_PROCESSING_INSTRUCTION|s.SHOW_CDATA_SECTION,null)},Cn=function(f){var z,H;f.normalize();const ke=le.call(f.ownerDocument||f,f,s.SHOW_TEXT|s.SHOW_COMMENT|s.SHOW_CDATA_SECTION|s.SHOW_PROCESSING_INSTRUCTION,null);let ce=ke.nextNode();for(;ce;){let ze=ce.data;$t([$,L,j],nt=>{ze=en(ze,nt," ")}),ce.data=ze,ce=ke.nextNode()}const we=(z=(H=f.querySelectorAll)===null||H===void 0?void 0:H.call(f,"template"))!==null&&z!==void 0?z:[];$t(Array.from(we),ze=>{Tt(ze.content)&&Cn(ze.content)})},un=function(f){const z=C?C(f):null;return typeof z!="string"||Te(z)!=="form"?!1:typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||f.attributes!==S(f)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function"||f.nodeType!==A(f)||f.childNodes!==_(f)},Tt=function(f){if(!A||typeof f!="object"||f===null)return!1;try{return A(f)===bt.documentFragment}catch{return!1}},xt=function(f){if(!A||typeof f!="object"||f===null)return!1;try{return typeof A(f)=="number"}catch{return!1}};function tt(J,f,z){$t(J,H=>{H.call(o,f,z,Bt)})}const oo=function(f){let z=null;if(tt(N.beforeSanitizeElements,f,null),un(f))return ne(f),!0;const H=Te(C?C(f):f.nodeName);if(tt(N.uponSanitizeElement,f,{tagName:H,allowedTags:B}),mt&&f.hasChildNodes()&&!xt(f.firstElementChild)&&We(/<[/\w!]/g,f.innerHTML)&&We(/<[/\w!]/g,f.textContent)||mt&&f.namespaceURI===Ie&&H==="style"&&xt(f.firstElementChild)||f.nodeType===bt.progressingInstruction||mt&&f.nodeType===bt.comment&&We(/<[/\w]/g,f.data))return ne(f),!0;if(ue[H]||!(De.tagCheck instanceof Function&&De.tagCheck(H))&&!B[H]){if(!ue[H]&&lo(H)&&(T.tagNameCheck instanceof RegExp&&We(T.tagNameCheck,H)||T.tagNameCheck instanceof Function&&T.tagNameCheck(H)))return!1;if(he&&!et[H]){const ce=x(f),we=_(f);if(we&&ce){const ze=we.length;for(let nt=ze-1;nt>=0;--nt){const ot=w(we[nt],!0);ce.insertBefore(ot,b(f))}}}return ne(f),!0}return(A?A(f):f.nodeType)===bt.element&&!no(f)||(H==="noscript"||H==="noembed"||H==="noframes")&&We(/<\/no(script|embed|frames)/i,f.innerHTML)?(ne(f),!0):(ee&&f.nodeType===bt.text&&(z=f.textContent,$t([$,L,j],ce=>{z=en(z,ce," ")}),f.textContent!==z&&(Qt(o.removed,{element:f.cloneNode()}),f.textContent=z)),tt(N.afterSanitizeElements,f,null),!1)},io=function(f,z,H){if(me[z]||F&&(z==="id"||z==="name")&&(H in n||H in qo))return!1;const ke=ae[z]||De.attributeCheck instanceof Function&&De.attributeCheck(z,f);if(!(Ge&&!me[z]&&We(X,z))){if(!(Ze&&We(ge,z))){if(!ke||me[z]){if(!(lo(f)&&(T.tagNameCheck instanceof RegExp&&We(T.tagNameCheck,f)||T.tagNameCheck instanceof Function&&T.tagNameCheck(f))&&(T.attributeNameCheck instanceof RegExp&&We(T.attributeNameCheck,z)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(z,f))||z==="is"&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&We(T.tagNameCheck,H)||T.tagNameCheck instanceof Function&&T.tagNameCheck(H))))return!1}else if(!at[z]){if(!We(v,en(H,Fe,""))){if(!((z==="src"||z==="xlink:href"||z==="href")&&f!=="script"&&Tr(H,"data:")===0&&on[f])){if(!(nn&&!We(Be,en(H,Fe,"")))){if(H)return!1}}}}}}return!0},ro=de({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),lo=function(f){return!ro[xn(f)]&&We(Le,f)},ao=function(f){tt(N.beforeSanitizeAttributes,f,null);const z=f.attributes;if(!z||un(f))return;const H={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae,forceKeepAttr:void 0};let ke=z.length;for(;ke--;){const ce=z[ke],we=ce.name,ze=ce.namespaceURI,nt=ce.value,ot=Te(we),fn=nt;let Pe=we==="value"?fn:Nu(fn);if(H.attrName=ot,H.attrValue=Pe,H.keepAttr=!0,H.forceKeepAttr=void 0,tt(N.uponSanitizeAttribute,f,H),Pe=H.attrValue,Z&&(ot==="id"||ot==="name")&&Tr(Pe,se)!==0&&($e(we,f),Pe=se+Pe),mt&&We(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Pe)){$e(we,f);continue}if(ot==="attributename"&&Sr(Pe,"href")){$e(we,f);continue}if(H.forceKeepAttr)continue;if(!H.keepAttr){$e(we,f);continue}if(!St&&We(/\/>/i,Pe)){$e(we,f);continue}ee&&$t([$,L,j],_n=>{Pe=en(Pe,_n," ")});const so=Te(f.nodeName);if(!io(so,ot,Pe)){$e(we,f);continue}if(h&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!ze)switch(g.getAttributeType(so,ot)){case"TrustedHTML":{Pe=oe(Pe);break}case"TrustedScriptURL":{Pe=h.createScriptURL(Pe);break}}if(Pe!==fn)try{ze?f.setAttributeNS(ze,we,Pe):f.setAttribute(we,Pe),un(f)?ne(f):Nr(o.removed)}catch{$e(we,f)}}tt(N.afterSanitizeAttributes,f,null)},mn=function(f){let z=null;const H=dn(f);for(tt(N.beforeSanitizeShadowDOM,f,null);z=H.nextNode();)if(tt(N.uponSanitizeShadowNode,z,null),oo(z),ao(z),Tt(z.content)&&mn(z.content),(A?A(z):z.nodeType)===bt.element){const ce=R?R(z):z.shadowRoot;Tt(ce)&&(zt(ce),mn(ce))}tt(N.afterSanitizeShadowDOM,f,null)},zt=function(f){const z=A?A(f):f.nodeType;if(z===bt.element){const ce=R?R(f):f.shadowRoot;Tt(ce)&&(zt(ce),mn(ce))}const H=_?_(f):f.childNodes;if(!H)return;const ke=[];$t(H,ce=>{Qt(ke,ce)});for(const ce of ke)zt(ce);if(z===bt.element){const ce=C?C(f):null;if(typeof ce=="string"&&Te(ce)==="template"){const we=f.content;Tt(we)&&zt(we)}}};return o.sanitize=function(J){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=null,H=null,ke=null,ce=null;if(an=!J,an&&(J="<!-->"),typeof J!="string"&&!xt(J)&&(J=Au(J),typeof J!="string"))throw tn("dirty is not a string, aborting");if(!o.isSupported)return J;if(ye||Sn(f),o.removed=[],typeof J=="string"&&(Me=!1),Me){const nt=C?C(J):J.nodeName;if(typeof nt=="string"){const ot=Te(nt);if(!B[ot]||ue[ot])throw tn("root node is forbidden and cannot be sanitized in-place")}if(un(J))throw tn("root node is clobbered and cannot be sanitized in-place");zt(J)}else if(xt(J))z=Tn("<!---->"),H=z.ownerDocument.importNode(J,!0),H.nodeType===bt.element&&H.nodeName==="BODY"||H.nodeName==="HTML"?z=H:z.appendChild(H),zt(H);else{if(!je&&!ee&&!Re&&J.indexOf("<")===-1)return h&&yt?oe(J):J;if(z=Tn(J),!z)return je?null:yt?O:""}z&&kt&&ne(z.firstChild);const we=dn(Me?J:z);for(;ke=we.nextNode();)oo(ke),ao(ke),Tt(ke.content)&&mn(ke.content);if(Me)return ee&&Cn(J),J;if(je){if(ee&&Cn(z),Qe)for(ce=G.call(z.ownerDocument);z.firstChild;)ce.appendChild(z.firstChild);else ce=z;return(ae.shadowroot||ae.shadowrootmode)&&(ce=U.call(i,ce,!0)),ce}let ze=Re?z.outerHTML:z.innerHTML;return Re&&B["!doctype"]&&z.ownerDocument&&z.ownerDocument.doctype&&z.ownerDocument.doctype.name&&We($u,z.ownerDocument.doctype.name)&&(ze="<!DOCTYPE "+z.ownerDocument.doctype.name+`>
130
- `+ze),ee&&$t([$,L,j],nt=>{ze=en(ze,nt," ")}),h&&yt?oe(ze):ze},o.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sn(J),ye=!0},o.clearConfig=function(){Bt=null,ye=!1},o.isValidAttribute=function(J,f,z){Bt||Sn({});const H=Te(J),ke=Te(f);return io(H,ke,z)},o.addHook=function(J,f){typeof f=="function"&&Qt(N[J],f)},o.removeHook=function(J,f){if(f!==void 0){const z=xu(N[J],f);return z===-1?void 0:wu(N[J],z,1)[0]}return Nr(N[J])},o.removeHooks=function(J){N[J]=[]},o.removeAllHooks=function(){N=Or()},o}var Hu=Ir();const Wu=new kr({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new yn;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),r=To(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${r}</code></pre>`},t})()}),Gu=["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"],ju=["href","title","target","rel","src","alt","class","checked","type","disabled"],Ku=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function qu(t){if(!t)return"";const o=Wu.parse(t,{async:!1});return Hu.sanitize(o,{ALLOWED_TAGS:Gu,ALLOWED_ATTR:ju,ALLOWED_URI_REGEXP:Ku})}const Yu={class:"zm-note-panel"},Zu={key:0,class:"zm-note-empty"},Xu={class:"zm-note-header"},Ju={class:"zm-note-title-row"},Qu={class:"zm-note-name"},em={class:"zm-note-meta"},tm={class:"zm-note-scroll"},nm={class:"zm-note-section"},om={class:"zm-note-section-head"},im={class:"zm-note-split"},rm=["disabled"],lm={key:0,class:"zm-note-preview"},am=["innerHTML"],sm={key:1,class:"zm-note-preview-hint"},cm={key:0,class:"zm-note-section-actions"},dm={key:0,class:"zm-note-add-row"},um={key:1,class:"zm-note-section"},mm=["disabled"],fm=["href","title"],pm={key:2,class:"zm-note-section"},gm=["disabled"],hm=["src","alt"],bm={key:3,class:"zm-note-section"},km={class:"zm-note-section-head"},ym={key:0,class:"zm-note-section-tag"},Em=["disabled"],xm={key:0,class:"zm-note-code"},wm=["innerHTML"],Nm={key:4,class:"zm-note-section"},Sm=["disabled"],Tm={key:0,class:"zm-note-table"},Cm=["onClick"],_m={class:"zm-note-table-sort-mark","aria-hidden":"true"},Am=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,r=e.ref(""),a=e.ref(null);_o(a,{minRows:4,maxRows:10});const c=e.computed(()=>!r.value||r.value.trim()===""),u=e.computed(()=>qu(r.value)),s=e.ref(!0);function m(){s.value=!s.value}e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:ie.text]},()=>{var v,B;r.value=((B=(v=n.selectedNode)==null?void 0:v.note)==null?void 0:B.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const v=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(v){v.focus();const B=v.value.length;v.setSelectionRange(B,B)}});function p(){var ie,ae;if(n.readonly)return;const v=r.value,B=((ae=(ie=n.selectedNode)==null?void 0:ie.note)==null?void 0:ae.text)??"";v!==B&&i("apply",v)}function g(v){var B,ie;n.readonly||(v.key==="Escape"?(v.preventDefault(),r.value=((ie=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:ie.text)??"",v.target.blur()):v.key==="Enter"&&(v.ctrlKey||v.metaKey)&&(v.preventDefault(),p(),v.target.blur()))}function y(){n.readonly||confirm("移除该节点的笔记?")&&(r.value="",i("remove"))}const w=e.computed(()=>{var v,B;return!!((B=(v=n.selectedNode)==null?void 0:v.link)!=null&&B.url)}),k=e.computed(()=>{var v,B;return!!((B=(v=n.selectedNode)==null?void 0:v.image)!=null&&B.src)}),b=e.computed(()=>{var v,B;return(B=(v=n.selectedNode)==null?void 0:v.richContent)==null?void 0:B.kind}),_=e.computed(()=>b.value==="code"),x=e.computed(()=>b.value==="table"),R=e.ref(!1),S=e.ref(!1),A=e.ref(!1),C=e.ref(!1);e.watch(()=>{var v;return(v=n.selectedNode)==null?void 0:v.id},()=>{R.value=!1,S.value=!1,A.value=!1,C.value=!1});const h=e.ref("");e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.link)==null?void 0:ie.url]},()=>{var v,B;h.value=((B=(v=n.selectedNode)==null?void 0:v.link)==null?void 0:B.url)??""},{immediate:!0});function O(){var ie,ae;if(n.readonly)return;const v=h.value.trim(),B=((ae=(ie=n.selectedNode)==null?void 0:ie.link)==null?void 0:ae.url)??"";v!==B&&i("set-link",v)}const W=e.ref("");e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.image)==null?void 0:ie.src]},()=>{var v,B;W.value=((B=(v=n.selectedNode)==null?void 0:v.image)==null?void 0:B.src)??""},{immediate:!0});function oe(){var ie,ae;if(n.readonly)return;const v=W.value.trim(),B=((ae=(ie=n.selectedNode)==null?void 0:ie.image)==null?void 0:ae.src)??"";v!==B&&i("set-image",v)}function K(v){const B=v.target;B.style.display="none"}function te(v){const B=v.target;B.style.display=""}const le=e.ref(""),G=e.ref(null);_o(G,{minRows:4,maxRows:18}),e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:ie.raw]},()=>{var v,B;le.value=((B=(v=n.selectedNode)==null?void 0:v.richContent)==null?void 0:B.raw)??""},{immediate:!0});const Y=e.computed(()=>To(So(le.value),qt(le.value)));function U(){var ae,D;if(n.readonly)return;const v=le.value,B=((D=(ae=n.selectedNode)==null?void 0:ae.richContent)==null?void 0:D.raw)??"";if(v===B)return;const ie=qt(v)||void 0;i("set-rich",v?{kind:"code",raw:v,lang:ie}:null)}const N=e.ref(""),$=e.ref(null);_o($,{minRows:4,maxRows:14});const L=e.ref(-1),j=e.ref("asc");e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:ie.raw]},()=>{var v,B;N.value=((B=(v=n.selectedNode)==null?void 0:v.richContent)==null?void 0:B.raw)??"",L.value=-1,j.value="asc"},{immediate:!0});function X(){var ie,ae;if(n.readonly)return;const v=N.value,B=((ae=(ie=n.selectedNode)==null?void 0:ie.richContent)==null?void 0:ae.raw)??"";v!==B&&i("set-rich",v?{kind:"table",raw:v}:null)}const ge=e.computed(()=>Ji(N.value)),Be=e.computed(()=>{const v=ge.value;return L.value<0||v.length<=1?v:Qi(v,L.value,j.value)});function Fe(v){L.value!==v?(L.value=v,j.value="asc"):j.value==="asc"?j.value="desc":L.value=-1}const Le=e.computed(()=>{const v=[];return c.value||v.push(`${r.value.length} 字`),w.value&&v.push("1 链接"),k.value&&v.push("1 图片"),_.value&&v.push("代码块"),x.value&&v.push("表格"),v.length===0?"节点没有额外内容":v.join(" · ")});return(v,B)=>{var ie,ae,D,T;return e.openBlock(),e.createElementBlock("div",Yu,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Xu,[e.createElementVNode("div",Ju,[B[12]||(B[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",Qu,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",em,e.toDisplayString(Le.value),1)]),e.createElementVNode("div",tm,[e.createElementVNode("section",nm,[e.createElementVNode("header",om,[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:m},e.toDisplayString(s.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",im,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:a,"onUpdate:modelValue":B[0]||(B[0]=ue=>r.value=ue),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:p,onKeydown:g},null,40,rm),[[e.vModelText,r.value]]),s.value?(e.openBlock(),e.createElementBlock("div",lm,[c.value?(e.openBlock(),e.createElementBlock("div",sm," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,am))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",cm,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:y},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",dm,[!w.value&&!R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:B[1]||(B[1]=ue=>R.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!k.value&&!S.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:B[2]||(B[2]=ue=>S.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!_.value&&!A.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:B[3]||(B[3]=ue=>A.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!x.value&&!C.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:B[4]||(B[4]=ue=>C.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),w.value||R.value?(e.openBlock(),e.createElementBlock("section",um,[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]=ue=>h.value=ue),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:O,onKeydown:B[6]||(B[6]=e.withKeys(e.withModifiers(ue=>ue.target.blur(),["prevent"]),["enter"]))},null,40,mm),[[e.vModelText,h.value]]),w.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(ie=t.selectedNode.link)==null?void 0:ie.url,target:"_blank",rel:"noopener noreferrer",title:(ae=t.selectedNode.link)==null?void 0:ae.url},e.toDisplayString((D=t.selectedNode.link)==null?void 0:D.url),9,fm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),k.value||S.value?(e.openBlock(),e.createElementBlock("section",pm,[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]=ue=>W.value=ue),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:oe,onKeydown:B[8]||(B[8]=e.withKeys(e.withModifiers(ue=>ue.target.blur(),["prevent"]),["enter"]))},null,40,gm),[[e.vModelText,W.value]]),k.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(T=t.selectedNode.image)==null?void 0:T.src,alt:t.selectedNode.text,onError:K,onLoad:te},null,40,hm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||A.value?(e.openBlock(),e.createElementBlock("section",bm,[e.createElementVNode("header",km,[B[17]||(B[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(qt)(le.value)?(e.openBlock(),e.createElementBlock("span",ym,e.toDisplayString(e.unref(qt)(le.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:G,"onUpdate:modelValue":B[9]||(B[9]=ue=>le.value=ue),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:U},null,40,Em),[[e.vModelText,le.value]]),le.value.trim()?(e.openBlock(),e.createElementBlock("pre",xm,[e.createElementVNode("code",{innerHTML:Y.value},null,8,wm)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),x.value||C.value?(e.openBlock(),e.createElementBlock("section",Nm,[B[18]||(B[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:$,"onUpdate:modelValue":B[10]||(B[10]=ue=>N.value=ue),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
127
+ `}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>${gt(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),r=kr(t);if(r===null)return i;t=r;let a='<a href="'+t+'"';return o&&(a+=' title="'+gt(o)+'"'),a+=">"+i+"</a>",a}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=kr(t);if(r===null)return gt(n);t=r;let a=`<img src="${t}" alt="${gt(n)}"`;return o&&(a+=` title="${gt(o)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:gt(t.text)}},Po=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}},ut=class oi{constructor(o){Ae(this,"options");Ae(this,"renderer");Ae(this,"textRenderer");this.options=o||Lt,this.options.renderer=this.options.renderer||new En,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Po}static parse(o,n){return new oi(n).parse(o)}static parseInline(o,n){return new oi(n).parseInline(o)}parse(o){var i,r;this.renderer.parser=this;let n="";for(let a=0;a<o.length;a++){let s=o[a];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[s.type]){let c=s,m=this.options.extensions.renderers[c.type].call({parser:this},c);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){n+=m||"";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 c='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}parseInline(o,n=this.renderer){var r,a;this.renderer.parser=this;let i="";for(let s=0;s<o.length;s++){let u=o[s];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[u.type]){let m=this.options.extensions.renderers[u.type].call({parser:this},u);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=m||"";continue}}let c=u;switch(c.type){case"escape":{i+=n.text(c);break}case"html":{i+=n.html(c);break}case"link":{i+=n.link(c);break}case"image":{i+=n.image(c);break}case"checkbox":{i+=n.checkbox(c);break}case"strong":{i+=n.strong(c);break}case"em":{i+=n.em(c);break}case"codespan":{i+=n.codespan(c);break}case"br":{i+=n.br(c);break}case"del":{i+=n.del(c);break}case"text":{i+=n.text(c);break}default:{let m='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return i}},xn=(Xn=class{constructor(t){Ae(this,"options");Ae(this,"block");this.options=t||Lt}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?dt.lex:dt.lexInline}provideParser(t=this.block){return t?ut.parse:ut.parseInline}},Ae(Xn,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ae(Xn,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Xn),wr=class{constructor(...t){Ae(this,"defaults",Bo());Ae(this,"options",this.setOptions);Ae(this,"parse",this.parseMarkdown(!0));Ae(this,"parseInline",this.parseMarkdown(!1));Ae(this,"Parser",ut);Ae(this,"Renderer",En);Ae(this,"TextRenderer",Po);Ae(this,"Lexer",dt);Ae(this,"Tokenizer",Yn);Ae(this,"Hooks",xn);this.use(...t)}walkTokens(t,o){var i,r;let n=[];for(let a of t)switch(n=n.concat(o.call(this,a)),a.type){case"table":{let s=a;for(let u of s.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of s.rows)for(let c of u)n=n.concat(this.walkTokens(c.tokens,o));break}case"list":{let s=a;n=n.concat(this.walkTokens(s.items,o));break}default:{let s=a;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[s.type]?this.defaults.extensions.childTokens[s.type].forEach(u=>{let c=s[u].flat(1/0);n=n.concat(this.walkTokens(c,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(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let a=o.renderers[r.name];a?o.renderers[r.name]=function(...s){let u=r.renderer.apply(this,s);return u===!1&&(u=a.apply(this,s)),u}:o.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=o[r.level];a?a.unshift(r.tokenizer):o[r.level]=[r.tokenizer],r.start&&(r.level==="block"?o.startBlock?o.startBlock.push(r.start):o.startBlock=[r.start]:r.level==="inline"&&(o.startInline?o.startInline.push(r.start):o.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(o.childTokens[r.name]=r.childTokens)}),i.extensions=o),n.renderer){let r=this.defaults.renderer||new En(this.defaults);for(let a in n.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let s=a,u=n.renderer[s],c=r[s];r[s]=(...m)=>{let p=u.apply(r,m);return p===!1&&(p=c.apply(r,m)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Yn(this.defaults);for(let a in n.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let s=a,u=n.tokenizer[s],c=r[s];r[s]=(...m)=>{let p=u.apply(r,m);return p===!1&&(p=c.apply(r,m)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new xn;for(let a in n.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let s=a,u=n.hooks[s],c=r[s];xn.passThroughHooks.has(a)?r[s]=m=>{if(this.defaults.async&&xn.passThroughHooksRespectAsync.has(a))return(async()=>{let g=await u.call(r,m);return c.call(r,g)})();let p=u.call(r,m);return c.call(r,p)}:r[s]=(...m)=>{if(this.defaults.async)return(async()=>{let g=await u.apply(r,m);return g===!1&&(g=await c.apply(r,m)),g})();let p=u.apply(r,m);return p===!1&&(p=c.apply(r,m)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(s){let u=[];return u.push(a.call(this,s)),r&&(u=u.concat(r.call(this,s))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return dt.lex(t,o??this.defaults)}parser(t,o){return ut.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},r={...this.defaults,...i},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&i.async===!1)return a(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 a(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let s=r.hooks?await r.hooks.preprocess(o):o,u=await(r.hooks?await r.hooks.provideLexer(t):t?dt.lex:dt.lexInline)(s,r),c=r.hooks?await r.hooks.processAllTokens(u):u;r.walkTokens&&await Promise.all(this.walkTokens(c,r.walkTokens));let m=await(r.hooks?await r.hooks.provideParser(t):t?ut.parse:ut.parseInline)(c,r);return r.hooks?await r.hooks.postprocess(m):m})().catch(a);try{r.hooks&&(o=r.hooks.preprocess(o));let s=(r.hooks?r.hooks.provideLexer(t):t?dt.lex:dt.lexInline)(o,r);r.hooks&&(s=r.hooks.processAllTokens(s)),r.walkTokens&&this.walkTokens(s,r.walkTokens);let u=(r.hooks?r.hooks.provideParser(t):t?ut.parse:ut.parseInline)(s,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(s){return a(s)}}}onError(t,o){return n=>{if(n.message+=`
128
+ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+gt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Vt=new wr;function _e(t,o){return Vt.parse(t,o)}_e.options=_e.setOptions=function(t){return Vt.setOptions(t),_e.defaults=Vt.defaults,rr(_e.defaults),_e},_e.getDefaults=Bo,_e.defaults=Lt,_e.use=function(...t){return Vt.use(...t),_e.defaults=Vt.defaults,rr(_e.defaults),_e},_e.walkTokens=function(t,o){return Vt.walkTokens(t,o)},_e.parseInline=Vt.parseInline,_e.Parser=ut,_e.parser=ut.parse,_e.Renderer=En,_e.TextRenderer=Po,_e.Lexer=dt,_e.lexer=dt.lex,_e.Tokenizer=Yn,_e.Hooks=xn,_e.parse=_e,_e.options,_e.setOptions,_e.use,_e.walkTokens,_e.parseInline,ut.parse,dt.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 Nr(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 yu(t){if(Array.isArray(t))return t}function Eu(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,r,a,s,u=[],c=!0,m=!1;try{if(a=(n=n.call(t)).next,o!==0)for(;!(c=(i=a.call(n)).done)&&(u.push(i.value),u.length!==o);c=!0);}catch(p){m=!0,r=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(m)throw r}}return u}}function xu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
129
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wu(t,o){return yu(t)||Eu(t,o)||Nu(t,o)||xu()}function Nu(t,o){if(t){if(typeof t=="string")return Nr(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)?Nr(t,o):void 0}}const Sr=Object.entries,Tr=Object.setPrototypeOf,Su=Object.isFrozen,Tu=Object.getPrototypeOf,Cu=Object.getOwnPropertyDescriptor;let Xe=Object.freeze,lt=Object.seal,Qt=Object.create,Cr=typeof Reflect<"u"&&Reflect,Fo=Cr.apply,Uo=Cr.construct;Xe||(Xe=function(o){return o}),lt||(lt=function(o){return o}),Fo||(Fo=function(o,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];return o.apply(n,r)}),Uo||(Uo=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new o(...i)});const $t=Fe(Array.prototype.forEach),_u=Fe(Array.prototype.lastIndexOf),_r=Fe(Array.prototype.pop),en=Fe(Array.prototype.push),Au=Fe(Array.prototype.splice),Je=Array.isArray,wn=Fe(String.prototype.toLowerCase),Ho=Fe(String.prototype.toString),Ar=Fe(String.prototype.match),tn=Fe(String.prototype.replace),Mr=Fe(String.prototype.indexOf),Mu=Fe(String.prototype.trim),Ru=Fe(Number.prototype.toString),Bu=Fe(Boolean.prototype.toString),Rr=typeof BigInt>"u"?null:Fe(BigInt.prototype.toString),Br=typeof Symbol>"u"?null:Fe(Symbol.prototype.toString),Oe=Fe(Object.prototype.hasOwnProperty),Nn=Fe(Object.prototype.toString),We=Fe(RegExp.prototype.test),nn=zu(TypeError);function Fe(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Fo(t,o,i)}}function zu(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Uo(t,n)}}function de(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wn;if(Tr&&Tr(t,null),!Je(o))return t;let i=o.length;for(;i--;){let r=o[i];if(typeof r=="string"){const a=n(r);a!==r&&(Su(o)||(o[i]=a),r=a)}t[r]=!0}return t}function Ou(t){for(let o=0;o<t.length;o++)Oe(t,o)||(t[o]=null);return t}function Ye(t){const o=Qt(null);for(const i of Sr(t)){var n=wu(i,2);const r=n[0],a=n[1];Oe(t,r)&&(Je(a)?o[r]=Ou(a):a&&typeof a=="object"&&a.constructor===Object?o[r]=Ye(a):o[r]=a)}return o}function Iu(t){switch(typeof t){case"string":return t;case"number":return Ru(t);case"boolean":return Bu(t);case"bigint":return Rr?Rr(t):"0";case"symbol":return Br?Br(t):"Symbol()";case"undefined":return Nn(t);case"function":case"object":{if(t===null)return Nn(t);const o=t,n=ht(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:Nn(i)}return Nn(t)}default:return Nn(t)}}function ht(t,o){for(;t!==null;){const i=Cu(t,o);if(i){if(i.get)return Fe(i.get);if(typeof i.value=="function")return Fe(i.value)}t=Tu(t)}function n(){return null}return n}function vu(t){try{return We(t,""),!0}catch{return!1}}const zr=Xe(["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"]),Wo=Xe(["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"]),Go=Xe(["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"]),Lu=Xe(["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"]),jo=Xe(["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"]),Du=Xe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Or=Xe(["#text"]),Ir=Xe(["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"]),Ko=Xe(["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"]),vr=Xe(["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"]),Zn=Xe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Vu=lt(/{{[\w\W]*|^[\w\W]*}}/g),$u=lt(/<%[\w\W]*|^[\w\W]*%>/g),Pu=lt(/\${[\w\W]*/g),Fu=lt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Uu=lt(/^aria-[\-\w]+$/),Lr=lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hu=lt(/^(?:\w+script|data):/i),Wu=lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Gu=lt(/^html$/i),ju=lt(/^[a-z][.\w]*(-[.\w]+)+$/i),bt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ku=function(){return typeof window>"u"?null:window},qu=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));const a="dompurify"+(i?"#"+i:"");try{return o.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},Dr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Vr(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ku();const o=J=>Vr(J);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==bt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,r=i.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,s=t.Node,u=t.Element,c=t.NodeFilter,m=t.NamedNodeMap;m===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const p=t.DOMParser,g=t.trustedTypes,y=u.prototype,w=ht(y,"cloneNode"),k=ht(y,"remove"),b=ht(y,"nextSibling"),_=ht(y,"childNodes"),x=ht(y,"parentNode"),M=ht(y,"shadowRoot"),S=ht(y,"attributes"),A=s&&s.prototype?ht(s.prototype,"nodeType"):null,C=s&&s.prototype?ht(s.prototype,"nodeName"):null;if(typeof a=="function"){const J=n.createElement("template");J.content&&J.content.ownerDocument&&(n=J.content.ownerDocument)}let h,O="",W=0;const oe=function(f){if(W>0)throw nn('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.');W++;try{return h.createHTML(f)}finally{W--}},K=n,te=K.implementation,le=K.createNodeIterator,G=K.createDocumentFragment,Y=K.getElementsByTagName,F=i.importNode;let N=Dr();o.isSupported=typeof Sr=="function"&&typeof x=="function"&&te&&te.createHTMLDocument!==void 0;const $=Vu,L=$u,j=Pu,X=Fu,ge=Uu,Be=Hu,Ue=Wu,Le=ju;let v=Lr,B=null;const ie=de({},[...zr,...Wo,...Go,...jo,...Or]);let ae=null;const D=de({},[...Ir,...Ko,...vr,...Zn]);let T=Object.seal(Qt(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}})),ue=null,me=null;const De=Object.seal(Qt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ze=!0,Ge=!0,on=!1,St=!0,ee=!1,mt=!0,Me=!1,ye=!1,kt=!1,je=!1,Qe=!1,yt=!1,U=!0,Z=!1;const se="user-content-";let he=!0,Re=!1,He={},et=null;const Pt=de({},["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 rn=null;const ln=de({},["audio","video","img","source","image","track"]);let at=null;const Ve=de({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),we="http://www.w3.org/1998/Math/MathML",an="http://www.w3.org/2000/svg",Ie="http://www.w3.org/1999/xhtml";let Q=Ie,sn=!1,cn=null;const Yo=de({},[we,an,Ie],Ho);let dn=de({},["mi","mo","mn","ms","mtext"]),Sn=de({},["annotation-xml"]);const Zo=de({},["title","style","font","a","script"]);let Et=null;const Xo=["application/xhtml+xml","text/html"],Jn="text/html";let Ce=null,Bt=null;const Jo=n.createElement("form"),Qn=function(f){return f instanceof RegExp||f instanceof Function},Tn=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Bt&&Bt===f)return;(!f||typeof f!="object")&&(f={}),f=Ye(f),Et=Xo.indexOf(f.PARSER_MEDIA_TYPE)===-1?Jn:f.PARSER_MEDIA_TYPE,Ce=Et==="application/xhtml+xml"?Ho:wn,B=Oe(f,"ALLOWED_TAGS")&&Je(f.ALLOWED_TAGS)?de({},f.ALLOWED_TAGS,Ce):ie,ae=Oe(f,"ALLOWED_ATTR")&&Je(f.ALLOWED_ATTR)?de({},f.ALLOWED_ATTR,Ce):D,cn=Oe(f,"ALLOWED_NAMESPACES")&&Je(f.ALLOWED_NAMESPACES)?de({},f.ALLOWED_NAMESPACES,Ho):Yo,at=Oe(f,"ADD_URI_SAFE_ATTR")&&Je(f.ADD_URI_SAFE_ATTR)?de(Ye(Ve),f.ADD_URI_SAFE_ATTR,Ce):Ve,rn=Oe(f,"ADD_DATA_URI_TAGS")&&Je(f.ADD_DATA_URI_TAGS)?de(Ye(ln),f.ADD_DATA_URI_TAGS,Ce):ln,et=Oe(f,"FORBID_CONTENTS")&&Je(f.FORBID_CONTENTS)?de({},f.FORBID_CONTENTS,Ce):Pt,ue=Oe(f,"FORBID_TAGS")&&Je(f.FORBID_TAGS)?de({},f.FORBID_TAGS,Ce):Ye({}),me=Oe(f,"FORBID_ATTR")&&Je(f.FORBID_ATTR)?de({},f.FORBID_ATTR,Ce):Ye({}),He=Oe(f,"USE_PROFILES")?f.USE_PROFILES&&typeof f.USE_PROFILES=="object"?Ye(f.USE_PROFILES):f.USE_PROFILES:!1,Ze=f.ALLOW_ARIA_ATTR!==!1,Ge=f.ALLOW_DATA_ATTR!==!1,on=f.ALLOW_UNKNOWN_PROTOCOLS||!1,St=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ee=f.SAFE_FOR_TEMPLATES||!1,mt=f.SAFE_FOR_XML!==!1,Me=f.WHOLE_DOCUMENT||!1,je=f.RETURN_DOM||!1,Qe=f.RETURN_DOM_FRAGMENT||!1,yt=f.RETURN_TRUSTED_TYPE||!1,kt=f.FORCE_BODY||!1,U=f.SANITIZE_DOM!==!1,Z=f.SANITIZE_NAMED_PROPS||!1,he=f.KEEP_CONTENT!==!1,Re=f.IN_PLACE||!1,v=vu(f.ALLOWED_URI_REGEXP)?f.ALLOWED_URI_REGEXP:Lr,Q=typeof f.NAMESPACE=="string"?f.NAMESPACE:Ie,dn=Oe(f,"MATHML_TEXT_INTEGRATION_POINTS")&&f.MATHML_TEXT_INTEGRATION_POINTS&&typeof f.MATHML_TEXT_INTEGRATION_POINTS=="object"?Ye(f.MATHML_TEXT_INTEGRATION_POINTS):de({},["mi","mo","mn","ms","mtext"]),Sn=Oe(f,"HTML_INTEGRATION_POINTS")&&f.HTML_INTEGRATION_POINTS&&typeof f.HTML_INTEGRATION_POINTS=="object"?Ye(f.HTML_INTEGRATION_POINTS):de({},["annotation-xml"]);const z=Oe(f,"CUSTOM_ELEMENT_HANDLING")&&f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING=="object"?Ye(f.CUSTOM_ELEMENT_HANDLING):Qt(null);if(T=Qt(null),Oe(z,"tagNameCheck")&&Qn(z.tagNameCheck)&&(T.tagNameCheck=z.tagNameCheck),Oe(z,"attributeNameCheck")&&Qn(z.attributeNameCheck)&&(T.attributeNameCheck=z.attributeNameCheck),Oe(z,"allowCustomizedBuiltInElements")&&typeof z.allowCustomizedBuiltInElements=="boolean"&&(T.allowCustomizedBuiltInElements=z.allowCustomizedBuiltInElements),ee&&(Ge=!1),Qe&&(je=!0),He&&(B=de({},Or),ae=Qt(null),He.html===!0&&(de(B,zr),de(ae,Ir)),He.svg===!0&&(de(B,Wo),de(ae,Ko),de(ae,Zn)),He.svgFilters===!0&&(de(B,Go),de(ae,Ko),de(ae,Zn)),He.mathMl===!0&&(de(B,jo),de(ae,vr),de(ae,Zn))),De.tagCheck=null,De.attributeCheck=null,Oe(f,"ADD_TAGS")&&(typeof f.ADD_TAGS=="function"?De.tagCheck=f.ADD_TAGS:Je(f.ADD_TAGS)&&(B===ie&&(B=Ye(B)),de(B,f.ADD_TAGS,Ce))),Oe(f,"ADD_ATTR")&&(typeof f.ADD_ATTR=="function"?De.attributeCheck=f.ADD_ATTR:Je(f.ADD_ATTR)&&(ae===D&&(ae=Ye(ae)),de(ae,f.ADD_ATTR,Ce))),Oe(f,"ADD_URI_SAFE_ATTR")&&Je(f.ADD_URI_SAFE_ATTR)&&de(at,f.ADD_URI_SAFE_ATTR,Ce),Oe(f,"FORBID_CONTENTS")&&Je(f.FORBID_CONTENTS)&&(et===Pt&&(et=Ye(et)),de(et,f.FORBID_CONTENTS,Ce)),Oe(f,"ADD_FORBID_CONTENTS")&&Je(f.ADD_FORBID_CONTENTS)&&(et===Pt&&(et=Ye(et)),de(et,f.ADD_FORBID_CONTENTS,Ce)),he&&(B["#text"]=!0),Me&&de(B,["html","head","body"]),B.table&&(de(B,["tbody"]),delete ue.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw nn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw nn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const H=h;h=f.TRUSTED_TYPES_POLICY;try{O=oe("")}catch(ke){throw h=H,ke}}else h===void 0&&f.TRUSTED_TYPES_POLICY!==null&&(h=qu(g,r)),h&&typeof O=="string"&&(O=oe(""));(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&B===ie&&(B=Ye(B)),N.uponSanitizeAttribute.length>0&&ae===D&&(ae=Ye(ae)),Xe&&Xe(f),Bt=f},eo=de({},[...Wo,...Go,...Lu]),to=de({},[...jo,...Du]),no=function(f){let z=x(f);(!z||!z.tagName)&&(z={namespaceURI:Q,tagName:"template"});const H=wn(f.tagName),ke=wn(z.tagName);return cn[f.namespaceURI]?f.namespaceURI===an?z.namespaceURI===Ie?H==="svg":z.namespaceURI===we?H==="svg"&&(ke==="annotation-xml"||dn[ke]):!!eo[H]:f.namespaceURI===we?z.namespaceURI===Ie?H==="math":z.namespaceURI===an?H==="math"&&Sn[ke]:!!to[H]:f.namespaceURI===Ie?z.namespaceURI===an&&!Sn[ke]||z.namespaceURI===we&&!dn[ke]?!1:!to[H]&&(Zo[H]||!eo[H]):!!(Et==="application/xhtml+xml"&&cn[f.namespaceURI]):!1},ne=function(f){en(o.removed,{element:f});try{x(f).removeChild(f)}catch{k(f)}},$e=function(f,z){try{en(o.removed,{attribute:z.getAttributeNode(f),from:z})}catch{en(o.removed,{attribute:null,from:z})}if(z.removeAttribute(f),f==="is")if(je||Qe)try{ne(z)}catch{}else try{z.setAttribute(f,"")}catch{}},Cn=function(f){let z=null,H=null;if(kt)f="<remove></remove>"+f;else{const Ne=Ar(f,/^[\r\n\t ]+/);H=Ne&&Ne[0]}Et==="application/xhtml+xml"&&Q===Ie&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const ke=h?oe(f):f;if(Q===Ie)try{z=new p().parseFromString(ke,Et)}catch{}if(!z||!z.documentElement){z=te.createDocument(Q,"template",null);try{z.documentElement.innerHTML=sn?O:ke}catch{}}const ce=z.body||z.documentElement;return f&&H&&ce.insertBefore(n.createTextNode(H),ce.childNodes[0]||null),Q===Ie?Y.call(z,Me?"html":"body")[0]:Me?z.documentElement:ce},un=function(f){return le.call(f.ownerDocument||f,f,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},_n=function(f){var z,H;f.normalize();const ke=le.call(f.ownerDocument||f,f,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let ce=ke.nextNode();for(;ce;){let ze=ce.data;$t([$,L,j],nt=>{ze=tn(ze,nt," ")}),ce.data=ze,ce=ke.nextNode()}const Ne=(z=(H=f.querySelectorAll)===null||H===void 0?void 0:H.call(f,"template"))!==null&&z!==void 0?z:[];$t(Array.from(Ne),ze=>{Tt(ze.content)&&_n(ze.content)})},mn=function(f){const z=C?C(f):null;return typeof z!="string"||Ce(z)!=="form"?!1:typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||f.attributes!==S(f)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function"||f.nodeType!==A(f)||f.childNodes!==_(f)},Tt=function(f){if(!A||typeof f!="object"||f===null)return!1;try{return A(f)===bt.documentFragment}catch{return!1}},xt=function(f){if(!A||typeof f!="object"||f===null)return!1;try{return typeof A(f)=="number"}catch{return!1}};function tt(J,f,z){$t(J,H=>{H.call(o,f,z,Bt)})}const oo=function(f){let z=null;if(tt(N.beforeSanitizeElements,f,null),mn(f))return ne(f),!0;const H=Ce(C?C(f):f.nodeName);if(tt(N.uponSanitizeElement,f,{tagName:H,allowedTags:B}),mt&&f.hasChildNodes()&&!xt(f.firstElementChild)&&We(/<[/\w!]/g,f.innerHTML)&&We(/<[/\w!]/g,f.textContent)||mt&&f.namespaceURI===Ie&&H==="style"&&xt(f.firstElementChild)||f.nodeType===bt.progressingInstruction||mt&&f.nodeType===bt.comment&&We(/<[/\w]/g,f.data))return ne(f),!0;if(ue[H]||!(De.tagCheck instanceof Function&&De.tagCheck(H))&&!B[H]){if(!ue[H]&&lo(H)&&(T.tagNameCheck instanceof RegExp&&We(T.tagNameCheck,H)||T.tagNameCheck instanceof Function&&T.tagNameCheck(H)))return!1;if(he&&!et[H]){const ce=x(f),Ne=_(f);if(Ne&&ce){const ze=Ne.length;for(let nt=ze-1;nt>=0;--nt){const ot=w(Ne[nt],!0);ce.insertBefore(ot,b(f))}}}return ne(f),!0}return(A?A(f):f.nodeType)===bt.element&&!no(f)||(H==="noscript"||H==="noembed"||H==="noframes")&&We(/<\/no(script|embed|frames)/i,f.innerHTML)?(ne(f),!0):(ee&&f.nodeType===bt.text&&(z=f.textContent,$t([$,L,j],ce=>{z=tn(z,ce," ")}),f.textContent!==z&&(en(o.removed,{element:f.cloneNode()}),f.textContent=z)),tt(N.afterSanitizeElements,f,null),!1)},io=function(f,z,H){if(me[z]||U&&(z==="id"||z==="name")&&(H in n||H in Jo))return!1;const ke=ae[z]||De.attributeCheck instanceof Function&&De.attributeCheck(z,f);if(!(Ge&&!me[z]&&We(X,z))){if(!(Ze&&We(ge,z))){if(!ke||me[z]){if(!(lo(f)&&(T.tagNameCheck instanceof RegExp&&We(T.tagNameCheck,f)||T.tagNameCheck instanceof Function&&T.tagNameCheck(f))&&(T.attributeNameCheck instanceof RegExp&&We(T.attributeNameCheck,z)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(z,f))||z==="is"&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&We(T.tagNameCheck,H)||T.tagNameCheck instanceof Function&&T.tagNameCheck(H))))return!1}else if(!at[z]){if(!We(v,tn(H,Ue,""))){if(!((z==="src"||z==="xlink:href"||z==="href")&&f!=="script"&&Mr(H,"data:")===0&&rn[f])){if(!(on&&!We(Be,tn(H,Ue,"")))){if(H)return!1}}}}}}return!0},ro=de({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),lo=function(f){return!ro[wn(f)]&&We(Le,f)},ao=function(f){tt(N.beforeSanitizeAttributes,f,null);const z=f.attributes;if(!z||mn(f))return;const H={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae,forceKeepAttr:void 0};let ke=z.length;for(;ke--;){const ce=z[ke],Ne=ce.name,ze=ce.namespaceURI,nt=ce.value,ot=Ce(Ne),pn=nt;let Pe=Ne==="value"?pn:Mu(pn);if(H.attrName=ot,H.attrValue=Pe,H.keepAttr=!0,H.forceKeepAttr=void 0,tt(N.uponSanitizeAttribute,f,H),Pe=H.attrValue,Z&&(ot==="id"||ot==="name")&&Mr(Pe,se)!==0&&($e(Ne,f),Pe=se+Pe),mt&&We(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Pe)){$e(Ne,f);continue}if(ot==="attributename"&&Ar(Pe,"href")){$e(Ne,f);continue}if(H.forceKeepAttr)continue;if(!H.keepAttr){$e(Ne,f);continue}if(!St&&We(/\/>/i,Pe)){$e(Ne,f);continue}ee&&$t([$,L,j],An=>{Pe=tn(Pe,An," ")});const so=Ce(f.nodeName);if(!io(so,ot,Pe)){$e(Ne,f);continue}if(h&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!ze)switch(g.getAttributeType(so,ot)){case"TrustedHTML":{Pe=oe(Pe);break}case"TrustedScriptURL":{Pe=h.createScriptURL(Pe);break}}if(Pe!==pn)try{ze?f.setAttributeNS(ze,Ne,Pe):f.setAttribute(Ne,Pe),mn(f)?ne(f):_r(o.removed)}catch{$e(Ne,f)}}tt(N.afterSanitizeAttributes,f,null)},fn=function(f){let z=null;const H=un(f);for(tt(N.beforeSanitizeShadowDOM,f,null);z=H.nextNode();)if(tt(N.uponSanitizeShadowNode,z,null),oo(z),ao(z),Tt(z.content)&&fn(z.content),(A?A(z):z.nodeType)===bt.element){const ce=M?M(z):z.shadowRoot;Tt(ce)&&(zt(ce),fn(ce))}tt(N.afterSanitizeShadowDOM,f,null)},zt=function(f){const z=A?A(f):f.nodeType;if(z===bt.element){const ce=M?M(f):f.shadowRoot;Tt(ce)&&(zt(ce),fn(ce))}const H=_?_(f):f.childNodes;if(!H)return;const ke=[];$t(H,ce=>{en(ke,ce)});for(const ce of ke)zt(ce);if(z===bt.element){const ce=C?C(f):null;if(typeof ce=="string"&&Ce(ce)==="template"){const Ne=f.content;Tt(Ne)&&zt(Ne)}}};return o.sanitize=function(J){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=null,H=null,ke=null,ce=null;if(sn=!J,sn&&(J="<!-->"),typeof J!="string"&&!xt(J)&&(J=Iu(J),typeof J!="string"))throw nn("dirty is not a string, aborting");if(!o.isSupported)return J;if(ye||Tn(f),o.removed=[],typeof J=="string"&&(Re=!1),Re){const nt=C?C(J):J.nodeName;if(typeof nt=="string"){const ot=Ce(nt);if(!B[ot]||ue[ot])throw nn("root node is forbidden and cannot be sanitized in-place")}if(mn(J))throw nn("root node is clobbered and cannot be sanitized in-place");zt(J)}else if(xt(J))z=Cn("<!---->"),H=z.ownerDocument.importNode(J,!0),H.nodeType===bt.element&&H.nodeName==="BODY"||H.nodeName==="HTML"?z=H:z.appendChild(H),zt(H);else{if(!je&&!ee&&!Me&&J.indexOf("<")===-1)return h&&yt?oe(J):J;if(z=Cn(J),!z)return je?null:yt?O:""}z&&kt&&ne(z.firstChild);const Ne=un(Re?J:z);for(;ke=Ne.nextNode();)oo(ke),ao(ke),Tt(ke.content)&&fn(ke.content);if(Re)return ee&&_n(J),J;if(je){if(ee&&_n(z),Qe)for(ce=G.call(z.ownerDocument);z.firstChild;)ce.appendChild(z.firstChild);else ce=z;return(ae.shadowroot||ae.shadowrootmode)&&(ce=F.call(i,ce,!0)),ce}let ze=Me?z.outerHTML:z.innerHTML;return Me&&B["!doctype"]&&z.ownerDocument&&z.ownerDocument.doctype&&z.ownerDocument.doctype.name&&We(Gu,z.ownerDocument.doctype.name)&&(ze="<!DOCTYPE "+z.ownerDocument.doctype.name+`>
130
+ `+ze),ee&&$t([$,L,j],nt=>{ze=tn(ze,nt," ")}),h&&yt?oe(ze):ze},o.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tn(J),ye=!0},o.clearConfig=function(){Bt=null,ye=!1},o.isValidAttribute=function(J,f,z){Bt||Tn({});const H=Ce(J),ke=Ce(f);return io(H,ke,z)},o.addHook=function(J,f){typeof f=="function"&&en(N[J],f)},o.removeHook=function(J,f){if(f!==void 0){const z=_u(N[J],f);return z===-1?void 0:Au(N[J],z,1)[0]}return _r(N[J])},o.removeHooks=function(J){N[J]=[]},o.removeAllHooks=function(){N=Dr()},o}var Yu=Vr();const Zu=new wr({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new En;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),r=To(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${r}</code></pre>`},t})()}),Xu=["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"],Ju=["href","title","target","rel","src","alt","class","checked","type","disabled"],Qu=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function em(t){if(!t)return"";const o=Zu.parse(t,{async:!1});return Yu.sanitize(o,{ALLOWED_TAGS:Xu,ALLOWED_ATTR:Ju,ALLOWED_URI_REGEXP:Qu})}const tm={class:"zm-note-panel"},nm={key:0,class:"zm-note-empty"},om={class:"zm-note-header"},im={class:"zm-note-title-row"},rm={class:"zm-note-name"},lm={class:"zm-note-meta"},am={class:"zm-note-scroll"},sm={class:"zm-note-section"},cm={class:"zm-note-section-head"},dm={class:"zm-note-split"},um=["disabled"],mm={key:0,class:"zm-note-preview"},fm=["innerHTML"],pm={key:1,class:"zm-note-preview-hint"},gm={key:0,class:"zm-note-section-actions"},hm={key:0,class:"zm-note-add-row"},bm={key:1,class:"zm-note-section"},km=["disabled"],ym=["href","title"],Em={key:2,class:"zm-note-section"},xm=["disabled"],wm=["src","alt"],Nm={key:3,class:"zm-note-section"},Sm={class:"zm-note-section-head"},Tm={key:0,class:"zm-note-section-tag"},Cm=["disabled"],_m={key:0,class:"zm-note-code"},Am=["innerHTML"],Mm={key:4,class:"zm-note-section"},Rm=["disabled"],Bm={key:0,class:"zm-note-table"},zm=["onClick"],Om={class:"zm-note-table-sort-mark","aria-hidden":"true"},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,r=e.ref(""),a=e.ref(null);Ro(a,{minRows:4,maxRows:10});const s=e.computed(()=>!r.value||r.value.trim()===""),u=e.computed(()=>em(r.value)),c=e.ref(!0);function m(){c.value=!c.value}e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:ie.text]},()=>{var v,B;r.value=((B=(v=n.selectedNode)==null?void 0:v.note)==null?void 0:B.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const v=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(v){v.focus();const B=v.value.length;v.setSelectionRange(B,B)}});function p(){var ie,ae;if(n.readonly)return;const v=r.value,B=((ae=(ie=n.selectedNode)==null?void 0:ie.note)==null?void 0:ae.text)??"";v!==B&&i("apply",v)}function g(v){var B,ie;n.readonly||(v.key==="Escape"?(v.preventDefault(),r.value=((ie=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:ie.text)??"",v.target.blur()):v.key==="Enter"&&(v.ctrlKey||v.metaKey)&&(v.preventDefault(),p(),v.target.blur()))}function y(){n.readonly||confirm("移除该节点的笔记?")&&(r.value="",i("remove"))}const w=e.computed(()=>{var v,B;return!!((B=(v=n.selectedNode)==null?void 0:v.link)!=null&&B.url)}),k=e.computed(()=>{var v,B;return!!((B=(v=n.selectedNode)==null?void 0:v.image)!=null&&B.src)}),b=e.computed(()=>{var v,B;return(B=(v=n.selectedNode)==null?void 0:v.richContent)==null?void 0:B.kind}),_=e.computed(()=>b.value==="code"),x=e.computed(()=>b.value==="table"),M=e.ref(!1),S=e.ref(!1),A=e.ref(!1),C=e.ref(!1);e.watch(()=>{var v;return(v=n.selectedNode)==null?void 0:v.id},()=>{M.value=!1,S.value=!1,A.value=!1,C.value=!1});const h=e.ref("");e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.link)==null?void 0:ie.url]},()=>{var v,B;h.value=((B=(v=n.selectedNode)==null?void 0:v.link)==null?void 0:B.url)??""},{immediate:!0});function O(){var ie,ae;if(n.readonly)return;const v=h.value.trim(),B=((ae=(ie=n.selectedNode)==null?void 0:ie.link)==null?void 0:ae.url)??"";v!==B&&i("set-link",v)}const W=e.ref("");e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.image)==null?void 0:ie.src]},()=>{var v,B;W.value=((B=(v=n.selectedNode)==null?void 0:v.image)==null?void 0:B.src)??""},{immediate:!0});function oe(){var ie,ae;if(n.readonly)return;const v=W.value.trim(),B=((ae=(ie=n.selectedNode)==null?void 0:ie.image)==null?void 0:ae.src)??"";v!==B&&i("set-image",v)}function K(v){const B=v.target;B.style.display="none"}function te(v){const B=v.target;B.style.display=""}const le=e.ref(""),G=e.ref(null);Ro(G,{minRows:4,maxRows:18}),e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:ie.raw]},()=>{var v,B;le.value=((B=(v=n.selectedNode)==null?void 0:v.richContent)==null?void 0:B.raw)??""},{immediate:!0});const Y=e.computed(()=>To(So(le.value),qt(le.value)));function F(){var ae,D;if(n.readonly)return;const v=le.value,B=((D=(ae=n.selectedNode)==null?void 0:ae.richContent)==null?void 0:D.raw)??"";if(v===B)return;const ie=qt(v)||void 0;i("set-rich",v?{kind:"code",raw:v,lang:ie}:null)}const N=e.ref(""),$=e.ref(null);Ro($,{minRows:4,maxRows:14});const L=e.ref(-1),j=e.ref("asc");e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:ie.raw]},()=>{var v,B;N.value=((B=(v=n.selectedNode)==null?void 0:v.richContent)==null?void 0:B.raw)??"",L.value=-1,j.value="asc"},{immediate:!0});function X(){var ie,ae;if(n.readonly)return;const v=N.value,B=((ae=(ie=n.selectedNode)==null?void 0:ie.richContent)==null?void 0:ae.raw)??"";v!==B&&i("set-rich",v?{kind:"table",raw:v}:null)}const ge=e.computed(()=>nr(N.value)),Be=e.computed(()=>{const v=ge.value;return L.value<0||v.length<=1?v:or(v,L.value,j.value)});function Ue(v){L.value!==v?(L.value=v,j.value="asc"):j.value==="asc"?j.value="desc":L.value=-1}const Le=e.computed(()=>{const v=[];return s.value||v.push(`${r.value.length} 字`),w.value&&v.push("1 链接"),k.value&&v.push("1 图片"),_.value&&v.push("代码块"),x.value&&v.push("表格"),v.length===0?"节点没有额外内容":v.join(" · ")});return(v,B)=>{var ie,ae,D,T;return e.openBlock(),e.createElementBlock("div",tm,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",om,[e.createElementVNode("div",im,[B[12]||(B[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",rm,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",lm,e.toDisplayString(Le.value),1)]),e.createElementVNode("div",am,[e.createElementVNode("section",sm,[e.createElementVNode("header",cm,[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:m},e.toDisplayString(c.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",dm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:a,"onUpdate:modelValue":B[0]||(B[0]=ue=>r.value=ue),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:p,onKeydown:g},null,40,um),[[e.vModelText,r.value]]),c.value?(e.openBlock(),e.createElementBlock("div",mm,[s.value?(e.openBlock(),e.createElementBlock("div",pm," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,fm))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",gm,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:y},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",hm,[!w.value&&!M.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:B[1]||(B[1]=ue=>M.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!k.value&&!S.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:B[2]||(B[2]=ue=>S.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!_.value&&!A.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:B[3]||(B[3]=ue=>A.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!x.value&&!C.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:B[4]||(B[4]=ue=>C.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),w.value||M.value?(e.openBlock(),e.createElementBlock("section",bm,[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]=ue=>h.value=ue),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:O,onKeydown:B[6]||(B[6]=e.withKeys(e.withModifiers(ue=>ue.target.blur(),["prevent"]),["enter"]))},null,40,km),[[e.vModelText,h.value]]),w.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(ie=t.selectedNode.link)==null?void 0:ie.url,target:"_blank",rel:"noopener noreferrer",title:(ae=t.selectedNode.link)==null?void 0:ae.url},e.toDisplayString((D=t.selectedNode.link)==null?void 0:D.url),9,ym)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),k.value||S.value?(e.openBlock(),e.createElementBlock("section",Em,[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]=ue=>W.value=ue),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:oe,onKeydown:B[8]||(B[8]=e.withKeys(e.withModifiers(ue=>ue.target.blur(),["prevent"]),["enter"]))},null,40,xm),[[e.vModelText,W.value]]),k.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(T=t.selectedNode.image)==null?void 0:T.src,alt:t.selectedNode.text,onError:K,onLoad:te},null,40,wm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||A.value?(e.openBlock(),e.createElementBlock("section",Nm,[e.createElementVNode("header",Sm,[B[17]||(B[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(qt)(le.value)?(e.openBlock(),e.createElementBlock("span",Tm,e.toDisplayString(e.unref(qt)(le.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:G,"onUpdate:modelValue":B[9]||(B[9]=ue=>le.value=ue),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:F},null,40,Cm),[[e.vModelText,le.value]]),le.value.trim()?(e.openBlock(),e.createElementBlock("pre",_m,[e.createElementVNode("code",{innerHTML:Y.value},null,8,Am)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),x.value||C.value?(e.openBlock(),e.createElementBlock("section",Mm,[B[18]||(B[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:$,"onUpdate:modelValue":B[10]||(B[10]=ue=>N.value=ue),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
131
131
  | --- | --- |
132
- | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:X},null,40,Sm),[[e.vModelText,N.value]]),ge.value.length?(e.openBlock(),e.createElementBlock("table",Tm,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,(ue,me)=>(e.openBlock(),e.createElementBlock("tr",{key:me},[me===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ue,(De,Ze)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ze}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":L.value===Ze,"is-asc":L.value===Ze&&j.value==="asc","is-desc":L.value===Ze&&j.value==="desc"}]),onClick:Ge=>Fe(Ze)},[e.createElementVNode("span",null,e.toDisplayString(De),1),e.createElementVNode("span",_m,e.toDisplayString(L.value===Ze?j.value==="asc"?"▲":"▼":"↕"),1)],10,Cm))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ue,(De,Ze)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ze}`},e.toDisplayString(De),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",Zu,[...B[11]||(B[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Rm={class:"zm-app"},Mm={class:"zm-app-main"},Bm={key:0,class:"zm-app-toolbar"},zm={class:"zm-app-tip"},Om={class:"zm-app-canvas"},Im={class:"zm-settings-popover-header"},vr=e.defineComponent({__name:"App",props:{showOutlineBtn:{type:Boolean,default:!0},showDataBtn:{type:Boolean,default:!0},showMarkdownBtn:{type:Boolean,default:!1},showSettingsBtn:{type:Boolean,default:!0},showPreviewModeBtn:{type:Boolean,default:!0}},setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
132
+ | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:X},null,40,Rm),[[e.vModelText,N.value]]),ge.value.length?(e.openBlock(),e.createElementBlock("table",Bm,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,(ue,me)=>(e.openBlock(),e.createElementBlock("tr",{key:me},[me===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ue,(De,Ze)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ze}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":L.value===Ze,"is-asc":L.value===Ze&&j.value==="asc","is-desc":L.value===Ze&&j.value==="desc"}]),onClick:Ge=>Ue(Ze)},[e.createElementVNode("span",null,e.toDisplayString(De),1),e.createElementVNode("span",Om,e.toDisplayString(L.value===Ze?j.value==="asc"?"▲":"▼":"↕"),1)],10,zm))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ue,(De,Ze)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ze}`},e.toDisplayString(De),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",nm,[...B[11]||(B[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Im={class:"zm-app"},vm={class:"zm-app-main"},Lm={key:0,class:"zm-app-toolbar"},Dm={class:"zm-app-tip"},Vm={class:"zm-app-canvas"},$m={class:"zm-settings-popover-header"},$r=e.defineComponent({__name:"App",props:{showOutlineBtn:{type:Boolean,default:!0},showDataBtn:{type:Boolean,default:!0},showMarkdownBtn:{type:Boolean,default:!1},showSettingsBtn:{type:Boolean,default:!0},showPreviewModeBtn:{type:Boolean,default:!0}},setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
133
133
  所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},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 形式携带,
134
134
  渲染在节点标题上方,自动支持语言 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
135
135
  interface Node {
@@ -160,4 +160,4 @@ function walk(n: Node) {
160
160
  | --- | --- | --- | --- | --- |
161
161
  | 1 | 2 | 3 | 4 | 5 |
162
162
  | 6 | 7 | 8 | 9 | 10 |`},children:[]}]},{id:"r_note",text:"笔记 (note)",note:{text:`节点右上角的便签图标。
163
- 鼠标悬浮预览前 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"?r:(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:[]}]},r=(()=>{const D=(me,De)=>({id:me,text:De,children:[]}),T=[D("s_l1","左一"),D("s_l2","左二"),D("s_l3","左三"),D("s_l4","左四"),D("s_l5","左五"),D("s_l6","左六"),D("s_l7","左七")],ue=[D("s_r1","右一"),D("s_r2","右二"),D("s_r3","右三"),D("s_r4","右四"),D("s_r5","右五"),D("s_r6","右六"),D("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...T,...ue]}})(),a=e.ref(o),c=t,u=e.ref(null),s=e.ref(new Set),m=e.ref(!1),p=e.ref(!1),g=e.ref(!1),y=e.ref(!1),w=e.ref(0),k=e.ref(!1),b=e.ref(!1),_=e.ref(null);function x(){a.value=n(),R.value=typeof location<"u"&&location.hash==="#rich"}const R=e.ref(!0);function S(){p.value=!0,g.value=!1,y.value=!1}function A(D){S()}const C=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function h(D){var T;Object.assign(C,D),(T=_.value)==null||T.applySettings(D)}function O(D){var T;u.value&&((T=_.value)==null||T.applyNodeStyle(u.value.id,D))}function W(){var T;const D={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1};Object.assign(C,D),(T=_.value)==null||T.applySettings(D)}function oe(D){if(!k.value)return;const T=D.target;T&&T.closest(".zm-settings-popover")||T&&T.closest('.zm-app-icon-btn[title="显示设置"]')||(k.value=!1)}function K(D){if(D.key==="Escape"){if(k.value){k.value=!1,D.stopPropagation();return}b.value&&(b.value=!1,D.stopPropagation())}}e.onMounted(()=>{var D;document.addEventListener("click",oe),document.addEventListener("keydown",K),window.addEventListener("hashchange",x),(D=_.value)==null||D.applySettings({rainbowBranch:C.rainbowBranch,branchPaletteId:C.branchPaletteId,customPalettes:C.customPalettes,lineWidthStart:C.lineWidthStart,lineWidthEnd:C.lineWidthEnd,lineStyle:C.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("click",oe),document.removeEventListener("keydown",K),window.removeEventListener("hashchange",x)});function te(D){a.value=D}function le(D){u.value=D,D?y.value||(p.value=!1,g.value=!1,y.value=!0):y.value=!1}e.watch(a,D=>{if(!u.value)return;const T=Y(D,u.value.id);T?T!==u.value&&(u.value=T):u.value=null},{deep:!1});function G(D){if(!u.value||u.value.id!==D){const T=Y(a.value,D);T&&(u.value=T)}p.value=!1,g.value=!1,y.value=!0,w.value++}function Y(D,T){if(D.id===T)return D;for(const ue of D.children){const me=Y(ue,T);if(me)return me}return null}function U(D){var T;u.value&&((T=_.value)==null||T.applyNodeNote(u.value.id,D))}function N(){var D;u.value&&((D=_.value)==null||D.removeNodeNote(u.value.id))}function $(D){var T;u.value&&((T=_.value)==null||T.applyNodeLink(u.value.id,D))}function L(D){var T;u.value&&((T=_.value)==null||T.applyNodeImageByUrl(u.value.id,D))}function j(D){var T;u.value&&((T=_.value)==null||T.applyNodeRichContent(u.value.id,D))}function X(D){const T=document.querySelector(`[data-node-id="${D.id}"]`);T&&T.click()}function ge(D){const T=new Set(s.value);T.has(D)?T.delete(D):T.add(D),s.value=T}function Be(D){var T;(T=_.value)==null||T.setNodeText(D.id,D.text)}function Fe(D){var T;(T=_.value)==null||T.addChild(D)}function Le(D){var T;(T=_.value)==null||T.addSibling(D)}function v(D){var T;(T=_.value)==null||T.moveNode(D.srcId,D.targetId,D.position)}const B=e.computed(()=>{var D;return((D=u.value)==null?void 0:D.id)??null});function ie(D){return 1+D.children.reduce((T,ue)=>T+ie(ue),0)}const ae=e.computed(()=>ie(a.value));return(D,T)=>{var ue;return e.openBlock(),e.createElementBlock("div",Rm,[e.createVNode(Wn,{side:"left",width:300,open:m.value,title:"大纲","onUpdate:open":T[0]||(T[0]=me=>m.value=me)},{default:e.withCtx(()=>[e.createVNode(Co,{data:a.value,"selected-id":B.value,"collapsed-ids":s.value,onSelect:X,onToggleCollapse:ge,onEdit:Be,onAddChild:Fe,onAddSibling:Le,onMove:v},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",Mm,[b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Bm,[c.showOutlineBtn&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-icon-btn",title:"显示大纲",onClick:T[1]||(T[1]=me=>m.value=!0)},[...T[18]||(T[18]=[e.createStaticVNode('<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',1)])])):e.createCommentVNode("",!0),c.showDataBtn&&!p.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-icon-btn",title:"显示数据",onClick:T[2]||(T[2]=me=>{p.value=!0,g.value=!1,y.value=!1})},[...T[19]||(T[19]=[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("polyline",{points:"16 18 22 12 16 6"}),e.createElementVNode("polyline",{points:"8 6 2 12 8 18"})],-1)])])):e.createCommentVNode("",!0),c.showMarkdownBtn&&!g.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-app-icon-btn",title:"显示 Markdown",onClick:T[3]||(T[3]=me=>{g.value=!0,p.value=!1,y.value=!1})},[...T[20]||(T[20]=[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:"M4 7 V4 H20 V7"}),e.createElementVNode("path",{d:"M9 20 H15"}),e.createElementVNode("path",{d:"M12 4 V20"})],-1)])])):e.createCommentVNode("",!0),c.showSettingsBtn&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-app-icon-btn",title:"显示设置",onClick:T[4]||(T[4]=me=>k.value=!0)},[...T[21]||(T[21]=[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("circle",{cx:"12",cy:"12",r:"3"}),e.createElementVNode("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1)])])):e.createCommentVNode("",!0),T[24]||(T[24]=e.createElementVNode("span",{class:"zm-app-spacer"},null,-1)),e.createElementVNode("span",zm,e.toDisplayString(a.value.text||"未命名")+" · "+e.toDisplayString(ae.value)+" 节点",1),e.createCommentVNode("",!0),c.showPreviewModeBtn?(e.openBlock(),e.createElementBlock("button",{key:5,class:e.normalizeClass(["zm-app-icon-btn",{"is-on":b.value}]),title:"进入预览模式",onClick:T[5]||(T[5]=me=>b.value=!0)},[...T[23]||(T[23]=[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("circle",{cx:"12",cy:"12",r:"3"})],-1)])],2)):e.createCommentVNode("",!0)])),b.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:T[6]||(T[6]=me=>b.value=!1)},[...T[25]||(T[25]=[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",Om,[e.createVNode(Hn,{ref_key:"mindMapRef",ref:_,data:a.value,"preview-mode":b.value,onChange:te,onSelect:le,onEditNote:G,onCanvasSettings:T[7]||(T[7]=me=>k.value=!0),onCanvasData:S,onCanvasImport:A,onCanvasTogglePreview:T[8]||(T[8]=me=>b.value=!b.value),onCanvasOutline:T[9]||(T[9]=me=>m.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Wn,{side:"right",width:360,open:p.value&&!b.value,title:"数据","onUpdate:open":T[11]||(T[11]=me=>p.value=me)},{default:e.withCtx(()=>[e.createVNode(uc,{data:a.value,onImport:T[10]||(T[10]=me=>a.value=me)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Wn,{side:"right",width:420,open:g.value&&!b.value,title:"Markdown","onUpdate:open":T[13]||(T[13]=me=>g.value=me)},{default:e.withCtx(()=>[e.createVNode(Td,{data:a.value,onImport:T[12]||(T[12]=me=>a.value=me)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Wn,{side:"right",width:360,open:y.value&&!b.value,title:"节点内容","onUpdate:open":T[14]||(T[14]=me=>y.value=me)},{default:e.withCtx(()=>[e.createVNode(Am,{"selected-node":u.value,readonly:!1,"focus-tick":w.value,onApply:U,onRemove:N,onSetLink:$,onSetImage:L,onSetRich:j},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),k.value&&!b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-settings-backdrop",onClick:T[15]||(T[15]=me=>k.value=!1)})):e.createCommentVNode("",!0),k.value&&!b.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-settings-popover",onClick:T[17]||(T[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Im,[T[27]||(T[27]=e.createElementVNode("span",{class:"zm-settings-popover-title"},"设置",-1)),e.createElementVNode("button",{class:"zm-settings-close",onClick:T[16]||(T[16]=me=>k.value=!1),title:"关闭"},[...T[26]||(T[26]=[e.createElementVNode("svg",{width:"12",height:"12",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.createVNode(gd,{settings:C,"has-selection":u.value!==null,"selected-node-text":(ue=u.value)==null?void 0:ue.text,"onUpdate:settings":h,"onUpdate:nodeStyle":O,onReset:W},null,8,["settings","has-selection","selected-node-text"])])):e.createCommentVNode("",!0)])}}}),vm={install(t){t.component("FlowMindMap",Hn),t.component("FlowMindMapOutline",Co),t.component("FlowMindMapApp",vr)}};Ae.MindMap=Hn,Ae.MindMapApp=vr,Ae.Outline=Co,Ae.addChild=si,Ae.addSibling=ci,Ae.clone=pt,Ae.default=vm,Ae.findNode=pe,Ae.findParent=ct,Ae.markdownToMindMap=Ht,Ae.markdownToRichMindMap=wl,Ae.mindMapToMarkdown=Wt,Ae.removeNode=go,Ae.richBlockToMarkdown=Nl,Ae.uid=ft,Object.defineProperties(Ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
163
+ 鼠标悬浮预览前 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"?r:(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:[]}]},r=(()=>{const D=(me,De)=>({id:me,text:De,children:[]}),T=[D("s_l1","左一"),D("s_l2","左二"),D("s_l3","左三"),D("s_l4","左四"),D("s_l5","左五"),D("s_l6","左六"),D("s_l7","左七")],ue=[D("s_r1","右一"),D("s_r2","右二"),D("s_r3","右三"),D("s_r4","右四"),D("s_r5","右五"),D("s_r6","右六"),D("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...T,...ue]}})(),a=e.ref(o),s=t,u=e.ref(null),c=e.ref(new Set),m=e.ref(!1),p=e.ref(!1),g=e.ref(!1),y=e.ref(!1),w=e.ref(0),k=e.ref(!1),b=e.ref(!1),_=e.ref(null);function x(){a.value=n(),M.value=typeof location<"u"&&location.hash==="#rich"}const M=e.ref(!0);function S(){p.value=!0,g.value=!1,y.value=!1}function A(D){S()}const C=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function h(D){var T;Object.assign(C,D),(T=_.value)==null||T.applySettings(D)}function O(D){var T;u.value&&((T=_.value)==null||T.applyNodeStyle(u.value.id,D))}function W(){var T;const D={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1};Object.assign(C,D),(T=_.value)==null||T.applySettings(D)}function oe(D){if(!k.value)return;const T=D.target;T&&T.closest(".zm-settings-popover")||T&&T.closest('.zm-app-icon-btn[title="显示设置"]')||(k.value=!1)}function K(D){if(D.key==="Escape"){if(k.value){k.value=!1,D.stopPropagation();return}b.value&&(b.value=!1,D.stopPropagation())}}e.onMounted(()=>{var D;document.addEventListener("click",oe),document.addEventListener("keydown",K),window.addEventListener("hashchange",x),(D=_.value)==null||D.applySettings({rainbowBranch:C.rainbowBranch,branchPaletteId:C.branchPaletteId,customPalettes:C.customPalettes,lineWidthStart:C.lineWidthStart,lineWidthEnd:C.lineWidthEnd,lineStyle:C.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("click",oe),document.removeEventListener("keydown",K),window.removeEventListener("hashchange",x)});function te(D){a.value=D}function le(D){u.value=D,D?y.value||(p.value=!1,g.value=!1,y.value=!0):y.value=!1}e.watch(a,D=>{if(!u.value)return;const T=Y(D,u.value.id);T?T!==u.value&&(u.value=T):u.value=null},{deep:!1});function G(D){if(!u.value||u.value.id!==D){const T=Y(a.value,D);T&&(u.value=T)}p.value=!1,g.value=!1,y.value=!0,w.value++}function Y(D,T){if(D.id===T)return D;for(const ue of D.children){const me=Y(ue,T);if(me)return me}return null}function F(D){var T;u.value&&((T=_.value)==null||T.applyNodeNote(u.value.id,D))}function N(){var D;u.value&&((D=_.value)==null||D.removeNodeNote(u.value.id))}function $(D){var T;u.value&&((T=_.value)==null||T.applyNodeLink(u.value.id,D))}function L(D){var T;u.value&&((T=_.value)==null||T.applyNodeImageByUrl(u.value.id,D))}function j(D){var T;u.value&&((T=_.value)==null||T.applyNodeRichContent(u.value.id,D))}function X(D){const T=document.querySelector(`[data-node-id="${D.id}"]`);T&&T.click()}function ge(D){const T=new Set(c.value);T.has(D)?T.delete(D):T.add(D),c.value=T}function Be(D){var T;(T=_.value)==null||T.setNodeText(D.id,D.text)}function Ue(D){var T;(T=_.value)==null||T.addChild(D)}function Le(D){var T;(T=_.value)==null||T.addSibling(D)}function v(D){var T;(T=_.value)==null||T.moveNode(D.srcId,D.targetId,D.position)}const B=e.computed(()=>{var D;return((D=u.value)==null?void 0:D.id)??null});function ie(D){return 1+D.children.reduce((T,ue)=>T+ie(ue),0)}const ae=e.computed(()=>ie(a.value));return(D,T)=>{var ue;return e.openBlock(),e.createElementBlock("div",Im,[e.createVNode(Zt,{side:"left",width:300,open:m.value,title:"大纲","onUpdate:open":T[0]||(T[0]=me=>m.value=me)},{default:e.withCtx(()=>[e.createVNode(Co,{data:a.value,"selected-id":B.value,"collapsed-ids":c.value,onSelect:X,onToggleCollapse:ge,onEdit:Be,onAddChild:Ue,onAddSibling:Le,onMove:v},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",vm,[b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Lm,[s.showOutlineBtn&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-icon-btn",title:"显示大纲",onClick:T[1]||(T[1]=me=>m.value=!0)},[...T[18]||(T[18]=[e.createStaticVNode('<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',1)])])):e.createCommentVNode("",!0),s.showDataBtn&&!p.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-icon-btn",title:"显示数据",onClick:T[2]||(T[2]=me=>{p.value=!0,g.value=!1,y.value=!1})},[...T[19]||(T[19]=[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("polyline",{points:"16 18 22 12 16 6"}),e.createElementVNode("polyline",{points:"8 6 2 12 8 18"})],-1)])])):e.createCommentVNode("",!0),s.showMarkdownBtn&&!g.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-app-icon-btn",title:"显示 Markdown",onClick:T[3]||(T[3]=me=>{g.value=!0,p.value=!1,y.value=!1})},[...T[20]||(T[20]=[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:"M4 7 V4 H20 V7"}),e.createElementVNode("path",{d:"M9 20 H15"}),e.createElementVNode("path",{d:"M12 4 V20"})],-1)])])):e.createCommentVNode("",!0),s.showSettingsBtn&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-app-icon-btn",title:"显示设置",onClick:T[4]||(T[4]=me=>k.value=!0)},[...T[21]||(T[21]=[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("circle",{cx:"12",cy:"12",r:"3"}),e.createElementVNode("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1)])])):e.createCommentVNode("",!0),T[24]||(T[24]=e.createElementVNode("span",{class:"zm-app-spacer"},null,-1)),e.createElementVNode("span",Dm,e.toDisplayString(a.value.text||"未命名")+" · "+e.toDisplayString(ae.value)+" 节点",1),e.createCommentVNode("",!0),s.showPreviewModeBtn?(e.openBlock(),e.createElementBlock("button",{key:5,class:e.normalizeClass(["zm-app-icon-btn",{"is-on":b.value}]),title:"进入预览模式",onClick:T[5]||(T[5]=me=>b.value=!0)},[...T[23]||(T[23]=[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("circle",{cx:"12",cy:"12",r:"3"})],-1)])],2)):e.createCommentVNode("",!0)])),b.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:T[6]||(T[6]=me=>b.value=!1)},[...T[25]||(T[25]=[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",Vm,[e.createVNode(Wn,{ref_key:"mindMapRef",ref:_,data:a.value,"preview-mode":b.value,onChange:te,onSelect:le,onEditNote:G,onCanvasSettings:T[7]||(T[7]=me=>k.value=!0),onCanvasData:S,onCanvasImport:A,onCanvasTogglePreview:T[8]||(T[8]=me=>b.value=!b.value),onCanvasOutline:T[9]||(T[9]=me=>m.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Zt,{side:"right",width:360,open:p.value&&!b.value,title:"数据","onUpdate:open":T[11]||(T[11]=me=>p.value=me)},{default:e.withCtx(()=>[e.createVNode(_o,{data:a.value,onImport:T[10]||(T[10]=me=>a.value=me)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Zt,{side:"right",width:420,open:g.value&&!b.value,title:"Markdown","onUpdate:open":T[13]||(T[13]=me=>g.value=me)},{default:e.withCtx(()=>[e.createVNode(Ao,{data:a.value,onImport:T[12]||(T[12]=me=>a.value=me)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Zt,{side:"right",width:360,open:y.value&&!b.value,title:"节点内容","onUpdate:open":T[14]||(T[14]=me=>y.value=me)},{default:e.withCtx(()=>[e.createVNode(qo,{"selected-node":u.value,readonly:!1,"focus-tick":w.value,onApply:F,onRemove:N,onSetLink:$,onSetImage:L,onSetRich:j},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),k.value&&!b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-settings-backdrop",onClick:T[15]||(T[15]=me=>k.value=!1)})):e.createCommentVNode("",!0),k.value&&!b.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-settings-popover",onClick:T[17]||(T[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",$m,[T[27]||(T[27]=e.createElementVNode("span",{class:"zm-settings-popover-title"},"设置",-1)),e.createElementVNode("button",{class:"zm-settings-close",onClick:T[16]||(T[16]=me=>k.value=!1),title:"关闭"},[...T[26]||(T[26]=[e.createElementVNode("svg",{width:"12",height:"12",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.createVNode(Mo,{settings:C,"has-selection":u.value!==null,"selected-node-text":(ue=u.value)==null?void 0:ue.text,"onUpdate:settings":h,"onUpdate:nodeStyle":O,onReset:W},null,8,["settings","has-selection","selected-node-text"])])):e.createCommentVNode("",!0)])}}}),Pm={install(t){t.component("FlowMindMap",Wn),t.component("FlowMindMapOutline",Co),t.component("FlowMindMapDrawer",Zt),t.component("FlowMindMapDataPanel",_o),t.component("FlowMindMapMarkdownPanel",Ao),t.component("FlowMindMapSettingsPanel",Mo),t.component("FlowMindMapNotePanel",qo),t.component("FlowMindMapApp",$r)}};Ee.DataPanel=_o,Ee.Drawer=Zt,Ee.MarkdownPanel=Ao,Ee.MindMap=Wn,Ee.MindMapApp=$r,Ee.NotePanel=qo,Ee.Outline=Co,Ee.SettingsPanel=Mo,Ee.addChild=mi,Ee.addSibling=fi,Ee.clone=pt,Ee.default=Pm,Ee.findNode=pe,Ee.findParent=ct,Ee.markdownToMindMap=Ht,Ee.markdownToRichMindMap=Cl,Ee.mindMapToMarkdown=Wt,Ee.removeNode=go,Ee.richBlockToMarkdown=_l,Ee.uid=ft,Object.defineProperties(Ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});