flow-mindmap 0.4.6 → 0.5.0

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,26 +1,29 @@
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 hf=Object.defineProperty;var bf=(Ee,e,Yt)=>e in Ee?hf(Ee,e,{enumerable:!0,configurable:!0,writable:!0,value:Yt}):Ee[e]=Yt;var Ae=(Ee,e,Yt)=>bf(Ee,typeof e!="symbol"?e+"":e,Yt);var no;const Yt=["width","height","stroke-width"],al={key:4,points:"6 9 12 15 18 9"},sl={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",al)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",sl)):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,Yt))}}),di="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",ui="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",mi=[18,15,13,12],cl=[700,600,500,400],dl=[52,40,32,28],ul=[120,80,60,44],ml=[.8,.8,.8,.8],fl=mi.length-1;function pl(t,o){return Math.round(Eo(t,o)*ml[Dn(t)])}function Dn(t){return Math.min(fl,Math.max(0,t))}function Eo(t,o=14){return Math.round(mi[Dn(t)]*o/14*10)/10}function gl(t,o=14){return Math.round(dl[Dn(t)]*o/14)}const Vn=60,Xt=14,st=24;let xo=null;function hl(){if(xo)return xo;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(xo=t,t):{font:"",measureText:()=>({width:0})}}const fi=new Map;function bl(t,o,n){const i=`${n}|${o}|${t}`,r=fi.get(i);if(r!==void 0)return r;const s=hl();s.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=s.measureText(t).width;return fi.set(i,c),c}const kl=24,yl=400,El=8,pi=16,xl=4,wl=200;function Nl(t,o,n){return Math.min(n,Math.max(o,t))}function Sl(t,o,n,i,r){const s=Dn(o),c=Eo(o,n),u=Math.min(bl(t.text||"",c,cl[s]),wl),d=pl(o,n),m=Math.ceil(u+d*2),k=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:gl(o,n);let y=0;if(t.link&&(y+=pi),t.note&&(y+=pi),y>0){const b=(t.link?1:0)+(t.note?1:0);y+=xl*b}const w=m+y,E=(()=>{const b=Math.round(ul[s]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const v=r==null?void 0:r[t.id];return Math.max(b,v??240)}return b})(),L=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),C=i==null?void 0:i[t.id],x=L?Math.max(24,C??Math.max(70,Math.ceil(c*5))):0,R=x>0?10:0;if(!t.image){const b=Math.max(E,w),v=Math.ceil(k+R+x);return{w:b,h:v}}const S=Nl(t.image.width,kl,yl),g=Math.max(E,w,Math.ceil(S+d*2)),_=Math.ceil(t.image.height+El+k+R+x);return{w:g,h:_}}function Tl(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,r=o.baseFontSize??14,s=hi(t,0,null,1,"right",r,o.richHeights,o.richWidths);return _l(s),Cl(s,n,i),s.x=0,s.y=0,Al(s,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((k,y)=>k+y._subtreeH,0);let d=1,m=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),p=0;for(let k=0;k<i.length-1;k++){p+=i[k]._subtreeH;const y=Math.abs(p-(u-p));y<m&&(m=y,d=k+1)}for(let k=0;k<d;k++)i[k]._dir="right",i[k].side=1,i[k]._dirRight=1;for(let k=d;k<i.length;k++)i[k]._dir="left",i[k].side=-1,i[k]._dirRight=-1}const r=t.children.filter(u=>u.side===1),s=t.children.filter(u=>u.side===-1),c=(u,d)=>{const m=d==="right"?1:-1;u._dir=d,u.side=m,u._dirRight=m;for(const p of u.children)c(p,d)};for(const u of r)c(u,"right");for(const u of s)c(u,"left");if(r.length>0){const u={...t,children:r};$n(u,"right",Vn,!0,n)}if(s.length>0){const u={...t,children:s};$n(u,"left",Vn,!0,n)}}else if(o==="tree"){const i=r=>{r.side=1,r._dir="right";for(const s of r.children)i(s)};for(const r of t.children)r._dir="right";$n(t,"right",Vn,!0,n),i(t)}else{for(const i of t.children)i._dir="down";gi(t,Vn,n)}}function $n(t,o,n,i,r=!1){if(t.children.length===0)return;const s=t.children.reduce((m,p,k)=>m+p._subtreeH+(k>0?Xt:0),0),c=o==="right"?1:-1,u=i?c:1;let d=t.y-u*s/2;t.children.forEach(m=>{r||(m.x=t.x+c*(t.width/2+n+m.width/2),m.y=d+u*m._subtreeH/2),m._dir=o,d+=u*(m._subtreeH+Xt),$n(m,o,n,!1,r)})}function gi(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,c,u)=>s+c._subtreeW+(u>0?Xt*2:0),0);let r=t.x-i/2;t.children.forEach(s=>{n||(s.x=r+s._subtreeW/2,s.y=t.y+t.height/2+o+s.height/2),s._dir="down",r+=s._subtreeW+Xt*2,gi(s,o,n)})}function hi(t,o,n,i,r,s,c,u){const d=Sl(t,o,s,c,u),m={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:Eo(o,s),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:r,_dirRight:i,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,children:[],parent:n};if(t.collapsed)return m;const p=t.children.length,k=Math.ceil(p/2);return m.children=t.children.map((y,w)=>{const E=o===0?w<k?1:-1:i;return hi(y,o+1,m,E,r,s,c,u)}),m}function _l(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,s=0;for(const c of i.children)r+=c._subtreeH,s+=c._subtreeW;i.children.length>1&&(r+=Xt*(i.children.length-1),s+=Xt*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,r),i._subtreeW=Math.max(i.width,s)}}function Al(t,o=!1){const n=[t];let i=1/0,r=-1/0,s=1/0,c=-1/0;for(;n.length;){const m=n.pop(),p=m.width/2,k=m.height/2;m.x-p<i&&(i=m.x-p),m.x+p>r&&(r=m.x+p),m.y-k<s&&(s=m.y-k),m.y+k>c&&(c=m.y+k),n.push(...m.children)}if(o)return{root:t,width:r-i+st*2,height:c-s+st*2,vbX:i-st,vbY:s-st,vbW:r-i+st*2,vbH:c-s+st*2};const u=st-s,d=[t];for(;d.length;){const m=d.pop();m.y+=u,d.push(...m.children)}return s+=u,c+=u,{root:t,width:r-i+st*2,height:c+st,vbX:i-st,vbY:0,vbW:r-i+st*2,vbH:c+st}}const Ct=[{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[...Ct,...o].find(i=>i.id===t)??Ct[0]}function Rl(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 s;for(;(s=r.exec(t))!==null;){const c=s[0];let u=null;if(c.startsWith("#")?u=Bl(c):c.startsWith("rgb")?u=zl(c):u=Il[c.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!i.has(d)&&(i.add(d),n.push(d),n.length>=o))break}return n}function Bl(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 zl(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 s=n[r];if(s.endsWith("%")){const c=parseFloat(s);if(!isFinite(c))return null;i.push(Math.round(c/100*255))}else{const c=parseInt(s,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 Il={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function kt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function ct(t){return JSON.parse(JSON.stringify(t))}function fe(t,o){if(t.id===o)return t;for(const n of t.children){const i=fe(n,o);if(i)return i}return null}function ut(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const r=ut(i,o,t);if(r!==null)return r}return null}function Pn(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(Pn(i,o))return!0;return!1}function Ol(t,o,n){const i=fe(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function vl(t,o,n,i){if(!ut(t,o)||o===n||fe(fe(t,o),n))return!1;const r=ut(t,o),s=r.children.findIndex(m=>m.id===o);if(s<0)return!1;const[c]=r.children.splice(s,1);if(i==="child"){const m=fe(t,n);return m?(m.children.push(c),!0):(r.children.splice(s,0,c),!1)}const u=ut(t,n);if(!u)return r.children.splice(s,0,c),!1;let d=u.children.findIndex(m=>m.id===n);return d<0?(r.children.splice(s,0,c),!1):(i==="after"&&(d+=1),u.children.splice(d,0,c),!0)}function bi(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const r of t.children){const s=r.text.match(o);if(s)if(s[1]){const c=parseInt(s[1],10);c>n&&(n=c)}else i=!0}return n===0&&!i?Un:n>0?`新节点 ${n+1}`:"新节点 2"}function ki(t,o,n){const i=fe(t,o);if(!i)return null;const r={id:kt(),text:n??bi(i),children:[]};return i.children.push(r),r}function yi(t,o,n){const i=ut(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const s={id:kt(),text:n??bi(i),children:[]};return i.children.splice(r+1,0,s),s}function Ll(t,o,n){const i=ut(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const s={id:kt(),text:n,children:[]};return i.children.splice(r,0,s),s}function Dl(t,o){const n=ut(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],s=ct(r);return Fn(s),n.children.splice(i+1,0,s),s}function Fn(t){t.id=kt();for(const o of t.children)Fn(o)}function Ei(t,o){const n=fe(t,o);if(!n||n.id===t.id)return null;const i=ct(n);return Fn(i),i}const Un="新节点";function Zt(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:kt(),text:o,children:[]},r=[i],s=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,m=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let k=!1,y=[],w=null;function E(x){y.push(x)}function L(){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})}k=!1,y=[]}for(const x of n){if(k){const b=x.match(p);if(b&&b[1][0]==="`"){L();continue}E(x);continue}const R=x.match(u);if(R){const b=R[1].length,v=R[2].trim();c.push({level:b,text:v,body:""}),w=c[c.length-1];continue}const S=x.match(p);if(S&&S[2]==="note"){k=!0,y=[];continue}const g=x.match(d);if(g&&w){const b=g[2],v=160,H=120;w.image={src:b,naturalW:v,naturalH:H,width:v,height:H};continue}const _=x.match(m);if(_&&w){w.link={url:_[2]},w.text=_[1];continue}if(x.trim().length>0&&w){const b=x.trim();w.body=w.body?w.body+`
3
- `+b:b}}k&&L();function C(x){for(;r.length>1;){const _=r.length-1,b=s[_];if(b!==void 0&&b<x.level)break;r.pop(),s.pop()}const R=r[r.length-1],S=x.text,g={id:kt(),text:S,children:[]};x.image&&(g.image={...x.image}),x.link&&(g.link={url:x.link.url}),x.note&&(g.note={text:x.note.text}),x.body&&(g.note={text:x.body}),R.children.push(g),r.push(g),s.push(x.level)}for(const x of c)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 Jt(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
1
+ (function(be,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(be=typeof globalThis<"u"?globalThis:be||self,e(be.FlowMind={},be.Vue))})(this,function(be,e){"use strict";var Fp=Object.defineProperty;var Up=(be,e,Ln)=>e in be?Fp(be,e,{enumerable:!0,configurable:!0,writable:!0,value:Ln}):be[e]=Ln;var Re=(be,e,Ln)=>Up(be,typeof e!="symbol"?e+"":e,Ln);var Yo;const Ln=["width","height","stroke-width"],Jl={key:4,points:"6 9 12 15 18 9"},Ql={key:5,points:"9 6 15 12 9 18"},ke=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",Jl)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Ql)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="database"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createElementVNode("ellipse",{cx:"12",cy:"6",rx:"7",ry:"2.5"},null,-1)),n[24]||(n[24]=e.createElementVNode("path",{d:"M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[26]||(n[26]=e.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1)),n[27]||(n[27]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[28]||(n[28]=e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M6 15 V9 L9 12 L12 9 V15"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M15 15 V9 L18 12 V9 M15 12 L18 15"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[31]||(n[31]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[32]||(n[32]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[33]||(n[33]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[35]||(n[35]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[36]||(n[36]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[37]||(n[37]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[38]||(n[38]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[39]||(n[39]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[40]||(n[40]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[41]||(n[41]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[42]||(n[42]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[43]||(n[43]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[44]||(n[44]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[45]||(n[45]=e.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[46]||(n[46]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[47]||(n[47]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[48]||(n[48]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[50]||(n[50]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[51]||(n[51]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[52]||(n[52]=e.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[54]||(n[54]=e.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[55]||(n[55]=e.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[56]||(n[56]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[57]||(n[57]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[58]||(n[58]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[60]||(n[60]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[61]||(n[61]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[62]||(n[62]=e.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[65]||(n[65]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[66]||(n[66]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="search"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[67]||(n[67]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="json"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[69]||(n[69]=e.createElementVNode("path",{d:"M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14"},null,-1)),n[70]||(n[70]=e.createElementVNode("path",{d:"M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14"},null,-1))],64)):t.name==="svg-export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:33},[n[71]||(n[71]=e.createElementVNode("path",{d:"M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[72]||(n[72]=e.createElementVNode("polyline",{points:"14 3 14 7 18 7"},null,-1)),n[73]||(n[73]=e.createElementVNode("polyline",{points:"8 14 6 16 8 18"},null,-1)),n[74]||(n[74]=e.createElementVNode("polyline",{points:"14 14 16 16 14 18"},null,-1))],64)):e.createCommentVNode("",!0)],8,Ln))}}),qr="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",Xr="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",Zr=[18,15,13,12],ea=[700,600,500,400],ta=[52,40,32,28],na=[120,80,60,44],oa=[.8,.8,.8,.8],ra=Zr.length-1;function ia(t,o){return Math.round(or(t,o)*oa[Co(t)])}function Co(t){return Math.min(ra,Math.max(0,t))}function or(t,o=14){return Math.round(Zr[Co(t)]*o/14*10)/10}function la(t,o=14){return Math.round(ta[Co(t)]*o/14)}const Ao=60,Dn=14,Tt=24;let rr=null;function aa(){if(rr)return rr;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(rr=t,t):{font:"",measureText:()=>({width:0})}}const Jr=new Map;function sa(t,o,n){const r=`${n}|${o}|${t}`,i=Jr.get(r);if(i!==void 0)return i;const s=aa();s.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=s.measureText(t).width;return Jr.set(r,c),c}const ca=24,da=400,ua=8,Qr=16,ei=4,fa=200;function ma(t,o,n){return Math.min(n,Math.max(o,t))}function pa(t,o,n,r,i){const s=Co(o),c=or(o,n),u=Math.min(sa(t.text||"",c,ea[s]),fa),d=ia(o,n),g=Math.ceil(u+d*2),w=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:la(o,n);let N=0;if(t.link&&(N+=Qr),t.note&&(N+=Qr),N>0){const Y=(t.link?1:0)+(t.note?1:0);N+=ei*Y}const V=14,_=2;let $=0;t.markers&&t.markers.length>0&&($=t.markers.length*V+(t.markers.length-1)*_+ei);const B=18,T=4,E=t.tags&&t.tags.length>0?B:0,k=g+N+$,m=(()=>{const Y=Math.round(na[s]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const ee=i==null?void 0:i[t.id];return Math.max(Y,ee??240)}return Y})(),v=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),x=r==null?void 0:r[t.id],j=v?Math.max(24,x??Math.max(70,Math.ceil(c*5))):0,K=j>0?10:0;if(!t.image){const Y=Math.max(m,k),ee=Math.ceil(w+K+j+(E>0?T+E:0));return{w:Y,h:ee}}const ne=ma(t.image.width,ca,da),ce=Math.max(m,k,Math.ceil(ne+d*2)),re=Math.ceil(t.image.height+ua+w+K+j+(E>0?T+E:0));return{w:ce,h:re}}function ga(t,o={}){const n=o.mode??"mindmap",r=o.preservePositions===!0,i=o.baseFontSize??14,s=ni(t,0,null,1,"right",i,o.richHeights,o.richWidths);return ba(s),ha(s,n,r),s.x=0,s.y=0,ka(s,r)}function ha(t,o,n=!1){if(o==="mindmap"){const r=t.children;if(r.length!==0)if(r.length===1)r[0]._dir="right",r[0].side=1,r[0]._dirRight=1;else{const u=r.reduce((w,N)=>w+N._subtreeH,0);let d=1,g=Math.abs(r[0]._subtreeH-(u-r[0]._subtreeH)),b=0;for(let w=0;w<r.length-1;w++){b+=r[w]._subtreeH;const N=Math.abs(b-(u-b));N<g&&(g=N,d=w+1)}for(let w=0;w<d;w++)r[w]._dir="right",r[w].side=1,r[w]._dirRight=1;for(let w=d;w<r.length;w++)r[w]._dir="left",r[w].side=-1,r[w]._dirRight=-1}const i=t.children.filter(u=>u.side===1),s=t.children.filter(u=>u.side===-1),c=(u,d)=>{const g=d==="right"?1:-1;u._dir=d,u.side=g,u._dirRight=g;for(const b of u.children)c(b,d)};for(const u of i)c(u,"right");for(const u of s)c(u,"left");if(i.length>0){const u={...t,children:i};_o(u,"right",Ao,!0,n)}if(s.length>0){const u={...t,children:s};_o(u,"left",Ao,!0,n)}}else if(o==="tree"){const r=i=>{i.side=1,i._dir="right";for(const s of i.children)r(s)};for(const i of t.children)i._dir="right";_o(t,"right",Ao,!0,n),r(t)}else{for(const r of t.children)r._dir="down";ti(t,Ao,n)}}function _o(t,o,n,r,i=!1){if(t.children.length===0)return;const s=t.children.reduce((g,b,w)=>g+b._subtreeH+(w>0?Dn:0),0),c=o==="right"?1:-1,u=r?c:1;let d=t.y-u*s/2;t.children.forEach(g=>{i||(g.x=t.x+c*(t.width/2+n+g.width/2),g.y=d+u*g._subtreeH/2),g._dir=o,d+=u*(g._subtreeH+Dn),_o(g,o,n,!1,i)})}function ti(t,o,n=!1){if(t.children.length===0)return;const r=t.children.reduce((s,c,u)=>s+c._subtreeW+(u>0?Dn*2:0),0);let i=t.x-r/2;t.children.forEach(s=>{n||(s.x=i+s._subtreeW/2,s.y=t.y+t.height/2+o+s.height/2),s._dir="down",i+=s._subtreeW+Dn*2,ti(s,o,n)})}function ni(t,o,n,r,i,s,c,u){const d=pa(t,o,s,c,u),g={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:or(o,s),isRoot:o===0,collapsed:t.collapsed,side:r,_dir:i,_dirRight:r,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return g;const b=t.children.length,w=Math.ceil(b/2);return g.children=t.children.map((N,V)=>{const _=o===0?V<w?1:-1:r;return ni(N,o+1,g,_,i,s,c,u)}),g}function ba(t){const o=[t];for(let n=0;n<o.length;n++){const r=o[n];for(const i of r.children)o.push(i)}for(let n=o.length-1;n>=0;n--){const r=o[n];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let i=0,s=0;for(const c of r.children)i+=c._subtreeH,s+=c._subtreeW;r.children.length>1&&(i+=Dn*(r.children.length-1),s+=Dn*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,i),r._subtreeW=Math.max(r.width,s)}}function ka(t,o=!1){const n=[t];let r=1/0,i=-1/0,s=1/0,c=-1/0;for(;n.length;){const g=n.pop(),b=g.width/2,w=g.height/2;g.x-b<r&&(r=g.x-b),g.x+b>i&&(i=g.x+b),g.y-w<s&&(s=g.y-w),g.y+w>c&&(c=g.y+w),n.push(...g.children)}if(o)return{root:t,width:i-r+Tt*2,height:c-s+Tt*2,vbX:r-Tt,vbY:s-Tt,vbW:i-r+Tt*2,vbH:c-s+Tt*2};const u=Tt-s,d=[t];for(;d.length;){const g=d.pop();g.y+=u,d.push(...g.children)}return s+=u,c+=u,{root:t,width:i-r+Tt*2,height:c+Tt,vbX:r-Tt,vbY:0,vbW:i-r+Tt*2,vbH:c+Tt}}const Jt=[{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 ya(t,o=[]){return[...Jt,...o].find(r=>r.id===t)??Jt[0]}function Ea(t,o=8){const n=[],r=new Set,i=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let s;for(;(s=i.exec(t))!==null;){const c=s[0];let u=null;if(c.startsWith("#")?u=xa(c):c.startsWith("rgb")?u=wa(c):u=Na[c.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!r.has(d)&&(r.add(d),n.push(d),n.length>=o))break}return n}function xa(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(r=>r+r).join("");else if(o.length===4)n=o.slice(0,3).split("").map(r=>r+r).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function wa(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const r=[];for(let i=0;i<3;i++){const s=n[i];if(s.endsWith("%")){const c=parseFloat(s);if(!isFinite(c))return null;r.push(Math.round(c/100*255))}else{const c=parseInt(s,10);if(!isFinite(c)||c<0||c>255)return null;r.push(c)}}return"#"+r.map(i=>i.toString(16).padStart(2,"0")).join("").toLowerCase()}const Na={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 Ct(t){return JSON.parse(JSON.stringify(t))}function le(t,o){if(t.id===o)return t;for(const n of t.children){const r=le(n,o);if(r)return r}return null}function Bt(t,o,n=null){if(t.id===o)return n;for(const r of t.children){const i=Bt(r,o,t);if(i!==null)return i}return null}function Mo(t,o){const n=t.children.findIndex(r=>r.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const r of t.children)if(Mo(r,o))return!0;return!1}function Sa(t,o,n){const r=le(t,o);return!r||r.text===n?!1:(r.text=n,!0)}function Ta(t,o,n,r){if(!Bt(t,o)||o===n||le(le(t,o),n))return!1;const i=Bt(t,o),s=i.children.findIndex(g=>g.id===o);if(s<0)return!1;const[c]=i.children.splice(s,1);if(r==="child"){const g=le(t,n);return g?(g.children.push(c),!0):(i.children.splice(s,0,c),!1)}const u=Bt(t,n);if(!u)return i.children.splice(s,0,c),!1;let d=u.children.findIndex(g=>g.id===n);return d<0?(i.children.splice(s,0,c),!1):(r==="after"&&(d+=1),u.children.splice(d,0,c),!0)}function oi(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const i of t.children){const s=i.text.match(o);if(s)if(s[1]){const c=parseInt(s[1],10);c>n&&(n=c)}else r=!0}return n===0&&!r?vo:n>0?`新节点 ${n+1}`:"新节点 2"}function ri(t,o,n){const r=le(t,o);if(!r)return null;const i={id:Ft(),text:n??oi(r),children:[]};return r.children.push(i),i}function ii(t,o,n){const r=Bt(t,o);if(!r)return null;const i=r.children.findIndex(c=>c.id===o);if(i<0)return null;const s={id:Ft(),text:n??oi(r),children:[]};return r.children.splice(i+1,0,s),s}function Ca(t,o,n){const r=Bt(t,o);if(!r)return null;const i=r.children.findIndex(c=>c.id===o);if(i<0)return null;const s={id:Ft(),text:n,children:[]};return r.children.splice(i,0,s),s}function Aa(t,o){const n=Bt(t,o);if(!n)return null;const r=n.children.findIndex(c=>c.id===o);if(r<0)return null;const i=n.children[r],s=Ct(i);return Ro(s),n.children.splice(r+1,0,s),s}function Ro(t){t.id=Ft();for(const o of t.children)Ro(o)}function li(t,o){const n=le(t,o);if(!n||n.id===t.id)return null;const r=Ct(n);return Ro(r),r}const vo="新节点";function Vn(t,o="导入的导图"){const n=t.split(/\r?\n/),r={id:Ft(),text:o,children:[]},i=[r],s=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,b=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let w=!1,N=[],V=null;function _(T){N.push(T)}function $(){if(V&&N.length>0){for(;N.length>0&&N[0].trim()==="";)N.shift();for(;N.length>0&&N[N.length-1].trim()==="";)N.pop();const T=N.join(`
2
+ `);T&&(V.note={text:T})}w=!1,N=[]}for(const T of n){if(w){const x=T.match(b);if(x&&x[1][0]==="`"){$();continue}_(T);continue}const E=T.match(u);if(E){const x=E[1].length,j=E[2].trim();c.push({level:x,text:j,body:""}),V=c[c.length-1];continue}const k=T.match(b);if(k&&k[2]==="note"){w=!0,N=[];continue}const m=T.match(d);if(m&&V){const x=m[2],j=160,K=120;V.image={src:x,naturalW:j,naturalH:K,width:j,height:K};continue}const v=T.match(g);if(v&&V){V.link={url:v[2]},V.text=v[1];continue}if(T.trim().length>0&&V){const x=T.trim();V.body=V.body?V.body+`
3
+ `+x:x}}w&&$();function B(T){for(;i.length>1;){const v=i.length-1,x=s[v];if(x!==void 0&&x<T.level)break;i.pop(),s.pop()}const E=i[i.length-1],k=T.text,m={id:Ft(),text:k,children:[]};T.image&&(m.image={...T.image}),T.link&&(m.link={url:T.link.url}),T.note&&(m.note={text:T.note.text}),T.body&&(m.note={text:T.body}),E.children.push(m),i.push(m),s.push(T.level)}for(const T of c)B(T);if(c.length>0&&c[0].level===1){const T=r.children[0];T&&(r.text=T.text,r.id=T.id,T.image&&(r.image={...T.image}),T.link&&(r.link={url:T.link.url}),T.note&&(r.note={text:T.note.text}),r.children=T.children)}return r}function $n(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+=Jt(i,o+1);return n}function Vl(t){var m,p;const o=t.split(/\r?\n/),n=[];let i=0;const r=/^(#{1,6})\s+(.+?)\s*#*\s*$/,s=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,c=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const k=o[i],y=k.match(s);if(y){const S=y[1][0],g=y[2]||"",_=[k];for(i++;i<o.length;){const v=o[i].match(s);if(v&&v[1][0]===S){_.push(o[i]),i++;break}_.push(o[i]),i++}const b=_.slice(1,-1).join(`
8
- `).trim();n.push({kind:"code",text:((m=b.split(`
9
- `)[0])==null?void 0:m.slice(0,80))||"(空代码块)",raw:_.join(`
10
- `),lang:g});continue}const w=k.match(r);if(w){n.push({kind:"heading",level:w[1].length,text:w[2].trim(),raw:k}),i++;continue}if(/^\s*\|/.test(k)){const S=[];let g=i,_=!1;for(;g<o.length&&/^\s*\|/.test(o[g]);)S.push(o[g]),c.test(o[g])&&(_=!0),g++;if(_&&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=g;continue}}const E=k.match(u),L=k.match(d);if(E||L){let S=i;for(;S<o.length;){const g=o[S].match(u),_=o[S].match(d);if(!(g||_))break;const b=o[S].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();b.length>0&&n.push({kind:"list",text:b.slice(0,80)||"(列表项)",raw:o[S]}),S++}i=S;continue}if(k.trim()===""){i++;continue}const C=[k];let x=i+1;for(;x<o.length;){const S=o[x];if(S.trim()===""||r.test(S)||s.test(S)||u.test(S)||d.test(S)||/^\s*\|/.test(S))break;C.push(S),x++}const R=C.join(" ").trim();n.push({kind:"paragraph",text:R.slice(0,80)||"(空段落)",raw:C.join(`
12
- `)}),i=x}return n}function $l(t,o="导入的导图"){const n=Vl(t||""),i={id:kt(),text:o,children:[]},r=[i],s=[0];let c=!1;function u(d){if(d.kind==="heading"){const p=d.level;for(;r.length>1&&s[s.length-1]>=p;)r.pop(),s.pop();if(!c&&p===1){c=!0,i.text=d.text,s[0]=1;return}const k={id:kt(),text:d.text,children:[]};r[r.length-1].children.push(k),r.push(k),s.push(p);return}const m={id:kt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};r[r.length-1].children.push(m)}for(const d of n)u(d);return i}function Pl(t){return t.richContent?t.richContent.raw+`
13
- `:""}function Fl(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,r=e.ref(1),s=e.ref(0),c=e.ref(0),u=e.ref(!1),d=e.reactive({x:0,y:0,ox:0,oy:0}),m=e.ref(!1),p=e.reactive({x:0,y:0}),k=e.reactive({x:0,y:0,width:0,height:0}),y=e.ref(0);let w=null;function E(q){w=q}function L(q){q.preventDefault();const J=t.getContainer();if(!J)return;const ae=-q.deltaY*.001,W=Math.min(n,Math.max(o,r.value*(1+ae))),K=J.getBoundingClientRect(),F=q.clientX-K.left,N=q.clientY-K.top,P=(F-s.value)/r.value,D=(N-c.value)/r.value;r.value=W,s.value=F-P*W,c.value=N-D*W}function C(){r.value=Math.min(n,r.value*i)}function x(){r.value=Math.max(o,r.value/i)}function R(q){var ae;q.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.x=q.clientX,d.y=q.clientY,d.ox=s.value,d.oy=c.value,window.addEventListener("mousemove",S),window.addEventListener("mouseup",g),(ae=q.preventDefault)==null||ae.call(q))}function S(q){u.value&&(s.value=d.ox+(q.clientX-d.x),c.value=d.oy+(q.clientY-d.y))}function g(){u.value=!1,window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",g)}function _(q,J,ae){m.value=!0,p.x=q,p.y=J,k.x=q,k.y=J,k.width=0,k.height=0,k.shiftKey=!!(ae!=null&&ae.shift),y.value++,window.addEventListener("mousemove",H),window.addEventListener("mouseup",v)}function b(q,J){if(!m.value)return;const ae=Math.min(p.x,q),W=Math.min(p.y,J),K=Math.max(p.x,q),F=Math.max(p.y,J);k.x=ae,k.y=W,k.width=K-ae,k.height=F-W,y.value++}function v(){m.value=!1,window.removeEventListener("mousemove",H),window.removeEventListener("mouseup",v),w&&w()}function H(q){if(!m.value)return;const J=t.getContainer();if(!J)return;const ae=J.getBoundingClientRect(),W=(q.clientX-ae.left-s.value)/r.value,K=(q.clientY-ae.top-c.value)/r.value;b(W,K)}function oe(q,J,ae,W=60){const K=t.getContainer();if(!K)return;const F=K.getBoundingClientRect(),N=(F.width-W*2)/q,P=(F.height-W*2)/J,D=Math.min(1,Math.max(.3,Math.min(N,P)));r.value=D,s.value=F.width/2,c.value=F.height/2-ae*D}return{scale:r,offsetX:s,offsetY:c,isPanning:u,onWheel:L,zoomIn:C,zoomOut:x,startPan:R,startMarquee:_,updateMarquee:b,isMarquee:m,marquee:k,marqueeVersion:y,setOnMarqueeEnd:E,resetView:oe}}const Ul=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function xi(t){return Ul?t.metaKey:t.ctrlKey}function Hl(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const r=t.getSelectedIds();return r.length>0?r[0]:null}function n(i){var u,d,m;const r=i.target;if(r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||t.isReadonly()||t.isEditing())return;const s=t.getSelectedId(),c=o();if(c){if(xi(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const p=(u=t.defaultTargetId)==null?void 0:u.call(t);s&&s!==p&&(i.preventDefault(),t.onDuplicate(s));return}if(i.key==="c"||i.key==="C"){const p=t.getSelectedIds();p.length>0&&(i.preventDefault(),t.onCopy(p));return}if(i.key==="x"||i.key==="X"){const p=t.getSelectedIds();p.length>0&&(i.preventDefault(),t.onCut(p));return}if(i.key==="v"||i.key==="V"){i.preventDefault();const p=t.getSelectedIds();t.onPaste(p.length>0?p[0]:null);return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(xi(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(c);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const p=(d=t.defaultTargetId)==null?void 0:d.call(t);s&&s!==p&&t.onAddSiblingBefore(s)}else t.onAddSibling(c);else(i.key==="Delete"||i.key==="Backspace")&&s&&s!==((m=t.defaultTargetId)==null?void 0:m.call(t))?(i.preventDefault(),t.onRemove(s)):i.key==="F2"&&s?(i.preventDefault(),t.onStartEdit(s)):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 Wl(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function r(){return n<o.value.length-1}function s(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 d(){o.value=[],n=-1}return{canUndo:i,canRedo:r,record:s,undo:c,redo:u,reset:d}}const Gl=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 E=n.container.getBoundingClientRect(),L=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+L>E.right&&(y=Math.max(E.left+4,n.x-L-2)),w+x>E.bottom&&(w=Math.max(E.top+4,n.y-x-2)),y<E.left+2&&(y=E.left+2),w<E.top+2&&(w=E.top+2)}return{left:y,top:w}}),s=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote);function d(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",d,!0),window.addEventListener("keydown",m,!0),window.addEventListener("wheel",p,!0),window.addEventListener("scroll",p,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",d,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener("wheel",p,!0),window.removeEventListener("scroll",p,!0)});function k(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(E=>k(()=>i("pickImage")),["stop"]))},[e.createVNode(xe,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"替换图片":"添加图片"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:w[1]||(w[1]=e.withModifiers(E=>k(()=>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(E=>k(()=>i("setLink")),["stop"]))},[e.createVNode(xe,{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(E=>k(()=>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(E=>k(()=>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(E=>k(()=>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(E=>k(()=>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(E=>k(()=>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(E=>k(()=>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(E=>k(()=>i("removeNote")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[17]||(w[17]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0)],36))}}),jl=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 C=n.x+2,x=n.y+2;if(n.container){const R=n.container.getBoundingClientRect(),S=160,g=4+3*28;C+S>R.right&&(C=Math.max(R.left+4,n.x-S-2)),x+g>R.bottom&&(x=Math.max(R.top+4,n.y-g-2)),C<R.left+2&&(C=R.left+2),x<R.top+2&&(x=R.top+2)}return{left:C,top:x}}),s=e.ref(!1),c=e.ref(null),u=e.computed(()=>{if(!c.value)return{left:"-9999px",top:"-9999px",display:"none"};const C=c.value.getBoundingClientRect(),x=window.innerWidth,R=window.innerHeight,S=176,g=4+3*28;let _=C.right;_+S>x-4&&(_=Math.max(4,C.left-S));let b=C.top-4;return b+g>R-4&&(b=Math.max(4,R-g-4)),{left:_+"px",top:b+"px",display:"block"}});let d=null,m=null;function p(){m&&(clearTimeout(m),m=null),d=setTimeout(()=>{s.value=!0},60)}function k(){d&&(clearTimeout(d),d=null),m=setTimeout(()=>{s.value=!1},120)}e.onBeforeUnmount(()=>{d&&clearTimeout(d),m&&clearTimeout(m)});function y(C){const x=C.target;x&&x.closest(".zm-canvas-menu")||i("close")}function w(C){C.key==="Escape"&&i("close")}function E(){i("close")}window.addEventListener("mousedown",y,!0),window.addEventListener("keydown",w,!0),window.addEventListener("wheel",E,!0),window.addEventListener("scroll",E,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",y,!0),window.removeEventListener("keydown",w,!0),window.removeEventListener("wheel",E,!0),window.removeEventListener("scroll",E,!0)});function L(C){C(),i("close")}return(C,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=>L(()=>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:c,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":s.value}]),onMouseenter:p,onMouseleave:k},[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)),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(u.value),onMouseenter:p,onMouseleave:k},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(R=>L(()=>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(R=>L(()=>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(R=>L(()=>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(R=>L(()=>i("openSettings")),["stop"]))},[e.createVNode(xe,{name:"settings",size:13}),x[12]||(x[12]=e.createElementVNode("span",null,"设置",-1))])],36))}});function Kl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function wi(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)&&wi(n)}),t}class Ni{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Si(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Rt(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 ql="</span>",Ti=t=>!!t.scope,Yl=(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 Xl{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Si(o)}openNode(o){if(!Ti(o))return;const n=Yl(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Ti(o)&&(this.buffer+=ql)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ci=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class wo{constructor(){this.rootNode=Ci(),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=Ci({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=>{wo._collapse(n)}))}}class Zl extends wo{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 Xl(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Sn(t){return t?typeof t=="string"?t:t.source:null}function _i(t){return Ft("(?=",t,")")}function Jl(t){return Ft("(?:",t,")*")}function Ql(t){return Ft("(?:",t,")?")}function Ft(...t){return t.map(n=>Sn(n)).join("")}function ea(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function No(...t){return"("+(ea(t).capture?"":"?:")+t.map(i=>Sn(i)).join("|")+")"}function Ai(t){return new RegExp(t.toString()+"|").exec("").length-1}function ta(t,o){const n=t&&t.exec(o);return n&&n.index===0}const na=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function So(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const r=n;let s=Sn(i),c="";for(;s.length>0;){const u=na.exec(s);if(!u){c+=s;break}c+=s.substring(0,u.index),s=s.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 oa=/\b\B/,Mi="[a-zA-Z]\\w*",To="[a-zA-Z_]\\w*",Ri="\\b\\d+(\\.\\d+)?",Bi="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",zi="\\b(0b[01]+)",ia="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ra=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Ft(o,/.*\b/,t.binary,/\b.*/)),Rt({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},Tn={begin:"\\\\[\\s\\S]",relevance:0},la={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Tn]},aa={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Tn]},sa={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/},Hn=function(t,o,n={}){const i=Rt({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=No("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:Ft(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},ca=Hn("//","$"),da=Hn("/\\*","\\*/"),ua=Hn("#","$"),ma={scope:"number",begin:Ri,relevance:0},fa={scope:"number",begin:Bi,relevance:0},pa={scope:"number",begin:zi,relevance:0},ga={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Tn,{begin:/\[/,end:/\]/,relevance:0,contains:[Tn]}]},ha={scope:"title",begin:Mi,relevance:0},ba={scope:"title",begin:To,relevance:0},ka={begin:"\\.\\s*"+To,relevance:0};var Wn=Object.freeze({__proto__:null,APOS_STRING_MODE:la,BACKSLASH_ESCAPE:Tn,BINARY_NUMBER_MODE:pa,BINARY_NUMBER_RE:zi,COMMENT:Hn,C_BLOCK_COMMENT_MODE:da,C_LINE_COMMENT_MODE:ca,C_NUMBER_MODE:fa,C_NUMBER_RE:Bi,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:ua,IDENT_RE:Mi,MATCH_NOTHING_RE:oa,METHOD_GUARD:ka,NUMBER_MODE:ma,NUMBER_RE:Ri,PHRASAL_WORDS_MODE:sa,QUOTE_STRING_MODE:aa,REGEXP_MODE:ga,RE_STARTERS_RE:ia,SHEBANG:ra,TITLE_MODE:ha,UNDERSCORE_IDENT_RE:To,UNDERSCORE_TITLE_MODE:ba});function ya(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Ea(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function xa(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=ya,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function wa(t,o){Array.isArray(t.illegal)&&(t.illegal=No(...t.illegal))}function Na(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 Sa(t,o){t.relevance===void 0&&(t.relevance=1)}const Ta=(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=Ft(n.beforeMatch,_i(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"],_a="keyword";function Ii(t,o,n=_a){const i=Object.create(null);return typeof t=="string"?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(s){Object.assign(i,Ii(t[s],o,s))}),i;function r(s,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const d=u.split("|");i[d[0]]=[s,Aa(d[0],d[1])]})}}function Aa(t,o){return o?Number(o):Ma(t)?0:1}function Ma(t){return Ca.includes(t.toLowerCase())}const Oi={},Ut=t=>{console.error(t)},vi=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Qt=(t,o)=>{Oi[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Oi[`${t}/${o}`]=!0)},Gn=new Error;function Li(t,o,{key:n}){let i=0;const r=t[n],s={},c={};for(let u=1;u<=o.length;u++)c[u+i]=r[u],s[u+i]=!0,i+=Ai(o[u-1]);t[n]=c,t[n]._emit=s,t[n]._multi=!0}function Ra(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Ut("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Gn;if(typeof t.beginScope!="object"||t.beginScope===null)throw Ut("beginScope must be object"),Gn;Li(t,t.begin,{key:"beginScope"}),t.begin=So(t.begin,{joinWith:""})}}function Ba(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Ut("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Gn;if(typeof t.endScope!="object"||t.endScope===null)throw Ut("endScope must be object"),Gn;Li(t,t.end,{key:"endScope"}),t.end=So(t.end,{joinWith:""})}}function za(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Ia(t){za(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Ra(t),Ba(t)}function Oa(t){function o(c,u){return new RegExp(Sn(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,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=Ai(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(So(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const m=d.findIndex((k,y)=>y>0&&k!==void 0),p=this.matchIndexes[m];return d.splice(0,m),Object.assign(d,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 d=new n;return this.rules.slice(u).forEach(([m,p])=>d.addRule(m,p)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let m=d.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(d=>u.addRule(d.begin,{rule:d,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function s(c,u){const d=c;if(c.isCompiled)return d;[Ea,Na,Ia,Ta].forEach(p=>p(c,u)),t.compilerExtensions.forEach(p=>p(c,u)),c.__beforeBegin=null,[xa,wa,Sa].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=Ii(c.keywords,t.case_insensitive)),d.keywordPatternRe=o(m,!0),u&&(c.begin||(c.begin=/\B|\b/),d.beginRe=o(d.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(d.endRe=o(d.end)),d.terminatorEnd=Sn(d.end)||"",c.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(d.illegalRe=o(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(p){return va(p==="self"?c:p)})),c.contains.forEach(function(p){s(p,d)}),c.starts&&s(c.starts,u),d.matcher=r(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Rt(t.classNameAliases||{}),s(t)}function Di(t){return t?t.endsWithParent||Di(t.starts):!1}function va(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return Rt(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Di(t)?Rt(t,{starts:t.starts?Rt(t.starts):null}):Object.isFrozen(t)?Rt(t):t}var La="11.11.1";class Da extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Co=Si,Vi=Rt,$i=Symbol("nomatch"),Va=7,Pi=function(t){const o=Object.create(null),n=Object.create(null),i=[];let r=!0;const s="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:Zl};function d(N){return u.noHighlightRe.test(N)}function m(N){let P=N.className+" ";P+=N.parentNode?N.parentNode.className:"";const D=u.languageDetectRe.exec(P);if(D){const Y=H(D[1]);return Y||(vi(s.replace("{}",D[1])),vi("Falling back to no-highlight mode for this block.",N)),Y?D[1]:"no-highlight"}return P.split(/\s+/).find(Y=>d(Y)||H(Y))}function p(N,P,D){let Y="",se="";typeof P=="object"?(Y=N,D=P.ignoreIllegals,se=P.language):(Qt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Qt("10.7.0",`Please use highlight(code, options) instead.
14
- https://github.com/highlightjs/highlight.js/issues/2277`),se=N,Y=P),D===void 0&&(D=!0);const ke={code:Y,language:se};K("before:highlight",ke);const Re=ke.result?ke.result:k(ke.language,ke.code,D);return Re.code=ke.code,K("after:highlight",Re),Re}function k(N,P,D,Y){const se=Object.create(null);function ke(U,Z){return U.keywords[Z]}function Re(){if(!Q.keywords){Me.addText(we);return}let U=0;Q.keywordPatternRe.lastIndex=0;let Z=Q.keywordPatternRe.exec(we),le="";for(;Z;){le+=we.substring(U,Z.index);const pe=We.case_insensitive?Z[0].toLowerCase():Z[0],ze=ke(Q,pe);if(ze){const[Ue,Je]=ze;if(Me.addText(le),le="",se[pe]=(se[pe]||0)+1,se[pe]<=Va&&(pt+=Je),Ue.startsWith("_"))le+=Z[0];else{const Ot=We.classNameAliases[Ue]||Ue;B(Z[0],Ot)}}else le+=Z[0];U=Q.keywordPatternRe.lastIndex,Z=Q.keywordPatternRe.exec(we)}le+=we.substring(U),Me.addText(le)}function Pe(){if(we==="")return;let U=null;if(typeof Q.subLanguage=="string"){if(!o[Q.subLanguage]){Me.addText(we);return}U=k(Q.subLanguage,we,!0,wt[Q.subLanguage]),wt[Q.subLanguage]=U._top}else U=w(we,Q.subLanguage.length?Q.subLanguage:null);Q.relevance>0&&(pt+=U.relevance),Me.__addSublanguage(U._emitter,U.language)}function Te(){Q.subLanguage!=null?Pe():Re(),we=""}function B(U,Z){U!==""&&(Me.startScope(Z),Me.addText(U),Me.endScope())}function z(U,Z){let le=1;const pe=Z.length-1;for(;le<=pe;){if(!U._emit[le]){le++;continue}const ze=We.classNameAliases[U[le]]||U[le],Ue=Z[le];ze?B(Ue,ze):(we=Ue,Re(),we=""),le++}}function ie(U,Z){return U.scope&&typeof U.scope=="string"&&Me.openNode(We.classNameAliases[U.scope]||U.scope),U.beginScope&&(U.beginScope._wrap?(B(we,We.classNameAliases[U.beginScope._wrap]||U.beginScope._wrap),we=""):U.beginScope._multi&&(z(U.beginScope,Z),we="")),Q=Object.create(U,{parent:{value:Q}}),Q}function re(U,Z,le){let pe=ta(U.endRe,le);if(pe){if(U["on:end"]){const ze=new Ni(U);U["on:end"](Z,ze),ze.isMatchIgnored&&(pe=!1)}if(pe){for(;U.endsParent&&U.parent;)U=U.parent;return U}}if(U.endsWithParent)return re(U.parent,Z,le)}function V(U){return Q.matcher.regexIndex===0?(we+=U[0],1):(Nt=!0,0)}function T(U){const Z=U[0],le=U.rule,pe=new Ni(le),ze=[le.__beforeBegin,le["on:begin"]];for(const Ue of ze)if(Ue&&(Ue(U,pe),pe.isMatchIgnored))return V(Z);return le.skip?we+=Z:(le.excludeBegin&&(we+=Z),Te(),!le.returnBegin&&!le.excludeBegin&&(we=Z)),ie(le,U),le.returnBegin?0:Z.length}function ce(U){const Z=U[0],le=P.substring(U.index),pe=re(Q,U,le);if(!pe)return $i;const ze=Q;Q.endScope&&Q.endScope._wrap?(Te(),B(Z,Q.endScope._wrap)):Q.endScope&&Q.endScope._multi?(Te(),z(Q.endScope,U)):ze.skip?we+=Z:(ze.returnEnd||ze.excludeEnd||(we+=Z),Te(),ze.excludeEnd&&(we=Z));do Q.scope&&Me.closeNode(),!Q.skip&&!Q.subLanguage&&(pt+=Q.relevance),Q=Q.parent;while(Q!==pe.parent);return pe.starts&&ie(pe.starts,U),ze.returnEnd?0:Z.length}function de(){const U=[];for(let Z=Q;Z!==We;Z=Z.parent)Z.scope&&U.unshift(Z.scope);U.forEach(Z=>Me.openNode(Z))}let De={};function Ke(U,Z){const le=Z&&Z[0];if(we+=U,le==null)return Te(),0;if(De.type==="begin"&&Z.type==="end"&&De.index===Z.index&&le===""){if(we+=P.slice(Z.index,Z.index+1),!r){const pe=new Error(`0 width match regex (${N})`);throw pe.languageName=N,pe.badRule=De.rule,pe}return 1}if(De=Z,Z.type==="begin")return T(Z);if(Z.type==="illegal"&&!D){const pe=new Error('Illegal lexeme "'+le+'" for mode "'+(Q.scope||"<unnamed>")+'"');throw pe.mode=Q,pe}else if(Z.type==="end"){const pe=ce(Z);if(pe!==$i)return pe}if(Z.type==="illegal"&&le==="")return we+=`
15
- `,1;if(gt>1e5&&gt>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return we+=le,le.length}const We=H(N);if(!We)throw Ut(s.replace("{}",N)),new Error('Unknown language: "'+N+'"');const mn=Oa(We);let It="",Q=Y||mn;const wt={},Me=new u.__emitter(u);de();let we="",pt=0,qe=0,gt=0,Nt=!1;try{if(We.__emitTokens)We.__emitTokens(P,Me);else{for(Q.matcher.considerAll();;){gt++,Nt?Nt=!1:Q.matcher.considerAll(),Q.matcher.lastIndex=qe;const U=Q.matcher.exec(P);if(!U)break;const Z=P.substring(qe,U.index),le=Ke(Z,U);qe=U.index+le}Ke(P.substring(qe))}return Me.finalize(),It=Me.toHTML(),{language:N,value:It,relevance:pt,illegal:!1,_emitter:Me,_top:Q}}catch(U){if(U.message&&U.message.includes("Illegal"))return{language:N,value:Co(P),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:qe,context:P.slice(qe-100,qe+100),mode:U.mode,resultSoFar:It},_emitter:Me};if(r)return{language:N,value:Co(P),illegal:!1,relevance:0,errorRaised:U,_emitter:Me,_top:Q};throw U}}function y(N){const P={value:Co(N),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return P._emitter.addText(N),P}function w(N,P){P=P||u.languages||Object.keys(o);const D=y(N),Y=P.filter(H).filter(q).map(Te=>k(Te,N,!1));Y.unshift(D);const se=Y.sort((Te,B)=>{if(Te.relevance!==B.relevance)return B.relevance-Te.relevance;if(Te.language&&B.language){if(H(Te.language).supersetOf===B.language)return 1;if(H(B.language).supersetOf===Te.language)return-1}return 0}),[ke,Re]=se,Pe=ke;return Pe.secondBest=Re,Pe}function E(N,P,D){const Y=P&&n[P]||D;N.classList.add("hljs"),N.classList.add(`language-${Y}`)}function L(N){let P=null;const D=m(N);if(d(D))return;if(K("before:highlightElement",{el:N,language:D}),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 Da("One of your code blocks includes unescaped HTML.",N.innerHTML);P=N;const Y=P.textContent,se=D?p(Y,{language:D,ignoreIllegals:!0}):w(Y);N.innerHTML=se.value,N.dataset.highlighted="yes",E(N,D,se.language),N.result={language:se.language,re:se.relevance,relevance:se.relevance},se.secondBest&&(N.secondBest={language:se.secondBest.language,relevance:se.secondBest.relevance}),K("after:highlightElement",{el:N,result:se,text:Y})}function C(N){u=Vi(u,N)}const x=()=>{g(),Qt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function R(){g(),Qt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function g(){function N(){g()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",N,!1),S=!0;return}document.querySelectorAll(u.cssSelector).forEach(L)}function _(N,P){let D=null;try{D=P(t)}catch(Y){if(Ut("Language definition for '{}' could not be registered.".replace("{}",N)),r)Ut(Y);else throw Y;D=c}D.name||(D.name=N),o[N]=D,D.rawDefinition=P.bind(null,t),D.aliases&&oe(D.aliases,{languageName:N})}function b(N){delete o[N];for(const P of Object.keys(n))n[P]===N&&delete n[P]}function v(){return Object.keys(o)}function H(N){return N=(N||"").toLowerCase(),o[N]||o[n[N]]}function oe(N,{languageName:P}){typeof N=="string"&&(N=[N]),N.forEach(D=>{n[D.toLowerCase()]=P})}function q(N){const P=H(N);return P&&!P.disableAutodetect}function J(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=P=>{N["before:highlightBlock"](Object.assign({block:P.el},P))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=P=>{N["after:highlightBlock"](Object.assign({block:P.el},P))})}function ae(N){J(N),i.push(N)}function W(N){const P=i.indexOf(N);P!==-1&&i.splice(P,1)}function K(N,P){const D=N;i.forEach(function(Y){Y[D]&&Y[D](P)})}function F(N){return Qt("10.7.0","highlightBlock will be removed entirely in v12.0"),Qt("10.7.0","Please use highlightElement now."),L(N)}Object.assign(t,{highlight:p,highlightAuto:w,highlightAll:g,highlightElement:L,highlightBlock:F,configure:C,initHighlighting:x,initHighlightingOnLoad:R,registerLanguage:_,unregisterLanguage:b,listLanguages:v,getLanguage:H,registerAliases:oe,autoDetection:q,inherit:Vi,addPlugin:ae,removePlugin:W}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=La,t.regex={concat:Ft,lookahead:_i,either:No,optional:Ql,anyNumberOfTimes:Jl};for(const N in Wn)typeof Wn[N]=="object"&&wi(Wn[N]);return Object.assign(t,Wn),t},en=Pi({});en.newInstance=()=>Pi({});var $a=en;en.HighlightJS=en,en.default=en;const _o=Kl($a);function Ao(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]},s=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 d={match:/\\"/},m={className:"string",begin:/'/,end:/'/},p={match:/\\'/},k={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}),E={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},L=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["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"],g=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],_=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:L,literal:C,built_in:[...R,...S,"set","shopt",...g,..._]},contains:[w,t.SHEBANG(),E,k,s,c,x,u,d,m,p,n]}}const Pa=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_-]*/}}),Fa=["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"],Ua=["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"],Ha=[...Fa,...Ua],Wa=["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(),Ga=["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(),ja=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ka=["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 qa(t){const o=t.regex,n=Pa(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",s=/@-?\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:":("+Ga.join("|")+")"},{begin:":(:)?("+ja.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ka.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:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:Wa.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ha.join("|")+")\\b"}]}}function Fi(t){const s={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:s,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:s,illegal:/["']/}]}]}}var tn="[0-9](_*[0-9])*",jn=`\\.(${tn})`,Kn="[0-9a-fA-F](_*[0-9a-fA-F])*",Ui={className:"number",variants:[{begin:`(\\b(${tn})((${jn})|\\.)?|(${jn}))[eE][+-]?(${tn})[fFdD]?\\b`},{begin:`\\b(${tn})((${jn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${jn})[fFdD]?\\b`},{begin:`\\b(${tn})[fFdD]\\b`},{begin:`\\b0[xX]((${Kn})\\.?|(${Kn})?\\.(${Kn}))[pP][+-]?(${tn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Kn})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Hi(t,o,n){return n===-1?"":t.replace(o,i=>Hi(t,o,n-1))}function Ya(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Hi("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},m={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[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:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Ui,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Ui,m]}}const Wi="[A-Za-z$_][0-9A-Za-z$_]*",Xa=["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"],Za=["true","false","null","undefined","NaN","Infinity"],Gi=["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"],ji=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ki=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ja=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Qa=[].concat(Ki,Gi,ji);function qi(t){const o=t.regex,n=(D,{after:Y})=>{const se="</"+D[0].slice(1);return D.input.indexOf(se,Y)!==-1},i=Wi,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,Y)=>{const se=D[0].length+D.index,ke=D.input[se];if(ke==="<"||ke===","){Y.ignoreMatch();return}ke===">"&&(n(D,{after:se})||Y.ignoreMatch());let Re;const Pe=D.input.substring(se);if(Re=Pe.match(/^\s*=/)){Y.ignoreMatch();return}if((Re=Pe.match(/^\s+extends\s+/))&&Re.index===0){Y.ignoreMatch();return}}},u={$pattern:Wi,keyword:Xa,literal:Za,built_in:Qa,"variable.language":Ja},d="[0-9](_?[0-9])*",m=`\\.(${d})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",k={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\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"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={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,E,L,C,{match:/\$\d+/},k];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const g=[].concat(R,y.contains),_=g.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(g)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:_},v={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"}}]},H={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:{_:[...Gi,...ji]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ae(D){return o.concat("(?!",D.join("|"),")")}const W={match:o.concat(/\b/,ae([...Ki,"super","import"].map(D=>`${D}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={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:/\(\)/},b]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:H},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,E,L,C,R,{match:/\$\d+/},k,H,{scope:"attr",match:i+o.lookahead(":"),relevance:0},P,{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:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},W,J,v,F,{match:/\$[(.]/}]}}function es(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 Yi(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}]},s={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+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},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}]},k=t.inherit(m,{contains:[]}),y=t.inherit(p,{contains:[]});m.contains.push(y),p.contains.push(k);let w=[n,d];return[m,p,k,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,s,m,p,{className:"quote",begin:"^>\\s+",contains:w,end:"$"},r,i,d,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Xi(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},p={begin:/\{\{/,relevance:0},k={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,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})\\.`,E=`\\b|${i.join("|")}`,L={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${w}))[eE][+-]?(${y})[jJ]?(?=${E})`},{begin:`(${w})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${E})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${E})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${E})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${E})`},{begin:`\\b(${y})[jJ](?=${E})`}]},C={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",d,L,k,t.HASH_COMMENT_MODE]}]};return m.contains=[k,L,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,L,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},k,C,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:[L,x,k]}]}}function Zi(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),r=o.concat(n,t.IDENT_RE),s={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"],d=["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:d,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:"->"},s]}}function ts(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["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"],d=["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"],k=["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,E=[...m,...d].filter(_=>!p.includes(_)),L={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:o.concat(/\b/,o.either(...w),/\s*\(/),relevance:0,keywords:{built_in:w}};function R(_){return o.concat(/\b/,o.either(..._.map(b=>b.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:R(y),relevance:0};function g(_,{exceptions:b,when:v}={}){const H=v;return b=b||[],_.map(oe=>oe.match(/\|\d+$/)||b.includes(oe)?oe:H(oe)?`${oe}|0`:oe)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:g(E,{when:_=>_.length<3}),literal:s,type:u,built_in:k},contains:[{scope:"type",match:R(c)},S,x,L,i,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,C]}}const qn="[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"],Qi=["true","false","null","undefined","NaN","Infinity"],er=["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"],tr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],nr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],or=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ir=[].concat(nr,er,tr);function ns(t){const o=t.regex,n=(D,{after:Y})=>{const se="</"+D[0].slice(1);return D.input.indexOf(se,Y)!==-1},i=qn,r={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,Y)=>{const se=D[0].length+D.index,ke=D.input[se];if(ke==="<"||ke===","){Y.ignoreMatch();return}ke===">"&&(n(D,{after:se})||Y.ignoreMatch());let Re;const Pe=D.input.substring(se);if(Re=Pe.match(/^\s*=/)){Y.ignoreMatch();return}if((Re=Pe.match(/^\s+extends\s+/))&&Re.index===0){Y.ignoreMatch();return}}},u={$pattern:qn,keyword:Ji,literal:Qi,built_in:ir,"variable.language":or},d="[0-9](_?[0-9])*",m=`\\.(${d})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",k={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\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"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},C={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,E,L,C,{match:/\$\d+/},k];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const g=[].concat(R,y.contains),_=g.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(g)}]),b={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:_},v={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"}}]},H={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:{_:[...er,...tr]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[b],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ae(D){return o.concat("(?!",D.join("|"),")")}const W={match:o.concat(/\b/,ae([...nr,"super","import"].map(D=>`${D}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={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:/\(\)/},b]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",P={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[b]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:H},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,E,L,C,R,{match:/\$\d+/},k,H,{scope:"attr",match:i+o.lookahead(":"),relevance:0},P,{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:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[b,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[b]},W,J,v,F,{match:/\$[(.]/}]}}function rr(t){const o=t.regex,n=ns(t),i=qn,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={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['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:qn,keyword:Ji.concat(d),literal:Qi,built_in:ir.concat(r),"variable.language":or},p={className:"meta",begin:"@"+i},k=(L,C,x)=>{const R=L.contains.findIndex(S=>S.label===C);if(R===-1)throw new Error("can not find mode to replace");L.contains.splice(R,1,x)};Object.assign(n.keywords,m),n.exports.PARAMS_CONTAINS.push(p);const y=n.contains.find(L=>L.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,s,c,w]),k(n,"shebang",t.SHEBANG()),k(n,"use_strict",u);const E=n.contains.find(L=>L.label==="func.def");return E.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function lr(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]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(s,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=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:[s,d,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,c,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[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 ar(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:/\}/}]},s={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},E={begin:/\{/,end:/\}/,contains:[w],illegal:"\\n",relevance:0},L={begin:"\\[",end:"\\]",contains:[w],illegal:"\\n",relevance:0},C=[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},E,L,s,c],x=[...C];return x.pop(),x.push(u),w.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}const Mo={bash:Ao,sh:Ao,shell:Ao,css:qa,go:Fi,golang:Fi,java:Ya,javascript:qi,js:qi,json:es,markdown:Yi,md:Yi,python:Xi,py:Xi,rust:Zi,rs:Zi,sql:ts,typescript:rr,ts:rr,xml:lr,html:lr,yaml:ar,yml:ar};for(const[t,o]of Object.entries(Mo))_o.registerLanguage(t,o);function Ro(t){const o=t.split(`
7
+ `);for(const r of t.children)n+=$n(r,o+1);return n}function _a(t){var g,b;const o=t.split(/\r?\n/),n=[];let r=0;const i=/^(#{1,6})\s+(.+?)\s*#*\s*$/,s=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,c=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;r<o.length;){const w=o[r],N=w.match(s);if(N){const k=N[1][0],m=N[2]||"",v=[w];for(r++;r<o.length;){const j=o[r].match(s);if(j&&j[1][0]===k){v.push(o[r]),r++;break}v.push(o[r]),r++}const x=v.slice(1,-1).join(`
8
+ `).trim();n.push({kind:"code",text:((g=x.split(`
9
+ `)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:v.join(`
10
+ `),lang:m});continue}const V=w.match(i);if(V){n.push({kind:"heading",level:V[1].length,text:V[2].trim(),raw:w}),r++;continue}if(/^\s*\|/.test(w)){const k=[];let m=r,v=!1;for(;m<o.length&&/^\s*\|/.test(o[m]);)k.push(o[m]),c.test(o[m])&&(v=!0),m++;if(v&&k.length>=2){n.push({kind:"table",text:((b=k[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:b.trim())||"表格",raw:k.join(`
11
+ `)}),r=m;continue}}const _=w.match(u),$=w.match(d);if(_||$){let k=r;for(;k<o.length;){const m=o[k].match(u),v=o[k].match(d);if(!(m||v))break;const x=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();x.length>0&&n.push({kind:"list",text:x.slice(0,80)||"(列表项)",raw:o[k]}),k++}r=k;continue}if(w.trim()===""){r++;continue}const B=[w];let T=r+1;for(;T<o.length;){const k=o[T];if(k.trim()===""||i.test(k)||s.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;B.push(k),T++}const E=B.join(" ").trim();n.push({kind:"paragraph",text:E.slice(0,80)||"(空段落)",raw:B.join(`
12
+ `)}),r=T}return n}function Ma(t,o="导入的导图"){const n=_a(t||""),r={id:Ft(),text:o,children:[]},i=[r],s=[0];let c=!1;function u(d){if(d.kind==="heading"){const b=d.level;for(;i.length>1&&s[s.length-1]>=b;)i.pop(),s.pop();if(!c&&b===1){c=!0,r.text=d.text,s[0]=1;return}const w={id:Ft(),text:d.text,children:[]};i[i.length-1].children.push(w),i.push(w),s.push(b);return}const g={id:Ft(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};i[i.length-1].children.push(g)}for(const d of n)u(d);return r}function Ra(t){return t.richContent?t.richContent.raw+`
13
+ `:""}function va(t){const o=t.minScale??.2,n=t.maxScale??1/0,r=t.step??1.2,i=e.ref(1),s=e.ref(0),c=e.ref(0),u=e.ref(!1),d=e.ref(!1),g=e.reactive({x:0,y:0,ox:0,oy:0}),b=e.ref(!1),w=e.reactive({x:0,y:0}),N=e.reactive({x:0,y:0,width:0,height:0}),V=e.ref(0);let _=null;function $(Y){_=Y}function B(Y){Y.preventDefault();const ee=t.getContainer();if(!ee)return;const ie=-Y.deltaY*.001,z=Math.min(n,Math.max(o,i.value*(1+ie))),C=ee.getBoundingClientRect(),F=Y.clientX-C.left,P=Y.clientY-C.top,W=(F-s.value)/i.value,ae=(P-c.value)/i.value;i.value=z,s.value=F-W*z,c.value=P-ae*z}function T(){i.value=Math.min(n,i.value*r)}function E(){i.value=Math.max(o,i.value/r)}function k(Y){var ie;Y.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,g.x=Y.clientX,g.y=Y.clientY,g.ox=s.value,g.oy=c.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",v),(ie=Y.preventDefault)==null||ie.call(Y))}function m(Y){if(!u.value)return;const ee=Y.clientX-g.x,ie=Y.clientY-g.y;(Math.abs(ee)>3||Math.abs(ie)>3)&&(d.value=!0),s.value=g.ox+ee,c.value=g.oy+ie}function v(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",v)}function x(Y,ee,ie){b.value=!0,w.x=Y,w.y=ee,N.x=Y,N.y=ee,N.width=0,N.height=0,N.shiftKey=!!(ie!=null&&ie.shift),V.value++,window.addEventListener("mousemove",ne),window.addEventListener("mouseup",K)}function j(Y,ee){if(!b.value)return;const ie=Math.min(w.x,Y),z=Math.min(w.y,ee),C=Math.max(w.x,Y),F=Math.max(w.y,ee);N.x=ie,N.y=z,N.width=C-ie,N.height=F-z,V.value++}function K(){b.value=!1,window.removeEventListener("mousemove",ne),window.removeEventListener("mouseup",K),_&&_()}function ne(Y){if(!b.value)return;const ee=t.getContainer();if(!ee)return;const ie=ee.getBoundingClientRect(),z=(Y.clientX-ie.left-s.value)/i.value,C=(Y.clientY-ie.top-c.value)/i.value;j(z,C)}function ce(Y,ee,ie,z=60){const C=t.getContainer();if(!C)return;const F=C.getBoundingClientRect(),P=(F.width-z*2)/Y,W=(F.height-z*2)/ee,ae=Math.min(1,Math.max(.3,Math.min(P,W)));i.value=ae,s.value=F.width/2,c.value=F.height/2-ie*ae}function re(Y,ee,ie,z,C=80){const F=t.getContainer();if(!F)return;const P=F.getBoundingClientRect();let W=i.value;(ie*W<40||z*W<40)&&(W=Math.min(n,Math.max(1,60/Math.min(ie,z)))),i.value=W,s.value=P.width/2-Y*W,c.value=P.height/2-ee*W}return{scale:i,offsetX:s,offsetY:c,isPanning:u,panMoved:d,onWheel:B,zoomIn:T,zoomOut:E,startPan:k,startMarquee:x,updateMarquee:j,isMarquee:b,marquee:N,marqueeVersion:V,setOnMarqueeEnd:$,resetView:ce,centerOn:re}}const Ba=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function ai(t){return Ba?t.metaKey:t.ctrlKey}function za(t){function o(){const r=t.getSelectedId();if(r)return r;if(t.defaultTargetId)return t.defaultTargetId();const i=t.getSelectedIds();return i.length>0?i[0]:null}function n(r){var u,d,g;const i=r.target;if(i&&(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable)||t.isReadonly()||t.isEditing())return;const s=t.getSelectedId(),c=o();if(c){if(ai(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){const b=(u=t.defaultTargetId)==null?void 0:u.call(t);s&&s!==b&&(r.preventDefault(),t.onDuplicate(s));return}if(r.key==="c"||r.key==="C"){const b=t.getSelectedIds();b.length>0&&(r.preventDefault(),t.onCopy(b));return}if(r.key==="x"||r.key==="X"){const b=t.getSelectedIds();b.length>0&&(r.preventDefault(),t.onCut(b));return}if(r.key==="v"||r.key==="V"){if(!t.hasClipboard())return;r.preventDefault();const b=t.getSelectedIds();t.onPaste(b.length>0?b[0]:null);return}if(r.key==="z"||r.key==="Z"){r.preventDefault(),t.onUndo();return}if(r.key==="y"||r.key==="Y"){r.preventDefault(),t.onRedo();return}if(r.key==="Home"){r.preventDefault(),t.onSelectRoot();return}}if(ai(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),t.onRedo();return}if(r.key==="Tab")r.preventDefault(),t.onAddChild(c);else if(r.key==="Enter")if(r.preventDefault(),r.shiftKey){const b=(d=t.defaultTargetId)==null?void 0:d.call(t);s&&s!==b&&t.onAddSiblingBefore(s)}else t.onAddSibling(c);else(r.key==="Delete"||r.key==="Backspace")&&s&&s!==((g=t.defaultTargetId)==null?void 0:g.call(t))?(r.preventDefault(),t.onRemove(s)):r.key==="F2"&&s?(r.preventDefault(),t.onStartEdit(s)):r.key==="Escape"?(r.preventDefault(),t.onClearSelection()):r.key==="ArrowDown"?(r.preventDefault(),t.onNavigate(0,1)):r.key==="ArrowUp"?(r.preventDefault(),t.onNavigate(0,-1)):r.key==="ArrowRight"?(r.preventDefault(),t.onNavigate(1,0)):r.key==="ArrowLeft"&&(r.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function Ia(t=100){const o=e.ref([]);let n=-1;function r(){return n>0}function i(){return n<o.value.length-1}function s(g){const b=JSON.stringify(g);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(b),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function c(){return r()?(n--,JSON.parse(o.value[n])):null}function u(){return i()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:r,canRedo:i,record:s,undo:c,redo:u,reset:d}}const Oa={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},La={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,r=Oa[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${r}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function Da(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),r=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${r.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const Va={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:Da(t)}))},$a={label:"旗帜",markers:[{id:"flag-red",label:"红旗",color:"#ef4444"},{id:"flag-orange",label:"橙旗",color:"#f97316"},{id:"flag-yellow",label:"黄旗",color:"#eab308"},{id:"flag-green",label:"绿旗",color:"#22c55e"},{id:"flag-blue",label:"蓝旗",color:"#3b82f6"},{id:"flag-gray",label:"灰旗",color:"#94a3b8"}].map(t=>({id:t.id,label:t.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${t.color}" stroke="${t.color}" stroke-width="1" stroke-linejoin="round"/>`}))},ir=[La,Va,$a,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],Bo={};for(const t of ir)for(const o of t.markers)Bo[o.id]=o;function Pa(t){return Bo[t]}function zo(t){var o;return((o=Bo[t])==null?void 0:o.svg)??""}function si(t){var o;return((o=Bo[t])==null?void 0:o.label)??t}function lr(t){let o=0;for(let r=0;r<t.length;r++)o=(o<<5)-o+t.charCodeAt(r),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const Fa={key:5,class:"zm-marker-picker"},Ua={class:"zm-marker-group-label"},Ha={class:"zm-marker-grid"},Wa=["title","onClick","innerHTML"],Ga=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,r=o,i=e.computed(()=>{let E=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),v=180,j=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;E+v>m.right&&(E=Math.max(m.left+4,n.x-v-2)),k+j>m.bottom&&(k=Math.max(m.top+4,n.y-j-2)),E<m.left+2&&(E=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:E,top:k}}),s=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),g=e.computed(()=>n.nodeTags.length>0),b=e.ref(!1);function w(){b.value=!b.value}function N(E){return n.nodeMarkers.includes(E)}function V(E){r("toggleMarker",E)}function _(E){const k=E.target;k&&k.closest(".zm-node-menu")||r("close")}function $(E){E.key==="Escape"&&r("close")}function B(){r("close")}window.addEventListener("mousedown",_,!0),window.addEventListener("keydown",$,!0),window.addEventListener("wheel",B,!0),window.addEventListener("scroll",B,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",_,!0),window.removeEventListener("keydown",$,!0),window.removeEventListener("wheel",B,!0),window.removeEventListener("scroll",B,!0)});function T(E){E(),r("close")}return(E,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:i.value.left+"px",top:i.value.top+"px"}),onContextmenu:k[13]||(k[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[0]||(k[0]=e.withModifiers(m=>T(()=>r("pickImage")),["stop"]))},[e.createVNode(ke,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"替换图片":"添加图片"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:k[1]||(k[1]=e.withModifiers(m=>T(()=>r("removeImage")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[14]||(k[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[2]||(k[2]=e.withModifiers(m=>T(()=>r("setLink")),["stop"]))},[e.createVNode(ke,{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:k[3]||(k[3]=e.withModifiers(m=>T(()=>r("removeLink")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[15]||(k[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[4]||(k[4]=e.withModifiers(m=>T(()=>r("addCode")),["stop"]))},[k[16]||(k[16]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:k[5]||(k[5]=e.withModifiers(m=>T(()=>r("removeCode")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[17]||(k[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[6]||(k[6]=e.withModifiers(m=>T(()=>r("addTable")),["stop"]))},[k[18]||(k[18]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:k[7]||(k[7]=e.withModifiers(m=>T(()=>r("removeTable")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[19]||(k[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[8]||(k[8]=e.withModifiers(m=>T(()=>r("editNote")),["stop"]))},[e.createVNode(ke,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:k[9]||(k[9]=e.withModifiers(m=>T(()=>r("removeNote")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[20]||(k[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),k[25]||(k[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(w,["stop"])},[k[21]||(k[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),k[22]||(k[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":b.value}])},"›",2)]),b.value?(e.openBlock(),e.createElementBlock("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ir),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",Ua,e.toDisplayString(m.label),1),e.createElementVNode("div",Ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,v=>(e.openBlock(),e.createElementBlock("button",{key:v.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":N(v.id)}]),title:v.label,onClick:e.withModifiers(x=>V(v.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(zo)(v.id)+"</svg>"},null,10,Wa))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>r("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>T(()=>r("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(g.value?"编辑标签":"添加标签"),1)]),g.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>T(()=>r("removeTags")),["stop"]))},[e.createVNode(ke,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ja=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,r=o,i=e.computed(()=>{let T=n.x+2,E=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,v=4+4*28+5;T+m>k.right&&(T=Math.max(k.left+4,n.x-m-2)),E+v>k.bottom&&(E=Math.max(k.top+4,n.y-v-2)),T<k.left+2&&(T=k.left+2),E<k.top+2&&(E=k.top+2)}return{left:T,top:E}}),s=e.ref(null),c=e.ref(null),u=e.ref(null),d=e.computed(()=>{const T=s.value==="import"?c.value:s.value==="export"?u.value:null;if(!T)return{left:"-9999px",top:"-9999px",display:"none"};const E=T.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,v=176,x=4+3*28;let j=E.right;j+v>k-4&&(j=Math.max(4,E.left-v));let K=E.top-4;return K+x>m-4&&(K=Math.max(4,m-x-4)),{left:j+"px",top:K+"px",display:"block"}});let g=null,b=null;function w(T){b&&(clearTimeout(b),b=null),g=setTimeout(()=>{s.value=T},60)}function N(){g&&(clearTimeout(g),g=null),b=setTimeout(()=>{s.value=null},120)}e.onBeforeUnmount(()=>{g&&clearTimeout(g),b&&clearTimeout(b)});function V(T){const E=T.target;E&&E.closest(".zm-canvas-menu")||r("close")}function _(T){T.key==="Escape"&&r("close")}function $(){r("close")}window.addEventListener("mousedown",V,!0),window.addEventListener("keydown",_,!0),window.addEventListener("wheel",$,!0),window.addEventListener("scroll",$,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",V,!0),window.removeEventListener("keydown",_,!0),window.removeEventListener("wheel",$,!0),window.removeEventListener("scroll",$,!0)});function B(T){T(),r("close")}return(T,E)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:i.value.left+"px",top:i.value.top+"px"}),onContextmenu:E[11]||(E[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[0]||(E[0]=e.withModifiers(k=>B(()=>r("openData")),["stop"]))},[e.createVNode(ke,{name:"database",size:13,stroke:1.6}),E[12]||(E[12]=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":s.value==="import"}]),onMouseenter:E[5]||(E[5]=k=>w("import")),onMouseleave:N},[e.createVNode(ke,{name:"import",size:13,stroke:1.6}),E[16]||(E[16]=e.createElementVNode("span",null,"导入",-1)),E[17]||(E[17]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:E[4]||(E[4]=k=>w("import")),onMouseleave:N},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[1]||(E[1]=e.withModifiers(k=>B(()=>r("openImport","markdown")),["stop"]))},[e.createVNode(ke,{name:"markdown",size:13,stroke:1.6}),E[13]||(E[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[2]||(E[2]=e.withModifiers(k=>B(()=>r("openImport","json")),["stop"]))},[e.createVNode(ke,{name:"json",size:13,stroke:1.6}),E[14]||(E[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[3]||(E[3]=e.withModifiers(k=>B(()=>r("openImport","txt")),["stop"]))},[e.createVNode(ke,{name:"txt",size:13,stroke:1.6}),E[15]||(E[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[6]||(E[6]=e.withModifiers(k=>B(()=>r("openSettings")),["stop"]))},[e.createVNode(ke,{name:"settings",size:13,stroke:1.6}),E[18]||(E[18]=e.createElementVNode("span",null,"设置",-1))]),E[23]||(E[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:u,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":s.value==="export"}]),onMouseenter:E[10]||(E[10]=k=>w("export")),onMouseleave:N},[e.createVNode(ke,{name:"export",size:13,stroke:1.6}),E[21]||(E[21]=e.createElementVNode("span",null,"导出",-1)),E[22]||(E[22]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),s.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:E[9]||(E[9]=k=>w("export")),onMouseleave:N},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[7]||(E[7]=e.withModifiers(k=>B(()=>r("exportPng")),["stop"]))},[e.createVNode(ke,{name:"image",size:13,stroke:1.6}),E[19]||(E[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:E[8]||(E[8]=e.withModifiers(k=>B(()=>r("exportSvg")),["stop"]))},[e.createVNode(ke,{name:"svg-export",size:13,stroke:1.6}),E[20]||(E[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}});function Ka(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ci(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],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&ci(n)}),t}class di{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ui(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function un(t,...o){const n=Object.create(null);for(const r in t)n[r]=t[r];return o.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const Ya="</span>",fi=t=>!!t.scope,qa=(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((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${o}${t}`};class Xa{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=ui(o)}openNode(o){if(!fi(o))return;const n=qa(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){fi(o)&&(this.buffer+=Ya)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const mi=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class ar{constructor(){this.rootNode=mi(),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=mi({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(r=>this._walk(o,r)),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=>{ar._collapse(n)}))}}class Za extends ar{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const r=o.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Xa(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function oo(t){return t?typeof t=="string"?t:t.source:null}function pi(t){return Nn("(?=",t,")")}function Ja(t){return Nn("(?:",t,")*")}function Qa(t){return Nn("(?:",t,")?")}function Nn(...t){return t.map(n=>oo(n)).join("")}function es(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function sr(...t){return"("+(es(t).capture?"":"?:")+t.map(r=>oo(r)).join("|")+")"}function gi(t){return new RegExp(t.toString()+"|").exec("").length-1}function ts(t,o){const n=t&&t.exec(o);return n&&n.index===0}const ns=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function cr(t,{joinWith:o}){let n=0;return t.map(r=>{n+=1;const i=n;let s=oo(r),c="";for(;s.length>0;){const u=ns.exec(s);if(!u){c+=s;break}c+=s.substring(0,u.index),s=s.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?c+="\\"+String(Number(u[1])+i):(c+=u[0],u[0]==="("&&n++)}return c}).map(r=>`(${r})`).join(o)}const os=/\b\B/,hi="[a-zA-Z]\\w*",dr="[a-zA-Z_]\\w*",bi="\\b\\d+(\\.\\d+)?",ki="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",yi="\\b(0b[01]+)",rs="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",is=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Nn(o,/.*\b/,t.binary,/\b.*/)),un({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},t)},ro={begin:"\\\\[\\s\\S]",relevance:0},ls={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ro]},as={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ro]},ss={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/},Io=function(t,o,n={}){const r=un({scope:"comment",begin:t,end:o,contains:[]},n);r.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 i=sr("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 r.contains.push({begin:Nn(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},cs=Io("//","$"),ds=Io("/\\*","\\*/"),us=Io("#","$"),fs={scope:"number",begin:bi,relevance:0},ms={scope:"number",begin:ki,relevance:0},ps={scope:"number",begin:yi,relevance:0},gs={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ro,{begin:/\[/,end:/\]/,relevance:0,contains:[ro]}]},hs={scope:"title",begin:hi,relevance:0},bs={scope:"title",begin:dr,relevance:0},ks={begin:"\\.\\s*"+dr,relevance:0};var Oo=Object.freeze({__proto__:null,APOS_STRING_MODE:ls,BACKSLASH_ESCAPE:ro,BINARY_NUMBER_MODE:ps,BINARY_NUMBER_RE:yi,COMMENT:Io,C_BLOCK_COMMENT_MODE:ds,C_LINE_COMMENT_MODE:cs,C_NUMBER_MODE:ms,C_NUMBER_RE:ki,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:us,IDENT_RE:hi,MATCH_NOTHING_RE:os,METHOD_GUARD:ks,NUMBER_MODE:fs,NUMBER_RE:bi,PHRASAL_WORDS_MODE:ss,QUOTE_STRING_MODE:as,REGEXP_MODE:gs,RE_STARTERS_RE:rs,SHEBANG:is,TITLE_MODE:hs,UNDERSCORE_IDENT_RE:dr,UNDERSCORE_TITLE_MODE:bs});function ys(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Es(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function xs(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=ys,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function ws(t,o){Array.isArray(t.illegal)&&(t.illegal=sr(...t.illegal))}function Ns(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 Ss(t,o){t.relevance===void 0&&(t.relevance=1)}const Ts=(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(r=>{delete t[r]}),t.keywords=n.keywords,t.begin=Nn(n.beforeMatch,pi(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},Cs=["of","and","for","in","not","or","if","then","parent","list","value"],As="keyword";function Ei(t,o,n=As){const r=Object.create(null);return typeof t=="string"?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach(function(s){Object.assign(r,Ei(t[s],o,s))}),r;function i(s,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const d=u.split("|");r[d[0]]=[s,_s(d[0],d[1])]})}}function _s(t,o){return o?Number(o):Ms(t)?0:1}function Ms(t){return Cs.includes(t.toLowerCase())}const xi={},Sn=t=>{console.error(t)},wi=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Pn=(t,o)=>{xi[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),xi[`${t}/${o}`]=!0)},Lo=new Error;function Ni(t,o,{key:n}){let r=0;const i=t[n],s={},c={};for(let u=1;u<=o.length;u++)c[u+r]=i[u],s[u+r]=!0,r+=gi(o[u-1]);t[n]=c,t[n]._emit=s,t[n]._multi=!0}function Rs(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Sn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Lo;if(typeof t.beginScope!="object"||t.beginScope===null)throw Sn("beginScope must be object"),Lo;Ni(t,t.begin,{key:"beginScope"}),t.begin=cr(t.begin,{joinWith:""})}}function vs(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Sn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Lo;if(typeof t.endScope!="object"||t.endScope===null)throw Sn("endScope must be object"),Lo;Ni(t,t.end,{key:"endScope"}),t.end=cr(t.end,{joinWith:""})}}function Bs(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function zs(t){Bs(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),Rs(t),vs(t)}function Is(t){function o(c,u){return new RegExp(oo(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,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=gi(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(cr(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const g=d.findIndex((w,N)=>N>0&&w!==void 0),b=this.matchIndexes[g];return d.splice(0,g),Object.assign(d,b)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([g,b])=>d.addRule(g,b)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let g=d.exec(u);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const b=this.getMatcher(0);b.lastIndex=this.lastIndex+1,g=b.exec(u)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}function i(c){const u=new r;return c.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function s(c,u){const d=c;if(c.isCompiled)return d;[Es,Ns,zs,Ts].forEach(b=>b(c,u)),t.compilerExtensions.forEach(b=>b(c,u)),c.__beforeBegin=null,[xs,ws,Ss].forEach(b=>b(c,u)),c.isCompiled=!0;let g=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),g=c.keywords.$pattern,delete c.keywords.$pattern),g=g||/\w+/,c.keywords&&(c.keywords=Ei(c.keywords,t.case_insensitive)),d.keywordPatternRe=o(g,!0),u&&(c.begin||(c.begin=/\B|\b/),d.beginRe=o(d.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(d.endRe=o(d.end)),d.terminatorEnd=oo(d.end)||"",c.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(d.illegalRe=o(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(b){return Os(b==="self"?c:b)})),c.contains.forEach(function(b){s(b,d)}),c.starts&&s(c.starts,u),d.matcher=i(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=un(t.classNameAliases||{}),s(t)}function Si(t){return t?t.endsWithParent||Si(t.starts):!1}function Os(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return un(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Si(t)?un(t,{starts:t.starts?un(t.starts):null}):Object.isFrozen(t)?un(t):t}var Ls="11.11.1";class Ds extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const ur=ui,Ti=un,Ci=Symbol("nomatch"),Vs=7,Ai=function(t){const o=Object.create(null),n=Object.create(null),r=[];let i=!0;const s="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:Za};function d(C){return u.noHighlightRe.test(C)}function g(C){let F=C.className+" ";F+=C.parentNode?C.parentNode.className:"";const P=u.languageDetectRe.exec(F);if(P){const W=K(P[1]);return W||(wi(s.replace("{}",P[1])),wi("Falling back to no-highlight mode for this block.",C)),W?P[1]:"no-highlight"}return F.split(/\s+/).find(W=>d(W)||K(W))}function b(C,F,P){let W="",ae="";typeof F=="object"?(W=C,P=F.ignoreIllegals,ae=F.language):(Pn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Pn("10.7.0",`Please use highlight(code, options) instead.
14
+ https://github.com/highlightjs/highlight.js/issues/2277`),ae=C,W=F),P===void 0&&(P=!0);const we={code:W,language:ae};ie("before:highlight",we);const ve=we.result?we.result:w(we.language,we.code,P);return ve.code=we.code,ie("after:highlight",ve),ve}function w(C,F,P,W){const ae=Object.create(null);function we(U,Z){return U.keywords[Z]}function ve(){if(!te.keywords){Be.addText(Te);return}let U=0;te.keywordPatternRe.lastIndex=0;let Z=te.keywordPatternRe.exec(Te),se="";for(;Z;){se+=Te.substring(U,Z.index);const ye=Ke.case_insensitive?Z[0].toLowerCase():Z[0],Me=we(te,ye);if(Me){const[Qe,pt]=Me;if(Be.addText(se),se="",ae[ye]=(ae[ye]||0)+1,ae[ye]<=Vs&&(Ot+=pt),Qe.startsWith("_"))se+=Z[0];else{const gn=Ke.classNameAliases[Qe]||Qe;y(Z[0],gn)}}else se+=Z[0];U=te.keywordPatternRe.lastIndex,Z=te.keywordPatternRe.exec(Te)}se+=Te.substring(U),Be.addText(se)}function ze(){if(Te==="")return;let U=null;if(typeof te.subLanguage=="string"){if(!o[te.subLanguage]){Be.addText(Te);return}U=w(te.subLanguage,Te,!0,Gt[te.subLanguage]),Gt[te.subLanguage]=U._top}else U=V(Te,te.subLanguage.length?te.subLanguage:null);te.relevance>0&&(Ot+=U.relevance),Be.__addSublanguage(U._emitter,U.language)}function Ne(){te.subLanguage!=null?ze():ve(),Te=""}function y(U,Z){U!==""&&(Be.startScope(Z),Be.addText(U),Be.endScope())}function p(U,Z){let se=1;const ye=Z.length-1;for(;se<=ye;){if(!U._emit[se]){se++;continue}const Me=Ke.classNameAliases[U[se]]||U[se],Qe=Z[se];Me?y(Qe,Me):(Te=Qe,ve(),Te=""),se++}}function O(U,Z){return U.scope&&typeof U.scope=="string"&&Be.openNode(Ke.classNameAliases[U.scope]||U.scope),U.beginScope&&(U.beginScope._wrap?(y(Te,Ke.classNameAliases[U.beginScope._wrap]||U.beginScope._wrap),Te=""):U.beginScope._multi&&(p(U.beginScope,Z),Te="")),te=Object.create(U,{parent:{value:te}}),te}function D(U,Z,se){let ye=ts(U.endRe,se);if(ye){if(U["on:end"]){const Me=new di(U);U["on:end"](Z,Me),Me.isMatchIgnored&&(ye=!1)}if(ye){for(;U.endsParent&&U.parent;)U=U.parent;return U}}if(U.endsWithParent)return D(U.parent,Z,se)}function q(U){return te.matcher.regexIndex===0?(Te+=U[0],1):(jt=!0,0)}function de(U){const Z=U[0],se=U.rule,ye=new di(se),Me=[se.__beforeBegin,se["on:begin"]];for(const Qe of Me)if(Qe&&(Qe(U,ye),ye.isMatchIgnored))return q(Z);return se.skip?Te+=Z:(se.excludeBegin&&(Te+=Z),Ne(),!se.returnBegin&&!se.excludeBegin&&(Te=Z)),O(se,U),se.returnBegin?0:Z.length}function ge(U){const Z=U[0],se=F.substring(U.index),ye=D(te,U,se);if(!ye)return Ci;const Me=te;te.endScope&&te.endScope._wrap?(Ne(),y(Z,te.endScope._wrap)):te.endScope&&te.endScope._multi?(Ne(),p(te.endScope,U)):Me.skip?Te+=Z:(Me.returnEnd||Me.excludeEnd||(Te+=Z),Ne(),Me.excludeEnd&&(Te=Z));do te.scope&&Be.closeNode(),!te.skip&&!te.subLanguage&&(Ot+=te.relevance),te=te.parent;while(te!==ye.parent);return ye.starts&&O(ye.starts,U),Me.returnEnd?0:Z.length}function je(){const U=[];for(let Z=te;Z!==Ke;Z=Z.parent)Z.scope&&U.unshift(Z.scope);U.forEach(Z=>Be.openNode(Z))}let Pe={};function Je(U,Z){const se=Z&&Z[0];if(Te+=U,se==null)return Ne(),0;if(Pe.type==="begin"&&Z.type==="end"&&Pe.index===Z.index&&se===""){if(Te+=F.slice(Z.index,Z.index+1),!i){const ye=new Error(`0 width match regex (${C})`);throw ye.languageName=C,ye.badRule=Pe.rule,ye}return 1}if(Pe=Z,Z.type==="begin")return de(Z);if(Z.type==="illegal"&&!P){const ye=new Error('Illegal lexeme "'+se+'" for mode "'+(te.scope||"<unnamed>")+'"');throw ye.mode=te,ye}else if(Z.type==="end"){const ye=ge(Z);if(ye!==Ci)return ye}if(Z.type==="illegal"&&se==="")return Te+=`
15
+ `,1;if(Lt>1e5&&Lt>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Te+=se,se.length}const Ke=K(C);if(!Ke)throw Sn(s.replace("{}",C)),new Error('Unknown language: "'+C+'"');const Xn=Is(Ke);let pn="",te=W||Xn;const Gt={},Be=new u.__emitter(u);je();let Te="",Ot=0,it=0,Lt=0,jt=!1;try{if(Ke.__emitTokens)Ke.__emitTokens(F,Be);else{for(te.matcher.considerAll();;){Lt++,jt?jt=!1:te.matcher.considerAll(),te.matcher.lastIndex=it;const U=te.matcher.exec(F);if(!U)break;const Z=F.substring(it,U.index),se=Je(Z,U);it=U.index+se}Je(F.substring(it))}return Be.finalize(),pn=Be.toHTML(),{language:C,value:pn,relevance:Ot,illegal:!1,_emitter:Be,_top:te}}catch(U){if(U.message&&U.message.includes("Illegal"))return{language:C,value:ur(F),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:it,context:F.slice(it-100,it+100),mode:U.mode,resultSoFar:pn},_emitter:Be};if(i)return{language:C,value:ur(F),illegal:!1,relevance:0,errorRaised:U,_emitter:Be,_top:te};throw U}}function N(C){const F={value:ur(C),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return F._emitter.addText(C),F}function V(C,F){F=F||u.languages||Object.keys(o);const P=N(C),W=F.filter(K).filter(ce).map(Ne=>w(Ne,C,!1));W.unshift(P);const ae=W.sort((Ne,y)=>{if(Ne.relevance!==y.relevance)return y.relevance-Ne.relevance;if(Ne.language&&y.language){if(K(Ne.language).supersetOf===y.language)return 1;if(K(y.language).supersetOf===Ne.language)return-1}return 0}),[we,ve]=ae,ze=we;return ze.secondBest=ve,ze}function _(C,F,P){const W=F&&n[F]||P;C.classList.add("hljs"),C.classList.add(`language-${W}`)}function $(C){let F=null;const P=g(C);if(d(P))return;if(ie("before:highlightElement",{el:C,language:P}),C.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",C);return}if(C.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(C)),u.throwUnescapedHTML))throw new Ds("One of your code blocks includes unescaped HTML.",C.innerHTML);F=C;const W=F.textContent,ae=P?b(W,{language:P,ignoreIllegals:!0}):V(W);C.innerHTML=ae.value,C.dataset.highlighted="yes",_(C,P,ae.language),C.result={language:ae.language,re:ae.relevance,relevance:ae.relevance},ae.secondBest&&(C.secondBest={language:ae.secondBest.language,relevance:ae.secondBest.relevance}),ie("after:highlightElement",{el:C,result:ae,text:W})}function B(C){u=Ti(u,C)}const T=()=>{m(),Pn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function E(){m(),Pn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function C(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",C,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach($)}function v(C,F){let P=null;try{P=F(t)}catch(W){if(Sn("Language definition for '{}' could not be registered.".replace("{}",C)),i)Sn(W);else throw W;P=c}P.name||(P.name=C),o[C]=P,P.rawDefinition=F.bind(null,t),P.aliases&&ne(P.aliases,{languageName:C})}function x(C){delete o[C];for(const F of Object.keys(n))n[F]===C&&delete n[F]}function j(){return Object.keys(o)}function K(C){return C=(C||"").toLowerCase(),o[C]||o[n[C]]}function ne(C,{languageName:F}){typeof C=="string"&&(C=[C]),C.forEach(P=>{n[P.toLowerCase()]=F})}function ce(C){const F=K(C);return F&&!F.disableAutodetect}function re(C){C["before:highlightBlock"]&&!C["before:highlightElement"]&&(C["before:highlightElement"]=F=>{C["before:highlightBlock"](Object.assign({block:F.el},F))}),C["after:highlightBlock"]&&!C["after:highlightElement"]&&(C["after:highlightElement"]=F=>{C["after:highlightBlock"](Object.assign({block:F.el},F))})}function Y(C){re(C),r.push(C)}function ee(C){const F=r.indexOf(C);F!==-1&&r.splice(F,1)}function ie(C,F){const P=C;r.forEach(function(W){W[P]&&W[P](F)})}function z(C){return Pn("10.7.0","highlightBlock will be removed entirely in v12.0"),Pn("10.7.0","Please use highlightElement now."),$(C)}Object.assign(t,{highlight:b,highlightAuto:V,highlightAll:m,highlightElement:$,highlightBlock:z,configure:B,initHighlighting:T,initHighlightingOnLoad:E,registerLanguage:v,unregisterLanguage:x,listLanguages:j,getLanguage:K,registerAliases:ne,autoDetection:ce,inherit:Ti,addPlugin:Y,removePlugin:ee}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString=Ls,t.regex={concat:Nn,lookahead:pi,either:sr,optional:Qa,anyNumberOfTimes:Ja};for(const C in Oo)typeof Oo[C]=="object"&&ci(Oo[C]);return Object.assign(t,Oo),t},Fn=Ai({});Fn.newInstance=()=>Ai({});var $s=Fn;Fn.HighlightJS=Fn,Fn.default=Fn;const fr=Ka($s);function mr(t){const o=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=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,i]};i.contains.push(u);const d={match:/\\"/},g={className:"string",begin:/'/,end:/'/},b={match:/\\'/},w={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},N=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],V=t.SHEBANG({binary:`(${N.join("|")})`,relevance:10}),_={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},$=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],B=["true","false"],T={match:/(\/[a-z._-]+)+/},E=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],m=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],v=["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:$,literal:B,built_in:[...E,...k,"set","shopt",...m,...v]},contains:[V,t.SHEBANG(),_,w,s,c,T,u,d,g,b,n]}}const Ps=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_-]*/}}),Fs=["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"],Us=["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"],Hs=[...Fs,...Us],Ws=["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(),Gs=["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(),js=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ks=["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 Ys(t){const o=t.regex,n=Ps(t),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\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,r,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:":("+Gs.join("|")+")"},{begin:":(:)?("+js.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ks.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:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Ws.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Hs.join("|")+")\\b"}]}}function _i(t){const s={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:s,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:s,illegal:/["']/}]}]}}var Un="[0-9](_*[0-9])*",Do=`\\.(${Un})`,Vo="[0-9a-fA-F](_*[0-9a-fA-F])*",Mi={className:"number",variants:[{begin:`(\\b(${Un})((${Do})|\\.)?|(${Do}))[eE][+-]?(${Un})[fFdD]?\\b`},{begin:`\\b(${Un})((${Do})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Do})[fFdD]?\\b`},{begin:`\\b(${Un})[fFdD]\\b`},{begin:`\\b0[xX]((${Vo})\\.?|(${Vo})?\\.(${Vo}))[pP][+-]?(${Un})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Vo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ri(t,o,n){return n===-1?"":t.replace(o,r=>Ri(t,o,n-1))}function qs(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Ri("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},b={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[b,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[g,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Mi,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Mi,g]}}const vi="[A-Za-z$_][0-9A-Za-z$_]*",Xs=["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"],Zs=["true","false","null","undefined","NaN","Infinity"],Bi=["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"],zi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ii=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Js=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Qs=[].concat(Ii,Bi,zi);function Oi(t){const o=t.regex,n=(P,{after:W})=>{const ae="</"+P[0].slice(1);return P.input.indexOf(ae,W)!==-1},r=vi,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,W)=>{const ae=P[0].length+P.index,we=P.input[ae];if(we==="<"||we===","){W.ignoreMatch();return}we===">"&&(n(P,{after:ae})||W.ignoreMatch());let ve;const ze=P.input.substring(ae);if(ve=ze.match(/^\s*=/)){W.ignoreMatch();return}if((ve=ze.match(/^\s+extends\s+/))&&ve.index===0){W.ignoreMatch();return}}},u={$pattern:vi,keyword:Xs,literal:Zs,built_in:Qs,"variable.language":Js},d="[0-9](_?[0-9])*",g=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\b((${g})\\b|\\.)?|(${g})\\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},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},V={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},$={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},E={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,_,$,B,{match:/\$\d+/},w];N.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(E,N.contains),v=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:v},j={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,o.concat(r,"(",o.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={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:{_:[...Bi,...zi]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ce={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(P){return o.concat("(?!",P.join("|"),")")}const ee={match:o.concat(/\b/,Y([...Ii,"super","import"].map(P=>`${P}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,_,$,B,E,{match:/\$\d+/},w,K,{scope:"attr",match:r+o.lookahead(":"),relevance:0},F,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:C,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:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},ce,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},ee,re,j,z,{match:/\$[(.]/}]}}function ec(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[o,n,t.QUOTE_STRING_MODE,i,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Li(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={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}]},s={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+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},g={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},w=t.inherit(g,{contains:[]}),N=t.inherit(b,{contains:[]});g.contains.push(N),b.contains.push(w);let V=[n,d];return[g,b,w,N].forEach(T=>{T.contains=T.contains.concat(V)}),V=V.concat(g,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:V},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:V}]}]},n,s,g,b,{className:"quote",begin:"^>\\s+",contains:V,end:"$"},i,r,d,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Di(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["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:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},b={begin:/\{\{/,relevance:0},w={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,b,g]},{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,b,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,g]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},N="[0-9](_?[0-9])*",V=`(\\b(${N}))?\\.(${N})|\\b(${N})\\.`,_=`\\b|${r.join("|")}`,$={className:"number",relevance:0,variants:[{begin:`(\\b(${N})|(${V}))[eE][+-]?(${N})[jJ]?(?=${_})`},{begin:`(${V})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${_})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${_})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${_})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${_})`},{begin:`\\b(${N})[jJ](?=${_})`}]},B={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},T={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,$,w,t.HASH_COMMENT_MODE]}]};return g.contains=[w,$,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,$,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},w,B,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[T]},{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:[$,T,w]}]}}function Vi(t){const o=t.regex,n=/(r#)?/,r=o.concat(n,t.UNDERSCORE_IDENT_RE),i=o.concat(n,t.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,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"],d=["true","false","Some","None","Ok","Err"],g=["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!"],b=["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:b,keyword:u,literal:d,built_in:g},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+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:b}},{className:"punctuation",begin:"->"},s]}}function tc(t){const o=t.regex,n=t.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["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"],d=["add","asc","collation","desc","final","first","last","view"],g=["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"],b=["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"],w=["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"],N=["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"],V=b,_=[...g,...d].filter(v=>!b.includes(v)),$={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},B={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={match:o.concat(/\b/,o.either(...V),/\s*\(/),relevance:0,keywords:{built_in:V}};function E(v){return o.concat(/\b/,o.either(...v.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:E(N),relevance:0};function m(v,{exceptions:x,when:j}={}){const K=j;return x=x||[],v.map(ne=>ne.match(/\|\d+$/)||x.includes(ne)?ne:K(ne)?`${ne}|0`:ne)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(_,{when:v=>v.length<3}),literal:s,type:u,built_in:w},contains:[{scope:"type",match:E(c)},k,T,$,r,i,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,B]}}const $o="[A-Za-z$_][0-9A-Za-z$_]*",$i=["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"],Pi=["true","false","null","undefined","NaN","Infinity"],Fi=["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"],Ui=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Wi=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Gi=[].concat(Hi,Fi,Ui);function nc(t){const o=t.regex,n=(P,{after:W})=>{const ae="</"+P[0].slice(1);return P.input.indexOf(ae,W)!==-1},r=$o,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(P,W)=>{const ae=P[0].length+P.index,we=P.input[ae];if(we==="<"||we===","){W.ignoreMatch();return}we===">"&&(n(P,{after:ae})||W.ignoreMatch());let ve;const ze=P.input.substring(ae);if(ve=ze.match(/^\s*=/)){W.ignoreMatch();return}if((ve=ze.match(/^\s+extends\s+/))&&ve.index===0){W.ignoreMatch();return}}},u={$pattern:$o,keyword:$i,literal:Pi,built_in:Gi,"variable.language":Wi},d="[0-9](_?[0-9])*",g=`\\.(${d})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${b})((${g})|\\.)?|(${g}))[eE][+-]?(${d})\\b`},{begin:`\\b(${b})\\b((${g})\\b|\\.)?|(${g})\\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},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},V={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},_={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"css"}},$={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,N]},E={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:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,_,$,B,{match:/\$\d+/},w];N.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(E,N.contains),v=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:v},j={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,o.concat(r,"(",o.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},K={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:{_:[...Fi,...Ui]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},ce={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},re={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Y(P){return o.concat("(?!",P.join("|"),")")}const ee={match:o.concat(/\b/,Y([...Hi,"super","import"].map(P=>`${P}\\s*\\(`)),r,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:o.concat(/\./,o.lookahead(o.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},C="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(C)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:v,CLASS_REFERENCE:K},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,V,_,$,B,E,{match:/\$\d+/},w,K,{scope:"attr",match:r+o.lookahead(":"),relevance:0},F,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[E,t.REGEXP_MODE,{className:"function",begin:C,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:v}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},ce,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,t.inherit(t.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},ee,re,j,z,{match:/\$[(.]/}]}}function ji(t){const o=t.regex,n=nc(t),r=$o,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:$o,keyword:$i.concat(d),literal:Pi,built_in:Gi.concat(i),"variable.language":Wi},b={className:"meta",begin:"@"+r},w=($,B,T)=>{const E=$.contains.findIndex(k=>k.label===B);if(E===-1)throw new Error("can not find mode to replace");$.contains.splice(E,1,T)};Object.assign(n.keywords,g),n.exports.PARAMS_CONTAINS.push(b);const N=n.contains.find($=>$.scope==="attr"),V=Object.assign({},N,{match:o.concat(r,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,N,V]),n.contains=n.contains.concat([b,s,c,V]),w(n,"shebang",t.SHEBANG()),w(n,"use_strict",u);const _=n.contains.find($=>$.label==="func.def");return _.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Ki(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(s,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{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:[s,d,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,c,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],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:g}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Yi(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={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,i]},u=t.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),N={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"},V={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},_={begin:/\{/,end:/\}/,contains:[V],illegal:"\\n",relevance:0},$={begin:"\\[",end:"\\]",contains:[V],illegal:"\\n",relevance:0},B=[r,{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}},N,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},_,$,s,c],T=[...B];return T.pop(),T.push(u),V.contains=T,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:B}}const pr={bash:mr,sh:mr,shell:mr,css:Ys,go:_i,golang:_i,java:qs,javascript:Oi,js:Oi,json:ec,markdown:Li,md:Li,python:Di,py:Di,rust:Vi,rs:Vi,sql:tc,typescript:ji,ts:ji,xml:Ki,html:Ki,yaml:Yi,yml:Yi};for(const[t,o]of Object.entries(pr))fr.registerLanguage(t,o);function Po(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
- `).replace(/\n+$/,"")}function nn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
18
- `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Mo[n]?n:""}function Bo(t,o){const n=o&&Mo[o]?o:"";try{return n?_o.highlight(t,{language:n,ignoreIllegals:!0}).value:_o.highlightAuto(t).value}catch{return os(t)}}function sr(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 os(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function cr(t,o,n){if(t.length<=1)return t.slice();const[i,...r]=t,s=r.map(m=>m[o]??""),c=s.length>0&&s.every(m=>m.trim()!==""&&!Number.isNaN(Number(m))),u=n==="asc"?1:-1,d=r.slice().sort((m,p)=>{const k=m[o]??"",y=p[o]??"";return c?(Number(k)-Number(y))*u:k.localeCompare(y,"zh-Hans-CN",{numeric:!0})*u});return[i,...d]}const is=["viewBox","width","height"],rs={class:"zm-edges"},ls=["d","fill"],as=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],ss=["src","width","height","alt"],cs=["onDblclick"],ds={key:0,class:"zm-rich-code"},us=["innerHTML"],ms={key:1,class:"zm-rich-table"},fs=["onClick"],ps={class:"zm-rich-sort-mark","aria-hidden":"true"},gs={key:2,class:"zm-text"},hs={class:"zm-text-label"},bs=["href","title"],ks=["title","onClick"],ys=["title"],Es=["title","onClick"],xs=["onClick"],ws=["onMousedown"],Ns=["onClick"],Ss=["title"],Ts={class:"zm-tb-tip zm-tb-zoom"},Cs=["src"],_s=["src"],Ht=24,on=400,Bt=160,Yn=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,s=e.ref(null),c=e.ref(null),u=e.ref(""),d=e.ref(new Set),m=e.computed(()=>d.value.values().next().value??null),p=e.ref(new Set),k=e.ref(!1),y=e.ref(null),w=e.ref(0),E=e.ref(0),L=e.ref(null),C=e.ref(null),x=e.ref(null),R=e.ref(""),S=e.ref(new Map),g=e.ref(ct(i.data)),_=e.ref({}),b=e.ref({}),v=e.ref(i.markdown!==void 0);let H=!1;e.watch(()=>i.markdown,l=>{if(l===void 0){v.value=!1;return}v.value=!0;const a=Zt(l||"");H=!0,g.value=ct(a),d.value=new Set,p.value=new Set,be(),e.nextTick(()=>{H=!1,At()})}),e.watch(g,()=>{v.value&&!H&&r("markdownChange",Jt(g.value))},{deep:!0});const oe=e.computed(()=>ee.showOrderBadge===!0),q=e.ref(new Map),J=q.value;function ae(l,a){const h={};a.bg&&(h.bg=a.bg),a.textColor&&(h.textColor=a.textColor),a.borderColor&&(h.borderColor=a.borderColor),a.fontWeight&&(h.fontWeight=a.fontWeight),Object.keys(h).length===0?J.delete(l):J.set(l,h),q.value=new Map(J)}function W(l){return J.get(l)??{}}function K(l,a){const h=fe(g.value,l);h&&(h.image={src:a.src,naturalW:a.naturalW,naturalH:a.naturalH,width:P(a.width,Ht,on),height:P(a.height,Ht,on)},Ie(),be(),r("change",g.value))}function F(l){const a=fe(g.value,l);!a||!a.image||(delete a.image,Ie(),be(),r("change",g.value))}function N(l,a){const h=a.trim();if(!fe(g.value,l))return;if(!h){F(l);return}const A=new Image;A.onload=()=>{const $=fe(g.value,l);if(!$)return;const j=A.naturalWidth&&A.naturalHeight?A.naturalWidth/A.naturalHeight:1,ne=P(A.naturalWidth||Bt,Ht,on),Ne=Math.round(ne/j);$.image={src:h,naturalW:A.naturalWidth||ne,naturalH:A.naturalHeight||Ne,width:ne,height:Ne},Ie(),be(),r("change",g.value)},A.onerror=()=>{},A.src=h}function P(l,a,h){return Math.min(h,Math.max(a,l))}function D(l,a){const h=new FileReader;h.onload=()=>{if(typeof h.result!="string")return;const I=h.result,A=new window.Image;A.onload=()=>{const $=A.naturalWidth||Bt,j=A.naturalHeight||Bt,ne=P($,Ht,Bt),Ne=P(Math.round(j*ne/$),Ht,on);a({src:I,naturalW:$,naturalH:j,width:ne,height:Ne})},A.onerror=()=>{a({src:I,naturalW:Bt,naturalH:Bt,width:Bt,height:Bt})},A.src=I},h.readAsDataURL(l)}function Y(l){const a=document.createElement("input");a.type="file",a.accept="image/*",a.style.display="none",a.onchange=()=>{var I;const h=(I=a.files)==null?void 0:I[0];h&&(D(h,A=>K(l,A)),document.body.removeChild(a))},document.body.appendChild(a),a.click()}function se(l,a){const h=a.trim(),I=fe(g.value,l);I&&(h?I.link={url:h}:delete I.link,Ie(),be(),r("change",g.value))}function ke(l){se(l,"")}function Re(l,a){const h=fe(g.value,l);h&&(a?h.note={text:a}:delete h.note,Ie(),be(),r("change",g.value))}function Pe(l){Re(l,"")}function Te(l,a){const h=fe(g.value,l);h&&(a?h.richContent=a:delete h.richContent,Ie(),be(),r("change",g.value))}const B=e.ref(null),z=e.ref(null),ie=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||k.value)?"is-visible":""].filter(Boolean).join(" ")),re=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||k.value)?"is-visible":""].filter(Boolean).join(" "));function V(l,a){i.previewMode||(l.preventDefault(),l.stopPropagation(),z.value=null,d.value=new Set([a.id]),it(),B.value={nodeId:a.id,x:l.clientX,y:l.clientY})}function T(){B.value=null}function ce(l){const a=l.target;a!=null&&a.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline")||(l.preventDefault(),B.value&&(B.value=null),z.value={x:l.clientX,y:l.clientY})}function de(){z.value=null}function De(){de(),r("canvas-settings")}function Ke(){de(),r("canvas-data")}function We(l){de(),r("canvas-import",l)}function mn(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Y(l)}function It(){var I,A,$;const l=(I=B.value)==null?void 0:I.nodeId;if(!l)return;const a=(($=(A=fe(g.value,l))==null?void 0:A.link)==null?void 0:$.url)??"",h=window.prompt("输入链接 URL(留空取消)",a);h!==null&&se(l,h)}function Q(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&ke(l)}function wt(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&U(l)}function Me(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Pe(l)}function we(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&F(l)}function pt(){var tt,rt;const l=(tt=B.value)==null?void 0:tt.nodeId;if(!l)return;const a=(rt=fe(g.value,l))==null?void 0:rt.richContent,h=(a==null?void 0:a.kind)==="code"?Ro(a.raw):"",I=(a==null?void 0:a.kind)==="code"&&a.lang||"",A=I?"```"+I+`
20
- `:"```\n",j=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",h?A+h+(h.endsWith("```")?"":"\n```"):A+"// 你的代码"+"\n```");if(j===null)return;const ne=j.trim();if(!ne){Te(l,null);return}const Ne=/^```([^\s`]*)/.exec(ne),M=Ne?Ne[1]:void 0;Te(l,{kind:"code",raw:ne,lang:M})}function qe(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Te(l,null)}function gt(){var j,ne;const l=(j=B.value)==null?void 0:j.nodeId;if(!l)return;const a=(ne=fe(g.value,l))==null?void 0:ne.richContent,h=(a==null?void 0:a.kind)==="table"?a.raw:"",A=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",h||`| 列1 | 列2 | 列3 |
17
+ `).replace(/\n+$/,"")}function Tn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
18
+ `)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&pr[n]?n:""}function gr(t,o){const n=o&&pr[o]?o:"";try{return n?fr.highlight(t,{language:n,ignoreIllegals:!0}).value:fr.highlightAuto(t).value}catch{return oc(t)}}function hr(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 oc(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[r,...i]=t,s=i.map(g=>g[o]??""),c=s.length>0&&s.every(g=>g.trim()!==""&&!Number.isNaN(Number(g))),u=n==="asc"?1:-1,d=i.slice().sort((g,b)=>{const w=g[o]??"",N=b[o]??"";return c?(Number(w)-Number(N))*u:w.localeCompare(N,"zh-Hans-CN",{numeric:!0})*u});return[r,...d]}const rc=["viewBox","width","height"],ic={class:"zm-edges"},lc=["d","fill"],ac=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],sc=["src","width","height","alt"],cc=["onDblclick"],dc={key:0,class:"zm-rich-code"},uc=["innerHTML"],fc={key:1,class:"zm-rich-table"},mc=["onClick"],pc={class:"zm-rich-sort-mark","aria-hidden":"true"},gc={key:2,class:"zm-text"},hc={key:0,class:"zm-node-markers"},bc=["title","innerHTML"],kc={class:"zm-text-label"},yc=["href","title"],Ec=["title","onClick"],xc={key:4,class:"zm-node-tags"},wc=["title"],Nc=["title","onClick"],Sc=["onClick"],Tc=["onMousedown"],Cc=["onClick"],Ac=["title"],_c={class:"zm-tb-tip zm-tb-zoom"},Mc=["src"],Rc=["src"],Cn=24,Hn=400,fn=160,Xi=4,Fo=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 r=t,i=n,s=e.ref(null),c=e.ref(null),u=e.ref(""),d=e.ref(new Set),g=e.computed(()=>d.value.values().next().value??null),b=e.ref(new Set),w=e.ref(!1),N=e.ref(null),V=e.ref(0),_=e.ref(0),$=e.ref(null),B=e.ref(null),T=e.ref(null),E=e.ref(""),k=e.ref(new Map),m=e.ref(Ct(r.data)),v=e.ref({}),x=e.ref({}),j=e.ref(r.markdown!==void 0);let K=!1;e.watch(()=>r.markdown,l=>{if(l===void 0){j.value=!1;return}j.value=!0;const a=Vn(l||"");K=!0,m.value=Ct(a),d.value=new Set,b.value=new Set,he(),e.nextTick(()=>{K=!1,rn()})}),e.watch(m,()=>{j.value&&!K&&i("markdownChange",$n(m.value))},{deep:!0});const ne=e.computed(()=>Q.showOrderBadge===!0),ce=e.ref(new Map),re=ce.value;function Y(l,a){const f={};a.bg&&(f.bg=a.bg),a.textColor&&(f.textColor=a.textColor),a.borderColor&&(f.borderColor=a.borderColor),a.fontWeight&&(f.fontWeight=a.fontWeight),a.fontSize&&(f.fontSize=a.fontSize),Object.keys(f).length===0?re.delete(l):re.set(l,f),ce.value=new Map(re)}function ee(l){return re.get(l)??{}}function ie(l,a){const f=le(m.value,l);f&&(f.image={src:a.src,naturalW:a.naturalW,naturalH:a.naturalH,width:F(a.width,Cn,Hn),height:F(a.height,Cn,Hn)},Ce(),he(),i("change",m.value))}function z(l){const a=le(m.value,l);!a||!a.image||(delete a.image,Ce(),he(),i("change",m.value))}function C(l,a){const f=a.trim();if(!le(m.value,l))return;if(!f){z(l);return}const S=new Image;S.onload=()=>{const L=le(m.value,l);if(!L)return;const M=S.naturalWidth&&S.naturalHeight?S.naturalWidth/S.naturalHeight:1,G=F(S.naturalWidth||fn,Cn,Hn),oe=Math.round(G/M);L.image={src:f,naturalW:S.naturalWidth||G,naturalH:S.naturalHeight||oe,width:G,height:oe},Ce(),he(),i("change",m.value)},S.onerror=()=>{},S.src=f}function F(l,a,f){return Math.min(f,Math.max(a,l))}function P(l,a){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const A=f.result,S=new window.Image;S.onload=()=>{const L=S.naturalWidth||fn,M=S.naturalHeight||fn,G=F(L,Cn,fn),oe=F(Math.round(M*G/L),Cn,Hn);a({src:A,naturalW:L,naturalH:M,width:G,height:oe})},S.onerror=()=>{a({src:A,naturalW:fn,naturalH:fn,width:fn,height:fn})},S.src=A},f.readAsDataURL(l)}function W(l){const a=document.createElement("input");a.type="file",a.accept="image/*",a.style.display="none",a.onchange=()=>{var A;const f=(A=a.files)==null?void 0:A[0];f&&(P(f,S=>ie(l,S)),document.body.removeChild(a))},document.body.appendChild(a),a.click()}function ae(l,a){const f=a.trim(),A=le(m.value,l);A&&(f?A.link={url:f}:delete A.link,Ce(),he(),i("change",m.value))}function we(l){ae(l,"")}function ve(l,a){const f=le(m.value,l);f&&(a?f.note={text:a}:delete f.note,Ce(),he(),i("change",m.value))}function ze(l){ve(l,"")}function Ne(l,a){const f=le(m.value,l);f&&(a?f.richContent=a:delete f.richContent,Ce(),he(),i("change",m.value))}const y=e.ref(null),p=e.ref(null),O=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!r.hideCanvasActions&&(!r.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" ")),D=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!r.hideCanvasActions&&(!r.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" "));function q(l,a){r.previewMode||(l.preventDefault(),l.stopPropagation(),p.value=null,d.value=new Set([a.id]),ut(),y.value={nodeId:a.id,x:l.clientX,y:l.clientY})}function de(){y.value=null}function ge(l){const a=l.target;if(!(a!=null&&a.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(er&&J.panMoved.value){er=!1,l.preventDefault();return}l.preventDefault(),y.value&&(y.value=null),p.value={x:l.clientX,y:l.clientY}}}function je(){p.value=null}function Pe(){je(),i("canvas-settings")}function Je(){je(),i("canvas-data")}function Ke(l){je(),i("canvas-import",l)}function Xn(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&W(l)}function pn(){var A,S,L;const l=(A=y.value)==null?void 0:A.nodeId;if(!l)return;const a=((L=(S=le(m.value,l))==null?void 0:S.link)==null?void 0:L.url)??"",f=window.prompt("输入链接 URL(留空取消)",a);f!==null&&ae(l,f)}function te(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&we(l)}function Gt(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&U(l)}function Be(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&ze(l)}function Te(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&z(l)}function Ot(){var Ve,R;const l=(Ve=y.value)==null?void 0:Ve.nodeId;if(!l)return;const a=(R=le(m.value,l))==null?void 0:R.richContent,f=(a==null?void 0:a.kind)==="code"?Po(a.raw):"",A=(a==null?void 0:a.kind)==="code"&&a.lang||"",S=A?"```"+A+`
20
+ `:"```\n",M=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?S+f+(f.endsWith("```")?"":"\n```"):S+"// 你的代码"+"\n```");if(M===null)return;const G=M.trim();if(!G){Ne(l,null);return}const oe=/^```([^\s`]*)/.exec(G),pe=oe?oe[1]:void 0;Ne(l,{kind:"code",raw:G,lang:pe})}function it(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&Ne(l,null)}function Lt(){var M,G;const l=(M=y.value)==null?void 0:M.nodeId;if(!l)return;const a=(G=le(m.value,l))==null?void 0:G.richContent,f=(a==null?void 0:a.kind)==="table"?a.raw:"",S=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
21
21
  | --- | --- | --- |
22
- | a | b | c |`);if(A===null)return;const $=A.trim();if(!$){Te(l,null);return}Te(l,{kind:"table",raw:$})}function Nt(){var a;const l=(a=B.value)==null?void 0:a.nodeId;l&&Te(l,null)}function U(l){i.previewMode||r("edit-note",l)}function Z(l,a=60){const h=l.replace(/\s+/g," ").trim();return h.length<=a?h||"点击编辑笔记":h.slice(0,a)+"…"}function le(l){var A;if(i.previewMode||c.value)return;const a=l.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))return;const h=m.value;if(!h)return;const I=(A=l.clipboardData)==null?void 0:A.items;if(I)for(let $=0;$<I.length;$++){const j=I[$];if(j.kind==="file"&&j.type.startsWith("image/")){const ne=j.getAsFile();if(!ne)continue;l.preventDefault();const Ne=fe(g.value,h);if(Ne!=null&&Ne.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;D(ne,M=>K(h,M));return}}}e.onMounted(()=>{window.addEventListener("paste",le),be()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",le)});const pe=e.ref(null),ze=e.computed(()=>{var l;return((l=pe.value)==null?void 0:l.nodeId)??null});function Ue(l,a){if(!a.image)return;l.preventDefault(),l.stopPropagation();const h=a.image.naturalW||a.image.width,I=a.image.naturalH||a.image.height,A=I>0?I/h:1;pe.value={nodeId:a.id,startX:l.clientX,startY:l.clientY,startW:a.image.width,startH:a.image.height,naturalW:h,naturalH:I,ratio:A,pendingW:a.image.width,pendingH:a.image.height},window.addEventListener("mousemove",Je),window.addEventListener("mouseup",Ot)}function Je(l){var Ne,M;const a=pe.value;if(!a)return;const h=te.scale.value||1,I=l.clientX-a.startX,A=P(a.startW+I/h,Ht,on),$=P(A*a.ratio,Ht,on);a.pendingW=A,a.pendingH=$;const j=(Ne=s.value)==null?void 0:Ne.querySelector(`[data-node-id="${a.nodeId}"] .zm-node-img`);j&&(j.style.width=`${A}px`,j.style.height=`${$}px`);const ne=(M=s.value)==null?void 0:M.querySelector(`[data-node-id="${a.nodeId}"]`);ne&&(ne.style.minWidth=`${Math.max(80,Math.ceil(A+28))}px`,ne.style.height=`${Math.ceil($+8+30)}px`)}function Ot(){const l=pe.value;if(window.removeEventListener("mousemove",Je),window.removeEventListener("mouseup",Ot),pe.value=null,!l)return;const a=fe(g.value,l.nodeId);!a||!a.image||(K(l.nodeId,{src:a.image.src,naturalW:a.image.naturalW,naturalH:a.image.naturalH,width:l.pendingW,height:l.pendingH}),d.value=new Set([l.nodeId]),it(),pn=!0)}const fn=e.ref(null);let pn=!1;function zn(l){fn.value=l}function oo(l){fn.value===l&&(fn.value=null),C.value&&(C.value=null)}function gn(l,a){var ht;if(!a.text||a.text.length<14)return;const I=l.currentTarget.getBoundingClientRect(),A=(ht=s.value)==null?void 0:ht.getBoundingClientRect();if(!A)return;const $=10,j=240,ne=I.top-A.top>60,Ne=I.left-A.left+I.width/2,M=$+j/2,tt=A.width-j/2-$,rt=Math.max(M,Math.min(Ne,tt)),ge=ne?I.top-A.top-8:I.bottom-A.top+8;C.value={text:a.text,x:rt,y:ge,above:ne}}const vt=e.ref(0),nt=e.ref(!1),Qe=Wl(100);function Ie(){Qe.record({data:g.value,selectedIds:[...d.value]})}function be(){p.value=new Set(p.value),vt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>ti()).then(()=>{vt.value++})}function ti(){const l=document.querySelectorAll(".zm-rich"),a={},h={};l.forEach(I=>{let A=I,$=null;for(;A&&!$;)$=A.getAttribute("data-node-id"),A=A.parentElement;if(!$)return;const j=I.offsetHeight,ne=I.scrollWidth,Ne=Math.round(j*2)/2,M=Math.round(ne*2)/2;a[$]=Ne,h[$]=M,_.value[$],b.value[$]}),_.value=a,b.value=h}const et=e.computed(()=>{var l,a,h,I,A,$,j,ne,Ne,M;return{rootBg:((l=i.theme)==null?void 0:l.rootBg)??"#1f2937",rootText:((a=i.theme)==null?void 0:a.rootText)??"#ffffff",branchBg:((h=i.theme)==null?void 0:h.branchBg)??"#ffffff",branchText:((I=i.theme)==null?void 0:I.branchText)??"#1f2937",lineColor:((A=i.theme)==null?void 0:A.lineColor)??"#94a3b8",bgColor:(($=i.theme)==null?void 0:$.bgColor)??"#f8fafc",fontSize:((j=i.theme)==null?void 0:j.fontSize)??14,lineWidthStart:((ne=i.theme)==null?void 0:ne.lineWidthStart)??2.2,lineWidthEnd:((Ne=i.theme)==null?void 0:Ne.lineWidthEnd)??.8,rainbowBranch:((M=i.theme)==null?void 0:M.rainbowBranch)??!1}}),ee=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function io(l){return ee.taperedEdge?ni(l):ro(l)}function Lt(l){return ee.taperedEdge?ee.lineWidthEnd:ro(l)}function ni(l){return l<=0?ee.lineWidthStart:l===1?Math.max(1.5,ee.lineWidthStart*.67):l===2?Math.max(.8,ee.lineWidthStart*.42):ee.lineWidthEnd}function ro(l){if(l<=0)return ee.lineWidthStart;if(l>=3)return ee.lineWidthEnd;const a=l/3;return ee.lineWidthStart+(ee.lineWidthEnd-ee.lineWidthStart)*a}function Oe(l,a,h,I){const A=1-l,$=A*A*A*a.x+3*A*A*l*h.x1+3*A*l*l*h.x2+l*l*l*I.x,j=A*A*A*a.y+3*A*A*l*h.y1+3*A*l*l*h.y2+l*l*l*I.y;return{x:$,y:j}}function Dt(l,a,h,I,A=32,$="curve",j="right"){if($==="curve"){let Tt;if(j==="right"||j==="left"){const Le=Math.abs(a.x-l.x)*.45,Mt=j==="right"?1:-1;Tt={x1:l.x+Mt*Le,y1:l.y,x2:a.x-Mt*Le,y2:a.y}}else{const Le=Math.abs(a.y-l.y)*.45;Tt={x1:l.x,y1:l.y+Le,x2:a.x,y2:a.y-Le}}const go=Se=>{const Le=1-Se,Mt=-3*Le*Le*l.x+3*(Le*Le-2*Le*Se)*Tt.x1+3*(2*Le*Se-Se*Se)*Tt.x2+3*Se*Se*a.x,Nn=-3*Le*Le*l.y+3*(Le*Le-2*Le*Se)*Tt.y1+3*(2*Le*Se-Se*Se)*Tt.y2+3*Se*Se*a.y;return{dx:Mt,dy:Nn}},Pt=[],ho=[];for(let Se=0;Se<=A;Se++){const Le=Se/A,Mt=Se===0?l:Se===A?a:Oe(Le,l,Tt,a),Nn=go(Le);let ko=Math.hypot(Nn.dx,Nn.dy);ko<1e-6&&(ko=1);const rl=-Nn.dy/ko,ll=Nn.dx/ko,yo=(h+(I-h)*Le)/2;Pt.push({x:Mt.x+rl*yo,y:Mt.y+ll*yo}),ho.push({x:Mt.x-rl*yo,y:Mt.y-ll*yo})}let bo=`M ${Pt[0].x.toFixed(2)} ${Pt[0].y.toFixed(2)}`;for(let Se=1;Se<=A;Se++)bo+=` L ${Pt[Se].x.toFixed(2)} ${Pt[Se].y.toFixed(2)}`;for(let Se=A;Se>=0;Se--)bo+=` L ${ho[Se].x.toFixed(2)} ${ho[Se].y.toFixed(2)}`;return bo+=" Z",bo}const ne=a.x-l.x,Ne=a.y-l.y;let M=Math.hypot(ne,Ne);M<1e-6&&(M=1);const tt=-Ne/M,rt=ne/M,ge=h/2,ht=I/2,wn={x:l.x+tt*ge,y:l.y+rt*ge},bt={x:l.x-tt*ge,y:l.y-rt*ge},vn={x:a.x-tt*ht,y:a.y-rt*ht},Ln={x:a.x+tt*ht,y:a.y+rt*ht};return`M ${wn.x.toFixed(2)} ${wn.y.toFixed(2)} L ${Ln.x.toFixed(2)} ${Ln.y.toFixed(2)} L ${vn.x.toFixed(2)} ${vn.y.toFixed(2)} L ${bt.x.toFixed(2)} ${bt.y.toFixed(2)} Z`}const hn=e.computed(()=>Fe.value.root.children),lo=Ct[0].colors,bn=e.computed(()=>Ml(ee.branchPaletteId,ee.customPalettes)),St=e.computed(()=>{const l=new Map;if(!ee.rainbowBranch)return l;const a=i.lineColors,h=a&&a.length>0?a:bn.value.colors.length>0?bn.value.colors:lo;for(let A=0;A<hn.value.length;A++){const $=hn.value[A];l.set($.id,h[A%h.length])}const I=(A,$)=>{l.set(A.id,$);for(const j of A.children)I(j,$)};for(let A=0;A<hn.value.length;A++){const $=hn.value[A];I($,h[A%h.length])}return l});function ao(l,a){return ee.rainbowBranch?St.value.get(a.id)??et.value.lineColor:et.value.lineColor}function oi(l){const a=W(l.id);if(a.bg)return a.bg;if(l.isRoot)return et.value.rootBg;if(ee.rainbowBranch){const h=St.value.get(l.id);if(h)return co(h,.18)}return et.value.branchBg}function lt(l){const a=W(l.id);if(a.textColor)return a.textColor;if(l.isRoot)return et.value.rootText;if(ee.rainbowBranch){const h=St.value.get(l.id);if(h)return kn(h,.55)}return et.value.branchText}function _t(l){const a=W(l.id);if(a.borderColor)return a.borderColor;if(l.isRoot)return et.value.rootBg;if(ee.rainbowBranch){const h=St.value.get(l.id);if(h)return kn(h,.3)}return et.value.lineColor}function so(l){return W(l.id).fontWeight??(l.isRoot?600:400)}function co(l,a){const h=l.replace("#",""),I=h.length===6?h:h.split("").map(ne=>ne+ne).join(""),A=parseInt(I.slice(0,2),16),$=parseInt(I.slice(2,4),16),j=parseInt(I.slice(4,6),16);return`rgba(${A}, ${$}, ${j}, ${a})`}function kn(l,a){const h=l.replace("#",""),I=h.length===6?h:h.split("").map(ne=>ne+ne).join(""),A=Math.round(parseInt(I.slice(0,2),16)*(1-a)),$=Math.round(parseInt(I.slice(2,4),16)*(1-a)),j=Math.round(parseInt(I.slice(4,6),16)*(1-a));return`rgb(${A}, ${$}, ${j})`}const te=Fl({getContainer:()=>s.value});te.setOnMarqueeEnd(df),Hl({isEditing:()=>c.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>m.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>g.value.id,onAddChild:Be,onAddSibling:Ye,onAddSiblingBefore:at,onRemove:qr,onStartEdit:Vt,onClearSelection:()=>{d.value=new Set,it()},onDuplicate:xn,onCopy:On,onCut:jr,onPaste:Kr,onUndo:ii,onRedo:ri,onNavigate:ef,onSelectRoot:()=>{d.value=new Set([g.value.id]),it()}});const Fe=e.computed(()=>{const l=ct(g.value);return fo(l),Tl(l,{mode:ee.layoutMode,baseFontSize:et.value.fontSize,richHeights:_.value,richWidths:b.value})}),qt=e.ref([]),ot=e.computed(()=>(vt.value,qt.value));e.watch(Fe,l=>{const a=[],h=I=>{a.push(I);for(const A of I.children)h(A)};h(l.root),qt.value=a},{immediate:!0});const uo=e.computed(()=>{const l=[];for(const a of ot.value)for(const h of a.children)l.push({from:a,to:h,key:`${a.id}->${h.id}`});return l}),mo=e.computed(()=>`${Fe.value.vbX} ${Fe.value.vbY} ${Fe.value.vbW} ${Fe.value.vbH}`);function fo(l){if(p.value.has(l.id)){l.children=[],l.collapsed=!0;return}l.collapsed=!1;for(const a of l.children)fo(a)}function Vt(l){const a=fe(g.value,l);a&&(c.value=l,u.value=a.text,e.nextTick(()=>{const h=document.querySelector(".zm-input");h==null||h.focus(),h==null||h.select()}))}function yn(){if(!c.value)return;const l=fe(g.value,c.value);l&&l.text!==(u.value.trim()||" ")&&(l.text=u.value.trim()||" ",Ie(),r("change",g.value)),c.value=null}function En(){c.value=null}function $t(l){if(i.previewMode)return;const a=fe(g.value,l);a!=null&&a.richContent&&(x.value=l,R.value=a.richContent.raw,e.nextTick(()=>{const h=document.querySelector(".zm-node .zm-rich textarea");h==null||h.focus()}))}function X(){if(!x.value)return;const l=x.value,a=fe(g.value,l),h=R.value;if(a&&a.richContent&&a.richContent.raw!==h)if(a.richContent.kind==="code"){const I=nn(h)||void 0;Te(l,{kind:"code",raw:h,lang:I})}else Te(l,{kind:"table",raw:h});x.value=null}function f(){x.value=null}function O(l){l.key==="Escape"?(l.preventDefault(),f()):l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),X())}function G(l,a){const h=S.value.get(l);!h||h.col!==a?S.value.set(l,{col:a,dir:"asc"}):h.dir==="asc"?S.value.set(l,{col:a,dir:"desc"}):S.value.delete(l)}function ye(l,a){const h=S.value.get(l);return!h||a.length<=1?a:cr(a,h.col,h.dir)}function me(l,a){const h=S.value.get(l);return!h||h.col!==a?"↕":h.dir==="asc"?"▲":"▼"}function Ce(l){const a=l.metaKey||l.ctrlKey;a&&(l.key==="z"||l.key==="Z")&&!l.shiftKey?(l.preventDefault(),ii()):(a&&l.shiftKey&&(l.key==="z"||l.key==="Z")||a&&(l.key==="y"||l.key==="Y")&&!l.shiftKey)&&(l.preventDefault(),ri())}function Be(l){const a=ki(g.value,l,Un);a&&(Ie(),be(),r("change",g.value),e.nextTick(()=>Vt(a.id)))}function Ye(l){if(l===g.value.id){Be(l);return}const a=yi(g.value,l,Un);a&&(Ie(),be(),r("change",g.value),e.nextTick(()=>Vt(a.id)))}function at(l){if(l===g.value.id){Be(l);return}const a=Ll(g.value,l,Un);a&&(Ie(),be(),r("change",g.value),e.nextTick(()=>Vt(a.id)))}function xn(l){if(l===g.value.id)return;const a=Dl(g.value,l);a&&(Ie(),d.value=new Set([a.id]),it(),r("change",g.value),be())}function Ve(l){const a=[],h=new Set;for(const I of l)I!==g.value.id&&(h.has(I)||fe(g.value,I)&&(h.add(I),a.push(I)));return a}function In(l){const a=new Set(l),h=[],I=A=>{a.has(A.id)&&h.push(A.id);for(const $ of A.children)I($)};return I(g.value),h}function On(l){const a=In(Ve(l));if(a.length===0)return;const h=[];for(const I of a){const A=Ei(g.value,I);A&&h.push(A)}h.length!==0&&(L.value={nodes:h,originalIds:new Set(a)},be())}function jr(l){const a=In(Ve(l));if(a.length===0)return;const h=[];for(const I of a){const A=Ei(g.value,I);A&&h.push(A)}if(h.length!==0){Ie();for(const I of a)Pn(g.value,I);d.value=new Set,it(),L.value={nodes:h,originalIds:new Set(a)},be(),r("change",g.value)}}function Kr(l){const a=L.value;if(!a||a.nodes.length===0)return;const h=l??g.value.id,I=fe(g.value,h);if(I){for(const A of a.originalIds){const $=fe(g.value,A);if($&&fe($,h))return}Ie();for(const A of a.nodes){const $=ct(A);Fn($),I.children.push($)}L.value=null,be(),r("change",g.value)}}function ii(){const l=Qe.undo();l&&(g.value=l.data,d.value=new Set(l.selectedIds??[]),it(),be(),r("change",g.value))}function ri(){const l=Qe.redo();l&&(g.value=l.data,d.value=new Set(l.selectedIds??[]),it(),be(),r("change",g.value))}function it(){const l=[];for(const a of d.value){const h=fe(g.value,a);h&&l.push(h)}r("select",l.length>0?l:null)}function ef(l,a){const h=m.value??g.value.id,I=fe(g.value,h);if(!I)return;let A=null;if(a===1){const $=ut(g.value,I.id);if($){const j=$.children.findIndex(ne=>ne.id===I.id);j>=0&&j<$.children.length-1&&(A=$.children[j+1].id)}}else if(a===-1){const $=ut(g.value,I.id);if($){const j=$.children.findIndex(ne=>ne.id===I.id);j>0&&(A=$.children[j-1].id)}}else if(l===1){const $=ut(g.value,I.id);$&&(A=$.id)}else l===-1&&I.children.length>0&&(A=I.children[0].id);A&&(d.value=new Set([A]),it())}function qr(l){if(l!==g.value.id&&Pn(g.value,l)){if(Ie(),d.value.has(l)){const a=new Set(d.value);a.delete(l),d.value=a,it()}be(),r("change",g.value)}}function Yr(l){p.value.has(l)?p.value.delete(l):p.value.add(l),be()}function Xr(l){const a=[{n:g.value,depth:1}];for(;a.length;){const{n:h,depth:I}=a.pop();l(h,I);for(let A=h.children.length-1;A>=0;A--)a.push({n:h.children[A],depth:I+1})}}function tf(){p.value=new Set,Xr(l=>{l.children.length>0&&p.value.add(l.id)}),be()}function Zr(l){p.value=new Set,Xr((a,h)=>{h>l&&a.children.length>0&&p.value.add(a.id)}),be()}function nf(){p.value=new Set,be()}function of(l,a){Ol(g.value,l,a)&&(Ie(),be(),r("change",g.value))}function Jr(l,a,h){return vl(g.value,l,a,h)?(Ie(),be(),r("change",g.value),!0):!1}function rf(l,a){if(l.stopPropagation(),l.shiftKey){const h=new Set(d.value);h.has(a.id)?h.delete(a.id):h.add(a.id),d.value=h}else d.value=new Set([a.id]);it()}function lf(l,a,h){let I=null;for(const A of ot.value){if(A.id===h)continue;const $=A.width/2,j=A.height/2;l>=A.x-$&&l<=A.x+$&&a>=A.y-j&&a<=A.y+j&&(I=A)}return I}function af(l,a){if(i.previewMode||a.isRoot||l.button!==0)return;const h=l.target;if(h!=null&&h.closest(".zm-img-resize-handle"))return;l.stopPropagation();const I=s.value.getBoundingClientRect(),A=a.x*te.scale.value+te.offsetX.value,$=a.y*te.scale.value+te.offsetY.value,j=l.clientX-I.left-A,ne=l.clientY-I.top-$;y.value={srcId:a.id,srcText:a.text,pointerOffsetX:j,pointerOffsetY:ne,currentTargetId:null},w.value=l.clientX-I.left-j,E.value=l.clientY-I.top-ne,document.body.classList.add("is-dragging"),window.addEventListener("pointermove",Qr),window.addEventListener("pointerup",po),window.addEventListener("pointercancel",po)}function Qr(l){const a=y.value;if(!a)return;const h=s.value.getBoundingClientRect();w.value=l.clientX-h.left-a.pointerOffsetX,E.value=l.clientY-h.top-a.pointerOffsetY;const I=(l.clientX-h.left-te.offsetX.value)/te.scale.value,A=(l.clientY-h.top-te.offsetY.value)/te.scale.value,$=lf(I,A,a.srcId);a.currentTargetId=($==null?void 0:$.id)??null}function po(l){const a=y.value;a&&(window.removeEventListener("pointermove",Qr),window.removeEventListener("pointerup",po),window.removeEventListener("pointercancel",po),a.currentTargetId&&(Jr(a.srcId,a.currentTargetId,"child"),d.value=new Set([a.srcId]),it()),y.value=null,w.value=0,E.value=0,document.body.classList.remove("is-dragging"))}function sf(l){const a=l.target;if(!a||a.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(l.button===2){te.startPan(l);return}if(l.button!==0)return;const h=s.value.getBoundingClientRect(),I=(l.clientX-h.left-te.offsetX.value)/te.scale.value,A=(l.clientY-h.top-te.offsetY.value)/te.scale.value;te.startMarquee(I,A,{shift:l.shiftKey})}function cf(l){if(pn){pn=!1;return}const a=l.target;if(!a||a.closest(".zm-node"))return;const h=te.marquee;h.width>=4||h.height>=4||d.value.size>0&&(d.value=new Set,it())}function df(){const l=te.marquee;if(l.width<4&&l.height<4)return;const a=l.x,h=l.y,I=l.x+l.width,A=l.y+l.height,$=[];for(const j of ot.value){const ne=j.width/2,Ne=j.height/2,M=j.x-ne,tt=j.x+ne,rt=j.y-Ne,ge=j.y+Ne;M<=I&&tt>=a&&rt<=A&&ge>=h&&$.push(j.id)}d.value=l.shiftKey?new Set([...d.value,...$]):new Set($),it()}function el(l){return p.value.has(l)}function uf(l){const a=fe(g.value,l.id);return!!a&&a.children.length>0}function li(l){const a=fe(g.value,l);return a?a.children.length:0}function tl(l){if(!fe(g.value,l))return 0;const I=[g.value];for(;I.length;){const A=I.pop(),$=A.children.findIndex(j=>j.id===l);if($>=0)return $;for(const j of A.children)I.push(j)}return 0}function nl(l,a,h,I){if(((I==null?void 0:I._dir)??l._dir)==="down")return a==="out"?{x:l.x,y:l.y+l.height/2}:{x:l.x,y:l.y-l.height/2};let $;a==="in"?$=-l.side:h!==void 0?$=h:$=l.side;const j=a==="in"?l._richInsetX??0:0;return{x:l.x+$*(l.width/2-j),y:l.y}}function At(){const l=Fe.value;te.resetView(l.width,l.height,l.root.y)}function mf(){nt.value=!0,Ie(),be(),e.nextTick(()=>At())}function ai(l){ee.layoutMode!==l&&(ee.layoutMode=l,be(),e.nextTick(()=>At()))}function ol(){return JSON.stringify(g.value,null,2)}function ff(l){const a=fe(g.value,l);return a?!!(a.note&&a.note.text||a.link&&a.link.url||a.image&&a.image.src||a.richContent&&a.richContent.raw):!1}function il(l){try{const a=JSON.parse(l);return!a.id||!Array.isArray(a.children)?!1:(Qe.reset(),g.value=ct(a),d.value=new Set,p.value=new Set,be(),e.nextTick(()=>At()),r("change",g.value),!0)}catch{return!1}}function pf(){const l=document.createElement("input");l.type="file",l.accept="application/json",l.onchange=()=>{var I;const a=(I=l.files)==null?void 0:I[0];if(!a)return;const h=new FileReader;h.onload=()=>{typeof h.result=="string"&&(il(h.result)||alert("导入失败:JSON 格式无效"))},h.readAsText(a)},l.click()}function gf(){const l=new Blob([ol()],{type:"application/json"}),a=URL.createObjectURL(l),h=document.createElement("a");h.href=a,h.download=`${g.value.text||"mindmap"}.json`,h.click(),URL.revokeObjectURL(a)}return o({addChild:l=>Be(l),addSibling:l=>Ye(l),removeNode:l=>qr(l),duplicateNode:l=>xn(l),setNodeText:(l,a)=>of(l,a),moveNode:(l,a,h)=>Jr(l,a,h),lineWidthForDepth:io,endWidthForDepth:Lt,getData:()=>g.value,nodeHasContent:l=>ff(l),getSelectedIds:()=>[...d.value],copyNodes:l=>On(l),cutNodes:l=>jr(l),pasteNodes:l=>Kr(l),setData:l=>{Qe.reset(),g.value=ct(l),d.value=new Set,p.value=new Set,be(),Ie(),e.nextTick(()=>At())},resetView:()=>At(),exportData:ol,importData:il,getMarkdown:()=>Jt(g.value),setMarkdown:(l,a=!0)=>{const h=Zt(l||"");a&&(v.value=!0),H=!a,Qe.reset(),g.value=ct(h),d.value=new Set,p.value=new Set,be(),Ie(),e.nextTick(()=>{H=!1,At()}),r("change",g.value)},setBalanced:l=>{nt.value=l},isBalanced:()=>nt.value,balance:()=>mf(),applyNodeStyle:(l,a)=>ae(l,a),getNodeStyle:l=>W(l),applyNodeImage:(l,a)=>K(l,a),applyNodeImageByUrl:(l,a)=>N(l,a),removeNodeImage:l=>F(l),applyNodeLink:(l,a)=>se(l,a),removeNodeLink:l=>ke(l),applyNodeNote:(l,a)=>Re(l,a),removeNodeNote:l=>Pe(l),applyNodeRichContent:(l,a)=>Te(l,a),undo:()=>ii(),redo:()=>ri(),canUndo:()=>Qe.canUndo(),canRedo:()=>Qe.canRedo(),applySettings:l=>{l.autoBalanceOnChange!==void 0&&(ee.autoBalanceOnChange=l.autoBalanceOnChange),l.lineWidthStart!==void 0&&(ee.lineWidthStart=Math.max(.5,Math.min(20,l.lineWidthStart))),l.lineWidthEnd!==void 0&&(ee.lineWidthEnd=Math.max(.3,Math.min(10,l.lineWidthEnd))),l.rainbowBranch!==void 0&&(ee.rainbowBranch=l.rainbowBranch),l.branchPaletteId!==void 0&&(ee.branchPaletteId=l.branchPaletteId),l.customPalettes!==void 0&&(ee.customPalettes=l.customPalettes),l.lineStyle!==void 0&&(ee.lineStyle=l.lineStyle),l.taperedEdge!==void 0&&(ee.taperedEdge=l.taperedEdge),l.showOrderBadge!==void 0&&(ee.showOrderBadge=l.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:ee.autoBalanceOnChange,lineWidthStart:ee.lineWidthStart,lineWidthEnd:ee.lineWidthEnd,rainbowBranch:ee.rainbowBranch,branchPaletteId:ee.branchPaletteId,customPalettes:ee.customPalettes,lineStyle:ee.lineStyle,layoutMode:ee.layoutMode,taperedEdge:ee.taperedEdge,showOrderBadge:ee.showOrderBadge}),setBranchPalette:l=>{if(!l)return;[...Ct,...ee.customPalettes].find(h=>h.id===l)&&(ee.branchPaletteId=l)},getBranchPalette:()=>ee.branchPaletteId,getBranchPalettes:()=>[...Ct,...ee.customPalettes]}),e.watch(()=>i.data,l=>{g.value=ct(l),be()},{deep:!1}),e.onMounted(()=>{Ie(),e.nextTick(()=>At())}),(l,a)=>{var h,I,A,$,j,ne,Ne;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:et.value.bgColor,fontSize:et.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:s,class:"zm-canvas",onMousedown:sf,onContextmenu:ce,onWheel:a[26]||(a[26]=(...M)=>e.unref(te).onWheel&&e.unref(te).onWheel(...M)),onMouseenter:a[27]||(a[27]=M=>k.value=!0),onMouseleave:a[28]||(a[28]=M=>k.value=!1),onClick:cf},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:Fe.value.vbX*e.unref(te).scale.value+e.unref(te).offsetX.value+"px",top:Fe.value.vbY*e.unref(te).scale.value+e.unref(te).offsetY.value+"px",width:Fe.value.vbW*e.unref(te).scale.value+"px",height:Fe.value.vbH*e.unref(te).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:mo.value,preserveAspectRatio:"xMinYMin meet",width:Fe.value.vbW*e.unref(te).scale.value,height:Fe.value.vbH*e.unref(te).scale.value},[e.createElementVNode("g",rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(uo.value,M=>(e.openBlock(),e.createElementBlock("path",{key:M.key,d:Dt(nl(M.from,"out",M.to.side,M.to),nl(M.to,"in"),io(M.from.depth),Lt(M.to.depth),32,ee.lineStyle,M.to._dir),fill:ao(M.from,M.to),stroke:"none"},null,8,ls))),128))])],8,is))],4),e.unref(te).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(te).marquee.x*e.unref(te).scale.value+e.unref(te).offsetX.value+"px",top:e.unref(te).marquee.y*e.unref(te).scale.value+e.unref(te).offsetY.value+"px",width:e.unref(te).marquee.width*e.unref(te).scale.value+"px",height:e.unref(te).marquee.height*e.unref(te).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:w.value+"px",top:E.value+"px",transform:`scale(${e.unref(te).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(y.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(te).offsetX.value}px, ${e.unref(te).offsetY.value}px) scale(${e.unref(te).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,M=>{var tt,rt;return e.openBlock(),e.createElementBlock("div",{key:M.id,class:e.normalizeClass(["zm-node",{"is-root":M.isRoot,"is-selected":m.value===M.id,"is-selected-secondary":m.value!==M.id&&d.value.has(M.id),"is-editing":c.value===M.id,"has-image":!!M.image,"is-resizing":ze.value===M.id,"is-dragging-source":((tt=y.value)==null?void 0:tt.srcId)===M.id,"is-drop-target":((rt=y.value)==null?void 0:rt.currentTargetId)===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:oi(M),color:lt(M),borderColor:_t(M),fontWeight:so(M),transform:"translate(-50%, -50%)"}),onClick:ge=>rf(ge,M),onPointerdown:ge=>af(ge,M),onDblclick:ge=>{ge.stopPropagation(),t.previewMode||Vt(M.id)},onContextmenu:ge=>V(ge,M),onMouseenter:ge=>{zn(M.id),gn(ge,M)},onMouseleave:ge=>oo(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,ss)):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:a[1]||(a[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ge=>$t(M.id),["stop"]),onMousedown:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[x.value===M.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":a[0]||(a[0]=ge=>R.value=ge),class:"zm-rich-edit",spellcheck:"false",onBlur:X,onKeydown:O},null,544)),[[e.vModelText,R.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[M.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",ds,[e.createElementVNode("code",{innerHTML:e.unref(Bo)(e.unref(Ro)(M.richContent.raw),e.unref(nn)(M.richContent.raw))},null,8,us)])):M.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",ms,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye(M.id,e.unref(sr)(M.richContent.raw)),(ge,ht)=>(e.openBlock(),e.createElementBlock("tr",{key:ht},[ht===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ge,(wn,bt)=>{var vn,Ln,Tt,go,Pt;return e.openBlock(),e.createElementBlock("th",{key:`h${bt}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((vn=S.value.get(M.id))==null?void 0:vn.col)===bt,"is-asc":((Ln=S.value.get(M.id))==null?void 0:Ln.col)===bt&&((Tt=S.value.get(M.id))==null?void 0:Tt.dir)==="asc","is-desc":((go=S.value.get(M.id))==null?void 0:go.col)===bt&&((Pt=S.value.get(M.id))==null?void 0:Pt.dir)==="desc"}]),onClick:e.withModifiers(ho=>G(M.id,bt),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(wn),1),e.createElementVNode("span",ps,e.toDisplayString(me(M.id,bt)),1)],10,fs)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ge,(wn,bt)=>(e.openBlock(),e.createElementBlock("td",{key:`c${bt}`},e.toDisplayString(wn),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,cs)):e.createCommentVNode("",!0),c.value!==M.id?(e.openBlock(),e.createElementBlock("span",gs,[e.createElementVNode("span",hs,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:a[3]||(a[3]=e.withModifiers(()=>{},["stop"])),onMousedown:a[4]||(a[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"link",size:11,stroke:2})],40,bs)):e.createCommentVNode("",!0),M.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:Z(M.note.text),onClick:e.withModifiers(ge=>U(M.id),["stop"]),onMousedown:a[5]||(a[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"note",size:11,stroke:2})],40,ks)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":a[6]||(a[6]=ge=>u.value=ge),autofocus:"",onBlur:a[7]||(a[7]=ge=>yn()),onKeydown:[a[8]||(a[8]=e.withKeys(e.withModifiers(ge=>yn(),["exact"]),["enter"])),a[9]||(a[9]=e.withKeys(e.withModifiers(ge=>yn(),["prevent"]),["tab"])),e.withKeys(En,["esc"]),Ce],onMousedown:a[10]||(a[10]=e.withModifiers(()=>{},["stop"])),onClick:a[11]||(a[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),oe.value?(e.openBlock(),e.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${tl(M.id)+1} 个`},e.toDisplayString(tl(M.id)+1),9,ys)):e.createCommentVNode("",!0),el(M.id)&&li(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:St.value.get(M.id)??"#64748b"}),title:`展开 ${li(M.id)} 个子节点`,onMousedown:a[12]||(a[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>Yr(M.id),["stop"])},e.toDisplayString(li(M.id)),47,Es)):e.createCommentVNode("",!0),uf(M)&&!el(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:St.value.get(M.id)??"#64748b",borderColor:St.value.get(M.id)??"#64748b"}),title:"折叠",onMousedown:a[13]||(a[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>Yr(M.id),["stop"])},[e.createVNode(xe,{name:"minus",size:10,stroke:2.4})],46,xs)):e.createCommentVNode("",!0),M.image&&m.value===M.id&&c.value!==M.id?(e.openBlock(),e.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ge=>Ue(ge,M),["stop"])},null,40,ws)):e.createCommentVNode("",!0),M.image&&m.value===M.id&&c.value!==M.id?(e.openBlock(),e.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:a[14]||(a[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>F(M.id),["stop"])},[e.createVNode(xe,{name:"x",size:9,stroke:2.2})],40,Ns)):e.createCommentVNode("",!0)],46,as)}),128))],4),C.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!C.value.above}]),style:e.normalizeStyle({left:C.value.x+"px",top:C.value.y+"px"})},e.toDisplayString(C.value.text),7)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(Gl,{key:3,x:B.value.x,y:B.value.y,container:s.value,"has-image":!!((h=e.unref(fe)(g.value,B.value.nodeId))!=null&&h.image),"has-link":!!((I=e.unref(fe)(g.value,B.value.nodeId))!=null&&I.link),"has-note":!!((A=e.unref(fe)(g.value,B.value.nodeId))!=null&&A.note),"has-code":((j=($=e.unref(fe)(g.value,B.value.nodeId))==null?void 0:$.richContent)==null?void 0:j.kind)==="code","has-table":((Ne=(ne=e.unref(fe)(g.value,B.value.nodeId))==null?void 0:ne.richContent)==null?void 0:Ne.kind)==="table",onPickImage:mn,onRemoveImage:we,onSetLink:It,onRemoveLink:Q,onEditNote:wt,onRemoveNote:Me,onAddCode:pt,onEditCode:pt,onRemoveCode:qe,onAddTable:gt,onEditTable:gt,onRemoveTable:Nt,onClose:T},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(jl,{key:4,x:z.value.x,y:z.value.y,container:s.value,onOpenSettings:De,onOpenData:Ke,onOpenImport:We,onClose:de},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(ie.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:a[15]||(a[15]=M=>r("canvas-toggle-preview"))},[e.createVNode(xe,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Ss),e.createElementVNode("button",{class:e.normalizeClass(re.value),title:"显示大纲视图",onClick:a[16]||(a[16]=M=>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":k.value}])},[e.createElementVNode("span",Ts,e.toDisplayString(Math.round(e.unref(te).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:a[17]||(a[17]=(...M)=>e.unref(te).zoomIn&&e.unref(te).zoomIn(...M))},[e.createVNode(xe,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:a[18]||(a[18]=(...M)=>e.unref(te).zoomOut&&e.unref(te).zoomOut(...M))},[e.createVNode(xe,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:At},[e.createVNode(xe,{name:"reset"})]),a[32]||(a[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:tf},[e.createVNode(xe,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:a[19]||(a[19]=M=>Zr(1))},[e.createVNode(xe,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:a[20]||(a[20]=M=>Zr(2))},[e.createVNode(xe,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:nf},[e.createVNode(xe,{name:"expand-all"})]),a[33]||(a[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:gf},[e.createVNode(xe,{name:"export"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[29]||(a[29]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:a[21]||(a[21]=M=>m.value&&Be(m.value))},[e.createElementVNode("img",{src:e.unref(ui),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Cs)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:a[22]||(a[22]=M=>m.value&&Ye(m.value))},[e.createElementVNode("img",{src:e.unref(di),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,_s)]),a[30]||(a[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:a[23]||(a[23]=M=>ai("mindmap"))},[e.createVNode(xe,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:a[24]||(a[24]=M=>ai("tree"))},[e.createVNode(xe,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:a[25]||(a[25]=M=>ai("org"))},[e.createVNode(xe,{name:"org"})],2),a[31]||(a[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:pf},[e.createVNode(xe,{name:"import"})])],64))],2)],544)],4)}}}),As={class:"zm-outline-root"},Ms={class:"zm-outline-actions"},Rs={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"},Is={class:"zm-outline"},Os=["onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],vs=["title","onClick"],Ls={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ds={key:0,points:"6 9 12 15 18 9"},Vs={key:1,points:"9 6 15 12 9 18"},$s={key:1,class:"zm-outline-dot"},Ps={class:"zm-outline-index"},Fs={key:3,class:"zm-outline-text"},Us=["onClick"],Hs=["src"],Ws=["onClick"],Gs=["src"],js=["title","onClick"],Ks={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},qs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ys={key:1,d:"M5 12 L10 17 L19 7"},zo=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 W=[],K=(F,N,P)=>{const D=F.children.length>0,Y=n.collapsedIds.has(F.id);W.push({id:F.id,text:F.text||"(无标题)",depth:N,siblingIndex:P,hasChildren:D,collapsed:Y,node:F}),D&&!Y&&F.children.forEach((se,ke)=>K(se,N+1,ke))};return K(n.data,0,0),W}),s=e.ref(null),c=e.ref("");let u=null;function d(W){n.readonly||(s.value=W.id,c.value=W.text,e.nextTick(()=>{u=document.querySelector(".zm-outline-input"),u==null||u.focus(),u==null||u.select()}))}function m(){s.value!=null&&(i("edit",{id:s.value,text:c.value.trim()||"(无标题)"}),p())}function p(){s.value=null,c.value="",u=null}function k(W){W.key==="Enter"?(W.preventDefault(),m()):W.key==="Escape"&&(W.preventDefault(),p())}e.onBeforeUnmount(p);const y=e.ref(null),w=e.ref(null),E=e.ref(null);function L(W,K){if(n.readonly){W.preventDefault();return}y.value={id:K.id,text:K.text},W.dataTransfer&&(W.dataTransfer.effectAllowed="move",W.dataTransfer.setData("text/plain",K.id))}function C(){y.value=null,w.value=null,E.value=null}function x(W,K){if(!y.value)return;W.preventDefault(),W.dataTransfer&&(W.dataTransfer.dropEffect="move");const F=g(W);w.value=K.id,E.value=F}function R(W){w.value===W.id&&(w.value=null,E.value=null)}function S(W,K){W.preventDefault();const F=y.value;if(!F)return;const N=g(W);F.id!==K.id&&i("move",{srcId:F.id,targetId:K.id,position:N}),C()}function g(W,K){const N=W.currentTarget.getBoundingClientRect(),P=W.clientY-N.top,D=N.height;return P<D*.3?"before":P>D*.7?"after":"child"}const _=e.ref(null);let b=null;async function v(W){try{return await navigator.clipboard.writeText(W),!0}catch{const K=document.createElement("textarea");K.value=W,document.body.appendChild(K),K.select();let F=!1;try{F=document.execCommand("copy")}finally{document.body.removeChild(K)}return F}}async function H(W,K,F){W.stopPropagation(),await v(K)&&(_.value=F,b&&clearTimeout(b),b=setTimeout(()=>_.value=null,1200))}const oe=e.computed(()=>{const W=[],K=(F,N)=>{const P=" ".repeat(N),D=N===0?"":"- ";W.push(P+D+(F.text||""));for(const Y of F.children)K(Y,N+1)};return K(n.data,0),W.join(`
23
- `)}),q=e.ref(!1);let J=null;async function ae(){await v(oe.value)&&(q.value=!0,J&&clearTimeout(J),J=setTimeout(()=>q.value=!1,1200))}return(W,K)=>(e.openBlock(),e.createElementBlock("div",As,[e.createElementVNode("div",Ms,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":q.value}]),title:"复制完整大纲为纯文本",onClick:ae},[(e.openBlock(),e.createElementBlock("svg",Rs,[q.value?(e.openBlock(),e.createElementBlock("path",zs)):(e.openBlock(),e.createElementBlock("rect",Bs)),K[2]||(K[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(q.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Is,[(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":s.value===F.id,"is-drag-over-before":w.value===F.id&&E.value==="before","is-drag-over-after":w.value===F.id&&E.value==="after","is-drag-over-child":w.value===F.id&&E.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+F.depth*16+"px"}),draggable:"true",onClick:N=>i("select",F.node),onDblclick:N=>d(F),onDragstart:N=>L(N,F),onDragend:C,onDragover:N=>x(N,F),onDragleave:()=>R(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",Ls,[F.collapsed?(e.openBlock(),e.createElementBlock("polyline",Vs)):(e.openBlock(),e.createElementBlock("polyline",Ds))]))],8,vs)):(e.openBlock(),e.createElementBlock("span",$s)),e.createElementVNode("span",Ps,e.toDisplayString(F.siblingIndex+1)+".",1),s.value===F.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":K[0]||(K[0]=N=>c.value=N),class:"zm-outline-input",onBlur:m,onKeydown:k,onClick:K[1]||(K[1]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,c.value]]):(e.openBlock(),e.createElementBlock("span",Fs,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(di),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Hs)],8,Us)),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(ui),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Gs)],8,Ws)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":_.value===F.id}]),title:_.value===F.id?"已复制":"复制节点文本",onClick:N=>H(N,F.text,F.id)},[(e.openBlock(),e.createElementBlock("svg",Ks,[_.value!==F.id?(e.openBlock(),e.createElementBlock("rect",qs)):(e.openBlock(),e.createElementBlock("path",Ys)),K[3]||(K[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,js)],46,Os))),128))])]))}}),Xs=["aria-hidden"],Zs=["aria-hidden"],Js={key:0,class:"zm-drawer-header"},Qs={key:0,class:"zm-drawer-title"},ec={class:"zm-drawer-body"},tc=["aria-hidden"],nc={key:0,class:"zm-drawer-header"},oc={key:0,class:"zm-drawer-title"},ic={class:"zm-drawer-body"},rn=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(s,c)=>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:c[0]||(c[0]=u=>t.closeOnBackdrop&&r())},null,8,Xs)):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||s.$slots.header?(e.openBlock(),e.createElementBlock("div",Js,[t.title?(e.openBlock(),e.createElementBlock("h3",Qs,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...c[1]||(c[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",ec,[e.renderSlot(s.$slots,"default")])],14,Zs)):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||s.$slots.header?(e.openBlock(),e.createElementBlock("div",nc,[t.title?(e.openBlock(),e.createElementBlock("h3",oc,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...c[2]||(c[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",ic,[e.renderSlot(s.$slots,"default")])],14,tc)):e.createCommentVNode("",!0)]),_:3}))}}),rc={key:0,class:"zm-jtv-root"},lc={key:0,class:"zm-jtv-key"},ac={key:1,class:"zm-jtv-colon"},sc={key:2,class:"zm-jtv-key zm-jtv-bracket"},cc={key:3,class:"zm-jtv-size"},dc={key:4,class:"zm-jtv-bracket"},uc={key:5,class:"zm-jtv-brace"},mc={key:0,class:"zm-jtv-children"},fc={class:"zm-jtv-key"},pc={key:0,class:"zm-jtv-key"},gc=["src","alt"],hc=["href"],bc=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 s=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),d=e.computed(()=>o.collapsedPaths.has(u.value));function m(R,S,g){R!=="<root>"&&(g<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(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function k(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 E(R,S){return!o.query||w(R)?!0:S===null||typeof S!="object"?y(S):!0}function L(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 C(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 _,b,v,H,oe,q;const g=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,J=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:J.key,class:"zm-jtv-row"},[e.createVNode(g,{"key-name":J.key,value:J.value,path:k(J.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,E(J.key,J.value)]])),128))])):i.value||r.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:p},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",lc,e.toDisplayString(t.keyName),1)),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ac,":")),r.value?(e.openBlock(),e.createElementBlock("span",sc,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",cc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),d.value&&r.value?(e.openBlock(),e.createElementBlock("span",dc,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",uc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",mc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,J=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:J.key,class:"zm-jtv-row"},[e.createVNode(g,{"key-name":J.key,value:J.value,path:k(J.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,E(J.key,J.value)]])),128))])),!d.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),!d.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",fc,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",pc,[e.createElementVNode("span",null,e.toDisplayString((_=x(t.keyName))==null?void 0:_.before),1),e.createElementVNode("mark",null,e.toDisplayString((b=x(t.keyName))==null?void 0:b.match),1),e.createElementVNode("span",null,e.toDisplayString((v=x(t.keyName))==null?void 0:v.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[x(L(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((H=x(L(t.value)))==null?void 0:H.before),1),e.createElementVNode("mark",null,e.toDisplayString((oe=x(L(t.value)))==null?void 0:oe.match),1),e.createElementVNode("span",null,e.toDisplayString((q=x(L(t.value)))==null?void 0:q.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(L(t.value)),1)],64))],2),C(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,gc),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,hc)])):e.createCommentVNode("",!0)],4))}}}),kc={class:"zm-data-panel"},yc={class:"zm-data-header"},Ec={class:"zm-data-title"},xc={class:"zm-data-title-meta"},wc={class:"zm-data-toolbar"},Nc=["title"],Sc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Tc={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"},Cc={key:0,class:"zm-data-paste"},_c={class:"zm-data-tabs"},Ac=["placeholder"],Mc={key:0,class:"zm-data-error"},Rc={class:"zm-data-paste-actions"},Bc=["disabled"],zc={class:"zm-data-tree"},Io=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)),s=e.ref(""),c=e.ref(null),u=e.ref(!1),d=e.ref("json"),m=e.ref("idle"),p=e.ref(new Set),k=e.ref("");e.watch(()=>n.pendingMode,S=>{S&&(u.value=!0,d.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"}),g=URL.createObjectURL(S),_=document.createElement("a");_.href=g,_.download=`${n.data.text||"mindmap"}.json`,_.click(),URL.revokeObjectURL(g)}function E(){c.value=null;const S=s.value.trim();if(S){if(d.value==="markdown"||d.value==="txt"){try{const g=Zt(S);i("import",g),s.value="",u.value=!1}catch(g){c.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+g.message}return}try{const g=JSON.parse(S);if(!g.id||!Array.isArray(g.children)){c.value="JSON 缺少 id 或 children 字段";return}i("import",g),s.value="",u.value=!1}catch(g){c.value="JSON 解析失败:"+g.message}}}function L(S){return 1+S.children.reduce((g,_)=>g+L(_),0)}const C=e.computed(()=>L(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 b;const g=(b=S.files)==null?void 0:b[0];if(!g)return;const _=new FileReader;_.onload=()=>{typeof _.result=="string"&&(s.value=_.result,E())},_.readAsText(g)},S.click()}return(S,g)=>(e.openBlock(),e.createElementBlock("div",kc,[e.createElementVNode("div",yc,[e.createElementVNode("div",Ec,[g[8]||(g[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",xc,e.toDisplayString(C.value)+" 节点 · "+e.toDisplayString(x.value)+" chars",1)])]),e.createElementVNode("div",wc,[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",Sc,[...g[9]||(g[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",Tc,[...g[10]||(g[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),g[11]||(g[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,Nc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:w},[...g[12]||(g[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},[...g[13]||(g[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:g[0]||(g[0]=_=>u.value=!u.value)},[...g[14]||(g[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),g[16]||(g[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":k.value.length>0}])},[g[15]||(g[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":g[1]||(g[1]=_=>k.value=_),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,k.value]]),k.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:g[2]||(g[2]=_=>k.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",Cc,[e.createElementVNode("div",_c,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:g[3]||(g[3]=_=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:g[4]||(g[4]=_=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":g[5]||(g[5]=_=>s.value=_),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Ac),[[e.vModelText,s.value]]),c.value?(e.openBlock(),e.createElementBlock("div",Mc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Rc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!s.value,onClick:E},"应用",8,Bc),e.createElementVNode("button",{class:"zm-data-btn",onClick:g[6]||(g[6]=_=>{s.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:g[7]||(g[7]=_=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",zc,[e.createVNode(bc,{value:t.data,query:k.value,"collapsed-paths":p.value},null,8,["value","query","collapsed-paths"])]),g[17]||(g[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))]))}}),Ic={class:"zm-md-panel"},Oc={key:0,class:"zm-md-error"},vc={class:"zm-md-split"},Lc={class:"zm-md-edit"},Dc={class:"zm-md-preview"},Vc={class:"zm-md-preview-body"},$c={class:"zm-md-footer"},Pc=["disabled"],Fc=`# flow-mindmap 思维导图
22
+ | a | b | c |`);if(S===null)return;const L=S.trim();if(!L){Ne(l,null);return}Ne(l,{kind:"table",raw:L})}function jt(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&Ne(l,null)}function U(l){r.previewMode||i("edit-note",l)}function Z(l,a=60){const f=l.replace(/\s+/g," ").trim();return f.length<=a?f||"点击编辑笔记":f.slice(0,a)+"…"}function se(l){var S;if(r.previewMode||c.value)return;const a=l.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable))return;const f=g.value;if(!f)return;const A=(S=l.clipboardData)==null?void 0:S.items;if(A)for(let L=0;L<A.length;L++){const M=A[L];if(M.kind==="file"&&M.type.startsWith("image/")){const G=M.getAsFile();if(!G)continue;l.preventDefault();const oe=le(m.value,f);if(oe!=null&&oe.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;P(G,pe=>ie(f,pe));return}}}e.onMounted(()=>{window.addEventListener("paste",se),window.addEventListener("keydown",ye),he()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",se),window.removeEventListener("keydown",ye)});function ye(l){if((l.metaKey||l.ctrlKey)&&(l.key==="f"||l.key==="F")){const f=l.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;l.preventDefault(),i("canvas-outline")}}const Me=e.ref(null),Qe=e.computed(()=>{var l;return((l=Me.value)==null?void 0:l.nodeId)??null});function pt(l,a){if(!a.image)return;l.preventDefault(),l.stopPropagation();const f=a.image.naturalW||a.image.width,A=a.image.naturalH||a.image.height,S=A>0?A/f:1;Me.value={nodeId:a.id,startX:l.clientX,startY:l.clientY,startW:a.image.width,startH:a.image.height,naturalW:f,naturalH:A,ratio:S,pendingW:a.image.width,pendingH:a.image.height},window.addEventListener("mousemove",gn),window.addEventListener("mouseup",fo)}function gn(l){var oe,pe;const a=Me.value;if(!a)return;const f=J.scale.value||1,A=l.clientX-a.startX,S=F(a.startW+A/f,Cn,Hn),L=F(S*a.ratio,Cn,Hn);a.pendingW=S,a.pendingH=L;const M=(oe=s.value)==null?void 0:oe.querySelector(`[data-node-id="${a.nodeId}"] .zm-node-img`);M&&(M.style.width=`${S}px`,M.style.height=`${L}px`);const G=(pe=s.value)==null?void 0:pe.querySelector(`[data-node-id="${a.nodeId}"]`);G&&(G.style.minWidth=`${Math.max(80,Math.ceil(S+28))}px`,G.style.height=`${Math.ceil(L+8+30)}px`)}function fo(){const l=Me.value;if(window.removeEventListener("mousemove",gn),window.removeEventListener("mouseup",fo),Me.value=null,!l)return;const a=le(m.value,l.nodeId);!a||!a.image||(ie(l.nodeId,{src:a.image.src,naturalW:a.image.naturalW,naturalH:a.image.naturalH,width:l.pendingW,height:l.pendingH}),d.value=new Set([l.nodeId]),ut(),Bn=!0)}const Zn=e.ref(null);let Bn=!1;function qo(l){Zn.value=l}function Jn(l){Zn.value===l&&(Zn.value=null),B.value&&(B.value=null)}function Qn(l,a){var Et;if(!a.text||a.text.length<14)return;const A=l.currentTarget.getBoundingClientRect(),S=(Et=s.value)==null?void 0:Et.getBoundingClientRect();if(!S)return;const L=10,M=240,G=A.top-S.top>60,oe=A.left-S.left+A.width/2,pe=L+M/2,Ve=S.width-M/2-L,R=Math.max(pe,Math.min(oe,Ve)),Ye=G?A.top-S.top-8:A.bottom-S.top+8;B.value={text:a.text,x:R,y:Ye,above:G}}const gt=e.ref(0),Kt=e.ref(!1),_t=Ia(100);function Ce(){_t.record({data:m.value,selectedIds:[...d.value]})}function he(){b.value=new Set(b.value),gt.value++,e.nextTick().then(()=>e.nextTick()).then(()=>mo()).then(()=>{gt.value++})}function mo(){const l=document.querySelectorAll(".zm-rich"),a={},f={};l.forEach(A=>{let S=A,L=null;for(;S&&!L;)L=S.getAttribute("data-node-id"),S=S.parentElement;if(!L)return;const M=A.offsetHeight,G=A.scrollWidth,oe=Math.round(M*2)/2,pe=Math.round(G*2)/2;a[L]=oe,f[L]=pe,v.value[L],x.value[L]}),v.value=a,x.value=f}const lt=e.computed(()=>{var l,a,f,A,S,L,M,G,oe,pe;return{rootBg:((l=r.theme)==null?void 0:l.rootBg)??"#1f2937",rootText:((a=r.theme)==null?void 0:a.rootText)??"#ffffff",branchBg:((f=r.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((A=r.theme)==null?void 0:A.branchText)??"#1f2937",lineColor:((S=r.theme)==null?void 0:S.lineColor)??"#94a3b8",bgColor:((L=r.theme)==null?void 0:L.bgColor)??"#f8fafc",fontSize:((M=r.theme)==null?void 0:M.fontSize)??14,lineWidthStart:((G=r.theme)==null?void 0:G.lineWidthStart)??2.2,lineWidthEnd:((oe=r.theme)==null?void 0:oe.lineWidthEnd)??.8,rainbowBranch:((pe=r.theme)==null?void 0:pe.rainbowBranch)??!1}}),po=e.computed(()=>Q.canvasBg||lt.value.bgColor),Q=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0});function go(l){return Q.taperedEdge?De(l):Qt(l)}function ho(l){return Q.taperedEdge?Q.lineWidthEnd:Qt(l)}function De(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 Qt(l){if(l<=0)return Q.lineWidthStart;if(l>=3)return Q.lineWidthEnd;const a=l/3;return Q.lineWidthStart+(Q.lineWidthEnd-Q.lineWidthStart)*a}function Pr(l,a,f,A){const S=1-l,L=S*S*S*a.x+3*S*S*l*f.x1+3*S*l*l*f.x2+l*l*l*A.x,M=S*S*S*a.y+3*S*S*l*f.y1+3*S*l*l*f.y2+l*l*l*A.y;return{x:L,y:M}}function bo(l,a,f,A,S=32,L="curve",M="right"){if(L==="curve"){let kt;if(M==="right"||M==="left"){const Oe=Math.abs(a.x-l.x)*.45,Pt=M==="right"?1:-1;kt={x1:l.x+Pt*Oe,y1:l.y,x2:a.x-Pt*Oe,y2:a.y}}else{const Oe=Math.abs(a.y-l.y)*.45;kt={x1:l.x,y1:l.y+Oe,x2:a.x,y2:a.y-Oe}}const qt=Ee=>{const Oe=1-Ee,Pt=-3*Oe*Oe*l.x+3*(Oe*Oe-2*Oe*Ee)*kt.x1+3*(2*Oe*Ee-Ee*Ee)*kt.x2+3*Ee*Ee*a.x,sn=-3*Oe*Oe*l.y+3*(Oe*Oe-2*Oe*Ee)*kt.y1+3*(2*Oe*Ee-Ee*Ee)*kt.y2+3*Ee*Ee*a.y;return{dx:Pt,dy:sn}},Vt=[],yn=[];for(let Ee=0;Ee<=S;Ee++){const Oe=Ee/S,Pt=Ee===0?l:Ee===S?a:Pr(Oe,l,kt,a),sn=qt(Oe);let to=Math.hypot(sn.dx,sn.dy);to<1e-6&&(to=1);const xt=-sn.dy/to,qe=sn.dx/to,Xe=(f+(A-f)*Oe)/2;Vt.push({x:Pt.x+xt*Xe,y:Pt.y+qe*Xe}),yn.push({x:Pt.x-xt*Xe,y:Pt.y-qe*Xe})}let $t=`M ${Vt[0].x.toFixed(2)} ${Vt[0].y.toFixed(2)}`;for(let Ee=1;Ee<=S;Ee++)$t+=` L ${Vt[Ee].x.toFixed(2)} ${Vt[Ee].y.toFixed(2)}`;for(let Ee=S;Ee>=0;Ee--)$t+=` L ${yn[Ee].x.toFixed(2)} ${yn[Ee].y.toFixed(2)}`;return $t+=" Z",$t}const G=a.x-l.x,oe=a.y-l.y;let pe=Math.hypot(G,oe);pe<1e-6&&(pe=1);const Ve=-oe/pe,R=G/pe,Ye=f/2,Et=A/2,ue={x:l.x+Ve*Ye,y:l.y+R*Ye},ft={x:l.x-Ve*Ye,y:l.y-R*Ye},an={x:a.x-Ve*Et,y:a.y-R*Et},at={x:a.x+Ve*Et,y:a.y+R*Et};return`M ${ue.x.toFixed(2)} ${ue.y.toFixed(2)} L ${at.x.toFixed(2)} ${at.y.toFixed(2)} L ${an.x.toFixed(2)} ${an.y.toFixed(2)} L ${ft.x.toFixed(2)} ${ft.y.toFixed(2)} Z`}const hn=e.computed(()=>et.value.root.children),Xo=Jt[0].colors,ko=e.computed(()=>ya(Q.branchPaletteId,Q.customPalettes)),en=e.computed(()=>{const l=new Map;if(!Q.rainbowBranch)return l;const a=r.lineColors,f=a&&a.length>0?a:ko.value.colors.length>0?ko.value.colors:Xo;for(let S=0;S<hn.value.length;S++){const L=hn.value[S];l.set(L.id,f[S%f.length])}const A=(S,L)=>{l.set(S.id,L);for(const M of S.children)A(M,L)};for(let S=0;S<hn.value.length;S++){const L=hn.value[S];A(L,f[S%f.length])}return l});function ht(l,a){return Q.rainbowBranch?en.value.get(a.id)??lt.value.lineColor:lt.value.lineColor}function Yt(l){const a=ee(l.id);if(a.bg)return a.bg;if(l.isRoot)return lt.value.rootBg;if(Q.rainbowBranch){const f=en.value.get(l.id);if(f)return bn(f,.18)}return lt.value.branchBg}function tn(l){const a=ee(l.id);if(a.textColor)return a.textColor;if(l.isRoot)return lt.value.rootText;if(Q.rainbowBranch){const f=en.value.get(l.id);if(f)return In(f,.55)}return lt.value.branchText}function nn(l){const a=ee(l.id);if(a.borderColor)return a.borderColor;if(l.isRoot)return lt.value.rootBg;if(Q.rainbowBranch){const f=en.value.get(l.id);if(f)return In(f,.3)}return lt.value.lineColor}function eo(l){return ee(l.id).fontWeight??(l.isRoot?600:400)}function zn(l){return ee(l.id).fontSize??lt.value.fontSize}function bn(l,a){const f=l.replace("#",""),A=f.length===6?f:f.split("").map(G=>G+G).join(""),S=parseInt(A.slice(0,2),16),L=parseInt(A.slice(2,4),16),M=parseInt(A.slice(4,6),16);return`rgba(${S}, ${L}, ${M}, ${a})`}function In(l,a){const f=l.replace("#",""),A=f.length===6?f:f.split("").map(G=>G+G).join(""),S=Math.round(parseInt(A.slice(0,2),16)*(1-a)),L=Math.round(parseInt(A.slice(2,4),16)*(1-a)),M=Math.round(parseInt(A.slice(4,6),16)*(1-a));return`rgb(${S}, ${L}, ${M})`}const J=va({getContainer:()=>s.value});J.setOnMarqueeEnd(Ep),za({isEditing:()=>c.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>g.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:on,onAddSibling:Fe,onAddSiblingBefore:Jo,onRemove:Vl,onStartEdit:Mt,onClearSelection:()=>{d.value=new Set,ut()},onDuplicate:xo,onCopy:Ol,onCut:Ll,onPaste:Dl,hasClipboard:()=>!!$.value&&$.value.nodes.length>0,onUndo:Fr,onRedo:Ur,onNavigate:up,onSelectRoot:()=>{d.value=new Set([m.value.id]),ut()}});const et=e.computed(()=>{const l=Ct(m.value);return On(l),ga(l,{mode:Q.layoutMode,baseFontSize:lt.value.fontSize,richHeights:v.value,richWidths:x.value})}),yo=e.ref([]),kn=e.computed(()=>(gt.value,yo.value));e.watch(et,l=>{const a=[],f=A=>{a.push(A);for(const S of A.children)f(S)};f(l.root),yo.value=a},{immediate:!0});const Eo=e.computed(()=>{const l=[];for(const a of kn.value)for(const f of a.children)l.push({from:a,to:f,key:`${a.id}->${f.id}`});return l}),Zo=e.computed(()=>`${et.value.vbX} ${et.value.vbY} ${et.value.vbW} ${et.value.vbH}`);function On(l){if(b.value.has(l.id)){l.children=[],l.collapsed=!0;return}l.collapsed=!1;for(const a of l.children)On(a)}function Mt(l){const a=le(m.value,l);a&&(c.value=l,u.value=a.text,e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select()}))}function X(){if(!c.value)return;const l=le(m.value,c.value);l&&l.text!==(u.value.trim()||" ")&&(l.text=u.value.trim()||" ",Ce(),i("change",m.value)),c.value=null}function h(){c.value=null}function I(l){if(r.previewMode)return;const a=le(m.value,l);a!=null&&a.richContent&&(T.value=l,E.value=a.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function H(){if(!T.value)return;const l=T.value,a=le(m.value,l),f=E.value;if(a&&a.richContent&&a.richContent.raw!==f)if(a.richContent.kind==="code"){const A=Tn(f)||void 0;Ne(l,{kind:"code",raw:f,lang:A})}else Ne(l,{kind:"table",raw:f});T.value=null}function Se(){T.value=null}function me(l){l.key==="Escape"?(l.preventDefault(),Se()):l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),H())}function Ae(l,a){const f=k.value.get(l);!f||f.col!==a?k.value.set(l,{col:a,dir:"asc"}):f.dir==="asc"?k.value.set(l,{col:a,dir:"desc"}):k.value.delete(l)}function We(l,a){const f=k.value.get(l);return!f||a.length<=1?a:qi(a,f.col,f.dir)}function bt(l,a){const f=k.value.get(l);return!f||f.col!==a?"↕":f.dir==="asc"?"▲":"▼"}function yt(l){const a=l.metaKey||l.ctrlKey;a&&(l.key==="z"||l.key==="Z")&&!l.shiftKey?(l.preventDefault(),Fr()):(a&&l.shiftKey&&(l.key==="z"||l.key==="Z")||a&&(l.key==="y"||l.key==="Y")&&!l.shiftKey)&&(l.preventDefault(),Ur())}function on(l){const a=ri(m.value,l,vo);a&&(Ce(),he(),i("change",m.value),e.nextTick(()=>Mt(a.id)))}function Fe(l){if(l===m.value.id){on(l);return}const a=ii(m.value,l,vo);a&&(Ce(),he(),i("change",m.value),e.nextTick(()=>Mt(a.id)))}function Jo(l){if(l===m.value.id){on(l);return}const a=Ca(m.value,l,vo);a&&(Ce(),he(),i("change",m.value),e.nextTick(()=>Mt(a.id)))}function xo(l){if(l===m.value.id)return;const a=Aa(m.value,l);a&&(Ce(),d.value=new Set([a.id]),ut(),i("change",m.value),he())}function zl(l){const a=[],f=new Set;for(const A of l)A!==m.value.id&&(f.has(A)||le(m.value,A)&&(f.add(A),a.push(A)));return a}function Il(l){const a=new Set(l),f=[],A=S=>{a.has(S.id)&&f.push(S.id);for(const L of S.children)A(L)};return A(m.value),f}function Ol(l){const a=Il(zl(l));if(a.length===0)return;const f=[];for(const A of a){const S=li(m.value,A);S&&f.push(S)}f.length!==0&&($.value={nodes:f,originalIds:new Set(a)},he())}function Ll(l){const a=Il(zl(l));if(a.length===0)return;const f=[];for(const A of a){const S=li(m.value,A);S&&f.push(S)}if(f.length!==0){Ce();for(const A of a)Mo(m.value,A);d.value=new Set,ut(),$.value={nodes:f,originalIds:new Set(a)},he(),i("change",m.value)}}function Dl(l){const a=$.value;if(!a||a.nodes.length===0)return;const f=l??m.value.id,A=le(m.value,f);if(A){for(const S of a.originalIds){const L=le(m.value,S);if(L&&le(L,f))return}Ce();for(const S of a.nodes){const L=Ct(S);Ro(L),A.children.push(L)}$.value=null,he(),i("change",m.value)}}function Fr(){const l=_t.undo();l&&(m.value=l.data,d.value=new Set(l.selectedIds??[]),ut(),he(),i("change",m.value))}function Ur(){const l=_t.redo();l&&(m.value=l.data,d.value=new Set(l.selectedIds??[]),ut(),he(),i("change",m.value))}function ut(){const l=[];for(const a of d.value){const f=le(m.value,a);f&&l.push(f)}i("select",l.length>0?l:null)}function up(l,a){const f=g.value??m.value.id,A=le(m.value,f);if(!A)return;let S=null;if(a===1){const L=Bt(m.value,A.id);if(L){const M=L.children.findIndex(G=>G.id===A.id);M>=0&&M<L.children.length-1&&(S=L.children[M+1].id)}}else if(a===-1){const L=Bt(m.value,A.id);if(L){const M=L.children.findIndex(G=>G.id===A.id);M>0&&(S=L.children[M-1].id)}}else if(l===1){const L=Bt(m.value,A.id);L&&(S=L.id)}else l===-1&&A.children.length>0&&(S=A.children[0].id);S&&(d.value=new Set([S]),ut())}function Vl(l){if(l!==m.value.id&&Mo(m.value,l)){if(Ce(),d.value.has(l)){const a=new Set(d.value);a.delete(l),d.value=a,ut()}he(),i("change",m.value)}}function $l(l){b.value.has(l)?b.value.delete(l):b.value.add(l),he()}function Pl(l){const a=[{n:m.value,depth:1}];for(;a.length;){const{n:f,depth:A}=a.pop();l(f,A);for(let S=f.children.length-1;S>=0;S--)a.push({n:f.children[S],depth:A+1})}}function fp(){b.value=new Set,Pl(l=>{l.children.length>0&&b.value.add(l.id)}),he()}function Fl(l){b.value=new Set,Pl((a,f)=>{f>l&&a.children.length>0&&b.value.add(a.id)}),he()}function mp(){b.value=new Set,he()}function pp(l,a){Sa(m.value,l,a)&&(Ce(),he(),i("change",m.value))}function Ul(l,a,f){return Ta(m.value,l,a,f)?(Ce(),he(),i("change",m.value),!0):!1}function gp(l,a){if(l.stopPropagation(),l.shiftKey){const f=new Set(d.value);f.has(a.id)?f.delete(a.id):f.add(a.id),d.value=f}else d.value=new Set([a.id]);ut()}function hp(l,a,f){let A=null;for(const S of kn.value){if(S.id===f)continue;const L=S.width/2,M=S.height/2;l>=S.x-L&&l<=S.x+L&&a>=S.y-M&&a<=S.y+M&&(A=S)}return A}let Dt=null;function bp(l,a){if(r.previewMode||a.isRoot||l.button!==0)return;const f=l.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;l.stopPropagation();const A=s.value.getBoundingClientRect(),S=a.x*J.scale.value+J.offsetX.value,L=a.y*J.scale.value+J.offsetY.value,M=l.clientX-A.left-S,G=l.clientY-A.top-L;Dt={srcId:a.id,srcText:a.text,pointerOffsetX:M,pointerOffsetY:G,startX:l.clientX,startY:l.clientY},window.addEventListener("pointermove",Hl),window.addEventListener("pointerup",Qo),window.addEventListener("pointercancel",Qo)}function Hl(l){if(Dt){const M=l.clientX-Dt.startX,G=l.clientY-Dt.startY;if(Math.abs(M)<=Xi&&Math.abs(G)<=Xi)return;N.value={srcId:Dt.srcId,srcText:Dt.srcText,pointerOffsetX:Dt.pointerOffsetX,pointerOffsetY:Dt.pointerOffsetY,currentTargetId:null},document.body.classList.add("is-dragging"),Dt=null}const a=N.value;if(!a)return;const f=s.value.getBoundingClientRect();V.value=l.clientX-f.left-a.pointerOffsetX,_.value=l.clientY-f.top-a.pointerOffsetY;const A=(l.clientX-f.left-J.offsetX.value)/J.scale.value,S=(l.clientY-f.top-J.offsetY.value)/J.scale.value,L=hp(A,S,a.srcId);a.currentTargetId=(L==null?void 0:L.id)??null}function Qo(l){if(window.removeEventListener("pointermove",Hl),window.removeEventListener("pointerup",Qo),window.removeEventListener("pointercancel",Qo),Dt){Dt=null;return}const a=N.value;a&&(a.currentTargetId&&(Ul(a.srcId,a.currentTargetId,"child"),d.value=new Set([a.srcId]),ut()),N.value=null,V.value=0,_.value=0,document.body.classList.remove("is-dragging"))}let er=!1;function kp(l){const a=l.target;if(!a||a.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(l.button===2){er=!0,J.startPan(l);return}if(er=!1,l.button!==0)return;const f=s.value.getBoundingClientRect(),A=(l.clientX-f.left-J.offsetX.value)/J.scale.value,S=(l.clientY-f.top-J.offsetY.value)/J.scale.value;J.startMarquee(A,S,{shift:l.shiftKey})}function yp(l){if(Bn){Bn=!1;return}const a=l.target;if(!a||a.closest(".zm-node"))return;const f=J.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,ut())}function Ep(){const l=J.marquee;if(l.width<4&&l.height<4)return;const a=l.x,f=l.y,A=l.x+l.width,S=l.y+l.height,L=[];for(const M of kn.value){const G=M.width/2,oe=M.height/2,pe=M.x-G,Ve=M.x+G,R=M.y-oe,Ye=M.y+oe;pe<=A&&Ve>=a&&R<=S&&Ye>=f&&L.push(M.id)}d.value=l.shiftKey?new Set([...d.value,...L]):new Set(L),ut()}function Wl(l){return b.value.has(l)}function xp(l){const a=le(m.value,l.id);return!!a&&a.children.length>0}function Hr(l){const a=le(m.value,l);return a?a.children.length:0}function Gl(l){if(!le(m.value,l))return 0;const A=[m.value];for(;A.length;){const S=A.pop(),L=S.children.findIndex(M=>M.id===l);if(L>=0)return L;for(const M of S.children)A.push(M)}return 0}function tr(l,a,f,A){if(((A==null?void 0:A._dir)??l._dir)==="down")return a==="out"?{x:l.x,y:l.y+l.height/2}:{x:l.x,y:l.y-l.height/2};let L;a==="in"?L=-l.side:f!==void 0?L=f:L=l.side;const M=a==="in"?l._richInsetX??0:0;return{x:l.x+L*(l.width/2-M),y:l.y}}function rn(){const l=et.value;J.resetView(l.width,l.height,l.root.y)}function wp(){Kt.value=!0,Ce(),he(),e.nextTick(()=>rn())}function Wr(l){Q.layoutMode!==l&&(Q.layoutMode=l,he(),e.nextTick(()=>rn()))}function jl(){return JSON.stringify(m.value,null,2)}function Np(l){const a=le(m.value,l);return a?!!(a.note&&a.note.text||a.link&&a.link.url||a.image&&a.image.src||a.richContent&&a.richContent.raw||a.markers&&a.markers.length>0||a.tags&&a.tags.length>0):!1}function Kl(l){try{const a=JSON.parse(l);return!a.id||!Array.isArray(a.children)?!1:(_t.reset(),m.value=Ct(a),d.value=new Set,b.value=new Set,he(),e.nextTick(()=>rn()),i("change",m.value),!0)}catch{return!1}}function Sp(){const l=document.createElement("input");l.type="file",l.accept="application/json",l.onchange=()=>{var A;const a=(A=l.files)==null?void 0:A[0];if(!a)return;const f=new FileReader;f.onload=()=>{typeof f.result=="string"&&(Kl(f.result)||alert("导入失败:JSON 格式无效"))},f.readAsText(a)},l.click()}function Tp(){const l=new Blob([jl()],{type:"application/json"}),a=URL.createObjectURL(l),f=document.createElement("a");f.href=a,f.download=`${m.value.text||"mindmap"}.json`,f.click(),URL.revokeObjectURL(a)}const Yl=e.ref(""),ln=e.ref([]),wo=e.ref(-1);function Cp(l){Yl.value=l;const a=l.trim();if(!a){ln.value=[],wo.value=-1;return}const f=a.toLowerCase(),A=[],S=L=>{var M;(L.text.toLowerCase().includes(f)||(M=L.note)!=null&&M.text&&L.note.text.toLowerCase().includes(f))&&A.push(L.id);for(const G of L.children)S(G)};S(m.value),ln.value=A,wo.value=A.length>0?0:-1,A.length>0&&(Rp(A),e.nextTick(()=>vp(0)))}function Ap(l){return ln.value.includes(l)}function _p(l){return wo.value>=0&&ln.value[wo.value]===l}function Mp(l){return Yl.value.trim().length>0&&ln.value.length>0&&!ln.value.includes(l)}function Rp(l){if(l.length===0)return;const a=new Set(l),f=new Set,A=S=>{let L=a.has(S.id);for(const M of S.children)A(M)&&(L=!0);return L&&S.children.length>0&&b.value.has(S.id)&&f.add(S.id),L};if(A(m.value),f.size>0){for(const S of f)b.value.delete(S);he()}}function vp(l){const a=ln.value[l];if(!a)return;const f=kn.value.find(A=>A.id===a);f&&(d.value=new Set([a]),ut(),J.centerOn(f.x,f.y,f.width,f.height))}function Bp(l,a){const f=le(m.value,l);f&&(f.markers||(f.markers=[]),!f.markers.includes(a)&&(f.markers.push(a),Ce(),he(),i("change",m.value)))}function zp(l,a){const f=le(m.value,l);if(!f||!f.markers)return;const A=f.markers.indexOf(a);A<0||(f.markers.splice(A,1),f.markers.length===0&&delete f.markers,Ce(),he(),i("change",m.value))}function ql(l,a){const f=le(m.value,l);if(!f)return!1;f.markers||(f.markers=[]);const A=f.markers.indexOf(a);return A>=0?(f.markers.splice(A,1),f.markers.length===0&&delete f.markers,Ce(),he(),i("change",m.value),!1):(f.markers.push(a),Ce(),he(),i("change",m.value),!0)}function Ip(l){const a=le(m.value,l);return a!=null&&a.markers?[...a.markers]:[]}function Op(l){var f;const a=(f=y.value)==null?void 0:f.nodeId;a&&ql(a,l)}function Lp(){var f;const l=(f=y.value)==null?void 0:f.nodeId;if(!l)return;const a=le(m.value,l);!a||!a.markers||(delete a.markers,Ce(),he(),i("change",m.value),de())}function Gr(l,a){const f=le(m.value,l);f&&(a.length===0?f.tags&&delete f.tags:f.tags=[...a],Ce(),he(),i("change",m.value))}function Dp(l){const a=le(m.value,l);return a!=null&&a.tags?[...a.tags]:[]}function Vp(){var L,M;const l=(L=y.value)==null?void 0:L.nodeId;if(!l)return;const a=le(m.value,l),f=((M=a==null?void 0:a.tags)==null?void 0:M.join(", "))??"",A=window.prompt("输入标签(多个用逗号分隔)",f);if(A===null)return;const S=A.split(/[,,]/).map(G=>G.trim()).filter(G=>G.length>0);Gr(l,S),de()}function $p(){var a;const l=(a=y.value)==null?void 0:a.nodeId;l&&(Gr(l,[]),de())}function Xl(){const l=et.value,a="http://www.w3.org/2000/svg",f=document.createElementNS(a,"svg");f.setAttribute("xmlns",a),f.setAttribute("viewBox",`${l.vbX} ${l.vbY} ${l.vbW} ${l.vbH}`),f.setAttribute("width",String(l.vbW)),f.setAttribute("height",String(l.vbH));const A=document.createElementNS(a,"rect");A.setAttribute("x",String(l.vbX)),A.setAttribute("y",String(l.vbY)),A.setAttribute("width",String(l.vbW)),A.setAttribute("height",String(l.vbH)),A.setAttribute("fill",po.value),f.appendChild(A);for(const M of Eo.value){const G=document.createElementNS(a,"path");G.setAttribute("d",bo(tr(M.from,"out",M.to.side,M.to),tr(M.to,"in"),go(M.from.depth),ho(M.to.depth),32,Q.lineStyle,M.to._dir)),G.setAttribute("fill",ht(M.from,M.to)),G.setAttribute("stroke","none"),f.appendChild(G)}const S="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function L(M,G){let oe=0;for(const pe of M)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(pe)?oe+=G:oe+=G*.55;return oe}for(const M of kn.value){const G=M.x-M.width/2,oe=M.y-M.height/2,pe=document.createElementNS(a,"rect");pe.setAttribute("x",String(G)),pe.setAttribute("y",String(oe)),pe.setAttribute("width",String(M.width)),pe.setAttribute("height",String(M.height)),pe.setAttribute("rx","8"),pe.setAttribute("fill",Yt(M)),pe.setAttribute("stroke",nn(M)),pe.setAttribute("stroke-width","1"),f.appendChild(pe);const Ve=!!(M.tags&&M.tags.length>0),R=!!(M.markers&&M.markers.length>0),Ye=!!M.image,Et=!!(M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table"));let ue=0,ft=0;if(Et){const qe=M.richContent,Xe=M.fontSize*.78*.92,Xt=6,Le=4,En=2,xn=6;if(qe.kind==="code"){const wt=Po(qe.raw),mt=Tn(qe.raw),Nt=wt.split(`
23
+ `),Zt=Xe*1.35;let Rt=0;for(const Ie of Nt)Rt=Math.max(Rt,L(Ie,Xe));ft=Math.min(Rt+Xt*2+4,M.width-4),ue=Nt.length*Zt+Le*2+En;const Ze=M.x-ft/2;let st=oe+4;Ye&&(st=oe+M.image.height+xn);const St=document.createElementNS(a,"rect");if(St.setAttribute("x",String(Ze)),St.setAttribute("y",String(st)),St.setAttribute("width",String(ft)),St.setAttribute("height",String(ue-En)),St.setAttribute("rx","6"),St.setAttribute("fill","rgba(255,255,255,0.55)"),St.setAttribute("stroke",nn(M)),St.setAttribute("stroke-width","1"),f.appendChild(St),mt){const Ie=document.createElementNS(a,"text");Ie.setAttribute("x",String(Ze+ft-Xt)),Ie.setAttribute("y",String(st+Le+4)),Ie.setAttribute("text-anchor","end"),Ie.setAttribute("fill",tn(M)),Ie.setAttribute("font-size",String(Xe*.8)),Ie.setAttribute("font-family",S),Ie.setAttribute("opacity","0.5"),Ie.textContent=mt,f.appendChild(Ie)}const So="'JetBrains Mono','Fira Code',Consolas,monospace";for(let Ie=0;Ie<Nt.length;Ie++){const nt=document.createElementNS(a,"text");nt.setAttribute("x",String(Ze+Xt)),nt.setAttribute("y",String(st+Le+(Ie+.5)*Zt+2)),nt.setAttribute("dominant-baseline","central"),nt.setAttribute("fill",tn(M)),nt.setAttribute("font-size",String(Xe)),nt.setAttribute("font-family",So);let vt=Nt[Ie];const Ue=Math.floor((ft-Xt*2)/(Xe*.6));vt.length>Ue&&(vt=vt.substring(0,Ue-1)+"…"),nt.textContent=vt,f.appendChild(nt)}}else if(qe.kind==="table"){const wt=hr(qe.raw);if(wt.length>0){const mt=Xe*1.35,Nt=6,Zt=3,Rt=wt[0].length,Ze=[];for(let Ue=0;Ue<Rt;Ue++){let cn=0;for(const wn of wt)Ue<wn.length&&(cn=Math.max(cn,L(wn[Ue],Xe)));Ze.push(cn+Nt*2)}ft=Math.min(Ze.reduce((Ue,cn)=>Ue+cn,0),M.width-4);const st=ft/Ze.reduce((Ue,cn)=>Ue+cn,0);for(let Ue=0;Ue<Rt;Ue++)Ze[Ue]*=st;ue=wt.length*(mt+Zt*2)+En;const St=M.x-ft/2;let So=oe+4;Ye&&(So=oe+M.image.height+xn);const Ie=document.createElementNS(a,"rect");Ie.setAttribute("x",String(St)),Ie.setAttribute("y",String(So)),Ie.setAttribute("width",String(ft)),Ie.setAttribute("height",String(ue-En)),Ie.setAttribute("rx","6"),Ie.setAttribute("fill","rgba(255,255,255,0.55)"),Ie.setAttribute("stroke",nn(M)),Ie.setAttribute("stroke-width","1"),f.appendChild(Ie);let nt=St,vt=So;for(let Ue=0;Ue<wt.length;Ue++){const cn=wt[Ue],wn=mt+Zt*2;nt=St;for(let To=0;To<Rt;To++){const no=Ze[To],Pp=cn[To]||"";if(To<Rt-1){const He=document.createElementNS(a,"line");He.setAttribute("x1",String(nt+no)),He.setAttribute("y1",String(vt)),He.setAttribute("x2",String(nt+no)),He.setAttribute("y2",String(vt+wn)),He.setAttribute("stroke",nn(M)),He.setAttribute("stroke-width","1"),f.appendChild(He)}if(Ue<wt.length-1){const He=document.createElementNS(a,"line");He.setAttribute("x1",String(nt)),He.setAttribute("y1",String(vt+wn)),He.setAttribute("x2",String(nt+no)),He.setAttribute("y2",String(vt+wn)),He.setAttribute("stroke",nn(M)),He.setAttribute("stroke-width","1"),f.appendChild(He)}if(Ue===0){const He=document.createElementNS(a,"rect");He.setAttribute("x",String(nt)),He.setAttribute("y",String(vt)),He.setAttribute("width",String(no)),He.setAttribute("height",String(wn)),He.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(He)}const dn=document.createElementNS(a,"text");dn.setAttribute("x",String(nt+Nt)),dn.setAttribute("y",String(vt+Zt+mt/2+2)),dn.setAttribute("dominant-baseline","central"),dn.setAttribute("fill",tn(M)),dn.setAttribute("font-size",String(Xe)),dn.setAttribute("font-family",S),Ue===0&&dn.setAttribute("font-weight","600");let nr=Pp;const jr=Math.floor((no-Nt*2)/(Xe*.55));nr.length>jr&&jr>2&&(nr=nr.substring(0,jr-1)+"…"),dn.textContent=nr,f.appendChild(dn),nt+=no}vt+=wn}}}}let an=0;if(Ye){const qe=M.image,Xe=oe+4,Xt=M.x-qe.width/2,Le=document.createElementNS(a,"image");Le.setAttribute("x",String(Xt)),Le.setAttribute("y",String(Xe)),Le.setAttribute("width",String(qe.width)),Le.setAttribute("height",String(qe.height)),Le.setAttribute("href",qe.src),Le.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",qe.src),Le.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild(Le),an=qe.height+6}let at=M.y;const kt=an+ue;kt>0?at=oe+kt+(M.height-kt)/2:Ve&&(at=M.y-8);const qt=14,Vt=2,yn=4,$t=R?M.markers.length:0,Ee=$t>0?$t*qt+($t-1)*Vt+yn:0,Oe=L(M.text,M.fontSize),Pt=Ee+Oe,sn=M.x-Pt/2;if(R){let qe=sn;for(const Xe of M.markers){const Xt=zo(Xe);if(Xt){const Le=document.createElementNS(a,"svg");Le.setAttribute("x",String(qe)),Le.setAttribute("y",String(at-qt/2)),Le.setAttribute("width",String(qt)),Le.setAttribute("height",String(qt)),Le.setAttribute("viewBox","0 0 24 24"),Le.setAttribute("color",tn(M));const xn=new DOMParser().parseFromString(`<svg xmlns="${a}">${Xt}</svg>`,"image/svg+xml");if(!xn.querySelector("parsererror"))for(;xn.documentElement.firstChild;)Le.appendChild(xn.documentElement.firstChild);f.appendChild(Le)}qe+=qt+Vt}}const to=R?sn+Ee+Oe/2:M.x,xt=document.createElementNS(a,"text");if(xt.setAttribute("x",String(to)),xt.setAttribute("y",String(at)),xt.setAttribute("text-anchor","middle"),xt.setAttribute("dominant-baseline","central"),xt.setAttribute("fill",tn(M)),xt.setAttribute("font-size",String(zn(M))),xt.setAttribute("font-weight",String(eo(M))),xt.setAttribute("font-family",S),xt.textContent=M.text,f.appendChild(xt),Ve){const Le=M.y+10,En=M.tags.map(mt=>L(mt,10)+12),xn=En.reduce((mt,Nt)=>mt+Nt+3,-3);let wt=M.x-xn/2;for(let mt=0;mt<M.tags.length;mt++){const Nt=M.tags[mt],Zt=lr(Nt),Rt=En[mt],Ze=document.createElementNS(a,"rect");Ze.setAttribute("x",String(wt)),Ze.setAttribute("y",String(Le-16/2)),Ze.setAttribute("width",String(Rt)),Ze.setAttribute("height",String(16)),Ze.setAttribute("rx",String(16/2)),Ze.setAttribute("fill",Zt.background),Ze.setAttribute("stroke",Zt.borderColor),Ze.setAttribute("stroke-width","1"),f.appendChild(Ze);const st=document.createElementNS(a,"text");st.setAttribute("x",String(wt+Rt/2)),st.setAttribute("y",String(Le)),st.setAttribute("text-anchor","middle"),st.setAttribute("dominant-baseline","central"),st.setAttribute("fill",Zt.color),st.setAttribute("font-size",String(10)),st.setAttribute("font-family",S),st.textContent=Nt,f.appendChild(st),wt+=Rt+3}}}return f}function No(){const l=Xl();let f=new XMLSerializer().serializeToString(l);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
24
+ `+f);const A=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),S=URL.createObjectURL(A),L=document.createElement("a");L.href=S,L.download=`${m.value.text||"mindmap"}.svg`,L.click(),URL.revokeObjectURL(S)}function Zl(l=2){const a=Xl(),f=et.value;let S=new XMLSerializer().serializeToString(a);S.startsWith("<?xml")||(S=`<?xml version="1.0" encoding="UTF-8"?>
25
+ `+S);const L=new Blob([S],{type:"image/svg+xml;charset=utf-8"}),M=URL.createObjectURL(L),G=new window.Image;G.onload=()=>{const oe=document.createElement("canvas");oe.width=Math.ceil(f.vbW*l),oe.height=Math.ceil(f.vbH*l);const pe=oe.getContext("2d");if(!pe){URL.revokeObjectURL(M);return}pe.fillStyle=po.value,pe.fillRect(0,0,oe.width,oe.height),pe.drawImage(G,0,0,oe.width,oe.height),URL.revokeObjectURL(M);try{oe.toBlob(Ve=>{if(!Ve){No();return}const R=URL.createObjectURL(Ve),Ye=document.createElement("a");Ye.href=R,Ye.download=`${m.value.text||"mindmap"}.png`,Ye.click(),URL.revokeObjectURL(R)},"image/png")}catch(Ve){console.warn("PNG export failed, falling back to SVG:",Ve),No()}},G.onerror=()=>{URL.revokeObjectURL(M),No()},G.src=M}return o({addChild:l=>on(l),addSibling:l=>Fe(l),removeNode:l=>Vl(l),duplicateNode:l=>xo(l),setNodeText:(l,a)=>pp(l,a),moveNode:(l,a,f)=>Ul(l,a,f),lineWidthForDepth:go,endWidthForDepth:ho,getData:()=>m.value,nodeHasContent:l=>Np(l),getSelectedIds:()=>[...d.value],copyNodes:l=>Ol(l),cutNodes:l=>Ll(l),pasteNodes:l=>Dl(l),setData:l=>{_t.reset(),m.value=Ct(l),d.value=new Set,b.value=new Set,he(),Ce(),e.nextTick(()=>rn())},resetView:()=>rn(),exportData:jl,importData:Kl,getMarkdown:()=>$n(m.value),setMarkdown:(l,a=!0)=>{const f=Vn(l||"");a&&(j.value=!0),K=!a,_t.reset(),m.value=Ct(f),d.value=new Set,b.value=new Set,he(),Ce(),e.nextTick(()=>{K=!1,rn()}),i("change",m.value)},setBalanced:l=>{Kt.value=l},isBalanced:()=>Kt.value,balance:()=>wp(),applyNodeStyle:(l,a)=>Y(l,a),getNodeStyle:l=>ee(l),applyNodeImage:(l,a)=>ie(l,a),applyNodeImageByUrl:(l,a)=>C(l,a),removeNodeImage:l=>z(l),applyNodeLink:(l,a)=>ae(l,a),removeNodeLink:l=>we(l),applyNodeNote:(l,a)=>ve(l,a),removeNodeNote:l=>ze(l),applyNodeRichContent:(l,a)=>Ne(l,a),addNodeMarker:(l,a)=>Bp(l,a),removeNodeMarker:(l,a)=>zp(l,a),toggleNodeMarker:(l,a)=>ql(l,a),getNodeMarkers:l=>Ip(l),setNodeTags:(l,a)=>Gr(l,a),getNodeTags:l=>Dp(l),exportPNG:l=>Zl(l),exportSVG:()=>No(),searchNodes:l=>(Cp(l),[...ln.value]),undo:()=>Fr(),redo:()=>Ur(),canUndo:()=>_t.canUndo(),canRedo:()=>_t.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),l.canvasBg!==void 0&&(Q.canvasBg=l.canvasBg)},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,canvasBg:Q.canvasBg}),setBranchPalette:l=>{if(!l)return;[...Jt,...Q.customPalettes].find(f=>f.id===l)&&(Q.branchPaletteId=l)},getBranchPalette:()=>Q.branchPaletteId,getBranchPalettes:()=>[...Jt,...Q.customPalettes],getSearchResults:()=>[...ln.value],getSearchIndex:()=>wo.value}),e.watch(()=>r.data,l=>{m.value=Ct(l),he()},{deep:!1}),e.onMounted(()=>{Ce(),e.nextTick(()=>rn())}),(l,a)=>{var f,A,S,L,M,G,oe,pe,Ve;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:po.value,fontSize:lt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:s,class:"zm-canvas",onMousedown:kp,onContextmenu:ge,onWheel:a[26]||(a[26]=(...R)=>e.unref(J).onWheel&&e.unref(J).onWheel(...R)),onMouseenter:a[27]||(a[27]=R=>w.value=!0),onMouseleave:a[28]||(a[28]=R=>w.value=!1),onClick:yp},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:et.value.vbX*e.unref(J).scale.value+e.unref(J).offsetX.value+"px",top:et.value.vbY*e.unref(J).scale.value+e.unref(J).offsetY.value+"px",width:et.value.vbW*e.unref(J).scale.value+"px",height:et.value.vbH*e.unref(J).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:Zo.value,preserveAspectRatio:"xMinYMin meet",width:et.value.vbW*e.unref(J).scale.value,height:et.value.vbH*e.unref(J).scale.value},[e.createElementVNode("g",ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,R=>(e.openBlock(),e.createElementBlock("path",{key:R.key,d:bo(tr(R.from,"out",R.to.side,R.to),tr(R.to,"in"),go(R.from.depth),ho(R.to.depth),32,Q.lineStyle,R.to._dir),fill:ht(R.from,R.to),stroke:"none"},null,8,lc))),128))])],8,rc))],4),e.unref(J).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(J).marquee.x*e.unref(J).scale.value+e.unref(J).offsetX.value+"px",top:e.unref(J).marquee.y*e.unref(J).scale.value+e.unref(J).offsetY.value+"px",width:e.unref(J).marquee.width*e.unref(J).scale.value+"px",height:e.unref(J).marquee.height*e.unref(J).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:V.value+"px",top:_.value+"px",transform:`scale(${e.unref(J).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(N.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(J).offsetX.value}px, ${e.unref(J).offsetY.value}px) scale(${e.unref(J).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kn.value,R=>{var Ye,Et;return e.openBlock(),e.createElementBlock("div",{key:R.id,class:e.normalizeClass(["zm-node",{"is-root":R.isRoot,"is-selected":g.value===R.id,"is-selected-secondary":g.value!==R.id&&d.value.has(R.id),"is-editing":c.value===R.id,"has-image":!!R.image,"is-resizing":Qe.value===R.id,"is-dragging-source":((Ye=N.value)==null?void 0:Ye.srcId)===R.id,"is-drop-target":((Et=N.value)==null?void 0:Et.currentTargetId)===R.id,"is-search-hit":Ap(R.id),"is-search-current":_p(R.id),"is-search-dimmed":Mp(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:zn(R)+"px",background:Yt(R),color:tn(R),borderColor:nn(R),fontWeight:eo(R),transform:"translate(-50%, -50%)"}),onClick:ue=>gp(ue,R),onPointerdown:ue=>bp(ue,R),onDblclick:ue=>{ue.stopPropagation(),t.previewMode||Mt(R.id)},onContextmenu:ue=>q(ue,R),onMouseenter:ue=>{qo(R.id),Qn(ue,R)},onMouseleave:ue=>Jn(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,sc)):e.createCommentVNode("",!0),R.richContent&&(R.richContent.kind==="code"||R.richContent.kind==="table")&&c.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:a[1]||(a[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ue=>I(R.id),["stop"]),onMousedown:a[2]||(a[2]=e.withModifiers(()=>{},["stop"]))},[T.value===R.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":a[0]||(a[0]=ue=>E.value=ue),class:"zm-rich-edit",spellcheck:"false",onBlur:H,onKeydown:me},null,544)),[[e.vModelText,E.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[R.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",dc,[e.createElementVNode("code",{innerHTML:e.unref(gr)(e.unref(Po)(R.richContent.raw),e.unref(Tn)(R.richContent.raw))},null,8,uc)])):R.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",fc,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We(R.id,e.unref(hr)(R.richContent.raw)),(ue,ft)=>(e.openBlock(),e.createElementBlock("tr",{key:ft},[ft===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ue,(an,at)=>{var kt,qt,Vt,yn,$t;return e.openBlock(),e.createElementBlock("th",{key:`h${at}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((kt=k.value.get(R.id))==null?void 0:kt.col)===at,"is-asc":((qt=k.value.get(R.id))==null?void 0:qt.col)===at&&((Vt=k.value.get(R.id))==null?void 0:Vt.dir)==="asc","is-desc":((yn=k.value.get(R.id))==null?void 0:yn.col)===at&&(($t=k.value.get(R.id))==null?void 0:$t.dir)==="desc"}]),onClick:e.withModifiers(Ee=>Ae(R.id,at),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(an),1),e.createElementVNode("span",pc,e.toDisplayString(bt(R.id,at)),1)],10,mc)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ue,(an,at)=>(e.openBlock(),e.createElementBlock("td",{key:`c${at}`},e.toDisplayString(an),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,cc)):e.createCommentVNode("",!0),c.value!==R.id?(e.openBlock(),e.createElementBlock("span",gc,[R.markers&&R.markers.length>0?(e.openBlock(),e.createElementBlock("span",hc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.markers,ue=>(e.openBlock(),e.createElementBlock("span",{key:ue,class:"zm-node-marker",title:e.unref(si)(ue),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(zo)(ue)+"</svg>"},null,8,bc))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",kc,e.toDisplayString(R.text),1),R.link&&!c.value?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:R.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${R.link.url}`,onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"])),onMousedown:a[4]||(a[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ke,{name:"link",size:11,stroke:2})],40,yc)):e.createCommentVNode("",!0),R.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:Z(R.note.text),onClick:e.withModifiers(ue=>U(R.id),["stop"]),onMousedown:a[5]||(a[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ke,{name:"note",size:11,stroke:2})],40,Ec)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":a[6]||(a[6]=ue=>u.value=ue),autofocus:"",onBlur:a[7]||(a[7]=ue=>X()),onKeydown:[a[8]||(a[8]=e.withKeys(e.withModifiers(ue=>X(),["exact"]),["enter"])),a[9]||(a[9]=e.withKeys(e.withModifiers(ue=>X(),["prevent"]),["tab"])),e.withKeys(h,["esc"]),yt],onMousedown:a[10]||(a[10]=e.withModifiers(()=>{},["stop"])),onClick:a[11]||(a[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),R.tags&&R.tags.length>0&&c.value!==R.id?(e.openBlock(),e.createElementBlock("div",xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.tags,ue=>(e.openBlock(),e.createElementBlock("span",{key:ue,class:"zm-node-tag",style:e.normalizeStyle(e.unref(lr)(ue))},e.toDisplayString(ue),5))),128))])):e.createCommentVNode("",!0),ne.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${Gl(R.id)+1} 个`},e.toDisplayString(Gl(R.id)+1),9,wc)):e.createCommentVNode("",!0),Wl(R.id)&&Hr(R.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":R.side===-1}]),style:e.normalizeStyle({background:en.value.get(R.id)??"#64748b"}),title:`展开 ${Hr(R.id)} 个子节点`,onMousedown:a[12]||(a[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ue=>$l(R.id),["stop"])},e.toDisplayString(Hr(R.id)),47,Nc)):e.createCommentVNode("",!0),xp(R)&&!Wl(R.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":R.side===-1}]),style:e.normalizeStyle({color:en.value.get(R.id)??"#64748b",borderColor:en.value.get(R.id)??"#64748b"}),title:"折叠",onMousedown:a[13]||(a[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ue=>$l(R.id),["stop"])},[e.createVNode(ke,{name:"minus",size:10,stroke:2.4})],46,Sc)):e.createCommentVNode("",!0),R.image&&g.value===R.id&&c.value!==R.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ue=>pt(ue,R),["stop"])},null,40,Tc)):e.createCommentVNode("",!0),R.image&&g.value===R.id&&c.value!==R.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:a[14]||(a[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ue=>z(R.id),["stop"])},[e.createVNode(ke,{name:"x",size:9,stroke:2.2})],40,Cc)):e.createCommentVNode("",!0)],46,ac)}),128))],4),B.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!B.value.above}]),style:e.normalizeStyle({left:B.value.x+"px",top:B.value.y+"px"})},e.toDisplayString(B.value.text),7)):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createBlock(Ga,{key:3,x:y.value.x,y:y.value.y,container:s.value,"has-image":!!((f=e.unref(le)(m.value,y.value.nodeId))!=null&&f.image),"has-link":!!((A=e.unref(le)(m.value,y.value.nodeId))!=null&&A.link),"has-note":!!((S=e.unref(le)(m.value,y.value.nodeId))!=null&&S.note),"has-code":((M=(L=e.unref(le)(m.value,y.value.nodeId))==null?void 0:L.richContent)==null?void 0:M.kind)==="code","has-table":((oe=(G=e.unref(le)(m.value,y.value.nodeId))==null?void 0:G.richContent)==null?void 0:oe.kind)==="table","node-markers":((pe=e.unref(le)(m.value,y.value.nodeId))==null?void 0:pe.markers)??[],"node-tags":((Ve=e.unref(le)(m.value,y.value.nodeId))==null?void 0:Ve.tags)??[],onPickImage:Xn,onRemoveImage:Te,onSetLink:pn,onRemoveLink:te,onEditNote:Gt,onRemoveNote:Be,onAddCode:Ot,onEditCode:Ot,onRemoveCode:it,onAddTable:Lt,onEditTable:Lt,onRemoveTable:jt,onToggleMarker:Op,onClearMarkers:Lp,onAddTag:Vp,onRemoveTags:$p,onClose:de},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(ja,{key:4,x:p.value.x,y:p.value.y,container:s.value,onOpenSettings:Pe,onOpenData:Je,onOpenImport:Ke,onExportPng:Zl,onExportSvg:No,onClose:je},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(O.value),title:r.previewMode?"退出预览模式":"进入预览模式",onClick:a[15]||(a[15]=R=>i("canvas-toggle-preview"))},[e.createVNode(ke,{name:r.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Ac),e.createElementVNode("button",{class:e.normalizeClass(D.value),title:"显示大纲视图",onClick:a[16]||(a[16]=R=>i("canvas-outline"))},[e.createVNode(ke,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":w.value}])},[e.createElementVNode("span",_c,e.toDisplayString(Math.round(e.unref(J).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:a[17]||(a[17]=(...R)=>e.unref(J).zoomIn&&e.unref(J).zoomIn(...R))},[e.createVNode(ke,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:a[18]||(a[18]=(...R)=>e.unref(J).zoomOut&&e.unref(J).zoomOut(...R))},[e.createVNode(ke,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:rn},[e.createVNode(ke,{name:"reset"})]),a[32]||(a[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:fp},[e.createVNode(ke,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:a[19]||(a[19]=R=>Fl(1))},[e.createVNode(ke,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:a[20]||(a[20]=R=>Fl(2))},[e.createVNode(ke,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:mp},[e.createVNode(ke,{name:"expand-all"})]),a[33]||(a[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:Tp},[e.createVNode(ke,{name:"export"})]),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[a[29]||(a[29]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:a[21]||(a[21]=R=>g.value&&on(g.value))},[e.createElementVNode("img",{src:e.unref(Xr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Mc)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:a[22]||(a[22]=R=>g.value&&Fe(g.value))},[e.createElementVNode("img",{src:e.unref(qr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Rc)]),a[30]||(a[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:a[23]||(a[23]=R=>Wr("mindmap"))},[e.createVNode(ke,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:a[24]||(a[24]=R=>Wr("tree"))},[e.createVNode(ke,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:a[25]||(a[25]=R=>Wr("org"))},[e.createVNode(ke,{name:"org"})],2),a[31]||(a[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:Sp},[e.createVNode(ke,{name:"import"})])],64))],2)],544)],4)}}}),vc={class:"zm-outline-root"},Bc={class:"zm-outline-search"},zc={key:0,class:"zm-outline-search-count"},Ic={key:1,class:"zm-outline-search-count zm-outline-search-empty"},Oc={class:"zm-outline-actions"},Lc={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Dc={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Vc={key:1,d:"M5 12 L10 17 L19 7"},$c={class:"zm-outline"},Pc=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Fc=["title","onClick"],Uc={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Hc={key:0,points:"6 9 12 15 18 9"},Wc={key:1,points:"9 6 15 12 9 18"},Gc={key:1,class:"zm-outline-dot"},jc={class:"zm-outline-index"},Kc={key:3,class:"zm-outline-text"},Yc=["onClick"],qc=["src"],Xc=["onClick"],Zc=["src"],Jc=["title","onClick"],Qc={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ed={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},td={key:1,d:"M5 12 L10 17 L19 7"},br=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,r=o,i=e.ref(""),s=e.ref(null),c=e.ref(-1),u=e.computed(()=>{const p=i.value.trim().toLowerCase();if(!p)return new Set;const O=new Set,D=q=>{var de;(q.text.toLowerCase().includes(p)||(de=q.note)!=null&&de.text&&q.note.text.toLowerCase().includes(p))&&O.add(q.id);for(const ge of q.children)D(ge)};return D(n.data),O}),d=e.computed(()=>{if(u.value.size===0)return new Set;const p=new Set,O=D=>{let q=u.value.has(D.id);for(const de of D.children)O(de)&&(q=!0);return q&&p.add(D.id),q};return O(n.data),p}),g=e.computed(()=>{const p=[],O=D=>{u.value.has(D.id)&&p.push(D.id);for(const q of D.children)O(q)};return O(n.data),p}),b=e.computed(()=>i.value.trim().length>0),w=e.computed(()=>{const p=[],O=d.value,D=(q,de,ge)=>{if(b.value&&!O.has(q.id))return;const je=q.children.length>0,Pe=b.value?!1:n.collapsedIds.has(q.id);p.push({id:q.id,text:q.text||"(无标题)",depth:de,siblingIndex:ge,hasChildren:je,collapsed:Pe,node:q}),je&&!Pe&&q.children.forEach((Je,Ke)=>D(Je,de+1,Ke))};return D(n.data,0,0),p});function N(){c.value=g.value.length>0?0:-1}function V(){const p=g.value;p.length!==0&&(c.value=(c.value+1)%p.length,B(c.value))}function _(){const p=g.value;p.length!==0&&(c.value=(c.value-1+p.length)%p.length,B(c.value))}function $(p){p.key==="Enter"?(p.preventDefault(),p.shiftKey?_():V()):p.key==="Escape"&&(p.preventDefault(),i.value="",c.value=-1)}function B(p){const O=g.value[p];if(!O)return;const D=w.value.find(q=>q.id===O);D&&r("select",D.node),e.nextTick(()=>{const q=document.querySelector(`[data-outline-id="${O}"]`);q==null||q.scrollIntoView({block:"nearest",behavior:"smooth"})})}function T(){i.value="",c.value=-1}e.onMounted(()=>{e.nextTick(()=>{var p;return(p=s.value)==null?void 0:p.focus()})});const E=e.ref(null),k=e.ref("");let m=null;function v(p){n.readonly||(E.value=p.id,k.value=p.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function x(){E.value!=null&&(r("edit",{id:E.value,text:k.value.trim()||"(无标题)"}),j())}function j(){E.value=null,k.value="",m=null}function K(p){p.key==="Enter"?(p.preventDefault(),x()):p.key==="Escape"&&(p.preventDefault(),j())}e.onBeforeUnmount(j);const ne=e.ref(null),ce=e.ref(null),re=e.ref(null);function Y(p,O){if(n.readonly){p.preventDefault();return}ne.value={id:O.id,text:O.text},p.dataTransfer&&(p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/plain",O.id))}function ee(){ne.value=null,ce.value=null,re.value=null}function ie(p,O){if(!ne.value)return;p.preventDefault(),p.dataTransfer&&(p.dataTransfer.dropEffect="move");const D=F(p);ce.value=O.id,re.value=D}function z(p){ce.value===p.id&&(ce.value=null,re.value=null)}function C(p,O){p.preventDefault();const D=ne.value;if(!D)return;const q=F(p);D.id!==O.id&&r("move",{srcId:D.id,targetId:O.id,position:q}),ee()}function F(p,O){const q=p.currentTarget.getBoundingClientRect(),de=p.clientY-q.top,ge=q.height;return de<ge*.3?"before":de>ge*.7?"after":"child"}const P=e.ref(null);let W=null;async function ae(p){try{return await navigator.clipboard.writeText(p),!0}catch{const O=document.createElement("textarea");O.value=p,document.body.appendChild(O),O.select();let D=!1;try{D=document.execCommand("copy")}finally{document.body.removeChild(O)}return D}}async function we(p,O,D){p.stopPropagation(),await ae(O)&&(P.value=D,W&&clearTimeout(W),W=setTimeout(()=>P.value=null,1200))}const ve=e.computed(()=>{const p=[],O=(D,q)=>{const de=" ".repeat(q),ge=q===0?"":"- ";p.push(de+ge+(D.text||""));for(const je of D.children)O(je,q+1)};return O(n.data,0),p.join(`
26
+ `)}),ze=e.ref(!1);let Ne=null;async function y(){await ae(ve.value)&&(ze.value=!0,Ne&&clearTimeout(Ne),Ne=setTimeout(()=>ze.value=!1,1200))}return(p,O)=>(e.openBlock(),e.createElementBlock("div",vc,[e.createElementVNode("div",Bc,[O[3]||(O[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":O[0]||(O[0]=D=>i.value=D),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:N,onKeydown:$},null,544),[[e.vModelText,i.value]]),g.value.length>0?(e.openBlock(),e.createElementBlock("span",zc,e.toDisplayString(c.value+1)+"/"+e.toDisplayString(g.value.length),1)):b.value?(e.openBlock(),e.createElementBlock("span",Ic,"无结果")):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:T},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Oc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":ze.value}]),title:"复制完整大纲为纯文本",onClick:y},[(e.openBlock(),e.createElementBlock("svg",Lc,[ze.value?(e.openBlock(),e.createElementBlock("path",Vc)):(e.openBlock(),e.createElementBlock("rect",Dc)),O[4]||(O[4]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(ze.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",$c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,D=>(e.openBlock(),e.createElementBlock("li",{key:D.id,"data-outline-id":D.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":D.id===t.selectedId,"is-root":D.depth===0,"is-editing":E.value===D.id,"is-search-hit":u.value.has(D.id),"is-search-current":g.value[c.value]===D.id,"is-drag-over-before":ce.value===D.id&&re.value==="before","is-drag-over-after":ce.value===D.id&&re.value==="after","is-drag-over-child":ce.value===D.id&&re.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+D.depth*16+"px"}),draggable:"true",onClick:q=>r("select",D.node),onDblclick:q=>v(D),onDragstart:q=>Y(q,D),onDragend:ee,onDragover:q=>ie(q,D),onDragleave:()=>z(D),onDrop:q=>C(q,D)},[D.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:D.collapsed?"展开":"折叠",onClick:e.withModifiers(q=>r("toggleCollapse",D.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Uc,[D.collapsed?(e.openBlock(),e.createElementBlock("polyline",Wc)):(e.openBlock(),e.createElementBlock("polyline",Hc))]))],8,Fc)):(e.openBlock(),e.createElementBlock("span",Gc)),e.createElementVNode("span",jc,e.toDisplayString(D.siblingIndex+1)+".",1),E.value===D.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":O[1]||(O[1]=q=>k.value=q),class:"zm-outline-input",onBlur:x,onKeydown:K,onClick:O[2]||(O[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Kc,e.toDisplayString(D.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(q=>r("addSibling",D.id),["stop"])},[e.createElementVNode("img",{src:e.unref(qr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,qc)],8,Yc)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(q=>r("addChild",D.id),["stop"])},[e.createElementVNode("img",{src:e.unref(Xr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Zc)],8,Xc)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":P.value===D.id}]),title:P.value===D.id?"已复制":"复制节点文本",onClick:q=>we(q,D.text,D.id)},[(e.openBlock(),e.createElementBlock("svg",Qc,[P.value!==D.id?(e.openBlock(),e.createElementBlock("rect",ed)):(e.openBlock(),e.createElementBlock("path",td)),O[5]||(O[5]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Jc)],46,Pc))),128))])]))}}),nd=["aria-hidden"],od=["aria-hidden"],rd={key:0,class:"zm-drawer-header"},id={key:0,class:"zm-drawer-title"},ld={class:"zm-drawer-body"},ad=["aria-hidden"],sd={key:0,class:"zm-drawer-header"},cd={key:0,class:"zm-drawer-title"},dd={class:"zm-drawer-body"},An=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 r(){n("update:open",!1)}function i(){n("update:open",!1)}return(s,c)=>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:c[0]||(c[0]=u=>t.closeOnBackdrop&&i())},null,8,nd)):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||s.$slots.header?(e.openBlock(),e.createElementBlock("div",rd,[t.title?(e.openBlock(),e.createElementBlock("h3",id,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:r},[...c[1]||(c[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",ld,[e.renderSlot(s.$slots,"default")])],14,od)):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||s.$slots.header?(e.openBlock(),e.createElementBlock("div",sd,[t.title?(e.openBlock(),e.createElementBlock("h3",cd,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:r},[...c[2]||(c[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",dd,[e.renderSlot(s.$slots,"default")])],14,ad)):e.createCommentVNode("",!0)]),_:3}))}}),ud={key:0,class:"zm-jtv-root"},fd={key:0,class:"zm-jtv-key"},md={key:1,class:"zm-jtv-colon"},pd={key:2,class:"zm-jtv-key zm-jtv-bracket"},gd={key:3,class:"zm-jtv-size"},hd={key:4,class:"zm-jtv-bracket"},bd={key:5,class:"zm-jtv-brace"},kd={key:0,class:"zm-jtv-children"},yd={class:"zm-jtv-key"},Ed={key:0,class:"zm-jtv-key"},xd=["src","alt"],wd=["href"],Nd=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),r=e.computed(()=>n.value==="object"),i=e.computed(()=>n.value==="array");e.computed(()=>!r.value&&!i.value);const s=e.computed(()=>{if(i.value)return`Array(${o.value.length})`;if(r.value){const E=o.value,k=Object.keys(E);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),c=e.computed(()=>i.value?o.value.map((E,k)=>({key:String(k),value:E})):r.value?Object.entries(o.value).map(([E,k])=>({key:E,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function g(E,k,m){E!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(E)||o.collapsedPaths.add(E))}o.isRoot||g(u.value,o.value,o.depth);function b(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function w(E){return u.value===""?E:`${u.value}.${E}`}function N(E){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof E=="string"?E.toLowerCase().includes(k):E===null?"null".includes(k):String(E).toLowerCase().includes(k)}function V(E){return o.query?E.toLowerCase().includes(o.query.toLowerCase()):!0}function _(E,k){return!o.query||V(E)?!0:k===null||typeof k!="object"?N(k):!0}function $(E){return E===null?"null":typeof E=="string"?E.length>80?`"${E.slice(0,80)}..."`:`"${E}"`:typeof E=="boolean"?E?"true":"false":typeof E=="number"?String(E):typeof E>"u"?"undefined":JSON.stringify(E)}function B(E){if(typeof E!="string")return!1;const k=E.trim();return!!(k.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k)||/^https?:\/\/.+/i.test(k)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k))}function T(E){if(!o.query)return null;const k=E.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:E.slice(0,k),match:E.slice(k,k+o.query.length),after:E.slice(k+o.query.length)}}return(E,k)=>{var v,x,j,K,ne,ce;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",ud,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,re=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:re.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":re.key,value:re.value,path:w(re.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,_(re.key,re.value)]])),128))])):r.value||i.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:b},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",fd,e.toDisplayString(t.keyName),1)),i.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",md,":")),i.value?(e.openBlock(),e.createElementBlock("span",pd,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",gd,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",hd,"]")):e.createCommentVNode("",!0),d.value&&r.value?(e.openBlock(),e.createElementBlock("span",bd,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",kd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,re=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:re.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":re.key,value:re.value,path:w(re.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,_(re.key,re.value)]])),128))])),!d.value&&i.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&r.value&&!i.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[k[2]||(k[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",yd,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),V(t.keyName)&&T(t.keyName)?(e.openBlock(),e.createElementBlock("span",Ed,[e.createElementVNode("span",null,e.toDisplayString((v=T(t.keyName))==null?void 0:v.before),1),e.createElementVNode("mark",null,e.toDisplayString((x=T(t.keyName))==null?void 0:x.match),1),e.createElementVNode("span",null,e.toDisplayString((j=T(t.keyName))==null?void 0:j.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[T($(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((K=T($(t.value)))==null?void 0:K.before),1),e.createElementVNode("mark",null,e.toDisplayString((ne=T($(t.value)))==null?void 0:ne.match),1),e.createElementVNode("span",null,e.toDisplayString((ce=T($(t.value)))==null?void 0:ce.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString($(t.value)),1)],64))],2),B(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,xd),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:k[0]||(k[0]=e.withModifiers(()=>{},["stop"]))},"open",8,wd)])):e.createCommentVNode("",!0)],4))}}}),Sd={class:"zm-data-panel"},Td={class:"zm-data-header"},Cd={class:"zm-data-title"},Ad={class:"zm-data-title-meta"},_d={class:"zm-data-toolbar"},Md=["title"],Rd={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},vd={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"},Bd={key:0,class:"zm-data-paste"},zd={class:"zm-data-tabs"},Id=["placeholder"],Od={key:0,class:"zm-data-error"},Ld={class:"zm-data-paste-actions"},Dd=["disabled"],Vd={class:"zm-data-tree"},kr=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,r=o,i=e.computed(()=>JSON.stringify(n.data,null,2)),s=e.ref(""),c=e.ref(null),u=e.ref(!1),d=e.ref("json"),g=e.ref("idle"),b=e.ref(new Set),w=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,r("consumed-mode"))},{immediate:!0});async function N(){try{await navigator.clipboard.writeText(i.value),g.value="copied",setTimeout(()=>g.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=i.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),g.value="copied",setTimeout(()=>g.value="idle",1500)}finally{document.body.removeChild(k)}}}function V(){const k=new Blob([i.value],{type:"application/json"}),m=URL.createObjectURL(k),v=document.createElement("a");v.href=m,v.download=`${n.data.text||"mindmap"}.json`,v.click(),URL.revokeObjectURL(m)}function _(){c.value=null;const k=s.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=Vn(k);r("import",m),s.value="",u.value=!1}catch(m){c.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){c.value="JSON 缺少 id 或 children 字段";return}r("import",m),s.value="",u.value=!1}catch(m){c.value="JSON 解析失败:"+m.message}}}function $(k){return 1+k.children.reduce((m,v)=>m+$(v),0)}const B=e.computed(()=>$(n.data)),T=e.computed(()=>i.value.length);function E(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var x;const m=(x=k.files)==null?void 0:x[0];if(!m)return;const v=new FileReader;v.onload=()=>{typeof v.result=="string"&&(s.value=v.result,_())},v.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",Sd,[e.createElementVNode("div",Td,[e.createElementVNode("div",Cd,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",Ad,e.toDisplayString(B.value)+" 节点 · "+e.toDisplayString(T.value)+" chars",1)])]),e.createElementVNode("div",_d,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":g.value==="copied"}]),title:g.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:N},[g.value==="idle"?(e.openBlock(),e.createElementBlock("svg",Rd,[...m[9]||(m[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",vd,[...m[10]||(m[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),m[11]||(m[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,Md),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:V},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:E},[...m[13]||(m[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:m[0]||(m[0]=v=>u.value=!u.value)},[...m[14]||(m[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),m[16]||(m[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":w.value.length>0}])},[m[15]||(m[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[1]||(m[1]=v=>w.value=v),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,w.value]]),w.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=v=>w.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",Bd,[e.createElementVNode("div",zd,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=v=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=v=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=v=>s.value=v),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Id),[[e.vModelText,s.value]]),c.value?(e.openBlock(),e.createElementBlock("div",Od,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ld,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!s.value,onClick:_},"应用",8,Dd),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=v=>{s.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=v=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",Vd,[e.createVNode(Nd,{value:t.data,query:w.value,"collapsed-paths":b.value},null,8,["value","query","collapsed-paths"])]),m[17]||(m[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),$d={class:"zm-md-panel"},Pd={key:0,class:"zm-md-error"},Fd={class:"zm-md-split"},Ud={class:"zm-md-edit"},Hd={class:"zm-md-preview"},Wd={class:"zm-md-preview-body"},Gd={class:"zm-md-footer"},jd=["disabled"],Kd=`# flow-mindmap 思维导图
24
27
 
25
28
  [GitHub 仓库](https://github.com/xz333221/flow-mindmap)
26
29
 
@@ -59,77 +62,77 @@ https://github.com/highlightjs/highlight.js/issues/2277`),se=N,Y=P),D===void 0&&
59
62
 
60
63
  ## 开源协议
61
64
  [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
62
- `,Oo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,r=e.ref(Jt(n.data)),s=e.ref(null),c=e.ref(null),u=e.computed(()=>{try{const C=Zt(r.value||"");return s.value=null,C}catch(C){return s.value=C.message,{id:"preview_fallback",text:r.value||"(空)",children:[]}}}),d=e.computed(()=>ct(u.value));let m=null;e.watch(r,()=>{m&&clearTimeout(m),m=setTimeout(()=>{var C;return(C=c.value)==null?void 0:C.resetView()},250)});function p(){try{const C=Zt(r.value||"");s.value=null,i("import",C)}catch(C){s.value=C.message}}function k(){r.value=Jt(n.data),s.value=null,e.nextTick(()=>{var C;return(C=c.value)==null?void 0:C.resetView()})}function y(){r.value="",s.value=null,e.nextTick(()=>{var C;return(C=c.value)==null?void 0:C.resetView()})}function w(){const C=document.createElement("input");C.type="file",C.accept=".md,text/markdown,text/plain",C.onchange=()=>{var S;const x=(S=C.files)==null?void 0:S[0];if(!x)return;const R=new FileReader;R.onload=()=>{typeof R.result=="string"&&(r.value=R.result,s.value=null,e.nextTick(()=>{var g;return(g=c.value)==null?void 0:g.resetView()}))},R.readAsText(x)},C.click()}function E(){const C=new Blob([r.value],{type:"text/markdown;charset=utf-8"}),x=URL.createObjectURL(C),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 L(){r.value=Fc,s.value=null,e.nextTick(()=>{var C;return(C=c.value)==null?void 0:C.resetView()})}return(C,x)=>(e.openBlock(),e.createElementBlock("div",Ic,[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:E},[...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:L},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:k},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:y},"清空")]),s.value?(e.openBlock(),e.createElementBlock("div",Oc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",vc,[e.createElementVNode("div",Lc,[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",Dc,[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",Vc,[e.createVNode(Yn,{ref_key:"previewRef",ref:c,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",$c,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!r.value.trim(),onClick:p},"应用到导图",8,Pc)])]))}}),Uc={class:"zm-settings-panel"},Hc={key:0,class:"zm-settings-section"},Wc={class:"zm-settings-row"},Gc=["value"],jc={class:"zm-slider"},Kc=["value"],qc={class:"zm-settings-row"},Yc=["value"],Xc={class:"zm-slider"},Zc=["value"],Jc={class:"zm-settings-row"},Qc={class:"zm-line-style-group"},ed=["title","onClick"],td=["viewBox"],nd={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},od={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},id={class:"zm-line-style-label"},rd={class:"zm-settings-row"},ld={key:0,class:"zm-palette-picker"},ad={class:"zm-palette-grid"},sd=["title","onClick"],cd={class:"zm-palette-card-name"},dd={class:"zm-palette-card-swatches"},ud={key:0,class:"zm-palette-customs"},md=["title","onClick"],fd={class:"zm-palette-card-name"},pd={class:"zm-palette-card-swatches"},gd=["value","onInput"],hd={class:"zm-palette-custom-actions"},bd=["onClick"],kd=["onClick"],yd={class:"zm-settings-row"},Ed={class:"zm-settings-row"},xd={class:"zm-settings-preview"},wd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Nd=["x1","y1","x2","y2","stroke","stroke-width"],Sd={key:1,class:"zm-settings-section"},Td={class:"zm-settings-row"},Cd={class:"zm-settings-value-tag"},_d={class:"zm-settings-row"},Ad={class:"zm-settings-value-tag"},Md={class:"zm-settings-row"},Rd={class:"zm-settings-value-tag"},Bd={class:"zm-settings-row"},zd={key:2,class:"zm-settings-section"},Id={class:"zm-settings-section-title"},Od={key:0,class:"zm-settings-section-sub"},vd={class:"zm-settings-row"},Ld={class:"zm-settings-value-tag"},Dd={class:"zm-swatch-row"},Vd=["title","onClick"],$d={class:"zm-settings-row"},Pd={class:"zm-settings-value-tag"},Fd={class:"zm-swatch-row"},Ud=["title","onClick"],Hd={class:"zm-settings-row"},Wd={class:"zm-settings-section"},vo=((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(_,b){i("update:settings",{[_]:b})}e.computed(()=>{const _=n.settings.lineWidthStart;return _<1.2?"细":_<2.5?"中":_<4?"粗":"极粗"}),e.computed(()=>{const _=n.settings.lineWidthEnd;return _<.6?"极细":_<1.2?"细":_<2?"中":"粗"});const s=[{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 d(){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(_){return m[_.id]===void 0&&(m[_.id]=_.colors.join(`
63
- `)),m[_.id]}function k(_){const b=m[_.id]??"",v=Rl(b);if(v.length===0){m[_.id]=_.colors.join(`
64
- `);return}const H=n.settings.customPalettes.map(oe=>oe.id===_.id?{...oe,colors:v}:oe);i("update:settings",{customPalettes:H})}function y(){const _=E.value.find(q=>q.id===n.settings.branchPaletteId),b=_?[..._.colors]:[...Ct[0].colors],v="custom-";let H=v+(n.settings.customPalettes.length+1);for(;Ct.some(q=>q.id===H)||n.settings.customPalettes.some(q=>q.id===H);)H=v+Math.random().toString(36).slice(2,7);const oe={id:H,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:b};i("update:settings",{customPalettes:[...n.settings.customPalettes,oe],branchPaletteId:H}),m[H]=b.join(`
65
- `)}function w(_){const b=n.settings.customPalettes.filter(H=>H.id!==_.id),v=n.settings.branchPaletteId===_.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:b,...v!==n.settings.branchPaletteId?{branchPaletteId:v}:{}}),delete m[_.id]}const E=e.computed(()=>[...Ct,...n.settings.customPalettes]),L=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],C=[0,1,2,3],x=["#f87171","#fb923c","#34d399","#818cf8"];function R(_,b,v,H){if(b<=1)return v;const oe=_/(b-1);return v+(H-v)*oe}function S(_,b,v){return _<=0?b:_===1?Math.max(1.5,b*.67):_===2?Math.max(.8,b*.42):v}const g=e.computed(()=>{const _=n.settings.lineWidthStart,b=n.settings.lineWidthEnd,v=n.settings.taperedEdge,H=C.length,oe=8,q=192,J=E.value.find(W=>W.id===n.settings.branchPaletteId),ae=J&&J.colors.length?J.colors:x;return C.map((W,K)=>{const F=10+K*60/(H-1);return{x1:oe,y1:F,x2:q,y2:F,w:v?S(W,_,b):R(W,H,_,b),color:n.settings.rainbowBranch?ae[K%ae.length]:"#94a3b8"}})});return(_,b)=>(e.openBlock(),e.createElementBlock("div",Uc,[t.hasSelection?(e.openBlock(),e.createElementBlock("section",Sd,[b[32]||(b[32]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Td,[b[27]||(b[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端",-1)),e.createElementVNode("span",Cd,e.toDisplayString(t.settings.lineWidthStart.toFixed(1)),1)]),e.createElementVNode("div",_d,[b[28]||(b[28]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端",-1)),e.createElementVNode("span",Ad,e.toDisplayString(t.settings.lineWidthEnd.toFixed(1)),1)]),e.createElementVNode("div",Md,[b[29]||(b[29]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("span",Rd,e.toDisplayString(t.settings.lineStyle==="curve"?"圆弧":"直线"),1)]),e.createElementVNode("label",Bd,[b[31]||(b[31]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:b[7]||(b[7]=v=>r("rainbowBranch",!t.settings.rainbowBranch))},[...b[30]||(b[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[33]||(b[33]=e.createElementVNode("p",{class:"zm-settings-hint"},"画布级别的设置会影响整张图。",-1))])):(e.openBlock(),e.createElementBlock("section",Hc,[b[23]||(b[23]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Wc,[b[12]||(b[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:b[0]||(b[0]=v=>r("lineWidthStart",parseFloat(v.target.value)||0))},null,40,Gc)]),e.createElementVNode("div",jc,[e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:b[1]||(b[1]=v=>r("lineWidthStart",parseFloat(v.target.value)))},null,40,Kc)]),e.createElementVNode("div",qc,[b[13]||(b[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:b[2]||(b[2]=v=>r("lineWidthEnd",parseFloat(v.target.value)||0))},null,40,Yc)]),e.createElementVNode("div",Xc,[e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:b[3]||(b[3]=v=>r("lineWidthEnd",parseFloat(v.target.value)))},null,40,Zc)]),e.createElementVNode("div",Jc,[b[14]||(b[14]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",Qc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,v=>e.createElementVNode("button",{key:v.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===v.value}]),title:v.label,onClick:H=>r("lineStyle",v.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:v.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[v.value==="curve"?(e.openBlock(),e.createElementBlock("path",nd)):(e.openBlock(),e.createElementBlock("line",od))],8,td)),e.createElementVNode("span",id,e.toDisplayString(v.label),1)],10,ed)),64))])]),e.createElementVNode("label",rd,[b[16]||(b[16]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:b[4]||(b[4]=v=>r("rainbowBranch",!t.settings.rainbowBranch))},[...b[15]||(b[15]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[24]||(b[24]=e.createElementVNode("p",{class:"zm-settings-hint"},"关闭时所有线条使用统一的 lineColor。",-1)),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",ld,[b[17]||(b[17]=e.createElementVNode("h5",{class:"zm-palette-picker-title"},"配色方案",-1)),e.createElementVNode("div",ad,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ct),v=>(e.openBlock(),e.createElementBlock("button",{key:v.id,type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===v.id}]),title:v.name,onClick:H=>r("branchPaletteId",v.id)},[e.createElementVNode("span",cd,e.toDisplayString(v.name),1),e.createElementVNode("span",dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.colors,(H,oe)=>(e.openBlock(),e.createElementBlock("span",{key:oe,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:H})},null,4))),128))])],10,sd))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("div",ud,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,v=>(e.openBlock(),e.createElementBlock("div",{key:v.id,class:"zm-palette-custom"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===v.id}]),title:v.name,onClick:H=>r("branchPaletteId",v.id)},[e.createElementVNode("span",fd,e.toDisplayString(v.name),1),e.createElementVNode("span",pd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.colors,(H,oe)=>(e.openBlock(),e.createElementBlock("span",{key:oe,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:H})},null,4))),128))])],10,md),e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"2",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:p(v),onInput:H=>m[v.id]=H.target.value},null,40,gd),e.createElementVNode("div",hd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:H=>k(v)},"保存",8,bd),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:H=>w(v)},"删除",8,kd)])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:y},"+ 新建配色")])):e.createCommentVNode("",!0),e.createElementVNode("label",yd,[b[19]||(b[19]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:b[5]||(b[5]=v=>r("taperedEdge",!t.settings.taperedEdge))},[...b[18]||(b[18]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[25]||(b[25]=e.createElementVNode("p",{class:"zm-settings-hint"}," 开启时每条边都从根部粗端收回到细端子端,父子边之间可能形成粗细跳变; 关闭时整棵树从最粗平滑过渡到最细,所有边连成一条带子。 ",-1)),e.createElementVNode("label",Ed,[b[21]||(b[21]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:b[6]||(b[6]=v=>r("showOrderBadge",!t.settings.showOrderBadge))},[...b[20]||(b[20]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),b[26]||(b[26]=e.createElementVNode("p",{class:"zm-settings-hint"}," 在每个节点右上角标注它是同级中的第几个 (1, 2, 3, ...), 方便对比画布位置与数据顺序。 ",-1)),e.createElementVNode("div",xd,[(e.openBlock(),e.createElementBlock("svg",wd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(v,H)=>(e.openBlock(),e.createElementBlock("line",{key:H,x1:v.x1,y1:v.y1,x2:v.x2,y2:v.y2,stroke:t.settings.rainbowBranch?v.color:"#94a3b8","stroke-width":v.w,"stroke-linecap":"butt"},null,8,Nd))),128))])),b[22]||(b[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",zd,[e.createElementVNode("h4",Id,[b[34]||(b[34]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Od,"“"+e.toDisplayString(t.selectedNodeText)+"”",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",vd,[b[35]||(b[35]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",Ld,e.toDisplayString(c.bg||"默认"),1)]),e.createElementVNode("div",Dd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(L,v=>e.createElementVNode("button",{key:"bg-"+v,class:"zm-swatch",style:e.normalizeStyle({background:v}),title:v,onClick:H=>c.bg=v},null,12,Vd)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:b[8]||(b[8]=v=>c.bg=void 0)},"∅")]),e.createElementVNode("div",$d,[b[36]||(b[36]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",Pd,e.toDisplayString(c.textColor||"默认"),1)]),e.createElementVNode("div",Fd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(L,v=>e.createElementVNode("button",{key:"fg-"+v,class:"zm-swatch",style:e.normalizeStyle({background:v}),title:v,onClick:H=>c.textColor=v},null,12,Ud)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:b[9]||(b[9]=v=>c.textColor=void 0)},"∅")]),e.createElementVNode("div",Hd,[b[38]||(b[38]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":c.fontWeight===600}]),onClick:b[10]||(b[10]=v=>c.fontWeight=c.fontWeight===600?400:600)},[...b[37]||(b[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:d},"清除该节点样式")]),b[39]||(b[39]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Wd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:b[11]||(b[11]=v=>i("reset"))},"恢复默认设置")])]))}}),[["__scopeId","data-v-17ef65d1"]]),dr=20;function Gd(t,o){t.style.height="auto";const n=o.minRows*dr,i=o.maxRows>0?o.maxRows*dr: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 Lo(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const s=t.value;s&&Gd(s,n)}function r(){i()}e.onMounted(async()=>{await e.nextTick();const s=t.value;s&&(s.addEventListener("input",r),i())}),e.watch(()=>{var s;return(s=t.value)==null?void 0:s.value},()=>i()),e.onBeforeUnmount(()=>{const s=t.value;s&&s.removeEventListener("input",r)})}function Do(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Wt=Do();function ur(t){Wt=t}var Gt={exec:()=>null};function ln(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 he(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(r,s)=>{let c=typeof s=="string"?s:s.source;return c=c.replace(Ge.caret,"$1"),n=n.replace(r,c),i},getRegex:()=>new RegExp(n,o)};return i}var jd=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Ge={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:ln(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ln(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:ln(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:ln(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:ln(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:ln(t=>new RegExp(`^ {0,${t}}>`))},Kd=/^(?:[ \t]*(?:\n|$))+/,qd=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yd=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Cn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Xd=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,mr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fr=he(mr).replace(/bull/g,Vo).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=he(mr).replace(/bull/g,Vo).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(),$o=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Jd=/^[^\n]+/,Po=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Qd=he(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Po).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),eu=he(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Vo).getRegex(),Xn="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",Fo=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,tu=he("^ {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",Fo).replace("tag",Xn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pr=he($o).replace("hr",Cn).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",Xn).getRegex(),nu=he(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",pr).getRegex(),Uo={blockquote:nu,code:qd,def:Qd,fences:Yd,heading:Xd,hr:Cn,html:tu,lheading:fr,list:eu,newline:Kd,paragraph:pr,table:Gt,text:Jd},gr=he("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Cn).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",Xn).getRegex(),ou={...Uo,lheading:Zd,table:gr,paragraph:he($o).replace("hr",Cn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gr).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",Xn).getRegex()},iu={...Uo,html:he(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Fo).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:Gt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:he($o).replace("hr",Cn).replace("heading",` *#{1,6} *[^
66
- ]`).replace("lheading",fr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ru=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,lu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,hr=/^( {2,}|\\)\n(?!\s*$)/,au=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,an=/[\p{P}\p{S}]/u,Zn=/[\s\p{P}\p{S}]/u,Ho=/[^\s\p{P}\p{S}]/u,su=he(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zn).getRegex(),br=/(?!~)[\p{P}\p{S}]/u,cu=/(?!~)[\s\p{P}\p{S}]/u,du=/(?:[^\s\p{P}\p{S}]|~)/u,uu=he(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",jd?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),kr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,mu=he(kr,"u").replace(/punct/g,an).getRegex(),fu=he(kr,"u").replace(/punct/g,br).getRegex(),yr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pu=he(yr,"gu").replace(/notPunctSpace/g,Ho).replace(/punctSpace/g,Zn).replace(/punct/g,an).getRegex(),gu=he(yr,"gu").replace(/notPunctSpace/g,du).replace(/punctSpace/g,cu).replace(/punct/g,br).getRegex(),hu=he("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ho).replace(/punctSpace/g,Zn).replace(/punct/g,an).getRegex(),bu=he(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,an).getRegex(),ku="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",yu=he(ku,"gu").replace(/notPunctSpace/g,Ho).replace(/punctSpace/g,Zn).replace(/punct/g,an).getRegex(),Eu=he(/\\(punct)/,"gu").replace(/punct/g,an).getRegex(),xu=he(/^<(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(),wu=he(Fo).replace("(?:-->|$)","-->").getRegex(),Nu=he("^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",wu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Jn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Su=he(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Jn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Er=he(/^!?\[(label)\]\[(ref)\]/).replace("label",Jn).replace("ref",Po).getRegex(),xr=he(/^!?\[(ref)\](?:\[\])?/).replace("ref",Po).getRegex(),Tu=he("reflink|nolink(?!\\()","g").replace("reflink",Er).replace("nolink",xr).getRegex(),wr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Wo={_backpedal:Gt,anyPunctuation:Eu,autolink:xu,blockSkip:uu,br:hr,code:lu,del:Gt,delLDelim:Gt,delRDelim:Gt,emStrongLDelim:mu,emStrongRDelimAst:pu,emStrongRDelimUnd:hu,escape:ru,link:Su,nolink:xr,punctuation:su,reflink:Er,reflinkSearch:Tu,tag:Nu,text:au,url:Gt},Cu={...Wo,link:he(/^!?\[(label)\]\((.*?)\)/).replace("label",Jn).getRegex(),reflink:he(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jn).getRegex()},Go={...Wo,emStrongRDelimAst:gu,emStrongLDelim:fu,delLDelim:bu,delRDelim:yu,url:he(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",wr).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:he(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",wr).getRegex()},_u={...Go,br:he(hr).replace("{2,}","*").getRegex(),text:he(Go.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Qn={normal:Uo,gfm:ou,pedantic:iu},_n={normal:Wo,gfm:Go,breaks:_u,pedantic:Cu},Au={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Nr=t=>Au[t];function yt(t,o){if(o){if(Ge.escapeTest.test(t))return t.replace(Ge.escapeReplace,Nr)}else if(Ge.escapeTestNoEncode.test(t))return t.replace(Ge.escapeReplaceNoEncode,Nr);return t}function Sr(t){try{t=encodeURI(t).replace(Ge.percentDecode,"%")}catch{return null}return t}function Tr(t,o){var s;let n=t.replace(Ge.findPipe,(c,u,d)=>{let m=!1,p=u;for(;--p>=0&&d[p]==="\\";)m=!m;return m?"|":" |"}),i=n.split(Ge.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!((s=i.at(-1))!=null&&s.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(Ge.slashPipe,"|");return i}function zt(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 Cr(t){let o=t.split(`
67
- `),n=o.length-1;for(;n>=0&&Ge.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
68
- `)}function Mu(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 Ru(t,o=0){let n=o,i="";for(let r of t)if(r===" "){let s=4-n%4;i+=" ".repeat(s),n+=s}else i+=r,n++;return i}function _r(t,o,n,i,r){let s=o.href,c=o.title||null,u=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:c,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,d}function Bu(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let r=i[1];return o.split(`
69
- `).map(s=>{let c=s.match(n.other.beginningSpace);if(c===null)return s;let[u]=c;return u.length>=r.length?s.slice(r.length):s}).join(`
70
- `)}var eo=class{constructor(t){Ae(this,"options");Ae(this,"rules");Ae(this,"lexer");this.options=t||Wt}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]:Cr(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=Bu(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=zt(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:zt(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:zt(o[0],`
72
- `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=zt(o[0],`
65
+ `,yr=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,r=o,i=e.ref($n(n.data)),s=e.ref(null),c=e.ref(null),u=e.computed(()=>{try{const B=Vn(i.value||"");return s.value=null,B}catch(B){return s.value=B.message,{id:"preview_fallback",text:i.value||"(空)",children:[]}}}),d=e.computed(()=>Ct(u.value));let g=null;e.watch(i,()=>{g&&clearTimeout(g),g=setTimeout(()=>{var B;return(B=c.value)==null?void 0:B.resetView()},250)});function b(){try{const B=Vn(i.value||"");s.value=null,r("import",B)}catch(B){s.value=B.message}}function w(){i.value=$n(n.data),s.value=null,e.nextTick(()=>{var B;return(B=c.value)==null?void 0:B.resetView()})}function N(){i.value="",s.value=null,e.nextTick(()=>{var B;return(B=c.value)==null?void 0:B.resetView()})}function V(){const B=document.createElement("input");B.type="file",B.accept=".md,text/markdown,text/plain",B.onchange=()=>{var k;const T=(k=B.files)==null?void 0:k[0];if(!T)return;const E=new FileReader;E.onload=()=>{typeof E.result=="string"&&(i.value=E.result,s.value=null,e.nextTick(()=>{var m;return(m=c.value)==null?void 0:m.resetView()}))},E.readAsText(T)},B.click()}function _(){const B=new Blob([i.value],{type:"text/markdown;charset=utf-8"}),T=URL.createObjectURL(B),E=document.createElement("a");E.href=T;const k=(n.data.text||"mindmap").trim()||"mindmap";E.download=`${k}.md`,E.click(),URL.revokeObjectURL(T)}function $(){i.value=Kd,s.value=null,e.nextTick(()=>{var B;return(B=c.value)==null?void 0:B.resetView()})}return(B,T)=>(e.openBlock(),e.createElementBlock("div",$d,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:V},[...T[1]||(T[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:_},[...T[2]||(T[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)])]),T[3]||(T[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:$},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:w},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:N},"清空")]),s.value?(e.openBlock(),e.createElementBlock("div",Pd,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Fd,[e.createElementVNode("div",Ud,[T[4]||(T[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":T[0]||(T[0]=E=>i.value=E),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,i.value]])]),e.createElementVNode("div",Hd,[T[5]||(T[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Wd,[e.createVNode(Fo,{ref_key:"previewRef",ref:c,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Gd,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!i.value.trim(),onClick:b},"应用到导图",8,jd)])]))}}),Yd={class:"zm-settings-panel"},qd={class:"zm-settings-section"},Xd={class:"zm-settings-field"},Zd={class:"zm-settings-control"},Jd={class:"zm-color-input-wrap"},Qd=["value"],eu={class:"zm-color-input-text"},tu={class:"zm-swatch-row zm-swatch-row--compact"},nu=["title","onClick"],ou={class:"zm-settings-field"},ru=["value"],iu={class:"zm-slider"},lu=["value"],au={class:"zm-settings-field"},su=["value"],cu={class:"zm-slider"},du=["value"],uu={class:"zm-settings-field"},fu={class:"zm-line-style-group"},mu=["title","onClick"],pu=["viewBox"],gu={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},hu={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},bu={class:"zm-line-style-label"},ku={class:"zm-settings-field"},yu={key:0,class:"zm-palette-dropdown"},Eu={class:"zm-settings-field"},xu=["value"],wu={label:"内置配色"},Nu=["value"],Su={key:0,label:"自定义"},Tu=["value"],Cu={key:0,class:"zm-palette-preview-bar"},Au={key:1,class:"zm-palette-custom-editor"},_u=["value"],Mu={class:"zm-palette-custom-actions"},Ru={class:"zm-settings-field"},vu={class:"zm-settings-field"},Bu={class:"zm-settings-preview"},zu={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},Iu=["x1","y1","x2","y2","stroke","stroke-width"],Ou={key:0,class:"zm-settings-section"},Lu={class:"zm-settings-section-title"},Du={key:0,class:"zm-settings-section-sub"},Vu={class:"zm-settings-field"},$u={class:"zm-settings-value-tag"},Pu={class:"zm-swatch-row"},Fu=["title","onClick"],Uu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},Hu=["value"],Wu={class:"zm-settings-field"},Gu={class:"zm-settings-value-tag"},ju={class:"zm-swatch-row"},Ku=["title","onClick"],Yu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},qu=["value"],Xu={class:"zm-settings-field"},Zu=["value"],Ju=["value"],Qu={class:"zm-settings-field"},ef=["value"],tf={class:"zm-slider"},nf=["value"],of={class:"zm-settings-section zm-settings-section--actions"},Er=((t,o)=>{const n=t.__vccOpts||t;for(const[r,i]of o)n[r]=i;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{},nodeStyle:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,r=o;function i(v,x){r("update:settings",{[v]:x})}const s=[{value:"curve",label:"圆弧",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"}],c=[{value:100,label:"100"},{value:200,label:"200"},{value:300,label:"300"},{value:400,label:"400 (常规)"},{value:500,label:"500"},{value:600,label:"600 (半粗)"},{value:700,label:"700 (粗体)"},{value:800,label:"800"},{value:900,label:"900"}];function u(v){r("update:nodeStyle",v)}const d=e.computed(()=>[...Jt,...n.settings.customPalettes]),g=e.reactive({});function b(v){return g[v.id]===void 0&&(g[v.id]=v.colors.join(`
66
+ `)),g[v.id]}function w(v){const x=g[v.id]??"",j=Ea(x);if(j.length===0){g[v.id]=v.colors.join(`
67
+ `);return}const K=n.settings.customPalettes.map(ne=>ne.id===v.id?{...ne,colors:j}:ne);r("update:settings",{customPalettes:K})}function N(){const v=d.value.find(ce=>ce.id===n.settings.branchPaletteId),x=v?[...v.colors]:[...Jt[0].colors],j="custom-";let K=j+(n.settings.customPalettes.length+1);for(;Jt.some(ce=>ce.id===K)||n.settings.customPalettes.some(ce=>ce.id===K);)K=j+Math.random().toString(36).slice(2,7);const ne={id:K,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:x};r("update:settings",{customPalettes:[...n.settings.customPalettes,ne],branchPaletteId:K}),g[K]=x.join(`
68
+ `)}function V(v){const x=n.settings.customPalettes.filter(K=>K.id!==v.id),j=n.settings.branchPaletteId===v.id?"default":n.settings.branchPaletteId;r("update:settings",{customPalettes:x,...j!==n.settings.branchPaletteId?{branchPaletteId:j}:{}}),delete g[v.id]}const _=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],$=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],B=[0,1,2,3],T=["#f87171","#fb923c","#34d399","#818cf8"];function E(v,x,j,K){if(x<=1)return j;const ne=v/(x-1);return j+(K-j)*ne}function k(v,x,j){return v<=0?x:v===1?Math.max(1.5,x*.67):v===2?Math.max(.8,x*.42):j}const m=e.computed(()=>{const v=n.settings.lineWidthStart,x=n.settings.lineWidthEnd,j=n.settings.taperedEdge,K=B.length,ne=8,ce=192,re=d.value.find(ee=>ee.id===n.settings.branchPaletteId),Y=re&&re.colors.length?re.colors:T;return B.map((ee,ie)=>{const z=10+ie*60/(K-1);return{x1:ne,y1:z,x2:ce,y2:z,w:j?k(ee,v,x):E(ee,K,v,x),color:n.settings.rainbowBranch?Y[ie%Y.length]:"#94a3b8"}})});return(v,x)=>{var j,K,ne,ce,re,Y,ee,ie;return e.openBlock(),e.createElementBlock("div",Yd,[e.createElementVNode("section",qd,[x[35]||(x[35]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Xd,[x[21]||(x[21]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Zd,[e.createElementVNode("label",Jd,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:x[0]||(x[0]=z=>i("canvasBg",z.target.value))},null,40,Qd),e.createElementVNode("span",eu,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",tu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList($,z=>e.createElementVNode("button",{key:"cbg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:C=>i("canvasBg",z)},null,14,nu)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:x[1]||(x[1]=z=>i("canvasBg",void 0))},"∅")]),x[36]||(x[36]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",ou,[x[22]||(x[22]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端 (根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:x[2]||(x[2]=z=>i("lineWidthStart",parseFloat(z.target.value)||0))},null,40,ru)]),e.createElementVNode("div",iu,[x[23]||(x[23]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:x[3]||(x[3]=z=>i("lineWidthStart",parseFloat(z.target.value)))},null,40,lu)]),e.createElementVNode("div",au,[x[24]||(x[24]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端 (子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:x[4]||(x[4]=z=>i("lineWidthEnd",parseFloat(z.target.value)||0))},null,40,su)]),e.createElementVNode("div",cu,[x[25]||(x[25]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:x[5]||(x[5]=z=>i("lineWidthEnd",parseFloat(z.target.value)))},null,40,du)]),x[37]||(x[37]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",uu,[x[26]||(x[26]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",fu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,z=>e.createElementVNode("button",{key:z.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===z.value}]),title:z.label,onClick:C=>i("lineStyle",z.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:z.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[z.value==="curve"?(e.openBlock(),e.createElementBlock("path",gu)):(e.openBlock(),e.createElementBlock("line",hu))],8,pu)),e.createElementVNode("span",bu,e.toDisplayString(z.label),1)],10,mu)),64))])]),e.createElementVNode("div",ku,[x[28]||(x[28]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:x[6]||(x[6]=z=>i("rainbowBranch",!t.settings.rainbowBranch))},[...x[27]||(x[27]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",yu,[e.createElementVNode("div",Eu,[x[29]||(x[29]=e.createElementVNode("span",{class:"zm-settings-label"},"配色方案",-1)),e.createElementVNode("select",{class:"zm-select",value:t.settings.branchPaletteId,onChange:x[7]||(x[7]=z=>i("branchPaletteId",z.target.value))},[e.createElementVNode("optgroup",wu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Jt),z=>(e.openBlock(),e.createElementBlock("option",{key:z.id,value:z.id},e.toDisplayString(z.name),9,Nu))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("optgroup",Su,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,z=>(e.openBlock(),e.createElementBlock("option",{key:z.id,value:z.id},e.toDisplayString(z.name),9,Tu))),128))])):e.createCommentVNode("",!0)],40,xu)]),d.value.find(z=>z.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Cu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((j=d.value.find(z=>z.id===t.settings.branchPaletteId))==null?void 0:j.colors,(z,C)=>(e.openBlock(),e.createElementBlock("span",{key:C,class:"zm-palette-preview-swatch",style:e.normalizeStyle({background:z})},null,4))),128))])):e.createCommentVNode("",!0),t.settings.customPalettes.find(z=>z.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Au,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:b(t.settings.customPalettes.find(z=>z.id===t.settings.branchPaletteId)),onInput:x[8]||(x[8]=z=>g[t.settings.customPalettes.find(C=>C.id===t.settings.branchPaletteId).id]=z.target.value)},null,40,_u),e.createElementVNode("div",Mu,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:x[9]||(x[9]=z=>w(t.settings.customPalettes.find(C=>C.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:x[10]||(x[10]=z=>V(t.settings.customPalettes.find(C=>C.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:N},"+ 新建配色")])):e.createCommentVNode("",!0),x[38]||(x[38]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Ru,[x[31]||(x[31]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:x[11]||(x[11]=z=>i("taperedEdge",!t.settings.taperedEdge))},[...x[30]||(x[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",vu,[x[33]||(x[33]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:x[12]||(x[12]=z=>i("showOrderBadge",!t.settings.showOrderBadge))},[...x[32]||(x[32]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Bu,[(e.openBlock(),e.createElementBlock("svg",zu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(z,C)=>(e.openBlock(),e.createElementBlock("line",{key:C,x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,stroke:t.settings.rainbowBranch?z.color:"#94a3b8","stroke-width":z.w,"stroke-linecap":"butt"},null,8,Iu))),128))])),x[34]||(x[34]=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",Ou,[e.createElementVNode("h4",Lu,[x[39]||(x[39]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Du,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Vu,[x[40]||(x[40]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",$u,e.toDisplayString(((K=t.nodeStyle)==null?void 0:K.bg)||"默认"),1)]),e.createElementVNode("div",Pu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,z=>{var C;return e.createElementVNode("button",{key:"bg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":((C=t.nodeStyle)==null?void 0:C.bg)===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:F=>u({bg:z})},null,14,Fu)}),64)),e.createElementVNode("label",Uu,[e.createElementVNode("input",{type:"color",value:((ne=t.nodeStyle)==null?void 0:ne.bg)||"#ffffff",onInput:x[13]||(x[13]=z=>u({bg:z.target.value}))},null,40,Hu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[14]||(x[14]=z=>u({bg:void 0}))},"∅")]),e.createElementVNode("div",Wu,[x[41]||(x[41]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",Gu,e.toDisplayString(((ce=t.nodeStyle)==null?void 0:ce.textColor)||"默认"),1)]),e.createElementVNode("div",ju,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,z=>{var C;return e.createElementVNode("button",{key:"fg-"+z,class:e.normalizeClass(["zm-swatch",{"is-active":((C=t.nodeStyle)==null?void 0:C.textColor)===z}]),style:e.normalizeStyle({background:z}),title:z,onClick:F=>u({textColor:z})},null,14,Ku)}),64)),e.createElementVNode("label",Yu,[e.createElementVNode("input",{type:"color",value:((re=t.nodeStyle)==null?void 0:re.textColor)||"#1e2937",onInput:x[15]||(x[15]=z=>u({textColor:z.target.value}))},null,40,qu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:x[16]||(x[16]=z=>u({textColor:void 0}))},"∅")]),x[45]||(x[45]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Xu,[x[42]||(x[42]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((Y=t.nodeStyle)==null?void 0:Y.fontWeight)??400,onChange:x[17]||(x[17]=z=>u({fontWeight:parseInt(z.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,z=>e.createElementVNode("option",{key:z.value,value:z.value},e.toDisplayString(z.label),9,Ju)),64))],40,Zu)]),e.createElementVNode("div",Qu,[x[43]||(x[43]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((ee=t.nodeStyle)==null?void 0:ee.fontSize)??14,onChange:x[18]||(x[18]=z=>u({fontSize:parseInt(z.target.value)||14}))},null,40,ef)]),e.createElementVNode("div",tf,[x[44]||(x[44]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ie=t.nodeStyle)==null?void 0:ie.fontSize)??14,onInput:x[19]||(x[19]=z=>u({fontSize:parseInt(z.target.value)}))},null,40,nf)]),x[46]||(x[46]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",of,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:x[20]||(x[20]=z=>r("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-3fc1672c"]]),Zi=20;function rf(t,o){t.style.height="auto";const n=o.minRows*Zi,r=o.maxRows>0?o.maxRows*Zi:1/0,i=Math.max(n,Math.min(r,t.scrollHeight));t.style.height=i+"px",t.style.overflowY=t.scrollHeight>r?"auto":"hidden"}function xr(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function r(){const s=t.value;s&&rf(s,n)}function i(){r()}e.onMounted(async()=>{await e.nextTick();const s=t.value;s&&(s.addEventListener("input",i),r())}),e.watch(()=>{var s;return(s=t.value)==null?void 0:s.value},()=>r()),e.onBeforeUnmount(()=>{const s=t.value;s&&s.removeEventListener("input",i)})}function wr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _n=wr();function Ji(t){_n=t}var Mn={exec:()=>null};function Wn(t){let o=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=o[r];return i||(i=t(r),o[r]=i),i}}function xe(t,o=""){let n=typeof t=="string"?t:t.source,r={replace:(i,s)=>{let c=typeof s=="string"?s:s.source;return c=c.replace(ot.caret,"$1"),n=n.replace(i,c),r},getRegex:()=>new RegExp(n,o)};return r}var lf=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ot={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:Wn(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Wn(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Wn(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Wn(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Wn(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Wn(t=>new RegExp(`^ {0,${t}}>`))},af=/^(?:[ \t]*(?:\n|$))+/,sf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,io=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,df=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Nr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Qi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,el=xe(Qi).replace(/bull/g,Nr).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(),uf=xe(Qi).replace(/bull/g,Nr).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(),Sr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ff=/^[^\n]+/,Tr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,mf=xe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Tr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pf=xe(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Nr).getRegex(),Uo="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",Cr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gf=xe("^ {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",Cr).replace("tag",Uo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),tl=xe(Sr).replace("hr",io).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",Uo).getRegex(),hf=xe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",tl).getRegex(),Ar={blockquote:hf,code:sf,def:mf,fences:cf,heading:df,hr:io,html:gf,lheading:el,list:pf,newline:af,paragraph:tl,table:Mn,text:ff},nl=xe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",io).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",Uo).getRegex(),bf={...Ar,lheading:uf,table:nl,paragraph:xe(Sr).replace("hr",io).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",nl).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",Uo).getRegex()},kf={...Ar,html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Cr).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:Mn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xe(Sr).replace("hr",io).replace("heading",` *#{1,6} *[^
69
+ ]`).replace("lheading",el).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},yf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ef=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ol=/^( {2,}|\\)\n(?!\s*$)/,xf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Gn=/[\p{P}\p{S}]/u,Ho=/[\s\p{P}\p{S}]/u,_r=/[^\s\p{P}\p{S}]/u,wf=xe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ho).getRegex(),rl=/(?!~)[\p{P}\p{S}]/u,Nf=/(?!~)[\s\p{P}\p{S}]/u,Sf=/(?:[^\s\p{P}\p{S}]|~)/u,Tf=xe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",lf?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),il=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Cf=xe(il,"u").replace(/punct/g,Gn).getRegex(),Af=xe(il,"u").replace(/punct/g,rl).getRegex(),ll="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_f=xe(ll,"gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,Ho).replace(/punct/g,Gn).getRegex(),Mf=xe(ll,"gu").replace(/notPunctSpace/g,Sf).replace(/punctSpace/g,Nf).replace(/punct/g,rl).getRegex(),Rf=xe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,Ho).replace(/punct/g,Gn).getRegex(),vf=xe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Gn).getRegex(),Bf="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",zf=xe(Bf,"gu").replace(/notPunctSpace/g,_r).replace(/punctSpace/g,Ho).replace(/punct/g,Gn).getRegex(),If=xe(/\\(punct)/,"gu").replace(/punct/g,Gn).getRegex(),Of=xe(/^<(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(),Lf=xe(Cr).replace("(?:-->|$)","-->").getRegex(),Df=xe("^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",Lf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Wo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Vf=xe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Wo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),al=xe(/^!?\[(label)\]\[(ref)\]/).replace("label",Wo).replace("ref",Tr).getRegex(),sl=xe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tr).getRegex(),$f=xe("reflink|nolink(?!\\()","g").replace("reflink",al).replace("nolink",sl).getRegex(),cl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Mr={_backpedal:Mn,anyPunctuation:If,autolink:Of,blockSkip:Tf,br:ol,code:Ef,del:Mn,delLDelim:Mn,delRDelim:Mn,emStrongLDelim:Cf,emStrongRDelimAst:_f,emStrongRDelimUnd:Rf,escape:yf,link:Vf,nolink:sl,punctuation:wf,reflink:al,reflinkSearch:$f,tag:Df,text:xf,url:Mn},Pf={...Mr,link:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Wo).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Wo).getRegex()},Rr={...Mr,emStrongRDelimAst:Mf,emStrongLDelim:Af,delLDelim:vf,delRDelim:zf,url:xe(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",cl).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:xe(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",cl).getRegex()},Ff={...Rr,br:xe(ol).replace("{2,}","*").getRegex(),text:xe(Rr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Go={normal:Ar,gfm:bf,pedantic:kf},lo={normal:Mr,gfm:Rr,breaks:Ff,pedantic:Pf},Uf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},dl=t=>Uf[t];function Ut(t,o){if(o){if(ot.escapeTest.test(t))return t.replace(ot.escapeReplace,dl)}else if(ot.escapeTestNoEncode.test(t))return t.replace(ot.escapeReplaceNoEncode,dl);return t}function ul(t){try{t=encodeURI(t).replace(ot.percentDecode,"%")}catch{return null}return t}function fl(t,o){var s;let n=t.replace(ot.findPipe,(c,u,d)=>{let g=!1,b=u;for(;--b>=0&&d[b]==="\\";)g=!g;return g?"|":" |"}),r=n.split(ot.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),o)if(r.length>o)r.splice(o);else for(;r.length<o;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(ot.slashPipe,"|");return r}function mn(t,o,n){let r=t.length;if(r===0)return"";let i=0;for(;i<r&&t.charAt(r-i-1)===o;)i++;return t.slice(0,r-i)}function ml(t){let o=t.split(`
70
+ `),n=o.length-1;for(;n>=0&&ot.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
71
+ `)}function Hf(t,o){if(t.indexOf(o[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===o[0])n++;else if(t[r]===o[1]&&(n--,n<0))return r;return n>0?-2:-1}function Wf(t,o=0){let n=o,r="";for(let i of t)if(i===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=i,n++;return r}function pl(t,o,n,r,i){let s=o.href,c=o.title||null,u=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:c,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,d}function Gf(t,o,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return o;let i=r[1];return o.split(`
72
+ `).map(s=>{let c=s.match(n.other.beginningSpace);if(c===null)return s;let[u]=c;return u.length>=i.length?s.slice(i.length):s}).join(`
73
+ `)}var jo=class{constructor(t){Re(this,"options");Re(this,"rules");Re(this,"lexer");this.options=t||_n}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]:ml(o[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],r=Gf(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:r}}}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 r=mn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:mn(o[0],`
74
+ `),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:mn(o[0],`
75
+ `)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=mn(o[0],`
73
76
  `).split(`
74
- `),i="",r="",s=[];for(;n.length>0;){let c=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),c=!0;else if(!c)u.push(n[d]);else break;n=n.slice(d);let m=u.join(`
75
- `),p=m.replace(this.rules.other.blockquoteSetextReplace,`
76
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
77
- ${m}`:m,r=r?`${r}
78
- ${p}`:p;let k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=k,n.length===0)break;let y=s.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let w=y,E=w.raw+`
77
+ `),r="",i="",s=[];for(;n.length>0;){let c=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),c=!0;else if(!c)u.push(n[d]);else break;n=n.slice(d);let g=u.join(`
78
+ `),b=g.replace(this.rules.other.blockquoteSetextReplace,`
79
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
80
+ ${g}`:g,i=i?`${i}
81
+ ${b}`:b;let w=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,s,!0),this.lexer.state.top=w,n.length===0)break;let N=s.at(-1);if((N==null?void 0:N.type)==="code")break;if((N==null?void 0:N.type)==="blockquote"){let V=N,_=V.raw+`
79
82
  `+n.join(`
80
- `),L=this.blockquote(E);s[s.length-1]=L,i=i.substring(0,i.length-w.raw.length)+L.raw,r=r.substring(0,r.length-w.text.length)+L.text;break}else if((y==null?void 0:y.type)==="list"){let w=y,E=w.raw+`
83
+ `),$=this.blockquote(_);s[s.length-1]=$,r=r.substring(0,r.length-V.raw.length)+$.raw,i=i.substring(0,i.length-V.text.length)+$.text;break}else if((N==null?void 0:N.type)==="list"){let V=N,_=V.raw+`
81
84
  `+n.join(`
82
- `),L=this.list(E);s[s.length-1]=L,i=i.substring(0,i.length-y.raw.length)+L.raw,r=r.substring(0,r.length-w.raw.length)+L.raw,n=E.substring(s.at(-1).raw.length).split(`
83
- `);continue}}return{type:"blockquote",raw:i,tokens:s,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 s=this.rules.other.listItemRegex(n),c=!1;for(;t;){let d=!1,m="",p="";if(!(o=s.exec(t))||this.rules.block.hr.test(t))break;m=o[0],t=t.substring(m.length);let k=Ru(o[2].split(`
84
- `,1)[0],o[1].length),y=t.split(`
85
- `,1)[0],w=!k.trim(),E=0;if(this.options.pedantic?(E=2,p=k.trimStart()):w?E=o[1].length+1:(E=k.search(this.rules.other.nonSpaceChar),E=E>4?1:E,p=k.slice(E),E+=o[1].length),w&&this.rules.other.blankLine.test(y)&&(m+=y+`
86
- `,t=t.substring(y.length+1),d=!0),!d){let L=this.rules.other.nextBulletRegex(E),C=this.rules.other.hrRegex(E),x=this.rules.other.fencesBeginRegex(E),R=this.rules.other.headingBeginRegex(E),S=this.rules.other.htmlBeginRegex(E),g=this.rules.other.blockquoteBeginRegex(E);for(;t;){let _=t.split(`
87
- `,1)[0],b;if(y=_,this.options.pedantic?(y=y.replace(this.rules.other.listReplaceNesting," "),b=y):b=y.replace(this.rules.other.tabCharGlobal," "),x.test(y)||R.test(y)||S.test(y)||g.test(y)||L.test(y)||C.test(y))break;if(b.search(this.rules.other.nonSpaceChar)>=E||!y.trim())p+=`
88
- `+b.slice(E);else{if(w||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(k)||R.test(k)||C.test(k))break;p+=`
89
- `+y}w=!y.trim(),m+=_+`
90
- `,t=t.substring(_.length+1),k=b.slice(E)}}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 d of r.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let m=d.tokens[0];if(d.task&&((m==null?void 0:m.type)==="text"||(m==null?void 0:m.type)==="paragraph")){d.text=d.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 k=this.lexer.inlineQueue.length-1;k>=0;k--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)){this.lexer.inlineQueue[k].src=this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(d.raw);if(p){let k={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};d.checked=k.checked,r.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=k.raw+d.tokens[0].raw,d.tokens[0].text=k.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(k)):d.tokens.unshift({type:"paragraph",raw:k.raw,text:k.raw,tokens:[k]}):d.tokens.unshift(k)}}else d.task&&(d.task=!1);if(!r.loose){let p=d.tokens.filter(y=>y.type==="space"),k=p.length>0&&p.some(y=>this.rules.other.anyLine.test(y.raw));r.loose=k}}if(r.loose)for(let d of r.items){d.loose=!0;for(let m of d.tokens)m.type==="text"&&(m.type="paragraph")}return r}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Cr(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:zt(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=Tr(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
- `):[],s={type:"table",raw:zt(o[0],`
93
- `),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?s.align.push("right"):this.rules.other.tableAlignCenter.test(u)?s.align.push("center"):this.rules.other.tableAlignLeft.test(u)?s.align.push("left"):s.align.push(null);for(let u=0;u<n.length;u++)s.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:s.align[u]});for(let u of r)s.rows.push(Tr(u,s.header.length).map((d,m)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:s.align[m]})));return s}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:zt(o[0],`
85
+ `),$=this.list(_);s[s.length-1]=$,r=r.substring(0,r.length-N.raw.length)+$.raw,i=i.substring(0,i.length-V.raw.length)+$.raw,n=_.substring(s.at(-1).raw.length).split(`
86
+ `);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),c=!1;for(;t;){let d=!1,g="",b="";if(!(o=s.exec(t))||this.rules.block.hr.test(t))break;g=o[0],t=t.substring(g.length);let w=Wf(o[2].split(`
87
+ `,1)[0],o[1].length),N=t.split(`
88
+ `,1)[0],V=!w.trim(),_=0;if(this.options.pedantic?(_=2,b=w.trimStart()):V?_=o[1].length+1:(_=w.search(this.rules.other.nonSpaceChar),_=_>4?1:_,b=w.slice(_),_+=o[1].length),V&&this.rules.other.blankLine.test(N)&&(g+=N+`
89
+ `,t=t.substring(N.length+1),d=!0),!d){let $=this.rules.other.nextBulletRegex(_),B=this.rules.other.hrRegex(_),T=this.rules.other.fencesBeginRegex(_),E=this.rules.other.headingBeginRegex(_),k=this.rules.other.htmlBeginRegex(_),m=this.rules.other.blockquoteBeginRegex(_);for(;t;){let v=t.split(`
90
+ `,1)[0],x;if(N=v,this.options.pedantic?(N=N.replace(this.rules.other.listReplaceNesting," "),x=N):x=N.replace(this.rules.other.tabCharGlobal," "),T.test(N)||E.test(N)||k.test(N)||m.test(N)||$.test(N)||B.test(N))break;if(x.search(this.rules.other.nonSpaceChar)>=_||!N.trim())b+=`
91
+ `+x.slice(_);else{if(V||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(w)||E.test(w)||B.test(w))break;b+=`
92
+ `+N}V=!N.trim(),g+=v+`
93
+ `,t=t.substring(v.length+1),w=x.slice(_)}}i.loose||(c?i.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),i.items.push({type:"list_item",raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(b),loose:!1,text:b,tokens:[]}),i.raw+=g}let u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let d of i.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let g=d.tokens[0];if(d.task&&((g==null?void 0:g.type)==="text"||(g==null?void 0:g.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),g.raw=g.raw.replace(this.rules.other.listReplaceTask,""),g.text=g.text.replace(this.rules.other.listReplaceTask,"");for(let w=this.lexer.inlineQueue.length-1;w>=0;w--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[w].src)){this.lexer.inlineQueue[w].src=this.lexer.inlineQueue[w].src.replace(this.rules.other.listReplaceTask,"");break}let b=this.rules.other.listTaskCheckbox.exec(d.raw);if(b){let w={type:"checkbox",raw:b[0]+" ",checked:b[0]!=="[ ]"};d.checked=w.checked,i.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=w.raw+d.tokens[0].raw,d.tokens[0].text=w.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(w)):d.tokens.unshift({type:"paragraph",raw:w.raw,text:w.raw,tokens:[w]}):d.tokens.unshift(w)}}else d.task&&(d.task=!1);if(!i.loose){let b=d.tokens.filter(N=>N.type==="space"),w=b.length>0&&b.some(N=>this.rules.other.anyLine.test(N.raw));i.loose=w}}if(i.loose)for(let d of i.items){d.loose=!0;for(let g of d.tokens)g.type==="text"&&(g.type="paragraph")}return i}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=ml(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," "),r=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:mn(o[0],`
94
+ `),href:r,title:i}}}table(t){var c;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=fl(o[1]),r=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(c=o[3])!=null&&c.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
95
+ `):[],s={type:"table",raw:mn(o[0],`
96
+ `),header:[],align:[],rows:[]};if(n.length===r.length){for(let u of r)this.rules.other.tableAlignRight.test(u)?s.align.push("right"):this.rules.other.tableAlignCenter.test(u)?s.align.push("center"):this.rules.other.tableAlignLeft.test(u)?s.align.push("left"):s.align.push(null);for(let u=0;u<n.length;u++)s.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:s.align[u]});for(let u of i)s.rows.push(fl(u,s.header.length).map((d,g)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:s.align[g]})));return s}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:mn(o[0],`
94
97
  `),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 s=zt(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Mu(o[2],"()");if(s===-2)return;if(s>-1){let c=(o[0].indexOf("!")===0?5:4)+o[1].length+s;o[2]=o[2].substring(0,s),o[0]=o[0].substring(0,c).trim(),o[3]=""}}let i=o[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[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)),_r(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 s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return _r(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,s,c,u=r,d=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(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(c=[...s].length,i[3]||i[4]){u+=c;continue}else if((i[5]||i[6])&&r%3&&!((r+c)%3)){d+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+d);let p=[...i[0]][0].length,k=t.slice(0,r+i.index+p+c);if(Math.min(r,c)%2){let w=k.slice(1,-1);return{type:"em",raw:k,text:w,tokens:this.lexer.inlineTokens(w)}}let y=k.slice(2,-2);return{type:"strong",raw:k,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,s,c,u=r,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+r);(i=d.exec(o))!==null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s||(c=[...s].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),k=p.slice(r,-r);return{type:"del",raw:p,text:k,tokens:this.lexer.inlineTokens(k)}}}}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 s;do s=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(s!==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}}}},mt=class si{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||Wt,this.options.tokenizer=this.options.tokenizer||new eo,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:Ge,block:Qn.normal,inline:_n.normal};this.options.pedantic?(n.block=Qn.pedantic,n.inline=_n.pedantic):this.options.gfm&&(n.block=Qn.gfm,this.options.breaks?n.inline=_n.breaks:n.inline=_n.gfm),this.tokenizer.rules=n}static get rules(){return{block:Qn,inline:_n}}static lex(o,n){return new si(n).lex(o)}static lexInline(o,n){return new si(n).inlineTokens(o)}lex(o){o=o.replace(Ge.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 s,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(Ge.tabCharGlobal," ").replace(Ge.spaceLine,""));let r=1/0;for(;o;){if(o.length<r)r=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((c=(s=this.options.extensions)==null?void 0:s.block)!=null&&c.some(p=>(d=p.call({lexer:this},o,n))?(o=o.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.space(o)){o=o.substring(d.raw.length);let p=n.at(-1);d.raw.length===1&&p!==void 0?p.raw+=`
97
- `:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.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
+ `?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 s=mn(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Hf(o[2],"()");if(s===-2)return;if(s>-1){let c=(o[0].indexOf("!")===0?5:4)+o[1].length+s;o[2]=o[2].substring(0,s),o[0]=o[0].substring(0,c).trim(),o[3]=""}}let r=o[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=o[3]?o[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),pl(o,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.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 r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=o[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return pl(n,i,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,c,u=i,d=0,g=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,o=o.slice(-1*t.length+i);(r=g.exec(o))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(c=[...s].length,r[3]||r[4]){u+=c;continue}else if((r[5]||r[6])&&i%3&&!((i+c)%3)){d+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+d);let b=[...r[0]][0].length,w=t.slice(0,i+r.index+b+c);if(Math.min(i,c)%2){let V=w.slice(1,-1);return{type:"em",raw:w,text:V,tokens:this.lexer.inlineTokens(V)}}let N=w.slice(2,-2);return{type:"strong",raw:w,text:N,tokens:this.lexer.inlineTokens(N)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw: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 r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,c,u=i,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+i);(r=d.exec(o))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(c=[...s].length,c!==i))continue;if(r[3]||r[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let g=[...r[0]][0].length,b=t.slice(0,i+r.index+g+c),w=b.slice(i,-i);return{type:"del",raw:b,text:w,tokens:this.lexer.inlineTokens(w)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,r;return o[2]==="@"?(n=o[1],r="mailto:"+n):(n=o[1],r=n),{type:"link",raw:o[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let r,i;if(o[2]==="@")r=o[0],i="mailto:"+r;else{let s;do s=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(s!==o[0]);r=o[0],o[1]==="www."?i="http://"+o[0]:i=o[0]}return{type:"link",raw:o[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}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}}}},zt=class Kr{constructor(o){Re(this,"tokens");Re(this,"options");Re(this,"state");Re(this,"inlineQueue");Re(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||_n,this.options.tokenizer=this.options.tokenizer||new jo,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:ot,block:Go.normal,inline:lo.normal};this.options.pedantic?(n.block=Go.pedantic,n.inline=lo.pedantic):this.options.gfm&&(n.block=Go.gfm,this.options.breaks?n.inline=lo.breaks:n.inline=lo.gfm),this.tokenizer.rules=n}static get rules(){return{block:Go,inline:lo}}static lex(o,n){return new Kr(n).lex(o)}static lexInline(o,n){return new Kr(n).inlineTokens(o)}lex(o){o=o.replace(ot.carriageReturn,`
99
+ `),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],r=!1){var s,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(ot.tabCharGlobal," ").replace(ot.spaceLine,""));let i=1/0;for(;o;){if(o.length<i)i=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((c=(s=this.options.extensions)==null?void 0:s.block)!=null&&c.some(b=>(d=b.call({lexer:this},o,n))?(o=o.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.space(o)){o=o.substring(d.raw.length);let b=n.at(-1);d.raw.length===1&&b!==void 0?b.raw+=`
100
+ `:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.raw.length);let b=n.at(-1);(b==null?void 0:b.type)==="paragraph"||(b==null?void 0:b.type)==="text"?(b.raw+=(b.raw.endsWith(`
98
101
  `)?"":`
99
- `)+d.raw,p.text+=`
100
- `+d.text,this.inlineQueue.at(-1).src=p.text):n.push(d);continue}if(d=this.tokenizer.fences(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.heading(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.hr(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.blockquote(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.list(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.html(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.def(o)){o=o.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
102
+ `)+d.raw,b.text+=`
103
+ `+d.text,this.inlineQueue.at(-1).src=b.text):n.push(d);continue}if(d=this.tokenizer.fences(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.heading(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.hr(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.blockquote(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.list(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.html(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.def(o)){o=o.substring(d.raw.length);let b=n.at(-1);(b==null?void 0:b.type)==="paragraph"||(b==null?void 0:b.type)==="text"?(b.raw+=(b.raw.endsWith(`
101
104
  `)?"":`
102
- `)+d.raw,p.text+=`
103
- `+d.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let m=o;if((u=this.options.extensions)!=null&&u.startBlock){let p=1/0,k=o.slice(1),y;this.options.extensions.startBlock.forEach(w=>{y=w.call({lexer:this},k),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&&(d=this.tokenizer.paragraph(m))){let p=n.at(-1);i&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
105
+ `)+d.raw,b.text+=`
106
+ `+d.raw,this.inlineQueue.at(-1).src=b.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let g=o;if((u=this.options.extensions)!=null&&u.startBlock){let b=1/0,w=o.slice(1),N;this.options.extensions.startBlock.forEach(V=>{N=V.call({lexer:this},w),typeof N=="number"&&N>=0&&(b=Math.min(b,N))}),b<1/0&&b>=0&&(g=o.substring(0,b+1))}if(this.state.top&&(d=this.tokenizer.paragraph(g))){let b=n.at(-1);r&&(b==null?void 0:b.type)==="paragraph"?(b.raw+=(b.raw.endsWith(`
104
107
  `)?"":`
105
- `)+d.raw,p.text+=`
106
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(d),i=m.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
108
+ `)+d.raw,b.text+=`
109
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):n.push(d),r=g.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let b=n.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=(b.raw.endsWith(`
107
110
  `)?"":`
108
- `)+d.raw,p.text+=`
109
- `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var m,p,k,y,w;this.tokenizer.lexer=this;let i=o,r=null;if(this.tokens.links){let E=Object.keys(this.tokens.links);if(E.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)E.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 s;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)s=r[2]?r[2].length:0,i=i.slice(0,r.index+s)+"["+"a".repeat(r[0].length-s-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="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}c||(u=""),c=!1;let E;if((y=(k=this.options.extensions)==null?void 0:k.inline)!=null&&y.some(C=>(E=C.call({lexer:this},o,n))?(o=o.substring(E.raw.length),n.push(E),!0):!1))continue;if(E=this.tokenizer.escape(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.tag(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.link(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(E.raw.length);let C=n.at(-1);E.type==="text"&&(C==null?void 0:C.type)==="text"?(C.raw+=E.raw,C.text+=E.text):n.push(E);continue}if(E=this.tokenizer.emStrong(o,i,u)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.codespan(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.br(o)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.del(o,i,u)){o=o.substring(E.raw.length),n.push(E);continue}if(E=this.tokenizer.autolink(o)){o=o.substring(E.raw.length),n.push(E);continue}if(!this.state.inLink&&(E=this.tokenizer.url(o))){o=o.substring(E.raw.length),n.push(E);continue}let L=o;if((w=this.options.extensions)!=null&&w.startInline){let C=1/0,x=o.slice(1),R;this.options.extensions.startInline.forEach(S=>{R=S.call({lexer:this},x),typeof R=="number"&&R>=0&&(C=Math.min(C,R))}),C<1/0&&C>=0&&(L=o.substring(0,C+1))}if(E=this.tokenizer.inlineText(L)){o=o.substring(E.raw.length),E.raw.slice(-1)!=="_"&&(u=E.raw.slice(-1)),c=!0;let C=n.at(-1);(C==null?void 0:C.type)==="text"?(C.raw+=E.raw,C.text+=E.text):n.push(E);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)}},An=class{constructor(t){Ae(this,"options");Ae(this,"parser");this.options=t||Wt}space(t){return""}code({text:t,lang:o,escaped:n}){var s;let i=(s=(o||"").match(Ge.notSpaceStart))==null?void 0:s[0],r=t.replace(Ge.endingNewline,"")+`
110
- `;return i?'<pre><code class="language-'+yt(i)+'">'+(n?r:yt(r,!0))+`</code></pre>
111
- `:"<pre><code>"+(n?r:yt(r,!0))+`</code></pre>
111
+ `)+d.raw,b.text+=`
112
+ `+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=b.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var g,b,w,N,V;this.tokenizer.lexer=this;let r=o,i=null;if(this.tokens.links){let _=Object.keys(this.tokens.links);if(_.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)_.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)s=i[2]?i[2].length:0,r=r.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((b=(g=this.options.hooks)==null?void 0:g.emStrongMask)==null?void 0:b.call({lexer:this},r))??r;let c=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}c||(u=""),c=!1;let _;if((N=(w=this.options.extensions)==null?void 0:w.inline)!=null&&N.some(B=>(_=B.call({lexer:this},o,n))?(o=o.substring(_.raw.length),n.push(_),!0):!1))continue;if(_=this.tokenizer.escape(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.tag(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.link(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(_.raw.length);let B=n.at(-1);_.type==="text"&&(B==null?void 0:B.type)==="text"?(B.raw+=_.raw,B.text+=_.text):n.push(_);continue}if(_=this.tokenizer.emStrong(o,r,u)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.codespan(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.br(o)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.del(o,r,u)){o=o.substring(_.raw.length),n.push(_);continue}if(_=this.tokenizer.autolink(o)){o=o.substring(_.raw.length),n.push(_);continue}if(!this.state.inLink&&(_=this.tokenizer.url(o))){o=o.substring(_.raw.length),n.push(_);continue}let $=o;if((V=this.options.extensions)!=null&&V.startInline){let B=1/0,T=o.slice(1),E;this.options.extensions.startInline.forEach(k=>{E=k.call({lexer:this},T),typeof E=="number"&&E>=0&&(B=Math.min(B,E))}),B<1/0&&B>=0&&($=o.substring(0,B+1))}if(_=this.tokenizer.inlineText($)){o=o.substring(_.raw.length),_.raw.slice(-1)!=="_"&&(u=_.raw.slice(-1)),c=!0;let B=n.at(-1);(B==null?void 0:B.type)==="text"?(B.raw+=_.raw,B.text+=_.text):n.push(_);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return n}infiniteLoopError(o){let n="Infinite loop on byte: "+o;if(this.options.silent)console.error(n);else throw new Error(n)}},ao=class{constructor(t){Re(this,"options");Re(this,"parser");this.options=t||_n}space(t){return""}code({text:t,lang:o,escaped:n}){var s;let r=(s=(o||"").match(ot.notSpaceStart))==null?void 0:s[0],i=t.replace(ot.endingNewline,"")+`
113
+ `;return r?'<pre><code class="language-'+Ut(r)+'">'+(n?i:Ut(i,!0))+`</code></pre>
114
+ `:"<pre><code>"+(n?i:Ut(i,!0))+`</code></pre>
112
115
  `}blockquote({tokens:t}){return`<blockquote>
113
116
  ${this.parser.parse(t)}</blockquote>
114
117
  `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
115
118
  `}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",s=o&&n!==1?' start="'+n+'"':"";return"<"+r+s+`>
117
- `+i+"</"+r+`>
119
+ `}list(t){let o=t.ordered,n=t.start,r="";for(let c=0;c<t.items.length;c++){let u=t.items[c];r+=this.listitem(u)}let i=o?"ol":"ul",s=o&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
120
+ `+r+"</"+i+`>
118
121
  `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
119
122
  `}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 s=t.rows[r];n="";for(let c=0;c<s.length;c++)n+=this.tablecell(s[c]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
123
+ `}table(t){let o="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);o+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){let s=t.rows[i];n="";for(let c=0;c<s.length;c++)n+=this.tablecell(s[c]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
121
124
  <thead>
122
125
  `+o+`</thead>
123
- `+i+`</table>
126
+ `+r+`</table>
124
127
  `}tablerow({text:t}){return`<tr>
125
128
  ${t}</tr>
126
129
  `}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>${yt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let i=this.parser.parseInline(n),r=Sr(t);if(r===null)return i;t=r;let s='<a href="'+t+'"';return o&&(s+=' title="'+yt(o)+'"'),s+=">"+i+"</a>",s}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=Sr(t);if(r===null)return yt(n);t=r;let s=`<img src="${t}" alt="${yt(n)}"`;return o&&(s+=` title="${yt(o)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:yt(t.text)}},jo=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}},ft=class ci{constructor(o){Ae(this,"options");Ae(this,"renderer");Ae(this,"textRenderer");this.options=o||Wt,this.options.renderer=this.options.renderer||new An,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jo}static parse(o,n){return new ci(n).parse(o)}static parseInline(o,n){return new ci(n).parseInline(o)}parse(o){var i,r;this.renderer.parser=this;let n="";for(let s=0;s<o.length;s++){let c=o[s];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[c.type]){let d=c,m=this.options.extensions.renderers[d.type].call({parser:this},d);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.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 d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var r,s;this.renderer.parser=this;let i="";for(let c=0;c<o.length;c++){let u=o[c];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[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 d=u;switch(d.type){case"escape":{i+=n.text(d);break}case"html":{i+=n.html(d);break}case"link":{i+=n.link(d);break}case"image":{i+=n.image(d);break}case"checkbox":{i+=n.checkbox(d);break}case"strong":{i+=n.strong(d);break}case"em":{i+=n.em(d);break}case"codespan":{i+=n.codespan(d);break}case"br":{i+=n.br(d);break}case"del":{i+=n.del(d);break}case"text":{i+=n.text(d);break}default:{let m='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return i}},Mn=(no=class{constructor(t){Ae(this,"options");Ae(this,"block");this.options=t||Wt}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?mt.lex:mt.lexInline}provideParser(t=this.block){return t?ft.parse:ft.parseInline}},Ae(no,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ae(no,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),no),Ar=class{constructor(...t){Ae(this,"defaults",Do());Ae(this,"options",this.setOptions);Ae(this,"parse",this.parseMarkdown(!0));Ae(this,"parseInline",this.parseMarkdown(!1));Ae(this,"Parser",ft);Ae(this,"Renderer",An);Ae(this,"TextRenderer",jo);Ae(this,"Lexer",mt);Ae(this,"Tokenizer",eo);Ae(this,"Hooks",Mn);this.use(...t)}walkTokens(t,o){var i,r;let n=[];for(let s of t)switch(n=n.concat(o.call(this,s)),s.type){case"table":{let c=s;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of c.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let c=s;n=n.concat(this.walkTokens(c.items,o));break}default:{let c=s;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let d=c[u].flat(1/0);n=n.concat(this.walkTokens(d,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 s=o.renderers[r.name];s?o.renderers[r.name]=function(...c){let u=r.renderer.apply(this,c);return u===!1&&(u=s.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 s=o[r.level];s?s.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 An(this.defaults);for(let s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let c=s,u=n.renderer[c],d=r[c];r[c]=(...m)=>{let p=u.apply(r,m);return p===!1&&(p=d.apply(r,m)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new eo(this.defaults);for(let s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let c=s,u=n.tokenizer[c],d=r[c];r[c]=(...m)=>{let p=u.apply(r,m);return p===!1&&(p=d.apply(r,m)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new Mn;for(let s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let c=s,u=n.hooks[c],d=r[c];Mn.passThroughHooks.has(s)?r[c]=m=>{if(this.defaults.async&&Mn.passThroughHooksRespectAsync.has(s))return(async()=>{let k=await u.call(r,m);return d.call(r,k)})();let p=u.call(r,m);return d.call(r,p)}:r[c]=(...m)=>{if(this.defaults.async)return(async()=>{let k=await u.apply(r,m);return k===!1&&(k=await d.apply(r,m)),k})();let p=u.apply(r,m);return p===!1&&(p=d.apply(r,m)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(c){let u=[];return u.push(s.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 mt.lex(t,o??this.defaults)}parser(t,o){return ft.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},r={...this.defaults,...i},s=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&i.async===!1)return s(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 s(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return s(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?mt.lex:mt.lexInline)(c,r),d=r.hooks?await r.hooks.processAllTokens(u):u;r.walkTokens&&await Promise.all(this.walkTokens(d,r.walkTokens));let m=await(r.hooks?await r.hooks.provideParser(t):t?ft.parse:ft.parseInline)(d,r);return r.hooks?await r.hooks.postprocess(m):m})().catch(s);try{r.hooks&&(o=r.hooks.preprocess(o));let c=(r.hooks?r.hooks.provideLexer(t):t?mt.lex:mt.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?ft.parse:ft.parseInline)(c,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(c){return s(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>"+yt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},jt=new Ar;function _e(t,o){return jt.parse(t,o)}_e.options=_e.setOptions=function(t){return jt.setOptions(t),_e.defaults=jt.defaults,ur(_e.defaults),_e},_e.getDefaults=Do,_e.defaults=Wt,_e.use=function(...t){return jt.use(...t),_e.defaults=jt.defaults,ur(_e.defaults),_e},_e.walkTokens=function(t,o){return jt.walkTokens(t,o)},_e.parseInline=jt.parseInline,_e.Parser=ft,_e.parser=ft.parse,_e.Renderer=An,_e.TextRenderer=jo,_e.Lexer=mt,_e.lexer=mt.lex,_e.Tokenizer=eo,_e.Hooks=Mn,_e.parse=_e,_e.options,_e.setOptions,_e.use,_e.walkTokens,_e.parseInline,ft.parse,mt.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 Mr(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 zu(t){if(Array.isArray(t))return t}function Iu(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,r,s,c,u=[],d=!0,m=!1;try{if(s=(n=n.call(t)).next,o!==0)for(;!(d=(i=s.call(n)).done)&&(u.push(i.value),u.length!==o);d=!0);}catch(p){m=!0,r=p}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw r}}return u}}function Ou(){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 vu(t,o){return zu(t)||Iu(t,o)||Lu(t,o)||Ou()}function Lu(t,o){if(t){if(typeof t=="string")return Mr(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)?Mr(t,o):void 0}}const Rr=Object.entries,Br=Object.setPrototypeOf,Du=Object.isFrozen,Vu=Object.getPrototypeOf,$u=Object.getOwnPropertyDescriptor;let Xe=Object.freeze,dt=Object.seal,sn=Object.create,zr=typeof Reflect<"u"&&Reflect,Ko=zr.apply,qo=zr.construct;Xe||(Xe=function(o){return o}),dt||(dt=function(o){return o}),Ko||(Ko=function(o,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),s=2;s<i;s++)r[s-2]=arguments[s];return o.apply(n,r)}),qo||(qo=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 Kt=$e(Array.prototype.forEach),Pu=$e(Array.prototype.lastIndexOf),Ir=$e(Array.prototype.pop),cn=$e(Array.prototype.push),Fu=$e(Array.prototype.splice),Ze=Array.isArray,Rn=$e(String.prototype.toLowerCase),Yo=$e(String.prototype.toString),Or=$e(String.prototype.match),dn=$e(String.prototype.replace),vr=$e(String.prototype.indexOf),Uu=$e(String.prototype.trim),Hu=$e(Number.prototype.toString),Wu=$e(Boolean.prototype.toString),Lr=typeof BigInt>"u"?null:$e(BigInt.prototype.toString),Dr=typeof Symbol>"u"?null:$e(Symbol.prototype.toString),ve=$e(Object.prototype.hasOwnProperty),Bn=$e(Object.prototype.toString),He=$e(RegExp.prototype.test),un=Gu(TypeError);function $e(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 Ko(t,o,i)}}function Gu(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return qo(t,n)}}function ue(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rn;if(Br&&Br(t,null),!Ze(o))return t;let i=o.length;for(;i--;){let r=o[i];if(typeof r=="string"){const s=n(r);s!==r&&(Du(o)||(o[i]=s),r=s)}t[r]=!0}return t}function ju(t){for(let o=0;o<t.length;o++)ve(t,o)||(t[o]=null);return t}function je(t){const o=sn(null);for(const i of Rr(t)){var n=vu(i,2);const r=n[0],s=n[1];ve(t,r)&&(Ze(s)?o[r]=ju(s):s&&typeof s=="object"&&s.constructor===Object?o[r]=je(s):o[r]=s)}return o}function Ku(t){switch(typeof t){case"string":return t;case"number":return Hu(t);case"boolean":return Wu(t);case"bigint":return Lr?Lr(t):"0";case"symbol":return Dr?Dr(t):"Symbol()";case"undefined":return Bn(t);case"function":case"object":{if(t===null)return Bn(t);const o=t,n=Et(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:Bn(i)}return Bn(t)}default:return Bn(t)}}function Et(t,o){for(;t!==null;){const i=$u(t,o);if(i){if(i.get)return $e(i.get);if(typeof i.value=="function")return $e(i.value)}t=Vu(t)}function n(){return null}return n}function qu(t){try{return He(t,""),!0}catch{return!1}}const Vr=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"]),Xo=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"]),Zo=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"]),Yu=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"]),Xu=Xe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$r=Xe(["#text"]),Pr=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"]),Qo=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"]),Fr=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"]),to=Xe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Zu=dt(/{{[\w\W]*|^[\w\W]*}}/g),Ju=dt(/<%[\w\W]*|^[\w\W]*%>/g),Qu=dt(/\${[\w\W]*/g),em=dt(/^data-[\-\w.\u00B7-\uFFFF]+$/),tm=dt(/^aria-[\-\w]+$/),Ur=dt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),nm=dt(/^(?:\w+script|data):/i),om=dt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),im=dt(/^html$/i),rm=dt(/^[a-z][.\w]*(-[.\w]+)+$/i),xt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},lm=function(){return typeof window>"u"?null:window},am=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 s="dompurify"+(i?"#"+i:"");try{return o.createPolicy(s,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Hr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Wr(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lm();const o=X=>Wr(X);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==xt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,r=i.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,c=t.Node,u=t.Element,d=t.NodeFilter,m=t.NamedNodeMap;m===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const p=t.DOMParser,k=t.trustedTypes,y=u.prototype,w=Et(y,"cloneNode"),E=Et(y,"remove"),L=Et(y,"nextSibling"),C=Et(y,"childNodes"),x=Et(y,"parentNode"),R=Et(y,"shadowRoot"),S=Et(y,"attributes"),g=c&&c.prototype?Et(c.prototype,"nodeType"):null,_=c&&c.prototype?Et(c.prototype,"nodeName"):null;if(typeof s=="function"){const X=n.createElement("template");X.content&&X.content.ownerDocument&&(n=X.content.ownerDocument)}let b,v="",H=0;const oe=function(f){if(H>0)throw un('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.');H++;try{return b.createHTML(f)}finally{H--}},q=n,J=q.implementation,ae=q.createNodeIterator,W=q.createDocumentFragment,K=q.getElementsByTagName,F=i.importNode;let N=Hr();o.isSupported=typeof Rr=="function"&&typeof x=="function"&&J&&J.createHTMLDocument!==void 0;const P=Zu,D=Ju,Y=Qu,se=em,ke=tm,Re=nm,Pe=om,Te=rm;let B=Ur,z=null;const ie=ue({},[...Vr,...Xo,...Zo,...Jo,...$r]);let re=null;const V=ue({},[...Pr,...Qo,...Fr,...to]);let T=Object.seal(sn(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}})),ce=null,de=null;const De=Object.seal(sn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ke=!0,We=!0,mn=!1,It=!0,Q=!1,wt=!0,Me=!1,we=!1,pt=!1,qe=!1,gt=!1,Nt=!1,U=!0,Z=!1;const le="user-content-";let pe=!0,ze=!1,Ue={},Je=null;const Ot=ue({},["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 fn=null;const pn=ue({},["audio","video","img","source","image","track"]);let zn=null;const oo=ue({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),gn="http://www.w3.org/1998/Math/MathML",vt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let Qe=nt,Ie=!1,be=null;const ti=ue({},[gn,vt,nt],Yo);let et=ue({},["mi","mo","mn","ms","mtext"]),ee=ue({},["annotation-xml"]);const io=ue({},["title","style","font","a","script"]);let Lt=null;const ni=["application/xhtml+xml","text/html"],ro="text/html";let Oe=null,Dt=null;const hn=n.createElement("form"),lo=function(f){return f instanceof RegExp||f instanceof Function},bn=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Dt&&Dt===f)return;(!f||typeof f!="object")&&(f={}),f=je(f),Lt=ni.indexOf(f.PARSER_MEDIA_TYPE)===-1?ro:f.PARSER_MEDIA_TYPE,Oe=Lt==="application/xhtml+xml"?Yo:Rn,z=ve(f,"ALLOWED_TAGS")&&Ze(f.ALLOWED_TAGS)?ue({},f.ALLOWED_TAGS,Oe):ie,re=ve(f,"ALLOWED_ATTR")&&Ze(f.ALLOWED_ATTR)?ue({},f.ALLOWED_ATTR,Oe):V,be=ve(f,"ALLOWED_NAMESPACES")&&Ze(f.ALLOWED_NAMESPACES)?ue({},f.ALLOWED_NAMESPACES,Yo):ti,zn=ve(f,"ADD_URI_SAFE_ATTR")&&Ze(f.ADD_URI_SAFE_ATTR)?ue(je(oo),f.ADD_URI_SAFE_ATTR,Oe):oo,fn=ve(f,"ADD_DATA_URI_TAGS")&&Ze(f.ADD_DATA_URI_TAGS)?ue(je(pn),f.ADD_DATA_URI_TAGS,Oe):pn,Je=ve(f,"FORBID_CONTENTS")&&Ze(f.FORBID_CONTENTS)?ue({},f.FORBID_CONTENTS,Oe):Ot,ce=ve(f,"FORBID_TAGS")&&Ze(f.FORBID_TAGS)?ue({},f.FORBID_TAGS,Oe):je({}),de=ve(f,"FORBID_ATTR")&&Ze(f.FORBID_ATTR)?ue({},f.FORBID_ATTR,Oe):je({}),Ue=ve(f,"USE_PROFILES")?f.USE_PROFILES&&typeof f.USE_PROFILES=="object"?je(f.USE_PROFILES):f.USE_PROFILES:!1,Ke=f.ALLOW_ARIA_ATTR!==!1,We=f.ALLOW_DATA_ATTR!==!1,mn=f.ALLOW_UNKNOWN_PROTOCOLS||!1,It=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=f.SAFE_FOR_TEMPLATES||!1,wt=f.SAFE_FOR_XML!==!1,Me=f.WHOLE_DOCUMENT||!1,qe=f.RETURN_DOM||!1,gt=f.RETURN_DOM_FRAGMENT||!1,Nt=f.RETURN_TRUSTED_TYPE||!1,pt=f.FORCE_BODY||!1,U=f.SANITIZE_DOM!==!1,Z=f.SANITIZE_NAMED_PROPS||!1,pe=f.KEEP_CONTENT!==!1,ze=f.IN_PLACE||!1,B=qu(f.ALLOWED_URI_REGEXP)?f.ALLOWED_URI_REGEXP:Ur,Qe=typeof f.NAMESPACE=="string"?f.NAMESPACE:nt,et=ve(f,"MATHML_TEXT_INTEGRATION_POINTS")&&f.MATHML_TEXT_INTEGRATION_POINTS&&typeof f.MATHML_TEXT_INTEGRATION_POINTS=="object"?je(f.MATHML_TEXT_INTEGRATION_POINTS):ue({},["mi","mo","mn","ms","mtext"]),ee=ve(f,"HTML_INTEGRATION_POINTS")&&f.HTML_INTEGRATION_POINTS&&typeof f.HTML_INTEGRATION_POINTS=="object"?je(f.HTML_INTEGRATION_POINTS):ue({},["annotation-xml"]);const O=ve(f,"CUSTOM_ELEMENT_HANDLING")&&f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING=="object"?je(f.CUSTOM_ELEMENT_HANDLING):sn(null);if(T=sn(null),ve(O,"tagNameCheck")&&lo(O.tagNameCheck)&&(T.tagNameCheck=O.tagNameCheck),ve(O,"attributeNameCheck")&&lo(O.attributeNameCheck)&&(T.attributeNameCheck=O.attributeNameCheck),ve(O,"allowCustomizedBuiltInElements")&&typeof O.allowCustomizedBuiltInElements=="boolean"&&(T.allowCustomizedBuiltInElements=O.allowCustomizedBuiltInElements),Q&&(We=!1),gt&&(qe=!0),Ue&&(z=ue({},$r),re=sn(null),Ue.html===!0&&(ue(z,Vr),ue(re,Pr)),Ue.svg===!0&&(ue(z,Xo),ue(re,Qo),ue(re,to)),Ue.svgFilters===!0&&(ue(z,Zo),ue(re,Qo),ue(re,to)),Ue.mathMl===!0&&(ue(z,Jo),ue(re,Fr),ue(re,to))),De.tagCheck=null,De.attributeCheck=null,ve(f,"ADD_TAGS")&&(typeof f.ADD_TAGS=="function"?De.tagCheck=f.ADD_TAGS:Ze(f.ADD_TAGS)&&(z===ie&&(z=je(z)),ue(z,f.ADD_TAGS,Oe))),ve(f,"ADD_ATTR")&&(typeof f.ADD_ATTR=="function"?De.attributeCheck=f.ADD_ATTR:Ze(f.ADD_ATTR)&&(re===V&&(re=je(re)),ue(re,f.ADD_ATTR,Oe))),ve(f,"ADD_URI_SAFE_ATTR")&&Ze(f.ADD_URI_SAFE_ATTR)&&ue(zn,f.ADD_URI_SAFE_ATTR,Oe),ve(f,"FORBID_CONTENTS")&&Ze(f.FORBID_CONTENTS)&&(Je===Ot&&(Je=je(Je)),ue(Je,f.FORBID_CONTENTS,Oe)),ve(f,"ADD_FORBID_CONTENTS")&&Ze(f.ADD_FORBID_CONTENTS)&&(Je===Ot&&(Je=je(Je)),ue(Je,f.ADD_FORBID_CONTENTS,Oe)),pe&&(z["#text"]=!0),Me&&ue(z,["html","head","body"]),z.table&&(ue(z,["tbody"]),delete ce.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw un('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw un('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const G=b;b=f.TRUSTED_TYPES_POLICY;try{v=oe("")}catch(ye){throw b=G,ye}}else b===void 0&&f.TRUSTED_TYPES_POLICY!==null&&(b=am(k,r)),b&&typeof v=="string"&&(v=oe(""));(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&z===ie&&(z=je(z)),N.uponSanitizeAttribute.length>0&&re===V&&(re=je(re)),Xe&&Xe(f),Dt=f},St=ue({},[...Xo,...Zo,...Yu]),ao=ue({},[...Jo,...Xu]),oi=function(f){let O=x(f);(!O||!O.tagName)&&(O={namespaceURI:Qe,tagName:"template"});const G=Rn(f.tagName),ye=Rn(O.tagName);return be[f.namespaceURI]?f.namespaceURI===vt?O.namespaceURI===nt?G==="svg":O.namespaceURI===gn?G==="svg"&&(ye==="annotation-xml"||et[ye]):!!St[G]:f.namespaceURI===gn?O.namespaceURI===nt?G==="math":O.namespaceURI===vt?G==="math"&&ee[ye]:!!ao[G]:f.namespaceURI===nt?O.namespaceURI===vt&&!ee[ye]||O.namespaceURI===gn&&!et[ye]?!1:!ao[G]&&(io[G]||!St[G]):!!(Lt==="application/xhtml+xml"&&be[f.namespaceURI]):!1},lt=function(f){cn(o.removed,{element:f});try{x(f).removeChild(f)}catch{E(f)}},_t=function(f,O){try{cn(o.removed,{attribute:O.getAttributeNode(f),from:O})}catch{cn(o.removed,{attribute:null,from:O})}if(O.removeAttribute(f),f==="is")if(qe||gt)try{lt(O)}catch{}else try{O.setAttribute(f,"")}catch{}},so=function(f){let O=null,G=null;if(pt)f="<remove></remove>"+f;else{const Ce=Or(f,/^[\r\n\t ]+/);G=Ce&&Ce[0]}Lt==="application/xhtml+xml"&&Qe===nt&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const ye=b?oe(f):f;if(Qe===nt)try{O=new p().parseFromString(ye,Lt)}catch{}if(!O||!O.documentElement){O=J.createDocument(Qe,"template",null);try{O.documentElement.innerHTML=Ie?v:ye}catch{}}const me=O.body||O.documentElement;return f&&G&&me.insertBefore(n.createTextNode(G),me.childNodes[0]||null),Qe===nt?K.call(O,Me?"html":"body")[0]:Me?O.documentElement:me},co=function(f){return ae.call(f.ownerDocument||f,f,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},kn=function(f){var O,G;f.normalize();const ye=ae.call(f.ownerDocument||f,f,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let me=ye.nextNode();for(;me;){let Be=me.data;Kt([P,D,Y],Ye=>{Be=dn(Be,Ye," ")}),me.data=Be,me=ye.nextNode()}const Ce=(O=(G=f.querySelectorAll)===null||G===void 0?void 0:G.call(f,"template"))!==null&&O!==void 0?O:[];Kt(Array.from(Ce),Be=>{Fe(Be.content)&&kn(Be.content)})},te=function(f){const O=_?_(f):null;return typeof O!="string"||Oe(O)!=="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!==g(f)||f.childNodes!==C(f)},Fe=function(f){if(!g||typeof f!="object"||f===null)return!1;try{return g(f)===xt.documentFragment}catch{return!1}},qt=function(f){if(!g||typeof f!="object"||f===null)return!1;try{return typeof g(f)=="number"}catch{return!1}};function ot(X,f,O){Kt(X,G=>{G.call(o,f,O,Dt)})}const uo=function(f){let O=null;if(ot(N.beforeSanitizeElements,f,null),te(f))return lt(f),!0;const G=Oe(_?_(f):f.nodeName);if(ot(N.uponSanitizeElement,f,{tagName:G,allowedTags:z}),wt&&f.hasChildNodes()&&!qt(f.firstElementChild)&&He(/<[/\w!]/g,f.innerHTML)&&He(/<[/\w!]/g,f.textContent)||wt&&f.namespaceURI===nt&&G==="style"&&qt(f.firstElementChild)||f.nodeType===xt.progressingInstruction||wt&&f.nodeType===xt.comment&&He(/<[/\w]/g,f.data))return lt(f),!0;if(ce[G]||!(De.tagCheck instanceof Function&&De.tagCheck(G))&&!z[G]){if(!ce[G]&&Vt(G)&&(T.tagNameCheck instanceof RegExp&&He(T.tagNameCheck,G)||T.tagNameCheck instanceof Function&&T.tagNameCheck(G)))return!1;if(pe&&!Je[G]){const me=x(f),Ce=C(f);if(Ce&&me){const Be=Ce.length;for(let Ye=Be-1;Ye>=0;--Ye){const at=w(Ce[Ye],!0);me.insertBefore(at,L(f))}}}return lt(f),!0}return(g?g(f):f.nodeType)===xt.element&&!oi(f)||(G==="noscript"||G==="noembed"||G==="noframes")&&He(/<\/no(script|embed|frames)/i,f.innerHTML)?(lt(f),!0):(Q&&f.nodeType===xt.text&&(O=f.textContent,Kt([P,D,Y],me=>{O=dn(O,me," ")}),f.textContent!==O&&(cn(o.removed,{element:f.cloneNode()}),f.textContent=O)),ot(N.afterSanitizeElements,f,null),!1)},mo=function(f,O,G){if(de[O]||U&&(O==="id"||O==="name")&&(G in n||G in hn))return!1;const ye=re[O]||De.attributeCheck instanceof Function&&De.attributeCheck(O,f);if(!(We&&!de[O]&&He(se,O))){if(!(Ke&&He(ke,O))){if(!ye||de[O]){if(!(Vt(f)&&(T.tagNameCheck instanceof RegExp&&He(T.tagNameCheck,f)||T.tagNameCheck instanceof Function&&T.tagNameCheck(f))&&(T.attributeNameCheck instanceof RegExp&&He(T.attributeNameCheck,O)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(O,f))||O==="is"&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&He(T.tagNameCheck,G)||T.tagNameCheck instanceof Function&&T.tagNameCheck(G))))return!1}else if(!zn[O]){if(!He(B,dn(G,Pe,""))){if(!((O==="src"||O==="xlink:href"||O==="href")&&f!=="script"&&vr(G,"data:")===0&&fn[f])){if(!(mn&&!He(Re,dn(G,Pe,"")))){if(G)return!1}}}}}}return!0},fo=ue({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Vt=function(f){return!fo[Rn(f)]&&He(Te,f)},yn=function(f){ot(N.beforeSanitizeAttributes,f,null);const O=f.attributes;if(!O||te(f))return;const G={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:re,forceKeepAttr:void 0};let ye=O.length;for(;ye--;){const me=O[ye],Ce=me.name,Be=me.namespaceURI,Ye=me.value,at=Oe(Ce),xn=Ye;let Ve=Ce==="value"?xn:Uu(xn);if(G.attrName=at,G.attrValue=Ve,G.keepAttr=!0,G.forceKeepAttr=void 0,ot(N.uponSanitizeAttribute,f,G),Ve=G.attrValue,Z&&(at==="id"||at==="name")&&vr(Ve,le)!==0&&(_t(Ce,f),Ve=le+Ve),wt&&He(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ve)){_t(Ce,f);continue}if(at==="attributename"&&Or(Ve,"href")){_t(Ce,f);continue}if(G.forceKeepAttr)continue;if(!G.keepAttr){_t(Ce,f);continue}if(!It&&He(/\/>/i,Ve)){_t(Ce,f);continue}Q&&Kt([P,D,Y],On=>{Ve=dn(Ve,On," ")});const In=Oe(f.nodeName);if(!mo(In,at,Ve)){_t(Ce,f);continue}if(b&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!Be)switch(k.getAttributeType(In,at)){case"TrustedHTML":{Ve=oe(Ve);break}case"TrustedScriptURL":{Ve=b.createScriptURL(Ve);break}}if(Ve!==xn)try{Be?f.setAttributeNS(Be,Ce,Ve):f.setAttribute(Ce,Ve),te(f)?lt(f):Ir(o.removed)}catch{_t(Ce,f)}}ot(N.afterSanitizeAttributes,f,null)},En=function(f){let O=null;const G=co(f);for(ot(N.beforeSanitizeShadowDOM,f,null);O=G.nextNode();)if(ot(N.uponSanitizeShadowNode,O,null),uo(O),yn(O),Fe(O.content)&&En(O.content),(g?g(O):O.nodeType)===xt.element){const me=R?R(O):O.shadowRoot;Fe(me)&&($t(me),En(me))}ot(N.afterSanitizeShadowDOM,f,null)},$t=function(f){const O=g?g(f):f.nodeType;if(O===xt.element){const me=R?R(f):f.shadowRoot;Fe(me)&&($t(me),En(me))}const G=C?C(f):f.childNodes;if(!G)return;const ye=[];Kt(G,me=>{cn(ye,me)});for(const me of ye)$t(me);if(O===xt.element){const me=_?_(f):null;if(typeof me=="string"&&Oe(me)==="template"){const Ce=f.content;Fe(Ce)&&$t(Ce)}}};return o.sanitize=function(X){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=null,G=null,ye=null,me=null;if(Ie=!X,Ie&&(X="<!-->"),typeof X!="string"&&!qt(X)&&(X=Ku(X),typeof X!="string"))throw un("dirty is not a string, aborting");if(!o.isSupported)return X;if(we||bn(f),o.removed=[],typeof X=="string"&&(ze=!1),ze){const Ye=_?_(X):X.nodeName;if(typeof Ye=="string"){const at=Oe(Ye);if(!z[at]||ce[at])throw un("root node is forbidden and cannot be sanitized in-place")}if(te(X))throw un("root node is clobbered and cannot be sanitized in-place");$t(X)}else if(qt(X))O=so("<!---->"),G=O.ownerDocument.importNode(X,!0),G.nodeType===xt.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?O=G:O.appendChild(G),$t(G);else{if(!qe&&!Q&&!Me&&X.indexOf("<")===-1)return b&&Nt?oe(X):X;if(O=so(X),!O)return qe?null:Nt?v:""}O&&pt&&lt(O.firstChild);const Ce=co(ze?X:O);for(;ye=Ce.nextNode();)uo(ye),yn(ye),Fe(ye.content)&&En(ye.content);if(ze)return Q&&kn(X),X;if(qe){if(Q&&kn(O),gt)for(me=W.call(O.ownerDocument);O.firstChild;)me.appendChild(O.firstChild);else me=O;return(re.shadowroot||re.shadowrootmode)&&(me=F.call(i,me,!0)),me}let Be=Me?O.outerHTML:O.innerHTML;return Me&&z["!doctype"]&&O.ownerDocument&&O.ownerDocument.doctype&&O.ownerDocument.doctype.name&&He(im,O.ownerDocument.doctype.name)&&(Be="<!DOCTYPE "+O.ownerDocument.doctype.name+`>
130
- `+Be),Q&&Kt([P,D,Y],Ye=>{Be=dn(Be,Ye," ")}),b&&Nt?oe(Be):Be},o.setConfig=function(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bn(X),we=!0},o.clearConfig=function(){Dt=null,we=!1},o.isValidAttribute=function(X,f,O){Dt||bn({});const G=Oe(X),ye=Oe(f);return mo(G,ye,O)},o.addHook=function(X,f){typeof f=="function"&&cn(N[X],f)},o.removeHook=function(X,f){if(f!==void 0){const O=Pu(N[X],f);return O===-1?void 0:Fu(N[X],O,1)[0]}return Ir(N[X])},o.removeHooks=function(X){N[X]=[]},o.removeAllHooks=function(){N=Hr()},o}var sm=Wr();const cm=new Ar({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new An;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),r=Bo(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${r}</code></pre>`},t})()}),dm=["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"],um=["href","title","target","rel","src","alt","class","checked","type","disabled"],mm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function fm(t){if(!t)return"";const o=cm.parse(t,{async:!1});return sm.sanitize(o,{ALLOWED_TAGS:dm,ALLOWED_ATTR:um,ALLOWED_URI_REGEXP:mm})}const pm={class:"zm-note-panel"},gm={key:0,class:"zm-note-empty"},hm={class:"zm-note-header"},bm={class:"zm-note-title-row"},km={class:"zm-note-name"},ym={class:"zm-note-meta"},Em={class:"zm-note-scroll"},xm={class:"zm-note-section"},wm={class:"zm-note-section-head"},Nm={class:"zm-note-split"},Sm=["disabled"],Tm={key:0,class:"zm-note-preview"},Cm=["innerHTML"],_m={key:1,class:"zm-note-preview-hint"},Am={key:0,class:"zm-note-section-actions"},Mm={key:0,class:"zm-note-add-row"},Rm={key:1,class:"zm-note-section"},Bm=["disabled"],zm=["href","title"],Im={key:2,class:"zm-note-section"},Om=["disabled"],vm=["src","alt"],Lm={key:3,class:"zm-note-section"},Dm={class:"zm-note-section-head"},Vm={key:0,class:"zm-note-section-tag"},$m=["disabled"],Pm={key:0,class:"zm-note-code"},Fm=["innerHTML"],Um={key:4,class:"zm-note-section"},Hm=["disabled"],Wm={key:0,class:"zm-note-table"},Gm=["onClick"],jm={class:"zm-note-table-sort-mark","aria-hidden":"true"},ei=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(""),s=e.ref(null);Lo(s,{minRows:4,maxRows:10});const c=e.computed(()=>!r.value||r.value.trim()===""),u=e.computed(()=>fm(r.value)),d=e.ref(!0);function m(){d.value=!d.value}e.watch(()=>{var B,z,ie;return[(B=n.selectedNode)==null?void 0:B.id,(ie=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:ie.text]},()=>{var B,z;r.value=((z=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:z.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const B=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(B){B.focus();const z=B.value.length;B.setSelectionRange(z,z)}});function p(){var ie,re;if(n.readonly)return;const B=r.value,z=((re=(ie=n.selectedNode)==null?void 0:ie.note)==null?void 0:re.text)??"";B!==z&&i("apply",B)}function k(B){var z,ie;n.readonly||(B.key==="Escape"?(B.preventDefault(),r.value=((ie=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:ie.text)??"",B.target.blur()):B.key==="Enter"&&(B.ctrlKey||B.metaKey)&&(B.preventDefault(),p(),B.target.blur()))}function y(){n.readonly||confirm("移除该节点的笔记?")&&(r.value="",i("remove"))}const w=e.computed(()=>{var B,z;return!!((z=(B=n.selectedNode)==null?void 0:B.link)!=null&&z.url)}),E=e.computed(()=>{var B,z;return!!((z=(B=n.selectedNode)==null?void 0:B.image)!=null&&z.src)}),L=e.computed(()=>{var B,z;return(z=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:z.kind}),C=e.computed(()=>L.value==="code"),x=e.computed(()=>L.value==="table"),R=e.ref(!1),S=e.ref(!1),g=e.ref(!1),_=e.ref(!1);e.watch(()=>{var B;return(B=n.selectedNode)==null?void 0:B.id},()=>{R.value=!1,S.value=!1,g.value=!1,_.value=!1});const b=e.ref("");e.watch(()=>{var B,z,ie;return[(B=n.selectedNode)==null?void 0:B.id,(ie=(z=n.selectedNode)==null?void 0:z.link)==null?void 0:ie.url]},()=>{var B,z;b.value=((z=(B=n.selectedNode)==null?void 0:B.link)==null?void 0:z.url)??""},{immediate:!0});function v(){var ie,re;if(n.readonly)return;const B=b.value.trim(),z=((re=(ie=n.selectedNode)==null?void 0:ie.link)==null?void 0:re.url)??"";B!==z&&i("set-link",B)}const H=e.ref("");e.watch(()=>{var B,z,ie;return[(B=n.selectedNode)==null?void 0:B.id,(ie=(z=n.selectedNode)==null?void 0:z.image)==null?void 0:ie.src]},()=>{var B,z;H.value=((z=(B=n.selectedNode)==null?void 0:B.image)==null?void 0:z.src)??""},{immediate:!0});function oe(){var ie,re;if(n.readonly)return;const B=H.value.trim(),z=((re=(ie=n.selectedNode)==null?void 0:ie.image)==null?void 0:re.src)??"";B!==z&&i("set-image",B)}function q(B){const z=B.target;z.style.display="none"}function J(B){const z=B.target;z.style.display=""}const ae=e.ref(""),W=e.ref(null);Lo(W,{minRows:4,maxRows:18}),e.watch(()=>{var B,z,ie;return[(B=n.selectedNode)==null?void 0:B.id,(ie=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:ie.raw]},()=>{var B,z;ae.value=((z=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:z.raw)??""},{immediate:!0});const K=e.computed(()=>Bo(Ro(ae.value),nn(ae.value)));function F(){var re,V;if(n.readonly)return;const B=ae.value,z=((V=(re=n.selectedNode)==null?void 0:re.richContent)==null?void 0:V.raw)??"";if(B===z)return;const ie=nn(B)||void 0;i("set-rich",B?{kind:"code",raw:B,lang:ie}:null)}const N=e.ref(""),P=e.ref(null);Lo(P,{minRows:4,maxRows:14});const D=e.ref(-1),Y=e.ref("asc");e.watch(()=>{var B,z,ie;return[(B=n.selectedNode)==null?void 0:B.id,(ie=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:ie.raw]},()=>{var B,z;N.value=((z=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:z.raw)??"",D.value=-1,Y.value="asc"},{immediate:!0});function se(){var ie,re;if(n.readonly)return;const B=N.value,z=((re=(ie=n.selectedNode)==null?void 0:ie.richContent)==null?void 0:re.raw)??"";B!==z&&i("set-rich",B?{kind:"table",raw:B}:null)}const ke=e.computed(()=>sr(N.value)),Re=e.computed(()=>{const B=ke.value;return D.value<0||B.length<=1?B:cr(B,D.value,Y.value)});function Pe(B){D.value!==B?(D.value=B,Y.value="asc"):Y.value==="asc"?Y.value="desc":D.value=-1}const Te=e.computed(()=>{const B=[];return c.value||B.push(`${r.value.length} 字`),w.value&&B.push("1 链接"),E.value&&B.push("1 图片"),C.value&&B.push("代码块"),x.value&&B.push("表格"),B.length===0?"节点没有额外内容":B.join(" · ")});return(B,z)=>{var ie,re,V,T;return e.openBlock(),e.createElementBlock("div",pm,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",hm,[e.createElementVNode("div",bm,[z[12]||(z[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",km,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",ym,e.toDisplayString(Te.value),1)]),e.createElementVNode("div",Em,[e.createElementVNode("section",xm,[e.createElementVNode("header",wm,[z[13]||(z[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),z[14]||(z[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(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",Nm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:s,"onUpdate:modelValue":z[0]||(z[0]=ce=>r.value=ce),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:p,onKeydown:k},null,40,Sm),[[e.vModelText,r.value]]),d.value?(e.openBlock(),e.createElementBlock("div",Tm,[c.value?(e.openBlock(),e.createElementBlock("div",_m," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,Cm))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",Am,[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",Mm,[!w.value&&!R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:z[1]||(z[1]=ce=>R.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!E.value&&!S.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:z[2]||(z[2]=ce=>S.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!C.value&&!g.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:z[3]||(z[3]=ce=>g.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!x.value&&!_.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:z[4]||(z[4]=ce=>_.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),w.value||R.value?(e.openBlock(),e.createElementBlock("section",Rm,[z[15]||(z[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":z[5]||(z[5]=ce=>b.value=ce),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:v,onKeydown:z[6]||(z[6]=e.withKeys(e.withModifiers(ce=>ce.target.blur(),["prevent"]),["enter"]))},null,40,Bm),[[e.vModelText,b.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:(re=t.selectedNode.link)==null?void 0:re.url},e.toDisplayString((V=t.selectedNode.link)==null?void 0:V.url),9,zm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),E.value||S.value?(e.openBlock(),e.createElementBlock("section",Im,[z[16]||(z[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":z[7]||(z[7]=ce=>H.value=ce),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:oe,onKeydown:z[8]||(z[8]=e.withKeys(e.withModifiers(ce=>ce.target.blur(),["prevent"]),["enter"]))},null,40,Om),[[e.vModelText,H.value]]),E.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:q,onLoad:J},null,40,vm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),C.value||g.value?(e.openBlock(),e.createElementBlock("section",Lm,[e.createElementVNode("header",Dm,[z[17]||(z[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(nn)(ae.value)?(e.openBlock(),e.createElementBlock("span",Vm,e.toDisplayString(e.unref(nn)(ae.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:W,"onUpdate:modelValue":z[9]||(z[9]=ce=>ae.value=ce),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:F},null,40,$m),[[e.vModelText,ae.value]]),ae.value.trim()?(e.openBlock(),e.createElementBlock("pre",Pm,[e.createElementVNode("code",{innerHTML:K.value},null,8,Fm)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),x.value||_.value?(e.openBlock(),e.createElementBlock("section",Um,[z[18]||(z[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:P,"onUpdate:modelValue":z[10]||(z[10]=ce=>N.value=ce),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
130
+ `}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>${Ut(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 r=this.parser.parseInline(n),i=ul(t);if(i===null)return r;t=i;let s='<a href="'+t+'"';return o&&(s+=' title="'+Ut(o)+'"'),s+=">"+r+"</a>",s}image({href:t,title:o,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=ul(t);if(i===null)return Ut(n);t=i;let s=`<img src="${t}" alt="${Ut(n)}"`;return o&&(s+=` title="${Ut(o)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ut(t.text)}},vr=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}},It=class Yr{constructor(o){Re(this,"options");Re(this,"renderer");Re(this,"textRenderer");this.options=o||_n,this.options.renderer=this.options.renderer||new ao,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new vr}static parse(o,n){return new Yr(n).parse(o)}static parseInline(o,n){return new Yr(n).parseInline(o)}parse(o){var r,i;this.renderer.parser=this;let n="";for(let s=0;s<o.length;s++){let c=o[s];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[c.type]){let d=c,g=this.options.extensions.renderers[d.type].call({parser:this},d);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=g||"";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 d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var i,s;this.renderer.parser=this;let r="";for(let c=0;c<o.length;c++){let u=o[c];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[u.type]){let g=this.options.extensions.renderers[u.type].call({parser:this},u);if(g!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){r+=g||"";continue}}let d=u;switch(d.type){case"escape":{r+=n.text(d);break}case"html":{r+=n.html(d);break}case"link":{r+=n.link(d);break}case"image":{r+=n.image(d);break}case"checkbox":{r+=n.checkbox(d);break}case"strong":{r+=n.strong(d);break}case"em":{r+=n.em(d);break}case"codespan":{r+=n.codespan(d);break}case"br":{r+=n.br(d);break}case"del":{r+=n.del(d);break}case"text":{r+=n.text(d);break}default:{let g='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}},so=(Yo=class{constructor(t){Re(this,"options");Re(this,"block");this.options=t||_n}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?zt.lex:zt.lexInline}provideParser(t=this.block){return t?It.parse:It.parseInline}},Re(Yo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Re(Yo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Yo),gl=class{constructor(...t){Re(this,"defaults",wr());Re(this,"options",this.setOptions);Re(this,"parse",this.parseMarkdown(!0));Re(this,"parseInline",this.parseMarkdown(!1));Re(this,"Parser",It);Re(this,"Renderer",ao);Re(this,"TextRenderer",vr);Re(this,"Lexer",zt);Re(this,"Tokenizer",jo);Re(this,"Hooks",so);this.use(...t)}walkTokens(t,o){var r,i;let n=[];for(let s of t)switch(n=n.concat(o.call(this,s)),s.type){case"table":{let c=s;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of c.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let c=s;n=n.concat(this.walkTokens(c.items,o));break}default:{let c=s;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let d=c[u].flat(1/0);n=n.concat(this.walkTokens(d,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 r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=o.renderers[i.name];s?o.renderers[i.name]=function(...c){let u=i.renderer.apply(this,c);return u===!1&&(u=s.apply(this,c)),u}:o.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=o[i.level];s?s.unshift(i.tokenizer):o[i.level]=[i.tokenizer],i.start&&(i.level==="block"?o.startBlock?o.startBlock.push(i.start):o.startBlock=[i.start]:i.level==="inline"&&(o.startInline?o.startInline.push(i.start):o.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(o.childTokens[i.name]=i.childTokens)}),r.extensions=o),n.renderer){let i=this.defaults.renderer||new ao(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let c=s,u=n.renderer[c],d=i[c];i[c]=(...g)=>{let b=u.apply(i,g);return b===!1&&(b=d.apply(i,g)),b||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new jo(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let c=s,u=n.tokenizer[c],d=i[c];i[c]=(...g)=>{let b=u.apply(i,g);return b===!1&&(b=d.apply(i,g)),b}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new so;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let c=s,u=n.hooks[c],d=i[c];so.passThroughHooks.has(s)?i[c]=g=>{if(this.defaults.async&&so.passThroughHooksRespectAsync.has(s))return(async()=>{let w=await u.call(i,g);return d.call(i,w)})();let b=u.call(i,g);return d.call(i,b)}:i[c]=(...g)=>{if(this.defaults.async)return(async()=>{let w=await u.apply(i,g);return w===!1&&(w=await d.apply(i,g)),w})();let b=u.apply(i,g);return b===!1&&(b=d.apply(i,g)),b}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(c){let u=[];return u.push(s.call(this,c)),i&&(u=u.concat(i.call(this,c))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return zt.lex(t,o??this.defaults)}parser(t,o){return It.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return s(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 s(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let c=i.hooks?await i.hooks.preprocess(o):o,u=await(i.hooks?await i.hooks.provideLexer(t):t?zt.lex:zt.lexInline)(c,i),d=i.hooks?await i.hooks.processAllTokens(u):u;i.walkTokens&&await Promise.all(this.walkTokens(d,i.walkTokens));let g=await(i.hooks?await i.hooks.provideParser(t):t?It.parse:It.parseInline)(d,i);return i.hooks?await i.hooks.postprocess(g):g})().catch(s);try{i.hooks&&(o=i.hooks.preprocess(o));let c=(i.hooks?i.hooks.provideLexer(t):t?zt.lex:zt.lexInline)(o,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=(i.hooks?i.hooks.provideParser(t):t?It.parse:It.parseInline)(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return s(c)}}}onError(t,o){return n=>{if(n.message+=`
131
+ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+Ut(n.message+"",!0)+"</pre>";return o?Promise.resolve(r):r}if(o)return Promise.reject(n);throw n}}},Rn=new gl;function _e(t,o){return Rn.parse(t,o)}_e.options=_e.setOptions=function(t){return Rn.setOptions(t),_e.defaults=Rn.defaults,Ji(_e.defaults),_e},_e.getDefaults=wr,_e.defaults=_n,_e.use=function(...t){return Rn.use(...t),_e.defaults=Rn.defaults,Ji(_e.defaults),_e},_e.walkTokens=function(t,o){return Rn.walkTokens(t,o)},_e.parseInline=Rn.parseInline,_e.Parser=It,_e.parser=It.parse,_e.Renderer=ao,_e.TextRenderer=vr,_e.Lexer=zt,_e.lexer=zt.lex,_e.Tokenizer=jo,_e.Hooks=so,_e.parse=_e,_e.options,_e.setOptions,_e.use,_e.walkTokens,_e.parseInline,It.parse,zt.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 hl(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,r=Array(o);n<o;n++)r[n]=t[n];return r}function jf(t){if(Array.isArray(t))return t}function Kf(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,c,u=[],d=!0,g=!1;try{if(s=(n=n.call(t)).next,o!==0)for(;!(d=(r=s.call(n)).done)&&(u.push(r.value),u.length!==o);d=!0);}catch(b){g=!0,i=b}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(g)throw i}}return u}}function Yf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
132
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qf(t,o){return jf(t)||Kf(t,o)||Xf(t,o)||Yf()}function Xf(t,o){if(t){if(typeof t=="string")return hl(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)?hl(t,o):void 0}}const bl=Object.entries,kl=Object.setPrototypeOf,Zf=Object.isFrozen,Jf=Object.getPrototypeOf,Qf=Object.getOwnPropertyDescriptor;let ct=Object.freeze,At=Object.seal,jn=Object.create,yl=typeof Reflect<"u"&&Reflect,Br=yl.apply,zr=yl.construct;ct||(ct=function(o){return o}),At||(At=function(o){return o}),Br||(Br=function(o,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return o.apply(n,i)}),zr||(zr=function(o){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new o(...r)});const vn=Ge(Array.prototype.forEach),em=Ge(Array.prototype.lastIndexOf),El=Ge(Array.prototype.pop),Kn=Ge(Array.prototype.push),tm=Ge(Array.prototype.splice),dt=Array.isArray,co=Ge(String.prototype.toLowerCase),Ir=Ge(String.prototype.toString),xl=Ge(String.prototype.match),Yn=Ge(String.prototype.replace),wl=Ge(String.prototype.indexOf),nm=Ge(String.prototype.trim),om=Ge(Number.prototype.toString),rm=Ge(Boolean.prototype.toString),Nl=typeof BigInt>"u"?null:Ge(BigInt.prototype.toString),Sl=typeof Symbol>"u"?null:Ge(Symbol.prototype.toString),$e=Ge(Object.prototype.hasOwnProperty),uo=Ge(Object.prototype.toString),tt=Ge(RegExp.prototype.test),qn=im(TypeError);function Ge(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Br(t,o,r)}}function im(t){return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];return zr(t,n)}}function fe(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:co;if(kl&&kl(t,null),!dt(o))return t;let r=o.length;for(;r--;){let i=o[r];if(typeof i=="string"){const s=n(i);s!==i&&(Zf(o)||(o[r]=s),i=s)}t[i]=!0}return t}function lm(t){for(let o=0;o<t.length;o++)$e(t,o)||(t[o]=null);return t}function rt(t){const o=jn(null);for(const r of bl(t)){var n=qf(r,2);const i=n[0],s=n[1];$e(t,i)&&(dt(s)?o[i]=lm(s):s&&typeof s=="object"&&s.constructor===Object?o[i]=rt(s):o[i]=s)}return o}function am(t){switch(typeof t){case"string":return t;case"number":return om(t);case"boolean":return rm(t);case"bigint":return Nl?Nl(t):"0";case"symbol":return Sl?Sl(t):"Symbol()";case"undefined":return uo(t);case"function":case"object":{if(t===null)return uo(t);const o=t,n=Ht(o,"toString");if(typeof n=="function"){const r=n(o);return typeof r=="string"?r:uo(r)}return uo(t)}default:return uo(t)}}function Ht(t,o){for(;t!==null;){const r=Qf(t,o);if(r){if(r.get)return Ge(r.get);if(typeof r.value=="function")return Ge(r.value)}t=Jf(t)}function n(){return null}return n}function sm(t){try{return tt(t,""),!0}catch{return!1}}const Tl=ct(["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"]),Or=ct(["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"]),Lr=ct(["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"]),cm=ct(["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"]),Dr=ct(["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"]),dm=ct(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Cl=ct(["#text"]),Al=ct(["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"]),Vr=ct(["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"]),_l=ct(["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"]),Ko=ct(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),um=At(/{{[\w\W]*|^[\w\W]*}}/g),fm=At(/<%[\w\W]*|^[\w\W]*%>/g),mm=At(/\${[\w\W]*/g),pm=At(/^data-[\-\w.\u00B7-\uFFFF]+$/),gm=At(/^aria-[\-\w]+$/),Ml=At(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hm=At(/^(?:\w+script|data):/i),bm=At(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),km=At(/^html$/i),ym=At(/^[a-z][.\w]*(-[.\w]+)+$/i),Wt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Em=function(){return typeof window>"u"?null:window},xm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return o.createPolicy(s,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Rl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function vl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Em();const o=X=>vl(X);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Wt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const r=n,i=r.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,c=t.Node,u=t.Element,d=t.NodeFilter,g=t.NamedNodeMap;g===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const b=t.DOMParser,w=t.trustedTypes,N=u.prototype,V=Ht(N,"cloneNode"),_=Ht(N,"remove"),$=Ht(N,"nextSibling"),B=Ht(N,"childNodes"),T=Ht(N,"parentNode"),E=Ht(N,"shadowRoot"),k=Ht(N,"attributes"),m=c&&c.prototype?Ht(c.prototype,"nodeType"):null,v=c&&c.prototype?Ht(c.prototype,"nodeName"):null;if(typeof s=="function"){const X=n.createElement("template");X.content&&X.content.ownerDocument&&(n=X.content.ownerDocument)}let x,j="",K=0;const ne=function(h){if(K>0)throw qn('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.');K++;try{return x.createHTML(h)}finally{K--}},ce=n,re=ce.implementation,Y=ce.createNodeIterator,ee=ce.createDocumentFragment,ie=ce.getElementsByTagName,z=r.importNode;let C=Rl();o.isSupported=typeof bl=="function"&&typeof T=="function"&&re&&re.createHTMLDocument!==void 0;const F=um,P=fm,W=mm,ae=pm,we=gm,ve=hm,ze=bm,Ne=ym;let y=Ml,p=null;const O=fe({},[...Tl,...Or,...Lr,...Dr,...Cl]);let D=null;const q=fe({},[...Al,...Vr,..._l,...Ko]);let de=Object.seal(jn(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}})),ge=null,je=null;const Pe=Object.seal(jn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Je=!0,Ke=!0,Xn=!1,pn=!0,te=!1,Gt=!0,Be=!1,Te=!1,Ot=!1,it=!1,Lt=!1,jt=!1,U=!0,Z=!1;const se="user-content-";let ye=!0,Me=!1,Qe={},pt=null;const gn=fe({},["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 fo=null;const Zn=fe({},["audio","video","img","source","image","track"]);let Bn=null;const qo=fe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Jn="http://www.w3.org/1998/Math/MathML",Qn="http://www.w3.org/2000/svg",gt="http://www.w3.org/1999/xhtml";let Kt=gt,_t=!1,Ce=null;const he=fe({},[Jn,Qn,gt],Ir);let mo=fe({},["mi","mo","mn","ms","mtext"]),lt=fe({},["annotation-xml"]);const po=fe({},["title","style","font","a","script"]);let Q=null;const go=["application/xhtml+xml","text/html"],ho="text/html";let De=null,Qt=null;const Pr=n.createElement("form"),bo=function(h){return h instanceof RegExp||h instanceof Function},hn=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Qt&&Qt===h)return;(!h||typeof h!="object")&&(h={}),h=rt(h),Q=go.indexOf(h.PARSER_MEDIA_TYPE)===-1?ho:h.PARSER_MEDIA_TYPE,De=Q==="application/xhtml+xml"?Ir:co,p=$e(h,"ALLOWED_TAGS")&&dt(h.ALLOWED_TAGS)?fe({},h.ALLOWED_TAGS,De):O,D=$e(h,"ALLOWED_ATTR")&&dt(h.ALLOWED_ATTR)?fe({},h.ALLOWED_ATTR,De):q,Ce=$e(h,"ALLOWED_NAMESPACES")&&dt(h.ALLOWED_NAMESPACES)?fe({},h.ALLOWED_NAMESPACES,Ir):he,Bn=$e(h,"ADD_URI_SAFE_ATTR")&&dt(h.ADD_URI_SAFE_ATTR)?fe(rt(qo),h.ADD_URI_SAFE_ATTR,De):qo,fo=$e(h,"ADD_DATA_URI_TAGS")&&dt(h.ADD_DATA_URI_TAGS)?fe(rt(Zn),h.ADD_DATA_URI_TAGS,De):Zn,pt=$e(h,"FORBID_CONTENTS")&&dt(h.FORBID_CONTENTS)?fe({},h.FORBID_CONTENTS,De):gn,ge=$e(h,"FORBID_TAGS")&&dt(h.FORBID_TAGS)?fe({},h.FORBID_TAGS,De):rt({}),je=$e(h,"FORBID_ATTR")&&dt(h.FORBID_ATTR)?fe({},h.FORBID_ATTR,De):rt({}),Qe=$e(h,"USE_PROFILES")?h.USE_PROFILES&&typeof h.USE_PROFILES=="object"?rt(h.USE_PROFILES):h.USE_PROFILES:!1,Je=h.ALLOW_ARIA_ATTR!==!1,Ke=h.ALLOW_DATA_ATTR!==!1,Xn=h.ALLOW_UNKNOWN_PROTOCOLS||!1,pn=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,te=h.SAFE_FOR_TEMPLATES||!1,Gt=h.SAFE_FOR_XML!==!1,Be=h.WHOLE_DOCUMENT||!1,it=h.RETURN_DOM||!1,Lt=h.RETURN_DOM_FRAGMENT||!1,jt=h.RETURN_TRUSTED_TYPE||!1,Ot=h.FORCE_BODY||!1,U=h.SANITIZE_DOM!==!1,Z=h.SANITIZE_NAMED_PROPS||!1,ye=h.KEEP_CONTENT!==!1,Me=h.IN_PLACE||!1,y=sm(h.ALLOWED_URI_REGEXP)?h.ALLOWED_URI_REGEXP:Ml,Kt=typeof h.NAMESPACE=="string"?h.NAMESPACE:gt,mo=$e(h,"MATHML_TEXT_INTEGRATION_POINTS")&&h.MATHML_TEXT_INTEGRATION_POINTS&&typeof h.MATHML_TEXT_INTEGRATION_POINTS=="object"?rt(h.MATHML_TEXT_INTEGRATION_POINTS):fe({},["mi","mo","mn","ms","mtext"]),lt=$e(h,"HTML_INTEGRATION_POINTS")&&h.HTML_INTEGRATION_POINTS&&typeof h.HTML_INTEGRATION_POINTS=="object"?rt(h.HTML_INTEGRATION_POINTS):fe({},["annotation-xml"]);const I=$e(h,"CUSTOM_ELEMENT_HANDLING")&&h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING=="object"?rt(h.CUSTOM_ELEMENT_HANDLING):jn(null);if(de=jn(null),$e(I,"tagNameCheck")&&bo(I.tagNameCheck)&&(de.tagNameCheck=I.tagNameCheck),$e(I,"attributeNameCheck")&&bo(I.attributeNameCheck)&&(de.attributeNameCheck=I.attributeNameCheck),$e(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(de.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),te&&(Ke=!1),Lt&&(it=!0),Qe&&(p=fe({},Cl),D=jn(null),Qe.html===!0&&(fe(p,Tl),fe(D,Al)),Qe.svg===!0&&(fe(p,Or),fe(D,Vr),fe(D,Ko)),Qe.svgFilters===!0&&(fe(p,Lr),fe(D,Vr),fe(D,Ko)),Qe.mathMl===!0&&(fe(p,Dr),fe(D,_l),fe(D,Ko))),Pe.tagCheck=null,Pe.attributeCheck=null,$e(h,"ADD_TAGS")&&(typeof h.ADD_TAGS=="function"?Pe.tagCheck=h.ADD_TAGS:dt(h.ADD_TAGS)&&(p===O&&(p=rt(p)),fe(p,h.ADD_TAGS,De))),$e(h,"ADD_ATTR")&&(typeof h.ADD_ATTR=="function"?Pe.attributeCheck=h.ADD_ATTR:dt(h.ADD_ATTR)&&(D===q&&(D=rt(D)),fe(D,h.ADD_ATTR,De))),$e(h,"ADD_URI_SAFE_ATTR")&&dt(h.ADD_URI_SAFE_ATTR)&&fe(Bn,h.ADD_URI_SAFE_ATTR,De),$e(h,"FORBID_CONTENTS")&&dt(h.FORBID_CONTENTS)&&(pt===gn&&(pt=rt(pt)),fe(pt,h.FORBID_CONTENTS,De)),$e(h,"ADD_FORBID_CONTENTS")&&dt(h.ADD_FORBID_CONTENTS)&&(pt===gn&&(pt=rt(pt)),fe(pt,h.ADD_FORBID_CONTENTS,De)),ye&&(p["#text"]=!0),Be&&fe(p,["html","head","body"]),p.table&&(fe(p,["tbody"]),delete ge.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw qn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const H=x;x=h.TRUSTED_TYPES_POLICY;try{j=ne("")}catch(Se){throw x=H,Se}}else x===void 0&&h.TRUSTED_TYPES_POLICY!==null&&(x=xm(w,i)),x&&typeof j=="string"&&(j=ne(""));(C.uponSanitizeElement.length>0||C.uponSanitizeAttribute.length>0)&&p===O&&(p=rt(p)),C.uponSanitizeAttribute.length>0&&D===q&&(D=rt(D)),ct&&ct(h),Qt=h},Xo=fe({},[...Or,...Lr,...cm]),ko=fe({},[...Dr,...dm]),en=function(h){let I=T(h);(!I||!I.tagName)&&(I={namespaceURI:Kt,tagName:"template"});const H=co(h.tagName),Se=co(I.tagName);return Ce[h.namespaceURI]?h.namespaceURI===Qn?I.namespaceURI===gt?H==="svg":I.namespaceURI===Jn?H==="svg"&&(Se==="annotation-xml"||mo[Se]):!!Xo[H]:h.namespaceURI===Jn?I.namespaceURI===gt?H==="math":I.namespaceURI===Qn?H==="math"&&lt[Se]:!!ko[H]:h.namespaceURI===gt?I.namespaceURI===Qn&&!lt[Se]||I.namespaceURI===Jn&&!mo[Se]?!1:!ko[H]&&(po[H]||!Xo[H]):!!(Q==="application/xhtml+xml"&&Ce[h.namespaceURI]):!1},ht=function(h){Kn(o.removed,{element:h});try{T(h).removeChild(h)}catch{_(h)}},Yt=function(h,I){try{Kn(o.removed,{attribute:I.getAttributeNode(h),from:I})}catch{Kn(o.removed,{attribute:null,from:I})}if(I.removeAttribute(h),h==="is")if(it||Lt)try{ht(I)}catch{}else try{I.setAttribute(h,"")}catch{}},tn=function(h){let I=null,H=null;if(Ot)h="<remove></remove>"+h;else{const Ae=xl(h,/^[\r\n\t ]+/);H=Ae&&Ae[0]}Q==="application/xhtml+xml"&&Kt===gt&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const Se=x?ne(h):h;if(Kt===gt)try{I=new b().parseFromString(Se,Q)}catch{}if(!I||!I.documentElement){I=re.createDocument(Kt,"template",null);try{I.documentElement.innerHTML=_t?j:Se}catch{}}const me=I.body||I.documentElement;return h&&H&&me.insertBefore(n.createTextNode(H),me.childNodes[0]||null),Kt===gt?ie.call(I,Be?"html":"body")[0]:Be?I.documentElement:me},nn=function(h){return Y.call(h.ownerDocument||h,h,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},eo=function(h){var I,H;h.normalize();const Se=Y.call(h.ownerDocument||h,h,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let me=Se.nextNode();for(;me;){let We=me.data;vn([F,P,W],bt=>{We=Yn(We,bt," ")}),me.data=We,me=Se.nextNode()}const Ae=(I=(H=h.querySelectorAll)===null||H===void 0?void 0:H.call(h,"template"))!==null&&I!==void 0?I:[];vn(Array.from(Ae),We=>{bn(We.content)&&eo(We.content)})},zn=function(h){const I=v?v(h):null;return typeof I!="string"||De(I)!=="form"?!1:typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||h.attributes!==k(h)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function"||h.nodeType!==m(h)||h.childNodes!==B(h)},bn=function(h){if(!m||typeof h!="object"||h===null)return!1;try{return m(h)===Wt.documentFragment}catch{return!1}},In=function(h){if(!m||typeof h!="object"||h===null)return!1;try{return typeof m(h)=="number"}catch{return!1}};function J(X,h,I){vn(X,H=>{H.call(o,h,I,Qt)})}const et=function(h){let I=null;if(J(C.beforeSanitizeElements,h,null),zn(h))return ht(h),!0;const H=De(v?v(h):h.nodeName);if(J(C.uponSanitizeElement,h,{tagName:H,allowedTags:p}),Gt&&h.hasChildNodes()&&!In(h.firstElementChild)&&tt(/<[/\w!]/g,h.innerHTML)&&tt(/<[/\w!]/g,h.textContent)||Gt&&h.namespaceURI===gt&&H==="style"&&In(h.firstElementChild)||h.nodeType===Wt.progressingInstruction||Gt&&h.nodeType===Wt.comment&&tt(/<[/\w]/g,h.data))return ht(h),!0;if(ge[H]||!(Pe.tagCheck instanceof Function&&Pe.tagCheck(H))&&!p[H]){if(!ge[H]&&Eo(H)&&(de.tagNameCheck instanceof RegExp&&tt(de.tagNameCheck,H)||de.tagNameCheck instanceof Function&&de.tagNameCheck(H)))return!1;if(ye&&!pt[H]){const me=T(h),Ae=B(h);if(Ae&&me){const We=Ae.length;for(let bt=We-1;bt>=0;--bt){const yt=V(Ae[bt],!0);me.insertBefore(yt,$(h))}}}return ht(h),!0}return(m?m(h):h.nodeType)===Wt.element&&!en(h)||(H==="noscript"||H==="noembed"||H==="noframes")&&tt(/<\/no(script|embed|frames)/i,h.innerHTML)?(ht(h),!0):(te&&h.nodeType===Wt.text&&(I=h.textContent,vn([F,P,W],me=>{I=Yn(I,me," ")}),h.textContent!==I&&(Kn(o.removed,{element:h.cloneNode()}),h.textContent=I)),J(C.afterSanitizeElements,h,null),!1)},yo=function(h,I,H){if(je[I]||U&&(I==="id"||I==="name")&&(H in n||H in Pr))return!1;const Se=D[I]||Pe.attributeCheck instanceof Function&&Pe.attributeCheck(I,h);if(!(Ke&&!je[I]&&tt(ae,I))){if(!(Je&&tt(we,I))){if(!Se||je[I]){if(!(Eo(h)&&(de.tagNameCheck instanceof RegExp&&tt(de.tagNameCheck,h)||de.tagNameCheck instanceof Function&&de.tagNameCheck(h))&&(de.attributeNameCheck instanceof RegExp&&tt(de.attributeNameCheck,I)||de.attributeNameCheck instanceof Function&&de.attributeNameCheck(I,h))||I==="is"&&de.allowCustomizedBuiltInElements&&(de.tagNameCheck instanceof RegExp&&tt(de.tagNameCheck,H)||de.tagNameCheck instanceof Function&&de.tagNameCheck(H))))return!1}else if(!Bn[I]){if(!tt(y,Yn(H,ze,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&h!=="script"&&wl(H,"data:")===0&&fo[h])){if(!(Xn&&!tt(ve,Yn(H,ze,"")))){if(H)return!1}}}}}}return!0},kn=fe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Eo=function(h){return!kn[co(h)]&&tt(Ne,h)},Zo=function(h){J(C.beforeSanitizeAttributes,h,null);const I=h.attributes;if(!I||zn(h))return;const H={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0};let Se=I.length;for(;Se--;){const me=I[Se],Ae=me.name,We=me.namespaceURI,bt=me.value,yt=De(Ae),on=bt;let Fe=Ae==="value"?on:nm(on);if(H.attrName=yt,H.attrValue=Fe,H.keepAttr=!0,H.forceKeepAttr=void 0,J(C.uponSanitizeAttribute,h,H),Fe=H.attrValue,Z&&(yt==="id"||yt==="name")&&wl(Fe,se)!==0&&(Yt(Ae,h),Fe=se+Fe),Gt&&tt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Fe)){Yt(Ae,h);continue}if(yt==="attributename"&&xl(Fe,"href")){Yt(Ae,h);continue}if(H.forceKeepAttr)continue;if(!H.keepAttr){Yt(Ae,h);continue}if(!pn&&tt(/\/>/i,Fe)){Yt(Ae,h);continue}te&&vn([F,P,W],xo=>{Fe=Yn(Fe,xo," ")});const Jo=De(h.nodeName);if(!yo(Jo,yt,Fe)){Yt(Ae,h);continue}if(x&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!We)switch(w.getAttributeType(Jo,yt)){case"TrustedHTML":{Fe=ne(Fe);break}case"TrustedScriptURL":{Fe=x.createScriptURL(Fe);break}}if(Fe!==on)try{We?h.setAttributeNS(We,Ae,Fe):h.setAttribute(Ae,Fe),zn(h)?ht(h):El(o.removed)}catch{Yt(Ae,h)}}J(C.afterSanitizeAttributes,h,null)},On=function(h){let I=null;const H=nn(h);for(J(C.beforeSanitizeShadowDOM,h,null);I=H.nextNode();)if(J(C.uponSanitizeShadowNode,I,null),et(I),Zo(I),bn(I.content)&&On(I.content),(m?m(I):I.nodeType)===Wt.element){const me=E?E(I):I.shadowRoot;bn(me)&&(Mt(me),On(me))}J(C.afterSanitizeShadowDOM,h,null)},Mt=function(h){const I=m?m(h):h.nodeType;if(I===Wt.element){const me=E?E(h):h.shadowRoot;bn(me)&&(Mt(me),On(me))}const H=B?B(h):h.childNodes;if(!H)return;const Se=[];vn(H,me=>{Kn(Se,me)});for(const me of Se)Mt(me);if(I===Wt.element){const me=v?v(h):null;if(typeof me=="string"&&De(me)==="template"){const Ae=h.content;bn(Ae)&&Mt(Ae)}}};return o.sanitize=function(X){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,H=null,Se=null,me=null;if(_t=!X,_t&&(X="<!-->"),typeof X!="string"&&!In(X)&&(X=am(X),typeof X!="string"))throw qn("dirty is not a string, aborting");if(!o.isSupported)return X;if(Te||hn(h),o.removed=[],typeof X=="string"&&(Me=!1),Me){const bt=v?v(X):X.nodeName;if(typeof bt=="string"){const yt=De(bt);if(!p[yt]||ge[yt])throw qn("root node is forbidden and cannot be sanitized in-place")}if(zn(X))throw qn("root node is clobbered and cannot be sanitized in-place");Mt(X)}else if(In(X))I=tn("<!---->"),H=I.ownerDocument.importNode(X,!0),H.nodeType===Wt.element&&H.nodeName==="BODY"||H.nodeName==="HTML"?I=H:I.appendChild(H),Mt(H);else{if(!it&&!te&&!Be&&X.indexOf("<")===-1)return x&&jt?ne(X):X;if(I=tn(X),!I)return it?null:jt?j:""}I&&Ot&&ht(I.firstChild);const Ae=nn(Me?X:I);for(;Se=Ae.nextNode();)et(Se),Zo(Se),bn(Se.content)&&On(Se.content);if(Me)return te&&eo(X),X;if(it){if(te&&eo(I),Lt)for(me=ee.call(I.ownerDocument);I.firstChild;)me.appendChild(I.firstChild);else me=I;return(D.shadowroot||D.shadowrootmode)&&(me=z.call(r,me,!0)),me}let We=Be?I.outerHTML:I.innerHTML;return Be&&p["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&tt(km,I.ownerDocument.doctype.name)&&(We="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
133
+ `+We),te&&vn([F,P,W],bt=>{We=Yn(We,bt," ")}),x&&jt?ne(We):We},o.setConfig=function(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hn(X),Te=!0},o.clearConfig=function(){Qt=null,Te=!1},o.isValidAttribute=function(X,h,I){Qt||hn({});const H=De(X),Se=De(h);return yo(H,Se,I)},o.addHook=function(X,h){typeof h=="function"&&Kn(C[X],h)},o.removeHook=function(X,h){if(h!==void 0){const I=em(C[X],h);return I===-1?void 0:tm(C[X],I,1)[0]}return El(C[X])},o.removeHooks=function(X){C[X]=[]},o.removeAllHooks=function(){C=Rl()},o}var wm=vl();const Nm=new gl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new ao;return t.code=({text:o,lang:n})=>{const r=(n??"").toLowerCase(),i=gr(o,r);return`<pre><code${r?` class="language-${r}"`:""}>${i}</code></pre>`},t})()}),Sm=["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"],Tm=["href","title","target","rel","src","alt","class","checked","type","disabled"],Cm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Am(t){if(!t)return"";const o=Nm.parse(t,{async:!1});return wm.sanitize(o,{ALLOWED_TAGS:Sm,ALLOWED_ATTR:Tm,ALLOWED_URI_REGEXP:Cm})}const _m={class:"zm-note-panel"},Mm={key:0,class:"zm-note-empty"},Rm={class:"zm-note-header"},vm={class:"zm-note-title-row"},Bm={class:"zm-note-name"},zm={class:"zm-note-meta"},Im={class:"zm-note-scroll"},Om={class:"zm-note-section"},Lm={class:"zm-note-section-head"},Dm={class:"zm-note-split"},Vm=["disabled"],$m={key:0,class:"zm-note-preview"},Pm=["innerHTML"],Fm={key:1,class:"zm-note-preview-hint"},Um={key:0,class:"zm-note-section-actions"},Hm={key:0,class:"zm-note-add-row"},Wm={key:1,class:"zm-note-section"},Gm=["disabled"],jm=["href","title"],Km={key:2,class:"zm-note-section"},Ym=["disabled"],qm=["src","alt"],Xm={key:3,class:"zm-note-section"},Zm={class:"zm-note-section-head"},Jm={key:0,class:"zm-note-section-tag"},Qm=["disabled"],ep={key:0,class:"zm-note-code"},tp=["innerHTML"],np={key:4,class:"zm-note-section"},op=["disabled"],rp={key:0,class:"zm-note-table"},ip=["onClick"],lp={class:"zm-note-table-sort-mark","aria-hidden":"true"},$r=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,r=o,i=e.ref(""),s=e.ref(null);xr(s,{minRows:4,maxRows:10});const c=e.computed(()=>!i.value||i.value.trim()===""),u=e.computed(()=>Am(i.value)),d=e.ref(!0);function g(){d.value=!d.value}e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:O.text]},()=>{var y,p;i.value=((p=(y=n.selectedNode)==null?void 0:y.note)==null?void 0:p.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const y=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(y){y.focus();const p=y.value.length;y.setSelectionRange(p,p)}});function b(){var O,D;if(n.readonly)return;const y=i.value,p=((D=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:D.text)??"";y!==p&&r("apply",y)}function w(y){var p,O;n.readonly||(y.key==="Escape"?(y.preventDefault(),i.value=((O=(p=n.selectedNode)==null?void 0:p.note)==null?void 0:O.text)??"",y.target.blur()):y.key==="Enter"&&(y.ctrlKey||y.metaKey)&&(y.preventDefault(),b(),y.target.blur()))}function N(){n.readonly||confirm("移除该节点的笔记?")&&(i.value="",r("remove"))}const V=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.link)!=null&&p.url)}),_=e.computed(()=>{var y,p;return!!((p=(y=n.selectedNode)==null?void 0:y.image)!=null&&p.src)}),$=e.computed(()=>{var y,p;return(p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.kind}),B=e.computed(()=>$.value==="code"),T=e.computed(()=>$.value==="table"),E=e.ref(!1),k=e.ref(!1),m=e.ref(!1),v=e.ref(!1);e.watch(()=>{var y;return(y=n.selectedNode)==null?void 0:y.id},()=>{E.value=!1,k.value=!1,m.value=!1,v.value=!1});const x=e.ref("");e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.link)==null?void 0:O.url]},()=>{var y,p;x.value=((p=(y=n.selectedNode)==null?void 0:y.link)==null?void 0:p.url)??""},{immediate:!0});function j(){var O,D;if(n.readonly)return;const y=x.value.trim(),p=((D=(O=n.selectedNode)==null?void 0:O.link)==null?void 0:D.url)??"";y!==p&&r("set-link",y)}const K=e.ref("");e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.image)==null?void 0:O.src]},()=>{var y,p;K.value=((p=(y=n.selectedNode)==null?void 0:y.image)==null?void 0:p.src)??""},{immediate:!0});function ne(){var O,D;if(n.readonly)return;const y=K.value.trim(),p=((D=(O=n.selectedNode)==null?void 0:O.image)==null?void 0:D.src)??"";y!==p&&r("set-image",y)}function ce(y){const p=y.target;p.style.display="none"}function re(y){const p=y.target;p.style.display=""}const Y=e.ref(""),ee=e.ref(null);xr(ee,{minRows:4,maxRows:18}),e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:O.raw]},()=>{var y,p;Y.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??""},{immediate:!0});const ie=e.computed(()=>gr(Po(Y.value),Tn(Y.value)));function z(){var D,q;if(n.readonly)return;const y=Y.value,p=((q=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:q.raw)??"";if(y===p)return;const O=Tn(y)||void 0;r("set-rich",y?{kind:"code",raw:y,lang:O}:null)}const C=e.ref(""),F=e.ref(null);xr(F,{minRows:4,maxRows:14});const P=e.ref(-1),W=e.ref("asc");e.watch(()=>{var y,p,O;return[(y=n.selectedNode)==null?void 0:y.id,(O=(p=n.selectedNode)==null?void 0:p.richContent)==null?void 0:O.raw]},()=>{var y,p;C.value=((p=(y=n.selectedNode)==null?void 0:y.richContent)==null?void 0:p.raw)??"",P.value=-1,W.value="asc"},{immediate:!0});function ae(){var O,D;if(n.readonly)return;const y=C.value,p=((D=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:D.raw)??"";y!==p&&r("set-rich",y?{kind:"table",raw:y}:null)}const we=e.computed(()=>hr(C.value)),ve=e.computed(()=>{const y=we.value;return P.value<0||y.length<=1?y:qi(y,P.value,W.value)});function ze(y){P.value!==y?(P.value=y,W.value="asc"):W.value==="asc"?W.value="desc":P.value=-1}const Ne=e.computed(()=>{const y=[];return c.value||y.push(`${i.value.length} 字`),V.value&&y.push("1 链接"),_.value&&y.push("1 图片"),B.value&&y.push("代码块"),T.value&&y.push("表格"),y.length===0?"节点没有额外内容":y.join(" · ")});return(y,p)=>{var O,D,q,de;return e.openBlock(),e.createElementBlock("div",_m,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Rm,[e.createElementVNode("div",vm,[p[12]||(p[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",Bm,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",zm,e.toDisplayString(Ne.value),1)]),e.createElementVNode("div",Im,[e.createElementVNode("section",Om,[e.createElementVNode("header",Lm,[p[13]||(p[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),p[14]||(p[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:g},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",Dm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:s,"onUpdate:modelValue":p[0]||(p[0]=ge=>i.value=ge),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:b,onKeydown:w},null,40,Vm),[[e.vModelText,i.value]]),d.value?(e.openBlock(),e.createElementBlock("div",$m,[c.value?(e.openBlock(),e.createElementBlock("div",Fm," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,Pm))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",Um,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:N},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Hm,[!V.value&&!E.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:p[1]||(p[1]=ge=>E.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!_.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:p[2]||(p[2]=ge=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!B.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:p[3]||(p[3]=ge=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!T.value&&!v.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:p[4]||(p[4]=ge=>v.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),V.value||E.value?(e.openBlock(),e.createElementBlock("section",Wm,[p[15]||(p[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":p[5]||(p[5]=ge=>x.value=ge),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:j,onKeydown:p[6]||(p[6]=e.withKeys(e.withModifiers(ge=>ge.target.blur(),["prevent"]),["enter"]))},null,40,Gm),[[e.vModelText,x.value]]),V.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(O=t.selectedNode.link)==null?void 0:O.url,target:"_blank",rel:"noopener noreferrer",title:(D=t.selectedNode.link)==null?void 0:D.url},e.toDisplayString((q=t.selectedNode.link)==null?void 0:q.url),9,jm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||k.value?(e.openBlock(),e.createElementBlock("section",Km,[p[16]||(p[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":p[7]||(p[7]=ge=>K.value=ge),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ne,onKeydown:p[8]||(p[8]=e.withKeys(e.withModifiers(ge=>ge.target.blur(),["prevent"]),["enter"]))},null,40,Ym),[[e.vModelText,K.value]]),_.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(de=t.selectedNode.image)==null?void 0:de.src,alt:t.selectedNode.text,onError:ce,onLoad:re},null,40,qm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),B.value||m.value?(e.openBlock(),e.createElementBlock("section",Xm,[e.createElementVNode("header",Zm,[p[17]||(p[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(Tn)(Y.value)?(e.openBlock(),e.createElementBlock("span",Jm,e.toDisplayString(e.unref(Tn)(Y.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:ee,"onUpdate:modelValue":p[9]||(p[9]=ge=>Y.value=ge),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:z},null,40,Qm),[[e.vModelText,Y.value]]),Y.value.trim()?(e.openBlock(),e.createElementBlock("pre",ep,[e.createElementVNode("code",{innerHTML:ie.value},null,8,tp)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),T.value||v.value?(e.openBlock(),e.createElementBlock("section",np,[p[18]||(p[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:F,"onUpdate:modelValue":p[10]||(p[10]=ge=>C.value=ge),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
131
134
  | --- | --- |
132
- | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:se},null,40,Hm),[[e.vModelText,N.value]]),ke.value.length?(e.openBlock(),e.createElementBlock("table",Wm,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(ce,de)=>(e.openBlock(),e.createElementBlock("tr",{key:de},[de===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ce,(De,Ke)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ke}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":D.value===Ke,"is-asc":D.value===Ke&&Y.value==="asc","is-desc":D.value===Ke&&Y.value==="desc"}]),onClick:We=>Pe(Ke)},[e.createElementVNode("span",null,e.toDisplayString(De),1),e.createElementVNode("span",jm,e.toDisplayString(D.value===Ke?Y.value==="asc"?"▲":"▼":"↕"),1)],10,Gm))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ce,(De,Ke)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ke}`},e.toDisplayString(De),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",gm,[...z[11]||(z[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Km={class:"zm-app"},qm={class:"zm-app-main"},Ym={key:0,class:"zm-app-toolbar"},Xm={class:"zm-app-tip"},Zm={class:"zm-app-canvas"},Jm={class:"zm-settings-popover-header"},Gr=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:`本导图用于演示节点的全部可渲染字段。
135
+ | a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:ae},null,40,op),[[e.vModelText,C.value]]),we.value.length?(e.openBlock(),e.createElementBlock("table",rp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(ge,je)=>(e.openBlock(),e.createElementBlock("tr",{key:je},[je===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ge,(Pe,Je)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Je}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":P.value===Je,"is-asc":P.value===Je&&W.value==="asc","is-desc":P.value===Je&&W.value==="desc"}]),onClick:Ke=>ze(Je)},[e.createElementVNode("span",null,e.toDisplayString(Pe),1),e.createElementVNode("span",lp,e.toDisplayString(P.value===Je?W.value==="asc"?"▲":"▼":"↕"),1)],10,ip))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ge,(Pe,Je)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Je}`},e.toDisplayString(Pe),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",Mm,[...p[11]||(p[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),ap={class:"zm-app"},sp={class:"zm-app-main"},cp={class:"zm-app-canvas"},Bl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
133
136
  所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},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
137
  渲染在节点标题上方,自动支持语言 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
138
  interface Node {
@@ -160,4 +163,4 @@ function walk(n: Node) {
160
163
  | --- | --- | --- | --- | --- |
161
164
  | 1 | 2 | 3 | 4 | 5 |
162
165
  | 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 V=(de,De)=>({id:de,text:De,children:[]}),T=[V("s_l1","左一"),V("s_l2","左二"),V("s_l3","左三"),V("s_l4","左四"),V("s_l5","左五"),V("s_l6","左六"),V("s_l7","左七")],ce=[V("s_r1","右一"),V("s_r2","右二"),V("s_r3","右三"),V("s_r4","右四"),V("s_r5","右五"),V("s_r6","右六"),V("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...T,...ce]}})(),s=e.ref(o),c=t,u=e.ref(null),d=e.ref(new Set),m=e.ref(!1),p=e.ref(!1),k=e.ref(!1),y=e.ref(!1),w=e.ref(0),E=e.ref(!1),L=e.ref(!1),C=e.ref(null);function x(){s.value=n(),R.value=typeof location<"u"&&location.hash==="#rich"}const R=e.ref(!0);function S(){p.value=!0,k.value=!1,y.value=!1}function g(V){S()}const _=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function b(V){var T;Object.assign(_,V),(T=C.value)==null||T.applySettings(V)}function v(V){var T;u.value&&((T=C.value)==null||T.applyNodeStyle(u.value.id,V))}function H(){var T;const V={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1};Object.assign(_,V),(T=C.value)==null||T.applySettings(V)}function oe(V){if(!E.value)return;const T=V.target;T&&T.closest(".zm-settings-popover")||T&&T.closest('.zm-app-icon-btn[title="显示设置"]')||(E.value=!1)}function q(V){if(V.key==="Escape"){if(E.value){E.value=!1,V.stopPropagation();return}L.value&&(L.value=!1,V.stopPropagation())}}e.onMounted(()=>{var V;document.addEventListener("click",oe),document.addEventListener("keydown",q),window.addEventListener("hashchange",x),(V=C.value)==null||V.applySettings({rainbowBranch:_.rainbowBranch,branchPaletteId:_.branchPaletteId,customPalettes:_.customPalettes,lineWidthStart:_.lineWidthStart,lineWidthEnd:_.lineWidthEnd,lineStyle:_.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("click",oe),document.removeEventListener("keydown",q),window.removeEventListener("hashchange",x)});function J(V){s.value=V}function ae(V){var ce;const T=V&&V.length>0?V[0]:null;u.value=T,T?!y.value&&((ce=C.value)!=null&&ce.nodeHasContent(T.id))&&(p.value=!1,k.value=!1,y.value=!0):y.value=!1}e.watch(s,V=>{if(!u.value)return;const T=K(V,u.value.id);T?T!==u.value&&(u.value=T):u.value=null},{deep:!1});function W(V){if(!u.value||u.value.id!==V){const T=K(s.value,V);T&&(u.value=T)}p.value=!1,k.value=!1,y.value=!0,w.value++}function K(V,T){if(V.id===T)return V;for(const ce of V.children){const de=K(ce,T);if(de)return de}return null}function F(V){var T;u.value&&((T=C.value)==null||T.applyNodeNote(u.value.id,V))}function N(){var V;u.value&&((V=C.value)==null||V.removeNodeNote(u.value.id))}function P(V){var T;u.value&&((T=C.value)==null||T.applyNodeLink(u.value.id,V))}function D(V){var T;u.value&&((T=C.value)==null||T.applyNodeImageByUrl(u.value.id,V))}function Y(V){var T;u.value&&((T=C.value)==null||T.applyNodeRichContent(u.value.id,V))}function se(V){const T=document.querySelector(`[data-node-id="${V.id}"]`);T&&T.click()}function ke(V){const T=new Set(d.value);T.has(V)?T.delete(V):T.add(V),d.value=T}function Re(V){var T;(T=C.value)==null||T.setNodeText(V.id,V.text)}function Pe(V){var T;(T=C.value)==null||T.addChild(V)}function Te(V){var T;(T=C.value)==null||T.addSibling(V)}function B(V){var T;(T=C.value)==null||T.moveNode(V.srcId,V.targetId,V.position)}const z=e.computed(()=>{var V;return((V=u.value)==null?void 0:V.id)??null});function ie(V){return 1+V.children.reduce((T,ce)=>T+ie(ce),0)}const re=e.computed(()=>ie(s.value));return(V,T)=>{var ce;return e.openBlock(),e.createElementBlock("div",Km,[e.createVNode(rn,{side:"left",width:300,open:m.value,title:"大纲","onUpdate:open":T[0]||(T[0]=de=>m.value=de)},{default:e.withCtx(()=>[e.createVNode(zo,{data:s.value,"selected-id":z.value,"collapsed-ids":d.value,onSelect:se,onToggleCollapse:ke,onEdit:Re,onAddChild:Pe,onAddSibling:Te,onMove:B},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",qm,[L.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ym,[c.showOutlineBtn&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-icon-btn",title:"显示大纲",onClick:T[1]||(T[1]=de=>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]=de=>{p.value=!0,k.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&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-app-icon-btn",title:"显示 Markdown",onClick:T[3]||(T[3]=de=>{k.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&&!E.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-app-icon-btn",title:"显示设置",onClick:T[4]||(T[4]=de=>E.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",Xm,e.toDisplayString(s.value.text||"未命名")+" · "+e.toDisplayString(re.value)+" 节点",1),e.createCommentVNode("",!0),c.showPreviewModeBtn?(e.openBlock(),e.createElementBlock("button",{key:5,class:e.normalizeClass(["zm-app-icon-btn",{"is-on":L.value}]),title:"进入预览模式",onClick:T[5]||(T[5]=de=>L.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)])),L.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:T[6]||(T[6]=de=>L.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",Zm,[e.createVNode(Yn,{ref_key:"mindMapRef",ref:C,data:s.value,"preview-mode":L.value,onChange:J,onSelect:ae,onEditNote:W,onCanvasSettings:T[7]||(T[7]=de=>E.value=!0),onCanvasData:S,onCanvasImport:g,onCanvasTogglePreview:T[8]||(T[8]=de=>L.value=!L.value),onCanvasOutline:T[9]||(T[9]=de=>m.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(rn,{side:"right",width:360,open:p.value&&!L.value,title:"数据","onUpdate:open":T[11]||(T[11]=de=>p.value=de)},{default:e.withCtx(()=>[e.createVNode(Io,{data:s.value,onImport:T[10]||(T[10]=de=>s.value=de)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(rn,{side:"right",width:420,open:k.value&&!L.value,title:"Markdown","onUpdate:open":T[13]||(T[13]=de=>k.value=de)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:s.value,onImport:T[12]||(T[12]=de=>s.value=de)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(rn,{side:"right",width:360,open:y.value&&!L.value,title:"节点内容","onUpdate:open":T[14]||(T[14]=de=>y.value=de)},{default:e.withCtx(()=>[e.createVNode(ei,{"selected-node":u.value,readonly:!1,"focus-tick":w.value,onApply:F,onRemove:N,onSetLink:P,onSetImage:D,onSetRich:Y},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),E.value&&!L.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-settings-backdrop",onClick:T[15]||(T[15]=de=>E.value=!1)})):e.createCommentVNode("",!0),E.value&&!L.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-settings-popover",onClick:T[17]||(T[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Jm,[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]=de=>E.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(vo,{settings:_,"has-selection":u.value!==null,"selected-node-text":(ce=u.value)==null?void 0:ce.text,"onUpdate:settings":b,"onUpdate:nodeStyle":v,onReset:H},null,8,["settings","has-selection","selected-node-text"])])):e.createCommentVNode("",!0)])}}}),Qm={install(t){t.component("FlowMindMap",Yn),t.component("FlowMindMapOutline",zo),t.component("FlowMindMapDrawer",rn),t.component("FlowMindMapDataPanel",Io),t.component("FlowMindMapMarkdownPanel",Oo),t.component("FlowMindMapSettingsPanel",vo),t.component("FlowMindMapNotePanel",ei),t.component("FlowMindMapApp",Gr)}};Ee.DataPanel=Io,Ee.Drawer=rn,Ee.MarkdownPanel=Oo,Ee.MindMap=Yn,Ee.MindMapApp=Gr,Ee.NotePanel=ei,Ee.Outline=zo,Ee.SettingsPanel=vo,Ee.addChild=ki,Ee.addSibling=yi,Ee.clone=ct,Ee.default=Qm,Ee.findNode=fe,Ee.findParent=ut,Ee.markdownToMindMap=Zt,Ee.markdownToRichMindMap=$l,Ee.mindMapToMarkdown=Jt,Ee.removeNode=Pn,Ee.richBlockToMarkdown=Pl,Ee.uid=kt,Object.defineProperties(Ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
166
+ 鼠标悬浮预览前 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"?r:typeof location<"u"&&location.hash==="#stress"?i:(typeof location<"u"&&location.hash==="#rich",o)}const r={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:[]}]},i=(()=>{const y=(D,q)=>({id:D,text:q,children:[]}),p=[y("s_l1","左一"),y("s_l2","左二"),y("s_l3","左三"),y("s_l4","左四"),y("s_l5","左五"),y("s_l6","左六"),y("s_l7","左七")],O=[y("s_r1","右一"),y("s_r2","右二"),y("s_r3","右三"),y("s_r4","右四"),y("s_r5","右五"),y("s_r6","右六"),y("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...p,...O]}})(),s=e.ref(o),c=e.ref(null),u=e.ref(new Set),d=e.ref(!1),g=e.ref(!1),b=e.ref(!1),w=e.ref(!1),N=e.ref(0),V=e.ref(!1),_=e.ref(!1),$=e.ref(null);function B(){s.value=n()}function T(){g.value=!0,b.value=!1,w.value=!1}function E(y){T()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0}),m=e.computed(()=>{var y;return c.value?((y=$.value)==null?void 0:y.getNodeStyle(c.value.id))??{}:{}});function v(y){var p;Object.assign(k,y),(p=$.value)==null||p.applySettings(y)}function x(y){var p;c.value&&((p=$.value)==null||p.applyNodeStyle(c.value.id,y))}function j(){var p;const y={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,y),(p=$.value)==null||p.applySettings(y)}function K(y){if(y.key==="Escape"){if(V.value){V.value=!1,y.stopPropagation();return}_.value&&(_.value=!1,y.stopPropagation())}}e.onMounted(()=>{var y;document.addEventListener("keydown",K),window.addEventListener("hashchange",B),(y=$.value)==null||y.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",K),window.removeEventListener("hashchange",B)});function ne(y){s.value=y}function ce(y){var O;const p=y&&y.length>0?y[0]:null;c.value=p,p?!w.value&&((O=$.value)!=null&&O.nodeHasContent(p.id))&&(g.value=!1,b.value=!1,w.value=!0):w.value=!1}e.watch(s,y=>{if(!c.value)return;const p=Y(y,c.value.id);p?p!==c.value&&(c.value=p):c.value=null},{deep:!1});function re(y){if(!c.value||c.value.id!==y){const p=Y(s.value,y);p&&(c.value=p)}g.value=!1,b.value=!1,w.value=!0,N.value++}function Y(y,p){if(y.id===p)return y;for(const O of y.children){const D=Y(O,p);if(D)return D}return null}function ee(y){var p;c.value&&((p=$.value)==null||p.applyNodeNote(c.value.id,y))}function ie(){var y;c.value&&((y=$.value)==null||y.removeNodeNote(c.value.id))}function z(y){var p;c.value&&((p=$.value)==null||p.applyNodeLink(c.value.id,y))}function C(y){var p;c.value&&((p=$.value)==null||p.applyNodeImageByUrl(c.value.id,y))}function F(y){var p;c.value&&((p=$.value)==null||p.applyNodeRichContent(c.value.id,y))}function P(y){const p=document.querySelector(`[data-node-id="${y.id}"]`);p&&p.click()}function W(y){const p=new Set(u.value);p.has(y)?p.delete(y):p.add(y),u.value=p}function ae(y){var p;(p=$.value)==null||p.setNodeText(y.id,y.text)}function we(y){var p;(p=$.value)==null||p.addChild(y)}function ve(y){var p;(p=$.value)==null||p.addSibling(y)}function ze(y){var p;(p=$.value)==null||p.moveNode(y.srcId,y.targetId,y.position)}const Ne=e.computed(()=>{var y;return((y=c.value)==null?void 0:y.id)??null});return(y,p)=>(e.openBlock(),e.createElementBlock("div",ap,[e.createVNode(An,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":p[0]||(p[0]=O=>d.value=O)},{default:e.withCtx(()=>[e.createVNode(br,{data:s.value,"selected-id":Ne.value,"collapsed-ids":u.value,onSelect:P,onToggleCollapse:W,onEdit:ae,onAddChild:we,onAddSibling:ve,onMove:ze},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",sp,[_.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:p[1]||(p[1]=O=>_.value=!1)},[...p[11]||(p[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",cp,[e.createVNode(Fo,{ref_key:"mindMapRef",ref:$,data:s.value,"preview-mode":_.value,onChange:ne,onSelect:ce,onEditNote:re,onCanvasSettings:p[2]||(p[2]=O=>V.value=!0),onCanvasData:T,onCanvasImport:E,onCanvasTogglePreview:p[3]||(p[3]=O=>_.value=!_.value),onCanvasOutline:p[4]||(p[4]=O=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(An,{side:"right",width:360,open:g.value&&!_.value,title:"数据","onUpdate:open":p[6]||(p[6]=O=>g.value=O)},{default:e.withCtx(()=>[e.createVNode(kr,{data:s.value,onImport:p[5]||(p[5]=O=>s.value=O)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(An,{side:"right",width:420,open:b.value&&!_.value,title:"Markdown","onUpdate:open":p[8]||(p[8]=O=>b.value=O)},{default:e.withCtx(()=>[e.createVNode(yr,{data:s.value,onImport:p[7]||(p[7]=O=>s.value=O)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(An,{side:"right",width:360,open:w.value&&!_.value,title:"节点内容","onUpdate:open":p[9]||(p[9]=O=>w.value=O)},{default:e.withCtx(()=>[e.createVNode($r,{"selected-node":c.value,readonly:!1,"focus-tick":N.value,onApply:ee,onRemove:ie,onSetLink:z,onSetImage:C,onSetRich:F},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(An,{side:"right",width:340,open:V.value&&!_.value,title:"设置","onUpdate:open":p[10]||(p[10]=O=>V.value=O)},{default:e.withCtx(()=>{var O;return[e.createVNode(Er,{settings:k,"has-selection":c.value!==null,"selected-node-text":(O=c.value)==null?void 0:O.text,"node-style":m.value,"onUpdate:settings":v,"onUpdate:nodeStyle":x,onReset:j},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),dp={install(t){t.component("FlowMindMap",Fo),t.component("FlowMindMapOutline",br),t.component("FlowMindMapDrawer",An),t.component("FlowMindMapDataPanel",kr),t.component("FlowMindMapMarkdownPanel",yr),t.component("FlowMindMapSettingsPanel",Er),t.component("FlowMindMapNotePanel",$r),t.component("FlowMindMapApp",Bl)}};be.DataPanel=kr,be.Drawer=An,be.MARKER_LIB=ir,be.MarkdownPanel=yr,be.MindMap=Fo,be.MindMapApp=Bl,be.NotePanel=$r,be.Outline=br,be.SettingsPanel=Er,be.addChild=ri,be.addSibling=ii,be.clone=Ct,be.default=dp,be.findNode=le,be.findParent=Bt,be.markdownToMindMap=Vn,be.markdownToRichMindMap=Ma,be.markerDef=Pa,be.markerLabel=si,be.markerSvg=zo,be.mindMapToMarkdown=$n,be.removeNode=Mo,be.richBlockToMarkdown=Ra,be.tagColor=lr,be.uid=Ft,Object.defineProperties(be,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});