flow-mindmap 0.3.5 → 0.3.7
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/flow-mindmap.js +1465 -1455
- package/dist/flow-mindmap.umd.cjs +15 -15
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
(function(de,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(de=typeof globalThis<"u"?globalThis:de||self,t(de.FlowMind={},de.Vue))})(this,function(de,t){"use strict";const Ei=["width","height","stroke-width"],xi={key:4,points:"6 9 12 15 18 9"},ki={key:5,points:"9 6 15 12 9 18"},q=t.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(e){return(a,n)=>(t.openBlock(),t.createElementBlock("svg",{width:e.size??16,height:e.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":e.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.name==="add"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[n[0]||(n[0]=t.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=t.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):e.name==="minus"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[n[3]||(n[3]=t.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):e.name==="delete"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[n[5]||(n[5]=t.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)):e.name==="edit"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[n[6]||(n[6]=t.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=t.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):e.name==="collapse"?(t.openBlock(),t.createElementBlock("polyline",xi)):e.name==="expand"?(t.openBlock(),t.createElementBlock("polyline",ki)):e.name==="collapse-all"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:6},[n[8]||(n[8]=t.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)):e.name==="expand-all"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:7},[n[9]||(n[9]=t.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)):e.name==="expand-level-1"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:8},[n[10]||(n[10]=t.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)):e.name==="expand-level-2"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:9},[n[11]||(n[11]=t.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)):e.name==="zoom-in"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:10},[n[12]||(n[12]=t.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=t.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=t.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=t.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):e.name==="zoom-out"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:11},[n[16]||(n[16]=t.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=t.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=t.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):e.name==="reset"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:12},[n[19]||(n[19]=t.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=t.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=t.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=t.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):e.name==="settings"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:13},[n[23]||(n[23]=t.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)):e.name==="data"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:14},[n[24]||(n[24]=t.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]=t.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]=t.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):e.name==="settings"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:15},[n[27]||(n[27]=t.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)):e.name==="data"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:16},[n[28]||(n[28]=t.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]=t.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]=t.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):e.name==="markdown"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:17},[n[31]||(n[31]=t.createElementVNode("path",{d:"M3 17 V7 L7 13 L11 7 V17"},null,-1)),n[32]||(n[32]=t.createElementVNode("path",{d:"M14 7 V17"},null,-1)),n[33]||(n[33]=t.createElementVNode("path",{d:"M14 7 L18 12 L22 7"},null,-1)),n[34]||(n[34]=t.createElementVNode("line",{x1:"14",y1:"17",x2:"22",y2:"17"},null,-1))],64)):e.name==="txt"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:18},[n[35]||(n[35]=t.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[36]||(n[36]=t.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[37]||(n[37]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[38]||(n[38]=t.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):e.name==="logo"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:19},[n[39]||(n[39]=t.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)):e.name==="import"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:20},[n[40]||(n[40]=t.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[41]||(n[41]=t.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[42]||(n[42]=t.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):e.name==="export"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:21},[n[43]||(n[43]=t.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[44]||(n[44]=t.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[45]||(n[45]=t.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):e.name==="balance"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:22},[n[46]||(n[46]=t.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)):e.name==="mindmap"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:23},[n[47]||(n[47]=t.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)):e.name==="tree"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:24},[n[48]||(n[48]=t.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)):e.name==="org"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:25},[n[49]||(n[49]=t.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)):e.name==="image"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:26},[n[50]||(n[50]=t.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[51]||(n[51]=t.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[52]||(n[52]=t.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):e.name==="x"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:27},[n[53]||(n[53]=t.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[54]||(n[54]=t.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):e.name==="link"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:28},[n[55]||(n[55]=t.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[56]||(n[56]=t.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)):e.name==="note"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:29},[n[57]||(n[57]=t.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[58]||(n[58]=t.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[59]||(n[59]=t.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[60]||(n[60]=t.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.createCommentVNode("",!0)],8,Ei))}}),Ni="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",wi="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",jt=[18,15,13,12],_i=[700,600,500,400],Si=[52,40,32,28],Mi=[120,80,60,44],Ci=[.8,.8,.8,.8],vi=jt.length-1;function Ti(e,a){return Math.round(Tt(e,a)*Ci[lt(e)])}function lt(e){return Math.min(vi,Math.max(0,e))}function Tt(e,a=14){return Math.round(jt[lt(e)]*a/14*10)/10}function Ai(e,a=14){return Math.round(Si[lt(e)]*a/14)}const st=60,Pe=14,ye=24;let At=null;function Ri(){if(At)return At;const e=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return e?(At=e,e):{font:"",measureText:()=>({width:0})}}const Jt=new Map;function Oi(e,a,n){const r=`${n}|${a}|${e}`,l=Jt.get(r);if(l!==void 0)return l;const f=Ri();f.font=`${n} ${a}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=f.measureText(e).width;return Jt.set(r,s),s}const Ii=24,Bi=400,Li=8,Qt=16,Di=4,zi=200;function $i(e,a,n){return Math.min(n,Math.max(a,e))}function Pi(e,a,n,r,l){const f=lt(a),s=Tt(a,n),c=Math.min(Oi(e.text||"",s,_i[f]),zi),d=Ti(a,n),m=Math.ceil(c+d*2),b=!!(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table"))?Math.ceil(s*1.2)+6:Ai(a,n);let k=0;if(e.link&&(k+=Qt),e.note&&(k+=Qt),k>0){const B=(e.link?1:0)+(e.note?1:0);k+=Di*B}const h=m+k,g=(()=>{const B=Math.round(Mi[f]*n/14);if(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table")){const J=l==null?void 0:l[e.id];return Math.max(B,J??240)}return B})(),w=!!(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table")),L=r==null?void 0:r[e.id],_=w?Math.max(24,L??Math.max(70,Math.ceil(s*5))):0,F=_>0?10:0;if(!e.image){const B=Math.max(g,h),J=Math.ceil(b+F+_);return{w:B,h:J}}const I=$i(e.image.width,Ii,Bi),P=Math.max(g,h,Math.ceil(I+d*2)),z=Math.ceil(e.image.height+Li+b+F+_);return{w:P,h:z}}function Vi(e,a={}){const n=a.mode??"mindmap",r=a.preservePositions===!0,l=a.baseFontSize??14,f=tn(e,0,null,1,"right",l,a.richHeights,a.richWidths);return Hi(f),Ui(f,n,r),f.x=0,f.y=0,Fi(f,r)}function Ui(e,a,n=!1){if(a==="mindmap"){const r=e.children;if(r.length!==0)if(r.length===1)r[0]._dir="right",r[0].side=1,r[0]._dirRight=1;else{const c=r.reduce((b,k)=>b+k._subtreeH,0);let d=1,m=Math.abs(r[0]._subtreeH-(c-r[0]._subtreeH)),x=0;for(let b=0;b<r.length-1;b++){x+=r[b]._subtreeH;const k=Math.abs(x-(c-x));k<m&&(m=k,d=b+1)}for(let b=0;b<d;b++)r[b]._dir="right",r[b].side=1,r[b]._dirRight=1;for(let b=d;b<r.length;b++)r[b]._dir="left",r[b].side=-1,r[b]._dirRight=-1}const l=e.children.filter(c=>c.side===1),f=e.children.filter(c=>c.side===-1),s=(c,d)=>{const m=d==="right"?1:-1;c._dir=d,c.side=m,c._dirRight=m;for(const x of c.children)s(x,d)};for(const c of l)s(c,"right");for(const c of f)s(c,"left");if(l.length>0){const c={...e,children:l};ct(c,"right",st,!0,n)}if(f.length>0){const c={...e,children:f};ct(c,"left",st,!0,n)}}else if(a==="tree"){const r=l=>{l.side=1,l._dir="right";for(const f of l.children)r(f)};for(const l of e.children)l._dir="right";ct(e,"right",st,!0,n),r(e)}else{for(const r of e.children)r._dir="down";en(e,st,n)}}function ct(e,a,n,r,l=!1){if(e.children.length===0)return;const f=e.children.reduce((m,x,b)=>m+x._subtreeH+(b>0?Pe:0),0),s=a==="right"?1:-1,c=r?s:1;let d=e.y-c*f/2;e.children.forEach(m=>{l||(m.x=e.x+s*(e.width/2+n+m.width/2),m.y=d+c*m._subtreeH/2),m._dir=a,d+=c*(m._subtreeH+Pe),ct(m,a,n,!1,l)})}function en(e,a,n=!1){if(e.children.length===0)return;const r=e.children.reduce((f,s,c)=>f+s._subtreeW+(c>0?Pe*2:0),0);let l=e.x-r/2;e.children.forEach(f=>{n||(f.x=l+f._subtreeW/2,f.y=e.y+e.height/2+a+f.height/2),f._dir="down",l+=f._subtreeW+Pe*2,en(f,a,n)})}function tn(e,a,n,r,l,f,s,c){const d=Pi(e,a,f,s,c),m={id:e.id,text:e.text,depth:a,x:e._x??0,y:e._y??0,width:d.w,height:d.h,fontSize:Tt(a,f),isRoot:a===0,collapsed:e.collapsed,side:r,_dir:l,_dirRight:r,_subtreeH:d.h,_subtreeW:d.w,image:e.image?{...e.image}:void 0,link:e.link?{url:e.link.url}:void 0,note:e.note?{text:e.note.text}:void 0,richContent:e.richContent?{kind:e.richContent.kind,raw:e.richContent.raw,lang:e.richContent.lang}:void 0,children:[],parent:n};if(e.collapsed)return m;const x=e.children.length,b=Math.ceil(x/2);return m.children=e.children.map((k,h)=>{const g=a===0?h<b?1:-1:r;return tn(k,a+1,m,g,l,f,s,c)}),m}function Hi(e){const a=[e];for(let n=0;n<a.length;n++){const r=a[n];for(const l of r.children)a.push(l)}for(let n=a.length-1;n>=0;n--){const r=a[n];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let l=0,f=0;for(const s of r.children)l+=s._subtreeH,f+=s._subtreeW;r.children.length>1&&(l+=Pe*(r.children.length-1),f+=Pe*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,l),r._subtreeW=Math.max(r.width,f)}}function Fi(e,a=!1){const n=[e];let r=1/0,l=-1/0,f=1/0,s=-1/0;for(;n.length;){const m=n.pop(),x=m.width/2,b=m.height/2;m.x-x<r&&(r=m.x-x),m.x+x>l&&(l=m.x+x),m.y-b<f&&(f=m.y-b),m.y+b>s&&(s=m.y+b),n.push(...m.children)}if(a)return{root:e,width:l-r+ye*2,height:s-f+ye*2,vbX:r-ye,vbY:f-ye,vbW:l-r+ye*2,vbH:s-f+ye*2};const c=ye-f,d=[e];for(;d.length;){const m=d.pop();m.y+=c,d.push(...m.children)}return f+=c,s+=c,{root:e,width:l-r+ye*2,height:s+ye,vbX:r-ye,vbY:0,vbW:l-r+ye*2,vbH:s+ye}}const qe=[{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 Wi(e,a=[]){return[...qe,...a].find(r=>r.id===e)??qe[0]}function Se(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Te(e){return JSON.parse(JSON.stringify(e))}function W(e,a){if(e.id===a)return e;for(const n of e.children){const r=W(n,a);if(r)return r}return null}function we(e,a,n=null){if(e.id===a)return n;for(const r of e.children){const l=we(r,a,e);if(l!==null)return l}return null}function Rt(e,a){const n=e.children.findIndex(r=>r.id===a);if(n>=0)return e.children.splice(n,1),!0;for(const r of e.children)if(Rt(r,a))return!0;return!1}function Gi(e,a,n){const r=W(e,a);return!r||r.text===n?!1:(r.text=n,!0)}function Ki(e,a,n,r){if(!we(e,a)||a===n||W(W(e,a),n))return!1;const l=we(e,a),f=l.children.findIndex(m=>m.id===a);if(f<0)return!1;const[s]=l.children.splice(f,1);if(r==="child"){const m=W(e,n);return m?(m.children.push(s),!0):(l.children.splice(f,0,s),!1)}const c=we(e,n);if(!c)return l.children.splice(f,0,s),!1;let d=c.children.findIndex(m=>m.id===n);return d<0?(l.children.splice(f,0,s),!1):(r==="after"&&(d+=1),c.children.splice(d,0,s),!0)}function nn(e){const a=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const l of e.children){const f=l.text.match(a);if(f)if(f[1]){const s=parseInt(f[1],10);s>n&&(n=s)}else r=!0}return n===0&&!r?dt:n>0?`新节点 ${n+1}`:"新节点 2"}function on(e,a,n){const r=W(e,a);if(!r)return null;const l={id:Se(),text:n??nn(r),children:[]};return r.children.push(l),l}function rn(e,a,n){const r=we(e,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const f={id:Se(),text:n??nn(r),children:[]};return r.children.splice(l+1,0,f),f}function Yi(e,a,n){const r=we(e,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const f={id:Se(),text:n,children:[]};return r.children.splice(l,0,f),f}function Zi(e,a){const n=we(e,a);if(!n)return null;const r=n.children.findIndex(s=>s.id===a);if(r<0)return null;const l=n.children[r],f=Te(l);return an(f),n.children.splice(r+1,0,f),f}function an(e){e.id=Se();for(const a of e.children)an(a)}const dt="新节点";function Ot(e,a="导入的导图"){const n=e.split(/\r?\n/),r={id:Se(),text:a,children:[]},l=[r],f=[-1/0],s=[],c=/^(#{1,6})\s+(.+?)\s*#*\s*$/,d=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,m=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,x=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let b=!1,k=[],h=null;function g(_){k.push(_)}function w(){if(h&&k.length>0){for(;k.length>0&&k[0].trim()==="";)k.shift();for(;k.length>0&&k[k.length-1].trim()==="";)k.pop();const _=k.join(`
|
|
2
|
-
`);
|
|
3
|
-
`+
|
|
1
|
+
(function(de,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(de=typeof globalThis<"u"?globalThis:de||self,t(de.FlowMind={},de.Vue))})(this,function(de,t){"use strict";const Ei=["width","height","stroke-width"],xi={key:4,points:"6 9 12 15 18 9"},ki={key:5,points:"9 6 15 12 9 18"},q=t.defineComponent({__name:"Icon",props:{name:{},size:{},stroke:{}},setup(e){return(a,n)=>(t.openBlock(),t.createElementBlock("svg",{width:e.size??16,height:e.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":e.stroke??1.8,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e.name==="add"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[n[0]||(n[0]=t.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[1]||(n[1]=t.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"16"},null,-1)),n[2]||(n[2]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):e.name==="minus"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[n[3]||(n[3]=t.createElementVNode("circle",{cx:"12",cy:"12",r:"9"},null,-1)),n[4]||(n[4]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1))],64)):e.name==="delete"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[n[5]||(n[5]=t.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)):e.name==="edit"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[n[6]||(n[6]=t.createElementVNode("path",{d:"M4 20 l4 -1 11 -11 -3 -3 -11 11 z"},null,-1)),n[7]||(n[7]=t.createElementVNode("line",{x1:"14",y1:"6",x2:"18",y2:"10"},null,-1))],64)):e.name==="collapse"?(t.openBlock(),t.createElementBlock("polyline",xi)):e.name==="expand"?(t.openBlock(),t.createElementBlock("polyline",ki)):e.name==="collapse-all"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:6},[n[8]||(n[8]=t.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)):e.name==="expand-all"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:7},[n[9]||(n[9]=t.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)):e.name==="expand-level-1"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:8},[n[10]||(n[10]=t.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)):e.name==="expand-level-2"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:9},[n[11]||(n[11]=t.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)):e.name==="zoom-in"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:10},[n[12]||(n[12]=t.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[13]||(n[13]=t.createElementVNode("line",{x1:"11",y1:"8",x2:"11",y2:"14"},null,-1)),n[14]||(n[14]=t.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[15]||(n[15]=t.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):e.name==="zoom-out"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:11},[n[16]||(n[16]=t.createElementVNode("circle",{cx:"11",cy:"11",r:"7"},null,-1)),n[17]||(n[17]=t.createElementVNode("line",{x1:"8",y1:"11",x2:"14",y2:"11"},null,-1)),n[18]||(n[18]=t.createElementVNode("line",{x1:"16",y1:"16",x2:"21",y2:"21"},null,-1))],64)):e.name==="reset"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:12},[n[19]||(n[19]=t.createElementVNode("polyline",{points:"4 9 4 4 9 4"},null,-1)),n[20]||(n[20]=t.createElementVNode("polyline",{points:"15 4 20 4 20 9"},null,-1)),n[21]||(n[21]=t.createElementVNode("polyline",{points:"20 15 20 20 15 20"},null,-1)),n[22]||(n[22]=t.createElementVNode("polyline",{points:"9 20 4 20 4 15"},null,-1))],64)):e.name==="settings"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:13},[n[23]||(n[23]=t.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)):e.name==="data"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:14},[n[24]||(n[24]=t.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]=t.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]=t.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):e.name==="settings"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:15},[n[27]||(n[27]=t.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)):e.name==="data"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:16},[n[28]||(n[28]=t.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]=t.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]=t.createElementVNode("line",{x1:"10.5",y1:"12",x2:"13.5",y2:"12"},null,-1))],64)):e.name==="markdown"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:17},[n[31]||(n[31]=t.createElementVNode("path",{d:"M3 17 V7 L7 13 L11 7 V17"},null,-1)),n[32]||(n[32]=t.createElementVNode("path",{d:"M14 7 V17"},null,-1)),n[33]||(n[33]=t.createElementVNode("path",{d:"M14 7 L18 12 L22 7"},null,-1)),n[34]||(n[34]=t.createElementVNode("line",{x1:"14",y1:"17",x2:"22",y2:"17"},null,-1))],64)):e.name==="txt"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:18},[n[35]||(n[35]=t.createElementVNode("rect",{x:"5",y:"3",width:"14",height:"18",rx:"1.5"},null,-1)),n[36]||(n[36]=t.createElementVNode("line",{x1:"8",y1:"8",x2:"16",y2:"8"},null,-1)),n[37]||(n[37]=t.createElementVNode("line",{x1:"8",y1:"12",x2:"16",y2:"12"},null,-1)),n[38]||(n[38]=t.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):e.name==="logo"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:19},[n[39]||(n[39]=t.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)):e.name==="import"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:20},[n[40]||(n[40]=t.createElementVNode("path",{d:"M12 4 V15"},null,-1)),n[41]||(n[41]=t.createElementVNode("polyline",{points:"7 10 12 15 17 10"},null,-1)),n[42]||(n[42]=t.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):e.name==="export"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:21},[n[43]||(n[43]=t.createElementVNode("path",{d:"M12 15 V4"},null,-1)),n[44]||(n[44]=t.createElementVNode("polyline",{points:"7 9 12 4 17 9"},null,-1)),n[45]||(n[45]=t.createElementVNode("path",{d:"M4 19 H20"},null,-1))],64)):e.name==="balance"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:22},[n[46]||(n[46]=t.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)):e.name==="mindmap"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:23},[n[47]||(n[47]=t.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)):e.name==="tree"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:24},[n[48]||(n[48]=t.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)):e.name==="org"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:25},[n[49]||(n[49]=t.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)):e.name==="image"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:26},[n[50]||(n[50]=t.createElementVNode("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"},null,-1)),n[51]||(n[51]=t.createElementVNode("circle",{cx:"9",cy:"11",r:"1.6"},null,-1)),n[52]||(n[52]=t.createElementVNode("polyline",{points:"3 17 9 12 13 15 16 13 21 17"},null,-1))],64)):e.name==="x"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:27},[n[53]||(n[53]=t.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"},null,-1)),n[54]||(n[54]=t.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"},null,-1))],64)):e.name==="link"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:28},[n[55]||(n[55]=t.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[56]||(n[56]=t.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)):e.name==="note"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:29},[n[57]||(n[57]=t.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[58]||(n[58]=t.createElementVNode("line",{x1:"8",y1:"10",x2:"16",y2:"10"},null,-1)),n[59]||(n[59]=t.createElementVNode("line",{x1:"8",y1:"13",x2:"16",y2:"13"},null,-1)),n[60]||(n[60]=t.createElementVNode("line",{x1:"8",y1:"16",x2:"13",y2:"16"},null,-1))],64)):t.createCommentVNode("",!0)],8,Ei))}}),Ni="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",wi="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",jt=[18,15,13,12],_i=[700,600,500,400],Si=[52,40,32,28],Mi=[120,80,60,44],Ci=[.8,.8,.8,.8],vi=jt.length-1;function Ti(e,a){return Math.round(Tt(e,a)*Ci[lt(e)])}function lt(e){return Math.min(vi,Math.max(0,e))}function Tt(e,a=14){return Math.round(jt[lt(e)]*a/14*10)/10}function Ai(e,a=14){return Math.round(Si[lt(e)]*a/14)}const st=60,Pe=14,ye=24;let At=null;function Ri(){if(At)return At;const e=typeof document<"u"?document.createElement("canvas").getContext("2d"):null;return e?(At=e,e):{font:"",measureText:()=>({width:0})}}const Jt=new Map;function Oi(e,a,n){const r=`${n}|${a}|${e}`,l=Jt.get(r);if(l!==void 0)return l;const f=Ri();f.font=`${n} ${a}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;const s=f.measureText(e).width;return Jt.set(r,s),s}const Ii=24,Bi=400,Li=8,Qt=16,Di=4,zi=200;function $i(e,a,n){return Math.min(n,Math.max(a,e))}function Pi(e,a,n,r,l){const f=lt(a),s=Tt(a,n),d=Math.min(Oi(e.text||"",s,_i[f]),zi),c=Ti(a,n),g=Math.ceil(d+c*2),y=!!(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table"))?Math.ceil(s*1.2)+6:Ai(a,n);let N=0;if(e.link&&(N+=Qt),e.note&&(N+=Qt),N>0){const I=(e.link?1:0)+(e.note?1:0);N+=Di*I}const h=g+N,m=(()=>{const I=Math.round(Mi[f]*n/14);if(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table")){const J=l==null?void 0:l[e.id];return Math.max(I,J??240)}return I})(),L=!!(e.richContent&&(e.richContent.kind==="code"||e.richContent.kind==="table")),B=r==null?void 0:r[e.id],b=L?Math.max(24,B??Math.max(70,Math.ceil(s*5))):0,O=b>0?10:0;if(!e.image){const I=Math.max(m,h),J=Math.ceil(y+O+b);return{w:I,h:J}}const R=$i(e.image.width,Ii,Bi),z=Math.max(m,h,Math.ceil(R+c*2)),$=Math.ceil(e.image.height+Li+y+O+b);return{w:z,h:$}}function Vi(e,a={}){const n=a.mode??"mindmap",r=a.preservePositions===!0,l=a.baseFontSize??14,f=tn(e,0,null,1,"right",l,a.richHeights,a.richWidths);return Hi(f),Ui(f,n,r),f.x=0,f.y=0,Fi(f,r)}function Ui(e,a,n=!1){if(a==="mindmap"){const r=e.children;if(r.length!==0)if(r.length===1)r[0]._dir="right",r[0].side=1,r[0]._dirRight=1;else{const d=r.reduce((y,N)=>y+N._subtreeH,0);let c=1,g=Math.abs(r[0]._subtreeH-(d-r[0]._subtreeH)),k=0;for(let y=0;y<r.length-1;y++){k+=r[y]._subtreeH;const N=Math.abs(k-(d-k));N<g&&(g=N,c=y+1)}for(let y=0;y<c;y++)r[y]._dir="right",r[y].side=1,r[y]._dirRight=1;for(let y=c;y<r.length;y++)r[y]._dir="left",r[y].side=-1,r[y]._dirRight=-1}const l=e.children.filter(d=>d.side===1),f=e.children.filter(d=>d.side===-1),s=(d,c)=>{const g=c==="right"?1:-1;d._dir=c,d.side=g,d._dirRight=g;for(const k of d.children)s(k,c)};for(const d of l)s(d,"right");for(const d of f)s(d,"left");if(l.length>0){const d={...e,children:l};ct(d,"right",st,!0,n)}if(f.length>0){const d={...e,children:f};ct(d,"left",st,!0,n)}}else if(a==="tree"){const r=l=>{l.side=1,l._dir="right";for(const f of l.children)r(f)};for(const l of e.children)l._dir="right";ct(e,"right",st,!0,n),r(e)}else{for(const r of e.children)r._dir="down";en(e,st,n)}}function ct(e,a,n,r,l=!1){if(e.children.length===0)return;const f=e.children.reduce((g,k,y)=>g+k._subtreeH+(y>0?Pe:0),0),s=a==="right"?1:-1,d=r?s:1;let c=e.y-d*f/2;e.children.forEach(g=>{l||(g.x=e.x+s*(e.width/2+n+g.width/2),g.y=c+d*g._subtreeH/2),g._dir=a,c+=d*(g._subtreeH+Pe),ct(g,a,n,!1,l)})}function en(e,a,n=!1){if(e.children.length===0)return;const r=e.children.reduce((f,s,d)=>f+s._subtreeW+(d>0?Pe*2:0),0);let l=e.x-r/2;e.children.forEach(f=>{n||(f.x=l+f._subtreeW/2,f.y=e.y+e.height/2+a+f.height/2),f._dir="down",l+=f._subtreeW+Pe*2,en(f,a,n)})}function tn(e,a,n,r,l,f,s,d){const c=Pi(e,a,f,s,d),g={id:e.id,text:e.text,depth:a,x:e._x??0,y:e._y??0,width:c.w,height:c.h,fontSize:Tt(a,f),isRoot:a===0,collapsed:e.collapsed,side:r,_dir:l,_dirRight:r,_subtreeH:c.h,_subtreeW:c.w,image:e.image?{...e.image}:void 0,link:e.link?{url:e.link.url}:void 0,note:e.note?{text:e.note.text}:void 0,richContent:e.richContent?{kind:e.richContent.kind,raw:e.richContent.raw,lang:e.richContent.lang}:void 0,children:[],parent:n};if(e.collapsed)return g;const k=e.children.length,y=Math.ceil(k/2);return g.children=e.children.map((N,h)=>{const m=a===0?h<y?1:-1:r;return tn(N,a+1,g,m,l,f,s,d)}),g}function Hi(e){const a=[e];for(let n=0;n<a.length;n++){const r=a[n];for(const l of r.children)a.push(l)}for(let n=a.length-1;n>=0;n--){const r=a[n];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let l=0,f=0;for(const s of r.children)l+=s._subtreeH,f+=s._subtreeW;r.children.length>1&&(l+=Pe*(r.children.length-1),f+=Pe*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,l),r._subtreeW=Math.max(r.width,f)}}function Fi(e,a=!1){const n=[e];let r=1/0,l=-1/0,f=1/0,s=-1/0;for(;n.length;){const g=n.pop(),k=g.width/2,y=g.height/2;g.x-k<r&&(r=g.x-k),g.x+k>l&&(l=g.x+k),g.y-y<f&&(f=g.y-y),g.y+y>s&&(s=g.y+y),n.push(...g.children)}if(a)return{root:e,width:l-r+ye*2,height:s-f+ye*2,vbX:r-ye,vbY:f-ye,vbW:l-r+ye*2,vbH:s-f+ye*2};const d=ye-f,c=[e];for(;c.length;){const g=c.pop();g.y+=d,c.push(...g.children)}return f+=d,s+=d,{root:e,width:l-r+ye*2,height:s+ye,vbX:r-ye,vbY:0,vbW:l-r+ye*2,vbH:s+ye}}const qe=[{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 Wi(e,a=[]){return[...qe,...a].find(r=>r.id===e)??qe[0]}function Se(){return"n_"+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function Te(e){return JSON.parse(JSON.stringify(e))}function W(e,a){if(e.id===a)return e;for(const n of e.children){const r=W(n,a);if(r)return r}return null}function we(e,a,n=null){if(e.id===a)return n;for(const r of e.children){const l=we(r,a,e);if(l!==null)return l}return null}function Rt(e,a){const n=e.children.findIndex(r=>r.id===a);if(n>=0)return e.children.splice(n,1),!0;for(const r of e.children)if(Rt(r,a))return!0;return!1}function Gi(e,a,n){const r=W(e,a);return!r||r.text===n?!1:(r.text=n,!0)}function Ki(e,a,n,r){if(!we(e,a)||a===n||W(W(e,a),n))return!1;const l=we(e,a),f=l.children.findIndex(g=>g.id===a);if(f<0)return!1;const[s]=l.children.splice(f,1);if(r==="child"){const g=W(e,n);return g?(g.children.push(s),!0):(l.children.splice(f,0,s),!1)}const d=we(e,n);if(!d)return l.children.splice(f,0,s),!1;let c=d.children.findIndex(g=>g.id===n);return c<0?(l.children.splice(f,0,s),!1):(r==="after"&&(c+=1),d.children.splice(c,0,s),!0)}function nn(e){const a=/^新节点(?:\s+(\d+))?$/;let n=0,r=!1;for(const l of e.children){const f=l.text.match(a);if(f)if(f[1]){const s=parseInt(f[1],10);s>n&&(n=s)}else r=!0}return n===0&&!r?dt:n>0?`新节点 ${n+1}`:"新节点 2"}function on(e,a,n){const r=W(e,a);if(!r)return null;const l={id:Se(),text:n??nn(r),children:[]};return r.children.push(l),l}function rn(e,a,n){const r=we(e,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const f={id:Se(),text:n??nn(r),children:[]};return r.children.splice(l+1,0,f),f}function Yi(e,a,n){const r=we(e,a);if(!r)return null;const l=r.children.findIndex(s=>s.id===a);if(l<0)return null;const f={id:Se(),text:n,children:[]};return r.children.splice(l,0,f),f}function Zi(e,a){const n=we(e,a);if(!n)return null;const r=n.children.findIndex(s=>s.id===a);if(r<0)return null;const l=n.children[r],f=Te(l);return an(f),n.children.splice(r+1,0,f),f}function an(e){e.id=Se();for(const a of e.children)an(a)}const dt="新节点";function Ot(e,a="导入的导图"){const n=e.split(/\r?\n/),r={id:Se(),text:a,children:[]},l=[r],f=[-1/0],s=[],d=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,g=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,k=/^(`{3,}|~{3,})\s*(\S+)?\s*$/;let y=!1,N=[],h=null;function m(b){N.push(b)}function L(){if(h&&N.length>0){for(;N.length>0&&N[0].trim()==="";)N.shift();for(;N.length>0&&N[N.length-1].trim()==="";)N.pop();const b=N.join(`
|
|
2
|
+
`);b&&(h.note={text:b})}y=!1,N=[]}for(const b of n){if(y){const I=b.match(k);if(I&&I[1][0]==="`"){L();continue}m(b);continue}const O=b.match(d);if(O){const I=O[1].length,J=O[2].trim();s.push({level:I,text:J,body:""}),h=s[s.length-1];continue}const R=b.match(k);if(R&&R[2]==="note"){y=!0,N=[];continue}const z=b.match(c);if(z&&h){const I=z[2],J=160,ee=120;h.image={src:I,naturalW:J,naturalH:ee,width:J,height:ee};continue}const $=b.match(g);if($&&h){h.link={url:$[2]},h.text=$[1];continue}if(b.trim().length>0&&h){const I=b.trim();h.body=h.body?h.body+`
|
|
3
|
+
`+I:I}}y&&L();function B(b){for(;l.length>1;){const $=l.length-1,I=f[$];if(I!==void 0&&I<b.level)break;l.pop(),f.pop()}const O=l[l.length-1],R=b.text,z={id:Se(),text:R,children:[]};b.image&&(z.image={...b.image}),b.link&&(z.link={url:b.link.url}),b.note&&(z.note={text:b.note.text}),b.body&&(z.note={text:b.body}),O.children.push(z),l.push(z),f.push(b.level)}for(const b of s)B(b);if(s.length>0&&s[0].level===1){const b=r.children[0];b&&(r.text=b.text,r.id=b.id,b.image&&(r.image={...b.image}),b.link&&(r.link={url:b.link.url}),b.note&&(r.note={text:b.note.text}),r.children=b.children)}return r}function ut(e,a=1){let n="#".repeat(a)+" "+(e.text||"")+`
|
|
4
4
|
`;e.link&&(n+=`[${e.text||"link"}](${e.link.url})
|
|
5
5
|
`),e.image&&(n+=`
|
|
6
6
|
`),e.note&&(n+="```note\n"+e.note.text+"\n```\n"),e.richContent&&(n+=e.richContent.raw+`
|
|
7
|
-
`);for(const r of e.children)n+=ut(r,a+1);return n}function Xi(e){var
|
|
8
|
-
`).trim();n.push({kind:"code",text:((
|
|
9
|
-
`)[0])==null?void 0:
|
|
10
|
-
`),lang:
|
|
11
|
-
`)}),r=
|
|
12
|
-
`)}),r=
|
|
13
|
-
`:""}function Ji(e){const a=e.minScale??.2,n=e.maxScale??1/0,r=e.step??1.2,l=t.ref(1),f=t.ref(0),s=t.ref(0),c=t.ref(!1),d=t.reactive({x:0,y:0,ox:0,oy:0}),m=t.ref(!1),x=t.reactive({x:0,y:0}),b=t.reactive({x:0,y:0,width:0,height:0}),k=t.ref(0);let h=null;function g(G){h=G}function w(G){G.preventDefault();const Q=e.getContainer();if(!Q)return;const re=-G.deltaY*.001,ue=Math.min(n,Math.max(a,l.value*(1+re))),ie=Q.getBoundingClientRect(),fe=G.clientX-ie.left,E=G.clientY-ie.top,v=(fe-f.value)/l.value,C=(E-s.value)/l.value;l.value=ue,f.value=fe-v*ue,s.value=E-C*ue}function L(){l.value=Math.min(n,l.value*r)}function _(){l.value=Math.max(a,l.value/r)}function F(G){var re;G.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(c.value=!0,d.x=G.clientX,d.y=G.clientY,d.ox=f.value,d.oy=s.value,window.addEventListener("mousemove",I),window.addEventListener("mouseup",P),(re=G.preventDefault)==null||re.call(G))}function I(G){c.value&&(f.value=d.ox+(G.clientX-d.x),s.value=d.oy+(G.clientY-d.y))}function P(){c.value=!1,window.removeEventListener("mousemove",I),window.removeEventListener("mouseup",P)}function z(G,Q){m.value=!0,x.x=G,x.y=Q,b.x=G,b.y=Q,b.width=0,b.height=0,k.value++,window.addEventListener("mousemove",ee),window.addEventListener("mouseup",J)}function B(G,Q){if(!m.value)return;const re=Math.min(x.x,G),ue=Math.min(x.y,Q),ie=Math.max(x.x,G),fe=Math.max(x.y,Q);b.x=re,b.y=ue,b.width=ie-re,b.height=fe-ue,k.value++}function J(){m.value=!1,window.removeEventListener("mousemove",ee),window.removeEventListener("mouseup",J),h&&h()}function ee(G){if(!m.value)return;const Q=e.getContainer();if(!Q)return;const re=Q.getBoundingClientRect(),ue=(G.clientX-re.left-f.value)/l.value,ie=(G.clientY-re.top-s.value)/l.value;B(ue,ie)}function ae(G,Q,re,ue=60){const ie=e.getContainer();if(!ie)return;const fe=ie.getBoundingClientRect(),E=(fe.width-ue*2)/G,v=(fe.height-ue*2)/Q,C=Math.min(1,Math.max(.3,Math.min(E,v)));l.value=C,f.value=fe.width/2,s.value=fe.height/2-re*C}return{scale:l,offsetX:f,offsetY:s,isPanning:c,onWheel:w,zoomIn:L,zoomOut:_,startPan:F,startMarquee:z,updateMarquee:B,isMarquee:m,marquee:b,marqueeVersion:k,setOnMarqueeEnd:g,resetView:ae}}const Qi=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function ln(e){return Qi?e.metaKey:e.ctrlKey}function eo(e){function a(){const r=e.getSelectedId();return r||(e.defaultTargetId?e.defaultTargetId():e.getRootId())}function n(r){const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)||e.isReadonly()||e.isEditing())return;const f=e.getSelectedId(),s=a();if(s){if(ln(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){f&&f!==e.getRootId()&&(r.preventDefault(),e.onDuplicate(f));return}if(r.key==="z"||r.key==="Z"){r.preventDefault(),e.onUndo();return}if(r.key==="y"||r.key==="Y"){r.preventDefault(),e.onRedo();return}if(r.key==="Home"){r.preventDefault(),e.onSelectRoot();return}}if(ln(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),e.onRedo();return}r.key==="Tab"?(r.preventDefault(),e.onAddChild(s)):r.key==="Enter"?(r.preventDefault(),r.shiftKey?f&&f!==e.getRootId()&&e.onAddSiblingBefore(f):e.onAddSibling(s)):(r.key==="Delete"||r.key==="Backspace")&&f&&f!==e.getRootId()?(r.preventDefault(),e.onRemove(f)):r.key==="F2"&&f?(r.preventDefault(),e.onStartEdit(f)):r.key==="Escape"?(r.preventDefault(),e.onClearSelection()):r.key==="ArrowDown"?(r.preventDefault(),e.onNavigate(0,1)):r.key==="ArrowUp"?(r.preventDefault(),e.onNavigate(0,-1)):r.key==="ArrowRight"?(r.preventDefault(),e.onNavigate(1,0)):r.key==="ArrowLeft"&&(r.preventDefault(),e.onNavigate(-1,0))}}t.onMounted(()=>{window.addEventListener("keydown",n)}),t.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function to(e=100){const a=t.ref([]);let n=-1;function r(){return n>0}function l(){return n<a.value.length-1}function f(m){const x=JSON.stringify(m);for(n<a.value.length-1&&(a.value=a.value.slice(0,n+1)),a.value.push(x),n=a.value.length-1;a.value.length>e;)a.value.shift(),n--}function s(){return r()?(n--,JSON.parse(a.value[n])):null}function c(){return l()?(n++,JSON.parse(a.value[n])):null}function d(){a.value=[],n=-1}return{canUndo:r,canRedo:l,record:f,undo:s,redo:c,reset:d}}const no=t.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(e,{emit:a}){const n=e,r=a,l=t.computed(()=>{let k=n.x+2,h=n.y+2;if(n.container){const g=n.container.getBoundingClientRect(),w=180,_=4+(3+(n.hasImage?1:0)+(n.hasLink?1:0)+(n.hasNote?1:0)+1+(n.hasCode?1:0)+1+(n.hasTable?1:0))*28;k+w>g.right&&(k=Math.max(g.left+4,n.x-w-2)),h+_>g.bottom&&(h=Math.max(g.top+4,n.y-_-2)),k<g.left+2&&(k=g.left+2),h<g.top+2&&(h=g.top+2)}return{left:k,top:h}}),f=t.computed(()=>n.hasImage),s=t.computed(()=>n.hasLink),c=t.computed(()=>n.hasNote);function d(k){const h=k.target;h&&h.closest(".zm-node-menu")||r("close")}function m(k){k.key==="Escape"&&r("close")}function x(){r("close")}window.addEventListener("mousedown",d,!0),window.addEventListener("keydown",m,!0),window.addEventListener("wheel",x,!0),window.addEventListener("scroll",x,!0),t.onBeforeUnmount(()=>{window.removeEventListener("mousedown",d,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener("wheel",x,!0),window.removeEventListener("scroll",x,!0)});function b(k){k(),r("close")}return(k,h)=>(t.openBlock(),t.createElementBlock("div",{class:"zm-node-menu",style:t.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:h[10]||(h[10]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[0]||(h[0]=t.withModifiers(g=>b(()=>r("pickImage")),["stop"]))},[t.createVNode(q,{name:"image",size:13}),t.createElementVNode("span",null,t.toDisplayString(f.value?"替换图片":"添加图片"),1)]),f.value?(t.openBlock(),t.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:h[1]||(h[1]=t.withModifiers(g=>b(()=>r("removeImage")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[11]||(h[11]=t.createElementVNode("span",null,"移除图片",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[2]||(h[2]=t.withModifiers(g=>b(()=>r("setLink")),["stop"]))},[t.createVNode(q,{name:"link",size:13}),t.createElementVNode("span",null,t.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:h[3]||(h[3]=t.withModifiers(g=>b(()=>r("removeLink")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[12]||(h[12]=t.createElementVNode("span",null,"移除链接",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[4]||(h[4]=t.withModifiers(g=>b(()=>r("addCode")),["stop"]))},[h[13]||(h[13]=t.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),t.createElementVNode("span",null,t.toDisplayString(e.hasCode?"编辑代码块":"添加代码块"),1)]),e.hasCode?(t.openBlock(),t.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:h[5]||(h[5]=t.withModifiers(g=>b(()=>r("removeCode")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[14]||(h[14]=t.createElementVNode("span",null,"移除代码块",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[6]||(h[6]=t.withModifiers(g=>b(()=>r("addTable")),["stop"]))},[h[15]||(h[15]=t.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),t.createElementVNode("span",null,t.toDisplayString(e.hasTable?"编辑表格":"添加表格"),1)]),e.hasTable?(t.openBlock(),t.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:h[7]||(h[7]=t.withModifiers(g=>b(()=>r("removeTable")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[16]||(h[16]=t.createElementVNode("span",null,"移除表格",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[8]||(h[8]=t.withModifiers(g=>b(()=>r("editNote")),["stop"]))},[t.createVNode(q,{name:"note",size:13}),t.createElementVNode("span",null,t.toDisplayString(c.value?"编辑笔记":"添加笔记"),1)]),c.value?(t.openBlock(),t.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:h[9]||(h[9]=t.withModifiers(g=>b(()=>r("removeNote")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[17]||(h[17]=t.createElementVNode("span",null,"移除笔记",-1))])):t.createCommentVNode("",!0)],36))}}),io=t.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(e,{emit:a}){const n=e,r=a,l=t.computed(()=>{let g=n.x+2,w=n.y+2;if(n.container){const L=n.container.getBoundingClientRect(),_=160,F=4+3*28;g+_>L.right&&(g=Math.max(L.left+4,n.x-_-2)),w+F>L.bottom&&(w=Math.max(L.top+4,n.y-F-2)),g<L.left+2&&(g=L.left+2),w<L.top+2&&(w=L.top+2)}return{left:g,top:w}}),f=t.ref(!1);let s=null,c=null;function d(){c&&(clearTimeout(c),c=null),s=setTimeout(()=>{f.value=!0},60)}function m(){s&&(clearTimeout(s),s=null),c=setTimeout(()=>{f.value=!1},120)}t.onBeforeUnmount(()=>{s&&clearTimeout(s),c&&clearTimeout(c)});function x(g){const w=g.target;w&&w.closest(".zm-canvas-menu")||r("close")}function b(g){g.key==="Escape"&&r("close")}function k(){r("close")}window.addEventListener("mousedown",x,!0),window.addEventListener("keydown",b,!0),window.addEventListener("wheel",k,!0),window.addEventListener("scroll",k,!0),t.onBeforeUnmount(()=>{window.removeEventListener("mousedown",x,!0),window.removeEventListener("keydown",b,!0),window.removeEventListener("wheel",k,!0),window.removeEventListener("scroll",k,!0)});function h(g){g(),r("close")}return(g,w)=>(t.openBlock(),t.createElementBlock("div",{class:"zm-canvas-menu",style:t.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:w[5]||(w[5]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:w[0]||(w[0]=t.withModifiers(L=>h(()=>r("openData")),["stop"]))},[t.createVNode(q,{name:"data",size:13}),w[6]||(w[6]=t.createElementVNode("span",null,"查看数据",-1))]),t.createElementVNode("div",{class:t.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":f.value}]),onMouseenter:d,onMouseleave:m},[t.createVNode(q,{name:"import",size:13}),w[10]||(w[10]=t.createElementVNode("span",null,"导入",-1)),w[11]||(w[11]=t.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"},[t.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),f.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"zm-canvas-submenu",onMouseenter:d,onMouseleave:m},[t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:w[1]||(w[1]=t.withModifiers(L=>h(()=>r("openImport","markdown")),["stop"]))},[t.createVNode(q,{name:"markdown",size:13}),w[7]||(w[7]=t.createElementVNode("span",null,"Markdown 导入",-1))]),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:w[2]||(w[2]=t.withModifiers(L=>h(()=>r("openImport","json")),["stop"]))},[t.createVNode(q,{name:"data",size:13}),w[8]||(w[8]=t.createElementVNode("span",null,"JSON 文件导入",-1))]),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:w[3]||(w[3]=t.withModifiers(L=>h(()=>r("openImport","txt")),["stop"]))},[t.createVNode(q,{name:"note",size:13}),w[9]||(w[9]=t.createElementVNode("span",null,"TXT 文件导入",-1))])],32)):t.createCommentVNode("",!0)],34),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:w[4]||(w[4]=t.withModifiers(L=>h(()=>r("openSettings")),["stop"]))},[t.createVNode(q,{name:"settings",size:13}),w[12]||(w[12]=t.createElementVNode("span",null,"设置",-1))])],36))}});function oo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sn(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(a=>{const n=e[a],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&sn(n)}),e}class cn{constructor(a){a.data===void 0&&(a.data={}),this.data=a.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function dn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ie(e,...a){const n=Object.create(null);for(const r in e)n[r]=e[r];return a.forEach(function(r){for(const l in r)n[l]=r[l]}),n}const ro="</span>",un=e=>!!e.scope,ao=(e,{prefix:a})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${a}${n.shift()}`,...n.map((r,l)=>`${r}${"_".repeat(l+1)}`)].join(" ")}return`${a}${e}`};class lo{constructor(a,n){this.buffer="",this.classPrefix=n.classPrefix,a.walk(this)}addText(a){this.buffer+=dn(a)}openNode(a){if(!un(a))return;const n=ao(a.scope,{prefix:this.classPrefix});this.span(n)}closeNode(a){un(a)&&(this.buffer+=ro)}value(){return this.buffer}span(a){this.buffer+=`<span class="${a}">`}}const fn=(e={})=>{const a={children:[]};return Object.assign(a,e),a};class It{constructor(){this.rootNode=fn(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(a){this.top.children.push(a)}openNode(a){const n=fn({scope:a});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(a){return this.constructor._walk(a,this.rootNode)}static _walk(a,n){return typeof n=="string"?a.addText(n):n.children&&(a.openNode(n),n.children.forEach(r=>this._walk(a,r)),a.closeNode(n)),a}static _collapse(a){typeof a!="string"&&a.children&&(a.children.every(n=>typeof n=="string")?a.children=[a.children.join("")]:a.children.forEach(n=>{It._collapse(n)}))}}class so extends It{constructor(a){super(),this.options=a}addText(a){a!==""&&this.add(a)}startScope(a){this.openNode(a)}endScope(){this.closeNode()}__addSublanguage(a,n){const r=a.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new lo(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function je(e){return e?typeof e=="string"?e:e.source:null}function gn(e){return Le("(?=",e,")")}function co(e){return Le("(?:",e,")*")}function uo(e){return Le("(?:",e,")?")}function Le(...e){return e.map(n=>je(n)).join("")}function fo(e){const a=e[e.length-1];return typeof a=="object"&&a.constructor===Object?(e.splice(e.length-1,1),a):{}}function Bt(...e){return"("+(fo(e).capture?"":"?:")+e.map(r=>je(r)).join("|")+")"}function mn(e){return new RegExp(e.toString()+"|").exec("").length-1}function go(e,a){const n=e&&e.exec(a);return n&&n.index===0}const mo=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Lt(e,{joinWith:a}){let n=0;return e.map(r=>{n+=1;const l=n;let f=je(r),s="";for(;f.length>0;){const c=mo.exec(f);if(!c){s+=f;break}s+=f.substring(0,c.index),f=f.substring(c.index+c[0].length),c[0][0]==="\\"&&c[1]?s+="\\"+String(Number(c[1])+l):(s+=c[0],c[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(a)}const po=/\b\B/,pn="[a-zA-Z]\\w*",Dt="[a-zA-Z_]\\w*",hn="\\b\\d+(\\.\\d+)?",bn="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",yn="\\b(0b[01]+)",ho="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",bo=(e={})=>{const a=/^#![ ]*\//;return e.binary&&(e.begin=Le(a,/.*\b/,e.binary,/\b.*/)),Ie({scope:"meta",begin:a,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Je={begin:"\\\\[\\s\\S]",relevance:0},yo={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Je]},Eo={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Je]},xo={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/},ft=function(e,a,n={}){const r=Ie({scope:"comment",begin:e,end:a,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const l=Bt("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Le(/[ ]+/,"(",l,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},ko=ft("//","$"),No=ft("/\\*","\\*/"),wo=ft("#","$"),_o={scope:"number",begin:hn,relevance:0},So={scope:"number",begin:bn,relevance:0},Mo={scope:"number",begin:yn,relevance:0},Co={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Je,{begin:/\[/,end:/\]/,relevance:0,contains:[Je]}]},vo={scope:"title",begin:pn,relevance:0},To={scope:"title",begin:Dt,relevance:0},Ao={begin:"\\.\\s*"+Dt,relevance:0};var gt=Object.freeze({__proto__:null,APOS_STRING_MODE:yo,BACKSLASH_ESCAPE:Je,BINARY_NUMBER_MODE:Mo,BINARY_NUMBER_RE:yn,COMMENT:ft,C_BLOCK_COMMENT_MODE:No,C_LINE_COMMENT_MODE:ko,C_NUMBER_MODE:So,C_NUMBER_RE:bn,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(a,n)=>{n.data._beginMatch=a[1]},"on:end":(a,n)=>{n.data._beginMatch!==a[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:wo,IDENT_RE:pn,MATCH_NOTHING_RE:po,METHOD_GUARD:Ao,NUMBER_MODE:_o,NUMBER_RE:hn,PHRASAL_WORDS_MODE:xo,QUOTE_STRING_MODE:Eo,REGEXP_MODE:Co,RE_STARTERS_RE:ho,SHEBANG:bo,TITLE_MODE:vo,UNDERSCORE_IDENT_RE:Dt,UNDERSCORE_TITLE_MODE:To});function Ro(e,a){e.input[e.index-1]==="."&&a.ignoreMatch()}function Oo(e,a){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Io(e,a){a&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Ro,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Bo(e,a){Array.isArray(e.illegal)&&(e.illegal=Bt(...e.illegal))}function Lo(e,a){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Do(e,a){e.relevance===void 0&&(e.relevance=1)}const zo=(e,a)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Le(n.beforeMatch,gn(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},$o=["of","and","for","in","not","or","if","then","parent","list","value"],Po="keyword";function En(e,a,n=Po){const r=Object.create(null);return typeof e=="string"?l(n,e.split(" ")):Array.isArray(e)?l(n,e):Object.keys(e).forEach(function(f){Object.assign(r,En(e[f],a,f))}),r;function l(f,s){a&&(s=s.map(c=>c.toLowerCase())),s.forEach(function(c){const d=c.split("|");r[d[0]]=[f,Vo(d[0],d[1])]})}}function Vo(e,a){return a?Number(a):Uo(e)?0:1}function Uo(e){return $o.includes(e.toLowerCase())}const xn={},De=e=>{console.error(e)},kn=(e,...a)=>{console.log(`WARN: ${e}`,...a)},Ve=(e,a)=>{xn[`${e}/${a}`]||(console.log(`Deprecated as of ${e}. ${a}`),xn[`${e}/${a}`]=!0)},mt=new Error;function Nn(e,a,{key:n}){let r=0;const l=e[n],f={},s={};for(let c=1;c<=a.length;c++)s[c+r]=l[c],f[c+r]=!0,r+=mn(a[c-1]);e[n]=s,e[n]._emit=f,e[n]._multi=!0}function Ho(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw De("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),mt;if(typeof e.beginScope!="object"||e.beginScope===null)throw De("beginScope must be object"),mt;Nn(e,e.begin,{key:"beginScope"}),e.begin=Lt(e.begin,{joinWith:""})}}function Fo(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw De("skip, excludeEnd, returnEnd not compatible with endScope: {}"),mt;if(typeof e.endScope!="object"||e.endScope===null)throw De("endScope must be object"),mt;Nn(e,e.end,{key:"endScope"}),e.end=Lt(e.end,{joinWith:""})}}function Wo(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Go(e){Wo(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Ho(e),Fo(e)}function Ko(e){function a(s,c){return new RegExp(je(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(c?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(c,d){d.position=this.position++,this.matchIndexes[this.matchAt]=d,this.regexes.push([d,c]),this.matchAt+=mn(c)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const c=this.regexes.map(d=>d[1]);this.matcherRe=a(Lt(c,{joinWith:"|"}),!0),this.lastIndex=0}exec(c){this.matcherRe.lastIndex=this.lastIndex;const d=this.matcherRe.exec(c);if(!d)return null;const m=d.findIndex((b,k)=>k>0&&b!==void 0),x=this.matchIndexes[m];return d.splice(0,m),Object.assign(d,x)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(c){if(this.multiRegexes[c])return this.multiRegexes[c];const d=new n;return this.rules.slice(c).forEach(([m,x])=>d.addRule(m,x)),d.compile(),this.multiRegexes[c]=d,d}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(c,d){this.rules.push([c,d]),d.type==="begin"&&this.count++}exec(c){const d=this.getMatcher(this.regexIndex);d.lastIndex=this.lastIndex;let m=d.exec(c);if(this.resumingScanAtSamePosition()&&!(m&&m.index===this.lastIndex)){const x=this.getMatcher(0);x.lastIndex=this.lastIndex+1,m=x.exec(c)}return m&&(this.regexIndex+=m.position+1,this.regexIndex===this.count&&this.considerAll()),m}}function l(s){const c=new r;return s.contains.forEach(d=>c.addRule(d.begin,{rule:d,type:"begin"})),s.terminatorEnd&&c.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&c.addRule(s.illegal,{type:"illegal"}),c}function f(s,c){const d=s;if(s.isCompiled)return d;[Oo,Lo,Go,zo].forEach(x=>x(s,c)),e.compilerExtensions.forEach(x=>x(s,c)),s.__beforeBegin=null,[Io,Bo,Do].forEach(x=>x(s,c)),s.isCompiled=!0;let m=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),m=s.keywords.$pattern,delete s.keywords.$pattern),m=m||/\w+/,s.keywords&&(s.keywords=En(s.keywords,e.case_insensitive)),d.keywordPatternRe=a(m,!0),c&&(s.begin||(s.begin=/\B|\b/),d.beginRe=a(d.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(d.endRe=a(d.end)),d.terminatorEnd=je(d.end)||"",s.endsWithParent&&c.terminatorEnd&&(d.terminatorEnd+=(s.end?"|":"")+c.terminatorEnd)),s.illegal&&(d.illegalRe=a(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(x){return Yo(x==="self"?s:x)})),s.contains.forEach(function(x){f(x,d)}),s.starts&&f(s.starts,c),d.matcher=l(d),d}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Ie(e.classNameAliases||{}),f(e)}function wn(e){return e?e.endsWithParent||wn(e.starts):!1}function Yo(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(a){return Ie(e,{variants:null},a)})),e.cachedVariants?e.cachedVariants:wn(e)?Ie(e,{starts:e.starts?Ie(e.starts):null}):Object.isFrozen(e)?Ie(e):e}var Zo="11.11.1";class Xo extends Error{constructor(a,n){super(a),this.name="HTMLInjectionError",this.html=n}}const zt=dn,_n=Ie,Sn=Symbol("nomatch"),qo=7,Mn=function(e){const a=Object.create(null),n=Object.create(null),r=[];let l=!0;const f="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let c={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:so};function d(E){return c.noHighlightRe.test(E)}function m(E){let v=E.className+" ";v+=E.parentNode?E.parentNode.className:"";const C=c.languageDetectRe.exec(v);if(C){const T=ee(C[1]);return T||(kn(f.replace("{}",C[1])),kn("Falling back to no-highlight mode for this block.",E)),T?C[1]:"no-highlight"}return v.split(/\s+/).find(T=>d(T)||ee(T))}function x(E,v,C){let T="",U="";typeof v=="object"?(T=E,C=v.ignoreIllegals,U=v.language):(Ve("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ve("10.7.0",`Please use highlight(code, options) instead.
|
|
14
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),
|
|
15
|
-
`,1;if(Ke>1e5&&Ke>R.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Y+=V,V.length}const ke=ee(E);if(!ke)throw De(f.replace("{}",E)),new Error('Unknown language: "'+E+'"');const kt=Ko(ke);let et="",D=T||kt;const Nt={},le=new c.__emitter(c);Wt();let Y="",Ge=0,Ae=0,Ke=0,Ye=!1;try{if(ke.__emitTokens)ke.__emitTokens(v,le);else{for(D.matcher.considerAll();;){Ke++,Ye?Ye=!1:D.matcher.considerAll(),D.matcher.lastIndex=Ae;const M=D.matcher.exec(v);if(!M)break;const R=v.substring(Ae,M.index),V=Qe(R,M);Ae=M.index+V}Qe(v.substring(Ae))}return le.finalize(),et=le.toHTML(),{language:E,value:et,relevance:Ge,illegal:!1,_emitter:le,_top:D}}catch(M){if(M.message&&M.message.includes("Illegal"))return{language:E,value:zt(v),illegal:!0,relevance:0,_illegalBy:{message:M.message,index:Ae,context:v.slice(Ae-100,Ae+100),mode:M.mode,resultSoFar:et},_emitter:le};if(l)return{language:E,value:zt(v),illegal:!1,relevance:0,errorRaised:M,_emitter:le,_top:D};throw M}}function k(E){const v={value:zt(E),illegal:!1,relevance:0,_top:s,_emitter:new c.__emitter(c)};return v._emitter.addText(E),v}function h(E,v){v=v||c.languages||Object.keys(a);const C=k(E),T=v.filter(ee).filter(G).map(me=>b(me,E,!1));T.unshift(C);const U=T.sort((me,xe)=>{if(me.relevance!==xe.relevance)return xe.relevance-me.relevance;if(me.language&&xe.language){if(ee(me.language).supersetOf===xe.language)return 1;if(ee(xe.language).supersetOf===me.language)return-1}return 0}),[ne,ge]=U,Ee=ne;return Ee.secondBest=ge,Ee}function g(E,v,C){const T=v&&n[v]||C;E.classList.add("hljs"),E.classList.add(`language-${T}`)}function w(E){let v=null;const C=m(E);if(d(C))return;if(ie("before:highlightElement",{el:E,language:C}),E.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",E);return}if(E.children.length>0&&(c.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(E)),c.throwUnescapedHTML))throw new Xo("One of your code blocks includes unescaped HTML.",E.innerHTML);v=E;const T=v.textContent,U=C?x(T,{language:C,ignoreIllegals:!0}):h(T);E.innerHTML=U.value,E.dataset.highlighted="yes",g(E,C,U.language),E.result={language:U.language,re:U.relevance,relevance:U.relevance},U.secondBest&&(E.secondBest={language:U.secondBest.language,relevance:U.secondBest.relevance}),ie("after:highlightElement",{el:E,result:U,text:T})}function L(E){c=_n(c,E)}const _=()=>{P(),Ve("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function F(){P(),Ve("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let I=!1;function P(){function E(){P()}if(document.readyState==="loading"){I||window.addEventListener("DOMContentLoaded",E,!1),I=!0;return}document.querySelectorAll(c.cssSelector).forEach(w)}function z(E,v){let C=null;try{C=v(e)}catch(T){if(De("Language definition for '{}' could not be registered.".replace("{}",E)),l)De(T);else throw T;C=s}C.name||(C.name=E),a[E]=C,C.rawDefinition=v.bind(null,e),C.aliases&&ae(C.aliases,{languageName:E})}function B(E){delete a[E];for(const v of Object.keys(n))n[v]===E&&delete n[v]}function J(){return Object.keys(a)}function ee(E){return E=(E||"").toLowerCase(),a[E]||a[n[E]]}function ae(E,{languageName:v}){typeof E=="string"&&(E=[E]),E.forEach(C=>{n[C.toLowerCase()]=v})}function G(E){const v=ee(E);return v&&!v.disableAutodetect}function Q(E){E["before:highlightBlock"]&&!E["before:highlightElement"]&&(E["before:highlightElement"]=v=>{E["before:highlightBlock"](Object.assign({block:v.el},v))}),E["after:highlightBlock"]&&!E["after:highlightElement"]&&(E["after:highlightElement"]=v=>{E["after:highlightBlock"](Object.assign({block:v.el},v))})}function re(E){Q(E),r.push(E)}function ue(E){const v=r.indexOf(E);v!==-1&&r.splice(v,1)}function ie(E,v){const C=E;r.forEach(function(T){T[C]&&T[C](v)})}function fe(E){return Ve("10.7.0","highlightBlock will be removed entirely in v12.0"),Ve("10.7.0","Please use highlightElement now."),w(E)}Object.assign(e,{highlight:x,highlightAuto:h,highlightAll:P,highlightElement:w,highlightBlock:fe,configure:L,initHighlighting:_,initHighlightingOnLoad:F,registerLanguage:z,unregisterLanguage:B,listLanguages:J,getLanguage:ee,registerAliases:ae,autoDetection:G,inherit:_n,addPlugin:re,removePlugin:ue}),e.debugMode=function(){l=!1},e.safeMode=function(){l=!0},e.versionString=Zo,e.regex={concat:Le,lookahead:gn,either:Bt,optional:uo,anyNumberOfTimes:co};for(const E in gt)typeof gt[E]=="object"&&sn(gt[E]);return Object.assign(e,gt),e},Ue=Mn({});Ue.newInstance=()=>Mn({});var jo=Ue;Ue.HighlightJS=Ue,Ue.default=Ue;const $t=oo(jo);function Pt(e){const a=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:a.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},f=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,l]};l.contains.push(c);const d={match:/\\"/},m={className:"string",begin:/'/,end:/'/},x={match:/\\'/},b={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},k=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${k.join("|")})`,relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},w=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],L=["true","false"],_={match:/(\/[a-z._-]+)+/},F=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],I=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],P=["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"],z=["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:w,literal:L,built_in:[...F,...I,"set","shopt",...P,...z]},contains:[h,e.SHEBANG(),g,b,f,s,_,c,d,m,x,n]}}const Jo=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.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:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.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_-]*/}}),Qo=["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"],er=["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"],tr=[...Qo,...er],nr=["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(),ir=["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(),or=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rr=["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 ar(e){const a=e.regex,n=Jo(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",f=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",c=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+ir.join("|")+")"},{begin:":(:)?("+or.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rr.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...c,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...c,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:a.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:f},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:nr.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...c,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+tr.join("|")+")\\b"}]}}function Cn(e){const f={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:f,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.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:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:f,illegal:/["']/}]}]}}var He="[0-9](_*[0-9])*",pt=`\\.(${He})`,ht="[0-9a-fA-F](_*[0-9a-fA-F])*",vn={className:"number",variants:[{begin:`(\\b(${He})((${pt})|\\.)?|(${pt}))[eE][+-]?(${He})[fFdD]?\\b`},{begin:`\\b(${He})((${pt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${pt})[fFdD]?\\b`},{begin:`\\b(${He})[fFdD]\\b`},{begin:`\\b0[xX]((${ht})\\.?|(${ht})?\\.(${ht}))[pP][+-]?(${He})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ht})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Tn(e,a,n){return n===-1?"":e.replace(a,r=>Tn(e,a,n-1))}function lr(e){const a=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Tn("(?:<"+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"]}]},x={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.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:[a.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,vn,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},vn,m]}}const An="[A-Za-z$_][0-9A-Za-z$_]*",sr=["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"],cr=["true","false","null","undefined","NaN","Infinity"],Rn=["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"],On=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],In=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],dr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ur=[].concat(In,Rn,On);function Bn(e){const a=e.regex,n=(C,{after:T})=>{const U="</"+C[0].slice(1);return C.input.indexOf(U,T)!==-1},r=An,l={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(C,T)=>{const U=C[0].length+C.index,ne=C.input[U];if(ne==="<"||ne===","){T.ignoreMatch();return}ne===">"&&(n(C,{after:U})||T.ignoreMatch());let ge;const Ee=C.input.substring(U);if(ge=Ee.match(/^\s*=/)){T.ignoreMatch();return}if((ge=Ee.match(/^\s+extends\s+/))&&ge.index===0){T.ignoreMatch();return}}},c={$pattern:An,keyword:sr,literal:cr,built_in:ur,"variable.language":dr},d="[0-9](_?[0-9])*",m=`\\.(${d})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${x})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\b`},{begin:`\\b(${x})\\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},k={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"graphql"}},L={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,k]},F={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},I=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,w,L,{match:/\$\d+/},b];k.contains=I.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(I)});const P=[].concat(F,k.contains),z=P.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(P)}]),B={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z},J={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:a.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:{_:[...Rn,...On]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[B],illegal:/%/},Q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(C){return a.concat("(?!",C.join("|"),")")}const ue={match:a.concat(/\b/,re([...In,"super","import"].map(C=>`${C}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},B]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",v={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[B]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,w,L,F,{match:/\$\d+/},b,ee,{scope:"attr",match:r+a.lookahead(":"),relevance:0},v,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[F,e.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:f},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[B,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[B]},ue,Q,J,fe,{match:/\$[(.]/}]}}function fr(e){const a={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],l={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[a,n,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Ln(e){const a=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},l={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}]},f={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:a.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),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}/}]},x={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},b=e.inherit(m,{contains:[]}),k=e.inherit(x,{contains:[]});m.contains.push(k),x.contains.push(b);let h=[n,d];return[m,x,b,k].forEach(_=>{_.contains=_.contains.concat(h)}),h=h.concat(m,x),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},n,f,m,x,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},l,r,d,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Dn(e){const a=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},d={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},x={begin:/\{\{/,relevance:0},b={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,d,x,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,d,x,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:[e.BACKSLASH_ESCAPE,x,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,x,m]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},k="[0-9](_?[0-9])*",h=`(\\b(${k}))?\\.(${k})|\\b(${k})\\.`,g=`\\b|${r.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${k})|(${h}))[eE][+-]?(${k})[jJ]?(?=${g})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${k})[jJ](?=${g})`}]},L={className:"comment",begin:a.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},_={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",d,w,b,e.HASH_COMMENT_MODE]}]};return m.contains=[b,w,d],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[d,w,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},b,L,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[_]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[w,_,b]}]}}function zn(e){const a=e.regex,n=/(r#)?/,r=a.concat(n,e.UNDERSCORE_IDENT_RE),l=a.concat(n,e.IDENT_RE),f={className:"title.function.invoke",relevance:0,begin:a.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,a.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",c=["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!"],x=["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:e.IDENT_RE+"!?",type:x,keyword:c,literal:d,built_in:m},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:m,type:x}},{className:"punctuation",begin:"->"},f]}}function gr(e){const a=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},f=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],c=["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"],x=["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"],k=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=x,g=[...m,...d].filter(z=>!x.includes(z)),w={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},L={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:a.concat(/\b/,a.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function F(z){return a.concat(/\b/,a.either(...z.map(B=>B.replace(/\s+/,"\\s+"))),/\b/)}const I={scope:"keyword",match:F(k),relevance:0};function P(z,{exceptions:B,when:J}={}){const ee=J;return B=B||[],z.map(ae=>ae.match(/\|\d+$/)||B.includes(ae)?ae:ee(ae)?`${ae}|0`:ae)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:P(g,{when:z=>z.length<3}),literal:f,type:c,built_in:b},contains:[{scope:"type",match:F(s)},I,_,w,r,l,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,L]}}const bt="[A-Za-z$_][0-9A-Za-z$_]*",$n=["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"],Pn=["true","false","null","undefined","NaN","Infinity"],Vn=["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"],Un=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Fn=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Wn=[].concat(Hn,Vn,Un);function mr(e){const a=e.regex,n=(C,{after:T})=>{const U="</"+C[0].slice(1);return C.input.indexOf(U,T)!==-1},r=bt,l={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(C,T)=>{const U=C[0].length+C.index,ne=C.input[U];if(ne==="<"||ne===","){T.ignoreMatch();return}ne===">"&&(n(C,{after:U})||T.ignoreMatch());let ge;const Ee=C.input.substring(U);if(ge=Ee.match(/^\s*=/)){T.ignoreMatch();return}if((ge=Ee.match(/^\s+extends\s+/))&&ge.index===0){T.ignoreMatch();return}}},c={$pattern:bt,keyword:$n,literal:Pn,built_in:Wn,"variable.language":Fn},d="[0-9](_?[0-9])*",m=`\\.(${d})`,x="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",b={className:"number",variants:[{begin:`(\\b(${x})((${m})|\\.)?|(${m}))[eE][+-]?(${d})\\b`},{begin:`\\b(${x})\\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},k={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"xml"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,k],subLanguage:"graphql"}},L={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,k]},F={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},I=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,w,L,{match:/\$\d+/},b];k.contains=I.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(I)});const P=[].concat(F,k.contains),z=P.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(P)}]),B={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z},J={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:a.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:{_:[...Vn,...Un]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[B],illegal:/%/},Q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(C){return a.concat("(?!",C.join("|"),")")}const ue={match:a.concat(/\b/,re([...Hn,"super","import"].map(C=>`${C}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},B]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",v={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[B]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:z,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,w,L,F,{match:/\$\d+/},b,ee,{scope:"attr",match:r+a.lookahead(":"),relevance:0},v,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[F,e.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:z}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:f},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[B,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[B]},ue,Q,J,fe,{match:/\$[(.]/}]}}function Gn(e){const a=e.regex,n=mr(e),r=bt,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[n.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},d=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:bt,keyword:$n.concat(d),literal:Pn,built_in:Wn.concat(l),"variable.language":Fn},x={className:"meta",begin:"@"+r},b=(w,L,_)=>{const F=w.contains.findIndex(I=>I.label===L);if(F===-1)throw new Error("can not find mode to replace");w.contains.splice(F,1,_)};Object.assign(n.keywords,m),n.exports.PARAMS_CONTAINS.push(x);const k=n.contains.find(w=>w.scope==="attr"),h=Object.assign({},k,{match:a.concat(r,a.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,k,h]),n.contains=n.contains.concat([x,f,s,h]),b(n,"shebang",e.SHEBANG()),b(n,"use_strict",c);const g=n.contains.find(w=>w.label==="func.def");return g.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Kn(e){const a=e.regex,n=a.concat(/[\p{L}_]/u,a.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},f={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(f,{begin:/\(/,end:/\)/}),c=e.inherit(e.APOS_STRING_MODE,{className:"string"}),d=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),m={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{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:[f,d,c,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[f,s,d,c]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{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:a.concat(/</,a.lookahead(a.concat(n,a.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:m}]},{className:"tag",begin:a.concat(/<\//,a.lookahead(a.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Yn(e){const a="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},f={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,l]},c=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),k={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"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:a,relevance:0},g={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},w={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},L=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:a,keywords:{literal:a}},k,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},g,w,f,s],_=[...L];return _.pop(),_.push(c),h.contains=_,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:L}}const Vt={bash:Pt,sh:Pt,shell:Pt,css:ar,go:Cn,golang:Cn,java:lr,javascript:Bn,js:Bn,json:fr,markdown:Ln,md:Ln,python:Dn,py:Dn,rust:zn,rs:zn,sql:gr,typescript:Gn,ts:Gn,xml:Kn,html:Kn,yaml:Yn,yml:Yn};for(const[e,a]of Object.entries(Vt))$t.registerLanguage(e,a);function Zn(e){const a=e.split(`
|
|
7
|
+
`);for(const r of e.children)n+=ut(r,a+1);return n}function Xi(e){var g,k;const a=e.split(/\r?\n/),n=[];let r=0;const l=/^(#{1,6})\s+(.+?)\s*#*\s*$/,f=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,s=/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/,d=/^(\s*)[-*+]\s+(.*)$/,c=/^(\s*)\d+\.\s+(.*)$/;for(;r<a.length;){const y=a[r],N=y.match(f);if(N){const R=N[1][0],z=N[2]||"",$=[y];for(r++;r<a.length;){const J=a[r].match(f);if(J&&J[1][0]===R){$.push(a[r]),r++;break}$.push(a[r]),r++}const I=$.slice(1,-1).join(`
|
|
8
|
+
`).trim();n.push({kind:"code",text:((g=I.split(`
|
|
9
|
+
`)[0])==null?void 0:g.slice(0,80))||"(空代码块)",raw:$.join(`
|
|
10
|
+
`),lang:z});continue}const h=y.match(l);if(h){n.push({kind:"heading",level:h[1].length,text:h[2].trim(),raw:y}),r++;continue}if(/^\s*\|/.test(y)){const R=[];let z=r,$=!1;for(;z<a.length&&/^\s*\|/.test(a[z]);)R.push(a[z]),s.test(a[z])&&($=!0),z++;if($&&R.length>=2){n.push({kind:"table",text:((k=R[0].replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|")[0])==null?void 0:k.trim())||"表格",raw:R.join(`
|
|
11
|
+
`)}),r=z;continue}}const m=y.match(d),L=y.match(c);if(m||L){let R=r;for(;R<a.length;){const z=a[R].match(d),$=a[R].match(c);if(!(z||$))break;const I=a[R].replace(/^\s*[-*+]\s+/,"").replace(/^\s*\d+\.\s+/,"").trim();I.length>0&&n.push({kind:"list",text:I.slice(0,80)||"(列表项)",raw:a[R]}),R++}r=R;continue}if(y.trim()===""){r++;continue}const B=[y];let b=r+1;for(;b<a.length;){const R=a[b];if(R.trim()===""||l.test(R)||f.test(R)||d.test(R)||c.test(R)||/^\s*\|/.test(R))break;B.push(R),b++}const O=B.join(" ").trim();n.push({kind:"paragraph",text:O.slice(0,80)||"(空段落)",raw:B.join(`
|
|
12
|
+
`)}),r=b}return n}function qi(e,a="导入的导图"){const n=Xi(e||""),r={id:Se(),text:a,children:[]},l=[r],f=[0];let s=!1;function d(c){if(c.kind==="heading"){const k=c.level;for(;l.length>1&&f[f.length-1]>=k;)l.pop(),f.pop();if(!s&&k===1){s=!0,r.text=c.text,f[0]=1;return}const y={id:Se(),text:c.text,children:[]};l[l.length-1].children.push(y),l.push(y),f.push(k);return}const g={id:Se(),text:c.text,children:[],richContent:{kind:c.kind,raw:c.raw,lang:c.lang}};l[l.length-1].children.push(g)}for(const c of n)d(c);return r}function ji(e){return e.richContent?e.richContent.raw+`
|
|
13
|
+
`:""}function Ji(e){const a=e.minScale??.2,n=e.maxScale??1/0,r=e.step??1.2,l=t.ref(1),f=t.ref(0),s=t.ref(0),d=t.ref(!1),c=t.reactive({x:0,y:0,ox:0,oy:0}),g=t.ref(!1),k=t.reactive({x:0,y:0}),y=t.reactive({x:0,y:0,width:0,height:0}),N=t.ref(0);let h=null;function m(G){h=G}function L(G){G.preventDefault();const Q=e.getContainer();if(!Q)return;const re=-G.deltaY*.001,ue=Math.min(n,Math.max(a,l.value*(1+re))),ie=Q.getBoundingClientRect(),fe=G.clientX-ie.left,x=G.clientY-ie.top,C=(fe-f.value)/l.value,M=(x-s.value)/l.value;l.value=ue,f.value=fe-C*ue,s.value=x-M*ue}function B(){l.value=Math.min(n,l.value*r)}function b(){l.value=Math.max(a,l.value/r)}function O(G){var re;G.target.closest(".zm-node, .zm-toolbar, button, input, textarea")||(d.value=!0,c.x=G.clientX,c.y=G.clientY,c.ox=f.value,c.oy=s.value,window.addEventListener("mousemove",R),window.addEventListener("mouseup",z),(re=G.preventDefault)==null||re.call(G))}function R(G){d.value&&(f.value=c.ox+(G.clientX-c.x),s.value=c.oy+(G.clientY-c.y))}function z(){d.value=!1,window.removeEventListener("mousemove",R),window.removeEventListener("mouseup",z)}function $(G,Q){g.value=!0,k.x=G,k.y=Q,y.x=G,y.y=Q,y.width=0,y.height=0,N.value++,window.addEventListener("mousemove",ee),window.addEventListener("mouseup",J)}function I(G,Q){if(!g.value)return;const re=Math.min(k.x,G),ue=Math.min(k.y,Q),ie=Math.max(k.x,G),fe=Math.max(k.y,Q);y.x=re,y.y=ue,y.width=ie-re,y.height=fe-ue,N.value++}function J(){g.value=!1,window.removeEventListener("mousemove",ee),window.removeEventListener("mouseup",J),h&&h()}function ee(G){if(!g.value)return;const Q=e.getContainer();if(!Q)return;const re=Q.getBoundingClientRect(),ue=(G.clientX-re.left-f.value)/l.value,ie=(G.clientY-re.top-s.value)/l.value;I(ue,ie)}function ae(G,Q,re,ue=60){const ie=e.getContainer();if(!ie)return;const fe=ie.getBoundingClientRect(),x=(fe.width-ue*2)/G,C=(fe.height-ue*2)/Q,M=Math.min(1,Math.max(.3,Math.min(x,C)));l.value=M,f.value=fe.width/2,s.value=fe.height/2-re*M}return{scale:l,offsetX:f,offsetY:s,isPanning:d,onWheel:L,zoomIn:B,zoomOut:b,startPan:O,startMarquee:$,updateMarquee:I,isMarquee:g,marquee:y,marqueeVersion:N,setOnMarqueeEnd:m,resetView:ae}}const Qi=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform);function ln(e){return Qi?e.metaKey:e.ctrlKey}function eo(e){function a(){const r=e.getSelectedId();return r||(e.defaultTargetId?e.defaultTargetId():e.getRootId())}function n(r){const l=r.target;if(l&&(l.tagName==="INPUT"||l.tagName==="TEXTAREA"||l.isContentEditable)||e.isReadonly()||e.isEditing())return;const f=e.getSelectedId(),s=a();if(s){if(ln(r)&&!r.shiftKey){if(r.key==="d"||r.key==="D"){f&&f!==e.getRootId()&&(r.preventDefault(),e.onDuplicate(f));return}if(r.key==="z"||r.key==="Z"){r.preventDefault(),e.onUndo();return}if(r.key==="y"||r.key==="Y"){r.preventDefault(),e.onRedo();return}if(r.key==="Home"){r.preventDefault(),e.onSelectRoot();return}}if(ln(r)&&r.shiftKey&&(r.key==="Z"||r.key==="z")){r.preventDefault(),e.onRedo();return}r.key==="Tab"?(r.preventDefault(),e.onAddChild(s)):r.key==="Enter"?(r.preventDefault(),r.shiftKey?f&&f!==e.getRootId()&&e.onAddSiblingBefore(f):e.onAddSibling(s)):(r.key==="Delete"||r.key==="Backspace")&&f&&f!==e.getRootId()?(r.preventDefault(),e.onRemove(f)):r.key==="F2"&&f?(r.preventDefault(),e.onStartEdit(f)):r.key==="Escape"?(r.preventDefault(),e.onClearSelection()):r.key==="ArrowDown"?(r.preventDefault(),e.onNavigate(0,1)):r.key==="ArrowUp"?(r.preventDefault(),e.onNavigate(0,-1)):r.key==="ArrowRight"?(r.preventDefault(),e.onNavigate(1,0)):r.key==="ArrowLeft"&&(r.preventDefault(),e.onNavigate(-1,0))}}t.onMounted(()=>{window.addEventListener("keydown",n)}),t.onBeforeUnmount(()=>{window.removeEventListener("keydown",n)})}function to(e=100){const a=t.ref([]);let n=-1;function r(){return n>0}function l(){return n<a.value.length-1}function f(g){const k=JSON.stringify(g);for(n<a.value.length-1&&(a.value=a.value.slice(0,n+1)),a.value.push(k),n=a.value.length-1;a.value.length>e;)a.value.shift(),n--}function s(){return r()?(n--,JSON.parse(a.value[n])):null}function d(){return l()?(n++,JSON.parse(a.value[n])):null}function c(){a.value=[],n=-1}return{canUndo:r,canRedo:l,record:f,undo:s,redo:d,reset:c}}const no=t.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(e,{emit:a}){const n=e,r=a,l=t.computed(()=>{let N=n.x+2,h=n.y+2;if(n.container){const m=n.container.getBoundingClientRect(),L=180,b=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;N+L>m.right&&(N=Math.max(m.left+4,n.x-L-2)),h+b>m.bottom&&(h=Math.max(m.top+4,n.y-b-2)),N<m.left+2&&(N=m.left+2),h<m.top+2&&(h=m.top+2)}return{left:N,top:h}}),f=t.computed(()=>n.hasImage),s=t.computed(()=>n.hasLink),d=t.computed(()=>n.hasNote);function c(N){const h=N.target;h&&h.closest(".zm-node-menu")||r("close")}function g(N){N.key==="Escape"&&r("close")}function k(){r("close")}window.addEventListener("mousedown",c,!0),window.addEventListener("keydown",g,!0),window.addEventListener("wheel",k,!0),window.addEventListener("scroll",k,!0),t.onBeforeUnmount(()=>{window.removeEventListener("mousedown",c,!0),window.removeEventListener("keydown",g,!0),window.removeEventListener("wheel",k,!0),window.removeEventListener("scroll",k,!0)});function y(N){N(),r("close")}return(N,h)=>(t.openBlock(),t.createElementBlock("div",{class:"zm-node-menu",style:t.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:h[10]||(h[10]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[0]||(h[0]=t.withModifiers(m=>y(()=>r("pickImage")),["stop"]))},[t.createVNode(q,{name:"image",size:13}),t.createElementVNode("span",null,t.toDisplayString(f.value?"替换图片":"添加图片"),1)]),f.value?(t.openBlock(),t.createElementBlock("button",{key:0,class:"zm-node-menu-item",onClick:h[1]||(h[1]=t.withModifiers(m=>y(()=>r("removeImage")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[11]||(h[11]=t.createElementVNode("span",null,"移除图片",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[2]||(h[2]=t.withModifiers(m=>y(()=>r("setLink")),["stop"]))},[t.createVNode(q,{name:"link",size:13}),t.createElementVNode("span",null,t.toDisplayString(s.value?"编辑链接":"添加链接"),1)]),s.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"zm-node-menu-item",onClick:h[3]||(h[3]=t.withModifiers(m=>y(()=>r("removeLink")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[12]||(h[12]=t.createElementVNode("span",null,"移除链接",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[4]||(h[4]=t.withModifiers(m=>y(()=>r("addCode")),["stop"]))},[h[13]||(h[13]=t.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-code","aria-hidden":"true"},"{ }",-1)),t.createElementVNode("span",null,t.toDisplayString(e.hasCode?"编辑代码块":"添加代码块"),1)]),e.hasCode?(t.openBlock(),t.createElementBlock("button",{key:2,class:"zm-node-menu-item",onClick:h[5]||(h[5]=t.withModifiers(m=>y(()=>r("removeCode")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[14]||(h[14]=t.createElementVNode("span",null,"移除代码块",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[6]||(h[6]=t.withModifiers(m=>y(()=>r("addTable")),["stop"]))},[h[15]||(h[15]=t.createElementVNode("span",{class:"zm-node-menu-icon zm-node-menu-icon-table","aria-hidden":"true"},"▦",-1)),t.createElementVNode("span",null,t.toDisplayString(e.hasTable?"编辑表格":"添加表格"),1)]),e.hasTable?(t.openBlock(),t.createElementBlock("button",{key:3,class:"zm-node-menu-item",onClick:h[7]||(h[7]=t.withModifiers(m=>y(()=>r("removeTable")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[16]||(h[16]=t.createElementVNode("span",null,"移除表格",-1))])):t.createCommentVNode("",!0),t.createElementVNode("button",{class:"zm-node-menu-item",onClick:h[8]||(h[8]=t.withModifiers(m=>y(()=>r("editNote")),["stop"]))},[t.createVNode(q,{name:"note",size:13}),t.createElementVNode("span",null,t.toDisplayString(d.value?"编辑笔记":"添加笔记"),1)]),d.value?(t.openBlock(),t.createElementBlock("button",{key:4,class:"zm-node-menu-item",onClick:h[9]||(h[9]=t.withModifiers(m=>y(()=>r("removeNote")),["stop"]))},[t.createVNode(q,{name:"x",size:13}),h[17]||(h[17]=t.createElementVNode("span",null,"移除笔记",-1))])):t.createCommentVNode("",!0)],36))}}),io=t.defineComponent({__name:"CanvasContextMenu",props:{x:{},y:{},container:{}},emits:["openSettings","openData","openImport","close"],setup(e,{emit:a}){const n=e,r=a,l=t.computed(()=>{let B=n.x+2,b=n.y+2;if(n.container){const O=n.container.getBoundingClientRect(),R=160,z=4+3*28;B+R>O.right&&(B=Math.max(O.left+4,n.x-R-2)),b+z>O.bottom&&(b=Math.max(O.top+4,n.y-z-2)),B<O.left+2&&(B=O.left+2),b<O.top+2&&(b=O.top+2)}return{left:B,top:b}}),f=t.ref(!1),s=t.ref(null),d=t.computed(()=>{if(!s.value)return{left:"-9999px",top:"-9999px",display:"none"};const B=s.value.getBoundingClientRect(),b=window.innerWidth,O=window.innerHeight,R=176,z=4+3*28;let $=B.right;$+R>b-4&&($=Math.max(4,B.left-R));let I=B.top-4;return I+z>O-4&&(I=Math.max(4,O-z-4)),{left:$+"px",top:I+"px",display:"block"}});let c=null,g=null;function k(){g&&(clearTimeout(g),g=null),c=setTimeout(()=>{f.value=!0},60)}function y(){c&&(clearTimeout(c),c=null),g=setTimeout(()=>{f.value=!1},120)}t.onBeforeUnmount(()=>{c&&clearTimeout(c),g&&clearTimeout(g)});function N(B){const b=B.target;b&&b.closest(".zm-canvas-menu")||r("close")}function h(B){B.key==="Escape"&&r("close")}function m(){r("close")}window.addEventListener("mousedown",N,!0),window.addEventListener("keydown",h,!0),window.addEventListener("wheel",m,!0),window.addEventListener("scroll",m,!0),t.onBeforeUnmount(()=>{window.removeEventListener("mousedown",N,!0),window.removeEventListener("keydown",h,!0),window.removeEventListener("wheel",m,!0),window.removeEventListener("scroll",m,!0)});function L(B){B(),r("close")}return(B,b)=>(t.openBlock(),t.createElementBlock("div",{class:"zm-canvas-menu",style:t.normalizeStyle({left:l.value.left+"px",top:l.value.top+"px"}),onContextmenu:b[5]||(b[5]=t.withModifiers(()=>{},["prevent"]))},[t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:b[0]||(b[0]=t.withModifiers(O=>L(()=>r("openData")),["stop"]))},[t.createVNode(q,{name:"data",size:13}),b[6]||(b[6]=t.createElementVNode("span",null,"查看数据",-1))]),t.createElementVNode("div",{ref_key:"importItemRef",ref:s,class:t.normalizeClass(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu",{"is-open":f.value}]),onMouseenter:k,onMouseleave:y},[t.createVNode(q,{name:"import",size:13}),b[10]||(b[10]=t.createElementVNode("span",null,"导入",-1)),b[11]||(b[11]=t.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"},[t.createElementVNode("polyline",{points:"2.5 1.8 5.2 4 2.5 6.2"})],-1)),f.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"zm-canvas-submenu",style:t.normalizeStyle(d.value),onMouseenter:k,onMouseleave:y},[t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:b[1]||(b[1]=t.withModifiers(O=>L(()=>r("openImport","markdown")),["stop"]))},[t.createVNode(q,{name:"markdown",size:13}),b[7]||(b[7]=t.createElementVNode("span",null,"Markdown 导入",-1))]),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:b[2]||(b[2]=t.withModifiers(O=>L(()=>r("openImport","json")),["stop"]))},[t.createVNode(q,{name:"data",size:13}),b[8]||(b[8]=t.createElementVNode("span",null,"JSON 文件导入",-1))]),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:b[3]||(b[3]=t.withModifiers(O=>L(()=>r("openImport","txt")),["stop"]))},[t.createVNode(q,{name:"note",size:13}),b[9]||(b[9]=t.createElementVNode("span",null,"TXT 文件导入",-1))])],36)):t.createCommentVNode("",!0)],34),t.createElementVNode("button",{class:"zm-canvas-menu-item",onClick:b[4]||(b[4]=t.withModifiers(O=>L(()=>r("openSettings")),["stop"]))},[t.createVNode(q,{name:"settings",size:13}),b[12]||(b[12]=t.createElementVNode("span",null,"设置",-1))])],36))}});function oo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function sn(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(a=>{const n=e[a],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&sn(n)}),e}class cn{constructor(a){a.data===void 0&&(a.data={}),this.data=a.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function dn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ie(e,...a){const n=Object.create(null);for(const r in e)n[r]=e[r];return a.forEach(function(r){for(const l in r)n[l]=r[l]}),n}const ro="</span>",un=e=>!!e.scope,ao=(e,{prefix:a})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${a}${n.shift()}`,...n.map((r,l)=>`${r}${"_".repeat(l+1)}`)].join(" ")}return`${a}${e}`};class lo{constructor(a,n){this.buffer="",this.classPrefix=n.classPrefix,a.walk(this)}addText(a){this.buffer+=dn(a)}openNode(a){if(!un(a))return;const n=ao(a.scope,{prefix:this.classPrefix});this.span(n)}closeNode(a){un(a)&&(this.buffer+=ro)}value(){return this.buffer}span(a){this.buffer+=`<span class="${a}">`}}const fn=(e={})=>{const a={children:[]};return Object.assign(a,e),a};class It{constructor(){this.rootNode=fn(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(a){this.top.children.push(a)}openNode(a){const n=fn({scope:a});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(a){return this.constructor._walk(a,this.rootNode)}static _walk(a,n){return typeof n=="string"?a.addText(n):n.children&&(a.openNode(n),n.children.forEach(r=>this._walk(a,r)),a.closeNode(n)),a}static _collapse(a){typeof a!="string"&&a.children&&(a.children.every(n=>typeof n=="string")?a.children=[a.children.join("")]:a.children.forEach(n=>{It._collapse(n)}))}}class so extends It{constructor(a){super(),this.options=a}addText(a){a!==""&&this.add(a)}startScope(a){this.openNode(a)}endScope(){this.closeNode()}__addSublanguage(a,n){const r=a.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new lo(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function je(e){return e?typeof e=="string"?e:e.source:null}function gn(e){return Le("(?=",e,")")}function co(e){return Le("(?:",e,")*")}function uo(e){return Le("(?:",e,")?")}function Le(...e){return e.map(n=>je(n)).join("")}function fo(e){const a=e[e.length-1];return typeof a=="object"&&a.constructor===Object?(e.splice(e.length-1,1),a):{}}function Bt(...e){return"("+(fo(e).capture?"":"?:")+e.map(r=>je(r)).join("|")+")"}function mn(e){return new RegExp(e.toString()+"|").exec("").length-1}function go(e,a){const n=e&&e.exec(a);return n&&n.index===0}const mo=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Lt(e,{joinWith:a}){let n=0;return e.map(r=>{n+=1;const l=n;let f=je(r),s="";for(;f.length>0;){const d=mo.exec(f);if(!d){s+=f;break}s+=f.substring(0,d.index),f=f.substring(d.index+d[0].length),d[0][0]==="\\"&&d[1]?s+="\\"+String(Number(d[1])+l):(s+=d[0],d[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(a)}const po=/\b\B/,pn="[a-zA-Z]\\w*",Dt="[a-zA-Z_]\\w*",hn="\\b\\d+(\\.\\d+)?",bn="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",yn="\\b(0b[01]+)",ho="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",bo=(e={})=>{const a=/^#![ ]*\//;return e.binary&&(e.begin=Le(a,/.*\b/,e.binary,/\b.*/)),Ie({scope:"meta",begin:a,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Je={begin:"\\\\[\\s\\S]",relevance:0},yo={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Je]},Eo={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Je]},xo={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/},ft=function(e,a,n={}){const r=Ie({scope:"comment",begin:e,end:a,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const l=Bt("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Le(/[ ]+/,"(",l,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},ko=ft("//","$"),No=ft("/\\*","\\*/"),wo=ft("#","$"),_o={scope:"number",begin:hn,relevance:0},So={scope:"number",begin:bn,relevance:0},Mo={scope:"number",begin:yn,relevance:0},Co={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Je,{begin:/\[/,end:/\]/,relevance:0,contains:[Je]}]},vo={scope:"title",begin:pn,relevance:0},To={scope:"title",begin:Dt,relevance:0},Ao={begin:"\\.\\s*"+Dt,relevance:0};var gt=Object.freeze({__proto__:null,APOS_STRING_MODE:yo,BACKSLASH_ESCAPE:Je,BINARY_NUMBER_MODE:Mo,BINARY_NUMBER_RE:yn,COMMENT:ft,C_BLOCK_COMMENT_MODE:No,C_LINE_COMMENT_MODE:ko,C_NUMBER_MODE:So,C_NUMBER_RE:bn,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(a,n)=>{n.data._beginMatch=a[1]},"on:end":(a,n)=>{n.data._beginMatch!==a[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:wo,IDENT_RE:pn,MATCH_NOTHING_RE:po,METHOD_GUARD:Ao,NUMBER_MODE:_o,NUMBER_RE:hn,PHRASAL_WORDS_MODE:xo,QUOTE_STRING_MODE:Eo,REGEXP_MODE:Co,RE_STARTERS_RE:ho,SHEBANG:bo,TITLE_MODE:vo,UNDERSCORE_IDENT_RE:Dt,UNDERSCORE_TITLE_MODE:To});function Ro(e,a){e.input[e.index-1]==="."&&a.ignoreMatch()}function Oo(e,a){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Io(e,a){a&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Ro,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Bo(e,a){Array.isArray(e.illegal)&&(e.illegal=Bt(...e.illegal))}function Lo(e,a){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Do(e,a){e.relevance===void 0&&(e.relevance=1)}const zo=(e,a)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Le(n.beforeMatch,gn(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},$o=["of","and","for","in","not","or","if","then","parent","list","value"],Po="keyword";function En(e,a,n=Po){const r=Object.create(null);return typeof e=="string"?l(n,e.split(" ")):Array.isArray(e)?l(n,e):Object.keys(e).forEach(function(f){Object.assign(r,En(e[f],a,f))}),r;function l(f,s){a&&(s=s.map(d=>d.toLowerCase())),s.forEach(function(d){const c=d.split("|");r[c[0]]=[f,Vo(c[0],c[1])]})}}function Vo(e,a){return a?Number(a):Uo(e)?0:1}function Uo(e){return $o.includes(e.toLowerCase())}const xn={},De=e=>{console.error(e)},kn=(e,...a)=>{console.log(`WARN: ${e}`,...a)},Ve=(e,a)=>{xn[`${e}/${a}`]||(console.log(`Deprecated as of ${e}. ${a}`),xn[`${e}/${a}`]=!0)},mt=new Error;function Nn(e,a,{key:n}){let r=0;const l=e[n],f={},s={};for(let d=1;d<=a.length;d++)s[d+r]=l[d],f[d+r]=!0,r+=mn(a[d-1]);e[n]=s,e[n]._emit=f,e[n]._multi=!0}function Ho(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw De("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),mt;if(typeof e.beginScope!="object"||e.beginScope===null)throw De("beginScope must be object"),mt;Nn(e,e.begin,{key:"beginScope"}),e.begin=Lt(e.begin,{joinWith:""})}}function Fo(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw De("skip, excludeEnd, returnEnd not compatible with endScope: {}"),mt;if(typeof e.endScope!="object"||e.endScope===null)throw De("endScope must be object"),mt;Nn(e,e.end,{key:"endScope"}),e.end=Lt(e.end,{joinWith:""})}}function Wo(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Go(e){Wo(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Ho(e),Fo(e)}function Ko(e){function a(s,d){return new RegExp(je(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(d?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(d,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,d]),this.matchAt+=mn(d)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const d=this.regexes.map(c=>c[1]);this.matcherRe=a(Lt(d,{joinWith:"|"}),!0),this.lastIndex=0}exec(d){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(d);if(!c)return null;const g=c.findIndex((y,N)=>N>0&&y!==void 0),k=this.matchIndexes[g];return c.splice(0,g),Object.assign(c,k)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(d){if(this.multiRegexes[d])return this.multiRegexes[d];const c=new n;return this.rules.slice(d).forEach(([g,k])=>c.addRule(g,k)),c.compile(),this.multiRegexes[d]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(d,c){this.rules.push([d,c]),c.type==="begin"&&this.count++}exec(d){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let g=c.exec(d);if(this.resumingScanAtSamePosition()&&!(g&&g.index===this.lastIndex)){const k=this.getMatcher(0);k.lastIndex=this.lastIndex+1,g=k.exec(d)}return g&&(this.regexIndex+=g.position+1,this.regexIndex===this.count&&this.considerAll()),g}}function l(s){const d=new r;return s.contains.forEach(c=>d.addRule(c.begin,{rule:c,type:"begin"})),s.terminatorEnd&&d.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&d.addRule(s.illegal,{type:"illegal"}),d}function f(s,d){const c=s;if(s.isCompiled)return c;[Oo,Lo,Go,zo].forEach(k=>k(s,d)),e.compilerExtensions.forEach(k=>k(s,d)),s.__beforeBegin=null,[Io,Bo,Do].forEach(k=>k(s,d)),s.isCompiled=!0;let g=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),g=s.keywords.$pattern,delete s.keywords.$pattern),g=g||/\w+/,s.keywords&&(s.keywords=En(s.keywords,e.case_insensitive)),c.keywordPatternRe=a(g,!0),d&&(s.begin||(s.begin=/\B|\b/),c.beginRe=a(c.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(c.endRe=a(c.end)),c.terminatorEnd=je(c.end)||"",s.endsWithParent&&d.terminatorEnd&&(c.terminatorEnd+=(s.end?"|":"")+d.terminatorEnd)),s.illegal&&(c.illegalRe=a(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(k){return Yo(k==="self"?s:k)})),s.contains.forEach(function(k){f(k,c)}),s.starts&&f(s.starts,d),c.matcher=l(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Ie(e.classNameAliases||{}),f(e)}function wn(e){return e?e.endsWithParent||wn(e.starts):!1}function Yo(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(a){return Ie(e,{variants:null},a)})),e.cachedVariants?e.cachedVariants:wn(e)?Ie(e,{starts:e.starts?Ie(e.starts):null}):Object.isFrozen(e)?Ie(e):e}var Zo="11.11.1";class Xo extends Error{constructor(a,n){super(a),this.name="HTMLInjectionError",this.html=n}}const zt=dn,_n=Ie,Sn=Symbol("nomatch"),qo=7,Mn=function(e){const a=Object.create(null),n=Object.create(null),r=[];let l=!0;const f="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let d={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:so};function c(x){return d.noHighlightRe.test(x)}function g(x){let C=x.className+" ";C+=x.parentNode?x.parentNode.className:"";const M=d.languageDetectRe.exec(C);if(M){const v=ee(M[1]);return v||(kn(f.replace("{}",M[1])),kn("Falling back to no-highlight mode for this block.",x)),v?M[1]:"no-highlight"}return C.split(/\s+/).find(v=>c(v)||ee(v))}function k(x,C,M){let v="",H="";typeof C=="object"?(v=x,M=C.ignoreIllegals,H=C.language):(Ve("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ve("10.7.0",`Please use highlight(code, options) instead.
|
|
14
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),H=x,v=C),M===void 0&&(M=!0);const ne={code:v,language:H};ie("before:highlight",ne);const ge=ne.result?ne.result:y(ne.language,ne.code,M);return ge.code=ne.code,ie("after:highlight",ge),ge}function y(x,C,M,v){const H=Object.create(null);function ne(S,A){return S.keywords[A]}function ge(){if(!P.keywords){le.addText(Y);return}let S=0;P.keywordPatternRe.lastIndex=0;let A=P.keywordPatternRe.exec(Y),U="";for(;A;){U+=Y.substring(S,A.index);const Z=ke.case_insensitive?A[0].toLowerCase():A[0],se=ne(P,Z);if(se){const[he,Me]=se;if(le.addText(U),U="",H[Z]=(H[Z]||0)+1,H[Z]<=qo&&(Ge+=Me),he.startsWith("_"))U+=A[0];else{const ce=ke.classNameAliases[he]||he;xe(A[0],ce)}}else U+=A[0];S=P.keywordPatternRe.lastIndex,A=P.keywordPatternRe.exec(Y)}U+=Y.substring(S),le.addText(U)}function Ee(){if(Y==="")return;let S=null;if(typeof P.subLanguage=="string"){if(!a[P.subLanguage]){le.addText(Y);return}S=y(P.subLanguage,Y,!0,Nt[P.subLanguage]),Nt[P.subLanguage]=S._top}else S=h(Y,P.subLanguage.length?P.subLanguage:null);P.relevance>0&&(Ge+=S.relevance),le.__addSublanguage(S._emitter,S.language)}function me(){P.subLanguage!=null?Ee():ge(),Y=""}function xe(S,A){S!==""&&(le.startScope(A),le.addText(S),le.endScope())}function yt(S,A){let U=1;const Z=A.length-1;for(;U<=Z;){if(!S._emit[U]){U++;continue}const se=ke.classNameAliases[S[U]]||S[U],he=A[U];se?xe(he,se):(Y=he,ge(),Y=""),U++}}function Et(S,A){return S.scope&&typeof S.scope=="string"&&le.openNode(ke.classNameAliases[S.scope]||S.scope),S.beginScope&&(S.beginScope._wrap?(xe(Y,ke.classNameAliases[S.beginScope._wrap]||S.beginScope._wrap),Y=""):S.beginScope._multi&&(yt(S.beginScope,A),Y="")),P=Object.create(S,{parent:{value:P}}),P}function xt(S,A,U){let Z=go(S.endRe,U);if(Z){if(S["on:end"]){const se=new cn(S);S["on:end"](A,se),se.isMatchIgnored&&(Z=!1)}if(Z){for(;S.endsParent&&S.parent;)S=S.parent;return S}}if(S.endsWithParent)return xt(S.parent,A,U)}function Ut(S){return P.matcher.regexIndex===0?(Y+=S[0],1):(Ye=!0,0)}function Ht(S){const A=S[0],U=S.rule,Z=new cn(U),se=[U.__beforeBegin,U["on:begin"]];for(const he of se)if(he&&(he(S,Z),Z.isMatchIgnored))return Ut(A);return U.skip?Y+=A:(U.excludeBegin&&(Y+=A),me(),!U.returnBegin&&!U.excludeBegin&&(Y=A)),Et(U,S),U.returnBegin?0:A.length}function Ft(S){const A=S[0],U=C.substring(S.index),Z=xt(P,S,U);if(!Z)return Sn;const se=P;P.endScope&&P.endScope._wrap?(me(),xe(A,P.endScope._wrap)):P.endScope&&P.endScope._multi?(me(),yt(P.endScope,S)):se.skip?Y+=A:(se.returnEnd||se.excludeEnd||(Y+=A),me(),se.excludeEnd&&(Y=A));do P.scope&&le.closeNode(),!P.skip&&!P.subLanguage&&(Ge+=P.relevance),P=P.parent;while(P!==Z.parent);return Z.starts&&Et(Z.starts,S),se.returnEnd?0:A.length}function Wt(){const S=[];for(let A=P;A!==ke;A=A.parent)A.scope&&S.unshift(A.scope);S.forEach(A=>le.openNode(A))}let We={};function Qe(S,A){const U=A&&A[0];if(Y+=S,U==null)return me(),0;if(We.type==="begin"&&A.type==="end"&&We.index===A.index&&U===""){if(Y+=C.slice(A.index,A.index+1),!l){const Z=new Error(`0 width match regex (${x})`);throw Z.languageName=x,Z.badRule=We.rule,Z}return 1}if(We=A,A.type==="begin")return Ht(A);if(A.type==="illegal"&&!M){const Z=new Error('Illegal lexeme "'+U+'" for mode "'+(P.scope||"<unnamed>")+'"');throw Z.mode=P,Z}else if(A.type==="end"){const Z=Ft(A);if(Z!==Sn)return Z}if(A.type==="illegal"&&U==="")return Y+=`
|
|
15
|
+
`,1;if(Ke>1e5&&Ke>A.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Y+=U,U.length}const ke=ee(x);if(!ke)throw De(f.replace("{}",x)),new Error('Unknown language: "'+x+'"');const kt=Ko(ke);let et="",P=v||kt;const Nt={},le=new d.__emitter(d);Wt();let Y="",Ge=0,Ae=0,Ke=0,Ye=!1;try{if(ke.__emitTokens)ke.__emitTokens(C,le);else{for(P.matcher.considerAll();;){Ke++,Ye?Ye=!1:P.matcher.considerAll(),P.matcher.lastIndex=Ae;const S=P.matcher.exec(C);if(!S)break;const A=C.substring(Ae,S.index),U=Qe(A,S);Ae=S.index+U}Qe(C.substring(Ae))}return le.finalize(),et=le.toHTML(),{language:x,value:et,relevance:Ge,illegal:!1,_emitter:le,_top:P}}catch(S){if(S.message&&S.message.includes("Illegal"))return{language:x,value:zt(C),illegal:!0,relevance:0,_illegalBy:{message:S.message,index:Ae,context:C.slice(Ae-100,Ae+100),mode:S.mode,resultSoFar:et},_emitter:le};if(l)return{language:x,value:zt(C),illegal:!1,relevance:0,errorRaised:S,_emitter:le,_top:P};throw S}}function N(x){const C={value:zt(x),illegal:!1,relevance:0,_top:s,_emitter:new d.__emitter(d)};return C._emitter.addText(x),C}function h(x,C){C=C||d.languages||Object.keys(a);const M=N(x),v=C.filter(ee).filter(G).map(me=>y(me,x,!1));v.unshift(M);const H=v.sort((me,xe)=>{if(me.relevance!==xe.relevance)return xe.relevance-me.relevance;if(me.language&&xe.language){if(ee(me.language).supersetOf===xe.language)return 1;if(ee(xe.language).supersetOf===me.language)return-1}return 0}),[ne,ge]=H,Ee=ne;return Ee.secondBest=ge,Ee}function m(x,C,M){const v=C&&n[C]||M;x.classList.add("hljs"),x.classList.add(`language-${v}`)}function L(x){let C=null;const M=g(x);if(c(M))return;if(ie("before:highlightElement",{el:x,language:M}),x.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",x);return}if(x.children.length>0&&(d.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(x)),d.throwUnescapedHTML))throw new Xo("One of your code blocks includes unescaped HTML.",x.innerHTML);C=x;const v=C.textContent,H=M?k(v,{language:M,ignoreIllegals:!0}):h(v);x.innerHTML=H.value,x.dataset.highlighted="yes",m(x,M,H.language),x.result={language:H.language,re:H.relevance,relevance:H.relevance},H.secondBest&&(x.secondBest={language:H.secondBest.language,relevance:H.secondBest.relevance}),ie("after:highlightElement",{el:x,result:H,text:v})}function B(x){d=_n(d,x)}const b=()=>{z(),Ve("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function O(){z(),Ve("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let R=!1;function z(){function x(){z()}if(document.readyState==="loading"){R||window.addEventListener("DOMContentLoaded",x,!1),R=!0;return}document.querySelectorAll(d.cssSelector).forEach(L)}function $(x,C){let M=null;try{M=C(e)}catch(v){if(De("Language definition for '{}' could not be registered.".replace("{}",x)),l)De(v);else throw v;M=s}M.name||(M.name=x),a[x]=M,M.rawDefinition=C.bind(null,e),M.aliases&&ae(M.aliases,{languageName:x})}function I(x){delete a[x];for(const C of Object.keys(n))n[C]===x&&delete n[C]}function J(){return Object.keys(a)}function ee(x){return x=(x||"").toLowerCase(),a[x]||a[n[x]]}function ae(x,{languageName:C}){typeof x=="string"&&(x=[x]),x.forEach(M=>{n[M.toLowerCase()]=C})}function G(x){const C=ee(x);return C&&!C.disableAutodetect}function Q(x){x["before:highlightBlock"]&&!x["before:highlightElement"]&&(x["before:highlightElement"]=C=>{x["before:highlightBlock"](Object.assign({block:C.el},C))}),x["after:highlightBlock"]&&!x["after:highlightElement"]&&(x["after:highlightElement"]=C=>{x["after:highlightBlock"](Object.assign({block:C.el},C))})}function re(x){Q(x),r.push(x)}function ue(x){const C=r.indexOf(x);C!==-1&&r.splice(C,1)}function ie(x,C){const M=x;r.forEach(function(v){v[M]&&v[M](C)})}function fe(x){return Ve("10.7.0","highlightBlock will be removed entirely in v12.0"),Ve("10.7.0","Please use highlightElement now."),L(x)}Object.assign(e,{highlight:k,highlightAuto:h,highlightAll:z,highlightElement:L,highlightBlock:fe,configure:B,initHighlighting:b,initHighlightingOnLoad:O,registerLanguage:$,unregisterLanguage:I,listLanguages:J,getLanguage:ee,registerAliases:ae,autoDetection:G,inherit:_n,addPlugin:re,removePlugin:ue}),e.debugMode=function(){l=!1},e.safeMode=function(){l=!0},e.versionString=Zo,e.regex={concat:Le,lookahead:gn,either:Bt,optional:uo,anyNumberOfTimes:co};for(const x in gt)typeof gt[x]=="object"&&sn(gt[x]);return Object.assign(e,gt),e},Ue=Mn({});Ue.newInstance=()=>Mn({});var jo=Ue;Ue.HighlightJS=Ue,Ue.default=Ue;const $t=oo(jo);function Pt(e){const a=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:a.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},f=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},d={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,l]};l.contains.push(d);const c={match:/\\"/},g={className:"string",begin:/'/,end:/'/},k={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},N=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${N.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},L=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],B=["true","false"],b={match:/(\/[a-z._-]+)+/},O=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],R=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],z=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],$=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:L,literal:B,built_in:[...O,...R,"set","shopt",...z,...$]},contains:[h,e.SHEBANG(),m,y,f,s,b,d,c,g,k,n]}}const Jo=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.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:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.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_-]*/}}),Qo=["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"],er=["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"],tr=[...Qo,...er],nr=["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(),ir=["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(),or=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),rr=["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 ar(e){const a=e.regex,n=Jo(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},l="and or not only",f=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",d=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+ir.join("|")+")"},{begin:":(:)?("+or.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+rr.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...d,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...d,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:a.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:f},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:l,attribute:nr.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...d,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+tr.join("|")+")\\b"}]}}function Cn(e){const f={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:f,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.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:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:f,illegal:/["']/}]}]}}var He="[0-9](_*[0-9])*",pt=`\\.(${He})`,ht="[0-9a-fA-F](_*[0-9a-fA-F])*",vn={className:"number",variants:[{begin:`(\\b(${He})((${pt})|\\.)?|(${pt}))[eE][+-]?(${He})[fFdD]?\\b`},{begin:`\\b(${He})((${pt})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${pt})[fFdD]?\\b`},{begin:`\\b(${He})[fFdD]\\b`},{begin:`\\b0[xX]((${ht})\\.?|(${ht})?\\.(${ht}))[pP][+-]?(${He})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ht})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Tn(e,a,n){return n===-1?"":e.replace(a,r=>Tn(e,a,n-1))}function lr(e){const a=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Tn("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},g={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},k={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.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:[a.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[k,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,vn,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},vn,g]}}const An="[A-Za-z$_][0-9A-Za-z$_]*",sr=["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"],cr=["true","false","null","undefined","NaN","Infinity"],Rn=["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"],On=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],In=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],dr=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ur=[].concat(In,Rn,On);function Bn(e){const a=e.regex,n=(M,{after:v})=>{const H="</"+M[0].slice(1);return M.input.indexOf(H,v)!==-1},r=An,l={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,v)=>{const H=M[0].length+M.index,ne=M.input[H];if(ne==="<"||ne===","){v.ignoreMatch();return}ne===">"&&(n(M,{after:H})||v.ignoreMatch());let ge;const Ee=M.input.substring(H);if(ge=Ee.match(/^\s*=/)){v.ignoreMatch();return}if((ge=Ee.match(/^\s+extends\s+/))&&ge.index===0){v.ignoreMatch();return}}},d={$pattern:An,keyword:sr,literal:cr,built_in:ur,"variable.language":dr},c="[0-9](_?[0-9])*",g=`\\.(${c})`,k="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${k})((${g})|\\.)?|(${g}))[eE][+-]?(${c})\\b`},{begin:`\\b(${k})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,N]},O={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,L,B,{match:/\$\d+/},y];N.contains=R.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(R)});const z=[].concat(O,N.contains),$=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(z)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:$},J={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:a.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:{_:[...Rn,...On]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},Q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(M){return a.concat("(?!",M.join("|"),")")}const ue={match:a.concat(/\b/,re([...In,"super","import"].map(M=>`${M}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},x="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(x)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,L,B,O,{match:/\$\d+/},y,ee,{scope:"attr",match:r+a.lookahead(":"),relevance:0},C,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,e.REGEXP_MODE,{className:"function",begin:x,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:f},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},ue,Q,J,fe,{match:/\$[(.]/}]}}function fr(e){const a={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],l={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[a,n,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Ln(e){const a=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},l={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}]},f={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},d=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:a.concat(/\[.+?\]\(/,d,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},g={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},k={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},y=e.inherit(g,{contains:[]}),N=e.inherit(k,{contains:[]});g.contains.push(N),k.contains.push(y);let h=[n,c];return[g,k,y,N].forEach(b=>{b.contains=b.contains.concat(h)}),h=h.concat(g,k),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},n,f,g,k,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},l,r,c,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Dn(e){const a=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],d={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},g={className:"subst",begin:/\{/,end:/\}/,keywords:d,illegal:/#/},k={begin:/\{\{/,relevance:0},y={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,k,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,k,g]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,k,g]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,k,g]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},N="[0-9](_?[0-9])*",h=`(\\b(${N}))?\\.(${N})|\\b(${N})\\.`,m=`\\b|${r.join("|")}`,L={className:"number",relevance:0,variants:[{begin:`(\\b(${N})|(${h}))[eE][+-]?(${N})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${N})[jJ](?=${m})`}]},B={className:"comment",begin:a.lookahead(/# type:/),end:/$/,keywords:d,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},b={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:["self",c,L,y,e.HASH_COMMENT_MODE]}]};return g.contains=[y,L,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:d,illegal:/(<\/|\?)|=>/,contains:[c,L,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,B,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[L,b,y]}]}}function zn(e){const a=e.regex,n=/(r#)?/,r=a.concat(n,e.UNDERSCORE_IDENT_RE),l=a.concat(n,e.IDENT_RE),f={className:"title.function.invoke",relevance:0,begin:a.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,a.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",d=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],g=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],k=["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:e.IDENT_RE+"!?",type:k,keyword:d,literal:c,built_in:g},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:g,type:k}},{className:"punctuation",begin:"->"},f]}}function gr(e){const a=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},f=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],d=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],g=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],k=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],y=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],N=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=k,m=[...g,...c].filter($=>!k.includes($)),L={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},B={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},b={match:a.concat(/\b/,a.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function O($){return a.concat(/\b/,a.either(...$.map(I=>I.replace(/\s+/,"\\s+"))),/\b/)}const R={scope:"keyword",match:O(N),relevance:0};function z($,{exceptions:I,when:J}={}){const ee=J;return I=I||[],$.map(ae=>ae.match(/\|\d+$/)||I.includes(ae)?ae:ee(ae)?`${ae}|0`:ae)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:z(m,{when:$=>$.length<3}),literal:f,type:d,built_in:y},contains:[{scope:"type",match:O(s)},R,b,L,r,l,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,B]}}const bt="[A-Za-z$_][0-9A-Za-z$_]*",$n=["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"],Pn=["true","false","null","undefined","NaN","Infinity"],Vn=["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"],Un=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Fn=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Wn=[].concat(Hn,Vn,Un);function mr(e){const a=e.regex,n=(M,{after:v})=>{const H="</"+M[0].slice(1);return M.input.indexOf(H,v)!==-1},r=bt,l={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,v)=>{const H=M[0].length+M.index,ne=M.input[H];if(ne==="<"||ne===","){v.ignoreMatch();return}ne===">"&&(n(M,{after:H})||v.ignoreMatch());let ge;const Ee=M.input.substring(H);if(ge=Ee.match(/^\s*=/)){v.ignoreMatch();return}if((ge=Ee.match(/^\s+extends\s+/))&&ge.index===0){v.ignoreMatch();return}}},d={$pattern:bt,keyword:$n,literal:Pn,built_in:Wn,"variable.language":Fn},c="[0-9](_?[0-9])*",g=`\\.(${c})`,k="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${k})((${g})|\\.)?|(${g}))[eE][+-]?(${c})\\b`},{begin:`\\b(${k})\\b((${g})\\b|\\.)?|(${g})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"css"}},L={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,N]},O={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},R=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,L,B,{match:/\$\d+/},y];N.contains=R.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(R)});const z=[].concat(O,N.contains),$=z.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(z)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:$},J={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,a.concat(r,"(",a.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:a.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:{_:[...Vn,...Un]}},ae={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},G={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},Q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function re(M){return a.concat("(?!",M.join("|"),")")}const ue={match:a.concat(/\b/,re([...Hn,"super","import"].map(M=>`${M}\\s*\\(`)),r,a.lookahead(/\s*\(/)),className:"title.function",relevance:0},ie={begin:a.concat(/\./,a.lookahead(a.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},fe={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},x="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",C={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,a.lookahead(x)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:$,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),ae,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,L,B,O,{match:/\$\d+/},y,ee,{scope:"attr",match:r+a.lookahead(":"),relevance:0},C,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,e.REGEXP_MODE,{className:"function",begin:x,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:$}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:f},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},G,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},ue,Q,J,fe,{match:/\$[(.]/}]}}function Gn(e){const a=e.regex,n=mr(e),r=bt,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[n.exports.CLASS_REFERENCE]},d={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],g={$pattern:bt,keyword:$n.concat(c),literal:Pn,built_in:Wn.concat(l),"variable.language":Fn},k={className:"meta",begin:"@"+r},y=(L,B,b)=>{const O=L.contains.findIndex(R=>R.label===B);if(O===-1)throw new Error("can not find mode to replace");L.contains.splice(O,1,b)};Object.assign(n.keywords,g),n.exports.PARAMS_CONTAINS.push(k);const N=n.contains.find(L=>L.scope==="attr"),h=Object.assign({},N,{match:a.concat(r,a.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,N,h]),n.contains=n.contains.concat([k,f,s,h]),y(n,"shebang",e.SHEBANG()),y(n,"use_strict",d);const m=n.contains.find(L=>L.label==="func.def");return m.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Kn(e){const a=e.regex,n=a.concat(/[\p{L}_]/u,a.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},f={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(f,{begin:/\(/,end:/\)/}),d=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),g={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{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:[f,c,d,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[f,s,c,d]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[g],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[g],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:a.concat(/</,a.lookahead(a.concat(n,a.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:g}]},{className:"tag",begin:a.concat(/<\//,a.lookahead(a.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Yn(e){const a="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},f={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,l]},d=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),N={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:a,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},L={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},B=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:a,keywords:{literal:a}},N,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,L,f,s],b=[...B];return b.pop(),b.push(d),h.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:B}}const Vt={bash:Pt,sh:Pt,shell:Pt,css:ar,go:Cn,golang:Cn,java:lr,javascript:Bn,js:Bn,json:fr,markdown:Ln,md:Ln,python:Dn,py:Dn,rust:zn,rs:zn,sql:gr,typescript:Gn,ts:Gn,xml:Kn,html:Kn,yaml:Yn,yml:Yn};for(const[e,a]of Object.entries(Vt))$t.registerLanguage(e,a);function Zn(e){const a=e.split(`
|
|
16
16
|
`);return/^(`{3,}|~{3,})/.test(a[0]??"")&&a.shift(),/^(`{3,}|~{3,})\s*$/.test(a[a.length-1]??"")&&a.pop(),a.join(`
|
|
17
17
|
`).replace(/\n+$/,"")}function Xn(e){const a=/^(`{3,}|~{3,})([^\s`~]*)/.exec(e.split(`
|
|
18
18
|
`)[0]??""),n=((a==null?void 0:a[2])??"").toLowerCase();return n&&Vt[n]?n:""}function pr(e,a){const n=a&&Vt[a]?a:"";try{return n?$t.highlight(e,{language:n,ignoreIllegals:!0}).value:$t.highlightAuto(e).value}catch{return br(e)}}function hr(e){return e.split(`
|
|
19
|
-
`).filter(a=>a.trim().length>0).filter(a=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(a)).map(a=>a.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function br(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function yr(e,a,n){if(e.length<=1)return e.slice();const[r,...l]=e,f=l.map(
|
|
20
|
-
`:"```\n",
|
|
19
|
+
`).filter(a=>a.trim().length>0).filter(a=>!/^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/.test(a)).map(a=>a.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(n=>n.trim()))}function br(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function yr(e,a,n){if(e.length<=1)return e.slice();const[r,...l]=e,f=l.map(g=>g[a]??""),s=f.length>0&&f.every(g=>g.trim()!==""&&!Number.isNaN(Number(g))),d=n==="asc"?1:-1,c=l.slice().sort((g,k)=>{const y=g[a]??"",N=k[a]??"";return s?(Number(y)-Number(N))*d:y.localeCompare(N,"zh-Hans-CN",{numeric:!0})*d});return[r,...c]}const Er=["viewBox","width","height"],xr={class:"zm-edges"},kr=["d","fill"],Nr=["data-node-id","onClick","onDblclick","onContextmenu","onMouseenter","onMouseleave"],wr=["src","width","height","alt"],_r=["onDblclick"],Sr={key:0,class:"zm-rich-code"},Mr=["innerHTML"],Cr={key:1,class:"zm-rich-table"},vr=["onClick"],Tr={class:"zm-rich-sort-mark","aria-hidden":"true"},Ar={key:2,class:"zm-text"},Rr={class:"zm-text-label"},Or=["href","title"],Ir=["title","onClick"],Br=["title"],Lr=["title","onClick"],Dr=["onClick"],zr=["onMousedown"],$r=["onClick"],Pr={class:"zm-tb-tip zm-tb-zoom"},Vr=["src"],Ur=["src"],ze=24,Fe=400,Be=160,qn=t.defineComponent({__name:"MindMap",props:{data:{},theme:{},previewMode:{type:Boolean,default:!1},markdown:{},lineColors:{}},emits:["change","select","edit-note","markdownChange","canvas-settings","canvas-data","canvas-import"],setup(e,{expose:a,emit:n}){const r=e,l=n,f=t.ref(null),s=t.ref(null),d=t.ref(""),c=t.ref(null),g=t.ref(new Set),k=t.ref(!1),y=t.ref(null),N=t.ref(""),h=t.ref(new Map),m=t.ref(Te(r.data)),L=t.ref({}),B=t.ref({}),b=t.ref(r.markdown!==void 0);let O=!1;t.watch(()=>r.markdown,i=>{if(i===void 0){b.value=!1;return}b.value=!0;const o=Ot(i||"");O=!0,m.value=Te(o),c.value=null,g.value=new Set,te(),t.nextTick(()=>{O=!1,Re()})}),t.watch(m,()=>{b.value&&!O&&l("markdownChange",ut(m.value))},{deep:!0});const R=t.computed(()=>D.showOrderBadge===!0),z=t.ref(new Map),$=z.value;function I(i,o){const u={};o.bg&&(u.bg=o.bg),o.textColor&&(u.textColor=o.textColor),o.borderColor&&(u.borderColor=o.borderColor),o.fontWeight&&(u.fontWeight=o.fontWeight),Object.keys(u).length===0?$.delete(i):$.set(i,u),z.value=new Map($)}function J(i){return $.get(i)??{}}function ee(i,o){const u=W(m.value,i);u&&(u.image={src:o.src,naturalW:o.naturalW,naturalH:o.naturalH,width:Q(o.width,ze,Fe),height:Q(o.height,ze,Fe)},ce(),te(),l("change",m.value))}function ae(i){const o=W(m.value,i);!o||!o.image||(delete o.image,ce(),te(),l("change",m.value))}function G(i,o){const u=o.trim();if(!W(m.value,i))return;if(!u){ae(i);return}const E=new Image;E.onload=()=>{const _=W(m.value,i);if(!_)return;const T=E.naturalWidth&&E.naturalHeight?E.naturalWidth/E.naturalHeight:1,V=Q(E.naturalWidth||Be,ze,Fe),j=Math.round(V/T);_.image={src:u,naturalW:E.naturalWidth||V,naturalH:E.naturalHeight||j,width:V,height:j},ce(),te(),l("change",m.value)},E.onerror=()=>{},E.src=u}function Q(i,o,u){return Math.min(u,Math.max(o,i))}function re(i,o){const u=new FileReader;u.onload=()=>{if(typeof u.result!="string")return;const w=u.result,E=new window.Image;E.onload=()=>{const _=E.naturalWidth||Be,T=E.naturalHeight||Be,V=Q(_,ze,Be),j=Q(Math.round(T*V/_),ze,Fe);o({src:w,naturalW:_,naturalH:T,width:V,height:j})},E.onerror=()=>{o({src:w,naturalW:Be,naturalH:Be,width:Be,height:Be})},E.src=w},u.readAsDataURL(i)}function ue(i){const o=document.createElement("input");o.type="file",o.accept="image/*",o.style.display="none",o.onchange=()=>{var w;const u=(w=o.files)==null?void 0:w[0];u&&(re(u,E=>ee(i,E)),document.body.removeChild(o))},document.body.appendChild(o),o.click()}function ie(i,o){const u=o.trim(),w=W(m.value,i);w&&(u?w.link={url:u}:delete w.link,ce(),te(),l("change",m.value))}function fe(i){ie(i,"")}function x(i,o){const u=W(m.value,i);u&&(o?u.note={text:o}:delete u.note,ce(),te(),l("change",m.value))}function C(i){x(i,"")}function M(i,o){const u=W(m.value,i);u&&(o?u.richContent=o:delete u.richContent,ce(),te(),l("change",m.value))}const v=t.ref(null),H=t.ref(null);function ne(i,o){r.previewMode||(i.preventDefault(),i.stopPropagation(),c.value=o.id,l("select",W(m.value,o.id)),v.value={nodeId:o.id,x:i.clientX,y:i.clientY})}function ge(){v.value=null}function Ee(i){r.previewMode||(i.preventDefault(),v.value=null,H.value={x:i.clientX,y:i.clientY})}function me(){H.value=null}function xe(){H.value=null,l("canvas-settings")}function yt(){H.value=null,l("canvas-data")}function Et(i){H.value=null,l("canvas-import",i)}function xt(){var o;const i=(o=v.value)==null?void 0:o.nodeId;i&&ue(i)}function Ut(){var w,E,_;const i=(w=v.value)==null?void 0:w.nodeId;if(!i)return;const o=((_=(E=W(m.value,i))==null?void 0:E.link)==null?void 0:_.url)??"",u=window.prompt("输入链接 URL(留空取消)",o);u!==null&&ie(i,u)}function Ht(){var o;const i=(o=v.value)==null?void 0:o.nodeId;i&&fe(i)}function Ft(){var o;const i=(o=v.value)==null?void 0:o.nodeId;i&&P(i)}function Wt(){var o;const i=(o=v.value)==null?void 0:o.nodeId;i&&C(i)}function We(){var o;const i=(o=v.value)==null?void 0:o.nodeId;i&&ae(i)}function Qe(){var K,Ne;const i=(K=v.value)==null?void 0:K.nodeId;if(!i)return;const o=(Ne=W(m.value,i))==null?void 0:Ne.richContent,u=(o==null?void 0:o.kind)==="code"?Zn(o.raw):"",w=(o==null?void 0:o.kind)==="code"&&o.lang||"",E=w?"```"+w+`
|
|
20
|
+
`:"```\n",T=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",u?E+u+(u.endsWith("```")?"":"\n```"):E+"// 你的代码"+"\n```");if(T===null)return;const V=T.trim();if(!V){M(i,null);return}const j=/^```([^\s`]*)/.exec(V),p=j?j[1]:void 0;M(i,{kind:"code",raw:V,lang:p})}function ke(){var o;const i=(o=v.value)==null?void 0:o.nodeId;i&&M(i,null)}function kt(){var T,V;const i=(T=v.value)==null?void 0:T.nodeId;if(!i)return;const o=(V=W(m.value,i))==null?void 0:V.richContent,u=(o==null?void 0:o.kind)==="table"?o.raw:"",E=window.prompt("输入 markdown 表格(每行以 | 分隔;留空取消)",u||`| 列1 | 列2 | 列3 |
|
|
21
21
|
| --- | --- | --- |
|
|
22
|
-
| a | b | c |`);if(y===null)return;const S=y.trim();if(!S){C(i,null);return}C(i,{kind:"table",raw:S})}function et(){var o;const i=(o=T.value)==null?void 0:o.nodeId;i&&C(i,null)}function D(i){r.previewMode||l("edit-note",i)}function Nt(i,o=60){const u=i.replace(/\s+/g," ").trim();return u.length<=o?u||"点击编辑笔记":u.slice(0,o)+"…"}function le(i){var y;if(r.previewMode||s.value)return;const o=i.target;if(o&&(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable))return;const u=d.value;if(!u)return;const N=(y=i.clipboardData)==null?void 0:y.items;if(N)for(let S=0;S<N.length;S++){const A=N[S];if(A.kind==="file"&&A.type.startsWith("image/")){const $=A.getAsFile();if(!$)continue;i.preventDefault();const j=W(g.value,u);if(j!=null&&j.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;re($,p=>ee(u,p));return}}}t.onMounted(()=>{window.addEventListener("paste",le),te()}),t.onBeforeUnmount(()=>{window.removeEventListener("paste",le)});const Y=t.ref(null),Ge=t.computed(()=>{var i;return((i=Y.value)==null?void 0:i.nodeId)??null});function Ae(i,o){if(!o.image)return;i.preventDefault(),i.stopPropagation();const u=o.image.naturalW||o.image.width,N=o.image.naturalH||o.image.height,y=N>0?N/u:1;Y.value={nodeId:o.id,startX:i.clientX,startY:i.clientY,startW:o.image.width,startH:o.image.height,naturalW:u,naturalH:N,ratio:y,pendingW:o.image.width,pendingH:o.image.height},window.addEventListener("mousemove",Ke),window.addEventListener("mouseup",Ye)}function Ke(i){var j,p;const o=Y.value;if(!o)return;const u=H.scale.value||1,N=i.clientX-o.startX,y=Q(o.startW+N/u,ze,Fe),S=Q(y*o.ratio,ze,Fe);o.pendingW=y,o.pendingH=S;const A=(j=f.value)==null?void 0:j.querySelector(`[data-node-id="${o.nodeId}"] .zm-node-img`);A&&(A.style.width=`${y}px`,A.style.height=`${S}px`);const $=(p=f.value)==null?void 0:p.querySelector(`[data-node-id="${o.nodeId}"]`);$&&($.style.minWidth=`${Math.max(80,Math.ceil(y+28))}px`,$.style.height=`${Math.ceil(S+8+30)}px`)}function Ye(){const i=Y.value;if(window.removeEventListener("mousemove",Ke),window.removeEventListener("mouseup",Ye),Y.value=null,!i)return;const o=W(g.value,i.nodeId);!o||!o.image||(ee(i.nodeId,{src:o.image.src,naturalW:o.image.naturalW,naturalH:o.image.naturalH,width:i.pendingW,height:i.pendingH}),d.value=i.nodeId,l("select",o),R=!0)}const M=t.ref(null);let R=!1;function V(i){M.value=i}function Z(i){M.value===i&&(M.value=null)}const se=t.ref(0),he=t.ref(!1),Me=to(100);function ce(){Me.record({data:g.value})}function te(){m.value=new Set(m.value),se.value++,t.nextTick().then(()=>t.nextTick()).then(()=>Fr()).then(()=>{se.value++})}function Fr(){const i=document.querySelectorAll(".zm-rich"),o={},u={};i.forEach(N=>{let y=N,S=null;for(;y&&!S;)S=y.getAttribute("data-node-id"),y=y.parentElement;if(!S)return;const A=N.offsetHeight,$=N.scrollWidth,j=Math.round(A*2)/2,p=Math.round($*2)/2;o[S]=j,u[S]=p,w.value[S],L.value[S]}),w.value=o,L.value=u}const _e=t.computed(()=>{var i,o,u,N,y,S,A,$,j,p;return{rootBg:((i=r.theme)==null?void 0:i.rootBg)??"#1f2937",rootText:((o=r.theme)==null?void 0:o.rootText)??"#ffffff",branchBg:((u=r.theme)==null?void 0:u.branchBg)??"#ffffff",branchText:((N=r.theme)==null?void 0:N.branchText)??"#1f2937",lineColor:((y=r.theme)==null?void 0:y.lineColor)??"#94a3b8",bgColor:((S=r.theme)==null?void 0:S.bgColor)??"#f8fafc",fontSize:((A=r.theme)==null?void 0:A.fontSize)??14,lineWidthStart:(($=r.theme)==null?void 0:$.lineWidthStart)??2.2,lineWidthEnd:((j=r.theme)==null?void 0:j.lineWidthEnd)??.8,rainbowBranch:((p=r.theme)==null?void 0:p.rainbowBranch)??!1}}),O=t.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function jn(i){return O.taperedEdge?Wr(i):Qn(i)}function Jn(i){return O.taperedEdge?O.lineWidthEnd:Qn(i)}function Wr(i){return i<=0?O.lineWidthStart:i===1?Math.max(1.5,O.lineWidthStart*.67):i===2?Math.max(.8,O.lineWidthStart*.42):O.lineWidthEnd}function Qn(i){if(i<=0)return O.lineWidthStart;if(i>=3)return O.lineWidthEnd;const o=i/3;return O.lineWidthStart+(O.lineWidthEnd-O.lineWidthStart)*o}function Gr(i,o,u,N){const y=1-i,S=y*y*y*o.x+3*y*y*i*u.x1+3*y*i*i*u.x2+i*i*i*N.x,A=y*y*y*o.y+3*y*y*i*u.y1+3*y*i*i*u.y2+i*i*i*N.y;return{x:S,y:A}}function Kr(i,o,u,N,y=32,S="curve",A="right"){if(S==="curve"){let ve;if(A==="right"||A==="left"){const oe=Math.abs(o.x-i.x)*.45,Oe=A==="right"?1:-1;ve={x1:i.x+Oe*oe,y1:i.y,x2:o.x-Oe*oe,y2:o.y}}else{const oe=Math.abs(o.y-i.y)*.45;ve={x1:i.x,y1:i.y+oe,x2:o.x,y2:o.y-oe}}const hi=X=>{const oe=1-X,Oe=-3*oe*oe*i.x+3*(oe*oe-2*oe*X)*ve.x1+3*(2*oe*X-X*X)*ve.x2+3*X*X*o.x,Xe=-3*oe*oe*i.y+3*(oe*oe-2*oe*X)*ve.y1+3*(2*oe*X-X*X)*ve.y2+3*X*X*o.y;return{dx:Oe,dy:Xe}},at=[],qt=[];for(let X=0;X<=y;X++){const oe=X/y,Oe=X===0?i:X===y?o:Gr(oe,i,ve,o),Xe=hi(oe);let Ct=Math.hypot(Xe.dx,Xe.dy);Ct<1e-6&&(Ct=1);const bi=-Xe.dy/Ct,yi=Xe.dx/Ct,vt=(u+(N-u)*oe)/2;at.push({x:Oe.x+bi*vt,y:Oe.y+yi*vt}),qt.push({x:Oe.x-bi*vt,y:Oe.y-yi*vt})}let Mt=`M ${at[0].x.toFixed(2)} ${at[0].y.toFixed(2)}`;for(let X=1;X<=y;X++)Mt+=` L ${at[X].x.toFixed(2)} ${at[X].y.toFixed(2)}`;for(let X=y;X>=0;X--)Mt+=` L ${qt[X].x.toFixed(2)} ${qt[X].y.toFixed(2)}`;return Mt+=" Z",Mt}const $=o.x-i.x,j=o.y-i.y;let p=Math.hypot($,j);p<1e-6&&(p=1);const K=-j/p,Ne=$/p,Ce=u/2,pe=N/2,nt={x:i.x+K*Ce,y:i.y+Ne*Ce},it={x:i.x-K*Ce,y:i.y-Ne*Ce},ot={x:o.x-K*pe,y:o.y-Ne*pe},rt={x:o.x+K*pe,y:o.y+Ne*pe};return`M ${nt.x.toFixed(2)} ${nt.y.toFixed(2)} L ${rt.x.toFixed(2)} ${rt.y.toFixed(2)} L ${ot.x.toFixed(2)} ${ot.y.toFixed(2)} L ${it.x.toFixed(2)} ${it.y.toFixed(2)} Z`}const wt=t.computed(()=>be.value.root.children),Yr=qe[0].colors,ei=t.computed(()=>Wi(O.branchPaletteId,O.customPalettes)),$e=t.computed(()=>{const i=new Map;if(!O.rainbowBranch)return i;const o=r.lineColors,u=o&&o.length>0?o:ei.value.colors.length>0?ei.value.colors:Yr;for(let y=0;y<wt.value.length;y++){const S=wt.value[y];i.set(S.id,u[y%u.length])}const N=(y,S)=>{i.set(y.id,S);for(const A of y.children)N(A,S)};for(let y=0;y<wt.value.length;y++){const S=wt.value[y];N(S,u[y%u.length])}return i});function Zr(i,o){return O.rainbowBranch?$e.value.get(o.id)??_e.value.lineColor:_e.value.lineColor}function Xr(i){const o=J(i.id);if(o.bg)return o.bg;if(i.isRoot)return _e.value.rootBg;if(O.rainbowBranch){const u=$e.value.get(i.id);if(u)return Qr(u,.18)}return _e.value.branchBg}function qr(i){const o=J(i.id);if(o.textColor)return o.textColor;if(i.isRoot)return _e.value.rootText;if(O.rainbowBranch){const u=$e.value.get(i.id);if(u)return ti(u,.55)}return _e.value.branchText}function jr(i){const o=J(i.id);if(o.borderColor)return o.borderColor;if(i.isRoot)return _e.value.rootBg;if(O.rainbowBranch){const u=$e.value.get(i.id);if(u)return ti(u,.3)}return _e.value.lineColor}function Jr(i){return J(i.id).fontWeight??(i.isRoot?600:400)}function Qr(i,o){const u=i.replace("#",""),N=u.length===6?u:u.split("").map($=>$+$).join(""),y=parseInt(N.slice(0,2),16),S=parseInt(N.slice(2,4),16),A=parseInt(N.slice(4,6),16);return`rgba(${y}, ${S}, ${A}, ${o})`}function ti(i,o){const u=i.replace("#",""),N=u.length===6?u:u.split("").map($=>$+$).join(""),y=Math.round(parseInt(N.slice(0,2),16)*(1-o)),S=Math.round(parseInt(N.slice(2,4),16)*(1-o)),A=Math.round(parseInt(N.slice(4,6),16)*(1-o));return`rgb(${y}, ${S}, ${A})`}const H=Ji({getContainer:()=>f.value});H.setOnMarqueeEnd(ya),eo({isEditing:()=>s.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>d.value,getRootId:()=>g.value.id,defaultTargetId:()=>g.value.id,onAddChild:Ze,onAddSibling:St,onAddSiblingBefore:ri,onRemove:li,onStartEdit:tt,onClearSelection:()=>{d.value=null,l("select",null)},onDuplicate:ai,onUndo:Kt,onRedo:Yt,onNavigate:da,onSelectRoot:()=>{d.value=g.value.id;const i=W(g.value,g.value.id);i&&l("select",i)}});const be=t.computed(()=>{const i=Te(g.value);return ii(i),Vi(i,{mode:O.layoutMode,baseFontSize:_e.value.fontSize,richHeights:w.value,richWidths:L.value})}),ni=t.ref([]),Gt=t.computed(()=>(se.value,ni.value));t.watch(be,i=>{const o=[],u=N=>{o.push(N);for(const y of N.children)u(y)};u(i.root),ni.value=o},{immediate:!0});const ea=t.computed(()=>{const i=[];for(const o of Gt.value)for(const u of o.children)i.push({from:o,to:u,key:`${o.id}->${u.id}`});return i}),ta=t.computed(()=>`${be.value.vbX} ${be.value.vbY} ${be.value.vbW} ${be.value.vbH}`);function ii(i){if(m.value.has(i.id)){i.children=[],i.collapsed=!0;return}i.collapsed=!1;for(const o of i.children)ii(o)}function tt(i){const o=W(g.value,i);o&&(s.value=i,c.value=o.text,t.nextTick(()=>{const u=document.querySelector(".zm-input");u==null||u.focus(),u==null||u.select()}))}function _t(i={}){if(!s.value)return;const o=W(g.value,s.value);o&&o.text!==(c.value.trim()||" ")&&(o.text=c.value.trim()||" ",ce(),l("change",g.value));const u=s.value;s.value=null,i.addChild?t.nextTick(()=>Ze(u)):i.addSibling==="after"?t.nextTick(()=>St(u)):i.addSibling==="before"&&t.nextTick(()=>ri(u))}function na(){s.value=null}function ia(i){if(r.previewMode)return;const o=W(g.value,i);o!=null&&o.richContent&&(b.value=i,k.value=o.richContent.raw,t.nextTick(()=>{const u=document.querySelector(".zm-node .zm-rich textarea");u==null||u.focus()}))}function oi(){if(!b.value)return;const i=b.value,o=W(g.value,i),u=k.value;if(o&&o.richContent&&o.richContent.raw!==u)if(o.richContent.kind==="code"){const N=Xn(u)||void 0;C(i,{kind:"code",raw:u,lang:N})}else C(i,{kind:"table",raw:u});b.value=null}function oa(){b.value=null}function ra(i){i.key==="Escape"?(i.preventDefault(),oa()):i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),oi())}function aa(i,o){const u=h.value.get(i);!u||u.col!==o?h.value.set(i,{col:o,dir:"asc"}):u.dir==="asc"?h.value.set(i,{col:o,dir:"desc"}):h.value.delete(i)}function la(i,o){const u=h.value.get(i);return!u||o.length<=1?o:yr(o,u.col,u.dir)}function sa(i,o){const u=h.value.get(i);return!u||u.col!==o?"↕":u.dir==="asc"?"▲":"▼"}function ca(i){const o=i.metaKey||i.ctrlKey;o&&(i.key==="z"||i.key==="Z")&&!i.shiftKey?(i.preventDefault(),Kt()):(o&&i.shiftKey&&(i.key==="z"||i.key==="Z")||o&&(i.key==="y"||i.key==="Y")&&!i.shiftKey)&&(i.preventDefault(),Yt())}function Ze(i){const o=on(g.value,i,dt);o&&(ce(),te(),l("change",g.value),t.nextTick(()=>tt(o.id)))}function St(i){if(i===g.value.id){Ze(i);return}const o=rn(g.value,i,dt);o&&(ce(),te(),l("change",g.value),t.nextTick(()=>tt(o.id)))}function ri(i){if(i===g.value.id){Ze(i);return}const o=Yi(g.value,i,dt);o&&(ce(),te(),l("change",g.value),t.nextTick(()=>tt(o.id)))}function ai(i){if(i===g.value.id)return;const o=Zi(g.value,i);o&&(ce(),d.value=o.id,l("change",g.value),te())}function Kt(){const i=Me.undo();i&&(g.value=i.data,d.value=null,l("select",null),te(),l("change",g.value))}function Yt(){const i=Me.redo();i&&(g.value=i.data,d.value=null,l("select",null),te(),l("change",g.value))}function da(i,o){const u=d.value??g.value.id,N=W(g.value,u);if(!N)return;let y=null;if(o===1){const S=we(g.value,N.id);if(S){const A=S.children.findIndex($=>$.id===N.id);A>=0&&A<S.children.length-1&&(y=S.children[A+1].id)}}else if(o===-1){const S=we(g.value,N.id);if(S){const A=S.children.findIndex($=>$.id===N.id);A>0&&(y=S.children[A-1].id)}}else if(i===1){const S=we(g.value,N.id);S&&(y=S.id)}else i===-1&&N.children.length>0&&(y=N.children[0].id);if(y){d.value=y;const S=W(g.value,y);S&&l("select",S)}}function li(i){i!==g.value.id&&Rt(g.value,i)&&(ce(),d.value===i&&(d.value=null),te(),l("change",g.value))}function si(i){m.value.has(i)?m.value.delete(i):m.value.add(i),te()}function ci(i){const o=[{n:g.value,depth:1}];for(;o.length;){const{n:u,depth:N}=o.pop();i(u,N);for(let y=u.children.length-1;y>=0;y--)o.push({n:u.children[y],depth:N+1})}}function ua(){m.value=new Set,ci(i=>{i.children.length>0&&m.value.add(i.id)}),te()}function di(i){m.value=new Set,ci((o,u)=>{u>i&&o.children.length>0&&m.value.add(o.id)}),te()}function fa(){m.value=new Set,te()}function ga(i,o){Gi(g.value,i,o)&&(ce(),te(),l("change",g.value))}function ma(i,o,u){return Ki(g.value,i,o,u)?(ce(),te(),l("change",g.value),!0):!1}function pa(i,o){i.stopPropagation(),d.value=o.id;const u=W(g.value,o.id);l("select",u)}function ha(i){const o=i.target;if(!o||o.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(i.button===2){H.startPan(i);return}if(i.button!==0)return;const u=f.value.getBoundingClientRect(),N=(i.clientX-u.left-H.offsetX.value)/H.scale.value,y=(i.clientY-u.top-H.offsetY.value)/H.scale.value;H.startMarquee(N,y)}function ba(i){if(R){R=!1;return}const o=i.target;if(!o||o.closest(".zm-node"))return;const u=H.marquee;u.width>=4||u.height>=4||d.value!==null&&(d.value=null,l("select",null))}function ya(){const i=H.marquee;if(i.width<4&&i.height<4)return;const o=i.x,u=i.y,N=i.x+i.width,y=i.y+i.height,S=[];for(const A of Gt.value){const $=A.width/2,j=A.height/2,p=A.x-$,K=A.x+$,Ne=A.y-j,Ce=A.y+j;p<=N&&K>=o&&Ne<=y&&Ce>=u&&S.push(A.id)}if(S.length>0){d.value=S[0];const A=W(g.value,S[0]);A&&l("select",A)}}function ui(i){return m.value.has(i)}function Ea(i){const o=W(g.value,i.id);return!!o&&o.children.length>0}function Zt(i){const o=W(g.value,i);return o?o.children.length:0}function fi(i){if(!W(g.value,i))return 0;const N=[g.value];for(;N.length;){const y=N.pop(),S=y.children.findIndex(A=>A.id===i);if(S>=0)return S;for(const A of y.children)N.push(A)}return 0}function gi(i,o,u,N){if(((N==null?void 0:N._dir)??i._dir)==="down")return o==="out"?{x:i.x,y:i.y+i.height/2}:{x:i.x,y:i.y-i.height/2};let S;o==="in"?S=-i.side:u!==void 0?S=u:S=i.side;const A=o==="in"?i._richInsetX??0:0;return{x:i.x+S*(i.width/2-A),y:i.y}}function Re(){const i=be.value;H.resetView(i.width,i.height,i.root.y)}function xa(){he.value=!0,ce(),te(),t.nextTick(()=>Re())}function Xt(i){O.layoutMode!==i&&(O.layoutMode=i,te(),t.nextTick(()=>Re()))}function mi(){return JSON.stringify(g.value,null,2)}function pi(i){try{const o=JSON.parse(i);return!o.id||!Array.isArray(o.children)?!1:(Me.reset(),g.value=Te(o),d.value=null,m.value=new Set,te(),t.nextTick(()=>Re()),l("change",g.value),!0)}catch{return!1}}function ka(){const i=document.createElement("input");i.type="file",i.accept="application/json",i.onchange=()=>{var N;const o=(N=i.files)==null?void 0:N[0];if(!o)return;const u=new FileReader;u.onload=()=>{typeof u.result=="string"&&(pi(u.result)||alert("导入失败:JSON 格式无效"))},u.readAsText(o)},i.click()}function Na(){const i=new Blob([mi()],{type:"application/json"}),o=URL.createObjectURL(i),u=document.createElement("a");u.href=o,u.download=`${g.value.text||"mindmap"}.json`,u.click(),URL.revokeObjectURL(o)}return a({addChild:i=>Ze(i),addSibling:i=>St(i),removeNode:i=>li(i),duplicateNode:i=>ai(i),setNodeText:(i,o)=>ga(i,o),moveNode:(i,o,u)=>ma(i,o,u),lineWidthForDepth:jn,endWidthForDepth:Jn,getData:()=>g.value,setData:i=>{Me.reset(),g.value=Te(i),d.value=null,m.value=new Set,te(),ce(),t.nextTick(()=>Re())},resetView:()=>Re(),exportData:mi,importData:pi,getMarkdown:()=>ut(g.value),setMarkdown:(i,o=!0)=>{const u=Ot(i||"");o&&(_.value=!0),F=!o,Me.reset(),g.value=Te(u),d.value=null,m.value=new Set,te(),ce(),t.nextTick(()=>{F=!1,Re()}),l("change",g.value)},setBalanced:i=>{he.value=i},isBalanced:()=>he.value,balance:()=>xa(),applyNodeStyle:(i,o)=>B(i,o),getNodeStyle:i=>J(i),applyNodeImage:(i,o)=>ee(i,o),applyNodeImageByUrl:(i,o)=>G(i,o),removeNodeImage:i=>ae(i),applyNodeLink:(i,o)=>ie(i,o),removeNodeLink:i=>fe(i),applyNodeNote:(i,o)=>E(i,o),removeNodeNote:i=>v(i),applyNodeRichContent:(i,o)=>C(i,o),undo:()=>Kt(),redo:()=>Yt(),canUndo:()=>Me.canUndo(),canRedo:()=>Me.canRedo(),applySettings:i=>{i.autoBalanceOnChange!==void 0&&(O.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(O.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(O.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(O.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(O.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(O.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(O.lineStyle=i.lineStyle),i.taperedEdge!==void 0&&(O.taperedEdge=i.taperedEdge),i.showOrderBadge!==void 0&&(O.showOrderBadge=i.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:O.autoBalanceOnChange,lineWidthStart:O.lineWidthStart,lineWidthEnd:O.lineWidthEnd,rainbowBranch:O.rainbowBranch,branchPaletteId:O.branchPaletteId,customPalettes:O.customPalettes,lineStyle:O.lineStyle,layoutMode:O.layoutMode,taperedEdge:O.taperedEdge,showOrderBadge:O.showOrderBadge}),setBranchPalette:i=>{if(!i)return;[...qe,...O.customPalettes].find(u=>u.id===i)&&(O.branchPaletteId=i)},getBranchPalette:()=>O.branchPaletteId,getBranchPalettes:()=>[...qe,...O.customPalettes]}),t.watch(()=>r.data,i=>{g.value=Te(i),te()},{deep:!1}),t.onMounted(()=>{ce(),t.nextTick(()=>Re())}),(i,o)=>{var u,N,y,S,A,$,j;return t.openBlock(),t.createElementBlock("div",{class:"zm-mindmap",style:t.normalizeStyle({background:_e.value.bgColor,fontSize:_e.value.fontSize+"px"})},[t.createElementVNode("div",{ref_key:"wrapperRef",ref:f,class:"zm-canvas",onMousedown:ha,onContextmenu:Ee,onWheel:o[25]||(o[25]=(...p)=>t.unref(H).onWheel&&t.unref(H).onWheel(...p)),onMouseenter:o[26]||(o[26]=p=>x.value=!0),onMouseleave:o[27]||(o[27]=p=>x.value=!1),onClick:ba},[t.createElementVNode("div",{class:"zm-svg-layer",style:t.normalizeStyle({left:be.value.vbX*t.unref(H).scale.value+t.unref(H).offsetX.value+"px",top:be.value.vbY*t.unref(H).scale.value+t.unref(H).offsetY.value+"px",width:be.value.vbW*t.unref(H).scale.value+"px",height:be.value.vbH*t.unref(H).scale.value+"px"})},[(t.openBlock(),t.createElementBlock("svg",{class:"zm-svg",viewBox:ta.value,preserveAspectRatio:"xMinYMin meet",width:be.value.vbW*t.unref(H).scale.value,height:be.value.vbH*t.unref(H).scale.value},[t.createElementVNode("g",xr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ea.value,p=>(t.openBlock(),t.createElementBlock("path",{key:p.key,d:Kr(gi(p.from,"out",p.to.side,p.to),gi(p.to,"in"),jn(p.from.depth),Jn(p.to.depth),32,O.lineStyle,p.to._dir),fill:Zr(p.from,p.to),stroke:"none"},null,8,kr))),128))])],8,Er))],4),t.unref(H).isMarquee.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"zm-marquee",style:t.normalizeStyle({left:t.unref(H).marquee.x*t.unref(H).scale.value+t.unref(H).offsetX.value+"px",top:t.unref(H).marquee.y*t.unref(H).scale.value+t.unref(H).offsetY.value+"px",width:t.unref(H).marquee.width*t.unref(H).scale.value+"px",height:t.unref(H).marquee.height*t.unref(H).scale.value+"px"})},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"zm-world",style:t.normalizeStyle({transform:`translate(${t.unref(H).offsetX.value}px, ${t.unref(H).offsetY.value}px) scale(${t.unref(H).scale.value})`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Gt.value,p=>(t.openBlock(),t.createElementBlock("div",{key:p.id,class:t.normalizeClass(["zm-node",{"is-root":p.isRoot,"is-selected":d.value===p.id,"is-editing":s.value===p.id,"has-image":!!p.image,"is-resizing":Ge.value===p.id}]),"data-node-id":p.id,style:t.normalizeStyle({left:p.x+"px",top:p.y+"px",width:p.width+"px",minWidth:p.width+"px",height:p.height+"px",fontSize:p.fontSize+"px",background:Xr(p),color:qr(p),borderColor:jr(p),fontWeight:Jr(p),transform:"translate(-50%, -50%)"}),onClick:K=>pa(K,p),onDblclick:K=>{K.stopPropagation(),e.previewMode||tt(p.id)},onContextmenu:K=>ne(K,p),onMouseenter:K=>V(p.id),onMouseleave:K=>Z(p.id)},[p.image?(t.openBlock(),t.createElementBlock("img",{key:0,class:"zm-node-img",src:p.image.src,width:p.image.width,height:p.image.height,alt:p.text,draggable:"false"},null,8,wr)):t.createCommentVNode("",!0),p.richContent&&(p.richContent.kind==="code"||p.richContent.kind==="table")&&s.value!==p.id?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":p.richContent.kind==="table"||p.richContent.kind==="code"}]),onClick:o[1]||(o[1]=t.withModifiers(()=>{},["stop"])),onDblclick:t.withModifiers(K=>ia(p.id),["stop"]),onMousedown:o[2]||(o[2]=t.withModifiers(()=>{},["stop"]))},[b.value===p.id?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:0,"onUpdate:modelValue":o[0]||(o[0]=K=>k.value=K),class:"zm-rich-edit",spellcheck:"false",onBlur:oi,onKeydown:ra},null,544)),[[t.vModelText,k.value]]):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[p.richContent.kind==="code"?(t.openBlock(),t.createElementBlock("pre",Sr,[t.createElementVNode("code",{innerHTML:t.unref(pr)(t.unref(Zn)(p.richContent.raw),t.unref(Xn)(p.richContent.raw))},null,8,Mr)])):p.richContent.kind==="table"?(t.openBlock(),t.createElementBlock("table",Cr,[t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(la(p.id,t.unref(hr)(p.richContent.raw)),(K,Ne)=>(t.openBlock(),t.createElementBlock("tr",{key:Ne},[Ne===0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(K,(Ce,pe)=>{var nt,it,ot,rt,ve;return t.openBlock(),t.createElementBlock("th",{key:`h${pe}`,class:t.normalizeClass(["zm-rich-table-sort",{"is-sorted":((nt=h.value.get(p.id))==null?void 0:nt.col)===pe,"is-asc":((it=h.value.get(p.id))==null?void 0:it.col)===pe&&((ot=h.value.get(p.id))==null?void 0:ot.dir)==="asc","is-desc":((rt=h.value.get(p.id))==null?void 0:rt.col)===pe&&((ve=h.value.get(p.id))==null?void 0:ve.dir)==="desc"}]),onClick:t.withModifiers(hi=>aa(p.id,pe),["stop"])},[t.createElementVNode("span",null,t.toDisplayString(Ce),1),t.createElementVNode("span",Tr,t.toDisplayString(sa(p.id,pe)),1)],10,vr)}),128)):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(K,(Ce,pe)=>(t.openBlock(),t.createElementBlock("td",{key:`c${pe}`},t.toDisplayString(Ce),1))),128))]))),128))])])):t.createCommentVNode("",!0)],64))],42,_r)):t.createCommentVNode("",!0),s.value!==p.id?(t.openBlock(),t.createElementBlock("span",Ar,[t.createElementVNode("span",Rr,t.toDisplayString(p.text),1),p.link&&!s.value?(t.openBlock(),t.createElementBlock("a",{key:0,class:"zm-node-link",href:p.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${p.link.url}`,onClick:o[3]||(o[3]=t.withModifiers(()=>{},["stop"])),onMousedown:o[4]||(o[4]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(q,{name:"link",size:11,stroke:2})],40,Or)):t.createCommentVNode("",!0),p.note&&!s.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:Nt(p.note.text),onClick:t.withModifiers(K=>D(p.id),["stop"]),onMousedown:o[5]||(o[5]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(q,{name:"note",size:11,stroke:2})],40,Ir)):t.createCommentVNode("",!0)])):t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":o[6]||(o[6]=K=>c.value=K),autofocus:"",onBlur:o[7]||(o[7]=K=>_t()),onKeydown:[o[8]||(o[8]=t.withKeys(t.withModifiers(K=>_t({addSibling:"after"}),["exact"]),["enter"])),o[9]||(o[9]=t.withKeys(t.withModifiers(K=>_t({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),o[10]||(o[10]=t.withKeys(t.withModifiers(K=>_t({addChild:!0}),["prevent"]),["tab"])),t.withKeys(na,["esc"]),ca],onMousedown:o[11]||(o[11]=t.withModifiers(()=>{},["stop"])),onClick:o[12]||(o[12]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,c.value]]),I.value?(t.openBlock(),t.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${fi(p.id)+1} 个`},t.toDisplayString(fi(p.id)+1),9,Br)):t.createCommentVNode("",!0),ui(p.id)&&Zt(p.id)>0?(t.openBlock(),t.createElementBlock("span",{key:5,class:t.normalizeClass(["zm-collapse-badge",{"is-on-left":p.side===-1}]),style:t.normalizeStyle({background:$e.value.get(p.id)??"#64748b"}),title:`展开 ${Zt(p.id)} 个子节点`,onMousedown:o[13]||(o[13]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(K=>si(p.id),["stop"])},t.toDisplayString(Zt(p.id)),47,Lr)):t.createCommentVNode("",!0),Ea(p)&&!ui(p.id)?(t.openBlock(),t.createElementBlock("button",{key:6,class:t.normalizeClass(["zm-btn zm-collapse",{"is-on-left":p.side===-1}]),style:t.normalizeStyle({color:$e.value.get(p.id)??"#64748b",borderColor:$e.value.get(p.id)??"#64748b"}),title:"折叠",onMousedown:o[14]||(o[14]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(K=>si(p.id),["stop"])},[t.createVNode(q,{name:"minus",size:10,stroke:2.4})],46,Dr)):t.createCommentVNode("",!0),p.image&&d.value===p.id&&s.value!==p.id?(t.openBlock(),t.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:t.withModifiers(K=>Ae(K,p),["stop"])},null,40,zr)):t.createCommentVNode("",!0),p.image&&d.value===p.id&&s.value!==p.id?(t.openBlock(),t.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:o[15]||(o[15]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(K=>ae(p.id),["stop"])},[t.createVNode(q,{name:"x",size:9,stroke:2.2})],40,$r)):t.createCommentVNode("",!0)],46,Nr))),128))],4),T.value?(t.openBlock(),t.createBlock(no,{key:1,x:T.value.x,y:T.value.y,container:f.value,"has-image":!!((u=t.unref(W)(g.value,T.value.nodeId))!=null&&u.image),"has-link":!!((N=t.unref(W)(g.value,T.value.nodeId))!=null&&N.link),"has-note":!!((y=t.unref(W)(g.value,T.value.nodeId))!=null&&y.note),"has-code":((A=(S=t.unref(W)(g.value,T.value.nodeId))==null?void 0:S.richContent)==null?void 0:A.kind)==="code","has-table":((j=($=t.unref(W)(g.value,T.value.nodeId))==null?void 0:$.richContent)==null?void 0:j.kind)==="table",onPickImage:xt,onRemoveImage:We,onSetLink:Ut,onRemoveLink:Ht,onEditNote:Ft,onRemoveNote:Wt,onAddCode:Qe,onEditCode:Qe,onRemoveCode:ke,onAddTable:kt,onEditTable:kt,onRemoveTable:et,onClose:ge},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):t.createCommentVNode("",!0),U.value?(t.openBlock(),t.createBlock(io,{key:2,x:U.value.x,y:U.value.y,container:f.value,onOpenData:yt,onOpenImport:Et,onOpenSettings:xe,onClose:me},null,8,["x","y","container"])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":x.value}])},[t.createElementVNode("span",Pr,t.toDisplayString(Math.round(t.unref(H).scale.value*100))+"%",1),t.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:o[16]||(o[16]=(...p)=>t.unref(H).zoomIn&&t.unref(H).zoomIn(...p))},[t.createVNode(q,{name:"zoom-in"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:o[17]||(o[17]=(...p)=>t.unref(H).zoomOut&&t.unref(H).zoomOut(...p))},[t.createVNode(q,{name:"zoom-out"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Re},[t.createVNode(q,{name:"reset"})]),o[31]||(o[31]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:ua},[t.createVNode(q,{name:"collapse-all"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:o[18]||(o[18]=p=>di(1))},[t.createVNode(q,{name:"expand-level-1"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:o[19]||(o[19]=p=>di(2))},[t.createVNode(q,{name:"expand-level-2"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:fa},[t.createVNode(q,{name:"expand-all"})]),o[32]||(o[32]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:Na},[t.createVNode(q,{name:"export"})]),r.previewMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[28]||(o[28]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:o[20]||(o[20]=p=>d.value&&Ze(d.value))},[t.createElementVNode("img",{src:t.unref(wi),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Vr)]),t.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:o[21]||(o[21]=p=>d.value&&St(d.value))},[t.createElementVNode("img",{src:t.unref(Ni),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Ur)]),o[29]||(o[29]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:O.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:o[22]||(o[22]=p=>Xt("mindmap"))},[t.createVNode(q,{name:"mindmap"})],2),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:O.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:o[23]||(o[23]=p=>Xt("tree"))},[t.createVNode(q,{name:"tree"})],2),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:O.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:o[24]||(o[24]=p=>Xt("org"))},[t.createVNode(q,{name:"org"})],2),o[30]||(o[30]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:ka},[t.createVNode(q,{name:"import"})])],64))],2)],544)],4)}}}),Hr={install(e){e.component("FlowMindMap",qn)}};de.MindMap=qn,de.addChild=on,de.addSibling=rn,de.clone=Te,de.default=Hr,de.findNode=W,de.findParent=we,de.markdownToMindMap=Ot,de.markdownToRichMindMap=qi,de.mindMapToMarkdown=ut,de.removeNode=Rt,de.richBlockToMarkdown=ji,de.uid=Se,Object.defineProperties(de,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
22
|
+
| a | b | c |`);if(E===null)return;const _=E.trim();if(!_){M(i,null);return}M(i,{kind:"table",raw:_})}function et(){var o;const i=(o=v.value)==null?void 0:o.nodeId;i&&M(i,null)}function P(i){r.previewMode||l("edit-note",i)}function Nt(i,o=60){const u=i.replace(/\s+/g," ").trim();return u.length<=o?u||"点击编辑笔记":u.slice(0,o)+"…"}function le(i){var E;if(r.previewMode||s.value)return;const o=i.target;if(o&&(o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable))return;const u=c.value;if(!u)return;const w=(E=i.clipboardData)==null?void 0:E.items;if(w)for(let _=0;_<w.length;_++){const T=w[_];if(T.kind==="file"&&T.type.startsWith("image/")){const V=T.getAsFile();if(!V)continue;i.preventDefault();const j=W(m.value,u);if(j!=null&&j.image&&!window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))return;re(V,p=>ee(u,p));return}}}t.onMounted(()=>{window.addEventListener("paste",le),te()}),t.onBeforeUnmount(()=>{window.removeEventListener("paste",le)});const Y=t.ref(null),Ge=t.computed(()=>{var i;return((i=Y.value)==null?void 0:i.nodeId)??null});function Ae(i,o){if(!o.image)return;i.preventDefault(),i.stopPropagation();const u=o.image.naturalW||o.image.width,w=o.image.naturalH||o.image.height,E=w>0?w/u:1;Y.value={nodeId:o.id,startX:i.clientX,startY:i.clientY,startW:o.image.width,startH:o.image.height,naturalW:u,naturalH:w,ratio:E,pendingW:o.image.width,pendingH:o.image.height},window.addEventListener("mousemove",Ke),window.addEventListener("mouseup",Ye)}function Ke(i){var j,p;const o=Y.value;if(!o)return;const u=F.scale.value||1,w=i.clientX-o.startX,E=Q(o.startW+w/u,ze,Fe),_=Q(E*o.ratio,ze,Fe);o.pendingW=E,o.pendingH=_;const T=(j=f.value)==null?void 0:j.querySelector(`[data-node-id="${o.nodeId}"] .zm-node-img`);T&&(T.style.width=`${E}px`,T.style.height=`${_}px`);const V=(p=f.value)==null?void 0:p.querySelector(`[data-node-id="${o.nodeId}"]`);V&&(V.style.minWidth=`${Math.max(80,Math.ceil(E+28))}px`,V.style.height=`${Math.ceil(_+8+30)}px`)}function Ye(){const i=Y.value;if(window.removeEventListener("mousemove",Ke),window.removeEventListener("mouseup",Ye),Y.value=null,!i)return;const o=W(m.value,i.nodeId);!o||!o.image||(ee(i.nodeId,{src:o.image.src,naturalW:o.image.naturalW,naturalH:o.image.naturalH,width:i.pendingW,height:i.pendingH}),c.value=i.nodeId,l("select",o),A=!0)}const S=t.ref(null);let A=!1;function U(i){S.value=i}function Z(i){S.value===i&&(S.value=null)}const se=t.ref(0),he=t.ref(!1),Me=to(100);function ce(){Me.record({data:m.value})}function te(){g.value=new Set(g.value),se.value++,t.nextTick().then(()=>t.nextTick()).then(()=>Fr()).then(()=>{se.value++})}function Fr(){const i=document.querySelectorAll(".zm-rich"),o={},u={};i.forEach(w=>{let E=w,_=null;for(;E&&!_;)_=E.getAttribute("data-node-id"),E=E.parentElement;if(!_)return;const T=w.offsetHeight,V=w.scrollWidth,j=Math.round(T*2)/2,p=Math.round(V*2)/2;o[_]=j,u[_]=p,L.value[_],B.value[_]}),L.value=o,B.value=u}const _e=t.computed(()=>{var i,o,u,w,E,_,T,V,j,p;return{rootBg:((i=r.theme)==null?void 0:i.rootBg)??"#1f2937",rootText:((o=r.theme)==null?void 0:o.rootText)??"#ffffff",branchBg:((u=r.theme)==null?void 0:u.branchBg)??"#ffffff",branchText:((w=r.theme)==null?void 0:w.branchText)??"#1f2937",lineColor:((E=r.theme)==null?void 0:E.lineColor)??"#94a3b8",bgColor:((_=r.theme)==null?void 0:_.bgColor)??"#f8fafc",fontSize:((T=r.theme)==null?void 0:T.fontSize)??14,lineWidthStart:((V=r.theme)==null?void 0:V.lineWidthStart)??2.2,lineWidthEnd:((j=r.theme)==null?void 0:j.lineWidthEnd)??.8,rainbowBranch:((p=r.theme)==null?void 0:p.rainbowBranch)??!1}}),D=t.reactive({autoBalanceOnChange:!0,lineWidthStart:12,lineWidthEnd:3.6,rainbowBranch:!0,branchPaletteId:"default",customPalettes:[],lineStyle:"curve",layoutMode:"mindmap",taperedEdge:!0,showOrderBadge:!1});function jn(i){return D.taperedEdge?Wr(i):Qn(i)}function Jn(i){return D.taperedEdge?D.lineWidthEnd:Qn(i)}function Wr(i){return i<=0?D.lineWidthStart:i===1?Math.max(1.5,D.lineWidthStart*.67):i===2?Math.max(.8,D.lineWidthStart*.42):D.lineWidthEnd}function Qn(i){if(i<=0)return D.lineWidthStart;if(i>=3)return D.lineWidthEnd;const o=i/3;return D.lineWidthStart+(D.lineWidthEnd-D.lineWidthStart)*o}function Gr(i,o,u,w){const E=1-i,_=E*E*E*o.x+3*E*E*i*u.x1+3*E*i*i*u.x2+i*i*i*w.x,T=E*E*E*o.y+3*E*E*i*u.y1+3*E*i*i*u.y2+i*i*i*w.y;return{x:_,y:T}}function Kr(i,o,u,w,E=32,_="curve",T="right"){if(_==="curve"){let ve;if(T==="right"||T==="left"){const oe=Math.abs(o.x-i.x)*.45,Oe=T==="right"?1:-1;ve={x1:i.x+Oe*oe,y1:i.y,x2:o.x-Oe*oe,y2:o.y}}else{const oe=Math.abs(o.y-i.y)*.45;ve={x1:i.x,y1:i.y+oe,x2:o.x,y2:o.y-oe}}const hi=X=>{const oe=1-X,Oe=-3*oe*oe*i.x+3*(oe*oe-2*oe*X)*ve.x1+3*(2*oe*X-X*X)*ve.x2+3*X*X*o.x,Xe=-3*oe*oe*i.y+3*(oe*oe-2*oe*X)*ve.y1+3*(2*oe*X-X*X)*ve.y2+3*X*X*o.y;return{dx:Oe,dy:Xe}},at=[],qt=[];for(let X=0;X<=E;X++){const oe=X/E,Oe=X===0?i:X===E?o:Gr(oe,i,ve,o),Xe=hi(oe);let Ct=Math.hypot(Xe.dx,Xe.dy);Ct<1e-6&&(Ct=1);const bi=-Xe.dy/Ct,yi=Xe.dx/Ct,vt=(u+(w-u)*oe)/2;at.push({x:Oe.x+bi*vt,y:Oe.y+yi*vt}),qt.push({x:Oe.x-bi*vt,y:Oe.y-yi*vt})}let Mt=`M ${at[0].x.toFixed(2)} ${at[0].y.toFixed(2)}`;for(let X=1;X<=E;X++)Mt+=` L ${at[X].x.toFixed(2)} ${at[X].y.toFixed(2)}`;for(let X=E;X>=0;X--)Mt+=` L ${qt[X].x.toFixed(2)} ${qt[X].y.toFixed(2)}`;return Mt+=" Z",Mt}const V=o.x-i.x,j=o.y-i.y;let p=Math.hypot(V,j);p<1e-6&&(p=1);const K=-j/p,Ne=V/p,Ce=u/2,pe=w/2,nt={x:i.x+K*Ce,y:i.y+Ne*Ce},it={x:i.x-K*Ce,y:i.y-Ne*Ce},ot={x:o.x-K*pe,y:o.y-Ne*pe},rt={x:o.x+K*pe,y:o.y+Ne*pe};return`M ${nt.x.toFixed(2)} ${nt.y.toFixed(2)} L ${rt.x.toFixed(2)} ${rt.y.toFixed(2)} L ${ot.x.toFixed(2)} ${ot.y.toFixed(2)} L ${it.x.toFixed(2)} ${it.y.toFixed(2)} Z`}const wt=t.computed(()=>be.value.root.children),Yr=qe[0].colors,ei=t.computed(()=>Wi(D.branchPaletteId,D.customPalettes)),$e=t.computed(()=>{const i=new Map;if(!D.rainbowBranch)return i;const o=r.lineColors,u=o&&o.length>0?o:ei.value.colors.length>0?ei.value.colors:Yr;for(let E=0;E<wt.value.length;E++){const _=wt.value[E];i.set(_.id,u[E%u.length])}const w=(E,_)=>{i.set(E.id,_);for(const T of E.children)w(T,_)};for(let E=0;E<wt.value.length;E++){const _=wt.value[E];w(_,u[E%u.length])}return i});function Zr(i,o){return D.rainbowBranch?$e.value.get(o.id)??_e.value.lineColor:_e.value.lineColor}function Xr(i){const o=J(i.id);if(o.bg)return o.bg;if(i.isRoot)return _e.value.rootBg;if(D.rainbowBranch){const u=$e.value.get(i.id);if(u)return Qr(u,.18)}return _e.value.branchBg}function qr(i){const o=J(i.id);if(o.textColor)return o.textColor;if(i.isRoot)return _e.value.rootText;if(D.rainbowBranch){const u=$e.value.get(i.id);if(u)return ti(u,.55)}return _e.value.branchText}function jr(i){const o=J(i.id);if(o.borderColor)return o.borderColor;if(i.isRoot)return _e.value.rootBg;if(D.rainbowBranch){const u=$e.value.get(i.id);if(u)return ti(u,.3)}return _e.value.lineColor}function Jr(i){return J(i.id).fontWeight??(i.isRoot?600:400)}function Qr(i,o){const u=i.replace("#",""),w=u.length===6?u:u.split("").map(V=>V+V).join(""),E=parseInt(w.slice(0,2),16),_=parseInt(w.slice(2,4),16),T=parseInt(w.slice(4,6),16);return`rgba(${E}, ${_}, ${T}, ${o})`}function ti(i,o){const u=i.replace("#",""),w=u.length===6?u:u.split("").map(V=>V+V).join(""),E=Math.round(parseInt(w.slice(0,2),16)*(1-o)),_=Math.round(parseInt(w.slice(2,4),16)*(1-o)),T=Math.round(parseInt(w.slice(4,6),16)*(1-o));return`rgb(${E}, ${_}, ${T})`}const F=Ji({getContainer:()=>f.value});F.setOnMarqueeEnd(ya),eo({isEditing:()=>s.value!==null,isReadonly:()=>r.previewMode,getSelectedId:()=>c.value,getRootId:()=>m.value.id,defaultTargetId:()=>m.value.id,onAddChild:Ze,onAddSibling:St,onAddSiblingBefore:ri,onRemove:li,onStartEdit:tt,onClearSelection:()=>{c.value=null,l("select",null)},onDuplicate:ai,onUndo:Kt,onRedo:Yt,onNavigate:da,onSelectRoot:()=>{c.value=m.value.id;const i=W(m.value,m.value.id);i&&l("select",i)}});const be=t.computed(()=>{const i=Te(m.value);return ii(i),Vi(i,{mode:D.layoutMode,baseFontSize:_e.value.fontSize,richHeights:L.value,richWidths:B.value})}),ni=t.ref([]),Gt=t.computed(()=>(se.value,ni.value));t.watch(be,i=>{const o=[],u=w=>{o.push(w);for(const E of w.children)u(E)};u(i.root),ni.value=o},{immediate:!0});const ea=t.computed(()=>{const i=[];for(const o of Gt.value)for(const u of o.children)i.push({from:o,to:u,key:`${o.id}->${u.id}`});return i}),ta=t.computed(()=>`${be.value.vbX} ${be.value.vbY} ${be.value.vbW} ${be.value.vbH}`);function ii(i){if(g.value.has(i.id)){i.children=[],i.collapsed=!0;return}i.collapsed=!1;for(const o of i.children)ii(o)}function tt(i){const o=W(m.value,i);o&&(s.value=i,d.value=o.text,t.nextTick(()=>{const u=document.querySelector(".zm-input");u==null||u.focus(),u==null||u.select()}))}function _t(i={}){if(!s.value)return;const o=W(m.value,s.value);o&&o.text!==(d.value.trim()||" ")&&(o.text=d.value.trim()||" ",ce(),l("change",m.value));const u=s.value;s.value=null,i.addChild?t.nextTick(()=>Ze(u)):i.addSibling==="after"?t.nextTick(()=>St(u)):i.addSibling==="before"&&t.nextTick(()=>ri(u))}function na(){s.value=null}function ia(i){if(r.previewMode)return;const o=W(m.value,i);o!=null&&o.richContent&&(y.value=i,N.value=o.richContent.raw,t.nextTick(()=>{const u=document.querySelector(".zm-node .zm-rich textarea");u==null||u.focus()}))}function oi(){if(!y.value)return;const i=y.value,o=W(m.value,i),u=N.value;if(o&&o.richContent&&o.richContent.raw!==u)if(o.richContent.kind==="code"){const w=Xn(u)||void 0;M(i,{kind:"code",raw:u,lang:w})}else M(i,{kind:"table",raw:u});y.value=null}function oa(){y.value=null}function ra(i){i.key==="Escape"?(i.preventDefault(),oa()):i.key==="Enter"&&(i.ctrlKey||i.metaKey)&&(i.preventDefault(),oi())}function aa(i,o){const u=h.value.get(i);!u||u.col!==o?h.value.set(i,{col:o,dir:"asc"}):u.dir==="asc"?h.value.set(i,{col:o,dir:"desc"}):h.value.delete(i)}function la(i,o){const u=h.value.get(i);return!u||o.length<=1?o:yr(o,u.col,u.dir)}function sa(i,o){const u=h.value.get(i);return!u||u.col!==o?"↕":u.dir==="asc"?"▲":"▼"}function ca(i){const o=i.metaKey||i.ctrlKey;o&&(i.key==="z"||i.key==="Z")&&!i.shiftKey?(i.preventDefault(),Kt()):(o&&i.shiftKey&&(i.key==="z"||i.key==="Z")||o&&(i.key==="y"||i.key==="Y")&&!i.shiftKey)&&(i.preventDefault(),Yt())}function Ze(i){const o=on(m.value,i,dt);o&&(ce(),te(),l("change",m.value),t.nextTick(()=>tt(o.id)))}function St(i){if(i===m.value.id){Ze(i);return}const o=rn(m.value,i,dt);o&&(ce(),te(),l("change",m.value),t.nextTick(()=>tt(o.id)))}function ri(i){if(i===m.value.id){Ze(i);return}const o=Yi(m.value,i,dt);o&&(ce(),te(),l("change",m.value),t.nextTick(()=>tt(o.id)))}function ai(i){if(i===m.value.id)return;const o=Zi(m.value,i);o&&(ce(),c.value=o.id,l("change",m.value),te())}function Kt(){const i=Me.undo();i&&(m.value=i.data,c.value=null,l("select",null),te(),l("change",m.value))}function Yt(){const i=Me.redo();i&&(m.value=i.data,c.value=null,l("select",null),te(),l("change",m.value))}function da(i,o){const u=c.value??m.value.id,w=W(m.value,u);if(!w)return;let E=null;if(o===1){const _=we(m.value,w.id);if(_){const T=_.children.findIndex(V=>V.id===w.id);T>=0&&T<_.children.length-1&&(E=_.children[T+1].id)}}else if(o===-1){const _=we(m.value,w.id);if(_){const T=_.children.findIndex(V=>V.id===w.id);T>0&&(E=_.children[T-1].id)}}else if(i===1){const _=we(m.value,w.id);_&&(E=_.id)}else i===-1&&w.children.length>0&&(E=w.children[0].id);if(E){c.value=E;const _=W(m.value,E);_&&l("select",_)}}function li(i){i!==m.value.id&&Rt(m.value,i)&&(ce(),c.value===i&&(c.value=null),te(),l("change",m.value))}function si(i){g.value.has(i)?g.value.delete(i):g.value.add(i),te()}function ci(i){const o=[{n:m.value,depth:1}];for(;o.length;){const{n:u,depth:w}=o.pop();i(u,w);for(let E=u.children.length-1;E>=0;E--)o.push({n:u.children[E],depth:w+1})}}function ua(){g.value=new Set,ci(i=>{i.children.length>0&&g.value.add(i.id)}),te()}function di(i){g.value=new Set,ci((o,u)=>{u>i&&o.children.length>0&&g.value.add(o.id)}),te()}function fa(){g.value=new Set,te()}function ga(i,o){Gi(m.value,i,o)&&(ce(),te(),l("change",m.value))}function ma(i,o,u){return Ki(m.value,i,o,u)?(ce(),te(),l("change",m.value),!0):!1}function pa(i,o){i.stopPropagation(),c.value=o.id;const u=W(m.value,o.id);l("select",u)}function ha(i){const o=i.target;if(!o||o.closest(".zm-node, .zm-toolbar, button, input, textarea"))return;if(i.button===2){F.startPan(i);return}if(i.button!==0)return;const u=f.value.getBoundingClientRect(),w=(i.clientX-u.left-F.offsetX.value)/F.scale.value,E=(i.clientY-u.top-F.offsetY.value)/F.scale.value;F.startMarquee(w,E)}function ba(i){if(A){A=!1;return}const o=i.target;if(!o||o.closest(".zm-node"))return;const u=F.marquee;u.width>=4||u.height>=4||c.value!==null&&(c.value=null,l("select",null))}function ya(){const i=F.marquee;if(i.width<4&&i.height<4)return;const o=i.x,u=i.y,w=i.x+i.width,E=i.y+i.height,_=[];for(const T of Gt.value){const V=T.width/2,j=T.height/2,p=T.x-V,K=T.x+V,Ne=T.y-j,Ce=T.y+j;p<=w&&K>=o&&Ne<=E&&Ce>=u&&_.push(T.id)}if(_.length>0){c.value=_[0];const T=W(m.value,_[0]);T&&l("select",T)}}function ui(i){return g.value.has(i)}function Ea(i){const o=W(m.value,i.id);return!!o&&o.children.length>0}function Zt(i){const o=W(m.value,i);return o?o.children.length:0}function fi(i){if(!W(m.value,i))return 0;const w=[m.value];for(;w.length;){const E=w.pop(),_=E.children.findIndex(T=>T.id===i);if(_>=0)return _;for(const T of E.children)w.push(T)}return 0}function gi(i,o,u,w){if(((w==null?void 0:w._dir)??i._dir)==="down")return o==="out"?{x:i.x,y:i.y+i.height/2}:{x:i.x,y:i.y-i.height/2};let _;o==="in"?_=-i.side:u!==void 0?_=u:_=i.side;const T=o==="in"?i._richInsetX??0:0;return{x:i.x+_*(i.width/2-T),y:i.y}}function Re(){const i=be.value;F.resetView(i.width,i.height,i.root.y)}function xa(){he.value=!0,ce(),te(),t.nextTick(()=>Re())}function Xt(i){D.layoutMode!==i&&(D.layoutMode=i,te(),t.nextTick(()=>Re()))}function mi(){return JSON.stringify(m.value,null,2)}function pi(i){try{const o=JSON.parse(i);return!o.id||!Array.isArray(o.children)?!1:(Me.reset(),m.value=Te(o),c.value=null,g.value=new Set,te(),t.nextTick(()=>Re()),l("change",m.value),!0)}catch{return!1}}function ka(){const i=document.createElement("input");i.type="file",i.accept="application/json",i.onchange=()=>{var w;const o=(w=i.files)==null?void 0:w[0];if(!o)return;const u=new FileReader;u.onload=()=>{typeof u.result=="string"&&(pi(u.result)||alert("导入失败:JSON 格式无效"))},u.readAsText(o)},i.click()}function Na(){const i=new Blob([mi()],{type:"application/json"}),o=URL.createObjectURL(i),u=document.createElement("a");u.href=o,u.download=`${m.value.text||"mindmap"}.json`,u.click(),URL.revokeObjectURL(o)}return a({addChild:i=>Ze(i),addSibling:i=>St(i),removeNode:i=>li(i),duplicateNode:i=>ai(i),setNodeText:(i,o)=>ga(i,o),moveNode:(i,o,u)=>ma(i,o,u),lineWidthForDepth:jn,endWidthForDepth:Jn,getData:()=>m.value,setData:i=>{Me.reset(),m.value=Te(i),c.value=null,g.value=new Set,te(),ce(),t.nextTick(()=>Re())},resetView:()=>Re(),exportData:mi,importData:pi,getMarkdown:()=>ut(m.value),setMarkdown:(i,o=!0)=>{const u=Ot(i||"");o&&(b.value=!0),O=!o,Me.reset(),m.value=Te(u),c.value=null,g.value=new Set,te(),ce(),t.nextTick(()=>{O=!1,Re()}),l("change",m.value)},setBalanced:i=>{he.value=i},isBalanced:()=>he.value,balance:()=>xa(),applyNodeStyle:(i,o)=>I(i,o),getNodeStyle:i=>J(i),applyNodeImage:(i,o)=>ee(i,o),applyNodeImageByUrl:(i,o)=>G(i,o),removeNodeImage:i=>ae(i),applyNodeLink:(i,o)=>ie(i,o),removeNodeLink:i=>fe(i),applyNodeNote:(i,o)=>x(i,o),removeNodeNote:i=>C(i),applyNodeRichContent:(i,o)=>M(i,o),undo:()=>Kt(),redo:()=>Yt(),canUndo:()=>Me.canUndo(),canRedo:()=>Me.canRedo(),applySettings:i=>{i.autoBalanceOnChange!==void 0&&(D.autoBalanceOnChange=i.autoBalanceOnChange),i.lineWidthStart!==void 0&&(D.lineWidthStart=Math.max(.5,Math.min(20,i.lineWidthStart))),i.lineWidthEnd!==void 0&&(D.lineWidthEnd=Math.max(.3,Math.min(10,i.lineWidthEnd))),i.rainbowBranch!==void 0&&(D.rainbowBranch=i.rainbowBranch),i.branchPaletteId!==void 0&&(D.branchPaletteId=i.branchPaletteId),i.customPalettes!==void 0&&(D.customPalettes=i.customPalettes),i.lineStyle!==void 0&&(D.lineStyle=i.lineStyle),i.taperedEdge!==void 0&&(D.taperedEdge=i.taperedEdge),i.showOrderBadge!==void 0&&(D.showOrderBadge=i.showOrderBadge)},getSettings:()=>({autoBalanceOnChange:D.autoBalanceOnChange,lineWidthStart:D.lineWidthStart,lineWidthEnd:D.lineWidthEnd,rainbowBranch:D.rainbowBranch,branchPaletteId:D.branchPaletteId,customPalettes:D.customPalettes,lineStyle:D.lineStyle,layoutMode:D.layoutMode,taperedEdge:D.taperedEdge,showOrderBadge:D.showOrderBadge}),setBranchPalette:i=>{if(!i)return;[...qe,...D.customPalettes].find(u=>u.id===i)&&(D.branchPaletteId=i)},getBranchPalette:()=>D.branchPaletteId,getBranchPalettes:()=>[...qe,...D.customPalettes]}),t.watch(()=>r.data,i=>{m.value=Te(i),te()},{deep:!1}),t.onMounted(()=>{ce(),t.nextTick(()=>Re())}),(i,o)=>{var u,w,E,_,T,V,j;return t.openBlock(),t.createElementBlock("div",{class:"zm-mindmap",style:t.normalizeStyle({background:_e.value.bgColor,fontSize:_e.value.fontSize+"px"})},[t.createElementVNode("div",{ref_key:"wrapperRef",ref:f,class:"zm-canvas",onMousedown:ha,onContextmenu:Ee,onWheel:o[25]||(o[25]=(...p)=>t.unref(F).onWheel&&t.unref(F).onWheel(...p)),onMouseenter:o[26]||(o[26]=p=>k.value=!0),onMouseleave:o[27]||(o[27]=p=>k.value=!1),onClick:ba},[t.createElementVNode("div",{class:"zm-svg-layer",style:t.normalizeStyle({left:be.value.vbX*t.unref(F).scale.value+t.unref(F).offsetX.value+"px",top:be.value.vbY*t.unref(F).scale.value+t.unref(F).offsetY.value+"px",width:be.value.vbW*t.unref(F).scale.value+"px",height:be.value.vbH*t.unref(F).scale.value+"px"})},[(t.openBlock(),t.createElementBlock("svg",{class:"zm-svg",viewBox:ta.value,preserveAspectRatio:"xMinYMin meet",width:be.value.vbW*t.unref(F).scale.value,height:be.value.vbH*t.unref(F).scale.value},[t.createElementVNode("g",xr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ea.value,p=>(t.openBlock(),t.createElementBlock("path",{key:p.key,d:Kr(gi(p.from,"out",p.to.side,p.to),gi(p.to,"in"),jn(p.from.depth),Jn(p.to.depth),32,D.lineStyle,p.to._dir),fill:Zr(p.from,p.to),stroke:"none"},null,8,kr))),128))])],8,Er))],4),t.unref(F).isMarquee.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"zm-marquee",style:t.normalizeStyle({left:t.unref(F).marquee.x*t.unref(F).scale.value+t.unref(F).offsetX.value+"px",top:t.unref(F).marquee.y*t.unref(F).scale.value+t.unref(F).offsetY.value+"px",width:t.unref(F).marquee.width*t.unref(F).scale.value+"px",height:t.unref(F).marquee.height*t.unref(F).scale.value+"px"})},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"zm-world",style:t.normalizeStyle({transform:`translate(${t.unref(F).offsetX.value}px, ${t.unref(F).offsetY.value}px) scale(${t.unref(F).scale.value})`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Gt.value,p=>(t.openBlock(),t.createElementBlock("div",{key:p.id,class:t.normalizeClass(["zm-node",{"is-root":p.isRoot,"is-selected":c.value===p.id,"is-editing":s.value===p.id,"has-image":!!p.image,"is-resizing":Ge.value===p.id}]),"data-node-id":p.id,style:t.normalizeStyle({left:p.x+"px",top:p.y+"px",width:p.width+"px",minWidth:p.width+"px",height:p.height+"px",fontSize:p.fontSize+"px",background:Xr(p),color:qr(p),borderColor:jr(p),fontWeight:Jr(p),transform:"translate(-50%, -50%)"}),onClick:K=>pa(K,p),onDblclick:K=>{K.stopPropagation(),e.previewMode||tt(p.id)},onContextmenu:K=>ne(K,p),onMouseenter:K=>U(p.id),onMouseleave:K=>Z(p.id)},[p.image?(t.openBlock(),t.createElementBlock("img",{key:0,class:"zm-node-img",src:p.image.src,width:p.image.width,height:p.image.height,alt:p.text,draggable:"false"},null,8,wr)):t.createCommentVNode("",!0),p.richContent&&(p.richContent.kind==="code"||p.richContent.kind==="table")&&s.value!==p.id?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["zm-rich zm-rich-above",{"zm-rich-no-overflow":p.richContent.kind==="table"||p.richContent.kind==="code"}]),onClick:o[1]||(o[1]=t.withModifiers(()=>{},["stop"])),onDblclick:t.withModifiers(K=>ia(p.id),["stop"]),onMousedown:o[2]||(o[2]=t.withModifiers(()=>{},["stop"]))},[y.value===p.id?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:0,"onUpdate:modelValue":o[0]||(o[0]=K=>N.value=K),class:"zm-rich-edit",spellcheck:"false",onBlur:oi,onKeydown:ra},null,544)),[[t.vModelText,N.value]]):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[p.richContent.kind==="code"?(t.openBlock(),t.createElementBlock("pre",Sr,[t.createElementVNode("code",{innerHTML:t.unref(pr)(t.unref(Zn)(p.richContent.raw),t.unref(Xn)(p.richContent.raw))},null,8,Mr)])):p.richContent.kind==="table"?(t.openBlock(),t.createElementBlock("table",Cr,[t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(la(p.id,t.unref(hr)(p.richContent.raw)),(K,Ne)=>(t.openBlock(),t.createElementBlock("tr",{key:Ne},[Ne===0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(K,(Ce,pe)=>{var nt,it,ot,rt,ve;return t.openBlock(),t.createElementBlock("th",{key:`h${pe}`,class:t.normalizeClass(["zm-rich-table-sort",{"is-sorted":((nt=h.value.get(p.id))==null?void 0:nt.col)===pe,"is-asc":((it=h.value.get(p.id))==null?void 0:it.col)===pe&&((ot=h.value.get(p.id))==null?void 0:ot.dir)==="asc","is-desc":((rt=h.value.get(p.id))==null?void 0:rt.col)===pe&&((ve=h.value.get(p.id))==null?void 0:ve.dir)==="desc"}]),onClick:t.withModifiers(hi=>aa(p.id,pe),["stop"])},[t.createElementVNode("span",null,t.toDisplayString(Ce),1),t.createElementVNode("span",Tr,t.toDisplayString(sa(p.id,pe)),1)],10,vr)}),128)):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(K,(Ce,pe)=>(t.openBlock(),t.createElementBlock("td",{key:`c${pe}`},t.toDisplayString(Ce),1))),128))]))),128))])])):t.createCommentVNode("",!0)],64))],42,_r)):t.createCommentVNode("",!0),s.value!==p.id?(t.openBlock(),t.createElementBlock("span",Ar,[t.createElementVNode("span",Rr,t.toDisplayString(p.text),1),p.link&&!s.value?(t.openBlock(),t.createElementBlock("a",{key:0,class:"zm-node-link",href:p.link.url,target:"_blank",rel:"noopener noreferrer",title:`打开链接:${p.link.url}`,onClick:o[3]||(o[3]=t.withModifiers(()=>{},["stop"])),onMousedown:o[4]||(o[4]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(q,{name:"link",size:11,stroke:2})],40,Or)):t.createCommentVNode("",!0),p.note&&!s.value?(t.openBlock(),t.createElementBlock("button",{key:1,class:"zm-node-note-btn",type:"button",title:Nt(p.note.text),onClick:t.withModifiers(K=>P(p.id),["stop"]),onMousedown:o[5]||(o[5]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(q,{name:"note",size:11,stroke:2})],40,Ir)):t.createCommentVNode("",!0)])):t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:3,class:"zm-input","onUpdate:modelValue":o[6]||(o[6]=K=>d.value=K),autofocus:"",onBlur:o[7]||(o[7]=K=>_t()),onKeydown:[o[8]||(o[8]=t.withKeys(t.withModifiers(K=>_t({addSibling:"after"}),["exact"]),["enter"])),o[9]||(o[9]=t.withKeys(t.withModifiers(K=>_t({addSibling:"before"}),["shift","prevent","exact"]),["enter"])),o[10]||(o[10]=t.withKeys(t.withModifiers(K=>_t({addChild:!0}),["prevent"]),["tab"])),t.withKeys(na,["esc"]),ca],onMousedown:o[11]||(o[11]=t.withModifiers(()=>{},["stop"])),onClick:o[12]||(o[12]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,d.value]]),R.value?(t.openBlock(),t.createElementBlock("span",{key:4,class:"zm-order-badge",title:`数据顺序:第 ${fi(p.id)+1} 个`},t.toDisplayString(fi(p.id)+1),9,Br)):t.createCommentVNode("",!0),ui(p.id)&&Zt(p.id)>0?(t.openBlock(),t.createElementBlock("span",{key:5,class:t.normalizeClass(["zm-collapse-badge",{"is-on-left":p.side===-1}]),style:t.normalizeStyle({background:$e.value.get(p.id)??"#64748b"}),title:`展开 ${Zt(p.id)} 个子节点`,onMousedown:o[13]||(o[13]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(K=>si(p.id),["stop"])},t.toDisplayString(Zt(p.id)),47,Lr)):t.createCommentVNode("",!0),Ea(p)&&!ui(p.id)?(t.openBlock(),t.createElementBlock("button",{key:6,class:t.normalizeClass(["zm-btn zm-collapse",{"is-on-left":p.side===-1}]),style:t.normalizeStyle({color:$e.value.get(p.id)??"#64748b",borderColor:$e.value.get(p.id)??"#64748b"}),title:"折叠",onMousedown:o[14]||(o[14]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(K=>si(p.id),["stop"])},[t.createVNode(q,{name:"minus",size:10,stroke:2.4})],46,Dr)):t.createCommentVNode("",!0),p.image&&c.value===p.id&&s.value!==p.id?(t.openBlock(),t.createElementBlock("span",{key:7,class:"zm-img-resize-handle",title:"拖动调整图片大小",onMousedown:t.withModifiers(K=>Ae(K,p),["stop"])},null,40,zr)):t.createCommentVNode("",!0),p.image&&c.value===p.id&&s.value!==p.id?(t.openBlock(),t.createElementBlock("button",{key:8,class:"zm-img-remove-btn",title:"移除图片",onMousedown:o[15]||(o[15]=t.withModifiers(()=>{},["stop"])),onClick:t.withModifiers(K=>ae(p.id),["stop"])},[t.createVNode(q,{name:"x",size:9,stroke:2.2})],40,$r)):t.createCommentVNode("",!0)],46,Nr))),128))],4),v.value?(t.openBlock(),t.createBlock(no,{key:1,x:v.value.x,y:v.value.y,container:f.value,"has-image":!!((u=t.unref(W)(m.value,v.value.nodeId))!=null&&u.image),"has-link":!!((w=t.unref(W)(m.value,v.value.nodeId))!=null&&w.link),"has-note":!!((E=t.unref(W)(m.value,v.value.nodeId))!=null&&E.note),"has-code":((T=(_=t.unref(W)(m.value,v.value.nodeId))==null?void 0:_.richContent)==null?void 0:T.kind)==="code","has-table":((j=(V=t.unref(W)(m.value,v.value.nodeId))==null?void 0:V.richContent)==null?void 0:j.kind)==="table",onPickImage:xt,onRemoveImage:We,onSetLink:Ut,onRemoveLink:Ht,onEditNote:Ft,onRemoveNote:Wt,onAddCode:Qe,onEditCode:Qe,onRemoveCode:ke,onAddTable:kt,onEditTable:kt,onRemoveTable:et,onClose:ge},null,8,["x","y","container","has-image","has-link","has-note","has-code","has-table"])):t.createCommentVNode("",!0),H.value?(t.openBlock(),t.createBlock(io,{key:2,x:H.value.x,y:H.value.y,container:f.value,onOpenData:yt,onOpenImport:Et,onOpenSettings:xe,onClose:me},null,8,["x","y","container"])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["zm-toolbar",{"is-preview-only":r.previewMode,"is-hovered":k.value}])},[t.createElementVNode("span",Pr,t.toDisplayString(Math.round(t.unref(F).scale.value*100))+"%",1),t.createElementVNode("button",{class:"zm-tb-btn",title:"放大",onClick:o[16]||(o[16]=(...p)=>t.unref(F).zoomIn&&t.unref(F).zoomIn(...p))},[t.createVNode(q,{name:"zoom-in"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"缩小",onClick:o[17]||(o[17]=(...p)=>t.unref(F).zoomOut&&t.unref(F).zoomOut(...p))},[t.createVNode(q,{name:"zoom-out"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"重置视图",onClick:Re},[t.createVNode(q,{name:"reset"})]),o[31]||(o[31]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"全部收起",onClick:ua},[t.createVNode(q,{name:"collapse-all"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"展开一级",onClick:o[18]||(o[18]=p=>di(1))},[t.createVNode(q,{name:"expand-level-1"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"展开二级",onClick:o[19]||(o[19]=p=>di(2))},[t.createVNode(q,{name:"expand-level-2"})]),t.createElementVNode("button",{class:"zm-tb-btn",title:"全部展开",onClick:fa},[t.createVNode(q,{name:"expand-all"})]),o[32]||(o[32]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"导出 JSON",onClick:Na},[t.createVNode(q,{name:"export"})]),r.previewMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[28]||(o[28]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"添加子节点 (Tab)",onClick:o[20]||(o[20]=p=>c.value&&Ze(c.value))},[t.createElementVNode("img",{src:t.unref(wi),width:"14",height:"14",alt:"添加子节点",draggable:"false"},null,8,Vr)]),t.createElementVNode("button",{class:"zm-tb-btn",title:"添加同级 (Enter)",onClick:o[21]||(o[21]=p=>c.value&&St(c.value))},[t.createElementVNode("img",{src:t.unref(Ni),width:"14",height:"14",alt:"添加同级",draggable:"false"},null,8,Ur)]),o[29]||(o[29]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:D.layoutMode==="mindmap"}]),title:"思维导图布局 (中心辐射)",onClick:o[22]||(o[22]=p=>Xt("mindmap"))},[t.createVNode(q,{name:"mindmap"})],2),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:D.layoutMode==="tree"}]),title:"树形布局 (向右展开)",onClick:o[23]||(o[23]=p=>Xt("tree"))},[t.createVNode(q,{name:"tree"})],2),t.createElementVNode("button",{class:t.normalizeClass(["zm-tb-btn",{active:D.layoutMode==="org"}]),title:"组织结构布局 (向下展开)",onClick:o[24]||(o[24]=p=>Xt("org"))},[t.createVNode(q,{name:"org"})],2),o[30]||(o[30]=t.createElementVNode("span",{class:"zm-tb-divider"},null,-1)),t.createElementVNode("button",{class:"zm-tb-btn",title:"导入 JSON",onClick:ka},[t.createVNode(q,{name:"import"})])],64))],2)],544)],4)}}}),Hr={install(e){e.component("FlowMindMap",qn)}};de.MindMap=qn,de.addChild=on,de.addSibling=rn,de.clone=Te,de.default=Hr,de.findNode=W,de.findParent=we,de.markdownToMindMap=Ot,de.markdownToRichMindMap=qi,de.mindMapToMarkdown=ut,de.removeNode=Rt,de.richBlockToMarkdown=ji,de.uid=Se,Object.defineProperties(de,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|