flow-mindmap 0.4.2 → 0.4.4
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/components/Drawer.vue.d.ts +27 -3
- package/dist/components/MindMap.vue.d.ts +1 -0
- package/dist/flow-mindmap.js +3964 -3828
- package/dist/flow-mindmap.umd.cjs +61 -61
- package/dist/style.css +1 -1
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
(function(Ee,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(Ee=typeof globalThis<"u"?globalThis:Ee||self,e(Ee.FlowMind={},Ee.Vue))})(this,function(Ee,e){"use strict";var Km=Object.defineProperty;var qm=(Ee,e,Ft)=>e in Ee?Km(Ee,e,{enumerable:!0,configurable:!0,writable:!0,value:Ft}):Ee[e]=Ft;var Ae=(Ee,e,Ft)=>qm(Ee,typeof e!="symbol"?e+"":e,Ft);var Xn;const Ft=["width","height","stroke-width"],qr={key:4,points:"6 9 12 15 18 9"},Yr={key:5,points:"9 6 15 12 9 18"},xe=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{width:t.size??16,height:t.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[t.name==="add"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=e.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="minus"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[3]||(n[3]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="delete"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n[5]||(n[5]=e.createStaticVNode('<polyline points="4 7 20 7"></polyline><path d="M9 7 V5 a1 1 0 0 1 1 -1 h4 a1 1 0 0 1 1 1 V7"></path><path d="M6 7 l1 12 a1 1 0 0 0 1 1 h8 a1 1 0 0 0 1 -1 l1 -12"></path><line x1="10" y1="11" x2="10" y2="18"></line><line x1="14" y1="11" x2="14" y2="18"></line>',5))],64)):t.name==="edit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[n[6]||(n[6]=e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):t.name==="collapse"?(e.openBlock(),e.createElementBlock("polyline",qr)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",Yr)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[24]||(n[24]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[26]||(n[26]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[27]||(n[27]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[28]||(n[28]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[30]||(n[30]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[31]||(n[31]=e.createElementVNode("path",{d:"M3 17 V7 L7 13 L11 7 V17"},null,-1)),n[32]||(n[32]=e.createElementVNode("path",{d:"M14 7 V17"},null,-1)),n[33]||(n[33]=e.createElementVNode("path",{d:"M14 7 L18 12 L22 7"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"14",y1:"17",x2:"22",y2:"17"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[35]||(n[35]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[36]||(n[36]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[37]||(n[37]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[38]||(n[38]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[39]||(n[39]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[40]||(n[40]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[41]||(n[41]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[42]||(n[42]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[43]||(n[43]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[44]||(n[44]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[45]||(n[45]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[46]||(n[46]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[47]||(n[47]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[48]||(n[48]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[50]||(n[50]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[51]||(n[51]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[52]||(n[52]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[54]||(n[54]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[55]||(n[55]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[56]||(n[56]=e.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[57]||(n[57]=e.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[58]||(n[58]=e.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[60]||(n[60]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[61]||(n[61]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[62]||(n[62]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[65]||(n[65]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[66]||(n[66]=e.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[67]||(n[67]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[69]||(n[69]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[70]||(n[70]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):e.createCommentVNode("",!0)],8,Ft))}}),ii="data:image/svg+xml,%3csvg%20t='1780822312364'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7459'%20width='200'%20height='200'%3e%3cpath%20d='M329.16%20292.571h658.286V512H329.16zM329.16%200h658.286v219.429H329.16z'%20fill='%239AA1A2'%20p-id='7460'%3e%3c/path%3e%3cpath%20d='M44.927%20146.286a46.519%2046.519%200%200%201%2038.107-73.143h319.269v73.143H109.73V791.99l-48.713%205.705-24.43-651.41h8.339z'%20fill='%239AA1A2'%20p-id='7461'%3e%3c/path%3e%3cpath%20d='M363.83%20877.714H179.51c-78.775%200-142.921-66.12-142.921-147.31V112.787c0-21.943%2017.188-39.643%2038.473-39.643%2021.211%200%2033.5%2017.774%2033.5%2039.643v617.619c0%2037.522%2028.013%2076.58%2064.438%2076.58h190.903c21.211%200%2038.766%2013.97%2038.766%2035.84%200%2021.943-17.555%2034.89-38.766%2034.89z'%20fill='%239AA1A2'%20p-id='7462'%3e%3c/path%3e%3cpath%20d='M432.95%20438.857H179.51c-78.775%200-81.043-18.578-81.043-62.903l10.094-90.624c0%2020.48%2013.458%2080.677%2049.884%2080.677h210.139c21.211%200%20120.613%204.023%20120.613%2016.018%200%2011.922-35.036%2056.832-56.32%2056.832zM640.017%20749.714V640a54.857%2054.857%200%200%201%20109.714%200v109.714h109.715a54.857%2054.857%200%200%201%200%20109.715H749.73v109.714a54.857%2054.857%200%200%201-109.714%200V859.429H530.303a54.857%2054.857%200%200%201%200-109.715h109.714z'%20fill='%239AA1A2'%20p-id='7463'%3e%3c/path%3e%3c/svg%3e",ri="data:image/svg+xml,%3csvg%20t='1780822464335'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8457'%20width='200'%20height='200'%3e%3cpath%20d='M512%20804.571h512V1024H512V804.571zM0%200h658.286v219.429H0V0z'%20fill='%239AA1A2'%20p-id='8458'%3e%3c/path%3e%3cpath%20d='M619.813%20950.857h-184.32c-78.775%200-142.922-66.121-142.922-147.31V185.93c0-21.943%2017.189-39.643%2038.474-39.643%2021.211%200%2033.353%2017.773%2033.353%2039.643v617.618c0%2037.523%2034.743%2073.728%2071.095%2073.728h184.32c21.211%200%2038.473%2012.069%2038.473%2033.939%200%2021.943-17.189%2039.643-38.473%2039.643z'%20fill='%239AA1A2'%20p-id='8459'%3e%3c/path%3e%3cpath%20d='M676.571%20457.143V347.429a54.857%2054.857%200%200%201%20109.715%200v109.714H896a54.857%2054.857%200%200%201%200%20109.714H786.286v109.714a54.857%2054.857%200%200%201-109.715%200V566.857H566.857a54.857%2054.857%200%200%201%200-109.714h109.714z'%20fill='%239AA1A2'%20p-id='8460'%3e%3c/path%3e%3c/svg%3e",li=[18,15,13,12],Zr=[700,600,500,400],Xr=[52,40,32,28],Jr=[120,80,60,44],Qr=[.8,.8,.8,.8],el=li.length-1;function tl(t,o){return Math.round(fo(t,o)*Qr[In(t)])}function In(t){return Math.min(el,Math.max(0,t))}function fo(t,o=14){return Math.round(li[In(t)]*o/14*10)/10}function nl(t,o=14){return Math.round(Xr[In(t)]*o/14)}const vn=60,Ut=14,rt=24;let po=null;function ol(){if(po)return po;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(po=t,t):{font:"",measureText:()=>({width:0})}}const ai=new Map;function il(t,o,n){const i=`${n}|${o}|${t}`,r=ai.get(i);if(r!==void 0)return r;const a=ol();a.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=a.measureText(t).width;return ai.set(i,c),c}const rl=24,ll=400,al=8,si=16,sl=4,cl=200;function dl(t,o,n){return Math.min(n,Math.max(o,t))}function ul(t,o,n,i,r){const a=In(o),c=fo(o,n),u=Math.min(il(t.text||"",c,Zr[a]),cl),s=tl(o,n),m=Math.ceil(u+s*2),g=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:nl(o,n);let y=0;if(t.link&&(y+=si),t.note&&(y+=si),y>0){const h=(t.link?1:0)+(t.note?1:0);y+=sl*h}const w=m+y,k=(()=>{const h=Math.round(Jr[a]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const O=r==null?void 0:r[t.id];return Math.max(h,O??240)}return h})(),b=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),_=i==null?void 0:i[t.id],x=b?Math.max(24,_??Math.max(70,Math.ceil(c*5))):0,M=x>0?10:0;if(!t.image){const h=Math.max(k,w),O=Math.ceil(g+M+x);return{w:h,h:O}}const S=dl(t.image.width,rl,ll),A=Math.max(k,w,Math.ceil(S+s*2)),C=Math.ceil(t.image.height+al+g+M+x);return{w:A,h:C}}function ml(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,r=o.baseFontSize??14,a=di(t,0,null,1,"right",r,o.richHeights,o.richWidths);return pl(a),fl(a,n,i),a.x=0,a.y=0,gl(a,i)}function fl(t,o,n=!1){if(o==="mindmap"){const i=t.children;if(i.length!==0)if(i.length===1)i[0]._dir="right",i[0].side=1,i[0]._dirRight=1;else{const u=i.reduce((g,y)=>g+y._subtreeH,0);let s=1,m=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),p=0;for(let g=0;g<i.length-1;g++){p+=i[g]._subtreeH;const y=Math.abs(p-(u-p));y<m&&(m=y,s=g+1)}for(let g=0;g<s;g++)i[g]._dir="right",i[g].side=1,i[g]._dirRight=1;for(let g=s;g<i.length;g++)i[g]._dir="left",i[g].side=-1,i[g]._dirRight=-1}const r=t.children.filter(u=>u.side===1),a=t.children.filter(u=>u.side===-1),c=(u,s)=>{const m=s==="right"?1:-1;u._dir=s,u.side=m,u._dirRight=m;for(const p of u.children)c(p,s)};for(const u of r)c(u,"right");for(const u of a)c(u,"left");if(r.length>0){const u={...t,children:r};Ln(u,"right",vn,!0,n)}if(a.length>0){const u={...t,children:a};Ln(u,"left",vn,!0,n)}}else if(o==="tree"){const i=r=>{r.side=1,r._dir="right";for(const a of r.children)i(a)};for(const r of t.children)r._dir="right";Ln(t,"right",vn,!0,n),i(t)}else{for(const i of t.children)i._dir="down";ci(t,vn,n)}}function Ln(t,o,n,i,r=!1){if(t.children.length===0)return;const a=t.children.reduce((m,p,g)=>m+p._subtreeH+(g>0?Ut:0),0),c=o==="right"?1:-1,u=i?c:1;let s=t.y-u*a/2;t.children.forEach(m=>{r||(m.x=t.x+c*(t.width/2+n+m.width/2),m.y=s+u*m._subtreeH/2),m._dir=o,s+=u*(m._subtreeH+Ut),Ln(m,o,n,!1,r)})}function ci(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((a,c,u)=>a+c._subtreeW+(u>0?Ut*2:0),0);let r=t.x-i/2;t.children.forEach(a=>{n||(a.x=r+a._subtreeW/2,a.y=t.y+t.height/2+o+a.height/2),a._dir="down",r+=a._subtreeW+Ut*2,ci(a,o,n)})}function di(t,o,n,i,r,a,c,u){const s=ul(t,o,a,c,u),m={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:s.w,height:s.h,fontSize:fo(o,a),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:r,_dirRight:i,_subtreeH:s.h,_subtreeW:s.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,children:[],parent:n};if(t.collapsed)return m;const p=t.children.length,g=Math.ceil(p/2);return m.children=t.children.map((y,w)=>{const k=o===0?w<g?1:-1:i;return di(y,o+1,m,k,r,a,c,u)}),m}function pl(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const r of i.children)o.push(r)}for(let n=o.length-1;n>=0;n--){const i=o[n];if(i.collapsed||i.children.length===0){i._subtreeH=i.height,i._subtreeW=i.width;continue}let r=0,a=0;for(const c of i.children)r+=c._subtreeH,a+=c._subtreeW;i.children.length>1&&(r+=Ut*(i.children.length-1),a+=Ut*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,r),i._subtreeW=Math.max(i.width,a)}}function gl(t,o=!1){const n=[t];let i=1/0,r=-1/0,a=1/0,c=-1/0;for(;n.length;){const m=n.pop(),p=m.width/2,g=m.height/2;m.x-p<i&&(i=m.x-p),m.x+p>r&&(r=m.x+p),m.y-g<a&&(a=m.y-g),m.y+g>c&&(c=m.y+g),n.push(...m.children)}if(o)return{root:t,width:r-i+rt*2,height:c-a+rt*2,vbX:i-rt,vbY:a-rt,vbW:r-i+rt*2,vbH:c-a+rt*2};const u=rt-a,s=[t];for(;s.length;){const m=s.pop();m.y+=u,s.push(...m.children)}return a+=u,c+=u,{root:t,width:r-i+rt*2,height:c+rt,vbX:i-rt,vbY:0,vbW:r-i+rt*2,vbH:c+rt}}const Nt=[{id:"default",name:"默认",colors:["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc"]},{id:"classic",name:"经典",colors:["#ef4444","#f59e0b","#10b981","#3b82f6","#6366f1","#8b5cf6","#ec4899","#14b8a6"]},{id:"vivid",name:"活力",colors:["#dc2626","#ea580c","#ca8a04","#16a34a","#0891b2","#2563eb","#7c3aed","#db2777"]},{id:"dev",name:"代码",colors:["#f472b6","#a78bfa","#60a5fa","#38bdf8","#22d3ee","#34d399","#facc15","#fb923c"]},{id:"mint",name:"薄荷",colors:["#5eead4","#67e8f9","#93c5fd","#c4b5fd","#fbcfe8","#fde68a","#a7f3d0","#bae6fd"]}];function hl(t,o=[]){return[...Nt,...o].find(i=>i.id===t)??Nt[0]}function bl(t,o=8){const n=[],i=new Set,r=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let a;for(;(a=r.exec(t))!==null;){const c=a[0];let u=null;if(c.startsWith("#")?u=kl(c):c.startsWith("rgb")?u=yl(c):u=El[c.toLowerCase()]??null,!u)continue;const s=u.toLowerCase();if(!i.has(s)&&(i.add(s),n.push(s),n.length>=o))break}return n}function kl(t){const o=t.startsWith("#")?t.slice(1):t;if(!/^[0-9a-fA-F]+$/.test(o))return null;let n;if(o.length===3)n=o.split("").map(i=>i+i).join("");else if(o.length===4)n=o.slice(0,3).split("").map(i=>i+i).join("");else if(o.length===6)n=o;else if(o.length===8)n=o.slice(0,6);else return null;return"#"+n.toLowerCase()}function yl(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const i=[];for(let r=0;r<3;r++){const a=n[r];if(a.endsWith("%")){const c=parseFloat(a);if(!isFinite(c))return null;i.push(Math.round(c/100*255))}else{const c=parseInt(a,10);if(!isFinite(c)||c<0||c>255)return null;i.push(c)}}return"#"+i.map(r=>r.toString(16).padStart(2,"0")).join("").toLowerCase()}const El={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",gray:"#808080",grey:"#808080",silver:"#c0c0c0",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",pink:"#ffc0cb",brown:"#a52a2a",gold:"#ffd700",coral:"#ff7f50",tomato:"#ff6347",salmon:"#fa8072",khaki:"#f0e68c",violet:"#ee82ee",indigo:"#4b0082",turquoise:"#40e0d0",chocolate:"#d2691e",crimson:"#dc143c",darkred:"#8b0000",darkblue:"#00008b",darkgreen:"#006400",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightblue:"#add8e6",lightgreen:"#90ee90",lightyellow:"#ffffe0",lightpink:"#ffb6c1",skyblue:"#87ceeb",forestgreen:"#228b22",royalblue:"#4169e1",steelblue:"#4682b4",hotpink:"#ff69b4",deeppink:"#ff1493",orangered:"#ff4500",goldenrod:"#daa520",mediumpurple:"#9370db"};function ft(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function pt(t){return JSON.parse(JSON.stringify(t))}function pe(t,o){if(t.id===o)return t;for(const n of t.children){const i=pe(n,o);if(i)return i}return null}function ct(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const r=ct(i,o,t);if(r!==null)return r}return null}function go(t,o){const n=t.children.findIndex(i=>i.id===o);if(n>=0)return t.children.splice(n,1),!0;for(const i of t.children)if(go(i,o))return!0;return!1}function xl(t,o,n){const i=pe(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function wl(t,o,n,i){if(!ct(t,o)||o===n||pe(pe(t,o),n))return!1;const r=ct(t,o),a=r.children.findIndex(m=>m.id===o);if(a<0)return!1;const[c]=r.children.splice(a,1);if(i==="child"){const m=pe(t,n);return m?(m.children.push(c),!0):(r.children.splice(a,0,c),!1)}const u=ct(t,n);if(!u)return r.children.splice(a,0,c),!1;let s=u.children.findIndex(m=>m.id===n);return s<0?(r.children.splice(a,0,c),!1):(i==="after"&&(s+=1),u.children.splice(s,0,c),!0)}function ui(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const r of t.children){const a=r.text.match(o);if(a)if(a[1]){const c=parseInt(a[1],10);c>n&&(n=c)}else i=!0}return n===0&&!i?Dn:n>0?`新节点 ${n+1}`:"新节点 2"}function mi(t,o,n){const i=pe(t,o);if(!i)return null;const r={id:ft(),text:n??ui(i),children:[]};return i.children.push(r),r}function fi(t,o,n){const i=ct(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const a={id:ft(),text:n??ui(i),children:[]};return i.children.splice(r+1,0,a),a}function Nl(t,o,n){const i=ct(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const a={id:ft(),text:n,children:[]};return i.children.splice(r,0,a),a}function Sl(t,o){const n=ct(t,o);if(!n)return null;const i=n.children.findIndex(c=>c.id===o);if(i<0)return null;const r=n.children[i],a=pt(r);return pi(a),n.children.splice(i+1,0,a),a}function pi(t){t.id=ft();for(const o of t.children)pi(o)}const Dn="新节点";function Ht(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:ft(),text:o,children:[]},r=[i],a=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,s=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,m=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let g=!1,y=[],w=null;function k(x){y.push(x)}function b(){if(w&&y.length>0){for(;y.length>0&&y[0].trim()==="";)y.shift();for(;y.length>0&&y[y.length-1].trim()==="";)y.pop();const x=y.join(`
|
|
2
|
-
`);x&&(w.note={text:x})}
|
|
3
|
-
`+h:h}}
|
|
1
|
+
(function(xe,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(xe=typeof globalThis<"u"?globalThis:xe||self,e(xe.FlowMind={},xe.Vue))})(this,function(xe,e){"use strict";var af=Object.defineProperty;var sf=(xe,e,Xt)=>e in xe?af(xe,e,{enumerable:!0,configurable:!0,writable:!0,value:Xt}):xe[e]=Xt;var Be=(xe,e,Xt)=>sf(xe,typeof e!="symbol"?e+"":e,Xt);var to;const Xt=["width","height","stroke-width"],Qr={key:4,points:"6 9 12 15 18 9"},el={key:5,points:"9 6 15 12 9 18"},we=e.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("svg",{width:t.size??16,height:t.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[t.name==="add"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[0]||(n[0]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=e.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="minus"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[3]||(n[3]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):t.name==="delete"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n[5]||(n[5]=e.createStaticVNode('<polyline points="4 7 20 7"></polyline><path d="M9 7 V5 a1 1 0 0 1 1 -1 h4 a1 1 0 0 1 1 1 V7"></path><path d="M6 7 l1 12 a1 1 0 0 0 1 1 h8 a1 1 0 0 0 1 -1 l1 -12"></path><line x1="10" y1="11" x2="10" y2="18"></line><line x1="14" y1="11" x2="14" y2="18"></line>',5))],64)):t.name==="edit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[n[6]||(n[6]=e.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=e.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):t.name==="collapse"?(e.openBlock(),e.createElementBlock("polyline",Qr)):t.name==="expand"?(e.openBlock(),e.createElementBlock("polyline",el)):t.name==="collapse-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[n[8]||(n[8]=e.createStaticVNode('<line x1="4" y1="4" x2="10" y2="10"></line><polyline points="6 10 10 10 10 6"></polyline><line x1="20" y1="4" x2="14" y2="10"></line><polyline points="14 6 14 10 18 10"></polyline><line x1="20" y1="20" x2="14" y2="14"></line><polyline points="14 18 14 14 18 14"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="6 14 10 14 10 18"></polyline>',8))],64)):t.name==="expand-all"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:7},[n[9]||(n[9]=e.createStaticVNode('<line x1="10" y1="10" x2="4" y2="4"></line><polyline points="4 6 4 4 6 4"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="20 6 20 4 18 4"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="20 18 20 20 18 20"></polyline><line x1="10" y1="14" x2="4" y2="20"></line><polyline points="4 18 4 20 6 20"></polyline>',8))],64)):t.name==="expand-level-1"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[n[10]||(n[10]=e.createStaticVNode('<circle cx="12" cy="5" r="1.8" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="11" x2="5" y2="17"></line><line x1="12" y1="11" x2="12" y2="17"></line><line x1="12" y1="11" x2="19" y2="17"></line><circle cx="5" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="1.8" fill="currentColor" stroke="none"></circle>',8))],64)):t.name==="expand-level-2"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[n[11]||(n[11]=e.createStaticVNode('<circle cx="12" cy="3" r="1.4" fill="currentColor" stroke="none"></circle><line x1="12" y1="4.5" x2="12" y2="7"></line><line x1="12" y1="7" x2="5" y2="11"></line><line x1="12" y1="7" x2="12" y2="11"></line><line x1="12" y1="7" x2="19" y2="11"></line><line x1="5" y1="11" x2="3" y2="16"></line><line x1="5" y1="11" x2="7" y2="16"></line><line x1="12" y1="11" x2="10" y2="16"></line><line x1="12" y1="11" x2="14" y2="16"></line><line x1="19" y1="11" x2="17" y2="16"></line><line x1="19" y1="11" x2="21" y2="16"></line><circle cx="5" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="12" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="19" cy="11" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="3" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="7" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="10" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="14" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="17" cy="18" r="1.4" fill="currentColor" stroke="none"></circle><circle cx="21" cy="18" r="1.4" fill="currentColor" stroke="none"></circle>',20))],64)):t.name==="zoom-in"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[n[12]||(n[12]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=e.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="zoom-out"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[n[16]||(n[16]=e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=e.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=e.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):t.name==="reset"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[n[19]||(n[19]=e.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=e.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=e.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=e.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:13},[n[23]||(n[23]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:14},[n[24]||(n[24]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[25]||(n[25]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[26]||(n[26]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="settings"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:15},[n[27]||(n[27]=e.createStaticVNode('<circle cx="12" cy="12" r="3"></circle><line x1="12" y1="2.5" x2="12" y2="4.5"></line><line x1="12" y1="19.5" x2="12" y2="21.5"></line><line x1="2.5" y1="12" x2="4.5" y2="12"></line><line x1="19.5" y1="12" x2="21.5" y2="12"></line><line x1="5.6" y1="5.6" x2="7" y2="7"></line><line x1="17" y1="17" x2="18.4" y2="18.4"></line><line x1="5.6" y1="18.4" x2="7" y2="17"></line><line x1="17" y1="7" x2="18.4" y2="5.6"></line>',9))],64)):t.name==="data"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:16},[n[28]||(n[28]=e.createElementVNode("path",{d:"M9 5 C7 5 7 7 7 9 C7 11 7 12 5 12 C7 12 7 13 7 15 C7 17 7 19 9 19"},null,-1)),n[29]||(n[29]=e.createElementVNode("path",{d:"M15 5 C17 5 17 7 17 9 C17 11 17 12 19 12 C17 12 17 13 17 15 C17 17 17 19 15 19"},null,-1)),n[30]||(n[30]=e.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):t.name==="markdown"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:17},[n[31]||(n[31]=e.createElementVNode("path",{d:"M3 17 V7 L7 13 L11 7 V17"},null,-1)),n[32]||(n[32]=e.createElementVNode("path",{d:"M14 7 V17"},null,-1)),n[33]||(n[33]=e.createElementVNode("path",{d:"M14 7 L18 12 L22 7"},null,-1)),n[34]||(n[34]=e.createElementVNode("line",{x1:"14",y1:"17",x2:"22",y2:"17"},null,-1))],64)):t.name==="txt"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:18},[n[35]||(n[35]=e.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[36]||(n[36]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[37]||(n[37]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[38]||(n[38]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="eye"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:19},[n[39]||(n[39]=e.createElementVNode("path",{d:"M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z"},null,-1)),n[40]||(n[40]=e.createElementVNode("circle",{cx:"12",cy:"12",r:"3.2"},null,-1))],64)):t.name==="eye-off"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:20},[n[41]||(n[41]=e.createElementVNode("path",{d:"M3 3 L21 21"},null,-1)),n[42]||(n[42]=e.createElementVNode("path",{d:"M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2"},null,-1)),n[43]||(n[43]=e.createElementVNode("path",{d:"M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3"},null,-1)),n[44]||(n[44]=e.createElementVNode("path",{d:"M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1"},null,-1))],64)):t.name==="outline"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:21},[n[45]||(n[45]=e.createElementVNode("rect",{x:"4",y:"3",width:"16",height:"18",rx:"2"},null,-1)),n[46]||(n[46]=e.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[47]||(n[47]=e.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[48]||(n[48]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.name==="logo"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:22},[n[49]||(n[49]=e.createStaticVNode('<circle cx="12" cy="12" r="2.2"></circle><circle cx="4" cy="5" r="1.6"></circle><circle cx="20" cy="5" r="1.6"></circle><circle cx="4" cy="19" r="1.6"></circle><circle cx="20" cy="19" r="1.6"></circle><line x1="10.5" y1="10.8" x2="5.2" y2="6.4"></line><line x1="13.5" y1="10.8" x2="18.8" y2="6.4"></line><line x1="10.5" y1="13.2" x2="5.2" y2="17.6"></line><line x1="13.5" y1="13.2" x2="18.8" y2="17.6"></line>',9))],64)):t.name==="import"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:23},[n[50]||(n[50]=e.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[51]||(n[51]=e.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[52]||(n[52]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="export"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:24},[n[53]||(n[53]=e.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[54]||(n[54]=e.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[55]||(n[55]=e.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):t.name==="balance"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:25},[n[56]||(n[56]=e.createStaticVNode('<line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line><polyline points="9 4 5 6 9 8"></polyline><polyline points="15 4 19 6 15 8"></polyline><polyline points="9 10 5 12 9 14"></polyline><polyline points="15 10 19 12 15 14"></polyline><polyline points="9 16 5 18 9 20"></polyline><polyline points="15 16 19 18 15 20"></polyline>',9))],64)):t.name==="mindmap"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:26},[n[57]||(n[57]=e.createStaticVNode('<circle cx="12" cy="12" r="2.4" fill="currentColor" stroke="none"></circle><line x1="13.4" y1="10.6" x2="18.5" y2="5.5"></line><line x1="13.4" y1="13.4" x2="18.5" y2="18.5"></line><line x1="10.6" y1="10.6" x2="5.5" y2="5.5"></line><line x1="10.6" y1="13.4" x2="5.5" y2="18.5"></line><circle cx="19.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="19.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="4.5" r="1.8" fill="currentColor" stroke="none"></circle><circle cx="4.5" cy="19.5" r="1.8" fill="currentColor" stroke="none"></circle>',9))],64)):t.name==="tree"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:27},[n[58]||(n[58]=e.createStaticVNode('<circle cx="5" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="12" r="2" fill="currentColor" stroke="none"></circle><circle cx="19" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="7" y1="12" x2="12" y2="12"></line><line x1="12" y1="12" x2="12" y2="5"></line><line x1="12" y1="12" x2="12" y2="19"></line><line x1="12" y1="5" x2="17" y2="5"></line><line x1="12" y1="19" x2="17" y2="19"></line>',9))],64)):t.name==="org"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:28},[n[59]||(n[59]=e.createStaticVNode('<circle cx="12" cy="5" r="2" fill="currentColor" stroke="none"></circle><circle cx="6" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="12" cy="19" r="2" fill="currentColor" stroke="none"></circle><circle cx="18" cy="19" r="2" fill="currentColor" stroke="none"></circle><line x1="12" y1="7" x2="12" y2="13"></line><line x1="6" y1="13" x2="18" y2="13"></line><line x1="6" y1="13" x2="6" y2="17"></line><line x1="12" y1="13" x2="12" y2="17"></line><line x1="18" y1="13" x2="18" y2="17"></line>',9))],64)):t.name==="image"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:29},[n[60]||(n[60]=e.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[61]||(n[61]=e.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[62]||(n[62]=e.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):t.name==="x"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:30},[n[63]||(n[63]=e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[64]||(n[64]=e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):t.name==="link"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:31},[n[65]||(n[65]=e.createElementVNode("path",{d:"M10 13 a4 4 0 0 0 5.66 0 l3 -3 a4 4 0 1 0 -5.66 -5.66 l-1 1"},null,-1)),n[66]||(n[66]=e.createElementVNode("path",{d:"M14 11 a4 4 0 0 0 -5.66 0 l-3 3 a4 4 0 1 0 5.66 5.66 l1 -1"},null,-1))],64)):t.name==="note"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:32},[n[67]||(n[67]=e.createElementVNode("path",{d:"M6 4 h9 l3 3 v13 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z"},null,-1)),n[68]||(n[68]=e.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[69]||(n[69]=e.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[70]||(n[70]=e.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):e.createCommentVNode("",!0)],8,Xt))}}),li="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",ai="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",si=[18,15,13,12],tl=[700,600,500,400],nl=[52,40,32,28],ol=[120,80,60,44],il=[.8,.8,.8,.8],rl=si.length-1;function ll(t,o){return Math.round(ho(t,o)*il[Vn(t)])}function Vn(t){return Math.min(rl,Math.max(0,t))}function ho(t,o=14){return Math.round(si[Vn(t)]*o/14*10)/10}function al(t,o=14){return Math.round(nl[Vn(t)]*o/14)}const $n=60,Zt=14,rt=24;let bo=null;function sl(){if(bo)return bo;const t=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return t?(bo=t,t):{font:"",measureText:()=>({width:0})}}const ci=new Map;function cl(t,o,n){const i=`${n}|${o}|${t}`,r=ci.get(i);if(r!==void 0)return r;const a=sl();a.font=`${n} ${o}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const c=a.measureText(t).width;return ci.set(i,c),c}const dl=24,ul=400,ml=8,di=16,fl=4,pl=200;function gl(t,o,n){return Math.min(n,Math.max(o,t))}function hl(t,o,n,i,r){const a=Vn(o),c=ho(o,n),u=Math.min(cl(t.text||"",c,tl[a]),pl),d=ll(o,n),m=Math.ceil(u+d*2),b=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table"))?Math.ceil(c*1.2)+6:al(o,n);let E=0;if(t.link&&(E+=di),t.note&&(E+=di),E>0){const h=(t.link?1:0)+(t.note?1:0);E+=fl*h}const w=m+E,y=(()=>{const h=Math.round(ol[a]*n/14);if(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")){const O=r==null?void 0:r[t.id];return Math.max(h,O??240)}return h})(),v=!!(t.richContent&&(t.richContent.kind==="code"||t.richContent.kind==="table")),_=i==null?void 0:i[t.id],x=v?Math.max(24,_??Math.max(70,Math.ceil(c*5))):0,g=x>0?10:0;if(!t.image){const h=Math.max(y,w),O=Math.ceil(b+g+x);return{w:h,h:O}}const C=gl(t.image.width,dl,ul),A=Math.max(y,w,Math.ceil(C+d*2)),T=Math.ceil(t.image.height+ml+b+g+x);return{w:A,h:T}}function bl(t,o={}){const n=o.mode??"mindmap",i=o.preservePositions===!0,r=o.baseFontSize??14,a=mi(t,0,null,1,"right",r,o.richHeights,o.richWidths);return yl(a),kl(a,n,i),a.x=0,a.y=0,El(a,i)}function kl(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((b,E)=>b+E._subtreeH,0);let d=1,m=Math.abs(i[0]._subtreeH-(u-i[0]._subtreeH)),p=0;for(let b=0;b<i.length-1;b++){p+=i[b]._subtreeH;const E=Math.abs(p-(u-p));E<m&&(m=E,d=b+1)}for(let b=0;b<d;b++)i[b]._dir="right",i[b].side=1,i[b]._dirRight=1;for(let b=d;b<i.length;b++)i[b]._dir="left",i[b].side=-1,i[b]._dirRight=-1}const r=t.children.filter(u=>u.side===1),a=t.children.filter(u=>u.side===-1),c=(u,d)=>{const m=d==="right"?1:-1;u._dir=d,u.side=m,u._dirRight=m;for(const p of u.children)c(p,d)};for(const u of r)c(u,"right");for(const u of a)c(u,"left");if(r.length>0){const u={...t,children:r};Pn(u,"right",$n,!0,n)}if(a.length>0){const u={...t,children:a};Pn(u,"left",$n,!0,n)}}else if(o==="tree"){const i=r=>{r.side=1,r._dir="right";for(const a of r.children)i(a)};for(const r of t.children)r._dir="right";Pn(t,"right",$n,!0,n),i(t)}else{for(const i of t.children)i._dir="down";ui(t,$n,n)}}function Pn(t,o,n,i,r=!1){if(t.children.length===0)return;const a=t.children.reduce((m,p,b)=>m+p._subtreeH+(b>0?Zt:0),0),c=o==="right"?1:-1,u=i?c:1;let d=t.y-u*a/2;t.children.forEach(m=>{r||(m.x=t.x+c*(t.width/2+n+m.width/2),m.y=d+u*m._subtreeH/2),m._dir=o,d+=u*(m._subtreeH+Zt),Pn(m,o,n,!1,r)})}function ui(t,o,n=!1){if(t.children.length===0)return;const i=t.children.reduce((a,c,u)=>a+c._subtreeW+(u>0?Zt*2:0),0);let r=t.x-i/2;t.children.forEach(a=>{n||(a.x=r+a._subtreeW/2,a.y=t.y+t.height/2+o+a.height/2),a._dir="down",r+=a._subtreeW+Zt*2,ui(a,o,n)})}function mi(t,o,n,i,r,a,c,u){const d=hl(t,o,a,c,u),m={id:t.id,text:t.text,depth:o,x:t._x??0,y:t._y??0,width:d.w,height:d.h,fontSize:ho(o,a),isRoot:o===0,collapsed:t.collapsed,side:i,_dir:r,_dirRight:i,_subtreeH:d.h,_subtreeW:d.w,image:t.image?{...t.image}:void 0,link:t.link?{url:t.link.url}:void 0,note:t.note?{text:t.note.text}:void 0,richContent:t.richContent?{kind:t.richContent.kind,raw:t.richContent.raw,lang:t.richContent.lang}:void 0,children:[],parent:n};if(t.collapsed)return m;const p=t.children.length,b=Math.ceil(p/2);return m.children=t.children.map((E,w)=>{const y=o===0?w<b?1:-1:i;return mi(E,o+1,m,y,r,a,c,u)}),m}function yl(t){const o=[t];for(let n=0;n<o.length;n++){const i=o[n];for(const r of i.children)o.push(r)}for(let n=o.length-1;n>=0;n--){const i=o[n];if(i.collapsed||i.children.length===0){i._subtreeH=i.height,i._subtreeW=i.width;continue}let r=0,a=0;for(const c of i.children)r+=c._subtreeH,a+=c._subtreeW;i.children.length>1&&(r+=Zt*(i.children.length-1),a+=Zt*2*(i.children.length-1)),i._subtreeH=Math.max(i.height,r),i._subtreeW=Math.max(i.width,a)}}function El(t,o=!1){const n=[t];let i=1/0,r=-1/0,a=1/0,c=-1/0;for(;n.length;){const m=n.pop(),p=m.width/2,b=m.height/2;m.x-p<i&&(i=m.x-p),m.x+p>r&&(r=m.x+p),m.y-b<a&&(a=m.y-b),m.y+b>c&&(c=m.y+b),n.push(...m.children)}if(o)return{root:t,width:r-i+rt*2,height:c-a+rt*2,vbX:i-rt,vbY:a-rt,vbW:r-i+rt*2,vbH:c-a+rt*2};const u=rt-a,d=[t];for(;d.length;){const m=d.pop();m.y+=u,d.push(...m.children)}return a+=u,c+=u,{root:t,width:r-i+rt*2,height:c+rt,vbX:i-rt,vbY:0,vbW:r-i+rt*2,vbH:c+rt}}const Tt=[{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 xl(t,o=[]){return[...Tt,...o].find(i=>i.id===t)??Tt[0]}function wl(t,o=8){const n=[],i=new Set,r=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g;let a;for(;(a=r.exec(t))!==null;){const c=a[0];let u=null;if(c.startsWith("#")?u=Nl(c):c.startsWith("rgb")?u=Sl(c):u=Tl[c.toLowerCase()]??null,!u)continue;const d=u.toLowerCase();if(!i.has(d)&&(i.add(d),n.push(d),n.length>=o))break}return n}function Nl(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 Sl(t){const o=t.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!o)return null;const n=o[1].split(/\s*,\s*/);if(n.length<3)return null;const i=[];for(let r=0;r<3;r++){const a=n[r];if(a.endsWith("%")){const c=parseFloat(a);if(!isFinite(c))return null;i.push(Math.round(c/100*255))}else{const c=parseInt(a,10);if(!isFinite(c)||c<0||c>255)return null;i.push(c)}}return"#"+i.map(r=>r.toString(16).padStart(2,"0")).join("").toLowerCase()}const Tl={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 ht(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function bt(t){return JSON.parse(JSON.stringify(t))}function me(t,o){if(t.id===o)return t;for(const n of t.children){const i=me(n,o);if(i)return i}return null}function at(t,o,n=null){if(t.id===o)return n;for(const i of t.children){const r=at(i,o,t);if(r!==null)return r}return null}function ko(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(ko(i,o))return!0;return!1}function Cl(t,o,n){const i=me(t,o);return!i||i.text===n?!1:(i.text=n,!0)}function _l(t,o,n,i){if(!at(t,o)||o===n||me(me(t,o),n))return!1;const r=at(t,o),a=r.children.findIndex(m=>m.id===o);if(a<0)return!1;const[c]=r.children.splice(a,1);if(i==="child"){const m=me(t,n);return m?(m.children.push(c),!0):(r.children.splice(a,0,c),!1)}const u=at(t,n);if(!u)return r.children.splice(a,0,c),!1;let d=u.children.findIndex(m=>m.id===n);return d<0?(r.children.splice(a,0,c),!1):(i==="after"&&(d+=1),u.children.splice(d,0,c),!0)}function fi(t){const o=/^新节点(?:\s+(\d+))?$/;let n=0,i=!1;for(const r of t.children){const a=r.text.match(o);if(a)if(a[1]){const c=parseInt(a[1],10);c>n&&(n=c)}else i=!0}return n===0&&!i?Fn:n>0?`新节点 ${n+1}`:"新节点 2"}function pi(t,o,n){const i=me(t,o);if(!i)return null;const r={id:ht(),text:n??fi(i),children:[]};return i.children.push(r),r}function gi(t,o,n){const i=at(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const a={id:ht(),text:n??fi(i),children:[]};return i.children.splice(r+1,0,a),a}function Al(t,o,n){const i=at(t,o);if(!i)return null;const r=i.children.findIndex(c=>c.id===o);if(r<0)return null;const a={id:ht(),text:n,children:[]};return i.children.splice(r,0,a),a}function Ml(t,o){const n=at(t,o);if(!n)return null;const i=n.children.findIndex(c=>c.id===o);if(i<0)return null;const r=n.children[i],a=bt(r);return hi(a),n.children.splice(i+1,0,a),a}function hi(t){t.id=ht();for(const o of t.children)hi(o)}const Fn="新节点";function Jt(t,o="导入的导图"){const n=t.split(/\r?\n/),i={id:ht(),text:o,children:[]},r=[i],a=[-1/0],c=[],u=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,m=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,p=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let b=!1,E=[],w=null;function y(x){E.push(x)}function v(){if(w&&E.length>0){for(;E.length>0&&E[0].trim()==="";)E.shift();for(;E.length>0&&E[E.length-1].trim()==="";)E.pop();const x=E.join(`
|
|
2
|
+
`);x&&(w.note={text:x})}b=!1,E=[]}for(const x of n){if(b){const h=x.match(p);if(h&&h[1][0]==="`"){v();continue}y(x);continue}const g=x.match(u);if(g){const h=g[1].length,O=g[2].trim();c.push({level:h,text:O,body:""}),w=c[c.length-1];continue}const C=x.match(p);if(C&&C[2]==="note"){b=!0,E=[];continue}const A=x.match(d);if(A&&w){const h=A[2],O=160,G=120;w.image={src:h,naturalW:O,naturalH:G,width:O,height:G};continue}const T=x.match(m);if(T&&w){w.link={url:T[2]},w.text=T[1];continue}if(x.trim().length>0&&w){const h=x.trim();w.body=w.body?w.body+`
|
|
3
|
+
`+h:h}}b&&v();function _(x){for(;r.length>1;){const T=r.length-1,h=a[T];if(h!==void 0&&h<x.level)break;r.pop(),a.pop()}const g=r[r.length-1],C=x.text,A={id:ht(),text:C,children:[]};x.image&&(A.image={...x.image}),x.link&&(A.link={url:x.link.url}),x.note&&(A.note={text:x.note.text}),x.body&&(A.note={text:x.body}),g.children.push(A),r.push(A),a.push(x.level)}for(const x of c)_(x);if(c.length>0&&c[0].level===1){const x=i.children[0];x&&(i.text=x.text,i.id=x.id,x.image&&(i.image={...x.image}),x.link&&(i.link={url:x.link.url}),x.note&&(i.note={text:x.note.text}),i.children=x.children)}return i}function Qt(t,o=1){let n="#".repeat(o)+" "+(t.text||"")+`
|
|
4
4
|
`;t.link&&(n+=`[${t.text||"link"}](${t.link.url})
|
|
5
5
|
`),t.image&&(n+=`
|
|
6
6
|
`),t.note&&(n+="```note\n"+t.note.text+"\n```\n"),t.richContent&&(n+=t.richContent.raw+`
|
|
7
|
-
`);for(const i of t.children)n+=
|
|
7
|
+
`);for(const i of t.children)n+=Qt(i,o+1);return n}function Rl(t){var m,p;const o=t.split(/\r?\n/),n=[];let i=0;const r=/^(#{1,6})\s+(.+?)\s*#*\s*$/,a=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,c=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,u=/^(\s*)[-*+]\s+(.*)$/,d=/^(\s*)\d+\.\s+(.*)$/;for(;i<o.length;){const b=o[i],E=b.match(a);if(E){const C=E[1][0],A=E[2]||"",T=[b];for(i++;i<o.length;){const O=o[i].match(a);if(O&&O[1][0]===C){T.push(o[i]),i++;break}T.push(o[i]),i++}const h=T.slice(1,-1).join(`
|
|
8
8
|
`).trim();n.push({kind:"code",text:((m=h.split(`
|
|
9
|
-
`)[0])==null?void 0:m.slice(0,80))||"(空代码块)",raw:
|
|
10
|
-
`),lang:A});continue}const w=
|
|
11
|
-
`)}),i=A;continue}}const
|
|
12
|
-
`)}),i=x}return n}function
|
|
13
|
-
`:""}function Al(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,r=e.ref(1),a=e.ref(0),c=e.ref(0),u=e.ref(!1),s=e.reactive({x:0,y:0,ox:0,oy:0}),m=e.ref(!1),p=e.reactive({x:0,y:0}),g=e.reactive({x:0,y:0,width:0,height:0}),y=e.ref(0);let w=null;function k(K){w=K}function b(K){K.preventDefault();const te=t.getContainer();if(!te)return;const le=-K.deltaY*.001,G=Math.min(n,Math.max(o,r.value*(1+le))),Y=te.getBoundingClientRect(),F=K.clientX-Y.left,N=K.clientY-Y.top,$=(F-a.value)/r.value,L=(N-c.value)/r.value;r.value=G,a.value=F-$*G,c.value=N-L*G}function _(){r.value=Math.min(n,r.value*i)}function x(){r.value=Math.max(o,r.value/i)}function M(K){var le;K.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,s.x=K.clientX,s.y=K.clientY,s.ox=a.value,s.oy=c.value,window.addEventListener("mousemove",S),window.addEventListener("mouseup",A),(le=K.preventDefault)==null||le.call(K))}function S(K){u.value&&(a.value=s.ox+(K.clientX-s.x),c.value=s.oy+(K.clientY-s.y))}function A(){u.value=!1,window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",A)}function C(K,te){m.value=!0,p.x=K,p.y=te,g.x=K,g.y=te,g.width=0,g.height=0,y.value++,window.addEventListener("mousemove",W),window.addEventListener("mouseup",O)}function h(K,te){if(!m.value)return;const le=Math.min(p.x,K),G=Math.min(p.y,te),Y=Math.max(p.x,K),F=Math.max(p.y,te);g.x=le,g.y=G,g.width=Y-le,g.height=F-G,y.value++}function O(){m.value=!1,window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",O),w&&w()}function W(K){if(!m.value)return;const te=t.getContainer();if(!te)return;const le=te.getBoundingClientRect(),G=(K.clientX-le.left-a.value)/r.value,Y=(K.clientY-le.top-c.value)/r.value;h(G,Y)}function oe(K,te,le,G=60){const Y=t.getContainer();if(!Y)return;const F=Y.getBoundingClientRect(),N=(F.width-G*2)/K,$=(F.height-G*2)/te,L=Math.min(1,Math.max(.3,Math.min(N,$)));r.value=L,a.value=F.width/2,c.value=F.height/2-le*L}return{scale:r,offsetX:a,offsetY:c,isPanning:u,onWheel:b,zoomIn:_,zoomOut:x,startPan:M,startMarquee:C,updateMarquee:h,isMarquee:m,marquee:g,marqueeVersion:y,setOnMarqueeEnd:k,resetView:oe}}const Ml=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function gi(t){return Ml?t.metaKey:t.ctrlKey}function Rl(t){function o(){const i=t.getSelectedId();return i||(t.defaultTargetId?t.defaultTargetId():t.getRootId())}function n(i){const r=i.target;if(r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||t.isReadonly()||t.isEditing())return;const a=t.getSelectedId(),c=o();if(c){if(gi(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){a&&a!==t.getRootId()&&(i.preventDefault(),t.onDuplicate(a));return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(gi(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}i.key==="Tab"?(i.preventDefault(),t.onAddChild(c)):i.key==="Enter"?(i.preventDefault(),i.shiftKey?a&&a!==t.getRootId()&&t.onAddSiblingBefore(a):t.onAddSibling(c)):(i.key==="Delete"||i.key==="Backspace")&&a&&a!==t.getRootId()?(i.preventDefault(),t.onRemove(a)):i.key==="F2"&&a?(i.preventDefault(),t.onStartEdit(a)):i.key==="Escape"?(i.preventDefault(),t.onClearSelection()):i.key==="ArrowDown"?(i.preventDefault(),t.onNavigate(0,1)):i.key==="ArrowUp"?(i.preventDefault(),t.onNavigate(0,-1)):i.key==="ArrowRight"?(i.preventDefault(),t.onNavigate(1,0)):i.key==="ArrowLeft"&&(i.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function Bl(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function r(){return n<o.value.length-1}function a(m){const p=JSON.stringify(m);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(p),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function c(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return r()?(n++,JSON.parse(o.value[n])):null}function s(){o.value=[],n=-1}return{canUndo:i,canRedo:r,record:a,undo:c,redo:u,reset:s}}const zl=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let y=n.x+2,w=n.y+2;if(n.container){const k=n.container.getBoundingClientRect(),b=180,x=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;y+b>k.right&&(y=Math.max(k.left+4,n.x-b-2)),w+x>k.bottom&&(w=Math.max(k.top+4,n.y-x-2)),y<k.left+2&&(y=k.left+2),w<k.top+2&&(w=k.top+2)}return{left:y,top:w}}),a=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote);function s(y){const w=y.target;w&&w.closest(".zm-node-menu")||i("close")}function m(y){y.key==="Escape"&&i("close")}function p(){i("close")}window.addEventListener("mousedown",s,!0),window.addEventListener("keydown",m,!0),window.addEventListener("wheel",p,!0),window.addEventListener("scroll",p,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",s,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener("wheel",p,!0),window.removeEventListener("scroll",p,!0)});function g(y){y(),i("close")}return(y,w)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:w[10]||(w[10]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[0]||(w[0]=e.withModifiers(k=>g(()=>i("pickImage")),["stop"]))},[e.createVNode(xe,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(a.value?"替换图片":"添加图片"),1)]),a.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:w[1]||(w[1]=e.withModifiers(k=>g(()=>i("removeImage")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[11]||(w[11]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[2]||(w[2]=e.withModifiers(k=>g(()=>i("setLink")),["stop"]))},[e.createVNode(xe,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"编辑链接":"添加链接"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:w[3]||(w[3]=e.withModifiers(k=>g(()=>i("removeLink")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[12]||(w[12]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[4]||(w[4]=e.withModifiers(k=>g(()=>i("addCode")),["stop"]))},[w[13]||(w[13]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:w[5]||(w[5]=e.withModifiers(k=>g(()=>i("removeCode")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[14]||(w[14]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[6]||(w[6]=e.withModifiers(k=>g(()=>i("addTable")),["stop"]))},[w[15]||(w[15]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:w[7]||(w[7]=e.withModifiers(k=>g(()=>i("removeTable")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[16]||(w[16]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[8]||(w[8]=e.withModifiers(k=>g(()=>i("editNote")),["stop"]))},[e.createVNode(xe,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:w[9]||(w[9]=e.withModifiers(k=>g(()=>i("removeNote")),["stop"]))},[e.createVNode(xe,{name:"x",size:13}),w[17]||(w[17]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0)],36))}}),Ol=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let _=n.x+2,x=n.y+2;if(n.container){const M=n.container.getBoundingClientRect(),S=160,A=4+3*28;_+S>M.right&&(_=Math.max(M.left+4,n.x-S-2)),x+A>M.bottom&&(x=Math.max(M.top+4,n.y-A-2)),_<M.left+2&&(_=M.left+2),x<M.top+2&&(x=M.top+2)}return{left:_,top:x}}),a=e.ref(!1),c=e.ref(null),u=e.computed(()=>{if(!c.value)return{left:"-9999px",top:"-9999px",display:"none"};const _=c.value.getBoundingClientRect(),x=window.innerWidth,M=window.innerHeight,S=176,A=4+3*28;let C=_.right;C+S>x-4&&(C=Math.max(4,_.left-S));let h=_.top-4;return h+A>M-4&&(h=Math.max(4,M-A-4)),{left:C+"px",top:h+"px",display:"block"}});let s=null,m=null;function p(){m&&(clearTimeout(m),m=null),s=setTimeout(()=>{a.value=!0},60)}function g(){s&&(clearTimeout(s),s=null),m=setTimeout(()=>{a.value=!1},120)}e.onBeforeUnmount(()=>{s&&clearTimeout(s),m&&clearTimeout(m)});function y(_){const x=_.target;x&&x.closest(".zm-canvas-menu")||i("close")}function w(_){_.key==="Escape"&&i("close")}function k(){i("close")}window.addEventListener("mousedown",y,!0),window.addEventListener("keydown",w,!0),window.addEventListener("wheel",k,!0),window.addEventListener("scroll",k,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",y,!0),window.removeEventListener("keydown",w,!0),window.removeEventListener("wheel",k,!0),window.removeEventListener("scroll",k,!0)});function b(_){_(),i("close")}return(_,x)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:x[5]||(x[5]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[0]||(x[0]=e.withModifiers(M=>b(()=>i("openData")),["stop"]))},[e.createVNode(xe,{name:"data",size:13}),x[6]||(x[6]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:c,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":a.value}]),onMouseenter:p,onMouseleave:g},[e.createVNode(xe,{name:"import",size:13}),x[10]||(x[10]=e.createElementVNode("span",null,"导入",-1)),x[11]||(x[11]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(u.value),onMouseenter:p,onMouseleave:g},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(M=>b(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(xe,{name:"markdown",size:13}),x[7]||(x[7]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[2]||(x[2]=e.withModifiers(M=>b(()=>i("openImport","json")),["stop"]))},[e.createVNode(xe,{name:"data",size:13}),x[8]||(x[8]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[3]||(x[3]=e.withModifiers(M=>b(()=>i("openImport","txt")),["stop"]))},[e.createVNode(xe,{name:"note",size:13}),x[9]||(x[9]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[4]||(x[4]=e.withModifiers(M=>b(()=>i("openSettings")),["stop"]))},[e.createVNode(xe,{name:"settings",size:13}),x[12]||(x[12]=e.createElementVNode("span",null,"设置",-1))])],36))}});function Il(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function hi(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(o=>{const n=t[o],i=typeof n;(i==="object"||i==="function")&&!Object.isFrozen(n)&&hi(n)}),t}class bi{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ki(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function At(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const vl="</span>",yi=t=>!!t.scope,Ll=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((i,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${o}${t}`};class Dl{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=ki(o)}openNode(o){if(!yi(o))return;const n=Ll(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){yi(o)&&(this.buffer+=vl)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const Ei=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class ho{constructor(){this.rootNode=Ei(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(o){this.top.children.push(o)}openNode(o){const n=Ei({scope:o});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(o){return this.constructor._walk(o,this.rootNode)}static _walk(o,n){return typeof n=="string"?o.addText(n):n.children&&(o.openNode(n),n.children.forEach(i=>this._walk(o,i)),o.closeNode(n)),o}static _collapse(o){typeof o!="string"&&o.children&&(o.children.every(n=>typeof n=="string")?o.children=[o.children.join("")]:o.children.forEach(n=>{ho._collapse(n)}))}}class Vl extends ho{constructor(o){super(),this.options=o}addText(o){o!==""&&this.add(o)}startScope(o){this.openNode(o)}endScope(){this.closeNode()}__addSublanguage(o,n){const i=o.root;n&&(i.scope=`language:${n}`),this.add(i)}toHTML(){return new Dl(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function hn(t){return t?typeof t=="string"?t:t.source:null}function xi(t){return Ot("(?=",t,")")}function $l(t){return Ot("(?:",t,")*")}function Pl(t){return Ot("(?:",t,")?")}function Ot(...t){return t.map(n=>hn(n)).join("")}function Fl(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function bo(...t){return"("+(Fl(t).capture?"":"?:")+t.map(i=>hn(i)).join("|")+")"}function wi(t){return new RegExp(t.toString()+"|").exec("").length-1}function Ul(t,o){const n=t&&t.exec(o);return n&&n.index===0}const Hl=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ko(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const r=n;let a=hn(i),c="";for(;a.length>0;){const u=Hl.exec(a);if(!u){c+=a;break}c+=a.substring(0,u.index),a=a.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?c+="\\"+String(Number(u[1])+r):(c+=u[0],u[0]==="("&&n++)}return c}).map(i=>`(${i})`).join(o)}const Wl=/\b\B/,Ni="[a-zA-Z]\\w*",yo="[a-zA-Z_]\\w*",Si="\\b\\d+(\\.\\d+)?",Ti="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ci="\\b(0b[01]+)",Gl="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",jl=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Ot(o,/.*\b/,t.binary,/\b.*/)),At({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},bn={begin:"\\\\[\\s\\S]",relevance:0},Kl={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[bn]},ql={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[bn]},Yl={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Vn=function(t,o,n={}){const i=At({scope:"comment",begin:t,end:o,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=bo("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return i.contains.push({begin:Ot(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},Zl=Vn("//","$"),Xl=Vn("/\\*","\\*/"),Jl=Vn("#","$"),Ql={scope:"number",begin:Si,relevance:0},ea={scope:"number",begin:Ti,relevance:0},ta={scope:"number",begin:Ci,relevance:0},na={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[bn,{begin:/\[/,end:/\]/,relevance:0,contains:[bn]}]},oa={scope:"title",begin:Ni,relevance:0},ia={scope:"title",begin:yo,relevance:0},ra={begin:"\\.\\s*"+yo,relevance:0};var $n=Object.freeze({__proto__:null,APOS_STRING_MODE:Kl,BACKSLASH_ESCAPE:bn,BINARY_NUMBER_MODE:ta,BINARY_NUMBER_RE:Ci,COMMENT:Vn,C_BLOCK_COMMENT_MODE:Xl,C_LINE_COMMENT_MODE:Zl,C_NUMBER_MODE:ea,C_NUMBER_RE:Ti,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(o,n)=>{n.data._beginMatch=o[1]},"on:end":(o,n)=>{n.data._beginMatch!==o[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:Jl,IDENT_RE:Ni,MATCH_NOTHING_RE:Wl,METHOD_GUARD:ra,NUMBER_MODE:Ql,NUMBER_RE:Si,PHRASAL_WORDS_MODE:Yl,QUOTE_STRING_MODE:ql,REGEXP_MODE:na,RE_STARTERS_RE:Gl,SHEBANG:jl,TITLE_MODE:oa,UNDERSCORE_IDENT_RE:yo,UNDERSCORE_TITLE_MODE:ia});function la(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function aa(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function sa(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=la,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function ca(t,o){Array.isArray(t.illegal)&&(t.illegal=bo(...t.illegal))}function da(t,o){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function ua(t,o){t.relevance===void 0&&(t.relevance=1)}const ma=(t,o)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach(i=>{delete t[i]}),t.keywords=n.keywords,t.begin=Ot(n.beforeMatch,xi(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},fa=["of","and","for","in","not","or","if","then","parent","list","value"],pa="keyword";function _i(t,o,n=pa){const i=Object.create(null);return typeof t=="string"?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(a){Object.assign(i,_i(t[a],o,a))}),i;function r(a,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const s=u.split("|");i[s[0]]=[a,ga(s[0],s[1])]})}}function ga(t,o){return o?Number(o):ha(t)?0:1}function ha(t){return fa.includes(t.toLowerCase())}const Ai={},It=t=>{console.error(t)},Mi=(t,...o)=>{console.log(`WARN: ${t}`,...o)},Gt=(t,o)=>{Ai[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Ai[`${t}/${o}`]=!0)},Pn=new Error;function Ri(t,o,{key:n}){let i=0;const r=t[n],a={},c={};for(let u=1;u<=o.length;u++)c[u+i]=r[u],a[u+i]=!0,i+=wi(o[u-1]);t[n]=c,t[n]._emit=a,t[n]._multi=!0}function ba(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw It("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Pn;if(typeof t.beginScope!="object"||t.beginScope===null)throw It("beginScope must be object"),Pn;Ri(t,t.begin,{key:"beginScope"}),t.begin=ko(t.begin,{joinWith:""})}}function ka(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw It("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Pn;if(typeof t.endScope!="object"||t.endScope===null)throw It("endScope must be object"),Pn;Ri(t,t.end,{key:"endScope"}),t.end=ko(t.end,{joinWith:""})}}function ya(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Ea(t){ya(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),ba(t),ka(t)}function xa(t){function o(c,u){return new RegExp(hn(c),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,s){s.position=this.position++,this.matchIndexes[this.matchAt]=s,this.regexes.push([s,u]),this.matchAt+=wi(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(s=>s[1]);this.matcherRe=o(ko(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const s=this.matcherRe.exec(u);if(!s)return null;const m=s.findIndex((g,y)=>y>0&&g!==void 0),p=this.matchIndexes[m];return s.splice(0,m),Object.assign(s,p)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const s=new n;return this.rules.slice(u).forEach(([m,p])=>s.addRule(m,p)),s.compile(),this.multiRegexes[u]=s,s}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,s){this.rules.push([u,s]),s.type==="begin"&&this.count++}exec(u){const s=this.getMatcher(this.regexIndex);s.lastIndex=this.lastIndex;let m=s.exec(u);if(this.resumingScanAtSamePosition()&&!(m&&m.index===this.lastIndex)){const p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,m=p.exec(u)}return m&&(this.regexIndex+=m.position+1,this.regexIndex===this.count&&this.considerAll()),m}}function r(c){const u=new i;return c.contains.forEach(s=>u.addRule(s.begin,{rule:s,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function a(c,u){const s=c;if(c.isCompiled)return s;[aa,da,Ea,ma].forEach(p=>p(c,u)),t.compilerExtensions.forEach(p=>p(c,u)),c.__beforeBegin=null,[sa,ca,ua].forEach(p=>p(c,u)),c.isCompiled=!0;let m=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),m=c.keywords.$pattern,delete c.keywords.$pattern),m=m||/\w+/,c.keywords&&(c.keywords=_i(c.keywords,t.case_insensitive)),s.keywordPatternRe=o(m,!0),u&&(c.begin||(c.begin=/\B|\b/),s.beginRe=o(s.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(s.endRe=o(s.end)),s.terminatorEnd=hn(s.end)||"",c.endsWithParent&&u.terminatorEnd&&(s.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(s.illegalRe=o(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(p){return wa(p==="self"?c:p)})),c.contains.forEach(function(p){a(p,s)}),c.starts&&a(c.starts,u),s.matcher=r(s),s}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=At(t.classNameAliases||{}),a(t)}function Bi(t){return t?t.endsWithParent||Bi(t.starts):!1}function wa(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return At(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Bi(t)?At(t,{starts:t.starts?At(t.starts):null}):Object.isFrozen(t)?At(t):t}var Na="11.11.1";class Sa extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const Eo=ki,zi=At,Oi=Symbol("nomatch"),Ta=7,Ii=function(t){const o=Object.create(null),n=Object.create(null),i=[];let r=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Vl};function s(N){return u.noHighlightRe.test(N)}function m(N){let $=N.className+" ";$+=N.parentNode?N.parentNode.className:"";const L=u.languageDetectRe.exec($);if(L){const j=W(L[1]);return j||(Mi(a.replace("{}",L[1])),Mi("Falling back to no-highlight mode for this block.",N)),j?L[1]:"no-highlight"}return $.split(/\s+/).find(j=>s(j)||W(j))}function p(N,$,L){let j="",X="";typeof $=="object"?(j=N,L=$.ignoreIllegals,X=$.language):(Gt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Gt("10.7.0",`Please use highlight(code, options) instead.
|
|
14
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),
|
|
15
|
-
`,1;if(Qe>1e5&&Qe>Z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ye+=se,se.length}const Ge=W(N);if(!Ge)throw It(a.replace("{}",N)),new Error('Unknown language: "'+N+'"');const on=xa(Ge);let St="",ee=j||on;const mt={},Me=new u.__emitter(u);me();let ye="",kt=0,je=0,Qe=0,yt=!1;try{if(Ge.__emitTokens)Ge.__emitTokens($,Me);else{for(ee.matcher.considerAll();;){Qe++,yt?yt=!1:ee.matcher.considerAll(),ee.matcher.lastIndex=je;const U=ee.matcher.exec($);if(!U)break;const Z=$.substring(je,U.index),se=Ze(Z,U);je=U.index+se}Ze($.substring(je))}return Me.finalize(),St=Me.toHTML(),{language:N,value:St,relevance:kt,illegal:!1,_emitter:Me,_top:ee}}catch(U){if(U.message&&U.message.includes("Illegal"))return{language:N,value:Eo($),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:je,context:$.slice(je-100,je+100),mode:U.mode,resultSoFar:St},_emitter:Me};if(r)return{language:N,value:Eo($),illegal:!1,relevance:0,errorRaised:U,_emitter:Me,_top:ee};throw U}}function y(N){const $={value:Eo(N),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return $._emitter.addText(N),$}function w(N,$){$=$||u.languages||Object.keys(o);const L=y(N),j=$.filter(W).filter(K).map(Le=>g(Le,N,!1));j.unshift(L);const X=j.sort((Le,v)=>{if(Le.relevance!==v.relevance)return v.relevance-Le.relevance;if(Le.language&&v.language){if(W(Le.language).supersetOf===v.language)return 1;if(W(v.language).supersetOf===Le.language)return-1}return 0}),[ge,Be]=X,Ue=ge;return Ue.secondBest=Be,Ue}function k(N,$,L){const j=$&&n[$]||L;N.classList.add("hljs"),N.classList.add(`language-${j}`)}function b(N){let $=null;const L=m(N);if(s(L))return;if(Y("before:highlightElement",{el:N,language:L}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.children.length>0&&(u.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(N)),u.throwUnescapedHTML))throw new Sa("One of your code blocks includes unescaped HTML.",N.innerHTML);$=N;const j=$.textContent,X=L?p(j,{language:L,ignoreIllegals:!0}):w(j);N.innerHTML=X.value,N.dataset.highlighted="yes",k(N,L,X.language),N.result={language:X.language,re:X.relevance,relevance:X.relevance},X.secondBest&&(N.secondBest={language:X.secondBest.language,relevance:X.secondBest.relevance}),Y("after:highlightElement",{el:N,result:X,text:j})}function _(N){u=zi(u,N)}const x=()=>{A(),Gt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function M(){A(),Gt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function A(){function N(){A()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",N,!1),S=!0;return}document.querySelectorAll(u.cssSelector).forEach(b)}function C(N,$){let L=null;try{L=$(t)}catch(j){if(It("Language definition for '{}' could not be registered.".replace("{}",N)),r)It(j);else throw j;L=c}L.name||(L.name=N),o[N]=L,L.rawDefinition=$.bind(null,t),L.aliases&&oe(L.aliases,{languageName:N})}function h(N){delete o[N];for(const $ of Object.keys(n))n[$]===N&&delete n[$]}function O(){return Object.keys(o)}function W(N){return N=(N||"").toLowerCase(),o[N]||o[n[N]]}function oe(N,{languageName:$}){typeof N=="string"&&(N=[N]),N.forEach(L=>{n[L.toLowerCase()]=$})}function K(N){const $=W(N);return $&&!$.disableAutodetect}function te(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=$=>{N["before:highlightBlock"](Object.assign({block:$.el},$))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=$=>{N["after:highlightBlock"](Object.assign({block:$.el},$))})}function le(N){te(N),i.push(N)}function G(N){const $=i.indexOf(N);$!==-1&&i.splice($,1)}function Y(N,$){const L=N;i.forEach(function(j){j[L]&&j[L]($)})}function F(N){return Gt("10.7.0","highlightBlock will be removed entirely in v12.0"),Gt("10.7.0","Please use highlightElement now."),b(N)}Object.assign(t,{highlight:p,highlightAuto:w,highlightAll:A,highlightElement:b,highlightBlock:F,configure:_,initHighlighting:x,initHighlightingOnLoad:M,registerLanguage:C,unregisterLanguage:h,listLanguages:O,getLanguage:W,registerAliases:oe,autoDetection:K,inherit:zi,addPlugin:le,removePlugin:G}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=Na,t.regex={concat:Ot,lookahead:xi,either:bo,optional:Pl,anyNumberOfTimes:$l};for(const N in $n)typeof $n[N]=="object"&&hi($n[N]);return Object.assign(t,$n),t},jt=Ii({});jt.newInstance=()=>Ii({});var Ca=jt;jt.HighlightJS=jt,jt.default=jt;const xo=Il(Ca);function wo(t){const o=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},a=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,r]};r.contains.push(u);const s={match:/\\"/},m={className:"string",begin:/'/,end:/'/},p={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],w=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),k={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],_=["true","false"],x={match:/(\/[a-z._-]+)+/},M=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],C=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:_,built_in:[...M,...S,"set","shopt",...A,...C]},contains:[w,t.SHEBANG(),k,g,a,c,x,u,s,m,p,n]}}const _a=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Aa=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Ma=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Ra=[...Aa,...Ma],Ba=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),za=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Oa=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ia=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function va(t){const o=t.regex,n=_a(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",a=/@-?\w[\w]*(-\w+)*/,c="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+za.join("|")+")"},{begin:":(:)?("+Oa.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ia.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:Ba.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ra.join("|")+")\\b"}]}}function vi(t){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}var Kt="[0-9](_*[0-9])*",Fn=`\\.(${Kt})`,Un="[0-9a-fA-F](_*[0-9a-fA-F])*",Li={className:"number",variants:[{begin:`(\\b(${Kt})((${Fn})|\\.)?|(${Fn}))[eE][+-]?(${Kt})[fFdD]?\\b`},{begin:`\\b(${Kt})((${Fn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Fn})[fFdD]?\\b`},{begin:`\\b(${Kt})[fFdD]\\b`},{begin:`\\b0[xX]((${Un})\\.?|(${Un})?\\.(${Un}))[pP][+-]?(${Kt})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Un})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Di(t,o,n){return n===-1?"":t.replace(o,i=>Di(t,o,n-1))}function La(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+Di("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),s={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},m={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={className:"params",begin:/\(/,end:/\)/,keywords:s,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:s,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[p,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:s,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:s,relevance:0,contains:[m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Li,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Li,m]}}const Vi="[A-Za-z$_][0-9A-Za-z$_]*",Da=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Va=["true","false","null","undefined","NaN","Infinity"],$i=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Pi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Fi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$a=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Pa=[].concat(Fi,$i,Pi);function Ui(t){const o=t.regex,n=(L,{after:j})=>{const X="</"+L[0].slice(1);return L.input.indexOf(X,j)!==-1},i=Vi,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,j)=>{const X=L[0].length+L.index,ge=L.input[X];if(ge==="<"||ge===","){j.ignoreMatch();return}ge===">"&&(n(L,{after:X})||j.ignoreMatch());let Be;const Ue=L.input.substring(X);if(Be=Ue.match(/^\s*=/)){j.ignoreMatch();return}if((Be=Ue.match(/^\s+extends\s+/))&&Be.index===0){j.ignoreMatch();return}}},u={$pattern:Vi,keyword:Da,literal:Va,built_in:Pa,"variable.language":$a},s="[0-9](_?[0-9])*",m=`\\.(${s})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${s})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},M={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,{match:/\$\d+/},g];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const A=[].concat(M,y.contains),C=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),h={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:C},O={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},W={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...$i,...Pi]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[h],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(L){return o.concat("(?!",L.join("|"),")")}const G={match:o.concat(/\b/,le([...Fi,"super","import"].map(L=>`${L}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},h]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[h]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,M,{match:/\$\d+/},g,W,{scope:"attr",match:i+o.lookahead(":"),relevance:0},$,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,t.REGEXP_MODE,{className:"function",begin:N,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[h,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[h]},G,te,O,F,{match:/\$[(.]/}]}}function Fa(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,r,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Hi(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},m={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=t.inherit(m,{contains:[]}),y=t.inherit(p,{contains:[]});m.contains.push(y),p.contains.push(g);let w=[n,s];return[m,p,g,y].forEach(x=>{x.contains=x.contains.concat(w)}),w=w.concat(m,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:w},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:w}]}]},n,a,m,p,{className:"quote",begin:"^>\\s+",contains:w,end:"$"},r,i,s,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Wi(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},s={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},p={begin:/\{\{/,relevance:0},g={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,s,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,s,p,m]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,m]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",w=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,k=`\\b|${i.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${w}))[eE][+-]?(${y})[jJ]?(?=${k})`},{begin:`(${w})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${k})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${k})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${k})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${k})`},{begin:`\\b(${y})[jJ](?=${k})`}]},_={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",s,b,g,t.HASH_COMMENT_MODE]}]};return m.contains=[g,b,s],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[s,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,_,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,x,g]}]}}function Gi(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),r=o.concat(n,t.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,o.lookahead(/\s*\(/))},c="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],s=["true","false","Some","None","Ok","Err"],m=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],p=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:p,keyword:u,literal:s,built_in:m},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:m,type:p}},{className:"punctuation",begin:"->"},a]}}function Ua(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],c=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],s=["add","asc","collation","desc","final","first","last","view"],m=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],p=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],w=p,k=[...m,...s].filter(C=>!p.includes(C)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},_={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:o.concat(/\b/,o.either(...w),/\s*\(/),relevance:0,keywords:{built_in:w}};function M(C){return o.concat(/\b/,o.either(...C.map(h=>h.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:M(y),relevance:0};function A(C,{exceptions:h,when:O}={}){const W=O;return h=h||[],C.map(oe=>oe.match(/\|\d+$/)||h.includes(oe)?oe:W(oe)?`${oe}|0`:oe)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(k,{when:C=>C.length<3}),literal:a,type:u,built_in:g},contains:[{scope:"type",match:M(c)},S,x,b,i,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,_]}}const Hn="[A-Za-z$_][0-9A-Za-z$_]*",ji=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Ki=["true","false","null","undefined","NaN","Infinity"],qi=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Yi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Zi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Xi=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ji=[].concat(Zi,qi,Yi);function Ha(t){const o=t.regex,n=(L,{after:j})=>{const X="</"+L[0].slice(1);return L.input.indexOf(X,j)!==-1},i=Hn,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(L,j)=>{const X=L[0].length+L.index,ge=L.input[X];if(ge==="<"||ge===","){j.ignoreMatch();return}ge===">"&&(n(L,{after:X})||j.ignoreMatch());let Be;const Ue=L.input.substring(X);if(Be=Ue.match(/^\s*=/)){j.ignoreMatch();return}if((Be=Ue.match(/^\s+extends\s+/))&&Be.index===0){j.ignoreMatch();return}}},u={$pattern:Hn,keyword:ji,literal:Ki,built_in:Ji,"variable.language":Xi},s="[0-9](_?[0-9])*",m=`\\.(${s})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${s})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,y]},M={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},S=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,{match:/\$\d+/},g];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(S)});const A=[].concat(M,y.contains),C=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),h={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:C},O={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},W={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...qi,...Yi]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[h],illegal:/%/},te={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function le(L){return o.concat("(?!",L.join("|"),")")}const G={match:o.concat(/\b/,le([...Zi,"super","import"].map(L=>`${L}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},Y={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},h]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[h]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:C,CLASS_REFERENCE:W},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,k,b,_,M,{match:/\$\d+/},g,W,{scope:"attr",match:i+o.lookahead(":"),relevance:0},$,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[M,t.REGEXP_MODE,{className:"function",begin:N,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:C}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[h,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},Y,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[h]},G,te,O,F,{match:/\$[(.]/}]}}function Qi(t){const o=t.regex,n=Ha(t),i=Hn,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},s=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:Hn,keyword:ji.concat(s),literal:Ki,built_in:Ji.concat(r),"variable.language":Xi},p={className:"meta",begin:"@"+i},g=(b,_,x)=>{const M=b.contains.findIndex(S=>S.label===_);if(M===-1)throw new Error("can not find mode to replace");b.contains.splice(M,1,x)};Object.assign(n.keywords,m),n.exports.PARAMS_CONTAINS.push(p);const y=n.contains.find(b=>b.scope==="attr"),w=Object.assign({},y,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,w]),n.contains=n.contains.concat([p,a,c,w]),g(n,"shebang",t.SHEBANG()),g(n,"use_strict",u);const k=n.contains.find(b=>b.label==="func.def");return k.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function er(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(a,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),s=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),m={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,s,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,c,s,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[s]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:m}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function tr(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},u=t.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},w={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},k={begin:/\{/,end:/\}/,contains:[w],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[w],illegal:"\\n",relevance:0},_=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},y,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},k,b,a,c],x=[..._];return x.pop(),x.push(u),w.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:_}}const No={bash:wo,sh:wo,shell:wo,css:va,go:vi,golang:vi,java:La,javascript:Ui,js:Ui,json:Fa,markdown:Hi,md:Hi,python:Wi,py:Wi,rust:Gi,rs:Gi,sql:Ua,typescript:Qi,ts:Qi,xml:er,html:er,yaml:tr,yml:tr};for(const[t,o]of Object.entries(No))xo.registerLanguage(t,o);function So(t){const o=t.split(`
|
|
9
|
+
`)[0])==null?void 0:m.slice(0,80))||"(空代码块)",raw:T.join(`
|
|
10
|
+
`),lang:A});continue}const w=b.match(r);if(w){n.push({kind:"heading",level:w[1].length,text:w[2].trim(),raw:b}),i++;continue}if(/^\s*\|/.test(b)){const C=[];let A=i,T=!1;for(;A<o.length&&/^\s*\|/.test(o[A]);)C.push(o[A]),c.test(o[A])&&(T=!0),A++;if(T&&C.length>=2){n.push({kind:"table",text:((p=C[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:p.trim())||"表格",raw:C.join(`
|
|
11
|
+
`)}),i=A;continue}}const y=b.match(u),v=b.match(d);if(y||v){let C=i;for(;C<o.length;){const A=o[C].match(u),T=o[C].match(d);if(!(A||T))break;const h=o[C].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();h.length>0&&n.push({kind:"list",text:h.slice(0,80)||"(列表项)",raw:o[C]}),C++}i=C;continue}if(b.trim()===""){i++;continue}const _=[b];let x=i+1;for(;x<o.length;){const C=o[x];if(C.trim()===""||r.test(C)||a.test(C)||u.test(C)||d.test(C)||/^\s*\|/.test(C))break;_.push(C),x++}const g=_.join(" ").trim();n.push({kind:"paragraph",text:g.slice(0,80)||"(空段落)",raw:_.join(`
|
|
12
|
+
`)}),i=x}return n}function Bl(t,o="导入的导图"){const n=Rl(t||""),i={id:ht(),text:o,children:[]},r=[i],a=[0];let c=!1;function u(d){if(d.kind==="heading"){const p=d.level;for(;r.length>1&&a[a.length-1]>=p;)r.pop(),a.pop();if(!c&&p===1){c=!0,i.text=d.text,a[0]=1;return}const b={id:ht(),text:d.text,children:[]};r[r.length-1].children.push(b),r.push(b),a.push(p);return}const m={id:ht(),text:d.text,children:[],richContent:{kind:d.kind,raw:d.raw,lang:d.lang}};r[r.length-1].children.push(m)}for(const d of n)u(d);return i}function zl(t){return t.richContent?t.richContent.raw+`
|
|
13
|
+
`:""}function Ol(t){const o=t.minScale??.2,n=t.maxScale??1/0,i=t.step??1.2,r=e.ref(1),a=e.ref(0),c=e.ref(0),u=e.ref(!1),d=e.reactive({x:0,y:0,ox:0,oy:0}),m=e.ref(!1),p=e.reactive({x:0,y:0}),b=e.reactive({x:0,y:0,width:0,height:0}),E=e.ref(0);let w=null;function y(Y){w=Y}function v(Y){Y.preventDefault();const J=t.getContainer();if(!J)return;const se=-Y.deltaY*.001,W=Math.min(n,Math.max(o,r.value*(1+se))),X=J.getBoundingClientRect(),P=Y.clientX-X.left,N=Y.clientY-X.top,F=(P-a.value)/r.value,D=(N-c.value)/r.value;r.value=W,a.value=P-F*W,c.value=N-D*W}function _(){r.value=Math.min(n,r.value*i)}function x(){r.value=Math.max(o,r.value/i)}function g(Y){var se;Y.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(u.value=!0,d.x=Y.clientX,d.y=Y.clientY,d.ox=a.value,d.oy=c.value,window.addEventListener("mousemove",C),window.addEventListener("mouseup",A),(se=Y.preventDefault)==null||se.call(Y))}function C(Y){u.value&&(a.value=d.ox+(Y.clientX-d.x),c.value=d.oy+(Y.clientY-d.y))}function A(){u.value=!1,window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",A)}function T(Y,J){m.value=!0,p.x=Y,p.y=J,b.x=Y,b.y=J,b.width=0,b.height=0,E.value++,window.addEventListener("mousemove",G),window.addEventListener("mouseup",O)}function h(Y,J){if(!m.value)return;const se=Math.min(p.x,Y),W=Math.min(p.y,J),X=Math.max(p.x,Y),P=Math.max(p.y,J);b.x=se,b.y=W,b.width=X-se,b.height=P-W,E.value++}function O(){m.value=!1,window.removeEventListener("mousemove",G),window.removeEventListener("mouseup",O),w&&w()}function G(Y){if(!m.value)return;const J=t.getContainer();if(!J)return;const se=J.getBoundingClientRect(),W=(Y.clientX-se.left-a.value)/r.value,X=(Y.clientY-se.top-c.value)/r.value;h(W,X)}function ne(Y,J,se,W=60){const X=t.getContainer();if(!X)return;const P=X.getBoundingClientRect(),N=(P.width-W*2)/Y,F=(P.height-W*2)/J,D=Math.min(1,Math.max(.3,Math.min(N,F)));r.value=D,a.value=P.width/2,c.value=P.height/2-se*D}return{scale:r,offsetX:a,offsetY:c,isPanning:u,onWheel:v,zoomIn:_,zoomOut:x,startPan:g,startMarquee:T,updateMarquee:h,isMarquee:m,marquee:b,marqueeVersion:E,setOnMarqueeEnd:y,resetView:ne}}const Il=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function bi(t){return Il?t.metaKey:t.ctrlKey}function vl(t){function o(){const i=t.getSelectedId();return i||(t.defaultTargetId?t.defaultTargetId():t.getRootId())}function n(i){const r=i.target;if(r&&(r.tagName==="INPUT"||r.tagName==="TEXTAREA"||r.isContentEditable)||t.isReadonly()||t.isEditing())return;const a=t.getSelectedId(),c=o();if(c){if(bi(i)&&!i.shiftKey){if(i.key==="d"||i.key==="D"){a&&a!==t.getRootId()&&(i.preventDefault(),t.onDuplicate(a));return}if(i.key==="z"||i.key==="Z"){i.preventDefault(),t.onUndo();return}if(i.key==="y"||i.key==="Y"){i.preventDefault(),t.onRedo();return}if(i.key==="Home"){i.preventDefault(),t.onSelectRoot();return}}if(bi(i)&&i.shiftKey&&(i.key==="Z"||i.key==="z")){i.preventDefault(),t.onRedo();return}i.key==="Tab"?(i.preventDefault(),t.onAddChild(c)):i.key==="Enter"?(i.preventDefault(),i.shiftKey?a&&a!==t.getRootId()&&t.onAddSiblingBefore(a):t.onAddSibling(c)):(i.key==="Delete"||i.key==="Backspace")&&a&&a!==t.getRootId()?(i.preventDefault(),t.onRemove(a)):i.key==="F2"&&a?(i.preventDefault(),t.onStartEdit(a)):i.key==="Escape"?(i.preventDefault(),t.onClearSelection()):i.key==="ArrowDown"?(i.preventDefault(),t.onNavigate(0,1)):i.key==="ArrowUp"?(i.preventDefault(),t.onNavigate(0,-1)):i.key==="ArrowRight"?(i.preventDefault(),t.onNavigate(1,0)):i.key==="ArrowLeft"&&(i.preventDefault(),t.onNavigate(-1,0))}}e.onMounted(()=>{window.addEventListener("keydown",n)}),e.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function Ll(t=100){const o=e.ref([]);let n=-1;function i(){return n>0}function r(){return n<o.value.length-1}function a(m){const p=JSON.stringify(m);for(n<o.value.length-1&&(o.value=o.value.slice(0,n+1)),o.value.push(p),n=o.value.length-1;o.value.length>t;)o.value.shift(),n--}function c(){return i()?(n--,JSON.parse(o.value[n])):null}function u(){return r()?(n++,JSON.parse(o.value[n])):null}function d(){o.value=[],n=-1}return{canUndo:i,canRedo:r,record:a,undo:c,redo:u,reset:d}}const Dl=e.defineComponent({__name:"NodeContextMenu",props:{x:{},y:{},container:{},hasImage:{type:Boolean,default:!1},hasLink:{type:Boolean,default:!1},hasNote:{type:Boolean,default:!1},hasCode:{type:Boolean,default:!1},hasTable:{type:Boolean,default:!1}},emits:["pickImage","setLink","removeLink","editNote","removeNote","removeImage","addCode","editCode","removeCode","addTable","editTable","removeTable","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let E=n.x+2,w=n.y+2;if(n.container){const y=n.container.getBoundingClientRect(),v=180,x=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;E+v>y.right&&(E=Math.max(y.left+4,n.x-v-2)),w+x>y.bottom&&(w=Math.max(y.top+4,n.y-x-2)),E<y.left+2&&(E=y.left+2),w<y.top+2&&(w=y.top+2)}return{left:E,top:w}}),a=e.computed(()=>n.hasImage),c=e.computed(()=>n.hasLink),u=e.computed(()=>n.hasNote);function d(E){const w=E.target;w&&w.closest(".zm-node-menu")||i("close")}function m(E){E.key==="Escape"&&i("close")}function p(){i("close")}window.addEventListener("mousedown",d,!0),window.addEventListener("keydown",m,!0),window.addEventListener("wheel",p,!0),window.addEventListener("scroll",p,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",d,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener("wheel",p,!0),window.removeEventListener("scroll",p,!0)});function b(E){E(),i("close")}return(E,w)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-node-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:w[10]||(w[10]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[0]||(w[0]=e.withModifiers(y=>b(()=>i("pickImage")),["stop"]))},[e.createVNode(we,{name:"image",size:13}),e.createElementVNode("span",null,e.toDisplayString(a.value?"替换图片":"添加图片"),1)]),a.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:w[1]||(w[1]=e.withModifiers(y=>b(()=>i("removeImage")),["stop"]))},[e.createVNode(we,{name:"x",size:13}),w[11]||(w[11]=e.createElementVNode("span",null,"移除图片",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[2]||(w[2]=e.withModifiers(y=>b(()=>i("setLink")),["stop"]))},[e.createVNode(we,{name:"link",size:13}),e.createElementVNode("span",null,e.toDisplayString(c.value?"编辑链接":"添加链接"),1)]),c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:w[3]||(w[3]=e.withModifiers(y=>b(()=>i("removeLink")),["stop"]))},[e.createVNode(we,{name:"x",size:13}),w[12]||(w[12]=e.createElementVNode("span",null,"移除链接",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[4]||(w[4]=e.withModifiers(y=>b(()=>i("addCode")),["stop"]))},[w[13]||(w[13]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasCode?"编辑代码块":"添加代码块"),1)]),t.hasCode?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:w[5]||(w[5]=e.withModifiers(y=>b(()=>i("removeCode")),["stop"]))},[e.createVNode(we,{name:"x",size:13}),w[14]||(w[14]=e.createElementVNode("span",null,"移除代码块",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[6]||(w[6]=e.withModifiers(y=>b(()=>i("addTable")),["stop"]))},[w[15]||(w[15]=e.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),e.createElementVNode("span",null,e.toDisplayString(t.hasTable?"编辑表格":"添加表格"),1)]),t.hasTable?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:w[7]||(w[7]=e.withModifiers(y=>b(()=>i("removeTable")),["stop"]))},[e.createVNode(we,{name:"x",size:13}),w[16]||(w[16]=e.createElementVNode("span",null,"移除表格",-1))])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"zm-node-menu-item",onClick:w[8]||(w[8]=e.withModifiers(y=>b(()=>i("editNote")),["stop"]))},[e.createVNode(we,{name:"note",size:13}),e.createElementVNode("span",null,e.toDisplayString(u.value?"编辑笔记":"添加笔记"),1)]),u.value?(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:w[9]||(w[9]=e.withModifiers(y=>b(()=>i("removeNote")),["stop"]))},[e.createVNode(we,{name:"x",size:13}),w[17]||(w[17]=e.createElementVNode("span",null,"移除笔记",-1))])):e.createCommentVNode("",!0)],36))}}),Vl=e.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{let _=n.x+2,x=n.y+2;if(n.container){const g=n.container.getBoundingClientRect(),C=160,A=4+3*28;_+C>g.right&&(_=Math.max(g.left+4,n.x-C-2)),x+A>g.bottom&&(x=Math.max(g.top+4,n.y-A-2)),_<g.left+2&&(_=g.left+2),x<g.top+2&&(x=g.top+2)}return{left:_,top:x}}),a=e.ref(!1),c=e.ref(null),u=e.computed(()=>{if(!c.value)return{left:"-9999px",top:"-9999px",display:"none"};const _=c.value.getBoundingClientRect(),x=window.innerWidth,g=window.innerHeight,C=176,A=4+3*28;let T=_.right;T+C>x-4&&(T=Math.max(4,_.left-C));let h=_.top-4;return h+A>g-4&&(h=Math.max(4,g-A-4)),{left:T+"px",top:h+"px",display:"block"}});let d=null,m=null;function p(){m&&(clearTimeout(m),m=null),d=setTimeout(()=>{a.value=!0},60)}function b(){d&&(clearTimeout(d),d=null),m=setTimeout(()=>{a.value=!1},120)}e.onBeforeUnmount(()=>{d&&clearTimeout(d),m&&clearTimeout(m)});function E(_){const x=_.target;x&&x.closest(".zm-canvas-menu")||i("close")}function w(_){_.key==="Escape"&&i("close")}function y(){i("close")}window.addEventListener("mousedown",E,!0),window.addEventListener("keydown",w,!0),window.addEventListener("wheel",y,!0),window.addEventListener("scroll",y,!0),e.onBeforeUnmount(()=>{window.removeEventListener("mousedown",E,!0),window.removeEventListener("keydown",w,!0),window.removeEventListener("wheel",y,!0),window.removeEventListener("scroll",y,!0)});function v(_){_(),i("close")}return(_,x)=>(e.openBlock(),e.createElementBlock("div",{class:"zm-canvas-menu",style:e.normalizeStyle({left:r.value.left+"px",top:r.value.top+"px"}),onContextmenu:x[5]||(x[5]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[0]||(x[0]=e.withModifiers(g=>v(()=>i("openData")),["stop"]))},[e.createVNode(we,{name:"data",size:13}),x[6]||(x[6]=e.createElementVNode("span",null,"查看数据",-1))]),e.createElementVNode("div",{ref_key:"importItemRef",ref:c,class:e.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":a.value}]),onMouseenter:p,onMouseleave:b},[e.createVNode(we,{name:"import",size:13}),x[10]||(x[10]=e.createElementVNode("span",null,"导入",-1)),x[11]||(x[11]=e.createElementVNode("svg",{class:"zm-canvas-menu-caret",width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:e.normalizeStyle(u.value),onMouseenter:p,onMouseleave:b},[e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[1]||(x[1]=e.withModifiers(g=>v(()=>i("openImport","markdown")),["stop"]))},[e.createVNode(we,{name:"markdown",size:13}),x[7]||(x[7]=e.createElementVNode("span",null,"Markdown 导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[2]||(x[2]=e.withModifiers(g=>v(()=>i("openImport","json")),["stop"]))},[e.createVNode(we,{name:"data",size:13}),x[8]||(x[8]=e.createElementVNode("span",null,"JSON 文件导入",-1))]),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[3]||(x[3]=e.withModifiers(g=>v(()=>i("openImport","txt")),["stop"]))},[e.createVNode(we,{name:"note",size:13}),x[9]||(x[9]=e.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):e.createCommentVNode("",!0)],34),e.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:x[4]||(x[4]=e.withModifiers(g=>v(()=>i("openSettings")),["stop"]))},[e.createVNode(we,{name:"settings",size:13}),x[12]||(x[12]=e.createElementVNode("span",null,"设置",-1))])],36))}});function $l(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ki(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)&&ki(n)}),t}class yi{constructor(o){o.data===void 0&&(o.data={}),this.data=o.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Ei(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Rt(t,...o){const n=Object.create(null);for(const i in t)n[i]=t[i];return o.forEach(function(i){for(const r in i)n[r]=i[r]}),n}const Pl="</span>",xi=t=>!!t.scope,Fl=(t,{prefix:o})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${o}${n.shift()}`,...n.map((i,r)=>`${i}${"_".repeat(r+1)}`)].join(" ")}return`${o}${t}`};class Ul{constructor(o,n){this.buffer="",this.classPrefix=n.classPrefix,o.walk(this)}addText(o){this.buffer+=Ei(o)}openNode(o){if(!xi(o))return;const n=Fl(o.scope,{prefix:this.classPrefix});this.span(n)}closeNode(o){xi(o)&&(this.buffer+=Pl)}value(){return this.buffer}span(o){this.buffer+=`<span class="${o}">`}}const wi=(t={})=>{const o={children:[]};return Object.assign(o,t),o};class yo{constructor(){this.rootNode=wi(),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=wi({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=>{yo._collapse(n)}))}}class Hl extends yo{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 Ul(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function xn(t){return t?typeof t=="string"?t:t.source:null}function Ni(t){return Pt("(?=",t,")")}function Wl(t){return Pt("(?:",t,")*")}function Gl(t){return Pt("(?:",t,")?")}function Pt(...t){return t.map(n=>xn(n)).join("")}function jl(t){const o=t[t.length-1];return typeof o=="object"&&o.constructor===Object?(t.splice(t.length-1,1),o):{}}function Eo(...t){return"("+(jl(t).capture?"":"?:")+t.map(i=>xn(i)).join("|")+")"}function Si(t){return new RegExp(t.toString()+"|").exec("").length-1}function Kl(t,o){const n=t&&t.exec(o);return n&&n.index===0}const ql=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function xo(t,{joinWith:o}){let n=0;return t.map(i=>{n+=1;const r=n;let a=xn(i),c="";for(;a.length>0;){const u=ql.exec(a);if(!u){c+=a;break}c+=a.substring(0,u.index),a=a.substring(u.index+u[0].length),u[0][0]==="\\"&&u[1]?c+="\\"+String(Number(u[1])+r):(c+=u[0],u[0]==="("&&n++)}return c}).map(i=>`(${i})`).join(o)}const Yl=/\b\B/,Ti="[a-zA-Z]\\w*",wo="[a-zA-Z_]\\w*",Ci="\\b\\d+(\\.\\d+)?",_i="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ai="\\b(0b[01]+)",Xl="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Zl=(t={})=>{const o=/^#![ ]*\//;return t.binary&&(t.begin=Pt(o,/.*\b/,t.binary,/\b.*/)),Rt({scope:"meta",begin:o,end:/$/,relevance:0,"on:begin":(n,i)=>{n.index!==0&&i.ignoreMatch()}},t)},wn={begin:"\\\\[\\s\\S]",relevance:0},Jl={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[wn]},Ql={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[wn]},ea={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/},Un=function(t,o,n={}){const i=Rt({scope:"comment",begin:t,end:o,contains:[]},n);i.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=Eo("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:Pt(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},ta=Un("//","$"),na=Un("/\\*","\\*/"),oa=Un("#","$"),ia={scope:"number",begin:Ci,relevance:0},ra={scope:"number",begin:_i,relevance:0},la={scope:"number",begin:Ai,relevance:0},aa={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[wn,{begin:/\[/,end:/\]/,relevance:0,contains:[wn]}]},sa={scope:"title",begin:Ti,relevance:0},ca={scope:"title",begin:wo,relevance:0},da={begin:"\\.\\s*"+wo,relevance:0};var Hn=Object.freeze({__proto__:null,APOS_STRING_MODE:Jl,BACKSLASH_ESCAPE:wn,BINARY_NUMBER_MODE:la,BINARY_NUMBER_RE:Ai,COMMENT:Un,C_BLOCK_COMMENT_MODE:na,C_LINE_COMMENT_MODE:ta,C_NUMBER_MODE:ra,C_NUMBER_RE:_i,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:oa,IDENT_RE:Ti,MATCH_NOTHING_RE:Yl,METHOD_GUARD:da,NUMBER_MODE:ia,NUMBER_RE:Ci,PHRASAL_WORDS_MODE:ea,QUOTE_STRING_MODE:Ql,REGEXP_MODE:aa,RE_STARTERS_RE:Xl,SHEBANG:Zl,TITLE_MODE:sa,UNDERSCORE_IDENT_RE:wo,UNDERSCORE_TITLE_MODE:ca});function ua(t,o){t.input[t.index-1]==="."&&o.ignoreMatch()}function ma(t,o){t.className!==void 0&&(t.scope=t.className,delete t.className)}function fa(t,o){o&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=ua,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function pa(t,o){Array.isArray(t.illegal)&&(t.illegal=Eo(...t.illegal))}function ga(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 ha(t,o){t.relevance===void 0&&(t.relevance=1)}const ba=(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=Pt(n.beforeMatch,Ni(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},ka=["of","and","for","in","not","or","if","then","parent","list","value"],ya="keyword";function Mi(t,o,n=ya){const i=Object.create(null);return typeof t=="string"?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(a){Object.assign(i,Mi(t[a],o,a))}),i;function r(a,c){o&&(c=c.map(u=>u.toLowerCase())),c.forEach(function(u){const d=u.split("|");i[d[0]]=[a,Ea(d[0],d[1])]})}}function Ea(t,o){return o?Number(o):xa(t)?0:1}function xa(t){return ka.includes(t.toLowerCase())}const Ri={},Ft=t=>{console.error(t)},Bi=(t,...o)=>{console.log(`WARN: ${t}`,...o)},en=(t,o)=>{Ri[`${t}/${o}`]||(console.log(`Deprecated as of ${t}. ${o}`),Ri[`${t}/${o}`]=!0)},Wn=new Error;function zi(t,o,{key:n}){let i=0;const r=t[n],a={},c={};for(let u=1;u<=o.length;u++)c[u+i]=r[u],a[u+i]=!0,i+=Si(o[u-1]);t[n]=c,t[n]._emit=a,t[n]._multi=!0}function wa(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw Ft("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Wn;if(typeof t.beginScope!="object"||t.beginScope===null)throw Ft("beginScope must be object"),Wn;zi(t,t.begin,{key:"beginScope"}),t.begin=xo(t.begin,{joinWith:""})}}function Na(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw Ft("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Wn;if(typeof t.endScope!="object"||t.endScope===null)throw Ft("endScope must be object"),Wn;zi(t,t.end,{key:"endScope"}),t.end=xo(t.end,{joinWith:""})}}function Sa(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function Ta(t){Sa(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),wa(t),Na(t)}function Ca(t){function o(c,u){return new RegExp(xn(c),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(u?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(u,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,u]),this.matchAt+=Si(u)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const u=this.regexes.map(d=>d[1]);this.matcherRe=o(xo(u,{joinWith:"|"}),!0),this.lastIndex=0}exec(u){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(u);if(!d)return null;const m=d.findIndex((b,E)=>E>0&&b!==void 0),p=this.matchIndexes[m];return d.splice(0,m),Object.assign(d,p)}}class i{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(u){if(this.multiRegexes[u])return this.multiRegexes[u];const d=new n;return this.rules.slice(u).forEach(([m,p])=>d.addRule(m,p)),d.compile(),this.multiRegexes[u]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(u,d){this.rules.push([u,d]),d.type==="begin"&&this.count++}exec(u){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let m=d.exec(u);if(this.resumingScanAtSamePosition()&&!(m&&m.index===this.lastIndex)){const p=this.getMatcher(0);p.lastIndex=this.lastIndex+1,m=p.exec(u)}return m&&(this.regexIndex+=m.position+1,this.regexIndex===this.count&&this.considerAll()),m}}function r(c){const u=new i;return c.contains.forEach(d=>u.addRule(d.begin,{rule:d,type:"begin"})),c.terminatorEnd&&u.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&u.addRule(c.illegal,{type:"illegal"}),u}function a(c,u){const d=c;if(c.isCompiled)return d;[ma,ga,Ta,ba].forEach(p=>p(c,u)),t.compilerExtensions.forEach(p=>p(c,u)),c.__beforeBegin=null,[fa,pa,ha].forEach(p=>p(c,u)),c.isCompiled=!0;let m=null;return typeof c.keywords=="object"&&c.keywords.$pattern&&(c.keywords=Object.assign({},c.keywords),m=c.keywords.$pattern,delete c.keywords.$pattern),m=m||/\w+/,c.keywords&&(c.keywords=Mi(c.keywords,t.case_insensitive)),d.keywordPatternRe=o(m,!0),u&&(c.begin||(c.begin=/\B|\b/),d.beginRe=o(d.begin),!c.end&&!c.endsWithParent&&(c.end=/\B|\b/),c.end&&(d.endRe=o(d.end)),d.terminatorEnd=xn(d.end)||"",c.endsWithParent&&u.terminatorEnd&&(d.terminatorEnd+=(c.end?"|":"")+u.terminatorEnd)),c.illegal&&(d.illegalRe=o(c.illegal)),c.contains||(c.contains=[]),c.contains=[].concat(...c.contains.map(function(p){return _a(p==="self"?c:p)})),c.contains.forEach(function(p){a(p,d)}),c.starts&&a(c.starts,u),d.matcher=r(d),d}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Rt(t.classNameAliases||{}),a(t)}function Oi(t){return t?t.endsWithParent||Oi(t.starts):!1}function _a(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(o){return Rt(t,{variants:null},o)})),t.cachedVariants?t.cachedVariants:Oi(t)?Rt(t,{starts:t.starts?Rt(t.starts):null}):Object.isFrozen(t)?Rt(t):t}var Aa="11.11.1";class Ma extends Error{constructor(o,n){super(o),this.name="HTMLInjectionError",this.html=n}}const No=Ei,Ii=Rt,vi=Symbol("nomatch"),Ra=7,Li=function(t){const o=Object.create(null),n=Object.create(null),i=[];let r=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",c={disableAutodetect:!0,name:"Plain text",contains:[]};let u={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Hl};function d(N){return u.noHighlightRe.test(N)}function m(N){let F=N.className+" ";F+=N.parentNode?N.parentNode.className:"";const D=u.languageDetectRe.exec(F);if(D){const q=G(D[1]);return q||(Bi(a.replace("{}",D[1])),Bi("Falling back to no-highlight mode for this block.",N)),q?D[1]:"no-highlight"}return F.split(/\s+/).find(q=>d(q)||G(q))}function p(N,F,D){let q="",ce="";typeof F=="object"?(q=N,D=F.ignoreIllegals,ce=F.language):(en("10.7.0","highlight(lang, code, ...args) has been deprecated."),en("10.7.0",`Please use highlight(code, options) instead.
|
|
14
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),ce=N,q=F),D===void 0&&(D=!0);const ye={code:q,language:ce};X("before:highlight",ye);const Ne=ye.result?ye.result:b(ye.language,ye.code,D);return Ne.code=ye.code,X("after:highlight",Ne),Ne}function b(N,F,D,q){const ce=Object.create(null);function ye(U,K){return U.keywords[K]}function Ne(){if(!Q.keywords){Re.addText(Se);return}let U=0;Q.keywordPatternRe.lastIndex=0;let K=Q.keywordPatternRe.exec(Se),ae="";for(;K;){ae+=Se.substring(U,K.index);const he=He.case_insensitive?K[0].toLowerCase():K[0],Ie=ye(Q,he);if(Ie){const[Fe,Ye]=Ie;if(Re.addText(ae),ae="",ce[he]=(ce[he]||0)+1,ce[he]<=Ra&&(dt+=Ye),Fe.startsWith("_"))ae+=K[0];else{const Ct=He.classNameAliases[Fe]||Fe;I(K[0],Ct)}}else ae+=K[0];U=Q.keywordPatternRe.lastIndex,K=Q.keywordPatternRe.exec(Se)}ae+=Se.substring(U),Re.addText(ae)}function ue(){if(Se==="")return;let U=null;if(typeof Q.subLanguage=="string"){if(!o[Q.subLanguage]){Re.addText(Se);return}U=b(Q.subLanguage,Se,!0,xt[Q.subLanguage]),xt[Q.subLanguage]=U._top}else U=w(Se,Q.subLanguage.length?Q.subLanguage:null);Q.relevance>0&&(dt+=U.relevance),Re.__addSublanguage(U._emitter,U.language)}function ze(){Q.subLanguage!=null?ue():Ne(),Se=""}function I(U,K){U!==""&&(Re.startScope(K),Re.addText(U),Re.endScope())}function R(U,K){let ae=1;const he=K.length-1;for(;ae<=he;){if(!U._emit[ae]){ae++;continue}const Ie=He.classNameAliases[U[ae]]||U[ae],Fe=K[ae];Ie?I(Fe,Ie):(Se=Fe,Ne(),Se=""),ae++}}function ie(U,K){return U.scope&&typeof U.scope=="string"&&Re.openNode(He.classNameAliases[U.scope]||U.scope),U.beginScope&&(U.beginScope._wrap?(I(Se,He.classNameAliases[U.beginScope._wrap]||U.beginScope._wrap),Se=""):U.beginScope._multi&&(R(U.beginScope,K),Se="")),Q=Object.create(U,{parent:{value:Q}}),Q}function le(U,K,ae){let he=Kl(U.endRe,ae);if(he){if(U["on:end"]){const Ie=new yi(U);U["on:end"](K,Ie),Ie.isMatchIgnored&&(he=!1)}if(he){for(;U.endsParent&&U.parent;)U=U.parent;return U}}if(U.endsWithParent)return le(U.parent,K,ae)}function V(U){return Q.matcher.regexIndex===0?(Se+=U[0],1):(wt=!0,0)}function S(U){const K=U[0],ae=U.rule,he=new yi(ae),Ie=[ae.__beforeBegin,ae["on:begin"]];for(const Fe of Ie)if(Fe&&(Fe(U,he),he.isMatchIgnored))return V(K);return ae.skip?Se+=K:(ae.excludeBegin&&(Se+=K),ze(),!ae.returnBegin&&!ae.excludeBegin&&(Se=K)),ie(ae,U),ae.returnBegin?0:K.length}function fe(U){const K=U[0],ae=F.substring(U.index),he=le(Q,U,ae);if(!he)return vi;const Ie=Q;Q.endScope&&Q.endScope._wrap?(ze(),I(K,Q.endScope._wrap)):Q.endScope&&Q.endScope._multi?(ze(),R(Q.endScope,U)):Ie.skip?Se+=K:(Ie.returnEnd||Ie.excludeEnd||(Se+=K),ze(),Ie.excludeEnd&&(Se=K));do Q.scope&&Re.closeNode(),!Q.skip&&!Q.subLanguage&&(dt+=Q.relevance),Q=Q.parent;while(Q!==he.parent);return he.starts&&ie(he.starts,U),Ie.returnEnd?0:K.length}function pe(){const U=[];for(let K=Q;K!==He;K=K.parent)K.scope&&U.unshift(K.scope);U.forEach(K=>Re.openNode(K))}let Ve={};function Ke(U,K){const ae=K&&K[0];if(Se+=U,ae==null)return ze(),0;if(Ve.type==="begin"&&K.type==="end"&&Ve.index===K.index&&ae===""){if(Se+=F.slice(K.index,K.index+1),!r){const he=new Error(`0 width match regex (${N})`);throw he.languageName=N,he.badRule=Ve.rule,he}return 1}if(Ve=K,K.type==="begin")return S(K);if(K.type==="illegal"&&!D){const he=new Error('Illegal lexeme "'+ae+'" for mode "'+(Q.scope||"<unnamed>")+'"');throw he.mode=Q,he}else if(K.type==="end"){const he=fe(K);if(he!==vi)return he}if(K.type==="illegal"&&ae==="")return Se+=`
|
|
15
|
+
`,1;if(ut>1e5&&ut>K.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=ae,ae.length}const He=G(N);if(!He)throw Ft(a.replace("{}",N)),new Error('Unknown language: "'+N+'"');const fn=Ca(He);let Ot="",Q=q||fn;const xt={},Re=new u.__emitter(u);pe();let Se="",dt=0,qe=0,ut=0,wt=!1;try{if(He.__emitTokens)He.__emitTokens(F,Re);else{for(Q.matcher.considerAll();;){ut++,wt?wt=!1:Q.matcher.considerAll(),Q.matcher.lastIndex=qe;const U=Q.matcher.exec(F);if(!U)break;const K=F.substring(qe,U.index),ae=Ke(K,U);qe=U.index+ae}Ke(F.substring(qe))}return Re.finalize(),Ot=Re.toHTML(),{language:N,value:Ot,relevance:dt,illegal:!1,_emitter:Re,_top:Q}}catch(U){if(U.message&&U.message.includes("Illegal"))return{language:N,value:No(F),illegal:!0,relevance:0,_illegalBy:{message:U.message,index:qe,context:F.slice(qe-100,qe+100),mode:U.mode,resultSoFar:Ot},_emitter:Re};if(r)return{language:N,value:No(F),illegal:!1,relevance:0,errorRaised:U,_emitter:Re,_top:Q};throw U}}function E(N){const F={value:No(N),illegal:!1,relevance:0,_top:c,_emitter:new u.__emitter(u)};return F._emitter.addText(N),F}function w(N,F){F=F||u.languages||Object.keys(o);const D=E(N),q=F.filter(G).filter(Y).map(ze=>b(ze,N,!1));q.unshift(D);const ce=q.sort((ze,I)=>{if(ze.relevance!==I.relevance)return I.relevance-ze.relevance;if(ze.language&&I.language){if(G(ze.language).supersetOf===I.language)return 1;if(G(I.language).supersetOf===ze.language)return-1}return 0}),[ye,Ne]=ce,ue=ye;return ue.secondBest=Ne,ue}function y(N,F,D){const q=F&&n[F]||D;N.classList.add("hljs"),N.classList.add(`language-${q}`)}function v(N){let F=null;const D=m(N);if(d(D))return;if(X("before:highlightElement",{el:N,language:D}),N.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",N);return}if(N.children.length>0&&(u.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(N)),u.throwUnescapedHTML))throw new Ma("One of your code blocks includes unescaped HTML.",N.innerHTML);F=N;const q=F.textContent,ce=D?p(q,{language:D,ignoreIllegals:!0}):w(q);N.innerHTML=ce.value,N.dataset.highlighted="yes",y(N,D,ce.language),N.result={language:ce.language,re:ce.relevance,relevance:ce.relevance},ce.secondBest&&(N.secondBest={language:ce.secondBest.language,relevance:ce.secondBest.relevance}),X("after:highlightElement",{el:N,result:ce,text:q})}function _(N){u=Ii(u,N)}const x=()=>{A(),en("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function g(){A(),en("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let C=!1;function A(){function N(){A()}if(document.readyState==="loading"){C||window.addEventListener("DOMContentLoaded",N,!1),C=!0;return}document.querySelectorAll(u.cssSelector).forEach(v)}function T(N,F){let D=null;try{D=F(t)}catch(q){if(Ft("Language definition for '{}' could not be registered.".replace("{}",N)),r)Ft(q);else throw q;D=c}D.name||(D.name=N),o[N]=D,D.rawDefinition=F.bind(null,t),D.aliases&&ne(D.aliases,{languageName:N})}function h(N){delete o[N];for(const F of Object.keys(n))n[F]===N&&delete n[F]}function O(){return Object.keys(o)}function G(N){return N=(N||"").toLowerCase(),o[N]||o[n[N]]}function ne(N,{languageName:F}){typeof N=="string"&&(N=[N]),N.forEach(D=>{n[D.toLowerCase()]=F})}function Y(N){const F=G(N);return F&&!F.disableAutodetect}function J(N){N["before:highlightBlock"]&&!N["before:highlightElement"]&&(N["before:highlightElement"]=F=>{N["before:highlightBlock"](Object.assign({block:F.el},F))}),N["after:highlightBlock"]&&!N["after:highlightElement"]&&(N["after:highlightElement"]=F=>{N["after:highlightBlock"](Object.assign({block:F.el},F))})}function se(N){J(N),i.push(N)}function W(N){const F=i.indexOf(N);F!==-1&&i.splice(F,1)}function X(N,F){const D=N;i.forEach(function(q){q[D]&&q[D](F)})}function P(N){return en("10.7.0","highlightBlock will be removed entirely in v12.0"),en("10.7.0","Please use highlightElement now."),v(N)}Object.assign(t,{highlight:p,highlightAuto:w,highlightAll:A,highlightElement:v,highlightBlock:P,configure:_,initHighlighting:x,initHighlightingOnLoad:g,registerLanguage:T,unregisterLanguage:h,listLanguages:O,getLanguage:G,registerAliases:ne,autoDetection:Y,inherit:Ii,addPlugin:se,removePlugin:W}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=Aa,t.regex={concat:Pt,lookahead:Ni,either:Eo,optional:Gl,anyNumberOfTimes:Wl};for(const N in Hn)typeof Hn[N]=="object"&&ki(Hn[N]);return Object.assign(t,Hn),t},tn=Li({});tn.newInstance=()=>Li({});var Ba=tn;tn.HighlightJS=tn,tn.default=tn;const So=$l(Ba);function To(t){const o=t.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:o.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},a=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),c={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,r]};r.contains.push(u);const d={match:/\\"/},m={className:"string",begin:/'/,end:/'/},p={match:/\\'/},b={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},E=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],w=t.SHEBANG({binary:`(${E.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},v=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],_=["true","false"],x={match:/(\/[a-z._-]+)+/},g=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],C=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],T=["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:v,literal:_,built_in:[...g,...C,"set","shopt",...A,...T]},contains:[w,t.SHEBANG(),y,b,a,c,x,u,d,m,p,n]}}const za=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_-]*/}}),Oa=["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"],Ia=["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"],va=[...Oa,...Ia],La=["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(),Da=["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(),Va=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$a=["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 Pa(t){const o=t.regex,n=za(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",a=/@-?\w[\w]*(-\w+)*/,c="[a-zA-Z-][a-zA-Z0-9_-]*",u=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+c,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Da.join("|")+")"},{begin:":(:)?("+Va.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$a.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:o.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:La.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+va.join("|")+")\\b"}]}}function Di(t){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:a,illegal:/["']/}]}]}}var nn="[0-9](_*[0-9])*",Gn=`\\.(${nn})`,jn="[0-9a-fA-F](_*[0-9a-fA-F])*",Vi={className:"number",variants:[{begin:`(\\b(${nn})((${Gn})|\\.)?|(${Gn}))[eE][+-]?(${nn})[fFdD]?\\b`},{begin:`\\b(${nn})((${Gn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Gn})[fFdD]?\\b`},{begin:`\\b(${nn})[fFdD]\\b`},{begin:`\\b0[xX]((${jn})\\.?|(${jn})?\\.(${jn}))[pP][+-]?(${nn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${jn})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function $i(t,o,n){return n===-1?"":t.replace(o,i=>$i(t,o,n-1))}function Fa(t){const o=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=n+$i("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},m={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[o.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[p,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[m,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Vi,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Vi,m]}}const Pi="[A-Za-z$_][0-9A-Za-z$_]*",Ua=["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"],Ha=["true","false","null","undefined","NaN","Infinity"],Fi=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Ui=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hi=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Wa=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ga=[].concat(Hi,Fi,Ui);function Wi(t){const o=t.regex,n=(D,{after:q})=>{const ce="</"+D[0].slice(1);return D.input.indexOf(ce,q)!==-1},i=Pi,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,q)=>{const ce=D[0].length+D.index,ye=D.input[ce];if(ye==="<"||ye===","){q.ignoreMatch();return}ye===">"&&(n(D,{after:ce})||q.ignoreMatch());let Ne;const ue=D.input.substring(ce);if(Ne=ue.match(/^\s*=/)){q.ignoreMatch();return}if((Ne=ue.match(/^\s+extends\s+/))&&Ne.index===0){q.ignoreMatch();return}}},u={$pattern:Pi,keyword:Ua,literal:Ha,built_in:Ga,"variable.language":Wa},d="[0-9](_?[0-9])*",m=`\\.(${d})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},E={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,E],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,E],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,E],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,E]},g={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]},C=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,y,v,_,{match:/\$\d+/},b];E.contains=C.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(C)});const A=[].concat(g,E.contains),T=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),h={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:T},O={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},G={relevance:0,match:o.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Fi,...Ui]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Y={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[h],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function se(D){return o.concat("(?!",D.join("|"),")")}const W={match:o.concat(/\b/,se([...Hi,"super","import"].map(D=>`${D}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},X={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},h]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[h]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:T,CLASS_REFERENCE:G},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,y,v,_,g,{match:/\$\d+/},b,G,{scope:"attr",match:i+o.lookahead(":"),relevance:0},F,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[g,t.REGEXP_MODE,{className:"function",begin:N,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:T}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},Y,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[h,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},X,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[h]},W,J,O,P,{match:/\$[(.]/}]}}function ja(t){const o={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[o,n,t.QUOTE_STRING_MODE,r,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Gi(t){const o=t.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},c={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:o.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},m={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},p={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},b=t.inherit(m,{contains:[]}),E=t.inherit(p,{contains:[]});m.contains.push(E),p.contains.push(b);let w=[n,d];return[m,p,b,E].forEach(x=>{x.contains=x.contains.concat(w)}),w=w.concat(m,p),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:w},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:w}]}]},n,a,m,p,{className:"quote",begin:"^>\\s+",contains:w,end:"$"},r,i,d,c,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ji(t){const o=t.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],u={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:u,illegal:/#/},p={begin:/\{\{/,relevance:0},b={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,d,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,d,p,m]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,p,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,p,m]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},E="[0-9](_?[0-9])*",w=`(\\b(${E}))?\\.(${E})|\\b(${E})\\.`,y=`\\b|${i.join("|")}`,v={className:"number",relevance:0,variants:[{begin:`(\\b(${E})|(${w}))[eE][+-]?(${E})[jJ]?(?=${y})`},{begin:`(${w})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${E})[jJ](?=${y})`}]},_={className:"comment",begin:o.lookahead(/# type:/),end:/$/,keywords:u,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},x={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:["self",d,v,b,t.HASH_COMMENT_MODE]}]};return m.contains=[b,v,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:u,illegal:/(<\/|\?)|=>/,contains:[d,v,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},b,_,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[x]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[v,x,b]}]}}function Ki(t){const o=t.regex,n=/(r#)?/,i=o.concat(n,t.UNDERSCORE_IDENT_RE),r=o.concat(n,t.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:o.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,o.lookahead(/\s*\(/))},c="([ui](8|16|32|64|128|size)|f(32|64))?",u=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],d=["true","false","Some","None","Ok","Err"],m=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],p=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:p,keyword:u,literal:d,built_in:m},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+c},{begin:"\\b0o([0-7_]+)"+c},{begin:"\\b0x([A-Fa-f0-9_]+)"+c},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+c}],relevance:0},{begin:[/fn/,/\s+/,i],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,i],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,i,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:m,type:p}},{className:"punctuation",begin:"->"},a]}}function Ka(t){const o=t.regex,n=t.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],c=["double precision","large object","with timezone","without timezone"],u=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],d=["add","asc","collation","desc","final","first","last","view"],m=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],p=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],b=["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"],E=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],w=p,y=[...m,...d].filter(T=>!p.includes(T)),v={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},_={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},x={match:o.concat(/\b/,o.either(...w),/\s*\(/),relevance:0,keywords:{built_in:w}};function g(T){return o.concat(/\b/,o.either(...T.map(h=>h.replace(/\s+/,"\\s+"))),/\b/)}const C={scope:"keyword",match:g(E),relevance:0};function A(T,{exceptions:h,when:O}={}){const G=O;return h=h||[],T.map(ne=>ne.match(/\|\d+$/)||h.includes(ne)?ne:G(ne)?`${ne}|0`:ne)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:A(y,{when:T=>T.length<3}),literal:a,type:u,built_in:b},contains:[{scope:"type",match:g(c)},C,x,v,i,r,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,_]}}const Kn="[A-Za-z$_][0-9A-Za-z$_]*",qi=["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"],Yi=["true","false","null","undefined","NaN","Infinity"],Xi=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Zi=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ji=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Qi=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],er=[].concat(Ji,Xi,Zi);function qa(t){const o=t.regex,n=(D,{after:q})=>{const ce="</"+D[0].slice(1);return D.input.indexOf(ce,q)!==-1},i=Kn,r={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,q)=>{const ce=D[0].length+D.index,ye=D.input[ce];if(ye==="<"||ye===","){q.ignoreMatch();return}ye===">"&&(n(D,{after:ce})||q.ignoreMatch());let Ne;const ue=D.input.substring(ce);if(Ne=ue.match(/^\s*=/)){q.ignoreMatch();return}if((Ne=ue.match(/^\s+extends\s+/))&&Ne.index===0){q.ignoreMatch();return}}},u={$pattern:Kn,keyword:qi,literal:Yi,built_in:er,"variable.language":Qi},d="[0-9](_?[0-9])*",m=`\\.(${d})`,p="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${p})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\b`},{begin:`\\b(${p})\\b((${m})\\b|\\.)?|(${m})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},E={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,E],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,E],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,E],subLanguage:"graphql"}},_={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,E]},g={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]},C=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,y,v,_,{match:/\$\d+/},b];E.contains=C.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(C)});const A=[].concat(g,E.contains),T=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(A)}]),h={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:T},O={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,o.concat(i,"(",o.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},G={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:{_:[...Xi,...Zi]}},ne={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Y={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[h],illegal:/%/},J={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function se(D){return o.concat("(?!",D.join("|"),")")}const W={match:o.concat(/\b/,se([...Ji,"super","import"].map(D=>`${D}\\s*\\(`)),i,o.lookahead(/\s*\(/)),className:"title.function",relevance:0},X={begin:o.concat(/\./,o.lookahead(o.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},P={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},h]},N="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,o.lookahead(N)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[h]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:T,CLASS_REFERENCE:G},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),ne,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,y,v,_,g,{match:/\$\d+/},b,G,{scope:"attr",match:i+o.lookahead(":"),relevance:0},F,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[g,t.REGEXP_MODE,{className:"function",begin:N,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:T}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:a},{begin:c.begin,"on:begin":c.isTrulyOpeningTag,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}]},Y,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[h,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},X,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[h]},W,J,O,P,{match:/\$[(.]/}]}}function tr(t){const o=t.regex,n=qa(t),i=Kn,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},c={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},u={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:Kn,keyword:qi.concat(d),literal:Yi,built_in:er.concat(r),"variable.language":Qi},p={className:"meta",begin:"@"+i},b=(v,_,x)=>{const g=v.contains.findIndex(C=>C.label===_);if(g===-1)throw new Error("can not find mode to replace");v.contains.splice(g,1,x)};Object.assign(n.keywords,m),n.exports.PARAMS_CONTAINS.push(p);const E=n.contains.find(v=>v.scope==="attr"),w=Object.assign({},E,{match:o.concat(i,o.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,E,w]),n.contains=n.contains.concat([p,a,c,w]),b(n,"shebang",t.SHEBANG()),b(n,"use_strict",u);const y=n.contains.find(v=>v.label==="func.def");return y.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function nr(t){const o=t.regex,n=o.concat(/[\p{L}_]/u,o.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},c=t.inherit(a,{begin:/\(/,end:/\)/}),u=t.inherit(t.APOS_STRING_MODE,{className:"string"}),d=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),m={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,d,u,c,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[a,c,d,u]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[d]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:o.concat(/</,o.lookahead(o.concat(n,o.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:m}]},{className:"tag",begin:o.concat(/<\//,o.lookahead(o.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function or(t){const o="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},c={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},u=t.inherit(c,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),E={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},w={end:",",endsWithParent:!0,excludeEnd:!0,keywords:o,relevance:0},y={begin:/\{/,end:/\}/,contains:[w],illegal:"\\n",relevance:0},v={begin:"\\[",end:"\\]",contains:[w],illegal:"\\n",relevance:0},_=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:o,keywords:{literal:o}},E,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},y,v,a,c],x=[..._];return x.pop(),x.push(u),w.contains=x,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:_}}const Co={bash:To,sh:To,shell:To,css:Pa,go:Di,golang:Di,java:Fa,javascript:Wi,js:Wi,json:ja,markdown:Gi,md:Gi,python:ji,py:ji,rust:Ki,rs:Ki,sql:Ka,typescript:tr,ts:tr,xml:nr,html:nr,yaml:or,yml:or};for(const[t,o]of Object.entries(Co))So.registerLanguage(t,o);function _o(t){const o=t.split(`
|
|
16
16
|
`);return/^(`{3,}|~{3,})/.test(o[0]??"")&&o.shift(),/^(`{3,}|~{3,})\s*$/.test(o[o.length-1]??"")&&o.pop(),o.join(`
|
|
17
|
-
`).replace(/\n+$/,"")}function
|
|
18
|
-
`)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&
|
|
19
|
-
`).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function
|
|
20
|
-
`:"```\n",
|
|
17
|
+
`).replace(/\n+$/,"")}function on(t){const o=/^(`{3,}|~{3,})([^\s`~]*)/.exec(t.split(`
|
|
18
|
+
`)[0]??""),n=((o==null?void 0:o[2])??"").toLowerCase();return n&&Co[n]?n:""}function Ao(t,o){const n=o&&Co[o]?o:"";try{return n?So.highlight(t,{language:n,ignoreIllegals:!0}).value:So.highlightAuto(t).value}catch{return Ya(t)}}function ir(t){return t.split(`
|
|
19
|
+
`).filter(o=>o.trim().length>0).filter(o=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(o)).map(o=>o.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function Ya(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function rr(t,o,n){if(t.length<=1)return t.slice();const[i,...r]=t,a=r.map(m=>m[o]??""),c=a.length>0&&a.every(m=>m.trim()!==""&&!Number.isNaN(Number(m))),u=n==="asc"?1:-1,d=r.slice().sort((m,p)=>{const b=m[o]??"",E=p[o]??"";return c?(Number(b)-Number(E))*u:b.localeCompare(E,"zh-Hans-CN",{numeric:!0})*u});return[i,...d]}const Xa=["viewBox","width","height"],Za={class:"zm-edges"},Ja=["d","fill"],Qa=["data-node-id","onClick","onPointerdown","onDblclick","onContextmenu","onMouseenter","onMouseleave"],es=["src","width","height","alt"],ts=["onDblclick"],ns={key:0,class:"zm-rich-code"},os=["innerHTML"],is={key:1,class:"zm-rich-table"},rs=["onClick"],ls={class:"zm-rich-sort-mark","aria-hidden":"true"},as={key:2,class:"zm-text"},ss={class:"zm-text-label"},cs=["href","title"],ds=["title","onClick"],us=["title"],ms=["title","onClick"],fs=["onClick"],ps=["onMousedown"],gs=["onClick"],hs=["title"],bs={class:"zm-tb-tip zm-tb-zoom"},ks=["src"],ys=["src"],Ut=24,rn=400,Bt=160,qn=e.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{},hideCanvasActions:{type:Boolean,default:!1}},emits:["change","select","edit-note","markdownChange","canvas-toggle-preview","canvas-outline","canvas-settings","canvas-data","canvas-import"],setup(t,{expose:o,emit:n}){const i=t,r=n,a=e.ref(null),c=e.ref(null),u=e.ref(""),d=e.ref(null),m=e.ref(new Set),p=e.ref(!1),b=e.ref(null),E=e.ref(0),w=e.ref(0),y=e.ref(null),v=e.ref(null),_=e.ref(""),x=e.ref(new Map),g=e.ref(bt(i.data)),C=e.ref({}),A=e.ref({}),T=e.ref(i.markdown!==void 0);let h=!1;e.watch(()=>i.markdown,l=>{if(l===void 0){T.value=!1;return}T.value=!0;const s=Jt(l||"");h=!0,g.value=bt(s),d.value=null,m.value=new Set,ke(),e.nextTick(()=>{h=!1,At()})}),e.watch(g,()=>{T.value&&!h&&r("markdownChange",Qt(g.value))},{deep:!0});const O=e.computed(()=>ee.showOrderBadge===!0),G=e.ref(new Map),ne=G.value;function Y(l,s){const k={};s.bg&&(k.bg=s.bg),s.textColor&&(k.textColor=s.textColor),s.borderColor&&(k.borderColor=s.borderColor),s.fontWeight&&(k.fontWeight=s.fontWeight),Object.keys(k).length===0?ne.delete(l):ne.set(l,k),G.value=new Map(ne)}function J(l){return ne.get(l)??{}}function se(l,s){const k=me(g.value,l);k&&(k.image={src:s.src,naturalW:s.naturalW,naturalH:s.naturalH,width:P(s.width,Ut,rn),height:P(s.height,Ut,rn)},Ae(),ke(),r("change",g.value))}function W(l){const s=me(g.value,l);!s||!s.image||(delete s.image,Ae(),ke(),r("change",g.value))}function X(l,s){const k=s.trim();if(!me(g.value,l))return;if(!k){W(l);return}const B=new Image;B.onload=()=>{const $=me(g.value,l);if(!$)return;const j=B.naturalWidth&&B.naturalHeight?B.naturalWidth/B.naturalHeight:1,oe=P(B.naturalWidth||Bt,Ut,rn),Ce=Math.round(oe/j);$.image={src:k,naturalW:B.naturalWidth||oe,naturalH:B.naturalHeight||Ce,width:oe,height:Ce},Ae(),ke(),r("change",g.value)},B.onerror=()=>{},B.src=k}function P(l,s,k){return Math.min(k,Math.max(s,l))}function N(l,s){const k=new FileReader;k.onload=()=>{if(typeof k.result!="string")return;const L=k.result,B=new window.Image;B.onload=()=>{const $=B.naturalWidth||Bt,j=B.naturalHeight||Bt,oe=P($,Ut,Bt),Ce=P(Math.round(j*oe/$),Ut,rn);s({src:L,naturalW:$,naturalH:j,width:oe,height:Ce})},B.onerror=()=>{s({src:L,naturalW:Bt,naturalH:Bt,width:Bt,height:Bt})},B.src=L},k.readAsDataURL(l)}function F(l){const s=document.createElement("input");s.type="file",s.accept="image/*",s.style.display="none",s.onchange=()=>{var L;const k=(L=s.files)==null?void 0:L[0];k&&(N(k,B=>se(l,B)),document.body.removeChild(s))},document.body.appendChild(s),s.click()}function D(l,s){const k=s.trim(),L=me(g.value,l);L&&(k?L.link={url:k}:delete L.link,Ae(),ke(),r("change",g.value))}function q(l){D(l,"")}function ce(l,s){const k=me(g.value,l);k&&(s?k.note={text:s}:delete k.note,Ae(),ke(),r("change",g.value))}function ye(l){ce(l,"")}function Ne(l,s){const k=me(g.value,l);k&&(s?k.richContent=s:delete k.richContent,Ae(),ke(),r("change",g.value))}const ue=e.ref(null),ze=e.ref(null),I=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-preview",!i.hideCanvasActions&&(!i.previewMode||p.value)?"is-visible":""].filter(Boolean).join(" ")),R=e.computed(()=>["zm-canvas-fab","zm-canvas-fab-outline",!i.hideCanvasActions&&(!i.previewMode||p.value)?"is-visible":""].filter(Boolean).join(" "));function ie(l,s){i.previewMode||(l.preventDefault(),l.stopPropagation(),ze.value=null,d.value=s.id,r("select",me(g.value,s.id)),ue.value={nodeId:s.id,x:l.clientX,y:l.clientY})}function le(){ue.value=null}function V(l){const s=l.target;s!=null&&s.closest(".zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline")||(l.preventDefault(),ue.value&&(ue.value=null),ze.value={x:l.clientX,y:l.clientY})}function S(){ze.value=null}function fe(){S(),r("canvas-settings")}function pe(){S(),r("canvas-data")}function Ve(l){S(),r("canvas-import",l)}function Ke(){var s;const l=(s=ue.value)==null?void 0:s.nodeId;l&&F(l)}function He(){var L,B,$;const l=(L=ue.value)==null?void 0:L.nodeId;if(!l)return;const s=(($=(B=me(g.value,l))==null?void 0:B.link)==null?void 0:$.url)??"",k=window.prompt("输入链接 URL(留空取消)",s);k!==null&&D(l,k)}function fn(){var s;const l=(s=ue.value)==null?void 0:s.nodeId;l&&q(l)}function Ot(){var s;const l=(s=ue.value)==null?void 0:s.nodeId;l&&ut(l)}function Q(){var s;const l=(s=ue.value)==null?void 0:s.nodeId;l&&ye(l)}function xt(){var s;const l=(s=ue.value)==null?void 0:s.nodeId;l&&W(l)}function Re(){var tt,nt;const l=(tt=ue.value)==null?void 0:tt.nodeId;if(!l)return;const s=(nt=me(g.value,l))==null?void 0:nt.richContent,k=(s==null?void 0:s.kind)==="code"?_o(s.raw):"",L=(s==null?void 0:s.kind)==="code"&&s.lang||"",B=L?"```"+L+`
|
|
20
|
+
`:"```\n",j=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",k?B+k+(k.endsWith("```")?"":"\n```"):B+"// 你的代码"+"\n```");if(j===null)return;const oe=j.trim();if(!oe){Ne(l,null);return}const Ce=/^```([^\s`]*)/.exec(oe),M=Ce?Ce[1]:void 0;Ne(l,{kind:"code",raw:oe,lang:M})}function Se(){var s;const l=(s=ue.value)==null?void 0:s.nodeId;l&&Ne(l,null)}function dt(){var j,oe;const l=(j=ue.value)==null?void 0:j.nodeId;if(!l)return;const s=(oe=me(g.value,l))==null?void 0:oe.richContent,k=(s==null?void 0:s.kind)==="table"?s.raw:"",B=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",k||`| 列1 | 列2 | 列3 |
|
|
21
21
|
| --- | --- | --- |
|
|
22
|
-
| a | b | c |`);if(I===null)return;const P=I.trim();if(!P){j(l,null);return}j(l,{kind:"table",raw:P})}function Me(){var d;const l=(d=X.value)==null?void 0:d.nodeId;l&&j(l,null)}function ye(l){i.previewMode||r("edit-note",l)}function kt(l,d=60){const E=l.replace(/\s+/g," ").trim();return E.length<=d?E||"点击编辑笔记":E.slice(0,d)+"…"}function je(l){var I;if(i.previewMode||c.value)return;const d=l.target;if(d&&(d.tagName==="INPUT"||d.tagName==="TEXTAREA"||d.isContentEditable))return;const E=s.value;if(!E)return;const V=(I=l.clipboardData)==null?void 0:I.items;if(V)for(let P=0;P<V.length;P++){const q=V[P];if(q.kind==="file"&&q.type.startsWith("image/")){const re=q.getAsFile();if(!re)continue;l.preventDefault();const Se=pe(b.value,E);if(Se!=null&&Se.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;G(re,R=>oe(E,R));return}}}e.onMounted(()=>{window.addEventListener("paste",je),we()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",je)});const Qe=e.ref(null),yt=e.computed(()=>{var l;return((l=Qe.value)==null?void 0:l.nodeId)??null});function U(l,d){if(!d.image)return;l.preventDefault(),l.stopPropagation();const E=d.image.naturalW||d.image.width,V=d.image.naturalH||d.image.height,I=V>0?V/E:1;Qe.value={nodeId:d.id,startX:l.clientX,startY:l.clientY,startW:d.image.width,startH:d.image.height,naturalW:E,naturalH:V,ratio:I,pendingW:d.image.width,pendingH:d.image.height},window.addEventListener("mousemove",Z),window.addEventListener("mouseup",se)}function Z(l){var Se,R;const d=Qe.value;if(!d)return;const E=ne.scale.value||1,V=l.clientX-d.startX,I=le(d.startW+V/E,vt,Yt),P=le(I*d.ratio,vt,Yt);d.pendingW=I,d.pendingH=P;const q=(Se=a.value)==null?void 0:Se.querySelector(`[data-node-id="${d.nodeId}"] .zm-node-img`);q&&(q.style.width=`${I}px`,q.style.height=`${P}px`);const re=(R=a.value)==null?void 0:R.querySelector(`[data-node-id="${d.nodeId}"]`);re&&(re.style.minWidth=`${Math.max(80,Math.ceil(I+28))}px`,re.style.height=`${Math.ceil(P+8+30)}px`)}function se(){const l=Qe.value;if(window.removeEventListener("mousemove",Z),window.removeEventListener("mouseup",se),Qe.value=null,!l)return;const d=pe(b.value,l.nodeId);!d||!d.image||(oe(l.nodeId,{src:d.image.src,naturalW:d.image.naturalW,naturalH:d.image.naturalH,width:l.pendingW,height:l.pendingH}),s.value=l.nodeId,r("select",d),Re=!0)}const he=e.ref(null);let Re=!1;function He(l){he.value=l}function et(l){he.value===l&&(he.value=null),g.value&&(g.value=null)}function Pt(l,d){var Ke;if(!d.text||d.text.length<14)return;const V=l.currentTarget.getBoundingClientRect(),I=(Ke=a.value)==null?void 0:Ke.getBoundingClientRect();if(!I)return;const P=10,q=240,re=V.top-I.top>60,Se=V.left-I.left+V.width/2,R=P+q/2,fe=I.width-q/2-P,it=Math.max(R,Math.min(Se,fe)),st=re?V.top-I.top-8:V.bottom-I.top+8;g.value={text:d.text,x:it,y:st,above:re}}const rn=e.ref(0),ln=e.ref(!1),at=Bl(100);function Ve(){at.record({data:b.value})}function we(){m.value=new Set(m.value),rn.value++,e.nextTick().then(()=>e.nextTick()).then(()=>an()).then(()=>{rn.value++})}function an(){const l=document.querySelectorAll(".zm-rich"),d={},E={};l.forEach(V=>{let I=V,P=null;for(;I&&!P;)P=I.getAttribute("data-node-id"),I=I.parentElement;if(!P)return;const q=V.offsetHeight,re=V.scrollWidth,Se=Math.round(q*2)/2,R=Math.round(re*2)/2;d[P]=Se,E[P]=R,_.value[P],x.value[P]}),_.value=d,x.value=E}const Ie=e.computed(()=>{var l,d,E,V,I,P,q,re,Se,R;return{rootBg:((l=i.theme)==null?void 0:l.rootBg)??"#1f2937",rootText:((d=i.theme)==null?void 0:d.rootText)??"#ffffff",branchBg:((E=i.theme)==null?void 0:E.branchBg)??"#ffffff",branchText:((V=i.theme)==null?void 0:V.branchText)??"#1f2937",lineColor:((I=i.theme)==null?void 0:I.lineColor)??"#94a3b8",bgColor:((P=i.theme)==null?void 0:P.bgColor)??"#f8fafc",fontSize:((q=i.theme)==null?void 0:q.fontSize)??14,lineWidthStart:((re=i.theme)==null?void 0:re.lineWidthStart)??2.2,lineWidthEnd:((Se=i.theme)==null?void 0:Se.lineWidthEnd)??.8,rainbowBranch:((R=i.theme)==null?void 0:R.rainbowBranch)??!1}}),Q=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function sn(l){return Q.taperedEdge?Yo(l):dn(l)}function cn(l){return Q.taperedEdge?Q.lineWidthEnd:dn(l)}function Yo(l){return l<=0?Q.lineWidthStart:l===1?Math.max(1.5,Q.lineWidthStart*.67):l===2?Math.max(.8,Q.lineWidthStart*.42):Q.lineWidthEnd}function dn(l){if(l<=0)return Q.lineWidthStart;if(l>=3)return Q.lineWidthEnd;const d=l/3;return Q.lineWidthStart+(Q.lineWidthEnd-Q.lineWidthStart)*d}function Sn(l,d,E,V){const I=1-l,P=I*I*I*d.x+3*I*I*l*E.x1+3*I*l*l*E.x2+l*l*l*V.x,q=I*I*I*d.y+3*I*I*l*E.y1+3*I*l*l*E.y2+l*l*l*V.y;return{x:P,y:q}}function Zo(l,d,E,V,I=32,P="curve",q="right"){if(P==="curve"){let wt;if(q==="right"||q==="left"){const ve=Math.abs(d.x-l.x)*.45,_t=q==="right"?1:-1;wt={x1:l.x+_t*ve,y1:l.y,x2:d.x-_t*ve,y2:d.y}}else{const ve=Math.abs(d.y-l.y)*.45;wt={x1:l.x,y1:l.y+ve,x2:d.x,y2:d.y-ve}}const Gr=Te=>{const ve=1-Te,_t=-3*ve*ve*l.x+3*(ve*ve-2*ve*Te)*wt.x1+3*(2*ve*Te-Te*Te)*wt.x2+3*Te*Te*d.x,gn=-3*ve*ve*l.y+3*(ve*ve-2*ve*Te)*wt.y1+3*(2*ve*Te-Te*Te)*wt.y2+3*Te*Te*d.y;return{dx:_t,dy:gn}},On=[],ti=[];for(let Te=0;Te<=I;Te++){const ve=Te/I,_t=Te===0?l:Te===I?d:Sn(ve,l,wt,d),gn=Gr(ve);let uo=Math.hypot(gn.dx,gn.dy);uo<1e-6&&(uo=1);const jr=-gn.dy/uo,Kr=gn.dx/uo,mo=(E+(V-E)*ve)/2;On.push({x:_t.x+jr*mo,y:_t.y+Kr*mo}),ti.push({x:_t.x-jr*mo,y:_t.y-Kr*mo})}let co=`M ${On[0].x.toFixed(2)} ${On[0].y.toFixed(2)}`;for(let Te=1;Te<=I;Te++)co+=` L ${On[Te].x.toFixed(2)} ${On[Te].y.toFixed(2)}`;for(let Te=I;Te>=0;Te--)co+=` L ${ti[Te].x.toFixed(2)} ${ti[Te].y.toFixed(2)}`;return co+=" Z",co}const re=d.x-l.x,Se=d.y-l.y;let R=Math.hypot(re,Se);R<1e-6&&(R=1);const fe=-Se/R,it=re/R,st=E/2,Ke=V/2,Mn={x:l.x+fe*st,y:l.y+it*st},Rn={x:l.x-fe*st,y:l.y-it*st},Bn={x:d.x-fe*Ke,y:d.y-it*Ke},zn={x:d.x+fe*Ke,y:d.y+it*Ke};return`M ${Mn.x.toFixed(2)} ${Mn.y.toFixed(2)} L ${zn.x.toFixed(2)} ${zn.y.toFixed(2)} L ${Bn.x.toFixed(2)} ${Bn.y.toFixed(2)} L ${Rn.x.toFixed(2)} ${Rn.y.toFixed(2)} Z`}const Et=e.computed(()=>$e.value.root.children),Xo=Nt[0].colors,Jn=e.computed(()=>hl(Q.branchPaletteId,Q.customPalettes)),Ce=e.computed(()=>{const l=new Map;if(!Q.rainbowBranch)return l;const d=i.lineColors,E=d&&d.length>0?d:Jn.value.colors.length>0?Jn.value.colors:Xo;for(let I=0;I<Et.value.length;I++){const P=Et.value[I];l.set(P.id,E[I%E.length])}const V=(I,P)=>{l.set(I.id,P);for(const q of I.children)V(q,P)};for(let I=0;I<Et.value.length;I++){const P=Et.value[I];V(P,E[I%E.length])}return l});function Bt(l,d){return Q.rainbowBranch?Ce.value.get(d.id)??Ie.value.lineColor:Ie.value.lineColor}function Jo(l){const d=W(l.id);if(d.bg)return d.bg;if(l.isRoot)return Ie.value.rootBg;if(Q.rainbowBranch){const E=Ce.value.get(l.id);if(E)return to(E,.18)}return Ie.value.branchBg}function Qn(l){const d=W(l.id);if(d.textColor)return d.textColor;if(l.isRoot)return Ie.value.rootText;if(Q.rainbowBranch){const E=Ce.value.get(l.id);if(E)return no(E,.55)}return Ie.value.branchText}function Tn(l){const d=W(l.id);if(d.borderColor)return d.borderColor;if(l.isRoot)return Ie.value.rootBg;if(Q.rainbowBranch){const E=Ce.value.get(l.id);if(E)return no(E,.3)}return Ie.value.lineColor}function eo(l){return W(l.id).fontWeight??(l.isRoot?600:400)}function to(l,d){const E=l.replace("#",""),V=E.length===6?E:E.split("").map(re=>re+re).join(""),I=parseInt(V.slice(0,2),16),P=parseInt(V.slice(2,4),16),q=parseInt(V.slice(4,6),16);return`rgba(${I}, ${P}, ${q}, ${d})`}function no(l,d){const E=l.replace("#",""),V=E.length===6?E:E.split("").map(re=>re+re).join(""),I=Math.round(parseInt(V.slice(0,2),16)*(1-d)),P=Math.round(parseInt(V.slice(2,4),16)*(1-d)),q=Math.round(parseInt(V.slice(4,6),16)*(1-d));return`rgb(${I}, ${P}, ${q})`}const ne=Al({getContainer:()=>a.value});ne.setOnMarqueeEnd(Um),Rl({isEditing:()=>c.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>s.value,getRootId:()=>b.value.id,defaultTargetId:()=>b.value.id,onAddChild:z,onAddSibling:H,onAddSiblingBefore:ke,onRemove:ot,onStartEdit:xt,onClearSelection:()=>{s.value=null,r("select",null)},onDuplicate:ce,onUndo:Ne,onRedo:ze,onNavigate:nt,onSelectRoot:()=>{s.value=b.value.id;const l=pe(b.value,b.value.id);l&&r("select",l)}});const $e=e.computed(()=>{const l=pt(b.value);return Tt(l),ml(l,{mode:Q.layoutMode,baseFontSize:Ie.value.fontSize,richHeights:_.value,richWidths:x.value})}),Cn=e.ref([]),un=e.computed(()=>(rn.value,Cn.value));e.watch($e,l=>{const d=[],E=V=>{d.push(V);for(const I of V.children)E(I)};E(l.root),Cn.value=d},{immediate:!0});const _n=e.computed(()=>{const l=[];for(const d of un.value)for(const E of d.children)l.push({from:d,to:E,key:`${d.id}->${E.id}`});return l}),mn=e.computed(()=>`${$e.value.vbX} ${$e.value.vbY} ${$e.value.vbW} ${$e.value.vbH}`);function Tt(l){if(m.value.has(l.id)){l.children=[],l.collapsed=!0;return}l.collapsed=!1;for(const d of l.children)Tt(d)}function xt(l){const d=pe(b.value,l);d&&(c.value=l,u.value=d.text,e.nextTick(()=>{const E=document.querySelector(".zm-input");E==null||E.focus(),E==null||E.select()}))}function tt(l={}){if(!c.value)return;const d=pe(b.value,c.value);d&&d.text!==(u.value.trim()||" ")&&(d.text=u.value.trim()||" ",Ve(),r("change",b.value));const E=c.value;c.value=null,l.addChild?e.nextTick(()=>z(E)):l.addSibling==="after"?e.nextTick(()=>H(E)):l.addSibling==="before"&&e.nextTick(()=>ke(E))}function oo(){c.value=null}function io(l){if(i.previewMode)return;const d=pe(b.value,l);d!=null&&d.richContent&&(y.value=l,w.value=d.richContent.raw,e.nextTick(()=>{const E=document.querySelector(".zm-node .zm-rich textarea");E==null||E.focus()}))}function ro(){if(!y.value)return;const l=y.value,d=pe(b.value,l),E=w.value;if(d&&d.richContent&&d.richContent.raw!==E)if(d.richContent.kind==="code"){const V=qt(E)||void 0;j(l,{kind:"code",raw:E,lang:V})}else j(l,{kind:"table",raw:E});y.value=null}function lo(){y.value=null}function ao(l){l.key==="Escape"?(l.preventDefault(),lo()):l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),ro())}function fn(l,d){const E=k.value.get(l);!E||E.col!==d?k.value.set(l,{col:d,dir:"asc"}):E.dir==="asc"?k.value.set(l,{col:d,dir:"desc"}):k.value.delete(l)}function zt(l,d){const E=k.value.get(l);return!E||d.length<=1?d:or(d,E.col,E.dir)}function J(l,d){const E=k.value.get(l);return!E||E.col!==d?"↕":E.dir==="asc"?"▲":"▼"}function f(l){const d=l.metaKey||l.ctrlKey;d&&(l.key==="z"||l.key==="Z")&&!l.shiftKey?(l.preventDefault(),Ne()):(d&&l.shiftKey&&(l.key==="z"||l.key==="Z")||d&&(l.key==="y"||l.key==="Y")&&!l.shiftKey)&&(l.preventDefault(),ze())}function z(l){const d=mi(b.value,l,Dn);d&&(Ve(),we(),r("change",b.value),e.nextTick(()=>xt(d.id)))}function H(l){if(l===b.value.id){z(l);return}const d=fi(b.value,l,Dn);d&&(Ve(),we(),r("change",b.value),e.nextTick(()=>xt(d.id)))}function ke(l){if(l===b.value.id){z(l);return}const d=Nl(b.value,l,Dn);d&&(Ve(),we(),r("change",b.value),e.nextTick(()=>xt(d.id)))}function ce(l){if(l===b.value.id)return;const d=Sl(b.value,l);d&&(Ve(),s.value=d.id,r("change",b.value),we())}function Ne(){const l=at.undo();l&&(b.value=l.data,s.value=null,r("select",null),we(),r("change",b.value))}function ze(){const l=at.redo();l&&(b.value=l.data,s.value=null,r("select",null),we(),r("change",b.value))}function nt(l,d){const E=s.value??b.value.id,V=pe(b.value,E);if(!V)return;let I=null;if(d===1){const P=ct(b.value,V.id);if(P){const q=P.children.findIndex(re=>re.id===V.id);q>=0&&q<P.children.length-1&&(I=P.children[q+1].id)}}else if(d===-1){const P=ct(b.value,V.id);if(P){const q=P.children.findIndex(re=>re.id===V.id);q>0&&(I=P.children[q-1].id)}}else if(l===1){const P=ct(b.value,V.id);P&&(I=P.id)}else l===-1&&V.children.length>0&&(I=V.children[0].id);if(I){s.value=I;const P=pe(b.value,I);P&&r("select",P)}}function ot(l){l!==b.value.id&&go(b.value,l)&&(Ve(),s.value===l&&(s.value=null),we(),r("change",b.value))}function pn(l){m.value.has(l)?m.value.delete(l):m.value.add(l),we()}function Pe(l){const d=[{n:b.value,depth:1}];for(;d.length;){const{n:E,depth:V}=d.pop();l(E,V);for(let I=E.children.length-1;I>=0;I--)d.push({n:E.children[I],depth:V+1})}}function so(){m.value=new Set,Pe(l=>{l.children.length>0&&m.value.add(l.id)}),we()}function An(l){m.value=new Set,Pe((d,E)=>{E>l&&d.children.length>0&&m.value.add(d.id)}),we()}function Lm(){m.value=new Set,we()}function Dm(l,d){xl(b.value,l,d)&&(Ve(),we(),r("change",b.value))}function Vm(l,d,E){return wl(b.value,l,d,E)?(Ve(),we(),r("change",b.value),!0):!1}function $m(l,d){l.stopPropagation(),s.value=d.id;const E=pe(b.value,d.id);r("select",E)}function Pm(l){const d=l.target;if(!d||d.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(l.button===2){ne.startPan(l);return}if(l.button!==0)return;const E=a.value.getBoundingClientRect(),V=(l.clientX-E.left-ne.offsetX.value)/ne.scale.value,I=(l.clientY-E.top-ne.offsetY.value)/ne.scale.value;ne.startMarquee(V,I)}function Fm(l){if(Re){Re=!1;return}const d=l.target;if(!d||d.closest(".zm-node"))return;const E=ne.marquee;E.width>=4||E.height>=4||s.value!==null&&(s.value=null,r("select",null))}function Um(){const l=ne.marquee;if(l.width<4&&l.height<4)return;const d=l.x,E=l.y,V=l.x+l.width,I=l.y+l.height,P=[];for(const q of un.value){const re=q.width/2,Se=q.height/2,R=q.x-re,fe=q.x+re,it=q.y-Se,st=q.y+Se;R<=V&&fe>=d&&it<=I&&st>=E&&P.push(q.id)}if(P.length>0){s.value=P[0];const q=pe(b.value,P[0]);q&&r("select",q)}}function Pr(l){return m.value.has(l)}function Hm(l){const d=pe(b.value,l.id);return!!d&&d.children.length>0}function Qo(l){const d=pe(b.value,l);return d?d.children.length:0}function Fr(l){if(!pe(b.value,l))return 0;const V=[b.value];for(;V.length;){const I=V.pop(),P=I.children.findIndex(q=>q.id===l);if(P>=0)return P;for(const q of I.children)V.push(q)}return 0}function Ur(l,d,E,V){if(((V==null?void 0:V._dir)??l._dir)==="down")return d==="out"?{x:l.x,y:l.y+l.height/2}:{x:l.x,y:l.y-l.height/2};let P;d==="in"?P=-l.side:E!==void 0?P=E:P=l.side;const q=d==="in"?l._richInsetX??0:0;return{x:l.x+P*(l.width/2-q),y:l.y}}function Ct(){const l=$e.value;ne.resetView(l.width,l.height,l.root.y)}function Wm(){ln.value=!0,Ve(),we(),e.nextTick(()=>Ct())}function ei(l){Q.layoutMode!==l&&(Q.layoutMode=l,we(),e.nextTick(()=>Ct()))}function Hr(){return JSON.stringify(b.value,null,2)}function Wr(l){try{const d=JSON.parse(l);return!d.id||!Array.isArray(d.children)?!1:(at.reset(),b.value=pt(d),s.value=null,m.value=new Set,we(),e.nextTick(()=>Ct()),r("change",b.value),!0)}catch{return!1}}function Gm(){const l=document.createElement("input");l.type="file",l.accept="application/json",l.onchange=()=>{var V;const d=(V=l.files)==null?void 0:V[0];if(!d)return;const E=new FileReader;E.onload=()=>{typeof E.result=="string"&&(Wr(E.result)||alert("导入失败:JSON 格式无效"))},E.readAsText(d)},l.click()}function jm(){const l=new Blob([Hr()],{type:"application/json"}),d=URL.createObjectURL(l),E=document.createElement("a");E.href=d,E.download=`${b.value.text||"mindmap"}.json`,E.click(),URL.revokeObjectURL(d)}return o({addChild:l=>z(l),addSibling:l=>H(l),removeNode:l=>ot(l),duplicateNode:l=>ce(l),setNodeText:(l,d)=>Dm(l,d),moveNode:(l,d,E)=>Vm(l,d,E),lineWidthForDepth:sn,endWidthForDepth:cn,getData:()=>b.value,setData:l=>{at.reset(),b.value=pt(l),s.value=null,m.value=new Set,we(),Ve(),e.nextTick(()=>Ct())},resetView:()=>Ct(),exportData:Hr,importData:Wr,getMarkdown:()=>Wt(b.value),setMarkdown:(l,d=!0)=>{const E=Ht(l||"");d&&(M.value=!0),S=!d,at.reset(),b.value=pt(E),s.value=null,m.value=new Set,we(),Ve(),e.nextTick(()=>{S=!1,Ct()}),r("change",b.value)},setBalanced:l=>{ln.value=l},isBalanced:()=>ln.value,balance:()=>Wm(),applyNodeStyle:(l,d)=>O(l,d),getNodeStyle:l=>W(l),applyNodeImage:(l,d)=>oe(l,d),applyNodeImageByUrl:(l,d)=>te(l,d),removeNodeImage:l=>K(l),applyNodeLink:(l,d)=>F(l,d),removeNodeLink:l=>N(l),applyNodeNote:(l,d)=>$(l,d),removeNodeNote:l=>L(l),applyNodeRichContent:(l,d)=>j(l,d),undo:()=>Ne(),redo:()=>ze(),canUndo:()=>at.canUndo(),canRedo:()=>at.canRedo(),applySettings:l=>{l.autoBalanceOnChange!==void 0&&(Q.autoBalanceOnChange=l.autoBalanceOnChange),l.lineWidthStart!==void 0&&(Q.lineWidthStart=Math.max(.5,Math.min(20,l.lineWidthStart))),l.lineWidthEnd!==void 0&&(Q.lineWidthEnd=Math.max(.3,Math.min(10,l.lineWidthEnd))),l.rainbowBranch!==void 0&&(Q.rainbowBranch=l.rainbowBranch),l.branchPaletteId!==void 0&&(Q.branchPaletteId=l.branchPaletteId),l.customPalettes!==void 0&&(Q.customPalettes=l.customPalettes),l.lineStyle!==void 0&&(Q.lineStyle=l.lineStyle),l.taperedEdge!==void 0&&(Q.taperedEdge=l.taperedEdge),l.showOrderBadge!==void 0&&(Q.showOrderBadge=l.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:Q.autoBalanceOnChange,lineWidthStart:Q.lineWidthStart,lineWidthEnd:Q.lineWidthEnd,rainbowBranch:Q.rainbowBranch,branchPaletteId:Q.branchPaletteId,customPalettes:Q.customPalettes,lineStyle:Q.lineStyle,layoutMode:Q.layoutMode,taperedEdge:Q.taperedEdge,showOrderBadge:Q.showOrderBadge}),setBranchPalette:l=>{if(!l)return;[...Nt,...Q.customPalettes].find(E=>E.id===l)&&(Q.branchPaletteId=l)},getBranchPalette:()=>Q.branchPaletteId,getBranchPalettes:()=>[...Nt,...Q.customPalettes]}),e.watch(()=>i.data,l=>{b.value=pt(l),we()},{deep:!1}),e.onMounted(()=>{Ve(),e.nextTick(()=>Ct())}),(l,d)=>{var E,V,I,P,q,re,Se;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Ie.value.bgColor,fontSize:Ie.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:a,class:"zm-canvas",onMousedown:Pm,onContextmenu:B,onWheel:d[27]||(d[27]=(...R)=>e.unref(ne).onWheel&&e.unref(ne).onWheel(...R)),onMouseenter:d[28]||(d[28]=R=>p.value=!0),onMouseleave:d[29]||(d[29]=R=>p.value=!1),onClick:Fm},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:$e.value.vbX*e.unref(ne).scale.value+e.unref(ne).offsetX.value+"px",top:$e.value.vbY*e.unref(ne).scale.value+e.unref(ne).offsetY.value+"px",width:$e.value.vbW*e.unref(ne).scale.value+"px",height:$e.value.vbH*e.unref(ne).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:mn.value,preserveAspectRatio:"xMinYMin meet",width:$e.value.vbW*e.unref(ne).scale.value,height:$e.value.vbH*e.unref(ne).scale.value},[e.createElementVNode("g",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.value,R=>(e.openBlock(),e.createElementBlock("path",{key:R.key,d:Zo(Ur(R.from,"out",R.to.side,R.to),Ur(R.to,"in"),sn(R.from.depth),cn(R.to.depth),32,Q.lineStyle,R.to._dir),fill:Bt(R.from,R.to),stroke:"none"},null,8,Ka))),128))])],8,Ga))],4),e.unref(ne).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(ne).marquee.x*e.unref(ne).scale.value+e.unref(ne).offsetX.value+"px",top:e.unref(ne).marquee.y*e.unref(ne).scale.value+e.unref(ne).offsetY.value+"px",width:e.unref(ne).marquee.width*e.unref(ne).scale.value+"px",height:e.unref(ne).marquee.height*e.unref(ne).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(ne).offsetX.value}px, ${e.unref(ne).offsetY.value}px) scale(${e.unref(ne).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un.value,R=>(e.openBlock(),e.createElementBlock("div",{key:R.id,class:e.normalizeClass(["zm-node",{"is-root":R.isRoot,"is-selected":s.value===R.id,"is-editing":c.value===R.id,"has-image":!!R.image,"is-resizing":yt.value===R.id}]),"data-node-id":R.id,style:e.normalizeStyle({left:R.x+"px",top:R.y+"px",width:R.width+"px",minWidth:R.width+"px",height:R.height+"px",fontSize:R.fontSize+"px",background:Jo(R),color:Qn(R),borderColor:Tn(R),fontWeight:eo(R),transform:"translate(-50%, -50%)"}),onClick:fe=>$m(fe,R),onDblclick:fe=>{fe.stopPropagation(),t.previewMode||xt(R.id)},onContextmenu:fe=>Le(fe,R),onMouseenter:fe=>{He(R.id),Pt(fe,R)},onMouseleave:fe=>et(R.id)},[R.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:R.image.src,width:R.image.width,height:R.image.height,alt:R.text,draggable:"false"},null,8,Ya)):e.createCommentVNode("",!0),R.richContent&&(R.richContent.kind==="code"||R.richContent.kind==="table")&&c.value!==R.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":R.richContent.kind==="table"||R.richContent.kind==="code"}]),onClick:d[1]||(d[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(fe=>io(R.id),["stop"]),onMousedown:d[2]||(d[2]=e.withModifiers(()=>{},["stop"]))},[y.value===R.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":d[0]||(d[0]=fe=>w.value=fe),class:"zm-rich-edit",spellcheck:"false",onBlur:ro,onKeydown:ao},null,544)),[[e.vModelText,w.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[R.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",Xa,[e.createElementVNode("code",{innerHTML:e.unref(To)(e.unref(So)(R.richContent.raw),e.unref(qt)(R.richContent.raw))},null,8,Ja)])):R.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",Qa,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt(R.id,e.unref(nr)(R.richContent.raw)),(fe,it)=>(e.openBlock(),e.createElementBlock("tr",{key:it},[it===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(fe,(st,Ke)=>{var Mn,Rn,Bn,zn,wt;return e.openBlock(),e.createElementBlock("th",{key:`h${Ke}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((Mn=k.value.get(R.id))==null?void 0:Mn.col)===Ke,"is-asc":((Rn=k.value.get(R.id))==null?void 0:Rn.col)===Ke&&((Bn=k.value.get(R.id))==null?void 0:Bn.dir)==="asc","is-desc":((zn=k.value.get(R.id))==null?void 0:zn.col)===Ke&&((wt=k.value.get(R.id))==null?void 0:wt.dir)==="desc"}]),onClick:e.withModifiers(Gr=>fn(R.id,Ke),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(st),1),e.createElementVNode("span",ts,e.toDisplayString(J(R.id,Ke)),1)],10,es)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(fe,(st,Ke)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ke}`},e.toDisplayString(st),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,Za)):e.createCommentVNode("",!0),c.value!==R.id?(e.openBlock(),e.createElementBlock("span",ns,[e.createElementVNode("span",os,e.toDisplayString(R.text),1),R.link&&!c.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-node-link",href:R.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${R.link.url}`,onClick:d[3]||(d[3]=e.withModifiers(()=>{},["stop"])),onMousedown:d[4]||(d[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"link",size:11,stroke:2})],40,is)):e.createCommentVNode("",!0),R.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:kt(R.note.text),onClick:e.withModifiers(fe=>ye(R.id),["stop"]),onMousedown:d[5]||(d[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(xe,{name:"note",size:11,stroke:2})],40,rs)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":d[6]||(d[6]=fe=>u.value=fe),autofocus:"",onBlur:d[7]||(d[7]=fe=>tt()),onKeydown:[d[8]||(d[8]=e.withKeys(e.withModifiers(fe=>tt({addSibling:"after"}),["exact"]),["enter"])),d[9]||(d[9]=e.withKeys(e.withModifiers(fe=>tt({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),d[10]||(d[10]=e.withKeys(e.withModifiers(fe=>tt({addChild:!0}),["prevent"]),["tab"])),e.withKeys(oo,["esc"]),f],onMousedown:d[11]||(d[11]=e.withModifiers(()=>{},["stop"])),onClick:d[12]||(d[12]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),A.value?(e.openBlock(),e.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${Fr(R.id)+1} 个`},e.toDisplayString(Fr(R.id)+1),9,ls)):e.createCommentVNode("",!0),Pr(R.id)&&Qo(R.id)>0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":R.side===-1}]),style:e.normalizeStyle({background:Ce.value.get(R.id)??"#64748b"}),title:`展开 ${Qo(R.id)} 个子节点`,onMousedown:d[13]||(d[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(fe=>pn(R.id),["stop"])},e.toDisplayString(Qo(R.id)),47,as)):e.createCommentVNode("",!0),Hm(R)&&!Pr(R.id)?(e.openBlock(),e.createElementBlock("button",{key:6,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":R.side===-1}]),style:e.normalizeStyle({color:Ce.value.get(R.id)??"#64748b",borderColor:Ce.value.get(R.id)??"#64748b"}),title:"折叠",onMousedown:d[14]||(d[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(fe=>pn(R.id),["stop"])},[e.createVNode(xe,{name:"minus",size:10,stroke:2.4})],46,ss)):e.createCommentVNode("",!0),R.image&&s.value===R.id&&c.value!==R.id?(e.openBlock(),e.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(fe=>U(fe,R),["stop"])},null,40,cs)):e.createCommentVNode("",!0),R.image&&s.value===R.id&&c.value!==R.id?(e.openBlock(),e.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:d[15]||(d[15]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(fe=>K(R.id),["stop"])},[e.createVNode(xe,{name:"x",size:9,stroke:2.2})],40,ds)):e.createCommentVNode("",!0)],46,qa))),128))],4),g.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-tooltip",{"is-below":!g.value.above}]),style:e.normalizeStyle({left:g.value.x+"px",top:g.value.y+"px"})},e.toDisplayString(g.value.text),7)):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createBlock(zl,{key:2,x:X.value.x,y:X.value.y,container:a.value,"has-image":!!((E=e.unref(pe)(b.value,X.value.nodeId))!=null&&E.image),"has-link":!!((V=e.unref(pe)(b.value,X.value.nodeId))!=null&&V.link),"has-note":!!((I=e.unref(pe)(b.value,X.value.nodeId))!=null&&I.note),"has-code":((q=(P=e.unref(pe)(b.value,X.value.nodeId))==null?void 0:P.richContent)==null?void 0:q.kind)==="code","has-table":((Se=(re=e.unref(pe)(b.value,X.value.nodeId))==null?void 0:re.richContent)==null?void 0:Se.kind)==="table",onPickImage:ue,onRemoveImage:on,onSetLink:me,onRemoveLink:De,onEditNote:Ze,onRemoveNote:Ge,onAddCode:St,onEditCode:St,onRemoveCode:ee,onAddTable:mt,onEditTable:mt,onRemoveTable:Me,onClose:v},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):e.createCommentVNode("",!0),ge.value?(e.openBlock(),e.createBlock(Ol,{key:3,x:ge.value.x,y:ge.value.y,container:a.value,onOpenSettings:ae,onOpenData:D,onOpenImport:T,onClose:ie},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(Be.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:d[16]||(d[16]=R=>r("canvas-toggle-preview"))},[e.createVNode(xe,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,us),e.createElementVNode("button",{class:e.normalizeClass(Ue.value),title:"显示大纲视图",onClick:d[17]||(d[17]=R=>r("canvas-outline"))},[e.createVNode(xe,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":p.value}])},[e.createElementVNode("span",ms,e.toDisplayString(Math.round(e.unref(ne).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:d[18]||(d[18]=(...R)=>e.unref(ne).zoomIn&&e.unref(ne).zoomIn(...R))},[e.createVNode(xe,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:d[19]||(d[19]=(...R)=>e.unref(ne).zoomOut&&e.unref(ne).zoomOut(...R))},[e.createVNode(xe,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Ct},[e.createVNode(xe,{name:"reset"})]),d[33]||(d[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:so},[e.createVNode(xe,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:d[20]||(d[20]=R=>An(1))},[e.createVNode(xe,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:d[21]||(d[21]=R=>An(2))},[e.createVNode(xe,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:Lm},[e.createVNode(xe,{name:"expand-all"})]),d[34]||(d[34]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:jm},[e.createVNode(xe,{name:"export"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[d[30]||(d[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:d[22]||(d[22]=R=>s.value&&z(s.value))},[e.createElementVNode("img",{src:e.unref(ri),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,fs)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:d[23]||(d[23]=R=>s.value&&H(s.value))},[e.createElementVNode("img",{src:e.unref(ii),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,ps)]),d[31]||(d[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:d[24]||(d[24]=R=>ei("mindmap"))},[e.createVNode(xe,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:d[25]||(d[25]=R=>ei("tree"))},[e.createVNode(xe,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:Q.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:d[26]||(d[26]=R=>ei("org"))},[e.createVNode(xe,{name:"org"})],2),d[32]||(d[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:Gm},[e.createVNode(xe,{name:"import"})])],64))],2)],544)],4)}}}),gs={class:"zm-outline-root"},hs={class:"zm-outline-actions"},bs={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ks={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},ys={key:1,d:"M5 12 L10 17 L19 7"},Es={class:"zm-outline"},xs=["onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],ws=["title","onClick"],Ns={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ss={key:0,points:"6 9 12 15 18 9"},Ts={key:1,points:"9 6 15 12 9 18"},Cs={key:1,class:"zm-outline-dot"},_s={class:"zm-outline-index"},As={key:3,class:"zm-outline-text"},Ms=["onClick"],Rs=["src"],Bs=["onClick"],zs=["src"],Os=["title","onClick"],Is={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},vs={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ls={key:1,d:"M5 12 L10 17 L19 7"},Co=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{const G=[],Y=(F,N,$)=>{const L=F.children.length>0,j=n.collapsedIds.has(F.id);G.push({id:F.id,text:F.text||"(无标题)",depth:N,siblingIndex:$,hasChildren:L,collapsed:j,node:F}),L&&!j&&F.children.forEach((X,ge)=>Y(X,N+1,ge))};return Y(n.data,0,0),G}),a=e.ref(null),c=e.ref("");let u=null;function s(G){n.readonly||(a.value=G.id,c.value=G.text,e.nextTick(()=>{u=document.querySelector(".zm-outline-input"),u==null||u.focus(),u==null||u.select()}))}function m(){a.value!=null&&(i("edit",{id:a.value,text:c.value.trim()||"(无标题)"}),p())}function p(){a.value=null,c.value="",u=null}function g(G){G.key==="Enter"?(G.preventDefault(),m()):G.key==="Escape"&&(G.preventDefault(),p())}e.onBeforeUnmount(p);const y=e.ref(null),w=e.ref(null),k=e.ref(null);function b(G,Y){if(n.readonly){G.preventDefault();return}y.value={id:Y.id,text:Y.text},G.dataTransfer&&(G.dataTransfer.effectAllowed="move",G.dataTransfer.setData("text/plain",Y.id))}function _(){y.value=null,w.value=null,k.value=null}function x(G,Y){if(!y.value)return;G.preventDefault(),G.dataTransfer&&(G.dataTransfer.dropEffect="move");const F=A(G);w.value=Y.id,k.value=F}function M(G){w.value===G.id&&(w.value=null,k.value=null)}function S(G,Y){G.preventDefault();const F=y.value;if(!F)return;const N=A(G);F.id!==Y.id&&i("move",{srcId:F.id,targetId:Y.id,position:N}),_()}function A(G,Y){const N=G.currentTarget.getBoundingClientRect(),$=G.clientY-N.top,L=N.height;return $<L*.3?"before":$>L*.7?"after":"child"}const C=e.ref(null);let h=null;async function O(G){try{return await navigator.clipboard.writeText(G),!0}catch{const Y=document.createElement("textarea");Y.value=G,document.body.appendChild(Y),Y.select();let F=!1;try{F=document.execCommand("copy")}finally{document.body.removeChild(Y)}return F}}async function W(G,Y,F){G.stopPropagation(),await O(Y)&&(C.value=F,h&&clearTimeout(h),h=setTimeout(()=>C.value=null,1200))}const oe=e.computed(()=>{const G=[],Y=(F,N)=>{const $=" ".repeat(N),L=N===0?"":"- ";G.push($+L+(F.text||""));for(const j of F.children)Y(j,N+1)};return Y(n.data,0),G.join(`
|
|
23
|
-
`)}),K=e.ref(!1);let te=null;async function le(){await O(oe.value)&&(K.value=!0,te&&clearTimeout(te),te=setTimeout(()=>K.value=!1,1200))}return(G,Y)=>(e.openBlock(),e.createElementBlock("div",gs,[e.createElementVNode("div",hs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":K.value}]),title:"复制完整大纲为纯文本",onClick:le},[(e.openBlock(),e.createElementBlock("svg",bs,[K.value?(e.openBlock(),e.createElementBlock("path",ys)):(e.openBlock(),e.createElementBlock("rect",ks)),Y[2]||(Y[2]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(K.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,F=>(e.openBlock(),e.createElementBlock("li",{key:F.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":F.id===t.selectedId,"is-root":F.depth===0,"is-editing":a.value===F.id,"is-drag-over-before":w.value===F.id&&k.value==="before","is-drag-over-after":w.value===F.id&&k.value==="after","is-drag-over-child":w.value===F.id&&k.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+F.depth*16+"px"}),draggable:"true",onClick:N=>i("select",F.node),onDblclick:N=>s(F),onDragstart:N=>b(N,F),onDragend:_,onDragover:N=>x(N,F),onDragleave:()=>M(F),onDrop:N=>S(N,F)},[F.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:F.collapsed?"展开":"折叠",onClick:e.withModifiers(N=>i("toggleCollapse",F.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",Ns,[F.collapsed?(e.openBlock(),e.createElementBlock("polyline",Ts)):(e.openBlock(),e.createElementBlock("polyline",Ss))]))],8,ws)):(e.openBlock(),e.createElementBlock("span",Cs)),e.createElementVNode("span",_s,e.toDisplayString(F.siblingIndex+1)+".",1),a.value===F.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":Y[0]||(Y[0]=N=>c.value=N),class:"zm-outline-input",onBlur:m,onKeydown:g,onClick:Y[1]||(Y[1]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,c.value]]):(e.openBlock(),e.createElementBlock("span",As,e.toDisplayString(F.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(N=>i("addSibling",F.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ii),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Rs)],8,Ms)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(N=>i("addChild",F.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ri),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,zs)],8,Bs)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":C.value===F.id}]),title:C.value===F.id?"已复制":"复制节点文本",onClick:N=>W(N,F.text,F.id)},[(e.openBlock(),e.createElementBlock("svg",Is,[C.value!==F.id?(e.openBlock(),e.createElementBlock("rect",vs)):(e.openBlock(),e.createElementBlock("path",Ls)),Y[3]||(Y[3]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Os)],46,xs))),128))])]))}}),Ds=["aria-hidden"],Vs={key:0,class:"zm-drawer-header"},$s={key:0,class:"zm-drawer-title"},Ps={class:"zm-drawer-body"},Zt=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""}},emits:["update:open"],setup(t,{emit:o}){const n=o;function i(){n("update:open",!1)}return(r,a)=>(e.openBlock(),e.createBlock(e.Transition,{name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||r.$slots.header?(e.openBlock(),e.createElementBlock("div",Vs,[t.title?(e.openBlock(),e.createElementBlock("h3",$s,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"header"),e.createElementVNode("button",{class:"zm-drawer-close",title:"关闭",onClick:i},[...a[0]||(a[0]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ps,[e.renderSlot(r.$slots,"default")])],14,Ds)):e.createCommentVNode("",!0)]),_:3}))}}),Fs={key:0,class:"zm-jtv-root"},Us={key:0,class:"zm-jtv-key"},Hs={key:1,class:"zm-jtv-colon"},Ws={key:2,class:"zm-jtv-key zm-jtv-bracket"},Gs={key:3,class:"zm-jtv-size"},js={key:4,class:"zm-jtv-bracket"},Ks={key:5,class:"zm-jtv-brace"},qs={key:0,class:"zm-jtv-children"},Ys={class:"zm-jtv-key"},Zs={key:0,class:"zm-jtv-key"},Xs=["src","alt"],Js=["href"],Qs=e.defineComponent({__name:"JsonTreeViewer",props:{value:{},keyName:{default:""},isRoot:{type:Boolean,default:!0},path:{default:""},depth:{default:0},query:{default:""},collapsedPaths:{default:()=>new Set}},setup(t){const o=t,n=e.computed(()=>o.value===null?"null":Array.isArray(o.value)?"array":typeof o.value),i=e.computed(()=>n.value==="object"),r=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!r.value);const a=e.computed(()=>{if(r.value)return`Array(${o.value.length})`;if(i.value){const M=o.value,S=Object.keys(M);return`Object(${S.length} ${S.length===1?"key":"keys"})`}return""}),c=e.computed(()=>r.value?o.value.map((M,S)=>({key:String(S),value:M})):i.value?Object.entries(o.value).map(([M,S])=>({key:M,value:S})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),s=e.computed(()=>o.collapsedPaths.has(u.value));function m(M,S,A){M!=="<root>"&&(A<2||S===null||typeof S!="object"||o.collapsedPaths.has(M)||o.collapsedPaths.add(M))}o.isRoot||m(u.value,o.value,o.depth);function p(){s.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function g(M){return u.value===""?M:`${u.value}.${M}`}function y(M){if(!o.query)return!0;const S=o.query.toLowerCase();return typeof M=="string"?M.toLowerCase().includes(S):M===null?"null".includes(S):String(M).toLowerCase().includes(S)}function w(M){return o.query?M.toLowerCase().includes(o.query.toLowerCase()):!0}function k(M,S){return!o.query||w(M)?!0:S===null||typeof S!="object"?y(S):!0}function b(M){return M===null?"null":typeof M=="string"?M.length>80?`"${M.slice(0,80)}..."`:`"${M}"`:typeof M=="boolean"?M?"true":"false":typeof M=="number"?String(M):typeof M>"u"?"undefined":JSON.stringify(M)}function _(M){if(typeof M!="string")return!1;const S=M.trim();return!!(S.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(S)||/^https?:\/\/.+/i.test(S)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(S))}function x(M){if(!o.query)return null;const S=M.toLowerCase().indexOf(o.query.toLowerCase());return S<0?null:{before:M.slice(0,S),match:M.slice(S,S+o.query.length),after:M.slice(S+o.query.length)}}return(M,S)=>{var C,h,O,W,oe,K;const A=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Fs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,te=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:te.key,class:"zm-jtv-row"},[e.createVNode(A,{"key-name":te.key,value:te.value,path:g(te.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,k(te.key,te.value)]])),128))])):i.value||r.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":s.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:p},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(s.value?"▶":"▼"),1),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Us,e.toDisplayString(t.keyName),1)),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Hs,":")),r.value?(e.openBlock(),e.createElementBlock("span",Ws,"[")):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("span",Gs,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0),s.value&&r.value?(e.openBlock(),e.createElementBlock("span",js,"]")):e.createCommentVNode("",!0),s.value&&i.value?(e.openBlock(),e.createElementBlock("span",Ks,"}")):e.createCommentVNode("",!0)],4),s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,te=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:te.key,class:"zm-jtv-row"},[e.createVNode(A,{"key-name":te.key,value:te.value,path:g(te.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,k(te.key,te.value)]])),128))])),!s.value&&r.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!s.value&&i.value&&!r.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[S[2]||(S[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",Ys,e.toDisplayString(t.keyName),1),S[3]||(S[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),w(t.keyName)&&x(t.keyName)?(e.openBlock(),e.createElementBlock("span",Zs,[e.createElementVNode("span",null,e.toDisplayString((C=x(t.keyName))==null?void 0:C.before),1),e.createElementVNode("mark",null,e.toDisplayString((h=x(t.keyName))==null?void 0:h.match),1),e.createElementVNode("span",null,e.toDisplayString((O=x(t.keyName))==null?void 0:O.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[x(b(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((W=x(b(t.value)))==null?void 0:W.before),1),e.createElementVNode("mark",null,e.toDisplayString((oe=x(b(t.value)))==null?void 0:oe.match),1),e.createElementVNode("span",null,e.toDisplayString((K=x(b(t.value)))==null?void 0:K.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(b(t.value)),1)],64))],2),_(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:S[1]||(S[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("img",{class:"zm-jtv-thumb",src:String(t.value),alt:t.keyName,loading:"lazy",referrerpolicy:"no-referrer"},null,8,Xs),e.createElementVNode("a",{class:"zm-jtv-thumb-link",href:String(t.value),target:"_blank",rel:"noopener noreferrer",onClick:S[0]||(S[0]=e.withModifiers(()=>{},["stop"]))},"open",8,Js)])):e.createCommentVNode("",!0)],4))}}}),ec={class:"zm-data-panel"},tc={class:"zm-data-header"},nc={class:"zm-data-title"},oc={class:"zm-data-title-meta"},ic={class:"zm-data-toolbar"},rc=["title"],lc={key:0,width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ac={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"},sc={key:0,class:"zm-data-paste"},cc={class:"zm-data-tabs"},dc=["placeholder"],uc={key:0,class:"zm-data-error"},mc={class:"zm-data-paste-actions"},fc=["disabled"],pc={class:"zm-data-tree"},_o=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>JSON.stringify(n.data,null,2)),a=e.ref(""),c=e.ref(null),u=e.ref(!1),s=e.ref("json"),m=e.ref("idle"),p=e.ref(new Set),g=e.ref("");e.watch(()=>n.pendingMode,S=>{S&&(u.value=!0,s.value=S,i("consumed-mode"))},{immediate:!0});async function y(){try{await navigator.clipboard.writeText(r.value),m.value="copied",setTimeout(()=>m.value="idle",1500)}catch{const S=document.createElement("textarea");S.value=r.value,document.body.appendChild(S),S.select();try{document.execCommand("copy"),m.value="copied",setTimeout(()=>m.value="idle",1500)}finally{document.body.removeChild(S)}}}function w(){const S=new Blob([r.value],{type:"application/json"}),A=URL.createObjectURL(S),C=document.createElement("a");C.href=A,C.download=`${n.data.text||"mindmap"}.json`,C.click(),URL.revokeObjectURL(A)}function k(){c.value=null;const S=a.value.trim();if(S){if(s.value==="markdown"||s.value==="txt"){try{const A=Ht(S);i("import",A),a.value="",u.value=!1}catch(A){c.value=(s.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+A.message}return}try{const A=JSON.parse(S);if(!A.id||!Array.isArray(A.children)){c.value="JSON 缺少 id 或 children 字段";return}i("import",A),a.value="",u.value=!1}catch(A){c.value="JSON 解析失败:"+A.message}}}function b(S){return 1+S.children.reduce((A,C)=>A+b(C),0)}const _=e.computed(()=>b(n.data)),x=e.computed(()=>r.value.length);function M(){const S=document.createElement("input");S.type="file",S.accept="application/json",S.onchange=()=>{var h;const A=(h=S.files)==null?void 0:h[0];if(!A)return;const C=new FileReader;C.onload=()=>{typeof C.result=="string"&&(a.value=C.result,k())},C.readAsText(A)},S.click()}return(S,A)=>(e.openBlock(),e.createElementBlock("div",ec,[e.createElementVNode("div",tc,[e.createElementVNode("div",nc,[A[8]||(A[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",oc,e.toDisplayString(_.value)+" 节点 · "+e.toDisplayString(x.value)+" chars",1)])]),e.createElementVNode("div",ic,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":m.value==="copied"}]),title:m.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:y},[m.value==="idle"?(e.openBlock(),e.createElementBlock("svg",lc,[...A[9]||(A[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",ac,[...A[10]||(A[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),A[11]||(A[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,rc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:w},[...A[12]||(A[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:M},[...A[13]||(A[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:A[0]||(A[0]=C=>u.value=!u.value)},[...A[14]||(A[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),A[16]||(A[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":g.value.length>0}])},[A[15]||(A[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":A[1]||(A[1]=C=>g.value=C),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,g.value]]),g.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:A[2]||(A[2]=C=>g.value="")},"×")):e.createCommentVNode("",!0)],2)]),u.value?(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("div",cc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":s.value==="json"}]),onClick:A[3]||(A[3]=C=>s.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":s.value==="markdown"}]),onClick:A[4]||(A[4]=C=>s.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":A[5]||(A[5]=C=>a.value=C),placeholder:s.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,dc),[[e.vModelText,a.value]]),c.value?(e.openBlock(),e.createElementBlock("div",uc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",mc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!a.value,onClick:k},"应用",8,fc),e.createElementVNode("button",{class:"zm-data-btn",onClick:A[6]||(A[6]=C=>{a.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:A[7]||(A[7]=C=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",pc,[e.createVNode(Qs,{value:t.data,query:g.value,"collapsed-paths":p.value},null,8,["value","query","collapsed-paths"])]),A[17]||(A[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),gc={class:"zm-md-panel"},hc={key:0,class:"zm-md-error"},bc={class:"zm-md-split"},kc={class:"zm-md-edit"},yc={class:"zm-md-preview"},Ec={class:"zm-md-preview-body"},xc={class:"zm-md-footer"},wc=["disabled"],Nc=`# flow-mindmap 思维导图
|
|
22
|
+
| a | b | c |`);if(B===null)return;const $=B.trim();if(!$){Ne(l,null);return}Ne(l,{kind:"table",raw:$})}function qe(){var s;const l=(s=ue.value)==null?void 0:s.nodeId;l&&Ne(l,null)}function ut(l){i.previewMode||r("edit-note",l)}function wt(l,s=60){const k=l.replace(/\s+/g," ").trim();return k.length<=s?k||"点击编辑笔记":k.slice(0,s)+"…"}function U(l){var B;if(i.previewMode||c.value)return;const s=l.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"||s.isContentEditable))return;const k=d.value;if(!k)return;const L=(B=l.clipboardData)==null?void 0:B.items;if(L)for(let $=0;$<L.length;$++){const j=L[$];if(j.kind==="file"&&j.type.startsWith("image/")){const oe=j.getAsFile();if(!oe)continue;l.preventDefault();const Ce=me(g.value,k);if(Ce!=null&&Ce.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;N(oe,M=>se(k,M));return}}}e.onMounted(()=>{window.addEventListener("paste",U),ke()}),e.onBeforeUnmount(()=>{window.removeEventListener("paste",U)});const K=e.ref(null),ae=e.computed(()=>{var l;return((l=K.value)==null?void 0:l.nodeId)??null});function he(l,s){if(!s.image)return;l.preventDefault(),l.stopPropagation();const k=s.image.naturalW||s.image.width,L=s.image.naturalH||s.image.height,B=L>0?L/k:1;K.value={nodeId:s.id,startX:l.clientX,startY:l.clientY,startW:s.image.width,startH:s.image.height,naturalW:k,naturalH:L,ratio:B,pendingW:s.image.width,pendingH:s.image.height},window.addEventListener("mousemove",Ie),window.addEventListener("mouseup",Fe)}function Ie(l){var Ce,M;const s=K.value;if(!s)return;const k=te.scale.value||1,L=l.clientX-s.startX,B=P(s.startW+L/k,Ut,rn),$=P(B*s.ratio,Ut,rn);s.pendingW=B,s.pendingH=$;const j=(Ce=a.value)==null?void 0:Ce.querySelector(`[data-node-id="${s.nodeId}"] .zm-node-img`);j&&(j.style.width=`${B}px`,j.style.height=`${$}px`);const oe=(M=a.value)==null?void 0:M.querySelector(`[data-node-id="${s.nodeId}"]`);oe&&(oe.style.minWidth=`${Math.max(80,Math.ceil(B+28))}px`,oe.style.height=`${Math.ceil($+8+30)}px`)}function Fe(){const l=K.value;if(window.removeEventListener("mousemove",Ie),window.removeEventListener("mouseup",Fe),K.value=null,!l)return;const s=me(g.value,l.nodeId);!s||!s.image||(se(l.nodeId,{src:s.image.src,naturalW:s.image.naturalW,naturalH:s.image.naturalH,width:l.pendingW,height:l.pendingH}),d.value=l.nodeId,r("select",s),Ct=!0)}const Ye=e.ref(null);let Ct=!1;function no(l){Ye.value=l}function oo(l){Ye.value===l&&(Ye.value=null),y.value&&(y.value=null)}function Mn(l,s){var pt;if(!s.text||s.text.length<14)return;const L=l.currentTarget.getBoundingClientRect(),B=(pt=a.value)==null?void 0:pt.getBoundingClientRect();if(!B)return;const $=10,j=240,oe=L.top-B.top>60,Ce=L.left-B.left+L.width/2,M=$+j/2,tt=B.width-j/2-$,nt=Math.max(M,Math.min(Ce,tt)),ge=oe?L.top-B.top-8:L.bottom-B.top+8;y.value={text:s.text,x:nt,y:ge,above:oe}}const pn=e.ref(0),It=e.ref(!1),ot=Ll(100);function Ae(){ot.record({data:g.value})}function ke(){m.value=new Set(m.value),pn.value++,e.nextTick().then(()=>e.nextTick()).then(()=>Rn()).then(()=>{pn.value++})}function Rn(){const l=document.querySelectorAll(".zm-rich"),s={},k={};l.forEach(L=>{let B=L,$=null;for(;B&&!$;)$=B.getAttribute("data-node-id"),B=B.parentElement;if(!$)return;const j=L.offsetHeight,oe=L.scrollWidth,Ce=Math.round(j*2)/2,M=Math.round(oe*2)/2;s[$]=Ce,k[$]=M,C.value[$],A.value[$]}),C.value=s,A.value=k}const Je=e.computed(()=>{var l,s,k,L,B,$,j,oe,Ce,M;return{rootBg:((l=i.theme)==null?void 0:l.rootBg)??"#1f2937",rootText:((s=i.theme)==null?void 0:s.rootText)??"#ffffff",branchBg:((k=i.theme)==null?void 0:k.branchBg)??"#ffffff",branchText:((L=i.theme)==null?void 0:L.branchText)??"#1f2937",lineColor:((B=i.theme)==null?void 0:B.lineColor)??"#94a3b8",bgColor:(($=i.theme)==null?void 0:$.bgColor)??"#f8fafc",fontSize:((j=i.theme)==null?void 0:j.fontSize)??14,lineWidthStart:((oe=i.theme)==null?void 0:oe.lineWidthStart)??2.2,lineWidthEnd:((Ce=i.theme)==null?void 0:Ce.lineWidthEnd)??.8,rainbowBranch:((M=i.theme)==null?void 0:M.rainbowBranch)??!1}}),ee=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function gn(l){return ee.taperedEdge?Jo(l):vt(l)}function hn(l){return ee.taperedEdge?ee.lineWidthEnd:vt(l)}function Jo(l){return l<=0?ee.lineWidthStart:l===1?Math.max(1.5,ee.lineWidthStart*.67):l===2?Math.max(.8,ee.lineWidthStart*.42):ee.lineWidthEnd}function vt(l){if(l<=0)return ee.lineWidthStart;if(l>=3)return ee.lineWidthEnd;const s=l/3;return ee.lineWidthStart+(ee.lineWidthEnd-ee.lineWidthStart)*s}function Qo(l,s,k,L){const B=1-l,$=B*B*B*s.x+3*B*B*l*k.x1+3*B*l*l*k.x2+l*l*l*L.x,j=B*B*B*s.y+3*B*B*l*k.y1+3*B*l*l*k.y2+l*l*l*L.y;return{x:$,y:j}}function ei(l,s,k,L,B=32,$="curve",j="right"){if($==="curve"){let St;if(j==="right"||j==="left"){const De=Math.abs(s.x-l.x)*.45,Mt=j==="right"?1:-1;St={x1:l.x+Mt*De,y1:l.y,x2:s.x-Mt*De,y2:s.y}}else{const De=Math.abs(s.y-l.y)*.45;St={x1:l.x,y1:l.y+De,x2:s.x,y2:s.y-De}}const uo=_e=>{const De=1-_e,Mt=-3*De*De*l.x+3*(De*De-2*De*_e)*St.x1+3*(2*De*_e-_e*_e)*St.x2+3*_e*_e*s.x,En=-3*De*De*l.y+3*(De*De-2*De*_e)*St.y1+3*(2*De*_e-_e*_e)*St.y2+3*_e*_e*s.y;return{dx:Mt,dy:En}},$t=[],mo=[];for(let _e=0;_e<=B;_e++){const De=_e/B,Mt=_e===0?l:_e===B?s:Qo(De,l,St,s),En=uo(De);let po=Math.hypot(En.dx,En.dy);po<1e-6&&(po=1);const Zr=-En.dy/po,Jr=En.dx/po,go=(k+(L-k)*De)/2;$t.push({x:Mt.x+Zr*go,y:Mt.y+Jr*go}),mo.push({x:Mt.x-Zr*go,y:Mt.y-Jr*go})}let fo=`M ${$t[0].x.toFixed(2)} ${$t[0].y.toFixed(2)}`;for(let _e=1;_e<=B;_e++)fo+=` L ${$t[_e].x.toFixed(2)} ${$t[_e].y.toFixed(2)}`;for(let _e=B;_e>=0;_e--)fo+=` L ${mo[_e].x.toFixed(2)} ${mo[_e].y.toFixed(2)}`;return fo+=" Z",fo}const oe=s.x-l.x,Ce=s.y-l.y;let M=Math.hypot(oe,Ce);M<1e-6&&(M=1);const tt=-Ce/M,nt=oe/M,ge=k/2,pt=L/2,yn={x:l.x+tt*ge,y:l.y+nt*ge},gt={x:l.x-tt*ge,y:l.y-nt*ge},Ln={x:s.x-tt*pt,y:s.y-nt*pt},Dn={x:s.x+tt*pt,y:s.y+nt*pt};return`M ${yn.x.toFixed(2)} ${yn.y.toFixed(2)} L ${Dn.x.toFixed(2)} ${Dn.y.toFixed(2)} L ${Ln.x.toFixed(2)} ${Ln.y.toFixed(2)} L ${gt.x.toFixed(2)} ${gt.y.toFixed(2)} Z`}const Oe=e.computed(()=>We.value.root.children),Lt=Tt[0].colors,io=e.computed(()=>xl(ee.branchPaletteId,ee.customPalettes)),Nt=e.computed(()=>{const l=new Map;if(!ee.rainbowBranch)return l;const s=i.lineColors,k=s&&s.length>0?s:io.value.colors.length>0?io.value.colors:Lt;for(let B=0;B<Oe.value.length;B++){const $=Oe.value[B];l.set($.id,k[B%k.length])}const L=(B,$)=>{l.set(B.id,$);for(const j of B.children)L(j,$)};for(let B=0;B<Oe.value.length;B++){const $=Oe.value[B];L($,k[B%k.length])}return l});function Bn(l,s){return ee.rainbowBranch?Nt.value.get(s.id)??Je.value.lineColor:Je.value.lineColor}function ro(l){const s=J(l.id);if(s.bg)return s.bg;if(l.isRoot)return Je.value.rootBg;if(ee.rainbowBranch){const k=Nt.value.get(l.id);if(k)return _t(k,.18)}return Je.value.branchBg}function lo(l){const s=J(l.id);if(s.textColor)return s.textColor;if(l.isRoot)return Je.value.rootText;if(ee.rainbowBranch){const k=Nt.value.get(l.id);if(k)return zn(k,.55)}return Je.value.branchText}function ti(l){const s=J(l.id);if(s.borderColor)return s.borderColor;if(l.isRoot)return Je.value.rootBg;if(ee.rainbowBranch){const k=Nt.value.get(l.id);if(k)return zn(k,.3)}return Je.value.lineColor}function it(l){return J(l.id).fontWeight??(l.isRoot?600:400)}function _t(l,s){const k=l.replace("#",""),L=k.length===6?k:k.split("").map(oe=>oe+oe).join(""),B=parseInt(L.slice(0,2),16),$=parseInt(L.slice(2,4),16),j=parseInt(L.slice(4,6),16);return`rgba(${B}, ${$}, ${j}, ${s})`}function zn(l,s){const k=l.replace("#",""),L=k.length===6?k:k.split("").map(oe=>oe+oe).join(""),B=Math.round(parseInt(L.slice(0,2),16)*(1-s)),$=Math.round(parseInt(L.slice(2,4),16)*(1-s)),j=Math.round(parseInt(L.slice(4,6),16)*(1-s));return`rgb(${B}, ${$}, ${j})`}const te=Ol({getContainer:()=>a.value});te.setOnMarqueeEnd(ef),vl({isEditing:()=>c.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>d.value,getRootId:()=>g.value.id,defaultTargetId:()=>g.value.id,onAddChild:re,onAddSibling:Te,onAddSiblingBefore:Le,onRemove:In,onStartEdit:Dt,onClearSelection:()=>{d.value=null,r("select",null)},onDuplicate:Qe,onUndo:et,onRedo:Yt,onNavigate:Pe,onSelectRoot:()=>{d.value=g.value.id;const l=me(g.value,g.value.id);l&&r("select",l)}});const We=e.computed(()=>{const l=bt(g.value);return On(l),bl(l,{mode:ee.layoutMode,baseFontSize:Je.value.fontSize,richHeights:C.value,richWidths:A.value})}),Kt=e.ref([]),mt=e.computed(()=>(pn.value,Kt.value));e.watch(We,l=>{const s=[],k=L=>{s.push(L);for(const B of L.children)k(B)};k(l.root),Kt.value=s},{immediate:!0});const bn=e.computed(()=>{const l=[];for(const s of mt.value)for(const k of s.children)l.push({from:s,to:k,key:`${s.id}->${k.id}`});return l}),ft=e.computed(()=>`${We.value.vbX} ${We.value.vbY} ${We.value.vbW} ${We.value.vbH}`);function On(l){if(m.value.has(l.id)){l.children=[],l.collapsed=!0;return}l.collapsed=!1;for(const s of l.children)On(s)}function Dt(l){const s=me(g.value,l);s&&(c.value=l,u.value=s.text,e.nextTick(()=>{const k=document.querySelector(".zm-input");k==null||k.focus(),k==null||k.select()}))}function kn(l={}){if(!c.value)return;const s=me(g.value,c.value);s&&s.text!==(u.value.trim()||" ")&&(s.text=u.value.trim()||" ",Ae(),r("change",g.value));const k=c.value;c.value=null,l.addChild?e.nextTick(()=>re(k)):l.addSibling==="after"?e.nextTick(()=>Te(k)):l.addSibling==="before"&&e.nextTick(()=>Le(k))}function ao(){c.value=null}function so(l){if(i.previewMode)return;const s=me(g.value,l);s!=null&&s.richContent&&(v.value=l,_.value=s.richContent.raw,e.nextTick(()=>{const k=document.querySelector(".zm-node .zm-rich textarea");k==null||k.focus()}))}function qt(){if(!v.value)return;const l=v.value,s=me(g.value,l),k=_.value;if(s&&s.richContent&&s.richContent.raw!==k)if(s.richContent.kind==="code"){const L=on(k)||void 0;Ne(l,{kind:"code",raw:k,lang:L})}else Ne(l,{kind:"table",raw:k});v.value=null}function Vt(){v.value=null}function Z(l){l.key==="Escape"?(l.preventDefault(),Vt()):l.key==="Enter"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),qt())}function f(l,s){const k=x.value.get(l);!k||k.col!==s?x.value.set(l,{col:s,dir:"asc"}):k.dir==="asc"?x.value.set(l,{col:s,dir:"desc"}):x.value.delete(l)}function z(l,s){const k=x.value.get(l);return!k||s.length<=1?s:rr(s,k.col,k.dir)}function H(l,s){const k=x.value.get(l);return!k||k.col!==s?"↕":k.dir==="asc"?"▲":"▼"}function Ee(l){const s=l.metaKey||l.ctrlKey;s&&(l.key==="z"||l.key==="Z")&&!l.shiftKey?(l.preventDefault(),et()):(s&&l.shiftKey&&(l.key==="z"||l.key==="Z")||s&&(l.key==="y"||l.key==="Y")&&!l.shiftKey)&&(l.preventDefault(),Yt())}function re(l){const s=pi(g.value,l,Fn);s&&(Ae(),ke(),r("change",g.value),e.nextTick(()=>Dt(s.id)))}function Te(l){if(l===g.value.id){re(l);return}const s=gi(g.value,l,Fn);s&&(Ae(),ke(),r("change",g.value),e.nextTick(()=>Dt(s.id)))}function Le(l){if(l===g.value.id){re(l);return}const s=Al(g.value,l,Fn);s&&(Ae(),ke(),r("change",g.value),e.nextTick(()=>Dt(s.id)))}function Qe(l){if(l===g.value.id)return;const s=Ml(g.value,l);s&&(Ae(),d.value=s.id,r("change",g.value),ke())}function et(){const l=ot.undo();l&&(g.value=l.data,d.value=null,r("select",null),ke(),r("change",g.value))}function Yt(){const l=ot.redo();l&&(g.value=l.data,d.value=null,r("select",null),ke(),r("change",g.value))}function Pe(l,s){const k=d.value??g.value.id,L=me(g.value,k);if(!L)return;let B=null;if(s===1){const $=at(g.value,L.id);if($){const j=$.children.findIndex(oe=>oe.id===L.id);j>=0&&j<$.children.length-1&&(B=$.children[j+1].id)}}else if(s===-1){const $=at(g.value,L.id);if($){const j=$.children.findIndex(oe=>oe.id===L.id);j>0&&(B=$.children[j-1].id)}}else if(l===1){const $=at(g.value,L.id);$&&(B=$.id)}else l===-1&&L.children.length>0&&(B=L.children[0].id);if(B){d.value=B;const $=me(g.value,B);$&&r("select",$)}}function In(l){l!==g.value.id&&ko(g.value,l)&&(Ae(),d.value===l&&(d.value=null),ke(),r("change",g.value))}function vn(l){m.value.has(l)?m.value.delete(l):m.value.add(l),ke()}function Ur(l){const s=[{n:g.value,depth:1}];for(;s.length;){const{n:k,depth:L}=s.pop();l(k,L);for(let B=k.children.length-1;B>=0;B--)s.push({n:k.children[B],depth:L+1})}}function jm(){m.value=new Set,Ur(l=>{l.children.length>0&&m.value.add(l.id)}),ke()}function Hr(l){m.value=new Set,Ur((s,k)=>{k>l&&s.children.length>0&&m.value.add(s.id)}),ke()}function Km(){m.value=new Set,ke()}function qm(l,s){Cl(g.value,l,s)&&(Ae(),ke(),r("change",g.value))}function Wr(l,s,k){return _l(g.value,l,s,k)?(Ae(),ke(),r("change",g.value),!0):!1}function Ym(l,s){l.stopPropagation(),d.value=s.id;const k=me(g.value,s.id);r("select",k)}function Xm(l,s,k){let L=null;for(const B of mt.value){if(B.id===k)continue;const $=B.width/2,j=B.height/2;l>=B.x-$&&l<=B.x+$&&s>=B.y-j&&s<=B.y+j&&(L=B)}return L}function Zm(l,s){if(i.previewMode||s.isRoot||l.button!==0)return;const k=l.target;if(k!=null&&k.closest(".zm-img-resize-handle"))return;l.stopPropagation(),d.value=s.id;const L=a.value.getBoundingClientRect(),B=s.x*te.scale.value+te.offsetX.value,$=s.y*te.scale.value+te.offsetY.value,j=l.clientX-L.left-B,oe=l.clientY-L.top-$;b.value={srcId:s.id,srcText:s.text,pointerOffsetX:j,pointerOffsetY:oe,currentTargetId:null},E.value=l.clientX-L.left-j,w.value=l.clientY-L.top-oe,document.body.classList.add("is-dragging"),window.addEventListener("pointermove",Gr),window.addEventListener("pointerup",co),window.addEventListener("pointercancel",co)}function Gr(l){const s=b.value;if(!s)return;const k=a.value.getBoundingClientRect();E.value=l.clientX-k.left-s.pointerOffsetX,w.value=l.clientY-k.top-s.pointerOffsetY;const L=(l.clientX-k.left-te.offsetX.value)/te.scale.value,B=(l.clientY-k.top-te.offsetY.value)/te.scale.value,$=Xm(L,B,s.srcId);s.currentTargetId=($==null?void 0:$.id)??null}function co(l){const s=b.value;if(s){if(window.removeEventListener("pointermove",Gr),window.removeEventListener("pointerup",co),window.removeEventListener("pointercancel",co),s.currentTargetId){Wr(s.srcId,s.currentTargetId,"child");const k=me(g.value,s.srcId);k&&r("select",k)}b.value=null,E.value=0,w.value=0,document.body.classList.remove("is-dragging")}}function Jm(l){const s=l.target;if(!s||s.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(l.button===2){te.startPan(l);return}if(l.button!==0)return;const k=a.value.getBoundingClientRect(),L=(l.clientX-k.left-te.offsetX.value)/te.scale.value,B=(l.clientY-k.top-te.offsetY.value)/te.scale.value;te.startMarquee(L,B)}function Qm(l){if(Ct){Ct=!1;return}const s=l.target;if(!s||s.closest(".zm-node"))return;const k=te.marquee;k.width>=4||k.height>=4||d.value!==null&&(d.value=null,r("select",null))}function ef(){const l=te.marquee;if(l.width<4&&l.height<4)return;const s=l.x,k=l.y,L=l.x+l.width,B=l.y+l.height,$=[];for(const j of mt.value){const oe=j.width/2,Ce=j.height/2,M=j.x-oe,tt=j.x+oe,nt=j.y-Ce,ge=j.y+Ce;M<=L&&tt>=s&&nt<=B&&ge>=k&&$.push(j.id)}if($.length>0){d.value=$[0];const j=me(g.value,$[0]);j&&r("select",j)}}function jr(l){return m.value.has(l)}function tf(l){const s=me(g.value,l.id);return!!s&&s.children.length>0}function ni(l){const s=me(g.value,l);return s?s.children.length:0}function Kr(l){if(!me(g.value,l))return 0;const L=[g.value];for(;L.length;){const B=L.pop(),$=B.children.findIndex(j=>j.id===l);if($>=0)return $;for(const j of B.children)L.push(j)}return 0}function qr(l,s,k,L){if(((L==null?void 0:L._dir)??l._dir)==="down")return s==="out"?{x:l.x,y:l.y+l.height/2}:{x:l.x,y:l.y-l.height/2};let $;s==="in"?$=-l.side:k!==void 0?$=k:$=l.side;const j=s==="in"?l._richInsetX??0:0;return{x:l.x+$*(l.width/2-j),y:l.y}}function At(){const l=We.value;te.resetView(l.width,l.height,l.root.y)}function nf(){It.value=!0,Ae(),ke(),e.nextTick(()=>At())}function oi(l){ee.layoutMode!==l&&(ee.layoutMode=l,ke(),e.nextTick(()=>At()))}function Yr(){return JSON.stringify(g.value,null,2)}function of(l){const s=me(g.value,l);return s?!!(s.note&&s.note.text||s.link&&s.link.url||s.image&&s.image.src||s.richContent&&s.richContent.raw):!1}function Xr(l){try{const s=JSON.parse(l);return!s.id||!Array.isArray(s.children)?!1:(ot.reset(),g.value=bt(s),d.value=null,m.value=new Set,ke(),e.nextTick(()=>At()),r("change",g.value),!0)}catch{return!1}}function rf(){const l=document.createElement("input");l.type="file",l.accept="application/json",l.onchange=()=>{var L;const s=(L=l.files)==null?void 0:L[0];if(!s)return;const k=new FileReader;k.onload=()=>{typeof k.result=="string"&&(Xr(k.result)||alert("导入失败:JSON 格式无效"))},k.readAsText(s)},l.click()}function lf(){const l=new Blob([Yr()],{type:"application/json"}),s=URL.createObjectURL(l),k=document.createElement("a");k.href=s,k.download=`${g.value.text||"mindmap"}.json`,k.click(),URL.revokeObjectURL(s)}return o({addChild:l=>re(l),addSibling:l=>Te(l),removeNode:l=>In(l),duplicateNode:l=>Qe(l),setNodeText:(l,s)=>qm(l,s),moveNode:(l,s,k)=>Wr(l,s,k),lineWidthForDepth:gn,endWidthForDepth:hn,getData:()=>g.value,nodeHasContent:l=>of(l),setData:l=>{ot.reset(),g.value=bt(l),d.value=null,m.value=new Set,ke(),Ae(),e.nextTick(()=>At())},resetView:()=>At(),exportData:Yr,importData:Xr,getMarkdown:()=>Qt(g.value),setMarkdown:(l,s=!0)=>{const k=Jt(l||"");s&&(T.value=!0),h=!s,ot.reset(),g.value=bt(k),d.value=null,m.value=new Set,ke(),Ae(),e.nextTick(()=>{h=!1,At()}),r("change",g.value)},setBalanced:l=>{It.value=l},isBalanced:()=>It.value,balance:()=>nf(),applyNodeStyle:(l,s)=>Y(l,s),getNodeStyle:l=>J(l),applyNodeImage:(l,s)=>se(l,s),applyNodeImageByUrl:(l,s)=>X(l,s),removeNodeImage:l=>W(l),applyNodeLink:(l,s)=>D(l,s),removeNodeLink:l=>q(l),applyNodeNote:(l,s)=>ce(l,s),removeNodeNote:l=>ye(l),applyNodeRichContent:(l,s)=>Ne(l,s),undo:()=>et(),redo:()=>Yt(),canUndo:()=>ot.canUndo(),canRedo:()=>ot.canRedo(),applySettings:l=>{l.autoBalanceOnChange!==void 0&&(ee.autoBalanceOnChange=l.autoBalanceOnChange),l.lineWidthStart!==void 0&&(ee.lineWidthStart=Math.max(.5,Math.min(20,l.lineWidthStart))),l.lineWidthEnd!==void 0&&(ee.lineWidthEnd=Math.max(.3,Math.min(10,l.lineWidthEnd))),l.rainbowBranch!==void 0&&(ee.rainbowBranch=l.rainbowBranch),l.branchPaletteId!==void 0&&(ee.branchPaletteId=l.branchPaletteId),l.customPalettes!==void 0&&(ee.customPalettes=l.customPalettes),l.lineStyle!==void 0&&(ee.lineStyle=l.lineStyle),l.taperedEdge!==void 0&&(ee.taperedEdge=l.taperedEdge),l.showOrderBadge!==void 0&&(ee.showOrderBadge=l.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:ee.autoBalanceOnChange,lineWidthStart:ee.lineWidthStart,lineWidthEnd:ee.lineWidthEnd,rainbowBranch:ee.rainbowBranch,branchPaletteId:ee.branchPaletteId,customPalettes:ee.customPalettes,lineStyle:ee.lineStyle,layoutMode:ee.layoutMode,taperedEdge:ee.taperedEdge,showOrderBadge:ee.showOrderBadge}),setBranchPalette:l=>{if(!l)return;[...Tt,...ee.customPalettes].find(k=>k.id===l)&&(ee.branchPaletteId=l)},getBranchPalette:()=>ee.branchPaletteId,getBranchPalettes:()=>[...Tt,...ee.customPalettes]}),e.watch(()=>i.data,l=>{g.value=bt(l),ke()},{deep:!1}),e.onMounted(()=>{Ae(),e.nextTick(()=>At())}),(l,s)=>{var k,L,B,$,j,oe,Ce;return e.openBlock(),e.createElementBlock("div",{class:"zm-mindmap",style:e.normalizeStyle({background:Je.value.bgColor,fontSize:Je.value.fontSize+"px"})},[e.createElementVNode("div",{ref_key:"wrapperRef",ref:a,class:"zm-canvas",onMousedown:Jm,onContextmenu:V,onWheel:s[27]||(s[27]=(...M)=>e.unref(te).onWheel&&e.unref(te).onWheel(...M)),onMouseenter:s[28]||(s[28]=M=>p.value=!0),onMouseleave:s[29]||(s[29]=M=>p.value=!1),onClick:Qm},[e.createElementVNode("div",{class:"zm-svg-layer",style:e.normalizeStyle({left:We.value.vbX*e.unref(te).scale.value+e.unref(te).offsetX.value+"px",top:We.value.vbY*e.unref(te).scale.value+e.unref(te).offsetY.value+"px",width:We.value.vbW*e.unref(te).scale.value+"px",height:We.value.vbH*e.unref(te).scale.value+"px"})},[(e.openBlock(),e.createElementBlock("svg",{class:"zm-svg",viewBox:ft.value,preserveAspectRatio:"xMinYMin meet",width:We.value.vbW*e.unref(te).scale.value,height:We.value.vbH*e.unref(te).scale.value},[e.createElementVNode("g",Za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,M=>(e.openBlock(),e.createElementBlock("path",{key:M.key,d:ei(qr(M.from,"out",M.to.side,M.to),qr(M.to,"in"),gn(M.from.depth),hn(M.to.depth),32,ee.lineStyle,M.to._dir),fill:Bn(M.from,M.to),stroke:"none"},null,8,Ja))),128))])],8,Xa))],4),e.unref(te).isMarquee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-marquee",style:e.normalizeStyle({left:e.unref(te).marquee.x*e.unref(te).scale.value+e.unref(te).offsetX.value+"px",top:e.unref(te).marquee.y*e.unref(te).scale.value+e.unref(te).offsetY.value+"px",width:e.unref(te).marquee.width*e.unref(te).scale.value+"px",height:e.unref(te).marquee.height*e.unref(te).scale.value+"px"})},null,4)):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-drag-ghost",style:e.normalizeStyle({left:E.value+"px",top:w.value+"px",transform:`scale(${e.unref(te).scale.value})`,transformOrigin:"top left"})},e.toDisplayString(b.value.srcText),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"zm-world",style:e.normalizeStyle({transform:`translate(${e.unref(te).offsetX.value}px, ${e.unref(te).offsetY.value}px) scale(${e.unref(te).scale.value})`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.value,M=>{var tt,nt;return e.openBlock(),e.createElementBlock("div",{key:M.id,class:e.normalizeClass(["zm-node",{"is-root":M.isRoot,"is-selected":d.value===M.id,"is-editing":c.value===M.id,"has-image":!!M.image,"is-resizing":ae.value===M.id,"is-dragging-source":((tt=b.value)==null?void 0:tt.srcId)===M.id,"is-drop-target":((nt=b.value)==null?void 0:nt.currentTargetId)===M.id}]),"data-node-id":M.id,style:e.normalizeStyle({left:M.x+"px",top:M.y+"px",width:M.width+"px",minWidth:M.width+"px",height:M.height+"px",fontSize:M.fontSize+"px",background:ro(M),color:lo(M),borderColor:ti(M),fontWeight:it(M),transform:"translate(-50%, -50%)"}),onClick:ge=>Ym(ge,M),onPointerdown:ge=>Zm(ge,M),onDblclick:ge=>{ge.stopPropagation(),t.previewMode||Dt(M.id)},onContextmenu:ge=>ie(ge,M),onMouseenter:ge=>{no(M.id),Mn(ge,M)},onMouseleave:ge=>oo(M.id)},[M.image?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-node-img",src:M.image.src,width:M.image.width,height:M.image.height,alt:M.text,draggable:"false"},null,8,es)):e.createCommentVNode("",!0),M.richContent&&(M.richContent.kind==="code"||M.richContent.kind==="table")&&c.value!==M.id?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":M.richContent.kind==="table"||M.richContent.kind==="code"}]),onClick:s[1]||(s[1]=e.withModifiers(()=>{},["stop"])),onDblclick:e.withModifiers(ge=>so(M.id),["stop"]),onMousedown:s[2]||(s[2]=e.withModifiers(()=>{},["stop"]))},[v.value===M.id?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":s[0]||(s[0]=ge=>_.value=ge),class:"zm-rich-edit",spellcheck:"false",onBlur:qt,onKeydown:Z},null,544)),[[e.vModelText,_.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[M.richContent.kind==="code"?(e.openBlock(),e.createElementBlock("pre",ns,[e.createElementVNode("code",{innerHTML:e.unref(Ao)(e.unref(_o)(M.richContent.raw),e.unref(on)(M.richContent.raw))},null,8,os)])):M.richContent.kind==="table"?(e.openBlock(),e.createElementBlock("table",is,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z(M.id,e.unref(ir)(M.richContent.raw)),(ge,pt)=>(e.openBlock(),e.createElementBlock("tr",{key:pt},[pt===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ge,(yn,gt)=>{var Ln,Dn,St,uo,$t;return e.openBlock(),e.createElementBlock("th",{key:`h${gt}`,class:e.normalizeClass(["zm-rich-table-sort",{"is-sorted":((Ln=x.value.get(M.id))==null?void 0:Ln.col)===gt,"is-asc":((Dn=x.value.get(M.id))==null?void 0:Dn.col)===gt&&((St=x.value.get(M.id))==null?void 0:St.dir)==="asc","is-desc":((uo=x.value.get(M.id))==null?void 0:uo.col)===gt&&(($t=x.value.get(M.id))==null?void 0:$t.dir)==="desc"}]),onClick:e.withModifiers(mo=>f(M.id,gt),["stop"])},[e.createElementVNode("span",null,e.toDisplayString(yn),1),e.createElementVNode("span",ls,e.toDisplayString(H(M.id,gt)),1)],10,rs)}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ge,(yn,gt)=>(e.openBlock(),e.createElementBlock("td",{key:`c${gt}`},e.toDisplayString(yn),1))),128))]))),128))])])):e.createCommentVNode("",!0)],64))],42,ts)):e.createCommentVNode("",!0),c.value!==M.id?(e.openBlock(),e.createElementBlock("span",as,[e.createElementVNode("span",ss,e.toDisplayString(M.text),1),M.link&&!c.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-node-link",href:M.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${M.link.url}`,onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"])),onMousedown:s[4]||(s[4]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(we,{name:"link",size:11,stroke:2})],40,cs)):e.createCommentVNode("",!0),M.note&&!c.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:wt(M.note.text),onClick:e.withModifiers(ge=>ut(M.id),["stop"]),onMousedown:s[5]||(s[5]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(we,{name:"note",size:11,stroke:2})],40,ds)):e.createCommentVNode("",!0)])):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":s[6]||(s[6]=ge=>u.value=ge),autofocus:"",onBlur:s[7]||(s[7]=ge=>kn()),onKeydown:[s[8]||(s[8]=e.withKeys(e.withModifiers(ge=>kn({addSibling:"after"}),["exact"]),["enter"])),s[9]||(s[9]=e.withKeys(e.withModifiers(ge=>kn({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),s[10]||(s[10]=e.withKeys(e.withModifiers(ge=>kn({addChild:!0}),["prevent"]),["tab"])),e.withKeys(ao,["esc"]),Ee],onMousedown:s[11]||(s[11]=e.withModifiers(()=>{},["stop"])),onClick:s[12]||(s[12]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,u.value]]),O.value?(e.openBlock(),e.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${Kr(M.id)+1} 个`},e.toDisplayString(Kr(M.id)+1),9,us)):e.createCommentVNode("",!0),jr(M.id)&&ni(M.id)>0?(e.openBlock(),e.createElementBlock("span",{key:5,class:e.normalizeClass(["zm-collapse-badge",{"is-on-left":M.side===-1}]),style:e.normalizeStyle({background:Nt.value.get(M.id)??"#64748b"}),title:`展开 ${ni(M.id)} 个子节点`,onMousedown:s[13]||(s[13]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>vn(M.id),["stop"])},e.toDisplayString(ni(M.id)),47,ms)):e.createCommentVNode("",!0),tf(M)&&!jr(M.id)?(e.openBlock(),e.createElementBlock("button",{key:6,class:e.normalizeClass(["zm-btn zm-collapse",{"is-on-left":M.side===-1}]),style:e.normalizeStyle({color:Nt.value.get(M.id)??"#64748b",borderColor:Nt.value.get(M.id)??"#64748b"}),title:"折叠",onMousedown:s[14]||(s[14]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>vn(M.id),["stop"])},[e.createVNode(we,{name:"minus",size:10,stroke:2.4})],46,fs)):e.createCommentVNode("",!0),M.image&&d.value===M.id&&c.value!==M.id?(e.openBlock(),e.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:e.withModifiers(ge=>he(ge,M),["stop"])},null,40,ps)):e.createCommentVNode("",!0),M.image&&d.value===M.id&&c.value!==M.id?(e.openBlock(),e.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:s[15]||(s[15]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>W(M.id),["stop"])},[e.createVNode(we,{name:"x",size:9,stroke:2.2})],40,gs)):e.createCommentVNode("",!0)],46,Qa)}),128))],4),y.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["zm-tooltip",{"is-below":!y.value.above}]),style:e.normalizeStyle({left:y.value.x+"px",top:y.value.y+"px"})},e.toDisplayString(y.value.text),7)):e.createCommentVNode("",!0),ue.value?(e.openBlock(),e.createBlock(Dl,{key:3,x:ue.value.x,y:ue.value.y,container:a.value,"has-image":!!((k=e.unref(me)(g.value,ue.value.nodeId))!=null&&k.image),"has-link":!!((L=e.unref(me)(g.value,ue.value.nodeId))!=null&&L.link),"has-note":!!((B=e.unref(me)(g.value,ue.value.nodeId))!=null&&B.note),"has-code":((j=($=e.unref(me)(g.value,ue.value.nodeId))==null?void 0:$.richContent)==null?void 0:j.kind)==="code","has-table":((Ce=(oe=e.unref(me)(g.value,ue.value.nodeId))==null?void 0:oe.richContent)==null?void 0:Ce.kind)==="table",onPickImage:Ke,onRemoveImage:xt,onSetLink:He,onRemoveLink:fn,onEditNote:Ot,onRemoveNote:Q,onAddCode:Re,onEditCode:Re,onRemoveCode:Se,onAddTable:dt,onEditTable:dt,onRemoveTable:qe,onClose:le},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):e.createCommentVNode("",!0),ze.value?(e.openBlock(),e.createBlock(Vl,{key:4,x:ze.value.x,y:ze.value.y,container:a.value,onOpenSettings:fe,onOpenData:pe,onOpenImport:Ve,onClose:S},null,8,["x","y","container"])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(I.value),title:i.previewMode?"退出预览模式":"进入预览模式",onClick:s[16]||(s[16]=M=>r("canvas-toggle-preview"))},[e.createVNode(we,{name:i.previewMode?"eye-off":"eye",size:16},null,8,["name"])],10,hs),e.createElementVNode("button",{class:e.normalizeClass(R.value),title:"显示大纲视图",onClick:s[17]||(s[17]=M=>r("canvas-outline"))},[e.createVNode(we,{name:"outline",size:16})],2),e.createElementVNode("div",{class:e.normalizeClass(["zm-toolbar",{"is-preview-only":i.previewMode,"is-hovered":p.value}])},[e.createElementVNode("span",bs,e.toDisplayString(Math.round(e.unref(te).scale.value*100))+"%",1),e.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:s[18]||(s[18]=(...M)=>e.unref(te).zoomIn&&e.unref(te).zoomIn(...M))},[e.createVNode(we,{name:"zoom-in"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:s[19]||(s[19]=(...M)=>e.unref(te).zoomOut&&e.unref(te).zoomOut(...M))},[e.createVNode(we,{name:"zoom-out"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:At},[e.createVNode(we,{name:"reset"})]),s[33]||(s[33]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:jm},[e.createVNode(we,{name:"collapse-all"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:s[20]||(s[20]=M=>Hr(1))},[e.createVNode(we,{name:"expand-level-1"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:s[21]||(s[21]=M=>Hr(2))},[e.createVNode(we,{name:"expand-level-2"})]),e.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:Km},[e.createVNode(we,{name:"expand-all"})]),s[34]||(s[34]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:lf},[e.createVNode(we,{name:"export"})]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s[30]||(s[30]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:s[22]||(s[22]=M=>d.value&&re(d.value))},[e.createElementVNode("img",{src:e.unref(ai),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,ks)]),e.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:s[23]||(s[23]=M=>d.value&&Te(d.value))},[e.createElementVNode("img",{src:e.unref(li),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,ys)]),s[31]||(s[31]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:s[24]||(s[24]=M=>oi("mindmap"))},[e.createVNode(we,{name:"mindmap"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:s[25]||(s[25]=M=>oi("tree"))},[e.createVNode(we,{name:"tree"})],2),e.createElementVNode("button",{class:e.normalizeClass(["zm-tb-btn",{active:ee.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:s[26]||(s[26]=M=>oi("org"))},[e.createVNode(we,{name:"org"})],2),s[32]||(s[32]=e.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),e.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:rf},[e.createVNode(we,{name:"import"})])],64))],2)],544)],4)}}}),Es={class:"zm-outline-root"},xs={class:"zm-outline-actions"},ws={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ns={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Ss={key:1,d:"M5 12 L10 17 L19 7"},Ts={class:"zm-outline"},Cs=["onClick","onDblclick","onDragstart","onDragover","onDragleave","onDrop"],_s=["title","onClick"],As={width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round"},Ms={key:0,points:"6 9 12 15 18 9"},Rs={key:1,points:"9 6 15 12 9 18"},Bs={key:1,class:"zm-outline-dot"},zs={class:"zm-outline-index"},Os={key:3,class:"zm-outline-text"},Is=["onClick"],vs=["src"],Ls=["onClick"],Ds=["src"],Vs=["title","onClick"],$s={width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ps={key:0,x:"9",y:"9",width:"13",height:"13",rx:"2"},Fs={key:1,d:"M5 12 L10 17 L19 7"},Mo=e.defineComponent({__name:"Outline",props:{data:{},selectedId:{default:null},collapsedIds:{default:()=>new Set},readonly:{type:Boolean,default:!1}},emits:["select","toggleCollapse","edit","addChild","addSibling","move"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>{const W=[],X=(P,N,F)=>{const D=P.children.length>0,q=n.collapsedIds.has(P.id);W.push({id:P.id,text:P.text||"(无标题)",depth:N,siblingIndex:F,hasChildren:D,collapsed:q,node:P}),D&&!q&&P.children.forEach((ce,ye)=>X(ce,N+1,ye))};return X(n.data,0,0),W}),a=e.ref(null),c=e.ref("");let u=null;function d(W){n.readonly||(a.value=W.id,c.value=W.text,e.nextTick(()=>{u=document.querySelector(".zm-outline-input"),u==null||u.focus(),u==null||u.select()}))}function m(){a.value!=null&&(i("edit",{id:a.value,text:c.value.trim()||"(无标题)"}),p())}function p(){a.value=null,c.value="",u=null}function b(W){W.key==="Enter"?(W.preventDefault(),m()):W.key==="Escape"&&(W.preventDefault(),p())}e.onBeforeUnmount(p);const E=e.ref(null),w=e.ref(null),y=e.ref(null);function v(W,X){if(n.readonly){W.preventDefault();return}E.value={id:X.id,text:X.text},W.dataTransfer&&(W.dataTransfer.effectAllowed="move",W.dataTransfer.setData("text/plain",X.id))}function _(){E.value=null,w.value=null,y.value=null}function x(W,X){if(!E.value)return;W.preventDefault(),W.dataTransfer&&(W.dataTransfer.dropEffect="move");const P=A(W);w.value=X.id,y.value=P}function g(W){w.value===W.id&&(w.value=null,y.value=null)}function C(W,X){W.preventDefault();const P=E.value;if(!P)return;const N=A(W);P.id!==X.id&&i("move",{srcId:P.id,targetId:X.id,position:N}),_()}function A(W,X){const N=W.currentTarget.getBoundingClientRect(),F=W.clientY-N.top,D=N.height;return F<D*.3?"before":F>D*.7?"after":"child"}const T=e.ref(null);let h=null;async function O(W){try{return await navigator.clipboard.writeText(W),!0}catch{const X=document.createElement("textarea");X.value=W,document.body.appendChild(X),X.select();let P=!1;try{P=document.execCommand("copy")}finally{document.body.removeChild(X)}return P}}async function G(W,X,P){W.stopPropagation(),await O(X)&&(T.value=P,h&&clearTimeout(h),h=setTimeout(()=>T.value=null,1200))}const ne=e.computed(()=>{const W=[],X=(P,N)=>{const F=" ".repeat(N),D=N===0?"":"- ";W.push(F+D+(P.text||""));for(const q of P.children)X(q,N+1)};return X(n.data,0),W.join(`
|
|
23
|
+
`)}),Y=e.ref(!1);let J=null;async function se(){await O(ne.value)&&(Y.value=!0,J&&clearTimeout(J),J=setTimeout(()=>Y.value=!1,1200))}return(W,X)=>(e.openBlock(),e.createElementBlock("div",Es,[e.createElementVNode("div",xs,[e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-action-btn",{"is-success":Y.value}]),title:"复制完整大纲为纯文本",onClick:se},[(e.openBlock(),e.createElementBlock("svg",ws,[Y.value?(e.openBlock(),e.createElementBlock("path",Ss)):(e.openBlock(),e.createElementBlock("rect",Ns)),X[2]||(X[2]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))])),e.createElementVNode("span",null,e.toDisplayString(Y.value?"已复制":"复制大纲"),1)],2)]),e.createElementVNode("ul",Ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,P=>(e.openBlock(),e.createElementBlock("li",{key:P.id,class:e.normalizeClass(["zm-outline-row",{"is-selected":P.id===t.selectedId,"is-root":P.depth===0,"is-editing":a.value===P.id,"is-drag-over-before":w.value===P.id&&y.value==="before","is-drag-over-after":w.value===P.id&&y.value==="after","is-drag-over-child":w.value===P.id&&y.value==="child"}]),style:e.normalizeStyle({paddingLeft:12+P.depth*16+"px"}),draggable:"true",onClick:N=>i("select",P.node),onDblclick:N=>d(P),onDragstart:N=>v(N,P),onDragend:_,onDragover:N=>x(N,P),onDragleave:()=>g(P),onDrop:N=>C(N,P)},[P.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-outline-toggle",title:P.collapsed?"展开":"折叠",onClick:e.withModifiers(N=>i("toggleCollapse",P.id),["stop"])},[(e.openBlock(),e.createElementBlock("svg",As,[P.collapsed?(e.openBlock(),e.createElementBlock("polyline",Rs)):(e.openBlock(),e.createElementBlock("polyline",Ms))]))],8,_s)):(e.openBlock(),e.createElementBlock("span",Bs)),e.createElementVNode("span",zs,e.toDisplayString(P.siblingIndex+1)+".",1),a.value===P.id?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":X[0]||(X[0]=N=>c.value=N),class:"zm-outline-input",onBlur:m,onKeydown:b,onClick:X[1]||(X[1]=e.withModifiers(()=>{},["stop"]))},null,544)),[[e.vModelText,c.value]]):(e.openBlock(),e.createElementBlock("span",Os,e.toDisplayString(P.text),1)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:4,class:"zm-outline-row-action",title:"添加同级",onClick:e.withModifiers(N=>i("addSibling",P.id),["stop"])},[e.createElementVNode("img",{src:e.unref(li),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,vs)],8,Is)),n.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:5,class:"zm-outline-row-action",title:"添加子节点",onClick:e.withModifiers(N=>i("addChild",P.id),["stop"])},[e.createElementVNode("img",{src:e.unref(ai),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Ds)],8,Ls)),e.createElementVNode("button",{class:e.normalizeClass(["zm-outline-row-copy",{"is-success":T.value===P.id}]),title:T.value===P.id?"已复制":"复制节点文本",onClick:N=>G(N,P.text,P.id)},[(e.openBlock(),e.createElementBlock("svg",$s,[T.value!==P.id?(e.openBlock(),e.createElementBlock("rect",Ps)):(e.openBlock(),e.createElementBlock("path",Fs)),X[3]||(X[3]=e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1))]))],10,Vs)],46,Cs))),128))])]))}}),Us=["aria-hidden"],Hs=["aria-hidden"],Ws={key:0,class:"zm-drawer-header"},Gs={key:0,class:"zm-drawer-title"},js={class:"zm-drawer-body"},Ks=["aria-hidden"],qs={key:0,class:"zm-drawer-header"},Ys={key:0,class:"zm-drawer-title"},Xs={class:"zm-drawer-body"},ln=e.defineComponent({__name:"Drawer",props:{side:{default:"left"},width:{default:320},open:{type:Boolean,default:!0},title:{default:""},scope:{default:"page"},closable:{type:Boolean,default:!0},closeOnBackdrop:{type:Boolean,default:!0}},emits:["update:open"],setup(t,{emit:o}){const n=o;function i(){n("update:open",!1)}function r(){n("update:open",!1)}return(a,c)=>t.scope==="canvas"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.Transition,{name:"zm-fade"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-drawer-canvas-backdrop","aria-hidden":!t.open,onClick:c[0]||(c[0]=u=>t.closeOnBackdrop&&r())},null,8,Us)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:t.side==="left"?"zm-slide-left":"zm-slide-right"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer zm-drawer--canvas",["zm-drawer--"+t.side]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||a.$slots.header?(e.openBlock(),e.createElementBlock("div",Ws,[t.title?(e.openBlock(),e.createElementBlock("h3",Gs,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...c[1]||(c[1]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",js,[e.renderSlot(a.$slots,"default")])],14,Hs)):e.createCommentVNode("",!0)]),_:3},8,["name"])],64)):(e.openBlock(),e.createBlock(e.Transition,{key:1,name:"zm-drawer"},{default:e.withCtx(()=>[t.open?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(["zm-drawer",["zm-drawer--"+t.side,{"is-open":t.open}]]),style:e.normalizeStyle({width:t.width+"px"}),"aria-hidden":!t.open},[t.title||a.$slots.header?(e.openBlock(),e.createElementBlock("div",qs,[t.title?(e.openBlock(),e.createElementBlock("h3",Ys,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"header"),t.closable?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-drawer-close",title:"关闭",onClick:i},[...c[2]||(c[2]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Xs,[e.renderSlot(a.$slots,"default")])],14,Ks)):e.createCommentVNode("",!0)]),_:3}))}}),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"),r=e.computed(()=>n.value==="array");e.computed(()=>!i.value&&!r.value);const a=e.computed(()=>{if(r.value)return`Array(${o.value.length})`;if(i.value){const g=o.value,C=Object.keys(g);return`Object(${C.length} ${C.length===1?"key":"keys"})`}return""}),c=e.computed(()=>r.value?o.value.map((g,C)=>({key:String(C),value:g})):i.value?Object.entries(o.value).map(([g,C])=>({key:g,value:C})):[]),u=e.computed(()=>o.isRoot?"<root>":o.path),d=e.computed(()=>o.collapsedPaths.has(u.value));function m(g,C,A){g!=="<root>"&&(A<2||C===null||typeof C!="object"||o.collapsedPaths.has(g)||o.collapsedPaths.add(g))}o.isRoot||m(u.value,o.value,o.depth);function p(){d.value?o.collapsedPaths.delete(u.value):o.collapsedPaths.add(u.value)}function b(g){return u.value===""?g:`${u.value}.${g}`}function E(g){if(!o.query)return!0;const C=o.query.toLowerCase();return typeof g=="string"?g.toLowerCase().includes(C):g===null?"null".includes(C):String(g).toLowerCase().includes(C)}function w(g){return o.query?g.toLowerCase().includes(o.query.toLowerCase()):!0}function y(g,C){return!o.query||w(g)?!0:C===null||typeof C!="object"?E(C):!0}function v(g){return g===null?"null":typeof g=="string"?g.length>80?`"${g.slice(0,80)}..."`:`"${g}"`:typeof g=="boolean"?g?"true":"false":typeof g=="number"?String(g):typeof g>"u"?"undefined":JSON.stringify(g)}function _(g){if(typeof g!="string")return!1;const C=g.trim();return!!(C.startsWith("data:image/")||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(C)||/^https?:\/\/.+/i.test(C)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(C))}function x(g){if(!o.query)return null;const C=g.toLowerCase().indexOf(o.query.toLowerCase());return C<0?null:{before:g.slice(0,C),match:g.slice(C,C+o.query.length),after:g.slice(C+o.query.length)}}return(g,C)=>{var T,h,O,G,ne,Y;const A=e.resolveComponent("JsonTreeViewer",!0);return t.isRoot?(e.openBlock(),e.createElementBlock("div",Zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,J=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:J.key,class:"zm-jtv-row"},[e.createVNode(A,{"key-name":J.key,value:J.value,path:b(J.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,y(J.key,J.value)]])),128))])):i.value||r.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["zm-jtv-branch",{"is-collapsed":d.value}])},[e.createElementVNode("div",{class:"zm-jtv-header",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"}),onClick:p},[e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-toggle",{"is-leaf":!1}])},e.toDisplayString(d.value?"▶":"▼"),1),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Js,e.toDisplayString(t.keyName),1)),r.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Qs,":")),r.value?(e.openBlock(),e.createElementBlock("span",ec,"[")):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("span",tc,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0),d.value&&r.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(c.value,J=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:J.key,class:"zm-jtv-row"},[e.createVNode(A,{"key-name":J.key,value:J.value,path:b(J.key),depth:t.depth+1,query:t.query,"collapsed-paths":t.collapsedPaths,"is-root":!1},null,8,["key-name","value","path","depth","query","collapsed-paths"])])),[[e.vShow,y(J.key,J.value)]])),128))])),!d.value&&r.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"]",4)):e.createCommentVNode("",!0),!d.value&&i.value&&!r.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-footer",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},"}",4)):e.createCommentVNode("",!0)],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"zm-jtv-leaf",style:e.normalizeStyle({paddingLeft:6+t.depth*12+"px"})},[C[2]||(C[2]=e.createElementVNode("span",{class:"zm-jtv-toggle is-leaf"},"·",-1)),e.createElementVNode("span",rc,e.toDisplayString(t.keyName),1),C[3]||(C[3]=e.createElementVNode("span",{class:"zm-jtv-colon"},":",-1)),w(t.keyName)&&x(t.keyName)?(e.openBlock(),e.createElementBlock("span",lc,[e.createElementVNode("span",null,e.toDisplayString((T=x(t.keyName))==null?void 0:T.before),1),e.createElementVNode("mark",null,e.toDisplayString((h=x(t.keyName))==null?void 0:h.match),1),e.createElementVNode("span",null,e.toDisplayString((O=x(t.keyName))==null?void 0:O.after),1)])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["zm-jtv-value",`zm-jtv-${n.value}`])},[x(v(t.value))?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",null,e.toDisplayString((G=x(v(t.value)))==null?void 0:G.before),1),e.createElementVNode("mark",null,e.toDisplayString((ne=x(v(t.value)))==null?void 0:ne.match),1),e.createElementVNode("span",null,e.toDisplayString((Y=x(v(t.value)))==null?void 0:Y.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(v(t.value)),1)],64))],2),_(t.value)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"zm-jtv-thumb-wrap",onClick:C[1]||(C[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:C[0]||(C[0]=e.withModifiers(()=>{},["stop"]))},"open",8,sc)])):e.createCommentVNode("",!0)],4))}}}),dc={class:"zm-data-panel"},uc={class:"zm-data-header"},mc={class:"zm-data-title"},fc={class:"zm-data-title-meta"},pc={class:"zm-data-toolbar"},gc=["title"],hc={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"},Ro=e.defineComponent({__name:"DataPanel",props:{data:{},pendingMode:{default:null}},emits:["import","consumed-mode"],setup(t,{emit:o}){const n=t,i=o,r=e.computed(()=>JSON.stringify(n.data,null,2)),a=e.ref(""),c=e.ref(null),u=e.ref(!1),d=e.ref("json"),m=e.ref("idle"),p=e.ref(new Set),b=e.ref("");e.watch(()=>n.pendingMode,C=>{C&&(u.value=!0,d.value=C,i("consumed-mode"))},{immediate:!0});async function E(){try{await navigator.clipboard.writeText(r.value),m.value="copied",setTimeout(()=>m.value="idle",1500)}catch{const C=document.createElement("textarea");C.value=r.value,document.body.appendChild(C),C.select();try{document.execCommand("copy"),m.value="copied",setTimeout(()=>m.value="idle",1500)}finally{document.body.removeChild(C)}}}function w(){const C=new Blob([r.value],{type:"application/json"}),A=URL.createObjectURL(C),T=document.createElement("a");T.href=A,T.download=`${n.data.text||"mindmap"}.json`,T.click(),URL.revokeObjectURL(A)}function y(){c.value=null;const C=a.value.trim();if(C){if(d.value==="markdown"||d.value==="txt"){try{const A=Jt(C);i("import",A),a.value="",u.value=!1}catch(A){c.value=(d.value==="txt"?"TXT 解析失败:":"Markdown 解析失败:")+A.message}return}try{const A=JSON.parse(C);if(!A.id||!Array.isArray(A.children)){c.value="JSON 缺少 id 或 children 字段";return}i("import",A),a.value="",u.value=!1}catch(A){c.value="JSON 解析失败:"+A.message}}}function v(C){return 1+C.children.reduce((A,T)=>A+v(T),0)}const _=e.computed(()=>v(n.data)),x=e.computed(()=>r.value.length);function g(){const C=document.createElement("input");C.type="file",C.accept="application/json",C.onchange=()=>{var h;const A=(h=C.files)==null?void 0:h[0];if(!A)return;const T=new FileReader;T.onload=()=>{typeof T.result=="string"&&(a.value=T.result,y())},T.readAsText(A)},C.click()}return(C,A)=>(e.openBlock(),e.createElementBlock("div",dc,[e.createElementVNode("div",uc,[e.createElementVNode("div",mc,[A[8]||(A[8]=e.createElementVNode("span",{class:"zm-data-title-text"},"数据 JSON",-1)),e.createElementVNode("span",fc,e.toDisplayString(_.value)+" 节点 · "+e.toDisplayString(x.value)+" chars",1)])]),e.createElementVNode("div",pc,[e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-success":m.value==="copied"}]),title:m.value==="copied"?"已复制":"复制 JSON 到剪贴板",onClick:E},[m.value==="idle"?(e.openBlock(),e.createElementBlock("svg",hc,[...A[9]||(A[9]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"},null,-1),e.createElementVNode("path",{d:"M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",bc,[...A[10]||(A[10]=[e.createElementVNode("polyline",{points:"5 12 10 17 19 7"},null,-1)])])),A[11]||(A[11]=e.createElementVNode("span",{class:"zm-data-btn-label"},"复制",-1))],10,gc),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"导出为 JSON 文件",onClick:w},[...A[12]||(A[12]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>',2)])]),e.createElementVNode("button",{class:"zm-data-btn is-icon",title:"从 JSON 文件导入",onClick:g},[...A[13]||(A[13]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>',2)])]),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-btn is-icon",{"is-active":u.value}]),title:"粘贴 JSON 或 Markdown 替换当前数据",onClick:A[0]||(A[0]=T=>u.value=!u.value)},[...A[14]||(A[14]=[e.createStaticVNode('<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>',2)])],2),A[16]||(A[16]=e.createElementVNode("div",{class:"zm-data-toolbar-spacer"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["zm-data-search",{"is-active":b.value.length>0}])},[A[15]||(A[15]=e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"7"}),e.createElementVNode("line",{x1:"20",y1:"20",x2:"16",y2:"16"})],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":A[1]||(A[1]=T=>b.value=T),type:"text",placeholder:"过滤 (键 / 值)",spellcheck:"false"},null,512),[[e.vModelText,b.value]]),b.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-data-search-clear",title:"清空过滤",onClick:A[2]||(A[2]=T=>b.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:A[3]||(A[3]=T=>d.value="json")},"JSON",2),e.createElementVNode("button",{class:e.normalizeClass(["zm-data-tab",{"is-active":d.value==="markdown"}]),onClick:A[4]||(A[4]=T=>d.value="markdown")},"Markdown",2)]),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":A[5]||(A[5]=T=>a.value=T),placeholder:d.value==="json"?"paste a JSON tree to replace current data":"paste markdown - # / ## / ### become nodes",spellcheck:"false"},null,8,Ec),[[e.vModelText,a.value]]),c.value?(e.openBlock(),e.createElementBlock("div",xc,e.toDisplayString(c.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",wc,[e.createElementVNode("button",{class:"zm-data-btn is-primary",disabled:!a.value,onClick:y},"应用",8,Nc),e.createElementVNode("button",{class:"zm-data-btn",onClick:A[6]||(A[6]=T=>{a.value="",c.value=null})},"清空"),e.createElementVNode("button",{class:"zm-data-btn",onClick:A[7]||(A[7]=T=>u.value=!1)},"关闭")])])):e.createCommentVNode("",!0),e.createElementVNode("div",Sc,[e.createVNode(cc,{value:t.data,query:b.value,"collapsed-paths":p.value},null,8,["value","query","collapsed-paths"])]),A[17]||(A[17]=e.createElementVNode("div",{class:"zm-data-footer"},[e.createElementVNode("span",{class:"zm-data-footer-hint"},[e.createTextVNode(" 图片支持 "),e.createElementVNode("code",null,"data:image/..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"https://..."),e.createTextVNode(" / "),e.createElementVNode("code",null,"/imgs/foo.png"),e.createTextVNode(" (同源)。本地 "),e.createElementVNode("code",null,"file://"),e.createTextVNode(" 路径被浏览器拒绝。 ")])],-1))]))}}),Tc={class:"zm-md-panel"},Cc={key:0,class:"zm-md-error"},_c={class:"zm-md-split"},Ac={class:"zm-md-edit"},Mc={class:"zm-md-preview"},Rc={class:"zm-md-preview-body"},Bc={class:"zm-md-footer"},zc=["disabled"],Oc=`# flow-mindmap 思维导图
|
|
24
24
|
|
|
25
25
|
[GitHub 仓库](https://github.com/xz333221/flow-mindmap)
|
|
26
26
|
|
|
@@ -59,56 +59,56 @@ https://github.com/highlightjs/highlight.js/issues/2277`),X=N,j=$),L===void 0&&(
|
|
|
59
59
|
|
|
60
60
|
## 开源协议
|
|
61
61
|
[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
|
62
|
-
`,
|
|
63
|
-
`)),m[
|
|
64
|
-
`);return}const
|
|
65
|
-
`)}function w(C){const h=n.settings.customPalettes.filter(W=>W.id!==C.id),O=n.settings.branchPaletteId===C.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:h,...O!==n.settings.branchPaletteId?{branchPaletteId:O}:{}}),delete m[C.id]}const k=e.computed(()=>[...Nt,...n.settings.customPalettes]),b=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],_=[0,1,2,3],x=["#f87171","#fb923c","#34d399","#818cf8"];function M(C,h,O,W){if(h<=1)return O;const oe=C/(h-1);return O+(W-O)*oe}function S(C,h,O){return C<=0?h:C===1?Math.max(1.5,h*.67):C===2?Math.max(.8,h*.42):O}const A=e.computed(()=>{const C=n.settings.lineWidthStart,h=n.settings.lineWidthEnd,O=n.settings.taperedEdge,W=_.length,oe=8,K=192,te=k.value.find(G=>G.id===n.settings.branchPaletteId),le=te&&te.colors.length?te.colors:x;return _.map((G,Y)=>{const F=10+Y*60/(W-1);return{x1:oe,y1:F,x2:K,y2:F,w:O?S(G,C,h):M(G,W,C,h),color:n.settings.rainbowBranch?le[Y%le.length]:"#94a3b8"}})});return(C,h)=>(e.openBlock(),e.createElementBlock("div",Sc,[t.hasSelection?(e.openBlock(),e.createElementBlock("section",ld,[h[32]||(h[32]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",ad,[h[27]||(h[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端",-1)),e.createElementVNode("span",sd,e.toDisplayString(t.settings.lineWidthStart.toFixed(1)),1)]),e.createElementVNode("div",cd,[h[28]||(h[28]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端",-1)),e.createElementVNode("span",dd,e.toDisplayString(t.settings.lineWidthEnd.toFixed(1)),1)]),e.createElementVNode("div",ud,[h[29]||(h[29]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("span",md,e.toDisplayString(t.settings.lineStyle==="curve"?"圆弧":"直线"),1)]),e.createElementVNode("label",fd,[h[31]||(h[31]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:h[7]||(h[7]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...h[30]||(h[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[33]||(h[33]=e.createElementVNode("p",{class:"zm-settings-hint"},"画布级别的设置会影响整张图。",-1))])):(e.openBlock(),e.createElementBlock("section",Tc,[h[23]||(h[23]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Cc,[h[12]||(h[12]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端(根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:h[0]||(h[0]=O=>r("lineWidthStart",parseFloat(O.target.value)||0))},null,40,_c)]),e.createElementVNode("div",Ac,[e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:h[1]||(h[1]=O=>r("lineWidthStart",parseFloat(O.target.value)))},null,40,Mc)]),e.createElementVNode("div",Rc,[h[13]||(h[13]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端(子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:h[2]||(h[2]=O=>r("lineWidthEnd",parseFloat(O.target.value)||0))},null,40,Bc)]),e.createElementVNode("div",zc,[e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:h[3]||(h[3]=O=>r("lineWidthEnd",parseFloat(O.target.value)))},null,40,Oc)]),e.createElementVNode("div",Ic,[h[14]||(h[14]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",vc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,O=>e.createElementVNode("button",{key:O.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===O.value}]),title:O.label,onClick:W=>r("lineStyle",O.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:O.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[O.value==="curve"?(e.openBlock(),e.createElementBlock("path",Vc)):(e.openBlock(),e.createElementBlock("line",$c))],8,Dc)),e.createElementVNode("span",Pc,e.toDisplayString(O.label),1)],10,Lc)),64))])]),e.createElementVNode("label",Fc,[h[16]||(h[16]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:h[4]||(h[4]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...h[15]||(h[15]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[24]||(h[24]=e.createElementVNode("p",{class:"zm-settings-hint"},"关闭时所有线条使用统一的 lineColor。",-1)),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Uc,[h[17]||(h[17]=e.createElementVNode("h5",{class:"zm-palette-picker-title"},"配色方案",-1)),e.createElementVNode("div",Hc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Nt),O=>(e.openBlock(),e.createElementBlock("button",{key:O.id,type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===O.id}]),title:O.name,onClick:W=>r("branchPaletteId",O.id)},[e.createElementVNode("span",Gc,e.toDisplayString(O.name),1),e.createElementVNode("span",jc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(W,oe)=>(e.openBlock(),e.createElementBlock("span",{key:oe,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:W})},null,4))),128))])],10,Wc))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("div",Kc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,O=>(e.openBlock(),e.createElementBlock("div",{key:O.id,class:"zm-palette-custom"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===O.id}]),title:O.name,onClick:W=>r("branchPaletteId",O.id)},[e.createElementVNode("span",Yc,e.toDisplayString(O.name),1),e.createElementVNode("span",Zc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(W,oe)=>(e.openBlock(),e.createElementBlock("span",{key:oe,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:W})},null,4))),128))])],10,qc),e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"2",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:p(O),onInput:W=>m[O.id]=W.target.value},null,40,Xc),e.createElementVNode("div",Jc,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:W=>g(O)},"保存",8,Qc),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:W=>w(O)},"删除",8,ed)])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:y},"+ 新建配色")])):e.createCommentVNode("",!0),e.createElementVNode("label",td,[h[19]||(h[19]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:h[5]||(h[5]=O=>r("taperedEdge",!t.settings.taperedEdge))},[...h[18]||(h[18]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[25]||(h[25]=e.createElementVNode("p",{class:"zm-settings-hint"}," 开启时每条边都从根部粗端收回到细端子端,父子边之间可能形成粗细跳变; 关闭时整棵树从最粗平滑过渡到最细,所有边连成一条带子。 ",-1)),e.createElementVNode("label",nd,[h[21]||(h[21]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:h[6]||(h[6]=O=>r("showOrderBadge",!t.settings.showOrderBadge))},[...h[20]||(h[20]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[26]||(h[26]=e.createElementVNode("p",{class:"zm-settings-hint"}," 在每个节点右上角标注它是同级中的第几个 (1, 2, 3, ...), 方便对比画布位置与数据顺序。 ",-1)),e.createElementVNode("div",od,[(e.openBlock(),e.createElementBlock("svg",id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,(O,W)=>(e.openBlock(),e.createElementBlock("line",{key:W,x1:O.x1,y1:O.y1,x2:O.x2,y2:O.y2,stroke:t.settings.rainbowBranch?O.color:"#94a3b8","stroke-width":O.w,"stroke-linecap":"butt"},null,8,rd))),128))])),h[22]||(h[22]=e.createElementVNode("div",{class:"zm-settings-preview-labels"},[e.createElementVNode("span",null,"根"),e.createElementVNode("span",null,"1级"),e.createElementVNode("span",null,"2级"),e.createElementVNode("span",null,"3级")],-1))])])),t.hasSelection?(e.openBlock(),e.createElementBlock("section",pd,[e.createElementVNode("h4",gd,[h[34]||(h[34]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",hd,"“"+e.toDisplayString(t.selectedNodeText)+"”",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",bd,[h[35]||(h[35]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",kd,e.toDisplayString(c.bg||"默认"),1)]),e.createElementVNode("div",yd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(b,O=>e.createElementVNode("button",{key:"bg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:W=>c.bg=O},null,12,Ed)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:h[8]||(h[8]=O=>c.bg=void 0)},"∅")]),e.createElementVNode("div",xd,[h[36]||(h[36]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",wd,e.toDisplayString(c.textColor||"默认"),1)]),e.createElementVNode("div",Nd,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(b,O=>e.createElementVNode("button",{key:"fg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:W=>c.textColor=O},null,12,Sd)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:h[9]||(h[9]=O=>c.textColor=void 0)},"∅")]),e.createElementVNode("div",Td,[h[38]||(h[38]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":c.fontWeight===600}]),onClick:h[10]||(h[10]=O=>c.fontWeight=c.fontWeight===600?400:600)},[...h[37]||(h[37]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",{class:"zm-data-paste-actions"},[e.createElementVNode("button",{class:"zm-data-btn is-primary",onClick:u},"应用到该节点"),e.createElementVNode("button",{class:"zm-data-btn",onClick:s},"清除该节点样式")]),h[39]||(h[39]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Cd,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:h[11]||(h[11]=O=>i("reset"))},"恢复默认设置")])]))}}),[["__scopeId","data-v-17ef65d1"]]),ir=20;function _d(t,o){t.style.height="auto";const n=o.minRows*ir,i=o.maxRows>0?o.maxRows*ir:1/0,r=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=r+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function Ro(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const a=t.value;a&&_d(a,n)}function r(){i()}e.onMounted(async()=>{await e.nextTick();const a=t.value;a&&(a.addEventListener("input",r),i())}),e.watch(()=>{var a;return(a=t.value)==null?void 0:a.value},()=>i()),e.onBeforeUnmount(()=>{const a=t.value;a&&a.removeEventListener("input",r)})}function Bo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lt=Bo();function rr(t){Lt=t}var Dt={exec:()=>null};function Xt(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),r=o[i];return r||(r=t(i),o[i]=r),r}}function be(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(r,a)=>{let c=typeof a=="string"?a:a.source;return c=c.replace(qe.caret,"$1"),n=n.replace(r,c),i},getRegex:()=>new RegExp(n,o)};return i}var Ad=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),qe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Xt(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Xt(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Xt(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Xt(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Xt(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Xt(t=>new RegExp(`^ {0,${t}}>`))},Md=/^(?:[ \t]*(?:\n|$))+/,Rd=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Bd=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,kn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,zd=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,lr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ar=be(lr).replace(/bull/g,zo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Od=be(lr).replace(/bull/g,zo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Oo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Id=/^[^\n]+/,Io=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,vd=be(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Io).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ld=be(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,zo).getRegex(),Gn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",vo=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Dd=be("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",vo).replace("tag",Gn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),sr=be(Oo).replace("hr",kn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Gn).getRegex(),Vd=be(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",sr).getRegex(),Lo={blockquote:Vd,code:Rd,def:vd,fences:Bd,heading:zd,hr:kn,html:Dd,lheading:ar,list:Ld,newline:Md,paragraph:sr,table:Dt,text:Id},cr=be("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",kn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Gn).getRegex(),$d={...Lo,lheading:Od,table:cr,paragraph:be(Oo).replace("hr",kn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",cr).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Gn).getRegex()},Pd={...Lo,html:be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",vo).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Dt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:be(Oo).replace("hr",kn).replace("heading",` *#{1,6} *[^
|
|
66
|
-
]`).replace("lheading",
|
|
67
|
-
`),n=o.length-1;for(;n>=0&&
|
|
68
|
-
`)}function
|
|
62
|
+
`,Bo=e.defineComponent({__name:"MarkdownPanel",props:{data:{}},emits:["import"],setup(t,{emit:o}){const n=t,i=o,r=e.ref(Qt(n.data)),a=e.ref(null),c=e.ref(null),u=e.computed(()=>{try{const _=Jt(r.value||"");return a.value=null,_}catch(_){return a.value=_.message,{id:"preview_fallback",text:r.value||"(空)",children:[]}}}),d=e.computed(()=>bt(u.value));let m=null;e.watch(r,()=>{m&&clearTimeout(m),m=setTimeout(()=>{var _;return(_=c.value)==null?void 0:_.resetView()},250)});function p(){try{const _=Jt(r.value||"");a.value=null,i("import",_)}catch(_){a.value=_.message}}function b(){r.value=Qt(n.data),a.value=null,e.nextTick(()=>{var _;return(_=c.value)==null?void 0:_.resetView()})}function E(){r.value="",a.value=null,e.nextTick(()=>{var _;return(_=c.value)==null?void 0:_.resetView()})}function w(){const _=document.createElement("input");_.type="file",_.accept=".md,text/markdown,text/plain",_.onchange=()=>{var C;const x=(C=_.files)==null?void 0:C[0];if(!x)return;const g=new FileReader;g.onload=()=>{typeof g.result=="string"&&(r.value=g.result,a.value=null,e.nextTick(()=>{var A;return(A=c.value)==null?void 0:A.resetView()}))},g.readAsText(x)},_.click()}function y(){const _=new Blob([r.value],{type:"text/markdown;charset=utf-8"}),x=URL.createObjectURL(_),g=document.createElement("a");g.href=x;const C=(n.data.text||"mindmap").trim()||"mindmap";g.download=`${C}.md`,g.click(),URL.revokeObjectURL(x)}function v(){r.value=Oc,a.value=null,e.nextTick(()=>{var _;return(_=c.value)==null?void 0:_.resetView()})}return(_,x)=>(e.openBlock(),e.createElementBlock("div",Tc,[e.createElementVNode("div",{class:"zm-md-toolbar"},[e.createElementVNode("button",{class:"zm-md-btn",title:"从 .md 文件加载",onClick:w},[...x[1]||(x[1]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 4 V15"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"加载 .md",-1)])]),e.createElementVNode("button",{class:"zm-md-btn",title:"把当前导图导出为 .md",onClick:y},[...x[2]||(x[2]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 15 V4"}),e.createElementVNode("polyline",{points:"7 9 12 4 17 9"}),e.createElementVNode("path",{d:"M4 19 H20"})],-1),e.createElementVNode("span",null,"导出 .md",-1)])]),x[3]||(x[3]=e.createElementVNode("span",{class:"zm-md-spacer"},null,-1)),e.createElementVNode("button",{class:"zm-md-btn",title:"用示例内容填充",onClick:v},"示例"),e.createElementVNode("button",{class:"zm-md-btn",title:"覆盖为当前导图",onClick:b},"同步"),e.createElementVNode("button",{class:"zm-md-btn",title:"清空",onClick:E},"清空")]),a.value?(e.openBlock(),e.createElementBlock("div",Cc,e.toDisplayString(a.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",_c,[e.createElementVNode("div",Ac,[x[4]||(x[4]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"Markdown"),e.createElementVNode("span",{class:"zm-md-hint"},"# 根 · ## 一级 · ### 二级 …")],-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":x[0]||(x[0]=g=>r.value=g),class:"zm-md-textarea",spellcheck:"false",placeholder:"# 标题…"},null,512),[[e.vModelText,r.value]])]),e.createElementVNode("div",Mc,[x[5]||(x[5]=e.createElementVNode("div",{class:"zm-md-pane-header"},[e.createElementVNode("span",null,"导图预览"),e.createElementVNode("span",{class:"zm-md-hint"},"只读")],-1)),e.createElementVNode("div",Rc,[e.createVNode(qn,{ref_key:"previewRef",ref:c,data:d.value,readonly:"","preview-mode":""},null,8,["data"])])])]),e.createElementVNode("div",Bc,[e.createElementVNode("button",{class:"zm-md-btn is-primary",disabled:!r.value.trim(),onClick:p},"应用到导图",8,zc)])]))}}),Ic={class:"zm-settings-panel"},vc={key:0,class:"zm-settings-section"},Lc={class:"zm-settings-row"},Dc=["value"],Vc={class:"zm-slider"},$c=["value"],Pc={class:"zm-settings-row"},Fc=["value"],Uc={class:"zm-slider"},Hc=["value"],Wc={class:"zm-settings-row"},Gc={class:"zm-line-style-group"},jc=["title","onClick"],Kc=["viewBox"],qc={key:0,d:"M 0 12 C 8 0, 20 0, 28 12",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Yc={key:1,x1:"0",y1:"12",x2:"28",y2:"12",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},Xc={class:"zm-line-style-label"},Zc={class:"zm-settings-row"},Jc={key:0,class:"zm-palette-picker"},Qc={class:"zm-palette-grid"},ed=["title","onClick"],td={class:"zm-palette-card-name"},nd={class:"zm-palette-card-swatches"},od={key:0,class:"zm-palette-customs"},id=["title","onClick"],rd={class:"zm-palette-card-name"},ld={class:"zm-palette-card-swatches"},ad=["value","onInput"],sd={class:"zm-palette-custom-actions"},cd=["onClick"],dd=["onClick"],ud={class:"zm-settings-row"},md={class:"zm-settings-row"},fd={class:"zm-settings-preview"},pd={viewBox:"0 0 200 70",width:"100%",height:"70",preserveAspectRatio:"none"},gd=["x1","y1","x2","y2","stroke","stroke-width"],hd={key:1,class:"zm-settings-section"},bd={class:"zm-settings-row"},kd={class:"zm-settings-value-tag"},yd={class:"zm-settings-row"},Ed={class:"zm-settings-value-tag"},xd={class:"zm-settings-row"},wd={class:"zm-settings-value-tag"},Nd={class:"zm-settings-row"},Sd={key:2,class:"zm-settings-section"},Td={class:"zm-settings-section-title"},Cd={key:0,class:"zm-settings-section-sub"},_d={class:"zm-settings-row"},Ad={class:"zm-settings-value-tag"},Md={class:"zm-swatch-row"},Rd=["title","onClick"],Bd={class:"zm-settings-row"},zd={class:"zm-settings-value-tag"},Od={class:"zm-swatch-row"},Id=["title","onClick"],vd={class:"zm-settings-row"},Ld={class:"zm-settings-section"},zo=((t,o)=>{const n=t.__vccOpts||t;for(const[i,r]of o)n[i]=r;return n})(e.defineComponent({__name:"SettingsPanel",props:{settings:{},hasSelection:{type:Boolean},selectedNodeText:{}},emits:["update:settings","update:nodeStyle","reset"],setup(t,{emit:o}){const n=t,i=o;function r(T,h){i("update:settings",{[T]:h})}e.computed(()=>{const T=n.settings.lineWidthStart;return T<1.2?"细":T<2.5?"中":T<4?"粗":"极粗"}),e.computed(()=>{const T=n.settings.lineWidthEnd;return T<.6?"极细":T<1.2?"细":T<2?"中":"粗"});const a=[{value:"curve",label:"圆弧",viewBox:"0 0 28 14"},{value:"straight",label:"直线",viewBox:"0 0 28 14"}],c=e.reactive({fontWeight:400});function u(){i("update:nodeStyle",{...c})}function d(){c.bg=void 0,c.textColor=void 0,c.borderColor=void 0,c.fontWeight=400,i("update:nodeStyle",{...c})}const m=e.reactive({});function p(T){return m[T.id]===void 0&&(m[T.id]=T.colors.join(`
|
|
63
|
+
`)),m[T.id]}function b(T){const h=m[T.id]??"",O=wl(h);if(O.length===0){m[T.id]=T.colors.join(`
|
|
64
|
+
`);return}const G=n.settings.customPalettes.map(ne=>ne.id===T.id?{...ne,colors:O}:ne);i("update:settings",{customPalettes:G})}function E(){const T=y.value.find(Y=>Y.id===n.settings.branchPaletteId),h=T?[...T.colors]:[...Tt[0].colors],O="custom-";let G=O+(n.settings.customPalettes.length+1);for(;Tt.some(Y=>Y.id===G)||n.settings.customPalettes.some(Y=>Y.id===G);)G=O+Math.random().toString(36).slice(2,7);const ne={id:G,name:`我的配色 ${n.settings.customPalettes.length+1}`,colors:h};i("update:settings",{customPalettes:[...n.settings.customPalettes,ne],branchPaletteId:G}),m[G]=h.join(`
|
|
65
|
+
`)}function w(T){const h=n.settings.customPalettes.filter(G=>G.id!==T.id),O=n.settings.branchPaletteId===T.id?"default":n.settings.branchPaletteId;i("update:settings",{customPalettes:h,...O!==n.settings.branchPaletteId?{branchPaletteId:O}:{}}),delete m[T.id]}const y=e.computed(()=>[...Tt,...n.settings.customPalettes]),v=["#f87171","#fb923c","#fbbf24","#a3e635","#34d399","#22d3ee","#818cf8","#c084fc","#1e2937","#f8fafc","#94a3b8"],_=[0,1,2,3],x=["#f87171","#fb923c","#34d399","#818cf8"];function g(T,h,O,G){if(h<=1)return O;const ne=T/(h-1);return O+(G-O)*ne}function C(T,h,O){return T<=0?h:T===1?Math.max(1.5,h*.67):T===2?Math.max(.8,h*.42):O}const A=e.computed(()=>{const T=n.settings.lineWidthStart,h=n.settings.lineWidthEnd,O=n.settings.taperedEdge,G=_.length,ne=8,Y=192,J=y.value.find(W=>W.id===n.settings.branchPaletteId),se=J&&J.colors.length?J.colors:x;return _.map((W,X)=>{const P=10+X*60/(G-1);return{x1:ne,y1:P,x2:Y,y2:P,w:O?C(W,T,h):g(W,G,T,h),color:n.settings.rainbowBranch?se[X%se.length]:"#94a3b8"}})});return(T,h)=>(e.openBlock(),e.createElementBlock("div",Ic,[t.hasSelection?(e.openBlock(),e.createElementBlock("section",hd,[h[32]||(h[32]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",bd,[h[27]||(h[27]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端",-1)),e.createElementVNode("span",kd,e.toDisplayString(t.settings.lineWidthStart.toFixed(1)),1)]),e.createElementVNode("div",yd,[h[28]||(h[28]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端",-1)),e.createElementVNode("span",Ed,e.toDisplayString(t.settings.lineWidthEnd.toFixed(1)),1)]),e.createElementVNode("div",xd,[h[29]||(h[29]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("span",wd,e.toDisplayString(t.settings.lineStyle==="curve"?"圆弧":"直线"),1)]),e.createElementVNode("label",Nd,[h[31]||(h[31]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:h[7]||(h[7]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...h[30]||(h[30]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[33]||(h[33]=e.createElementVNode("p",{class:"zm-settings-hint"},"画布级别的设置会影响整张图。",-1))])):(e.openBlock(),e.createElementBlock("section",vc,[h[23]||(h[23]=e.createElementVNode("h4",{class:"zm-settings-section-title"},"画布",-1)),e.createElementVNode("div",Lc,[h[12]||(h[12]=e.createElementVNode("span",{class:"zm-settings-label"},"线条粗端(根部)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthStart,onChange:h[0]||(h[0]=O=>r("lineWidthStart",parseFloat(O.target.value)||0))},null,40,Dc)]),e.createElementVNode("div",Vc,[e.createElementVNode("input",{type:"range",min:"0.4",max:"20",step:"0.2",value:t.settings.lineWidthStart,onInput:h[1]||(h[1]=O=>r("lineWidthStart",parseFloat(O.target.value)))},null,40,$c)]),e.createElementVNode("div",Pc,[h[13]||(h[13]=e.createElementVNode("span",{class:"zm-settings-label"},"线条细端(子端)",-1)),e.createElementVNode("input",{class:"zm-settings-number",type:"number",step:"0.2",value:t.settings.lineWidthEnd,onChange:h[2]||(h[2]=O=>r("lineWidthEnd",parseFloat(O.target.value)||0))},null,40,Fc)]),e.createElementVNode("div",Uc,[e.createElementVNode("input",{type:"range",min:"0.2",max:"6",step:"0.1",value:t.settings.lineWidthEnd,onInput:h[3]||(h[3]=O=>r("lineWidthEnd",parseFloat(O.target.value)))},null,40,Hc)]),e.createElementVNode("div",Wc,[h[14]||(h[14]=e.createElementVNode("span",{class:"zm-settings-label"},"线条类型",-1)),e.createElementVNode("div",Gc,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,O=>e.createElementVNode("button",{key:O.value,class:e.normalizeClass(["zm-line-style-btn",{"is-on":t.settings.lineStyle===O.value}]),title:O.label,onClick:G=>r("lineStyle",O.value)},[(e.openBlock(),e.createElementBlock("svg",{viewBox:O.viewBox,width:"28",height:"14",preserveAspectRatio:"none"},[O.value==="curve"?(e.openBlock(),e.createElementBlock("path",qc)):(e.openBlock(),e.createElementBlock("line",Yc))],8,Kc)),e.createElementVNode("span",Xc,e.toDisplayString(O.label),1)],10,jc)),64))])]),e.createElementVNode("label",Zc,[h[16]||(h[16]=e.createElementVNode("span",{class:"zm-settings-label"},"一级分支彩虹色",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.rainbowBranch}]),onClick:h[4]||(h[4]=O=>r("rainbowBranch",!t.settings.rainbowBranch))},[...h[15]||(h[15]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[24]||(h[24]=e.createElementVNode("p",{class:"zm-settings-hint"},"关闭时所有线条使用统一的 lineColor。",-1)),t.settings.rainbowBranch?(e.openBlock(),e.createElementBlock("div",Jc,[h[17]||(h[17]=e.createElementVNode("h5",{class:"zm-palette-picker-title"},"配色方案",-1)),e.createElementVNode("div",Qc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(Tt),O=>(e.openBlock(),e.createElementBlock("button",{key:O.id,type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===O.id}]),title:O.name,onClick:G=>r("branchPaletteId",O.id)},[e.createElementVNode("span",td,e.toDisplayString(O.name),1),e.createElementVNode("span",nd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(G,ne)=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:G})},null,4))),128))])],10,ed))),128))]),t.settings.customPalettes.length?(e.openBlock(),e.createElementBlock("div",od,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.settings.customPalettes,O=>(e.openBlock(),e.createElementBlock("div",{key:O.id,class:"zm-palette-custom"},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["zm-palette-card",{"is-active":t.settings.branchPaletteId===O.id}]),title:O.name,onClick:G=>r("branchPaletteId",O.id)},[e.createElementVNode("span",rd,e.toDisplayString(O.name),1),e.createElementVNode("span",ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.colors,(G,ne)=>(e.openBlock(),e.createElementBlock("span",{key:ne,class:"zm-palette-card-swatch",style:e.normalizeStyle({background:G})},null,4))),128))])],10,id),e.createElementVNode("textarea",{class:"zm-palette-textarea",rows:"2",spellcheck:"false",placeholder:"一行一个 hex,例如 #f87171",value:p(O),onInput:G=>m[O.id]=G.target.value},null,40,ad),e.createElementVNode("div",sd,[e.createElementVNode("button",{type:"button",class:"zm-data-btn is-primary",onClick:G=>b(O)},"保存",8,cd),e.createElementVNode("button",{type:"button",class:"zm-data-btn",onClick:G=>w(O)},"删除",8,dd)])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"zm-palette-add",onClick:E},"+ 新建配色")])):e.createCommentVNode("",!0),e.createElementVNode("label",ud,[h[19]||(h[19]=e.createElementVNode("span",{class:"zm-settings-label"},"每条连线独立渐变",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.taperedEdge}]),onClick:h[5]||(h[5]=O=>r("taperedEdge",!t.settings.taperedEdge))},[...h[18]||(h[18]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[25]||(h[25]=e.createElementVNode("p",{class:"zm-settings-hint"}," 开启时每条边都从根部粗端收回到细端子端,父子边之间可能形成粗细跳变; 关闭时整棵树从最粗平滑过渡到最细,所有边连成一条带子。 ",-1)),e.createElementVNode("label",md,[h[21]||(h[21]=e.createElementVNode("span",{class:"zm-settings-label"},"显示节点序号",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":t.settings.showOrderBadge}]),onClick:h[6]||(h[6]=O=>r("showOrderBadge",!t.settings.showOrderBadge))},[...h[20]||(h[20]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),h[26]||(h[26]=e.createElementVNode("p",{class:"zm-settings-hint"}," 在每个节点右上角标注它是同级中的第几个 (1, 2, 3, ...), 方便对比画布位置与数据顺序。 ",-1)),e.createElementVNode("div",fd,[(e.openBlock(),e.createElementBlock("svg",pd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,(O,G)=>(e.openBlock(),e.createElementBlock("line",{key:G,x1:O.x1,y1:O.y1,x2:O.x2,y2:O.y2,stroke:t.settings.rainbowBranch?O.color:"#94a3b8","stroke-width":O.w,"stroke-linecap":"butt"},null,8,gd))),128))])),h[22]||(h[22]=e.createElementVNode("div",{class:"zm-settings-preview-labels"},[e.createElementVNode("span",null,"根"),e.createElementVNode("span",null,"1级"),e.createElementVNode("span",null,"2级"),e.createElementVNode("span",null,"3级")],-1))])])),t.hasSelection?(e.openBlock(),e.createElementBlock("section",Sd,[e.createElementVNode("h4",Td,[h[34]||(h[34]=e.createTextVNode(" 节点 ",-1)),t.selectedNodeText?(e.openBlock(),e.createElementBlock("span",Cd,"“"+e.toDisplayString(t.selectedNodeText)+"”",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",_d,[h[35]||(h[35]=e.createElementVNode("span",{class:"zm-settings-label"},"背景颜色",-1)),e.createElementVNode("span",Ad,e.toDisplayString(c.bg||"默认"),1)]),e.createElementVNode("div",Md,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(v,O=>e.createElementVNode("button",{key:"bg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:G=>c.bg=O},null,12,Rd)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:h[8]||(h[8]=O=>c.bg=void 0)},"∅")]),e.createElementVNode("div",Bd,[h[36]||(h[36]=e.createElementVNode("span",{class:"zm-settings-label"},"文字颜色",-1)),e.createElementVNode("span",zd,e.toDisplayString(c.textColor||"默认"),1)]),e.createElementVNode("div",Od,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(v,O=>e.createElementVNode("button",{key:"fg-"+O,class:"zm-swatch",style:e.normalizeStyle({background:O}),title:O,onClick:G=>c.textColor=O},null,12,Id)),64)),e.createElementVNode("button",{class:"zm-swatch is-reset",title:"清除",onClick:h[9]||(h[9]=O=>c.textColor=void 0)},"∅")]),e.createElementVNode("div",vd,[h[38]||(h[38]=e.createElementVNode("span",{class:"zm-settings-label"},"字重",-1)),e.createElementVNode("button",{class:e.normalizeClass(["zm-toggle",{"is-on":c.fontWeight===600}]),onClick:h[10]||(h[10]=O=>c.fontWeight=c.fontWeight===600?400:600)},[...h[37]||(h[37]=[e.createElementVNode("span",{class:"zm-toggle-knob"},null,-1)])],2)]),e.createElementVNode("div",{class:"zm-data-paste-actions"},[e.createElementVNode("button",{class:"zm-data-btn is-primary",onClick:u},"应用到该节点"),e.createElementVNode("button",{class:"zm-data-btn",onClick:d},"清除该节点样式")]),h[39]||(h[39]=e.createElementVNode("p",{class:"zm-settings-hint"},"仅作用于当前节点,不影响子节点。",-1))])):e.createCommentVNode("",!0),e.createElementVNode("section",Ld,[e.createElementVNode("button",{class:"zm-settings-reset",onClick:h[11]||(h[11]=O=>i("reset"))},"恢复默认设置")])]))}}),[["__scopeId","data-v-17ef65d1"]]),lr=20;function Dd(t,o){t.style.height="auto";const n=o.minRows*lr,i=o.maxRows>0?o.maxRows*lr:1/0,r=Math.max(n,Math.min(i,t.scrollHeight));t.style.height=r+"px",t.style.overflowY=t.scrollHeight>i?"auto":"hidden"}function Oo(t,o={}){const n={minRows:o.minRows??3,maxRows:o.maxRows??12};function i(){const a=t.value;a&&Dd(a,n)}function r(){i()}e.onMounted(async()=>{await e.nextTick();const a=t.value;a&&(a.addEventListener("input",r),i())}),e.watch(()=>{var a;return(a=t.value)==null?void 0:a.value},()=>i()),e.onBeforeUnmount(()=>{const a=t.value;a&&a.removeEventListener("input",r)})}function Io(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ht=Io();function ar(t){Ht=t}var Wt={exec:()=>null};function an(t){let o=[];return n=>{let i=Math.max(0,Math.min(3,n-1)),r=o[i];return r||(r=t(i),o[i]=r),r}}function be(t,o=""){let n=typeof t=="string"?t:t.source,i={replace:(r,a)=>{let c=typeof a=="string"?a:a.source;return c=c.replace(Ge.caret,"$1"),n=n.replace(r,c),i},getRegex:()=>new RegExp(n,o)};return i}var Vd=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Ge={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:an(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:an(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:an(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:an(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:an(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:an(t=>new RegExp(`^ {0,${t}}>`))},$d=/^(?:[ \t]*(?:\n|$))+/,Pd=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Fd=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Nn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ud=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,vo=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,sr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,cr=be(sr).replace(/bull/g,vo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Hd=be(sr).replace(/bull/g,vo).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Lo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Wd=/^[^\n]+/,Do=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Gd=be(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Do).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),jd=be(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,vo).getRegex(),Yn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Vo=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Kd=be("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Vo).replace("tag",Yn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),dr=be(Lo).replace("hr",Nn).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",Yn).getRegex(),qd=be(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",dr).getRegex(),$o={blockquote:qd,code:Pd,def:Gd,fences:Fd,heading:Ud,hr:Nn,html:Kd,lheading:cr,list:jd,newline:$d,paragraph:dr,table:Wt,text:Wd},ur=be("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Nn).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",Yn).getRegex(),Yd={...$o,lheading:Hd,table:ur,paragraph:be(Lo).replace("hr",Nn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ur).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",Yn).getRegex()},Xd={...$o,html:be(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Vo).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Wt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:be(Lo).replace("hr",Nn).replace("heading",` *#{1,6} *[^
|
|
66
|
+
]`).replace("lheading",cr).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Zd=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Jd=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,mr=/^( {2,}|\\)\n(?!\s*$)/,Qd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,sn=/[\p{P}\p{S}]/u,Xn=/[\s\p{P}\p{S}]/u,Po=/[^\s\p{P}\p{S}]/u,eu=be(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Xn).getRegex(),fr=/(?!~)[\p{P}\p{S}]/u,tu=/(?!~)[\s\p{P}\p{S}]/u,nu=/(?:[^\s\p{P}\p{S}]|~)/u,ou=be(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Vd?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),pr=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,iu=be(pr,"u").replace(/punct/g,sn).getRegex(),ru=be(pr,"u").replace(/punct/g,fr).getRegex(),gr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",lu=be(gr,"gu").replace(/notPunctSpace/g,Po).replace(/punctSpace/g,Xn).replace(/punct/g,sn).getRegex(),au=be(gr,"gu").replace(/notPunctSpace/g,nu).replace(/punctSpace/g,tu).replace(/punct/g,fr).getRegex(),su=be("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Po).replace(/punctSpace/g,Xn).replace(/punct/g,sn).getRegex(),cu=be(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,sn).getRegex(),du="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",uu=be(du,"gu").replace(/notPunctSpace/g,Po).replace(/punctSpace/g,Xn).replace(/punct/g,sn).getRegex(),mu=be(/\\(punct)/,"gu").replace(/punct/g,sn).getRegex(),fu=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(),pu=be(Vo).replace("(?:-->|$)","-->").getRegex(),gu=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",pu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Zn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,hu=be(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Zn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),hr=be(/^!?\[(label)\]\[(ref)\]/).replace("label",Zn).replace("ref",Do).getRegex(),br=be(/^!?\[(ref)\](?:\[\])?/).replace("ref",Do).getRegex(),bu=be("reflink|nolink(?!\\()","g").replace("reflink",hr).replace("nolink",br).getRegex(),kr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Fo={_backpedal:Wt,anyPunctuation:mu,autolink:fu,blockSkip:ou,br:mr,code:Jd,del:Wt,delLDelim:Wt,delRDelim:Wt,emStrongLDelim:iu,emStrongRDelimAst:lu,emStrongRDelimUnd:su,escape:Zd,link:hu,nolink:br,punctuation:eu,reflink:hr,reflinkSearch:bu,tag:gu,text:Qd,url:Wt},ku={...Fo,link:be(/^!?\[(label)\]\((.*?)\)/).replace("label",Zn).getRegex(),reflink:be(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Zn).getRegex()},Uo={...Fo,emStrongRDelimAst:au,emStrongLDelim:ru,delLDelim:cu,delRDelim:uu,url:be(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",kr).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",kr).getRegex()},yu={...Uo,br:be(mr).replace("{2,}","*").getRegex(),text:be(Uo.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Jn={normal:$o,gfm:Yd,pedantic:Xd},Sn={normal:Fo,gfm:Uo,breaks:yu,pedantic:ku},Eu={"&":"&","<":"<",">":">",'"':""","'":"'"},yr=t=>Eu[t];function kt(t,o){if(o){if(Ge.escapeTest.test(t))return t.replace(Ge.escapeReplace,yr)}else if(Ge.escapeTestNoEncode.test(t))return t.replace(Ge.escapeReplaceNoEncode,yr);return t}function Er(t){try{t=encodeURI(t).replace(Ge.percentDecode,"%")}catch{return null}return t}function xr(t,o){var a;let n=t.replace(Ge.findPipe,(c,u,d)=>{let m=!1,p=u;for(;--p>=0&&d[p]==="\\";)m=!m;return m?"|":" |"}),i=n.split(Ge.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!((a=i.at(-1))!=null&&a.trim())&&i.pop(),o)if(i.length>o)i.splice(o);else for(;i.length<o;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(Ge.slashPipe,"|");return i}function zt(t,o,n){let i=t.length;if(i===0)return"";let r=0;for(;r<i&&t.charAt(i-r-1)===o;)r++;return t.slice(0,i-r)}function wr(t){let o=t.split(`
|
|
67
|
+
`),n=o.length-1;for(;n>=0&&Ge.blankLine.test(o[n]);)n--;return o.length-n<=2?t:o.slice(0,n+1).join(`
|
|
68
|
+
`)}function xu(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 wu(t,o=0){let n=o,i="";for(let r of t)if(r===" "){let a=4-n%4;i+=" ".repeat(a),n+=a}else i+=r,n++;return i}function Nr(t,o,n,i,r){let a=o.href,c=o.title||null,u=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let d={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:c,text:u,tokens:i.inlineTokens(u)};return i.state.inLink=!1,d}function Nu(t,o,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return o;let r=i[1];return o.split(`
|
|
69
69
|
`).map(a=>{let c=a.match(n.other.beginningSpace);if(c===null)return a;let[u]=c;return u.length>=r.length?a.slice(r.length):a}).join(`
|
|
70
|
-
`)}var
|
|
71
|
-
`),depth:o[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:
|
|
72
|
-
`)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=
|
|
70
|
+
`)}var Qn=class{constructor(t){Be(this,"options");Be(this,"rules");Be(this,"lexer");this.options=t||Ht}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]:wr(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=Nu(n,o[3]||"",this.rules);return{type:"code",raw:n,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:i}}}heading(t){let o=this.rules.block.heading.exec(t);if(o){let n=o[2].trim();if(this.rules.other.endingHash.test(n)){let i=zt(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:zt(o[0],`
|
|
71
|
+
`),depth:o[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let o=this.rules.block.hr.exec(t);if(o)return{type:"hr",raw:zt(o[0],`
|
|
72
|
+
`)}}blockquote(t){let o=this.rules.block.blockquote.exec(t);if(o){let n=zt(o[0],`
|
|
73
73
|
`).split(`
|
|
74
|
-
`),i="",r="",a=[];for(;n.length>0;){let c=!1,u=[],
|
|
74
|
+
`),i="",r="",a=[];for(;n.length>0;){let c=!1,u=[],d;for(d=0;d<n.length;d++)if(this.rules.other.blockquoteStart.test(n[d]))u.push(n[d]),c=!0;else if(!c)u.push(n[d]);else break;n=n.slice(d);let m=u.join(`
|
|
75
75
|
`),p=m.replace(this.rules.other.blockquoteSetextReplace,`
|
|
76
76
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
77
77
|
${m}`:m,r=r?`${r}
|
|
78
|
-
${p}`:p;let
|
|
78
|
+
${p}`:p;let b=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=b,n.length===0)break;let E=a.at(-1);if((E==null?void 0:E.type)==="code")break;if((E==null?void 0:E.type)==="blockquote"){let w=E,y=w.raw+`
|
|
79
79
|
`+n.join(`
|
|
80
|
-
`),
|
|
80
|
+
`),v=this.blockquote(y);a[a.length-1]=v,i=i.substring(0,i.length-w.raw.length)+v.raw,r=r.substring(0,r.length-w.text.length)+v.text;break}else if((E==null?void 0:E.type)==="list"){let w=E,y=w.raw+`
|
|
81
81
|
`+n.join(`
|
|
82
|
-
`),
|
|
83
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:a,text:r}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let a=this.rules.other.listItemRegex(n),c=!1;for(;t;){let
|
|
84
|
-
`,1)[0],o[1].length),
|
|
85
|
-
`,1)[0],w=!
|
|
86
|
-
`,t=t.substring(
|
|
87
|
-
`,1)[0],h;if(
|
|
88
|
-
`+h.slice(
|
|
89
|
-
`+
|
|
90
|
-
`,t=t.substring(
|
|
91
|
-
`),href:i,title:r}}}table(t){var c;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=
|
|
92
|
-
`):[],a={type:"table",raw:
|
|
93
|
-
`),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u<n.length;u++)a.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:a.align[u]});for(let u of r)a.rows.push(
|
|
82
|
+
`),v=this.list(y);a[a.length-1]=v,i=i.substring(0,i.length-E.raw.length)+v.raw,r=r.substring(0,r.length-w.raw.length)+v.raw,n=y.substring(a.at(-1).raw.length).split(`
|
|
83
|
+
`);continue}}return{type:"blockquote",raw:i,tokens:a,text:r}}}list(t){let o=this.rules.block.list.exec(t);if(o){let n=o[1].trim(),i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let a=this.rules.other.listItemRegex(n),c=!1;for(;t;){let d=!1,m="",p="";if(!(o=a.exec(t))||this.rules.block.hr.test(t))break;m=o[0],t=t.substring(m.length);let b=wu(o[2].split(`
|
|
84
|
+
`,1)[0],o[1].length),E=t.split(`
|
|
85
|
+
`,1)[0],w=!b.trim(),y=0;if(this.options.pedantic?(y=2,p=b.trimStart()):w?y=o[1].length+1:(y=b.search(this.rules.other.nonSpaceChar),y=y>4?1:y,p=b.slice(y),y+=o[1].length),w&&this.rules.other.blankLine.test(E)&&(m+=E+`
|
|
86
|
+
`,t=t.substring(E.length+1),d=!0),!d){let v=this.rules.other.nextBulletRegex(y),_=this.rules.other.hrRegex(y),x=this.rules.other.fencesBeginRegex(y),g=this.rules.other.headingBeginRegex(y),C=this.rules.other.htmlBeginRegex(y),A=this.rules.other.blockquoteBeginRegex(y);for(;t;){let T=t.split(`
|
|
87
|
+
`,1)[0],h;if(E=T,this.options.pedantic?(E=E.replace(this.rules.other.listReplaceNesting," "),h=E):h=E.replace(this.rules.other.tabCharGlobal," "),x.test(E)||g.test(E)||C.test(E)||A.test(E)||v.test(E)||_.test(E))break;if(h.search(this.rules.other.nonSpaceChar)>=y||!E.trim())p+=`
|
|
88
|
+
`+h.slice(y);else{if(w||b.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(b)||g.test(b)||_.test(b))break;p+=`
|
|
89
|
+
`+E}w=!E.trim(),m+=T+`
|
|
90
|
+
`,t=t.substring(T.length+1),b=h.slice(y)}}r.loose||(c?r.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0)),r.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),r.raw+=m}let u=r.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let d of r.items){this.lexer.state.top=!1,d.tokens=this.lexer.blockTokens(d.text,[]);let m=d.tokens[0];if(d.task&&((m==null?void 0:m.type)==="text"||(m==null?void 0:m.type)==="paragraph")){d.text=d.text.replace(this.rules.other.listReplaceTask,""),m.raw=m.raw.replace(this.rules.other.listReplaceTask,""),m.text=m.text.replace(this.rules.other.listReplaceTask,"");for(let b=this.lexer.inlineQueue.length-1;b>=0;b--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[b].src)){this.lexer.inlineQueue[b].src=this.lexer.inlineQueue[b].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(d.raw);if(p){let b={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};d.checked=b.checked,r.loose?d.tokens[0]&&["paragraph","text"].includes(d.tokens[0].type)&&"tokens"in d.tokens[0]&&d.tokens[0].tokens?(d.tokens[0].raw=b.raw+d.tokens[0].raw,d.tokens[0].text=b.raw+d.tokens[0].text,d.tokens[0].tokens.unshift(b)):d.tokens.unshift({type:"paragraph",raw:b.raw,text:b.raw,tokens:[b]}):d.tokens.unshift(b)}}else d.task&&(d.task=!1);if(!r.loose){let p=d.tokens.filter(E=>E.type==="space"),b=p.length>0&&p.some(E=>this.rules.other.anyLine.test(E.raw));r.loose=b}}if(r.loose)for(let d of r.items){d.loose=!0;for(let m of d.tokens)m.type==="text"&&(m.type="paragraph")}return r}}html(t){let o=this.rules.block.html.exec(t);if(o){let n=wr(o[0]);return{type:"html",block:!0,raw:n,pre:o[1]==="pre"||o[1]==="script"||o[1]==="style",text:n}}}def(t){let o=this.rules.block.def.exec(t);if(o){let n=o[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=o[2]?o[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=o[3]?o[3].substring(1,o[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):o[3];return{type:"def",tag:n,raw:zt(o[0],`
|
|
91
|
+
`),href:i,title:r}}}table(t){var c;let o=this.rules.block.table.exec(t);if(!o||!this.rules.other.tableDelimiter.test(o[2]))return;let n=xr(o[1]),i=o[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(c=o[3])!=null&&c.trim()?o[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
92
|
+
`):[],a={type:"table",raw:zt(o[0],`
|
|
93
|
+
`),header:[],align:[],rows:[]};if(n.length===i.length){for(let u of i)this.rules.other.tableAlignRight.test(u)?a.align.push("right"):this.rules.other.tableAlignCenter.test(u)?a.align.push("center"):this.rules.other.tableAlignLeft.test(u)?a.align.push("left"):a.align.push(null);for(let u=0;u<n.length;u++)a.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:a.align[u]});for(let u of r)a.rows.push(xr(u,a.header.length).map((d,m)=>({text:d,tokens:this.lexer.inline(d),header:!1,align:a.align[m]})));return a}}lheading(t){let o=this.rules.block.lheading.exec(t);if(o){let n=o[1].trim();return{type:"heading",raw:zt(o[0],`
|
|
94
94
|
`),depth:o[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let o=this.rules.block.paragraph.exec(t);if(o){let n=o[1].charAt(o[1].length-1)===`
|
|
95
|
-
`?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=
|
|
96
|
-
`),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],i=!1){var a,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(
|
|
97
|
-
`:n.push(
|
|
95
|
+
`?o[1].slice(0,-1):o[1];return{type:"paragraph",raw:o[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let o=this.rules.block.text.exec(t);if(o)return{type:"text",raw:o[0],text:o[0],tokens:this.lexer.inline(o[0])}}escape(t){let o=this.rules.inline.escape.exec(t);if(o)return{type:"escape",raw:o[0],text:o[1]}}tag(t){let o=this.rules.inline.tag.exec(t);if(o)return!this.lexer.state.inLink&&this.rules.other.startATag.test(o[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(o[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(o[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(o[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:o[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:o[0]}}link(t){let o=this.rules.inline.link.exec(t);if(o){let n=o[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=zt(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=xu(o[2],"()");if(a===-2)return;if(a>-1){let c=(o[0].indexOf("!")===0?5:4)+o[1].length+a;o[2]=o[2].substring(0,a),o[0]=o[0].substring(0,c).trim(),o[3]=""}}let i=o[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],r=a[3])}else r=o[3]?o[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Nr(o,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},o[0],this.lexer,this.rules)}}reflink(t,o){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=o[i.toLowerCase()];if(!r){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return Nr(n,r,n[0],this.lexer,this.rules)}}emStrong(t,o,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!n||this.rules.inline.punctuation.exec(n))){let r=[...i[0]].length-1,a,c,u=r,d=0,m=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,o=o.slice(-1*t.length+r);(i=m.exec(o))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(c=[...a].length,i[3]||i[4]){u+=c;continue}else if((i[5]||i[6])&&r%3&&!((r+c)%3)){d+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+d);let p=[...i[0]][0].length,b=t.slice(0,r+i.index+p+c);if(Math.min(r,c)%2){let w=b.slice(1,-1);return{type:"em",raw:b,text:w,tokens:this.lexer.inlineTokens(w)}}let E=b.slice(2,-2);return{type:"strong",raw:b,text:E,tokens:this.lexer.inlineTokens(E)}}}}codespan(t){let o=this.rules.inline.code.exec(t);if(o){let n=o[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:o[0],text:n}}}br(t){let o=this.rules.inline.br.exec(t);if(o)return{type:"br",raw:o[0]}}del(t,o,n=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!n||this.rules.inline.punctuation.exec(n))){let r=[...i[0]].length-1,a,c,u=r,d=this.rules.inline.delRDelim;for(d.lastIndex=0,o=o.slice(-1*t.length+r);(i=d.exec(o))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(c=[...a].length,c!==r))continue;if(i[3]||i[4]){u+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u);let m=[...i[0]][0].length,p=t.slice(0,r+i.index+m+c),b=p.slice(r,-r);return{type:"del",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}}}autolink(t){let o=this.rules.inline.autolink.exec(t);if(o){let n,i;return o[2]==="@"?(n=o[1],i="mailto:"+n):(n=o[1],i=n),{type:"link",raw:o[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){var n;let o;if(o=this.rules.inline.url.exec(t)){let i,r;if(o[2]==="@")i=o[0],r="mailto:"+i;else{let a;do a=o[0],o[0]=((n=this.rules.inline._backpedal.exec(o[0]))==null?void 0:n[0])??"";while(a!==o[0]);i=o[0],o[1]==="www."?r="http://"+o[0]:r=o[0]}return{type:"link",raw:o[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t){let o=this.rules.inline.text.exec(t);if(o){let n=this.lexer.state.inRawBlock;return{type:"text",raw:o[0],text:o[0],escaped:n}}}},st=class ii{constructor(o){Be(this,"tokens");Be(this,"options");Be(this,"state");Be(this,"inlineQueue");Be(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=o||Ht,this.options.tokenizer=this.options.tokenizer||new Qn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Ge,block:Jn.normal,inline:Sn.normal};this.options.pedantic?(n.block=Jn.pedantic,n.inline=Sn.pedantic):this.options.gfm&&(n.block=Jn.gfm,this.options.breaks?n.inline=Sn.breaks:n.inline=Sn.gfm),this.tokenizer.rules=n}static get rules(){return{block:Jn,inline:Sn}}static lex(o,n){return new ii(n).lex(o)}static lexInline(o,n){return new ii(n).inlineTokens(o)}lex(o){o=o.replace(Ge.carriageReturn,`
|
|
96
|
+
`),this.blockTokens(o,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(o,n=[],i=!1){var a,c,u;this.tokenizer.lexer=this,this.options.pedantic&&(o=o.replace(Ge.tabCharGlobal," ").replace(Ge.spaceLine,""));let r=1/0;for(;o;){if(o.length<r)r=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}let d;if((c=(a=this.options.extensions)==null?void 0:a.block)!=null&&c.some(p=>(d=p.call({lexer:this},o,n))?(o=o.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.space(o)){o=o.substring(d.raw.length);let p=n.at(-1);d.raw.length===1&&p!==void 0?p.raw+=`
|
|
97
|
+
`:n.push(d);continue}if(d=this.tokenizer.code(o)){o=o.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
|
98
98
|
`)?"":`
|
|
99
|
-
`)+
|
|
100
|
-
`+
|
|
99
|
+
`)+d.raw,p.text+=`
|
|
100
|
+
`+d.text,this.inlineQueue.at(-1).src=p.text):n.push(d);continue}if(d=this.tokenizer.fences(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.heading(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.hr(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.blockquote(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.list(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.html(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.def(o)){o=o.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="paragraph"||(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
|
101
101
|
`)?"":`
|
|
102
|
-
`)+
|
|
103
|
-
`+
|
|
102
|
+
`)+d.raw,p.text+=`
|
|
103
|
+
`+d.raw,this.inlineQueue.at(-1).src=p.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title},n.push(d));continue}if(d=this.tokenizer.table(o)){o=o.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.lheading(o)){o=o.substring(d.raw.length),n.push(d);continue}let m=o;if((u=this.options.extensions)!=null&&u.startBlock){let p=1/0,b=o.slice(1),E;this.options.extensions.startBlock.forEach(w=>{E=w.call({lexer:this},b),typeof E=="number"&&E>=0&&(p=Math.min(p,E))}),p<1/0&&p>=0&&(m=o.substring(0,p+1))}if(this.state.top&&(d=this.tokenizer.paragraph(m))){let p=n.at(-1);i&&(p==null?void 0:p.type)==="paragraph"?(p.raw+=(p.raw.endsWith(`
|
|
104
104
|
`)?"":`
|
|
105
|
-
`)+
|
|
106
|
-
`+
|
|
105
|
+
`)+d.raw,p.text+=`
|
|
106
|
+
`+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(d),i=m.length!==o.length,o=o.substring(d.raw.length);continue}if(d=this.tokenizer.text(o)){o=o.substring(d.raw.length);let p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=(p.raw.endsWith(`
|
|
107
107
|
`)?"":`
|
|
108
|
-
`)+
|
|
109
|
-
`+
|
|
110
|
-
`;return i?'<pre><code class="language-'+
|
|
111
|
-
`:"<pre><code>"+(n?r:
|
|
108
|
+
`)+d.raw,p.text+=`
|
|
109
|
+
`+d.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=p.text):n.push(d);continue}if(o){this.infiniteLoopError(o.charCodeAt(0));break}}return this.state.top=!0,n}inline(o,n=[]){return this.inlineQueue.push({src:o,tokens:n}),n}inlineTokens(o,n=[]){var m,p,b,E,w;this.tokenizer.lexer=this;let i=o,r=null;if(this.tokens.links){let y=Object.keys(this.tokens.links);if(y.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!==null;)y.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!==null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!==null;)a=r[2]?r[2].length:0,i=i.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=((p=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:p.call({lexer:this},i))??i;let c=!1,u="",d=1/0;for(;o;){if(o.length<d)d=o.length;else{this.infiniteLoopError(o.charCodeAt(0));break}c||(u=""),c=!1;let y;if((E=(b=this.options.extensions)==null?void 0:b.inline)!=null&&E.some(_=>(y=_.call({lexer:this},o,n))?(o=o.substring(y.raw.length),n.push(y),!0):!1))continue;if(y=this.tokenizer.escape(o)){o=o.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.tag(o)){o=o.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.link(o)){o=o.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.reflink(o,this.tokens.links)){o=o.substring(y.raw.length);let _=n.at(-1);y.type==="text"&&(_==null?void 0:_.type)==="text"?(_.raw+=y.raw,_.text+=y.text):n.push(y);continue}if(y=this.tokenizer.emStrong(o,i,u)){o=o.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.codespan(o)){o=o.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.br(o)){o=o.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.del(o,i,u)){o=o.substring(y.raw.length),n.push(y);continue}if(y=this.tokenizer.autolink(o)){o=o.substring(y.raw.length),n.push(y);continue}if(!this.state.inLink&&(y=this.tokenizer.url(o))){o=o.substring(y.raw.length),n.push(y);continue}let v=o;if((w=this.options.extensions)!=null&&w.startInline){let _=1/0,x=o.slice(1),g;this.options.extensions.startInline.forEach(C=>{g=C.call({lexer:this},x),typeof g=="number"&&g>=0&&(_=Math.min(_,g))}),_<1/0&&_>=0&&(v=o.substring(0,_+1))}if(y=this.tokenizer.inlineText(v)){o=o.substring(y.raw.length),y.raw.slice(-1)!=="_"&&(u=y.raw.slice(-1)),c=!0;let _=n.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=y.raw,_.text+=y.text):n.push(y);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)}},Tn=class{constructor(t){Be(this,"options");Be(this,"parser");this.options=t||Ht}space(t){return""}code({text:t,lang:o,escaped:n}){var a;let i=(a=(o||"").match(Ge.notSpaceStart))==null?void 0:a[0],r=t.replace(Ge.endingNewline,"")+`
|
|
110
|
+
`;return i?'<pre><code class="language-'+kt(i)+'">'+(n?r:kt(r,!0))+`</code></pre>
|
|
111
|
+
`:"<pre><code>"+(n?r:kt(r,!0))+`</code></pre>
|
|
112
112
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
113
113
|
${this.parser.parse(t)}</blockquote>
|
|
114
114
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:o}){return`<h${o}>${this.parser.parseInline(t)}</h${o}>
|
|
@@ -124,12 +124,12 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
124
124
|
`}tablerow({text:t}){return`<tr>
|
|
125
125
|
${t}</tr>
|
|
126
126
|
`}tablecell(t){let o=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+o+`</${n}>
|
|
127
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${
|
|
128
|
-
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+
|
|
129
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bu(t,o){return pu(t)||gu(t,o)||ku(t,o)||hu()}function ku(t,o){if(t){if(typeof t=="string")return Nr(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nr(t,o):void 0}}const Sr=Object.entries,Tr=Object.setPrototypeOf,yu=Object.isFrozen,Eu=Object.getPrototypeOf,xu=Object.getOwnPropertyDescriptor;let Xe=Object.freeze,lt=Object.seal,Qt=Object.create,Cr=typeof Reflect<"u"&&Reflect,Fo=Cr.apply,Uo=Cr.construct;Xe||(Xe=function(o){return o}),lt||(lt=function(o){return o}),Fo||(Fo=function(o,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];return o.apply(n,r)}),Uo||(Uo=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new o(...i)});const $t=Fe(Array.prototype.forEach),wu=Fe(Array.prototype.lastIndexOf),_r=Fe(Array.prototype.pop),en=Fe(Array.prototype.push),Nu=Fe(Array.prototype.splice),Je=Array.isArray,wn=Fe(String.prototype.toLowerCase),Ho=Fe(String.prototype.toString),Ar=Fe(String.prototype.match),tn=Fe(String.prototype.replace),Mr=Fe(String.prototype.indexOf),Su=Fe(String.prototype.trim),Tu=Fe(Number.prototype.toString),Cu=Fe(Boolean.prototype.toString),Rr=typeof BigInt>"u"?null:Fe(BigInt.prototype.toString),Br=typeof Symbol>"u"?null:Fe(Symbol.prototype.toString),Oe=Fe(Object.prototype.hasOwnProperty),Nn=Fe(Object.prototype.toString),We=Fe(RegExp.prototype.test),nn=_u(TypeError);function Fe(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Fo(t,o,i)}}function _u(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Uo(t,n)}}function de(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wn;if(Tr&&Tr(t,null),!Je(o))return t;let i=o.length;for(;i--;){let r=o[i];if(typeof r=="string"){const a=n(r);a!==r&&(yu(o)||(o[i]=a),r=a)}t[r]=!0}return t}function Au(t){for(let o=0;o<t.length;o++)Oe(t,o)||(t[o]=null);return t}function Ye(t){const o=Qt(null);for(const i of Sr(t)){var n=bu(i,2);const r=n[0],a=n[1];Oe(t,r)&&(Je(a)?o[r]=Au(a):a&&typeof a=="object"&&a.constructor===Object?o[r]=Ye(a):o[r]=a)}return o}function Mu(t){switch(typeof t){case"string":return t;case"number":return Tu(t);case"boolean":return Cu(t);case"bigint":return Rr?Rr(t):"0";case"symbol":return Br?Br(t):"Symbol()";case"undefined":return Nn(t);case"function":case"object":{if(t===null)return Nn(t);const o=t,n=ht(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:Nn(i)}return Nn(t)}default:return Nn(t)}}function ht(t,o){for(;t!==null;){const i=xu(t,o);if(i){if(i.get)return Fe(i.get);if(typeof i.value=="function")return Fe(i.value)}t=Eu(t)}function n(){return null}return n}function Ru(t){try{return We(t,""),!0}catch{return!1}}const zr=Xe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wo=Xe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Go=Xe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Bu=Xe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),jo=Xe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),zu=Xe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Or=Xe(["#text"]),Ir=Xe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Ko=Xe(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),vr=Xe(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Zn=Xe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ou=lt(/{{[\w\W]*|^[\w\W]*}}/g),Iu=lt(/<%[\w\W]*|^[\w\W]*%>/g),vu=lt(/\${[\w\W]*/g),Lu=lt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Du=lt(/^aria-[\-\w]+$/),Lr=lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Vu=lt(/^(?:\w+script|data):/i),$u=lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pu=lt(/^html$/i),Fu=lt(/^[a-z][.\w]*(-[.\w]+)+$/i),bt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Uu=function(){return typeof window>"u"?null:window},Hu=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));const a="dompurify"+(i?"#"+i:"");try{return o.createPolicy(a,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},Dr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Vr(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Uu();const o=J=>Vr(J);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==bt.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,r=i.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,c=t.Node,u=t.Element,s=t.NodeFilter,m=t.NamedNodeMap;m===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const p=t.DOMParser,g=t.trustedTypes,y=u.prototype,w=ht(y,"cloneNode"),k=ht(y,"remove"),b=ht(y,"nextSibling"),_=ht(y,"childNodes"),x=ht(y,"parentNode"),M=ht(y,"shadowRoot"),S=ht(y,"attributes"),A=c&&c.prototype?ht(c.prototype,"nodeType"):null,C=c&&c.prototype?ht(c.prototype,"nodeName"):null;if(typeof a=="function"){const J=n.createElement("template");J.content&&J.content.ownerDocument&&(n=J.content.ownerDocument)}let h,O="",W=0;const oe=function(f){if(W>0)throw nn('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');W++;try{return h.createHTML(f)}finally{W--}},K=n,te=K.implementation,le=K.createNodeIterator,G=K.createDocumentFragment,Y=K.getElementsByTagName,F=i.importNode;let N=Dr();o.isSupported=typeof Sr=="function"&&typeof x=="function"&&te&&te.createHTMLDocument!==void 0;const $=Ou,L=Iu,j=vu,X=Lu,ge=Du,Be=Vu,Ue=$u,Le=Fu;let v=Lr,B=null;const ie=de({},[...zr,...Wo,...Go,...jo,...Or]);let ae=null;const D=de({},[...Ir,...Ko,...vr,...Zn]);let T=Object.seal(Qt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ue=null,me=null;const De=Object.seal(Qt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ze=!0,Ge=!0,on=!1,St=!0,ee=!1,mt=!0,Me=!1,ye=!1,kt=!1,je=!1,Qe=!1,yt=!1,U=!0,Z=!1;const se="user-content-";let he=!0,Re=!1,He={},et=null;const Pt=de({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let rn=null;const ln=de({},["audio","video","img","source","image","track"]);let at=null;const Ve=de({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),we="http://www.w3.org/1998/Math/MathML",an="http://www.w3.org/2000/svg",Ie="http://www.w3.org/1999/xhtml";let Q=Ie,sn=!1,cn=null;const Yo=de({},[we,an,Ie],Ho);let dn=de({},["mi","mo","mn","ms","mtext"]),Sn=de({},["annotation-xml"]);const Zo=de({},["title","style","font","a","script"]);let Et=null;const Xo=["application/xhtml+xml","text/html"],Jn="text/html";let Ce=null,Bt=null;const Jo=n.createElement("form"),Qn=function(f){return f instanceof RegExp||f instanceof Function},Tn=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Bt&&Bt===f)return;(!f||typeof f!="object")&&(f={}),f=Ye(f),Et=Xo.indexOf(f.PARSER_MEDIA_TYPE)===-1?Jn:f.PARSER_MEDIA_TYPE,Ce=Et==="application/xhtml+xml"?Ho:wn,B=Oe(f,"ALLOWED_TAGS")&&Je(f.ALLOWED_TAGS)?de({},f.ALLOWED_TAGS,Ce):ie,ae=Oe(f,"ALLOWED_ATTR")&&Je(f.ALLOWED_ATTR)?de({},f.ALLOWED_ATTR,Ce):D,cn=Oe(f,"ALLOWED_NAMESPACES")&&Je(f.ALLOWED_NAMESPACES)?de({},f.ALLOWED_NAMESPACES,Ho):Yo,at=Oe(f,"ADD_URI_SAFE_ATTR")&&Je(f.ADD_URI_SAFE_ATTR)?de(Ye(Ve),f.ADD_URI_SAFE_ATTR,Ce):Ve,rn=Oe(f,"ADD_DATA_URI_TAGS")&&Je(f.ADD_DATA_URI_TAGS)?de(Ye(ln),f.ADD_DATA_URI_TAGS,Ce):ln,et=Oe(f,"FORBID_CONTENTS")&&Je(f.FORBID_CONTENTS)?de({},f.FORBID_CONTENTS,Ce):Pt,ue=Oe(f,"FORBID_TAGS")&&Je(f.FORBID_TAGS)?de({},f.FORBID_TAGS,Ce):Ye({}),me=Oe(f,"FORBID_ATTR")&&Je(f.FORBID_ATTR)?de({},f.FORBID_ATTR,Ce):Ye({}),He=Oe(f,"USE_PROFILES")?f.USE_PROFILES&&typeof f.USE_PROFILES=="object"?Ye(f.USE_PROFILES):f.USE_PROFILES:!1,Ze=f.ALLOW_ARIA_ATTR!==!1,Ge=f.ALLOW_DATA_ATTR!==!1,on=f.ALLOW_UNKNOWN_PROTOCOLS||!1,St=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ee=f.SAFE_FOR_TEMPLATES||!1,mt=f.SAFE_FOR_XML!==!1,Me=f.WHOLE_DOCUMENT||!1,je=f.RETURN_DOM||!1,Qe=f.RETURN_DOM_FRAGMENT||!1,yt=f.RETURN_TRUSTED_TYPE||!1,kt=f.FORCE_BODY||!1,U=f.SANITIZE_DOM!==!1,Z=f.SANITIZE_NAMED_PROPS||!1,he=f.KEEP_CONTENT!==!1,Re=f.IN_PLACE||!1,v=Ru(f.ALLOWED_URI_REGEXP)?f.ALLOWED_URI_REGEXP:Lr,Q=typeof f.NAMESPACE=="string"?f.NAMESPACE:Ie,dn=Oe(f,"MATHML_TEXT_INTEGRATION_POINTS")&&f.MATHML_TEXT_INTEGRATION_POINTS&&typeof f.MATHML_TEXT_INTEGRATION_POINTS=="object"?Ye(f.MATHML_TEXT_INTEGRATION_POINTS):de({},["mi","mo","mn","ms","mtext"]),Sn=Oe(f,"HTML_INTEGRATION_POINTS")&&f.HTML_INTEGRATION_POINTS&&typeof f.HTML_INTEGRATION_POINTS=="object"?Ye(f.HTML_INTEGRATION_POINTS):de({},["annotation-xml"]);const z=Oe(f,"CUSTOM_ELEMENT_HANDLING")&&f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING=="object"?Ye(f.CUSTOM_ELEMENT_HANDLING):Qt(null);if(T=Qt(null),Oe(z,"tagNameCheck")&&Qn(z.tagNameCheck)&&(T.tagNameCheck=z.tagNameCheck),Oe(z,"attributeNameCheck")&&Qn(z.attributeNameCheck)&&(T.attributeNameCheck=z.attributeNameCheck),Oe(z,"allowCustomizedBuiltInElements")&&typeof z.allowCustomizedBuiltInElements=="boolean"&&(T.allowCustomizedBuiltInElements=z.allowCustomizedBuiltInElements),ee&&(Ge=!1),Qe&&(je=!0),He&&(B=de({},Or),ae=Qt(null),He.html===!0&&(de(B,zr),de(ae,Ir)),He.svg===!0&&(de(B,Wo),de(ae,Ko),de(ae,Zn)),He.svgFilters===!0&&(de(B,Go),de(ae,Ko),de(ae,Zn)),He.mathMl===!0&&(de(B,jo),de(ae,vr),de(ae,Zn))),De.tagCheck=null,De.attributeCheck=null,Oe(f,"ADD_TAGS")&&(typeof f.ADD_TAGS=="function"?De.tagCheck=f.ADD_TAGS:Je(f.ADD_TAGS)&&(B===ie&&(B=Ye(B)),de(B,f.ADD_TAGS,Ce))),Oe(f,"ADD_ATTR")&&(typeof f.ADD_ATTR=="function"?De.attributeCheck=f.ADD_ATTR:Je(f.ADD_ATTR)&&(ae===D&&(ae=Ye(ae)),de(ae,f.ADD_ATTR,Ce))),Oe(f,"ADD_URI_SAFE_ATTR")&&Je(f.ADD_URI_SAFE_ATTR)&&de(at,f.ADD_URI_SAFE_ATTR,Ce),Oe(f,"FORBID_CONTENTS")&&Je(f.FORBID_CONTENTS)&&(et===Pt&&(et=Ye(et)),de(et,f.FORBID_CONTENTS,Ce)),Oe(f,"ADD_FORBID_CONTENTS")&&Je(f.ADD_FORBID_CONTENTS)&&(et===Pt&&(et=Ye(et)),de(et,f.ADD_FORBID_CONTENTS,Ce)),he&&(B["#text"]=!0),Me&&de(B,["html","head","body"]),B.table&&(de(B,["tbody"]),delete ue.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw nn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw nn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const H=h;h=f.TRUSTED_TYPES_POLICY;try{O=oe("")}catch(ke){throw h=H,ke}}else h===void 0&&f.TRUSTED_TYPES_POLICY!==null&&(h=Hu(g,r)),h&&typeof O=="string"&&(O=oe(""));(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&B===ie&&(B=Ye(B)),N.uponSanitizeAttribute.length>0&&ae===D&&(ae=Ye(ae)),Xe&&Xe(f),Bt=f},eo=de({},[...Wo,...Go,...Bu]),to=de({},[...jo,...zu]),no=function(f){let z=x(f);(!z||!z.tagName)&&(z={namespaceURI:Q,tagName:"template"});const H=wn(f.tagName),ke=wn(z.tagName);return cn[f.namespaceURI]?f.namespaceURI===an?z.namespaceURI===Ie?H==="svg":z.namespaceURI===we?H==="svg"&&(ke==="annotation-xml"||dn[ke]):!!eo[H]:f.namespaceURI===we?z.namespaceURI===Ie?H==="math":z.namespaceURI===an?H==="math"&&Sn[ke]:!!to[H]:f.namespaceURI===Ie?z.namespaceURI===an&&!Sn[ke]||z.namespaceURI===we&&!dn[ke]?!1:!to[H]&&(Zo[H]||!eo[H]):!!(Et==="application/xhtml+xml"&&cn[f.namespaceURI]):!1},ne=function(f){en(o.removed,{element:f});try{x(f).removeChild(f)}catch{k(f)}},$e=function(f,z){try{en(o.removed,{attribute:z.getAttributeNode(f),from:z})}catch{en(o.removed,{attribute:null,from:z})}if(z.removeAttribute(f),f==="is")if(je||Qe)try{ne(z)}catch{}else try{z.setAttribute(f,"")}catch{}},Cn=function(f){let z=null,H=null;if(kt)f="<remove></remove>"+f;else{const Ne=Ar(f,/^[\r\n\t ]+/);H=Ne&&Ne[0]}Et==="application/xhtml+xml"&&Q===Ie&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const ke=h?oe(f):f;if(Q===Ie)try{z=new p().parseFromString(ke,Et)}catch{}if(!z||!z.documentElement){z=te.createDocument(Q,"template",null);try{z.documentElement.innerHTML=sn?O:ke}catch{}}const ce=z.body||z.documentElement;return f&&H&&ce.insertBefore(n.createTextNode(H),ce.childNodes[0]||null),Q===Ie?Y.call(z,Me?"html":"body")[0]:Me?z.documentElement:ce},un=function(f){return le.call(f.ownerDocument||f,f,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT|s.SHOW_PROCESSING_INSTRUCTION|s.SHOW_CDATA_SECTION,null)},_n=function(f){var z,H;f.normalize();const ke=le.call(f.ownerDocument||f,f,s.SHOW_TEXT|s.SHOW_COMMENT|s.SHOW_CDATA_SECTION|s.SHOW_PROCESSING_INSTRUCTION,null);let ce=ke.nextNode();for(;ce;){let ze=ce.data;$t([$,L,j],nt=>{ze=tn(ze,nt," ")}),ce.data=ze,ce=ke.nextNode()}const Ne=(z=(H=f.querySelectorAll)===null||H===void 0?void 0:H.call(f,"template"))!==null&&z!==void 0?z:[];$t(Array.from(Ne),ze=>{Tt(ze.content)&&_n(ze.content)})},mn=function(f){const z=C?C(f):null;return typeof z!="string"||Ce(z)!=="form"?!1:typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||f.attributes!==S(f)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function"||f.nodeType!==A(f)||f.childNodes!==_(f)},Tt=function(f){if(!A||typeof f!="object"||f===null)return!1;try{return A(f)===bt.documentFragment}catch{return!1}},xt=function(f){if(!A||typeof f!="object"||f===null)return!1;try{return typeof A(f)=="number"}catch{return!1}};function tt(J,f,z){$t(J,H=>{H.call(o,f,z,Bt)})}const oo=function(f){let z=null;if(tt(N.beforeSanitizeElements,f,null),mn(f))return ne(f),!0;const H=Ce(C?C(f):f.nodeName);if(tt(N.uponSanitizeElement,f,{tagName:H,allowedTags:B}),mt&&f.hasChildNodes()&&!xt(f.firstElementChild)&&We(/<[/\w!]/g,f.innerHTML)&&We(/<[/\w!]/g,f.textContent)||mt&&f.namespaceURI===Ie&&H==="style"&&xt(f.firstElementChild)||f.nodeType===bt.progressingInstruction||mt&&f.nodeType===bt.comment&&We(/<[/\w]/g,f.data))return ne(f),!0;if(ue[H]||!(De.tagCheck instanceof Function&&De.tagCheck(H))&&!B[H]){if(!ue[H]&&lo(H)&&(T.tagNameCheck instanceof RegExp&&We(T.tagNameCheck,H)||T.tagNameCheck instanceof Function&&T.tagNameCheck(H)))return!1;if(he&&!et[H]){const ce=x(f),Ne=_(f);if(Ne&&ce){const ze=Ne.length;for(let nt=ze-1;nt>=0;--nt){const ot=w(Ne[nt],!0);ce.insertBefore(ot,b(f))}}}return ne(f),!0}return(A?A(f):f.nodeType)===bt.element&&!no(f)||(H==="noscript"||H==="noembed"||H==="noframes")&&We(/<\/no(script|embed|frames)/i,f.innerHTML)?(ne(f),!0):(ee&&f.nodeType===bt.text&&(z=f.textContent,$t([$,L,j],ce=>{z=tn(z,ce," ")}),f.textContent!==z&&(en(o.removed,{element:f.cloneNode()}),f.textContent=z)),tt(N.afterSanitizeElements,f,null),!1)},io=function(f,z,H){if(me[z]||U&&(z==="id"||z==="name")&&(H in n||H in Jo))return!1;const ke=ae[z]||De.attributeCheck instanceof Function&&De.attributeCheck(z,f);if(!(Ge&&!me[z]&&We(X,z))){if(!(Ze&&We(ge,z))){if(!ke||me[z]){if(!(lo(f)&&(T.tagNameCheck instanceof RegExp&&We(T.tagNameCheck,f)||T.tagNameCheck instanceof Function&&T.tagNameCheck(f))&&(T.attributeNameCheck instanceof RegExp&&We(T.attributeNameCheck,z)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(z,f))||z==="is"&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&We(T.tagNameCheck,H)||T.tagNameCheck instanceof Function&&T.tagNameCheck(H))))return!1}else if(!at[z]){if(!We(v,tn(H,Ue,""))){if(!((z==="src"||z==="xlink:href"||z==="href")&&f!=="script"&&Mr(H,"data:")===0&&rn[f])){if(!(on&&!We(Be,tn(H,Ue,"")))){if(H)return!1}}}}}}return!0},ro=de({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),lo=function(f){return!ro[wn(f)]&&We(Le,f)},ao=function(f){tt(N.beforeSanitizeAttributes,f,null);const z=f.attributes;if(!z||mn(f))return;const H={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae,forceKeepAttr:void 0};let ke=z.length;for(;ke--;){const ce=z[ke],Ne=ce.name,ze=ce.namespaceURI,nt=ce.value,ot=Ce(Ne),pn=nt;let Pe=Ne==="value"?pn:Su(pn);if(H.attrName=ot,H.attrValue=Pe,H.keepAttr=!0,H.forceKeepAttr=void 0,tt(N.uponSanitizeAttribute,f,H),Pe=H.attrValue,Z&&(ot==="id"||ot==="name")&&Mr(Pe,se)!==0&&($e(Ne,f),Pe=se+Pe),mt&&We(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Pe)){$e(Ne,f);continue}if(ot==="attributename"&&Ar(Pe,"href")){$e(Ne,f);continue}if(H.forceKeepAttr)continue;if(!H.keepAttr){$e(Ne,f);continue}if(!St&&We(/\/>/i,Pe)){$e(Ne,f);continue}ee&&$t([$,L,j],An=>{Pe=tn(Pe,An," ")});const so=Ce(f.nodeName);if(!io(so,ot,Pe)){$e(Ne,f);continue}if(h&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!ze)switch(g.getAttributeType(so,ot)){case"TrustedHTML":{Pe=oe(Pe);break}case"TrustedScriptURL":{Pe=h.createScriptURL(Pe);break}}if(Pe!==pn)try{ze?f.setAttributeNS(ze,Ne,Pe):f.setAttribute(Ne,Pe),mn(f)?ne(f):_r(o.removed)}catch{$e(Ne,f)}}tt(N.afterSanitizeAttributes,f,null)},fn=function(f){let z=null;const H=un(f);for(tt(N.beforeSanitizeShadowDOM,f,null);z=H.nextNode();)if(tt(N.uponSanitizeShadowNode,z,null),oo(z),ao(z),Tt(z.content)&&fn(z.content),(A?A(z):z.nodeType)===bt.element){const ce=M?M(z):z.shadowRoot;Tt(ce)&&(zt(ce),fn(ce))}tt(N.afterSanitizeShadowDOM,f,null)},zt=function(f){const z=A?A(f):f.nodeType;if(z===bt.element){const ce=M?M(f):f.shadowRoot;Tt(ce)&&(zt(ce),fn(ce))}const H=_?_(f):f.childNodes;if(!H)return;const ke=[];$t(H,ce=>{en(ke,ce)});for(const ce of ke)zt(ce);if(z===bt.element){const ce=C?C(f):null;if(typeof ce=="string"&&Ce(ce)==="template"){const Ne=f.content;Tt(Ne)&&zt(Ne)}}};return o.sanitize=function(J){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=null,H=null,ke=null,ce=null;if(sn=!J,sn&&(J="<!-->"),typeof J!="string"&&!xt(J)&&(J=Mu(J),typeof J!="string"))throw nn("dirty is not a string, aborting");if(!o.isSupported)return J;if(ye||Tn(f),o.removed=[],typeof J=="string"&&(Re=!1),Re){const nt=C?C(J):J.nodeName;if(typeof nt=="string"){const ot=Ce(nt);if(!B[ot]||ue[ot])throw nn("root node is forbidden and cannot be sanitized in-place")}if(mn(J))throw nn("root node is clobbered and cannot be sanitized in-place");zt(J)}else if(xt(J))z=Cn("<!---->"),H=z.ownerDocument.importNode(J,!0),H.nodeType===bt.element&&H.nodeName==="BODY"||H.nodeName==="HTML"?z=H:z.appendChild(H),zt(H);else{if(!je&&!ee&&!Me&&J.indexOf("<")===-1)return h&&yt?oe(J):J;if(z=Cn(J),!z)return je?null:yt?O:""}z&&kt&&ne(z.firstChild);const Ne=un(Re?J:z);for(;ke=Ne.nextNode();)oo(ke),ao(ke),Tt(ke.content)&&fn(ke.content);if(Re)return ee&&_n(J),J;if(je){if(ee&&_n(z),Qe)for(ce=G.call(z.ownerDocument);z.firstChild;)ce.appendChild(z.firstChild);else ce=z;return(ae.shadowroot||ae.shadowrootmode)&&(ce=F.call(i,ce,!0)),ce}let ze=Me?z.outerHTML:z.innerHTML;return Me&&B["!doctype"]&&z.ownerDocument&&z.ownerDocument.doctype&&z.ownerDocument.doctype.name&&We(Pu,z.ownerDocument.doctype.name)&&(ze="<!DOCTYPE "+z.ownerDocument.doctype.name+`>
|
|
130
|
-
`+ze),ee&&$t([$,L,j],nt=>{ze=tn(ze,nt," ")}),h&&yt?oe(ze):ze},o.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tn(J),ye=!0},o.clearConfig=function(){Bt=null,ye=!1},o.isValidAttribute=function(J,f,z){Bt||Tn({});const H=Ce(J),ke=Ce(f);return io(H,ke,z)},o.addHook=function(J,f){typeof f=="function"&&en(N[J],f)},o.removeHook=function(J,f){if(f!==void 0){const z=wu(N[J],f);return z===-1?void 0:Nu(N[J],z,1)[0]}return _r(N[J])},o.removeHooks=function(J){N[J]=[]},o.removeAllHooks=function(){N=Dr()},o}var Wu=Vr();const Gu=new wr({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new En;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),r=To(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${r}</code></pre>`},t})()}),ju=["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"],Ku=["href","title","target","rel","src","alt","class","checked","type","disabled"],qu=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Yu(t){if(!t)return"";const o=Gu.parse(t,{async:!1});return Wu.sanitize(o,{ALLOWED_TAGS:ju,ALLOWED_ATTR:Ku,ALLOWED_URI_REGEXP:qu})}const Zu={class:"zm-note-panel"},Xu={key:0,class:"zm-note-empty"},Ju={class:"zm-note-header"},Qu={class:"zm-note-title-row"},em={class:"zm-note-name"},tm={class:"zm-note-meta"},nm={class:"zm-note-scroll"},om={class:"zm-note-section"},im={class:"zm-note-section-head"},rm={class:"zm-note-split"},lm=["disabled"],am={key:0,class:"zm-note-preview"},sm=["innerHTML"],cm={key:1,class:"zm-note-preview-hint"},dm={key:0,class:"zm-note-section-actions"},um={key:0,class:"zm-note-add-row"},mm={key:1,class:"zm-note-section"},fm=["disabled"],pm=["href","title"],gm={key:2,class:"zm-note-section"},hm=["disabled"],bm=["src","alt"],km={key:3,class:"zm-note-section"},ym={class:"zm-note-section-head"},Em={key:0,class:"zm-note-section-tag"},xm=["disabled"],wm={key:0,class:"zm-note-code"},Nm=["innerHTML"],Sm={key:4,class:"zm-note-section"},Tm=["disabled"],Cm={key:0,class:"zm-note-table"},_m=["onClick"],Am={class:"zm-note-table-sort-mark","aria-hidden":"true"},qo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,i=o,r=e.ref(""),a=e.ref(null);Ro(a,{minRows:4,maxRows:10});const c=e.computed(()=>!r.value||r.value.trim()===""),u=e.computed(()=>Yu(r.value)),s=e.ref(!0);function m(){s.value=!s.value}e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:ie.text]},()=>{var v,B;r.value=((B=(v=n.selectedNode)==null?void 0:v.note)==null?void 0:B.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const v=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(v){v.focus();const B=v.value.length;v.setSelectionRange(B,B)}});function p(){var ie,ae;if(n.readonly)return;const v=r.value,B=((ae=(ie=n.selectedNode)==null?void 0:ie.note)==null?void 0:ae.text)??"";v!==B&&i("apply",v)}function g(v){var B,ie;n.readonly||(v.key==="Escape"?(v.preventDefault(),r.value=((ie=(B=n.selectedNode)==null?void 0:B.note)==null?void 0:ie.text)??"",v.target.blur()):v.key==="Enter"&&(v.ctrlKey||v.metaKey)&&(v.preventDefault(),p(),v.target.blur()))}function y(){n.readonly||confirm("移除该节点的笔记?")&&(r.value="",i("remove"))}const w=e.computed(()=>{var v,B;return!!((B=(v=n.selectedNode)==null?void 0:v.link)!=null&&B.url)}),k=e.computed(()=>{var v,B;return!!((B=(v=n.selectedNode)==null?void 0:v.image)!=null&&B.src)}),b=e.computed(()=>{var v,B;return(B=(v=n.selectedNode)==null?void 0:v.richContent)==null?void 0:B.kind}),_=e.computed(()=>b.value==="code"),x=e.computed(()=>b.value==="table"),M=e.ref(!1),S=e.ref(!1),A=e.ref(!1),C=e.ref(!1);e.watch(()=>{var v;return(v=n.selectedNode)==null?void 0:v.id},()=>{M.value=!1,S.value=!1,A.value=!1,C.value=!1});const h=e.ref("");e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.link)==null?void 0:ie.url]},()=>{var v,B;h.value=((B=(v=n.selectedNode)==null?void 0:v.link)==null?void 0:B.url)??""},{immediate:!0});function O(){var ie,ae;if(n.readonly)return;const v=h.value.trim(),B=((ae=(ie=n.selectedNode)==null?void 0:ie.link)==null?void 0:ae.url)??"";v!==B&&i("set-link",v)}const W=e.ref("");e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.image)==null?void 0:ie.src]},()=>{var v,B;W.value=((B=(v=n.selectedNode)==null?void 0:v.image)==null?void 0:B.src)??""},{immediate:!0});function oe(){var ie,ae;if(n.readonly)return;const v=W.value.trim(),B=((ae=(ie=n.selectedNode)==null?void 0:ie.image)==null?void 0:ae.src)??"";v!==B&&i("set-image",v)}function K(v){const B=v.target;B.style.display="none"}function te(v){const B=v.target;B.style.display=""}const le=e.ref(""),G=e.ref(null);Ro(G,{minRows:4,maxRows:18}),e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:ie.raw]},()=>{var v,B;le.value=((B=(v=n.selectedNode)==null?void 0:v.richContent)==null?void 0:B.raw)??""},{immediate:!0});const Y=e.computed(()=>To(So(le.value),qt(le.value)));function F(){var ae,D;if(n.readonly)return;const v=le.value,B=((D=(ae=n.selectedNode)==null?void 0:ae.richContent)==null?void 0:D.raw)??"";if(v===B)return;const ie=qt(v)||void 0;i("set-rich",v?{kind:"code",raw:v,lang:ie}:null)}const N=e.ref(""),$=e.ref(null);Ro($,{minRows:4,maxRows:14});const L=e.ref(-1),j=e.ref("asc");e.watch(()=>{var v,B,ie;return[(v=n.selectedNode)==null?void 0:v.id,(ie=(B=n.selectedNode)==null?void 0:B.richContent)==null?void 0:ie.raw]},()=>{var v,B;N.value=((B=(v=n.selectedNode)==null?void 0:v.richContent)==null?void 0:B.raw)??"",L.value=-1,j.value="asc"},{immediate:!0});function X(){var ie,ae;if(n.readonly)return;const v=N.value,B=((ae=(ie=n.selectedNode)==null?void 0:ie.richContent)==null?void 0:ae.raw)??"";v!==B&&i("set-rich",v?{kind:"table",raw:v}:null)}const ge=e.computed(()=>nr(N.value)),Be=e.computed(()=>{const v=ge.value;return L.value<0||v.length<=1?v:or(v,L.value,j.value)});function Ue(v){L.value!==v?(L.value=v,j.value="asc"):j.value==="asc"?j.value="desc":L.value=-1}const Le=e.computed(()=>{const v=[];return c.value||v.push(`${r.value.length} 字`),w.value&&v.push("1 链接"),k.value&&v.push("1 图片"),_.value&&v.push("代码块"),x.value&&v.push("表格"),v.length===0?"节点没有额外内容":v.join(" · ")});return(v,B)=>{var ie,ae,D,T;return e.openBlock(),e.createElementBlock("div",Zu,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ju,[e.createElementVNode("div",Qu,[B[12]||(B[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",em,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",tm,e.toDisplayString(Le.value),1)]),e.createElementVNode("div",nm,[e.createElementVNode("section",om,[e.createElementVNode("header",im,[B[13]||(B[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),B[14]||(B[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:m},e.toDisplayString(s.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",rm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:a,"onUpdate:modelValue":B[0]||(B[0]=ue=>r.value=ue),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:p,onKeydown:g},null,40,lm),[[e.vModelText,r.value]]),s.value?(e.openBlock(),e.createElementBlock("div",am,[c.value?(e.openBlock(),e.createElementBlock("div",cm," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,sm))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",dm,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:y},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",um,[!w.value&&!M.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:B[1]||(B[1]=ue=>M.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!k.value&&!S.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:B[2]||(B[2]=ue=>S.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!_.value&&!A.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:B[3]||(B[3]=ue=>A.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!x.value&&!C.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:B[4]||(B[4]=ue=>C.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),w.value||M.value?(e.openBlock(),e.createElementBlock("section",mm,[B[15]||(B[15]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"链接")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[5]||(B[5]=ue=>h.value=ue),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:O,onKeydown:B[6]||(B[6]=e.withKeys(e.withModifiers(ue=>ue.target.blur(),["prevent"]),["enter"]))},null,40,fm),[[e.vModelText,h.value]]),w.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(ie=t.selectedNode.link)==null?void 0:ie.url,target:"_blank",rel:"noopener noreferrer",title:(ae=t.selectedNode.link)==null?void 0:ae.url},e.toDisplayString((D=t.selectedNode.link)==null?void 0:D.url),9,pm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),k.value||S.value?(e.openBlock(),e.createElementBlock("section",gm,[B[16]||(B[16]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"图片")],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":B[7]||(B[7]=ue=>W.value=ue),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:oe,onKeydown:B[8]||(B[8]=e.withKeys(e.withModifiers(ue=>ue.target.blur(),["prevent"]),["enter"]))},null,40,hm),[[e.vModelText,W.value]]),k.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"zm-note-image",src:(T=t.selectedNode.image)==null?void 0:T.src,alt:t.selectedNode.text,onError:K,onLoad:te},null,40,bm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||A.value?(e.openBlock(),e.createElementBlock("section",km,[e.createElementVNode("header",ym,[B[17]||(B[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(qt)(le.value)?(e.openBlock(),e.createElementBlock("span",Em,e.toDisplayString(e.unref(qt)(le.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:G,"onUpdate:modelValue":B[9]||(B[9]=ue=>le.value=ue),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:F},null,40,xm),[[e.vModelText,le.value]]),le.value.trim()?(e.openBlock(),e.createElementBlock("pre",wm,[e.createElementVNode("code",{innerHTML:Y.value},null,8,Nm)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),x.value||C.value?(e.openBlock(),e.createElementBlock("section",Sm,[B[18]||(B[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:$,"onUpdate:modelValue":B[10]||(B[10]=ue=>N.value=ue),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
|
|
127
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${kt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:o,tokens:n}){let i=this.parser.parseInline(n),r=Er(t);if(r===null)return i;t=r;let a='<a href="'+t+'"';return o&&(a+=' title="'+kt(o)+'"'),a+=">"+i+"</a>",a}image({href:t,title:o,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=Er(t);if(r===null)return kt(n);t=r;let a=`<img src="${t}" alt="${kt(n)}"`;return o&&(a+=` title="${kt(o)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:kt(t.text)}},Ho=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}},ct=class ri{constructor(o){Be(this,"options");Be(this,"renderer");Be(this,"textRenderer");this.options=o||Ht,this.options.renderer=this.options.renderer||new Tn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ho}static parse(o,n){return new ri(n).parse(o)}static parseInline(o,n){return new ri(n).parseInline(o)}parse(o){var i,r;this.renderer.parser=this;let n="";for(let a=0;a<o.length;a++){let c=o[a];if((r=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&r[c.type]){let d=c,m=this.options.extensions.renderers[d.type].call({parser:this},d);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(d.type)){n+=m||"";continue}}let u=c;switch(u.type){case"space":{n+=this.renderer.space(u);break}case"hr":{n+=this.renderer.hr(u);break}case"heading":{n+=this.renderer.heading(u);break}case"code":{n+=this.renderer.code(u);break}case"table":{n+=this.renderer.table(u);break}case"blockquote":{n+=this.renderer.blockquote(u);break}case"list":{n+=this.renderer.list(u);break}case"checkbox":{n+=this.renderer.checkbox(u);break}case"html":{n+=this.renderer.html(u);break}case"def":{n+=this.renderer.def(u);break}case"paragraph":{n+=this.renderer.paragraph(u);break}case"text":{n+=this.renderer.text(u);break}default:{let d='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return n}parseInline(o,n=this.renderer){var r,a;this.renderer.parser=this;let i="";for(let c=0;c<o.length;c++){let u=o[c];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[u.type]){let m=this.options.extensions.renderers[u.type].call({parser:this},u);if(m!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(u.type)){i+=m||"";continue}}let d=u;switch(d.type){case"escape":{i+=n.text(d);break}case"html":{i+=n.html(d);break}case"link":{i+=n.link(d);break}case"image":{i+=n.image(d);break}case"checkbox":{i+=n.checkbox(d);break}case"strong":{i+=n.strong(d);break}case"em":{i+=n.em(d);break}case"codespan":{i+=n.codespan(d);break}case"br":{i+=n.br(d);break}case"del":{i+=n.del(d);break}case"text":{i+=n.text(d);break}default:{let m='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return i}},Cn=(to=class{constructor(t){Be(this,"options");Be(this,"block");this.options=t||Ht}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?st.lex:st.lexInline}provideParser(t=this.block){return t?ct.parse:ct.parseInline}},Be(to,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Be(to,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),to),Sr=class{constructor(...t){Be(this,"defaults",Io());Be(this,"options",this.setOptions);Be(this,"parse",this.parseMarkdown(!0));Be(this,"parseInline",this.parseMarkdown(!1));Be(this,"Parser",ct);Be(this,"Renderer",Tn);Be(this,"TextRenderer",Ho);Be(this,"Lexer",st);Be(this,"Tokenizer",Qn);Be(this,"Hooks",Cn);this.use(...t)}walkTokens(t,o){var i,r;let n=[];for(let a of t)switch(n=n.concat(o.call(this,a)),a.type){case"table":{let c=a;for(let u of c.header)n=n.concat(this.walkTokens(u.tokens,o));for(let u of c.rows)for(let d of u)n=n.concat(this.walkTokens(d.tokens,o));break}case"list":{let c=a;n=n.concat(this.walkTokens(c.items,o));break}default:{let c=a;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[c.type]?this.defaults.extensions.childTokens[c.type].forEach(u=>{let d=c[u].flat(1/0);n=n.concat(this.walkTokens(d,o))}):c.tokens&&(n=n.concat(this.walkTokens(c.tokens,o)))}}return n}use(...t){let o=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let a=o.renderers[r.name];a?o.renderers[r.name]=function(...c){let u=r.renderer.apply(this,c);return u===!1&&(u=a.apply(this,c)),u}:o.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=o[r.level];a?a.unshift(r.tokenizer):o[r.level]=[r.tokenizer],r.start&&(r.level==="block"?o.startBlock?o.startBlock.push(r.start):o.startBlock=[r.start]:r.level==="inline"&&(o.startInline?o.startInline.push(r.start):o.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(o.childTokens[r.name]=r.childTokens)}),i.extensions=o),n.renderer){let r=this.defaults.renderer||new Tn(this.defaults);for(let a in n.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let c=a,u=n.renderer[c],d=r[c];r[c]=(...m)=>{let p=u.apply(r,m);return p===!1&&(p=d.apply(r,m)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new Qn(this.defaults);for(let a in n.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let c=a,u=n.tokenizer[c],d=r[c];r[c]=(...m)=>{let p=u.apply(r,m);return p===!1&&(p=d.apply(r,m)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new Cn;for(let a in n.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let c=a,u=n.hooks[c],d=r[c];Cn.passThroughHooks.has(a)?r[c]=m=>{if(this.defaults.async&&Cn.passThroughHooksRespectAsync.has(a))return(async()=>{let b=await u.call(r,m);return d.call(r,b)})();let p=u.call(r,m);return d.call(r,p)}:r[c]=(...m)=>{if(this.defaults.async)return(async()=>{let b=await u.apply(r,m);return b===!1&&(b=await d.apply(r,m)),b})();let p=u.apply(r,m);return p===!1&&(p=d.apply(r,m)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,a=n.walkTokens;i.walkTokens=function(c){let u=[];return u.push(a.call(this,c)),r&&(u=u.concat(r.call(this,c))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,o){return st.lex(t,o??this.defaults)}parser(t,o){return ct.parse(t,o??this.defaults)}parseMarkdown(t){return(o,n)=>{let i={...n},r={...this.defaults,...i},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof o>"u"||o===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=t),r.async)return(async()=>{let c=r.hooks?await r.hooks.preprocess(o):o,u=await(r.hooks?await r.hooks.provideLexer(t):t?st.lex:st.lexInline)(c,r),d=r.hooks?await r.hooks.processAllTokens(u):u;r.walkTokens&&await Promise.all(this.walkTokens(d,r.walkTokens));let m=await(r.hooks?await r.hooks.provideParser(t):t?ct.parse:ct.parseInline)(d,r);return r.hooks?await r.hooks.postprocess(m):m})().catch(a);try{r.hooks&&(o=r.hooks.preprocess(o));let c=(r.hooks?r.hooks.provideLexer(t):t?st.lex:st.lexInline)(o,r);r.hooks&&(c=r.hooks.processAllTokens(c)),r.walkTokens&&this.walkTokens(c,r.walkTokens);let u=(r.hooks?r.hooks.provideParser(t):t?ct.parse:ct.parseInline)(c,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(c){return a(c)}}}onError(t,o){return n=>{if(n.message+=`
|
|
128
|
+
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+kt(n.message+"",!0)+"</pre>";return o?Promise.resolve(i):i}if(o)return Promise.reject(n);throw n}}},Gt=new Sr;function Me(t,o){return Gt.parse(t,o)}Me.options=Me.setOptions=function(t){return Gt.setOptions(t),Me.defaults=Gt.defaults,ar(Me.defaults),Me},Me.getDefaults=Io,Me.defaults=Ht,Me.use=function(...t){return Gt.use(...t),Me.defaults=Gt.defaults,ar(Me.defaults),Me},Me.walkTokens=function(t,o){return Gt.walkTokens(t,o)},Me.parseInline=Gt.parseInline,Me.Parser=ct,Me.parser=ct.parse,Me.Renderer=Tn,Me.TextRenderer=Ho,Me.Lexer=st,Me.lexer=st.lex,Me.Tokenizer=Qn,Me.Hooks=Cn,Me.parse=Me,Me.options,Me.setOptions,Me.use,Me.walkTokens,Me.parseInline,ct.parse,st.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 Tr(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 Su(t){if(Array.isArray(t))return t}function Tu(t,o){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var i,r,a,c,u=[],d=!0,m=!1;try{if(a=(n=n.call(t)).next,o!==0)for(;!(d=(i=a.call(n)).done)&&(u.push(i.value),u.length!==o);d=!0);}catch(p){m=!0,r=p}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw r}}return u}}function Cu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
129
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _u(t,o){return Su(t)||Tu(t,o)||Au(t,o)||Cu()}function Au(t,o){if(t){if(typeof t=="string")return Tr(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)?Tr(t,o):void 0}}const Cr=Object.entries,_r=Object.setPrototypeOf,Mu=Object.isFrozen,Ru=Object.getPrototypeOf,Bu=Object.getOwnPropertyDescriptor;let Xe=Object.freeze,lt=Object.seal,cn=Object.create,Ar=typeof Reflect<"u"&&Reflect,Wo=Ar.apply,Go=Ar.construct;Xe||(Xe=function(o){return o}),lt||(lt=function(o){return o}),Wo||(Wo=function(o,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];return o.apply(n,r)}),Go||(Go=function(o){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new o(...i)});const jt=$e(Array.prototype.forEach),zu=$e(Array.prototype.lastIndexOf),Mr=$e(Array.prototype.pop),dn=$e(Array.prototype.push),Ou=$e(Array.prototype.splice),Ze=Array.isArray,_n=$e(String.prototype.toLowerCase),jo=$e(String.prototype.toString),Rr=$e(String.prototype.match),un=$e(String.prototype.replace),Br=$e(String.prototype.indexOf),Iu=$e(String.prototype.trim),vu=$e(Number.prototype.toString),Lu=$e(Boolean.prototype.toString),zr=typeof BigInt>"u"?null:$e(BigInt.prototype.toString),Or=typeof Symbol>"u"?null:$e(Symbol.prototype.toString),ve=$e(Object.prototype.hasOwnProperty),An=$e(Object.prototype.toString),Ue=$e(RegExp.prototype.test),mn=Du(TypeError);function $e(t){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return Wo(t,o,i)}}function Du(t){return function(){for(var o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];return Go(t,n)}}function de(t,o){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_n;if(_r&&_r(t,null),!Ze(o))return t;let i=o.length;for(;i--;){let r=o[i];if(typeof r=="string"){const a=n(r);a!==r&&(Mu(o)||(o[i]=a),r=a)}t[r]=!0}return t}function Vu(t){for(let o=0;o<t.length;o++)ve(t,o)||(t[o]=null);return t}function je(t){const o=cn(null);for(const i of Cr(t)){var n=_u(i,2);const r=n[0],a=n[1];ve(t,r)&&(Ze(a)?o[r]=Vu(a):a&&typeof a=="object"&&a.constructor===Object?o[r]=je(a):o[r]=a)}return o}function $u(t){switch(typeof t){case"string":return t;case"number":return vu(t);case"boolean":return Lu(t);case"bigint":return zr?zr(t):"0";case"symbol":return Or?Or(t):"Symbol()";case"undefined":return An(t);case"function":case"object":{if(t===null)return An(t);const o=t,n=yt(o,"toString");if(typeof n=="function"){const i=n(o);return typeof i=="string"?i:An(i)}return An(t)}default:return An(t)}}function yt(t,o){for(;t!==null;){const i=Bu(t,o);if(i){if(i.get)return $e(i.get);if(typeof i.value=="function")return $e(i.value)}t=Ru(t)}function n(){return null}return n}function Pu(t){try{return Ue(t,""),!0}catch{return!1}}const Ir=Xe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ko=Xe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),qo=Xe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Fu=Xe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Yo=Xe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Uu=Xe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),vr=Xe(["#text"]),Lr=Xe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Xo=Xe(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Dr=Xe(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),eo=Xe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Hu=lt(/{{[\w\W]*|^[\w\W]*}}/g),Wu=lt(/<%[\w\W]*|^[\w\W]*%>/g),Gu=lt(/\${[\w\W]*/g),ju=lt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ku=lt(/^aria-[\-\w]+$/),Vr=lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qu=lt(/^(?:\w+script|data):/i),Yu=lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xu=lt(/^html$/i),Zu=lt(/^[a-z][.\w]*(-[.\w]+)+$/i),Et={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ju=function(){return typeof window>"u"?null:window},Qu=function(o,n){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));const a="dompurify"+(i?"#"+i:"");try{return o.createPolicy(a,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},$r=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Pr(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ju();const o=Z=>Pr(Z);if(o.version="3.4.8",o.removed=[],!t||!t.document||t.document.nodeType!==Et.document||!t.Element)return o.isSupported=!1,o;let n=t.document;const i=n,r=i.currentScript;t.DocumentFragment;const a=t.HTMLTemplateElement,c=t.Node,u=t.Element,d=t.NodeFilter,m=t.NamedNodeMap;m===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const p=t.DOMParser,b=t.trustedTypes,E=u.prototype,w=yt(E,"cloneNode"),y=yt(E,"remove"),v=yt(E,"nextSibling"),_=yt(E,"childNodes"),x=yt(E,"parentNode"),g=yt(E,"shadowRoot"),C=yt(E,"attributes"),A=c&&c.prototype?yt(c.prototype,"nodeType"):null,T=c&&c.prototype?yt(c.prototype,"nodeName"):null;if(typeof a=="function"){const Z=n.createElement("template");Z.content&&Z.content.ownerDocument&&(n=Z.content.ownerDocument)}let h,O="",G=0;const ne=function(f){if(G>0)throw mn('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.');G++;try{return h.createHTML(f)}finally{G--}},Y=n,J=Y.implementation,se=Y.createNodeIterator,W=Y.createDocumentFragment,X=Y.getElementsByTagName,P=i.importNode;let N=$r();o.isSupported=typeof Cr=="function"&&typeof x=="function"&&J&&J.createHTMLDocument!==void 0;const F=Hu,D=Wu,q=Gu,ce=ju,ye=Ku,Ne=qu,ue=Yu,ze=Zu;let I=Vr,R=null;const ie=de({},[...Ir,...Ko,...qo,...Yo,...vr]);let le=null;const V=de({},[...Lr,...Xo,...Dr,...eo]);let S=Object.seal(cn(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}})),fe=null,pe=null;const Ve=Object.seal(cn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ke=!0,He=!0,fn=!1,Ot=!0,Q=!1,xt=!0,Re=!1,Se=!1,dt=!1,qe=!1,ut=!1,wt=!1,U=!0,K=!1;const ae="user-content-";let he=!0,Ie=!1,Fe={},Ye=null;const Ct=de({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let no=null;const oo=de({},["audio","video","img","source","image","track"]);let Mn=null;const pn=de({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),It="http://www.w3.org/1998/Math/MathML",ot="http://www.w3.org/2000/svg",Ae="http://www.w3.org/1999/xhtml";let ke=Ae,Rn=!1,Je=null;const ee=de({},[It,ot,Ae],jo);let gn=de({},["mi","mo","mn","ms","mtext"]),hn=de({},["annotation-xml"]);const Jo=de({},["title","style","font","a","script"]);let vt=null;const Qo=["application/xhtml+xml","text/html"],ei="text/html";let Oe=null,Lt=null;const io=n.createElement("form"),Nt=function(f){return f instanceof RegExp||f instanceof Function},Bn=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Lt&&Lt===f)return;(!f||typeof f!="object")&&(f={}),f=je(f),vt=Qo.indexOf(f.PARSER_MEDIA_TYPE)===-1?ei:f.PARSER_MEDIA_TYPE,Oe=vt==="application/xhtml+xml"?jo:_n,R=ve(f,"ALLOWED_TAGS")&&Ze(f.ALLOWED_TAGS)?de({},f.ALLOWED_TAGS,Oe):ie,le=ve(f,"ALLOWED_ATTR")&&Ze(f.ALLOWED_ATTR)?de({},f.ALLOWED_ATTR,Oe):V,Je=ve(f,"ALLOWED_NAMESPACES")&&Ze(f.ALLOWED_NAMESPACES)?de({},f.ALLOWED_NAMESPACES,jo):ee,Mn=ve(f,"ADD_URI_SAFE_ATTR")&&Ze(f.ADD_URI_SAFE_ATTR)?de(je(pn),f.ADD_URI_SAFE_ATTR,Oe):pn,no=ve(f,"ADD_DATA_URI_TAGS")&&Ze(f.ADD_DATA_URI_TAGS)?de(je(oo),f.ADD_DATA_URI_TAGS,Oe):oo,Ye=ve(f,"FORBID_CONTENTS")&&Ze(f.FORBID_CONTENTS)?de({},f.FORBID_CONTENTS,Oe):Ct,fe=ve(f,"FORBID_TAGS")&&Ze(f.FORBID_TAGS)?de({},f.FORBID_TAGS,Oe):je({}),pe=ve(f,"FORBID_ATTR")&&Ze(f.FORBID_ATTR)?de({},f.FORBID_ATTR,Oe):je({}),Fe=ve(f,"USE_PROFILES")?f.USE_PROFILES&&typeof f.USE_PROFILES=="object"?je(f.USE_PROFILES):f.USE_PROFILES:!1,Ke=f.ALLOW_ARIA_ATTR!==!1,He=f.ALLOW_DATA_ATTR!==!1,fn=f.ALLOW_UNKNOWN_PROTOCOLS||!1,Ot=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Q=f.SAFE_FOR_TEMPLATES||!1,xt=f.SAFE_FOR_XML!==!1,Re=f.WHOLE_DOCUMENT||!1,qe=f.RETURN_DOM||!1,ut=f.RETURN_DOM_FRAGMENT||!1,wt=f.RETURN_TRUSTED_TYPE||!1,dt=f.FORCE_BODY||!1,U=f.SANITIZE_DOM!==!1,K=f.SANITIZE_NAMED_PROPS||!1,he=f.KEEP_CONTENT!==!1,Ie=f.IN_PLACE||!1,I=Pu(f.ALLOWED_URI_REGEXP)?f.ALLOWED_URI_REGEXP:Vr,ke=typeof f.NAMESPACE=="string"?f.NAMESPACE:Ae,gn=ve(f,"MATHML_TEXT_INTEGRATION_POINTS")&&f.MATHML_TEXT_INTEGRATION_POINTS&&typeof f.MATHML_TEXT_INTEGRATION_POINTS=="object"?je(f.MATHML_TEXT_INTEGRATION_POINTS):de({},["mi","mo","mn","ms","mtext"]),hn=ve(f,"HTML_INTEGRATION_POINTS")&&f.HTML_INTEGRATION_POINTS&&typeof f.HTML_INTEGRATION_POINTS=="object"?je(f.HTML_INTEGRATION_POINTS):de({},["annotation-xml"]);const z=ve(f,"CUSTOM_ELEMENT_HANDLING")&&f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING=="object"?je(f.CUSTOM_ELEMENT_HANDLING):cn(null);if(S=cn(null),ve(z,"tagNameCheck")&&Nt(z.tagNameCheck)&&(S.tagNameCheck=z.tagNameCheck),ve(z,"attributeNameCheck")&&Nt(z.attributeNameCheck)&&(S.attributeNameCheck=z.attributeNameCheck),ve(z,"allowCustomizedBuiltInElements")&&typeof z.allowCustomizedBuiltInElements=="boolean"&&(S.allowCustomizedBuiltInElements=z.allowCustomizedBuiltInElements),Q&&(He=!1),ut&&(qe=!0),Fe&&(R=de({},vr),le=cn(null),Fe.html===!0&&(de(R,Ir),de(le,Lr)),Fe.svg===!0&&(de(R,Ko),de(le,Xo),de(le,eo)),Fe.svgFilters===!0&&(de(R,qo),de(le,Xo),de(le,eo)),Fe.mathMl===!0&&(de(R,Yo),de(le,Dr),de(le,eo))),Ve.tagCheck=null,Ve.attributeCheck=null,ve(f,"ADD_TAGS")&&(typeof f.ADD_TAGS=="function"?Ve.tagCheck=f.ADD_TAGS:Ze(f.ADD_TAGS)&&(R===ie&&(R=je(R)),de(R,f.ADD_TAGS,Oe))),ve(f,"ADD_ATTR")&&(typeof f.ADD_ATTR=="function"?Ve.attributeCheck=f.ADD_ATTR:Ze(f.ADD_ATTR)&&(le===V&&(le=je(le)),de(le,f.ADD_ATTR,Oe))),ve(f,"ADD_URI_SAFE_ATTR")&&Ze(f.ADD_URI_SAFE_ATTR)&&de(Mn,f.ADD_URI_SAFE_ATTR,Oe),ve(f,"FORBID_CONTENTS")&&Ze(f.FORBID_CONTENTS)&&(Ye===Ct&&(Ye=je(Ye)),de(Ye,f.FORBID_CONTENTS,Oe)),ve(f,"ADD_FORBID_CONTENTS")&&Ze(f.ADD_FORBID_CONTENTS)&&(Ye===Ct&&(Ye=je(Ye)),de(Ye,f.ADD_FORBID_CONTENTS,Oe)),he&&(R["#text"]=!0),Re&&de(R,["html","head","body"]),R.table&&(de(R,["tbody"]),delete fe.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw mn('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw mn('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const H=h;h=f.TRUSTED_TYPES_POLICY;try{O=ne("")}catch(Ee){throw h=H,Ee}}else h===void 0&&f.TRUSTED_TYPES_POLICY!==null&&(h=Qu(b,r)),h&&typeof O=="string"&&(O=ne(""));(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&R===ie&&(R=je(R)),N.uponSanitizeAttribute.length>0&&le===V&&(le=je(le)),Xe&&Xe(f),Lt=f},ro=de({},[...Ko,...qo,...Fu]),lo=de({},[...Yo,...Uu]),ti=function(f){let z=x(f);(!z||!z.tagName)&&(z={namespaceURI:ke,tagName:"template"});const H=_n(f.tagName),Ee=_n(z.tagName);return Je[f.namespaceURI]?f.namespaceURI===ot?z.namespaceURI===Ae?H==="svg":z.namespaceURI===It?H==="svg"&&(Ee==="annotation-xml"||gn[Ee]):!!ro[H]:f.namespaceURI===It?z.namespaceURI===Ae?H==="math":z.namespaceURI===ot?H==="math"&&hn[Ee]:!!lo[H]:f.namespaceURI===Ae?z.namespaceURI===ot&&!hn[Ee]||z.namespaceURI===It&&!gn[Ee]?!1:!lo[H]&&(Jo[H]||!ro[H]):!!(vt==="application/xhtml+xml"&&Je[f.namespaceURI]):!1},it=function(f){dn(o.removed,{element:f});try{x(f).removeChild(f)}catch{y(f)}},_t=function(f,z){try{dn(o.removed,{attribute:z.getAttributeNode(f),from:z})}catch{dn(o.removed,{attribute:null,from:z})}if(z.removeAttribute(f),f==="is")if(qe||ut)try{it(z)}catch{}else try{z.setAttribute(f,"")}catch{}},zn=function(f){let z=null,H=null;if(dt)f="<remove></remove>"+f;else{const Te=Rr(f,/^[\r\n\t ]+/);H=Te&&Te[0]}vt==="application/xhtml+xml"&&ke===Ae&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const Ee=h?ne(f):f;if(ke===Ae)try{z=new p().parseFromString(Ee,vt)}catch{}if(!z||!z.documentElement){z=J.createDocument(ke,"template",null);try{z.documentElement.innerHTML=Rn?O:Ee}catch{}}const re=z.body||z.documentElement;return f&&H&&re.insertBefore(n.createTextNode(H),re.childNodes[0]||null),ke===Ae?X.call(z,Re?"html":"body")[0]:Re?z.documentElement:re},te=function(f){return se.call(f.ownerDocument||f,f,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},We=function(f){var z,H;f.normalize();const Ee=se.call(f.ownerDocument||f,f,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let re=Ee.nextNode();for(;re;){let Le=re.data;jt([F,D,q],Qe=>{Le=un(Le,Qe," ")}),re.data=Le,re=Ee.nextNode()}const Te=(z=(H=f.querySelectorAll)===null||H===void 0?void 0:H.call(f,"template"))!==null&&z!==void 0?z:[];jt(Array.from(Te),Le=>{mt(Le.content)&&We(Le.content)})},Kt=function(f){const z=T?T(f):null;return typeof z!="string"||Oe(z)!=="form"?!1:typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||f.attributes!==C(f)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function"||f.nodeType!==A(f)||f.childNodes!==_(f)},mt=function(f){if(!A||typeof f!="object"||f===null)return!1;try{return A(f)===Et.documentFragment}catch{return!1}},bn=function(f){if(!A||typeof f!="object"||f===null)return!1;try{return typeof A(f)=="number"}catch{return!1}};function ft(Z,f,z){jt(Z,H=>{H.call(o,f,z,Lt)})}const On=function(f){let z=null;if(ft(N.beforeSanitizeElements,f,null),Kt(f))return it(f),!0;const H=Oe(T?T(f):f.nodeName);if(ft(N.uponSanitizeElement,f,{tagName:H,allowedTags:R}),xt&&f.hasChildNodes()&&!bn(f.firstElementChild)&&Ue(/<[/\w!]/g,f.innerHTML)&&Ue(/<[/\w!]/g,f.textContent)||xt&&f.namespaceURI===Ae&&H==="style"&&bn(f.firstElementChild)||f.nodeType===Et.progressingInstruction||xt&&f.nodeType===Et.comment&&Ue(/<[/\w]/g,f.data))return it(f),!0;if(fe[H]||!(Ve.tagCheck instanceof Function&&Ve.tagCheck(H))&&!R[H]){if(!fe[H]&&ao(H)&&(S.tagNameCheck instanceof RegExp&&Ue(S.tagNameCheck,H)||S.tagNameCheck instanceof Function&&S.tagNameCheck(H)))return!1;if(he&&!Ye[H]){const re=x(f),Te=_(f);if(Te&&re){const Le=Te.length;for(let Qe=Le-1;Qe>=0;--Qe){const et=w(Te[Qe],!0);re.insertBefore(et,v(f))}}}return it(f),!0}return(A?A(f):f.nodeType)===Et.element&&!ti(f)||(H==="noscript"||H==="noembed"||H==="noframes")&&Ue(/<\/no(script|embed|frames)/i,f.innerHTML)?(it(f),!0):(Q&&f.nodeType===Et.text&&(z=f.textContent,jt([F,D,q],re=>{z=un(z,re," ")}),f.textContent!==z&&(dn(o.removed,{element:f.cloneNode()}),f.textContent=z)),ft(N.afterSanitizeElements,f,null),!1)},Dt=function(f,z,H){if(pe[z]||U&&(z==="id"||z==="name")&&(H in n||H in io))return!1;const Ee=le[z]||Ve.attributeCheck instanceof Function&&Ve.attributeCheck(z,f);if(!(He&&!pe[z]&&Ue(ce,z))){if(!(Ke&&Ue(ye,z))){if(!Ee||pe[z]){if(!(ao(f)&&(S.tagNameCheck instanceof RegExp&&Ue(S.tagNameCheck,f)||S.tagNameCheck instanceof Function&&S.tagNameCheck(f))&&(S.attributeNameCheck instanceof RegExp&&Ue(S.attributeNameCheck,z)||S.attributeNameCheck instanceof Function&&S.attributeNameCheck(z,f))||z==="is"&&S.allowCustomizedBuiltInElements&&(S.tagNameCheck instanceof RegExp&&Ue(S.tagNameCheck,H)||S.tagNameCheck instanceof Function&&S.tagNameCheck(H))))return!1}else if(!Mn[z]){if(!Ue(I,un(H,ue,""))){if(!((z==="src"||z==="xlink:href"||z==="href")&&f!=="script"&&Br(H,"data:")===0&&no[f])){if(!(fn&&!Ue(Ne,un(H,ue,"")))){if(H)return!1}}}}}}return!0},kn=de({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ao=function(f){return!kn[_n(f)]&&Ue(ze,f)},so=function(f){ft(N.beforeSanitizeAttributes,f,null);const z=f.attributes;if(!z||Kt(f))return;const H={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:le,forceKeepAttr:void 0};let Ee=z.length;for(;Ee--;){const re=z[Ee],Te=re.name,Le=re.namespaceURI,Qe=re.value,et=Oe(Te),Yt=Qe;let Pe=Te==="value"?Yt:Iu(Yt);if(H.attrName=et,H.attrValue=Pe,H.keepAttr=!0,H.forceKeepAttr=void 0,ft(N.uponSanitizeAttribute,f,H),Pe=H.attrValue,K&&(et==="id"||et==="name")&&Br(Pe,ae)!==0&&(_t(Te,f),Pe=ae+Pe),xt&&Ue(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Pe)){_t(Te,f);continue}if(et==="attributename"&&Rr(Pe,"href")){_t(Te,f);continue}if(H.forceKeepAttr)continue;if(!H.keepAttr){_t(Te,f);continue}if(!Ot&&Ue(/\/>/i,Pe)){_t(Te,f);continue}Q&&jt([F,D,q],vn=>{Pe=un(Pe,vn," ")});const In=Oe(f.nodeName);if(!Dt(In,et,Pe)){_t(Te,f);continue}if(h&&typeof b=="object"&&typeof b.getAttributeType=="function"&&!Le)switch(b.getAttributeType(In,et)){case"TrustedHTML":{Pe=ne(Pe);break}case"TrustedScriptURL":{Pe=h.createScriptURL(Pe);break}}if(Pe!==Yt)try{Le?f.setAttributeNS(Le,Te,Pe):f.setAttribute(Te,Pe),Kt(f)?it(f):Mr(o.removed)}catch{_t(Te,f)}}ft(N.afterSanitizeAttributes,f,null)},qt=function(f){let z=null;const H=te(f);for(ft(N.beforeSanitizeShadowDOM,f,null);z=H.nextNode();)if(ft(N.uponSanitizeShadowNode,z,null),On(z),so(z),mt(z.content)&&qt(z.content),(A?A(z):z.nodeType)===Et.element){const re=g?g(z):z.shadowRoot;mt(re)&&(Vt(re),qt(re))}ft(N.afterSanitizeShadowDOM,f,null)},Vt=function(f){const z=A?A(f):f.nodeType;if(z===Et.element){const re=g?g(f):f.shadowRoot;mt(re)&&(Vt(re),qt(re))}const H=_?_(f):f.childNodes;if(!H)return;const Ee=[];jt(H,re=>{dn(Ee,re)});for(const re of Ee)Vt(re);if(z===Et.element){const re=T?T(f):null;if(typeof re=="string"&&Oe(re)==="template"){const Te=f.content;mt(Te)&&Vt(Te)}}};return o.sanitize=function(Z){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=null,H=null,Ee=null,re=null;if(Rn=!Z,Rn&&(Z="<!-->"),typeof Z!="string"&&!bn(Z)&&(Z=$u(Z),typeof Z!="string"))throw mn("dirty is not a string, aborting");if(!o.isSupported)return Z;if(Se||Bn(f),o.removed=[],typeof Z=="string"&&(Ie=!1),Ie){const Qe=T?T(Z):Z.nodeName;if(typeof Qe=="string"){const et=Oe(Qe);if(!R[et]||fe[et])throw mn("root node is forbidden and cannot be sanitized in-place")}if(Kt(Z))throw mn("root node is clobbered and cannot be sanitized in-place");Vt(Z)}else if(bn(Z))z=zn("<!---->"),H=z.ownerDocument.importNode(Z,!0),H.nodeType===Et.element&&H.nodeName==="BODY"||H.nodeName==="HTML"?z=H:z.appendChild(H),Vt(H);else{if(!qe&&!Q&&!Re&&Z.indexOf("<")===-1)return h&&wt?ne(Z):Z;if(z=zn(Z),!z)return qe?null:wt?O:""}z&&dt&&it(z.firstChild);const Te=te(Ie?Z:z);for(;Ee=Te.nextNode();)On(Ee),so(Ee),mt(Ee.content)&&qt(Ee.content);if(Ie)return Q&&We(Z),Z;if(qe){if(Q&&We(z),ut)for(re=W.call(z.ownerDocument);z.firstChild;)re.appendChild(z.firstChild);else re=z;return(le.shadowroot||le.shadowrootmode)&&(re=P.call(i,re,!0)),re}let Le=Re?z.outerHTML:z.innerHTML;return Re&&R["!doctype"]&&z.ownerDocument&&z.ownerDocument.doctype&&z.ownerDocument.doctype.name&&Ue(Xu,z.ownerDocument.doctype.name)&&(Le="<!DOCTYPE "+z.ownerDocument.doctype.name+`>
|
|
130
|
+
`+Le),Q&&jt([F,D,q],Qe=>{Le=un(Le,Qe," ")}),h&&wt?ne(Le):Le},o.setConfig=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Bn(Z),Se=!0},o.clearConfig=function(){Lt=null,Se=!1},o.isValidAttribute=function(Z,f,z){Lt||Bn({});const H=Oe(Z),Ee=Oe(f);return Dt(H,Ee,z)},o.addHook=function(Z,f){typeof f=="function"&&dn(N[Z],f)},o.removeHook=function(Z,f){if(f!==void 0){const z=zu(N[Z],f);return z===-1?void 0:Ou(N[Z],z,1)[0]}return Mr(N[Z])},o.removeHooks=function(Z){N[Z]=[]},o.removeAllHooks=function(){N=$r()},o}var em=Pr();const tm=new Sr({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{const t=new Tn;return t.code=({text:o,lang:n})=>{const i=(n??"").toLowerCase(),r=Ao(o,i);return`<pre><code${i?` class="language-${i}"`:""}>${r}</code></pre>`},t})()}),nm=["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"],om=["href","title","target","rel","src","alt","class","checked","type","disabled"],im=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function rm(t){if(!t)return"";const o=tm.parse(t,{async:!1});return em.sanitize(o,{ALLOWED_TAGS:nm,ALLOWED_ATTR:om,ALLOWED_URI_REGEXP:im})}const lm={class:"zm-note-panel"},am={key:0,class:"zm-note-empty"},sm={class:"zm-note-header"},cm={class:"zm-note-title-row"},dm={class:"zm-note-name"},um={class:"zm-note-meta"},mm={class:"zm-note-scroll"},fm={class:"zm-note-section"},pm={class:"zm-note-section-head"},gm={class:"zm-note-split"},hm=["disabled"],bm={key:0,class:"zm-note-preview"},km=["innerHTML"],ym={key:1,class:"zm-note-preview-hint"},Em={key:0,class:"zm-note-section-actions"},xm={key:0,class:"zm-note-add-row"},wm={key:1,class:"zm-note-section"},Nm=["disabled"],Sm=["href","title"],Tm={key:2,class:"zm-note-section"},Cm=["disabled"],_m=["src","alt"],Am={key:3,class:"zm-note-section"},Mm={class:"zm-note-section-head"},Rm={key:0,class:"zm-note-section-tag"},Bm=["disabled"],zm={key:0,class:"zm-note-code"},Om=["innerHTML"],Im={key:4,class:"zm-note-section"},vm=["disabled"],Lm={key:0,class:"zm-note-table"},Dm=["onClick"],Vm={class:"zm-note-table-sort-mark","aria-hidden":"true"},Zo=e.defineComponent({__name:"NotePanel",props:{selectedNode:{},readonly:{type:Boolean},focusTick:{}},emits:["apply","remove","set-link","set-image","set-rich"],setup(t,{emit:o}){const n=t,i=o,r=e.ref(""),a=e.ref(null);Oo(a,{minRows:4,maxRows:10});const c=e.computed(()=>!r.value||r.value.trim()===""),u=e.computed(()=>rm(r.value)),d=e.ref(!0);function m(){d.value=!d.value}e.watch(()=>{var I,R,ie;return[(I=n.selectedNode)==null?void 0:I.id,(ie=(R=n.selectedNode)==null?void 0:R.note)==null?void 0:ie.text]},()=>{var I,R;r.value=((R=(I=n.selectedNode)==null?void 0:I.note)==null?void 0:R.text)??""},{immediate:!0}),e.watch(()=>n.focusTick,async()=>{if(n.readonly)return;await e.nextTick();const I=document.querySelector(".zm-note-panel textarea.zm-note-textarea");if(I){I.focus();const R=I.value.length;I.setSelectionRange(R,R)}});function p(){var ie,le;if(n.readonly)return;const I=r.value,R=((le=(ie=n.selectedNode)==null?void 0:ie.note)==null?void 0:le.text)??"";I!==R&&i("apply",I)}function b(I){var R,ie;n.readonly||(I.key==="Escape"?(I.preventDefault(),r.value=((ie=(R=n.selectedNode)==null?void 0:R.note)==null?void 0:ie.text)??"",I.target.blur()):I.key==="Enter"&&(I.ctrlKey||I.metaKey)&&(I.preventDefault(),p(),I.target.blur()))}function E(){n.readonly||confirm("移除该节点的笔记?")&&(r.value="",i("remove"))}const w=e.computed(()=>{var I,R;return!!((R=(I=n.selectedNode)==null?void 0:I.link)!=null&&R.url)}),y=e.computed(()=>{var I,R;return!!((R=(I=n.selectedNode)==null?void 0:I.image)!=null&&R.src)}),v=e.computed(()=>{var I,R;return(R=(I=n.selectedNode)==null?void 0:I.richContent)==null?void 0:R.kind}),_=e.computed(()=>v.value==="code"),x=e.computed(()=>v.value==="table"),g=e.ref(!1),C=e.ref(!1),A=e.ref(!1),T=e.ref(!1);e.watch(()=>{var I;return(I=n.selectedNode)==null?void 0:I.id},()=>{g.value=!1,C.value=!1,A.value=!1,T.value=!1});const h=e.ref("");e.watch(()=>{var I,R,ie;return[(I=n.selectedNode)==null?void 0:I.id,(ie=(R=n.selectedNode)==null?void 0:R.link)==null?void 0:ie.url]},()=>{var I,R;h.value=((R=(I=n.selectedNode)==null?void 0:I.link)==null?void 0:R.url)??""},{immediate:!0});function O(){var ie,le;if(n.readonly)return;const I=h.value.trim(),R=((le=(ie=n.selectedNode)==null?void 0:ie.link)==null?void 0:le.url)??"";I!==R&&i("set-link",I)}const G=e.ref("");e.watch(()=>{var I,R,ie;return[(I=n.selectedNode)==null?void 0:I.id,(ie=(R=n.selectedNode)==null?void 0:R.image)==null?void 0:ie.src]},()=>{var I,R;G.value=((R=(I=n.selectedNode)==null?void 0:I.image)==null?void 0:R.src)??""},{immediate:!0});function ne(){var ie,le;if(n.readonly)return;const I=G.value.trim(),R=((le=(ie=n.selectedNode)==null?void 0:ie.image)==null?void 0:le.src)??"";I!==R&&i("set-image",I)}function Y(I){const R=I.target;R.style.display="none"}function J(I){const R=I.target;R.style.display=""}const se=e.ref(""),W=e.ref(null);Oo(W,{minRows:4,maxRows:18}),e.watch(()=>{var I,R,ie;return[(I=n.selectedNode)==null?void 0:I.id,(ie=(R=n.selectedNode)==null?void 0:R.richContent)==null?void 0:ie.raw]},()=>{var I,R;se.value=((R=(I=n.selectedNode)==null?void 0:I.richContent)==null?void 0:R.raw)??""},{immediate:!0});const X=e.computed(()=>Ao(_o(se.value),on(se.value)));function P(){var le,V;if(n.readonly)return;const I=se.value,R=((V=(le=n.selectedNode)==null?void 0:le.richContent)==null?void 0:V.raw)??"";if(I===R)return;const ie=on(I)||void 0;i("set-rich",I?{kind:"code",raw:I,lang:ie}:null)}const N=e.ref(""),F=e.ref(null);Oo(F,{minRows:4,maxRows:14});const D=e.ref(-1),q=e.ref("asc");e.watch(()=>{var I,R,ie;return[(I=n.selectedNode)==null?void 0:I.id,(ie=(R=n.selectedNode)==null?void 0:R.richContent)==null?void 0:ie.raw]},()=>{var I,R;N.value=((R=(I=n.selectedNode)==null?void 0:I.richContent)==null?void 0:R.raw)??"",D.value=-1,q.value="asc"},{immediate:!0});function ce(){var ie,le;if(n.readonly)return;const I=N.value,R=((le=(ie=n.selectedNode)==null?void 0:ie.richContent)==null?void 0:le.raw)??"";I!==R&&i("set-rich",I?{kind:"table",raw:I}:null)}const ye=e.computed(()=>ir(N.value)),Ne=e.computed(()=>{const I=ye.value;return D.value<0||I.length<=1?I:rr(I,D.value,q.value)});function ue(I){D.value!==I?(D.value=I,q.value="asc"):q.value==="asc"?q.value="desc":D.value=-1}const ze=e.computed(()=>{const I=[];return c.value||I.push(`${r.value.length} 字`),w.value&&I.push("1 链接"),y.value&&I.push("1 图片"),_.value&&I.push("代码块"),x.value&&I.push("表格"),I.length===0?"节点没有额外内容":I.join(" · ")});return(I,R)=>{var ie,le,V,S;return e.openBlock(),e.createElementBlock("div",lm,[t.selectedNode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",sm,[e.createElementVNode("div",cm,[R[12]||(R[12]=e.createElementVNode("span",{class:"zm-note-label"},"节点",-1)),e.createElementVNode("span",dm,e.toDisplayString(t.selectedNode.text||"(无标题)"),1)]),e.createElementVNode("div",um,e.toDisplayString(ze.value),1)]),e.createElementVNode("div",mm,[e.createElementVNode("section",fm,[e.createElementVNode("header",pm,[R[13]||(R[13]=e.createElementVNode("span",{class:"zm-note-section-title"},"笔记",-1)),R[14]||(R[14]=e.createElementVNode("span",{class:"zm-note-section-hint"},"Ctrl+Enter 提交, Esc 取消",-1)),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"zm-note-preview-toggle",onClick:m},e.toDisplayString(d.value?"隐藏预览":"显示预览"),1))]),e.createElementVNode("div",gm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"noteRef",ref:a,"onUpdate:modelValue":R[0]||(R[0]=fe=>r.value=fe),class:"zm-note-textarea",placeholder:"写点什么吧… 支持 Markdown",spellcheck:"false",disabled:t.readonly,onBlur:p,onKeydown:b},null,40,hm),[[e.vModelText,r.value]]),d.value?(e.openBlock(),e.createElementBlock("div",bm,[c.value?(e.openBlock(),e.createElementBlock("div",ym," 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 ")):(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-note-preview-body",innerHTML:u.value},null,8,km))])):e.createCommentVNode("",!0)]),!t.readonly&&!c.value?(e.openBlock(),e.createElementBlock("div",Em,[e.createElementVNode("button",{class:"zm-note-action-btn is-danger",onClick:E},"移除笔记")])):e.createCommentVNode("",!0)]),t.readonly?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",xm,[!w.value&&!g.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-note-add-chip",onClick:R[1]||(R[1]=fe=>g.value=!0)},"+ 链接")):e.createCommentVNode("",!0),!y.value&&!C.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-note-add-chip",onClick:R[2]||(R[2]=fe=>C.value=!0)},"+ 图片")):e.createCommentVNode("",!0),!_.value&&!A.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-note-add-chip",onClick:R[3]||(R[3]=fe=>A.value=!0)},"+ 代码块")):e.createCommentVNode("",!0),!x.value&&!T.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-note-add-chip",onClick:R[4]||(R[4]=fe=>T.value=!0)},"+ 表格")):e.createCommentVNode("",!0)])),w.value||g.value?(e.openBlock(),e.createElementBlock("section",wm,[R[15]||(R[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":R[5]||(R[5]=fe=>h.value=fe),class:"zm-note-input",type:"url",placeholder:"https://…",disabled:t.readonly,onBlur:O,onKeydown:R[6]||(R[6]=e.withKeys(e.withModifiers(fe=>fe.target.blur(),["prevent"]),["enter"]))},null,40,Nm),[[e.vModelText,h.value]]),w.value?(e.openBlock(),e.createElementBlock("a",{key:0,class:"zm-note-link-chip",href:(ie=t.selectedNode.link)==null?void 0:ie.url,target:"_blank",rel:"noopener noreferrer",title:(le=t.selectedNode.link)==null?void 0:le.url},e.toDisplayString((V=t.selectedNode.link)==null?void 0:V.url),9,Sm)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),y.value||C.value?(e.openBlock(),e.createElementBlock("section",Tm,[R[16]||(R[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":R[7]||(R[7]=fe=>G.value=fe),class:"zm-note-input",type:"url",placeholder:"data:image/… 或 https://…",disabled:t.readonly,onBlur:ne,onKeydown:R[8]||(R[8]=e.withKeys(e.withModifiers(fe=>fe.target.blur(),["prevent"]),["enter"]))},null,40,Cm),[[e.vModelText,G.value]]),y.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:Y,onLoad:J},null,40,_m)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_.value||A.value?(e.openBlock(),e.createElementBlock("section",Am,[e.createElementVNode("header",Mm,[R[17]||(R[17]=e.createElementVNode("span",{class:"zm-note-section-title"},"代码块",-1)),e.unref(on)(se.value)?(e.openBlock(),e.createElementBlock("span",Rm,e.toDisplayString(e.unref(on)(se.value)),1)):e.createCommentVNode("",!0)]),e.withDirectives(e.createElementVNode("textarea",{ref_key:"codeRef",ref:W,"onUpdate:modelValue":R[9]||(R[9]=fe=>se.value=fe),class:"zm-note-input zm-note-input-code",placeholder:"```ts\nconsole.log(123)\n```",spellcheck:"false",disabled:t.readonly,onBlur:P},null,40,Bm),[[e.vModelText,se.value]]),se.value.trim()?(e.openBlock(),e.createElementBlock("pre",zm,[e.createElementVNode("code",{innerHTML:X.value},null,8,Om)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),x.value||T.value?(e.openBlock(),e.createElementBlock("section",Im,[R[18]||(R[18]=e.createElementVNode("header",{class:"zm-note-section-head"},[e.createElementVNode("span",{class:"zm-note-section-title"},"表格"),e.createElementVNode("span",{class:"zm-note-section-hint"},"点击表头排序")],-1)),e.withDirectives(e.createElementVNode("textarea",{ref_key:"tableRef",ref:F,"onUpdate:modelValue":R[10]||(R[10]=fe=>N.value=fe),class:"zm-note-input zm-note-input-code",placeholder:`| 列1 | 列2 |
|
|
131
131
|
| --- | --- |
|
|
132
|
-
| a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:
|
|
132
|
+
| a | b |`,spellcheck:"false",disabled:t.readonly,onBlur:ce},null,40,vm),[[e.vModelText,N.value]]),ye.value.length?(e.openBlock(),e.createElementBlock("table",Lm,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value,(fe,pe)=>(e.openBlock(),e.createElementBlock("tr",{key:pe},[pe===0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(fe,(Ve,Ke)=>(e.openBlock(),e.createElementBlock("th",{key:`h${Ke}`,class:e.normalizeClass(["zm-note-table-sort",{"is-sorted":D.value===Ke,"is-asc":D.value===Ke&&q.value==="asc","is-desc":D.value===Ke&&q.value==="desc"}]),onClick:He=>ue(Ke)},[e.createElementVNode("span",null,e.toDisplayString(Ve),1),e.createElementVNode("span",Vm,e.toDisplayString(D.value===Ke?q.value==="asc"?"▲":"▼":"↕"),1)],10,Dm))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(fe,(Ve,Ke)=>(e.openBlock(),e.createElementBlock("td",{key:`c${Ke}`},e.toDisplayString(Ve),1))),128))]))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("div",am,[...R[11]||(R[11]=[e.createElementVNode("p",null,"请先在画布上选中一个节点。",-1),e.createElementVNode("p",{class:"zm-note-hint"}," 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 ",-1)])]))])}}}),$m={class:"zm-app"},Pm={class:"zm-app-main"},Fm={key:0,class:"zm-app-toolbar"},Um={class:"zm-app-tip"},Hm={class:"zm-app-canvas"},Wm={class:"zm-settings-popover-header"},Fr=e.defineComponent({__name:"App",props:{showOutlineBtn:{type:Boolean,default:!0},showDataBtn:{type:Boolean,default:!0},showMarkdownBtn:{type:Boolean,default:!1},showSettingsBtn:{type:Boolean,default:!0},showPreviewModeBtn:{type:Boolean,default:!0}},setup(t){const o={id:"r_root",text:"flow-mindmap 节点能力一览",link:{url:"https://github.com/xz333221/flow-mindmap"},note:{text:`本导图用于演示节点的全部可渲染字段。
|
|
133
133
|
所有代码块 / 表格在节点标题上方显示,不会撑大节点框。`},children:[{id:"r_image",text:"嵌入图片",image:{src:"data:image/svg+xml;utf8,"+encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 40" width="80" height="40"><rect width="80" height="40" rx="6" fill="#6366f1"/><text x="40" y="24" text-anchor="middle" fill="#fff" font-family="sans-serif" font-size="12" font-weight="600">LOGO</text></svg>'),naturalW:80,naturalH:40,width:80,height:40},children:[{id:"r_image_a",text:"节点上方的图标 / logo",children:[]},{id:"r_image_b",text:"remote URL 或 data: URL",children:[]},{id:"r_image_c",text:"可拖拽改尺寸",children:[]}]},{id:"r_code",text:"代码块",richContent:{kind:"code",lang:"ts",raw:'```ts\nimport { MindMap } from "flow-mindmap"\nconst tree = MindMap.parse(md)\n```'},note:{text:`代码块以 richContent 形式携带,
|
|
134
134
|
渲染在节点标题上方,自动支持语言 tag。`},link:{url:"https://flow-mindmap.example/docs/api"},children:[{id:"r_code_a",text:"等宽字体,自动换行",richContent:{kind:"code",lang:"js",raw:"```js\nconst sum = (a, b) => a + b\nconsole.log(sum(1, 2)) // 3\n```"},children:[]},{id:"r_code_b",text:"保留原始 ```lang 标签",richContent:{kind:"code",lang:"bash",raw:"```bash\nnpm install flow-mindmap\nnpm run dev\n```"},children:[]},{id:"r_code_c",text:"max-height 截断,框内可滚",richContent:{kind:"code",lang:"ts",raw:`\`\`\`ts
|
|
135
135
|
interface Node {
|
|
@@ -160,4 +160,4 @@ function walk(n: Node) {
|
|
|
160
160
|
| --- | --- | --- | --- | --- |
|
|
161
161
|
| 1 | 2 | 3 | 4 | 5 |
|
|
162
162
|
| 6 | 7 | 8 | 9 | 10 |`},children:[]}]},{id:"r_note",text:"笔记 (note)",note:{text:`节点右上角的便签图标。
|
|
163
|
-
鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?i:typeof location<"u"&&location.hash==="#stress"?r:(typeof location<"u"&&location.hash==="#rich",o)}const i={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},r=(()=>{const D=(me,De)=>({id:me,text:De,children:[]}),T=[D("s_l1","左一"),D("s_l2","左二"),D("s_l3","左三"),D("s_l4","左四"),D("s_l5","左五"),D("s_l6","左六"),D("s_l7","左七")],ue=[D("s_r1","右一"),D("s_r2","右二"),D("s_r3","右三"),D("s_r4","右四"),D("s_r5","右五"),D("s_r6","右六"),D("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...T,...ue]}})(),a=e.ref(o),c=t,u=e.ref(null),s=e.ref(new Set),m=e.ref(!1),p=e.ref(!1),g=e.ref(!1),y=e.ref(!1),w=e.ref(0),k=e.ref(!1),b=e.ref(!1),_=e.ref(null);function x(){a.value=n(),M.value=typeof location<"u"&&location.hash==="#rich"}const M=e.ref(!0);function S(){p.value=!0,g.value=!1,y.value=!1}function A(D){S()}const C=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function h(D){var T;Object.assign(C,D),(T=_.value)==null||T.applySettings(D)}function O(D){var T;u.value&&((T=_.value)==null||T.applyNodeStyle(u.value.id,D))}function W(){var T;const D={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1};Object.assign(C,D),(T=_.value)==null||T.applySettings(D)}function oe(D){if(!k.value)return;const T=D.target;T&&T.closest(".zm-settings-popover")||T&&T.closest('.zm-app-icon-btn[title="显示设置"]')||(k.value=!1)}function K(D){if(D.key==="Escape"){if(k.value){k.value=!1,D.stopPropagation();return}b.value&&(b.value=!1,D.stopPropagation())}}e.onMounted(()=>{var D;document.addEventListener("click",oe),document.addEventListener("keydown",K),window.addEventListener("hashchange",x),(D=_.value)==null||D.applySettings({rainbowBranch:C.rainbowBranch,branchPaletteId:C.branchPaletteId,customPalettes:C.customPalettes,lineWidthStart:C.lineWidthStart,lineWidthEnd:C.lineWidthEnd,lineStyle:C.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("click",oe),document.removeEventListener("keydown",K),window.removeEventListener("hashchange",x)});function te(D){a.value=D}function le(D){u.value=D,D?y.value||(p.value=!1,g.value=!1,y.value=!0):y.value=!1}e.watch(a,D=>{if(!u.value)return;const T=Y(D,u.value.id);T?T!==u.value&&(u.value=T):u.value=null},{deep:!1});function G(D){if(!u.value||u.value.id!==D){const T=Y(a.value,D);T&&(u.value=T)}p.value=!1,g.value=!1,y.value=!0,w.value++}function Y(D,T){if(D.id===T)return D;for(const ue of D.children){const me=Y(ue,T);if(me)return me}return null}function F(D){var T;u.value&&((T=_.value)==null||T.applyNodeNote(u.value.id,D))}function N(){var D;u.value&&((D=_.value)==null||D.removeNodeNote(u.value.id))}function $(D){var T;u.value&&((T=_.value)==null||T.applyNodeLink(u.value.id,D))}function L(D){var T;u.value&&((T=_.value)==null||T.applyNodeImageByUrl(u.value.id,D))}function j(D){var T;u.value&&((T=_.value)==null||T.applyNodeRichContent(u.value.id,D))}function X(D){const T=document.querySelector(`[data-node-id="${D.id}"]`);T&&T.click()}function ge(D){const T=new Set(s.value);T.has(D)?T.delete(D):T.add(D),s.value=T}function Be(D){var T;(T=_.value)==null||T.setNodeText(D.id,D.text)}function Ue(D){var T;(T=_.value)==null||T.addChild(D)}function Le(D){var T;(T=_.value)==null||T.addSibling(D)}function v(D){var T;(T=_.value)==null||T.moveNode(D.srcId,D.targetId,D.position)}const B=e.computed(()=>{var D;return((D=u.value)==null?void 0:D.id)??null});function ie(D){return 1+D.children.reduce((T,ue)=>T+ie(ue),0)}const ae=e.computed(()=>ie(a.value));return(D,T)=>{var ue;return e.openBlock(),e.createElementBlock("div",Mm,[e.createVNode(Zt,{side:"left",width:300,open:m.value,title:"大纲","onUpdate:open":T[0]||(T[0]=me=>m.value=me)},{default:e.withCtx(()=>[e.createVNode(Co,{data:a.value,"selected-id":B.value,"collapsed-ids":s.value,onSelect:X,onToggleCollapse:ge,onEdit:Be,onAddChild:Ue,onAddSibling:Le,onMove:v},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",Rm,[b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Bm,[c.showOutlineBtn&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-icon-btn",title:"显示大纲",onClick:T[1]||(T[1]=me=>m.value=!0)},[...T[18]||(T[18]=[e.createStaticVNode('<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',1)])])):e.createCommentVNode("",!0),c.showDataBtn&&!p.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-icon-btn",title:"显示数据",onClick:T[2]||(T[2]=me=>{p.value=!0,g.value=!1,y.value=!1})},[...T[19]||(T[19]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("polyline",{points:"16 18 22 12 16 6"}),e.createElementVNode("polyline",{points:"8 6 2 12 8 18"})],-1)])])):e.createCommentVNode("",!0),c.showMarkdownBtn&&!g.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-app-icon-btn",title:"显示 Markdown",onClick:T[3]||(T[3]=me=>{g.value=!0,p.value=!1,y.value=!1})},[...T[20]||(T[20]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M4 7 V4 H20 V7"}),e.createElementVNode("path",{d:"M9 20 H15"}),e.createElementVNode("path",{d:"M12 4 V20"})],-1)])])):e.createCommentVNode("",!0),c.showSettingsBtn&&!k.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-app-icon-btn",title:"显示设置",onClick:T[4]||(T[4]=me=>k.value=!0)},[...T[21]||(T[21]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"}),e.createElementVNode("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1)])])):e.createCommentVNode("",!0),T[24]||(T[24]=e.createElementVNode("span",{class:"zm-app-spacer"},null,-1)),e.createElementVNode("span",zm,e.toDisplayString(a.value.text||"未命名")+" · "+e.toDisplayString(ae.value)+" 节点",1),e.createCommentVNode("",!0),c.showPreviewModeBtn?(e.openBlock(),e.createElementBlock("button",{key:5,class:e.normalizeClass(["zm-app-icon-btn",{"is-on":b.value}]),title:"进入预览模式",onClick:T[5]||(T[5]=me=>b.value=!0)},[...T[23]||(T[23]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"})],-1)])],2)):e.createCommentVNode("",!0)])),b.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:T[6]||(T[6]=me=>b.value=!1)},[...T[25]||(T[25]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Om,[e.createVNode(Wn,{ref_key:"mindMapRef",ref:_,data:a.value,"preview-mode":b.value,onChange:te,onSelect:le,onEditNote:G,onCanvasSettings:T[7]||(T[7]=me=>k.value=!0),onCanvasData:S,onCanvasImport:A,onCanvasTogglePreview:T[8]||(T[8]=me=>b.value=!b.value),onCanvasOutline:T[9]||(T[9]=me=>m.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(Zt,{side:"right",width:360,open:p.value&&!b.value,title:"数据","onUpdate:open":T[11]||(T[11]=me=>p.value=me)},{default:e.withCtx(()=>[e.createVNode(_o,{data:a.value,onImport:T[10]||(T[10]=me=>a.value=me)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Zt,{side:"right",width:420,open:g.value&&!b.value,title:"Markdown","onUpdate:open":T[13]||(T[13]=me=>g.value=me)},{default:e.withCtx(()=>[e.createVNode(Ao,{data:a.value,onImport:T[12]||(T[12]=me=>a.value=me)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(Zt,{side:"right",width:360,open:y.value&&!b.value,title:"节点内容","onUpdate:open":T[14]||(T[14]=me=>y.value=me)},{default:e.withCtx(()=>[e.createVNode(qo,{"selected-node":u.value,readonly:!1,"focus-tick":w.value,onApply:F,onRemove:N,onSetLink:$,onSetImage:L,onSetRich:j},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),k.value&&!b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-settings-backdrop",onClick:T[15]||(T[15]=me=>k.value=!1)})):e.createCommentVNode("",!0),k.value&&!b.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-settings-popover",onClick:T[17]||(T[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Im,[T[27]||(T[27]=e.createElementVNode("span",{class:"zm-settings-popover-title"},"设置",-1)),e.createElementVNode("button",{class:"zm-settings-close",onClick:T[16]||(T[16]=me=>k.value=!1),title:"关闭"},[...T[26]||(T[26]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])]),e.createVNode(Mo,{settings:C,"has-selection":u.value!==null,"selected-node-text":(ue=u.value)==null?void 0:ue.text,"onUpdate:settings":h,"onUpdate:nodeStyle":O,onReset:W},null,8,["settings","has-selection","selected-node-text"])])):e.createCommentVNode("",!0)])}}}),vm={install(t){t.component("FlowMindMap",Wn),t.component("FlowMindMapOutline",Co),t.component("FlowMindMapDrawer",Zt),t.component("FlowMindMapDataPanel",_o),t.component("FlowMindMapMarkdownPanel",Ao),t.component("FlowMindMapSettingsPanel",Mo),t.component("FlowMindMapNotePanel",qo),t.component("FlowMindMapApp",$r)}};Ee.DataPanel=_o,Ee.Drawer=Zt,Ee.MarkdownPanel=Ao,Ee.MindMap=Wn,Ee.MindMapApp=$r,Ee.NotePanel=qo,Ee.Outline=Co,Ee.SettingsPanel=Mo,Ee.addChild=mi,Ee.addSibling=fi,Ee.clone=pt,Ee.default=vm,Ee.findNode=pe,Ee.findParent=ct,Ee.markdownToMindMap=Ht,Ee.markdownToRichMindMap=Cl,Ee.mindMapToMarkdown=Wt,Ee.removeNode=go,Ee.richBlockToMarkdown=_l,Ee.uid=ft,Object.defineProperties(Ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
163
|
+
鼠标悬浮预览前 60 字,点击打开完整笔记编辑器。`},children:[{id:"r_note_a",text:"悬浮预览",children:[]},{id:"r_note_b",text:"点击展开编辑",children:[]},{id:"r_note_c",text:"export → ```note 围栏",children:[]}]},{id:"r_link",text:"链接 (link)",link:{url:"https://github.com/xz333221/flow-mindmap"},children:[{id:"r_link_a",text:"节点右侧的小图标",children:[]},{id:"r_link_b",text:"点击在新 tab 打开",children:[]},{id:"r_link_c",text:"export → [label](url)",children:[]}]},{id:"r_para",text:"段落 / 列表 (子节点)",children:[{id:"r_para_a",text:"段落不再是父节点框内文字",children:[]},{id:"r_para_b",text:"列表每项一个子节点",children:[]},{id:"r_para_c",text:"节点框大小保持一致,边线对齐",children:[]}]}]};function n(){return typeof location<"u"&&location.hash==="#fan"?i:typeof location<"u"&&location.hash==="#stress"?r:(typeof location<"u"&&location.hash==="#rich",o)}const i={id:"root",text:"flow-mindmap 思维导图",children:[{id:"n_a",text:"主题一",children:[]},{id:"n_b",text:"主题二",children:[]},{id:"n_c",text:"主题三",children:[]},{id:"n_d",text:"主题四",children:[]},{id:"n_e",text:"主题五",children:[]},{id:"n_f",text:"主题六",children:[]},{id:"n_g",text:"主题七",children:[]},{id:"n_h",text:"主题八",children:[]},{id:"n_i",text:"主题九",children:[]}]},r=(()=>{const V=(pe,Ve)=>({id:pe,text:Ve,children:[]}),S=[V("s_l1","左一"),V("s_l2","左二"),V("s_l3","左三"),V("s_l4","左四"),V("s_l5","左五"),V("s_l6","左六"),V("s_l7","左七")],fe=[V("s_r1","右一"),V("s_r2","右二"),V("s_r3","右三"),V("s_r4","右四"),V("s_r5","右五"),V("s_r6","右六"),V("s_r7","右七")];return{id:"root",text:"flow-mindmap 思维导图",children:[...S,...fe]}})(),a=e.ref(o),c=t,u=e.ref(null),d=e.ref(new Set),m=e.ref(!1),p=e.ref(!1),b=e.ref(!1),E=e.ref(!1),w=e.ref(0),y=e.ref(!1),v=e.ref(!1),_=e.ref(null);function x(){a.value=n(),g.value=typeof location<"u"&&location.hash==="#rich"}const g=e.ref(!0);function C(){p.value=!0,b.value=!1,E.value=!1}function A(V){C()}const T=e.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function h(V){var S;Object.assign(T,V),(S=_.value)==null||S.applySettings(V)}function O(V){var S;u.value&&((S=_.value)==null||S.applyNodeStyle(u.value.id,V))}function G(){var S;const V={autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1};Object.assign(T,V),(S=_.value)==null||S.applySettings(V)}function ne(V){if(!y.value)return;const S=V.target;S&&S.closest(".zm-settings-popover")||S&&S.closest('.zm-app-icon-btn[title="显示设置"]')||(y.value=!1)}function Y(V){if(V.key==="Escape"){if(y.value){y.value=!1,V.stopPropagation();return}v.value&&(v.value=!1,V.stopPropagation())}}e.onMounted(()=>{var V;document.addEventListener("click",ne),document.addEventListener("keydown",Y),window.addEventListener("hashchange",x),(V=_.value)==null||V.applySettings({rainbowBranch:T.rainbowBranch,branchPaletteId:T.branchPaletteId,customPalettes:T.customPalettes,lineWidthStart:T.lineWidthStart,lineWidthEnd:T.lineWidthEnd,lineStyle:T.lineStyle})}),e.onBeforeUnmount(()=>{document.removeEventListener("click",ne),document.removeEventListener("keydown",Y),window.removeEventListener("hashchange",x)});function J(V){a.value=V}function se(V){var S;u.value=V,V?!E.value&&((S=_.value)!=null&&S.nodeHasContent(V.id))&&(p.value=!1,b.value=!1,E.value=!0):E.value=!1}e.watch(a,V=>{if(!u.value)return;const S=X(V,u.value.id);S?S!==u.value&&(u.value=S):u.value=null},{deep:!1});function W(V){if(!u.value||u.value.id!==V){const S=X(a.value,V);S&&(u.value=S)}p.value=!1,b.value=!1,E.value=!0,w.value++}function X(V,S){if(V.id===S)return V;for(const fe of V.children){const pe=X(fe,S);if(pe)return pe}return null}function P(V){var S;u.value&&((S=_.value)==null||S.applyNodeNote(u.value.id,V))}function N(){var V;u.value&&((V=_.value)==null||V.removeNodeNote(u.value.id))}function F(V){var S;u.value&&((S=_.value)==null||S.applyNodeLink(u.value.id,V))}function D(V){var S;u.value&&((S=_.value)==null||S.applyNodeImageByUrl(u.value.id,V))}function q(V){var S;u.value&&((S=_.value)==null||S.applyNodeRichContent(u.value.id,V))}function ce(V){const S=document.querySelector(`[data-node-id="${V.id}"]`);S&&S.click()}function ye(V){const S=new Set(d.value);S.has(V)?S.delete(V):S.add(V),d.value=S}function Ne(V){var S;(S=_.value)==null||S.setNodeText(V.id,V.text)}function ue(V){var S;(S=_.value)==null||S.addChild(V)}function ze(V){var S;(S=_.value)==null||S.addSibling(V)}function I(V){var S;(S=_.value)==null||S.moveNode(V.srcId,V.targetId,V.position)}const R=e.computed(()=>{var V;return((V=u.value)==null?void 0:V.id)??null});function ie(V){return 1+V.children.reduce((S,fe)=>S+ie(fe),0)}const le=e.computed(()=>ie(a.value));return(V,S)=>{var fe;return e.openBlock(),e.createElementBlock("div",$m,[e.createVNode(ln,{side:"left",width:300,open:m.value,title:"大纲","onUpdate:open":S[0]||(S[0]=pe=>m.value=pe)},{default:e.withCtx(()=>[e.createVNode(Mo,{data:a.value,"selected-id":R.value,"collapsed-ids":d.value,onSelect:ce,onToggleCollapse:ye,onEdit:Ne,onAddChild:ue,onAddSibling:ze,onMove:I},null,8,["data","selected-id","collapsed-ids"])]),_:1},8,["open"]),e.createElementVNode("main",Pm,[v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Fm,[c.showOutlineBtn&&!m.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"zm-app-icon-btn",title:"显示大纲",onClick:S[1]||(S[1]=pe=>m.value=!0)},[...S[18]||(S[18]=[e.createStaticVNode('<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>',1)])])):e.createCommentVNode("",!0),c.showDataBtn&&!p.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-icon-btn",title:"显示数据",onClick:S[2]||(S[2]=pe=>{p.value=!0,b.value=!1,E.value=!1})},[...S[19]||(S[19]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("polyline",{points:"16 18 22 12 16 6"}),e.createElementVNode("polyline",{points:"8 6 2 12 8 18"})],-1)])])):e.createCommentVNode("",!0),c.showMarkdownBtn&&!b.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"zm-app-icon-btn",title:"显示 Markdown",onClick:S[3]||(S[3]=pe=>{b.value=!0,p.value=!1,E.value=!1})},[...S[20]||(S[20]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M4 7 V4 H20 V7"}),e.createElementVNode("path",{d:"M9 20 H15"}),e.createElementVNode("path",{d:"M12 4 V20"})],-1)])])):e.createCommentVNode("",!0),c.showSettingsBtn&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:3,class:"zm-app-icon-btn",title:"显示设置",onClick:S[4]||(S[4]=pe=>y.value=!0)},[...S[21]||(S[21]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"}),e.createElementVNode("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1)])])):e.createCommentVNode("",!0),S[24]||(S[24]=e.createElementVNode("span",{class:"zm-app-spacer"},null,-1)),e.createElementVNode("span",Um,e.toDisplayString(a.value.text||"未命名")+" · "+e.toDisplayString(le.value)+" 节点",1),e.createCommentVNode("",!0),c.showPreviewModeBtn?(e.openBlock(),e.createElementBlock("button",{key:5,class:e.normalizeClass(["zm-app-icon-btn",{"is-on":v.value}]),title:"进入预览模式",onClick:S[5]||(S[5]=pe=>v.value=!0)},[...S[23]||(S[23]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"})],-1)])],2)):e.createCommentVNode("",!0)])),v.value?(e.openBlock(),e.createElementBlock("button",{key:1,class:"zm-app-preview-exit",title:"退出预览 (Esc)",onClick:S[6]||(S[6]=pe=>v.value=!1)},[...S[25]||(S[25]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("line",{x1:"2",y1:"2",x2:"22",y2:"22"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Hm,[e.createVNode(qn,{ref_key:"mindMapRef",ref:_,data:a.value,"preview-mode":v.value,onChange:J,onSelect:se,onEditNote:W,onCanvasSettings:S[7]||(S[7]=pe=>y.value=!0),onCanvasData:C,onCanvasImport:A,onCanvasTogglePreview:S[8]||(S[8]=pe=>v.value=!v.value),onCanvasOutline:S[9]||(S[9]=pe=>m.value=!0)},null,8,["data","preview-mode"])])]),e.createVNode(ln,{side:"right",width:360,open:p.value&&!v.value,title:"数据","onUpdate:open":S[11]||(S[11]=pe=>p.value=pe)},{default:e.withCtx(()=>[e.createVNode(Ro,{data:a.value,onImport:S[10]||(S[10]=pe=>a.value=pe)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(ln,{side:"right",width:420,open:b.value&&!v.value,title:"Markdown","onUpdate:open":S[13]||(S[13]=pe=>b.value=pe)},{default:e.withCtx(()=>[e.createVNode(Bo,{data:a.value,onImport:S[12]||(S[12]=pe=>a.value=pe)},null,8,["data"])]),_:1},8,["open"]),e.createVNode(ln,{side:"right",width:360,open:E.value&&!v.value,title:"节点内容","onUpdate:open":S[14]||(S[14]=pe=>E.value=pe)},{default:e.withCtx(()=>[e.createVNode(Zo,{"selected-node":u.value,readonly:!1,"focus-tick":w.value,onApply:P,onRemove:N,onSetLink:F,onSetImage:D,onSetRich:q},null,8,["selected-node","focus-tick"])]),_:1},8,["open"]),y.value&&!v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"zm-settings-backdrop",onClick:S[15]||(S[15]=pe=>y.value=!1)})):e.createCommentVNode("",!0),y.value&&!v.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"zm-settings-popover",onClick:S[17]||(S[17]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Wm,[S[27]||(S[27]=e.createElementVNode("span",{class:"zm-settings-popover-title"},"设置",-1)),e.createElementVNode("button",{class:"zm-settings-close",onClick:S[16]||(S[16]=pe=>y.value=!1),title:"关闭"},[...S[26]||(S[26]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},[e.createElementVNode("path",{d:"M6 6 L18 18 M18 6 L6 18"})],-1)])])]),e.createVNode(zo,{settings:T,"has-selection":u.value!==null,"selected-node-text":(fe=u.value)==null?void 0:fe.text,"onUpdate:settings":h,"onUpdate:nodeStyle":O,onReset:G},null,8,["settings","has-selection","selected-node-text"])])):e.createCommentVNode("",!0)])}}}),Gm={install(t){t.component("FlowMindMap",qn),t.component("FlowMindMapOutline",Mo),t.component("FlowMindMapDrawer",ln),t.component("FlowMindMapDataPanel",Ro),t.component("FlowMindMapMarkdownPanel",Bo),t.component("FlowMindMapSettingsPanel",zo),t.component("FlowMindMapNotePanel",Zo),t.component("FlowMindMapApp",Fr)}};xe.DataPanel=Ro,xe.Drawer=ln,xe.MarkdownPanel=Bo,xe.MindMap=qn,xe.MindMapApp=Fr,xe.NotePanel=Zo,xe.Outline=Mo,xe.SettingsPanel=zo,xe.addChild=pi,xe.addSibling=gi,xe.clone=bt,xe.default=Gm,xe.findNode=me,xe.findParent=at,xe.markdownToMindMap=Jt,xe.markdownToRichMindMap=Bl,xe.mindMapToMarkdown=Qt,xe.removeNode=ko,xe.richBlockToMarkdown=zl,xe.uid=ht,Object.defineProperties(xe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|