flow-mindmap 0.5.9 → 0.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/composables/usePanZoom.d.ts +1 -0
- package/dist/flow-mindmap.js +4068 -3975
- package/dist/flow-mindmap.umd.cjs +58 -58
- package/dist/style.css +2 -2
- package/dist/types.d.ts +7 -2
- package/package.json +77 -77
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
(function(Ce,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Ce=typeof globalThis<"u"?globalThis:Ce||self,e(Ce.FlowMind={},Ce.Vue))})(this,function(Ce,e){"use strict";var Kh=Object.defineProperty;var Yh=(Ce,e,In)=>e in Ce?Kh(Ce,e,{enumerable:!0,configurable:!0,writable:!0,value:In}):Ce[e]=In;var Ve=(Ce,e,In)=>Yh(Ce,typeof e!="symbol"?e+"":e,In);var ei;const In=["width","height","stroke-width"],Na={key:4,points:"6 9 12 15 18 9"},Sa={key:5,points:"9 6 15 12 9 18"},_e=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{width:t.size??16,height:t.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[t.name==="add"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=e.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="minus"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[3]||(n[3]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="delete"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n[5]||(n[5]=e.createStaticVNode('<polyline points="4 7 20 7"></polyline><path d="M9 7 V5 a1 1 0 0 1 1 -1 h4 a1 1 0 0 1 1 1 V7"></path><path d="M6 7 l1 12 a1 1 0 0 0 1 1 h8 a1 1 0 0 0 1 -1 l1 -12"></path><line x1="10" y1="11" x2="10" y2="18"></line><line x1="14" y1="11" x2="14" y2="18"></line>',5))],64)):t.name==="edit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[n[6]||(n[6]=e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):t.name==="collapse"?(e.openBlock(),e.createElementBlock("polyline",Na)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Sa)):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,In))}}),lr="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",ar="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",sr=[22,15,13,12],cr=[700,600,500,400],Ta=[46,36,30,26],Ca=[120,80,60,44],Ma=[.8,.8,.8,.8],Aa=1,_a=sr.length-1;function Ra(t,o){return Math.round(mi(t,o)*Ma[Ao(t)])}function Ao(t){return Math.min(_a,Math.max(0,t))}function mi(t,o=14){return Math.round(sr[Ao(t)]*o/14*10)/10}function Ba(t,o=14){return Math.round(Ta[Ao(t)]*o/14)}const io=60,va=30,Ia=.75,zn=14,vt=24;function dr(t){return Math.max(va,Math.round(io*Math.pow(Ia,t)))}let pi=null;function za(){if(pi)return pi;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(pi=t,t):{font:"",measureText:()=>({width:0})}}const ur=new Map;function fr(t,o,n){const i=`${n}|${o}|${t}`,a=ur.get(i);if(a!==void 0)return a;const c=za();c.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=t.split(`
|
|
2
|
-
`);let u=0;for(const d of s){const p=c.measureText(d).width;p>u&&(u=p)}return
|
|
3
|
-
`);let
|
|
4
|
-
`);
|
|
5
|
-
`+
|
|
1
|
+
(function(Ce,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Ce=typeof globalThis<"u"?globalThis:Ce||self,e(Ce.FlowMind={},Ce.Vue))})(this,function(Ce,e){"use strict";var Xh=Object.defineProperty;var Zh=(Ce,e,In)=>e in Ce?Xh(Ce,e,{enumerable:!0,configurable:!0,writable:!0,value:In}):Ce[e]=In;var He=(Ce,e,In)=>Zh(Ce,typeof e!="symbol"?e+"":e,In);var ti;const In=["width","height","stroke-width"],Ta={key:4,points:"6 9 12 15 18 9"},Ca={key:5,points:"9 6 15 12 9 18"},ve=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{width:t.size??16,height:t.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[t.name==="add"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=e.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="minus"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[3]||(n[3]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="delete"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n[5]||(n[5]=e.createStaticVNode('<polyline points="4 7 20 7"></polyline><path d="M9 7 V5 a1 1 0 0 1 1 -1 h4 a1 1 0 0 1 1 1 V7"></path><path d="M6 7 l1 12 a1 1 0 0 0 1 1 h8 a1 1 0 0 0 1 -1 l1 -12"></path><line x1="10" y1="11" x2="10" y2="18"></line><line x1="14" y1="11" x2="14" y2="18"></line>',5))],64)):t.name==="edit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[n[6]||(n[6]=e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):t.name==="collapse"?(e.openBlock(),e.createElementBlock("polyline",Ta)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Ca)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="database"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createElementVNode("ellipse",{cx:"12",cy:"6",rx:"7",ry:"2.5"},null,-1)),n[24]||(n[24]=e.createElementVNode("path",{d:"M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[26]||(n[26]=e.createElementVNode("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"},null,-1)),n[27]||(n[27]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[28]||(n[28]=e.createElementVNode("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M6 15 V9 L9 12 L12 9 V15"},null,-1)),n[30]||(n[30]=e.createElementVNode("path",{d:"M15 15 V9 L18 12 V9 M15 12 L18 15"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[31]||(n[31]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[32]||(n[32]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[33]||(n[33]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[35]||(n[35]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[36]||(n[36]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[37]||(n[37]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[38]||(n[38]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[39]||(n[39]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[40]||(n[40]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[41]||(n[41]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[42]||(n[42]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[43]||(n[43]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[44]||(n[44]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[45]||(n[45]=e.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[46]||(n[46]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[47]||(n[47]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[48]||(n[48]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[50]||(n[50]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[51]||(n[51]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[52]||(n[52]=e.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[54]||(n[54]=e.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[55]||(n[55]=e.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[56]||(n[56]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[57]||(n[57]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[58]||(n[58]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[60]||(n[60]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[61]||(n[61]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[62]||(n[62]=e.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[65]||(n[65]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[66]||(n[66]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="search"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[67]||(n[67]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="json"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[69]||(n[69]=e.createElementVNode("path",{d:"M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14"},null,-1)),n[70]||(n[70]=e.createElementVNode("path",{d:"M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14"},null,-1))],64)):t.name==="svg-export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:33},[n[71]||(n[71]=e.createElementVNode("path",{d:"M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[72]||(n[72]=e.createElementVNode("polyline",{points:"14 3 14 7 18 7"},null,-1)),n[73]||(n[73]=e.createElementVNode("polyline",{points:"8 14 6 16 8 18"},null,-1)),n[74]||(n[74]=e.createElementVNode("polyline",{points:"14 14 16 16 14 18"},null,-1))],64)):e.createCommentVNode("",!0)],8,In))}}),sr="data:image/svg+xml,%3csvg%20t='1780822312364'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7459'%20width='200'%20height='200'%3e%3cpath%20d='M329.16%20292.571h658.286V512H329.16zM329.16%200h658.286v219.429H329.16z'%20fill='%239AA1A2'%20p-id='7460'%3e%3c/path%3e%3cpath%20d='M44.927%20146.286a46.519%2046.519%200%200%201%2038.107-73.143h319.269v73.143H109.73V791.99l-48.713%205.705-24.43-651.41h8.339z'%20fill='%239AA1A2'%20p-id='7461'%3e%3c/path%3e%3cpath%20d='M363.83%20877.714H179.51c-78.775%200-142.921-66.12-142.921-147.31V112.787c0-21.943%2017.188-39.643%2038.473-39.643%2021.211%200%2033.5%2017.774%2033.5%2039.643v617.619c0%2037.522%2028.013%2076.58%2064.438%2076.58h190.903c21.211%200%2038.766%2013.97%2038.766%2035.84%200%2021.943-17.555%2034.89-38.766%2034.89z'%20fill='%239AA1A2'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M432.95%20438.857H179.51c-78.775%200-81.043-18.578-81.043-62.903l10.094-90.624c0%2020.48%2013.458%2080.677%2049.884%2080.677h210.139c21.211%200%20120.613%204.023%20120.613%2016.018%200%2011.922-35.036%2056.832-56.32%2056.832zM640.017%20749.714V640a54.857%2054.857%200%200%201%20109.714%200v109.714h109.715a54.857%2054.857%200%200%201%200%20109.715H749.73v109.714a54.857%2054.857%200%200%201-109.714%200V859.429H530.303a54.857%2054.857%200%200%201%200-109.715h109.714z'%20fill='%239AA1A2'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e",cr="data:image/svg+xml,%3csvg%20t='1780822464335'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8457'%20width='200'%20height='200'%3e%3cpath%20d='M512%20804.571h512V1024H512V804.571zM0%200h658.286v219.429H0V0z'%20fill='%239AA1A2'%20p-id='8458'%3e%3c/path%3e%3cpath%20d='M619.813%20950.857h-184.32c-78.775%200-142.922-66.121-142.922-147.31V185.93c0-21.943%2017.189-39.643%2038.474-39.643%2021.211%200%2033.353%2017.773%2033.353%2039.643v617.618c0%2037.523%2034.743%2073.728%2071.095%2073.728h184.32c21.211%200%2038.473%2012.069%2038.473%2033.939%200%2021.943-17.189%2039.643-38.473%2039.643z'%20fill='%239AA1A2'%20p-id='8459'%3e%3c/path%3e%3cpath%20d='M676.571%20457.143V347.429a54.857%2054.857%200%200%201%20109.715%200v109.714H896a54.857%2054.857%200%200%201%200%20109.714H786.286v109.714a54.857%2054.857%200%200%201-109.715%200V566.857H566.857a54.857%2054.857%200%200%201%200-109.714h109.714z'%20fill='%239AA1A2'%20p-id='8460'%3e%3c/path%3e%3c/svg%3e",dr=[22,15,13,12],ur=[700,600,500,400],Ma=[46,36,30,26],Aa=[120,80,60,44],_a=[.8,.8,.8,.8],Ra=1,Ba=dr.length-1;function va(t,o){return Math.round(pi(t,o)*_a[_o(t)])}function _o(t){return Math.min(Ba,Math.max(0,t))}function pi(t,o=14){return Math.round(dr[_o(t)]*o/14*10)/10}function za(t,o=14){return Math.round(Ma[_o(t)]*o/14)}const ro=60,Ia=30,La=.75,Ln=14,Lt=24;function fr(t){return Math.max(Ia,Math.round(ro*Math.pow(La,t)))}let hi=null;function Oa(){if(hi)return hi;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(hi=t,t):{font:"",measureText:()=>({width:0})}}const mr=new Map;function pr(t,o,n){const i=`${n}|${o}|${t}`,a=mr.get(i);if(a!==void 0)return a;const c=Oa();c.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=t.split(`
|
|
2
|
+
`);let u=0;for(const d of s){const p=c.measureText(d).width;p>u&&(u=p)}return mr.set(i,u),u}const Da=24,Va=400,$a=8,hr=16,gr=4,br=200;function Pa(t,o,n){return Math.min(n,Math.max(o,t))}function Fa(t,o,n,i,a){const c=_o(o),s=pi(o,n),u=Math.min(pr(t.text||"",s,ur[c]),br),d=va(o,n),p=Math.ceil(u+d*2+Ra*2),h=(t.text||"").split(`
|
|
3
|
+
`);let w=0;for(const ce of h){const ue=pr(ce,s,ur[c]);w+=Math.max(1,Math.ceil(ue/br))}w=Math.max(1,w);const $=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(s*1.2)+6+Math.ceil(s*1.2*(w-1)):za(o,n)+Math.ceil(s*1.2*(w-1));let R=0;if(t.link&&(R+=hr),t.note&&(R+=hr),R>0){const ce=(t.link?1:0)+(t.note?1:0);R+=gr*ce}const U=14,I=2;let _=0;t.markers&&t.markers.length>0&&(_=t.markers.length*U+(t.markers.length-1)*I+gr);const y=18,k=4,m=t.tags&&t.tags.length>0?y:0,P=p+R+_,j=(()=>{const ce=Math.round(Aa[c]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const ue=a==null?void 0:a[t.id];return Math.max(ce,ue??240)}return ce})(),Y=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),E=i==null?void 0:i[t.id],re=Y?Math.max(24,E??Math.max(70,Math.ceil(s*5))):0,pe=re>0?10:0;if(!t.image){const ce=Math.max(j,P),ue=Math.ceil($+pe+re+(m>0?k+m:0));return{w:ce,h:ue}}const de=Pa(t.image.width,Da,Va),Ee=Math.max(j,P,Math.ceil(de+d*2)),ee=Math.ceil(t.image.height+$a+$+pe+re+(m>0?k+m:0));return{w:Ee,h:ee}}function Ua(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,a=o.baseFontSize??14,c=yr(t,0,null,1,"right",a,o.richHeights,o.richWidths);return Wa(c),Ha(c,n,i),c.x=0,c.y=0,Ga(c,i)}function Ha(t,o,n=!1){if(o==="mindmap"){const i=t.children;if(i.length!==0)if(i.length===1)i[0]._dir="right",i[0].side=1,i[0]._dirRight=1;else{const u=i.reduce((w,C)=>w+C._subtreeH,0);let d=1,p=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),h=0;for(let w=0;w<i.length-1;w++){h+=i[w]._subtreeH;const C=Math.abs(h-(u-h));C<p&&(p=C,d=w+1)}for(let w=0;w<d;w++)i[w]._dir="right",i[w].side=1,i[w]._dirRight=1;for(let w=d;w<i.length;w++)i[w]._dir="left",i[w].side=-1,i[w]._dirRight=-1}const a=t.children.filter(u=>u.side===1),c=t.children.filter(u=>u.side===-1),s=(u,d)=>{const p=d==="right"?1:-1;u._dir=d,u.side=p,u._dirRight=p;for(const h of u.children)s(h,d)};for(const u of a)s(u,"right");for(const u of c)s(u,"left");if(a.length>0){const u={...t,children:a};Ro(u,"right",ro,!0,n)}if(c.length>0){const u={...t,children:c};Ro(u,"left",ro,!0,n)}}else if(o==="tree"){const i=a=>{a.side=1,a._dir="right";for(const c of a.children)i(c)};for(const a of t.children)a._dir="right";Ro(t,"right",ro,!0,n),i(t)}else{for(const i of t.children)i._dir="down";kr(t,ro,n)}}function Ro(t,o,n,i,a=!1){if(t.children.length===0)return;const c=t.children.reduce((h,w,C)=>h+w._subtreeH+(C>0?Ln:0),0),s=o==="right"?1:-1,u=i?s:1;let d=t.y-u*c/2;const p=fr(t.depth);t.children.forEach(h=>{a||(h.x=t.x+s*(t.width/2+p+h.width/2),h.y=d+u*h._subtreeH/2),h._dir=o,d+=u*(h._subtreeH+Ln),Ro(h,o,n,!1,a)})}function kr(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((s,u,d)=>s+u._subtreeW+(d>0?Ln*2:0),0);let a=t.x-i/2;const c=fr(t.depth);t.children.forEach(s=>{n||(s.x=a+s._subtreeW/2,s.y=t.y+t.height/2+c+s.height/2),s._dir="down",a+=s._subtreeW+Ln*2,kr(s,o,n)})}function yr(t,o,n,i,a,c,s,u){const d=Fa(t,o,c,s,u),p={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:pi(o,c),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:a,_dirRight:i,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,markers:t.markers?[...t.markers]:void 0,tags:t.tags?[...t.tags]:void 0,children:[],parent:n};if(t.collapsed)return p;const h=t.children.length,w=Math.ceil(h/2);return p.children=t.children.map((C,$)=>{const R=o===0?$<w?1:-1:i;return yr(C,o+1,p,R,a,c,s,u)}),p}function Wa(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const a of i.children)o.push(a)}for(let n=o.length-1;n>=0;n--){const i=o[n];if(i.collapsed||i.children.length===0){i._subtreeH=i.height,i._subtreeW=i.width;continue}let a=0,c=0;for(const s of i.children)a+=s._subtreeH,c+=s._subtreeW;i.children.length>1&&(a+=Ln*(i.children.length-1),c+=Ln*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,a),i._subtreeW=Math.max(i.width,c)}}function Ga(t,o=!1){const n=[t];let i=1/0,a=-1/0,c=1/0,s=-1/0;for(;n.length;){const p=n.pop(),h=p.width/2,w=p.height/2;p.x-h<i&&(i=p.x-h),p.x+h>a&&(a=p.x+h),p.y-w<c&&(c=p.y-w),p.y+w>s&&(s=p.y+w),n.push(...p.children)}if(o)return{root:t,width:a-i+Lt*2,height:s-c+Lt*2,vbX:i-Lt,vbY:c-Lt,vbW:a-i+Lt*2,vbH:s-c+Lt*2};const u=Lt-c,d=[t];for(;d.length;){const p=d.pop();p.y+=u,d.push(...p.children)}return c+=u,s+=u,{root:t,width:a-i+Lt*2,height:s+Lt,vbX:i-Lt,vbY:0,vbW:a-i+Lt*2,vbH:s+Lt}}const mn=[{id:"default",name:"默认",colors:["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc"]},{id:"classic",name:"经典",colors:["#ef4444","#f59e0b","#10b981","#3b82f6","#6366f1","#8b5cf6","#ec4899","#14b8a6"]},{id:"vivid",name:"活力",colors:["#dc2626","#ea580c","#ca8a04","#16a34a","#0891b2","#2563eb","#7c3aed","#db2777"]},{id:"dev",name:"代码",colors:["#f472b6","#a78bfa","#60a5fa","#38bdf8","#22d3ee","#34d399","#facc15","#fb923c"]},{id:"mint",name:"薄荷",colors:["#5eead4","#67e8f9","#93c5fd","#c4b5fd","#fbcfe8","#fde68a","#a7f3d0","#bae6fd"]}];function ja(t,o=[]){return[...mn,...o].find(i=>i.id===t)??mn[0]}function Ka(t,o=8){const n=[],i=new Set,a=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let c;for(;(c=a.exec(t))!==null;){const s=c[0];let u=null;if(s.startsWith("#")?u=Ya(s):s.startsWith("rgb")?u=qa(s):u=Xa[s.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!i.has(d)&&(i.add(d),n.push(d),n.length>=o))break}return n}function Ya(t){const o=t.startsWith("#")?t.slice(1):t;if(!/^[0-9a-fA-F]+$/.test(o))return null;let n;if(o.length===3)n=o.split("").map(i=>i+i).join("");else if(o.length===4)n=o.slice(0,3).split("").map(i=>i+i).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function qa(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const i=[];for(let a=0;a<3;a++){const c=n[a];if(c.endsWith("%")){const s=parseFloat(c);if(!isFinite(s))return null;i.push(Math.round(s/100*255))}else{const s=parseInt(c,10);if(!isFinite(s)||s<0||s>255)return null;i.push(s)}}return"#"+i.map(a=>a.toString(16).padStart(2,"0")).join("").toLowerCase()}const Xa={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function Xt(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Ot(t){return JSON.parse(JSON.stringify(t))}function be(t,o){if(t.id===o)return t;for(const n of t.children){const i=be(n,o);if(i)return i}return null}function Dt(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const a=Dt(i,o,t);if(a!==null)return a}return null}function Bo(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(Bo(i,o))return!0;return!1}function Za(t,o,n){const i=be(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function gi(t,o,n,i){if(!Dt(t,o)||o===n||be(be(t,o),n))return!1;const a=Dt(t,o),c=a.children.findIndex(p=>p.id===o);if(c<0)return!1;const[s]=a.children.splice(c,1);if(i==="child"){const p=be(t,n);return p?(p.children.push(s),!0):(a.children.splice(c,0,s),!1)}const u=Dt(t,n);if(!u)return a.children.splice(c,0,s),!1;let d=u.children.findIndex(p=>p.id===n);return d<0?(a.children.splice(c,0,s),!1):(i==="after"&&(d+=1),u.children.splice(d,0,s),!0)}function xr(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const a of t.children){const c=a.text.match(o);if(c)if(c[1]){const s=parseInt(c[1],10);s>n&&(n=s)}else i=!0}return n===0&&!i?zo:n>0?`新节点 ${n+1}`:"新节点 2"}function bi(t,o,n){const i=be(t,o);if(!i)return null;const a={id:Xt(),text:n??xr(i),children:[]};return i.children.push(a),a}function Er(t,o,n){const i=Dt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Xt(),text:n??xr(i),children:[]};return i.children.splice(a+1,0,c),c}function Ja(t,o,n){const i=Dt(t,o);if(!i)return null;const a=i.children.findIndex(s=>s.id===o);if(a<0)return null;const c={id:Xt(),text:n,children:[]};return i.children.splice(a,0,c),c}function Qa(t,o){const n=Dt(t,o);if(!n)return null;const i=n.children.findIndex(s=>s.id===o);if(i<0)return null;const a=n.children[i],c=Ot(a);return vo(c),n.children.splice(i+1,0,c),c}function vo(t){t.id=Xt();for(const o of t.children)vo(o)}function wr(t,o){const n=be(t,o);if(!n||n.id===t.id)return null;const i=Ot(n);return vo(i),i}function Nr(t){return t.children.reduce((o,n)=>o+1+Nr(n),0)}const zo="新节点";function On(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:Xt(),text:o,children:[]},a=[i],c=[-1/0],s=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,h=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let w=!1,C=[],$=null;function R(_){C.push(_)}function U(){if($&&C.length>0){for(;C.length>0&&C[0].trim()==="";)C.shift();for(;C.length>0&&C[C.length-1].trim()==="";)C.pop();const _=C.join(`
|
|
4
|
+
`);_&&($.note={text:_})}w=!1,C=[]}for(const _ of n){if(w){const j=_.match(h);if(j&&j[1][0]==="`"){U();continue}R(_);continue}const y=_.match(u);if(y){const j=y[1].length,Y=y[2].trim();s.push({level:j,text:Y,body:""}),$=s[s.length-1];continue}const k=_.match(h);if(k&&k[2]==="note"){w=!0,C=[];continue}const m=_.match(d);if(m&&$){const j=m[2],Y=160,E=120;$.image={src:j,naturalW:Y,naturalH:E,width:Y,height:E};continue}const P=_.match(p);if(P&&$){$.link={url:P[2]},$.text=P[1];continue}if(_.trim().length>0&&$){const j=_.trim();$.body=$.body?$.body+`
|
|
5
|
+
`+j:j}}w&&U();function I(_){for(;a.length>1;){const P=a.length-1,j=c[P];if(j!==void 0&&j<_.level)break;a.pop(),c.pop()}const y=a[a.length-1],k=_.text,m={id:Xt(),text:k,children:[]};_.image&&(m.image={..._.image}),_.link&&(m.link={url:_.link.url}),_.note&&(m.note={text:_.note.text}),_.body&&(m.note={text:_.body}),y.children.push(m),a.push(m),c.push(_.level)}for(const _ of s)I(_);if(s.length>0&&s[0].level===1){const _=i.children[0];_&&(i.text=_.text,i.id=_.id,_.image&&(i.image={..._.image}),_.link&&(i.link={url:_.link.url}),_.note&&(i.note={text:_.note.text}),i.children=_.children)}return i}function Dn(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
|
|
6
6
|
`;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
|
|
7
7
|
`),t.image&&(n+=`
|
|
8
8
|
`),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
|
|
9
|
-
`);for(const i of t.children)n+=
|
|
10
|
-
`).trim();n.push({kind:"code",text:((p=
|
|
9
|
+
`);for(const i of t.children)n+=Dn(i,o+1);return n}function es(t){var p,h;const o=t.split(/\r?\n/),n=[];let i=0;const a=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const w=o[i],C=w.match(c);if(C){const k=C[1][0],m=C[2]||"",P=[w];for(i++;i<o.length;){const Y=o[i].match(c);if(Y&&Y[1][0]===k){P.push(o[i]),i++;break}P.push(o[i]),i++}const j=P.slice(1,-1).join(`
|
|
10
|
+
`).trim();n.push({kind:"code",text:((p=j.split(`
|
|
11
11
|
`)[0])==null?void 0:p.slice(0,80))||"(空代码块)",raw:P.join(`
|
|
12
|
-
`),lang:m});continue}const $=
|
|
13
|
-
`)}),i=m;continue}}const R=
|
|
14
|
-
`)}),i=
|
|
15
|
-
`:""}function ts(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,a=e.ref(1),c=e.ref(0),s=e.ref(0),u=e.ref(!1),d=e.ref(!1),p=e.reactive({x:0,y:0,ox:0,oy:0}),h=e.ref(!1),x=e.reactive({x:0,y:0}),C=e.reactive({x:0,y:0,width:0,height:0}),$=e.ref(0);let R=null;function F(J){R=J}function O(J){J.preventDefault();const me=t.getContainer();if(!me)return;const ae=-J.deltaY*.001,ke=Math.min(n,Math.max(o,a.value*(1+ae))),b=me.getBoundingClientRect(),V=J.clientX-b.left,W=J.clientY-b.top,ee=(V-c.value)/a.value,ge=(W-s.value)/a.value;a.value=ke,c.value=V-ee*ke,s.value=W-ge*ke}function A(){a.value=Math.min(n,a.value*i)}function y(){a.value=Math.max(o,a.value/i)}function k(J){var ae;J.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,p.x=J.clientX,p.y=J.clientY,p.ox=c.value,p.oy=s.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",P),(ae=J.preventDefault)==null||ae.call(J))}function m(J){if(!u.value)return;const me=J.clientX-p.x,ae=J.clientY-p.y;(Math.abs(me)>3||Math.abs(ae)>3)&&(d.value=!0),c.value=p.ox+me,s.value=p.oy+ae}function P(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",P)}function G(J,me,ae){h.value=!0,x.x=J,x.y=me,C.x=J,C.y=me,C.width=0,C.height=0,C.shiftKey=!!(ae!=null&&ae.shift),$.value++,window.addEventListener("mousemove",ie),window.addEventListener("mouseup",w)}function q(J,me){if(!h.value)return;const ae=Math.min(x.x,J),ke=Math.min(x.y,me),b=Math.max(x.x,J),V=Math.max(x.y,me);C.x=ae,C.y=ke,C.width=b-ae,C.height=V-ke,$.value++}function w(){h.value=!1,window.removeEventListener("mousemove",ie),window.removeEventListener("mouseup",w),R&&R()}function ie(J){if(!h.value)return;const me=t.getContainer();if(!me)return;const ae=me.getBoundingClientRect(),ke=(J.clientX-ae.left-c.value)/a.value,b=(J.clientY-ae.top-s.value)/a.value;q(ke,b)}function fe(J,me,ae,ke=60){const b=t.getContainer();if(!b)return;const V=b.getBoundingClientRect(),W=(V.width-ke*2)/J,ee=(V.height-ke*2)/me,ge=Math.min(1,Math.max(.3,Math.min(W,ee)));a.value=ge,c.value=V.width/2,s.value=V.height/2-ae*ge}function ce(J,me,ae,ke,b=80){const V=t.getContainer();if(!V)return;const W=V.getBoundingClientRect();let ee=a.value;(ae*ee<40||ke*ee<40)&&(ee=Math.min(n,Math.max(1,60/Math.min(ae,ke)))),a.value=ee,c.value=W.width/2-J*ee,s.value=W.height/2-me*ee}return{scale:a,offsetX:c,offsetY:s,isPanning:u,panMoved:d,onWheel:O,zoomIn:A,zoomOut:y,startPan:k,startMarquee:G,updateMarquee:q,isMarquee:h,marquee:C,marqueeVersion:$,setOnMarqueeEnd:F,resetView:fe,centerOn:ce}}const ns=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function wr(t){return ns?t.metaKey:t.ctrlKey}function os(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const a=t.getSelectedIds();return a.length>0?a[0]:null}function n(i){var u,d,p;const a=i.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable)||t.isReadonly()||t.isEditing())return;const c=t.getSelectedId(),s=o();if(s){if(wr(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const h=(u=t.defaultTargetId)==null?void 0:u.call(t);c&&c!==h&&(i.preventDefault(),t.onDuplicate(c));return}if(i.key==="c"||i.key==="C"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCopy(h));return}if(i.key==="x"||i.key==="X"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCut(h));return}if(i.key==="v"||i.key==="V"){if(!t.hasClipboard())return;i.preventDefault();const h=t.getSelectedIds();t.onPaste(h.length>0?h[0]:null);return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(wr(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(s);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const h=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==h&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else if((i.key==="Delete"||i.key==="Backspace")&&c&&c!==((p=t.defaultTargetId)==null?void 0:p.call(t)))i.preventDefault(),t.onRemove(c);else if(i.key==="F2"&&c)i.preventDefault(),t.onStartEdit(c);else if(i.key==="Escape")i.preventDefault(),t.onClearSelection();else if(i.altKey&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey){if(i.key==="ArrowUp"){i.preventDefault(),t.onMoveSibling(-1);return}else if(i.key==="ArrowDown"){i.preventDefault(),t.onMoveSibling(1);return}}else i.key==="ArrowDown"?(i.preventDefault(),t.onNavigate(0,1)):i.key==="ArrowUp"?(i.preventDefault(),t.onNavigate(0,-1)):i.key==="ArrowRight"?(i.preventDefault(),t.onNavigate(1,0)):i.key==="ArrowLeft"&&(i.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function is(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function a(){return n<o.value.length-1}function c(p){const h=JSON.stringify(p);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(h),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function s(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return a()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:a,record:c,undo:s,redo:u,reset:d}}const rs={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},ls={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,i=rs[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${i}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function as(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),i=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${i.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const ss={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:as(t)}))},cs={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"/>`}))},gi=[ls,ss,cs,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],Io={};for(const t of gi)for(const o of t.markers)Io[o.id]=o;function ds(t){return Io[t]}function zo(t){var o;return((o=Io[t])==null?void 0:o.svg)??""}function Nr(t){var o;return((o=Io[t])==null?void 0:o.label)??t}function bi(t){let o=0;for(let i=0;i<t.length;i++)o=(o<<5)-o+t.charCodeAt(i),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const us={key:5,class:"zm-marker-picker"},fs={class:"zm-marker-group-label"},ms={class:"zm-marker-grid"},ps=["title","onClick","innerHTML"],hs=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let y=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),P=180,q=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;y+P>m.right&&(y=Math.max(m.left+4,n.x-P-2)),k+q>m.bottom&&(k=Math.max(m.top+4,n.y-q-2)),y<m.left+2&&(y=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:y,top:k}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),p=e.computed(()=>n.nodeTags.length>0),h=e.ref(!1);function x(){h.value=!h.value}function C(y){return n.nodeMarkers.includes(y)}function $(y){i("toggleMarker",y)}function R(y){const k=y.target;k&&k.closest(".zm-node-menu")||i("close")}function F(y){y.key==="Escape"&&i("close")}function O(){i("close")}window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",F,!0),window.addEventListener("wheel",O,!0),window.addEventListener("scroll",O,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",F,!0),window.removeEventListener("wheel",O,!0),window.removeEventListener("scroll",O,!0)});function A(y){y(),i("close")}return(y,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:k[13]||(k[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[0]||(k[0]=e.withModifiers(m=>A(()=>i("pickImage")),["stop"]))},[e.createVNode(_e,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"替换图片":"添加图片"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:k[1]||(k[1]=e.withModifiers(m=>A(()=>i("removeImage")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[14]||(k[14]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[2]||(k[2]=e.withModifiers(m=>A(()=>i("setLink")),["stop"]))},[e.createVNode(_e,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:k[3]||(k[3]=e.withModifiers(m=>A(()=>i("removeLink")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[15]||(k[15]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[4]||(k[4]=e.withModifiers(m=>A(()=>i("addCode")),["stop"]))},[k[16]||(k[16]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:k[5]||(k[5]=e.withModifiers(m=>A(()=>i("removeCode")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[17]||(k[17]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[6]||(k[6]=e.withModifiers(m=>A(()=>i("addTable")),["stop"]))},[k[18]||(k[18]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:k[7]||(k[7]=e.withModifiers(m=>A(()=>i("removeTable")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[19]||(k[19]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[8]||(k[8]=e.withModifiers(m=>A(()=>i("editNote")),["stop"]))},[e.createVNode(_e,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:k[9]||(k[9]=e.withModifiers(m=>A(()=>i("removeNote")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[20]||(k[20]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0),k[25]||(k[25]=e.createElementVNode("div",{class:"zm-node-menu-divider"},null,-1)),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:e.withModifiers(x,["stop"])},[k[21]||(k[21]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"⚑",-1)),k[22]||(k[22]=e.createElementVNode("span",null,"标记图标",-1)),e.createElementVNode("span",{class:e.normalizeClass(["zm-node-menu-arrow",{"is-open":h.value}])},"›",2)]),h.value?(e.openBlock(),e.createElementBlock("div",us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(gi),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",fs,e.toDisplayString(m.label),1),e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":C(P.id)}]),title:P.label,onClick:e.withModifiers(G=>$(P.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(zo)(P.id)+"</svg>"},null,10,ps))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>i("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>A(()=>i("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(p.value?"编辑标签":"添加标签"),1)]),p.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>A(()=>i("removeTags")),["stop"]))},[e.createVNode(_e,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),gs=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let A=n.x+2,y=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,P=4+4*28+5;A+m>k.right&&(A=Math.max(k.left+4,n.x-m-2)),y+P>k.bottom&&(y=Math.max(k.top+4,n.y-P-2)),A<k.left+2&&(A=k.left+2),y<k.top+2&&(y=k.top+2)}return{left:A,top:y}}),c=e.ref(null),s=e.ref(null),u=e.ref(null),d=e.computed(()=>{const A=c.value==="import"?s.value:c.value==="export"?u.value:null;if(!A)return{left:"-9999px",top:"-9999px",display:"none"};const y=A.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,P=176,G=4+3*28;let q=y.right;q+P>k-4&&(q=Math.max(4,y.left-P));let w=y.top-4;return w+G>m-4&&(w=Math.max(4,m-G-4)),{left:q+"px",top:w+"px",display:"block"}});let p=null,h=null;function x(A){h&&(clearTimeout(h),h=null),p=setTimeout(()=>{c.value=A},60)}function C(){p&&(clearTimeout(p),p=null),h=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{p&&clearTimeout(p),h&&clearTimeout(h)});function $(A){const y=A.target;y&&y.closest(".zm-canvas-menu")||i("close")}function R(A){A.key==="Escape"&&i("close")}function F(){i("close")}window.addEventListener("mousedown",$,!0),window.addEventListener("keydown",R,!0),window.addEventListener("wheel",F,!0),window.addEventListener("scroll",F,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",$,!0),window.removeEventListener("keydown",R,!0),window.removeEventListener("wheel",F,!0),window.removeEventListener("scroll",F,!0)});function O(A){A(),i("close")}return(A,y)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:y[11]||(y[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[0]||(y[0]=e.withModifiers(k=>O(()=>i("openData")),["stop"]))},[e.createVNode(_e,{name:"database",size:13,stroke:1.6}),y[12]||(y[12]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:s,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="import"}]),onMouseenter:y[5]||(y[5]=k=>x("import")),onMouseleave:C},[e.createVNode(_e,{name:"import",size:13,stroke:1.6}),y[16]||(y[16]=e.createElementVNode("span",null,"导入",-1)),y[17]||(y[17]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),c.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:y[4]||(y[4]=k=>x("import")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[1]||(y[1]=e.withModifiers(k=>O(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(_e,{name:"markdown",size:13,stroke:1.6}),y[13]||(y[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[2]||(y[2]=e.withModifiers(k=>O(()=>i("openImport","json")),["stop"]))},[e.createVNode(_e,{name:"json",size:13,stroke:1.6}),y[14]||(y[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[3]||(y[3]=e.withModifiers(k=>O(()=>i("openImport","txt")),["stop"]))},[e.createVNode(_e,{name:"txt",size:13,stroke:1.6}),y[15]||(y[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[6]||(y[6]=e.withModifiers(k=>O(()=>i("openSettings")),["stop"]))},[e.createVNode(_e,{name:"settings",size:13,stroke:1.6}),y[18]||(y[18]=e.createElementVNode("span",null,"设置",-1))]),y[23]||(y[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:u,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="export"}]),onMouseenter:y[10]||(y[10]=k=>x("export")),onMouseleave:C},[e.createVNode(_e,{name:"export",size:13,stroke:1.6}),y[21]||(y[21]=e.createElementVNode("span",null,"导出",-1)),y[22]||(y[22]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),c.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:y[9]||(y[9]=k=>x("export")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[7]||(y[7]=e.withModifiers(k=>O(()=>i("exportPng")),["stop"]))},[e.createVNode(_e,{name:"image",size:13,stroke:1.6}),y[19]||(y[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[8]||(y[8]=e.withModifiers(k=>O(()=>i("exportSvg")),["stop"]))},[e.createVNode(_e,{name:"svg-export",size:13,stroke:1.6}),y[20]||(y[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),bs=["aria-hidden"],ks=["aria-hidden"],ys={key:0,class:"zm-drawer-header"},Es={key:0,class:"zm-drawer-title"},xs={class:"zm-drawer-body"},ws=["aria-hidden"],Ns={key:0,class:"zm-drawer-header"},Ss={key:0,class:"zm-drawer-title"},Ts={class:"zm-drawer-body"},Ot=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function i(){n("update:open",!1)}function a(){n("update:open",!1)}return(c,s)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:s[0]||(s[0]=u=>t.closeOnBackdrop&&a())},null,8,bs)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",ys,[t.title?(e.openBlock(),e.createElementBlock("h3",Es,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[1]||(s[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",xs,[e.renderSlot(c.$slots,"default")])],14,ks)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",Ns,[t.title?(e.openBlock(),e.createElementBlock("h3",Ss,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[2]||(s[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ts,[e.renderSlot(c.$slots,"default")])],14,ws)):e.createCommentVNode("",!0)]),_:3}))}}),Cs={class:"zm-outline-root"},Ms={class:"zm-outline-search"},As={key:0,class:"zm-outline-search-count"},_s={key:1,class:"zm-outline-search-count zm-outline-search-empty"},Rs={class:"zm-outline-actions"},Bs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},vs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Is={key:1,d:"M5 12 L10 17 L19 7"},zs={class:"zm-outline"},Os=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Ls=["title","onClick"],Ds={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Vs={key:0,points:"6 9 12 15 18 9"},$s={key:1,points:"9 6 15 12 9 18"},Ps={key:1,class:"zm-outline-dot"},Fs={key:2,class:"zm-outline-index"},Us={key:4,class:"zm-outline-text"},Hs=["onClick"],Ws=["src"],Gs=["onClick"],js=["src"],Ks=["title","onClick"],Ys={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"},Xs={key:1,d:"M5 12 L10 17 L19 7"},Oo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1},showIndex:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null),s=e.ref(-1),u=e.computed(()=>{const N=a.value.trim().toLowerCase();if(!N)return new Set;const U=new Set,H=oe=>{var Ee;(oe.text.toLowerCase().includes(N)||(Ee=oe.note)!=null&&Ee.text&&oe.note.text.toLowerCase().includes(N))&&U.add(oe.id);for(const et of oe.children)H(et)};return H(n.data),U}),d=e.computed(()=>{if(u.value.size===0)return new Set;const N=new Set,U=H=>{let oe=u.value.has(H.id);for(const Ee of H.children)U(Ee)&&(oe=!0);return oe&&N.add(H.id),oe};return U(n.data),N}),p=e.computed(()=>{const N=[],U=H=>{u.value.has(H.id)&&N.push(H.id);for(const oe of H.children)U(oe)};return U(n.data),N}),h=e.computed(()=>a.value.trim().length>0),x=e.computed(()=>{const N=[],U=d.value,H=(oe,Ee,et)=>{if(h.value&&!U.has(oe.id))return;const ut=oe.children.length>0,tt=h.value?!1:n.collapsedIds.has(oe.id);N.push({id:oe.id,text:oe.text||"(无标题)",depth:Ee,siblingIndex:et,hasChildren:ut,collapsed:tt,node:oe}),ut&&!tt&&oe.children.forEach((nn,nt)=>H(nn,Ee+1,nt))};return H(n.data,0,0),N});function C(){s.value=p.value.length>0?0:-1}function $(){const N=p.value;N.length!==0&&(s.value=(s.value+1)%N.length,O(s.value))}function R(){const N=p.value;N.length!==0&&(s.value=(s.value-1+N.length)%N.length,O(s.value))}function F(N){N.key==="Enter"?(N.preventDefault(),N.shiftKey?R():$()):N.key==="Escape"&&(N.preventDefault(),a.value="",s.value=-1)}function O(N){const U=p.value[N];if(!U)return;const H=x.value.find(oe=>oe.id===U);H&&i("select",H.node),e.nextTick(()=>{const oe=document.querySelector(`[data-outline-id="${U}"]`);oe==null||oe.scrollIntoView({block:"nearest",behavior:"smooth"})})}function A(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var N;return(N=c.value)==null?void 0:N.focus()})});const y=e.ref(null),k=e.ref("");let m=null;function P(N){n.readonly||(y.value=N.id,k.value=N.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function G(){y.value!=null&&(i("edit",{id:y.value,text:k.value.trim()||"(无标题)"}),q())}function q(){y.value=null,k.value="",m=null}function w(N){N.key==="Enter"?(N.preventDefault(),G()):N.key==="Escape"&&(N.preventDefault(),q())}e.onBeforeUnmount(q);const ie=e.ref(null),fe=e.ref(null),ce=e.ref(null);function J(N,U){if(n.readonly){N.preventDefault();return}ie.value={id:U.id,text:U.text},N.dataTransfer&&(N.dataTransfer.effectAllowed="move",N.dataTransfer.setData("text/plain",U.id))}function me(){ie.value=null,fe.value=null,ce.value=null}function ae(N,U){if(!ie.value)return;N.preventDefault(),N.dataTransfer&&(N.dataTransfer.dropEffect="move");const H=V(N);fe.value=U.id,ce.value=H}function ke(N){fe.value===N.id&&(fe.value=null,ce.value=null)}function b(N,U){N.preventDefault();const H=ie.value;if(!H)return;const oe=V(N);H.id!==U.id&&i("move",{srcId:H.id,targetId:U.id,position:oe}),me()}function V(N,U){const oe=N.currentTarget.getBoundingClientRect(),Ee=N.clientY-oe.top,et=oe.height;return Ee<et*.3?"before":Ee>et*.7?"after":"child"}const W=e.ref(null);let ee=null;async function ge(N){try{return await navigator.clipboard.writeText(N),!0}catch{const U=document.createElement("textarea");U.value=N,document.body.appendChild(U),U.select();let H=!1;try{H=document.execCommand("copy")}finally{document.body.removeChild(U)}return H}}async function D(N,U,H){N.stopPropagation(),await ge(U)&&(W.value=H,ee&&clearTimeout(ee),ee=setTimeout(()=>W.value=null,1200))}const z=e.computed(()=>{const N=[],U=(H,oe)=>{const Ee=" ".repeat(oe),et=oe===0?"":"- ";N.push(Ee+et+(H.text||""));for(const ut of H.children)U(ut,oe+1)};return U(n.data,0),N.join(`
|
|
16
|
-
`)}),le=e.ref(!1);let be=null;async function I(){await ge(z.value)&&(le.value=!0,be&&clearTimeout(be),be=setTimeout(()=>le.value=!1,1200))}return(N,U)=>(e.openBlock(),e.createElementBlock("div",Cs,[e.createElementVNode("div",Ms,[U[3]||(U[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:c,"onUpdate:modelValue":U[0]||(U[0]=H=>a.value=H),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:C,onKeydown:F},null,544),[[e.vModelText,a.value]]),p.value.length>0?(e.openBlock(),e.createElementBlock("span",As,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(p.value.length),1)):h.value?(e.openBlock(),e.createElementBlock("span",_s,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:A},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",Rs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":le.value}]),title:"复制完整大纲为纯文本",onClick:I},[(e.openBlock(),e.createElementBlock("svg",Bs,[le.value?(e.openBlock(),e.createElementBlock("path",Is)):(e.openBlock(),e.createElementBlock("rect",vs)),U[4]||(U[4]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(le.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,H=>(e.openBlock(),e.createElementBlock("li",{key:H.id,"data-outline-id":H.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":H.id===t.selectedId,"is-root":H.depth===0,"is-editing":y.value===H.id,"is-search-hit":u.value.has(H.id),"is-search-current":p.value[s.value]===H.id,"is-drag-over-before":fe.value===H.id&&ce.value==="before","is-drag-over-after":fe.value===H.id&&ce.value==="after","is-drag-over-child":fe.value===H.id&&ce.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+H.depth*16+"px"}),draggable:"true",onClick:oe=>i("select",H.node),onDblclick:oe=>P(H),onDragstart:oe=>J(oe,H),onDragend:me,onDragover:oe=>ae(oe,H),onDragleave:()=>ke(H),onDrop:oe=>b(oe,H)},[H.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:H.collapsed?"展开":"折叠",onClick:e.withModifiers(oe=>i("toggleCollapse",H.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Ds,[H.collapsed?(e.openBlock(),e.createElementBlock("polyline",$s)):(e.openBlock(),e.createElementBlock("polyline",Vs))]))],8,Ls)):(e.openBlock(),e.createElementBlock("span",Ps)),n.showIndex?(e.openBlock(),e.createElementBlock("span",Fs,e.toDisplayString(H.siblingIndex+1)+".",1)):e.createCommentVNode("",!0),y.value===H.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,"onUpdate:modelValue":U[1]||(U[1]=oe=>k.value=oe),class:"zm-outline-input",onBlur:G,onKeydown:w,onClick:U[2]||(U[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Us,e.toDisplayString(H.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(oe=>i("addSibling",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Ws)],8,Hs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(oe=>i("addChild",H.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ar),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,js)],8,Gs)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":W.value===H.id}]),title:W.value===H.id?"已复制":"复制节点文本",onClick:oe=>D(oe,H.text,H.id)},[(e.openBlock(),e.createElementBlock("svg",Ys,[W.value!==H.id?(e.openBlock(),e.createElementBlock("rect",qs)):(e.openBlock(),e.createElementBlock("path",Xs)),U[5]||(U[5]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Ks)],46,Os))),128))])]))}}),Zs={key:0,class:"zm-jtv-root"},Js={key:0,class:"zm-jtv-key"},Qs={key:1,class:"zm-jtv-colon"},ec={key:2,class:"zm-jtv-key zm-jtv-bracket"},tc={key:3,class:"zm-jtv-size"},nc={key:4,class:"zm-jtv-bracket"},oc={key:5,class:"zm-jtv-brace"},ic={key:0,class:"zm-jtv-children"},rc={class:"zm-jtv-key"},lc={key:0,class:"zm-jtv-key"},ac=["src","alt"],sc=["href"],cc=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),i=e.computed(()=>n.value==="object"),a=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!a.value);const c=e.computed(()=>{if(a.value)return`Array(${o.value.length})`;if(i.value){const y=o.value,k=Object.keys(y);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),s=e.computed(()=>a.value?o.value.map((y,k)=>({key:String(k),value:y})):i.value?Object.entries(o.value).map(([y,k])=>({key:y,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function p(y,k,m){y!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(y)||o.collapsedPaths.add(y))}o.isRoot||p(u.value,o.value,o.depth);function h(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function x(y){return u.value===""?y:`${u.value}.${y}`}function C(y){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof y=="string"?y.toLowerCase().includes(k):y===null?"null".includes(k):String(y).toLowerCase().includes(k)}function $(y){return o.query?y.toLowerCase().includes(o.query.toLowerCase()):!0}function R(y,k){return!o.query||$(y)?!0:k===null||typeof k!="object"?C(k):!0}function F(y){return y===null?"null":typeof y=="string"?y.length>80?`"${y.slice(0,80)}..."`:`"${y}"`:typeof y=="boolean"?y?"true":"false":typeof y=="number"?String(y):typeof y>"u"?"undefined":JSON.stringify(y)}function O(y){if(typeof y!="string")return!1;const k=y.trim();return!!(k.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k)||/^https?:\/\/.+/i.test(k)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k))}function A(y){if(!o.query)return null;const k=y.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:y.slice(0,k),match:y.slice(k,k+o.query.length),after:y.slice(k+o.query.length)}}return(y,k)=>{var P,G,q,w,ie,fe;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ce=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ce.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":ce.key,value:ce.value,path:x(ce.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(ce.key,ce.value)]])),128))])):i.value||a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:h},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Js,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Qs,":")),a.value?(e.openBlock(),e.createElementBlock("span",ec,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",tc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",nc,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",oc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,ce=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:ce.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":ce.key,value:ce.value,path:x(ce.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(ce.key,ce.value)]])),128))])),!d.value&&a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&i.value&&!a.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[k[2]||(k[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",rc,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),$(t.keyName)&&A(t.keyName)?(e.openBlock(),e.createElementBlock("span",lc,[e.createElementVNode("span",null,e.toDisplayString((P=A(t.keyName))==null?void 0:P.before),1),e.createElementVNode("mark",null,e.toDisplayString((G=A(t.keyName))==null?void 0:G.match),1),e.createElementVNode("span",null,e.toDisplayString((q=A(t.keyName))==null?void 0:q.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[A(F(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((w=A(F(t.value)))==null?void 0:w.before),1),e.createElementVNode("mark",null,e.toDisplayString((ie=A(F(t.value)))==null?void 0:ie.match),1),e.createElementVNode("span",null,e.toDisplayString((fe=A(F(t.value)))==null?void 0:fe.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(F(t.value)),1)],64))],2),O(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,ac),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,sc)])):e.createCommentVNode("",!0)],4))}}}),dc={class:"zm-data-panel"},uc={class:"zm-data-header"},fc={class:"zm-data-title"},mc={class:"zm-data-title-meta"},pc={class:"zm-data-toolbar"},hc=["title"],gc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},bc={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"},kc={key:0,class:"zm-data-paste"},yc={class:"zm-data-tabs"},Ec=["placeholder"],xc={key:0,class:"zm-data-error"},wc={class:"zm-data-paste-actions"},Nc=["disabled"],Sc={class:"zm-data-tree"},Lo=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>JSON.stringify(n.data,null,2)),c=e.ref(""),s=e.ref(null),u=e.ref(!1),d=e.ref("json"),p=e.ref("idle"),h=e.ref(new Set),x=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,i("consumed-mode"))},{immediate:!0});async function C(){try{await navigator.clipboard.writeText(a.value),p.value="copied",setTimeout(()=>p.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=a.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),p.value="copied",setTimeout(()=>p.value="idle",1500)}finally{document.body.removeChild(k)}}}function $(){const k=new Blob([a.value],{type:"application/json"}),m=URL.createObjectURL(k),P=document.createElement("a");P.href=m,P.download=`${n.data.text||"mindmap"}.json`,P.click(),URL.revokeObjectURL(m)}function R(){s.value=null;const k=c.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=On(k);i("import",m),c.value="",u.value=!1}catch(m){s.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){s.value="JSON 缺少 id 或 children 字段";return}i("import",m),c.value="",u.value=!1}catch(m){s.value="JSON 解析失败:"+m.message}}}function F(k){return 1+k.children.reduce((m,P)=>m+F(P),0)}const O=e.computed(()=>F(n.data)),A=e.computed(()=>a.value.length);function y(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var G;const m=(G=k.files)==null?void 0:G[0];if(!m)return;const P=new FileReader;P.onload=()=>{typeof P.result=="string"&&(c.value=P.result,R())},P.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",dc,[e.createElementVNode("div",uc,[e.createElementVNode("div",fc,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",mc,e.toDisplayString(O.value)+" 节点 · "+e.toDisplayString(A.value)+" chars",1)])]),e.createElementVNode("div",pc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":p.value==="copied"}]),title:p.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:C},[p.value==="idle"?(e.openBlock(),e.createElementBlock("svg",gc,[...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",bc,[...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,hc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:$},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:y},[...m[13]||(m[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:m[0]||(m[0]=P=>u.value=!u.value)},[...m[14]||(m[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),m[16]||(m[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":x.value.length>0}])},[m[15]||(m[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[1]||(m[1]=P=>x.value=P),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,x.value]]),x.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:m[2]||(m[2]=P=>x.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",kc,[e.createElementVNode("div",yc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=P=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=P=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=P=>c.value=P),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Ec),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",xc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",wc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:R},"应用",8,Nc),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=P=>{c.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=P=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",Sc,[e.createVNode(cc,{value:t.data,query:x.value,"collapsed-paths":h.value},null,8,["value","query","collapsed-paths"])]),m[17]||(m[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),Tc={class:"zm-md-panel"},Cc={key:0,class:"zm-md-error"},Mc={class:"zm-md-split"},Ac={class:"zm-md-edit"},_c={class:"zm-md-preview"},Rc={class:"zm-md-preview-body"},Bc={class:"zm-md-footer"},vc=["disabled"],Ic=`# flow-mindmap 思维导图
|
|
12
|
+
`),lang:m});continue}const $=w.match(a);if($){n.push({kind:"heading",level:$[1].length,text:$[2].trim(),raw:w}),i++;continue}if(/^\s*\|/.test(w)){const k=[];let m=i,P=!1;for(;m<o.length&&/^\s*\|/.test(o[m]);)k.push(o[m]),s.test(o[m])&&(P=!0),m++;if(P&&k.length>=2){n.push({kind:"table",text:((h=k[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:h.trim())||"表格",raw:k.join(`
|
|
13
|
+
`)}),i=m;continue}}const R=w.match(u),U=w.match(d);if(R||U){let k=i;for(;k<o.length;){const m=o[k].match(u),P=o[k].match(d);if(!(m||P))break;const j=o[k].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();j.length>0&&n.push({kind:"list",text:j.slice(0,80)||"(列表项)",raw:o[k]}),k++}i=k;continue}if(w.trim()===""){i++;continue}const I=[w];let _=i+1;for(;_<o.length;){const k=o[_];if(k.trim()===""||a.test(k)||c.test(k)||u.test(k)||d.test(k)||/^\s*\|/.test(k))break;I.push(k),_++}const y=I.join(" ").trim();n.push({kind:"paragraph",text:y.slice(0,80)||"(空段落)",raw:I.join(`
|
|
14
|
+
`)}),i=_}return n}function ts(t,o="导入的导图"){const n=es(t||""),i={id:Xt(),text:o,children:[]},a=[i],c=[0];let s=!1;function u(d){if(d.kind==="heading"){const h=d.level;for(;a.length>1&&c[c.length-1]>=h;)a.pop(),c.pop();if(!s&&h===1){s=!0,i.text=d.text,c[0]=1;return}const w={id:Xt(),text:d.text,children:[]};a[a.length-1].children.push(w),a.push(w),c.push(h);return}const p={id:Xt(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};a[a.length-1].children.push(p)}for(const d of n)u(d);return i}function ns(t){return t.richContent?t.richContent.raw+`
|
|
15
|
+
`:""}function os(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,a=e.ref(1),c=e.ref(0),s=e.ref(0),u=e.ref(!1),d=e.ref(!1),p=e.reactive({x:0,y:0,ox:0,oy:0}),h=e.ref(!1),w=e.reactive({x:0,y:0}),C=e.reactive({x:0,y:0,width:0,height:0}),$=e.ref(0);let R=null;function U(ee){R=ee}function I(ee){ee.preventDefault();const ce=t.getContainer();if(!ce)return;const ue=-ee.deltaY*.001,g=Math.min(n,Math.max(o,a.value*(1+ue))),V=ce.getBoundingClientRect(),G=ee.clientX-V.left,oe=ee.clientY-V.top,fe=(G-c.value)/a.value,O=(oe-s.value)/a.value;a.value=g,c.value=G-fe*g,s.value=oe-O*g}function _(){a.value=Math.min(n,a.value*i)}function y(){a.value=Math.max(o,a.value/i)}function k(ee){var ue;ee.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.value=!1,p.x=ee.clientX,p.y=ee.clientY,p.ox=c.value,p.oy=s.value,window.addEventListener("mousemove",m),window.addEventListener("mouseup",P),(ue=ee.preventDefault)==null||ue.call(ee))}function m(ee){if(!u.value)return;const ce=ee.clientX-p.x,ue=ee.clientY-p.y;(Math.abs(ce)>3||Math.abs(ue)>3)&&(d.value=!0),c.value=p.ox+ce,s.value=p.oy+ue}function P(){u.value=!1,window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",P)}function j(ee,ce,ue){h.value=!0,w.x=ee,w.y=ce,C.x=ee,C.y=ce,C.width=0,C.height=0,C.shiftKey=!!(ue!=null&&ue.shift),$.value++,window.addEventListener("mousemove",re),window.addEventListener("mouseup",E)}function Y(ee,ce){if(!h.value)return;const ue=Math.min(w.x,ee),g=Math.min(w.y,ce),V=Math.max(w.x,ee),G=Math.max(w.y,ce);C.x=ue,C.y=g,C.width=V-ue,C.height=G-g,$.value++}function E(){h.value=!1,window.removeEventListener("mousemove",re),window.removeEventListener("mouseup",E),R&&R()}function re(ee){if(!h.value)return;const ce=t.getContainer();if(!ce)return;const ue=ce.getBoundingClientRect(),g=(ee.clientX-ue.left-c.value)/a.value,V=(ee.clientY-ue.top-s.value)/a.value;Y(g,V)}function pe(ee,ce,ue,g=60){const V=t.getContainer();if(!V)return;const G=V.getBoundingClientRect(),oe=(G.width-g*2)/ee,fe=(G.height-g*2)/ce,O=Math.min(1,Math.max(.3,Math.min(oe,fe)));a.value=O,c.value=G.width/2,s.value=G.height/2-ue*O}function de(){const ee=t.getContainer();if(!ee)return;const ce=ee.getBoundingClientRect(),ue=ce.width/2,g=ce.height/2,V=(ue-c.value)/a.value,G=(g-s.value)/a.value;a.value=1,c.value=ue-V,s.value=g-G}function Ee(ee,ce,ue,g,V=80){const G=t.getContainer();if(!G)return;const oe=G.getBoundingClientRect();let fe=a.value;(ue*fe<40||g*fe<40)&&(fe=Math.min(n,Math.max(1,60/Math.min(ue,g)))),a.value=fe,c.value=oe.width/2-ee*fe,s.value=oe.height/2-ce*fe}return{scale:a,offsetX:c,offsetY:s,isPanning:u,panMoved:d,onWheel:I,zoomIn:_,zoomOut:y,zoomTo100:de,startPan:k,startMarquee:j,updateMarquee:Y,isMarquee:h,marquee:C,marqueeVersion:$,setOnMarqueeEnd:U,resetView:pe,centerOn:Ee}}const is=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function Sr(t){return is?t.metaKey:t.ctrlKey}function rs(t){function o(){const i=t.getSelectedId();if(i)return i;if(t.defaultTargetId)return t.defaultTargetId();const a=t.getSelectedIds();return a.length>0?a[0]:null}function n(i){var u,d,p;const a=i.target;if(a&&(a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.isContentEditable)||t.isReadonly()||t.isEditing())return;const c=t.getSelectedId(),s=o();if(s){if(Sr(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){const h=(u=t.defaultTargetId)==null?void 0:u.call(t);c&&c!==h&&(i.preventDefault(),t.onDuplicate(c));return}if(i.key==="c"||i.key==="C"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCopy(h));return}if(i.key==="x"||i.key==="X"){const h=t.getSelectedIds();h.length>0&&(i.preventDefault(),t.onCut(h));return}if(i.key==="v"||i.key==="V"){if(!t.hasClipboard())return;i.preventDefault();const h=t.getSelectedIds();t.onPaste(h.length>0?h[0]:null);return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(Sr(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}if(i.key==="Tab")i.preventDefault(),t.onAddChild(s);else if(i.key==="Enter")if(i.preventDefault(),i.shiftKey){const h=(d=t.defaultTargetId)==null?void 0:d.call(t);c&&c!==h&&t.onAddSiblingBefore(c)}else t.onAddSibling(s);else if((i.key==="Delete"||i.key==="Backspace")&&c&&c!==((p=t.defaultTargetId)==null?void 0:p.call(t)))i.preventDefault(),t.onRemove(c);else if(i.key==="F2"&&c)i.preventDefault(),t.onStartEdit(c);else if(i.key===" "&&c)i.preventDefault(),t.onStartEdit(c);else if(i.key==="Escape")i.preventDefault(),t.onClearSelection();else if(i.altKey&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey){if(i.key==="ArrowUp"){i.preventDefault(),t.onMoveSibling(-1);return}else if(i.key==="ArrowDown"){i.preventDefault(),t.onMoveSibling(1);return}}else i.key==="ArrowDown"?(i.preventDefault(),t.onNavigate(0,1)):i.key==="ArrowUp"?(i.preventDefault(),t.onNavigate(0,-1)):i.key==="ArrowRight"?(i.preventDefault(),t.onNavigate(1,0)):i.key==="ArrowLeft"&&(i.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function ls(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function a(){return n<o.value.length-1}function c(p){const h=JSON.stringify(p);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(h),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function s(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return a()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:a,record:c,undo:s,redo:u,reset:d}}const as={1:"#ef4444",2:"#f97316",3:"#f59e0b",4:"#eab308",5:"#84cc16",6:"#22c55e",7:"#14b8a6",8:"#3b82f6",9:"#6366f1"},ss={label:"优先级",markers:Array.from({length:9},(t,o)=>{const n=o+1,i=as[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${i}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function cs(t){if(t===0)return'<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>';if(t===100)return'<circle cx="12" cy="12" r="10" fill="#22c55e"/>';const o=t/100*2*Math.PI,n=12+10*Math.sin(o),i=12-10*Math.cos(o);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${t>50?1:0} 1 ${n.toFixed(2)} ${i.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}const ds={label:"进度",markers:[0,25,50,75,100].map(t=>({id:`progress-${t}`,label:`进度 ${t}%`,svg:cs(t)}))},us={label:"旗帜",markers:[{id:"flag-red",label:"红旗",color:"#ef4444"},{id:"flag-orange",label:"橙旗",color:"#f97316"},{id:"flag-yellow",label:"黄旗",color:"#eab308"},{id:"flag-green",label:"绿旗",color:"#22c55e"},{id:"flag-blue",label:"蓝旗",color:"#3b82f6"},{id:"flag-gray",label:"灰旗",color:"#94a3b8"}].map(t=>({id:t.id,label:t.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${t.color}" stroke="${t.color}" stroke-width="1" stroke-linejoin="round"/>`}))},ki=[ss,ds,us,{label:"星标",markers:[{id:"star",label:"星标",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>'},{id:"star-half",label:"半星",svg:'<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>'}]},{label:"其他",markers:[{id:"smile",label:"微笑",svg:'<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>'},{id:"people",label:"人员",svg:'<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>'},{id:"arrow-up",label:"上箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-down",label:"下箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-right",label:"右箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'},{id:"arrow-left",label:"左箭头",svg:'<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>'}]}],Io={};for(const t of ki)for(const o of t.markers)Io[o.id]=o;function fs(t){return Io[t]}function Lo(t){var o;return((o=Io[t])==null?void 0:o.svg)??""}function Tr(t){var o;return((o=Io[t])==null?void 0:o.label)??t}function yi(t){let o=0;for(let i=0;i<t.length;i++)o=(o<<5)-o+t.charCodeAt(i),o|=0;const n=Math.abs(o)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}const ms={key:5,class:"zm-marker-picker"},ps={class:"zm-marker-group-label"},hs={class:"zm-marker-grid"},gs=["title","onClick","innerHTML"],bs=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1},nodeMarkers:{default:()=>[]},nodeTags:{default:()=>[]}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","toggleMarker","clearMarkers","addTag","removeTags","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let y=n.x+2,k=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),P=180,Y=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;y+P>m.right&&(y=Math.max(m.left+4,n.x-P-2)),k+Y>m.bottom&&(k=Math.max(m.top+4,n.y-Y-2)),y<m.left+2&&(y=m.left+2),k<m.top+2&&(k=m.top+2)}return{left:y,top:k}}),c=e.computed(()=>n.hasImage),s=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote),d=e.computed(()=>n.nodeMarkers.length>0),p=e.computed(()=>n.nodeTags.length>0),h=e.ref(!1);function w(){h.value=!h.value}function C(y){return n.nodeMarkers.includes(y)}function $(y){i("toggleMarker",y)}function R(y){const k=y.target;k&&k.closest(".zm-node-menu")||i("close")}function U(y){y.key==="Escape"&&i("close")}function I(){i("close")}window.addEventListener("mousedown",R,!0),window.addEventListener("keydown",U,!0),window.addEventListener("wheel",I,!0),window.addEventListener("scroll",I,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",R,!0),window.removeEventListener("keydown",U,!0),window.removeEventListener("wheel",I,!0),window.removeEventListener("scroll",I,!0)});function _(y){y(),i("close")}return(y,k)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:k[13]||(k[13]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[0]||(k[0]=e.withModifiers(m=>_(()=>i("pickImage")),["stop"]))},[e.createVNode(ve,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"替换图片":"添加图片"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:k[1]||(k[1]=e.withModifiers(m=>_(()=>i("removeImage")),["stop"]))},[e.createVNode(ve,{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=>_(()=>i("setLink")),["stop"]))},[e.createVNode(ve,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:k[3]||(k[3]=e.withModifiers(m=>_(()=>i("removeLink")),["stop"]))},[e.createVNode(ve,{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=>_(()=>i("addCode")),["stop"]))},[k[16]||(k[16]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:k[5]||(k[5]=e.withModifiers(m=>_(()=>i("removeCode")),["stop"]))},[e.createVNode(ve,{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=>_(()=>i("addTable")),["stop"]))},[k[18]||(k[18]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:k[7]||(k[7]=e.withModifiers(m=>_(()=>i("removeTable")),["stop"]))},[e.createVNode(ve,{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=>_(()=>i("editNote")),["stop"]))},[e.createVNode(ve,{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=>_(()=>i("removeNote")),["stop"]))},[e.createVNode(ve,{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":h.value}])},"›",2)]),h.value?(e.openBlock(),e.createElementBlock("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(ki),m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,class:"zm-marker-group"},[e.createElementVNode("div",ps,e.toDisplayString(m.label),1),e.createElementVNode("div",hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.markers,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,class:e.normalizeClass(["zm-marker-cell",{"is-active":C(P.id)}]),title:P.label,onClick:e.withModifiers(j=>$(P.id),["stop"]),innerHTML:'<svg viewBox="0 0 24 24" width="20" height="20">'+e.unref(Lo)(P.id)+"</svg>"},null,10,gs))),128))])]))),128)),d.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-marker-clear",onClick:k[10]||(k[10]=e.withModifiers(m=>i("clearMarkers"),["stop"]))}," 清除所有标记 ")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:k[11]||(k[11]=e.withModifiers(m=>_(()=>i("addTag")),["stop"]))},[k[23]||(k[23]=e.createElementVNode("span",{class:"zm-node-menu-icon","aria-hidden":"true"},"#",-1)),e.createElementVNode("span",null,e.toDisplayString(p.value?"编辑标签":"添加标签"),1)]),p.value?(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-node-menu-item",onClick:k[12]||(k[12]=e.withModifiers(m=>_(()=>i("removeTags")),["stop"]))},[e.createVNode(ve,{name:"x",size:13}),k[24]||(k[24]=e.createElementVNode("span",null,"移除标签",-1))])):e.createCommentVNode("",!0)],36))}}),ks=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","exportPng","exportSvg","close"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>{let _=n.x+2,y=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),m=160,P=4+4*28+5;_+m>k.right&&(_=Math.max(k.left+4,n.x-m-2)),y+P>k.bottom&&(y=Math.max(k.top+4,n.y-P-2)),_<k.left+2&&(_=k.left+2),y<k.top+2&&(y=k.top+2)}return{left:_,top:y}}),c=e.ref(null),s=e.ref(null),u=e.ref(null),d=e.computed(()=>{const _=c.value==="import"?s.value:c.value==="export"?u.value:null;if(!_)return{left:"-9999px",top:"-9999px",display:"none"};const y=_.getBoundingClientRect(),k=window.innerWidth,m=window.innerHeight,P=176,j=4+3*28;let Y=y.right;Y+P>k-4&&(Y=Math.max(4,y.left-P));let E=y.top-4;return E+j>m-4&&(E=Math.max(4,m-j-4)),{left:Y+"px",top:E+"px",display:"block"}});let p=null,h=null;function w(_){h&&(clearTimeout(h),h=null),p=setTimeout(()=>{c.value=_},60)}function C(){p&&(clearTimeout(p),p=null),h=setTimeout(()=>{c.value=null},120)}e.onBeforeUnmount(()=>{p&&clearTimeout(p),h&&clearTimeout(h)});function $(_){const y=_.target;y&&y.closest(".zm-canvas-menu")||i("close")}function R(_){_.key==="Escape"&&i("close")}function U(){i("close")}window.addEventListener("mousedown",$,!0),window.addEventListener("keydown",R,!0),window.addEventListener("wheel",U,!0),window.addEventListener("scroll",U,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",$,!0),window.removeEventListener("keydown",R,!0),window.removeEventListener("wheel",U,!0),window.removeEventListener("scroll",U,!0)});function I(_){_(),i("close")}return(_,y)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:a.value.left+"px",top:a.value.top+"px"}),onContextmenu:y[11]||(y[11]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[0]||(y[0]=e.withModifiers(k=>I(()=>i("openData")),["stop"]))},[e.createVNode(ve,{name:"database",size:13,stroke:1.6}),y[12]||(y[12]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:s,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="import"}]),onMouseenter:y[5]||(y[5]=k=>w("import")),onMouseleave:C},[e.createVNode(ve,{name:"import",size:13,stroke:1.6}),y[16]||(y[16]=e.createElementVNode("span",null,"导入",-1)),y[17]||(y[17]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),c.value==="import"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:y[4]||(y[4]=k=>w("import")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[1]||(y[1]=e.withModifiers(k=>I(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(ve,{name:"markdown",size:13,stroke:1.6}),y[13]||(y[13]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[2]||(y[2]=e.withModifiers(k=>I(()=>i("openImport","json")),["stop"]))},[e.createVNode(ve,{name:"json",size:13,stroke:1.6}),y[14]||(y[14]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[3]||(y[3]=e.withModifiers(k=>I(()=>i("openImport","txt")),["stop"]))},[e.createVNode(ve,{name:"txt",size:13,stroke:1.6}),y[15]||(y[15]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[6]||(y[6]=e.withModifiers(k=>I(()=>i("openSettings")),["stop"]))},[e.createVNode(ve,{name:"settings",size:13,stroke:1.6}),y[18]||(y[18]=e.createElementVNode("span",null,"设置",-1))]),y[23]||(y[23]=e.createElementVNode("div",{class:"zm-canvas-menu-divider"},null,-1)),e.createElementVNode("div",{ref_key:"exportItemRef",ref:u,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":c.value==="export"}]),onMouseenter:y[10]||(y[10]=k=>w("export")),onMouseleave:C},[e.createVNode(ve,{name:"export",size:13,stroke:1.6}),y[21]||(y[21]=e.createElementVNode("span",null,"导出",-1)),y[22]||(y[22]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),c.value==="export"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(d.value),onMouseenter:y[9]||(y[9]=k=>w("export")),onMouseleave:C},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[7]||(y[7]=e.withModifiers(k=>I(()=>i("exportPng")),["stop"]))},[e.createVNode(ve,{name:"image",size:13,stroke:1.6}),y[19]||(y[19]=e.createElementVNode("span",null,"导出 PNG",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:y[8]||(y[8]=e.withModifiers(k=>I(()=>i("exportSvg")),["stop"]))},[e.createVNode(ve,{name:"svg-export",size:13,stroke:1.6}),y[20]||(y[20]=e.createElementVNode("span",null,"导出 SVG",-1))])],36)):e.createCommentVNode("",!0)],34)],36))}}),ys=["aria-hidden"],xs=["aria-hidden"],Es={key:0,class:"zm-drawer-header"},ws={key:0,class:"zm-drawer-title"},Ns={class:"zm-drawer-body"},Ss=["aria-hidden"],Ts={key:0,class:"zm-drawer-header"},Cs={key:0,class:"zm-drawer-title"},Ms={class:"zm-drawer-body"},Vt=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function i(){n("update:open",!1)}function a(){n("update:open",!1)}return(c,s)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:s[0]||(s[0]=u=>t.closeOnBackdrop&&a())},null,8,ys)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",Es,[t.title?(e.openBlock(),e.createElementBlock("h3",ws,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[1]||(s[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ns,[e.renderSlot(c.$slots,"default")])],14,xs)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||c.$slots.header?(e.openBlock(),e.createElementBlock("div",Ts,[t.title?(e.openBlock(),e.createElementBlock("h3",Cs,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...s[2]||(s[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ms,[e.renderSlot(c.$slots,"default")])],14,Ss)):e.createCommentVNode("",!0)]),_:3}))}}),As={class:"zm-outline-root"},_s={class:"zm-outline-search"},Rs={key:0,class:"zm-outline-search-count"},Bs={key:1,class:"zm-outline-search-count zm-outline-search-empty"},vs={class:"zm-outline-actions"},zs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Is={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ls={key:1,d:"M5 12 L10 17 L19 7"},Os={class:"zm-outline"},Ds=["data-outline-id","onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],Vs=["title","onClick"],$s={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ps={key:0,points:"6 9 12 15 18 9"},Fs={key:1,points:"9 6 15 12 9 18"},Us={key:1,class:"zm-outline-dot"},Hs={key:2,class:"zm-outline-index"},Ws={key:4,class:"zm-outline-text"},Gs=["onClick"],js=["onClick"],Ks=["src"],Ys=["onClick"],qs=["src"],Xs=["title","onClick"],Zs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Js={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Qs={key:1,d:"M5 12 L10 17 L19 7"},Oo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1},showIndex:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null),s=e.ref(-1),u=e.computed(()=>{const S=a.value.trim().toLowerCase();if(!S)return new Set;const F=new Set,W=te=>{var ye;(te.text.toLowerCase().includes(S)||(ye=te.note)!=null&&ye.text&&te.note.text.toLowerCase().includes(S))&&F.add(te.id);for(const nt of te.children)W(nt)};return W(n.data),F}),d=e.computed(()=>{if(u.value.size===0)return new Set;const S=new Set,F=W=>{let te=u.value.has(W.id);for(const ye of W.children)F(ye)&&(te=!0);return te&&S.add(W.id),te};return F(n.data),S}),p=e.computed(()=>{const S=[],F=W=>{u.value.has(W.id)&&S.push(W.id);for(const te of W.children)F(te)};return F(n.data),S}),h=e.computed(()=>a.value.trim().length>0),w=e.computed(()=>{const S=[],F=d.value,W=(te,ye,nt)=>{if(h.value&&!F.has(te.id))return;const ft=te.children.length>0,ot=h.value?!1:n.collapsedIds.has(te.id);S.push({id:te.id,text:te.text||"(无标题)",depth:ye,siblingIndex:nt,hasChildren:ft,collapsed:ot,node:te}),ft&&!ot&&te.children.forEach((ln,it)=>W(ln,ye+1,it))};return W(n.data,0,0),S});function C(){s.value=p.value.length>0?0:-1}function $(){const S=p.value;S.length!==0&&(s.value=(s.value+1)%S.length,I(s.value))}function R(){const S=p.value;S.length!==0&&(s.value=(s.value-1+S.length)%S.length,I(s.value))}function U(S){S.key==="Enter"?(S.preventDefault(),S.shiftKey?R():$()):S.key==="Escape"&&(S.preventDefault(),a.value="",s.value=-1)}function I(S){const F=p.value[S];if(!F)return;const W=w.value.find(te=>te.id===F);W&&i("select",W.node),e.nextTick(()=>{const te=document.querySelector(`[data-outline-id="${F}"]`);te==null||te.scrollIntoView({block:"nearest",behavior:"smooth"})})}function _(){a.value="",s.value=-1}e.onMounted(()=>{e.nextTick(()=>{var S;return(S=c.value)==null?void 0:S.focus()})});const y=e.ref(null),k=e.ref("");let m=null;function P(S){n.readonly||(y.value=S.id,k.value=S.text,e.nextTick(()=>{m=document.querySelector(".zm-outline-input"),m==null||m.focus(),m==null||m.select()}))}function j(){y.value!=null&&(i("edit",{id:y.value,text:k.value.trim()||"(无标题)"}),Y())}function Y(){y.value=null,k.value="",m=null}function E(S){S.key==="Enter"?(S.preventDefault(),j()):S.key==="Escape"&&(S.preventDefault(),Y())}e.onBeforeUnmount(Y);const re=e.ref(null),pe=e.ref(null),de=e.ref(null);function Ee(S,F){if(n.readonly){S.preventDefault();return}re.value={id:F.id,text:F.text},S.dataTransfer&&(S.dataTransfer.effectAllowed="move",S.dataTransfer.setData("text/plain",F.id))}function ee(){re.value=null,pe.value=null,de.value=null}function ce(S,F){if(!re.value)return;S.preventDefault(),S.dataTransfer&&(S.dataTransfer.dropEffect="move");const W=V(S);pe.value=F.id,de.value=W}function ue(S){pe.value===S.id&&(pe.value=null,de.value=null)}function g(S,F){S.preventDefault();const W=re.value;if(!W)return;const te=V(S);W.id!==F.id&&i("move",{srcId:W.id,targetId:F.id,position:te}),ee()}function V(S,F){const te=S.currentTarget.getBoundingClientRect(),ye=S.clientY-te.top,nt=te.height;return ye<nt*.3?"before":ye>nt*.7?"after":"child"}const G=e.ref(null);let oe=null;async function fe(S){try{return await navigator.clipboard.writeText(S),!0}catch{const F=document.createElement("textarea");F.value=S,document.body.appendChild(F),F.select();let W=!1;try{W=document.execCommand("copy")}finally{document.body.removeChild(F)}return W}}async function O(S,F,W){S.stopPropagation(),await fe(F)&&(G.value=W,oe&&clearTimeout(oe),oe=setTimeout(()=>G.value=null,1200))}const L=e.computed(()=>{const S=[],F=(W,te)=>{const ye=" ".repeat(te),nt=te===0?"":"- ";S.push(ye+nt+(W.text||""));for(const ft of W.children)F(ft,te+1)};return F(n.data,0),S.join(`
|
|
16
|
+
`)}),se=e.ref(!1);let ke=null;async function z(){await fe(L.value)&&(se.value=!0,ke&&clearTimeout(ke),ke=setTimeout(()=>se.value=!1,1200))}return(S,F)=>(e.openBlock(),e.createElementBlock("div",As,[e.createElementVNode("div",_s,[F[3]||(F[3]=e.createElementVNode("svg",{class:"zm-outline-search-icon",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:c,"onUpdate:modelValue":F[0]||(F[0]=W=>a.value=W),type:"text",class:"zm-outline-search-input",placeholder:"搜索节点… (Enter 下一个, Shift+Enter 上一个)",onInput:C,onKeydown:U},null,544),[[e.vModelText,a.value]]),p.value.length>0?(e.openBlock(),e.createElementBlock("span",Rs,e.toDisplayString(s.value+1)+"/"+e.toDisplayString(p.value.length),1)):h.value?(e.openBlock(),e.createElementBlock("span",Bs,"无结果")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-outline-search-clear",title:"清除搜索",onClick:_},"×")):e.createCommentVNode("",!0)]),e.createElementVNode("div",vs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":se.value}]),title:"复制完整大纲为纯文本",onClick:z},[(e.openBlock(),e.createElementBlock("svg",zs,[se.value?(e.openBlock(),e.createElementBlock("path",Ls)):(e.openBlock(),e.createElementBlock("rect",Is)),F[4]||(F[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(se.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,W=>(e.openBlock(),e.createElementBlock("li",{key:W.id,"data-outline-id":W.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":W.id===t.selectedId,"is-root":W.depth===0,"is-editing":y.value===W.id,"is-search-hit":u.value.has(W.id),"is-search-current":p.value[s.value]===W.id,"is-drag-over-before":pe.value===W.id&&de.value==="before","is-drag-over-after":pe.value===W.id&&de.value==="after","is-drag-over-child":pe.value===W.id&&de.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+W.depth*16+"px"}),draggable:"true",onClick:te=>i("select",W.node),onDblclick:te=>P(W),onDragstart:te=>Ee(te,W),onDragend:ee,onDragover:te=>ce(te,W),onDragleave:()=>ue(W),onDrop:te=>g(te,W)},[W.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:W.collapsed?"展开":"折叠",onClick:e.withModifiers(te=>i("toggleCollapse",W.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",$s,[W.collapsed?(e.openBlock(),e.createElementBlock("polyline",Fs)):(e.openBlock(),e.createElementBlock("polyline",Ps))]))],8,Vs)):(e.openBlock(),e.createElementBlock("span",Us)),n.showIndex?(e.openBlock(),e.createElementBlock("span",Hs,e.toDisplayString(W.siblingIndex+1)+".",1)):e.createCommentVNode("",!0),y.value===W.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,"onUpdate:modelValue":F[1]||(F[1]=te=>k.value=te),class:"zm-outline-input",onBlur:j,onKeydown:E,onClick:F[2]||(F[2]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock("span",Ws,e.toDisplayString(W.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"编辑文字",onClick:e.withModifiers(te=>P(W),["stop"])},[...F[5]||(F[5]=[e.createElementVNode("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"}),e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"})],-1)])],8,Gs)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:6,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(te=>i("addSibling",W.id),["stop"])},[e.createElementVNode("img",{src:e.unref(sr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Ks)],8,js)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:7,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(te=>i("addChild",W.id),["stop"])},[e.createElementVNode("img",{src:e.unref(cr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,qs)],8,Ys)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":G.value===W.id}]),title:G.value===W.id?"已复制":"复制节点文本",onClick:te=>O(te,W.text,W.id)},[(e.openBlock(),e.createElementBlock("svg",Zs,[G.value!==W.id?(e.openBlock(),e.createElementBlock("rect",Js)):(e.openBlock(),e.createElementBlock("path",Qs)),F[6]||(F[6]=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,Xs)],46,Ds))),128))])]))}}),ec={key:0,class:"zm-jtv-root"},tc={key:0,class:"zm-jtv-key"},nc={key:1,class:"zm-jtv-colon"},oc={key:2,class:"zm-jtv-key zm-jtv-bracket"},ic={key:3,class:"zm-jtv-size"},rc={key:4,class:"zm-jtv-bracket"},lc={key:5,class:"zm-jtv-brace"},ac={key:0,class:"zm-jtv-children"},sc={class:"zm-jtv-key"},cc={key:0,class:"zm-jtv-key"},dc=["src","alt"],uc=["href"],fc=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),i=e.computed(()=>n.value==="object"),a=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!a.value);const c=e.computed(()=>{if(a.value)return`Array(${o.value.length})`;if(i.value){const y=o.value,k=Object.keys(y);return`Object(${k.length} ${k.length===1?"key":"keys"})`}return""}),s=e.computed(()=>a.value?o.value.map((y,k)=>({key:String(k),value:y})):i.value?Object.entries(o.value).map(([y,k])=>({key:y,value:k})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function p(y,k,m){y!=="<root>"&&(m<2||k===null||typeof k!="object"||o.collapsedPaths.has(y)||o.collapsedPaths.add(y))}o.isRoot||p(u.value,o.value,o.depth);function h(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function w(y){return u.value===""?y:`${u.value}.${y}`}function C(y){if(!o.query)return!0;const k=o.query.toLowerCase();return typeof y=="string"?y.toLowerCase().includes(k):y===null?"null".includes(k):String(y).toLowerCase().includes(k)}function $(y){return o.query?y.toLowerCase().includes(o.query.toLowerCase()):!0}function R(y,k){return!o.query||$(y)?!0:k===null||typeof k!="object"?C(k):!0}function U(y){return y===null?"null":typeof y=="string"?y.length>80?`"${y.slice(0,80)}..."`:`"${y}"`:typeof y=="boolean"?y?"true":"false":typeof y=="number"?String(y):typeof y>"u"?"undefined":JSON.stringify(y)}function I(y){if(typeof y!="string")return!1;const k=y.trim();return!!(k.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k)||/^https?:\/\/.+/i.test(k)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(k))}function _(y){if(!o.query)return null;const k=y.toLowerCase().indexOf(o.query.toLowerCase());return k<0?null:{before:y.slice(0,k),match:y.slice(k,k+o.query.length),after:y.slice(k+o.query.length)}}return(y,k)=>{var P,j,Y,E,re,pe;const m=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",ec,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,de=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:de.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":de.key,value:de.value,path:w(de.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(de.key,de.value)]])),128))])):i.value||a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:h},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",tc,e.toDisplayString(t.keyName),1)),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",nc,":")),a.value?(e.openBlock(),e.createElementBlock("span",oc,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",ic,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),d.value&&a.value?(e.openBlock(),e.createElementBlock("span",rc,"]")):e.createCommentVNode("",!0),d.value&&i.value?(e.openBlock(),e.createElementBlock("span",lc,"}")):e.createCommentVNode("",!0)],4),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,de=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:de.key,class:"zm-jtv-row"},[e.createVNode(m,{"key-name":de.key,value:de.value,path:w(de.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,R(de.key,de.value)]])),128))])),!d.value&&a.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&i.value&&!a.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[k[2]||(k[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",sc,e.toDisplayString(t.keyName),1),k[3]||(k[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),$(t.keyName)&&_(t.keyName)?(e.openBlock(),e.createElementBlock("span",cc,[e.createElementVNode("span",null,e.toDisplayString((P=_(t.keyName))==null?void 0:P.before),1),e.createElementVNode("mark",null,e.toDisplayString((j=_(t.keyName))==null?void 0:j.match),1),e.createElementVNode("span",null,e.toDisplayString((Y=_(t.keyName))==null?void 0:Y.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[_(U(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((E=_(U(t.value)))==null?void 0:E.before),1),e.createElementVNode("mark",null,e.toDisplayString((re=_(U(t.value)))==null?void 0:re.match),1),e.createElementVNode("span",null,e.toDisplayString((pe=_(U(t.value)))==null?void 0:pe.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(U(t.value)),1)],64))],2),I(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,dc),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,uc)])):e.createCommentVNode("",!0)],4))}}}),mc={class:"zm-data-panel"},pc={class:"zm-data-header"},hc={class:"zm-data-title"},gc={class:"zm-data-title-meta"},bc={class:"zm-data-toolbar"},kc=["title"],yc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},xc={key:1,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round","stroke-linejoin":"round"},Ec={key:0,class:"zm-data-paste"},wc={class:"zm-data-tabs"},Nc=["placeholder"],Sc={key:0,class:"zm-data-error"},Tc={class:"zm-data-paste-actions"},Cc=["disabled"],Mc={class:"zm-data-tree"},Do=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,a=e.computed(()=>JSON.stringify(n.data,null,2)),c=e.ref(""),s=e.ref(null),u=e.ref(!1),d=e.ref("json"),p=e.ref("idle"),h=e.ref(new Set),w=e.ref("");e.watch(()=>n.pendingMode,k=>{k&&(u.value=!0,d.value=k,i("consumed-mode"))},{immediate:!0});async function C(){try{await navigator.clipboard.writeText(a.value),p.value="copied",setTimeout(()=>p.value="idle",1500)}catch{const k=document.createElement("textarea");k.value=a.value,document.body.appendChild(k),k.select();try{document.execCommand("copy"),p.value="copied",setTimeout(()=>p.value="idle",1500)}finally{document.body.removeChild(k)}}}function $(){const k=new Blob([a.value],{type:"application/json"}),m=URL.createObjectURL(k),P=document.createElement("a");P.href=m,P.download=`${n.data.text||"mindmap"}.json`,P.click(),URL.revokeObjectURL(m)}function R(){s.value=null;const k=c.value.trim();if(k){if(d.value==="markdown"||d.value==="txt"){try{const m=On(k);i("import",m),c.value="",u.value=!1}catch(m){s.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+m.message}return}try{const m=JSON.parse(k);if(!m.id||!Array.isArray(m.children)){s.value="JSON 缺少 id 或 children 字段";return}i("import",m),c.value="",u.value=!1}catch(m){s.value="JSON 解析失败:"+m.message}}}function U(k){return 1+k.children.reduce((m,P)=>m+U(P),0)}const I=e.computed(()=>U(n.data)),_=e.computed(()=>a.value.length);function y(){const k=document.createElement("input");k.type="file",k.accept="application/json",k.onchange=()=>{var j;const m=(j=k.files)==null?void 0:j[0];if(!m)return;const P=new FileReader;P.onload=()=>{typeof P.result=="string"&&(c.value=P.result,R())},P.readAsText(m)},k.click()}return(k,m)=>(e.openBlock(),e.createElementBlock("div",mc,[e.createElementVNode("div",pc,[e.createElementVNode("div",hc,[m[8]||(m[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",gc,e.toDisplayString(I.value)+" 节点 · "+e.toDisplayString(_.value)+" chars",1)])]),e.createElementVNode("div",bc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":p.value==="copied"}]),title:p.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:C},[p.value==="idle"?(e.openBlock(),e.createElementBlock("svg",yc,[...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",xc,[...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,kc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:$},[...m[12]||(m[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:y},[...m[13]||(m[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:m[0]||(m[0]=P=>u.value=!u.value)},[...m[14]||(m[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),m[16]||(m[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":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]=P=>w.value=P),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]=P=>w.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",Ec,[e.createElementVNode("div",wc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="json"}]),onClick:m[3]||(m[3]=P=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:m[4]||(m[4]=P=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":m[5]||(m[5]=P=>c.value=P),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Nc),[[e.vModelText,c.value]]),s.value?(e.openBlock(),e.createElementBlock("div",Sc,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Tc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!c.value,onClick:R},"应用",8,Cc),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[6]||(m[6]=P=>{c.value="",s.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:m[7]||(m[7]=P=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",Mc,[e.createVNode(fc,{value:t.data,query:w.value,"collapsed-paths":h.value},null,8,["value","query","collapsed-paths"])]),m[17]||(m[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),Ac={class:"zm-md-panel"},_c={key:0,class:"zm-md-error"},Rc={class:"zm-md-split"},Bc={class:"zm-md-edit"},vc={class:"zm-md-preview"},zc={class:"zm-md-preview-body"},Ic={class:"zm-md-footer"},Lc=["disabled"],Oc=`# flow-mindmap 思维导图
|
|
17
17
|
|
|
18
18
|
[GitHub 仓库](https://github.com/xz333221/flow-mindmap)
|
|
19
19
|
|
|
@@ -52,62 +52,62 @@
|
|
|
52
52
|
|
|
53
53
|
## 开源协议
|
|
54
54
|
[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
|
55
|
-
`,
|
|
56
|
-
`)),
|
|
57
|
-
`);return}const
|
|
58
|
-
`)}function F(q){const w=n.settings.customPalettes.filter(fe=>fe.id!==q.id),ie=n.settings.branchPaletteId===q.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:w,...ie!==n.settings.branchPaletteId?{branchPaletteId:ie}:{}}),delete x[q.id]}const O=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],A=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],y=[0,1,2,3],k=["#f87171","#fb923c","#34d399","#818cf8"];function m(q,w,ie,fe){if(w<=1)return ie;const ce=q/(w-1);return ie+(fe-ie)*ce}function P(q,w,ie,fe){const ce=w*Math.pow(fe,q);return Math.max(ie,ce)}const G=e.computed(()=>{const q=n.settings.lineWidthStart,w=n.settings.lineWidthEnd,ie=n.settings.taperedEdge,fe=y.length,ce=8,J=192,me=h.value.find(ke=>ke.id===n.settings.branchPaletteId),ae=me&&me.colors.length?me.colors:k;return y.map((ke,b)=>{const V=10+b*60/(fe-1);return{x1:ce,y1:V,x2:J,y2:V,w:ie?P(ke,q,w,n.settings.lineWidthTaper):m(ke,fe,q,w),color:n.settings.rainbowBranch?ae[b%ae.length]:"#94a3b8"}})});return(q,w)=>{var ie,fe,ce,J,me,ae,ke;return e.openBlock(),e.createElementBlock("div",zc,[e.createElementVNode("section",Oc,[w[45]||(w[45]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Lc,[w[24]||(w[24]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Dc,[e.createElementVNode("label",Vc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:w[0]||(w[0]=b=>a("canvasBg",b.target.value))},null,40,$c),e.createElementVNode("span",Pc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",Fc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(A,b=>e.createElementVNode("button",{key:"cbg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:V=>a("canvasBg",b)},null,14,Uc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:w[1]||(w[1]=b=>a("canvasBg",void 0))},"∅")]),w[46]||(w[46]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Hc,[w[25]||(w[25]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端 (根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:w[2]||(w[2]=b=>a("lineWidthStart",parseFloat(b.target.value)||0))},null,40,Wc)]),e.createElementVNode("div",Gc,[w[26]||(w[26]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:w[3]||(w[3]=b=>a("lineWidthStart",parseFloat(b.target.value)))},null,40,jc)]),e.createElementVNode("div",Kc,[w[27]||(w[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端 (子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:w[4]||(w[4]=b=>a("lineWidthEnd",parseFloat(b.target.value)||0))},null,40,Yc)]),e.createElementVNode("div",qc,[w[28]||(w[28]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:w[5]||(w[5]=b=>a("lineWidthEnd",parseFloat(b.target.value)))},null,40,Xc)]),w[47]||(w[47]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Zc,[w[29]||(w[29]=e.createElementVNode("span",{class:"zm-settings-label"},"根节点线条",-1)),e.createElementVNode("div",Jc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),b=>(e.openBlock(),e.createElementBlock("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.rootLineStyle===b.value}]),title:b.label,onClick:V=>a("rootLineStyle",b.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:b.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[b.value==="arc"?(e.openBlock(),e.createElementBlock("path",td)):b.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",nd)):b.value==="elbow"?(e.openBlock(),e.createElementBlock("path",od)):b.value==="curve"?(e.openBlock(),e.createElementBlock("path",id)):(e.openBlock(),e.createElementBlock("line",rd))],8,ed)),e.createElementVNode("span",ld,e.toDisplayString(b.label),1)],10,Qc))),128))])]),e.createElementVNode("div",ad,[w[30]||(w[30]=e.createElementVNode("span",{class:"zm-settings-label"},"其他节点线条",-1)),e.createElementVNode("div",sd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,b=>e.createElementVNode("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===b.value}]),title:b.label,onClick:V=>a("lineStyle",b.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:b.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[b.value==="arc"?(e.openBlock(),e.createElementBlock("path",ud)):b.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",fd)):b.value==="elbow"?(e.openBlock(),e.createElementBlock("path",md)):b.value==="curve"?(e.openBlock(),e.createElementBlock("path",pd)):(e.openBlock(),e.createElementBlock("line",hd))],8,dd)),e.createElementVNode("span",gd,e.toDisplayString(b.label),1)],10,cd)),64))])]),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",bd,[e.createElementVNode("span",kd,[w[31]||(w[31]=e.createTextVNode("圆角大小 ",-1)),e.createElementVNode("span",yd,e.toDisplayString(t.settings.elbowRadius)+"px",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"2",max:"20",value:t.settings.elbowRadius,onChange:w[6]||(w[6]=b=>a("elbowRadius",parseFloat(b.target.value)||8))},null,40,Ed)])):e.createCommentVNode("",!0),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",xd,[w[32]||(w[32]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"2",max:"20",step:"1",value:t.settings.elbowRadius,onInput:w[7]||(w[7]=b=>a("elbowRadius",parseFloat(b.target.value)))},null,40,wd)])):e.createCommentVNode("",!0),e.createElementVNode("div",Nd,[w[34]||(w[34]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",Sd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,b=>e.createElementVNode("button",{key:b.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===b.value}]),title:b.label,onClick:V=>a("lineOrigin",b.value)},[(e.openBlock(),e.createElementBlock("svg",Cd,[w[33]||(w[33]=e.createElementVNode("rect",{x:"8",y:"6",width:"12",height:"6",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.2",opacity:"0.5"},null,-1)),b.value==="edge"?(e.openBlock(),e.createElementBlock("path",Md)):b.value==="center"?(e.openBlock(),e.createElementBlock("path",Ad)):(e.openBlock(),e.createElementBlock("path",_d))])),e.createElementVNode("span",Rd,e.toDisplayString(b.label),1)],10,Td)),64))])]),e.createElementVNode("div",Bd,[w[36]||(w[36]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:w[8]||(w[8]=b=>a("rainbowBranch",!t.settings.rainbowBranch))},[...w[35]||(w[35]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",vd,[w[37]||(w[37]=e.createElementVNode("div",{class:"zm-settings-field"},[e.createElementVNode("span",{class:"zm-settings-label"},"配色方案")],-1)),e.createElementVNode("div",Id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,b=>(e.openBlock(),e.createElementBlock("button",{key:b.id,class:e.normalizeClass(["zm-palette-option",{"is-active":t.settings.branchPaletteId===b.id}]),onClick:V=>a("branchPaletteId",b.id)},[e.createElementVNode("span",Od,e.toDisplayString(b.name),1),e.createElementVNode("span",Ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.colors,(V,W)=>(e.openBlock(),e.createElementBlock("span",{key:W,class:"zm-palette-option-swatch",style:e.normalizeStyle({background:V})},null,4))),128))])],10,zd))),128))]),t.settings.customPalettes.find(b=>b.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Dd,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:C(t.settings.customPalettes.find(b=>b.id===t.settings.branchPaletteId)),onInput:w[9]||(w[9]=b=>x[t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId).id]=b.target.value)},null,40,Vd),e.createElementVNode("div",$d,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:w[10]||(w[10]=b=>$(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:w[11]||(w[11]=b=>F(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:R},"+ 新建配色")])):e.createCommentVNode("",!0),w[48]||(w[48]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Pd,[w[39]||(w[39]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:w[12]||(w[12]=b=>a("taperedEdge",!t.settings.taperedEdge))},[...w[38]||(w[38]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Fd,[e.createElementVNode("span",Ud,[w[40]||(w[40]=e.createTextVNode("层级衰减 ",-1)),e.createElementVNode("span",Hd,e.toDisplayString(Math.round(t.settings.lineWidthTaper*100))+"%",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.05",min:"0.3",max:"1",value:t.settings.lineWidthTaper,onChange:w[13]||(w[13]=b=>a("lineWidthTaper",parseFloat(b.target.value)||.67))},null,40,Wd)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Gd,[w[41]||(w[41]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.3",max:"1",step:"0.01",value:t.settings.lineWidthTaper,onInput:w[14]||(w[14]=b=>a("lineWidthTaper",parseFloat(b.target.value)))},null,40,jd)])):e.createCommentVNode("",!0),e.createElementVNode("div",Kd,[w[43]||(w[43]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:w[15]||(w[15]=b=>a("showOrderBadge",!t.settings.showOrderBadge))},[...w[42]||(w[42]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Yd,[(e.openBlock(),e.createElementBlock("svg",qd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(b,V)=>(e.openBlock(),e.createElementBlock("line",{key:V,x1:b.x1,y1:b.y1,x2:b.x2,y2:b.y2,stroke:t.settings.rainbowBranch?b.color:"#94a3b8","stroke-width":b.w,"stroke-linecap":"butt"},null,8,Xd))),128))])),w[44]||(w[44]=e.createElementVNode("div",{class:"zm-settings-preview-labels"},[e.createElementVNode("span",null,"根"),e.createElementVNode("span",null,"1级"),e.createElementVNode("span",null,"2级"),e.createElementVNode("span",null,"3级")],-1))])]),t.hasSelection?(e.openBlock(),e.createElementBlock("section",Zd,[e.createElementVNode("h4",Jd,[w[49]||(w[49]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Qd,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",eu,[w[50]||(w[50]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",tu,e.toDisplayString(((ie=t.nodeStyle)==null?void 0:ie.bg)||"默认"),1)]),e.createElementVNode("div",nu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(O,b=>{var V;return e.createElementVNode("button",{key:"bg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.bg)===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:W=>p({bg:b})},null,14,ou)}),64)),e.createElementVNode("label",iu,[e.createElementVNode("input",{type:"color",value:((fe=t.nodeStyle)==null?void 0:fe.bg)||"#ffffff",onInput:w[16]||(w[16]=b=>p({bg:b.target.value}))},null,40,ru)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:w[17]||(w[17]=b=>p({bg:void 0}))},"∅")]),e.createElementVNode("div",lu,[w[51]||(w[51]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",au,e.toDisplayString(((ce=t.nodeStyle)==null?void 0:ce.textColor)||"默认"),1)]),e.createElementVNode("div",su,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(O,b=>{var V;return e.createElementVNode("button",{key:"fg-"+b,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.textColor)===b}]),style:e.normalizeStyle({background:b}),title:b,onClick:W=>p({textColor:b})},null,14,cu)}),64)),e.createElementVNode("label",du,[e.createElementVNode("input",{type:"color",value:((J=t.nodeStyle)==null?void 0:J.textColor)||"#1e2937",onInput:w[18]||(w[18]=b=>p({textColor:b.target.value}))},null,40,uu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:w[19]||(w[19]=b=>p({textColor:void 0}))},"∅")]),w[55]||(w[55]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",fu,[w[52]||(w[52]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((me=t.nodeStyle)==null?void 0:me.fontWeight)??400,onChange:w[20]||(w[20]=b=>p({fontWeight:parseInt(b.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,b=>e.createElementVNode("option",{key:b.value,value:b.value},e.toDisplayString(b.label),9,pu)),64))],40,mu)]),e.createElementVNode("div",hu,[w[53]||(w[53]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((ae=t.nodeStyle)==null?void 0:ae.fontSize)??14,onChange:w[21]||(w[21]=b=>p({fontSize:parseInt(b.target.value)||14}))},null,40,gu)]),e.createElementVNode("div",bu,[w[54]||(w[54]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ke=t.nodeStyle)==null?void 0:ke.fontSize)??14,onInput:w[22]||(w[22]=b=>p({fontSize:parseInt(b.target.value)}))},null,40,ku)]),w[56]||(w[56]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",yu,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:w[23]||(w[23]=b=>i("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-f1937c03"]]),Sr=20;function Eu(t,o){t.style.height="auto";const n=o.minRows*Sr,i=o.maxRows>0?o.maxRows*Sr:1/0,a=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=a+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function ki(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const c=t.value;c&&Eu(c,n)}function a(){i()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",a),i())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>i()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",a)})}function xu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Tr(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)&&Tr(n)}),t}class Cr{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Mr(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function un(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const a in i)n[a]=i[a]}),n}const wu="</span>",Ar=t=>!!t.scope,Nu=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((i,a)=>`${i}${"_".repeat(a+1)}`)].join(" ")}return`${o}${t}`};class Su{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Mr(o)}openNode(o){if(!Ar(o))return;const n=Nu(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Ar(o)&&(this.buffer+=wu)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const _r=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class yi{constructor(){this.rootNode=_r(),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=_r({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=>{yi._collapse(n)}))}}class Tu extends yi{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 Su(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function ro(t){return t?typeof t=="string"?t:t.source:null}function Rr(t){return En("(?=",t,")")}function Cu(t){return En("(?:",t,")*")}function Mu(t){return En("(?:",t,")?")}function En(...t){return t.map(n=>ro(n)).join("")}function Au(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function Ei(...t){return"("+(Au(t).capture?"":"?:")+t.map(i=>ro(i)).join("|")+")"}function Br(t){return new RegExp(t.toString()+"|").exec("").length-1}function _u(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Ru=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function xi(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const a=n;let c=ro(i),s="";for(;c.length>0;){const u=Ru.exec(c);if(!u){s+=c;break}s+=c.substring(0,u.index),c=c.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?s+="\\"+String(Number(u[1])+a):(s+=u[0],u[0]==="("&&n++)}return s}).map(i=>`(${i})`).join(o)}const Bu=/\b\B/,vr="[a-zA-Z]\\w*",wi="[a-zA-Z_]\\w*",Ir="\\b\\d+(\\.\\d+)?",zr="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Or="\\b(0b[01]+)",vu="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Iu=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=En(o,/.*\b/,t.binary,/\b.*/)),un({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},lo={begin:"\\\\[\\s\\S]",relevance:0},zu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[lo]},Ou={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[lo]},Lu={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},$o=function(t,o,n={}){const i=un({scope:"comment",begin:t,end:o,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=Ei("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:En(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},Du=$o("//","$"),Vu=$o("/\\*","\\*/"),$u=$o("#","$"),Pu={scope:"number",begin:Ir,relevance:0},Fu={scope:"number",begin:zr,relevance:0},Uu={scope:"number",begin:Or,relevance:0},Hu={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[lo,{begin:/\[/,end:/\]/,relevance:0,contains:[lo]}]},Wu={scope:"title",begin:vr,relevance:0},Gu={scope:"title",begin:wi,relevance:0},ju={begin:"\\.\\s*"+wi,relevance:0};var Po=Object.freeze({__proto__:null,APOS_STRING_MODE:zu,BACKSLASH_ESCAPE:lo,BINARY_NUMBER_MODE:Uu,BINARY_NUMBER_RE:Or,COMMENT:$o,C_BLOCK_COMMENT_MODE:Vu,C_LINE_COMMENT_MODE:Du,C_NUMBER_MODE:Fu,C_NUMBER_RE:zr,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(o,n)=>{n.data._beginMatch=o[1]},"on:end":(o,n)=>{n.data._beginMatch!==o[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:$u,IDENT_RE:vr,MATCH_NOTHING_RE:Bu,METHOD_GUARD:ju,NUMBER_MODE:Pu,NUMBER_RE:Ir,PHRASAL_WORDS_MODE:Lu,QUOTE_STRING_MODE:Ou,REGEXP_MODE:Hu,RE_STARTERS_RE:vu,SHEBANG:Iu,TITLE_MODE:Wu,UNDERSCORE_IDENT_RE:wi,UNDERSCORE_TITLE_MODE:Gu});function Ku(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Yu(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function qu(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Ku,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function Xu(t,o){Array.isArray(t.illegal)&&(t.illegal=Ei(...t.illegal))}function Zu(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 Ju(t,o){t.relevance===void 0&&(t.relevance=1)}const Qu=(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=En(n.beforeMatch,Rr(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},ef=["of","and","for","in","not","or","if","then","parent","list","value"],tf="keyword";function Lr(t,o,n=tf){const i=Object.create(null);return typeof t=="string"?a(n,t.split(" ")):Array.isArray(t)?a(n,t):Object.keys(t).forEach(function(c){Object.assign(i,Lr(t[c],o,c))}),i;function a(c,s){o&&(s=s.map(u=>u.toLowerCase())),s.forEach(function(u){const d=u.split("|");i[d[0]]=[c,nf(d[0],d[1])]})}}function nf(t,o){return o?Number(o):of(t)?0:1}function of(t){return ef.includes(t.toLowerCase())}const Dr={},xn=t=>{console.error(t)},Vr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Dn=(t,o)=>{Dr[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Dr[`${t}/${o}`]=!0)},Fo=new Error;function $r(t,o,{key:n}){let i=0;const a=t[n],c={},s={};for(let u=1;u<=o.length;u++)s[u+i]=a[u],c[u+i]=!0,i+=Br(o[u-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function rf(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw xn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Fo;if(typeof t.beginScope!="object"||t.beginScope===null)throw xn("beginScope must be object"),Fo;$r(t,t.begin,{key:"beginScope"}),t.begin=xi(t.begin,{joinWith:""})}}function lf(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw xn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Fo;if(typeof t.endScope!="object"||t.endScope===null)throw xn("endScope must be object"),Fo;$r(t,t.end,{key:"endScope"}),t.end=xi(t.end,{joinWith:""})}}function af(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function sf(t){af(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),rf(t),lf(t)}function cf(t){function o(s,u){return new RegExp(ro(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=Br(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(xi(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const p=d.findIndex((x,C)=>C>0&&x!==void 0),h=this.matchIndexes[p];return d.splice(0,p),Object.assign(d,h)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([p,h])=>d.addRule(p,h)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let p=d.exec(u);if(this.resumingScanAtSamePosition()&&!(p&&p.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,p=h.exec(u)}return p&&(this.regexIndex+=p.position+1,this.regexIndex===this.count&&this.considerAll()),p}}function a(s){const u=new i;return s.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&u.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&u.addRule(s.illegal,{type:"illegal"}),u}function c(s,u){const d=s;if(s.isCompiled)return d;[Yu,Zu,sf,Qu].forEach(h=>h(s,u)),t.compilerExtensions.forEach(h=>h(s,u)),s.__beforeBegin=null,[qu,Xu,Ju].forEach(h=>h(s,u)),s.isCompiled=!0;let p=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),p=s.keywords.$pattern,delete s.keywords.$pattern),p=p||/\w+/,s.keywords&&(s.keywords=Lr(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(p,!0),u&&(s.begin||(s.begin=/\B|\b/),d.beginRe=o(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=o(d.end)),d.terminatorEnd=ro(d.end)||"",s.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+u.terminatorEnd)),s.illegal&&(d.illegalRe=o(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(h){return df(h==="self"?s:h)})),s.contains.forEach(function(h){c(h,d)}),s.starts&&c(s.starts,u),d.matcher=a(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=un(t.classNameAliases||{}),c(t)}function Pr(t){return t?t.endsWithParent||Pr(t.starts):!1}function df(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return un(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Pr(t)?un(t,{starts:t.starts?un(t.starts):null}):Object.isFrozen(t)?un(t):t}var uf="11.11.1";class ff extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Ni=Mr,Fr=un,Ur=Symbol("nomatch"),mf=7,Hr=function(t){const o=Object.create(null),n=Object.create(null),i=[];let a=!0;const c="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Tu};function d(b){return u.noHighlightRe.test(b)}function p(b){let V=b.className+" ";V+=b.parentNode?b.parentNode.className:"";const W=u.languageDetectRe.exec(V);if(W){const ee=w(W[1]);return ee||(Vr(c.replace("{}",W[1])),Vr("Falling back to no-highlight mode for this block.",b)),ee?W[1]:"no-highlight"}return V.split(/\s+/).find(ee=>d(ee)||w(ee))}function h(b,V,W){let ee="",ge="";typeof V=="object"?(ee=b,W=V.ignoreIllegals,ge=V.language):(Dn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Dn("10.7.0",`Please use highlight(code, options) instead.
|
|
59
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),
|
|
60
|
-
`,1;if(xt>1e5&&xt>re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Be+=xe,xe.length}const nt=w(b);if(!nt)throw xn(c.replace("{}",b)),new Error('Unknown language: "'+b+'"');const on=cf(nt);let Dt="",ue=ee||on;const ft={},ze=new u.__emitter(u);ut();let Be="",Vt=0,ot=0,xt=0,kt=!1;try{if(nt.__emitTokens)nt.__emitTokens(V,ze);else{for(ue.matcher.considerAll();;){xt++,kt?kt=!1:ue.matcher.considerAll(),ue.matcher.lastIndex=ot;const X=ue.matcher.exec(V);if(!X)break;const re=V.substring(ot,X.index),xe=nn(re,X);ot=X.index+xe}nn(V.substring(ot))}return ze.finalize(),Dt=ze.toHTML(),{language:b,value:Dt,relevance:Vt,illegal:!1,_emitter:ze,_top:ue}}catch(X){if(X.message&&X.message.includes("Illegal"))return{language:b,value:Ni(V),illegal:!0,relevance:0,_illegalBy:{message:X.message,index:ot,context:V.slice(ot-100,ot+100),mode:X.mode,resultSoFar:Dt},_emitter:ze};if(a)return{language:b,value:Ni(V),illegal:!1,relevance:0,errorRaised:X,_emitter:ze,_top:ue};throw X}}function C(b){const V={value:Ni(b),illegal:!1,relevance:0,_top:s,_emitter:new u.__emitter(u)};return V._emitter.addText(b),V}function $(b,V){V=V||u.languages||Object.keys(o);const W=C(b),ee=V.filter(w).filter(fe).map(be=>x(be,b,!1));ee.unshift(W);const ge=ee.sort((be,I)=>{if(be.relevance!==I.relevance)return I.relevance-be.relevance;if(be.language&&I.language){if(w(be.language).supersetOf===I.language)return 1;if(w(I.language).supersetOf===be.language)return-1}return 0}),[D,z]=ge,le=D;return le.secondBest=z,le}function R(b,V,W){const ee=V&&n[V]||W;b.classList.add("hljs"),b.classList.add(`language-${ee}`)}function F(b){let V=null;const W=p(b);if(d(W))return;if(ae("before:highlightElement",{el:b,language:W}),b.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",b);return}if(b.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(b)),u.throwUnescapedHTML))throw new ff("One of your code blocks includes unescaped HTML.",b.innerHTML);V=b;const ee=V.textContent,ge=W?h(ee,{language:W,ignoreIllegals:!0}):$(ee);b.innerHTML=ge.value,b.dataset.highlighted="yes",R(b,W,ge.language),b.result={language:ge.language,re:ge.relevance,relevance:ge.relevance},ge.secondBest&&(b.secondBest={language:ge.secondBest.language,relevance:ge.secondBest.relevance}),ae("after:highlightElement",{el:b,result:ge,text:ee})}function O(b){u=Fr(u,b)}const A=()=>{m(),Dn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){m(),Dn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function b(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",b,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(F)}function P(b,V){let W=null;try{W=V(t)}catch(ee){if(xn("Language definition for '{}' could not be registered.".replace("{}",b)),a)xn(ee);else throw ee;W=s}W.name||(W.name=b),o[b]=W,W.rawDefinition=V.bind(null,t),W.aliases&&ie(W.aliases,{languageName:b})}function G(b){delete o[b];for(const V of Object.keys(n))n[V]===b&&delete n[V]}function q(){return Object.keys(o)}function w(b){return b=(b||"").toLowerCase(),o[b]||o[n[b]]}function ie(b,{languageName:V}){typeof b=="string"&&(b=[b]),b.forEach(W=>{n[W.toLowerCase()]=V})}function fe(b){const V=w(b);return V&&!V.disableAutodetect}function ce(b){b["before:highlightBlock"]&&!b["before:highlightElement"]&&(b["before:highlightElement"]=V=>{b["before:highlightBlock"](Object.assign({block:V.el},V))}),b["after:highlightBlock"]&&!b["after:highlightElement"]&&(b["after:highlightElement"]=V=>{b["after:highlightBlock"](Object.assign({block:V.el},V))})}function J(b){ce(b),i.push(b)}function me(b){const V=i.indexOf(b);V!==-1&&i.splice(V,1)}function ae(b,V){const W=b;i.forEach(function(ee){ee[W]&&ee[W](V)})}function ke(b){return Dn("10.7.0","highlightBlock will be removed entirely in v12.0"),Dn("10.7.0","Please use highlightElement now."),F(b)}Object.assign(t,{highlight:h,highlightAuto:$,highlightAll:m,highlightElement:F,highlightBlock:ke,configure:O,initHighlighting:A,initHighlightingOnLoad:y,registerLanguage:P,unregisterLanguage:G,listLanguages:q,getLanguage:w,registerAliases:ie,autoDetection:fe,inherit:Fr,addPlugin:J,removePlugin:me}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=uf,t.regex={concat:En,lookahead:Rr,either:Ei,optional:Mu,anyNumberOfTimes:Cu};for(const b in Po)typeof Po[b]=="object"&&Tr(Po[b]);return Object.assign(t,Po),t},Vn=Hr({});Vn.newInstance=()=>Hr({});var pf=Vn;Vn.HighlightJS=Vn,Vn.default=Vn;const Si=xu(pf);function Ti(t){const o=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,a]};a.contains.push(u);const d={match:/\\"/},p={className:"string",begin:/'/,end:/'/},h={match:/\\'/},x={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],$=t.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),R={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},F=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],O=["true","false"],A={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],m=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],P=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:F,literal:O,built_in:[...y,...k,"set","shopt",...m,...P]},contains:[$,t.SHEBANG(),R,x,c,s,A,u,d,p,h,n]}}const hf=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_-]*/}}),gf=["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"],bf=["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"],kf=[...gf,...bf],yf=["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(),Ef=["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(),xf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),wf=["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 Nf(t){const o=t.regex,n=hf(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",c=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Ef.join("|")+")"},{begin:":(:)?("+xf.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+wf.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:yf.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+kf.join("|")+")\\b"}]}}function Wr(t){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}var $n="[0-9](_*[0-9])*",Uo=`\\.(${$n})`,Ho="[0-9a-fA-F](_*[0-9a-fA-F])*",Gr={className:"number",variants:[{begin:`(\\b(${$n})((${Uo})|\\.)?|(${Uo}))[eE][+-]?(${$n})[fFdD]?\\b`},{begin:`\\b(${$n})((${Uo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Uo})[fFdD]?\\b`},{begin:`\\b(${$n})[fFdD]\\b`},{begin:`\\b0[xX]((${Ho})\\.?|(${Ho})?\\.(${Ho}))[pP][+-]?(${$n})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ho})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function jr(t,o,n){return n===-1?"":t.replace(o,i=>jr(t,o,n-1))}function Sf(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+jr("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},p={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Gr,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Gr,p]}}const Kr="[A-Za-z$_][0-9A-Za-z$_]*",Tf=["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"],Cf=["true","false","null","undefined","NaN","Infinity"],Yr=["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"],qr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Xr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Mf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Af=[].concat(Xr,Yr,qr);function Zr(t){const o=t.regex,n=(W,{after:ee})=>{const ge="</"+W[0].slice(1);return W.input.indexOf(ge,ee)!==-1},i=Kr,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,ee)=>{const ge=W[0].length+W.index,D=W.input[ge];if(D==="<"||D===","){ee.ignoreMatch();return}D===">"&&(n(W,{after:ge})||ee.ignoreMatch());let z;const le=W.input.substring(ge);if(z=le.match(/^\s*=/)){ee.ignoreMatch();return}if((z=le.match(/^\s+extends\s+/))&&z.index===0){ee.ignoreMatch();return}}},u={$pattern:Kr,keyword:Tf,literal:Cf,built_in:Af,"variable.language":Mf},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},y={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,O,{match:/\$\d+/},x];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Yr,...qr]}},ie={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},fe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},ce={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function J(W){return o.concat("(?!",W.join("|"),")")}const me={match:o.concat(/\b/,J([...Xr,"super","import"].map(W=>`${W}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ke={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},b="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(b)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ie,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,O,y,{match:/\$\d+/},x,w,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,t.REGEXP_MODE,{className:"function",begin:b,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},fe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},me,ce,q,ke,{match:/\$[(.]/}]}}function _f(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,a,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Jr(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=t.inherit(p,{contains:[]}),C=t.inherit(h,{contains:[]});p.contains.push(C),h.contains.push(x);let $=[n,d];return[p,h,x,C].forEach(A=>{A.contains=A.contains.concat($)}),$=$.concat(p,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:$},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:$}]}]},n,c,p,h,{className:"quote",begin:"^>\\s+",contains:$,end:"$"},a,i,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Qr(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},h={begin:/\{\{/,relevance:0},x={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,h,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",$=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,R=`\\b|${i.join("|")}`,F={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${$}))[eE][+-]?(${C})[jJ]?(?=${R})`},{begin:`(${$})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${R})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${R})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${R})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${R})`},{begin:`\\b(${C})[jJ](?=${R})`}]},O={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,F,x,t.HASH_COMMENT_MODE]}]};return p.contains=[x,F,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,F,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,O,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[F,A,x]}]}}function el(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),a=o.concat(n,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,o.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:h,keyword:u,literal:d,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:h}},{className:"punctuation",begin:"->"},c]}}function Rf(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],x=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],C=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],$=h,R=[...p,...d].filter(P=>!h.includes(P)),F={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},O={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:o.concat(/\b/,o.either(...$),/\s*\(/),relevance:0,keywords:{built_in:$}};function y(P){return o.concat(/\b/,o.either(...P.map(G=>G.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:y(C),relevance:0};function m(P,{exceptions:G,when:q}={}){const w=q;return G=G||[],P.map(ie=>ie.match(/\|\d+$/)||G.includes(ie)?ie:w(ie)?`${ie}|0`:ie)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(R,{when:P=>P.length<3}),literal:c,type:u,built_in:x},contains:[{scope:"type",match:y(s)},k,A,F,i,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,O]}}const Wo="[A-Za-z$_][0-9A-Za-z$_]*",tl=["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"],nl=["true","false","null","undefined","NaN","Infinity"],ol=["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"],il=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],rl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ll=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],al=[].concat(rl,ol,il);function Bf(t){const o=t.regex,n=(W,{after:ee})=>{const ge="</"+W[0].slice(1);return W.input.indexOf(ge,ee)!==-1},i=Wo,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(W,ee)=>{const ge=W[0].length+W.index,D=W.input[ge];if(D==="<"||D===","){ee.ignoreMatch();return}D===">"&&(n(W,{after:ge})||ee.ignoreMatch());let z;const le=W.input.substring(ge);if(z=le.match(/^\s*=/)){ee.ignoreMatch();return}if((z=le.match(/^\s+extends\s+/))&&z.index===0){ee.ignoreMatch();return}}},u={$pattern:Wo,keyword:tl,literal:nl,built_in:al,"variable.language":ll},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},F={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},y={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,O,{match:/\$\d+/},x];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},q={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...ol,...il]}},ie={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},fe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},ce={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function J(W){return o.concat("(?!",W.join("|"),")")}const me={match:o.concat(/\b/,J([...rl,"super","import"].map(W=>`${W}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ae={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ke={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},b="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(b)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ie,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,F,O,y,{match:/\$\d+/},x,w,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,t.REGEXP_MODE,{className:"function",begin:b,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},fe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ae,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[G]},me,ce,q,ke,{match:/\$[(.]/}]}}function sl(t){const o=t.regex,n=Bf(t),i=Wo,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:Wo,keyword:tl.concat(d),literal:nl,built_in:al.concat(a),"variable.language":ll},h={className:"meta",begin:"@"+i},x=(F,O,A)=>{const y=F.contains.findIndex(k=>k.label===O);if(y===-1)throw new Error("can not find mode to replace");F.contains.splice(y,1,A)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(h);const C=n.contains.find(F=>F.scope==="attr"),$=Object.assign({},C,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,C,$]),n.contains=n.contains.concat([h,c,s,$]),x(n,"shebang",t.SHEBANG()),x(n,"use_strict",u);const R=n.contains.find(F=>F.label==="func.def");return R.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function cl(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(c,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,d,u,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,s,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:p}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function dl(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,a]},u=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),C={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},$={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},R={begin:/\{/,end:/\}/,contains:[$],illegal:"\\n",relevance:0},F={begin:"\\[",end:"\\]",contains:[$],illegal:"\\n",relevance:0},O=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},C,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},R,F,c,s],A=[...O];return A.pop(),A.push(u),$.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:O}}const Ci={bash:Ti,sh:Ti,shell:Ti,css:Nf,go:Wr,golang:Wr,java:Sf,javascript:Zr,js:Zr,json:_f,markdown:Jr,md:Jr,python:Qr,py:Qr,rust:el,rs:el,sql:Rf,typescript:sl,ts:sl,xml:cl,html:cl,yaml:dl,yml:dl};for(const[t,o]of Object.entries(Ci))Si.registerLanguage(t,o);function Go(t){const o=t.split(`
|
|
55
|
+
`,Vo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(Dn(n.data)),c=e.ref(null),s=e.ref(null),u=e.computed(()=>{try{const I=On(a.value||"");return c.value=null,I}catch(I){return c.value=I.message,{id:"preview_fallback",text:a.value||"(空)",children:[]}}}),d=e.computed(()=>Ot(u.value));let p=null;e.watch(a,()=>{p&&clearTimeout(p),p=setTimeout(()=>{var I;return(I=s.value)==null?void 0:I.resetView()},250)});function h(){try{const I=On(a.value||"");c.value=null,i("import",I)}catch(I){c.value=I.message}}function w(){a.value=Dn(n.data),c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}function C(){a.value="",c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}function $(){const I=document.createElement("input");I.type="file",I.accept=".md,text/markdown,text/plain",I.onchange=()=>{var k;const _=(k=I.files)==null?void 0:k[0];if(!_)return;const y=new FileReader;y.onload=()=>{typeof y.result=="string"&&(a.value=y.result,c.value=null,e.nextTick(()=>{var m;return(m=s.value)==null?void 0:m.resetView()}))},y.readAsText(_)},I.click()}function R(){const I=new Blob([a.value],{type:"text/markdown;charset=utf-8"}),_=URL.createObjectURL(I),y=document.createElement("a");y.href=_;const k=(n.data.text||"mindmap").trim()||"mindmap";y.download=`${k}.md`,y.click(),URL.revokeObjectURL(_)}function U(){a.value=Oc,c.value=null,e.nextTick(()=>{var I;return(I=s.value)==null?void 0:I.resetView()})}return(I,_)=>(e.openBlock(),e.createElementBlock("div",Ac,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:$},[..._[1]||(_[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 4 V15"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"加载 .md",-1)])]),e.createElementVNode("button",{class:"zm-md-btn",title:"把当前导图导出为 .md",onClick:R},[..._[2]||(_[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)])]),_[3]||(_[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:U},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:w},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:C},"清空")]),c.value?(e.openBlock(),e.createElementBlock("div",_c,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Rc,[e.createElementVNode("div",Bc,[_[4]||(_[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":_[0]||(_[0]=y=>a.value=y),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,a.value]])]),e.createElementVNode("div",vc,[_[5]||(_[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",zc,[e.createVNode(ei,{ref_key:"previewRef",ref:s,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Ic,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!a.value.trim(),onClick:h},"应用到导图",8,Lc)])]))}}),Dc={class:"zm-settings-panel"},Vc={class:"zm-settings-section"},$c={class:"zm-settings-field"},Pc={class:"zm-settings-control"},Fc={class:"zm-color-input-wrap"},Uc=["value"],Hc={class:"zm-color-input-text"},Wc={class:"zm-swatch-row zm-swatch-row--compact"},Gc=["title","onClick"],jc={class:"zm-settings-field"},Kc=["value"],Yc={class:"zm-slider"},qc=["value"],Xc={class:"zm-settings-field"},Zc=["value"],Jc={class:"zm-slider"},Qc=["value"],ed={class:"zm-settings-field zm-line-style-field"},td={class:"zm-line-style-group"},nd=["title","onClick"],od=["viewBox"],id={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},rd={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},ld={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},ad={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},sd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},cd={class:"zm-line-style-label"},dd={class:"zm-settings-field zm-line-style-field"},ud={class:"zm-line-style-group"},fd=["title","onClick"],md=["viewBox"],pd={key:0,d:"M 0 12 Q 14 2, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},hd={key:1,d:"M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},gd={key:2,d:"M 0 10 L 16 10 L 16 4 L 28 4",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round"},bd={key:3,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},kd={key:4,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},yd={class:"zm-line-style-label"},xd={key:0,class:"zm-settings-field"},Ed={class:"zm-settings-label"},wd={class:"zm-settings-sub"},Nd=["value"],Sd={key:1,class:"zm-slider"},Td=["value"],Cd={class:"zm-settings-field zm-line-style-field"},Md={class:"zm-line-style-group"},Ad=["title","onClick"],_d={viewBox:"0 0 28 18",width:"28",height:"18",preserveAspectRatio:"none"},Rd={key:0,d:"M 8 9 L 0 9 M 20 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},Bd={key:1,d:"M 14 9 L 0 9 M 14 9 L 28 9",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},vd={key:2,d:"M 8 7 L 0 4 M 8 9 L 0 9 M 8 11 L 0 14 M 20 7 L 28 4 M 20 9 L 28 9 M 20 11 L 28 14",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"},zd={class:"zm-line-style-label"},Id={class:"zm-settings-field"},Ld={key:2,class:"zm-palette-picker"},Od={class:"zm-palette-list"},Dd=["onClick"],Vd={class:"zm-palette-option-name"},$d={class:"zm-palette-option-swatches"},Pd={key:0,class:"zm-palette-custom-editor"},Fd=["value"],Ud={class:"zm-palette-custom-actions"},Hd={class:"zm-settings-field"},Wd={key:3,class:"zm-settings-field"},Gd={class:"zm-settings-label"},jd={class:"zm-settings-sub"},Kd=["value"],Yd={key:4,class:"zm-slider"},qd=["value"],Xd={key:5,class:"zm-settings-field"},Zd={class:"zm-settings-field"},Jd={class:"zm-settings-preview"},Qd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},eu=["x1","y1","x2","y2","stroke","stroke-width"],tu={key:0,class:"zm-settings-section"},nu={class:"zm-settings-section-title"},ou={key:0,class:"zm-settings-section-sub"},iu={class:"zm-settings-field"},ru={class:"zm-settings-value-tag"},lu={class:"zm-swatch-row"},au=["title","onClick"],su={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},cu=["value"],du={class:"zm-settings-field"},uu={class:"zm-settings-value-tag"},fu={class:"zm-swatch-row"},mu=["title","onClick"],pu={class:"zm-swatch zm-swatch--custom",title:"自定义颜色"},hu=["value"],gu={class:"zm-settings-field"},bu=["value"],ku=["value"],yu={class:"zm-settings-field"},xu=["value"],Eu={class:"zm-slider"},wu=["value"],Nu={class:"zm-settings-section zm-settings-section--actions"},$o=((t,o)=>{const n=t.__vccOpts||t;for(const[i,a]of o)n[i]=a;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{},nodeStyle:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,i=o;function a(Y,E){i("update:settings",{[Y]:E})}const c=[{value:"arc",label:"圆弧",viewBox:"0 0 28 14"},{value:"rounded-elbow",label:"圆角折线",viewBox:"0 0 28 14"},{value:"elbow",label:"折线",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"},{value:"curve",label:"S曲线",viewBox:"0 0 28 14"}],s=c,u=[{value:"edge",label:"左右中点"},{value:"center",label:"节点正中心"},{value:"proportional",label:"按比例计算"}],d=[{value:100,label:"100"},{value:200,label:"200"},{value:300,label:"300"},{value:400,label:"400 (常规)"},{value:500,label:"500"},{value:600,label:"600 (半粗)"},{value:700,label:"700 (粗体)"},{value:800,label:"800"},{value:900,label:"900"}];function p(Y){i("update:nodeStyle",Y)}const h=e.computed(()=>[...mn,...n.settings.customPalettes]),w=e.reactive({});function C(Y){return w[Y.id]===void 0&&(w[Y.id]=Y.colors.join(`
|
|
56
|
+
`)),w[Y.id]}function $(Y){const E=w[Y.id]??"",re=Ka(E);if(re.length===0){w[Y.id]=Y.colors.join(`
|
|
57
|
+
`);return}const pe=n.settings.customPalettes.map(de=>de.id===Y.id?{...de,colors:re}:de);i("update:settings",{customPalettes:pe})}function R(){const Y=h.value.find(Ee=>Ee.id===n.settings.branchPaletteId),E=Y?[...Y.colors]:[...mn[0].colors],re="custom-";let pe=re+(n.settings.customPalettes.length+1);for(;mn.some(Ee=>Ee.id===pe)||n.settings.customPalettes.some(Ee=>Ee.id===pe);)pe=re+Math.random().toString(36).slice(2,7);const de={id:pe,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:E};i("update:settings",{customPalettes:[...n.settings.customPalettes,de],branchPaletteId:pe}),w[pe]=E.join(`
|
|
58
|
+
`)}function U(Y){const E=n.settings.customPalettes.filter(pe=>pe.id!==Y.id),re=n.settings.branchPaletteId===Y.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:E,...re!==n.settings.branchPaletteId?{branchPaletteId:re}:{}}),delete w[Y.id]}const I=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],_=["#f8fafc","#ffffff","#e2e8f0","#1e2937","#0f172a","#fef3c7","#dbeafe","#dcfce7","#fce7f3","#f1f5f9"],y=[0,1,2,3],k=["#f87171","#fb923c","#34d399","#818cf8"];function m(Y,E,re,pe){if(E<=1)return re;const de=Y/(E-1);return re+(pe-re)*de}function P(Y,E,re,pe){const de=E*Math.pow(pe,Y);return Math.max(re,de)}const j=e.computed(()=>{const Y=n.settings.lineWidthStart,E=n.settings.lineWidthEnd,re=n.settings.taperedEdge,pe=y.length,de=8,Ee=192,ee=h.value.find(ue=>ue.id===n.settings.branchPaletteId),ce=ee&&ee.colors.length?ee.colors:k;return y.map((ue,g)=>{const V=10+g*60/(pe-1);return{x1:de,y1:V,x2:Ee,y2:V,w:re?P(ue,Y,E,n.settings.lineWidthTaper):m(ue,pe,Y,E),color:n.settings.rainbowBranch?ce[g%ce.length]:"#94a3b8"}})});return(Y,E)=>{var re,pe,de,Ee,ee,ce,ue;return e.openBlock(),e.createElementBlock("div",Dc,[e.createElementVNode("section",Vc,[E[48]||(E[48]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",$c,[E[25]||(E[25]=e.createElementVNode("span",{class:"zm-settings-label"},"画布背景色",-1)),e.createElementVNode("div",Pc,[e.createElementVNode("label",Fc,[e.createElementVNode("input",{type:"color",class:"zm-color-input",value:t.settings.canvasBg||"#f8fafc",onInput:E[0]||(E[0]=g=>a("canvasBg",g.target.value))},null,40,Uc),e.createElementVNode("span",Hc,e.toDisplayString(t.settings.canvasBg||"默认"),1)])])]),e.createElementVNode("div",Wc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(_,g=>e.createElementVNode("button",{key:"cbg-"+g,class:e.normalizeClass(["zm-swatch",{"is-active":(t.settings.canvasBg||"#f8fafc")===g}]),style:e.normalizeStyle({background:g}),title:g,onClick:V=>a("canvasBg",g)},null,14,Gc)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"恢复默认",onClick:E[1]||(E[1]=g=>a("canvasBg",void 0))},"∅")]),E[49]||(E[49]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",jc,[E[26]||(E[26]=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:E[2]||(E[2]=g=>a("lineWidthStart",parseFloat(g.target.value)||0))},null,40,Kc)]),e.createElementVNode("div",Yc,[E[27]||(E[27]=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:E[3]||(E[3]=g=>a("lineWidthStart",parseFloat(g.target.value)))},null,40,qc)]),e.createElementVNode("div",Xc,[E[28]||(E[28]=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:E[4]||(E[4]=g=>a("lineWidthEnd",parseFloat(g.target.value)||0))},null,40,Zc)]),e.createElementVNode("div",Jc,[E[29]||(E[29]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.1",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:E[5]||(E[5]=g=>a("lineWidthEnd",parseFloat(g.target.value)))},null,40,Qc)]),E[50]||(E[50]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",ed,[E[30]||(E[30]=e.createElementVNode("span",{class:"zm-settings-label"},"根节点线条",-1)),e.createElementVNode("div",td,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.rootLineStyle===g.value}]),title:g.label,onClick:V=>a("rootLineStyle",g.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:g.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[g.value==="arc"?(e.openBlock(),e.createElementBlock("path",id)):g.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",rd)):g.value==="elbow"?(e.openBlock(),e.createElementBlock("path",ld)):g.value==="curve"?(e.openBlock(),e.createElementBlock("path",ad)):(e.openBlock(),e.createElementBlock("line",sd))],8,od)),e.createElementVNode("span",cd,e.toDisplayString(g.label),1)],10,nd))),128))])]),e.createElementVNode("div",dd,[E[31]||(E[31]=e.createElementVNode("span",{class:"zm-settings-label"},"非根节点线条",-1)),e.createElementVNode("div",ud,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,g=>e.createElementVNode("button",{key:g.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===g.value}]),title:g.label,onClick:V=>a("lineStyle",g.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:g.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[g.value==="arc"?(e.openBlock(),e.createElementBlock("path",pd)):g.value==="rounded-elbow"?(e.openBlock(),e.createElementBlock("path",hd)):g.value==="elbow"?(e.openBlock(),e.createElementBlock("path",gd)):g.value==="curve"?(e.openBlock(),e.createElementBlock("path",bd)):(e.openBlock(),e.createElementBlock("line",kd))],8,md)),e.createElementVNode("span",yd,e.toDisplayString(g.label),1)],10,fd)),64))])]),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",xd,[e.createElementVNode("span",Ed,[E[32]||(E[32]=e.createTextVNode("圆角大小 ",-1)),e.createElementVNode("span",wd,e.toDisplayString(t.settings.elbowRadius)+"px",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"2",max:"40",value:t.settings.elbowRadius,onChange:E[6]||(E[6]=g=>a("elbowRadius",parseFloat(g.target.value)||20))},null,40,Nd)])):e.createCommentVNode("",!0),t.settings.lineStyle==="rounded-elbow"||t.settings.rootLineStyle==="rounded-elbow"?(e.openBlock(),e.createElementBlock("div",Sd,[E[33]||(E[33]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"2",max:"40",step:"1",value:t.settings.elbowRadius,onInput:E[7]||(E[7]=g=>a("elbowRadius",parseFloat(g.target.value)))},null,40,Td)])):e.createCommentVNode("",!0),e.createElementVNode("div",Cd,[E[35]||(E[35]=e.createElementVNode("span",{class:"zm-settings-label"},"线条起点",-1)),e.createElementVNode("div",Md,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,g=>e.createElementVNode("button",{key:g.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineOrigin===g.value}]),title:g.label,onClick:V=>a("lineOrigin",g.value)},[(e.openBlock(),e.createElementBlock("svg",_d,[E[34]||(E[34]=e.createElementVNode("rect",{x:"8",y:"6",width:"12",height:"6",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.2",opacity:"0.5"},null,-1)),g.value==="edge"?(e.openBlock(),e.createElementBlock("path",Rd)):g.value==="center"?(e.openBlock(),e.createElementBlock("path",Bd)):(e.openBlock(),e.createElementBlock("path",vd))])),e.createElementVNode("span",zd,e.toDisplayString(g.label),1)],10,Ad)),64))])]),e.createElementVNode("div",Id,[E[37]||(E[37]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:E[8]||(E[8]=g=>a("rainbowBranch",!t.settings.rainbowBranch))},[...E[36]||(E[36]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Ld,[E[38]||(E[38]=e.createElementVNode("div",{class:"zm-settings-field"},[e.createElementVNode("span",{class:"zm-settings-label"},"配色方案")],-1)),e.createElementVNode("div",Od,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,g=>(e.openBlock(),e.createElementBlock("button",{key:g.id,class:e.normalizeClass(["zm-palette-option",{"is-active":t.settings.branchPaletteId===g.id}]),onClick:V=>a("branchPaletteId",g.id)},[e.createElementVNode("span",Vd,e.toDisplayString(g.name),1),e.createElementVNode("span",$d,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.colors,(V,G)=>(e.openBlock(),e.createElementBlock("span",{key:G,class:"zm-palette-option-swatch",style:e.normalizeStyle({background:V})},null,4))),128))])],10,Dd))),128))]),t.settings.customPalettes.find(g=>g.id===t.settings.branchPaletteId)?(e.openBlock(),e.createElementBlock("div",Pd,[e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"3",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:C(t.settings.customPalettes.find(g=>g.id===t.settings.branchPaletteId)),onInput:E[9]||(E[9]=g=>w[t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId).id]=g.target.value)},null,40,Fd),e.createElementVNode("div",Ud,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:E[10]||(E[10]=g=>$(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"保存"),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:E[11]||(E[11]=g=>U(t.settings.customPalettes.find(V=>V.id===t.settings.branchPaletteId)))},"删除")])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:R},"+ 新建配色")])):e.createCommentVNode("",!0),E[51]||(E[51]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",Hd,[E[40]||(E[40]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:E[12]||(E[12]=g=>a("taperedEdge",!t.settings.taperedEdge))},[...E[39]||(E[39]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Wd,[e.createElementVNode("span",Gd,[E[41]||(E[41]=e.createTextVNode("层级衰减 ",-1)),e.createElementVNode("span",jd,e.toDisplayString(Math.round(t.settings.lineWidthTaper*100))+"%",1)]),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.05",min:"0.1",max:"1",value:t.settings.lineWidthTaper,onChange:E[13]||(E[13]=g=>a("lineWidthTaper",parseFloat(g.target.value)||.67))},null,40,Kd)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Yd,[E[42]||(E[42]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"0.1",max:"1",step:"0.01",value:t.settings.lineWidthTaper,onInput:E[14]||(E[14]=g=>a("lineWidthTaper",parseFloat(g.target.value)))},null,40,qd)])):e.createCommentVNode("",!0),t.settings.taperedEdge?(e.openBlock(),e.createElementBlock("div",Xd,[E[44]||(E[44]=e.createElementVNode("span",{class:"zm-settings-label"},"非根节点相同粗细",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.uniformLineWidth}]),onClick:E[15]||(E[15]=g=>a("uniformLineWidth",!t.settings.uniformLineWidth))},[...E[43]||(E[43]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)])):e.createCommentVNode("",!0),e.createElementVNode("div",Zd,[E[46]||(E[46]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:E[16]||(E[16]=g=>a("showOrderBadge",!t.settings.showOrderBadge))},[...E[45]||(E[45]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",Jd,[(e.openBlock(),e.createElementBlock("svg",Qd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(g,V)=>(e.openBlock(),e.createElementBlock("line",{key:V,x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,stroke:t.settings.rainbowBranch?g.color:"#94a3b8","stroke-width":g.w,"stroke-linecap":"butt"},null,8,eu))),128))])),E[47]||(E[47]=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",tu,[e.createElementVNode("h4",nu,[E[52]||(E[52]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",ou,'"'+e.toDisplayString(t.selectedNodeText)+'"',1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",iu,[E[53]||(E[53]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",ru,e.toDisplayString(((re=t.nodeStyle)==null?void 0:re.bg)||"默认"),1)]),e.createElementVNode("div",lu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(I,g=>{var V;return e.createElementVNode("button",{key:"bg-"+g,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.bg)===g}]),style:e.normalizeStyle({background:g}),title:g,onClick:G=>p({bg:g})},null,14,au)}),64)),e.createElementVNode("label",su,[e.createElementVNode("input",{type:"color",value:((pe=t.nodeStyle)==null?void 0:pe.bg)||"#ffffff",onInput:E[17]||(E[17]=g=>p({bg:g.target.value}))},null,40,cu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:E[18]||(E[18]=g=>p({bg:void 0}))},"∅")]),e.createElementVNode("div",du,[E[54]||(E[54]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",uu,e.toDisplayString(((de=t.nodeStyle)==null?void 0:de.textColor)||"默认"),1)]),e.createElementVNode("div",fu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(I,g=>{var V;return e.createElementVNode("button",{key:"fg-"+g,class:e.normalizeClass(["zm-swatch",{"is-active":((V=t.nodeStyle)==null?void 0:V.textColor)===g}]),style:e.normalizeStyle({background:g}),title:g,onClick:G=>p({textColor:g})},null,14,mu)}),64)),e.createElementVNode("label",pu,[e.createElementVNode("input",{type:"color",value:((Ee=t.nodeStyle)==null?void 0:Ee.textColor)||"#1e2937",onInput:E[19]||(E[19]=g=>p({textColor:g.target.value}))},null,40,hu)]),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:E[20]||(E[20]=g=>p({textColor:void 0}))},"∅")]),E[58]||(E[58]=e.createElementVNode("div",{class:"zm-settings-divider"},null,-1)),e.createElementVNode("div",gu,[E[55]||(E[55]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("select",{class:"zm-select",value:((ee=t.nodeStyle)==null?void 0:ee.fontWeight)??400,onChange:E[21]||(E[21]=g=>p({fontWeight:parseInt(g.target.value)}))},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(d,g=>e.createElementVNode("option",{key:g.value,value:g.value},e.toDisplayString(g.label),9,ku)),64))],40,bu)]),e.createElementVNode("div",yu,[E[56]||(E[56]=e.createElementVNode("span",{class:"zm-settings-label"},"文字大小",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"1",min:"8",max:"48",value:((ce=t.nodeStyle)==null?void 0:ce.fontSize)??14,onChange:E[22]||(E[22]=g=>p({fontSize:parseInt(g.target.value)||14}))},null,40,xu)]),e.createElementVNode("div",Eu,[E[57]||(E[57]=e.createElementVNode("div",{class:"zm-slider-track"},null,-1)),e.createElementVNode("input",{type:"range",min:"8",max:"48",step:"1",value:((ue=t.nodeStyle)==null?void 0:ue.fontSize)??14,onInput:E[23]||(E[23]=g=>p({fontSize:parseInt(g.target.value)}))},null,40,wu)]),E[59]||(E[59]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Nu,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:E[24]||(E[24]=g=>i("reset"))},"恢复默认设置")])])}}}),[["__scopeId","data-v-8119213a"]]),Cr=20;function Su(t,o){t.style.height="auto";const n=o.minRows*Cr,i=o.maxRows>0?o.maxRows*Cr:1/0,a=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=a+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function xi(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const c=t.value;c&&Su(c,n)}function a(){i()}e.onMounted(async()=>{await e.nextTick();const c=t.value;c&&(c.addEventListener("input",a),i())}),e.watch(()=>{var c;return(c=t.value)==null?void 0:c.value},()=>i()),e.onBeforeUnmount(()=>{const c=t.value;c&&c.removeEventListener("input",a)})}function Tu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Mr(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(o=>{const n=t[o],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&Mr(n)}),t}class Ar{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function _r(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function pn(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const a in i)n[a]=i[a]}),n}const Cu="</span>",Rr=t=>!!t.scope,Mu=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((i,a)=>`${i}${"_".repeat(a+1)}`)].join(" ")}return`${o}${t}`};class Au{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=_r(o)}openNode(o){if(!Rr(o))return;const n=Mu(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){Rr(o)&&(this.buffer+=Cu)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Br=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class Ei{constructor(){this.rootNode=Br(),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=Br({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=>{Ei._collapse(n)}))}}class _u extends Ei{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 Au(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function lo(t){return t?typeof t=="string"?t:t.source:null}function vr(t){return Nn("(?=",t,")")}function Ru(t){return Nn("(?:",t,")*")}function Bu(t){return Nn("(?:",t,")?")}function Nn(...t){return t.map(n=>lo(n)).join("")}function vu(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function wi(...t){return"("+(vu(t).capture?"":"?:")+t.map(i=>lo(i)).join("|")+")"}function zr(t){return new RegExp(t.toString()+"|").exec("").length-1}function zu(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Iu=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ni(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const a=n;let c=lo(i),s="";for(;c.length>0;){const u=Iu.exec(c);if(!u){s+=c;break}s+=c.substring(0,u.index),c=c.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?s+="\\"+String(Number(u[1])+a):(s+=u[0],u[0]==="("&&n++)}return s}).map(i=>`(${i})`).join(o)}const Lu=/\b\B/,Ir="[a-zA-Z]\\w*",Si="[a-zA-Z_]\\w*",Lr="\\b\\d+(\\.\\d+)?",Or="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Dr="\\b(0b[01]+)",Ou="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Du=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Nn(o,/.*\b/,t.binary,/\b.*/)),pn({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},ao={begin:"\\\\[\\s\\S]",relevance:0},Vu={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ao]},$u={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ao]},Pu={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Po=function(t,o,n={}){const i=pn({scope:"comment",begin:t,end:o,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=wi("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:Nn(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},Fu=Po("//","$"),Uu=Po("/\\*","\\*/"),Hu=Po("#","$"),Wu={scope:"number",begin:Lr,relevance:0},Gu={scope:"number",begin:Or,relevance:0},ju={scope:"number",begin:Dr,relevance:0},Ku={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ao,{begin:/\[/,end:/\]/,relevance:0,contains:[ao]}]},Yu={scope:"title",begin:Ir,relevance:0},qu={scope:"title",begin:Si,relevance:0},Xu={begin:"\\.\\s*"+Si,relevance:0};var Fo=Object.freeze({__proto__:null,APOS_STRING_MODE:Vu,BACKSLASH_ESCAPE:ao,BINARY_NUMBER_MODE:ju,BINARY_NUMBER_RE:Dr,COMMENT:Po,C_BLOCK_COMMENT_MODE:Uu,C_LINE_COMMENT_MODE:Fu,C_NUMBER_MODE:Gu,C_NUMBER_RE:Or,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:Hu,IDENT_RE:Ir,MATCH_NOTHING_RE:Lu,METHOD_GUARD:Xu,NUMBER_MODE:Wu,NUMBER_RE:Lr,PHRASAL_WORDS_MODE:Pu,QUOTE_STRING_MODE:$u,REGEXP_MODE:Ku,RE_STARTERS_RE:Ou,SHEBANG:Du,TITLE_MODE:Yu,UNDERSCORE_IDENT_RE:Si,UNDERSCORE_TITLE_MODE:qu});function Zu(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function Ju(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function Qu(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Zu,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function ef(t,o){Array.isArray(t.illegal)&&(t.illegal=wi(...t.illegal))}function tf(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 nf(t,o){t.relevance===void 0&&(t.relevance=1)}const of=(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=Nn(n.beforeMatch,vr(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},rf=["of","and","for","in","not","or","if","then","parent","list","value"],lf="keyword";function Vr(t,o,n=lf){const i=Object.create(null);return typeof t=="string"?a(n,t.split(" ")):Array.isArray(t)?a(n,t):Object.keys(t).forEach(function(c){Object.assign(i,Vr(t[c],o,c))}),i;function a(c,s){o&&(s=s.map(u=>u.toLowerCase())),s.forEach(function(u){const d=u.split("|");i[d[0]]=[c,af(d[0],d[1])]})}}function af(t,o){return o?Number(o):sf(t)?0:1}function sf(t){return rf.includes(t.toLowerCase())}const $r={},Sn=t=>{console.error(t)},Pr=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Vn=(t,o)=>{$r[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),$r[`${t}/${o}`]=!0)},Uo=new Error;function Fr(t,o,{key:n}){let i=0;const a=t[n],c={},s={};for(let u=1;u<=o.length;u++)s[u+i]=a[u],c[u+i]=!0,i+=zr(o[u-1]);t[n]=s,t[n]._emit=c,t[n]._multi=!0}function cf(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Sn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Uo;if(typeof t.beginScope!="object"||t.beginScope===null)throw Sn("beginScope must be object"),Uo;Fr(t,t.begin,{key:"beginScope"}),t.begin=Ni(t.begin,{joinWith:""})}}function df(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Sn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Uo;if(typeof t.endScope!="object"||t.endScope===null)throw Sn("endScope must be object"),Uo;Fr(t,t.end,{key:"endScope"}),t.end=Ni(t.end,{joinWith:""})}}function uf(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function ff(t){uf(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),cf(t),df(t)}function mf(t){function o(s,u){return new RegExp(lo(s),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=zr(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(Ni(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const p=d.findIndex((w,C)=>C>0&&w!==void 0),h=this.matchIndexes[p];return d.splice(0,p),Object.assign(d,h)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([p,h])=>d.addRule(p,h)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let p=d.exec(u);if(this.resumingScanAtSamePosition()&&!(p&&p.index===this.lastIndex)){const h=this.getMatcher(0);h.lastIndex=this.lastIndex+1,p=h.exec(u)}return p&&(this.regexIndex+=p.position+1,this.regexIndex===this.count&&this.considerAll()),p}}function a(s){const u=new i;return s.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&u.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&u.addRule(s.illegal,{type:"illegal"}),u}function c(s,u){const d=s;if(s.isCompiled)return d;[Ju,tf,ff,of].forEach(h=>h(s,u)),t.compilerExtensions.forEach(h=>h(s,u)),s.__beforeBegin=null,[Qu,ef,nf].forEach(h=>h(s,u)),s.isCompiled=!0;let p=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),p=s.keywords.$pattern,delete s.keywords.$pattern),p=p||/\w+/,s.keywords&&(s.keywords=Vr(s.keywords,t.case_insensitive)),d.keywordPatternRe=o(p,!0),u&&(s.begin||(s.begin=/\B|\b/),d.beginRe=o(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=o(d.end)),d.terminatorEnd=lo(d.end)||"",s.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+u.terminatorEnd)),s.illegal&&(d.illegalRe=o(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(h){return pf(h==="self"?s:h)})),s.contains.forEach(function(h){c(h,d)}),s.starts&&c(s.starts,u),d.matcher=a(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=pn(t.classNameAliases||{}),c(t)}function Ur(t){return t?t.endsWithParent||Ur(t.starts):!1}function pf(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return pn(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Ur(t)?pn(t,{starts:t.starts?pn(t.starts):null}):Object.isFrozen(t)?pn(t):t}var hf="11.11.1";class gf extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Ti=_r,Hr=pn,Wr=Symbol("nomatch"),bf=7,Gr=function(t){const o=Object.create(null),n=Object.create(null),i=[];let a=!0;const c="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:_u};function d(g){return u.noHighlightRe.test(g)}function p(g){let V=g.className+" ";V+=g.parentNode?g.parentNode.className:"";const G=u.languageDetectRe.exec(V);if(G){const oe=E(G[1]);return oe||(Pr(c.replace("{}",G[1])),Pr("Falling back to no-highlight mode for this block.",g)),oe?G[1]:"no-highlight"}return V.split(/\s+/).find(oe=>d(oe)||E(oe))}function h(g,V,G){let oe="",fe="";typeof V=="object"?(oe=g,G=V.ignoreIllegals,fe=V.language):(Vn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Vn("10.7.0",`Please use highlight(code, options) instead.
|
|
59
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),fe=g,oe=V),G===void 0&&(G=!0);const O={code:oe,language:fe};ce("before:highlight",O);const L=O.result?O.result:w(O.language,O.code,G);return L.code=O.code,ce("after:highlight",L),L}function w(g,V,G,oe){const fe=Object.create(null);function O(q,le){return q.keywords[le]}function L(){if(!me.keywords){De.addText(ze);return}let q=0;me.keywordPatternRe.lastIndex=0;let le=me.keywordPatternRe.exec(ze),xe="";for(;le;){xe+=ze.substring(q,le.index);const Re=it.case_insensitive?le[0].toLowerCase():le[0],Ge=O(me,Re);if(Ge){const[lt,Mt]=Ge;if(De.addText(xe),xe="",fe[Re]=(fe[Re]||0)+1,fe[Re]<=bf&&(Ft+=Mt),lt.startsWith("_"))xe+=le[0];else{const Bn=it.classNameAliases[lt]||lt;z(le[0],Bn)}}else xe+=le[0];q=me.keywordPatternRe.lastIndex,le=me.keywordPatternRe.exec(ze)}xe+=ze.substring(q),De.addText(xe)}function se(){if(ze==="")return;let q=null;if(typeof me.subLanguage=="string"){if(!o[me.subLanguage]){De.addText(ze);return}q=w(me.subLanguage,ze,!0,mt[me.subLanguage]),mt[me.subLanguage]=q._top}else q=$(ze,me.subLanguage.length?me.subLanguage:null);me.relevance>0&&(Ft+=q.relevance),De.__addSublanguage(q._emitter,q.language)}function ke(){me.subLanguage!=null?se():L(),ze=""}function z(q,le){q!==""&&(De.startScope(le),De.addText(q),De.endScope())}function S(q,le){let xe=1;const Re=le.length-1;for(;xe<=Re;){if(!q._emit[xe]){xe++;continue}const Ge=it.classNameAliases[q[xe]]||q[xe],lt=le[xe];Ge?z(lt,Ge):(ze=lt,L(),ze=""),xe++}}function F(q,le){return q.scope&&typeof q.scope=="string"&&De.openNode(it.classNameAliases[q.scope]||q.scope),q.beginScope&&(q.beginScope._wrap?(z(ze,it.classNameAliases[q.beginScope._wrap]||q.beginScope._wrap),ze=""):q.beginScope._multi&&(S(q.beginScope,le),ze="")),me=Object.create(q,{parent:{value:me}}),me}function W(q,le,xe){let Re=zu(q.endRe,xe);if(Re){if(q["on:end"]){const Ge=new Ar(q);q["on:end"](le,Ge),Ge.isMatchIgnored&&(Re=!1)}if(Re){for(;q.endsParent&&q.parent;)q=q.parent;return q}}if(q.endsWithParent)return W(q.parent,le,xe)}function te(q){return me.matcher.regexIndex===0?(ze+=q[0],1):(wt=!0,0)}function ye(q){const le=q[0],xe=q.rule,Re=new Ar(xe),Ge=[xe.__beforeBegin,xe["on:begin"]];for(const lt of Ge)if(lt&&(lt(q,Re),Re.isMatchIgnored))return te(le);return xe.skip?ze+=le:(xe.excludeBegin&&(ze+=le),ke(),!xe.returnBegin&&!xe.excludeBegin&&(ze=le)),F(xe,q),xe.returnBegin?0:le.length}function nt(q){const le=q[0],xe=V.substring(q.index),Re=W(me,q,xe);if(!Re)return Wr;const Ge=me;me.endScope&&me.endScope._wrap?(ke(),z(le,me.endScope._wrap)):me.endScope&&me.endScope._multi?(ke(),S(me.endScope,q)):Ge.skip?ze+=le:(Ge.returnEnd||Ge.excludeEnd||(ze+=le),ke(),Ge.excludeEnd&&(ze=le));do me.scope&&De.closeNode(),!me.skip&&!me.subLanguage&&(Ft+=me.relevance),me=me.parent;while(me!==Re.parent);return Re.starts&&F(Re.starts,q),Ge.returnEnd?0:le.length}function ft(){const q=[];for(let le=me;le!==it;le=le.parent)le.scope&&q.unshift(le.scope);q.forEach(le=>De.openNode(le))}let ot={};function ln(q,le){const xe=le&&le[0];if(ze+=q,xe==null)return ke(),0;if(ot.type==="begin"&&le.type==="end"&&ot.index===le.index&&xe===""){if(ze+=V.slice(le.index,le.index+1),!a){const Re=new Error(`0 width match regex (${g})`);throw Re.languageName=g,Re.badRule=ot.rule,Re}return 1}if(ot=le,le.type==="begin")return ye(le);if(le.type==="illegal"&&!G){const Re=new Error('Illegal lexeme "'+xe+'" for mode "'+(me.scope||"<unnamed>")+'"');throw Re.mode=me,Re}else if(le.type==="end"){const Re=nt(le);if(Re!==Wr)return Re}if(le.type==="illegal"&&xe==="")return ze+=`
|
|
60
|
+
`,1;if(Ct>1e5&&Ct>le.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ze+=xe,xe.length}const it=E(g);if(!it)throw Sn(c.replace("{}",g)),new Error('Unknown language: "'+g+'"');const an=mf(it);let Pt="",me=oe||an;const mt={},De=new u.__emitter(u);ft();let ze="",Ft=0,rt=0,Ct=0,wt=!1;try{if(it.__emitTokens)it.__emitTokens(V,De);else{for(me.matcher.considerAll();;){Ct++,wt?wt=!1:me.matcher.considerAll(),me.matcher.lastIndex=rt;const q=me.matcher.exec(V);if(!q)break;const le=V.substring(rt,q.index),xe=ln(le,q);rt=q.index+xe}ln(V.substring(rt))}return De.finalize(),Pt=De.toHTML(),{language:g,value:Pt,relevance:Ft,illegal:!1,_emitter:De,_top:me}}catch(q){if(q.message&&q.message.includes("Illegal"))return{language:g,value:Ti(V),illegal:!0,relevance:0,_illegalBy:{message:q.message,index:rt,context:V.slice(rt-100,rt+100),mode:q.mode,resultSoFar:Pt},_emitter:De};if(a)return{language:g,value:Ti(V),illegal:!1,relevance:0,errorRaised:q,_emitter:De,_top:me};throw q}}function C(g){const V={value:Ti(g),illegal:!1,relevance:0,_top:s,_emitter:new u.__emitter(u)};return V._emitter.addText(g),V}function $(g,V){V=V||u.languages||Object.keys(o);const G=C(g),oe=V.filter(E).filter(pe).map(ke=>w(ke,g,!1));oe.unshift(G);const fe=oe.sort((ke,z)=>{if(ke.relevance!==z.relevance)return z.relevance-ke.relevance;if(ke.language&&z.language){if(E(ke.language).supersetOf===z.language)return 1;if(E(z.language).supersetOf===ke.language)return-1}return 0}),[O,L]=fe,se=O;return se.secondBest=L,se}function R(g,V,G){const oe=V&&n[V]||G;g.classList.add("hljs"),g.classList.add(`language-${oe}`)}function U(g){let V=null;const G=p(g);if(d(G))return;if(ce("before:highlightElement",{el:g,language:G}),g.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",g);return}if(g.children.length>0&&(u.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(g)),u.throwUnescapedHTML))throw new gf("One of your code blocks includes unescaped HTML.",g.innerHTML);V=g;const oe=V.textContent,fe=G?h(oe,{language:G,ignoreIllegals:!0}):$(oe);g.innerHTML=fe.value,g.dataset.highlighted="yes",R(g,G,fe.language),g.result={language:fe.language,re:fe.relevance,relevance:fe.relevance},fe.secondBest&&(g.secondBest={language:fe.secondBest.language,relevance:fe.secondBest.relevance}),ce("after:highlightElement",{el:g,result:fe,text:oe})}function I(g){u=Hr(u,g)}const _=()=>{m(),Vn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){m(),Vn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function m(){function g(){m()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",g,!1),k=!0;return}document.querySelectorAll(u.cssSelector).forEach(U)}function P(g,V){let G=null;try{G=V(t)}catch(oe){if(Sn("Language definition for '{}' could not be registered.".replace("{}",g)),a)Sn(oe);else throw oe;G=s}G.name||(G.name=g),o[g]=G,G.rawDefinition=V.bind(null,t),G.aliases&&re(G.aliases,{languageName:g})}function j(g){delete o[g];for(const V of Object.keys(n))n[V]===g&&delete n[V]}function Y(){return Object.keys(o)}function E(g){return g=(g||"").toLowerCase(),o[g]||o[n[g]]}function re(g,{languageName:V}){typeof g=="string"&&(g=[g]),g.forEach(G=>{n[G.toLowerCase()]=V})}function pe(g){const V=E(g);return V&&!V.disableAutodetect}function de(g){g["before:highlightBlock"]&&!g["before:highlightElement"]&&(g["before:highlightElement"]=V=>{g["before:highlightBlock"](Object.assign({block:V.el},V))}),g["after:highlightBlock"]&&!g["after:highlightElement"]&&(g["after:highlightElement"]=V=>{g["after:highlightBlock"](Object.assign({block:V.el},V))})}function Ee(g){de(g),i.push(g)}function ee(g){const V=i.indexOf(g);V!==-1&&i.splice(V,1)}function ce(g,V){const G=g;i.forEach(function(oe){oe[G]&&oe[G](V)})}function ue(g){return Vn("10.7.0","highlightBlock will be removed entirely in v12.0"),Vn("10.7.0","Please use highlightElement now."),U(g)}Object.assign(t,{highlight:h,highlightAuto:$,highlightAll:m,highlightElement:U,highlightBlock:ue,configure:I,initHighlighting:_,initHighlightingOnLoad:y,registerLanguage:P,unregisterLanguage:j,listLanguages:Y,getLanguage:E,registerAliases:re,autoDetection:pe,inherit:Hr,addPlugin:Ee,removePlugin:ee}),t.debugMode=function(){a=!1},t.safeMode=function(){a=!0},t.versionString=hf,t.regex={concat:Nn,lookahead:vr,either:wi,optional:Bu,anyNumberOfTimes:Ru};for(const g in Fo)typeof Fo[g]=="object"&&Mr(Fo[g]);return Object.assign(t,Fo),t},$n=Gr({});$n.newInstance=()=>Gr({});var kf=$n;$n.HighlightJS=$n,$n.default=$n;const Ci=Tu(kf);function Mi(t){const o=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,a]};a.contains.push(u);const d={match:/\\"/},p={className:"string",begin:/'/,end:/'/},h={match:/\\'/},w={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],$=t.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),R={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},U=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],I=["true","false"],_={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],m=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],P=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:U,literal:I,built_in:[...y,...k,"set","shopt",...m,...P]},contains:[$,t.SHEBANG(),R,w,c,s,_,u,d,p,h,n]}}const yf=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_-]*/}}),xf=["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"],Ef=["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"],wf=[...xf,...Ef],Nf=["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(),Sf=["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(),Tf=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Cf=["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 Mf(t){const o=t.regex,n=yf(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",c=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Sf.join("|")+")"},{begin:":(:)?("+Tf.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Cf.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:Nf.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+wf.join("|")+")\\b"}]}}function jr(t){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}var Pn="[0-9](_*[0-9])*",Ho=`\\.(${Pn})`,Wo="[0-9a-fA-F](_*[0-9a-fA-F])*",Kr={className:"number",variants:[{begin:`(\\b(${Pn})((${Ho})|\\.)?|(${Ho}))[eE][+-]?(${Pn})[fFdD]?\\b`},{begin:`\\b(${Pn})((${Ho})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ho})[fFdD]?\\b`},{begin:`\\b(${Pn})[fFdD]\\b`},{begin:`\\b0[xX]((${Wo})\\.?|(${Wo})?\\.(${Wo}))[pP][+-]?(${Pn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Wo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Yr(t,o,n){return n===-1?"":t.replace(o,i=>Yr(t,o,n-1))}function Af(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Yr("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},p={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},h={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Kr,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Kr,p]}}const qr="[A-Za-z$_][0-9A-Za-z$_]*",_f=["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"],Rf=["true","false","null","undefined","NaN","Infinity"],Xr=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Zr=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Jr=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Bf=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],vf=[].concat(Jr,Xr,Zr);function Qr(t){const o=t.regex,n=(G,{after:oe})=>{const fe="</"+G[0].slice(1);return G.input.indexOf(fe,oe)!==-1},i=qr,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,oe)=>{const fe=G[0].length+G.index,O=G.input[fe];if(O==="<"||O===","){oe.ignoreMatch();return}O===">"&&(n(G,{after:fe})||oe.ignoreMatch());let L;const se=G.input.substring(fe);if(L=se.match(/^\s*=/)){oe.ignoreMatch();return}if((L=se.match(/^\s+extends\s+/))&&L.index===0){oe.ignoreMatch();return}}},u={$pattern:qr,keyword:_f,literal:Rf,built_in:vf,"variable.language":Bf},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},U={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},y={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,U,I,{match:/\$\d+/},w];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),j={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},Y={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Xr,...Zr]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[j],illegal:/%/},de={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Ee(G){return o.concat("(?!",G.join("|"),")")}const ee={match:o.concat(/\b/,Ee([...Jr,"super","import"].map(G=>`${G}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ue={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},j]},g="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(g)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[j]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,U,I,y,{match:/\$\d+/},w,E,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,t.REGEXP_MODE,{className:"function",begin:g,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[j,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[j]},ee,de,Y,ue,{match:/\$[(.]/}]}}function zf(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,a,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function el(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},w=t.inherit(p,{contains:[]}),C=t.inherit(h,{contains:[]});p.contains.push(C),h.contains.push(w);let $=[n,d];return[p,h,w,C].forEach(_=>{_.contains=_.contains.concat($)}),$=$.concat(p,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:$},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:$}]}]},n,c,p,h,{className:"quote",begin:"^>\\s+",contains:$,end:"$"},a,i,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function tl(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},h={begin:/\{\{/,relevance:0},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,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,h,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,h,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,h,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",$=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,R=`\\b|${i.join("|")}`,U={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${$}))[eE][+-]?(${C})[jJ]?(?=${R})`},{begin:`(${$})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${R})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${R})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${R})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${R})`},{begin:`\\b(${C})[jJ](?=${R})`}]},I={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,U,w,t.HASH_COMMENT_MODE]}]};return p.contains=[w,U,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,U,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},w,I,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[_]},{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:[U,_,w]}]}}function nl(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),a=o.concat(n,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,o.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],h=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:h,keyword:u,literal:d,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:h}},{className:"punctuation",begin:"->"},c]}}function If(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],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"],C=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],$=h,R=[...p,...d].filter(P=>!h.includes(P)),U={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},I={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:o.concat(/\b/,o.either(...$),/\s*\(/),relevance:0,keywords:{built_in:$}};function y(P){return o.concat(/\b/,o.either(...P.map(j=>j.replace(/\s+/,"\\s+"))),/\b/)}const k={scope:"keyword",match:y(C),relevance:0};function m(P,{exceptions:j,when:Y}={}){const E=Y;return j=j||[],P.map(re=>re.match(/\|\d+$/)||j.includes(re)?re:E(re)?`${re}|0`:re)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:m(R,{when:P=>P.length<3}),literal:c,type:u,built_in:w},contains:[{scope:"type",match:y(s)},k,_,U,i,a,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,I]}}const Go="[A-Za-z$_][0-9A-Za-z$_]*",ol=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],il=["true","false","null","undefined","NaN","Infinity"],rl=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ll=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],al=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],sl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],cl=[].concat(al,rl,ll);function Lf(t){const o=t.regex,n=(G,{after:oe})=>{const fe="</"+G[0].slice(1);return G.input.indexOf(fe,oe)!==-1},i=Go,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(G,oe)=>{const fe=G[0].length+G.index,O=G.input[fe];if(O==="<"||O===","){oe.ignoreMatch();return}O===">"&&(n(G,{after:fe})||oe.ignoreMatch());let L;const se=G.input.substring(fe);if(L=se.match(/^\s*=/)){oe.ignoreMatch();return}if((L=se.match(/^\s+extends\s+/))&&L.index===0){oe.ignoreMatch();return}}},u={$pattern:Go,keyword:ol,literal:il,built_in:cl,"variable.language":sl},d="[0-9](_?[0-9])*",p=`\\.(${d})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",w={className:"number",variants:[{begin:`(\\b(${h})((${p})|\\.)?|(${p}))[eE][+-]?(${d})\\b`},{begin:`\\b(${h})\\b((${p})\\b|\\.)?|(${p})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},U={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},y={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},k=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,U,I,{match:/\$\d+/},w];C.contains=k.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(k)});const m=[].concat(y,C.contains),P=m.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(m)}]),j={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P},Y={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},E={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...rl,...ll]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[j],illegal:/%/},de={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Ee(G){return o.concat("(?!",G.join("|"),")")}const ee={match:o.concat(/\b/,Ee([...al,"super","import"].map(G=>`${G}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ue={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},j]},g="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(g)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[j]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:E},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,$,R,U,I,y,{match:/\$\d+/},w,E,{scope:"attr",match:i+o.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,t.REGEXP_MODE,{className:"function",begin:g,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[j,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[j]},ee,de,Y,ue,{match:/\$[(.]/}]}}function dl(t){const o=t.regex,n=Lf(t),i=Go,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],p={$pattern:Go,keyword:ol.concat(d),literal:il,built_in:cl.concat(a),"variable.language":sl},h={className:"meta",begin:"@"+i},w=(U,I,_)=>{const y=U.contains.findIndex(k=>k.label===I);if(y===-1)throw new Error("can not find mode to replace");U.contains.splice(y,1,_)};Object.assign(n.keywords,p),n.exports.PARAMS_CONTAINS.push(h);const C=n.contains.find(U=>U.scope==="attr"),$=Object.assign({},C,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,C,$]),n.contains=n.contains.concat([h,c,s,$]),w(n,"shebang",t.SHEBANG()),w(n,"use_strict",u);const R=n.contains.find(U=>U.label==="func.def");return R.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function ul(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=t.inherit(c,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,d,u,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,s,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:p}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function fl(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,a]},u=t.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),C={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},$={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},R={begin:/\{/,end:/\}/,contains:[$],illegal:"\\n",relevance:0},U={begin:"\\[",end:"\\]",contains:[$],illegal:"\\n",relevance:0},I=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},C,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},R,U,c,s],_=[...I];return _.pop(),_.push(u),$.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:I}}const Ai={bash:Mi,sh:Mi,shell:Mi,css:Mf,go:jr,golang:jr,java:Af,javascript:Qr,js:Qr,json:zf,markdown:el,md:el,python:tl,py:tl,rust:nl,rs:nl,sql:If,typescript:dl,ts:dl,xml:ul,html:ul,yaml:fl,yml:fl};for(const[t,o]of Object.entries(Ai))Ci.registerLanguage(t,o);function jo(t){const o=t.split(`
|
|
61
61
|
`);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
|
|
62
|
-
`).replace(/\n+$/,"")}function
|
|
63
|
-
`)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&
|
|
64
|
-
`).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function
|
|
65
|
-
]`).replace("lheading",
|
|
66
|
-
`),n=o.length-1;for(;n>=0&&
|
|
67
|
-
`)}function
|
|
62
|
+
`).replace(/\n+$/,"")}function Tn(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
|
|
63
|
+
`)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Ai[n]?n:""}function _i(t,o){const n=o&&Ai[o]?o:"";try{return n?Ci.highlight(t,{language:n,ignoreIllegals:!0}).value:Ci.highlightAuto(t).value}catch{return Of(t)}}function Ri(t){return t.split(`
|
|
64
|
+
`).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function Of(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Bi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Cn=Bi();function ml(t){Cn=t}var Mn={exec:()=>null};function Fn(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),a=o[i];return a||(a=t(i),o[i]=a),a}}function Be(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(a,c)=>{let s=typeof c=="string"?c:c.source;return s=s.replace(dt.caret,"$1"),n=n.replace(a,s),i},getRegex:()=>new RegExp(n,o)};return i}var Df=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),dt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Fn(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Fn(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Fn(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Fn(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Fn(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Fn(t=>new RegExp(`^ {0,${t}}>`))},Vf=/^(?:[ \t]*(?:\n|$))+/,$f=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Pf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,so=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ff=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,vi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hl=Be(pl).replace(/bull/g,vi).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=Be(pl).replace(/bull/g,vi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Hf=/^[^\n]+/,Ii=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Wf=Be(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ii).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gf=Be(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,vi).getRegex(),Ko="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Li=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,jf=Be("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Li).replace("tag",Ko).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),gl=Be(zi).replace("hr",so).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ko).getRegex(),Kf=Be(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",gl).getRegex(),Oi={blockquote:Kf,code:$f,def:Wf,fences:Pf,heading:Ff,hr:so,html:jf,lheading:hl,list:Gf,newline:Vf,paragraph:gl,table:Mn,text:Hf},bl=Be("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",so).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ko).getRegex(),Yf={...Oi,lheading:Uf,table:bl,paragraph:Be(zi).replace("hr",so).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",bl).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ko).getRegex()},qf={...Oi,html:Be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Li).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:Be(zi).replace("hr",so).replace("heading",` *#{1,6} *[^
|
|
65
|
+
]`).replace("lheading",hl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Xf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Zf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,kl=/^( {2,}|\\)\n(?!\s*$)/,Jf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Un=/[\p{P}\p{S}]/u,Yo=/[\s\p{P}\p{S}]/u,Di=/[^\s\p{P}\p{S}]/u,Qf=Be(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Yo).getRegex(),yl=/(?!~)[\p{P}\p{S}]/u,em=/(?!~)[\s\p{P}\p{S}]/u,tm=/(?:[^\s\p{P}\p{S}]|~)/u,nm=Be(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Df?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),xl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,om=Be(xl,"u").replace(/punct/g,Un).getRegex(),im=Be(xl,"u").replace(/punct/g,yl).getRegex(),El="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",rm=Be(El,"gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Yo).replace(/punct/g,Un).getRegex(),lm=Be(El,"gu").replace(/notPunctSpace/g,tm).replace(/punctSpace/g,em).replace(/punct/g,yl).getRegex(),am=Be("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Yo).replace(/punct/g,Un).getRegex(),sm=Be(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Un).getRegex(),cm="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",dm=Be(cm,"gu").replace(/notPunctSpace/g,Di).replace(/punctSpace/g,Yo).replace(/punct/g,Un).getRegex(),um=Be(/\\(punct)/,"gu").replace(/punct/g,Un).getRegex(),fm=Be(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),mm=Be(Li).replace("(?:-->|$)","-->").getRegex(),pm=Be("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",mm).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),qo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,hm=Be(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",qo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wl=Be(/^!?\[(label)\]\[(ref)\]/).replace("label",qo).replace("ref",Ii).getRegex(),Nl=Be(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ii).getRegex(),gm=Be("reflink|nolink(?!\\()","g").replace("reflink",wl).replace("nolink",Nl).getRegex(),Sl=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Vi={_backpedal:Mn,anyPunctuation:um,autolink:fm,blockSkip:nm,br:kl,code:Zf,del:Mn,delLDelim:Mn,delRDelim:Mn,emStrongLDelim:om,emStrongRDelimAst:rm,emStrongRDelimUnd:am,escape:Xf,link:hm,nolink:Nl,punctuation:Qf,reflink:wl,reflinkSearch:gm,tag:pm,text:Jf,url:Mn},bm={...Vi,link:Be(/^!?\[(label)\]\((.*?)\)/).replace("label",qo).getRegex(),reflink:Be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",qo).getRegex()},$i={...Vi,emStrongRDelimAst:lm,emStrongLDelim:im,delLDelim:sm,delRDelim:dm,url:Be(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Sl).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Be(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Sl).getRegex()},km={...$i,br:Be(kl).replace("{2,}","*").getRegex(),text:Be($i.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xo={normal:Oi,gfm:Yf,pedantic:qf},co={normal:Vi,gfm:$i,breaks:km,pedantic:bm},ym={"&":"&","<":"<",">":">",'"':""","'":"'"},Tl=t=>ym[t];function Zt(t,o){if(o){if(dt.escapeTest.test(t))return t.replace(dt.escapeReplace,Tl)}else if(dt.escapeTestNoEncode.test(t))return t.replace(dt.escapeReplaceNoEncode,Tl);return t}function Cl(t){try{t=encodeURI(t).replace(dt.percentDecode,"%")}catch{return null}return t}function Ml(t,o){var c;let n=t.replace(dt.findPipe,(s,u,d)=>{let p=!1,h=u;for(;--h>=0&&d[h]==="\\";)p=!p;return p?"|":" |"}),i=n.split(dt.splitPipe),a=0;if(i[0].trim()||i.shift(),i.length>0&&!((c=i.at(-1))!=null&&c.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;a<i.length;a++)i[a]=i[a].trim().replace(dt.slashPipe,"|");return i}function hn(t,o,n){let i=t.length;if(i===0)return"";let a=0;for(;a<i&&t.charAt(i-a-1)===o;)a++;return t.slice(0,i-a)}function Al(t){let o=t.split(`
|
|
66
|
+
`),n=o.length-1;for(;n>=0&&dt.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
|
|
67
|
+
`)}function xm(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 Em(t,o=0){let n=o,i="";for(let a of t)if(a===" "){let c=4-n%4;i+=" ".repeat(c),n+=c}else i+=a,n++;return i}function _l(t,o,n,i,a){let c=o.href,s=o.title||null,u=t[1].replace(a.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:c,title:s,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,d}function wm(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let a=i[1];return o.split(`
|
|
68
68
|
`).map(c=>{let s=c.match(n.other.beginningSpace);if(s===null)return c;let[u]=s;return u.length>=a.length?c.slice(a.length):c}).join(`
|
|
69
|
-
`)}var
|
|
70
|
-
`),depth:o[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:
|
|
71
|
-
`)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=
|
|
69
|
+
`)}var Zo=class{constructor(t){He(this,"options");He(this,"rules");He(this,"lexer");this.options=t||Cn}space(t){let o=this.rules.block.newline.exec(t);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(t){let o=this.rules.block.code.exec(t);if(o){let n=this.options.pedantic?o[0]:Al(o[0]),i=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:i}}}fences(t){let o=this.rules.block.fences.exec(t);if(o){let n=o[0],i=wm(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=hn(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:hn(o[0],`
|
|
70
|
+
`),depth:o[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:hn(o[0],`
|
|
71
|
+
`)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=hn(o[0],`
|
|
72
72
|
`).split(`
|
|
73
73
|
`),i="",a="",c=[];for(;n.length>0;){let s=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),s=!0;else if(!s)u.push(n[d]);else break;n=n.slice(d);let p=u.join(`
|
|
74
74
|
`),h=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
75
75
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
76
76
|
${p}`:p,a=a?`${a}
|
|
77
|
-
${h}`:h;let
|
|
77
|
+
${h}`:h;let w=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,c,!0),this.lexer.state.top=w,n.length===0)break;let C=c.at(-1);if((C==null?void 0:C.type)==="code")break;if((C==null?void 0:C.type)==="blockquote"){let $=C,R=$.raw+`
|
|
78
78
|
`+n.join(`
|
|
79
|
-
`),
|
|
79
|
+
`),U=this.blockquote(R);c[c.length-1]=U,i=i.substring(0,i.length-$.raw.length)+U.raw,a=a.substring(0,a.length-$.text.length)+U.text;break}else if((C==null?void 0:C.type)==="list"){let $=C,R=$.raw+`
|
|
80
80
|
`+n.join(`
|
|
81
|
-
`),
|
|
82
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:c,text:a}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,p="",h="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;p=o[0],t=t.substring(p.length);let
|
|
81
|
+
`),U=this.list(R);c[c.length-1]=U,i=i.substring(0,i.length-C.raw.length)+U.raw,a=a.substring(0,a.length-$.raw.length)+U.raw,n=R.substring(c.at(-1).raw.length).split(`
|
|
82
|
+
`);continue}}return{type:"blockquote",raw:i,tokens:c,text:a}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let c=this.rules.other.listItemRegex(n),s=!1;for(;t;){let d=!1,p="",h="";if(!(o=c.exec(t))||this.rules.block.hr.test(t))break;p=o[0],t=t.substring(p.length);let w=Em(o[2].split(`
|
|
83
83
|
`,1)[0],o[1].length),C=t.split(`
|
|
84
|
-
`,1)[0],$=!
|
|
85
|
-
`,t=t.substring(C.length+1),d=!0),!d){let
|
|
86
|
-
`,1)[0],
|
|
87
|
-
`+
|
|
84
|
+
`,1)[0],$=!w.trim(),R=0;if(this.options.pedantic?(R=2,h=w.trimStart()):$?R=o[1].length+1:(R=w.search(this.rules.other.nonSpaceChar),R=R>4?1:R,h=w.slice(R),R+=o[1].length),$&&this.rules.other.blankLine.test(C)&&(p+=C+`
|
|
85
|
+
`,t=t.substring(C.length+1),d=!0),!d){let U=this.rules.other.nextBulletRegex(R),I=this.rules.other.hrRegex(R),_=this.rules.other.fencesBeginRegex(R),y=this.rules.other.headingBeginRegex(R),k=this.rules.other.htmlBeginRegex(R),m=this.rules.other.blockquoteBeginRegex(R);for(;t;){let P=t.split(`
|
|
86
|
+
`,1)[0],j;if(C=P,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),j=C):j=C.replace(this.rules.other.tabCharGlobal," "),_.test(C)||y.test(C)||k.test(C)||m.test(C)||U.test(C)||I.test(C))break;if(j.search(this.rules.other.nonSpaceChar)>=R||!C.trim())h+=`
|
|
87
|
+
`+j.slice(R);else{if($||w.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(w)||y.test(w)||I.test(w))break;h+=`
|
|
88
88
|
`+C}$=!C.trim(),p+=P+`
|
|
89
|
-
`,t=t.substring(P.length+1),
|
|
90
|
-
`),href:i,title:a}}}table(t){var s;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=
|
|
91
|
-
`):[],c={type:"table",raw:
|
|
92
|
-
`),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?c.align.push("right"):this.rules.other.tableAlignCenter.test(u)?c.align.push("center"):this.rules.other.tableAlignLeft.test(u)?c.align.push("left"):c.align.push(null);for(let u=0;u<n.length;u++)c.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:c.align[u]});for(let u of a)c.rows.push(
|
|
89
|
+
`,t=t.substring(P.length+1),w=j.slice(R)}}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(s=!0)),a.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]}),a.raw+=p}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let d of a.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let p=d.tokens[0];if(d.task&&((p==null?void 0:p.type)==="text"||(p==null?void 0:p.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let 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 h=this.rules.other.listTaskCheckbox.exec(d.raw);if(h){let w={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};d.checked=w.checked,a.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=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(!a.loose){let h=d.tokens.filter(C=>C.type==="space"),w=h.length>0&&h.some(C=>this.rules.other.anyLine.test(C.raw));a.loose=w}}if(a.loose)for(let d of a.items){d.loose=!0;for(let p of d.tokens)p.type==="text"&&(p.type="paragraph")}return a}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=Al(o[0]);return{type:"html",block:!0,raw:n,pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:n}}}def(t){let o=this.rules.block.def.exec(t);if(o){let n=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:hn(o[0],`
|
|
90
|
+
`),href:i,title:a}}}table(t){var s;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=Ml(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=(s=o[3])!=null&&s.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
91
|
+
`):[],c={type:"table",raw:hn(o[0],`
|
|
92
|
+
`),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?c.align.push("right"):this.rules.other.tableAlignCenter.test(u)?c.align.push("center"):this.rules.other.tableAlignLeft.test(u)?c.align.push("left"):c.align.push(null);for(let u=0;u<n.length;u++)c.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:c.align[u]});for(let u of a)c.rows.push(Ml(u,c.header.length).map((d,p)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:c.align[p]})));return c}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:hn(o[0],`
|
|
93
93
|
`),depth:o[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let o=this.rules.block.paragraph.exec(t);if(o){let n=o[1].charAt(o[1].length-1)===`
|
|
94
|
-
`?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let c=
|
|
95
|
-
`),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],i=!1){var c,s,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(
|
|
94
|
+
`?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let c=hn(n.slice(0,-1),"\\");if((n.length-c.length)%2===0)return}else{let c=xm(o[2],"()");if(c===-2)return;if(c>-1){let s=(o[0].indexOf("!")===0?5:4)+o[1].length+c;o[2]=o[2].substring(0,c),o[0]=o[0].substring(0,s).trim(),o[3]=""}}let i=o[2],a="";if(this.options.pedantic){let c=this.rules.other.pedanticHrefTitle.exec(i);c&&(i=c[1],a=c[3])}else a=o[3]?o[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),_l(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(t,o){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=o[i.toLowerCase()];if(!a){let c=n[0].charAt(0);return{type:"text",raw:c,text:c}}return _l(n,a,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,u=a,d=0,p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,o=o.slice(-1*t.length+a);(i=p.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c)continue;if(s=[...c].length,i[3]||i[4]){u+=s;continue}else if((i[5]||i[6])&&a%3&&!((a+s)%3)){d+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u+d);let h=[...i[0]][0].length,w=t.slice(0,a+i.index+h+s);if(Math.min(a,s)%2){let $=w.slice(1,-1);return{type:"em",raw:w,text:$,tokens:this.lexer.inlineTokens($)}}let C=w.slice(2,-2);return{type:"strong",raw:w,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),a=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&a&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:o[0],text:n}}}br(t){let o=this.rules.inline.br.exec(t);if(o)return{type:"br",raw:o[0]}}del(t,o,n=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let a=[...i[0]].length-1,c,s,u=a,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+a);(i=d.exec(o))!==null;){if(c=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!c||(s=[...c].length,s!==a))continue;if(i[3]||i[4]){u+=s;continue}if(u-=s,u>0)continue;s=Math.min(s,s+u);let p=[...i[0]][0].length,h=t.slice(0,a+i.index+p+s),w=h.slice(a,-a);return{type:"del",raw:h,text:w,tokens:this.lexer.inlineTokens(w)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,i;return o[2]==="@"?(n=o[1],i="mailto:"+n):(n=o[1],i=n),{type:"link",raw:o[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let i,a;if(o[2]==="@")i=o[0],a="mailto:"+i;else{let c;do c=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(c!==o[0]);i=o[0],o[1]==="www."?a="http://"+o[0]:a=o[0]}return{type:"link",raw:o[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let o=this.rules.inline.text.exec(t);if(o){let n=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:n}}}},Gt=class lr{constructor(o){He(this,"tokens");He(this,"options");He(this,"state");He(this,"inlineQueue");He(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Cn,this.options.tokenizer=this.options.tokenizer||new Zo,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:dt,block:Xo.normal,inline:co.normal};this.options.pedantic?(n.block=Xo.pedantic,n.inline=co.pedantic):this.options.gfm&&(n.block=Xo.gfm,this.options.breaks?n.inline=co.breaks:n.inline=co.gfm),this.tokenizer.rules=n}static get rules(){return{block:Xo,inline:co}}static lex(o,n){return new lr(n).lex(o)}static lexInline(o,n){return new lr(n).inlineTokens(o)}lex(o){o=o.replace(dt.carriageReturn,`
|
|
95
|
+
`),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],i=!1){var c,s,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(dt.tabCharGlobal," ").replace(dt.spaceLine,""));let a=1/0;for(;o;){if(o.length<a)a=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((s=(c=this.options.extensions)==null?void 0:c.block)!=null&&s.some(h=>(d=h.call({lexer:this},o,n))?(o=o.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.space(o)){o=o.substring(d.raw.length);let h=n.at(-1);d.raw.length===1&&h!==void 0?h.raw+=`
|
|
96
96
|
`:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
97
97
|
`)?"":`
|
|
98
98
|
`)+d.raw,h.text+=`
|
|
99
99
|
`+d.text,this.inlineQueue.at(-1).src=h.text):n.push(d);continue}if(d=this.tokenizer.fences(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.heading(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.hr(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.blockquote(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.list(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.html(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.def(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
100
100
|
`)?"":`
|
|
101
101
|
`)+d.raw,h.text+=`
|
|
102
|
-
`+d.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let p=o;if((u=this.options.extensions)!=null&&u.startBlock){let h=1/0,
|
|
102
|
+
`+d.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let p=o;if((u=this.options.extensions)!=null&&u.startBlock){let h=1/0,w=o.slice(1),C;this.options.extensions.startBlock.forEach($=>{C=$.call({lexer:this},w),typeof C=="number"&&C>=0&&(h=Math.min(h,C))}),h<1/0&&h>=0&&(p=o.substring(0,h+1))}if(this.state.top&&(d=this.tokenizer.paragraph(p))){let h=n.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=(h.raw.endsWith(`
|
|
103
103
|
`)?"":`
|
|
104
104
|
`)+d.raw,h.text+=`
|
|
105
105
|
`+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d),i=p.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=(h.raw.endsWith(`
|
|
106
106
|
`)?"":`
|
|
107
107
|
`)+d.raw,h.text+=`
|
|
108
|
-
`+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var p,h,
|
|
109
|
-
`;return i?'<pre><code class="language-'+
|
|
110
|
-
`:"<pre><code>"+(n?a:
|
|
108
|
+
`+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var p,h,w,C,$;this.tokenizer.lexer=this;let i=o,a=null;if(this.tokens.links){let R=Object.keys(this.tokens.links);if(R.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)R.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,a.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let c;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)c=a[2]?a[2].length:0,i=i.slice(0,a.index+c)+"["+"a".repeat(a[0].length-c-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((h=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:h.call({lexer:this},i))??i;let s=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}s||(u=""),s=!1;let R;if((C=(w=this.options.extensions)==null?void 0:w.inline)!=null&&C.some(I=>(R=I.call({lexer:this},o,n))?(o=o.substring(R.raw.length),n.push(R),!0):!1))continue;if(R=this.tokenizer.escape(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.tag(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.link(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(R.raw.length);let I=n.at(-1);R.type==="text"&&(I==null?void 0:I.type)==="text"?(I.raw+=R.raw,I.text+=R.text):n.push(R);continue}if(R=this.tokenizer.emStrong(o,i,u)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.codespan(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.br(o)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.del(o,i,u)){o=o.substring(R.raw.length),n.push(R);continue}if(R=this.tokenizer.autolink(o)){o=o.substring(R.raw.length),n.push(R);continue}if(!this.state.inLink&&(R=this.tokenizer.url(o))){o=o.substring(R.raw.length),n.push(R);continue}let U=o;if(($=this.options.extensions)!=null&&$.startInline){let I=1/0,_=o.slice(1),y;this.options.extensions.startInline.forEach(k=>{y=k.call({lexer:this},_),typeof y=="number"&&y>=0&&(I=Math.min(I,y))}),I<1/0&&I>=0&&(U=o.substring(0,I+1))}if(R=this.tokenizer.inlineText(U)){o=o.substring(R.raw.length),R.raw.slice(-1)!=="_"&&(u=R.raw.slice(-1)),s=!0;let I=n.at(-1);(I==null?void 0:I.type)==="text"?(I.raw+=R.raw,I.text+=R.text):n.push(R);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return n}infiniteLoopError(o){let n="Infinite loop on byte: "+o;if(this.options.silent)console.error(n);else throw new Error(n)}},uo=class{constructor(t){He(this,"options");He(this,"parser");this.options=t||Cn}space(t){return""}code({text:t,lang:o,escaped:n}){var c;let i=(c=(o||"").match(dt.notSpaceStart))==null?void 0:c[0],a=t.replace(dt.endingNewline,"")+`
|
|
109
|
+
`;return i?'<pre><code class="language-'+Zt(i)+'">'+(n?a:Zt(a,!0))+`</code></pre>
|
|
110
|
+
`:"<pre><code>"+(n?a:Zt(a,!0))+`</code></pre>
|
|
111
111
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
112
112
|
${this.parser.parse(t)}</blockquote>
|
|
113
113
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
|
|
@@ -123,20 +123,20 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
123
123
|
`}tablerow({text:t}){return`<tr>
|
|
124
124
|
${t}</tr>
|
|
125
125
|
`}tablecell(t){let o=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+o+`</${n}>
|
|
126
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${
|
|
127
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+
|
|
128
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wm(t,o){return ym(t)||Em(t,o)||Nm(t,o)||xm()}function Nm(t,o){if(t){if(typeof t=="string")return _l(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)?_l(t,o):void 0}}const Rl=Object.entries,Bl=Object.setPrototypeOf,Sm=Object.isFrozen,Tm=Object.getPrototypeOf,Cm=Object.getOwnPropertyDescriptor;let gt=Object.freeze,Lt=Object.seal,Un=Object.create,vl=typeof Reflect<"u"&&Reflect,$i=vl.apply,Pi=vl.construct;gt||(gt=function(o){return o}),Lt||(Lt=function(o){return o}),$i||($i=function(o,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),c=2;c<i;c++)a[c-2]=arguments[c];return o.apply(n,a)}),Pi||(Pi=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return new o(...i)});const Cn=Je(Array.prototype.forEach),Mm=Je(Array.prototype.lastIndexOf),Il=Je(Array.prototype.pop),Hn=Je(Array.prototype.push),Am=Je(Array.prototype.splice),bt=Array.isArray,fo=Je(String.prototype.toLowerCase),Fi=Je(String.prototype.toString),zl=Je(String.prototype.match),Wn=Je(String.prototype.replace),Ol=Je(String.prototype.indexOf),_m=Je(String.prototype.trim),Rm=Je(Number.prototype.toString),Bm=Je(Boolean.prototype.toString),Ll=typeof BigInt>"u"?null:Je(BigInt.prototype.toString),Dl=typeof Symbol>"u"?null:Je(Symbol.prototype.toString),Ge=Je(Object.prototype.hasOwnProperty),mo=Je(Object.prototype.toString),rt=Je(RegExp.prototype.test),Gn=vm(TypeError);function Je(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return $i(t,o,i)}}function vm(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Pi(t,n)}}function Ne(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo;if(Bl&&Bl(t,null),!bt(o))return t;let i=o.length;for(;i--;){let a=o[i];if(typeof a=="string"){const c=n(a);c!==a&&(Sm(o)||(o[i]=c),a=c)}t[a]=!0}return t}function Im(t){for(let o=0;o<t.length;o++)Ge(t,o)||(t[o]=null);return t}function dt(t){const o=Un(null);for(const i of Rl(t)){var n=wm(i,2);const a=n[0],c=n[1];Ge(t,a)&&(bt(c)?o[a]=Im(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=dt(c):o[a]=c)}return o}function zm(t){switch(typeof t){case"string":return t;case"number":return Rm(t);case"boolean":return Bm(t);case"bigint":return Ll?Ll(t):"0";case"symbol":return Dl?Dl(t):"Symbol()";case"undefined":return mo(t);case"function":case"object":{if(t===null)return mo(t);const o=t,n=Xt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:mo(i)}return mo(t)}default:return mo(t)}}function Xt(t,o){for(;t!==null;){const i=Cm(t,o);if(i){if(i.get)return Je(i.get);if(typeof i.value=="function")return Je(i.value)}t=Tm(t)}function n(){return null}return n}function Om(t){try{return rt(t,""),!0}catch{return!1}}const Vl=gt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ui=gt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Hi=gt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Lm=gt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Wi=gt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Dm=gt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$l=gt(["#text"]),Pl=gt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Gi=gt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Fl=gt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Zo=gt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Vm=Lt(/{{[\w\W]*|^[\w\W]*}}/g),$m=Lt(/<%[\w\W]*|^[\w\W]*%>/g),Pm=Lt(/\${[\w\W]*/g),Fm=Lt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Um=Lt(/^aria-[\-\w]+$/),Ul=Lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hm=Lt(/^(?:\w+script|data):/i),Wm=Lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Gm=Lt(/^html$/i),jm=Lt(/^[a-z][.\w]*(-[.\w]+)+$/i),Zt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Km=function(){return typeof window>"u"?null:window},Ym=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(i=n.getAttribute(a));const c="dompurify"+(i?"#"+i:"");try{return o.createPolicy(c,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Hl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Wl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Km();const o=_=>Wl(_);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Zt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,a=i.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,s=t.Node,u=t.Element,d=t.NodeFilter,p=t.NamedNodeMap;p===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,x=t.trustedTypes,C=u.prototype,$=Xt(C,"cloneNode"),R=Xt(C,"remove"),F=Xt(C,"nextSibling"),O=Xt(C,"childNodes"),A=Xt(C,"parentNode"),y=Xt(C,"shadowRoot"),k=Xt(C,"attributes"),m=s&&s.prototype?Xt(s.prototype,"nodeType"):null,P=s&&s.prototype?Xt(s.prototype,"nodeName"):null;if(typeof c=="function"){const _=n.createElement("template");_.content&&_.content.ownerDocument&&(n=_.content.ownerDocument)}let G,q="",w=0;const ie=function(g){if(w>0)throw Gn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');w++;try{return G.createHTML(g)}finally{w--}},fe=n,ce=fe.implementation,J=fe.createNodeIterator,me=fe.createDocumentFragment,ae=fe.getElementsByTagName,ke=i.importNode;let b=Hl();o.isSupported=typeof Rl=="function"&&typeof A=="function"&&ce&&ce.createHTMLDocument!==void 0;const V=Vm,W=$m,ee=Pm,ge=Fm,D=Um,z=Hm,le=Wm,be=jm;let I=Ul,N=null;const U=Ne({},[...Vl,...Ui,...Hi,...Wi,...$l]);let H=null;const oe=Ne({},[...Pl,...Gi,...Fl,...Zo]);let Ee=Object.seal(Un(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),et=null,ut=null;const tt=Object.seal(Un(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let nn=!0,nt=!0,on=!1,Dt=!0,ue=!1,ft=!0,ze=!1,Be=!1,Vt=!1,ot=!1,xt=!1,kt=!1,X=!0,re=!1;const xe="user-content-";let Ae=!0,Ue=!1,it={},wt=null;const An=Ne({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ti=null;const ni=Ne({},["audio","video","img","source","image","track"]);let po=null;const oi=Ne({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Kn="http://www.w3.org/1998/Math/MathML",Yn="http://www.w3.org/2000/svg",$t="http://www.w3.org/1999/xhtml";let pn=$t,ho=!1,go=null;const ji=Ne({},[Kn,Yn,$t],Fi);let bo=Ne({},["mi","mo","mn","ms","mtext"]),ko=Ne({},["annotation-xml"]);const Ki=Ne({},["title","style","font","a","script"]);let _n=null;const ii=["application/xhtml+xml","text/html"],Yi="text/html";let He=null,hn=null;const ri=n.createElement("form"),li=function(g){return g instanceof RegExp||g instanceof Function},qn=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(hn&&hn===g)return;(!g||typeof g!="object")&&(g={}),g=dt(g),_n=ii.indexOf(g.PARSER_MEDIA_TYPE)===-1?Yi:g.PARSER_MEDIA_TYPE,He=_n==="application/xhtml+xml"?Fi:fo,N=Ge(g,"ALLOWED_TAGS")&&bt(g.ALLOWED_TAGS)?Ne({},g.ALLOWED_TAGS,He):U,H=Ge(g,"ALLOWED_ATTR")&&bt(g.ALLOWED_ATTR)?Ne({},g.ALLOWED_ATTR,He):oe,go=Ge(g,"ALLOWED_NAMESPACES")&&bt(g.ALLOWED_NAMESPACES)?Ne({},g.ALLOWED_NAMESPACES,Fi):ji,po=Ge(g,"ADD_URI_SAFE_ATTR")&&bt(g.ADD_URI_SAFE_ATTR)?Ne(dt(oi),g.ADD_URI_SAFE_ATTR,He):oi,ti=Ge(g,"ADD_DATA_URI_TAGS")&&bt(g.ADD_DATA_URI_TAGS)?Ne(dt(ni),g.ADD_DATA_URI_TAGS,He):ni,wt=Ge(g,"FORBID_CONTENTS")&&bt(g.FORBID_CONTENTS)?Ne({},g.FORBID_CONTENTS,He):An,et=Ge(g,"FORBID_TAGS")&&bt(g.FORBID_TAGS)?Ne({},g.FORBID_TAGS,He):dt({}),ut=Ge(g,"FORBID_ATTR")&&bt(g.FORBID_ATTR)?Ne({},g.FORBID_ATTR,He):dt({}),it=Ge(g,"USE_PROFILES")?g.USE_PROFILES&&typeof g.USE_PROFILES=="object"?dt(g.USE_PROFILES):g.USE_PROFILES:!1,nn=g.ALLOW_ARIA_ATTR!==!1,nt=g.ALLOW_DATA_ATTR!==!1,on=g.ALLOW_UNKNOWN_PROTOCOLS||!1,Dt=g.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ue=g.SAFE_FOR_TEMPLATES||!1,ft=g.SAFE_FOR_XML!==!1,ze=g.WHOLE_DOCUMENT||!1,ot=g.RETURN_DOM||!1,xt=g.RETURN_DOM_FRAGMENT||!1,kt=g.RETURN_TRUSTED_TYPE||!1,Vt=g.FORCE_BODY||!1,X=g.SANITIZE_DOM!==!1,re=g.SANITIZE_NAMED_PROPS||!1,Ae=g.KEEP_CONTENT!==!1,Ue=g.IN_PLACE||!1,I=Om(g.ALLOWED_URI_REGEXP)?g.ALLOWED_URI_REGEXP:Ul,pn=typeof g.NAMESPACE=="string"?g.NAMESPACE:$t,bo=Ge(g,"MATHML_TEXT_INTEGRATION_POINTS")&&g.MATHML_TEXT_INTEGRATION_POINTS&&typeof g.MATHML_TEXT_INTEGRATION_POINTS=="object"?dt(g.MATHML_TEXT_INTEGRATION_POINTS):Ne({},["mi","mo","mn","ms","mtext"]),ko=Ge(g,"HTML_INTEGRATION_POINTS")&&g.HTML_INTEGRATION_POINTS&&typeof g.HTML_INTEGRATION_POINTS=="object"?dt(g.HTML_INTEGRATION_POINTS):Ne({},["annotation-xml"]);const L=Ge(g,"CUSTOM_ELEMENT_HANDLING")&&g.CUSTOM_ELEMENT_HANDLING&&typeof g.CUSTOM_ELEMENT_HANDLING=="object"?dt(g.CUSTOM_ELEMENT_HANDLING):Un(null);if(Ee=Un(null),Ge(L,"tagNameCheck")&&li(L.tagNameCheck)&&(Ee.tagNameCheck=L.tagNameCheck),Ge(L,"attributeNameCheck")&&li(L.attributeNameCheck)&&(Ee.attributeNameCheck=L.attributeNameCheck),Ge(L,"allowCustomizedBuiltInElements")&&typeof L.allowCustomizedBuiltInElements=="boolean"&&(Ee.allowCustomizedBuiltInElements=L.allowCustomizedBuiltInElements),ue&&(nt=!1),xt&&(ot=!0),it&&(N=Ne({},$l),H=Un(null),it.html===!0&&(Ne(N,Vl),Ne(H,Pl)),it.svg===!0&&(Ne(N,Ui),Ne(H,Gi),Ne(H,Zo)),it.svgFilters===!0&&(Ne(N,Hi),Ne(H,Gi),Ne(H,Zo)),it.mathMl===!0&&(Ne(N,Wi),Ne(H,Fl),Ne(H,Zo))),tt.tagCheck=null,tt.attributeCheck=null,Ge(g,"ADD_TAGS")&&(typeof g.ADD_TAGS=="function"?tt.tagCheck=g.ADD_TAGS:bt(g.ADD_TAGS)&&(N===U&&(N=dt(N)),Ne(N,g.ADD_TAGS,He))),Ge(g,"ADD_ATTR")&&(typeof g.ADD_ATTR=="function"?tt.attributeCheck=g.ADD_ATTR:bt(g.ADD_ATTR)&&(H===oe&&(H=dt(H)),Ne(H,g.ADD_ATTR,He))),Ge(g,"ADD_URI_SAFE_ATTR")&&bt(g.ADD_URI_SAFE_ATTR)&&Ne(po,g.ADD_URI_SAFE_ATTR,He),Ge(g,"FORBID_CONTENTS")&&bt(g.FORBID_CONTENTS)&&(wt===An&&(wt=dt(wt)),Ne(wt,g.FORBID_CONTENTS,He)),Ge(g,"ADD_FORBID_CONTENTS")&&bt(g.ADD_FORBID_CONTENTS)&&(wt===An&&(wt=dt(wt)),Ne(wt,g.ADD_FORBID_CONTENTS,He)),Ae&&(N["#text"]=!0),ze&&Ne(N,["html","head","body"]),N.table&&(Ne(N,["tbody"]),delete et.tbody),g.TRUSTED_TYPES_POLICY){if(typeof g.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof g.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Z=G;G=g.TRUSTED_TYPES_POLICY;try{q=ie("")}catch(ve){throw G=Z,ve}}else G===void 0&&g.TRUSTED_TYPES_POLICY!==null&&(G=Ym(x,a)),G&&typeof q=="string"&&(q=ie(""));(b.uponSanitizeElement.length>0||b.uponSanitizeAttribute.length>0)&&N===U&&(N=dt(N)),b.uponSanitizeAttribute.length>0&&H===oe&&(H=dt(H)),gt&>(g),hn=g},yo=Ne({},[...Ui,...Hi,...Lm]),gn=Ne({},[...Wi,...Dm]),qi=function(g){let L=A(g);(!L||!L.tagName)&&(L={namespaceURI:pn,tagName:"template"});const Z=fo(g.tagName),ve=fo(L.tagName);return go[g.namespaceURI]?g.namespaceURI===Yn?L.namespaceURI===$t?Z==="svg":L.namespaceURI===Kn?Z==="svg"&&(ve==="annotation-xml"||bo[ve]):!!yo[Z]:g.namespaceURI===Kn?L.namespaceURI===$t?Z==="math":L.namespaceURI===Yn?Z==="math"&&ko[ve]:!!gn[Z]:g.namespaceURI===$t?L.namespaceURI===Yn&&!ko[ve]||L.namespaceURI===Kn&&!bo[ve]?!1:!gn[Z]&&(Ki[Z]||!yo[Z]):!!(_n==="application/xhtml+xml"&&go[g.namespaceURI]):!1},Mt=function(g){Hn(o.removed,{element:g});try{A(g).removeChild(g)}catch{R(g)}},Jt=function(g,L){try{Hn(o.removed,{attribute:L.getAttributeNode(g),from:L})}catch{Hn(o.removed,{attribute:null,from:L})}if(L.removeAttribute(g),g==="is")if(ot||xt)try{Mt(L)}catch{}else try{L.setAttribute(g,"")}catch{}},Eo=function(g){let L=null,Z=null;if(Vt)g="<remove></remove>"+g;else{const Le=zl(g,/^[\r\n\t ]+/);Z=Le&&Le[0]}_n==="application/xhtml+xml"&&pn===$t&&(g='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+g+"</body></html>");const ve=G?ie(g):g;if(pn===$t)try{L=new h().parseFromString(ve,_n)}catch{}if(!L||!L.documentElement){L=ce.createDocument(pn,"template",null);try{L.documentElement.innerHTML=ho?q:ve}catch{}}const we=L.body||L.documentElement;return g&&Z&&we.insertBefore(n.createTextNode(Z),we.childNodes[0]||null),pn===$t?ae.call(L,ze?"html":"body")[0]:ze?L.documentElement:we},Xn=function(g){return J.call(g.ownerDocument||g,g,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Rn=function(g){var L,Z;g.normalize();const ve=J.call(g.ownerDocument||g,g,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let we=ve.nextNode();for(;we;){let Xe=we.data;Cn([V,W,ee],yt=>{Xe=Wn(Xe,yt," ")}),we.data=Xe,we=ve.nextNode()}const Le=(L=(Z=g.querySelectorAll)===null||Z===void 0?void 0:Z.call(g,"template"))!==null&&L!==void 0?L:[];Cn(Array.from(Le),Xe=>{bn(Xe.content)&&Rn(Xe.content)})},Zn=function(g){const L=P?P(g):null;return typeof L!="string"||He(L)!=="form"?!1:typeof g.nodeName!="string"||typeof g.textContent!="string"||typeof g.removeChild!="function"||g.attributes!==k(g)||typeof g.removeAttribute!="function"||typeof g.setAttribute!="function"||typeof g.namespaceURI!="string"||typeof g.insertBefore!="function"||typeof g.hasChildNodes!="function"||g.nodeType!==m(g)||g.childNodes!==O(g)},bn=function(g){if(!m||typeof g!="object"||g===null)return!1;try{return m(g)===Zt.documentFragment}catch{return!1}},Jn=function(g){if(!m||typeof g!="object"||g===null)return!1;try{return typeof m(g)=="number"}catch{return!1}};function At(_,g,L){Cn(_,Z=>{Z.call(o,g,L,hn)})}const Qn=function(g){let L=null;if(At(b.beforeSanitizeElements,g,null),Zn(g))return Mt(g),!0;const Z=He(P?P(g):g.nodeName);if(At(b.uponSanitizeElement,g,{tagName:Z,allowedTags:N}),ft&&g.hasChildNodes()&&!Jn(g.firstElementChild)&&rt(/<[/\w!]/g,g.innerHTML)&&rt(/<[/\w!]/g,g.textContent)||ft&&g.namespaceURI===$t&&Z==="style"&&Jn(g.firstElementChild)||g.nodeType===Zt.progressingInstruction||ft&&g.nodeType===Zt.comment&&rt(/<[/\w]/g,g.data))return Mt(g),!0;if(et[Z]||!(tt.tagCheck instanceof Function&&tt.tagCheck(Z))&&!N[Z]){if(!et[Z]&&Se(Z)&&(Ee.tagNameCheck instanceof RegExp&&rt(Ee.tagNameCheck,Z)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(Z)))return!1;if(Ae&&!wt[Z]){const we=A(g),Le=O(g);if(Le&&we){const Xe=Le.length;for(let yt=Xe-1;yt>=0;--yt){const mt=$(Le[yt],!0);we.insertBefore(mt,F(g))}}}return Mt(g),!0}return(m?m(g):g.nodeType)===Zt.element&&!qi(g)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&&rt(/<\/no(script|embed|frames)/i,g.innerHTML)?(Mt(g),!0):(ue&&g.nodeType===Zt.text&&(L=g.textContent,Cn([V,W,ee],we=>{L=Wn(L,we," ")}),g.textContent!==L&&(Hn(o.removed,{element:g.cloneNode()}),g.textContent=L)),At(b.afterSanitizeElements,g,null),!1)},Gt=function(g,L,Z){if(ut[L]||X&&(L==="id"||L==="name")&&(Z in n||Z in ri))return!1;const ve=H[L]||tt.attributeCheck instanceof Function&&tt.attributeCheck(L,g);if(!(nt&&!ut[L]&&rt(ge,L))){if(!(nn&&rt(D,L))){if(!ve||ut[L]){if(!(Se(g)&&(Ee.tagNameCheck instanceof RegExp&&rt(Ee.tagNameCheck,g)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(g))&&(Ee.attributeNameCheck instanceof RegExp&&rt(Ee.attributeNameCheck,L)||Ee.attributeNameCheck instanceof Function&&Ee.attributeNameCheck(L,g))||L==="is"&&Ee.allowCustomizedBuiltInElements&&(Ee.tagNameCheck instanceof RegExp&&rt(Ee.tagNameCheck,Z)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(Z))))return!1}else if(!po[L]){if(!rt(I,Wn(Z,le,""))){if(!((L==="src"||L==="xlink:href"||L==="href")&&g!=="script"&&Ol(Z,"data:")===0&&ti[g])){if(!(on&&!rt(z,Wn(Z,le,"")))){if(Z)return!1}}}}}}return!0},Oe=Ne({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Se=function(g){return!Oe[fo(g)]&&rt(be,g)},ai=function(g){At(b.beforeSanitizeAttributes,g,null);const L=g.attributes;if(!L||Zn(g))return;const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let ve=L.length;for(;ve--;){const we=L[ve],Le=we.name,Xe=we.namespaceURI,yt=we.value,mt=He(Le),xo=yt;let Ze=Le==="value"?xo:_m(xo);if(Z.attrName=mt,Z.attrValue=Ze,Z.keepAttr=!0,Z.forceKeepAttr=void 0,At(b.uponSanitizeAttribute,g,Z),Ze=Z.attrValue,re&&(mt==="id"||mt==="name")&&Ol(Ze,xe)!==0&&(Jt(Le,g),Ze=xe+Ze),ft&&rt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ze)){Jt(Le,g);continue}if(mt==="attributename"&&zl(Ze,"href")){Jt(Le,g);continue}if(Z.forceKeepAttr)continue;if(!Z.keepAttr){Jt(Le,g);continue}if(!Dt&&rt(/\/>/i,Ze)){Jt(Le,g);continue}ue&&Cn([V,W,ee],wo=>{Ze=Wn(Ze,wo," ")});const en=He(g.nodeName);if(!Gt(en,mt,Ze)){Jt(Le,g);continue}if(G&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!Xe)switch(x.getAttributeType(en,mt)){case"TrustedHTML":{Ze=ie(Ze);break}case"TrustedScriptURL":{Ze=G.createScriptURL(Ze);break}}if(Ze!==xo)try{Xe?g.setAttributeNS(Xe,Le,Ze):g.setAttribute(Le,Ze),Zn(g)?Mt(g):Il(o.removed)}catch{Jt(Le,g)}}At(b.afterSanitizeAttributes,g,null)},lt=function(g){let L=null;const Z=Xn(g);for(At(b.beforeSanitizeShadowDOM,g,null);L=Z.nextNode();)if(At(b.uponSanitizeShadowNode,L,null),Qn(L),ai(L),bn(L.content)&<(L.content),(m?m(L):L.nodeType)===Zt.element){const we=y?y(L):L.shadowRoot;bn(we)&&(Qt(we),lt(we))}At(b.afterSanitizeShadowDOM,g,null)},Qt=function(g){const L=m?m(g):g.nodeType;if(L===Zt.element){const we=y?y(g):g.shadowRoot;bn(we)&&(Qt(we),lt(we))}const Z=O?O(g):g.childNodes;if(!Z)return;const ve=[];Cn(Z,we=>{Hn(ve,we)});for(const we of ve)Qt(we);if(L===Zt.element){const we=P?P(g):null;if(typeof we=="string"&&He(we)==="template"){const Le=g.content;bn(Le)&&Qt(Le)}}};return o.sanitize=function(_){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=null,Z=null,ve=null,we=null;if(ho=!_,ho&&(_="<!-->"),typeof _!="string"&&!Jn(_)&&(_=zm(_),typeof _!="string"))throw Gn("dirty is not a string, aborting");if(!o.isSupported)return _;if(Be||qn(g),o.removed=[],typeof _=="string"&&(Ue=!1),Ue){const yt=P?P(_):_.nodeName;if(typeof yt=="string"){const mt=He(yt);if(!N[mt]||et[mt])throw Gn("root node is forbidden and cannot be sanitized in-place")}if(Zn(_))throw Gn("root node is clobbered and cannot be sanitized in-place");Qt(_)}else if(Jn(_))L=Eo("<!---->"),Z=L.ownerDocument.importNode(_,!0),Z.nodeType===Zt.element&&Z.nodeName==="BODY"||Z.nodeName==="HTML"?L=Z:L.appendChild(Z),Qt(Z);else{if(!ot&&!ue&&!ze&&_.indexOf("<")===-1)return G&&kt?ie(_):_;if(L=Eo(_),!L)return ot?null:kt?q:""}L&&Vt&&Mt(L.firstChild);const Le=Xn(Ue?_:L);for(;ve=Le.nextNode();)Qn(ve),ai(ve),bn(ve.content)&<(ve.content);if(Ue)return ue&&Rn(_),_;if(ot){if(ue&&Rn(L),xt)for(we=me.call(L.ownerDocument);L.firstChild;)we.appendChild(L.firstChild);else we=L;return(H.shadowroot||H.shadowrootmode)&&(we=ke.call(i,we,!0)),we}let Xe=ze?L.outerHTML:L.innerHTML;return ze&&N["!doctype"]&&L.ownerDocument&&L.ownerDocument.doctype&&L.ownerDocument.doctype.name&&rt(Gm,L.ownerDocument.doctype.name)&&(Xe="<!DOCTYPE "+L.ownerDocument.doctype.name+`>
|
|
129
|
-
`+Xe),ue&&Cn([V,W,ee],yt=>{Xe=Wn(Xe,yt," ")}),G&&kt?ie(Xe):Xe},o.setConfig=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qn(_),Be=!0},o.clearConfig=function(){hn=null,Be=!1},o.isValidAttribute=function(_,g,L){hn||qn({});const Z=He(_),ve=He(g);return Gt(Z,ve,L)},o.addHook=function(_,g){typeof g=="function"&&Hn(b[_],g)},o.removeHook=function(_,g){if(g!==void 0){const L=Mm(b[_],g);return L===-1?void 0:Am(b[_],L,1)[0]}return Il(b[_])},o.removeHooks=function(_){b[_]=[]},o.removeAllHooks=function(){b=Hl()},o}var qm=Wl();const Xm=new Al({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new co;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),a=Mi(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${a}</code></pre>`},t})()}),Zm=["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"],Jm=["href","title","target","rel","src","alt","class","checked","type","disabled"],Qm=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function ep(t){if(!t)return"";const o=Xm.parse(t,{async:!1});return qm.sanitize(o,{ALLOWED_TAGS:Zm,ALLOWED_ATTR:Jm,ALLOWED_URI_REGEXP:Qm})}const tp={class:"zm-note-panel"},np={key:0,class:"zm-note-empty"},op={class:"zm-note-header"},ip={class:"zm-note-title-row"},rp={class:"zm-note-name"},lp={class:"zm-note-meta"},ap={class:"zm-note-scroll"},sp={class:"zm-note-section"},cp={class:"zm-note-section-head"},dp={class:"zm-note-split"},up=["disabled"],fp={key:0,class:"zm-note-preview"},mp=["innerHTML"],pp={key:1,class:"zm-note-preview-hint"},hp={key:0,class:"zm-note-section-actions"},gp={key:0,class:"zm-note-add-row"},bp={key:1,class:"zm-note-section"},kp=["disabled"],yp=["href","title"],Ep={key:2,class:"zm-note-section"},xp=["disabled"],wp=["src","alt"],Np={key:3,class:"zm-note-section"},Sp={class:"zm-note-section-head"},Tp={key:0,class:"zm-note-section-tag"},Cp=["disabled"],Mp={key:0,class:"zm-note-code"},Ap=["innerHTML"],_p={key:4,class:"zm-note-section"},Rp=["disabled"],Bp={key:0,class:"zm-note-table"},Jo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null);ki(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),u=e.computed(()=>ep(a.value)),d=e.ref(!0);function p(){d.value=!d.value}e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:le.text]},()=>{var D,z;a.value=((z=(D=n.selectedNode)==null?void 0:D.note)==null?void 0:z.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const D=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(D){D.focus();const z=D.value.length;D.setSelectionRange(z,z)}});function h(){var le,be;if(n.readonly)return;const D=a.value,z=((be=(le=n.selectedNode)==null?void 0:le.note)==null?void 0:be.text)??"";D!==z&&i("apply",D)}function x(D){var z,le;n.readonly||(D.key==="Escape"?(D.preventDefault(),a.value=((le=(z=n.selectedNode)==null?void 0:z.note)==null?void 0:le.text)??"",D.target.blur()):D.key==="Enter"&&(D.ctrlKey||D.metaKey)&&(D.preventDefault(),h(),D.target.blur()))}function C(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",i("remove"))}const $=e.computed(()=>{var D,z;return!!((z=(D=n.selectedNode)==null?void 0:D.link)!=null&&z.url)}),R=e.computed(()=>{var D,z;return!!((z=(D=n.selectedNode)==null?void 0:D.image)!=null&&z.src)}),F=e.computed(()=>{var D,z;return(z=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:z.kind}),O=e.computed(()=>F.value==="code"),A=e.computed(()=>F.value==="table"),y=e.ref(!1),k=e.ref(!1),m=e.ref(!1),P=e.ref(!1);e.watch(()=>{var D;return(D=n.selectedNode)==null?void 0:D.id},()=>{y.value=!1,k.value=!1,m.value=!1,P.value=!1});const G=e.ref("");e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.link)==null?void 0:le.url]},()=>{var D,z;G.value=((z=(D=n.selectedNode)==null?void 0:D.link)==null?void 0:z.url)??""},{immediate:!0});function q(){var le,be;if(n.readonly)return;const D=G.value.trim(),z=((be=(le=n.selectedNode)==null?void 0:le.link)==null?void 0:be.url)??"";D!==z&&i("set-link",D)}const w=e.ref("");e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.image)==null?void 0:le.src]},()=>{var D,z;w.value=((z=(D=n.selectedNode)==null?void 0:D.image)==null?void 0:z.src)??""},{immediate:!0});function ie(){var le,be;if(n.readonly)return;const D=w.value.trim(),z=((be=(le=n.selectedNode)==null?void 0:le.image)==null?void 0:be.src)??"";D!==z&&i("set-image",D)}function fe(D){const z=D.target;z.style.display="none"}function ce(D){const z=D.target;z.style.display=""}const J=e.ref(""),me=e.ref(null);ki(me,{minRows:4,maxRows:18}),e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:le.raw]},()=>{var D,z;J.value=((z=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:z.raw)??""},{immediate:!0});const ae=e.computed(()=>Mi(Go(J.value),wn(J.value)));function ke(){var be,I;if(n.readonly)return;const D=J.value,z=((I=(be=n.selectedNode)==null?void 0:be.richContent)==null?void 0:I.raw)??"";if(D===z)return;const le=wn(D)||void 0;i("set-rich",D?{kind:"code",raw:D,lang:le}:null)}const b=e.ref(""),V=e.ref(null);ki(V,{minRows:4,maxRows:14}),e.watch(()=>{var D,z,le;return[(D=n.selectedNode)==null?void 0:D.id,(le=(z=n.selectedNode)==null?void 0:z.richContent)==null?void 0:le.raw]},()=>{var D,z;b.value=((z=(D=n.selectedNode)==null?void 0:D.richContent)==null?void 0:z.raw)??""},{immediate:!0});function W(){var le,be;if(n.readonly)return;const D=b.value,z=((be=(le=n.selectedNode)==null?void 0:le.richContent)==null?void 0:be.raw)??"";D!==z&&i("set-rich",D?{kind:"table",raw:D}:null)}const ee=e.computed(()=>Ai(b.value)),ge=e.computed(()=>{const D=[];return s.value||D.push(`${a.value.length} 字`),$.value&&D.push("1 链接"),R.value&&D.push("1 图片"),O.value&&D.push("代码块"),A.value&&D.push("表格"),D.length===0?"节点没有额外内容":D.join(" · ")});return(D,z)=>{var le,be,I,N;return e.openBlock(),e.createElementBlock("div",tp,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",op,[e.createElementVNode("div",ip,[z[12]||(z[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",rp,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",lp,e.toDisplayString(ge.value),1)]),e.createElementVNode("div",ap,[e.createElementVNode("section",sp,[e.createElementVNode("header",cp,[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:p},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",dp,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":z[0]||(z[0]=U=>a.value=U),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:h,onKeydown:x},null,40,up),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",fp,[s.value?(e.openBlock(),e.createElementBlock("div",pp," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,mp))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",hp,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:C},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",gp,[!$.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:z[1]||(z[1]=U=>y.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!R.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:z[2]||(z[2]=U=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!O.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:z[3]||(z[3]=U=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!A.value&&!P.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:z[4]||(z[4]=U=>P.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),$.value||y.value?(e.openBlock(),e.createElementBlock("section",bp,[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]=U=>G.value=U),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:q,onKeydown:z[6]||(z[6]=e.withKeys(e.withModifiers(U=>U.target.blur(),["prevent"]),["enter"]))},null,40,kp),[[e.vModelText,G.value]]),$.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(le=t.selectedNode.link)==null?void 0:le.url,target:"_blank",rel:"noopener noreferrer",title:(be=t.selectedNode.link)==null?void 0:be.url},e.toDisplayString((I=t.selectedNode.link)==null?void 0:I.url),9,yp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||k.value?(e.openBlock(),e.createElementBlock("section",Ep,[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]=U=>w.value=U),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ie,onKeydown:z[8]||(z[8]=e.withKeys(e.withModifiers(U=>U.target.blur(),["prevent"]),["enter"]))},null,40,xp),[[e.vModelText,w.value]]),R.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(N=t.selectedNode.image)==null?void 0:N.src,alt:t.selectedNode.text,onError:fe,onLoad:ce},null,40,wp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),O.value||m.value?(e.openBlock(),e.createElementBlock("section",Np,[e.createElementVNode("header",Sp,[z[17]||(z[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(wn)(J.value)?(e.openBlock(),e.createElementBlock("span",Tp,e.toDisplayString(e.unref(wn)(J.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:me,"onUpdate:modelValue":z[9]||(z[9]=U=>J.value=U),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:ke},null,40,Cp),[[e.vModelText,J.value]]),J.value.trim()?(e.openBlock(),e.createElementBlock("pre",Mp,[e.createElementVNode("code",{innerHTML:ae.value},null,8,Ap)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),A.value||P.value?(e.openBlock(),e.createElementBlock("section",_p,[z[18]||(z[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:V,"onUpdate:modelValue":z[10]||(z[10]=U=>b.value=U),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
|
|
126
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Zt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let i=this.parser.parseInline(n),a=Cl(t);if(a===null)return i;t=a;let c='<a href="'+t+'"';return o&&(c+=' title="'+Zt(o)+'"'),c+=">"+i+"</a>",c}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let a=Cl(t);if(a===null)return Zt(n);t=a;let c=`<img src="${t}" alt="${Zt(n)}"`;return o&&(c+=` title="${Zt(o)}"`),c+=">",c}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Zt(t.text)}},Pi=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},jt=class ar{constructor(o){He(this,"options");He(this,"renderer");He(this,"textRenderer");this.options=o||Cn,this.options.renderer=this.options.renderer||new uo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Pi}static parse(o,n){return new ar(n).parse(o)}static parseInline(o,n){return new ar(n).parseInline(o)}parse(o){var i,a;this.renderer.parser=this;let n="";for(let c=0;c<o.length;c++){let s=o[c];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[s.type]){let d=s,p=this.options.extensions.renderers[d.type].call({parser:this},d);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=p||"";continue}}let u=s;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var a,c;this.renderer.parser=this;let i="";for(let s=0;s<o.length;s++){let u=o[s];if((c=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&c[u.type]){let p=this.options.extensions.renderers[u.type].call({parser:this},u);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=p||"";continue}}let d=u;switch(d.type){case"escape":{i+=n.text(d);break}case"html":{i+=n.html(d);break}case"link":{i+=n.link(d);break}case"image":{i+=n.image(d);break}case"checkbox":{i+=n.checkbox(d);break}case"strong":{i+=n.strong(d);break}case"em":{i+=n.em(d);break}case"codespan":{i+=n.codespan(d);break}case"br":{i+=n.br(d);break}case"del":{i+=n.del(d);break}case"text":{i+=n.text(d);break}default:{let p='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return i}},fo=(ti=class{constructor(t){He(this,"options");He(this,"block");this.options=t||Cn}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?Gt.lex:Gt.lexInline}provideParser(t=this.block){return t?jt.parse:jt.parseInline}},He(ti,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),He(ti,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ti),Rl=class{constructor(...t){He(this,"defaults",Bi());He(this,"options",this.setOptions);He(this,"parse",this.parseMarkdown(!0));He(this,"parseInline",this.parseMarkdown(!1));He(this,"Parser",jt);He(this,"Renderer",uo);He(this,"TextRenderer",Pi);He(this,"Lexer",Gt);He(this,"Tokenizer",Zo);He(this,"Hooks",fo);this.use(...t)}walkTokens(t,o){var i,a;let n=[];for(let c of t)switch(n=n.concat(o.call(this,c)),c.type){case"table":{let s=c;for(let u of s.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of s.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let s=c;n=n.concat(this.walkTokens(s.items,o));break}default:{let s=c;(a=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[s.type]?this.defaults.extensions.childTokens[s.type].forEach(u=>{let d=s[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,o)))}}return n}use(...t){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let c=o.renderers[a.name];c?o.renderers[a.name]=function(...s){let u=a.renderer.apply(this,s);return u===!1&&(u=c.apply(this,s)),u}:o.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let c=o[a.level];c?c.unshift(a.tokenizer):o[a.level]=[a.tokenizer],a.start&&(a.level==="block"?o.startBlock?o.startBlock.push(a.start):o.startBlock=[a.start]:a.level==="inline"&&(o.startInline?o.startInline.push(a.start):o.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(o.childTokens[a.name]=a.childTokens)}),i.extensions=o),n.renderer){let a=this.defaults.renderer||new uo(this.defaults);for(let c in n.renderer){if(!(c in a))throw new Error(`renderer '${c}' does not exist`);if(["options","parser"].includes(c))continue;let s=c,u=n.renderer[s],d=a[s];a[s]=(...p)=>{let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new Zo(this.defaults);for(let c in n.tokenizer){if(!(c in a))throw new Error(`tokenizer '${c}' does not exist`);if(["options","rules","lexer"].includes(c))continue;let s=c,u=n.tokenizer[s],d=a[s];a[s]=(...p)=>{let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new fo;for(let c in n.hooks){if(!(c in a))throw new Error(`hook '${c}' does not exist`);if(["options","block"].includes(c))continue;let s=c,u=n.hooks[s],d=a[s];fo.passThroughHooks.has(c)?a[s]=p=>{if(this.defaults.async&&fo.passThroughHooksRespectAsync.has(c))return(async()=>{let w=await u.call(a,p);return d.call(a,w)})();let h=u.call(a,p);return d.call(a,h)}:a[s]=(...p)=>{if(this.defaults.async)return(async()=>{let w=await u.apply(a,p);return w===!1&&(w=await d.apply(a,p)),w})();let h=u.apply(a,p);return h===!1&&(h=d.apply(a,p)),h}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,c=n.walkTokens;i.walkTokens=function(s){let u=[];return u.push(c.call(this,s)),a&&(u=u.concat(a.call(this,s))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return Gt.lex(t,o??this.defaults)}parser(t,o){return jt.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},a={...this.defaults,...i},c=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return c(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(a.hooks&&(a.hooks.options=a,a.hooks.block=t),a.async)return(async()=>{let s=a.hooks?await a.hooks.preprocess(o):o,u=await(a.hooks?await a.hooks.provideLexer(t):t?Gt.lex:Gt.lexInline)(s,a),d=a.hooks?await a.hooks.processAllTokens(u):u;a.walkTokens&&await Promise.all(this.walkTokens(d,a.walkTokens));let p=await(a.hooks?await a.hooks.provideParser(t):t?jt.parse:jt.parseInline)(d,a);return a.hooks?await a.hooks.postprocess(p):p})().catch(c);try{a.hooks&&(o=a.hooks.preprocess(o));let s=(a.hooks?a.hooks.provideLexer(t):t?Gt.lex:Gt.lexInline)(o,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&this.walkTokens(s,a.walkTokens);let u=(a.hooks?a.hooks.provideParser(t):t?jt.parse:jt.parseInline)(s,a);return a.hooks&&(u=a.hooks.postprocess(u)),u}catch(s){return c(s)}}}onError(t,o){return n=>{if(n.message+=`
|
|
127
|
+
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Zt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},An=new Rl;function Fe(t,o){return An.parse(t,o)}Fe.options=Fe.setOptions=function(t){return An.setOptions(t),Fe.defaults=An.defaults,ml(Fe.defaults),Fe},Fe.getDefaults=Bi,Fe.defaults=Cn,Fe.use=function(...t){return An.use(...t),Fe.defaults=An.defaults,ml(Fe.defaults),Fe},Fe.walkTokens=function(t,o){return An.walkTokens(t,o)},Fe.parseInline=An.parseInline,Fe.Parser=jt,Fe.parser=jt.parse,Fe.Renderer=uo,Fe.TextRenderer=Pi,Fe.Lexer=Gt,Fe.lexer=Gt.lex,Fe.Tokenizer=Zo,Fe.Hooks=fo,Fe.parse=Fe,Fe.options,Fe.setOptions,Fe.use,Fe.walkTokens,Fe.parseInline,jt.parse,Gt.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 Bl(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 Nm(t){if(Array.isArray(t))return t}function Sm(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,a,c,s,u=[],d=!0,p=!1;try{if(c=(n=n.call(t)).next,o!==0)for(;!(d=(i=c.call(n)).done)&&(u.push(i.value),u.length!==o);d=!0);}catch(h){p=!0,a=h}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(p)throw a}}return u}}function Tm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
128
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cm(t,o){return Nm(t)||Sm(t,o)||Mm(t,o)||Tm()}function Mm(t,o){if(t){if(typeof t=="string")return Bl(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)?Bl(t,o):void 0}}const vl=Object.entries,zl=Object.setPrototypeOf,Am=Object.isFrozen,_m=Object.getPrototypeOf,Rm=Object.getOwnPropertyDescriptor;let xt=Object.freeze,$t=Object.seal,Hn=Object.create,Il=typeof Reflect<"u"&&Reflect,Fi=Il.apply,Ui=Il.construct;xt||(xt=function(o){return o}),$t||($t=function(o){return o}),Fi||(Fi=function(o,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),c=2;c<i;c++)a[c-2]=arguments[c];return o.apply(n,a)}),Ui||(Ui=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return new o(...i)});const _n=Qe(Array.prototype.forEach),Bm=Qe(Array.prototype.lastIndexOf),Ll=Qe(Array.prototype.pop),Wn=Qe(Array.prototype.push),vm=Qe(Array.prototype.splice),Et=Array.isArray,mo=Qe(String.prototype.toLowerCase),Hi=Qe(String.prototype.toString),Ol=Qe(String.prototype.match),Gn=Qe(String.prototype.replace),Dl=Qe(String.prototype.indexOf),zm=Qe(String.prototype.trim),Im=Qe(Number.prototype.toString),Lm=Qe(Boolean.prototype.toString),Vl=typeof BigInt>"u"?null:Qe(BigInt.prototype.toString),$l=typeof Symbol>"u"?null:Qe(Symbol.prototype.toString),Ke=Qe(Object.prototype.hasOwnProperty),po=Qe(Object.prototype.toString),at=Qe(RegExp.prototype.test),jn=Om(TypeError);function Qe(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return Fi(t,o,i)}}function Om(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Ui(t,n)}}function Se(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mo;if(zl&&zl(t,null),!Et(o))return t;let i=o.length;for(;i--;){let a=o[i];if(typeof a=="string"){const c=n(a);c!==a&&(Am(o)||(o[i]=c),a=c)}t[a]=!0}return t}function Dm(t){for(let o=0;o<t.length;o++)Ke(t,o)||(t[o]=null);return t}function ut(t){const o=Hn(null);for(const i of vl(t)){var n=Cm(i,2);const a=n[0],c=n[1];Ke(t,a)&&(Et(c)?o[a]=Dm(c):c&&typeof c=="object"&&c.constructor===Object?o[a]=ut(c):o[a]=c)}return o}function Vm(t){switch(typeof t){case"string":return t;case"number":return Im(t);case"boolean":return Lm(t);case"bigint":return Vl?Vl(t):"0";case"symbol":return $l?$l(t):"Symbol()";case"undefined":return po(t);case"function":case"object":{if(t===null)return po(t);const o=t,n=Jt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:po(i)}return po(t)}default:return po(t)}}function Jt(t,o){for(;t!==null;){const i=Rm(t,o);if(i){if(i.get)return Qe(i.get);if(typeof i.value=="function")return Qe(i.value)}t=_m(t)}function n(){return null}return n}function $m(t){try{return at(t,""),!0}catch{return!1}}const Pl=xt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wi=xt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Gi=xt(["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"]),Pm=xt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ji=xt(["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"]),Fm=xt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Fl=xt(["#text"]),Ul=xt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Ki=xt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Hl=xt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Jo=xt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Um=$t(/{{[\w\W]*|^[\w\W]*}}/g),Hm=$t(/<%[\w\W]*|^[\w\W]*%>/g),Wm=$t(/\${[\w\W]*/g),Gm=$t(/^data-[\-\w.\u00B7-\uFFFF]+$/),jm=$t(/^aria-[\-\w]+$/),Wl=$t(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Km=$t(/^(?:\w+script|data):/i),Ym=$t(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qm=$t(/^html$/i),Xm=$t(/^[a-z][.\w]*(-[.\w]+)+$/i),Qt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Zm=function(){return typeof window>"u"?null:window},Jm=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const a="data-tt-policy-suffix";n&&n.hasAttribute(a)&&(i=n.getAttribute(a));const c="dompurify"+(i?"#"+i:"");try{return o.createPolicy(c,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Gl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function jl(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Zm();const o=M=>jl(M);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Qt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,a=i.currentScript;t.DocumentFragment;const c=t.HTMLTemplateElement,s=t.Node,u=t.Element,d=t.NodeFilter,p=t.NamedNodeMap;p===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const h=t.DOMParser,w=t.trustedTypes,C=u.prototype,$=Jt(C,"cloneNode"),R=Jt(C,"remove"),U=Jt(C,"nextSibling"),I=Jt(C,"childNodes"),_=Jt(C,"parentNode"),y=Jt(C,"shadowRoot"),k=Jt(C,"attributes"),m=s&&s.prototype?Jt(s.prototype,"nodeType"):null,P=s&&s.prototype?Jt(s.prototype,"nodeName"):null;if(typeof c=="function"){const M=n.createElement("template");M.content&&M.content.ownerDocument&&(n=M.content.ownerDocument)}let j,Y="",E=0;const re=function(b){if(E>0)throw jn('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.');E++;try{return j.createHTML(b)}finally{E--}},pe=n,de=pe.implementation,Ee=pe.createNodeIterator,ee=pe.createDocumentFragment,ce=pe.getElementsByTagName,ue=i.importNode;let g=Gl();o.isSupported=typeof vl=="function"&&typeof _=="function"&&de&&de.createHTMLDocument!==void 0;const V=Um,G=Hm,oe=Wm,fe=Gm,O=jm,L=Km,se=Ym,ke=Xm;let z=Wl,S=null;const F=Se({},[...Pl,...Wi,...Gi,...ji,...Fl]);let W=null;const te=Se({},[...Ul,...Ki,...Hl,...Jo]);let ye=Object.seal(Hn(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}})),nt=null,ft=null;const ot=Object.seal(Hn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ln=!0,it=!0,an=!1,Pt=!0,me=!1,mt=!0,De=!1,ze=!1,Ft=!1,rt=!1,Ct=!1,wt=!1,q=!0,le=!1;const xe="user-content-";let Re=!0,Ge=!1,lt={},Mt=null;const Bn=Se({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ni=null;const oi=Se({},["audio","video","img","source","image","track"]);let ho=null;const ii=Se({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Yn="http://www.w3.org/1998/Math/MathML",qn="http://www.w3.org/2000/svg",Ut="http://www.w3.org/1999/xhtml";let bn=Ut,go=!1,bo=null;const Yi=Se({},[Yn,qn,Ut],Hi);let ko=Se({},["mi","mo","mn","ms","mtext"]),yo=Se({},["annotation-xml"]);const qi=Se({},["title","style","font","a","script"]);let vn=null;const ri=["application/xhtml+xml","text/html"],Xi="text/html";let je=null,kn=null;const li=n.createElement("form"),ai=function(b){return b instanceof RegExp||b instanceof Function},Xn=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(kn&&kn===b)return;(!b||typeof b!="object")&&(b={}),b=ut(b),vn=ri.indexOf(b.PARSER_MEDIA_TYPE)===-1?Xi:b.PARSER_MEDIA_TYPE,je=vn==="application/xhtml+xml"?Hi:mo,S=Ke(b,"ALLOWED_TAGS")&&Et(b.ALLOWED_TAGS)?Se({},b.ALLOWED_TAGS,je):F,W=Ke(b,"ALLOWED_ATTR")&&Et(b.ALLOWED_ATTR)?Se({},b.ALLOWED_ATTR,je):te,bo=Ke(b,"ALLOWED_NAMESPACES")&&Et(b.ALLOWED_NAMESPACES)?Se({},b.ALLOWED_NAMESPACES,Hi):Yi,ho=Ke(b,"ADD_URI_SAFE_ATTR")&&Et(b.ADD_URI_SAFE_ATTR)?Se(ut(ii),b.ADD_URI_SAFE_ATTR,je):ii,ni=Ke(b,"ADD_DATA_URI_TAGS")&&Et(b.ADD_DATA_URI_TAGS)?Se(ut(oi),b.ADD_DATA_URI_TAGS,je):oi,Mt=Ke(b,"FORBID_CONTENTS")&&Et(b.FORBID_CONTENTS)?Se({},b.FORBID_CONTENTS,je):Bn,nt=Ke(b,"FORBID_TAGS")&&Et(b.FORBID_TAGS)?Se({},b.FORBID_TAGS,je):ut({}),ft=Ke(b,"FORBID_ATTR")&&Et(b.FORBID_ATTR)?Se({},b.FORBID_ATTR,je):ut({}),lt=Ke(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?ut(b.USE_PROFILES):b.USE_PROFILES:!1,ln=b.ALLOW_ARIA_ATTR!==!1,it=b.ALLOW_DATA_ATTR!==!1,an=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Pt=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=b.SAFE_FOR_TEMPLATES||!1,mt=b.SAFE_FOR_XML!==!1,De=b.WHOLE_DOCUMENT||!1,rt=b.RETURN_DOM||!1,Ct=b.RETURN_DOM_FRAGMENT||!1,wt=b.RETURN_TRUSTED_TYPE||!1,Ft=b.FORCE_BODY||!1,q=b.SANITIZE_DOM!==!1,le=b.SANITIZE_NAMED_PROPS||!1,Re=b.KEEP_CONTENT!==!1,Ge=b.IN_PLACE||!1,z=$m(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:Wl,bn=typeof b.NAMESPACE=="string"?b.NAMESPACE:Ut,ko=Ke(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?ut(b.MATHML_TEXT_INTEGRATION_POINTS):Se({},["mi","mo","mn","ms","mtext"]),yo=Ke(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?ut(b.HTML_INTEGRATION_POINTS):Se({},["annotation-xml"]);const D=Ke(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?ut(b.CUSTOM_ELEMENT_HANDLING):Hn(null);if(ye=Hn(null),Ke(D,"tagNameCheck")&&ai(D.tagNameCheck)&&(ye.tagNameCheck=D.tagNameCheck),Ke(D,"attributeNameCheck")&&ai(D.attributeNameCheck)&&(ye.attributeNameCheck=D.attributeNameCheck),Ke(D,"allowCustomizedBuiltInElements")&&typeof D.allowCustomizedBuiltInElements=="boolean"&&(ye.allowCustomizedBuiltInElements=D.allowCustomizedBuiltInElements),me&&(it=!1),Ct&&(rt=!0),lt&&(S=Se({},Fl),W=Hn(null),lt.html===!0&&(Se(S,Pl),Se(W,Ul)),lt.svg===!0&&(Se(S,Wi),Se(W,Ki),Se(W,Jo)),lt.svgFilters===!0&&(Se(S,Gi),Se(W,Ki),Se(W,Jo)),lt.mathMl===!0&&(Se(S,ji),Se(W,Hl),Se(W,Jo))),ot.tagCheck=null,ot.attributeCheck=null,Ke(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?ot.tagCheck=b.ADD_TAGS:Et(b.ADD_TAGS)&&(S===F&&(S=ut(S)),Se(S,b.ADD_TAGS,je))),Ke(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?ot.attributeCheck=b.ADD_ATTR:Et(b.ADD_ATTR)&&(W===te&&(W=ut(W)),Se(W,b.ADD_ATTR,je))),Ke(b,"ADD_URI_SAFE_ATTR")&&Et(b.ADD_URI_SAFE_ATTR)&&Se(ho,b.ADD_URI_SAFE_ATTR,je),Ke(b,"FORBID_CONTENTS")&&Et(b.FORBID_CONTENTS)&&(Mt===Bn&&(Mt=ut(Mt)),Se(Mt,b.FORBID_CONTENTS,je)),Ke(b,"ADD_FORBID_CONTENTS")&&Et(b.ADD_FORBID_CONTENTS)&&(Mt===Bn&&(Mt=ut(Mt)),Se(Mt,b.ADD_FORBID_CONTENTS,je)),Re&&(S["#text"]=!0),De&&Se(S,["html","head","body"]),S.table&&(Se(S,["tbody"]),delete nt.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw jn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw jn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const X=j;j=b.TRUSTED_TYPES_POLICY;try{Y=re("")}catch(Ie){throw j=X,Ie}}else j===void 0&&b.TRUSTED_TYPES_POLICY!==null&&(j=Jm(w,a)),j&&typeof Y=="string"&&(Y=re(""));(g.uponSanitizeElement.length>0||g.uponSanitizeAttribute.length>0)&&S===F&&(S=ut(S)),g.uponSanitizeAttribute.length>0&&W===te&&(W=ut(W)),xt&&xt(b),kn=b},xo=Se({},[...Wi,...Gi,...Pm]),yn=Se({},[...ji,...Fm]),Zi=function(b){let D=_(b);(!D||!D.tagName)&&(D={namespaceURI:bn,tagName:"template"});const X=mo(b.tagName),Ie=mo(D.tagName);return bo[b.namespaceURI]?b.namespaceURI===qn?D.namespaceURI===Ut?X==="svg":D.namespaceURI===Yn?X==="svg"&&(Ie==="annotation-xml"||ko[Ie]):!!xo[X]:b.namespaceURI===Yn?D.namespaceURI===Ut?X==="math":D.namespaceURI===qn?X==="math"&&yo[Ie]:!!yn[X]:b.namespaceURI===Ut?D.namespaceURI===qn&&!yo[Ie]||D.namespaceURI===Yn&&!ko[Ie]?!1:!yn[X]&&(qi[X]||!xo[X]):!!(vn==="application/xhtml+xml"&&bo[b.namespaceURI]):!1},At=function(b){Wn(o.removed,{element:b});try{_(b).removeChild(b)}catch{R(b)}},en=function(b,D){try{Wn(o.removed,{attribute:D.getAttributeNode(b),from:D})}catch{Wn(o.removed,{attribute:null,from:D})}if(D.removeAttribute(b),b==="is")if(rt||Ct)try{At(D)}catch{}else try{D.setAttribute(b,"")}catch{}},Eo=function(b){let D=null,X=null;if(Ft)b="<remove></remove>"+b;else{const $e=Ol(b,/^[\r\n\t ]+/);X=$e&&$e[0]}vn==="application/xhtml+xml"&&bn===Ut&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const Ie=j?re(b):b;if(bn===Ut)try{D=new h().parseFromString(Ie,vn)}catch{}if(!D||!D.documentElement){D=de.createDocument(bn,"template",null);try{D.documentElement.innerHTML=go?Y:Ie}catch{}}const Ne=D.body||D.documentElement;return b&&X&&Ne.insertBefore(n.createTextNode(X),Ne.childNodes[0]||null),bn===Ut?ce.call(D,De?"html":"body")[0]:De?D.documentElement:Ne},Zn=function(b){return Ee.call(b.ownerDocument||b,b,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},zn=function(b){var D,X;b.normalize();const Ie=Ee.call(b.ownerDocument||b,b,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let Ne=Ie.nextNode();for(;Ne;){let Ze=Ne.data;_n([V,G,oe],St=>{Ze=Gn(Ze,St," ")}),Ne.data=Ze,Ne=Ie.nextNode()}const $e=(D=(X=b.querySelectorAll)===null||X===void 0?void 0:X.call(b,"template"))!==null&&D!==void 0?D:[];_n(Array.from($e),Ze=>{xn(Ze.content)&&zn(Ze.content)})},Jn=function(b){const D=P?P(b):null;return typeof D!="string"||je(D)!=="form"?!1:typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||b.attributes!==k(b)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function"||b.nodeType!==m(b)||b.childNodes!==I(b)},xn=function(b){if(!m||typeof b!="object"||b===null)return!1;try{return m(b)===Qt.documentFragment}catch{return!1}},Qn=function(b){if(!m||typeof b!="object"||b===null)return!1;try{return typeof m(b)=="number"}catch{return!1}};function _t(M,b,D){_n(M,X=>{X.call(o,b,D,kn)})}const eo=function(b){let D=null;if(_t(g.beforeSanitizeElements,b,null),Jn(b))return At(b),!0;const X=je(P?P(b):b.nodeName);if(_t(g.uponSanitizeElement,b,{tagName:X,allowedTags:S}),mt&&b.hasChildNodes()&&!Qn(b.firstElementChild)&&at(/<[/\w!]/g,b.innerHTML)&&at(/<[/\w!]/g,b.textContent)||mt&&b.namespaceURI===Ut&&X==="style"&&Qn(b.firstElementChild)||b.nodeType===Qt.progressingInstruction||mt&&b.nodeType===Qt.comment&&at(/<[/\w]/g,b.data))return At(b),!0;if(nt[X]||!(ot.tagCheck instanceof Function&&ot.tagCheck(X))&&!S[X]){if(!nt[X]&&we(X)&&(ye.tagNameCheck instanceof RegExp&&at(ye.tagNameCheck,X)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(X)))return!1;if(Re&&!Mt[X]){const Ne=_(b),$e=I(b);if($e&&Ne){const Ze=$e.length;for(let St=Ze-1;St>=0;--St){const pt=$($e[St],!0);Ne.insertBefore(pt,U(b))}}}return At(b),!0}return(m?m(b):b.nodeType)===Qt.element&&!Zi(b)||(X==="noscript"||X==="noembed"||X==="noframes")&&at(/<\/no(script|embed|frames)/i,b.innerHTML)?(At(b),!0):(me&&b.nodeType===Qt.text&&(D=b.textContent,_n([V,G,oe],Ne=>{D=Gn(D,Ne," ")}),b.textContent!==D&&(Wn(o.removed,{element:b.cloneNode()}),b.textContent=D)),_t(g.afterSanitizeElements,b,null),!1)},Kt=function(b,D,X){if(ft[D]||q&&(D==="id"||D==="name")&&(X in n||X in li))return!1;const Ie=W[D]||ot.attributeCheck instanceof Function&&ot.attributeCheck(D,b);if(!(it&&!ft[D]&&at(fe,D))){if(!(ln&&at(O,D))){if(!Ie||ft[D]){if(!(we(b)&&(ye.tagNameCheck instanceof RegExp&&at(ye.tagNameCheck,b)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(b))&&(ye.attributeNameCheck instanceof RegExp&&at(ye.attributeNameCheck,D)||ye.attributeNameCheck instanceof Function&&ye.attributeNameCheck(D,b))||D==="is"&&ye.allowCustomizedBuiltInElements&&(ye.tagNameCheck instanceof RegExp&&at(ye.tagNameCheck,X)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(X))))return!1}else if(!ho[D]){if(!at(z,Gn(X,se,""))){if(!((D==="src"||D==="xlink:href"||D==="href")&&b!=="script"&&Dl(X,"data:")===0&&ni[b])){if(!(an&&!at(L,Gn(X,se,"")))){if(X)return!1}}}}}}return!0},Ve=Se({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),we=function(b){return!Ve[mo(b)]&&at(ke,b)},si=function(b){_t(g.beforeSanitizeAttributes,b,null);const D=b.attributes;if(!D||Jn(b))return;const X={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0};let Ie=D.length;for(;Ie--;){const Ne=D[Ie],$e=Ne.name,Ze=Ne.namespaceURI,St=Ne.value,pt=je($e),wo=St;let Je=$e==="value"?wo:zm(wo);if(X.attrName=pt,X.attrValue=Je,X.keepAttr=!0,X.forceKeepAttr=void 0,_t(g.uponSanitizeAttribute,b,X),Je=X.attrValue,le&&(pt==="id"||pt==="name")&&Dl(Je,xe)!==0&&(en($e,b),Je=xe+Je),mt&&at(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Je)){en($e,b);continue}if(pt==="attributename"&&Ol(Je,"href")){en($e,b);continue}if(X.forceKeepAttr)continue;if(!X.keepAttr){en($e,b);continue}if(!Pt&&at(/\/>/i,Je)){en($e,b);continue}me&&_n([V,G,oe],No=>{Je=Gn(Je,No," ")});const En=je(b.nodeName);if(!Kt(En,pt,Je)){en($e,b);continue}if(j&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!Ze)switch(w.getAttributeType(En,pt)){case"TrustedHTML":{Je=re(Je);break}case"TrustedScriptURL":{Je=j.createScriptURL(Je);break}}if(Je!==wo)try{Ze?b.setAttributeNS(Ze,$e,Je):b.setAttribute($e,Je),Jn(b)?At(b):Ll(o.removed)}catch{en($e,b)}}_t(g.afterSanitizeAttributes,b,null)},Nt=function(b){let D=null;const X=Zn(b);for(_t(g.beforeSanitizeShadowDOM,b,null);D=X.nextNode();)if(_t(g.uponSanitizeShadowNode,D,null),eo(D),si(D),xn(D.content)&&Nt(D.content),(m?m(D):D.nodeType)===Qt.element){const Ne=y?y(D):D.shadowRoot;xn(Ne)&&(tn(Ne),Nt(Ne))}_t(g.afterSanitizeShadowDOM,b,null)},tn=function(b){const D=m?m(b):b.nodeType;if(D===Qt.element){const Ne=y?y(b):b.shadowRoot;xn(Ne)&&(tn(Ne),Nt(Ne))}const X=I?I(b):b.childNodes;if(!X)return;const Ie=[];_n(X,Ne=>{Wn(Ie,Ne)});for(const Ne of Ie)tn(Ne);if(D===Qt.element){const Ne=P?P(b):null;if(typeof Ne=="string"&&je(Ne)==="template"){const $e=b.content;xn($e)&&tn($e)}}};return o.sanitize=function(M){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},D=null,X=null,Ie=null,Ne=null;if(go=!M,go&&(M="<!-->"),typeof M!="string"&&!Qn(M)&&(M=Vm(M),typeof M!="string"))throw jn("dirty is not a string, aborting");if(!o.isSupported)return M;if(ze||Xn(b),o.removed=[],typeof M=="string"&&(Ge=!1),Ge){const St=P?P(M):M.nodeName;if(typeof St=="string"){const pt=je(St);if(!S[pt]||nt[pt])throw jn("root node is forbidden and cannot be sanitized in-place")}if(Jn(M))throw jn("root node is clobbered and cannot be sanitized in-place");tn(M)}else if(Qn(M))D=Eo("<!---->"),X=D.ownerDocument.importNode(M,!0),X.nodeType===Qt.element&&X.nodeName==="BODY"||X.nodeName==="HTML"?D=X:D.appendChild(X),tn(X);else{if(!rt&&!me&&!De&&M.indexOf("<")===-1)return j&&wt?re(M):M;if(D=Eo(M),!D)return rt?null:wt?Y:""}D&&Ft&&At(D.firstChild);const $e=Zn(Ge?M:D);for(;Ie=$e.nextNode();)eo(Ie),si(Ie),xn(Ie.content)&&Nt(Ie.content);if(Ge)return me&&zn(M),M;if(rt){if(me&&zn(D),Ct)for(Ne=ee.call(D.ownerDocument);D.firstChild;)Ne.appendChild(D.firstChild);else Ne=D;return(W.shadowroot||W.shadowrootmode)&&(Ne=ue.call(i,Ne,!0)),Ne}let Ze=De?D.outerHTML:D.innerHTML;return De&&S["!doctype"]&&D.ownerDocument&&D.ownerDocument.doctype&&D.ownerDocument.doctype.name&&at(qm,D.ownerDocument.doctype.name)&&(Ze="<!DOCTYPE "+D.ownerDocument.doctype.name+`>
|
|
129
|
+
`+Ze),me&&_n([V,G,oe],St=>{Ze=Gn(Ze,St," ")}),j&&wt?re(Ze):Ze},o.setConfig=function(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Xn(M),ze=!0},o.clearConfig=function(){kn=null,ze=!1},o.isValidAttribute=function(M,b,D){kn||Xn({});const X=je(M),Ie=je(b);return Kt(X,Ie,D)},o.addHook=function(M,b){typeof b=="function"&&Wn(g[M],b)},o.removeHook=function(M,b){if(b!==void 0){const D=Bm(g[M],b);return D===-1?void 0:vm(g[M],D,1)[0]}return Ll(g[M])},o.removeHooks=function(M){g[M]=[]},o.removeAllHooks=function(){g=Gl()},o}var Qm=jl();const ep=new Rl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new uo;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),a=_i(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${a}</code></pre>`},t})()}),tp=["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"],np=["href","title","target","rel","src","alt","class","checked","type","disabled"],op=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function ip(t){if(!t)return"";const o=ep.parse(t,{async:!1});return Qm.sanitize(o,{ALLOWED_TAGS:tp,ALLOWED_ATTR:np,ALLOWED_URI_REGEXP:op})}const rp={class:"zm-note-panel"},lp={key:0,class:"zm-note-empty"},ap={class:"zm-note-header"},sp={class:"zm-note-title-row"},cp={class:"zm-note-name"},dp={class:"zm-note-meta"},up={class:"zm-note-scroll"},fp={class:"zm-note-section"},mp={class:"zm-note-section-head"},pp={class:"zm-note-split"},hp=["disabled"],gp={key:0,class:"zm-note-preview"},bp=["innerHTML"],kp={key:1,class:"zm-note-preview-hint"},yp={key:0,class:"zm-note-section-actions"},xp={key:0,class:"zm-note-add-row"},Ep={key:1,class:"zm-note-section"},wp=["disabled"],Np=["href","title"],Sp={key:2,class:"zm-note-section"},Tp=["disabled"],Cp=["src","alt"],Mp={key:3,class:"zm-note-section"},Ap={class:"zm-note-section-head"},_p={key:0,class:"zm-note-section-tag"},Rp=["disabled"],Bp={key:0,class:"zm-note-code"},vp=["innerHTML"],zp={key:4,class:"zm-note-section"},Ip=["disabled"],Lp={key:0,class:"zm-note-table"},Qo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,i=o,a=e.ref(""),c=e.ref(null);xi(c,{minRows:4,maxRows:10});const s=e.computed(()=>!a.value||a.value.trim()===""),u=e.computed(()=>ip(a.value)),d=e.ref(!0);function p(){d.value=!d.value}e.watch(()=>{var O,L,se;return[(O=n.selectedNode)==null?void 0:O.id,(se=(L=n.selectedNode)==null?void 0:L.note)==null?void 0:se.text]},()=>{var O,L;a.value=((L=(O=n.selectedNode)==null?void 0:O.note)==null?void 0:L.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const O=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(O){O.focus();const L=O.value.length;O.setSelectionRange(L,L)}});function h(){var se,ke;if(n.readonly)return;const O=a.value,L=((ke=(se=n.selectedNode)==null?void 0:se.note)==null?void 0:ke.text)??"";O!==L&&i("apply",O)}function w(O){var L,se;n.readonly||(O.key==="Escape"?(O.preventDefault(),a.value=((se=(L=n.selectedNode)==null?void 0:L.note)==null?void 0:se.text)??"",O.target.blur()):O.key==="Enter"&&(O.ctrlKey||O.metaKey)&&(O.preventDefault(),h(),O.target.blur()))}function C(){n.readonly||confirm("移除该节点的笔记?")&&(a.value="",i("remove"))}const $=e.computed(()=>{var O,L;return!!((L=(O=n.selectedNode)==null?void 0:O.link)!=null&&L.url)}),R=e.computed(()=>{var O,L;return!!((L=(O=n.selectedNode)==null?void 0:O.image)!=null&&L.src)}),U=e.computed(()=>{var O,L;return(L=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:L.kind}),I=e.computed(()=>U.value==="code"),_=e.computed(()=>U.value==="table"),y=e.ref(!1),k=e.ref(!1),m=e.ref(!1),P=e.ref(!1);e.watch(()=>{var O;return(O=n.selectedNode)==null?void 0:O.id},()=>{y.value=!1,k.value=!1,m.value=!1,P.value=!1});const j=e.ref("");e.watch(()=>{var O,L,se;return[(O=n.selectedNode)==null?void 0:O.id,(se=(L=n.selectedNode)==null?void 0:L.link)==null?void 0:se.url]},()=>{var O,L;j.value=((L=(O=n.selectedNode)==null?void 0:O.link)==null?void 0:L.url)??""},{immediate:!0});function Y(){var se,ke;if(n.readonly)return;const O=j.value.trim(),L=((ke=(se=n.selectedNode)==null?void 0:se.link)==null?void 0:ke.url)??"";O!==L&&i("set-link",O)}const E=e.ref("");e.watch(()=>{var O,L,se;return[(O=n.selectedNode)==null?void 0:O.id,(se=(L=n.selectedNode)==null?void 0:L.image)==null?void 0:se.src]},()=>{var O,L;E.value=((L=(O=n.selectedNode)==null?void 0:O.image)==null?void 0:L.src)??""},{immediate:!0});function re(){var se,ke;if(n.readonly)return;const O=E.value.trim(),L=((ke=(se=n.selectedNode)==null?void 0:se.image)==null?void 0:ke.src)??"";O!==L&&i("set-image",O)}function pe(O){const L=O.target;L.style.display="none"}function de(O){const L=O.target;L.style.display=""}const Ee=e.ref(""),ee=e.ref(null);xi(ee,{minRows:4,maxRows:18}),e.watch(()=>{var O,L,se;return[(O=n.selectedNode)==null?void 0:O.id,(se=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:se.raw]},()=>{var O,L;Ee.value=((L=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:L.raw)??""},{immediate:!0});const ce=e.computed(()=>_i(jo(Ee.value),Tn(Ee.value)));function ue(){var ke,z;if(n.readonly)return;const O=Ee.value,L=((z=(ke=n.selectedNode)==null?void 0:ke.richContent)==null?void 0:z.raw)??"";if(O===L)return;const se=Tn(O)||void 0;i("set-rich",O?{kind:"code",raw:O,lang:se}:null)}const g=e.ref(""),V=e.ref(null);xi(V,{minRows:4,maxRows:14}),e.watch(()=>{var O,L,se;return[(O=n.selectedNode)==null?void 0:O.id,(se=(L=n.selectedNode)==null?void 0:L.richContent)==null?void 0:se.raw]},()=>{var O,L;g.value=((L=(O=n.selectedNode)==null?void 0:O.richContent)==null?void 0:L.raw)??""},{immediate:!0});function G(){var se,ke;if(n.readonly)return;const O=g.value,L=((ke=(se=n.selectedNode)==null?void 0:se.richContent)==null?void 0:ke.raw)??"";O!==L&&i("set-rich",O?{kind:"table",raw:O}:null)}const oe=e.computed(()=>Ri(g.value)),fe=e.computed(()=>{const O=[];return s.value||O.push(`${a.value.length} 字`),$.value&&O.push("1 链接"),R.value&&O.push("1 图片"),I.value&&O.push("代码块"),_.value&&O.push("表格"),O.length===0?"节点没有额外内容":O.join(" · ")});return(O,L)=>{var se,ke,z,S;return e.openBlock(),e.createElementBlock("div",rp,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",ap,[e.createElementVNode("div",sp,[L[12]||(L[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",cp,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",dp,e.toDisplayString(fe.value),1)]),e.createElementVNode("div",up,[e.createElementVNode("section",fp,[e.createElementVNode("header",mp,[L[13]||(L[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),L[14]||(L[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:p},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",pp,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:c,"onUpdate:modelValue":L[0]||(L[0]=F=>a.value=F),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:h,onKeydown:w},null,40,hp),[[e.vModelText,a.value]]),d.value?(e.openBlock(),e.createElementBlock("div",gp,[s.value?(e.openBlock(),e.createElementBlock("div",kp," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,bp))])):e.createCommentVNode("",!0)]),!t.readonly&&!s.value?(e.openBlock(),e.createElementBlock("div",yp,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:C},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",xp,[!$.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:L[1]||(L[1]=F=>y.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!R.value&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:L[2]||(L[2]=F=>k.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!I.value&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:L[3]||(L[3]=F=>m.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!_.value&&!P.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:L[4]||(L[4]=F=>P.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),$.value||y.value?(e.openBlock(),e.createElementBlock("section",Ep,[L[15]||(L[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":L[5]||(L[5]=F=>j.value=F),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:Y,onKeydown:L[6]||(L[6]=e.withKeys(e.withModifiers(F=>F.target.blur(),["prevent"]),["enter"]))},null,40,wp),[[e.vModelText,j.value]]),$.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(se=t.selectedNode.link)==null?void 0:se.url,target:"_blank",rel:"noopener noreferrer",title:(ke=t.selectedNode.link)==null?void 0:ke.url},e.toDisplayString((z=t.selectedNode.link)==null?void 0:z.url),9,Np)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),R.value||k.value?(e.openBlock(),e.createElementBlock("section",Sp,[L[16]||(L[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":L[7]||(L[7]=F=>E.value=F),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:re,onKeydown:L[8]||(L[8]=e.withKeys(e.withModifiers(F=>F.target.blur(),["prevent"]),["enter"]))},null,40,Tp),[[e.vModelText,E.value]]),R.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(S=t.selectedNode.image)==null?void 0:S.src,alt:t.selectedNode.text,onError:pe,onLoad:de},null,40,Cp)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),I.value||m.value?(e.openBlock(),e.createElementBlock("section",Mp,[e.createElementVNode("header",Ap,[L[17]||(L[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(Tn)(Ee.value)?(e.openBlock(),e.createElementBlock("span",_p,e.toDisplayString(e.unref(Tn)(Ee.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:ee,"onUpdate:modelValue":L[9]||(L[9]=F=>Ee.value=F),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:ue},null,40,Rp),[[e.vModelText,Ee.value]]),Ee.value.trim()?(e.openBlock(),e.createElementBlock("pre",Bp,[e.createElementVNode("code",{innerHTML:ce.value},null,8,vp)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||P.value?(e.openBlock(),e.createElementBlock("section",zp,[L[18]||(L[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:V,"onUpdate:modelValue":L[10]||(L[10]=F=>g.value=F),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
|
|
130
130
|
| --- | --- |
|
|
131
|
-
| a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:
|
|
132
|
-
`:"```\n",
|
|
131
|
+
| a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:G},null,40,Ip),[[e.vModelText,g.value]]),oe.value.length?(e.openBlock(),e.createElementBlock("table",Lp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,(F,W)=>(e.openBlock(),e.createElementBlock("tr",{key:W},[W===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(F,(te,ye)=>(e.openBlock(),e.createElementBlock("th",{key:`h${ye}`},e.toDisplayString(te),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(F,(te,ye)=>(e.openBlock(),e.createElementBlock("td",{key:`c${ye}`},e.toDisplayString(te),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",lp,[...L[11]||(L[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),Op=["viewBox","width","height"],Dp={class:"zm-edges"},Vp=["d","fill"],$p=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],Pp=["src","width","height","alt"],Fp=["onDblclick"],Up={key:0,class:"zm-rich-code"},Hp=["innerHTML"],Wp={key:1,class:"zm-rich-table"},Gp={key:2,class:"zm-text"},jp={key:0,class:"zm-node-markers"},Kp=["title","innerHTML"],Yp={class:"zm-text-label"},qp=["href","title"],Xp=["title","onClick"],Zp={key:4,class:"zm-node-tags"},Jp=["title"],Qp=["title","onClick"],eh=["onClick"],th=["onMousedown"],nh=["onClick"],oh=["title"],ih=["src"],rh=["src"],Rn=24,Kn=400,gn=160,Kl=4,ei=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1},builtInDrawers:{type:Boolean,default:!0}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const i=t,a=n,c=e.ref(null),s=e.ref(null),u=e.ref(""),d=e.ref(new Set),p=e.computed(()=>d.value.values().next().value??null),h=e.ref(new Set),w=e.ref(!1),C=e.ref(null),$=e.ref(0),R=e.ref(0),U=e.computed(()=>{const r=C.value;if(!r||!r.currentTargetId||!r.dropPosition||r.dropPosition==="child")return null;const l=sn.value.find(B=>B.id===r.currentTargetId);if(!l)return null;const f=l.width/2,N=l.height/2;if(l._dir==="down"){const B=r.dropPosition==="before"?l.x-f:l.x+f;return{x1:B,y1:l.y-N,x2:B,y2:l.y+N,horizontal:!1}}const x=r.dropPosition==="before"?l.y-N:l.y+N;return{x1:l.x-f,y1:x,x2:l.x+f,y2:x,horizontal:!0}}),I=e.ref(null),_=e.ref(null),y=e.ref(null),k=e.ref(""),m=e.ref(Ot(i.data)),P=e.ref({}),j=e.ref({}),Y=e.ref(i.markdown!==void 0);let E=!1;e.watch(()=>i.markdown,r=>{if(r===void 0){Y.value=!1;return}Y.value=!0;const l=On(r||"");E=!0,m.value=Ot(l),d.value=new Set,h.value=new Set,we(),e.nextTick(()=>{E=!1,cn()})}),e.watch(m,()=>{Y.value&&!E&&a("markdownChange",Dn(m.value))},{deep:!0});const re=e.computed(()=>M.showOrderBadge===!0),pe=e.ref(new Map),de=pe.value;function Ee(r,l){const f={};l.bg&&(f.bg=l.bg),l.textColor&&(f.textColor=l.textColor),l.borderColor&&(f.borderColor=l.borderColor),l.fontWeight&&(f.fontWeight=l.fontWeight),l.fontSize&&(f.fontSize=l.fontSize),Object.keys(f).length===0?de.delete(r):de.set(r,f),pe.value=new Map(de)}function ee(r){return de.get(r)??{}}function ce(r,l){const f=be(m.value,r);f&&(f.image={src:l.src,naturalW:l.naturalW,naturalH:l.naturalH,width:V(l.width,Rn,Kn),height:V(l.height,Rn,Kn)},Ve(),we(),a("change",m.value))}function ue(r){const l=be(m.value,r);!l||!l.image||(delete l.image,Ve(),we(),a("change",m.value))}function g(r,l){const f=l.trim();if(!be(m.value,r))return;if(!f){ue(r);return}const x=new Image;x.onload=()=>{const B=be(m.value,r);if(!B)return;const A=x.naturalWidth&&x.naturalHeight?x.naturalWidth/x.naturalHeight:1,v=V(x.naturalWidth||gn,Rn,Kn),Z=Math.round(v/A);B.image={src:f,naturalW:x.naturalWidth||v,naturalH:x.naturalHeight||Z,width:v,height:Z},Ve(),we(),a("change",m.value)},x.onerror=()=>{},x.src=f}function V(r,l,f){return Math.min(f,Math.max(l,r))}function G(r,l){const f=new FileReader;f.onload=()=>{if(typeof f.result!="string")return;const N=f.result,x=new window.Image;x.onload=()=>{const B=x.naturalWidth||gn,A=x.naturalHeight||gn,v=V(B,Rn,gn),Z=V(Math.round(A*v/B),Rn,Kn);l({src:N,naturalW:B,naturalH:A,width:v,height:Z})},x.onerror=()=>{l({src:N,naturalW:gn,naturalH:gn,width:gn,height:gn})},x.src=N},f.readAsDataURL(r)}function oe(r){const l=document.createElement("input");l.type="file",l.accept="image/*",l.style.display="none",l.onchange=()=>{var N;const f=(N=l.files)==null?void 0:N[0];f&&(G(f,x=>ce(r,x)),document.body.removeChild(l))},document.body.appendChild(l),l.click()}function fe(r,l){const f=l.trim(),N=be(m.value,r);N&&(f?N.link={url:f}:delete N.link,Ve(),we(),a("change",m.value))}function O(r){fe(r,"")}function L(r,l){const f=be(m.value,r);f&&(l?f.note={text:l}:delete f.note,Ve(),we(),a("change",m.value))}function se(r){L(r,"")}function ke(r,l){const f=be(m.value,r);f&&(l?f.richContent=l:delete f.richContent,Ve(),we(),a("change",m.value))}const z=e.ref(null),S=e.ref(null),F=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" ")),W=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||w.value)?"is-visible":""].filter(Boolean).join(" "));function te(r,l){i.previewMode||(r.preventDefault(),r.stopPropagation(),S.value=null,d.value=new Set([l.id]),st(),z.value={nodeId:l.id,x:r.clientX,y:r.clientY})}function ye(){z.value=null}function nt(r){const l=r.target;if(!(l!=null&&l.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline"))){if(ui&&ge.panMoved.value){ui=!1,r.preventDefault();return}r.preventDefault(),z.value&&(z.value=null),S.value={x:r.clientX,y:r.clientY}}}function ft(){S.value=null}function ot(){ft(),i.builtInDrawers&&(Ct(),De.value=!0),a("canvas-settings")}function ln(){ft(),i.builtInDrawers&&(Ct(),Pt.value=!0),a("canvas-data")}function it(r){ft(),i.builtInDrawers&&(Ct(),Ft.value=r,Pt.value=!0),a("canvas-import",r)}const an=e.ref(!1),Pt=e.ref(!1),me=e.ref(!1),mt=e.ref(!1),De=e.ref(!1),ze=e.ref(0),Ft=e.ref(null),rt=e.ref(new Set);function Ct(){Pt.value=!1,me.value=!1,mt.value=!1,De.value=!1}const wt=e.computed(()=>{const r=p.value;return r?be(m.value,r)??null:null}),q=e.computed(()=>wt.value?ee(wt.value.id):{});function le(r){r.autoBalanceOnChange!==void 0&&(M.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(M.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(M.lineWidthEnd=Math.max(.1,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(M.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(M.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(M.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(M.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(M.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(M.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(M.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(M.lineWidthTaper=Math.max(.1,Math.min(1,r.lineWidthTaper))),r.uniformLineWidth!==void 0&&(M.uniformLineWidth=r.uniformLineWidth),r.elbowRadius!==void 0&&(M.elbowRadius=Math.max(2,Math.min(40,r.elbowRadius))),r.showOrderBadge!==void 0&&(M.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(M.canvasBg=r.canvasBg)}function xe(r){wt.value&&Ee(wt.value.id,r)}function Re(){const r={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0};M.autoBalanceOnChange=r.autoBalanceOnChange,M.lineWidthStart=r.lineWidthStart,M.lineWidthEnd=r.lineWidthEnd,M.rainbowBranch=r.rainbowBranch,M.branchPaletteId=r.branchPaletteId,M.customPalettes=r.customPalettes,M.lineStyle=r.lineStyle,M.rootLineStyle=r.rootLineStyle,M.lineOrigin=r.lineOrigin,M.layoutMode=r.layoutMode,M.taperedEdge=r.taperedEdge,M.lineWidthTaper=r.lineWidthTaper,M.uniformLineWidth=r.uniformLineWidth,M.elbowRadius=r.elbowRadius,M.showOrderBadge=r.showOrderBadge,M.canvasBg=r.canvasBg}function Ge(){Ft.value=null}function lt(r){const l=p.value;l&&L(l,r)}function Mt(){const r=p.value;r&&se(r)}function Bn(r){const l=p.value;l&&fe(l,r)}function ni(r){const l=p.value;l&&g(l,r)}function oi(r){const l=p.value;l&&ke(l,r)}function ho(r){const l=document.querySelector(`[data-node-id="${r.id}"]`);l&&l.click()}function ii(r){ha(r.id,r.text)}function Yn(r){oo(r)}function qn(r){ci(r)}function Ut(r){tr(r.srcId,r.targetId,r.position)}function bn(r){const l=new Set(rt.value);l.has(r)?l.delete(r):l.add(r),rt.value=l}function go(){i.builtInDrawers&&(an.value=!an.value),a("canvas-outline")}function bo(){var l;const r=(l=z.value)==null?void 0:l.nodeId;r&&oe(r)}function Yi(){var N,x,B;const r=(N=z.value)==null?void 0:N.nodeId;if(!r)return;const l=((B=(x=be(m.value,r))==null?void 0:x.link)==null?void 0:B.url)??"",f=window.prompt("输入链接 URL(留空取消)",l);f!==null&&fe(r,f)}function ko(){var l;const r=(l=z.value)==null?void 0:l.nodeId;r&&O(r)}function yo(){var l;const r=(l=z.value)==null?void 0:l.nodeId;r&&li(r)}function qi(){var l;const r=(l=z.value)==null?void 0:l.nodeId;r&&se(r)}function vn(){var l;const r=(l=z.value)==null?void 0:l.nodeId;r&&ue(r)}function ri(){var ie,T;const r=(ie=z.value)==null?void 0:ie.nodeId;if(!r)return;const l=(T=be(m.value,r))==null?void 0:T.richContent,f=(l==null?void 0:l.kind)==="code"?jo(l.raw):"",N=(l==null?void 0:l.kind)==="code"&&l.lang||"",x=N?"```"+N+`
|
|
132
|
+
`:"```\n",A=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",f?x+f+(f.endsWith("```")?"":"\n```"):x+"// 你的代码"+"\n```");if(A===null)return;const v=A.trim();if(!v){ke(r,null);return}const Z=/^```([^\s`]*)/.exec(v),H=Z?Z[1]:void 0;ke(r,{kind:"code",raw:v,lang:H})}function Xi(){var l;const r=(l=z.value)==null?void 0:l.nodeId;r&&ke(r,null)}function je(){var A,v;const r=(A=z.value)==null?void 0:A.nodeId;if(!r)return;const l=(v=be(m.value,r))==null?void 0:v.richContent,f=(l==null?void 0:l.kind)==="table"?l.raw:"",x=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",f||`| 列1 | 列2 | 列3 |
|
|
133
133
|
| --- | --- | --- |
|
|
134
|
-
| a | b | c |`);if(E===null)return;const B=E.trim();if(!B){be(r,null);return}be(r,{kind:"table",raw:B})}function hn(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&be(r,null)}function ri(r){i.previewMode||(d.value=new Set([r]),at(),i.builtInDrawers&&(xt(),ft.value=!0,Be.value++),a("edit-note",r))}function li(r,l=60){const f=r.replace(/\s+/g," ").trim();return f.length<=l?f||"点击编辑笔记":f.slice(0,l)+"…"}function qn(r){var E;if(i.previewMode||s.value)return;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const f=p.value;if(!f)return;const S=(E=r.clipboardData)==null?void 0:E.items;if(S)for(let B=0;B<S.length;B++){const M=S[B];if(M.kind==="file"&&M.type.startsWith("image/")){const v=M.getAsFile();if(!v)continue;r.preventDefault();const j=he(m.value,f);if(j!=null&&j.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;W(v,K=>ae(f,K));return}}}e.onMounted(()=>{window.addEventListener("paste",qn),window.addEventListener("keydown",yo),Se()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",qn),window.removeEventListener("keydown",yo)});function yo(r){if((r.metaKey||r.ctrlKey)&&(r.key==="f"||r.key==="F")){const f=r.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;r.preventDefault(),a("canvas-outline")}}const gn=e.ref(null),qi=e.computed(()=>{var r;return((r=gn.value)==null?void 0:r.nodeId)??null});function Mt(r,l){if(!l.image)return;r.preventDefault(),r.stopPropagation();const f=l.image.naturalW||l.image.width,S=l.image.naturalH||l.image.height,E=S>0?S/f:1;gn.value={nodeId:l.id,startX:r.clientX,startY:r.clientY,startW:l.image.width,startH:l.image.height,naturalW:f,naturalH:S,ratio:E,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",Jt),window.addEventListener("mouseup",Eo)}function Jt(r){var j,K;const l=gn.value;if(!l)return;const f=pe.scale.value||1,S=r.clientX-l.startX,E=V(l.startW+S/f,Mn,jn),B=V(E*l.ratio,Mn,jn);l.pendingW=E,l.pendingH=B;const M=(j=c.value)==null?void 0:j.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);M&&(M.style.width=`${E}px`,M.style.height=`${B}px`);const v=(K=c.value)==null?void 0:K.querySelector(`[data-node-id="${l.nodeId}"]`);v&&(v.style.minWidth=`${Math.max(80,Math.ceil(E+28))}px`,v.style.height=`${Math.ceil(B+8+30)}px`)}function Eo(){const r=gn.value;if(window.removeEventListener("mousemove",Jt),window.removeEventListener("mouseup",Eo),gn.value=null,!r)return;const l=he(m.value,r.nodeId);!l||!l.image||(ae(r.nodeId,{src:l.image.src,naturalW:l.image.naturalW,naturalH:l.image.naturalH,width:r.pendingW,height:r.pendingH}),d.value=new Set([r.nodeId]),at(),Rn=!0)}const Xn=e.ref(null);let Rn=!1;function Zn(r){Xn.value=r}function bn(r){Xn.value===r&&(Xn.value=null),A.value&&(A.value=null)}function Jn(r,l){var de;if(!l.text||l.text.length<14)return;const S=r.currentTarget.getBoundingClientRect(),E=(de=c.value)==null?void 0:de.getBoundingClientRect();if(!E)return;const B=10,M=240,v=S.top-E.top>60,j=S.left-E.left+S.width/2,K=B+M/2,ye=E.width-M/2-B,T=Math.max(K,Math.min(j,ye)),Q=v?S.top-E.top-8:S.bottom-E.top+8;A.value={text:l.text,x:T,y:Q,above:v}}const At=e.ref(0),Qn=e.ref(!1),Gt=is(100);function Oe(){Gt.record({data:m.value,selectedIds:[...d.value]})}function Se(){h.value=new Set(h.value),At.value++,e.nextTick().then(()=>e.nextTick()).then(()=>ai()).then(()=>{At.value++})}function ai(){const r=document.querySelectorAll(".zm-rich"),l={},f={};r.forEach(S=>{let E=S,B=null;for(;E&&!B;)B=E.getAttribute("data-node-id"),E=E.parentElement;if(!B)return;const M=S.offsetHeight,v=S.scrollWidth,j=Math.round(M*2)/2,K=Math.round(v*2)/2;l[B]=j,f[B]=K,P.value[B],G.value[B]}),P.value=l,G.value=f}const lt=e.computed(()=>{var r,l,f,S,E,B,M,v,j,K;return{rootBg:((r=i.theme)==null?void 0:r.rootBg)??"#1f2937",rootText:((l=i.theme)==null?void 0:l.rootText)??"#ffffff",branchBg:((f=i.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((S=i.theme)==null?void 0:S.branchText)??"#1f2937",lineColor:((E=i.theme)==null?void 0:E.lineColor)??"#94a3b8",bgColor:((B=i.theme)==null?void 0:B.bgColor)??"#f8fafc",fontSize:((M=i.theme)==null?void 0:M.fontSize)??14,lineWidthStart:((v=i.theme)==null?void 0:v.lineWidthStart)??2.2,lineWidthEnd:((j=i.theme)==null?void 0:j.lineWidthEnd)??.8,rainbowBranch:((K=i.theme)==null?void 0:K.rainbowBranch)??!1}}),Qt=e.computed(()=>_.canvasBg||lt.value.bgColor),_=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,elbowRadius:8,showOrderBadge:!1,canvasBg:void 0});function g(r){return r?_.rootLineStyle:_.lineStyle}function L(r){return _.taperedEdge?ve(r):we(r)}function Z(r){return _.taperedEdge?_.lineWidthEnd:we(r)}function ve(r){const l=_.lineWidthTaper,f=_.lineWidthStart*Math.pow(l,r);return Math.max(_.lineWidthEnd,f)}function we(r){if(r<=0)return _.lineWidthStart;if(r>=3)return _.lineWidthEnd;const l=r/3;return _.lineWidthStart+(_.lineWidthEnd-_.lineWidthStart)*l}function Le(r,l,f,S){const E=1-r,B=E*E*E*l.x+3*E*E*r*f.x1+3*E*r*r*f.x2+r*r*r*S.x,M=E*E*E*l.y+3*E*E*r*f.y1+3*E*r*r*f.y2+r*r*r*S.y;return{x:B,y:M}}function Xe(r,l,f,S){const E=1-r,B=E*E*l.x+2*E*r*f.x+r*r*S.x,M=E*E*l.y+2*E*r*f.y+r*r*S.y;return{x:B,y:M}}function yt(r,l,f,S,E=32,B="curve",M="right"){if(B==="curve"){let v;if(M==="right"||M==="left"){const de=Math.abs(l.x-r.x)*.45,se=M==="right"?1:-1;v={x1:r.x+se*de,y1:r.y,x2:l.x-se*de,y2:l.y}}else{const de=Math.abs(l.y-r.y)*.45;v={x1:r.x,y1:r.y+de,x2:l.x,y2:l.y-de}}const j=Q=>{const de=1-Q,se=-3*de*de*r.x+3*(de*de-2*de*Q)*v.x1+3*(2*de*Q-Q*Q)*v.x2+3*Q*Q*l.x,Te=-3*de*de*r.y+3*(de*de-2*de*Q)*v.y1+3*(2*de*Q-Q*Q)*v.y2+3*Q*Q*l.y;return{dx:se,dy:Te}},K=[],ye=[];for(let Q=0;Q<=E;Q++){const de=Q/E,se=Q===0?r:Q===E?l:Le(de,r,v,l),Te=j(de);let Ie=Math.hypot(Te.dx,Te.dy);Ie<1e-6&&(Ie=1);const Me=-Te.dy/Ie,te=Te.dx/Ie,ne=(f+(S-f)*de)/2;K.push({x:se.x+Me*ne,y:se.y+te*ne}),ye.push({x:se.x-Me*ne,y:se.y-te*ne})}let T=`M ${K[0].x.toFixed(2)} ${K[0].y.toFixed(2)}`;for(let Q=1;Q<=E;Q++)T+=` L ${K[Q].x.toFixed(2)} ${K[Q].y.toFixed(2)}`;for(let Q=E;Q>=0;Q--)T+=` L ${ye[Q].x.toFixed(2)} ${ye[Q].y.toFixed(2)}`;return T+=" Z",T}if(B==="arc"){let v;M==="right"||M==="left"?v={x:(r.x+l.x)/2,y:l.y}:v={x:l.x,y:(r.y+l.y)/2};const j=se=>{const Te=1-se,Ie=2*Te*(v.x-r.x)+2*se*(l.x-v.x),Me=2*Te*(v.y-r.y)+2*se*(l.y-v.y);return{dx:Ie,dy:Me}},K=[],ye=[];for(let se=0;se<=E;se++){const Te=se/E,Ie=se===0?r:se===E?l:Xe(Te,r,v,l),Me=j(Te);let te=Math.hypot(Me.dx,Me.dy);te<1e-6&&(te=1);const ne=-Me.dy/te,je=Me.dx/te,Y=(f+(S-f)*Te)/2;K.push({x:Ie.x+ne*Y,y:Ie.y+je*Y}),ye.push({x:Ie.x-ne*Y,y:Ie.y-je*Y})}const T=f/2,Q=S/2;let de=`M ${K[0].x.toFixed(2)} ${K[0].y.toFixed(2)}`;for(let se=1;se<=E;se++)de+=` L ${K[se].x.toFixed(2)} ${K[se].y.toFixed(2)}`;de+=` A ${Q.toFixed(2)} ${Q.toFixed(2)} 0 0 0 ${ye[E].x.toFixed(2)} ${ye[E].y.toFixed(2)}`;for(let se=E-1;se>=0;se--)de+=` L ${ye[se].x.toFixed(2)} ${ye[se].y.toFixed(2)}`;return de+=` A ${T.toFixed(2)} ${T.toFixed(2)} 0 0 0 ${K[0].x.toFixed(2)} ${K[0].y.toFixed(2)}`,de+=" Z",de}if(B==="elbow"){const v=[];if(M==="down"){const te=(r.y+l.y)/2;v.push(r,{x:r.x,y:te},{x:l.x,y:te},l)}else{const te=(r.x+l.x)/2;v.push(r,{x:te,y:r.y},{x:te,y:l.y},l)}const j=[];let K=0;for(let te=0;te<v.length-1;te++){const ne=Math.hypot(v[te+1].x-v[te].x,v[te+1].y-v[te].y);j.push(ne),K+=ne}const ye=[f/2];let T=0;for(let te=0;te<j.length-1;te++){T+=j[te];const ne=K>0?T/K:0;ye.push((f+(S-f)*ne)/2)}ye.push(S/2);const Q=[];for(let te=0;te<v.length-1;te++){const ne=v[te+1].x-v[te].x,je=v[te+1].y-v[te].y;let Y=Math.hypot(ne,je);Y<1e-6&&(Y=1),Q.push({x:-je/Y,y:ne/Y})}const de=[],se=[];de.push({x:v[0].x+Q[0].x*ye[0],y:v[0].y+Q[0].y*ye[0]}),se.push({x:v[0].x-Q[0].x*ye[0],y:v[0].y-Q[0].y*ye[0]});for(let te=1;te<v.length-1;te++){const ne=Q[te-1],je=Q[te],Y=ye[te];de.push({x:v[te].x+ne.x*Y+je.x*Y,y:v[te].y+ne.y*Y+je.y*Y}),se.push({x:v[te].x-ne.x*Y-je.x*Y,y:v[te].y-ne.y*Y-je.y*Y})}const Te=Q[Q.length-1],Ie=ye[ye.length-1];de.push({x:v[v.length-1].x+Te.x*Ie,y:v[v.length-1].y+Te.y*Ie}),se.push({x:v[v.length-1].x-Te.x*Ie,y:v[v.length-1].y-Te.y*Ie});let Me=`M ${de[0].x.toFixed(2)} ${de[0].y.toFixed(2)}`;for(let te=1;te<de.length;te++)Me+=` L ${de[te].x.toFixed(2)} ${de[te].y.toFixed(2)}`;for(let te=se.length-1;te>=0;te--)Me+=` L ${se[te].x.toFixed(2)} ${se[te].y.toFixed(2)}`;return Me+=" Z",Me}if(B==="rounded-elbow"){let v=function(Y,$e,Nt){const Pt={x:Y.pos.x-$e*Y.d1.x,y:Y.pos.y-$e*Y.d1.y},Bn={x:Y.pos.x+$e*Y.d2.x,y:Y.pos.y+$e*Y.d2.y},St={x:Y.pos.x+$e*(Y.d2.x-Y.d1.x),y:Y.pos.y+$e*(Y.d2.y-Y.d1.y)},vn=Math.atan2(Pt.y-St.y,Pt.x-St.x);let We=Math.atan2(Bn.y-St.y,Bn.x-St.x)-vn;for(;We>Math.PI;)We-=2*Math.PI;for(;We<-Math.PI;)We+=2*Math.PI;const Ke=[];for(let Ct=1;Ct<Nt;Ct++){const Pe=Ct/Nt,Kt=vn+We*Pe;Ke.push({x:St.x+$e*Math.cos(Kt),y:St.y+$e*Math.sin(Kt)})}return Ke};const j=[];let K;if(M==="down"){const Y=(r.y+l.y)/2,$e=Math.sign(Y-r.y)||1,Nt=Math.sign(l.x-r.x)||1,Pt=Math.sign(l.y-Y)||1;K=[{pos:{x:r.x,y:Y},d1:{x:0,y:$e},d2:{x:Nt,y:0}},{pos:{x:l.x,y:Y},d1:{x:Nt,y:0},d2:{x:0,y:Pt}}]}else{const Y=(r.x+l.x)/2,$e=Math.sign(Y-r.x)||1,Nt=Math.sign(l.y-r.y)||1,Pt=Math.sign(l.x-Y)||1;K=[{pos:{x:Y,y:r.y},d1:{x:$e,y:0},d2:{x:0,y:Nt}},{pos:{x:Y,y:l.y},d1:{x:0,y:Nt},d2:{x:Pt,y:0}}]}const ye=Math.hypot(K[0].pos.x-r.x,K[0].pos.y-r.y),T=Math.hypot(K[1].pos.x-K[0].pos.x,K[1].pos.y-K[0].pos.y),Q=Math.hypot(l.x-K[1].pos.x,l.y-K[1].pos.y),de=Math.min(ye,T,Q,_.elbowRadius)*.45,se=Math.max(2,de);j.push(r),j.push({x:K[0].pos.x-se*K[0].d1.x,y:K[0].pos.y-se*K[0].d1.y});for(const Y of v(K[0],se,7))j.push(Y);j.push({x:K[1].pos.x-se*K[1].d1.x,y:K[1].pos.y-se*K[1].d1.y});for(const Y of v(K[1],se,7))j.push(Y);j.push(l);const Te=[];let Ie=0;for(let Y=0;Y<j.length-1;Y++){const $e=Math.hypot(j[Y+1].x-j[Y].x,j[Y+1].y-j[Y].y);Te.push($e),Ie+=$e}const Me=[],te=[];let ne=0;for(let Y=0;Y<j.length;Y++){const $e=j[Math.max(0,Y-1)],Nt=j[Math.min(j.length-1,Y+1)],Pt=Nt.x-$e.x,Bn=Nt.y-$e.y;let St=Math.hypot(Pt,Bn);St<1e-6&&(St=1);const vn=-Bn/St,Tt=Pt/St;Y>0&&(ne+=Te[Y-1]);const We=Ie>0?ne/Ie:0,Ke=(f+(S-f)*We)/2;Me.push({x:j[Y].x+vn*Ke,y:j[Y].y+Tt*Ke}),te.push({x:j[Y].x-vn*Ke,y:j[Y].y-Tt*Ke})}let je=`M ${Me[0].x.toFixed(2)} ${Me[0].y.toFixed(2)}`;for(let Y=1;Y<Me.length;Y++)je+=` L ${Me[Y].x.toFixed(2)} ${Me[Y].y.toFixed(2)}`;je+=` L ${te[Me.length-1].x.toFixed(2)} ${te[Me.length-1].y.toFixed(2)}`;for(let Y=te.length-2;Y>=0;Y--)je+=` L ${te[Y].x.toFixed(2)} ${te[Y].y.toFixed(2)}`;return je+=" Z",je}{const v=l.x-r.x,j=l.y-r.y;let K=Math.hypot(v,j);K<1e-6&&(K=1);const ye=-j/K,T=v/K,Q=f/2,de=S/2,se={x:r.x+ye*Q,y:r.y+T*Q},Te={x:r.x-ye*Q,y:r.y-T*Q},Ie={x:l.x-ye*de,y:l.y-T*de},Me={x:l.x+ye*de,y:l.y+T*de};return`M ${se.x.toFixed(2)} ${se.y.toFixed(2)} L ${Me.x.toFixed(2)} ${Me.y.toFixed(2)} L ${Ie.x.toFixed(2)} ${Ie.y.toFixed(2)} L ${Te.x.toFixed(2)} ${Te.y.toFixed(2)} Z`}}const mt=e.computed(()=>pt.value.root.children),xo=dn[0].colors,Ze=e.computed(()=>Wa(_.branchPaletteId,_.customPalettes)),en=e.computed(()=>{const r=new Map;if(!_.rainbowBranch)return r;const l=i.lineColors,f=l&&l.length>0?l:Ze.value.colors.length>0?Ze.value.colors:xo;for(let E=0;E<mt.value.length;E++){const B=mt.value[E];r.set(B.id,f[E%f.length])}const S=(E,B)=>{r.set(E.id,B);for(const M of E.children)S(M,B)};for(let E=0;E<mt.value.length;E++){const B=mt.value[E];S(B,f[E%f.length])}return r});function wo(r,l){return _.rainbowBranch?en.value.get(l.id)??lt.value.lineColor:lt.value.lineColor}function Kl(r){const l=me(r.id);if(l.bg)return l.bg;if(r.isRoot)return lt.value.rootBg;if(_.rainbowBranch){const f=en.value.get(r.id);if(f)return sh(f,.18)}return lt.value.branchBg}function eo(r){const l=me(r.id);if(l.textColor)return l.textColor;if(r.isRoot)return lt.value.rootText;if(_.rainbowBranch){const f=en.value.get(r.id);if(f)return Xl(f,.55)}return lt.value.branchText}function to(r){const l=me(r.id);if(l.borderColor)return l.borderColor;if(r.isRoot)return lt.value.rootBg;if(_.rainbowBranch){const f=en.value.get(r.id);if(f)return Xl(f,.3)}return lt.value.lineColor}function Yl(r){const l=me(r.id);return l.fontWeight?l.fontWeight:r.isRoot?700:r.depth<=1?600:r.depth===2?500:400}function ql(r){return me(r.id).fontSize??r.fontSize??lt.value.fontSize}function sh(r,l){const f=r.replace("#",""),S=f.length===6?f:f.split("").map(v=>v+v).join(""),E=parseInt(S.slice(0,2),16),B=parseInt(S.slice(2,4),16),M=parseInt(S.slice(4,6),16);return`rgba(${E}, ${B}, ${M}, ${l})`}function Xl(r,l){const f=r.replace("#",""),S=f.length===6?f:f.split("").map(v=>v+v).join(""),E=Math.round(parseInt(S.slice(0,2),16)*(1-l)),B=Math.round(parseInt(S.slice(2,4),16)*(1-l)),M=Math.round(parseInt(S.slice(4,6),16)*(1-l));return`rgb(${E}, ${B}, ${M})`}const pe=ts({getContainer:()=>c.value});pe.setOnMarqueeEnd(Mh),os({isEditing:()=>s.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>p.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:no,onAddSibling:si,onAddSiblingBefore:gh,onRemove:ca,onStartEdit:No,onClearSelection:()=>{d.value=new Set,at()},onDuplicate:na,onCopy:la,onCut:aa,onPaste:sa,hasClipboard:()=>!!O.value&&O.value.nodes.length>0,onUndo:Zi,onRedo:Ji,onNavigate:bh,onMoveSibling:Eh,onSelectRoot:()=>{d.value=new Set([m.value.id]),at()}});const pt=e.computed(()=>{const r=It(m.value);return Ql(r),Pa(r,{mode:_.layoutMode,baseFontSize:lt.value.fontSize,richHeights:P.value,richWidths:G.value})}),Zl=e.ref([]),rn=e.computed(()=>(At.value,Zl.value));e.watch(pt,r=>{const l=[],f=S=>{l.push(S);for(const E of S.children)f(E)};f(r.root),Zl.value=l},{immediate:!0});const Jl=e.computed(()=>{const r=[];for(const l of rn.value)for(const f of l.children)r.push({from:l,to:f,key:`${l.id}->${f.id}`});return r}),ch=e.computed(()=>`${pt.value.vbX} ${pt.value.vbY} ${pt.value.vbW} ${pt.value.vbH}`);function Ql(r){if(h.value.has(r.id)){r.children=[],r.collapsed=!0;return}r.collapsed=!1;for(const l of r.children)Ql(l)}function No(r){const l=he(m.value,r);l&&(s.value=r,u.value=l.text,d.value=new Set([r]),at(),e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select(),ea(f)}))}function Xi(){if(!s.value)return;const r=he(m.value,s.value);r&&r.text!==(u.value.trim()||" ")&&(r.text=u.value.trim()||" ",Oe(),a("change",m.value)),s.value=null}function dh(){s.value=null}function ea(r){r&&(r.style.height="auto",r.style.height=r.scrollHeight+"px")}function uh(r){ea(r.target)}function fh(r){if(i.previewMode)return;const l=he(m.value,r);l!=null&&l.richContent&&(y.value=r,k.value=l.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function ta(){if(!y.value)return;const r=y.value,l=he(m.value,r),f=k.value;if(l&&l.richContent&&l.richContent.raw!==f)if(l.richContent.kind==="code"){const S=wn(f)||void 0;be(r,{kind:"code",raw:f,lang:S})}else be(r,{kind:"table",raw:f});y.value=null}function mh(){y.value=null}function ph(r){r.key==="Escape"?(r.preventDefault(),mh()):r.key==="Enter"&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),ta())}function hh(r){const l=r.metaKey||r.ctrlKey;l&&(r.key==="z"||r.key==="Z")&&!r.shiftKey?(r.preventDefault(),Zi()):(l&&r.shiftKey&&(r.key==="z"||r.key==="Z")||l&&(r.key==="y"||r.key==="Y")&&!r.shiftKey)&&(r.preventDefault(),Ji())}function no(r){const l=yr(m.value,r,vo);l&&(Oe(),Se(),a("change",m.value),e.nextTick(()=>No(l.id)))}function si(r){if(r===m.value.id){no(r);return}const l=Er(m.value,r,vo);l&&(Oe(),Se(),a("change",m.value),e.nextTick(()=>No(l.id)))}function gh(r){if(r===m.value.id){no(r);return}const l=Xa(m.value,r,vo);l&&(Oe(),Se(),a("change",m.value),e.nextTick(()=>No(l.id)))}function na(r){if(r===m.value.id)return;const l=Za(m.value,r);l&&(Oe(),d.value=new Set([l.id]),at(),a("change",m.value),Se())}function oa(r){const l=[],f=new Set;for(const S of r)S!==m.value.id&&(f.has(S)||he(m.value,S)&&(f.add(S),l.push(S)));return l}function ia(r){const l=new Set(r),f=[],S=E=>{l.has(E.id)&&f.push(E.id);for(const B of E.children)S(B)};return S(m.value),f}function ra(r){var l;try{(l=navigator.clipboard)==null||l.writeText(r)}catch{}}function la(r){const l=ia(oa(r));if(l.length===0)return;const f=[];for(const S of l){const E=xr(m.value,S);E&&f.push(E)}f.length!==0&&(O.value={nodes:f,originalIds:new Set(l)},ra(f.map(S=>S.text).join(`
|
|
135
|
-
`)),
|
|
136
|
-
`)),Se(),a("change",m.value)}}function sa(r){const l=O.value;if(!l||l.nodes.length===0)return;const f=r??m.value.id,S=he(m.value,f);if(S){for(const E of l.originalIds){const B=he(m.value,E);if(B&&he(B,f))return}Oe();for(const E of l.nodes){const B=It(E);Bo(B),S.children.push(B)}O.value=null,Se(),a("change",m.value)}}function Zi(){const r=Gt.undo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),at(),Se(),a("change",m.value))}function Ji(){const r=Gt.redo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),at(),Se(),a("change",m.value))}function at(){const r=[];for(const l of d.value){const f=he(m.value,l);f&&r.push(f)}if(i.builtInDrawers&&!i.previewMode&&r.length>0){const l=r[0];!ft.value&&ka(l.id)&&(xt(),ft.value=!0)}else i.builtInDrawers&&r.length===0&&(ft.value=!1);a("select",r.length>0?r:null)}function bh(r,l){const f=p.value??m.value.id,S=he(m.value,f);if(!S)return;let E=null;if(l===1){const B=zt(m.value,S.id);if(B){const M=B.children.findIndex(v=>v.id===S.id);M>=0&&M<B.children.length-1&&(E=B.children[M+1].id)}}else if(l===-1){const B=zt(m.value,S.id);if(B){const M=B.children.findIndex(v=>v.id===S.id);M>0&&(E=B.children[M-1].id)}}else if(r===1){const B=zt(m.value,S.id);B&&(E=B.id)}else r===-1&&S.children.length>0&&(E=S.children[0].id);E&&(d.value=new Set([E]),at())}function ca(r){if(r!==m.value.id&&Ro(m.value,r)){if(Oe(),d.value.has(r)){const l=new Set(d.value);l.delete(r),d.value=l,at()}Se(),a("change",m.value)}}function da(r){h.value.has(r)?h.value.delete(r):h.value.add(r),Se()}function ua(r){const l=[{n:m.value,depth:1}];for(;l.length;){const{n:f,depth:S}=l.pop();r(f,S);for(let E=f.children.length-1;E>=0;E--)l.push({n:f.children[E],depth:S+1})}}function kh(){h.value=new Set,ua(r=>{r.children.length>0&&h.value.add(r.id)}),Se()}function fa(r){h.value=new Set,ua((l,f)=>{f>r&&l.children.length>0&&h.value.add(l.id)}),Se()}function yh(){h.value=new Set,Se()}function ma(r,l){qa(m.value,r,l)&&(Oe(),Se(),a("change",m.value))}function Qi(r,l,f){return hi(m.value,r,l,f)?(Oe(),Se(),a("change",m.value),!0):!1}function Eh(r){const l=p.value;if(!l)return;const f=m.value;if(l===f.id)return;const S=zt(f,l);if(!S)return;const E=S.children.findIndex(v=>v.id===l);if(E<0)return;let B=r;const M=rn.value.find(v=>v.id===l);if(M&&ha(M)&&(B=-r),B<0){if(E===0)return;const v=S.children[E-1].id;hi(f,l,v,"before")}else{if(E>=S.children.length-1)return;const v=S.children[E+1].id;hi(f,l,v,"after")}Oe(),Se(),a("change",f)}function xh(r,l){if(r.stopPropagation(),r.shiftKey){const f=new Set(d.value);f.has(l.id)?f.delete(l.id):f.add(l.id),d.value=f}else d.value=new Set([l.id]);at()}function wh(r,l,f){let S=null;for(const E of rn.value){if(E.id===f)continue;const B=E.width/2,M=E.height/2;r>=E.x-B&&r<=E.x+B&&l>=E.y-M&&l<=E.y+M&&(S=E)}return S}let jt=null;function Nh(r,l){if(i.previewMode||l.isRoot||r.button!==0)return;const f=r.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;r.stopPropagation();const S=c.value.getBoundingClientRect(),E=l.x*pe.scale.value+pe.offsetX.value,B=l.y*pe.scale.value+pe.offsetY.value,M=r.clientX-S.left-E,v=r.clientY-S.top-B;jt={srcId:l.id,srcText:l.text,pointerOffsetX:M,pointerOffsetY:v,startX:r.clientX,startY:r.clientY},window.addEventListener("pointermove",pa),window.addEventListener("pointerup",ci),window.addEventListener("pointercancel",ci)}function pa(r){if(jt){const M=r.clientX-jt.startX,v=r.clientY-jt.startY;if(Math.abs(M)<=Gl&&Math.abs(v)<=Gl)return;C.value={srcId:jt.srcId,srcText:jt.srcText,pointerOffsetX:jt.pointerOffsetX,pointerOffsetY:jt.pointerOffsetY,currentTargetId:null,dropPosition:null},document.body.classList.add("is-dragging"),jt=null}const l=C.value;if(!l)return;const f=c.value.getBoundingClientRect();$.value=r.clientX-f.left-l.pointerOffsetX,R.value=r.clientY-f.top-l.pointerOffsetY;const S=(r.clientX-f.left-pe.offsetX.value)/pe.scale.value,E=(r.clientY-f.top-pe.offsetY.value)/pe.scale.value,B=wh(S,E,l.srcId);l.currentTargetId=(B==null?void 0:B.id)??null,B?l.dropPosition=Sh(S,E,B):l.dropPosition=null}function Sh(r,l,f){if(f.isRoot)return"child";const S=f.width/2,E=f.height/2;if(f._dir==="down"){const M=r-f.x;return M<-S*.3?"before":M>S*.3?"after":"child"}const B=l-f.y;return B<-E*.3?"before":B>E*.3?"after":"child"}function ha(r){var l;return!!((l=r.parent)!=null&&l.isRoot)&&r._dir==="left"}function ci(r){if(window.removeEventListener("pointermove",pa),window.removeEventListener("pointerup",ci),window.removeEventListener("pointercancel",ci),jt){jt=null;return}const l=C.value;if(l){if(l.currentTargetId&&l.dropPosition){let f=l.dropPosition;if(f!=="child"){const S=rn.value.find(E=>E.id===l.currentTargetId);S&&ha(S)&&(f=f==="before"?"after":"before")}Qi(l.srcId,l.currentTargetId,f),d.value=new Set([l.srcId]),at()}C.value=null,$.value=0,R.value=0,document.body.classList.remove("is-dragging")}}let di=!1;function Th(r){const l=r.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(r.button===2){di=!0,pe.startPan(r);return}if(di=!1,r.button!==0)return;const f=c.value.getBoundingClientRect(),S=(r.clientX-f.left-pe.offsetX.value)/pe.scale.value,E=(r.clientY-f.top-pe.offsetY.value)/pe.scale.value;pe.startMarquee(S,E,{shift:r.shiftKey})}function Ch(r){if(Rn){Rn=!1;return}const l=r.target;if(!l||l.closest(".zm-node"))return;const f=pe.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,at())}function Mh(){const r=pe.marquee;if(r.width<4&&r.height<4)return;const l=r.x,f=r.y,S=r.x+r.width,E=r.y+r.height,B=[];for(const M of rn.value){const v=M.width/2,j=M.height/2,K=M.x-v,ye=M.x+v,T=M.y-j,Q=M.y+j;K<=S&&ye>=l&&T<=E&&Q>=f&&B.push(M.id)}d.value=r.shiftKey?new Set([...d.value,...B]):new Set(B),at()}function ga(r){return h.value.has(r)}function Ah(r){const l=he(m.value,r.id);return!!l&&l.children.length>0}function er(r){const l=he(m.value,r);return l?l.children.length:0}function ba(r){if(!he(m.value,r))return 0;const S=[m.value];for(;S.length;){const E=S.pop(),B=E.children.findIndex(M=>M.id===r);if(B>=0)return B;for(const M of E.children)S.push(M)}return 0}function ui(r,l,f,S){const E=(S==null?void 0:S._dir)??r._dir;if(l==="out"&&r.isRoot&&_.lineOrigin==="center")return{x:r.x,y:r.y};if(l==="out"&&r.isRoot&&_.lineOrigin==="proportional"&&S){const v=pt.value.root.children;if(E==="down"){const de=v.reduce((Me,te)=>Math.max(Me,Math.abs(te.x-r.x)),1),se=Math.min(1,Math.abs(S.x-r.x)/de),Te=r.y+r.height/2,Ie=r.y;return{x:r.x,y:Te+(Ie-Te)*se}}const j=v.reduce((de,se)=>Math.max(de,Math.abs(se.y-r.y)),1),K=Math.min(1,Math.abs(S.y-r.y)/j),ye=f!==void 0?f:r.side,T=r.x+ye*(r.width/2),Q=r.x;return{x:T+(Q-T)*K,y:r.y}}if(E==="down")return l==="out"?{x:r.x,y:r.y+r.height/2}:{x:r.x,y:r.y-r.height/2};let B;l==="in"?B=-r.side:f!==void 0?B=f:B=r.side;const M=l==="in"?r._richInsetX??0:0;return{x:r.x+B*(r.width/2-M),y:r.y}}function ln(){const r=pt.value;pe.resetView(r.width,r.height,r.root.y)}function _h(){Qn.value=!0,Oe(),Se(),e.nextTick(()=>ln())}function tr(r){_.layoutMode!==r&&(_.layoutMode=r,Se(),e.nextTick(()=>ln()))}function Rh(){return JSON.stringify(m.value,null,2)}function ka(r){const l=he(m.value,r);return l?!!(l.note&&l.note.text||l.link&&l.link.url||l.image&&l.image.src||l.richContent&&l.richContent.raw||l.markers&&l.markers.length>0||l.tags&&l.tags.length>0):!1}function Bh(r){try{const l=JSON.parse(r);return!l.id||!Array.isArray(l.children)?!1:(Gt.reset(),m.value=It(l),d.value=new Set,h.value=new Set,Se(),e.nextTick(()=>ln()),a("change",m.value),!0)}catch{return!1}}const ya=e.ref(""),an=e.ref([]),So=e.ref(-1);function vh(r){ya.value=r;const l=r.trim();if(!l){an.value=[],So.value=-1;return}const f=l.toLowerCase(),S=[],E=B=>{var M;(B.text.toLowerCase().includes(f)||(M=B.note)!=null&&M.text&&B.note.text.toLowerCase().includes(f))&&S.push(B.id);for(const v of B.children)E(v)};E(m.value),an.value=S,So.value=S.length>0?0:-1,S.length>0&&(Lh(S),e.nextTick(()=>Dh(0)))}function Ih(r){return an.value.includes(r)}function zh(r){return So.value>=0&&an.value[So.value]===r}function Oh(r){return ya.value.trim().length>0&&an.value.length>0&&!an.value.includes(r)}function Lh(r){if(r.length===0)return;const l=new Set(r),f=new Set,S=E=>{let B=l.has(E.id);for(const M of E.children)S(M)&&(B=!0);return B&&E.children.length>0&&h.value.has(E.id)&&f.add(E.id),B};if(S(m.value),f.size>0){for(const E of f)h.value.delete(E);Se()}}function Dh(r){const l=an.value[r];if(!l)return;const f=rn.value.find(S=>S.id===l);f&&(d.value=new Set([l]),at(),pe.centerOn(f.x,f.y,f.width,f.height))}function Vh(r,l){const f=he(m.value,r);f&&(f.markers||(f.markers=[]),!f.markers.includes(l)&&(f.markers.push(l),Oe(),Se(),a("change",m.value)))}function $h(r,l){const f=he(m.value,r);if(!f||!f.markers)return;const S=f.markers.indexOf(l);S<0||(f.markers.splice(S,1),f.markers.length===0&&delete f.markers,Oe(),Se(),a("change",m.value))}function Ea(r,l){const f=he(m.value,r);if(!f)return!1;f.markers||(f.markers=[]);const S=f.markers.indexOf(l);return S>=0?(f.markers.splice(S,1),f.markers.length===0&&delete f.markers,Oe(),Se(),a("change",m.value),!1):(f.markers.push(l),Oe(),Se(),a("change",m.value),!0)}function Ph(r){const l=he(m.value,r);return l!=null&&l.markers?[...l.markers]:[]}function Fh(r){var f;const l=(f=I.value)==null?void 0:f.nodeId;l&&Ea(l,r)}function Uh(){var f;const r=(f=I.value)==null?void 0:f.nodeId;if(!r)return;const l=he(m.value,r);!l||!l.markers||(delete l.markers,Oe(),Se(),a("change",m.value),Ee())}function nr(r,l){const f=he(m.value,r);f&&(l.length===0?f.tags&&delete f.tags:f.tags=[...l],Oe(),Se(),a("change",m.value))}function Hh(r){const l=he(m.value,r);return l!=null&&l.tags?[...l.tags]:[]}function Wh(){var B,M;const r=(B=I.value)==null?void 0:B.nodeId;if(!r)return;const l=he(m.value,r),f=((M=l==null?void 0:l.tags)==null?void 0:M.join(", "))??"",S=window.prompt("输入标签(多个用逗号分隔)",f);if(S===null)return;const E=S.split(/[,,]/).map(v=>v.trim()).filter(v=>v.length>0);nr(r,E),Ee()}function Gh(){var l;const r=(l=I.value)==null?void 0:l.nodeId;r&&(nr(r,[]),Ee())}function xa(){const r=pt.value,l="http://www.w3.org/2000/svg",f=document.createElementNS(l,"svg");f.setAttribute("xmlns",l),f.setAttribute("viewBox",`${r.vbX} ${r.vbY} ${r.vbW} ${r.vbH}`),f.setAttribute("width",String(r.vbW)),f.setAttribute("height",String(r.vbH));const S=document.createElementNS(l,"rect");S.setAttribute("x",String(r.vbX)),S.setAttribute("y",String(r.vbY)),S.setAttribute("width",String(r.vbW)),S.setAttribute("height",String(r.vbH)),S.setAttribute("fill",Qt.value),f.appendChild(S);for(const M of Jl.value){const v=document.createElementNS(l,"path");v.setAttribute("d",yt(ui(M.from,"out",M.to.side,M.to),ui(M.to,"in"),L(M.from.depth),Z(M.to.depth),32,g(M.from.isRoot),M.to._dir)),v.setAttribute("fill",wo(M.from,M.to)),v.setAttribute("stroke","none"),f.appendChild(v)}const E="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function B(M,v){let j=0;for(const K of M)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(K)?j+=v:j+=v*.55;return j}for(const M of rn.value){const v=M.x-M.width/2,j=M.y-M.height/2,K=document.createElementNS(l,"rect");K.setAttribute("x",String(v)),K.setAttribute("y",String(j)),K.setAttribute("width",String(M.width)),K.setAttribute("height",String(M.height)),K.setAttribute("rx","8"),K.setAttribute("fill",Kl(M)),K.setAttribute("stroke",to(M)),K.setAttribute("stroke-width","1"),f.appendChild(K);const ye=!!(M.tags&&M.tags.length>0),T=!!(M.markers&&M.markers.length>0),Q=!!M.image,de=!!(M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table"));let se=0,Te=0;if(de){const We=M.richContent,Ke=M.fontSize*.78*.92,Ct=6,Pe=4,Kt=2,kn=6;if(We.kind==="code"){const _t=Go(We.raw),Et=wn(We.raw),Rt=_t.split(`
|
|
137
|
-
`),
|
|
138
|
-
`+f);const
|
|
139
|
-
`+E);const B=new Blob([E],{type:"image/svg+xml;charset=utf-8"}),M=URL.createObjectURL(B),v=new window.Image;v.onload=()=>{const j=document.createElement("canvas");j.width=Math.ceil(f.vbW*r),j.height=Math.ceil(f.vbH*r);const K=j.getContext("2d");if(!K){URL.revokeObjectURL(M);return}K.fillStyle=Qt.value,K.fillRect(0,0,j.width,j.height),K.drawImage(v,0,0,j.width,j.height),URL.revokeObjectURL(M);try{j.toBlob(ye=>{if(!ye){To();return}const T=URL.createObjectURL(ye),Q=document.createElement("a");Q.href=T,Q.download=`${m.value.text||"mindmap"}.png`,Q.click(),URL.revokeObjectURL(T)},"image/png")}catch(ye){console.warn("PNG export failed, falling back to SVG:",ye),To()}},v.onerror=()=>{URL.revokeObjectURL(M),To()},v.src=M}return o({addChild:r=>no(r),addSibling:r=>si(r),removeNode:r=>ca(r),duplicateNode:r=>na(r),setNodeText:(r,l)=>ma(r,l),moveNode:(r,l,f)=>Qi(r,l,f),lineWidthForDepth:L,endWidthForDepth:Z,getData:()=>m.value,nodeHasContent:r=>ka(r),getSelectedIds:()=>[...d.value],copyNodes:r=>la(r),cutNodes:r=>aa(r),pasteNodes:r=>sa(r),setData:r=>{Gt.reset(),m.value=It(r),d.value=new Set,h.value=new Set,Se(),Oe(),e.nextTick(()=>ln())},resetView:()=>ln(),exportData:Rh,importData:Bh,getMarkdown:()=>Ln(m.value),setMarkdown:(r,l=!0)=>{const f=On(r||"");l&&(q.value=!0),w=!l,Gt.reset(),m.value=It(f),d.value=new Set,h.value=new Set,Se(),Oe(),e.nextTick(()=>{w=!1,ln()}),a("change",m.value)},setBalanced:r=>{Qn.value=r},isBalanced:()=>Qn.value,balance:()=>_h(),applyNodeStyle:(r,l)=>J(r,l),getNodeStyle:r=>me(r),applyNodeImage:(r,l)=>ae(r,l),applyNodeImageByUrl:(r,l)=>b(r,l),removeNodeImage:r=>ke(r),applyNodeLink:(r,l)=>ge(r,l),removeNodeLink:r=>D(r),applyNodeNote:(r,l)=>z(r,l),removeNodeNote:r=>le(r),applyNodeRichContent:(r,l)=>be(r,l),addNodeMarker:(r,l)=>Vh(r,l),removeNodeMarker:(r,l)=>$h(r,l),toggleNodeMarker:(r,l)=>Ea(r,l),getNodeMarkers:r=>Ph(r),setNodeTags:(r,l)=>nr(r,l),getNodeTags:r=>Hh(r),exportPNG:r=>wa(r),exportSVG:()=>To(),searchNodes:r=>(vh(r),[...an.value]),undo:()=>Zi(),redo:()=>Ji(),canUndo:()=>Gt.canUndo(),canRedo:()=>Gt.canRedo(),applySettings:r=>{r.autoBalanceOnChange!==void 0&&(_.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(_.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(_.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(_.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(_.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(_.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(_.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(_.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(_.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(_.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(_.lineWidthTaper=Math.max(.3,Math.min(1,r.lineWidthTaper))),r.elbowRadius!==void 0&&(_.elbowRadius=Math.max(2,Math.min(20,r.elbowRadius))),r.showOrderBadge!==void 0&&(_.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(_.canvasBg=r.canvasBg)},getSettings:()=>({autoBalanceOnChange:_.autoBalanceOnChange,lineWidthStart:_.lineWidthStart,lineWidthEnd:_.lineWidthEnd,rainbowBranch:_.rainbowBranch,branchPaletteId:_.branchPaletteId,customPalettes:_.customPalettes,lineStyle:_.lineStyle,rootLineStyle:_.rootLineStyle,lineOrigin:_.lineOrigin,layoutMode:_.layoutMode,taperedEdge:_.taperedEdge,lineWidthTaper:_.lineWidthTaper,elbowRadius:_.elbowRadius,showOrderBadge:_.showOrderBadge,canvasBg:_.canvasBg}),setBranchPalette:r=>{if(!r)return;[...dn,..._.customPalettes].find(f=>f.id===r)&&(_.branchPaletteId=r)},getBranchPalette:()=>_.branchPaletteId,getBranchPalettes:()=>[...dn,..._.customPalettes],getSearchResults:()=>[...an.value],getSearchIndex:()=>So.value}),e.watch(()=>i.data,r=>{m.value=It(r),Se()},{deep:!1}),e.onMounted(()=>{Oe(),e.nextTick(()=>ln())}),(r,l)=>{var f,S,E,B,M,v,j,K,ye;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Qt.value,fontSize:lt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:Th,onContextmenu:et,onWheel:l[25]||(l[25]=(...T)=>e.unref(pe).onWheel&&e.unref(pe).onWheel(...T)),onMouseenter:l[26]||(l[26]=T=>x.value=!0),onMouseleave:l[27]||(l[27]=T=>x.value=!1),onClick:Ch},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:pt.value.vbX*e.unref(pe).scale.value+e.unref(pe).offsetX.value+"px",top:pt.value.vbY*e.unref(pe).scale.value+e.unref(pe).offsetY.value+"px",width:pt.value.vbW*e.unref(pe).scale.value+"px",height:pt.value.vbH*e.unref(pe).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:ch.value,preserveAspectRatio:"xMinYMin meet",width:pt.value.vbW*e.unref(pe).scale.value,height:pt.value.vbH*e.unref(pe).scale.value},[e.createElementVNode("g",Ip,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jl.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:yt(ui(T.from,"out",T.to.side,T.to),ui(T.to,"in"),L(T.from.depth),Z(T.to.depth),32,g(T.from.isRoot),T.to._dir),fill:wo(T.from,T.to),stroke:"none"},null,8,zp))),128))])],8,vp))],4),e.unref(pe).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(pe).marquee.x*e.unref(pe).scale.value+e.unref(pe).offsetX.value+"px",top:e.unref(pe).marquee.y*e.unref(pe).scale.value+e.unref(pe).offsetY.value+"px",width:e.unref(pe).marquee.width*e.unref(pe).scale.value+"px",height:e.unref(pe).marquee.height*e.unref(pe).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:$.value+"px",top:R.value+"px",transform:`scale(${e.unref(pe).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(C.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(pe).offsetX.value}px, ${e.unref(pe).offsetY.value}px) scale(${e.unref(pe).scale.value})`})},[F.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drop-indicator",style:e.normalizeStyle({left:F.value.x1+"px",top:F.value.y1+"px",width:F.value.horizontal?F.value.x2-F.value.x1+"px":"3px",height:F.value.horizontal?"3px":F.value.y2-F.value.y1+"px",transform:F.value.horizontal?"translateY(-1.5px)":"translateX(-1.5px)"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rn.value,T=>{var Q,de,se,Te,Ie,Me,te;return e.openBlock(),e.createElementBlock("div",{key:T.id,class:e.normalizeClass(["zm-node",{"is-root":T.isRoot,"is-selected":p.value===T.id,"is-selected-secondary":p.value!==T.id&&d.value.has(T.id),"is-editing":s.value===T.id,"has-image":!!T.image,"is-resizing":qi.value===T.id,"is-dragging-source":((Q=C.value)==null?void 0:Q.srcId)===T.id,"is-drop-target":((de=C.value)==null?void 0:de.currentTargetId)===T.id&&((se=C.value)==null?void 0:se.dropPosition)==="child","is-drop-target-before":((Te=C.value)==null?void 0:Te.currentTargetId)===T.id&&((Ie=C.value)==null?void 0:Ie.dropPosition)==="before","is-drop-target-after":((Me=C.value)==null?void 0:Me.currentTargetId)===T.id&&((te=C.value)==null?void 0:te.dropPosition)==="after","is-search-hit":Ih(T.id),"is-search-current":zh(T.id),"is-search-dimmed":Oh(T.id)}]),"data-node-id":T.id,style:e.normalizeStyle({left:T.x+"px",top:T.y+"px",width:T.width+"px",minWidth:T.width+"px",height:T.height+"px",fontSize:ql(T)+"px",background:Kl(T),color:eo(T),borderColor:to(T),fontWeight:Yl(T),transform:"translate(-50%, -50%)"}),onClick:ne=>xh(ne,T),onPointerdown:ne=>Nh(ne,T),onDblclick:ne=>{ne.stopPropagation(),t.previewMode||No(T.id)},onContextmenu:ne=>oe(ne,T),onMouseenter:ne=>{Zn(T.id),Jn(ne,T)},onMouseleave:ne=>bn(T.id)},[T.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:T.image.src,width:T.image.width,height:T.image.height,alt:T.text,draggable:"false"},null,8,Lp)):e.createCommentVNode("",!0),T.richContent&&(T.richContent.kind==="code"||T.richContent.kind==="table")&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":T.richContent.kind==="table"||T.richContent.kind==="code"}]),onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ne=>fh(T.id),["stop"]),onMousedown:l[2]||(l[2]=e.withModifiers(()=>{},["stop"]))},[y.value===T.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":l[0]||(l[0]=ne=>k.value=ne),class:"zm-rich-edit",spellcheck:"false",onBlur:ta,onKeydown:ph},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Vp,[e.createElementVNode("code",{innerHTML:e.unref(Mi)(e.unref(Go)(T.richContent.raw),e.unref(wn)(T.richContent.raw))},null,8,$p)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Pp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ai)(T.richContent.raw),(ne,je)=>(e.openBlock(),e.createElementBlock("tr",{key:je},[je===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ne,(Y,$e)=>(e.openBlock(),e.createElementBlock("th",{key:`h${$e}`},e.toDisplayString(Y),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ne,(Y,$e)=>(e.openBlock(),e.createElementBlock("td",{key:`c${$e}`},e.toDisplayString(Y),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Dp)):e.createCommentVNode("",!0),s.value!==T.id?(e.openBlock(),e.createElementBlock("span",Fp,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",Up,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.markers,ne=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-node-marker",title:e.unref(Nr)(ne),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(zo)(ne)+"</svg>"},null,8,Hp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",Wp,e.toDisplayString(T.text),1),T.link&&s.value!==T.id?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:T.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${T.link.url}`,onClick:l[3]||(l[3]=e.withModifiers(()=>{},["stop"])),onMousedown:l[4]||(l[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"link",size:11,stroke:2})],40,Gp)):e.createCommentVNode("",!0),T.note&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:li(T.note.text),onClick:e.withModifiers(ne=>ri(T.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(_e,{name:"note",size:11,stroke:2})],40,jp)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:3,class:"zm-input","onUpdate:modelValue":l[6]||(l[6]=ne=>u.value=ne),autofocus:"",rows:"1",onBlur:l[7]||(l[7]=ne=>Xi()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(ne=>Xi(),["exact","prevent"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(ne=>Xi(),["prevent"]),["tab"])),e.withKeys(dh,["esc"]),hh],onInput:uh,onMousedown:l[10]||(l[10]=e.withModifiers(()=>{},["stop"])),onClick:l[11]||(l[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),T.tags&&T.tags.length>0&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",Kp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.tags,ne=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-node-tag",style:e.normalizeStyle(e.unref(bi)(ne))},e.toDisplayString(ne),5))),128))])):e.createCommentVNode("",!0),ie.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${ba(T.id)+1} 个`},e.toDisplayString(ba(T.id)+1),9,Yp)):e.createCommentVNode("",!0),ga(T.id)&&er(T.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({background:en.value.get(T.id)??"#64748b"}),title:`展开 ${er(T.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>da(T.id),["stop"])},e.toDisplayString(er(T.id)),47,qp)):e.createCommentVNode("",!0),Ah(T)&&!ga(T.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({color:en.value.get(T.id)??"#64748b",borderColor:en.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>da(T.id),["stop"])},[e.createVNode(_e,{name:"minus",size:10,stroke:2.4})],46,Xp)):e.createCommentVNode("",!0),T.image&&p.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ne=>Mt(ne,T),["stop"])},null,40,Zp)):e.createCommentVNode("",!0),T.image&&p.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>ke(T.id),["stop"])},[e.createVNode(_e,{name:"x",size:10,stroke:2.2})],40,Jp)):e.createCommentVNode("",!0)],46,Op)}),128))],4),A.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!A.value.above}]),style:e.normalizeStyle({left:A.value.x+"px",top:A.value.y+"px"})},e.toDisplayString(A.value.text),7)):e.createCommentVNode("",!0),I.value?(e.openBlock(),e.createBlock(hs,{key:3,x:I.value.x,y:I.value.y,container:c.value,"has-image":!!((f=e.unref(he)(m.value,I.value.nodeId))!=null&&f.image),"has-link":!!((S=e.unref(he)(m.value,I.value.nodeId))!=null&&S.link),"has-note":!!((E=e.unref(he)(m.value,I.value.nodeId))!=null&&E.note),"has-code":((M=(B=e.unref(he)(m.value,I.value.nodeId))==null?void 0:B.richContent)==null?void 0:M.kind)==="code","has-table":((j=(v=e.unref(he)(m.value,I.value.nodeId))==null?void 0:v.richContent)==null?void 0:j.kind)==="table","node-markers":((K=e.unref(he)(m.value,I.value.nodeId))==null?void 0:K.markers)??[],"node-tags":((ye=e.unref(he)(m.value,I.value.nodeId))==null?void 0:ye.tags)??[],onPickImage:go,onRemoveImage:_n,onSetLink:ji,onRemoveLink:bo,onEditNote:ko,onRemoveNote:Ki,onAddCode:ii,onEditCode:ii,onRemoveCode:Yi,onAddTable:He,onEditTable:He,onRemoveTable:hn,onToggleMarker:Fh,onClearMarkers:Uh,onAddTag:Wh,onRemoveTags:Gh,onClose:Ee},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),N.value?(e.openBlock(),e.createBlock(gs,{key:4,x:N.value.x,y:N.value.y,container:c.value,onOpenSettings:tt,onOpenData:nn,onOpenImport:nt,onExportPng:wa,onExportSvg:To,onClose:ut},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(U.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:l[15]||(l[15]=T=>a("canvas-toggle-preview"))},[e.createVNode(_e,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,Qp),e.createElementVNode("button",{class:e.normalizeClass(H.value),title:"显示大纲视图",onClick:ho},[e.createVNode(_e,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":x.value}])},[e.createElementVNode("span",eh,e.toDisplayString(Math.round(e.unref(pe).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[16]||(l[16]=(...T)=>e.unref(pe).zoomIn&&e.unref(pe).zoomIn(...T))},[e.createVNode(_e,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[17]||(l[17]=(...T)=>e.unref(pe).zoomOut&&e.unref(pe).zoomOut(...T))},[e.createVNode(_e,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:ln},[e.createVNode(_e,{name:"reset"})]),l[37]||(l[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:kh},[e.createVNode(_e,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[18]||(l[18]=T=>fa(1))},[e.createVNode(_e,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[19]||(l[19]=T=>fa(2))},[e.createVNode(_e,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:yh},[e.createVNode(_e,{name:"expand-all"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[35]||(l[35]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:l[20]||(l[20]=T=>p.value&&no(p.value))},[e.createElementVNode("img",{src:e.unref(ar),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,th)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[21]||(l[21]=T=>p.value&&si(p.value))},[e.createElementVNode("img",{src:e.unref(lr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,nh)]),l[36]||(l[36]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[22]||(l[22]=T=>tr("mindmap"))},[e.createVNode(_e,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[23]||(l[23]=T=>tr("tree"))},[e.createVNode(_e,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:_.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[24]||(l[24]=T=>tr("org"))},[e.createVNode(_e,{name:"org"})],2)],64))],2)],544),i.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Ot,{side:"left",scope:"canvas",width:300,open:on.value&&!t.previewMode,title:"大纲","onUpdate:open":l[28]||(l[28]=T=>on.value=T)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:m.value,"selected-id":p.value,"collapsed-ids":ot.value,"show-index":ie.value,onSelect:po,onToggleCollapse:pn,onEdit:oi,onAddChild:Kn,onAddSibling:Yn,onMove:$t},null,8,["data","selected-id","collapsed-ids","show-index"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",scope:"canvas",width:360,open:Dt.value&&!t.previewMode,title:"数据","onUpdate:open":l[30]||(l[30]=T=>Dt.value=T)},{default:e.withCtx(()=>[e.createVNode(Lo,{data:m.value,"pending-mode":Vt.value,onImport:l[29]||(l[29]=T=>m.value=T),onConsumedMode:Ue},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",scope:"canvas",width:420,open:ue.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[32]||(l[32]=T=>ue.value=T)},{default:e.withCtx(()=>[e.createVNode(Do,{data:m.value,onImport:l[31]||(l[31]=T=>m.value=T)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",scope:"canvas",width:360,open:ft.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[33]||(l[33]=T=>ft.value=T)},{default:e.withCtx(()=>[e.createVNode(Jo,{"selected-node":kt.value,"focus-tick":Be.value,onApply:it,onRemove:wt,onSetLink:An,onSetImage:ti,onSetRich:ni},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Ot,{side:"right",scope:"canvas",width:340,open:ze.value&&!t.previewMode,title:"设置","onUpdate:open":l[34]||(l[34]=T=>ze.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode(Vo,{settings:_,"has-selection":p.value!==null,"selected-node-text":(T=kt.value)==null?void 0:T.text,"node-style":X.value,"onUpdate:settings":re,"onUpdate:nodeStyle":xe,onReset:Ae},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),oh={class:"zm-app"},ih={class:"zm-app-main"},rh={class:"zm-app-canvas"},jl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
|
|
134
|
+
| a | b | c |`);if(x===null)return;const B=x.trim();if(!B){ke(r,null);return}ke(r,{kind:"table",raw:B})}function kn(){var l;const r=(l=z.value)==null?void 0:l.nodeId;r&&ke(r,null)}function li(r){i.previewMode||(d.value=new Set([r]),st(),i.builtInDrawers&&(Ct(),mt.value=!0,ze.value++),a("edit-note",r))}function ai(r,l=60){const f=r.replace(/\s+/g," ").trim();return f.length<=l?f||"点击编辑笔记":f.slice(0,l)+"…"}function Xn(r){var A,v;if(i.previewMode||s.value)return;const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable))return;const f=p.value;if(!f)return;const N=(A=r.clipboardData)==null?void 0:A.items;if(!N)return;for(let Z=0;Z<N.length;Z++){const H=N[Z];if(H.kind==="file"&&H.type.startsWith("image/")){const ie=H.getAsFile();if(!ie)continue;r.preventDefault();const T=be(m.value,f);if(T!=null&&T.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;G(ie,J=>ce(f,J));return}}if(I.value&&I.value.nodes.length>0)return;let x=null;for(let Z=0;Z<N.length;Z++){const H=N[Z];if(H.kind==="string"&&H.type==="text/plain"){x=((v=r.clipboardData)==null?void 0:v.getData("text/plain"))??null;break}}if(!x)return;const B=x.split(/\r?\n/).map(Z=>Z.replace(/^\s*[-*+]\s+/,"").trim()).filter(Z=>Z.length>0);if(B.length!==0){r.preventDefault(),Ve();for(const Z of B)bi(m.value,f,Z);we(),a("change",m.value)}}e.onMounted(()=>{window.addEventListener("paste",Xn),window.addEventListener("keydown",xo),we()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",Xn),window.removeEventListener("keydown",xo)});function xo(r){if((r.metaKey||r.ctrlKey)&&(r.key==="f"||r.key==="F")){const f=r.target;if(f&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable))return;r.preventDefault(),a("canvas-outline")}}const yn=e.ref(null),Zi=e.computed(()=>{var r;return((r=yn.value)==null?void 0:r.nodeId)??null});function At(r,l){if(!l.image)return;r.preventDefault(),r.stopPropagation();const f=l.image.naturalW||l.image.width,N=l.image.naturalH||l.image.height,x=N>0?N/f:1;yn.value={nodeId:l.id,startX:r.clientX,startY:r.clientY,startW:l.image.width,startH:l.image.height,naturalW:f,naturalH:N,ratio:x,pendingW:l.image.width,pendingH:l.image.height},window.addEventListener("mousemove",en),window.addEventListener("mouseup",Eo)}function en(r){var Z,H;const l=yn.value;if(!l)return;const f=ge.scale.value||1,N=r.clientX-l.startX,x=V(l.startW+N/f,Rn,Kn),B=V(x*l.ratio,Rn,Kn);l.pendingW=x,l.pendingH=B;const A=(Z=c.value)==null?void 0:Z.querySelector(`[data-node-id="${l.nodeId}"] .zm-node-img`);A&&(A.style.width=`${x}px`,A.style.height=`${B}px`);const v=(H=c.value)==null?void 0:H.querySelector(`[data-node-id="${l.nodeId}"]`);v&&(v.style.minWidth=`${Math.max(80,Math.ceil(x+28))}px`,v.style.height=`${Math.ceil(B+8+30)}px`)}function Eo(){const r=yn.value;if(window.removeEventListener("mousemove",en),window.removeEventListener("mouseup",Eo),yn.value=null,!r)return;const l=be(m.value,r.nodeId);!l||!l.image||(ce(r.nodeId,{src:l.image.src,naturalW:l.image.naturalW,naturalH:l.image.naturalH,width:r.pendingW,height:r.pendingH}),d.value=new Set([r.nodeId]),st(),zn=!0)}const Zn=e.ref(null);let zn=!1;function Jn(r){Zn.value=r}function xn(r){Zn.value===r&&(Zn.value=null),_.value&&(_.value=null)}function Qn(r,l){var ae;if(!l.text||l.text.length<14)return;const N=r.currentTarget.getBoundingClientRect(),x=(ae=c.value)==null?void 0:ae.getBoundingClientRect();if(!x)return;const B=10,A=240,v=N.top-x.top>60,Z=N.left-x.left+N.width/2,H=B+A/2,ie=x.width-A/2-B,T=Math.max(H,Math.min(Z,ie)),J=v?N.top-x.top-8:N.bottom-x.top+8;_.value={text:l.text,x:T,y:J,above:v}}const _t=e.ref(0),eo=e.ref(!1),Kt=ls(100);function Ve(){Kt.record({data:m.value,selectedIds:[...d.value]})}function we(){h.value=new Set(h.value),_t.value++,e.nextTick().then(()=>e.nextTick()).then(()=>si()).then(()=>{_t.value++})}function si(){const r=document.querySelectorAll(".zm-rich"),l={},f={};r.forEach(N=>{let x=N,B=null;for(;x&&!B;)B=x.getAttribute("data-node-id"),x=x.parentElement;if(!B)return;const A=N.offsetHeight,v=N.scrollWidth,Z=Math.round(A*2)/2,H=Math.round(v*2)/2;l[B]=Z,f[B]=H,P.value[B],j.value[B]}),P.value=l,j.value=f}const Nt=e.computed(()=>{var r,l,f,N,x,B,A,v,Z,H;return{rootBg:((r=i.theme)==null?void 0:r.rootBg)??"#1f2937",rootText:((l=i.theme)==null?void 0:l.rootText)??"#ffffff",branchBg:((f=i.theme)==null?void 0:f.branchBg)??"#ffffff",branchText:((N=i.theme)==null?void 0:N.branchText)??"#1f2937",lineColor:((x=i.theme)==null?void 0:x.lineColor)??"#94a3b8",bgColor:((B=i.theme)==null?void 0:B.bgColor)??"#f8fafc",fontSize:((A=i.theme)==null?void 0:A.fontSize)??14,lineWidthStart:((v=i.theme)==null?void 0:v.lineWidthStart)??2.2,lineWidthEnd:((Z=i.theme)==null?void 0:Z.lineWidthEnd)??.8,rainbowBranch:((H=i.theme)==null?void 0:H.rainbowBranch)??!1}}),tn=e.computed(()=>M.canvasBg||Nt.value.bgColor),M=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.3,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0});function b(r){return r?M.rootLineStyle:M.lineStyle}function D(r){return M.taperedEdge?M.uniformLineWidth&&r>0?M.lineWidthEnd:Ie(r):Ne(r)}function X(r){return M.taperedEdge?M.lineWidthEnd:Ne(r)}function Ie(r){const l=M.lineWidthTaper,f=M.lineWidthStart*Math.pow(l,r);return Math.max(M.lineWidthEnd,f)}function Ne(r){if(r<=0)return M.lineWidthStart;if(r>=3)return M.lineWidthEnd;const l=r/3;return M.lineWidthStart+(M.lineWidthEnd-M.lineWidthStart)*l}function $e(r,l,f,N){const x=1-r,B=x*x*x*l.x+3*x*x*r*f.x1+3*x*r*r*f.x2+r*r*r*N.x,A=x*x*x*l.y+3*x*x*r*f.y1+3*x*r*r*f.y2+r*r*r*N.y;return{x:B,y:A}}function Ze(r,l,f,N){const x=1-r,B=x*x*l.x+2*x*r*f.x+r*r*N.x,A=x*x*l.y+2*x*r*f.y+r*r*N.y;return{x:B,y:A}}function St(r,l,f,N,x=32,B="curve",A="right"){if(B==="curve"){let v;if(A==="right"||A==="left"){const ae=Math.abs(l.x-r.x)*.45,he=A==="right"?1:-1;v={x1:r.x+he*ae,y1:r.y,x2:l.x-he*ae,y2:l.y}}else{const ae=Math.abs(l.y-r.y)*.45;v={x1:r.x,y1:r.y+ae,x2:l.x,y2:l.y-ae}}const Z=J=>{const ae=1-J,he=-3*ae*ae*r.x+3*(ae*ae-2*ae*J)*v.x1+3*(2*ae*J-J*J)*v.x2+3*J*J*l.x,Ae=-3*ae*ae*r.y+3*(ae*ae-2*ae*J)*v.y1+3*(2*ae*J-J*J)*v.y2+3*J*J*l.y;return{dx:he,dy:Ae}},H=[],ie=[];for(let J=0;J<=x;J++){const ae=J/x,he=J===0?r:J===x?l:$e(ae,r,v,l),Ae=Z(ae);let Me=Math.hypot(Ae.dx,Ae.dy);Me<1e-6&&(Me=1);const Le=-Ae.dy/Me,Q=Ae.dx/Me,ne=(f+(N-f)*ae)/2;H.push({x:he.x+Le*ne,y:he.y+Q*ne}),ie.push({x:he.x-Le*ne,y:he.y-Q*ne})}let T=`M ${H[0].x.toFixed(2)} ${H[0].y.toFixed(2)}`;for(let J=1;J<=x;J++)T+=` L ${H[J].x.toFixed(2)} ${H[J].y.toFixed(2)}`;for(let J=x;J>=0;J--)T+=` L ${ie[J].x.toFixed(2)} ${ie[J].y.toFixed(2)}`;return T+=" Z",T}if(B==="arc"){let v;A==="right"||A==="left"?v={x:(r.x+l.x)/2,y:l.y}:v={x:l.x,y:(r.y+l.y)/2};const Z=he=>{const Ae=1-he,Me=2*Ae*(v.x-r.x)+2*he*(l.x-v.x),Le=2*Ae*(v.y-r.y)+2*he*(l.y-v.y);return{dx:Me,dy:Le}},H=[],ie=[];for(let he=0;he<=x;he++){const Ae=he/x,Me=he===0?r:he===x?l:Ze(Ae,r,v,l),Le=Z(Ae);let Q=Math.hypot(Le.dx,Le.dy);Q<1e-6&&(Q=1);const ne=-Le.dy/Q,Pe=Le.dx/Q,Oe=(f+(N-f)*Ae)/2;H.push({x:Me.x+ne*Oe,y:Me.y+Pe*Oe}),ie.push({x:Me.x-ne*Oe,y:Me.y-Pe*Oe})}const T=f/2,J=N/2;let ae=`M ${H[0].x.toFixed(2)} ${H[0].y.toFixed(2)}`;for(let he=1;he<=x;he++)ae+=` L ${H[he].x.toFixed(2)} ${H[he].y.toFixed(2)}`;ae+=` A ${J.toFixed(2)} ${J.toFixed(2)} 0 0 0 ${ie[x].x.toFixed(2)} ${ie[x].y.toFixed(2)}`;for(let he=x-1;he>=0;he--)ae+=` L ${ie[he].x.toFixed(2)} ${ie[he].y.toFixed(2)}`;return ae+=` A ${T.toFixed(2)} ${T.toFixed(2)} 0 0 0 ${H[0].x.toFixed(2)} ${H[0].y.toFixed(2)}`,ae+=" Z",ae}if(B==="elbow"){const v=[];if(A==="down"){const Q=(r.y+l.y)/2;v.push(r,{x:r.x,y:Q},{x:l.x,y:Q},l)}else{const Q=(r.x+l.x)/2;v.push(r,{x:Q,y:r.y},{x:Q,y:l.y},l)}const Z=[];let H=0;for(let Q=0;Q<v.length-1;Q++){const ne=Math.hypot(v[Q+1].x-v[Q].x,v[Q+1].y-v[Q].y);Z.push(ne),H+=ne}const ie=[f/2];let T=0;for(let Q=0;Q<Z.length-1;Q++){T+=Z[Q];const ne=H>0?T/H:0;ie.push((f+(N-f)*ne)/2)}ie.push(N/2);const J=[];for(let Q=0;Q<v.length-1;Q++){const ne=v[Q+1].x-v[Q].x,Pe=v[Q+1].y-v[Q].y;let Oe=Math.hypot(ne,Pe);Oe<1e-6&&(Oe=1),J.push({x:-Pe/Oe,y:ne/Oe})}const ae=[],he=[];ae.push({x:v[0].x+J[0].x*ie[0],y:v[0].y+J[0].y*ie[0]}),he.push({x:v[0].x-J[0].x*ie[0],y:v[0].y-J[0].y*ie[0]});for(let Q=1;Q<v.length-1;Q++){const ne=J[Q-1],Pe=J[Q],Oe=ie[Q],gt=ne.x+Pe.x,K=ne.y+Pe.y,Te=gt*gt+K*K;if(Te<1e-6)ae.push({x:v[Q].x+ne.x*Oe,y:v[Q].y+ne.y*Oe}),he.push({x:v[Q].x-ne.x*Oe,y:v[Q].y-ne.y*Oe});else{const _e=2*Oe/Te;ae.push({x:v[Q].x+gt*_e,y:v[Q].y+K*_e}),he.push({x:v[Q].x-gt*_e,y:v[Q].y-K*_e})}}const Ae=J[J.length-1],Me=ie[ie.length-1];ae.push({x:v[v.length-1].x+Ae.x*Me,y:v[v.length-1].y+Ae.y*Me}),he.push({x:v[v.length-1].x-Ae.x*Me,y:v[v.length-1].y-Ae.y*Me});let Le=`M ${ae[0].x.toFixed(2)} ${ae[0].y.toFixed(2)}`;for(let Q=1;Q<ae.length;Q++)Le+=` L ${ae[Q].x.toFixed(2)} ${ae[Q].y.toFixed(2)}`;for(let Q=he.length-1;Q>=0;Q--)Le+=` L ${he[Q].x.toFixed(2)} ${he[Q].y.toFixed(2)}`;return Le+=" Z",Le}if(B==="rounded-elbow"&&!(A==="down"?Math.abs(r.x-l.x)<.5:Math.abs(r.y-l.y)<.5)){let Z=function(K,Te,_e){const bt={x:K.pos.x-Te*K.d1.x,y:K.pos.y-Te*K.d1.y},nn={x:K.pos.x+Te*K.d2.x,y:K.pos.y+Te*K.d2.y},Rt={x:K.pos.x+Te*(K.d2.x-K.d1.x),y:K.pos.y+Te*(K.d2.y-K.d1.y)},kt=Math.atan2(bt.y-Rt.y,bt.x-Rt.x);let et=Math.atan2(nn.y-Rt.y,nn.x-Rt.x)-kt;for(;et>Math.PI;)et-=2*Math.PI;for(;et<-Math.PI;)et+=2*Math.PI;const Bt=[];for(let Ue=1;Ue<_e;Ue++){const on=Ue/_e,qt=kt+et*on;Bt.push({x:Rt.x+Te*Math.cos(qt),y:Rt.y+Te*Math.sin(qt)})}return Bt};const H=[];let ie;if(A==="down"){const K=(r.y+l.y)/2,Te=Math.sign(K-r.y)||1,_e=Math.sign(l.x-r.x)||1,bt=Math.sign(l.y-K)||1;ie=[{pos:{x:r.x,y:K},d1:{x:0,y:Te},d2:{x:_e,y:0}},{pos:{x:l.x,y:K},d1:{x:_e,y:0},d2:{x:0,y:bt}}]}else{const K=(r.x+l.x)/2,Te=Math.sign(K-r.x)||1,_e=Math.sign(l.y-r.y)||1,bt=Math.sign(l.x-K)||1;ie=[{pos:{x:K,y:r.y},d1:{x:Te,y:0},d2:{x:0,y:_e}},{pos:{x:K,y:l.y},d1:{x:0,y:_e},d2:{x:bt,y:0}}]}const T=Math.hypot(ie[1].pos.x-ie[0].pos.x,ie[1].pos.y-ie[0].pos.y),J=Math.hypot(l.x-ie[1].pos.x,l.y-ie[1].pos.y),ae=Math.min(T,J,M.elbowRadius)*.5,he=Math.max(2,ae);H.push(r),H.push(ie[0].pos),H.push({x:ie[1].pos.x-he*ie[1].d1.x,y:ie[1].pos.y-he*ie[1].d1.y});for(const K of Z(ie[1],he,12))H.push(K);H.push(l);const Ae=[];let Me=0;for(let K=0;K<H.length-1;K++){const Te=Math.hypot(H[K+1].x-H[K].x,H[K+1].y-H[K].y);Ae.push(Te),Me+=Te}const Le=[];for(let K=0;K<H.length-1;K++){const Te=H[K+1].x-H[K].x,_e=H[K+1].y-H[K].y;let bt=Math.hypot(Te,_e);bt<1e-6&&(bt=1),Le.push({x:-_e/bt,y:Te/bt})}const Q=[];let ne=0;for(let K=0;K<H.length;K++){K>0&&(ne+=Ae[K-1]);const Te=Me>0?ne/Me:0;Q.push((f+(N-f)*Te)/2)}const Pe=[],Oe=[];for(let K=0;K<H.length;K++){const Te=Q[K];if(K===0){const _e=Le[0];Pe.push({x:H[K].x+_e.x*Te,y:H[K].y+_e.y*Te}),Oe.push({x:H[K].x-_e.x*Te,y:H[K].y-_e.y*Te})}else if(K===H.length-1){const _e=Le[Le.length-1];Pe.push({x:H[K].x+_e.x*Te,y:H[K].y+_e.y*Te}),Oe.push({x:H[K].x-_e.x*Te,y:H[K].y-_e.y*Te})}else{const _e=Le[K-1],bt=Le[K],nn=_e.x+bt.x,Rt=_e.y+bt.y,kt=nn*nn+Rt*Rt;if(kt<1e-6)Pe.push({x:H[K].x+_e.x*Te,y:H[K].y+_e.y*Te}),Oe.push({x:H[K].x-_e.x*Te,y:H[K].y-_e.y*Te});else{const Ye=2*Te/kt;Pe.push({x:H[K].x+nn*Ye,y:H[K].y+Rt*Ye}),Oe.push({x:H[K].x-nn*Ye,y:H[K].y-Rt*Ye})}}}let gt=`M ${Pe[0].x.toFixed(2)} ${Pe[0].y.toFixed(2)}`;for(let K=1;K<Pe.length;K++)gt+=` L ${Pe[K].x.toFixed(2)} ${Pe[K].y.toFixed(2)}`;gt+=` L ${Oe[Pe.length-1].x.toFixed(2)} ${Oe[Pe.length-1].y.toFixed(2)}`;for(let K=Oe.length-2;K>=0;K--)gt+=` L ${Oe[K].x.toFixed(2)} ${Oe[K].y.toFixed(2)}`;return gt+=" Z",gt}{const v=l.x-r.x,Z=l.y-r.y;let H=Math.hypot(v,Z);H<1e-6&&(H=1);const ie=-Z/H,T=v/H,J=f/2,ae=N/2,he={x:r.x+ie*J,y:r.y+T*J},Ae={x:r.x-ie*J,y:r.y-T*J},Me={x:l.x-ie*ae,y:l.y-T*ae},Le={x:l.x+ie*ae,y:l.y+T*ae};return`M ${he.x.toFixed(2)} ${he.y.toFixed(2)} L ${Le.x.toFixed(2)} ${Le.y.toFixed(2)} L ${Me.x.toFixed(2)} ${Me.y.toFixed(2)} L ${Ae.x.toFixed(2)} ${Ae.y.toFixed(2)} Z`}}const pt=e.computed(()=>ht.value.root.children),wo=mn[0].colors,Je=e.computed(()=>ja(M.branchPaletteId,M.customPalettes)),En=e.computed(()=>{const r=new Map;if(!M.rainbowBranch)return r;const l=i.lineColors,f=l&&l.length>0?l:Je.value.colors.length>0?Je.value.colors:wo;for(let x=0;x<pt.value.length;x++){const B=pt.value[x];r.set(B.id,f[x%f.length])}const N=(x,B)=>{r.set(x.id,B);for(const A of x.children)N(A,B)};for(let x=0;x<pt.value.length;x++){const B=pt.value[x];N(B,f[x%f.length])}return r});function No(r,l){return M.rainbowBranch?En.value.get(l.id)??Nt.value.lineColor:Nt.value.lineColor}function ql(r){const l=ee(r.id);if(l.bg)return l.bg;if(r.isRoot)return Nt.value.rootBg;if(r.depth>=3)return"transparent";const f=r.depth===1?.15:.08;if(M.rainbowBranch){const N=En.value.get(r.id);if(N)return Jl(N,f)}return Jl(Nt.value.rootBg,f)}function to(r){const l=ee(r.id);if(l.textColor)return l.textColor;if(r.isRoot)return Nt.value.rootText;if(M.rainbowBranch){const f=En.value.get(r.id);if(f)return uh(f,.55)}return Nt.value.branchText}function no(r){const l=ee(r.id);return l.borderColor?l.borderColor:"transparent"}function Xl(r){const l=ee(r.id);return l.fontWeight?l.fontWeight:r.isRoot?700:r.depth<=1?600:r.depth===2?500:400}function Zl(r){return ee(r.id).fontSize??r.fontSize??Nt.value.fontSize}function Jl(r,l){const f=r.replace("#",""),N=f.length===6?f:f.split("").map(v=>v+v).join(""),x=parseInt(N.slice(0,2),16),B=parseInt(N.slice(2,4),16),A=parseInt(N.slice(4,6),16);return`rgba(${x}, ${B}, ${A}, ${l})`}function uh(r,l){const f=r.replace("#",""),N=f.length===6?f:f.split("").map(v=>v+v).join(""),x=Math.round(parseInt(N.slice(0,2),16)*(1-l)),B=Math.round(parseInt(N.slice(2,4),16)*(1-l)),A=Math.round(parseInt(N.slice(4,6),16)*(1-l));return`rgb(${x}, ${B}, ${A})`}const ge=os({getContainer:()=>c.value});ge.setOnMarqueeEnd(Rh),rs({isEditing:()=>s.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>p.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>m.value.id,onAddChild:oo,onAddSibling:ci,onAddSiblingBefore:yh,onRemove:ua,onStartEdit:So,onClearSelection:()=>{d.value=new Set,st()},onDuplicate:ia,onCopy:sa,onCut:ca,onPaste:da,hasClipboard:()=>!!I.value&&I.value.nodes.length>0,onUndo:Qi,onRedo:er,onNavigate:xh,onMoveSibling:Nh,onSelectRoot:()=>{d.value=new Set([m.value.id]),st()}});const ht=e.computed(()=>{const r=Ot(m.value);return ta(r),Ua(r,{mode:M.layoutMode,baseFontSize:Nt.value.fontSize,richHeights:P.value,richWidths:j.value})}),Ql=e.ref([]),sn=e.computed(()=>(_t.value,Ql.value));e.watch(ht,r=>{const l=[],f=N=>{l.push(N);for(const x of N.children)f(x)};f(r.root),Ql.value=l},{immediate:!0});const ea=e.computed(()=>{const r=[];for(const l of sn.value)for(const f of l.children)r.push({from:l,to:f,key:`${l.id}->${f.id}`});return r}),fh=e.computed(()=>`${ht.value.vbX} ${ht.value.vbY} ${ht.value.vbW} ${ht.value.vbH}`);function ta(r){if(h.value.has(r.id)){r.children=[],r.collapsed=!0;return}r.collapsed=!1;for(const l of r.children)ta(l)}function So(r){const l=be(m.value,r);l&&(s.value=r,u.value=l.text,d.value=new Set([r]),st(),e.nextTick(()=>{const f=document.querySelector(".zm-input");f==null||f.focus(),f==null||f.select(),na(f)}))}function Ji(){if(!s.value)return;const r=be(m.value,s.value);r&&r.text!==(u.value.trim()||" ")&&(r.text=u.value.trim()||" ",Ve(),a("change",m.value)),s.value=null}function mh(){s.value=null}function na(r){r&&(r.style.height="auto",r.style.height=r.scrollHeight+"px")}function ph(r){na(r.target)}function hh(r){if(i.previewMode)return;const l=be(m.value,r);l!=null&&l.richContent&&(y.value=r,k.value=l.richContent.raw,e.nextTick(()=>{const f=document.querySelector(".zm-node .zm-rich textarea");f==null||f.focus()}))}function oa(){if(!y.value)return;const r=y.value,l=be(m.value,r),f=k.value;if(l&&l.richContent&&l.richContent.raw!==f)if(l.richContent.kind==="code"){const N=Tn(f)||void 0;ke(r,{kind:"code",raw:f,lang:N})}else ke(r,{kind:"table",raw:f});y.value=null}function gh(){y.value=null}function bh(r){r.key==="Escape"?(r.preventDefault(),gh()):r.key==="Enter"&&(r.ctrlKey||r.metaKey)&&(r.preventDefault(),oa())}function kh(r){const l=r.metaKey||r.ctrlKey;l&&(r.key==="z"||r.key==="Z")&&!r.shiftKey?(r.preventDefault(),Qi()):(l&&r.shiftKey&&(r.key==="z"||r.key==="Z")||l&&(r.key==="y"||r.key==="Y")&&!r.shiftKey)&&(r.preventDefault(),er())}function oo(r){const l=bi(m.value,r,zo);l&&(Ve(),we(),a("change",m.value),e.nextTick(()=>So(l.id)))}function ci(r){if(r===m.value.id){oo(r);return}const l=Er(m.value,r,zo);l&&(Ve(),we(),a("change",m.value),e.nextTick(()=>So(l.id)))}function yh(r){if(r===m.value.id){oo(r);return}const l=Ja(m.value,r,zo);l&&(Ve(),we(),a("change",m.value),e.nextTick(()=>So(l.id)))}function ia(r){if(r===m.value.id)return;const l=Qa(m.value,r);l&&(Ve(),d.value=new Set([l.id]),st(),a("change",m.value),we())}function ra(r){const l=[],f=new Set;for(const N of r)N!==m.value.id&&(f.has(N)||be(m.value,N)&&(f.add(N),l.push(N)));return l}function la(r){const l=new Set(r),f=[],N=x=>{l.has(x.id)&&f.push(x.id);for(const B of x.children)N(B)};return N(m.value),f}function aa(r){var l;try{(l=navigator.clipboard)==null||l.writeText(r)}catch{}}function sa(r){const l=la(ra(r));if(l.length===0)return;const f=[];for(const N of l){const x=wr(m.value,N);x&&f.push(x)}f.length!==0&&(I.value={nodes:f,originalIds:new Set(l)},aa(f.map(N=>N.text).join(`
|
|
135
|
+
`)),we())}function ca(r){const l=la(ra(r));if(l.length===0)return;const f=[];for(const N of l){const x=wr(m.value,N);x&&f.push(x)}if(f.length!==0){Ve();for(const N of l)Bo(m.value,N);d.value=new Set,st(),I.value={nodes:f,originalIds:new Set(l)},aa(f.map(N=>N.text).join(`
|
|
136
|
+
`)),we(),a("change",m.value)}}function da(r){const l=I.value;if(!l||l.nodes.length===0)return;const f=r??m.value.id,N=be(m.value,f);if(N){for(const x of l.originalIds){const B=be(m.value,x);if(B&&be(B,f))return}Ve();for(const x of l.nodes){const B=Ot(x);vo(B),N.children.push(B)}I.value=null,we(),a("change",m.value)}}function Qi(){const r=Kt.undo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),st(),we(),a("change",m.value))}function er(){const r=Kt.redo();r&&(m.value=r.data,d.value=new Set(r.selectedIds??[]),st(),we(),a("change",m.value))}function st(){const r=[];for(const l of d.value){const f=be(m.value,l);f&&r.push(f)}if(i.builtInDrawers&&!i.previewMode&&r.length>0){const l=r[0];!mt.value&&xa(l.id)&&(Ct(),mt.value=!0)}else i.builtInDrawers&&r.length===0&&(mt.value=!1);a("select",r.length>0?r:null)}function xh(r,l){const f=p.value??m.value.id,N=be(m.value,f);if(!N)return;let x=null;if(l===1){const B=Dt(m.value,N.id);if(B){const A=B.children.findIndex(v=>v.id===N.id);A>=0&&A<B.children.length-1&&(x=B.children[A+1].id)}}else if(l===-1){const B=Dt(m.value,N.id);if(B){const A=B.children.findIndex(v=>v.id===N.id);A>0&&(x=B.children[A-1].id)}}else if(r===1){const B=Dt(m.value,N.id);B&&(x=B.id)}else r===-1&&N.children.length>0&&(x=N.children[0].id);x&&(d.value=new Set([x]),st())}function ua(r){if(r!==m.value.id&&Bo(m.value,r)){if(Ve(),d.value.has(r)){const l=new Set(d.value);l.delete(r),d.value=l,st()}we(),a("change",m.value)}}function fa(r){h.value.has(r)?h.value.delete(r):h.value.add(r),we()}function ma(r){const l=[{n:m.value,depth:1}];for(;l.length;){const{n:f,depth:N}=l.pop();r(f,N);for(let x=f.children.length-1;x>=0;x--)l.push({n:f.children[x],depth:N+1})}}function Eh(){h.value=new Set,ma(r=>{r.children.length>0&&h.value.add(r.id)}),we()}function pa(r){h.value=new Set,ma((l,f)=>{f>r&&l.children.length>0&&h.value.add(l.id)}),we()}function wh(){h.value=new Set,we()}function ha(r,l){Za(m.value,r,l)&&(Ve(),we(),a("change",m.value))}function tr(r,l,f){return gi(m.value,r,l,f)?(Ve(),we(),a("change",m.value),!0):!1}function Nh(r){const l=p.value;if(!l)return;const f=m.value;if(l===f.id)return;const N=Dt(f,l);if(!N)return;const x=N.children.findIndex(v=>v.id===l);if(x<0)return;let B=r;const A=sn.value.find(v=>v.id===l);if(A&&ba(A)&&(B=-r),B<0){if(x===0)return;const v=N.children[x-1].id;gi(f,l,v,"before")}else{if(x>=N.children.length-1)return;const v=N.children[x+1].id;gi(f,l,v,"after")}Ve(),we(),a("change",f)}function Sh(r,l){if(r.stopPropagation(),r.shiftKey){const f=new Set(d.value);f.has(l.id)?f.delete(l.id):f.add(l.id),d.value=f}else d.value=new Set([l.id]);st()}function Th(r,l,f){let N=null;for(const x of sn.value){if(x.id===f)continue;const B=x.width/2,A=x.height/2;r>=x.x-B&&r<=x.x+B&&l>=x.y-A&&l<=x.y+A&&(N=x)}return N}let Yt=null;function Ch(r,l){if(i.previewMode||l.isRoot||r.button!==0)return;const f=r.target;if(f!=null&&f.closest(".zm-img-resize-handle"))return;r.stopPropagation();const N=c.value.getBoundingClientRect(),x=l.x*ge.scale.value+ge.offsetX.value,B=l.y*ge.scale.value+ge.offsetY.value,A=r.clientX-N.left-x,v=r.clientY-N.top-B;Yt={srcId:l.id,srcText:l.text,pointerOffsetX:A,pointerOffsetY:v,startX:r.clientX,startY:r.clientY},window.addEventListener("pointermove",ga),window.addEventListener("pointerup",di),window.addEventListener("pointercancel",di)}function ga(r){if(Yt){const A=r.clientX-Yt.startX,v=r.clientY-Yt.startY;if(Math.abs(A)<=Kl&&Math.abs(v)<=Kl)return;C.value={srcId:Yt.srcId,srcText:Yt.srcText,pointerOffsetX:Yt.pointerOffsetX,pointerOffsetY:Yt.pointerOffsetY,currentTargetId:null,dropPosition:null},document.body.classList.add("is-dragging"),Yt=null}const l=C.value;if(!l)return;const f=c.value.getBoundingClientRect();$.value=r.clientX-f.left-l.pointerOffsetX,R.value=r.clientY-f.top-l.pointerOffsetY;const N=(r.clientX-f.left-ge.offsetX.value)/ge.scale.value,x=(r.clientY-f.top-ge.offsetY.value)/ge.scale.value,B=Th(N,x,l.srcId);l.currentTargetId=(B==null?void 0:B.id)??null,B?l.dropPosition=Mh(N,x,B):l.dropPosition=null}function Mh(r,l,f){if(f.isRoot)return"child";const N=f.width/2,x=f.height/2;if(f._dir==="down"){const A=r-f.x;return A<-N*.3?"before":A>N*.3?"after":"child"}const B=l-f.y;return B<-x*.3?"before":B>x*.3?"after":"child"}function ba(r){var l;return!!((l=r.parent)!=null&&l.isRoot)&&r._dir==="left"}function di(r){if(window.removeEventListener("pointermove",ga),window.removeEventListener("pointerup",di),window.removeEventListener("pointercancel",di),Yt){Yt=null;return}const l=C.value;if(l){if(l.currentTargetId&&l.dropPosition){let f=l.dropPosition;if(f!=="child"){const N=sn.value.find(x=>x.id===l.currentTargetId);N&&ba(N)&&(f=f==="before"?"after":"before")}tr(l.srcId,l.currentTargetId,f),d.value=new Set([l.srcId]),st()}C.value=null,$.value=0,R.value=0,document.body.classList.remove("is-dragging")}}let ui=!1;function Ah(r){const l=r.target;if(!l||l.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(r.button===2){ui=!0,ge.startPan(r);return}if(ui=!1,r.button!==0)return;const f=c.value.getBoundingClientRect(),N=(r.clientX-f.left-ge.offsetX.value)/ge.scale.value,x=(r.clientY-f.top-ge.offsetY.value)/ge.scale.value;ge.startMarquee(N,x,{shift:r.shiftKey})}function _h(r){if(zn){zn=!1;return}const l=r.target;if(!l||l.closest(".zm-node"))return;const f=ge.marquee;f.width>=4||f.height>=4||d.value.size>0&&(d.value=new Set,st())}function Rh(){const r=ge.marquee;if(r.width<4&&r.height<4)return;const l=r.x,f=r.y,N=r.x+r.width,x=r.y+r.height,B=[];for(const A of sn.value){const v=A.width/2,Z=A.height/2,H=A.x-v,ie=A.x+v,T=A.y-Z,J=A.y+Z;H<=N&&ie>=l&&T<=x&&J>=f&&B.push(A.id)}d.value=r.shiftKey?new Set([...d.value,...B]):new Set(B),st()}function ka(r){return h.value.has(r)}function Bh(r){const l=be(m.value,r.id);return!!l&&l.children.length>0}function nr(r){const l=be(m.value,r);return l?Nr(l):0}function ya(r){if(!be(m.value,r))return 0;const N=[m.value];for(;N.length;){const x=N.pop(),B=x.children.findIndex(A=>A.id===r);if(B>=0)return B;for(const A of x.children)N.push(A)}return 0}function fi(r,l,f,N){const x=(N==null?void 0:N._dir)??r._dir;if(l==="out"&&r.isRoot&&M.lineOrigin==="center")return{x:r.x,y:r.y};if(l==="out"&&r.isRoot&&M.lineOrigin==="proportional"&&N){const v=ht.value.root.children;if(x==="down"){const ae=v.reduce((Le,Q)=>Math.max(Le,Math.abs(Q.x-r.x)),1),he=Math.min(1,Math.abs(N.x-r.x)/ae),Ae=r.y+r.height/2,Me=r.y;return{x:r.x,y:Ae+(Me-Ae)*he}}const Z=v.reduce((ae,he)=>Math.max(ae,Math.abs(he.y-r.y)),1),H=Math.min(1,Math.abs(N.y-r.y)/Z),ie=f!==void 0?f:r.side,T=r.x+ie*(r.width/2),J=r.x;return{x:T+(J-T)*H,y:r.y}}if(x==="down")return l==="out"?{x:r.x,y:r.y+r.height/2}:{x:r.x,y:r.y-r.height/2};let B;l==="in"?B=-r.side:f!==void 0?B=f:B=r.side;const A=l==="in"?r._richInsetX??0:0;return{x:r.x+B*(r.width/2-A),y:r.y}}function cn(){const r=ht.value;ge.resetView(r.width,r.height,r.root.y)}function vh(){eo.value=!0,Ve(),we(),e.nextTick(()=>cn())}function or(r){M.layoutMode!==r&&(M.layoutMode=r,we(),e.nextTick(()=>cn()))}function zh(){return JSON.stringify(m.value,null,2)}function xa(r){const l=be(m.value,r);return l?!!(l.note&&l.note.text||l.link&&l.link.url||l.image&&l.image.src||l.richContent&&l.richContent.raw||l.markers&&l.markers.length>0||l.tags&&l.tags.length>0):!1}function Ih(r){try{const l=JSON.parse(r);return!l.id||!Array.isArray(l.children)?!1:(Kt.reset(),m.value=Ot(l),d.value=new Set,h.value=new Set,we(),e.nextTick(()=>cn()),a("change",m.value),!0)}catch{return!1}}const Ea=e.ref(""),dn=e.ref([]),To=e.ref(-1);function Lh(r){Ea.value=r;const l=r.trim();if(!l){dn.value=[],To.value=-1;return}const f=l.toLowerCase(),N=[],x=B=>{var A;(B.text.toLowerCase().includes(f)||(A=B.note)!=null&&A.text&&B.note.text.toLowerCase().includes(f))&&N.push(B.id);for(const v of B.children)x(v)};x(m.value),dn.value=N,To.value=N.length>0?0:-1,N.length>0&&($h(N),e.nextTick(()=>Ph(0)))}function Oh(r){return dn.value.includes(r)}function Dh(r){return To.value>=0&&dn.value[To.value]===r}function Vh(r){return Ea.value.trim().length>0&&dn.value.length>0&&!dn.value.includes(r)}function $h(r){if(r.length===0)return;const l=new Set(r),f=new Set,N=x=>{let B=l.has(x.id);for(const A of x.children)N(A)&&(B=!0);return B&&x.children.length>0&&h.value.has(x.id)&&f.add(x.id),B};if(N(m.value),f.size>0){for(const x of f)h.value.delete(x);we()}}function Ph(r){const l=dn.value[r];if(!l)return;const f=sn.value.find(N=>N.id===l);f&&(d.value=new Set([l]),st(),ge.centerOn(f.x,f.y,f.width,f.height))}function Fh(r,l){const f=be(m.value,r);f&&(f.markers||(f.markers=[]),!f.markers.includes(l)&&(f.markers.push(l),Ve(),we(),a("change",m.value)))}function Uh(r,l){const f=be(m.value,r);if(!f||!f.markers)return;const N=f.markers.indexOf(l);N<0||(f.markers.splice(N,1),f.markers.length===0&&delete f.markers,Ve(),we(),a("change",m.value))}function wa(r,l){const f=be(m.value,r);if(!f)return!1;f.markers||(f.markers=[]);const N=f.markers.indexOf(l);return N>=0?(f.markers.splice(N,1),f.markers.length===0&&delete f.markers,Ve(),we(),a("change",m.value),!1):(f.markers.push(l),Ve(),we(),a("change",m.value),!0)}function Hh(r){const l=be(m.value,r);return l!=null&&l.markers?[...l.markers]:[]}function Wh(r){var f;const l=(f=z.value)==null?void 0:f.nodeId;l&&wa(l,r)}function Gh(){var f;const r=(f=z.value)==null?void 0:f.nodeId;if(!r)return;const l=be(m.value,r);!l||!l.markers||(delete l.markers,Ve(),we(),a("change",m.value),ye())}function ir(r,l){const f=be(m.value,r);f&&(l.length===0?f.tags&&delete f.tags:f.tags=[...l],Ve(),we(),a("change",m.value))}function jh(r){const l=be(m.value,r);return l!=null&&l.tags?[...l.tags]:[]}function Kh(){var B,A;const r=(B=z.value)==null?void 0:B.nodeId;if(!r)return;const l=be(m.value,r),f=((A=l==null?void 0:l.tags)==null?void 0:A.join(", "))??"",N=window.prompt("输入标签(多个用逗号分隔)",f);if(N===null)return;const x=N.split(/[,,]/).map(v=>v.trim()).filter(v=>v.length>0);ir(r,x),ye()}function Yh(){var l;const r=(l=z.value)==null?void 0:l.nodeId;r&&(ir(r,[]),ye())}function Na(){const r=ht.value,l="http://www.w3.org/2000/svg",f=document.createElementNS(l,"svg");f.setAttribute("xmlns",l),f.setAttribute("viewBox",`${r.vbX} ${r.vbY} ${r.vbW} ${r.vbH}`),f.setAttribute("width",String(r.vbW)),f.setAttribute("height",String(r.vbH));const N=document.createElementNS(l,"rect");N.setAttribute("x",String(r.vbX)),N.setAttribute("y",String(r.vbY)),N.setAttribute("width",String(r.vbW)),N.setAttribute("height",String(r.vbH)),N.setAttribute("fill",tn.value),f.appendChild(N);for(const A of ea.value){const v=document.createElementNS(l,"path");v.setAttribute("d",St(fi(A.from,"out",A.to.side,A.to),fi(A.to,"in"),D(A.from.depth),X(A.to.depth),32,b(A.from.isRoot),A.to._dir)),v.setAttribute("fill",No(A.from,A.to)),v.setAttribute("stroke","none"),f.appendChild(v)}const x="-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif";function B(A,v){let Z=0;for(const H of A)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(H)?Z+=v:Z+=v*.55;return Z}for(const A of sn.value){const v=A.x-A.width/2,Z=A.y-A.height/2,H=document.createElementNS(l,"rect");H.setAttribute("x",String(v)),H.setAttribute("y",String(Z)),H.setAttribute("width",String(A.width)),H.setAttribute("height",String(A.height)),H.setAttribute("rx","8"),H.setAttribute("fill",ql(A));const ie=no(A);ie!=="transparent"&&(H.setAttribute("stroke",ie),H.setAttribute("stroke-width","1")),f.appendChild(H);const T=!!(A.tags&&A.tags.length>0),J=!!(A.markers&&A.markers.length>0),ae=!!A.image,he=!!(A.richContent&&(A.richContent.kind==="code"||A.richContent.kind==="table"));let Ae=0,Me=0;if(he){const Ye=A.richContent,et=A.fontSize*.78*.92,Bt=6,Ue=4,on=2,qt=6;if(Ye.kind==="code"){const vt=jo(Ye.raw),Tt=Tn(Ye.raw),zt=vt.split(`
|
|
137
|
+
`),rn=et*1.35;let Ht=0;for(const We of zt)Ht=Math.max(Ht,B(We,et));Me=Math.min(Ht+Bt*2+4,A.width-4),Ae=zt.length*rn+Ue*2+on;const tt=A.x-Me/2;let yt=Z+4;ae&&(yt=Z+A.image.height+qt);const It=document.createElementNS(l,"rect");if(It.setAttribute("x",String(tt)),It.setAttribute("y",String(yt)),It.setAttribute("width",String(Me)),It.setAttribute("height",String(Ae-on)),It.setAttribute("rx","6"),It.setAttribute("fill","rgba(255,255,255,0.55)"),It.setAttribute("stroke",no(A)),It.setAttribute("stroke-width","1"),f.appendChild(It),Tt){const We=document.createElementNS(l,"text");We.setAttribute("x",String(tt+Me-Bt)),We.setAttribute("y",String(yt+Ue+4)),We.setAttribute("text-anchor","end"),We.setAttribute("fill",to(A)),We.setAttribute("font-size",String(et*.8)),We.setAttribute("font-family",x),We.setAttribute("opacity","0.5"),We.textContent=Tt,f.appendChild(We)}const Mo="'JetBrains Mono','Fira Code',Consolas,monospace";for(let We=0;We<zt.length;We++){const ct=document.createElementNS(l,"text");ct.setAttribute("x",String(tt+Bt)),ct.setAttribute("y",String(yt+Ue+(We+.5)*rn+2)),ct.setAttribute("dominant-baseline","central"),ct.setAttribute("fill",to(A)),ct.setAttribute("font-size",String(et)),ct.setAttribute("font-family",Mo);let Wt=zt[We];const qe=Math.floor((Me-Bt*2)/(et*.6));Wt.length>qe&&(Wt=Wt.substring(0,qe-1)+"…"),ct.textContent=Wt,f.appendChild(ct)}}else if(Ye.kind==="table"){const vt=Ri(Ye.raw);if(vt.length>0){const Tt=et*1.35,zt=6,rn=3,Ht=vt[0].length,tt=[];for(let qe=0;qe<Ht;qe++){let un=0;for(const wn of vt)qe<wn.length&&(un=Math.max(un,B(wn[qe],et)));tt.push(un+zt*2)}Me=Math.min(tt.reduce((qe,un)=>qe+un,0),A.width-4);const yt=Me/tt.reduce((qe,un)=>qe+un,0);for(let qe=0;qe<Ht;qe++)tt[qe]*=yt;Ae=vt.length*(Tt+rn*2)+on;const It=A.x-Me/2;let Mo=Z+4;ae&&(Mo=Z+A.image.height+qt);const We=document.createElementNS(l,"rect");We.setAttribute("x",String(It)),We.setAttribute("y",String(Mo)),We.setAttribute("width",String(Me)),We.setAttribute("height",String(Ae-on)),We.setAttribute("rx","6"),We.setAttribute("fill","rgba(255,255,255,0.55)"),We.setAttribute("stroke",no(A)),We.setAttribute("stroke-width","1"),f.appendChild(We);let ct=It,Wt=Mo;for(let qe=0;qe<vt.length;qe++){const un=vt[qe],wn=Tt+rn*2;ct=It;for(let Ao=0;Ao<Ht;Ao++){const io=tt[Ao],qh=un[Ao]||"";if(Ao<Ht-1){const Xe=document.createElementNS(l,"line");Xe.setAttribute("x1",String(ct+io)),Xe.setAttribute("y1",String(Wt)),Xe.setAttribute("x2",String(ct+io)),Xe.setAttribute("y2",String(Wt+wn)),Xe.setAttribute("stroke",no(A)),Xe.setAttribute("stroke-width","1"),f.appendChild(Xe)}if(qe<vt.length-1){const Xe=document.createElementNS(l,"line");Xe.setAttribute("x1",String(ct)),Xe.setAttribute("y1",String(Wt+wn)),Xe.setAttribute("x2",String(ct+io)),Xe.setAttribute("y2",String(Wt+wn)),Xe.setAttribute("stroke",no(A)),Xe.setAttribute("stroke-width","1"),f.appendChild(Xe)}if(qe===0){const Xe=document.createElementNS(l,"rect");Xe.setAttribute("x",String(ct)),Xe.setAttribute("y",String(Wt)),Xe.setAttribute("width",String(io)),Xe.setAttribute("height",String(wn)),Xe.setAttribute("fill","rgba(255,255,255,0.4)"),f.appendChild(Xe)}const fn=document.createElementNS(l,"text");fn.setAttribute("x",String(ct+zt)),fn.setAttribute("y",String(Wt+rn+Tt/2+2)),fn.setAttribute("dominant-baseline","central"),fn.setAttribute("fill",to(A)),fn.setAttribute("font-size",String(et)),fn.setAttribute("font-family",x),qe===0&&fn.setAttribute("font-weight","600");let mi=qh;const rr=Math.floor((io-zt*2)/(et*.55));mi.length>rr&&rr>2&&(mi=mi.substring(0,rr-1)+"…"),fn.textContent=mi,f.appendChild(fn),ct+=io}Wt+=wn}}}}let Le=0;if(ae){const Ye=A.image,et=Z+4,Bt=A.x-Ye.width/2,Ue=document.createElementNS(l,"image");Ue.setAttribute("x",String(Bt)),Ue.setAttribute("y",String(et)),Ue.setAttribute("width",String(Ye.width)),Ue.setAttribute("height",String(Ye.height)),Ue.setAttribute("href",Ye.src),Ue.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",Ye.src),Ue.setAttribute("preserveAspectRatio","xMidYMid meet"),f.appendChild(Ue),Le=Ye.height+6}let Q=A.y;const ne=Le+Ae;ne>0?Q=Z+ne+(A.height-ne)/2:T&&(Q=A.y-8);const Pe=14,Oe=2,gt=4,K=J?A.markers.length:0,Te=K>0?K*Pe+(K-1)*Oe+gt:0,_e=B(A.text,A.fontSize),bt=Te+_e,nn=A.x-bt/2;if(J){let Ye=nn;for(const et of A.markers){const Bt=Lo(et);if(Bt){const Ue=document.createElementNS(l,"svg");Ue.setAttribute("x",String(Ye)),Ue.setAttribute("y",String(Q-Pe/2)),Ue.setAttribute("width",String(Pe)),Ue.setAttribute("height",String(Pe)),Ue.setAttribute("viewBox","0 0 24 24"),Ue.setAttribute("color",to(A));const qt=new DOMParser().parseFromString(`<svg xmlns="${l}">${Bt}</svg>`,"image/svg+xml");if(!qt.querySelector("parsererror"))for(;qt.documentElement.firstChild;)Ue.appendChild(qt.documentElement.firstChild);f.appendChild(Ue)}Ye+=Pe+Oe}}const Rt=J?nn+Te+_e/2:A.x,kt=document.createElementNS(l,"text");if(kt.setAttribute("x",String(Rt)),kt.setAttribute("y",String(Q)),kt.setAttribute("text-anchor","middle"),kt.setAttribute("dominant-baseline","central"),kt.setAttribute("fill",to(A)),kt.setAttribute("font-size",String(Zl(A))),kt.setAttribute("font-weight",String(Xl(A))),kt.setAttribute("font-family",x),kt.textContent=A.text,f.appendChild(kt),T){const Ue=A.y+10,on=A.tags.map(Tt=>B(Tt,10)+12),qt=on.reduce((Tt,zt)=>Tt+zt+3,-3);let vt=A.x-qt/2;for(let Tt=0;Tt<A.tags.length;Tt++){const zt=A.tags[Tt],rn=yi(zt),Ht=on[Tt],tt=document.createElementNS(l,"rect");tt.setAttribute("x",String(vt)),tt.setAttribute("y",String(Ue-16/2)),tt.setAttribute("width",String(Ht)),tt.setAttribute("height",String(16)),tt.setAttribute("rx",String(16/2)),tt.setAttribute("fill",rn.background),tt.setAttribute("stroke",rn.borderColor),tt.setAttribute("stroke-width","1"),f.appendChild(tt);const yt=document.createElementNS(l,"text");yt.setAttribute("x",String(vt+Ht/2)),yt.setAttribute("y",String(Ue)),yt.setAttribute("text-anchor","middle"),yt.setAttribute("dominant-baseline","central"),yt.setAttribute("fill",rn.color),yt.setAttribute("font-size",String(10)),yt.setAttribute("font-family",x),yt.textContent=zt,f.appendChild(yt),vt+=Ht+3}}}return f}function Co(){const r=Na();let f=new XMLSerializer().serializeToString(r);f.startsWith("<?xml")||(f=`<?xml version="1.0" encoding="UTF-8"?>
|
|
138
|
+
`+f);const N=new Blob([f],{type:"image/svg+xml;charset=utf-8"}),x=URL.createObjectURL(N),B=document.createElement("a");B.href=x,B.download=`${m.value.text||"mindmap"}.svg`,B.click(),URL.revokeObjectURL(x)}function Sa(r=2){const l=Na(),f=ht.value;let x=new XMLSerializer().serializeToString(l);x.startsWith("<?xml")||(x=`<?xml version="1.0" encoding="UTF-8"?>
|
|
139
|
+
`+x);const B=new Blob([x],{type:"image/svg+xml;charset=utf-8"}),A=URL.createObjectURL(B),v=new window.Image;v.onload=()=>{const Z=document.createElement("canvas");Z.width=Math.ceil(f.vbW*r),Z.height=Math.ceil(f.vbH*r);const H=Z.getContext("2d");if(!H){URL.revokeObjectURL(A);return}H.fillStyle=tn.value,H.fillRect(0,0,Z.width,Z.height),H.drawImage(v,0,0,Z.width,Z.height),URL.revokeObjectURL(A);try{Z.toBlob(ie=>{if(!ie){Co();return}const T=URL.createObjectURL(ie),J=document.createElement("a");J.href=T,J.download=`${m.value.text||"mindmap"}.png`,J.click(),URL.revokeObjectURL(T)},"image/png")}catch(ie){console.warn("PNG export failed, falling back to SVG:",ie),Co()}},v.onerror=()=>{URL.revokeObjectURL(A),Co()},v.src=A}return o({addChild:r=>oo(r),addSibling:r=>ci(r),removeNode:r=>ua(r),duplicateNode:r=>ia(r),setNodeText:(r,l)=>ha(r,l),moveNode:(r,l,f)=>tr(r,l,f),lineWidthForDepth:D,endWidthForDepth:X,getData:()=>m.value,nodeHasContent:r=>xa(r),getSelectedIds:()=>[...d.value],copyNodes:r=>sa(r),cutNodes:r=>ca(r),pasteNodes:r=>da(r),setData:r=>{Kt.reset(),m.value=Ot(r),d.value=new Set,h.value=new Set,we(),Ve(),e.nextTick(()=>cn())},resetView:()=>cn(),exportData:zh,importData:Ih,getMarkdown:()=>Dn(m.value),setMarkdown:(r,l=!0)=>{const f=On(r||"");l&&(Y.value=!0),E=!l,Kt.reset(),m.value=Ot(f),d.value=new Set,h.value=new Set,we(),Ve(),e.nextTick(()=>{E=!1,cn()}),a("change",m.value)},setBalanced:r=>{eo.value=r},isBalanced:()=>eo.value,balance:()=>vh(),applyNodeStyle:(r,l)=>Ee(r,l),getNodeStyle:r=>ee(r),applyNodeImage:(r,l)=>ce(r,l),applyNodeImageByUrl:(r,l)=>g(r,l),removeNodeImage:r=>ue(r),applyNodeLink:(r,l)=>fe(r,l),removeNodeLink:r=>O(r),applyNodeNote:(r,l)=>L(r,l),removeNodeNote:r=>se(r),applyNodeRichContent:(r,l)=>ke(r,l),addNodeMarker:(r,l)=>Fh(r,l),removeNodeMarker:(r,l)=>Uh(r,l),toggleNodeMarker:(r,l)=>wa(r,l),getNodeMarkers:r=>Hh(r),setNodeTags:(r,l)=>ir(r,l),getNodeTags:r=>jh(r),exportPNG:r=>Sa(r),exportSVG:()=>Co(),searchNodes:r=>(Lh(r),[...dn.value]),undo:()=>Qi(),redo:()=>er(),canUndo:()=>Kt.canUndo(),canRedo:()=>Kt.canRedo(),applySettings:r=>{r.autoBalanceOnChange!==void 0&&(M.autoBalanceOnChange=r.autoBalanceOnChange),r.lineWidthStart!==void 0&&(M.lineWidthStart=Math.max(.5,Math.min(20,r.lineWidthStart))),r.lineWidthEnd!==void 0&&(M.lineWidthEnd=Math.max(.3,Math.min(10,r.lineWidthEnd))),r.rainbowBranch!==void 0&&(M.rainbowBranch=r.rainbowBranch),r.branchPaletteId!==void 0&&(M.branchPaletteId=r.branchPaletteId),r.customPalettes!==void 0&&(M.customPalettes=r.customPalettes),r.lineStyle!==void 0&&(M.lineStyle=r.lineStyle),r.rootLineStyle!==void 0&&(M.rootLineStyle=r.rootLineStyle),r.lineOrigin!==void 0&&(M.lineOrigin=r.lineOrigin),r.taperedEdge!==void 0&&(M.taperedEdge=r.taperedEdge),r.lineWidthTaper!==void 0&&(M.lineWidthTaper=Math.max(.1,Math.min(1,r.lineWidthTaper))),r.uniformLineWidth!==void 0&&(M.uniformLineWidth=r.uniformLineWidth),r.elbowRadius!==void 0&&(M.elbowRadius=Math.max(2,Math.min(40,r.elbowRadius))),r.showOrderBadge!==void 0&&(M.showOrderBadge=r.showOrderBadge),r.canvasBg!==void 0&&(M.canvasBg=r.canvasBg)},getSettings:()=>({autoBalanceOnChange:M.autoBalanceOnChange,lineWidthStart:M.lineWidthStart,lineWidthEnd:M.lineWidthEnd,rainbowBranch:M.rainbowBranch,branchPaletteId:M.branchPaletteId,customPalettes:M.customPalettes,lineStyle:M.lineStyle,rootLineStyle:M.rootLineStyle,lineOrigin:M.lineOrigin,layoutMode:M.layoutMode,taperedEdge:M.taperedEdge,lineWidthTaper:M.lineWidthTaper,uniformLineWidth:M.uniformLineWidth,elbowRadius:M.elbowRadius,showOrderBadge:M.showOrderBadge,canvasBg:M.canvasBg}),setBranchPalette:r=>{if(!r)return;[...mn,...M.customPalettes].find(f=>f.id===r)&&(M.branchPaletteId=r)},getBranchPalette:()=>M.branchPaletteId,getBranchPalettes:()=>[...mn,...M.customPalettes],getSearchResults:()=>[...dn.value],getSearchIndex:()=>To.value}),e.watch(()=>i.data,r=>{m.value=Ot(r),we()},{deep:!1}),e.onMounted(()=>{Ve(),e.nextTick(()=>cn())}),(r,l)=>{var f,N,x,B,A,v,Z,H,ie;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:tn.value,fontSize:Nt.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:c,class:"zm-canvas",onMousedown:Ah,onContextmenu:nt,onWheel:l[26]||(l[26]=(...T)=>e.unref(ge).onWheel&&e.unref(ge).onWheel(...T)),onMouseenter:l[27]||(l[27]=T=>w.value=!0),onMouseleave:l[28]||(l[28]=T=>w.value=!1),onClick:_h},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:ht.value.vbX*e.unref(ge).scale.value+e.unref(ge).offsetX.value+"px",top:ht.value.vbY*e.unref(ge).scale.value+e.unref(ge).offsetY.value+"px",width:ht.value.vbW*e.unref(ge).scale.value+"px",height:ht.value.vbH*e.unref(ge).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:fh.value,preserveAspectRatio:"xMinYMin meet",width:ht.value.vbW*e.unref(ge).scale.value,height:ht.value.vbH*e.unref(ge).scale.value},[e.createElementVNode("g",Dp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ea.value,T=>(e.openBlock(),e.createElementBlock("path",{key:T.key,d:St(fi(T.from,"out",T.to.side,T.to),fi(T.to,"in"),D(T.from.depth),X(T.to.depth),32,b(T.from.isRoot),T.to._dir),fill:No(T.from,T.to),stroke:"none"},null,8,Vp))),128))])],8,Op))],4),e.unref(ge).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(ge).marquee.x*e.unref(ge).scale.value+e.unref(ge).offsetX.value+"px",top:e.unref(ge).marquee.y*e.unref(ge).scale.value+e.unref(ge).offsetY.value+"px",width:e.unref(ge).marquee.width*e.unref(ge).scale.value+"px",height:e.unref(ge).marquee.height*e.unref(ge).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:$.value+"px",top:R.value+"px",transform:`scale(${e.unref(ge).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(C.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(ge).offsetX.value}px, ${e.unref(ge).offsetY.value}px) scale(${e.unref(ge).scale.value})`})},[U.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drop-indicator",style:e.normalizeStyle({left:U.value.x1+"px",top:U.value.y1+"px",width:U.value.horizontal?U.value.x2-U.value.x1+"px":"3px",height:U.value.horizontal?"3px":U.value.y2-U.value.y1+"px",transform:U.value.horizontal?"translateY(-1.5px)":"translateX(-1.5px)"})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sn.value,T=>{var J,ae,he,Ae,Me,Le,Q;return e.openBlock(),e.createElementBlock("div",{key:T.id,class:e.normalizeClass(["zm-node",{"is-root":T.isRoot,"is-selected":p.value===T.id,"is-selected-secondary":p.value!==T.id&&d.value.has(T.id),"is-editing":s.value===T.id,"has-image":!!T.image,"is-resizing":Zi.value===T.id,"is-dragging-source":((J=C.value)==null?void 0:J.srcId)===T.id,"is-drop-target":((ae=C.value)==null?void 0:ae.currentTargetId)===T.id&&((he=C.value)==null?void 0:he.dropPosition)==="child","is-drop-target-before":((Ae=C.value)==null?void 0:Ae.currentTargetId)===T.id&&((Me=C.value)==null?void 0:Me.dropPosition)==="before","is-drop-target-after":((Le=C.value)==null?void 0:Le.currentTargetId)===T.id&&((Q=C.value)==null?void 0:Q.dropPosition)==="after","is-search-hit":Oh(T.id),"is-search-current":Dh(T.id),"is-search-dimmed":Vh(T.id)}]),"data-node-id":T.id,style:e.normalizeStyle({left:T.x+"px",top:T.y+"px",width:T.width+"px",minWidth:T.width+"px",height:T.height+"px",fontSize:Zl(T)+"px",background:ql(T),color:to(T),borderColor:no(T),fontWeight:Xl(T),transform:"translate(-50%, -50%)"}),onClick:ne=>Sh(ne,T),onPointerdown:ne=>Ch(ne,T),onDblclick:ne=>{ne.stopPropagation(),t.previewMode||So(T.id)},onContextmenu:ne=>te(ne,T),onMouseenter:ne=>{Jn(T.id),Qn(ne,T)},onMouseleave:ne=>xn(T.id)},[T.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:T.image.src,width:T.image.width,height:T.image.height,alt:T.text,draggable:"false"},null,8,Pp)):e.createCommentVNode("",!0),T.richContent&&(T.richContent.kind==="code"||T.richContent.kind==="table")&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":T.richContent.kind==="table"||T.richContent.kind==="code"}]),onClick:l[1]||(l[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ne=>hh(T.id),["stop"]),onMousedown:l[2]||(l[2]=e.withModifiers(()=>{},["stop"]))},[y.value===T.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":l[0]||(l[0]=ne=>k.value=ne),class:"zm-rich-edit",spellcheck:"false",onBlur:oa,onKeydown:bh},null,544)),[[e.vModelText,k.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[T.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Up,[e.createElementVNode("code",{innerHTML:e.unref(_i)(e.unref(jo)(T.richContent.raw),e.unref(Tn)(T.richContent.raw))},null,8,Hp)])):T.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Wp,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Ri)(T.richContent.raw),(ne,Pe)=>(e.openBlock(),e.createElementBlock("tr",{key:Pe},[Pe===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ne,(Oe,gt)=>(e.openBlock(),e.createElementBlock("th",{key:`h${gt}`},e.toDisplayString(Oe),1))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ne,(Oe,gt)=>(e.openBlock(),e.createElementBlock("td",{key:`c${gt}`},e.toDisplayString(Oe),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Fp)):e.createCommentVNode("",!0),s.value!==T.id?(e.openBlock(),e.createElementBlock("span",Gp,[T.markers&&T.markers.length>0?(e.openBlock(),e.createElementBlock("span",jp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.markers,ne=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-node-marker",title:e.unref(Tr)(ne),innerHTML:'<svg viewBox="0 0 24 24" width="14" height="14">'+e.unref(Lo)(ne)+"</svg>"},null,8,Kp))),128))])):e.createCommentVNode("",!0),e.createElementVNode("span",Yp,e.toDisplayString(T.text),1),T.link&&s.value!==T.id?(e.openBlock(),e.createElementBlock("a",{key:1,class:"zm-node-link",href:T.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${T.link.url}`,onClick:l[3]||(l[3]=e.withModifiers(()=>{},["stop"])),onMousedown:l[4]||(l[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ve,{name:"link",size:11,stroke:2})],40,qp)):e.createCommentVNode("",!0),T.note&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-note-btn",type:"button",title:ai(T.note.text),onClick:e.withModifiers(ne=>li(T.id),["stop"]),onMousedown:l[5]||(l[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(ve,{name:"note",size:11,stroke:2})],40,Xp)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:3,class:"zm-input","onUpdate:modelValue":l[6]||(l[6]=ne=>u.value=ne),autofocus:"",rows:"1",onBlur:l[7]||(l[7]=ne=>Ji()),onKeydown:[l[8]||(l[8]=e.withKeys(e.withModifiers(ne=>Ji(),["exact","prevent"]),["enter"])),l[9]||(l[9]=e.withKeys(e.withModifiers(ne=>Ji(),["prevent"]),["tab"])),e.withKeys(mh,["esc"]),kh],onInput:ph,onMousedown:l[10]||(l[10]=e.withModifiers(()=>{},["stop"])),onClick:l[11]||(l[11]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),T.tags&&T.tags.length>0&&s.value!==T.id?(e.openBlock(),e.createElementBlock("div",Zp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.tags,ne=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-node-tag",style:e.normalizeStyle(e.unref(yi)(ne))},e.toDisplayString(ne),5))),128))])):e.createCommentVNode("",!0),re.value?(e.openBlock(),e.createElementBlock("span",{key:5,class:"zm-order-badge",title:`数据顺序:第 ${ya(T.id)+1} 个`},e.toDisplayString(ya(T.id)+1),9,Jp)):e.createCommentVNode("",!0),ka(T.id)&&nr(T.id)>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({background:En.value.get(T.id)??"#64748b"}),title:`展开 ${nr(T.id)} 个子节点`,onMousedown:l[12]||(l[12]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>fa(T.id),["stop"])},e.toDisplayString(nr(T.id)),47,Qp)):e.createCommentVNode("",!0),Bh(T)&&!ka(T.id)?(e.openBlock(),e.createElementBlock("button",{key:7,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":T.side===-1}]),style:e.normalizeStyle({"--zm-collapse-color":En.value.get(T.id)??"#64748b"}),title:"折叠",onMousedown:l[13]||(l[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>fa(T.id),["stop"])},[...l[36]||(l[36]=[e.createElementVNode("span",{class:"zm-collapse-bar"},null,-1)])],46,eh)):e.createCommentVNode("",!0),T.image&&p.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("span",{key:8,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ne=>At(ne,T),["stop"])},null,40,th)):e.createCommentVNode("",!0),T.image&&p.value===T.id&&s.value!==T.id?(e.openBlock(),e.createElementBlock("button",{key:9,class:"zm-img-remove-btn",title:"移除图片",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ne=>ue(T.id),["stop"])},[e.createVNode(ve,{name:"x",size:10,stroke:2.2})],40,nh)):e.createCommentVNode("",!0)],46,$p)}),128))],4),_.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!_.value.above}]),style:e.normalizeStyle({left:_.value.x+"px",top:_.value.y+"px"})},e.toDisplayString(_.value.text),7)):e.createCommentVNode("",!0),z.value?(e.openBlock(),e.createBlock(bs,{key:3,x:z.value.x,y:z.value.y,container:c.value,"has-image":!!((f=e.unref(be)(m.value,z.value.nodeId))!=null&&f.image),"has-link":!!((N=e.unref(be)(m.value,z.value.nodeId))!=null&&N.link),"has-note":!!((x=e.unref(be)(m.value,z.value.nodeId))!=null&&x.note),"has-code":((A=(B=e.unref(be)(m.value,z.value.nodeId))==null?void 0:B.richContent)==null?void 0:A.kind)==="code","has-table":((Z=(v=e.unref(be)(m.value,z.value.nodeId))==null?void 0:v.richContent)==null?void 0:Z.kind)==="table","node-markers":((H=e.unref(be)(m.value,z.value.nodeId))==null?void 0:H.markers)??[],"node-tags":((ie=e.unref(be)(m.value,z.value.nodeId))==null?void 0:ie.tags)??[],onPickImage:bo,onRemoveImage:vn,onSetLink:Yi,onRemoveLink:ko,onEditNote:yo,onRemoveNote:qi,onAddCode:ri,onEditCode:ri,onRemoveCode:Xi,onAddTable:je,onEditTable:je,onRemoveTable:kn,onToggleMarker:Wh,onClearMarkers:Gh,onAddTag:Kh,onRemoveTags:Yh,onClose:ye},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table","node-markers","node-tags"])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createBlock(ks,{key:4,x:S.value.x,y:S.value.y,container:c.value,onOpenSettings:ot,onOpenData:ln,onOpenImport:it,onExportPng:Sa,onExportSvg:Co,onClose:ft},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(F.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:l[15]||(l[15]=T=>a("canvas-toggle-preview"))},[e.createVNode(ve,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,oh),e.createElementVNode("button",{class:e.normalizeClass(W.value),title:"显示大纲视图",onClick:go},[e.createVNode(ve,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":w.value}])},[e.createElementVNode("span",{class:"zm-tb-tip zm-tb-zoom",title:"点击重置为 100%",onClick:l[16]||(l[16]=T=>e.unref(ge).zoomTo100())},e.toDisplayString(Math.round(e.unref(ge).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:l[17]||(l[17]=(...T)=>e.unref(ge).zoomIn&&e.unref(ge).zoomIn(...T))},[e.createVNode(ve,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:l[18]||(l[18]=(...T)=>e.unref(ge).zoomOut&&e.unref(ge).zoomOut(...T))},[e.createVNode(ve,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:cn},[e.createVNode(ve,{name:"reset"})]),l[39]||(l[39]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:Eh},[e.createVNode(ve,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:l[19]||(l[19]=T=>pa(1))},[e.createVNode(ve,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:l[20]||(l[20]=T=>pa(2))},[e.createVNode(ve,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:wh},[e.createVNode(ve,{name:"expand-all"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[37]||(l[37]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:l[21]||(l[21]=T=>p.value&&oo(p.value))},[e.createElementVNode("img",{src:e.unref(cr),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,ih)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:l[22]||(l[22]=T=>p.value&&ci(p.value))},[e.createElementVNode("img",{src:e.unref(sr),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,rh)]),l[38]||(l[38]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:M.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:l[23]||(l[23]=T=>or("mindmap"))},[e.createVNode(ve,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:M.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:l[24]||(l[24]=T=>or("tree"))},[e.createVNode(ve,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:M.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:l[25]||(l[25]=T=>or("org"))},[e.createVNode(ve,{name:"org"})],2)],64))],2)],544),i.builtInDrawers?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Vt,{side:"left",scope:"canvas",width:300,open:an.value&&!t.previewMode,title:"大纲","onUpdate:open":l[29]||(l[29]=T=>an.value=T)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:m.value,"selected-id":p.value,"collapsed-ids":rt.value,"show-index":re.value,onSelect:ho,onToggleCollapse:bn,onEdit:ii,onAddChild:Yn,onAddSibling:qn,onMove:Ut},null,8,["data","selected-id","collapsed-ids","show-index"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",scope:"canvas",width:360,open:Pt.value&&!t.previewMode,title:"数据","onUpdate:open":l[31]||(l[31]=T=>Pt.value=T)},{default:e.withCtx(()=>[e.createVNode(Do,{data:m.value,"pending-mode":Ft.value,onImport:l[30]||(l[30]=T=>m.value=T),onConsumedMode:Ge},null,8,["data","pending-mode"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",scope:"canvas",width:420,open:me.value&&!t.previewMode,title:"Markdown","onUpdate:open":l[33]||(l[33]=T=>me.value=T)},{default:e.withCtx(()=>[e.createVNode(Vo,{data:m.value,onImport:l[32]||(l[32]=T=>m.value=T)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",scope:"canvas",width:360,open:mt.value&&!t.previewMode,title:"节点内容","onUpdate:open":l[34]||(l[34]=T=>mt.value=T)},{default:e.withCtx(()=>[e.createVNode(Qo,{"selected-node":wt.value,"focus-tick":ze.value,onApply:lt,onRemove:Mt,onSetLink:Bn,onSetImage:ni,onSetRich:oi},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",scope:"canvas",width:340,open:De.value&&!t.previewMode,title:"设置","onUpdate:open":l[35]||(l[35]=T=>De.value=T)},{default:e.withCtx(()=>{var T;return[e.createVNode($o,{settings:M,"has-selection":p.value!==null,"selected-node-text":(T=wt.value)==null?void 0:T.text,"node-style":q.value,"onUpdate:settings":le,"onUpdate:nodeStyle":xe,onReset:Re},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])],64)):e.createCommentVNode("",!0)],4)}}}),lh={class:"zm-app"},ah={class:"zm-app-main"},sh={class:"zm-app-canvas"},Yl=e.defineComponent({__name:"App",setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
|
|
140
140
|
所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},children:[{id:"r_image",text:"嵌入图片",image:{src:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 40" width="80" height="40"><rect width="80" height="40" rx="6" fill="#6366f1"/><text x="40" y="24" text-anchor="middle" fill="#fff" font-family="sans-serif" font-size="12" font-weight="600">LOGO</text></svg>'),naturalW:80,naturalH:40,width:80,height:40},children:[{id:"r_image_a",text:"节点上方的图标 / logo",children:[]},{id:"r_image_b",text:"remote URL 或 data: URL",children:[]},{id:"r_image_c",text:"可拖拽改尺寸",children:[]}]},{id:"r_code",text:"代码块",richContent:{kind:"code",lang:"ts",raw:'```ts\nimport { MindMap } from "flow-mindmap"\nconst tree = MindMap.parse(md)\n```'},note:{text:`代码块以 richContent 形式携带,
|
|
141
141
|
渲染在节点标题上方,自动支持语言 tag。`},link:{url:"https://flow-mindmap.example/docs/api"},children:[{id:"r_code_a",text:"等宽字体,自动换行",richContent:{kind:"code",lang:"js",raw:"```js\nconst sum = (a, b) => a + b\nconsole.log(sum(1, 2)) // 3\n```"},children:[]},{id:"r_code_b",text:"保留原始 ```lang 标签",richContent:{kind:"code",lang:"bash",raw:"```bash\nnpm install flow-mindmap\nnpm run dev\n```"},children:[]},{id:"r_code_c",text:"max-height 截断,框内可滚",richContent:{kind:"code",lang:"ts",raw:`\`\`\`ts
|
|
142
142
|
interface Node {
|
|
@@ -167,4 +167,4 @@ function walk(n: Node) {
|
|
|
167
167
|
| --- | --- | --- | --- | --- |
|
|
168
168
|
| 1 | 2 | 3 | 4 | 5 |
|
|
169
169
|
| 6 | 7 | 8 | 9 | 10 |`},children:[]}]},{id:"r_note",text:"笔记 (note)",note:{text:`节点右上角的便签图标。
|
|
170
|
-
鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?i:typeof location<"u"&&location.hash==="#stress"?a:(typeof location<"u"&&location.hash==="#rich",o)}const i={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},a=(()=>{const
|
|
170
|
+
鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?i:typeof location<"u"&&location.hash==="#stress"?a:(typeof location<"u"&&location.hash==="#rich",o)}const i={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},a=(()=>{const z=(W,te)=>({id:W,text:te,children:[]}),S=[z("s_l1","左一"),z("s_l2","左二"),z("s_l3","左三"),z("s_l4","左四"),z("s_l5","左五"),z("s_l6","左六"),z("s_l7","左七")],F=[z("s_r1","右一"),z("s_r2","右二"),z("s_r3","右三"),z("s_r4","右四"),z("s_r5","右五"),z("s_r6","右六"),z("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...S,...F]}})(),c=e.ref(o),s=e.ref(null),u=e.ref(new Set),d=e.ref(!1),p=e.ref(!1),h=e.ref(!1),w=e.ref(!1),C=e.ref(0),$=e.ref(!1),R=e.ref(!1),U=e.ref(null);function I(){c.value=n()}function _(){p.value=!0,h.value=!1,w.value=!1}function y(z){_()}const k=e.reactive({autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.1,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0}),m=e.computed(()=>{var z;return s.value?((z=U.value)==null?void 0:z.getNodeStyle(s.value.id))??{}:{}});function P(z){var S;Object.assign(k,z),(S=U.value)==null||S.applySettings(z)}function j(z){var S;s.value&&((S=U.value)==null||S.applyNodeStyle(s.value.id,z))}function Y(){var S;const z={autoBalanceOnChange:!0,lineWidthStart:16,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"rounded-elbow",rootLineStyle:"arc",lineOrigin:"proportional",layoutMode:"mindmap",taperedEdge:!0,lineWidthTaper:.1,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0};Object.assign(k,z),(S=U.value)==null||S.applySettings(z)}function E(z){if(z.key==="Escape"){if($.value){$.value=!1,z.stopPropagation();return}R.value&&(R.value=!1,z.stopPropagation())}}e.onMounted(()=>{var z;document.addEventListener("keydown",E),window.addEventListener("hashchange",I),(z=U.value)==null||z.applySettings({rainbowBranch:k.rainbowBranch,branchPaletteId:k.branchPaletteId,customPalettes:k.customPalettes,lineWidthStart:k.lineWidthStart,lineWidthEnd:k.lineWidthEnd,lineStyle:k.lineStyle,rootLineStyle:k.rootLineStyle,lineOrigin:k.lineOrigin})}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",E),window.removeEventListener("hashchange",I)});function re(z){c.value=z}function pe(z){var F;const S=z&&z.length>0?z[0]:null;s.value=S,S?!w.value&&((F=U.value)!=null&&F.nodeHasContent(S.id))&&(p.value=!1,h.value=!1,w.value=!0):w.value=!1}e.watch(c,z=>{if(!s.value)return;const S=Ee(z,s.value.id);S?S!==s.value&&(s.value=S):s.value=null},{deep:!1});function de(z){if(!s.value||s.value.id!==z){const S=Ee(c.value,z);S&&(s.value=S)}p.value=!1,h.value=!1,w.value=!0,C.value++}function Ee(z,S){if(z.id===S)return z;for(const F of z.children){const W=Ee(F,S);if(W)return W}return null}function ee(z){var S;s.value&&((S=U.value)==null||S.applyNodeNote(s.value.id,z))}function ce(){var z;s.value&&((z=U.value)==null||z.removeNodeNote(s.value.id))}function ue(z){var S;s.value&&((S=U.value)==null||S.applyNodeLink(s.value.id,z))}function g(z){var S;s.value&&((S=U.value)==null||S.applyNodeImageByUrl(s.value.id,z))}function V(z){var S;s.value&&((S=U.value)==null||S.applyNodeRichContent(s.value.id,z))}function G(z){const S=document.querySelector(`[data-node-id="${z.id}"]`);S&&S.click()}function oe(z){const S=new Set(u.value);S.has(z)?S.delete(z):S.add(z),u.value=S}function fe(z){var S;(S=U.value)==null||S.setNodeText(z.id,z.text)}function O(z){var S;(S=U.value)==null||S.addChild(z)}function L(z){var S;(S=U.value)==null||S.addSibling(z)}function se(z){var S;(S=U.value)==null||S.moveNode(z.srcId,z.targetId,z.position)}const ke=e.computed(()=>{var z;return((z=s.value)==null?void 0:z.id)??null});return(z,S)=>(e.openBlock(),e.createElementBlock("div",lh,[e.createVNode(Vt,{side:"left",width:300,open:d.value,title:"大纲","onUpdate:open":S[0]||(S[0]=F=>d.value=F)},{default:e.withCtx(()=>[e.createVNode(Oo,{data:c.value,"selected-id":ke.value,"collapsed-ids":u.value,onSelect:G,onToggleCollapse:oe,onEdit:fe,onAddChild:O,onAddSibling:L,onMove:se},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",ah,[R.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:S[1]||(S[1]=F=>R.value=!1)},[...S[11]||(S[11]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",sh,[e.createVNode(ei,{ref_key:"mindMapRef",ref:U,data:c.value,"preview-mode":R.value,"built-in-drawers":!1,onChange:re,onSelect:pe,onEditNote:de,onCanvasSettings:S[2]||(S[2]=F=>$.value=!0),onCanvasData:_,onCanvasImport:y,onCanvasTogglePreview:S[3]||(S[3]=F=>R.value=!R.value),onCanvasOutline:S[4]||(S[4]=F=>d.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Vt,{side:"right",width:360,open:p.value&&!R.value,title:"数据","onUpdate:open":S[6]||(S[6]=F=>p.value=F)},{default:e.withCtx(()=>[e.createVNode(Do,{data:c.value,onImport:S[5]||(S[5]=F=>c.value=F)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",width:420,open:h.value&&!R.value,title:"Markdown","onUpdate:open":S[8]||(S[8]=F=>h.value=F)},{default:e.withCtx(()=>[e.createVNode(Vo,{data:c.value,onImport:S[7]||(S[7]=F=>c.value=F)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",width:360,open:w.value&&!R.value,title:"节点内容","onUpdate:open":S[9]||(S[9]=F=>w.value=F)},{default:e.withCtx(()=>[e.createVNode(Qo,{"selected-node":s.value,readonly:!1,"focus-tick":C.value,onApply:ee,onRemove:ce,onSetLink:ue,onSetImage:g,onSetRich:V},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),e.createVNode(Vt,{side:"right",width:340,open:$.value&&!R.value,title:"设置","onUpdate:open":S[10]||(S[10]=F=>$.value=F)},{default:e.withCtx(()=>{var F;return[e.createVNode($o,{settings:k,"has-selection":s.value!==null,"selected-node-text":(F=s.value)==null?void 0:F.text,"node-style":m.value,"onUpdate:settings":P,"onUpdate:nodeStyle":j,onReset:Y},null,8,["settings","has-selection","selected-node-text","node-style"])]}),_:1},8,["open"])]))}}),ch="0.5.10",dh={install(t){t.component("FlowMindMap",ei),t.component("FlowMindMapOutline",Oo),t.component("FlowMindMapDrawer",Vt),t.component("FlowMindMapDataPanel",Do),t.component("FlowMindMapMarkdownPanel",Vo),t.component("FlowMindMapSettingsPanel",$o),t.component("FlowMindMapNotePanel",Qo),t.component("FlowMindMapApp",Yl)}};Ce.DataPanel=Do,Ce.Drawer=Vt,Ce.MARKER_LIB=ki,Ce.MarkdownPanel=Vo,Ce.MindMap=ei,Ce.MindMapApp=Yl,Ce.NotePanel=Qo,Ce.Outline=Oo,Ce.SettingsPanel=$o,Ce.VERSION=ch,Ce.addChild=bi,Ce.addSibling=Er,Ce.clone=Ot,Ce.default=dh,Ce.findNode=be,Ce.findParent=Dt,Ce.markdownToMindMap=On,Ce.markdownToRichMindMap=ts,Ce.markerDef=fs,Ce.markerLabel=Tr,Ce.markerSvg=Lo,Ce.mindMapToMarkdown=Dn,Ce.removeNode=Bo,Ce.richBlockToMarkdown=ns,Ce.tagColor=yi,Ce.uid=Xt,Object.defineProperties(Ce,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|