zen-gitsync 2.17.27 → 2.17.29
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/README.md +12 -8
- package/package.json +5 -1
- package/src/config.js +8 -0
- package/src/ui/public/assets/AgentEngineSelector-Wl7dKYKL.js +2 -0
- package/src/ui/public/assets/{AgentView-BaYMwfC4.css → AgentView-Bebv5xk6.css} +1 -1
- package/src/ui/public/assets/AgentView-CebQ3545.js +11 -0
- package/src/ui/public/assets/{AppVersionBadge-BVZKGETC.js → AppVersionBadge-jm8ejuZ-.js} +2 -2
- package/src/ui/public/assets/BranchSelector-CcNILIbg.js +1 -0
- package/src/ui/public/assets/CommitForm-1ocxo8Cb.js +6 -0
- package/src/ui/public/assets/CommonDialog-DpFTO5cg.js +1 -0
- package/src/ui/public/assets/EditorView-CtRHV1Sv.js +37 -0
- package/src/ui/public/assets/FileDiffViewer-DXJO-G55.js +15 -0
- package/src/ui/public/assets/{FlowExecutionViewer-Dp3ZiatT.js → FlowExecutionViewer-d4O5Y9Ca.js} +1 -1
- package/src/ui/public/assets/FlowOrchestrationWorkspace-CKLRMeaL.js +21 -0
- package/src/ui/public/assets/{IconButton-BburHRSR.js → IconButton-Dl1cdP_x.js} +1 -1
- package/src/ui/public/assets/LogList-CdDRC_CO.js +7 -0
- package/src/ui/public/assets/MindmapView-U84MWPHc.js +2 -0
- package/src/ui/public/assets/MonitorView-spOV0cP7.js +1 -0
- package/src/ui/public/assets/ProjectStartupButton-BbAbfFn2.js +1 -0
- package/src/ui/public/assets/{RecentDirectoriesChat-6OG0eOqz.js → RecentDirectoriesChat-CxNjjgVG.js} +2 -2
- package/src/ui/public/assets/RemoteManagerDialog-BVm2-Hn4.js +4 -0
- package/src/ui/public/assets/RemoteRepoCard-UHK_hrDS.js +7 -0
- package/src/ui/public/assets/SourceMapView-PHMr0wt3.js +3 -0
- package/src/ui/public/assets/{SvgIcon-22vrNtgL.js → SvgIcon-Dk7WnZLB.js} +1 -1
- package/src/ui/public/assets/TemplateManager-B3ZNTXnP.js +1 -0
- package/src/ui/public/assets/UserInputNode-DeAD7H0z.js +1 -0
- package/src/ui/public/assets/WorkbenchView-DsZ2ONpW.js +143 -0
- package/src/ui/public/assets/WorkbenchView-kZ8DoH2l.css +1 -0
- package/src/ui/public/assets/{_plugin-vue_export-helper-DRfZJqP7.js → _plugin-vue_export-helper-BKeZSroN.js} +5 -5
- package/src/ui/public/assets/{agentConversations-17Pw5IQJ.js → agentConversations-ChTc-LkQ.js} +5 -5
- package/src/ui/public/assets/configStore-fJaic3kE.js +1 -0
- package/src/ui/public/assets/{element-plus-AaVXaSqv.js → element-plus-D0R8BMj4.js} +1 -1
- package/src/ui/public/assets/{flow-mindmap-C22NSZc1.js → flow-mindmap-Doi70WWn.js} +52 -52
- package/src/ui/public/assets/gitStore-D9oF5nof.js +6 -0
- package/src/ui/public/assets/index-CKxygqdx.js +148 -0
- package/src/ui/public/assets/index-DVpFh9xE.css +1 -0
- package/src/ui/public/assets/{office-docx-CJ6JSCs6.js → office-docx-O0YXk5gA.js} +6 -6
- package/src/ui/public/assets/{office-excel-BOjWK-1x.js → office-excel-CXD9VwgB.js} +1 -1
- package/src/ui/public/assets/{office-pptx-CF43ZwXE.js → office-pptx-CiF2OlTq.js} +1 -1
- package/src/ui/public/assets/{previewSandbox-BOIpC6hW.js → previewSandbox-21uStCdd.js} +2 -2
- package/src/ui/public/assets/toolsStore-C89takm3.js +1 -0
- package/src/ui/public/assets/{useThemeObserver-CiUpR4zj.js → useThemeObserver-BvSA7RDh.js} +1 -1
- package/src/ui/public/assets/{vendor-viKaN257.js → vendor-CCrjQw5C.js} +12 -12
- package/src/ui/public/assets/vue-flow-5Aq2bwoG.js +39 -0
- package/src/ui/public/index.html +17 -17
- package/src/ui/server/routes/fs.js +12 -2
- package/src/ui/server/routes/workbench/agentMarketplace.js +130 -23
- package/src/ui/server/routes/workbench/agentMarketplace.test.js +68 -1
- package/src/ui/server/routes/workbench/envContext.js +69 -29
- package/src/ui/server/routes/workbench/envContext.test.js +68 -0
- package/src/ui/server/routes/workbench/index.js +10 -3
- package/src/ui/server/routes/workbench/taskRunner.js +11 -4
- package/src/ui/public/assets/AgentEngineSelector-BUZYAFe-.js +0 -2
- package/src/ui/public/assets/AgentView-BFSmHCq7.js +0 -10
- package/src/ui/public/assets/BranchSelector-DHWPodUA.js +0 -1
- package/src/ui/public/assets/CommitForm-OhIAOaq7.js +0 -6
- package/src/ui/public/assets/CommonDialog-BXR1wKBq.js +0 -1
- package/src/ui/public/assets/EditorView-8SLDYcaH.js +0 -37
- package/src/ui/public/assets/FileDiffViewer-CfMdcN2j.js +0 -15
- package/src/ui/public/assets/FlowOrchestrationWorkspace-D97DHgyy.js +0 -21
- package/src/ui/public/assets/LogList-gFCt4Zlu.js +0 -7
- package/src/ui/public/assets/MindmapView-N67x62Qk.js +0 -2
- package/src/ui/public/assets/MonitorView-BQr56ZSC.js +0 -1
- package/src/ui/public/assets/ProjectStartupButton-DuWf9Z0m.js +0 -1
- package/src/ui/public/assets/RemoteManagerDialog-DrR79IRj.js +0 -4
- package/src/ui/public/assets/RemoteRepoCard-BU6qOfoG.js +0 -7
- package/src/ui/public/assets/SourceMapView-Ba73NVs8.js +0 -3
- package/src/ui/public/assets/TemplateManager-C9CzSc6Y.js +0 -1
- package/src/ui/public/assets/UserInputNode-4m8zpMv9.js +0 -1
- package/src/ui/public/assets/WorkbenchView-B4F_TeL5.css +0 -1
- package/src/ui/public/assets/WorkbenchView-CcqEZ_GQ.js +0 -142
- package/src/ui/public/assets/configStore-Gzz89_z_.js +0 -1
- package/src/ui/public/assets/gitStore--fzrTf_y.js +0 -6
- package/src/ui/public/assets/index-C7Ad5BGO.css +0 -1
- package/src/ui/public/assets/index-EJrJOx7s.js +0 -142
- package/src/ui/public/assets/toolsStore-B3bFcRXP.js +0 -1
- package/src/ui/public/assets/vue-flow-DwYB6Myr.js +0 -39
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import{$n as e,An as t,Cn as n,Dn as r,En as i,
|
|
1
|
+
import{$n as e,An as t,Cn as n,Dn as r,En as i,Gn as a,Hn as o,Jr as s,Kr as c,Mn as l,Nr as u,Pn as d,Qn as f,Qr as p,Rn as m,Tn as h,Yn as g,Zn as _,_n as v,dr as y,gn as b,gr as x,hn as S,ir as C,jn as w,ln as T,or as E,qn as ee,sn as D,sr as O,vn as k,vr as A,wn as j,yn as M}from"./element-plus-D0R8BMj4.js";m(),y(),T(),u();var N=Object.defineProperty,te=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>te(e,typeof t==`symbol`?t:t+``,n),ne=d({__name:`Icon`,props:{name:{type:String,required:!0},size:{type:[Number,String],required:!1},stroke:{type:[Number,String],required:!1}},setup(e,{expose:t}){t();let n={};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),F=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},re=[`width`,`height`,`stroke-width`];function I(e,n,a,o,s,c){return g(),r(`svg`,{width:a.size??16,height:a.size??16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":a.stroke??1.8,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[i(` add: plus in circle `),a.name===`add`?(g(),r(M,{key:0},[n[0]||=j(`circle`,{cx:`12`,cy:`12`,r:`9`},null,-1),n[1]||=j(`line`,{x1:`12`,y1:`8`,x2:`12`,y2:`16`},null,-1),n[2]||=j(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1)],64)):a.name===`minus`?(g(),r(M,{key:1},[i(` minus `),n[3]||=j(`circle`,{cx:`12`,cy:`12`,r:`9`},null,-1),n[4]||=j(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1)],64)):a.name===`delete`?(g(),r(M,{key:2},[i(` delete: trash `),n[5]||=t(`<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)):a.name===`edit`?(g(),r(M,{key:3},[i(` edit: pencil `),n[6]||=j(`path`,{d:`M4 20 l4 -1 11 -11 -3 -3 -11 11 z`},null,-1),n[7]||=j(`line`,{x1:`14`,y1:`6`,x2:`18`,y2:`10`},null,-1)],64)):a.name===`collapse`?(g(),r(M,{key:4},[i(` collapse: chevron up/down (rotate via :transform) `),n[8]||=j(`polyline`,{points:`6 9 12 15 18 9`},null,-1)],64)):a.name===`expand`?(g(),r(M,{key:5},[i(` expand: chevron right `),n[9]||=j(`polyline`,{points:`9 6 15 12 9 18`},null,-1)],64)):a.name===`collapse-all`?(g(),r(M,{key:6},[i(` collapse-all: 4 diagonal arrows pointing INWARD to the\r
|
|
2
2
|
center (4,4) (20,4) (20,20) (4,20) → (10,10) (14,10)\r
|
|
3
|
-
(14,14) (10,14). Reads as "compress all to center". `),n[10]||=t(`<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)):a.name===`expand-all`?(
|
|
3
|
+
(14,14) (10,14). Reads as "compress all to center". `),n[10]||=t(`<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)):a.name===`expand-all`?(g(),r(M,{key:7},[i(` expand-all: mirror of collapse-all — 4 diagonal arrows\r
|
|
4
4
|
pointing OUTWARD from the center. Reads as "expand to\r
|
|
5
|
-
bounds". `),n[11]||=t(`<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)):a.name===`expand-level-1`?(
|
|
6
|
-
root centered at top, 3 children at the bottom row). `),n[12]||=t(`<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)):a.name===`expand-level-2`?(
|
|
5
|
+
bounds". `),n[11]||=t(`<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)):a.name===`expand-level-1`?(g(),r(M,{key:8},[i(` expand-level-1: 1 root dot + 3 children dots (2-level tree,\r
|
|
6
|
+
root centered at top, 3 children at the bottom row). `),n[12]||=t(`<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)):a.name===`expand-level-2`?(g(),r(M,{key:9},[i(` expand-level-2: 1 root + 3 children + 3 grandchildren\r
|
|
7
7
|
(3-level tree). Lines fan out from each child to its\r
|
|
8
|
-
single grandchild, giving a symmetric "tree" silhouette. `),n[13]||=t(`<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)):a.name===`zoom-in`?(
|
|
9
|
-
glyph: reads as "snap the canvas back into the frame". `),n[21]||=j(`polyline`,{points:`4 9 4 4 9 4`},null,-1),n[22]||=j(`polyline`,{points:`15 4 20 4 20 9`},null,-1),n[23]||=j(`polyline`,{points:`20 15 20 20 15 20`},null,-1),n[24]||=j(`polyline`,{points:`9 20 4 20 4 15`},null,-1)],64)):a.name===`database`?(
|
|
8
|
+
single grandchild, giving a symmetric "tree" silhouette. `),n[13]||=t(`<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)):a.name===`zoom-in`?(g(),r(M,{key:10},[i(` zoom in `),n[14]||=j(`circle`,{cx:`11`,cy:`11`,r:`7`},null,-1),n[15]||=j(`line`,{x1:`11`,y1:`8`,x2:`11`,y2:`14`},null,-1),n[16]||=j(`line`,{x1:`8`,y1:`11`,x2:`14`,y2:`11`},null,-1),n[17]||=j(`line`,{x1:`16`,y1:`16`,x2:`21`,y2:`21`},null,-1)],64)):a.name===`zoom-out`?(g(),r(M,{key:11},[i(` zoom out `),n[18]||=j(`circle`,{cx:`11`,cy:`11`,r:`7`},null,-1),n[19]||=j(`line`,{x1:`8`,y1:`11`,x2:`14`,y2:`11`},null,-1),n[20]||=j(`line`,{x1:`16`,y1:`16`,x2:`21`,y2:`21`},null,-1)],64)):a.name===`reset`?(g(),r(M,{key:12},[i(` reset: 4 corner brackets pointing inward — "fit to view"\r
|
|
9
|
+
glyph: reads as "snap the canvas back into the frame". `),n[21]||=j(`polyline`,{points:`4 9 4 4 9 4`},null,-1),n[22]||=j(`polyline`,{points:`15 4 20 4 20 9`},null,-1),n[23]||=j(`polyline`,{points:`20 15 20 20 15 20`},null,-1),n[24]||=j(`polyline`,{points:`9 20 4 20 4 15`},null,-1)],64)):a.name===`database`?(g(),r(M,{key:13},[i(` database: classic cylinder — reads as “view data / data\r
|
|
10
10
|
source”. Stroke-only; matches the other monoline\r
|
|
11
|
-
icons. `),n[25]||=j(`ellipse`,{cx:`12`,cy:`6`,rx:`7`,ry:`2.5`},null,-1),n[26]||=j(`path`,{d:`M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6`},null,-1),n[27]||=j(`path`,{d:`M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12`},null,-1)],64)):a.name===`settings`?(
|
|
11
|
+
icons. `),n[25]||=j(`ellipse`,{cx:`12`,cy:`6`,rx:`7`,ry:`2.5`},null,-1),n[26]||=j(`path`,{d:`M5 6 V18 C5 19.4 8 20.5 12 20.5 C16 20.5 19 19.4 19 18 V6`},null,-1),n[27]||=j(`path`,{d:`M5 12 C5 13.4 8 14.5 12 14.5 C16 14.5 19 13.4 19 12`},null,-1)],64)):a.name===`settings`?(g(),r(M,{key:14},[i(` settings: gear / cog — Lucide-style single-path gear with\r
|
|
12
12
|
a center hole. Reads as “settings / preferences” at any\r
|
|
13
|
-
size and stays crisp at 13 px. `),n[28]||=j(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`},null,-1),n[29]||=j(`circle`,{cx:`12`,cy:`12`,r:`3`},null,-1)],64)):a.name===`markdown`?(
|
|
14
|
-
logo mark. Clean and recognizable at small sizes. `),n[30]||=j(`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`},null,-1),n[31]||=j(`path`,{d:`M6 15 V9 L9 12 L12 9 V15`},null,-1),n[32]||=j(`path`,{d:`M15 15 V9 L18 12 V9 M15 12 L18 15`},null,-1)],64)):a.name===`txt`?(
|
|
15
|
-
Slightly different from 'note' (no folded corner). `),n[33]||=j(`rect`,{x:`5`,y:`3`,width:`14`,height:`18`,rx:`1.5`},null,-1),n[34]||=j(`line`,{x1:`8`,y1:`8`,x2:`16`,y2:`8`},null,-1),n[35]||=j(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1),n[36]||=j(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):a.name===`eye`?(
|
|
13
|
+
size and stays crisp at 13 px. `),n[28]||=j(`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`},null,-1),n[29]||=j(`circle`,{cx:`12`,cy:`12`,r:`3`},null,-1)],64)):a.name===`markdown`?(g(),r(M,{key:15},[i(` markdown: rounded rect with “M↓” — the standard Markdown\r
|
|
14
|
+
logo mark. Clean and recognizable at small sizes. `),n[30]||=j(`rect`,{x:`2`,y:`5`,width:`20`,height:`14`,rx:`2`},null,-1),n[31]||=j(`path`,{d:`M6 15 V9 L9 12 L12 9 V15`},null,-1),n[32]||=j(`path`,{d:`M15 15 V9 L18 12 V9 M15 12 L18 15`},null,-1)],64)):a.name===`txt`?(g(),r(M,{key:16},[i(` txt: a page with horizontal lines, reads as plain text.\r
|
|
15
|
+
Slightly different from 'note' (no folded corner). `),n[33]||=j(`rect`,{x:`5`,y:`3`,width:`14`,height:`18`,rx:`1.5`},null,-1),n[34]||=j(`line`,{x1:`8`,y1:`8`,x2:`16`,y2:`8`},null,-1),n[35]||=j(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1),n[36]||=j(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):a.name===`eye`?(g(),r(M,{key:17},[i(` eye: open eye -- used for the canvas preview toggle button.\r
|
|
16
16
|
Reads as "click to enter preview mode" (the eye is "open",\r
|
|
17
|
-
i.e. seeing the canvas in full). `),n[37]||=j(`path`,{d:`M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z`},null,-1),n[38]||=j(`circle`,{cx:`12`,cy:`12`,r:`3.2`},null,-1)],64)):a.name===`eye-off`?(
|
|
17
|
+
i.e. seeing the canvas in full). `),n[37]||=j(`path`,{d:`M2 12 C4 6 8 3 12 3 C16 3 20 6 22 12 C20 18 16 21 12 21 C8 21 4 18 2 12 Z`},null,-1),n[38]||=j(`circle`,{cx:`12`,cy:`12`,r:`3.2`},null,-1)],64)):a.name===`eye-off`?(g(),r(M,{key:18},[i(` eye-off: closed/slashed eye -- used for "exit preview"\r
|
|
18
18
|
in the same button slot. When the canvas is in preview\r
|
|
19
19
|
mode, the button shows this icon to signal "click to go\r
|
|
20
|
-
back to the editable view". `),n[39]||=j(`path`,{d:`M3 3 L21 21`},null,-1),n[40]||=j(`path`,{d:`M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2`},null,-1),n[41]||=j(`path`,{d:`M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3`},null,-1),n[42]||=j(`path`,{d:`M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1`},null,-1)],64)):a.name===`outline`?(
|
|
21
|
-
Reads as "click to show the outline / sidebar view". `),n[43]||=j(`rect`,{x:`4`,y:`3`,width:`16`,height:`18`,rx:`2`},null,-1),n[44]||=j(`line`,{x1:`8`,y1:`8`,x2:`16`,y2:`8`},null,-1),n[45]||=j(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1),n[46]||=j(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):a.name===`logo`?(
|
|
22
|
-
nodes — classic radial / hub-and-spoke silhouette. `),n[55]||=t(`<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)):a.name===`tree`?(
|
|
23
|
-
with right-angled lines — clearly reads as "expand right". `),n[56]||=t(`<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)):a.name===`org`?(
|
|
24
|
-
"export vector/SVG". `),n[73]||=j(`path`,{d:`M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z`},null,-1),n[74]||=j(`polyline`,{points:`14 3 14 7 18 7`},null,-1),n[75]||=j(`polyline`,{points:`8 14 6 16 8 18`},null,-1),n[76]||=j(`polyline`,{points:`14 14 16 16 14 18`},null,-1)],64)):a.name===`relation`?(
|
|
20
|
+
back to the editable view". `),n[39]||=j(`path`,{d:`M3 3 L21 21`},null,-1),n[40]||=j(`path`,{d:`M10.5 6.2 C11 6.1 11.5 6 12 6 C16 6 19.5 8.5 21 12 C20.4 13.2 19.6 14.3 18.7 15.2`},null,-1),n[41]||=j(`path`,{d:`M6.6 6.6 C4 8.2 2.7 10.2 2 12 C3 14.5 5.2 16.8 8 18.3 C9.2 19 10.6 19.4 12 19.4 C13.5 19.4 14.9 19 16.2 18.3`},null,-1),n[42]||=j(`path`,{d:`M9.5 9.5 C9.1 10.2 9 11.1 9 12 C9 13.7 9.8 15.2 11 16.1`},null,-1)],64)):a.name===`outline`?(g(),r(M,{key:19},[i(` outline: document with a list -- the left-drawer trigger.\r
|
|
21
|
+
Reads as "click to show the outline / sidebar view". `),n[43]||=j(`rect`,{x:`4`,y:`3`,width:`16`,height:`18`,rx:`2`},null,-1),n[44]||=j(`line`,{x1:`8`,y1:`8`,x2:`16`,y2:`8`},null,-1),n[45]||=j(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`},null,-1),n[46]||=j(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):a.name===`logo`?(g(),r(M,{key:20},[i(` mindmap logo: branched node `),i(` mindmap logo: branched node `),n[47]||=t(`<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)):a.name===`import`?(g(),r(M,{key:21},[i(` import: arrow down into tray `),n[48]||=j(`path`,{d:`M12 4 V15`},null,-1),n[49]||=j(`polyline`,{points:`7 10 12 15 17 10`},null,-1),n[50]||=j(`path`,{d:`M4 19 H20`},null,-1)],64)):a.name===`export`?(g(),r(M,{key:22},[i(` export: arrow up out of tray `),n[51]||=j(`path`,{d:`M12 15 V4`},null,-1),n[52]||=j(`polyline`,{points:`7 9 12 4 17 9`},null,-1),n[53]||=j(`path`,{d:`M4 19 H20`},null,-1)],64)):a.name===`balance`?(g(),r(M,{key:23},[i(` balance: two arrows pointing inward, suggesting even distribution `),n[54]||=t(`<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)):a.name===`mindmap`?(g(),r(M,{key:24},[i(` mindmap: central node with 4 diagonal branches to outer\r
|
|
22
|
+
nodes — classic radial / hub-and-spoke silhouette. `),n[55]||=t(`<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)):a.name===`tree`?(g(),r(M,{key:25},[i(` tree: root on the left, 3 children on the right, joined\r
|
|
23
|
+
with right-angled lines — clearly reads as "expand right". `),n[56]||=t(`<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)):a.name===`org`?(g(),r(M,{key:26},[i(` org: top-down hierarchy (1.html btnLayoutOrg) `),n[57]||=t(`<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)):a.name===`image`?(g(),r(M,{key:27},[i(` image: rectangle + sun + mountain, picture glyph `),n[58]||=j(`rect`,{x:`3`,y:`5`,width:`18`,height:`14`,rx:`2`},null,-1),n[59]||=j(`circle`,{cx:`9`,cy:`11`,r:`1.6`},null,-1),n[60]||=j(`polyline`,{points:`3 17 9 12 13 15 16 13 21 17`},null,-1)],64)):a.name===`x`?(g(),r(M,{key:28},[i(` x: simple cross `),n[61]||=j(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`},null,-1),n[62]||=j(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`},null,-1)],64)):a.name===`link`?(g(),r(M,{key:29},[i(` link: chain link glyph `),n[63]||=j(`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[64]||=j(`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)):a.name===`note`?(g(),r(M,{key:30},[i(` note: lined note / page `),n[65]||=j(`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[66]||=j(`line`,{x1:`8`,y1:`10`,x2:`16`,y2:`10`},null,-1),n[67]||=j(`line`,{x1:`8`,y1:`13`,x2:`16`,y2:`13`},null,-1),n[68]||=j(`line`,{x1:`8`,y1:`16`,x2:`13`,y2:`16`},null,-1)],64)):a.name===`search`?(g(),r(M,{key:31},[i(` search: magnifying glass `),n[69]||=j(`circle`,{cx:`11`,cy:`11`,r:`7`},null,-1),n[70]||=j(`line`,{x1:`16`,y1:`16`,x2:`21`,y2:`21`},null,-1)],64)):a.name===`json`?(g(),r(M,{key:32},[i(` json: curly braces — reads as "JSON data format". `),n[71]||=j(`path`,{d:`M8 4 C6 4 6 6 6 7 C6 8 5 8 5 9 C5 10 6 10 6 11 C6 12 6 14 8 14`},null,-1),n[72]||=j(`path`,{d:`M16 4 C18 4 18 6 18 7 C18 8 19 8 19 9 C19 10 18 10 18 11 C18 12 18 14 16 14`},null,-1)],64)):a.name===`svg-export`?(g(),r(M,{key:33},[i(` svg-export: document with angle brackets — reads as\r
|
|
24
|
+
"export vector/SVG". `),n[73]||=j(`path`,{d:`M6 3 h8 l4 4 v14 a1 1 0 0 1 -1 1 h-11 a1 1 0 0 1 -1 -1 v-15 a1 1 0 0 1 1 -1 z`},null,-1),n[74]||=j(`polyline`,{points:`14 3 14 7 18 7`},null,-1),n[75]||=j(`polyline`,{points:`8 14 6 16 8 18`},null,-1),n[76]||=j(`polyline`,{points:`14 14 16 16 14 18`},null,-1)],64)):a.name===`relation`?(g(),r(M,{key:34},[i(` relation: two nodes joined by a dashed curve — reads as\r
|
|
25
25
|
"联系 / relationship line" (XMind). `),n[77]||=j(`circle`,{cx:`5`,cy:`19`,r:`2.5`},null,-1),n[78]||=j(`circle`,{cx:`19`,cy:`5`,r:`2.5`},null,-1),n[79]||=j(`path`,{d:`M7 17 C 10 12, 14 12, 17 7`,"stroke-dasharray":`3 2.2`},null,-1)],64)):i(`v-if`,!0)],8,re)}var ie=F(ne,[[`render`,I],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/Icon.vue`]]),ae=`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`,oe=`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`,L=[22,15,13,12],se=[700,600,500,400],ce=[46,36,30,26],le=[120,80,60,44],ue=[.8,.8,.8,.8],de=L.length-1;function R(e,t){return Math.round(B(e,t)*ue[z(e)])}function z(e){return Math.min(de,Math.max(0,e))}function B(e,t=14){return Math.round(L[z(e)]*t/14*10)/10}function fe(e,t=14){return Math.round(ce[z(e)]*t/14)}var pe=60,me=30,he=.75,V=14,ge=24;function _e(e){return Math.max(me,Math.round(pe*he**+e))}var ve=null;function ye(){if(ve)return ve;let e=typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):null;return e?(ve=e,e):{font:``,measureText:()=>({width:0})}}var be=new Map;function xe(e,t,n){let r=`${n}|${t}|${e}`,i=be.get(r);if(i!==void 0)return i;let a=ye();a.font=`${n} ${t}px "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`;let o=e.split(`
|
|
26
26
|
`),s=0;for(let e of o){let t=a.measureText(e).width;t>s&&(s=t)}return be.set(r,s),s}var Se=24,Ce=400,we=8,Te=16,Ee=4,De=200;function Oe(e,t,n){return Math.min(n,Math.max(t,e))}function ke(e,t,n,r,i){let a=z(t),o=B(t,n),s=Math.min(xe(e.text||``,o,se[a]),De),c=R(t,n),l=Math.ceil(s+c*2+2),u=(e.text||``).split(`
|
|
27
27
|
`),d=0;for(let e of u){let t=xe(e,o,se[a]);d+=Math.max(1,Math.ceil(t/De))}d=Math.max(1,d);let f=!e.richContent||e.richContent.kind!==`code`&&e.richContent.kind!==`table`?fe(t,n)+Math.ceil(o*1.2*(d-1)):Math.ceil(o*1.2)+6+Math.ceil(o*1.2*(d-1)),p=0;if(e.link&&(p+=Te),e.note&&(p+=Te),p>0){let t=+!!e.link+ +!!e.note;p+=Ee*t}let m=0;e.markers&&e.markers.length>0&&(m=e.markers.length*14+(e.markers.length-1)*2+Ee);let h=e.tags&&e.tags.length>0?18:0,g=l+p+m,_=(()=>{let t=Math.round(le[a]*n/14);if(e.richContent&&(e.richContent.kind===`code`||e.richContent.kind===`table`)){let n=i?.[e.id];return Math.max(t,n??240)}return t})(),v=!(!e.richContent||e.richContent.kind!==`code`&&e.richContent.kind!==`table`),y=r?.[e.id],b=v?Math.max(24,y??Math.max(70,Math.ceil(o*5))):0,x=b>0?10:0;if(!e.image)return{w:Math.max(_,g),h:Math.ceil(f+x+b+(h>0?4+h:0))};let S=Oe(e.image.width,Se,Ce);return{w:Math.max(_,g,Math.ceil(S+c*2)),h:Math.ceil(e.image.height+we+f+x+b+(h>0?4+h:0))}}function Ae(e,t={}){let n=t.mode??`mindmap`,r=t.preservePositions===!0,i=t.baseFontSize??14,a=t.branchGap??0,o=Pe(e,0,null,1,`right`,i,t.richHeights,t.richWidths);return Fe(o,a),je(o,n,r,a),o.x=0,o.y=0,Ie(o,r)}function je(e,t,n=!1,r=0){if(t===`mindmap`){let t=e.children;if(t.length!==0){if(t.length===1)t[0]._dir=`right`,t[0].side=1,t[0]._dirRight=1;else{let e=t.reduce((e,t)=>e+t._subtreeH,0),n=1,r=Math.abs(t[0]._subtreeH-(e-t[0]._subtreeH)),i=0;for(let a=0;a<t.length-1;a++){i+=t[a]._subtreeH;let o=Math.abs(i-(e-i));o<r&&(r=o,n=a+1)}for(let e=0;e<n;e++)t[e]._dir=`right`,t[e].side=1,t[e]._dirRight=1;for(let e=n;e<t.length;e++)t[e]._dir=`left`,t[e].side=-1,t[e]._dirRight=-1}}let i=e.children.filter(e=>e.side===1),a=e.children.filter(e=>e.side===-1),o=(e,t)=>{let n=t===`right`?1:-1;e._dir=t,e.side=n,e._dirRight=n;for(let n of e.children)o(n,t)};for(let e of i)o(e,`right`);for(let e of a)o(e,`left`);i.length>0&&Me({...e,children:i},`right`,pe,!0,n,r),a.length>0&&Me({...e,children:a},`left`,pe,!0,n,r)}else if(t===`tree`){let t=e=>{e.side=1,e._dir=`right`;for(let n of e.children)t(n)};for(let t of e.children)t._dir=`right`;Me(e,`right`,pe,!0,n,r),t(e)}else{for(let t of e.children)t._dir=`down`;Ne(e,pe,n,r)}}function Me(e,t,n,r,i=!1,a=0){if(e.children.length===0)return;let o=r?V+a:V,s=e.children.reduce((e,t,n)=>e+t._subtreeH+(n>0?o:0),0),c=t===`right`?1:-1,l=r?c:1,u=e.y-l*s/2,d=_e(e.depth);e.children.forEach(r=>{i||(r.x=e.x+c*(e.width/2+d+r.width/2),r.y=u+l*r._subtreeH/2),r._dir=t,u+=l*(r._subtreeH+o),Me(r,t,n,!1,i,0)})}function Ne(e,t,n=!1,r=0){if(e.children.length===0)return;let i=e.depth===0?V+r:V,a=e.children.reduce((e,t,n)=>e+t._subtreeW+(n>0?i*2:0),0),o=e.x-a/2,s=_e(e.depth);e.children.forEach(r=>{n||(r.x=o+r._subtreeW/2,r.y=e.y+e.height/2+s+r.height/2),r._dir=`down`,o+=r._subtreeW+i*2,Ne(r,t,n,0)})}function Pe(e,t,n,r,i,a,o,s){let c=ke(e,t,a,o,s),l={id:e.id,text:e.text,depth:t,x:e._x??0,y:e._y??0,width:c.w,height:c.h,fontSize:B(t,a),isRoot:t===0,collapsed:e.collapsed,side:r,_dir:i,_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,markers:e.markers?[...e.markers]:void 0,tags:e.tags?[...e.tags]:void 0,children:[],parent:n};if(e.collapsed)return l;let u=e.children.length,d=Math.ceil(u/2);return l.children=e.children.map((e,n)=>{let c=t===0?n<d?1:-1:r;return Pe(e,t+1,l,c,i,a,o,s)}),l}function Fe(e,t=0){let n=[e];for(let e=0;e<n.length;e++){let t=n[e];for(let e of t.children)n.push(e)}for(let e=n.length-1;e>=0;e--){let r=n[e];if(r.collapsed||r.children.length===0){r._subtreeH=r.height,r._subtreeW=r.width;continue}let i=r.depth===0?V+t:V,a=0,o=0;for(let e of r.children)a+=e._subtreeH,o+=e._subtreeW;r.children.length>1&&(a+=i*(r.children.length-1),o+=i*2*(r.children.length-1)),r._subtreeH=Math.max(r.height,a),r._subtreeW=Math.max(r.width,o)}}function Ie(e,t=!1){let n=[e],r=1/0,i=-1/0,a=1/0,o=-1/0;for(;n.length;){let e=n.pop(),t=e.width/2,s=e.height/2;e.x-t<r&&(r=e.x-t),e.x+t>i&&(i=e.x+t),e.y-s<a&&(a=e.y-s),e.y+s>o&&(o=e.y+s),n.push(...e.children)}if(t)return{root:e,width:i-r+48,height:o-a+48,vbX:r-ge,vbY:a-ge,vbW:i-r+48,vbH:o-a+48};let s=ge-a,c=[e];for(;c.length;){let e=c.pop();e.y+=s,c.push(...e.children)}return a+=s,o+=s,{root:e,width:i-r+48,height:o+ge,vbX:r-ge,vbY:0,vbW:i-r+48,vbH:o+ge}}var Le=[{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 Re(e,t=[]){return[...Le,...t].find(t=>t.id===e)??Le[0]}function ze(e,t=8){let n=[],r=new Set,i=/#[0-9a-fA-F]{3,8}\b|rgba?\([^)]+\)|[A-Za-z][A-Za-z0-9_-]{2,30}/g,a;for(;(a=i.exec(e))!==null;){let e=a[0],i=null;if(i=e.startsWith(`#`)?Be(e):e.startsWith(`rgb`)?Ve(e):He[e.toLowerCase()]??null,!i)continue;let o=i.toLowerCase();if(!r.has(o)&&(r.add(o),n.push(o),n.length>=t))break}return n}function Be(e){let t=e.startsWith(`#`)?e.slice(1):e;if(!/^[0-9a-fA-F]+$/.test(t))return null;let n;if(t.length===3)n=t.split(``).map(e=>e+e).join(``);else if(t.length===4)n=t.slice(0,3).split(``).map(e=>e+e).join(``);else if(t.length===6)n=t;else if(t.length===8)n=t.slice(0,6);else return null;return`#`+n.toLowerCase()}function Ve(e){let t=e.match(/^rgba?\(\s*([^)]+?)\s*\)$/i);if(!t)return null;let n=t[1].split(/\s*,\s*/);if(n.length<3)return null;let r=[];for(let e=0;e<3;e++){let t=n[e];if(t.endsWith(`%`)){let e=parseFloat(t);if(!isFinite(e))return null;r.push(Math.round(e/100*255))}else{let e=parseInt(t,10);if(!isFinite(e)||e<0||e>255)return null;r.push(e)}}return`#`+r.map(e=>e.toString(16).padStart(2,`0`)).join(``).toLowerCase()}var He={black:`#000000`,white:`#ffffff`,red:`#ff0000`,green:`#008000`,blue:`#0000ff`,yellow:`#ffff00`,cyan:`#00ffff`,magenta:`#ff00ff`,gray:`#808080`,grey:`#808080`,silver:`#c0c0c0`,maroon:`#800000`,olive:`#808000`,lime:`#00ff00`,aqua:`#00ffff`,teal:`#008080`,navy:`#000080`,fuchsia:`#ff00ff`,purple:`#800080`,orange:`#ffa500`,pink:`#ffc0cb`,brown:`#a52a2a`,gold:`#ffd700`,coral:`#ff7f50`,tomato:`#ff6347`,salmon:`#fa8072`,khaki:`#f0e68c`,violet:`#ee82ee`,indigo:`#4b0082`,turquoise:`#40e0d0`,chocolate:`#d2691e`,crimson:`#dc143c`,darkred:`#8b0000`,darkblue:`#00008b`,darkgreen:`#006400`,darkgray:`#a9a9a9`,darkgrey:`#a9a9a9`,lightgray:`#d3d3d3`,lightgrey:`#d3d3d3`,lightblue:`#add8e6`,lightgreen:`#90ee90`,lightyellow:`#ffffe0`,lightpink:`#ffb6c1`,skyblue:`#87ceeb`,forestgreen:`#228b22`,royalblue:`#4169e1`,steelblue:`#4682b4`,hotpink:`#ff69b4`,deeppink:`#ff1493`,orangered:`#ff4500`,goldenrod:`#daa520`,mediumpurple:`#9370db`};function Ue(){return`n_`+Math.random().toString(36).slice(2,10)+Date.now().toString(36).slice(-4)}function H(e){return JSON.parse(JSON.stringify(e))}function U(e,t){if(e.id===t)return e;for(let n of e.children){let e=U(n,t);if(e)return e}return null}function We(e,t,n=null){if(e.id===t)return n;for(let n of e.children){let r=We(n,t,e);if(r!==null)return r}return null}function Ge(e,t){let n=e.children.findIndex(e=>e.id===t);if(n>=0)return e.children.splice(n,1),!0;for(let n of e.children)if(Ge(n,t))return!0;return!1}function Ke(e,t,n){let r=U(e,t);return!r||r.text===n?!1:(r.text=n,!0)}function qe(e,t,n,r){if(!We(e,t)||t===n||U(U(e,t),n))return!1;let i=We(e,t),a=i.children.findIndex(e=>e.id===t);if(a<0)return!1;let[o]=i.children.splice(a,1);if(r===`child`){let t=U(e,n);return t?(t.children.push(o),!0):(i.children.splice(a,0,o),!1)}let s=We(e,n);if(!s)return i.children.splice(a,0,o),!1;let c=s.children.findIndex(e=>e.id===n);return c<0?(i.children.splice(a,0,o),!1):(r===`after`&&(c+=1),s.children.splice(c,0,o),!0)}function Je(e){let t=/^新节点(?:\s+(\d+))?$/,n=0,r=!1;for(let i of e.children){let e=i.text.match(t);if(e){if(e[1]){let t=parseInt(e[1],10);t>n&&(n=t)}else r=!0}}return n===0&&!r?tt:n>0?`新节点 ${n+1}`:`新节点 2`}function Ye(e,t,n){let r=U(e,t);if(!r)return null;let i={id:Ue(),text:n??Je(r),children:[]};return r.children.push(i),i}function Xe(e,t,n){let r=We(e,t);if(!r)return null;let i=r.children.findIndex(e=>e.id===t);if(i<0)return null;let a={id:Ue(),text:n??Je(r),children:[]};return r.children.splice(i+1,0,a),a}function Ze(e,t,n){let r=We(e,t);if(!r)return null;let i=r.children.findIndex(e=>e.id===t);if(i<0)return null;let a={id:Ue(),text:n,children:[]};return r.children.splice(i,0,a),a}function Qe(e,t){let n=We(e,t);if(!n)return null;let r=n.children.findIndex(e=>e.id===t);if(r<0)return null;let i=n.children[r],a=H(i);return $e(a),n.children.splice(r+1,0,a),a}function $e(e){e.id=Ue();for(let t of e.children)$e(t)}function W(e,t){let n=U(e,t);if(!n||n.id===e.id)return null;let r=H(n);return $e(r),r}function et(e){return e.children.reduce((e,t)=>e+1+et(t),0)}var tt=`新节点`;function nt(e){return e.relations||=[],e.relations}function rt(e,t){return e.relations?.find(e=>e.id===t)??null}function it(e,t,n){if(t===n||!U(e,t)||!U(e,n))return null;let r=nt(e);if(r.some(e=>e.fromId===t&&e.toId===n))return null;let i={id:Ue(),fromId:t,toId:n};return r.push(i),i}function at(e,t){let n=e.relations;if(!n)return!1;let r=n.findIndex(e=>e.id===t);return r<0?!1:(n.splice(r,1),!0)}function ot(e,t,n){let r=rt(e,t);return r?(Object.assign(r,n),!0):!1}function st(e,t,n,r){var i;let a=rt(e,t);if(!a||!U(e,r)||r===(n===`from`?a.toId:a.fromId))return!1;let o=n===`from`?r:a.fromId,s=n===`to`?r:a.toId;return(i=e.relations)!=null&&i.some(e=>e.id!==t&&e.fromId===o&&e.toId===s)?!1:(n===`from`?(a.fromId=r,delete a.fromT):(a.toId=r,delete a.toT),delete a.c1,delete a.c2,!0)}function ct(e,t){let n=e.relations;if(!n||n.length===0)return 0;let r=n.length;return e.relations=n.filter(e=>e.fromId!==t&&e.toId!==t),r-e.relations.length}function lt(e,t=`导入的导图`){let n=e.split(/\r?\n/),r={id:Ue(),text:t,children:[]},i=[r],a=[-1/0],o=[],s=/^(#{1,6})\s+(.+?)\s*#*\s*$/,c=/^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,l=/^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/,u=/^(`{3,}|~{3,})\s*(\S+)?\s*$/,d=!1,f=[],p=null;function m(e){f.push(e)}function h(){if(p&&f.length>0){for(;f.length>0&&f[0].trim()===``;)f.shift();for(;f.length>0&&f[f.length-1].trim()===``;)f.pop();let e=f.join(`
|
|
@@ -35,15 +35,15 @@ import{$n as e,An as t,Cn as n,Dn as r,En as i,Fr as a,Jn as o,Jr as s,Kn as c,M
|
|
|
35
35
|
`)[0]?.slice(0,80)||`(空代码块)`,raw:s.join(`
|
|
36
36
|
`),lang:o});continue}let u=e.match(i);if(u){n.push({kind:`heading`,level:u[1].length,text:u[2].trim(),raw:e}),r++;continue}if(/^\s*\|/.test(e)){let e=[],i=r,a=!1;for(;i<t.length&&/^\s*\|/.test(t[i]);)e.push(t[i]),o.test(t[i])&&(a=!0),i++;if(a&&e.length>=2){n.push({kind:`table`,text:e[0].replace(/^\s*\|/,``).replace(/\|\s*$/,``).split(`|`)[0]?.trim()||`表格`,raw:e.join(`
|
|
37
37
|
`)}),r=i;continue}}let d=e.match(s),f=e.match(c);if(d||f){let e=r;for(;e<t.length;){let r=t[e].match(s),i=t[e].match(c);if(!(r||i))break;let a=t[e].replace(/^\s*[-*+]\s+/,``).replace(/^\s*\d+\.\s+/,``).trim();a.length>0&&n.push({kind:`list`,text:a.slice(0,80)||`(列表项)`,raw:t[e]}),e++}r=e;continue}if(e.trim()===``){r++;continue}let p=[e],m=r+1;for(;m<t.length;){let e=t[m];if(e.trim()===``||i.test(e)||a.test(e)||s.test(e)||c.test(e)||/^\s*\|/.test(e))break;p.push(e),m++}let h=p.join(` `).trim();n.push({kind:`paragraph`,text:h.slice(0,80)||`(空段落)`,raw:p.join(`
|
|
38
|
-
`)}),r=m}return n}function ft(e,t=`导入的导图`){let n=dt(e||``),r={id:Ue(),text:t,children:[]},i=[r],a=[0],o=!1;function s(e){if(e.kind===`heading`){let t=e.level;for(;i.length>1&&a[a.length-1]>=t;)i.pop(),a.pop();if(!o&&t===1){o=!0,r.text=e.text,a[0]=1;return}let n={id:Ue(),text:e.text,children:[]};i[i.length-1].children.push(n),i.push(n),a.push(t);return}let t={id:Ue(),text:e.text,children:[],richContent:{kind:e.kind,raw:e.raw,lang:e.lang}};i[i.length-1].children.push(t)}for(let e of n)s(e);return r}function pt(e){let t=e.minScale??.2,n=e.maxScale??1/0,r=e.step??1.2,i=v(1),a=v(0),o=v(0),s=v(!1),c=v(!1),l=A({x:0,y:0,ox:0,oy:0}),u=v(!1),d=A({x:0,y:0}),f=A({x:0,y:0,width:0,height:0}),p=v(0),m=null;function h(e){m=e}function g(r){r.preventDefault();let s=e.getContainer();if(!s)return;let c=-r.deltaY*.001,l=Math.min(n,Math.max(t,i.value*(1+c))),u=s.getBoundingClientRect(),d=r.clientX-u.left,f=r.clientY-u.top,p=(d-a.value)/i.value,m=(f-o.value)/i.value;i.value=l,a.value=d-p*l,o.value=f-m*l}function _(){i.value=Math.min(n,i.value*r)}function y(){i.value=Math.max(t,i.value/r)}function b(e){var t;e.target.closest(`.zm-node, .zm-toolbar, button, input, textarea`)||(s.value=!0,c.value=!1,l.x=e.clientX,l.y=e.clientY,l.ox=a.value,l.oy=o.value,window.addEventListener(`mousemove`,x),window.addEventListener(`mouseup`,S),(t=e.preventDefault)==null||t.call(e))}function x(e){if(!s.value)return;let t=e.clientX-l.x,n=e.clientY-l.y;(Math.abs(t)>3||Math.abs(n)>3)&&(c.value=!0),a.value=l.ox+t,o.value=l.oy+n}function S(){s.value=!1,window.removeEventListener(`mousemove`,x),window.removeEventListener(`mouseup`,S)}function C(e,t,n){u.value=!0,d.x=e,d.y=t,f.x=e,f.y=t,f.width=0,f.height=0,f.shiftKey=!!(n!=null&&n.shift),p.value++,window.addEventListener(`mousemove`,E),window.addEventListener(`mouseup`,T)}function w(e,t){if(!u.value)return;let n=Math.min(d.x,e),r=Math.min(d.y,t),i=Math.max(d.x,e),a=Math.max(d.y,t);f.x=n,f.y=r,f.width=i-n,f.height=a-r,p.value++}function T(){u.value=!1,window.removeEventListener(`mousemove`,E),window.removeEventListener(`mouseup`,T),m&&m()}function E(t){if(!u.value)return;let n=e.getContainer();if(!n)return;let r=n.getBoundingClientRect();w((t.clientX-r.left-a.value)/i.value,(t.clientY-r.top-o.value)/i.value)}function D(t,n,r,s=60){let c=e.getContainer();if(!c)return;let l=c.getBoundingClientRect(),u=(l.width-s*2)/t,d=(l.height-s*2)/n,f=Math.min(1,Math.max(.3,Math.min(u,d)));i.value=f,a.value=l.width/2,o.value=l.height/2-r*f}function ee(){let t=e.getContainer();if(!t)return;let n=t.getBoundingClientRect(),r=n.width/2,s=n.height/2,c=(r-a.value)/i.value,l=(s-o.value)/i.value;i.value=1,a.value=r-c,o.value=s-l}function O(t,r,s,c,l=80){let u=e.getContainer();if(!u)return;let d=u.getBoundingClientRect(),f=i.value;(s*f<40||c*f<40)&&(f=Math.min(n,Math.max(1,60/Math.min(s,c)))),i.value=f,a.value=d.width/2-t*f,o.value=d.height/2-r*f}return{scale:i,offsetX:a,offsetY:o,isPanning:s,panMoved:c,onWheel:g,zoomIn:_,zoomOut:y,zoomTo100:ee,startPan:b,startMarquee:C,updateMarquee:w,isMarquee:u,marquee:f,marqueeVersion:p,setOnMarqueeEnd:h,resetView:D,centerOn:O}}var mt=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function ht(e){return mt?e.metaKey:e.ctrlKey}function gt(e){function t(){let t=e.getSelectedId();if(t)return t;if(e.defaultTargetId)return e.defaultTargetId();let n=e.getSelectedIds();return n.length>0?n[0]:null}function n(n){let r=n.target;if(r&&(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.isContentEditable)||e.isReadonly()||e.isEditing())return;let i=e.getSelectedId(),a=t();if(a){if(ht(n)&&!n.shiftKey){if(n.key===`d`||n.key===`D`){let t=e.defaultTargetId?.call(e);i&&i!==t&&(n.preventDefault(),e.onDuplicate(i));return}if(n.key===`c`||n.key===`C`){let t=e.getSelectedIds();t.length>0&&(n.preventDefault(),e.onCopy(t));return}if(n.key===`x`||n.key===`X`){let t=e.getSelectedIds();t.length>0&&(n.preventDefault(),e.onCut(t));return}if(n.key===`v`||n.key===`V`){if(!e.hasClipboard())return;n.preventDefault();let t=e.getSelectedIds();e.onPaste(t.length>0?t[0]:null);return}if(n.key===`z`||n.key===`Z`){n.preventDefault(),e.onUndo();return}if(n.key===`y`||n.key===`Y`){n.preventDefault(),e.onRedo();return}if(n.key===`Home`){n.preventDefault(),e.onSelectRoot();return}}if(ht(n)&&n.shiftKey&&(n.key===`Z`||n.key===`z`)){n.preventDefault(),e.onRedo();return}if(n.key===`Tab`)n.preventDefault(),e.onAddChild(a);else if(n.key===`Enter`){if(n.preventDefault(),n.shiftKey){let t=e.defaultTargetId?.call(e);i&&i!==t&&e.onAddSiblingBefore(i)}else e.onAddSibling(a)}else if((n.key===`Delete`||n.key===`Backspace`)&&i&&i!==e.defaultTargetId?.call(e))n.preventDefault(),e.onRemove(i);else if(n.key===`F2`&&i)n.preventDefault(),e.onStartEdit(i);else if(n.key===` `&&i)n.preventDefault(),e.onStartEdit(i);else if(n.key===`Escape`)n.preventDefault(),e.onClearSelection();else if(n.altKey&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey){if(n.key===`ArrowUp`){n.preventDefault(),e.onMoveSibling(-1);return}if(n.key===`ArrowDown`){n.preventDefault(),e.onMoveSibling(1);return}}else n.key===`ArrowDown`?(n.preventDefault(),e.onNavigate(0,1)):n.key===`ArrowUp`?(n.preventDefault(),e.onNavigate(0,-1)):n.key===`ArrowRight`?(n.preventDefault(),e.onNavigate(1,0)):n.key===`ArrowLeft`&&(n.preventDefault(),e.onNavigate(-1,0))}}o(()=>{window.addEventListener(`keydown`,n)}),c(()=>{window.removeEventListener(`keydown`,n)})}function _t(e=100){let t=v([]),n=-1;function r(){return n>0}function i(){return n<t.value.length-1}function a(r){let i=JSON.stringify(r);for(n<t.value.length-1&&(t.value=t.value.slice(0,n+1)),t.value.push(i),n=t.value.length-1;t.value.length>e;)t.value.shift(),n--}function o(){return r()?(n--,JSON.parse(t.value[n])):null}function s(){return i()?(n++,JSON.parse(t.value[n])):null}function c(){t.value=[],n=-1}return{canUndo:r,canRedo:i,record:a,undo:o,redo:s,reset:c}}var vt={1:`#ef4444`,2:`#f97316`,3:`#f59e0b`,4:`#eab308`,5:`#84cc16`,6:`#22c55e`,7:`#14b8a6`,8:`#3b82f6`,9:`#6366f1`},yt={label:`优先级`,markers:Array.from({length:9},(e,t)=>{let n=t+1,r=vt[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${r}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function bt(e){if(e===0)return`<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>`;if(e===100)return`<circle cx="12" cy="12" r="10" fill="#22c55e"/>`;let t=e/100*2*Math.PI,n=12+10*Math.sin(t),r=12-10*Math.cos(t);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${+(e>50)} 1 ${n.toFixed(2)} ${r.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}var xt=[yt,{label:`进度`,markers:[0,25,50,75,100].map(e=>({id:`progress-${e}`,label:`进度 ${e}%`,svg:bt(e)}))},{label:`旗帜`,markers:[{id:`flag-red`,label:`红旗`,color:`#ef4444`},{id:`flag-orange`,label:`橙旗`,color:`#f97316`},{id:`flag-yellow`,label:`黄旗`,color:`#eab308`},{id:`flag-green`,label:`绿旗`,color:`#22c55e`},{id:`flag-blue`,label:`蓝旗`,color:`#3b82f6`},{id:`flag-gray`,label:`灰旗`,color:`#94a3b8`}].map(e=>({id:e.id,label:e.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${e.color}" stroke="${e.color}" stroke-width="1" stroke-linejoin="round"/>`}))},{label:`星标`,markers:[{id:`star`,label:`星标`,svg:`<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>`},{id:`star-half`,label:`半星`,svg:`<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>`}]},{label:`其他`,markers:[{id:`smile`,label:`微笑`,svg:`<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>`},{id:`people`,label:`人员`,svg:`<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>`},{id:`arrow-up`,label:`上箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`},{id:`arrow-down`,label:`下箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`},{id:`arrow-right`,label:`右箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`},{id:`arrow-left`,label:`左箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`}]}],St={};for(let e of xt)for(let t of e.markers)St[t.id]=t;function Ct(e){return St[e]?.svg??``}function wt(e){return St[e]?.label??e}function Tt(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;let n=Math.abs(t)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}var Et=u({__name:`NodeContextMenu`,props:{x:{type:Number,required:!0},y:{type:Number,required:!0},container:{type:null,required:!0},hasImage:{type:Boolean,required:!1,default:!1},hasLink:{type:Boolean,required:!1,default:!1},hasNote:{type:Boolean,required:!1,default:!1},hasCode:{type:Boolean,required:!1,default:!1},hasTable:{type:Boolean,required:!1,default:!1},nodeMarkers:{type:Array,required:!1,default:()=>[]},nodeTags:{type:Array,required:!1,default:()=>[]}},emits:[`pickImage`,`setLink`,`removeLink`,`editNote`,`removeNote`,`removeImage`,`addCode`,`editCode`,`removeCode`,`addTable`,`editTable`,`removeTable`,`toggleMarker`,`clearMarkers`,`addTag`,`removeTags`,`addRelation`,`close`],setup(e,{expose:t,emit:r}){t();let i=e,a=r,o=n(()=>{let e=i.x+2,t=i.y+2;if(i.container){let n=i.container.getBoundingClientRect(),r=4+(3+ +!!i.hasImage+ +!!i.hasLink+ +!!i.hasNote+1+ +!!i.hasCode+1+ +!!i.hasTable+1+ +(i.nodeTags.length>0)+1)*28;e+180>n.right&&(e=Math.max(n.left+4,i.x-180-2)),t+r>n.bottom&&(t=Math.max(n.top+4,i.y-r-2)),e<n.left+2&&(e=n.left+2),t<n.top+2&&(t=n.top+2)}return{left:e,top:t}}),s=n(()=>i.hasImage),l=n(()=>i.hasLink),u=n(()=>i.hasNote),d=n(()=>i.nodeMarkers.length>0),f=n(()=>i.nodeTags.length>0),p=v(!1);function m(){p.value=!p.value}function h(e){return i.nodeMarkers.includes(e)}function g(e){a(`toggleMarker`,e)}function _(e){let t=e.target;t&&t.closest(`.zm-node-menu`)||a(`close`)}function y(e){e.key===`Escape`&&a(`close`)}function b(){a(`close`)}window.addEventListener(`mousedown`,_,!0),window.addEventListener(`keydown`,y,!0),window.addEventListener(`wheel`,b,!0),window.addEventListener(`scroll`,b,!0),c(()=>{window.removeEventListener(`mousedown`,_,!0),window.removeEventListener(`keydown`,y,!0),window.removeEventListener(`wheel`,b,!0),window.removeEventListener(`scroll`,b,!0)});function x(e){e(),a(`close`)}let S={props:i,emit:a,clamped:o,hasImage:s,hasLink:l,hasNote:u,hasMarkers:d,hasTags:f,markerPickerOpen:p,toggleMarkerPicker:m,isMarkerActive:h,onMarkerClick:g,onWindowMouseDown:_,onWindowKey:y,onWindowScroll:b,run:x,Icon:ie,get MARKER_LIB(){return xt},get markerSvg(){return Ct}};return Object.defineProperty(S,"__isScriptSetup",{enumerable:!1,value:!0}),S}}),Dt={key:5,class:`zm-marker-picker`},Ot={class:`zm-marker-group-label`},kt={class:`zm-marker-grid`},At=[`title`,`onClick`,`innerHTML`];function jt(e,t,n,a,o,c){return h(),r(`div`,{class:`zm-node-menu`,style:g({left:a.clamped.left+`px`,top:a.clamped.top+`px`}),onContextmenu:t[14]||=k(()=>{},[`prevent`])},[j(`button`,{class:`zm-node-menu-item`,onClick:t[0]||=k(e=>a.run(()=>a.emit(`pickImage`)),[`stop`])},[l(a.Icon,{name:`image`,size:13}),j(`span`,null,b(a.hasImage?`替换图片`:`添加图片`),1)]),a.hasImage?(h(),r(`button`,{key:0,class:`zm-node-menu-item`,onClick:t[1]||=k(e=>a.run(()=>a.emit(`removeImage`)),[`stop`])},[l(a.Icon,{name:`x`,size:13}),t[15]||=j(`span`,null,`移除图片`,-1)])):i(`v-if`,!0),j(`button`,{class:`zm-node-menu-item`,onClick:t[2]||=k(e=>a.run(()=>a.emit(`setLink`)),[`stop`])},[l(a.Icon,{name:`link`,size:13}),j(`span`,null,b(a.hasLink?`编辑链接`:`添加链接`),1)]),a.hasLink?(h(),r(`button`,{key:1,class:`zm-node-menu-item`,onClick:t[3]||=k(e=>a.run(()=>a.emit(`removeLink`)),[`stop`])},[l(a.Icon,{name:`x`,size:13}),t[16]||=j(`span`,null,`移除链接`,-1)])):i(`v-if`,!0),j(`button`,{class:`zm-node-menu-item`,onClick:t[4]||=k(e=>a.run(()=>a.emit(`addCode`)),[`stop`])},[t[17]||=j(`span`,{class:`zm-node-menu-icon zm-node-menu-icon-code`,"aria-hidden":`true`},`{ }`,-1),j(`span`,null,b(n.hasCode?`编辑代码块`:`添加代码块`),1)]),n.hasCode?(h(),r(`button`,{key:2,class:`zm-node-menu-item`,onClick:t[5]||=k(e=>a.run(()=>a.emit(`removeCode`)),[`stop`])},[l(a.Icon,{name:`x`,size:13}),t[18]||=j(`span`,null,`移除代码块`,-1)])):i(`v-if`,!0),j(`button`,{class:`zm-node-menu-item`,onClick:t[6]||=k(e=>a.run(()=>a.emit(`addTable`)),[`stop`])},[t[19]||=j(`span`,{class:`zm-node-menu-icon zm-node-menu-icon-table`,"aria-hidden":`true`},`▦`,-1),j(`span`,null,b(n.hasTable?`编辑表格`:`添加表格`),1)]),n.hasTable?(h(),r(`button`,{key:3,class:`zm-node-menu-item`,onClick:t[7]||=k(e=>a.run(()=>a.emit(`removeTable`)),[`stop`])},[l(a.Icon,{name:`x`,size:13}),t[20]||=j(`span`,null,`移除表格`,-1)])):i(`v-if`,!0),j(`button`,{class:`zm-node-menu-item`,onClick:t[8]||=k(e=>a.run(()=>a.emit(`editNote`)),[`stop`])},[l(a.Icon,{name:`note`,size:13}),j(`span`,null,b(a.hasNote?`编辑笔记`:`添加笔记`),1)]),a.hasNote?(h(),r(`button`,{key:4,class:`zm-node-menu-item`,onClick:t[9]||=k(e=>a.run(()=>a.emit(`removeNote`)),[`stop`])},[l(a.Icon,{name:`x`,size:13}),t[21]||=j(`span`,null,`移除笔记`,-1)])):i(`v-if`,!0),t[27]||=j(`div`,{class:`zm-node-menu-divider`},null,-1),i(` Markers — expandable picker grid `),j(`button`,{class:`zm-node-menu-item`,onClick:k(a.toggleMarkerPicker,[`stop`])},[t[22]||=j(`span`,{class:`zm-node-menu-icon`,"aria-hidden":`true`},`⚑`,-1),t[23]||=j(`span`,null,`标记图标`,-1),j(`span`,{class:s([`zm-node-menu-arrow`,{"is-open":a.markerPickerOpen}])},`›`,2)]),a.markerPickerOpen?(h(),r(`div`,Dt,[(h(!0),r(M,null,d(a.MARKER_LIB,e=>(h(),r(`div`,{key:e.label,class:`zm-marker-group`},[j(`div`,Ot,b(e.label),1),j(`div`,kt,[(h(!0),r(M,null,d(e.markers,e=>(h(),r(`button`,{key:e.id,class:s([`zm-marker-cell`,{"is-active":a.isMarkerActive(e.id)}]),title:e.label,onClick:k(t=>a.onMarkerClick(e.id),[`stop`]),innerHTML:`<svg viewBox="0 0 24 24" width="20" height="20">`+a.markerSvg(e.id)+`</svg>`},null,10,At))),128))])]))),128)),a.hasMarkers?(h(),r(`button`,{key:0,class:`zm-marker-clear`,onClick:t[10]||=k(e=>a.emit(`clearMarkers`),[`stop`])},` 清除所有标记 `)):i(`v-if`,!0)])):i(`v-if`,!0),i(` Tags `),j(`button`,{class:`zm-node-menu-item`,onClick:t[11]||=k(e=>a.run(()=>a.emit(`addTag`)),[`stop`])},[t[24]||=j(`span`,{class:`zm-node-menu-icon`,"aria-hidden":`true`},`#`,-1),j(`span`,null,b(a.hasTags?`编辑标签`:`添加标签`),1)]),a.hasTags?(h(),r(`button`,{key:6,class:`zm-node-menu-item`,onClick:t[12]||=k(e=>a.run(()=>a.emit(`removeTags`)),[`stop`])},[l(a.Icon,{name:`x`,size:13}),t[25]||=j(`span`,null,`移除标签`,-1)])):i(`v-if`,!0),t[28]||=j(`div`,{class:`zm-node-menu-divider`},null,-1),i(` Relationship line ("联系") — enter creation mode with this\r
|
|
39
|
-
node as the first endpoint. `),j(`button`,{class:`zm-node-menu-item`,onClick:t[13]||=k(e=>a.run(()=>a.emit(`addRelation`)),[`stop`])},[l(a.Icon,{name:`relation`,size:13}),t[26]||=j(`span`,null,`添加联系`,-1)])],36)}var Mt=F(Et,[[`render`,jt],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/NodeContextMenu.vue`]]),Nt=
|
|
38
|
+
`)}),r=m}return n}function ft(e,t=`导入的导图`){let n=dt(e||``),r={id:Ue(),text:t,children:[]},i=[r],a=[0],o=!1;function s(e){if(e.kind===`heading`){let t=e.level;for(;i.length>1&&a[a.length-1]>=t;)i.pop(),a.pop();if(!o&&t===1){o=!0,r.text=e.text,a[0]=1;return}let n={id:Ue(),text:e.text,children:[]};i[i.length-1].children.push(n),i.push(n),a.push(t);return}let t={id:Ue(),text:e.text,children:[],richContent:{kind:e.kind,raw:e.raw,lang:e.lang}};i[i.length-1].children.push(t)}for(let e of n)s(e);return r}function pt(e){let t=e.minScale??.2,n=e.maxScale??1/0,r=e.step??1.2,i=A(1),a=A(0),o=A(0),s=A(!1),c=A(!1),l=x({x:0,y:0,ox:0,oy:0}),u=A(!1),d=x({x:0,y:0}),f=x({x:0,y:0,width:0,height:0}),p=A(0),m=null;function h(e){m=e}function g(r){r.preventDefault();let s=e.getContainer();if(!s)return;let c=-r.deltaY*.001,l=Math.min(n,Math.max(t,i.value*(1+c))),u=s.getBoundingClientRect(),d=r.clientX-u.left,f=r.clientY-u.top,p=(d-a.value)/i.value,m=(f-o.value)/i.value;i.value=l,a.value=d-p*l,o.value=f-m*l}function _(){i.value=Math.min(n,i.value*r)}function v(){i.value=Math.max(t,i.value/r)}function y(e){var t;e.target.closest(`.zm-node, .zm-toolbar, button, input, textarea`)||(s.value=!0,c.value=!1,l.x=e.clientX,l.y=e.clientY,l.ox=a.value,l.oy=o.value,window.addEventListener(`mousemove`,b),window.addEventListener(`mouseup`,S),(t=e.preventDefault)==null||t.call(e))}function b(e){if(!s.value)return;let t=e.clientX-l.x,n=e.clientY-l.y;(Math.abs(t)>3||Math.abs(n)>3)&&(c.value=!0),a.value=l.ox+t,o.value=l.oy+n}function S(){s.value=!1,window.removeEventListener(`mousemove`,b),window.removeEventListener(`mouseup`,S)}function C(e,t,n){u.value=!0,d.x=e,d.y=t,f.x=e,f.y=t,f.width=0,f.height=0,f.shiftKey=!!(n!=null&&n.shift),p.value++,window.addEventListener(`mousemove`,E),window.addEventListener(`mouseup`,T)}function w(e,t){if(!u.value)return;let n=Math.min(d.x,e),r=Math.min(d.y,t),i=Math.max(d.x,e),a=Math.max(d.y,t);f.x=n,f.y=r,f.width=i-n,f.height=a-r,p.value++}function T(){u.value=!1,window.removeEventListener(`mousemove`,E),window.removeEventListener(`mouseup`,T),m&&m()}function E(t){if(!u.value)return;let n=e.getContainer();if(!n)return;let r=n.getBoundingClientRect();w((t.clientX-r.left-a.value)/i.value,(t.clientY-r.top-o.value)/i.value)}function ee(t,n,r,s=60){let c=e.getContainer();if(!c)return;let l=c.getBoundingClientRect(),u=(l.width-s*2)/t,d=(l.height-s*2)/n,f=Math.min(1,Math.max(.3,Math.min(u,d)));i.value=f,a.value=l.width/2,o.value=l.height/2-r*f}function D(){let t=e.getContainer();if(!t)return;let n=t.getBoundingClientRect(),r=n.width/2,s=n.height/2,c=(r-a.value)/i.value,l=(s-o.value)/i.value;i.value=1,a.value=r-c,o.value=s-l}function O(t,r,s,c,l=80){let u=e.getContainer();if(!u)return;let d=u.getBoundingClientRect(),f=i.value;(s*f<40||c*f<40)&&(f=Math.min(n,Math.max(1,60/Math.min(s,c)))),i.value=f,a.value=d.width/2-t*f,o.value=d.height/2-r*f}return{scale:i,offsetX:a,offsetY:o,isPanning:s,panMoved:c,onWheel:g,zoomIn:_,zoomOut:v,zoomTo100:D,startPan:y,startMarquee:C,updateMarquee:w,isMarquee:u,marquee:f,marqueeVersion:p,setOnMarqueeEnd:h,resetView:ee,centerOn:O}}var mt=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform);function ht(e){return mt?e.metaKey:e.ctrlKey}function gt(e){function t(){let t=e.getSelectedId();if(t)return t;if(e.defaultTargetId)return e.defaultTargetId();let n=e.getSelectedIds();return n.length>0?n[0]:null}function n(n){let r=n.target;if(r&&(r.tagName===`INPUT`||r.tagName===`TEXTAREA`||r.isContentEditable)||e.isReadonly()||e.isEditing())return;let i=e.getSelectedId(),a=t();if(a){if(ht(n)&&!n.shiftKey){if(n.key===`d`||n.key===`D`){let t=e.defaultTargetId?.call(e);i&&i!==t&&(n.preventDefault(),e.onDuplicate(i));return}if(n.key===`c`||n.key===`C`){let t=e.getSelectedIds();t.length>0&&(n.preventDefault(),e.onCopy(t));return}if(n.key===`x`||n.key===`X`){let t=e.getSelectedIds();t.length>0&&(n.preventDefault(),e.onCut(t));return}if(n.key===`v`||n.key===`V`){if(!e.hasClipboard())return;n.preventDefault();let t=e.getSelectedIds();e.onPaste(t.length>0?t[0]:null);return}if(n.key===`z`||n.key===`Z`){n.preventDefault(),e.onUndo();return}if(n.key===`y`||n.key===`Y`){n.preventDefault(),e.onRedo();return}if(n.key===`Home`){n.preventDefault(),e.onSelectRoot();return}}if(ht(n)&&n.shiftKey&&(n.key===`Z`||n.key===`z`)){n.preventDefault(),e.onRedo();return}if(n.key===`Tab`)n.preventDefault(),e.onAddChild(a);else if(n.key===`Enter`){if(n.preventDefault(),n.shiftKey){let t=e.defaultTargetId?.call(e);i&&i!==t&&e.onAddSiblingBefore(i)}else e.onAddSibling(a)}else if((n.key===`Delete`||n.key===`Backspace`)&&i&&i!==e.defaultTargetId?.call(e))n.preventDefault(),e.onRemove(i);else if(n.key===`F2`&&i)n.preventDefault(),e.onStartEdit(i);else if(n.key===` `&&i)n.preventDefault(),e.onStartEdit(i);else if(n.key===`Escape`)n.preventDefault(),e.onClearSelection();else if(n.altKey&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey){if(n.key===`ArrowUp`){n.preventDefault(),e.onMoveSibling(-1);return}if(n.key===`ArrowDown`){n.preventDefault(),e.onMoveSibling(1);return}}else n.key===`ArrowDown`?(n.preventDefault(),e.onNavigate(0,1)):n.key===`ArrowUp`?(n.preventDefault(),e.onNavigate(0,-1)):n.key===`ArrowRight`?(n.preventDefault(),e.onNavigate(1,0)):n.key===`ArrowLeft`&&(n.preventDefault(),e.onNavigate(-1,0))}}ee(()=>{window.addEventListener(`keydown`,n)}),a(()=>{window.removeEventListener(`keydown`,n)})}function _t(e=100){let t=A([]),n=-1;function r(){return n>0}function i(){return n<t.value.length-1}function a(r){let i=JSON.stringify(r);for(n<t.value.length-1&&(t.value=t.value.slice(0,n+1)),t.value.push(i),n=t.value.length-1;t.value.length>e;)t.value.shift(),n--}function o(){return r()?(n--,JSON.parse(t.value[n])):null}function s(){return i()?(n++,JSON.parse(t.value[n])):null}function c(){t.value=[],n=-1}return{canUndo:r,canRedo:i,record:a,undo:o,redo:s,reset:c}}var vt={1:`#ef4444`,2:`#f97316`,3:`#f59e0b`,4:`#eab308`,5:`#84cc16`,6:`#22c55e`,7:`#14b8a6`,8:`#3b82f6`,9:`#6366f1`},yt={label:`优先级`,markers:Array.from({length:9},(e,t)=>{let n=t+1,r=vt[n];return{id:`priority-${n}`,label:`优先级 ${n}`,svg:`<circle cx="12" cy="12" r="10" fill="${r}"/><text x="12" y="16" text-anchor="middle" font-size="12" font-weight="700" fill="#fff" font-family="sans-serif">${n}</text>`}})};function bt(e){if(e===0)return`<circle cx="12" cy="12" r="10" fill="none" stroke="#94a3b8" stroke-width="2"/>`;if(e===100)return`<circle cx="12" cy="12" r="10" fill="#22c55e"/>`;let t=e/100*2*Math.PI,n=12+10*Math.sin(t),r=12-10*Math.cos(t);return`<circle cx="12" cy="12" r="10" fill="none" stroke="#e2e8f0" stroke-width="2"/><path d="M 12 12 L 12 2 A 10 10 0 ${+(e>50)} 1 ${n.toFixed(2)} ${r.toFixed(2)} Z" fill="#3b82f6"/><circle cx="12" cy="12" r="10" fill="none" stroke="#cbd5e1" stroke-width="1"/>`}var xt=[yt,{label:`进度`,markers:[0,25,50,75,100].map(e=>({id:`progress-${e}`,label:`进度 ${e}%`,svg:bt(e)}))},{label:`旗帜`,markers:[{id:`flag-red`,label:`红旗`,color:`#ef4444`},{id:`flag-orange`,label:`橙旗`,color:`#f97316`},{id:`flag-yellow`,label:`黄旗`,color:`#eab308`},{id:`flag-green`,label:`绿旗`,color:`#22c55e`},{id:`flag-blue`,label:`蓝旗`,color:`#3b82f6`},{id:`flag-gray`,label:`灰旗`,color:`#94a3b8`}].map(e=>({id:e.id,label:e.label,svg:`<path d="M6 3 V21" stroke="#475569" stroke-width="2" stroke-linecap="round"/><path d="M6 4 H18 L15 7 L18 10 H6 Z" fill="${e.color}" stroke="${e.color}" stroke-width="1" stroke-linejoin="round"/>`}))},{label:`星标`,markers:[{id:`star`,label:`星标`,svg:`<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="#f59e0b" stroke-width="1" stroke-linejoin="round"/>`},{id:`star-half`,label:`半星`,svg:`<path d="M12 2 L14.5 8.5 L21 9 L16 13.5 L17.5 20 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#e2e8f0" stroke="#f59e0b" stroke-width="1.5" stroke-linejoin="round"/><path d="M12 2 L12 16.5 L6.5 20 L8 13.5 L3 9 L9.5 8.5 Z" fill="#f59e0b" stroke="none"/>`}]},{label:`其他`,markers:[{id:`smile`,label:`微笑`,svg:`<circle cx="12" cy="12" r="10" fill="#fef3c7" stroke="#f59e0b" stroke-width="1.5"/><circle cx="9" cy="10" r="1.2" fill="#92400e"/><circle cx="15" cy="10" r="1.2" fill="#92400e"/><path d="M8 14 Q12 17 16 14" stroke="#92400e" stroke-width="1.5" fill="none" stroke-linecap="round"/>`},{id:`people`,label:`人员`,svg:`<circle cx="9" cy="8" r="2.5" fill="#3b82f6"/><circle cx="16" cy="8" r="2.5" fill="#3b82f6"/><path d="M4 19 C4 15 6 13 9 13 C12 13 14 15 14 19" fill="#3b82f6"/><path d="M14 19 C14 15.5 15.5 13.5 17.5 13.5 C19.5 13.5 21 15.5 21 19" fill="#3b82f6"/>`},{id:`arrow-up`,label:`上箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 17 V7 M8 11 L12 7 L16 11" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`},{id:`arrow-down`,label:`下箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M12 7 V17 M8 13 L12 17 L16 13" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`},{id:`arrow-right`,label:`右箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M7 12 H17 M13 8 L17 12 L13 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`},{id:`arrow-left`,label:`左箭头`,svg:`<circle cx="12" cy="12" r="10" fill="#dbeafe" stroke="#3b82f6" stroke-width="1.5"/><path d="M17 12 H7 M11 8 L7 12 L11 16" stroke="#3b82f6" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`}]}],St={};for(let e of xt)for(let t of e.markers)St[t.id]=t;function Ct(e){return St[e]?.svg??``}function wt(e){return St[e]?.label??e}function Tt(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;let n=Math.abs(t)%360;return{background:`hsl(${n}, 85%, 92%)`,borderColor:`hsl(${n}, 60%, 70%)`,color:`hsl(${n}, 55%, 30%)`}}var Et=d({__name:`NodeContextMenu`,props:{x:{type:Number,required:!0},y:{type:Number,required:!0},container:{type:null,required:!0},hasImage:{type:Boolean,required:!1,default:!1},hasLink:{type:Boolean,required:!1,default:!1},hasNote:{type:Boolean,required:!1,default:!1},hasCode:{type:Boolean,required:!1,default:!1},hasTable:{type:Boolean,required:!1,default:!1},nodeMarkers:{type:Array,required:!1,default:()=>[]},nodeTags:{type:Array,required:!1,default:()=>[]}},emits:[`pickImage`,`setLink`,`removeLink`,`editNote`,`removeNote`,`removeImage`,`addCode`,`editCode`,`removeCode`,`addTable`,`editTable`,`removeTable`,`toggleMarker`,`clearMarkers`,`addTag`,`removeTags`,`addRelation`,`close`],setup(e,{expose:t,emit:r}){t();let i=e,o=r,s=n(()=>{let e=i.x+2,t=i.y+2;if(i.container){let n=i.container.getBoundingClientRect(),r=4+(3+ +!!i.hasImage+ +!!i.hasLink+ +!!i.hasNote+1+ +!!i.hasCode+1+ +!!i.hasTable+1+ +(i.nodeTags.length>0)+1)*28;e+180>n.right&&(e=Math.max(n.left+4,i.x-180-2)),t+r>n.bottom&&(t=Math.max(n.top+4,i.y-r-2)),e<n.left+2&&(e=n.left+2),t<n.top+2&&(t=n.top+2)}return{left:e,top:t}}),c=n(()=>i.hasImage),l=n(()=>i.hasLink),u=n(()=>i.hasNote),d=n(()=>i.nodeMarkers.length>0),f=n(()=>i.nodeTags.length>0),p=A(!1);function m(){p.value=!p.value}function h(e){return i.nodeMarkers.includes(e)}function g(e){o(`toggleMarker`,e)}function _(e){let t=e.target;t&&t.closest(`.zm-node-menu`)||o(`close`)}function v(e){e.key===`Escape`&&o(`close`)}function y(){o(`close`)}window.addEventListener(`mousedown`,_,!0),window.addEventListener(`keydown`,v,!0),window.addEventListener(`wheel`,y,!0),window.addEventListener(`scroll`,y,!0),a(()=>{window.removeEventListener(`mousedown`,_,!0),window.removeEventListener(`keydown`,v,!0),window.removeEventListener(`wheel`,y,!0),window.removeEventListener(`scroll`,y,!0)});function b(e){e(),o(`close`)}let x={props:i,emit:o,clamped:s,hasImage:c,hasLink:l,hasNote:u,hasMarkers:d,hasTags:f,markerPickerOpen:p,toggleMarkerPicker:m,isMarkerActive:h,onMarkerClick:g,onWindowMouseDown:_,onWindowKey:v,onWindowScroll:y,run:b,Icon:ie,get MARKER_LIB(){return xt},get markerSvg(){return Ct}};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}}),Dt={key:5,class:`zm-marker-picker`},Ot={class:`zm-marker-group-label`},kt={class:`zm-marker-grid`},At=[`title`,`onClick`,`innerHTML`];function jt(e,t,n,a,o,u){return g(),r(`div`,{class:`zm-node-menu`,style:s({left:a.clamped.left+`px`,top:a.clamped.top+`px`}),onContextmenu:t[14]||=k(()=>{},[`prevent`])},[j(`button`,{class:`zm-node-menu-item`,onClick:t[0]||=k(e=>a.run(()=>a.emit(`pickImage`)),[`stop`])},[l(a.Icon,{name:`image`,size:13}),j(`span`,null,p(a.hasImage?`替换图片`:`添加图片`),1)]),a.hasImage?(g(),r(`button`,{key:0,class:`zm-node-menu-item`,onClick:t[1]||=k(e=>a.run(()=>a.emit(`removeImage`)),[`stop`])},[l(a.Icon,{name:`x`,size:13}),t[15]||=j(`span`,null,`移除图片`,-1)])):i(`v-if`,!0),j(`button`,{class:`zm-node-menu-item`,onClick:t[2]||=k(e=>a.run(()=>a.emit(`setLink`)),[`stop`])},[l(a.Icon,{name:`link`,size:13}),j(`span`,null,p(a.hasLink?`编辑链接`:`添加链接`),1)]),a.hasLink?(g(),r(`button`,{key:1,class:`zm-node-menu-item`,onClick:t[3]||=k(e=>a.run(()=>a.emit(`removeLink`)),[`stop`])},[l(a.Icon,{name:`x`,size:13}),t[16]||=j(`span`,null,`移除链接`,-1)])):i(`v-if`,!0),j(`button`,{class:`zm-node-menu-item`,onClick:t[4]||=k(e=>a.run(()=>a.emit(`addCode`)),[`stop`])},[t[17]||=j(`span`,{class:`zm-node-menu-icon zm-node-menu-icon-code`,"aria-hidden":`true`},`{ }`,-1),j(`span`,null,p(n.hasCode?`编辑代码块`:`添加代码块`),1)]),n.hasCode?(g(),r(`button`,{key:2,class:`zm-node-menu-item`,onClick:t[5]||=k(e=>a.run(()=>a.emit(`removeCode`)),[`stop`])},[l(a.Icon,{name:`x`,size:13}),t[18]||=j(`span`,null,`移除代码块`,-1)])):i(`v-if`,!0),j(`button`,{class:`zm-node-menu-item`,onClick:t[6]||=k(e=>a.run(()=>a.emit(`addTable`)),[`stop`])},[t[19]||=j(`span`,{class:`zm-node-menu-icon zm-node-menu-icon-table`,"aria-hidden":`true`},`▦`,-1),j(`span`,null,p(n.hasTable?`编辑表格`:`添加表格`),1)]),n.hasTable?(g(),r(`button`,{key:3,class:`zm-node-menu-item`,onClick:t[7]||=k(e=>a.run(()=>a.emit(`removeTable`)),[`stop`])},[l(a.Icon,{name:`x`,size:13}),t[20]||=j(`span`,null,`移除表格`,-1)])):i(`v-if`,!0),j(`button`,{class:`zm-node-menu-item`,onClick:t[8]||=k(e=>a.run(()=>a.emit(`editNote`)),[`stop`])},[l(a.Icon,{name:`note`,size:13}),j(`span`,null,p(a.hasNote?`编辑笔记`:`添加笔记`),1)]),a.hasNote?(g(),r(`button`,{key:4,class:`zm-node-menu-item`,onClick:t[9]||=k(e=>a.run(()=>a.emit(`removeNote`)),[`stop`])},[l(a.Icon,{name:`x`,size:13}),t[21]||=j(`span`,null,`移除笔记`,-1)])):i(`v-if`,!0),t[27]||=j(`div`,{class:`zm-node-menu-divider`},null,-1),i(` Markers — expandable picker grid `),j(`button`,{class:`zm-node-menu-item`,onClick:k(a.toggleMarkerPicker,[`stop`])},[t[22]||=j(`span`,{class:`zm-node-menu-icon`,"aria-hidden":`true`},`⚑`,-1),t[23]||=j(`span`,null,`标记图标`,-1),j(`span`,{class:c([`zm-node-menu-arrow`,{"is-open":a.markerPickerOpen}])},`›`,2)]),a.markerPickerOpen?(g(),r(`div`,Dt,[(g(!0),r(M,null,_(a.MARKER_LIB,e=>(g(),r(`div`,{key:e.label,class:`zm-marker-group`},[j(`div`,Ot,p(e.label),1),j(`div`,kt,[(g(!0),r(M,null,_(e.markers,e=>(g(),r(`button`,{key:e.id,class:c([`zm-marker-cell`,{"is-active":a.isMarkerActive(e.id)}]),title:e.label,onClick:k(t=>a.onMarkerClick(e.id),[`stop`]),innerHTML:`<svg viewBox="0 0 24 24" width="20" height="20">`+a.markerSvg(e.id)+`</svg>`},null,10,At))),128))])]))),128)),a.hasMarkers?(g(),r(`button`,{key:0,class:`zm-marker-clear`,onClick:t[10]||=k(e=>a.emit(`clearMarkers`),[`stop`])},` 清除所有标记 `)):i(`v-if`,!0)])):i(`v-if`,!0),i(` Tags `),j(`button`,{class:`zm-node-menu-item`,onClick:t[11]||=k(e=>a.run(()=>a.emit(`addTag`)),[`stop`])},[t[24]||=j(`span`,{class:`zm-node-menu-icon`,"aria-hidden":`true`},`#`,-1),j(`span`,null,p(a.hasTags?`编辑标签`:`添加标签`),1)]),a.hasTags?(g(),r(`button`,{key:6,class:`zm-node-menu-item`,onClick:t[12]||=k(e=>a.run(()=>a.emit(`removeTags`)),[`stop`])},[l(a.Icon,{name:`x`,size:13}),t[25]||=j(`span`,null,`移除标签`,-1)])):i(`v-if`,!0),t[28]||=j(`div`,{class:`zm-node-menu-divider`},null,-1),i(` Relationship line ("联系") — enter creation mode with this\r
|
|
39
|
+
node as the first endpoint. `),j(`button`,{class:`zm-node-menu-item`,onClick:t[13]||=k(e=>a.run(()=>a.emit(`addRelation`)),[`stop`])},[l(a.Icon,{name:`relation`,size:13}),t[26]||=j(`span`,null,`添加联系`,-1)])],36)}var Mt=F(Et,[[`render`,jt],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/NodeContextMenu.vue`]]),Nt=d({__name:`CanvasContextMenu`,props:{x:{type:Number,required:!0},y:{type:Number,required:!0},container:{type:null,required:!0}},emits:[`openSettings`,`openData`,`openImport`,`exportPng`,`exportSvg`,`close`],setup(e,{expose:t,emit:r}){t();let i=e,o=r,s=n(()=>{let e=i.x+2,t=i.y+2;if(i.container){let n=i.container.getBoundingClientRect();e+160>n.right&&(e=Math.max(n.left+4,i.x-160-2)),t+121>n.bottom&&(t=Math.max(n.top+4,i.y-121-2)),e<n.left+2&&(e=n.left+2),t<n.top+2&&(t=n.top+2)}return{left:e,top:t}}),c=A(null),l=A(null),u=A(null),d=n(()=>{let e=c.value===`import`?l.value:c.value===`export`?u.value:null;if(!e)return{left:`-9999px`,top:`-9999px`,display:`none`};let t=e.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight,i=t.right;i+176>n-4&&(i=Math.max(4,t.left-176));let a=t.top-4;return a+88>r-4&&(a=Math.max(4,r-88-4)),{left:i+`px`,top:a+`px`,display:`block`}}),f=null,p=null;function m(e){p&&=(clearTimeout(p),null),f=setTimeout(()=>{c.value=e},60)}function h(){f&&=(clearTimeout(f),null),p=setTimeout(()=>{c.value=null},120)}a(()=>{f&&clearTimeout(f),p&&clearTimeout(p)});function g(e){let t=e.target;t&&t.closest(`.zm-canvas-menu`)||o(`close`)}function _(e){e.key===`Escape`&&o(`close`)}function v(){o(`close`)}window.addEventListener(`mousedown`,g,!0),window.addEventListener(`keydown`,_,!0),window.addEventListener(`wheel`,v,!0),window.addEventListener(`scroll`,v,!0),a(()=>{window.removeEventListener(`mousedown`,g,!0),window.removeEventListener(`keydown`,_,!0),window.removeEventListener(`wheel`,v,!0),window.removeEventListener(`scroll`,v,!0)});function y(e){e(),o(`close`)}let b={props:i,emit:o,clamped:s,openSubmenu:c,importItemRef:l,exportItemRef:u,submenuStyle:d,get submenuEnterTimer(){return f},set submenuEnterTimer(e){f=e},get submenuLeaveTimer(){return p},set submenuLeaveTimer(e){p=e},onSubmenuEnter:m,onSubmenuLeave:h,onWindowMouseDown:g,onWindowKey:_,onWindowScroll:v,run:y,Icon:ie};return Object.defineProperty(b,"__isScriptSetup",{enumerable:!1,value:!0}),b}});function Pt(e,t,n,a,o,u){return g(),r(`div`,{class:`zm-canvas-menu`,style:s({left:a.clamped.left+`px`,top:a.clamped.top+`px`}),onContextmenu:t[11]||=k(()=>{},[`prevent`])},[j(`button`,{class:`zm-canvas-menu-item`,onClick:t[0]||=k(e=>a.run(()=>a.emit(`openData`)),[`stop`])},[l(a.Icon,{name:`database`,size:13,stroke:1.6}),t[12]||=j(`span`,null,`查看数据`,-1)]),j(`div`,{ref:`importItemRef`,class:c([`zm-canvas-menu-item zm-canvas-menu-item-has-submenu`,{"is-open":a.openSubmenu===`import`}]),onMouseenter:t[5]||=e=>a.onSubmenuEnter(`import`),onMouseleave:a.onSubmenuLeave},[l(a.Icon,{name:`import`,size:13,stroke:1.6}),t[16]||=j(`span`,null,`导入`,-1),t[17]||=j(`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`},[j(`polyline`,{points:`2.5 1.8 5.2 4 2.5 6.2`})],-1),a.openSubmenu===`import`?(g(),r(`div`,{key:0,class:`zm-canvas-submenu`,style:s(a.submenuStyle),onMouseenter:t[4]||=e=>a.onSubmenuEnter(`import`),onMouseleave:a.onSubmenuLeave},[j(`button`,{class:`zm-canvas-menu-item`,onClick:t[1]||=k(e=>a.run(()=>a.emit(`openImport`,`markdown`)),[`stop`])},[l(a.Icon,{name:`markdown`,size:13,stroke:1.6}),t[13]||=j(`span`,null,`Markdown 导入`,-1)]),j(`button`,{class:`zm-canvas-menu-item`,onClick:t[2]||=k(e=>a.run(()=>a.emit(`openImport`,`json`)),[`stop`])},[l(a.Icon,{name:`json`,size:13,stroke:1.6}),t[14]||=j(`span`,null,`JSON 文件导入`,-1)]),j(`button`,{class:`zm-canvas-menu-item`,onClick:t[3]||=k(e=>a.run(()=>a.emit(`openImport`,`txt`)),[`stop`])},[l(a.Icon,{name:`txt`,size:13,stroke:1.6}),t[15]||=j(`span`,null,`TXT 文件导入`,-1)])],36)):i(`v-if`,!0)],34),j(`button`,{class:`zm-canvas-menu-item`,onClick:t[6]||=k(e=>a.run(()=>a.emit(`openSettings`)),[`stop`])},[l(a.Icon,{name:`settings`,size:13,stroke:1.6}),t[18]||=j(`span`,null,`设置`,-1)]),t[23]||=j(`div`,{class:`zm-canvas-menu-divider`},null,-1),j(`div`,{ref:`exportItemRef`,class:c([`zm-canvas-menu-item zm-canvas-menu-item-has-submenu`,{"is-open":a.openSubmenu===`export`}]),onMouseenter:t[10]||=e=>a.onSubmenuEnter(`export`),onMouseleave:a.onSubmenuLeave},[l(a.Icon,{name:`export`,size:13,stroke:1.6}),t[21]||=j(`span`,null,`导出`,-1),t[22]||=j(`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`},[j(`polyline`,{points:`2.5 1.8 5.2 4 2.5 6.2`})],-1),a.openSubmenu===`export`?(g(),r(`div`,{key:0,class:`zm-canvas-submenu`,style:s(a.submenuStyle),onMouseenter:t[9]||=e=>a.onSubmenuEnter(`export`),onMouseleave:a.onSubmenuLeave},[j(`button`,{class:`zm-canvas-menu-item`,onClick:t[7]||=k(e=>a.run(()=>a.emit(`exportPng`)),[`stop`])},[l(a.Icon,{name:`image`,size:13,stroke:1.6}),t[19]||=j(`span`,null,`导出 PNG`,-1)]),j(`button`,{class:`zm-canvas-menu-item`,onClick:t[8]||=k(e=>a.run(()=>a.emit(`exportSvg`)),[`stop`])},[l(a.Icon,{name:`svg-export`,size:13,stroke:1.6}),t[20]||=j(`span`,null,`导出 SVG`,-1)])],36)):i(`v-if`,!0)],34)],36)}var Ft=F(Nt,[[`render`,Pt],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/CanvasContextMenu.vue`]]),It=d({__name:`Drawer`,props:{side:{type:String,required:!1,default:`left`},width:{type:Number,required:!1,default:320},open:{type:Boolean,required:!1,default:!0},title:{type:String,required:!1,default:``},scope:{type:String,required:!1,default:`page`},closable:{type:Boolean,required:!1,default:!0},closeOnBackdrop:{type:Boolean,required:!1,default:!0}},emits:[`update:open`],setup(e,{expose:t,emit:n}){t();let r=n;function i(){r(`update:open`,!1)}function a(){r(`update:open`,!1)}let o={emit:r,close:i,onBackdropClick:a};return Object.defineProperty(o,"__isScriptSetup",{enumerable:!1,value:!0}),o}}),Lt=[`aria-hidden`],Rt=[`aria-hidden`],zt={key:0,class:`zm-drawer-header`},Bt={key:0,class:`zm-drawer-title`},Vt={class:`zm-drawer-body`},Ht=[`aria-hidden`],Ut={key:0,class:`zm-drawer-header`},Wt={key:0,class:`zm-drawer-title`},Gt={class:`zm-drawer-body`};function Kt(e,t,n,a,o,u){return g(),r(M,null,[i(` scope=canvas: render the backdrop + the floating aside. Both\r
|
|
40
40
|
are wrapped in a single root so v-if toggles the whole overlay\r
|
|
41
|
-
in/out together. `),
|
|
42
|
-
`)}),le=
|
|
41
|
+
in/out together. `),n.scope===`canvas`?(g(),r(M,{key:0},[l(D,{name:`zm-fade`},{default:E(()=>[n.open?(g(),r(`div`,{key:0,class:`zm-drawer-canvas-backdrop`,"aria-hidden":!n.open,onClick:t[0]||=e=>n.closeOnBackdrop&&a.onBackdropClick()},null,8,Lt)):i(`v-if`,!0)]),_:1}),l(D,{name:n.side===`left`?`zm-slide-left`:`zm-slide-right`},{default:E(()=>[n.open?(g(),r(`aside`,{key:0,class:c([`zm-drawer zm-drawer--canvas`,[`zm-drawer--`+n.side]]),style:s({width:n.width+`px`}),"aria-hidden":!n.open},[n.title||e.$slots.header?(g(),r(`div`,zt,[n.title?(g(),r(`h3`,Bt,p(n.title),1)):i(`v-if`,!0),f(e.$slots,`header`),n.closable?(g(),r(`button`,{key:1,class:`zm-drawer-close`,title:`关闭`,onClick:a.close},[...t[1]||=[j(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`},[j(`path`,{d:`M6 6 L18 18 M18 6 L6 18`})],-1)]])):i(`v-if`,!0)])):i(`v-if`,!0),j(`div`,Vt,[f(e.$slots,`default`)])],14,Rt)):i(`v-if`,!0)]),_:3},8,[`name`])],64)):(g(),r(M,{key:1},[i(` scope=page: legacy flex-flow aside that takes layout space. `),l(D,{name:`zm-drawer`},{default:E(()=>[n.open?(g(),r(`aside`,{key:0,class:c([`zm-drawer`,[`zm-drawer--`+n.side,{"is-open":n.open}]]),style:s({width:n.width+`px`}),"aria-hidden":!n.open},[n.title||e.$slots.header?(g(),r(`div`,Ut,[n.title?(g(),r(`h3`,Wt,p(n.title),1)):i(`v-if`,!0),f(e.$slots,`header`),n.closable?(g(),r(`button`,{key:1,class:`zm-drawer-close`,title:`关闭`,onClick:a.close},[...t[2]||=[j(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`},[j(`path`,{d:`M6 6 L18 18 M18 6 L6 18`})],-1)]])):i(`v-if`,!0)])):i(`v-if`,!0),j(`div`,Gt,[f(e.$slots,`default`)])],14,Ht)):i(`v-if`,!0)]),_:3})],2112))],2112)}var qt=F(It,[[`render`,Kt],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/Drawer.vue`]]),Jt=d({__name:`Outline`,props:{data:{type:Object,required:!0},selectedId:{type:[String,null],required:!1,default:null},collapsedIds:{type:Set,required:!1,default:()=>new Set},readonly:{type:Boolean,required:!1,default:!1},showIndex:{type:Boolean,required:!1,default:!1}},emits:[`select`,`toggleCollapse`,`edit`,`addChild`,`addSibling`,`move`],setup(e,{expose:t,emit:r}){t();let i=e,s=r,c=A(``),l=A(null),u=A(-1),d=n(()=>{let e=c.value.trim().toLowerCase();if(!e)return new Set;let t=new Set,n=r=>{var i;(r.text.toLowerCase().includes(e)||(i=r.note)!=null&&i.text&&r.note.text.toLowerCase().includes(e))&&t.add(r.id);for(let e of r.children)n(e)};return n(i.data),t}),f=n(()=>{if(d.value.size===0)return new Set;let e=new Set,t=n=>{let r=d.value.has(n.id);for(let e of n.children)t(e)&&(r=!0);return r&&e.add(n.id),r};return t(i.data),e}),p=n(()=>{let e=[],t=n=>{d.value.has(n.id)&&e.push(n.id);for(let e of n.children)t(e)};return t(i.data),e}),m=n(()=>c.value.trim().length>0),h=n(()=>{let e=[],t=f.value,n=(r,a,o)=>{if(m.value&&!t.has(r.id))return;let s=r.children.length>0,c=!m.value&&i.collapsedIds.has(r.id);e.push({id:r.id,text:r.text||`(无标题)`,depth:a,siblingIndex:o,hasChildren:s,collapsed:c,node:r}),s&&!c&&r.children.forEach((e,t)=>n(e,a+1,t))};return n(i.data,0,0),e});function g(){u.value=p.value.length>0?0:-1}function _(){let e=p.value;e.length!==0&&(u.value=(u.value+1)%e.length,b(u.value))}function v(){let e=p.value;e.length!==0&&(u.value=(u.value-1+e.length)%e.length,b(u.value))}function y(e){e.key===`Enter`?(e.preventDefault(),e.shiftKey?v():_()):e.key===`Escape`&&(e.preventDefault(),c.value=``,u.value=-1)}function b(e){let t=p.value[e];if(!t)return;let n=h.value.find(e=>e.id===t);n&&s(`select`,n.node),o(()=>{document.querySelector(`[data-outline-id="${t}"]`)?.scrollIntoView({block:`nearest`,behavior:`smooth`})})}function x(){c.value=``,u.value=-1}ee(()=>{o(()=>l.value?.focus())});let S=A(null),C=A(``),w=null;function T(e){i.readonly||(S.value=e.id,C.value=e.text,o(()=>{w=document.querySelector(`.zm-outline-input`),w?.focus(),w?.select()}))}function E(){S.value!=null&&(s(`edit`,{id:S.value,text:C.value.trim()||`(无标题)`}),D())}function D(){S.value=null,C.value=``,w=null}function O(e){e.key===`Enter`?(e.preventDefault(),E()):e.key===`Escape`&&(e.preventDefault(),D())}a(D);let k=A(null),j=A(null),M=A(null);function N(e,t){if(i.readonly){e.preventDefault();return}k.value={id:t.id,text:t.text},e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t.id))}function te(){k.value=null,j.value=null,M.value=null}function P(e,t){if(!k.value)return;e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`);let n=re(e);j.value=t.id,M.value=n}function ne(e){j.value===e.id&&(j.value=null,M.value=null)}function F(e,t){e.preventDefault();let n=k.value;if(!n)return;let r=re(e);n.id!==t.id&&s(`move`,{srcId:n.id,targetId:t.id,position:r}),te()}function re(e,t){let n=e.currentTarget.getBoundingClientRect(),r=e.clientY-n.top,i=n.height;return r<i*.3?`before`:r>i*.7?`after`:`child`}let I=A(null),ie=null;async function L(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,document.body.appendChild(t),t.select();let n=!1;try{n=document.execCommand(`copy`)}finally{document.body.removeChild(t)}return n}}async function se(e,t,n){e.stopPropagation(),await L(t)&&(I.value=n,ie&&clearTimeout(ie),ie=setTimeout(()=>I.value=null,1200))}let ce=n(()=>{let e=[],t=(n,r)=>{let i=` `.repeat(r),a=r===0?``:`- `;e.push(i+a+(n.text||``));for(let e of n.children)t(e,r+1)};return t(i.data,0),e.join(`
|
|
42
|
+
`)}),le=A(!1),ue=null;async function de(){await L(ce.value)&&(le.value=!0,ue&&clearTimeout(ue),ue=setTimeout(()=>le.value=!1,1200))}let R={props:i,emit:s,searchQuery:c,searchInputRef:l,searchIndex:u,searchMatchIds:d,searchVisibleIds:f,searchMatchList:p,hasSearch:m,rows:h,onSearchInput:g,searchNext:_,searchPrev:v,onSearchKeydown:y,jumpToMatch:b,clearSearch:x,editingId:S,editingText:C,get editInputEl(){return w},set editInputEl(e){w=e},startEdit:T,commitEdit:E,cancelEdit:D,onEditKeydown:O,dragData:k,dragOverId:j,dragOverPos:M,onDragStart:N,onDragEnd:te,onDragOver:P,onDragLeave:ne,onDrop:F,dropPositionFor:re,copiedId:I,get copyTimer(){return ie},set copyTimer(e){ie=e},copyText:L,copyNodeText:se,plainText:ce,copyingOutline:le,get outlineTimer(){return ue},set outlineTimer(e){ue=e},copyOutline:de,get addNodeIcon(){return ae},get addSubNodeIcon(){return oe}};return Object.defineProperty(R,"__isScriptSetup",{enumerable:!1,value:!0}),R}}),Yt={class:`zm-outline-root`},Xt={class:`zm-outline-search`},Zt={key:0,class:`zm-outline-search-count`},Qt={key:1,class:`zm-outline-search-count zm-outline-search-empty`},$t={class:`zm-outline-actions`},en={width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},G={key:0,x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`},tn={key:1,d:`M5 12 L10 17 L19 7`},K={class:`zm-outline`},nn=[`data-outline-id`,`onClick`,`onDblclick`,`onDragstart`,`onDragover`,`onDragleave`,`onDrop`],rn=[`title`,`onClick`],an={width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`3`,"stroke-linecap":`round`,"stroke-linejoin":`round`},q={key:0,points:`6 9 12 15 18 9`},on={key:1,points:`9 6 15 12 9 18`},sn={key:1,class:`zm-outline-dot`},cn={key:2,class:`zm-outline-index`},ln={key:4,class:`zm-outline-text`},un=[`onClick`],dn=[`onClick`],fn=[`src`],pn=[`onClick`],mn=[`src`],hn=[`title`,`onClick`],gn={width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},_n={key:0,x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`},vn={key:1,d:`M5 12 L10 17 L19 7`};function yn(e,t,n,a,o,l){return g(),r(`div`,Yt,[i(` Search bar — sits at the top of the outline drawer. When\r
|
|
43
43
|
the drawer opens (via Ctrl+F or the outline button), this\r
|
|
44
44
|
input auto-focuses so the user can start typing immediately.\r
|
|
45
45
|
Matches are highlighted in the list below; Enter jumps to\r
|
|
46
|
-
the next match (Shift+Enter for previous). `),j(`div`,Xt,[t[3]||=j(`svg`,{class:`zm-outline-search-icon`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[j(`circle`,{cx:`11`,cy:`11`,r:`7`}),j(`line`,{x1:`20`,y1:`20`,x2:`16`,y2:`16`})],-1),E(j(`input`,{ref:`searchInputRef`,"onUpdate:modelValue":t[0]||=e=>a.searchQuery=e,type:`text`,class:`zm-outline-search-input`,placeholder:`搜索节点… (Enter 下一个, Shift+Enter 上一个)`,onInput:a.onSearchInput,onKeydown:a.onSearchKeydown},null,544),[[C,a.searchQuery]]),a.searchMatchList.length>0?(h(),r(`span`,Zt,b(a.searchIndex+1)+`/`+b(a.searchMatchList.length),1)):a.hasSearch?(h(),r(`span`,Qt,`无结果`)):i(`v-if`,!0),a.searchQuery?(h(),r(`button`,{key:2,class:`zm-outline-search-clear`,title:`清除搜索`,onClick:a.clearSearch},`×`)):i(`v-if`,!0)]),j(`div`,$t,[j(`button`,{class:s([`zm-outline-action-btn`,{"is-success":a.copyingOutline}]),title:`复制完整大纲为纯文本`,onClick:a.copyOutline},[(h(),r(`svg`,en,[a.copyingOutline?(h(),r(`path`,tn)):(h(),r(`rect`,G)),t[4]||=j(`path`,{d:`M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1`},null,-1)])),j(`span`,null,b(a.copyingOutline?`已复制`:`复制大纲`),1)],2)]),j(`ul`,K,[(h(!0),r(M,null,d(a.rows,e=>(h(),r(`li`,{key:e.id,"data-outline-id":e.id,class:s([`zm-outline-row`,{"is-selected":e.id===n.selectedId,"is-root":e.depth===0,"is-editing":a.editingId===e.id,"is-search-hit":a.searchMatchIds.has(e.id),"is-search-current":a.searchMatchList[a.searchIndex]===e.id,"is-drag-over-before":a.dragOverId===e.id&&a.dragOverPos===`before`,"is-drag-over-after":a.dragOverId===e.id&&a.dragOverPos===`after`,"is-drag-over-child":a.dragOverId===e.id&&a.dragOverPos===`child`}]),style:g({paddingLeft:12+e.depth*16+`px`}),draggable:`true`,onClick:t=>a.emit(`select`,e.node),onDblclick:t=>a.startEdit(e),onDragstart:t=>a.onDragStart(t,e),onDragend:a.onDragEnd,onDragover:t=>a.onDragOver(t,e),onDragleave:()=>a.onDragLeave(e),onDrop:t=>a.onDrop(t,e)},[e.hasChildren?(h(),r(`button`,{key:0,class:`zm-outline-toggle`,title:e.collapsed?`展开`:`折叠`,onClick:k(t=>a.emit(`toggleCollapse`,e.id),[`stop`])},[(h(),r(`svg`,an,[e.collapsed?(h(),r(`polyline`,on)):(h(),r(`polyline`,q))]))],8,rn)):(h(),r(`span`,sn)),a.props.showIndex?(h(),r(`span`,cn,b(e.siblingIndex+1)+`.`,1)):i(`v-if`,!0),a.editingId===e.id?E((h(),r(`input`,{key:3,"onUpdate:modelValue":t[1]||=e=>a.editingText=e,class:`zm-outline-input`,onBlur:a.commitEdit,onKeydown:a.onEditKeydown,onClick:t[2]||=k(()=>{},[`stop`])},null,544)),[[C,a.editingText]]):(h(),r(`span`,ln,b(e.text),1)),a.props.readonly?i(`v-if`,!0):(h(),r(`button`,{key:5,class:`zm-outline-row-action`,title:`编辑文字`,onClick:k(t=>a.startEdit(e),[`stop`])},[...t[5]||=[j(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[j(`path`,{d:`M4 20 l4 -1 11 -11 -3 -3 -11 11 z`}),j(`line`,{x1:`14`,y1:`6`,x2:`18`,y2:`10`})],-1)]],8,un)),a.props.readonly?i(`v-if`,!0):(h(),r(`button`,{key:6,class:`zm-outline-row-action`,title:`添加同级`,onClick:k(t=>a.emit(`addSibling`,e.id),[`stop`])},[j(`img`,{src:a.addNodeIcon,width:`14`,height:`14`,alt:`添加同级`,draggable:`false`},null,8,fn)],8,dn)),a.props.readonly?i(`v-if`,!0):(h(),r(`button`,{key:7,class:`zm-outline-row-action`,title:`添加子节点`,onClick:k(t=>a.emit(`addChild`,e.id),[`stop`])},[j(`img`,{src:a.addSubNodeIcon,width:`14`,height:`14`,alt:`添加子节点`,draggable:`false`},null,8,mn)],8,pn)),j(`button`,{class:s([`zm-outline-row-copy`,{"is-success":a.copiedId===e.id}]),title:a.copiedId===e.id?`已复制`:`复制节点文本`,onClick:t=>a.copyNodeText(t,e.text,e.id)},[(h(),r(`svg`,gn,[a.copiedId===e.id?(h(),r(`path`,vn)):(h(),r(`rect`,_n)),t[6]||=j(`path`,{d:`M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1`},null,-1)]))],10,hn)],46,nn))),128))])])}var bn=F(Jt,[[`render`,yn],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/Outline.vue`]]),xn=u({__name:`JsonTreeViewer`,props:{value:{type:null,required:!0},keyName:{type:String,required:!1,default:``},isRoot:{type:Boolean,required:!1,default:!0},path:{type:String,required:!1,default:``},depth:{type:Number,required:!1,default:0},query:{type:String,required:!1,default:``},collapsedPaths:{type:Set,required:!1,default:()=>new Set}},setup(e,{expose:t}){t();let r=e,i=n(()=>r.value===null?`null`:Array.isArray(r.value)?`array`:typeof r.value),a=n(()=>i.value===`object`),o=n(()=>i.value===`array`),s=n(()=>!a.value&&!o.value),c=n(()=>{if(o.value)return`Array(${r.value.length})`;if(a.value){let e=r.value,t=Object.keys(e);return`Object(${t.length} ${t.length===1?`key`:`keys`})`}return``}),l=n(()=>o.value?r.value.map((e,t)=>({key:String(t),value:e})):a.value?Object.entries(r.value).map(([e,t])=>({key:e,value:t})):[]),u=n(()=>r.isRoot?`<root>`:r.path),d=n(()=>r.collapsedPaths.has(u.value));function f(e,t,n){e!==`<root>`&&(n<2||typeof t!=`object`||!t||r.collapsedPaths.has(e)||r.collapsedPaths.add(e))}r.isRoot||f(u.value,r.value,r.depth);function p(){d.value?r.collapsedPaths.delete(u.value):r.collapsedPaths.add(u.value)}function m(e){return u.value===``?e:`${u.value}.${e}`}function h(e){if(!r.query)return!0;let t=r.query.toLowerCase();return typeof e==`string`?e.toLowerCase().includes(t):e===null?`null`.includes(t):String(e).toLowerCase().includes(t)}function g(e){return!r.query||e.toLowerCase().includes(r.query.toLowerCase())}function _(e,t){return!r.query||g(e)?!0:typeof t!=`object`||!t?h(t):!0}function v(e){return e===null?`null`:typeof e==`string`?e.length>80?`"${e.slice(0,80)}..."`:`"${e}"`:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?String(e):typeof e>`u`?`undefined`:JSON.stringify(e)}function y(e){if(typeof e!=`string`)return!1;let t=e.trim();return!!(t.startsWith(`data:image/`)||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(t)||/^https?:\/\/.+/i.test(t)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(t))}function b(e){if(!r.query)return null;let t=e.toLowerCase().indexOf(r.query.toLowerCase());return t<0?null:{before:e.slice(0,t),match:e.slice(t,t+r.query.length),after:e.slice(t+r.query.length)}}let x={props:r,type:i,isObject:a,isArray:o,isPrimitive:s,sizeLabel:c,entries:l,myPath:u,isCollapsed:d,applyDefaultCollapse:f,toggle:p,childPath:m,primitiveMatches:h,keyMatches:g,shouldShowEntry:_,displayValue:v,isImageValue:y,highlightMatch:b};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}}),Sn={key:0,class:`zm-jtv-root`},Cn={key:0,class:`zm-jtv-key`},wn={key:1,class:`zm-jtv-colon`},Tn={key:2,class:`zm-jtv-key zm-jtv-bracket`},En={key:3,class:`zm-jtv-size`},J={key:4,class:`zm-jtv-bracket`},Dn={key:5,class:`zm-jtv-brace`},On={key:0,class:`zm-jtv-children`},kn={class:`zm-jtv-key`},An={key:0,class:`zm-jtv-key`},jn=[`src`,`alt`],Mn=[`href`];function Nn(e,t,n,a,o,c){let u=x(`JsonTreeViewer`,!0);return h(),r(M,null,[i(` Root: just the children, no key prefix. `),n.isRoot?(h(),r(`div`,Sn,[(h(!0),r(M,null,d(a.entries,e=>E((h(),r(`div`,{key:e.key,class:`zm-jtv-row`},[l(u,{"key-name":e.key,value:e.value,path:a.childPath(e.key),depth:n.depth+1,query:n.query,"collapsed-paths":n.collapsedPaths,"is-root":!1},null,8,[`key-name`,`value`,`path`,`depth`,`query`,`collapsed-paths`])])),[[S,a.shouldShowEntry(e.key,e.value)]])),128))])):a.isObject||a.isArray?(h(),r(M,{key:1},[i(` Object / array header + children `),j(`div`,{class:s([`zm-jtv-branch`,{"is-collapsed":a.isCollapsed}])},[j(`div`,{class:`zm-jtv-header`,style:g({paddingLeft:6+n.depth*12+`px`}),onClick:a.toggle},[j(`span`,{class:s([`zm-jtv-toggle`,{"is-leaf":!1}])},b(a.isCollapsed?`▶`:`▼`),1),a.isArray?i(`v-if`,!0):(h(),r(`span`,Cn,b(n.keyName),1)),a.isArray?i(`v-if`,!0):(h(),r(`span`,wn,`:`)),a.isArray?(h(),r(`span`,Tn,`[`)):i(`v-if`,!0),a.isCollapsed?(h(),r(`span`,En,b(a.sizeLabel),1)):i(`v-if`,!0),a.isCollapsed&&a.isArray?(h(),r(`span`,J,`]`)):i(`v-if`,!0),a.isCollapsed&&a.isObject?(h(),r(`span`,Dn,`}`)):i(`v-if`,!0)],4),a.isCollapsed?i(`v-if`,!0):(h(),r(`div`,On,[(h(!0),r(M,null,d(a.entries,e=>E((h(),r(`div`,{key:e.key,class:`zm-jtv-row`},[l(u,{"key-name":e.key,value:e.value,path:a.childPath(e.key),depth:n.depth+1,query:n.query,"collapsed-paths":n.collapsedPaths,"is-root":!1},null,8,[`key-name`,`value`,`path`,`depth`,`query`,`collapsed-paths`])])),[[S,a.shouldShowEntry(e.key,e.value)]])),128))])),!a.isCollapsed&&a.isArray?(h(),r(`div`,{key:1,class:`zm-jtv-footer`,style:g({paddingLeft:6+n.depth*12+`px`})},`]`,4)):i(`v-if`,!0),!a.isCollapsed&&a.isObject&&!a.isArray?(h(),r(`div`,{key:2,class:`zm-jtv-footer`,style:g({paddingLeft:6+n.depth*12+`px`})},`}`,4)):i(`v-if`,!0)],2)],2112)):(h(),r(M,{key:2},[i(` Primitive value row `),j(`div`,{class:`zm-jtv-leaf`,style:g({paddingLeft:6+n.depth*12+`px`})},[t[2]||=j(`span`,{class:`zm-jtv-toggle is-leaf`},`·`,-1),j(`span`,kn,b(n.keyName),1),t[3]||=j(`span`,{class:`zm-jtv-colon`},`:`,-1),a.keyMatches(n.keyName)&&a.highlightMatch(n.keyName)?(h(),r(`span`,An,[j(`span`,null,b(a.highlightMatch(n.keyName)?.before),1),j(`mark`,null,b(a.highlightMatch(n.keyName)?.match),1),j(`span`,null,b(a.highlightMatch(n.keyName)?.after),1)])):i(`v-if`,!0),j(`span`,{class:s([`zm-jtv-value`,`zm-jtv-${a.type}`])},[a.highlightMatch(a.displayValue(n.value))?(h(),r(M,{key:0},[j(`span`,null,b(a.highlightMatch(a.displayValue(n.value))?.before),1),j(`mark`,null,b(a.highlightMatch(a.displayValue(n.value))?.match),1),j(`span`,null,b(a.highlightMatch(a.displayValue(n.value))?.after),1)],64)):(h(),r(M,{key:1},[w(b(a.displayValue(n.value)),1)],64))],2),a.isImageValue(n.value)?(h(),r(`span`,{key:1,class:`zm-jtv-thumb-wrap`,onClick:t[1]||=k(()=>{},[`stop`])},[j(`img`,{class:`zm-jtv-thumb`,src:String(n.value),alt:n.keyName,loading:`lazy`,referrerpolicy:`no-referrer`},null,8,jn),j(`a`,{class:`zm-jtv-thumb-link`,href:String(n.value),target:`_blank`,rel:`noopener noreferrer`,onClick:t[0]||=k(()=>{},[`stop`])},`open`,8,Mn)])):i(`v-if`,!0)],4)],2112))],2112)}var Pn=F(xn,[[`render`,Nn],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/JsonTreeViewer.vue`]]),Fn=u({__name:`DataPanel`,props:{data:{type:Object,required:!0},pendingMode:{type:[String,null],required:!1,default:null}},emits:[`import`,`consumed-mode`],setup(e,{expose:t,emit:r}){t();let i=e,a=r,o=n(()=>JSON.stringify(i.data,null,2)),s=v(``),c=v(null),l=v(!1),u=v(`json`),d=v(`idle`),f=v(new Set),p=v(``);D(()=>i.pendingMode,e=>{e&&(l.value=!0,u.value=e,a(`consumed-mode`))},{immediate:!0});async function m(){try{await navigator.clipboard.writeText(o.value),d.value=`copied`,setTimeout(()=>d.value=`idle`,1500)}catch{let e=document.createElement(`textarea`);e.value=o.value,document.body.appendChild(e),e.select();try{document.execCommand(`copy`),d.value=`copied`,setTimeout(()=>d.value=`idle`,1500)}finally{document.body.removeChild(e)}}}function h(){let e=new Blob([o.value],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${i.data.text||`mindmap`}.json`,n.click(),URL.revokeObjectURL(t)}function g(){c.value=null;let e=s.value.trim();if(e){if(u.value===`markdown`||u.value===`txt`){try{let t=lt(e);a(`import`,t),s.value=``,l.value=!1}catch(e){c.value=(u.value===`txt`?`TXT 解析失败:`:`Markdown 解析失败:`)+e.message}return}try{let t=JSON.parse(e);if(!t.id||!Array.isArray(t.children)){c.value=`JSON 缺少 id 或 children 字段`;return}a(`import`,t),s.value=``,l.value=!1}catch(e){c.value=`JSON 解析失败:`+e.message}}}function _(e){return 1+e.children.reduce((e,t)=>e+_(t),0)}let y=n(()=>_(i.data)),b=n(()=>o.value.length);function x(){let e=document.createElement(`input`);e.type=`file`,e.accept=`application/json`,e.onchange=()=>{let t=e.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{typeof n.result==`string`&&(s.value=n.result,g())},n.readAsText(t)},e.click()}let S={props:i,emit:a,json:o,pasteText:s,pasteError:c,pasteOpen:l,pasteMode:u,copyState:d,collapsedPaths:f,searchQuery:p,copyAll:m,downloadJson:h,applyPaste:g,countNodes:_,totalNodes:y,charCount:b,pickFile:x,JsonTreeViewer:Pn};return Object.defineProperty(S,"__isScriptSetup",{enumerable:!1,value:!0}),S}}),In={class:`zm-data-panel`},Ln={class:`zm-data-header`},Rn={class:`zm-data-title`},zn={class:`zm-data-title-meta`},Bn={class:`zm-data-toolbar`},Vn=[`title`],Hn={key:0,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Un={key:1,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.4`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Wn={key:0,class:`zm-data-paste`},Gn={class:`zm-data-tabs`},Kn=[`placeholder`],qn={key:0,class:`zm-data-error`},Jn={class:`zm-data-paste-actions`},Yn=[`disabled`],Xn={class:`zm-data-tree`};function Zn(e,n,a,o,c,u){return h(),r(`div`,In,[j(`div`,Ln,[j(`div`,Rn,[n[8]||=j(`span`,{class:`zm-data-title-text`},`数据 JSON`,-1),j(`span`,zn,b(o.totalNodes)+` 节点 · `+b(o.charCount)+` chars`,1)])]),j(`div`,Bn,[j(`button`,{class:s([`zm-data-btn is-icon`,{"is-success":o.copyState===`copied`}]),title:o.copyState===`copied`?`已复制`:`复制 JSON 到剪贴板`,onClick:o.copyAll},[o.copyState===`idle`?(h(),r(`svg`,Hn,[...n[9]||=[j(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`},null,-1),j(`path`,{d:`M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1`},null,-1)]])):(h(),r(`svg`,Un,[...n[10]||=[j(`polyline`,{points:`5 12 10 17 19 7`},null,-1)]])),n[11]||=j(`span`,{class:`zm-data-btn-label`},`复制`,-1)],10,Vn),j(`button`,{class:`zm-data-btn is-icon`,title:`导出为 JSON 文件`,onClick:o.downloadJson},[...n[12]||=[t(`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>`,2)]]),j(`button`,{class:`zm-data-btn is-icon`,title:`从 JSON 文件导入`,onClick:o.pickFile},[...n[13]||=[t(`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>`,2)]]),j(`button`,{class:s([`zm-data-btn is-icon`,{"is-active":o.pasteOpen}]),title:`粘贴 JSON 或 Markdown 替换当前数据`,onClick:n[0]||=e=>o.pasteOpen=!o.pasteOpen},[...n[14]||=[t(`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>`,2)]],2),n[16]||=j(`div`,{class:`zm-data-toolbar-spacer`},null,-1),j(`div`,{class:s([`zm-data-search`,{"is-active":o.searchQuery.length>0}])},[n[15]||=j(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[j(`circle`,{cx:`11`,cy:`11`,r:`7`}),j(`line`,{x1:`20`,y1:`20`,x2:`16`,y2:`16`})],-1),E(j(`input`,{"onUpdate:modelValue":n[1]||=e=>o.searchQuery=e,type:`text`,placeholder:`过滤 (键 / 值)`,spellcheck:`false`},null,512),[[C,o.searchQuery]]),o.searchQuery?(h(),r(`button`,{key:0,class:`zm-data-search-clear`,title:`清空过滤`,onClick:n[2]||=e=>o.searchQuery=``},`×`)):i(`v-if`,!0)],2)]),o.pasteOpen?(h(),r(`div`,Wn,[j(`div`,Gn,[j(`button`,{class:s([`zm-data-tab`,{"is-active":o.pasteMode===`json`}]),onClick:n[3]||=e=>o.pasteMode=`json`},`JSON`,2),j(`button`,{class:s([`zm-data-tab`,{"is-active":o.pasteMode===`markdown`}]),onClick:n[4]||=e=>o.pasteMode=`markdown`},`Markdown`,2)]),E(j(`textarea`,{"onUpdate:modelValue":n[5]||=e=>o.pasteText=e,placeholder:o.pasteMode===`json`?`paste a JSON tree to replace current data`:`paste markdown - # / ## / ### become nodes`,spellcheck:`false`},null,8,Kn),[[C,o.pasteText]]),o.pasteError?(h(),r(`div`,qn,b(o.pasteError),1)):i(`v-if`,!0),j(`div`,Jn,[j(`button`,{class:`zm-data-btn is-primary`,disabled:!o.pasteText,onClick:o.applyPaste},`应用`,8,Yn),j(`button`,{class:`zm-data-btn`,onClick:n[6]||=e=>{o.pasteText=``,o.pasteError=null}},`清空`),j(`button`,{class:`zm-data-btn`,onClick:n[7]||=e=>o.pasteOpen=!1},`关闭`)])])):i(`v-if`,!0),j(`div`,Xn,[l(o.JsonTreeViewer,{value:a.data,query:o.searchQuery,"collapsed-paths":o.collapsedPaths},null,8,[`value`,`query`,`collapsed-paths`])]),n[17]||=j(`div`,{class:`zm-data-footer`},[j(`span`,{class:`zm-data-footer-hint`},[w(` 图片支持 `),j(`code`,null,`data:image/...`),w(` / `),j(`code`,null,`https://...`),w(` / `),j(`code`,null,`/imgs/foo.png`),w(` (同源)。本地 `),j(`code`,null,`file://`),w(` 路径被浏览器拒绝。 `)])],-1)])}var Qn=F(Fn,[[`render`,Zn],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/DataPanel.vue`]]),$n=`# flow-mindmap 思维导图
|
|
46
|
+
the next match (Shift+Enter for previous). `),j(`div`,Xt,[t[3]||=j(`svg`,{class:`zm-outline-search-icon`,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[j(`circle`,{cx:`11`,cy:`11`,r:`7`}),j(`line`,{x1:`20`,y1:`20`,x2:`16`,y2:`16`})],-1),O(j(`input`,{ref:`searchInputRef`,"onUpdate:modelValue":t[0]||=e=>a.searchQuery=e,type:`text`,class:`zm-outline-search-input`,placeholder:`搜索节点… (Enter 下一个, Shift+Enter 上一个)`,onInput:a.onSearchInput,onKeydown:a.onSearchKeydown},null,544),[[S,a.searchQuery]]),a.searchMatchList.length>0?(g(),r(`span`,Zt,p(a.searchIndex+1)+`/`+p(a.searchMatchList.length),1)):a.hasSearch?(g(),r(`span`,Qt,`无结果`)):i(`v-if`,!0),a.searchQuery?(g(),r(`button`,{key:2,class:`zm-outline-search-clear`,title:`清除搜索`,onClick:a.clearSearch},`×`)):i(`v-if`,!0)]),j(`div`,$t,[j(`button`,{class:c([`zm-outline-action-btn`,{"is-success":a.copyingOutline}]),title:`复制完整大纲为纯文本`,onClick:a.copyOutline},[(g(),r(`svg`,en,[a.copyingOutline?(g(),r(`path`,tn)):(g(),r(`rect`,G)),t[4]||=j(`path`,{d:`M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1`},null,-1)])),j(`span`,null,p(a.copyingOutline?`已复制`:`复制大纲`),1)],2)]),j(`ul`,K,[(g(!0),r(M,null,_(a.rows,e=>(g(),r(`li`,{key:e.id,"data-outline-id":e.id,class:c([`zm-outline-row`,{"is-selected":e.id===n.selectedId,"is-root":e.depth===0,"is-editing":a.editingId===e.id,"is-search-hit":a.searchMatchIds.has(e.id),"is-search-current":a.searchMatchList[a.searchIndex]===e.id,"is-drag-over-before":a.dragOverId===e.id&&a.dragOverPos===`before`,"is-drag-over-after":a.dragOverId===e.id&&a.dragOverPos===`after`,"is-drag-over-child":a.dragOverId===e.id&&a.dragOverPos===`child`}]),style:s({paddingLeft:12+e.depth*16+`px`}),draggable:`true`,onClick:t=>a.emit(`select`,e.node),onDblclick:t=>a.startEdit(e),onDragstart:t=>a.onDragStart(t,e),onDragend:a.onDragEnd,onDragover:t=>a.onDragOver(t,e),onDragleave:()=>a.onDragLeave(e),onDrop:t=>a.onDrop(t,e)},[e.hasChildren?(g(),r(`button`,{key:0,class:`zm-outline-toggle`,title:e.collapsed?`展开`:`折叠`,onClick:k(t=>a.emit(`toggleCollapse`,e.id),[`stop`])},[(g(),r(`svg`,an,[e.collapsed?(g(),r(`polyline`,on)):(g(),r(`polyline`,q))]))],8,rn)):(g(),r(`span`,sn)),a.props.showIndex?(g(),r(`span`,cn,p(e.siblingIndex+1)+`.`,1)):i(`v-if`,!0),a.editingId===e.id?O((g(),r(`input`,{key:3,"onUpdate:modelValue":t[1]||=e=>a.editingText=e,class:`zm-outline-input`,onBlur:a.commitEdit,onKeydown:a.onEditKeydown,onClick:t[2]||=k(()=>{},[`stop`])},null,544)),[[S,a.editingText]]):(g(),r(`span`,ln,p(e.text),1)),a.props.readonly?i(`v-if`,!0):(g(),r(`button`,{key:5,class:`zm-outline-row-action`,title:`编辑文字`,onClick:k(t=>a.startEdit(e),[`stop`])},[...t[5]||=[j(`svg`,{width:`11`,height:`11`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[j(`path`,{d:`M4 20 l4 -1 11 -11 -3 -3 -11 11 z`}),j(`line`,{x1:`14`,y1:`6`,x2:`18`,y2:`10`})],-1)]],8,un)),a.props.readonly?i(`v-if`,!0):(g(),r(`button`,{key:6,class:`zm-outline-row-action`,title:`添加同级`,onClick:k(t=>a.emit(`addSibling`,e.id),[`stop`])},[j(`img`,{src:a.addNodeIcon,width:`14`,height:`14`,alt:`添加同级`,draggable:`false`},null,8,fn)],8,dn)),a.props.readonly?i(`v-if`,!0):(g(),r(`button`,{key:7,class:`zm-outline-row-action`,title:`添加子节点`,onClick:k(t=>a.emit(`addChild`,e.id),[`stop`])},[j(`img`,{src:a.addSubNodeIcon,width:`14`,height:`14`,alt:`添加子节点`,draggable:`false`},null,8,mn)],8,pn)),j(`button`,{class:c([`zm-outline-row-copy`,{"is-success":a.copiedId===e.id}]),title:a.copiedId===e.id?`已复制`:`复制节点文本`,onClick:t=>a.copyNodeText(t,e.text,e.id)},[(g(),r(`svg`,gn,[a.copiedId===e.id?(g(),r(`path`,vn)):(g(),r(`rect`,_n)),t[6]||=j(`path`,{d:`M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1`},null,-1)]))],10,hn)],46,nn))),128))])])}var bn=F(Jt,[[`render`,yn],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/Outline.vue`]]),xn=d({__name:`JsonTreeViewer`,props:{value:{type:null,required:!0},keyName:{type:String,required:!1,default:``},isRoot:{type:Boolean,required:!1,default:!0},path:{type:String,required:!1,default:``},depth:{type:Number,required:!1,default:0},query:{type:String,required:!1,default:``},collapsedPaths:{type:Set,required:!1,default:()=>new Set}},setup(e,{expose:t}){t();let r=e,i=n(()=>r.value===null?`null`:Array.isArray(r.value)?`array`:typeof r.value),a=n(()=>i.value===`object`),o=n(()=>i.value===`array`),s=n(()=>!a.value&&!o.value),c=n(()=>{if(o.value)return`Array(${r.value.length})`;if(a.value){let e=r.value,t=Object.keys(e);return`Object(${t.length} ${t.length===1?`key`:`keys`})`}return``}),l=n(()=>o.value?r.value.map((e,t)=>({key:String(t),value:e})):a.value?Object.entries(r.value).map(([e,t])=>({key:e,value:t})):[]),u=n(()=>r.isRoot?`<root>`:r.path),d=n(()=>r.collapsedPaths.has(u.value));function f(e,t,n){e!==`<root>`&&(n<2||typeof t!=`object`||!t||r.collapsedPaths.has(e)||r.collapsedPaths.add(e))}r.isRoot||f(u.value,r.value,r.depth);function p(){d.value?r.collapsedPaths.delete(u.value):r.collapsedPaths.add(u.value)}function m(e){return u.value===``?e:`${u.value}.${e}`}function h(e){if(!r.query)return!0;let t=r.query.toLowerCase();return typeof e==`string`?e.toLowerCase().includes(t):e===null?`null`.includes(t):String(e).toLowerCase().includes(t)}function g(e){return!r.query||e.toLowerCase().includes(r.query.toLowerCase())}function _(e,t){return!r.query||g(e)?!0:typeof t!=`object`||!t?h(t):!0}function v(e){return e===null?`null`:typeof e==`string`?e.length>80?`"${e.slice(0,80)}..."`:`"${e}"`:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?String(e):typeof e>`u`?`undefined`:JSON.stringify(e)}function y(e){if(typeof e!=`string`)return!1;let t=e.trim();return!!(t.startsWith(`data:image/`)||/^https?:\/\/.+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(t)||/^https?:\/\/.+/i.test(t)&&/\/[^/]+\.(png|jpe?g|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(t))}function b(e){if(!r.query)return null;let t=e.toLowerCase().indexOf(r.query.toLowerCase());return t<0?null:{before:e.slice(0,t),match:e.slice(t,t+r.query.length),after:e.slice(t+r.query.length)}}let x={props:r,type:i,isObject:a,isArray:o,isPrimitive:s,sizeLabel:c,entries:l,myPath:u,isCollapsed:d,applyDefaultCollapse:f,toggle:p,childPath:m,primitiveMatches:h,keyMatches:g,shouldShowEntry:_,displayValue:v,isImageValue:y,highlightMatch:b};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}}),Sn={key:0,class:`zm-jtv-root`},Cn={key:0,class:`zm-jtv-key`},wn={key:1,class:`zm-jtv-colon`},Tn={key:2,class:`zm-jtv-key zm-jtv-bracket`},En={key:3,class:`zm-jtv-size`},J={key:4,class:`zm-jtv-bracket`},Dn={key:5,class:`zm-jtv-brace`},On={key:0,class:`zm-jtv-children`},kn={class:`zm-jtv-key`},An={key:0,class:`zm-jtv-key`},jn=[`src`,`alt`],Mn=[`href`];function Nn(t,n,a,o,u,d){let f=e(`JsonTreeViewer`,!0);return g(),r(M,null,[i(` Root: just the children, no key prefix. `),a.isRoot?(g(),r(`div`,Sn,[(g(!0),r(M,null,_(o.entries,e=>O((g(),r(`div`,{key:e.key,class:`zm-jtv-row`},[l(f,{"key-name":e.key,value:e.value,path:o.childPath(e.key),depth:a.depth+1,query:a.query,"collapsed-paths":a.collapsedPaths,"is-root":!1},null,8,[`key-name`,`value`,`path`,`depth`,`query`,`collapsed-paths`])])),[[b,o.shouldShowEntry(e.key,e.value)]])),128))])):o.isObject||o.isArray?(g(),r(M,{key:1},[i(` Object / array header + children `),j(`div`,{class:c([`zm-jtv-branch`,{"is-collapsed":o.isCollapsed}])},[j(`div`,{class:`zm-jtv-header`,style:s({paddingLeft:6+a.depth*12+`px`}),onClick:o.toggle},[j(`span`,{class:c([`zm-jtv-toggle`,{"is-leaf":!1}])},p(o.isCollapsed?`▶`:`▼`),1),o.isArray?i(`v-if`,!0):(g(),r(`span`,Cn,p(a.keyName),1)),o.isArray?i(`v-if`,!0):(g(),r(`span`,wn,`:`)),o.isArray?(g(),r(`span`,Tn,`[`)):i(`v-if`,!0),o.isCollapsed?(g(),r(`span`,En,p(o.sizeLabel),1)):i(`v-if`,!0),o.isCollapsed&&o.isArray?(g(),r(`span`,J,`]`)):i(`v-if`,!0),o.isCollapsed&&o.isObject?(g(),r(`span`,Dn,`}`)):i(`v-if`,!0)],4),o.isCollapsed?i(`v-if`,!0):(g(),r(`div`,On,[(g(!0),r(M,null,_(o.entries,e=>O((g(),r(`div`,{key:e.key,class:`zm-jtv-row`},[l(f,{"key-name":e.key,value:e.value,path:o.childPath(e.key),depth:a.depth+1,query:a.query,"collapsed-paths":a.collapsedPaths,"is-root":!1},null,8,[`key-name`,`value`,`path`,`depth`,`query`,`collapsed-paths`])])),[[b,o.shouldShowEntry(e.key,e.value)]])),128))])),!o.isCollapsed&&o.isArray?(g(),r(`div`,{key:1,class:`zm-jtv-footer`,style:s({paddingLeft:6+a.depth*12+`px`})},`]`,4)):i(`v-if`,!0),!o.isCollapsed&&o.isObject&&!o.isArray?(g(),r(`div`,{key:2,class:`zm-jtv-footer`,style:s({paddingLeft:6+a.depth*12+`px`})},`}`,4)):i(`v-if`,!0)],2)],2112)):(g(),r(M,{key:2},[i(` Primitive value row `),j(`div`,{class:`zm-jtv-leaf`,style:s({paddingLeft:6+a.depth*12+`px`})},[n[2]||=j(`span`,{class:`zm-jtv-toggle is-leaf`},`·`,-1),j(`span`,kn,p(a.keyName),1),n[3]||=j(`span`,{class:`zm-jtv-colon`},`:`,-1),o.keyMatches(a.keyName)&&o.highlightMatch(a.keyName)?(g(),r(`span`,An,[j(`span`,null,p(o.highlightMatch(a.keyName)?.before),1),j(`mark`,null,p(o.highlightMatch(a.keyName)?.match),1),j(`span`,null,p(o.highlightMatch(a.keyName)?.after),1)])):i(`v-if`,!0),j(`span`,{class:c([`zm-jtv-value`,`zm-jtv-${o.type}`])},[o.highlightMatch(o.displayValue(a.value))?(g(),r(M,{key:0},[j(`span`,null,p(o.highlightMatch(o.displayValue(a.value))?.before),1),j(`mark`,null,p(o.highlightMatch(o.displayValue(a.value))?.match),1),j(`span`,null,p(o.highlightMatch(o.displayValue(a.value))?.after),1)],64)):(g(),r(M,{key:1},[w(p(o.displayValue(a.value)),1)],64))],2),o.isImageValue(a.value)?(g(),r(`span`,{key:1,class:`zm-jtv-thumb-wrap`,onClick:n[1]||=k(()=>{},[`stop`])},[j(`img`,{class:`zm-jtv-thumb`,src:String(a.value),alt:a.keyName,loading:`lazy`,referrerpolicy:`no-referrer`},null,8,jn),j(`a`,{class:`zm-jtv-thumb-link`,href:String(a.value),target:`_blank`,rel:`noopener noreferrer`,onClick:n[0]||=k(()=>{},[`stop`])},`open`,8,Mn)])):i(`v-if`,!0)],4)],2112))],2112)}var Pn=F(xn,[[`render`,Nn],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/JsonTreeViewer.vue`]]),Fn=d({__name:`DataPanel`,props:{data:{type:Object,required:!0},pendingMode:{type:[String,null],required:!1,default:null}},emits:[`import`,`consumed-mode`],setup(e,{expose:t,emit:r}){t();let i=e,a=r,o=n(()=>JSON.stringify(i.data,null,2)),s=A(``),c=A(null),l=A(!1),u=A(`json`),d=A(`idle`),f=A(new Set),p=A(``);C(()=>i.pendingMode,e=>{e&&(l.value=!0,u.value=e,a(`consumed-mode`))},{immediate:!0});async function m(){try{await navigator.clipboard.writeText(o.value),d.value=`copied`,setTimeout(()=>d.value=`idle`,1500)}catch{let e=document.createElement(`textarea`);e.value=o.value,document.body.appendChild(e),e.select();try{document.execCommand(`copy`),d.value=`copied`,setTimeout(()=>d.value=`idle`,1500)}finally{document.body.removeChild(e)}}}function h(){let e=new Blob([o.value],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${i.data.text||`mindmap`}.json`,n.click(),URL.revokeObjectURL(t)}function g(){c.value=null;let e=s.value.trim();if(e){if(u.value===`markdown`||u.value===`txt`){try{let t=lt(e);a(`import`,t),s.value=``,l.value=!1}catch(e){c.value=(u.value===`txt`?`TXT 解析失败:`:`Markdown 解析失败:`)+e.message}return}try{let t=JSON.parse(e);if(!t.id||!Array.isArray(t.children)){c.value=`JSON 缺少 id 或 children 字段`;return}a(`import`,t),s.value=``,l.value=!1}catch(e){c.value=`JSON 解析失败:`+e.message}}}function _(e){return 1+e.children.reduce((e,t)=>e+_(t),0)}let v=n(()=>_(i.data)),y=n(()=>o.value.length);function b(){let e=document.createElement(`input`);e.type=`file`,e.accept=`application/json`,e.onchange=()=>{let t=e.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{typeof n.result==`string`&&(s.value=n.result,g())},n.readAsText(t)},e.click()}let x={props:i,emit:a,json:o,pasteText:s,pasteError:c,pasteOpen:l,pasteMode:u,copyState:d,collapsedPaths:f,searchQuery:p,copyAll:m,downloadJson:h,applyPaste:g,countNodes:_,totalNodes:v,charCount:y,pickFile:b,JsonTreeViewer:Pn};return Object.defineProperty(x,"__isScriptSetup",{enumerable:!1,value:!0}),x}}),In={class:`zm-data-panel`},Ln={class:`zm-data-header`},Rn={class:`zm-data-title`},zn={class:`zm-data-title-meta`},Bn={class:`zm-data-toolbar`},Vn=[`title`],Hn={key:0,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Un={key:1,width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.4`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Wn={key:0,class:`zm-data-paste`},Gn={class:`zm-data-tabs`},Kn=[`placeholder`],qn={key:0,class:`zm-data-error`},Jn={class:`zm-data-paste-actions`},Yn=[`disabled`],Xn={class:`zm-data-tree`};function Zn(e,n,a,o,s,u){return g(),r(`div`,In,[j(`div`,Ln,[j(`div`,Rn,[n[8]||=j(`span`,{class:`zm-data-title-text`},`数据 JSON`,-1),j(`span`,zn,p(o.totalNodes)+` 节点 · `+p(o.charCount)+` chars`,1)])]),j(`div`,Bn,[j(`button`,{class:c([`zm-data-btn is-icon`,{"is-success":o.copyState===`copied`}]),title:o.copyState===`copied`?`已复制`:`复制 JSON 到剪贴板`,onClick:o.copyAll},[o.copyState===`idle`?(g(),r(`svg`,Hn,[...n[9]||=[j(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`},null,-1),j(`path`,{d:`M5 15 H4 a2 2 0 0 1 -2 -2 V4 a2 2 0 0 1 2 -2 h9 a2 2 0 0 1 2 2 v1`},null,-1)]])):(g(),r(`svg`,Un,[...n[10]||=[j(`polyline`,{points:`5 12 10 17 19 7`},null,-1)]])),n[11]||=j(`span`,{class:`zm-data-btn-label`},`复制`,-1)],10,Vn),j(`button`,{class:`zm-data-btn is-icon`,title:`导出为 JSON 文件`,onClick:o.downloadJson},[...n[12]||=[t(`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 4 V15"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导出</span>`,2)]]),j(`button`,{class:`zm-data-btn is-icon`,title:`从 JSON 文件导入`,onClick:o.pickFile},[...n[13]||=[t(`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 15 V4"></path><polyline points="7 9 12 4 17 9"></polyline><path d="M4 19 H20"></path></svg><span class="zm-data-btn-label">导入</span>`,2)]]),j(`button`,{class:c([`zm-data-btn is-icon`,{"is-active":o.pasteOpen}]),title:`粘贴 JSON 或 Markdown 替换当前数据`,onClick:n[0]||=e=>o.pasteOpen=!o.pasteOpen},[...n[14]||=[t(`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4 H15 V8 H9 Z"></path><path d="M9 8 H4 V20 H9"></path><path d="M15 8 H20 V20 H15"></path></svg><span class="zm-data-btn-label">粘贴</span>`,2)]],2),n[16]||=j(`div`,{class:`zm-data-toolbar-spacer`},null,-1),j(`div`,{class:c([`zm-data-search`,{"is-active":o.searchQuery.length>0}])},[n[15]||=j(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[j(`circle`,{cx:`11`,cy:`11`,r:`7`}),j(`line`,{x1:`20`,y1:`20`,x2:`16`,y2:`16`})],-1),O(j(`input`,{"onUpdate:modelValue":n[1]||=e=>o.searchQuery=e,type:`text`,placeholder:`过滤 (键 / 值)`,spellcheck:`false`},null,512),[[S,o.searchQuery]]),o.searchQuery?(g(),r(`button`,{key:0,class:`zm-data-search-clear`,title:`清空过滤`,onClick:n[2]||=e=>o.searchQuery=``},`×`)):i(`v-if`,!0)],2)]),o.pasteOpen?(g(),r(`div`,Wn,[j(`div`,Gn,[j(`button`,{class:c([`zm-data-tab`,{"is-active":o.pasteMode===`json`}]),onClick:n[3]||=e=>o.pasteMode=`json`},`JSON`,2),j(`button`,{class:c([`zm-data-tab`,{"is-active":o.pasteMode===`markdown`}]),onClick:n[4]||=e=>o.pasteMode=`markdown`},`Markdown`,2)]),O(j(`textarea`,{"onUpdate:modelValue":n[5]||=e=>o.pasteText=e,placeholder:o.pasteMode===`json`?`paste a JSON tree to replace current data`:`paste markdown - # / ## / ### become nodes`,spellcheck:`false`},null,8,Kn),[[S,o.pasteText]]),o.pasteError?(g(),r(`div`,qn,p(o.pasteError),1)):i(`v-if`,!0),j(`div`,Jn,[j(`button`,{class:`zm-data-btn is-primary`,disabled:!o.pasteText,onClick:o.applyPaste},`应用`,8,Yn),j(`button`,{class:`zm-data-btn`,onClick:n[6]||=e=>{o.pasteText=``,o.pasteError=null}},`清空`),j(`button`,{class:`zm-data-btn`,onClick:n[7]||=e=>o.pasteOpen=!1},`关闭`)])])):i(`v-if`,!0),j(`div`,Xn,[l(o.JsonTreeViewer,{value:a.data,query:o.searchQuery,"collapsed-paths":o.collapsedPaths},null,8,[`value`,`query`,`collapsed-paths`])]),n[17]||=j(`div`,{class:`zm-data-footer`},[j(`span`,{class:`zm-data-footer-hint`},[w(` 图片支持 `),j(`code`,null,`data:image/...`),w(` / `),j(`code`,null,`https://...`),w(` / `),j(`code`,null,`/imgs/foo.png`),w(` (同源)。本地 `),j(`code`,null,`file://`),w(` 路径被浏览器拒绝。 `)])],-1)])}var Qn=F(Fn,[[`render`,Zn],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/DataPanel.vue`]]),$n=`# flow-mindmap 思维导图
|
|
47
47
|
|
|
48
48
|
[GitHub 仓库](https://github.com/xz333221/flow-mindmap)
|
|
49
49
|
|
|
@@ -82,17 +82,17 @@ import{$n as e,An as t,Cn as n,Dn as r,En as i,Fr as a,Jn as o,Jr as s,Kn as c,M
|
|
|
82
82
|
|
|
83
83
|
## 开源协议
|
|
84
84
|
[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
|
85
|
-
`,er=
|
|
85
|
+
`,er=d({__name:`MarkdownPanel`,props:{data:{type:Object,required:!0}},emits:[`import`],setup(e,{expose:t,emit:r}){t();let i=e,a=r,s=A(ut(i.data)),c=A(null),l=A(null),u=n(()=>{try{let e=lt(s.value||``);return c.value=null,e}catch(e){return c.value=e.message,{id:`preview_fallback`,text:s.value||`(空)`,children:[]}}}),d=n(()=>H(u.value)),f=null;C(s,()=>{f&&clearTimeout(f),f=setTimeout(()=>l.value?.resetView(),250)});function p(){try{let e=lt(s.value||``);c.value=null,a(`import`,e)}catch(e){c.value=e.message}}function m(){s.value=ut(i.data),c.value=null,o(()=>l.value?.resetView())}function h(){s.value=``,c.value=null,o(()=>l.value?.resetView())}function g(){let e=document.createElement(`input`);e.type=`file`,e.accept=`.md,text/markdown,text/plain`,e.onchange=()=>{let t=e.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{typeof n.result==`string`&&(s.value=n.result,c.value=null,o(()=>l.value?.resetView()))},n.readAsText(t)},e.click()}function _(){let e=new Blob([s.value],{type:`text/markdown;charset=utf-8`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${(i.data.text||`mindmap`).trim()||`mindmap`}.md`,n.click(),URL.revokeObjectURL(t)}function v(){s.value=$n,c.value=null,o(()=>l.value?.resetView())}let y={props:i,emit:a,mdText:s,parseError:c,previewRef:l,previewDataRaw:u,previewData:d,get resetTimer(){return f},set resetTimer(e){f=e},applyToData:p,syncFromData:m,clearAll:h,loadFromFile:g,exportToFile:_,STARTER:$n,loadStarter:v,MindMap:_f};return Object.defineProperty(y,"__isScriptSetup",{enumerable:!1,value:!0}),y}}),tr={class:`zm-md-panel`},nr={key:0,class:`zm-md-error`},Y={class:`zm-md-split`},rr={class:`zm-md-edit`},ir={class:`zm-md-preview`},ar={class:`zm-md-preview-body`},or={class:`zm-md-footer`},sr=[`disabled`];function cr(e,t,n,a,o,s){return g(),r(`div`,tr,[j(`div`,{class:`zm-md-toolbar`},[j(`button`,{class:`zm-md-btn`,title:`从 .md 文件加载`,onClick:a.loadFromFile},[...t[1]||=[j(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[j(`path`,{d:`M12 4 V15`}),j(`polyline`,{points:`7 9 12 4 17 9`}),j(`path`,{d:`M4 19 H20`})],-1),j(`span`,null,`加载 .md`,-1)]]),j(`button`,{class:`zm-md-btn`,title:`把当前导图导出为 .md`,onClick:a.exportToFile},[...t[2]||=[j(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[j(`path`,{d:`M12 15 V4`}),j(`polyline`,{points:`7 9 12 4 17 9`}),j(`path`,{d:`M4 19 H20`})],-1),j(`span`,null,`导出 .md`,-1)]]),t[3]||=j(`span`,{class:`zm-md-spacer`},null,-1),j(`button`,{class:`zm-md-btn`,title:`用示例内容填充`,onClick:a.loadStarter},`示例`),j(`button`,{class:`zm-md-btn`,title:`覆盖为当前导图`,onClick:a.syncFromData},`同步`),j(`button`,{class:`zm-md-btn`,title:`清空`,onClick:a.clearAll},`清空`)]),a.parseError?(g(),r(`div`,nr,p(a.parseError),1)):i(`v-if`,!0),j(`div`,Y,[j(`div`,rr,[t[4]||=j(`div`,{class:`zm-md-pane-header`},[j(`span`,null,`Markdown`),j(`span`,{class:`zm-md-hint`},`# 根 · ## 一级 · ### 二级 …`)],-1),O(j(`textarea`,{"onUpdate:modelValue":t[0]||=e=>a.mdText=e,class:`zm-md-textarea`,spellcheck:`false`,placeholder:`# 标题…`},null,512),[[S,a.mdText]])]),j(`div`,ir,[t[5]||=j(`div`,{class:`zm-md-pane-header`},[j(`span`,null,`导图预览`),j(`span`,{class:`zm-md-hint`},`只读`)],-1),j(`div`,ar,[l(a.MindMap,{ref:`previewRef`,data:a.previewData,readonly:``,"preview-mode":``},null,8,[`data`])])])]),j(`div`,or,[j(`button`,{class:`zm-md-btn is-primary`,disabled:!a.mdText.trim(),onClick:a.applyToData},`应用到导图`,8,sr)])])}var lr=F(er,[[`render`,cr],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/MarkdownPanel.vue`]]),ur=d({__name:`SettingsPanel`,props:{settings:{type:Object,required:!0},hasSelection:{type:Boolean,required:!0},selectedNodeText:{type:String,required:!1},nodeStyle:{type:Object,required:!1}},emits:[`update:settings`,`update:nodeStyle`,`reset`],setup(e,{expose:t,emit:r}){t();let i=e,a=r;function o(e,t){a(`update:settings`,{[e]:t})}let s=[{value:`arc`,label:`圆弧`,viewBox:`0 0 28 14`},{value:`rounded-elbow`,label:`圆角折线`,viewBox:`0 0 28 14`},{value:`elbow`,label:`折线`,viewBox:`0 0 28 14`},{value:`straight`,label:`直线`,viewBox:`0 0 28 14`},{value:`curve`,label:`S曲线`,viewBox:`0 0 28 14`}],c=s,l=[{value:`edge`,label:`左右中点`},{value:`center`,label:`节点正中心`},{value:`proportional`,label:`按比例计算`},{value:`xmind`,label:`分散排布`}],u=[{value:100,label:`100`},{value:200,label:`200`},{value:300,label:`300`},{value:400,label:`400 (常规)`},{value:500,label:`500`},{value:600,label:`600 (半粗)`},{value:700,label:`700 (粗体)`},{value:800,label:`800`},{value:900,label:`900`}];function d(e){a(`update:nodeStyle`,e)}let f=n(()=>[...Le,...i.settings.customPalettes]),p=x({});function m(e){return p[e.id]===void 0&&(p[e.id]=e.colors.join(`
|
|
86
86
|
`)),p[e.id]}function h(e){let t=ze(p[e.id]??``);if(t.length===0){p[e.id]=e.colors.join(`
|
|
87
87
|
`);return}let n=i.settings.customPalettes.map(n=>n.id===e.id?{...n,colors:t}:n);a(`update:settings`,{customPalettes:n})}function g(){let e=f.value.find(e=>e.id===i.settings.branchPaletteId),t=e?[...e.colors]:[...Le[0].colors],n=`custom-`,r=n+(i.settings.customPalettes.length+1);for(;Le.some(e=>e.id===r)||i.settings.customPalettes.some(e=>e.id===r);)r=n+Math.random().toString(36).slice(2,7);let o={id:r,name:`我的配色 ${i.settings.customPalettes.length+1}`,colors:t};a(`update:settings`,{customPalettes:[...i.settings.customPalettes,o],branchPaletteId:r}),p[r]=t.join(`
|
|
88
|
-
`)}function _(e){let t=i.settings.customPalettes.filter(t=>t.id!==e.id),n=i.settings.branchPaletteId===e.id?`default`:i.settings.branchPaletteId;a(`update:settings`,{customPalettes:t,...n===i.settings.branchPaletteId?{}:{branchPaletteId:n}}),delete p[e.id]}let v=[`#f87171`,`#fb923c`,`#fbbf24`,`#a3e635`,`#34d399`,`#22d3ee`,`#818cf8`,`#c084fc`,`#1e2937`,`#f8fafc`,`#94a3b8`],y=[`#f8fafc`,`#ffffff`,`#e2e8f0`,`#1e2937`,`#0f172a`,`#fef3c7`,`#dbeafe`,`#dcfce7`,`#fce7f3`,`#f1f5f9`],b=[0,1,2,3],
|
|
88
|
+
`)}function _(e){let t=i.settings.customPalettes.filter(t=>t.id!==e.id),n=i.settings.branchPaletteId===e.id?`default`:i.settings.branchPaletteId;a(`update:settings`,{customPalettes:t,...n===i.settings.branchPaletteId?{}:{branchPaletteId:n}}),delete p[e.id]}let v=[`#f87171`,`#fb923c`,`#fbbf24`,`#a3e635`,`#34d399`,`#22d3ee`,`#818cf8`,`#c084fc`,`#1e2937`,`#f8fafc`,`#94a3b8`],y=[`#f8fafc`,`#ffffff`,`#e2e8f0`,`#1e2937`,`#0f172a`,`#fef3c7`,`#dbeafe`,`#dcfce7`,`#fce7f3`,`#f1f5f9`],b=[0,1,2,3],S=[`#f87171`,`#fb923c`,`#34d399`,`#818cf8`];function C(e,t,n,r){if(t<=1)return n;let i=e/(t-1);return n+(r-n)*i}function w(e,t,n,r){let i=t*r**+e;return Math.max(n,i)}let T={props:i,emit:a,set:o,LINE_STYLE_OPTIONS:s,ROOT_LINE_STYLE_OPTIONS:c,LINE_ORIGIN_OPTIONS:l,FONT_WEIGHT_OPTIONS:u,applyNodeStyleDelta:d,allPalettes:f,customDrafts:p,draftFor:m,commitCustomPalette:h,addCustomPalette:g,deleteCustomPalette:_,PALETTE:v,CANVAS_BG_PRESETS:y,PREVIEW_DEPTHS:b,PREVIEW_PALETTE:S,widthAt:C,taperedParentW:w,previewLines:n(()=>{let e=i.settings.lineWidthStart,t=i.settings.lineWidthEnd,n=i.settings.taperedEdge,r=b.length,a=f.value.find(e=>e.id===i.settings.branchPaletteId),o=a&&a.colors.length?a.colors:S;return b.map((a,s)=>{let c=10+s*60/(r-1);return{x1:8,y1:c,x2:192,y2:c,w:n?w(a,e,t,i.settings.lineWidthTaper):C(a,r,e,t),color:i.settings.rainbowBranch?o[s%o.length]:`#94a3b8`}})})};return Object.defineProperty(T,"__isScriptSetup",{enumerable:!1,value:!0}),T}}),dr={class:`zm-settings-panel`},fr={class:`zm-settings-section`},pr={class:`zm-settings-field`},mr={class:`zm-settings-control`},hr={class:`zm-color-input-wrap`},gr=[`value`],_r={class:`zm-color-input-text`},vr={class:`zm-swatch-row zm-swatch-row--compact`},yr=[`title`,`onClick`],br={class:`zm-settings-field`},xr=[`value`],Sr={class:`zm-slider`},Cr=[`value`],wr={class:`zm-settings-field`},Tr=[`value`],Er={class:`zm-slider`},Dr=[`value`],Or={class:`zm-settings-field zm-line-style-field`},kr={class:`zm-line-style-group`},Ar=[`title`,`onClick`],jr=[`viewBox`],Mr={key:0,d:`M 0 12 Q 14 2, 28 12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},Nr={key:1,d:`M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Pr={key:2,d:`M 0 10 L 16 10 L 16 4 L 28 4`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Fr={key:3,d:`M 0 12 C 8 0, 20 0, 28 12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},Ir={key:4,x1:`0`,y1:`12`,x2:`28`,y2:`12`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},Lr={class:`zm-line-style-label`},Rr={class:`zm-settings-field zm-line-style-field`},zr={class:`zm-line-style-group`},Br=[`title`,`onClick`],Vr=[`viewBox`],Hr={key:0,d:`M 0 12 Q 14 2, 28 12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},Ur={key:1,d:`M 0 10 L 12 10 Q 16 10 16 6 L 16 4 L 28 4`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Wr={key:2,d:`M 0 10 L 16 10 L 16 4 L 28 4`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},Gr={key:3,d:`M 0 12 C 8 0, 20 0, 28 12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},Kr={key:4,x1:`0`,y1:`12`,x2:`28`,y2:`12`,stroke:`currentColor`,"stroke-width":`2.2`,"stroke-linecap":`round`},qr={class:`zm-line-style-label`},Jr={key:0,class:`zm-settings-field`},Yr={class:`zm-settings-label`},Xr={class:`zm-settings-sub`},Zr=[`value`],Qr={key:1,class:`zm-slider`},$r=[`value`],ei={class:`zm-settings-field zm-line-style-field`},ti={class:`zm-line-style-group`},ni=[`title`,`onClick`],ri={viewBox:`0 0 28 18`,width:`28`,height:`18`,preserveAspectRatio:`none`},ii={key:0,d:`M 8 9 L 0 9 M 20 9 L 28 9`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`},ai={key:1,d:`M 14 9 L 0 9 M 14 9 L 28 9`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`},oi={key:2,d:`M 8 7 L 0 4 M 8 9 L 0 9 M 8 11 L 0 14 M 20 7 L 28 4 M 20 9 L 28 9 M 20 11 L 28 14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`},si={key:3,d:`M 11 6 L 8 0 M 8 8 L 0 7 M 8 11 L 0 14 M 17 6 L 20 0 M 20 8 L 28 7 M 20 11 L 28 14`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`},ci={class:`zm-line-style-label`},li={class:`zm-settings-field`},ui={key:2,class:`zm-palette-picker`},di={class:`zm-palette-list`},fi=[`onClick`],pi={class:`zm-palette-option-name`},mi={class:`zm-palette-option-swatches`},hi={key:0,class:`zm-palette-custom-editor`},gi=[`value`],_i={class:`zm-palette-custom-actions`},vi={class:`zm-settings-field`},yi={key:3,class:`zm-settings-field`},bi={class:`zm-settings-label`},xi={class:`zm-settings-sub`},Si=[`value`],Ci={key:4,class:`zm-slider`},wi=[`value`],Ti={key:5,class:`zm-settings-field`},Ei={class:`zm-settings-field`},Di={class:`zm-settings-label`},Oi={class:`zm-settings-sub`},ki=[`value`],Ai={class:`zm-slider`},ji=[`value`],Mi={class:`zm-settings-field`},Ni={class:`zm-settings-preview`},Pi={viewBox:`0 0 200 70`,width:`100%`,height:`70`,preserveAspectRatio:`none`},Fi=[`x1`,`y1`,`x2`,`y2`,`stroke`,`stroke-width`],Ii={key:0,class:`zm-settings-section`},Li={class:`zm-settings-section-title`},Ri={key:0,class:`zm-settings-section-sub`},zi={class:`zm-settings-field`},Bi={class:`zm-settings-value-tag`},Vi={class:`zm-swatch-row`},Hi=[`title`,`onClick`],Ui={class:`zm-swatch zm-swatch--custom`,title:`自定义颜色`},Wi=[`value`],Gi={class:`zm-settings-field`},Ki={class:`zm-settings-value-tag`},qi={class:`zm-swatch-row`},Ji=[`title`,`onClick`],Yi={class:`zm-swatch zm-swatch--custom`,title:`自定义颜色`},Xi=[`value`],Zi={class:`zm-settings-field`},Qi=[`value`],$i=[`value`],ea={class:`zm-settings-field`},ta=[`value`],na={class:`zm-slider`},ra=[`value`],ia={class:`zm-settings-section zm-settings-section--actions`};function aa(e,t,n,a,o,l){return g(),r(`div`,dr,[i(` ============================================================\r
|
|
89
89
|
CANVAS / GLOBAL settings\r
|
|
90
|
-
============================================================ `),j(`section`,fr,[t[52]||=j(`h4`,{class:`zm-settings-section-title`},`画布`,-1),i(` Canvas background color `),j(`div`,pr,[t[27]||=j(`span`,{class:`zm-settings-label`},`画布背景色`,-1),j(`div`,mr,[j(`label`,hr,[j(`input`,{type:`color`,class:`zm-color-input`,value:n.settings.canvasBg||`#f8fafc`,onInput:t[0]||=e=>a.set(`canvasBg`,e.target.value)},null,40,gr),j(`span`,_r,
|
|
90
|
+
============================================================ `),j(`section`,fr,[t[52]||=j(`h4`,{class:`zm-settings-section-title`},`画布`,-1),i(` Canvas background color `),j(`div`,pr,[t[27]||=j(`span`,{class:`zm-settings-label`},`画布背景色`,-1),j(`div`,mr,[j(`label`,hr,[j(`input`,{type:`color`,class:`zm-color-input`,value:n.settings.canvasBg||`#f8fafc`,onInput:t[0]||=e=>a.set(`canvasBg`,e.target.value)},null,40,gr),j(`span`,_r,p(n.settings.canvasBg||`默认`),1)])])]),j(`div`,vr,[(g(),r(M,null,_(a.CANVAS_BG_PRESETS,e=>j(`button`,{key:`cbg-`+e,class:c([`zm-swatch`,{"is-active":(n.settings.canvasBg||`#f8fafc`)===e}]),style:s({background:e}),title:e,onClick:t=>a.set(`canvasBg`,e)},null,14,yr)),64)),j(`button`,{class:`zm-swatch is-reset`,title:`恢复默认`,onClick:t[1]||=e=>a.set(`canvasBg`,void 0)},`∅`)]),t[53]||=j(`div`,{class:`zm-settings-divider`},null,-1),i(` Line width start (root) `),j(`div`,br,[t[28]||=j(`span`,{class:`zm-settings-label`},`线条粗端 (根部)`,-1),j(`input`,{class:`zm-settings-number`,type:`number`,step:`0.2`,value:n.settings.lineWidthStart,onChange:t[2]||=e=>a.set(`lineWidthStart`,parseFloat(e.target.value)||0)},null,40,xr)]),j(`div`,Sr,[t[29]||=j(`div`,{class:`zm-slider-track`},null,-1),j(`input`,{type:`range`,min:`0.4`,max:`20`,step:`0.2`,value:n.settings.lineWidthStart,onInput:t[3]||=e=>a.set(`lineWidthStart`,parseFloat(e.target.value))},null,40,Cr)]),i(` Line width end (leaf) `),j(`div`,wr,[t[30]||=j(`span`,{class:`zm-settings-label`},`线条细端 (子端)`,-1),j(`input`,{class:`zm-settings-number`,type:`number`,step:`0.2`,value:n.settings.lineWidthEnd,onChange:t[4]||=e=>a.set(`lineWidthEnd`,parseFloat(e.target.value)||0)},null,40,Tr)]),j(`div`,Er,[t[31]||=j(`div`,{class:`zm-slider-track`},null,-1),j(`input`,{type:`range`,min:`0.1`,max:`6`,step:`0.1`,value:n.settings.lineWidthEnd,onInput:t[5]||=e=>a.set(`lineWidthEnd`,parseFloat(e.target.value))},null,40,Dr)]),t[54]||=j(`div`,{class:`zm-settings-divider`},null,-1),i(` Root line style `),j(`div`,Or,[t[32]||=j(`span`,{class:`zm-settings-label`},`根节点线条`,-1),j(`div`,kr,[(g(!0),r(M,null,_(a.ROOT_LINE_STYLE_OPTIONS,e=>(g(),r(`button`,{key:e.value,class:c([`zm-line-style-btn`,{"is-on":n.settings.rootLineStyle===e.value}]),title:e.label,onClick:t=>a.set(`rootLineStyle`,e.value)},[(g(),r(`svg`,{viewBox:e.viewBox,width:`28`,height:`14`,preserveAspectRatio:`none`},[e.value===`arc`?(g(),r(`path`,Mr)):e.value===`rounded-elbow`?(g(),r(`path`,Nr)):e.value===`elbow`?(g(),r(`path`,Pr)):e.value===`curve`?(g(),r(`path`,Fr)):(g(),r(`line`,Ir))],8,jr)),j(`span`,Lr,p(e.label),1)],10,Ar))),128))])]),i(` Line style (other nodes) `),j(`div`,Rr,[t[33]||=j(`span`,{class:`zm-settings-label`},`非根节点线条`,-1),j(`div`,zr,[(g(),r(M,null,_(a.LINE_STYLE_OPTIONS,e=>j(`button`,{key:e.value,class:c([`zm-line-style-btn`,{"is-on":n.settings.lineStyle===e.value}]),title:e.label,onClick:t=>a.set(`lineStyle`,e.value)},[(g(),r(`svg`,{viewBox:e.viewBox,width:`28`,height:`14`,preserveAspectRatio:`none`},[e.value===`arc`?(g(),r(`path`,Hr)):e.value===`rounded-elbow`?(g(),r(`path`,Ur)):e.value===`elbow`?(g(),r(`path`,Wr)):e.value===`curve`?(g(),r(`path`,Gr)):(g(),r(`line`,Kr))],8,Vr)),j(`span`,qr,p(e.label),1)],10,Br)),64))])]),i(` Elbow corner radius (only when rounded-elbow is active) `),n.settings.lineStyle===`rounded-elbow`||n.settings.rootLineStyle===`rounded-elbow`?(g(),r(`div`,Jr,[j(`span`,Yr,[t[34]||=w(`圆角大小 `,-1),j(`span`,Xr,p(n.settings.elbowRadius)+`px`,1)]),j(`input`,{class:`zm-settings-number`,type:`number`,step:`1`,min:`2`,max:`40`,value:n.settings.elbowRadius,onChange:t[6]||=e=>a.set(`elbowRadius`,parseFloat(e.target.value)||20)},null,40,Zr)])):i(`v-if`,!0),n.settings.lineStyle===`rounded-elbow`||n.settings.rootLineStyle===`rounded-elbow`?(g(),r(`div`,Qr,[t[35]||=j(`div`,{class:`zm-slider-track`},null,-1),j(`input`,{type:`range`,min:`2`,max:`40`,step:`1`,value:n.settings.elbowRadius,onInput:t[7]||=e=>a.set(`elbowRadius`,parseFloat(e.target.value))},null,40,$r)])):i(`v-if`,!0),i(` Line origin `),j(`div`,ei,[t[37]||=j(`span`,{class:`zm-settings-label`},`线条起点`,-1),j(`div`,ti,[(g(),r(M,null,_(a.LINE_ORIGIN_OPTIONS,e=>j(`button`,{key:e.value,class:c([`zm-line-style-btn`,{"is-on":n.settings.lineOrigin===e.value}]),title:e.label,onClick:t=>a.set(`lineOrigin`,e.value)},[(g(),r(`svg`,ri,[i(` Root node rectangle `),t[36]||=j(`rect`,{x:`8`,y:`6`,width:`12`,height:`6`,rx:`2`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.2`,opacity:`0.5`},null,-1),e.value===`edge`?(g(),r(`path`,ii)):e.value===`center`?(g(),r(`path`,ai)):e.value===`proportional`?(g(),r(`path`,oi)):(g(),r(`path`,si))])),j(`span`,ci,p(e.label),1)],10,ni)),64))])]),i(` Rainbow branches `),j(`div`,li,[t[39]||=j(`span`,{class:`zm-settings-label`},`一级分支彩虹色`,-1),j(`button`,{class:c([`zm-toggle`,{"is-on":n.settings.rainbowBranch}]),onClick:t[8]||=e=>a.set(`rainbowBranch`,!n.settings.rainbowBranch)},[...t[38]||=[j(`span`,{class:`zm-toggle-knob`},null,-1)]],2)]),i(` Palette picker `),n.settings.rainbowBranch?(g(),r(`div`,ui,[t[40]||=j(`div`,{class:`zm-settings-field`},[j(`span`,{class:`zm-settings-label`},`配色方案`)],-1),j(`div`,di,[(g(!0),r(M,null,_(a.allPalettes,e=>(g(),r(`button`,{key:e.id,class:c([`zm-palette-option`,{"is-active":n.settings.branchPaletteId===e.id}]),onClick:t=>a.set(`branchPaletteId`,e.id)},[j(`span`,pi,p(e.name),1),j(`span`,mi,[(g(!0),r(M,null,_(e.colors,(e,t)=>(g(),r(`span`,{key:t,class:`zm-palette-option-swatch`,style:s({background:e})},null,4))),128))])],10,fi))),128))]),i(` Custom palette editor (only show when a custom palette is active) `),n.settings.customPalettes.find(e=>e.id===n.settings.branchPaletteId)?(g(),r(`div`,hi,[j(`textarea`,{class:`zm-palette-textarea`,rows:`3`,spellcheck:`false`,placeholder:`一行一个 hex,例如 #f87171`,value:a.draftFor(n.settings.customPalettes.find(e=>e.id===n.settings.branchPaletteId)),onInput:t[9]||=e=>a.customDrafts[n.settings.customPalettes.find(e=>e.id===n.settings.branchPaletteId).id]=e.target.value},null,40,gi),j(`div`,_i,[j(`button`,{type:`button`,class:`zm-data-btn is-primary`,onClick:t[10]||=e=>a.commitCustomPalette(n.settings.customPalettes.find(e=>e.id===n.settings.branchPaletteId))},`保存`),j(`button`,{type:`button`,class:`zm-data-btn`,onClick:t[11]||=e=>a.deleteCustomPalette(n.settings.customPalettes.find(e=>e.id===n.settings.branchPaletteId))},`删除`)])])):i(`v-if`,!0),j(`button`,{type:`button`,class:`zm-palette-add`,onClick:a.addCustomPalette},`+ 新建配色`)])):i(`v-if`,!0),t[55]||=j(`div`,{class:`zm-settings-divider`},null,-1),i(` Tapered edge `),j(`div`,vi,[t[42]||=j(`span`,{class:`zm-settings-label`},`每条连线独立渐变`,-1),j(`button`,{class:c([`zm-toggle`,{"is-on":n.settings.taperedEdge}]),onClick:t[12]||=e=>a.set(`taperedEdge`,!n.settings.taperedEdge)},[...t[41]||=[j(`span`,{class:`zm-toggle-knob`},null,-1)]],2)]),i(` Line width taper ratio (only relevant in tapered mode) `),n.settings.taperedEdge?(g(),r(`div`,yi,[j(`span`,bi,[t[43]||=w(`层级衰减 `,-1),j(`span`,xi,p(Math.round(n.settings.lineWidthTaper*100))+`%`,1)]),j(`input`,{class:`zm-settings-number`,type:`number`,step:`0.05`,min:`0.1`,max:`1`,value:n.settings.lineWidthTaper,onChange:t[13]||=e=>a.set(`lineWidthTaper`,parseFloat(e.target.value)||.67)},null,40,Si)])):i(`v-if`,!0),n.settings.taperedEdge?(g(),r(`div`,Ci,[t[44]||=j(`div`,{class:`zm-slider-track`},null,-1),j(`input`,{type:`range`,min:`0.1`,max:`1`,step:`0.01`,value:n.settings.lineWidthTaper,onInput:t[14]||=e=>a.set(`lineWidthTaper`,parseFloat(e.target.value))},null,40,wi)])):i(`v-if`,!0),i(` Uniform non-root line width (only relevant in tapered mode) `),n.settings.taperedEdge?(g(),r(`div`,Ti,[t[46]||=j(`span`,{class:`zm-settings-label`},`非根节点相同粗细`,-1),j(`button`,{class:c([`zm-toggle`,{"is-on":n.settings.uniformLineWidth}]),onClick:t[15]||=e=>a.set(`uniformLineWidth`,!n.settings.uniformLineWidth)},[...t[45]||=[j(`span`,{class:`zm-toggle-knob`},null,-1)]],2)])):i(`v-if`,!0),i(` Branch gap (extra spacing between first-level branches) `),j(`div`,Ei,[j(`span`,Di,[t[47]||=w(`一级分支间距 `,-1),j(`span`,Oi,p(n.settings.branchGap)+`px`,1)]),j(`input`,{class:`zm-settings-number`,type:`number`,step:`2`,min:`0`,max:`80`,value:n.settings.branchGap,onChange:t[16]||=e=>a.set(`branchGap`,parseFloat(e.target.value)||0)},null,40,ki)]),j(`div`,Ai,[t[48]||=j(`div`,{class:`zm-slider-track`},null,-1),j(`input`,{type:`range`,min:`0`,max:`80`,step:`2`,value:n.settings.branchGap,onInput:t[17]||=e=>a.set(`branchGap`,parseFloat(e.target.value))},null,40,ji)]),i(` Order badge `),j(`div`,Mi,[t[50]||=j(`span`,{class:`zm-settings-label`},`显示节点序号`,-1),j(`button`,{class:c([`zm-toggle`,{"is-on":n.settings.showOrderBadge}]),onClick:t[18]||=e=>a.set(`showOrderBadge`,!n.settings.showOrderBadge)},[...t[49]||=[j(`span`,{class:`zm-toggle-knob`},null,-1)]],2)]),i(` Preview `),j(`div`,Ni,[(g(),r(`svg`,Pi,[(g(!0),r(M,null,_(a.previewLines,(e,t)=>(g(),r(`line`,{key:t,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:n.settings.rainbowBranch?e.color:`#94a3b8`,"stroke-width":e.w,"stroke-linecap":`butt`},null,8,Fi))),128))])),t[51]||=j(`div`,{class:`zm-settings-preview-labels`},[j(`span`,null,`根`),j(`span`,null,`1级`),j(`span`,null,`2级`),j(`span`,null,`3级`)],-1)])]),i(` ============================================================\r
|
|
91
91
|
NODE-LEVEL overrides — only when a node is selected.\r
|
|
92
92
|
Immediate-apply: every control emits on change.\r
|
|
93
|
-
============================================================ `),n.hasSelection?(h(),r(`section`,Ii,[j(`h4`,Li,[t[56]||=w(` 节点 `,-1),n.selectedNodeText?(h(),r(`span`,Ri,`"`+b(n.selectedNodeText)+`"`,1)):i(`v-if`,!0)]),i(` Background color `),j(`div`,zi,[t[57]||=j(`span`,{class:`zm-settings-label`},`背景颜色`,-1),j(`span`,Bi,b(n.nodeStyle?.bg||`默认`),1)]),j(`div`,Vi,[(h(),r(M,null,d(a.PALETTE,e=>j(`button`,{key:`bg-`+e,class:s([`zm-swatch`,{"is-active":n.nodeStyle?.bg===e}]),style:g({background:e}),title:e,onClick:t=>a.applyNodeStyleDelta({bg:e})},null,14,Hi)),64)),j(`label`,Ui,[j(`input`,{type:`color`,value:n.nodeStyle?.bg||`#ffffff`,onInput:t[19]||=e=>a.applyNodeStyleDelta({bg:e.target.value})},null,40,Wi)]),j(`button`,{class:`zm-swatch is-reset`,title:`清除`,onClick:t[20]||=e=>a.applyNodeStyleDelta({bg:void 0})},`∅`)]),i(` Text color `),j(`div`,Gi,[t[58]||=j(`span`,{class:`zm-settings-label`},`文字颜色`,-1),j(`span`,Ki,b(n.nodeStyle?.textColor||`默认`),1)]),j(`div`,qi,[(h(),r(M,null,d(a.PALETTE,e=>j(`button`,{key:`fg-`+e,class:s([`zm-swatch`,{"is-active":n.nodeStyle?.textColor===e}]),style:g({background:e}),title:e,onClick:t=>a.applyNodeStyleDelta({textColor:e})},null,14,Ji)),64)),j(`label`,Yi,[j(`input`,{type:`color`,value:n.nodeStyle?.textColor||`#1e2937`,onInput:t[21]||=e=>a.applyNodeStyleDelta({textColor:e.target.value})},null,40,Xi)]),j(`button`,{class:`zm-swatch is-reset`,title:`清除`,onClick:t[22]||=e=>a.applyNodeStyleDelta({textColor:void 0})},`∅`)]),t[62]||=j(`div`,{class:`zm-settings-divider`},null,-1),i(` Font weight `),j(`div`,Zi,[t[59]||=j(`span`,{class:`zm-settings-label`},`字重`,-1),j(`select`,{class:`zm-select`,value:n.nodeStyle?.fontWeight??400,onChange:t[23]||=e=>a.applyNodeStyleDelta({fontWeight:parseInt(e.target.value)})},[(h(),r(M,null,d(a.FONT_WEIGHT_OPTIONS,e=>j(`option`,{key:e.value,value:e.value},b(e.label),9,$i)),64))],40,Qi)]),i(` Font size `),j(`div`,ea,[t[60]||=j(`span`,{class:`zm-settings-label`},`文字大小`,-1),j(`input`,{class:`zm-settings-number`,type:`number`,step:`1`,min:`8`,max:`48`,value:n.nodeStyle?.fontSize??14,onChange:t[24]||=e=>a.applyNodeStyleDelta({fontSize:parseInt(e.target.value)||14})},null,40,ta)]),j(`div`,na,[t[61]||=j(`div`,{class:`zm-slider-track`},null,-1),j(`input`,{type:`range`,min:`8`,max:`48`,step:`1`,value:n.nodeStyle?.fontSize??14,onInput:t[25]||=e=>a.applyNodeStyleDelta({fontSize:parseInt(e.target.value)})},null,40,ra)]),t[63]||=j(`p`,{class:`zm-settings-hint`},`仅作用于当前节点,不影响子节点。`,-1)])):i(`v-if`,!0),j(`section`,ia,[j(`button`,{class:`zm-settings-reset`,onClick:t[26]||=e=>a.emit(`reset`)},`恢复默认设置`)])])}var oa=F(ur,[[`render`,aa],[`__scopeId`,`data-v-89c2361e`],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/SettingsPanel.vue`]]),sa=20;function ca(e,t){e.style.height=`auto`;let n=t.minRows*sa,r=t.maxRows>0?t.maxRows*sa:1/0,i=Math.max(n,Math.min(r,e.scrollHeight));e.style.height=i+`px`,e.style.overflowY=e.scrollHeight>r?`auto`:`hidden`}function la(e,t={}){let n={minRows:t.minRows??3,maxRows:t.maxRows??12};function r(){let t=e.value;t&&ca(t,n)}function i(){r()}o(async()=>{await m();let t=e.value;t&&(t.addEventListener(`input`,i),r())}),D(()=>e.value?.value,()=>r()),c(()=>{let t=e.value;t&&t.removeEventListener(`input`,i)})}function ua(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function da(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t],r=typeof n;(r===`object`||r===`function`)&&!Object.isFrozen(n)&&da(n)}),e}var fa=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function pa(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function ma(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var ha=`</span>`,ga=e=>!!e.scope,_a=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},va=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=pa(e)}openNode(e){if(!ga(e))return;let t=_a(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){ga(e)&&(this.buffer+=ha)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},ya=(e={})=>{let t={children:[]};return Object.assign(t,e),t},ba=class e{constructor(){this.rootNode=ya(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=ya({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},xa=class extends ba{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new va(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Sa(e){return e?typeof e==`string`?e:e.source:null}function Ca(e){return Ea(`(?=`,e,`)`)}function wa(e){return Ea(`(?:`,e,`)*`)}function Ta(e){return Ea(`(?:`,e,`)?`)}function Ea(...e){return e.map(e=>Sa(e)).join(``)}function Da(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Oa(...e){return`(`+(Da(e).capture?``:`?:`)+e.map(e=>Sa(e)).join(`|`)+`)`}function ka(e){return RegExp(e.toString()+`|`).exec(``).length-1}function Aa(e,t){let n=e&&e.exec(t);return n&&n.index===0}var ja=new RegExp(Oa(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function Ma(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=Sa(e),i=``;for(;r.length>0;){let e=ja.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],(e[0]===`(`||/^\(\?[<']/.test(e[0]))&&n++)}return i}).map(e=>`(${e})`).join(t)}var Na=/\b\B/,Pa=`[a-zA-Z]\\w*`,Fa=`[a-zA-Z_]\\w*`,Ia=`\\b\\d+(\\.\\d+)?`,La=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,Ra=`\\b(0b[01]+)`,za=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,Ba=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=Ea(t,/.*\b/,e.binary,/\b.*/)),ma({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},Va={begin:`\\\\[\\s\\S]`,relevance:0},Ha={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[Va]},Ua={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[Va]},Wa={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/},Ga=function(e,t,n={}){let r=ma({scope:`comment`,begin:e,end:t,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});let i=Oa(`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:Ea(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},Ka=Ga(`//`,`$`),qa=Ga(`/\\*`,`\\*/`),Ja=Ga(`#`,`$`),Ya={scope:`number`,begin:Ia,relevance:0},Xa={scope:`number`,begin:La,relevance:0},Za={scope:`number`,begin:Ra,relevance:0},Qa={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Va,{begin:/\[/,end:/\]/,relevance:0,contains:[Va]}]},$a={scope:`title`,begin:Pa,relevance:0},eo={scope:`title`,begin:Fa,relevance:0},to={begin:`\\.\\s*`+Fa,relevance:0},no=Object.freeze({__proto__:null,APOS_STRING_MODE:Ha,BACKSLASH_ESCAPE:Va,BINARY_NUMBER_MODE:Za,BINARY_NUMBER_RE:Ra,COMMENT:Ga,C_BLOCK_COMMENT_MODE:qa,C_LINE_COMMENT_MODE:Ka,C_NUMBER_MODE:Xa,C_NUMBER_RE:La,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:Ja,IDENT_RE:Pa,MATCH_NOTHING_RE:Na,METHOD_GUARD:to,NUMBER_MODE:Ya,NUMBER_RE:Ia,PHRASAL_WORDS_MODE:Wa,QUOTE_STRING_MODE:Ua,REGEXP_MODE:Qa,RE_STARTERS_RE:za,SHEBANG:Ba,TITLE_MODE:$a,UNDERSCORE_IDENT_RE:Fa,UNDERSCORE_TITLE_MODE:eo});function ro(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function io(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ao(e,t){t&&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 oo(e,t){Array.isArray(e.illegal)&&(e.illegal=Oa(...e.illegal))}function so(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function co(e,t){e.relevance===void 0&&(e.relevance=1)}var lo=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=Ea(n.beforeMatch,Ca(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},uo=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],fo=`keyword`;function po(e,t,n=fo){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,po(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,mo(n[0],n[1])]})}}function mo(e,t){return t?Number(t):+!ho(e)}function ho(e){return uo.includes(e.toLowerCase())}var go={},_o=e=>{console.error(e)},vo=(e,...t)=>{console.log(`WARN: ${e}`,...t)},yo=(e,t)=>{go[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),go[`${e}/${t}`]=!0)},bo=Error();function xo(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=ka(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function So(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw _o(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),bo;if(typeof e.beginScope!=`object`||e.beginScope===null)throw _o(`beginScope must be object`),bo;xo(e,e.begin,{key:`beginScope`}),e.begin=Ma(e.begin,{joinWith:``})}}function Co(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw _o(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),bo;if(typeof e.endScope!=`object`||e.endScope===null)throw _o(`endScope must be object`),bo;xo(e,e.end,{key:`endScope`}),e.end=Ma(e.end,{joinWith:``})}}function wo(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function To(e){wo(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),So(e),Co(e)}function Eo(e){function t(t,n){return new RegExp(Sa(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=ka(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(Ma(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function a(n,r){let o=n;if(n.isCompiled)return o;[io,so,To,lo].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ao,oo,co].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=po(n.keywords,e.case_insensitive),o.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,o.beginRe=t(o.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(o.endRe=t(o.end)),o.terminatorEnd=Sa(o.end)||``,n.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(o.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Oo(e===`self`?n:e)})),n.contains.forEach(function(e){a(e,o)}),n.starts&&a(n.starts,r),o.matcher=i(o),o}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=ma(e.classNameAliases||{}),a(e)}function Do(e){return e?e.endsWithParent||Do(e.starts):!1}function Oo(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ma(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Do(e)?ma(e,{starts:e.starts?ma(e.starts):null}):Object.isFrozen(e)?ma(e):e}var ko=`11.12.0`,Ao=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},jo=pa,Mo=ma,No=Symbol(`nomatch`),Po=7,Fo=function(e){let t=Object.create(null),n=Object.create(null),r=[],i=!0,a=`Could not find the language '{}', did you forget to load/include a language module?`,o={disableAutodetect:!0,name:`Plain text`,contains:[]},s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:xa};function c(e){return s.noHighlightRe.test(e)}function l(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=s.languageDetectRe.exec(t);if(n){let t=w(n[1]);return t||(vo(a.replace(`{}`,n[1])),vo(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>c(e)||w(e))}function u(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(yo(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),yo(`10.7.0`,`Please use highlight(code, options) instead.
|
|
93
|
+
============================================================ `),n.hasSelection?(g(),r(`section`,Ii,[j(`h4`,Li,[t[56]||=w(` 节点 `,-1),n.selectedNodeText?(g(),r(`span`,Ri,`"`+p(n.selectedNodeText)+`"`,1)):i(`v-if`,!0)]),i(` Background color `),j(`div`,zi,[t[57]||=j(`span`,{class:`zm-settings-label`},`背景颜色`,-1),j(`span`,Bi,p(n.nodeStyle?.bg||`默认`),1)]),j(`div`,Vi,[(g(),r(M,null,_(a.PALETTE,e=>j(`button`,{key:`bg-`+e,class:c([`zm-swatch`,{"is-active":n.nodeStyle?.bg===e}]),style:s({background:e}),title:e,onClick:t=>a.applyNodeStyleDelta({bg:e})},null,14,Hi)),64)),j(`label`,Ui,[j(`input`,{type:`color`,value:n.nodeStyle?.bg||`#ffffff`,onInput:t[19]||=e=>a.applyNodeStyleDelta({bg:e.target.value})},null,40,Wi)]),j(`button`,{class:`zm-swatch is-reset`,title:`清除`,onClick:t[20]||=e=>a.applyNodeStyleDelta({bg:void 0})},`∅`)]),i(` Text color `),j(`div`,Gi,[t[58]||=j(`span`,{class:`zm-settings-label`},`文字颜色`,-1),j(`span`,Ki,p(n.nodeStyle?.textColor||`默认`),1)]),j(`div`,qi,[(g(),r(M,null,_(a.PALETTE,e=>j(`button`,{key:`fg-`+e,class:c([`zm-swatch`,{"is-active":n.nodeStyle?.textColor===e}]),style:s({background:e}),title:e,onClick:t=>a.applyNodeStyleDelta({textColor:e})},null,14,Ji)),64)),j(`label`,Yi,[j(`input`,{type:`color`,value:n.nodeStyle?.textColor||`#1e2937`,onInput:t[21]||=e=>a.applyNodeStyleDelta({textColor:e.target.value})},null,40,Xi)]),j(`button`,{class:`zm-swatch is-reset`,title:`清除`,onClick:t[22]||=e=>a.applyNodeStyleDelta({textColor:void 0})},`∅`)]),t[62]||=j(`div`,{class:`zm-settings-divider`},null,-1),i(` Font weight `),j(`div`,Zi,[t[59]||=j(`span`,{class:`zm-settings-label`},`字重`,-1),j(`select`,{class:`zm-select`,value:n.nodeStyle?.fontWeight??400,onChange:t[23]||=e=>a.applyNodeStyleDelta({fontWeight:parseInt(e.target.value)})},[(g(),r(M,null,_(a.FONT_WEIGHT_OPTIONS,e=>j(`option`,{key:e.value,value:e.value},p(e.label),9,$i)),64))],40,Qi)]),i(` Font size `),j(`div`,ea,[t[60]||=j(`span`,{class:`zm-settings-label`},`文字大小`,-1),j(`input`,{class:`zm-settings-number`,type:`number`,step:`1`,min:`8`,max:`48`,value:n.nodeStyle?.fontSize??14,onChange:t[24]||=e=>a.applyNodeStyleDelta({fontSize:parseInt(e.target.value)||14})},null,40,ta)]),j(`div`,na,[t[61]||=j(`div`,{class:`zm-slider-track`},null,-1),j(`input`,{type:`range`,min:`8`,max:`48`,step:`1`,value:n.nodeStyle?.fontSize??14,onInput:t[25]||=e=>a.applyNodeStyleDelta({fontSize:parseInt(e.target.value)})},null,40,ra)]),t[63]||=j(`p`,{class:`zm-settings-hint`},`仅作用于当前节点,不影响子节点。`,-1)])):i(`v-if`,!0),j(`section`,ia,[j(`button`,{class:`zm-settings-reset`,onClick:t[26]||=e=>a.emit(`reset`)},`恢复默认设置`)])])}var oa=F(ur,[[`render`,aa],[`__scopeId`,`data-v-89c2361e`],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/SettingsPanel.vue`]]),sa=20;function ca(e,t){e.style.height=`auto`;let n=t.minRows*sa,r=t.maxRows>0?t.maxRows*sa:1/0,i=Math.max(n,Math.min(r,e.scrollHeight));e.style.height=i+`px`,e.style.overflowY=e.scrollHeight>r?`auto`:`hidden`}function la(e,t={}){let n={minRows:t.minRows??3,maxRows:t.maxRows??12};function r(){let t=e.value;t&&ca(t,n)}function i(){r()}ee(async()=>{await o();let t=e.value;t&&(t.addEventListener(`input`,i),r())}),C(()=>e.value?.value,()=>r()),a(()=>{let t=e.value;t&&t.removeEventListener(`input`,i)})}function ua(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function da(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t],r=typeof n;(r===`object`||r===`function`)&&!Object.isFrozen(n)&&da(n)}),e}var fa=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function pa(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function ma(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var ha=`</span>`,ga=e=>!!e.scope,_a=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},va=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=pa(e)}openNode(e){if(!ga(e))return;let t=_a(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){ga(e)&&(this.buffer+=ha)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},ya=(e={})=>{let t={children:[]};return Object.assign(t,e),t},ba=class e{constructor(){this.rootNode=ya(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=ya({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},xa=class extends ba{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new va(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Sa(e){return e?typeof e==`string`?e:e.source:null}function Ca(e){return Ea(`(?=`,e,`)`)}function wa(e){return Ea(`(?:`,e,`)*`)}function Ta(e){return Ea(`(?:`,e,`)?`)}function Ea(...e){return e.map(e=>Sa(e)).join(``)}function Da(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Oa(...e){return`(`+(Da(e).capture?``:`?:`)+e.map(e=>Sa(e)).join(`|`)+`)`}function ka(e){return RegExp(e.toString()+`|`).exec(``).length-1}function Aa(e,t){let n=e&&e.exec(t);return n&&n.index===0}var ja=new RegExp(Oa(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function Ma(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=Sa(e),i=``;for(;r.length>0;){let e=ja.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],(e[0]===`(`||/^\(\?[<']/.test(e[0]))&&n++)}return i}).map(e=>`(${e})`).join(t)}var Na=/\b\B/,Pa=`[a-zA-Z]\\w*`,Fa=`[a-zA-Z_]\\w*`,Ia=`\\b\\d+(\\.\\d+)?`,La=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,Ra=`\\b(0b[01]+)`,za=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,Ba=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=Ea(t,/.*\b/,e.binary,/\b.*/)),ma({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},Va={begin:`\\\\[\\s\\S]`,relevance:0},Ha={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[Va]},Ua={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[Va]},Wa={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/},Ga=function(e,t,n={}){let r=ma({scope:`comment`,begin:e,end:t,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});let i=Oa(`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:Ea(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},Ka=Ga(`//`,`$`),qa=Ga(`/\\*`,`\\*/`),Ja=Ga(`#`,`$`),Ya={scope:`number`,begin:Ia,relevance:0},Xa={scope:`number`,begin:La,relevance:0},Za={scope:`number`,begin:Ra,relevance:0},Qa={scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Va,{begin:/\[/,end:/\]/,relevance:0,contains:[Va]}]},$a={scope:`title`,begin:Pa,relevance:0},eo={scope:`title`,begin:Fa,relevance:0},to={begin:`\\.\\s*`+Fa,relevance:0},no=Object.freeze({__proto__:null,APOS_STRING_MODE:Ha,BACKSLASH_ESCAPE:Va,BINARY_NUMBER_MODE:Za,BINARY_NUMBER_RE:Ra,COMMENT:Ga,C_BLOCK_COMMENT_MODE:qa,C_LINE_COMMENT_MODE:Ka,C_NUMBER_MODE:Xa,C_NUMBER_RE:La,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:Ja,IDENT_RE:Pa,MATCH_NOTHING_RE:Na,METHOD_GUARD:to,NUMBER_MODE:Ya,NUMBER_RE:Ia,PHRASAL_WORDS_MODE:Wa,QUOTE_STRING_MODE:Ua,REGEXP_MODE:Qa,RE_STARTERS_RE:za,SHEBANG:Ba,TITLE_MODE:$a,UNDERSCORE_IDENT_RE:Fa,UNDERSCORE_TITLE_MODE:eo});function ro(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function io(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ao(e,t){t&&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 oo(e,t){Array.isArray(e.illegal)&&(e.illegal=Oa(...e.illegal))}function so(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function co(e,t){e.relevance===void 0&&(e.relevance=1)}var lo=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=Ea(n.beforeMatch,Ca(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},uo=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],fo=`keyword`;function po(e,t,n=fo){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,po(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,mo(n[0],n[1])]})}}function mo(e,t){return t?Number(t):+!ho(e)}function ho(e){return uo.includes(e.toLowerCase())}var go={},_o=e=>{console.error(e)},vo=(e,...t)=>{console.log(`WARN: ${e}`,...t)},yo=(e,t)=>{go[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),go[`${e}/${t}`]=!0)},bo=Error();function xo(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=ka(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function So(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw _o(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),bo;if(typeof e.beginScope!=`object`||e.beginScope===null)throw _o(`beginScope must be object`),bo;xo(e,e.begin,{key:`beginScope`}),e.begin=Ma(e.begin,{joinWith:``})}}function Co(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw _o(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),bo;if(typeof e.endScope!=`object`||e.endScope===null)throw _o(`endScope must be object`),bo;xo(e,e.end,{key:`endScope`}),e.end=Ma(e.end,{joinWith:``})}}function wo(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function To(e){wo(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),So(e),Co(e)}function Eo(e){function t(t,n){return new RegExp(Sa(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=ka(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(Ma(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function a(n,r){let o=n;if(n.isCompiled)return o;[io,so,To,lo].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ao,oo,co].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=po(n.keywords,e.case_insensitive),o.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,o.beginRe=t(o.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(o.endRe=t(o.end)),o.terminatorEnd=Sa(o.end)||``,n.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(o.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Oo(e===`self`?n:e)})),n.contains.forEach(function(e){a(e,o)}),n.starts&&a(n.starts,r),o.matcher=i(o),o}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=ma(e.classNameAliases||{}),a(e)}function Do(e){return e?e.endsWithParent||Do(e.starts):!1}function Oo(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return ma(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Do(e)?ma(e,{starts:e.starts?ma(e.starts):null}):Object.isFrozen(e)?ma(e):e}var ko=`11.12.0`,Ao=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},jo=pa,Mo=ma,No=Symbol(`nomatch`),Po=7,Fo=function(e){let t=Object.create(null),n=Object.create(null),r=[],i=!0,a=`Could not find the language '{}', did you forget to load/include a language module?`,o={disableAutodetect:!0,name:`Plain text`,contains:[]},s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:xa};function c(e){return s.noHighlightRe.test(e)}function l(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=s.languageDetectRe.exec(t);if(n){let t=w(n[1]);return t||(vo(a.replace(`{}`,n[1])),vo(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>c(e)||w(e))}function u(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(yo(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),yo(`10.7.0`,`Please use highlight(code, options) instead.
|
|
94
94
|
https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};k(`before:highlight`,a);let o=a.result?a.result:d(a.language,a.code,n);return o.code=a.code,k(`after:highlight`,o),o}function d(e,n,r,o){let c=Object.create(null);function l(e,t){return e.keywords[t]}function u(){if(!O.keywords){A.addText(j);return}let e=0;O.keywordPatternRe.lastIndex=0;let t=O.keywordPatternRe.exec(j),n=``;for(;t;){n+=j.substring(e,t.index);let r=E.case_insensitive?t[0].toLowerCase():t[0],i=l(O,r);if(i){let[e,a]=i;if(A.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Po&&(M+=a),e.startsWith(`_`))n+=t[0];else{let n=E.classNameAliases[e]||e;h(t[0],n)}}else n+=t[0];e=O.keywordPatternRe.lastIndex,t=O.keywordPatternRe.exec(j)}n+=j.substring(e),A.addText(n)}function f(){if(j===``)return;let e=null;if(typeof O.subLanguage==`string`){if(!t[O.subLanguage]){A.addText(j);return}e=d(O.subLanguage,j,!0,k[O.subLanguage]),k[O.subLanguage]=e._top}else e=p(j,O.subLanguage.length?O.subLanguage:null);O.relevance>0&&(M+=e.relevance),A.__addSublanguage(e._emitter,e.language)}function m(){O.subLanguage==null?u():f(),j=``}function h(e,t){e!==``&&(A.startScope(t),A.addText(e),A.endScope())}function g(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=E.classNameAliases[e[n]]||e[n],i=t[n];r?h(i,r):(j=i,u(),j=``),n++}}function _(e,t){return e.scope&&typeof e.scope==`string`&&A.openNode(E.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(h(j,E.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),j=``):e.beginScope._multi&&(g(e.beginScope,t),j=``)),O=Object.create(e,{parent:{value:O}}),O}function v(e,t,n){let r=Aa(e.endRe,n);if(r){if(e[`on:end`]){let n=new fa(e);e[`on:end`](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return v(e.parent,t,n)}function y(e){return O.matcher.regexIndex===0?(j+=e[0],1):(P=!0,0)}function b(e){let t=e[0],n=e.rule,r=new fa(n),i=[n.__beforeBegin,n[`on:begin`]];for(let n of i)if(n&&(n(e,r),r.isMatchIgnored))return y(t);return n.skip?j+=t:(n.excludeBegin&&(j+=t),m(),!n.returnBegin&&!n.excludeBegin&&(j=t)),_(n,e),n.returnBegin?0:t.length}function x(e){let t=e[0],r=n.substring(e.index),i=v(O,e,r);if(!i)return No;let a=O;O.endScope&&O.endScope._wrap?(m(),h(t,O.endScope._wrap)):O.endScope&&O.endScope._multi?(m(),g(O.endScope,e)):a.skip?j+=t:(a.returnEnd||a.excludeEnd||(j+=t),m(),a.excludeEnd&&(j=t));do O.scope&&A.closeNode(),!O.skip&&!O.subLanguage&&(M+=O.relevance),O=O.parent;while(O!==i.parent);return i.starts&&_(i.starts,e),a.returnEnd?0:t.length}function S(){let e=[];for(let t=O;t!==E;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>A.openNode(e))}let C={};function T(t,a){let o=a&&a[0];if(j+=t,o==null)return m(),0;if(C.type===`begin`&&a.type===`end`&&C.index===a.index&&o===``){if(j+=n.slice(a.index,a.index+1),!i){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=C.rule,t}return 1}if(C=a,a.type===`begin`)return b(a);if(a.type===`illegal`&&!r){let e=Error(`Illegal lexeme "`+o+`" for mode "`+(O.scope||`<unnamed>`)+`"`);throw e.mode=O,e}if(a.type===`end`){let e=x(a);if(e!==No)return e}if(a.type===`illegal`&&o===``)return a.index===n.length||(j+=`
|
|
95
|
-
`),1;if(te>1e5&&te>a.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return j+=o,o.length}let E=w(e);if(!E)throw _o(a.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let D=Eo(E),ee=``,O=o||D,k={},A=new s.__emitter(s);S();let j=``,M=0,N=0,te=0,P=!1;try{if(E.__emitTokens)E.__emitTokens(n,A);else{for(O.matcher.considerAll();;){te++,P?P=!1:O.matcher.considerAll(),O.matcher.lastIndex=N;let e=O.matcher.exec(n);if(!e)break;let t=T(n.substring(N,e.index),e);N=e.index+t}T(n.substring(N))}return A.finalize(),ee=A.toHTML(),{language:e,value:ee,relevance:M,illegal:!1,_emitter:A,_top:O}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:jo(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:N,context:n.slice(N-100,N+100),mode:t.mode,resultSoFar:ee},_emitter:A};if(i)return{language:e,value:jo(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:O};throw t}}function f(e){let t={value:jo(e),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return t._emitter.addText(e),t}function p(e,n){n=n||s.languages||Object.keys(t);let r=f(e),i=n.filter(w).filter(E).map(t=>d(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(w(e.language).supersetOf===t.language)return 1;if(w(t.language).supersetOf===e.language)return-1}return 0}),c=a;return c.secondBest=o,c}function m(e,t,r){let i=t&&n[t]||r;e.classList.add(`hljs`),e.classList.add(`language-${i}`)}function h(e){let t=null,n=l(e);if(c(n))return;if(k(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(s.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)),s.throwUnescapedHTML))throw new Ao(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?u(r,{language:n,ignoreIllegals:!0}):p(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,m(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),k(`after:highlightElement`,{el:e,result:i,text:r})}function g(e){s=Mo(s,e)}let _=()=>{b(),yo(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function v(){b(),yo(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let y=!1;function b(){function e(){b()}if(document.readyState===`loading`){y||window.addEventListener(`DOMContentLoaded`,e,!1),y=!0;return}document.querySelectorAll(s.cssSelector).forEach(h)}function x(n,r){let a=null;try{a=r(e)}catch(e){if(_o(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),i)_o(e);else throw e;a=o}a.name||(a.name=n),t[n]=a,a.rawDefinition=r.bind(null,e),a.aliases&&T(a.aliases,{languageName:n})}function S(e){delete t[e];for(let t of Object.keys(n))n[t]===e&&delete n[t]}function C(){return Object.keys(t)}function w(e){return e=(e||``).toLowerCase(),t[e]||t[n[e]]}function T(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function E(e){let t=w(e);return t&&!t.disableAutodetect}function D(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function ee(e){D(e),r.push(e)}function O(e){let t=r.indexOf(e);t!==-1&&r.splice(t,1)}function k(e,t){let n=e;r.forEach(function(e){e[n]&&e[n](t)})}function A(e){return yo(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),yo(`10.7.0`,`Please use highlightElement now.`),h(e)}Object.assign(e,{highlight:u,highlightAuto:p,highlightAll:b,highlightElement:h,highlightBlock:A,configure:g,initHighlighting:_,initHighlightingOnLoad:v,registerLanguage:x,unregisterLanguage:S,listLanguages:C,getLanguage:w,registerAliases:T,autoDetection:E,inherit:Mo,addPlugin:ee,removePlugin:O}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=ko,e.regex={concat:Ea,lookahead:Ca,either:Oa,optional:Ta,anyNumberOfTimes:wa};for(let e in no)typeof no[e]==`object`&&da(no[e]);return Object.assign(e,no),e},Io=Fo({});Io.newInstance=()=>Fo({});var Lo=Io;Io.HighlightJS=Io,Io.default=Io;var Ro=ua(Lo);function zo(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`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`.split(`.`),b=`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`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}var Bo=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/},UNICODE_RANGE:{scope:`number`,begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},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_-]*/}}),Vo=`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`.split(`.`),Ho=`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`.split(`.`),Uo=[...Vo,...Ho],Wo=`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`.split(`.`).sort().reverse(),Go=`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`.split(`.`).sort().reverse(),Ko=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),qo=`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.corner-bottom-left-shape.corner-bottom-right-shape.corner-shape.corner-top-left-shape.corner-top-right-shape.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.unicode-range.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`.split(`.`).sort().reverse();function Jo(e){let t=e.regex,n=Bo(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[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:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+Go.join(`|`)+`)`},{begin:`:(:)?(`+Ko.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+qo.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:Wo.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+Uo.join(`|`)+`)\\b`}]}}function Yo(e){let t={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:t,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:/-?\b0[bB](_?[01])*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:t,illegal:/["']/}]}]}}var Xo=`[0-9](_*[0-9])*`,Zo=`\\.(${Xo})`,Qo=`[0-9a-fA-F](_*[0-9a-fA-F])*`,$o={className:`number`,variants:[{begin:`(\\b(${Xo})((${Zo})|\\.)?|(${Zo}))[eE][+-]?(${Xo})[fFdD]?\\b`},{begin:`\\b(${Xo})((${Zo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Zo})[fFdD]?\\b`},{begin:`\\b(${Xo})[fFdD]\\b`},{begin:`\\b0[xX]((${Qo})\\.?|(${Qo})?\\.(${Qo}))[pP][+-]?(${Xo})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${Qo})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function es(e,t,n){return n===-1?``:e.replace(t,r=>es(e,t,n-1))}function ts(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=`(?:(?:\\s*\\[\\s*])+)?`,i=n+`<@@@>`+r,a=`(?:`+(`\\?(?:\\s+(?:extends|super)\\s+`+i+`)?`)+`|`+i+`)`,o=es(`(?:\\s*<\\s*`+a+`(?:\\s*,\\s*`+a+`)*\\s*>)?`,/<@@@>/g,2),s={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},c={className:`meta`,begin:`@`+n,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},l={className:`params`,begin:/\(/,end:/\)/,keywords:s,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:s,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`},{beginKeywords:`new throw return else yield assert`,relevance:0},{begin:[n,t.concat(o,r,/\s+/),n,r,/\s*/,/=(?!=)/],className:{1:`type`,3:`variable`,6:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{begin:[n,t.concat(o,r,/\s+/),n,/\s*(?=\()/],className:{1:`type`,3:`title.function`},keywords:s,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:s,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,$o,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},$o,c]}}var ns=`[A-Za-z$_][0-9A-Za-z$_]*`,rs=`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`.split(`.`),is=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],as=`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`.split(`.`),os=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],ss=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],cs=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],ls=[].concat(ss,as,os);function us(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=ns,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:ns,keyword:rs,literal:is,built_in:ls,"variable.language":cs},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\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},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,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]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.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:{_:[...as,...os]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let ee={match:t.concat(/\b/,D([...ss,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},O={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},A=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:A,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:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},O,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},ee,E,S,k,{match:/\$[(.]/}]}}var ds={scope:`number`,match:`([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity`,relevance:0};function fs(e){let t={className:`attr`,begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`,`json5`],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,ds,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function ps(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),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}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,r,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ms(e){let t=e.regex,n=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.lazy.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.aiter.all.anext.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozendict.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.sentinel.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{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:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function hs(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={scope:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!(?:let|for|while|if|else|match)\b)/,i,t.lookahead(/\s*\(/))},o=`([ui](8|16|32|64|128|size)|f(16|32|64|128))?`,s=`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.raw.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`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!`.split(`.`),u=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f16`,`f32`,`f64`,`f128`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:u,keyword:s,literal:c,built_in:l},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{scope:`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})/}]}]},{scope:`number`,variants:[{begin:`\\b0b([01_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],relevance:0},{begin:[/\bsafe/,/\s+/,/extern/],scope:{1:`keyword`,3:`keyword`}},{begin:[/fn/,/\s+/,r],scope:{1:`keyword`,3:`title.function`}},{scope:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{scope:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],scope:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],scope:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{scope:`punctuation`,begin:`->`},a]}}function gs(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`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`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`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`.split(`.`),u=`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`.split(`.`),d=[`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`],f=[`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`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var _s=`[A-Za-z$_][0-9A-Za-z$_]*`,vs=`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`.split(`.`),ys=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],bs=`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`.split(`.`),xs=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Ss=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Cs=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],ws=[].concat(Ss,bs,xs);function Ts(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=_s,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:_s,keyword:vs,literal:ys,built_in:ws,"variable.language":Cs},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\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},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,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]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.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:{_:[...bs,...xs]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let ee={match:t.concat(/\b/,D([...Ss,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},O={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},A=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:A,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:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},O,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},ee,E,S,k,{match:/\$[(.]/}]}}function Es(e){let t=e.regex,n=Ts(e),r=_s,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:_s,keyword:vs.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:ys,built_in:ws.concat(i),"variable.language":Cs},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function Ds(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{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:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:`css`}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:`javascript`}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Os(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[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:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var ks={bash:zo,sh:zo,shell:zo,css:Jo,go:Yo,golang:Yo,java:ts,javascript:us,js:us,json:fs,markdown:ps,md:ps,python:ms,py:ms,rust:hs,rs:hs,sql:gs,typescript:Es,ts:Es,xml:Ds,html:Ds,yaml:Os,yml:Os};for(let[e,t]of Object.entries(ks))Ro.registerLanguage(e,t);function As(e){let t=e.split(`
|
|
95
|
+
`),1;if(te>1e5&&te>a.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return j+=o,o.length}let E=w(e);if(!E)throw _o(a.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let ee=Eo(E),D=``,O=o||ee,k={},A=new s.__emitter(s);S();let j=``,M=0,N=0,te=0,P=!1;try{if(E.__emitTokens)E.__emitTokens(n,A);else{for(O.matcher.considerAll();;){te++,P?P=!1:O.matcher.considerAll(),O.matcher.lastIndex=N;let e=O.matcher.exec(n);if(!e)break;let t=T(n.substring(N,e.index),e);N=e.index+t}T(n.substring(N))}return A.finalize(),D=A.toHTML(),{language:e,value:D,relevance:M,illegal:!1,_emitter:A,_top:O}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:jo(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:N,context:n.slice(N-100,N+100),mode:t.mode,resultSoFar:D},_emitter:A};if(i)return{language:e,value:jo(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:O};throw t}}function f(e){let t={value:jo(e),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return t._emitter.addText(e),t}function p(e,n){n=n||s.languages||Object.keys(t);let r=f(e),i=n.filter(w).filter(E).map(t=>d(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(w(e.language).supersetOf===t.language)return 1;if(w(t.language).supersetOf===e.language)return-1}return 0}),c=a;return c.secondBest=o,c}function m(e,t,r){let i=t&&n[t]||r;e.classList.add(`hljs`),e.classList.add(`language-${i}`)}function h(e){let t=null,n=l(e);if(c(n))return;if(k(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(s.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)),s.throwUnescapedHTML))throw new Ao(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?u(r,{language:n,ignoreIllegals:!0}):p(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,m(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),k(`after:highlightElement`,{el:e,result:i,text:r})}function g(e){s=Mo(s,e)}let _=()=>{b(),yo(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function v(){b(),yo(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let y=!1;function b(){function e(){b()}if(document.readyState===`loading`){y||window.addEventListener(`DOMContentLoaded`,e,!1),y=!0;return}document.querySelectorAll(s.cssSelector).forEach(h)}function x(n,r){let a=null;try{a=r(e)}catch(e){if(_o(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),i)_o(e);else throw e;a=o}a.name||(a.name=n),t[n]=a,a.rawDefinition=r.bind(null,e),a.aliases&&T(a.aliases,{languageName:n})}function S(e){delete t[e];for(let t of Object.keys(n))n[t]===e&&delete n[t]}function C(){return Object.keys(t)}function w(e){return e=(e||``).toLowerCase(),t[e]||t[n[e]]}function T(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function E(e){let t=w(e);return t&&!t.disableAutodetect}function ee(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function D(e){ee(e),r.push(e)}function O(e){let t=r.indexOf(e);t!==-1&&r.splice(t,1)}function k(e,t){let n=e;r.forEach(function(e){e[n]&&e[n](t)})}function A(e){return yo(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),yo(`10.7.0`,`Please use highlightElement now.`),h(e)}Object.assign(e,{highlight:u,highlightAuto:p,highlightAll:b,highlightElement:h,highlightBlock:A,configure:g,initHighlighting:_,initHighlightingOnLoad:v,registerLanguage:x,unregisterLanguage:S,listLanguages:C,getLanguage:w,registerAliases:T,autoDetection:E,inherit:Mo,addPlugin:D,removePlugin:O}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=ko,e.regex={concat:Ea,lookahead:Ca,either:Oa,optional:Ta,anyNumberOfTimes:wa};for(let e in no)typeof no[e]==`object`&&da(no[e]);return Object.assign(e,no),e},Io=Fo({});Io.newInstance=()=>Fo({});var Lo=Io;Io.HighlightJS=Io,Io.default=Io;var Ro=ua(Lo);function zo(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`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`.split(`.`),b=`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`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}var Bo=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/},UNICODE_RANGE:{scope:`number`,begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},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_-]*/}}),Vo=`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`.split(`.`),Ho=`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`.split(`.`),Uo=[...Vo,...Ho],Wo=`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`.split(`.`).sort().reverse(),Go=`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`.split(`.`).sort().reverse(),Ko=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),qo=`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.corner-bottom-left-shape.corner-bottom-right-shape.corner-shape.corner-top-left-shape.corner-top-right-shape.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.unicode-range.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`.split(`.`).sort().reverse();function Jo(e){let t=e.regex,n=Bo(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[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:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+Go.join(`|`)+`)`},{begin:`:(:)?(`+Ko.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+qo.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:Wo.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+Uo.join(`|`)+`)\\b`}]}}function Yo(e){let t={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:t,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:/-?\b0[bB](_?[01])*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:t,illegal:/["']/}]}]}}var Xo=`[0-9](_*[0-9])*`,Zo=`\\.(${Xo})`,Qo=`[0-9a-fA-F](_*[0-9a-fA-F])*`,$o={className:`number`,variants:[{begin:`(\\b(${Xo})((${Zo})|\\.)?|(${Zo}))[eE][+-]?(${Xo})[fFdD]?\\b`},{begin:`\\b(${Xo})((${Zo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Zo})[fFdD]?\\b`},{begin:`\\b(${Xo})[fFdD]\\b`},{begin:`\\b0[xX]((${Qo})\\.?|(${Qo})?\\.(${Qo}))[pP][+-]?(${Xo})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${Qo})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function es(e,t,n){return n===-1?``:e.replace(t,r=>es(e,t,n-1))}function ts(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=`(?:(?:\\s*\\[\\s*])+)?`,i=n+`<@@@>`+r,a=`(?:`+(`\\?(?:\\s+(?:extends|super)\\s+`+i+`)?`)+`|`+i+`)`,o=es(`(?:\\s*<\\s*`+a+`(?:\\s*,\\s*`+a+`)*\\s*>)?`,/<@@@>/g,2),s={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},c={className:`meta`,begin:`@`+n,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},l={className:`params`,begin:/\(/,end:/\)/,keywords:s,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:s,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`},{beginKeywords:`new throw return else yield assert`,relevance:0},{begin:[n,t.concat(o,r,/\s+/),n,r,/\s*/,/=(?!=)/],className:{1:`type`,3:`variable`,6:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{begin:[n,t.concat(o,r,/\s+/),n,/\s*(?=\()/],className:{1:`type`,3:`title.function`},keywords:s,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:s,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,$o,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},$o,c]}}var ns=`[A-Za-z$_][0-9A-Za-z$_]*`,rs=`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`.split(`.`),is=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],as=`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`.split(`.`),os=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],ss=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],cs=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],ls=[].concat(ss,as,os);function us(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=ns,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:ns,keyword:rs,literal:is,built_in:ls,"variable.language":cs},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\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},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,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]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.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:{_:[...as,...os]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function ee(e){return t.concat(`(?!`,e.join(`|`),`)`)}let D={match:t.concat(/\b/,ee([...ss,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},O={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},A=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:A,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:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},O,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},D,E,S,k,{match:/\$[(.]/}]}}var ds={scope:`number`,match:`([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity`,relevance:0};function fs(e){let t={className:`attr`,begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`,`json5`],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,ds,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function ps(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),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}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,r,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function ms(e){let t=e.regex,n=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.lazy.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.aiter.all.anext.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozendict.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.sentinel.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{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:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function hs(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={scope:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!(?:let|for|while|if|else|match)\b)/,i,t.lookahead(/\s*\(/))},o=`([ui](8|16|32|64|128|size)|f(16|32|64|128))?`,s=`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.raw.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),c=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],l=`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!`.split(`.`),u=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f16`,`f32`,`f64`,`f128`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:u,keyword:s,literal:c,built_in:l},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{scope:`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})/}]}]},{scope:`number`,variants:[{begin:`\\b0b([01_]+)`+o},{begin:`\\b0o([0-7_]+)`+o},{begin:`\\b0x([A-Fa-f0-9_]+)`+o},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)`+o}],relevance:0},{begin:[/\bsafe/,/\s+/,/extern/],scope:{1:`keyword`,3:`keyword`}},{begin:[/fn/,/\s+/,r],scope:{1:`keyword`,3:`title.function`}},{scope:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{scope:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],scope:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],scope:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:l,type:u}},{scope:`punctuation`,begin:`->`},a]}}function gs(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`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`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`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`.split(`.`),u=`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`.split(`.`),d=[`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`],f=[`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`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var _s=`[A-Za-z$_][0-9A-Za-z$_]*`,vs=`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`.split(`.`),ys=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],bs=`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`.split(`.`),xs=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Ss=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],Cs=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],ws=[].concat(Ss,bs,xs);function Ts(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=_s,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:_s,keyword:vs,literal:ys,built_in:ws,"variable.language":Cs},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\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},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,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]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.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:{_:[...bs,...xs]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function ee(e){return t.concat(`(?!`,e.join(`|`),`)`)}let D={match:t.concat(/\b/,ee([...Ss,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},O={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},A=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,j={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},j,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:A,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:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},O,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},D,E,S,k,{match:/\$[(.]/}]}}function Es(e){let t=e.regex,n=Ts(e),r=_s,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:_s,keyword:vs.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:ys,built_in:ws.concat(i),"variable.language":Cs},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function Ds(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{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:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:`css`}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:`javascript`}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Os(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[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:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}var ks={bash:zo,sh:zo,shell:zo,css:Jo,go:Yo,golang:Yo,java:ts,javascript:us,js:us,json:fs,markdown:ps,md:ps,python:ms,py:ms,rust:hs,rs:hs,sql:gs,typescript:Es,ts:Es,xml:Ds,html:Ds,yaml:Os,yml:Os};for(let[e,t]of Object.entries(ks))Ro.registerLanguage(e,t);function As(e){let t=e.split(`
|
|
96
96
|
`);return/^(`{3,}|~{3,})/.test(t[0]??``)&&t.shift(),/^(`{3,}|~{3,})\s*$/.test(t[t.length-1]??``)&&t.pop(),t.join(`
|
|
97
97
|
`).replace(/\n+$/,``)}function js(e){let t=(/^(`{3,}|~{3,})([^\s`~]*)/.exec(e.split(`
|
|
98
98
|
`)[0]??``)?.[2]??``).toLowerCase();return t&&ks[t]?t:``}function Ms(e,t){let n=t&&ks[t]?t:``;try{return n?Ro.highlight(e,{language:n,ignoreIllegals:!0}).value:Ro.highlightAuto(e).value}catch{return Ps(e)}}function Ns(e){return e.split(`
|
|
@@ -160,43 +160,43 @@ ${e}</tr>
|
|
|
160
160
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
161
161
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Yc(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Xc(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Yc(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Xc(e);if(i===null)return Yc(n);e=i;let a=`<img src="${e}" alt="${Yc(n)}"`;return t&&(a+=` title="${Yc(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Yc(e.text)}},sl=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},cl=class e{constructor(e){P(this,`options`),P(this,`renderer`),P(this,`textRenderer`),this.options=e||Is,this.options.renderer=this.options.renderer||new ol,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new sl}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){var t;this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if((t=this.options.extensions?.renderers)!=null&&t[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);break;case`hr`:n+=this.renderer.hr(a);break;case`heading`:n+=this.renderer.heading(a);break;case`code`:n+=this.renderer.code(a);break;case`table`:n+=this.renderer.table(a);break;case`blockquote`:n+=this.renderer.blockquote(a);break;case`list`:n+=this.renderer.list(a);break;case`checkbox`:n+=this.renderer.checkbox(a);break;case`html`:n+=this.renderer.html(a);break;case`def`:n+=this.renderer.def(a);break;case`paragraph`:n+=this.renderer.paragraph(a);break;case`text`:n+=this.renderer.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){var n;this.renderer.parser=this;let r=``;for(let i=0;i<e.length;i++){let a=e[i];if((n=this.options.extensions?.renderers)!=null&&n[a.type]){let e=this.options.extensions.renderers[a.type].call({parser:this},a);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(a.type)){r+=e||``;continue}}let o=a;switch(o.type){case`escape`:r+=t.text(o);break;case`html`:r+=t.html(o);break;case`link`:r+=t.link(o);break;case`image`:r+=t.image(o);break;case`checkbox`:r+=t.checkbox(o);break;case`strong`:r+=t.strong(o);break;case`em`:r+=t.em(o);break;case`codespan`:r+=t.codespan(o);break;case`br`:r+=t.br(o);break;case`del`:r+=t.del(o);break;case`text`:r+=t.text(o);break;default:{let e=`Token with "`+o.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return r}},ll=class{constructor(e){P(this,`options`),P(this,`block`),this.options=e||Is}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?al.lex:al.lexInline}provideParser(e=this.block){return e?cl.parse:cl.parseInline}},ul=(P(ll,`passThroughHooks`,new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`])),P(ll,`passThroughHooksRespectAsync`,new Set([`preprocess`,`postprocess`,`processAllTokens`])),ll),dl=class{constructor(...e){P(this,`defaults`,Fs()),P(this,`options`,this.setOptions),P(this,`parse`,this.parseMarkdown(!0)),P(this,`parseInline`,this.parseMarkdown(!1)),P(this,`Parser`,cl),P(this,`Renderer`,ol),P(this,`TextRenderer`,sl),P(this,`Lexer`,al),P(this,`Tokenizer`,il),P(this,`Hooks`,ul),this.use(...e)}walkTokens(e,t){var n;let r=[];for(let i of e)switch(r=r.concat(t.call(this,i)),i.type){case`table`:{let e=i;for(let n of e.header)r=r.concat(this.walkTokens(n.tokens,t));for(let n of e.rows)for(let e of n)r=r.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=i;r=r.concat(this.walkTokens(e.items,t));break}default:{let e=i;(n=this.defaults.extensions?.childTokens)!=null&&n[e.type]?this.defaults.extensions.childTokens[e.type].forEach(n=>{let i=e[n].flat(1/0);r=r.concat(this.walkTokens(i,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ol(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new il(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ul;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=ul.passThroughHooks.has(n)?e=>{if(this.defaults.async&&ul.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return al.lex(e,t??this.defaults)}parser(e,t){return cl.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?al.lex:al.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?cl.parse:cl.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?al.lex:al.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?cl.parse:cl.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
162
162
|
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Yc(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},fl=new dl;function Z(e,t){return fl.parse(e,t)}Z.options=Z.setOptions=function(e){return fl.setOptions(e),Z.defaults=fl.defaults,Ls(Z.defaults),Z},Z.getDefaults=Fs,Z.defaults=Is,Z.use=function(...e){return fl.use(...e),Z.defaults=fl.defaults,Ls(Z.defaults),Z},Z.walkTokens=function(e,t){return fl.walkTokens(e,t)},Z.parseInline=fl.parseInline,Z.Parser=cl,Z.parser=cl.parse,Z.Renderer=ol,Z.TextRenderer=sl,Z.Lexer=al,Z.lexer=al.lex,Z.Tokenizer=il,Z.Hooks=ul,Z.parse=Z,Z.options,Z.setOptions,Z.use,Z.walkTokens,Z.parseInline,cl.parse,al.lex;function pl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ml(e){if(Array.isArray(e))return e}function hl(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function gl(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
163
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _l(e,t){return ml(e)||hl(e,t)||vl(e,t)||gl()}function vl(e,t){if(e){if(typeof e==`string`)return pl(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pl(e,t):void 0}}var yl=Object.entries,bl=Object.setPrototypeOf,xl=Object.isFrozen,Sl=Object.getPrototypeOf,Cl=Object.getOwnPropertyDescriptor,wl=Object.freeze,Tl=Object.seal,El=Object.create,Dl=typeof Reflect<`u`&&Reflect,Ol=Dl.apply,kl=Dl.construct;wl||=function(e){return e},Tl||=function(e){return e},Ol||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},kl||=function(e){return new e(...[...arguments].slice(1))};var Al=Q(Array.prototype.forEach),jl=Q(Array.prototype.lastIndexOf),Ml=Q(Array.prototype.pop),Nl=Q(Array.prototype.push),Pl=Q(Array.prototype.splice),Fl=Array.isArray,Il=Q(String.prototype.toLowerCase),Ll=Q(String.prototype.toString),Rl=Q(String.prototype.match),zl=Q(String.prototype.replace),Bl=Q(String.prototype.indexOf),Vl=Q(String.prototype.trim),Hl=Q(Number.prototype.toString),Ul=Q(Boolean.prototype.toString),Wl=typeof BigInt>`u`?null:Q(BigInt.prototype.toString),Gl=typeof Symbol>`u`?null:Q(Symbol.prototype.toString),Kl=Q(Object.prototype.hasOwnProperty),ql=Q(Object.prototype.toString),Jl=Q(RegExp.prototype.test),Yl=Xl(TypeError);function Q(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Ol(e,t,n)}}function Xl(e){return function(){return kl(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Il;if(bl&&bl(e,null),!Fl(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(xl(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Zl(e){for(let t=0;t<e.length;t++)Kl(e,t)||(e[t]=null);return e}function Ql(e){let t=El(null);for(let r of yl(e)){var n=_l(r,2);let i=n[0],a=n[1];Kl(e,i)&&(t[i]=Fl(a)?Zl(a):a&&typeof a==`object`&&a.constructor===Object?Ql(a):a)}return t}function $l(e){switch(typeof e){case`string`:return e;case`number`:return Hl(e);case`boolean`:return Ul(e);case`bigint`:return Wl?Wl(e):`0`;case`symbol`:return Gl?Gl(e):`Symbol()`;case`undefined`:return ql(e);case`function`:case`object`:{if(e===null)return ql(e);let t=e,n=eu(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:ql(e)}return ql(e)}default:return ql(e)}}function eu(e,t){for(;e!==null;){let n=Cl(e,t);if(n){if(n.get)return Q(n.get);if(typeof n.value==`function`)return Q(n.value)}e=Sl(e)}function n(){return null}return n}function tu(e){try{return Jl(e,``),!0}catch{return!1}}var nu=wl(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),ru=wl(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),iu=wl([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),au=wl([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),ou=wl(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),su=wl([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),cu=wl([`#text`]),lu=wl(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),uu=wl(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),du=wl(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),fu=wl([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),pu=Tl(/{{[\w\W]*|^[\w\W]*}}/g),mu=Tl(/<%[\w\W]*|^[\w\W]*%>/g),hu=Tl(/\${[\w\W]*/g),gu=Tl(/^data-[\-\w.\u00B7-\uFFFF]+$/),_u=Tl(/^aria-[\-\w]+$/),vu=Tl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yu=Tl(/^(?:\w+script|data):/i),bu=Tl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),xu=Tl(/^html$/i),Su=Tl(/^[a-z][.\w]*(-[.\w]+)+$/i),Cu=Tl(/<[/\w!]/g),wu=Tl(/<[/\w]/g),Tu=Tl(/<\/no(script|embed|frames)/i),Eu=Tl(/\/>/i),Du={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ou=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],ku=wl($({},Ou)),Au=function(){let e={};return Al(Ou,t=>{e[t]=Tl(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),wl(e)}(),ju=function(){return typeof window>`u`?null:window},Mu=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Nu=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Pu=function(e,t,n,r){return Kl(e,t)&&Fl(e[t])?$(r.base?Ql(r.base):{},e[t],r.transform):n},Fu=function(e,t,n){let r=Kl(e,t)?e[t]:void 0;return r&&typeof r==`object`?Ql(r):n()};function Iu(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ju(),t=e=>Iu(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==Du.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=eu(d,`cloneNode`),p=eu(d,`remove`),m=eu(d,`removeAttributeNode`),h=eu(d,`nextSibling`),g=eu(d,`childNodes`),_=eu(d,`parentNode`),v=eu(d,`shadowRoot`),y=eu(d,`attributes`),b=o&&o.prototype?eu(o.prototype,`nodeType`):null,x=o&&o.prototype?eu(o.prototype,`nodeName`):null,S=o&&o.prototype?eu(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,ee=!1,O=0,k=function(){if(O>0)throw Yl(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},A=function(e){k(),O++;try{return T.createHTML(e)}finally{O--}},j=function(e){k(),O++;try{return T.createScriptURL(e)}finally{O--}},M=function(){return ee||=(D=Mu(u,i),!0),D},N=n,te=N.implementation,P=N.createNodeIterator,ne=N.createDocumentFragment,F=N.getElementsByTagName,re=r.importNode,I=Nu();t.isSupported=typeof yl==`function`&&typeof _==`function`&&te&&te.createHTMLDocument!==void 0;let ie=pu,ae=mu,oe=hu,L=gu,se=_u,ce=yu,le=bu,ue=Su,de=vu,R=null,z=$({},[...nu,...ru,...iu,...ou,...cu]),B=null,fe=$({},[...lu,...uu,...du,...fu]),pe=Object.seal(El(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),me=null,he=null,V=Object.seal(El(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ge=!0,_e=!0,ve=!1,ye=!0,be=!1,xe=!0,Se=!1,Ce=!1,we=null,Te=null,Ee=!1,De=!1,Oe=!1,ke=!1,Ae=!0,je=!1,Me=`user-content-`,Ne=!0,Pe=!1,Fe={},Ie=null,Le=$({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Re=null,ze=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Be=null,Ve=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),He=`http://www.w3.org/1998/Math/MathML`,Ue=`http://www.w3.org/2000/svg`,H=`http://www.w3.org/1999/xhtml`,U=H,We=!1,Ge=null,Ke=$({},[He,Ue,H],Ll),qe=wl([`mi`,`mo`,`mn`,`ms`,`mtext`]),Je=$({},qe),Ye=wl([`annotation-xml`]),Xe=$({},Ye),Ze=$({},[`title`,`style`,`font`,`a`,`script`]),Qe=null,$e=[`application/xhtml+xml`,`text/html`],W=null,et=null,tt=n.createElement(`form`),nt=function(e){return e instanceof RegExp||e instanceof Function},rt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(et&&et===e)return;(!e||typeof e!=`object`)&&(e={}),e=Ql(e),Qe=$e.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,W=Qe===`application/xhtml+xml`?Ll:Il,R=Pu(e,`ALLOWED_TAGS`,z,{transform:W}),B=Pu(e,`ALLOWED_ATTR`,fe,{transform:W}),Ge=Pu(e,`ALLOWED_NAMESPACES`,Ke,{transform:Ll}),Be=Pu(e,`ADD_URI_SAFE_ATTR`,Ve,{transform:W,base:Ve}),Re=Pu(e,`ADD_DATA_URI_TAGS`,ze,{transform:W,base:ze}),Ie=Pu(e,`FORBID_CONTENTS`,Le,{transform:W}),me=Pu(e,`FORBID_TAGS`,Ql({}),{transform:W}),he=Pu(e,`FORBID_ATTR`,Ql({}),{transform:W}),Fe=Kl(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Ql(e.USE_PROFILES):e.USE_PROFILES:!1,ge=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,ve=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,be=e.SAFE_FOR_TEMPLATES||!1,xe=e.SAFE_FOR_XML!==!1,Se=e.WHOLE_DOCUMENT||!1,De=e.RETURN_DOM||!1,Oe=e.RETURN_DOM_FRAGMENT||!1,ke=e.RETURN_TRUSTED_TYPE||!1,Ee=e.FORCE_BODY||!1,Ae=e.SANITIZE_DOM!==!1,je=e.SANITIZE_NAMED_PROPS||!1,Ne=e.KEEP_CONTENT!==!1,Pe=e.IN_PLACE||!1,de=tu(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:vu,U=typeof e.NAMESPACE==`string`?e.NAMESPACE:H,Je=Fu(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>$({},qe)),Xe=Fu(e,`HTML_INTEGRATION_POINTS`,()=>$({},Ye));let t=Fu(e,`CUSTOM_ELEMENT_HANDLING`,()=>El(null));if(pe=El(null),Kl(t,`tagNameCheck`)&&nt(t.tagNameCheck)&&(pe.tagNameCheck=t.tagNameCheck),Kl(t,`attributeNameCheck`)&&nt(t.attributeNameCheck)&&(pe.attributeNameCheck=t.attributeNameCheck),Kl(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(pe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Tl(pe),be&&(_e=!1),Oe&&(De=!0),Fe&&(R=$({},cu),B=El(null),Fe.html===!0&&($(R,nu),$(B,lu)),Fe.svg===!0&&($(R,ru),$(B,uu),$(B,fu)),Fe.svgFilters===!0&&($(R,iu),$(B,uu),$(B,fu)),Fe.mathMl===!0&&($(R,ou),$(B,du),$(B,fu))),V.tagCheck=null,V.attributeCheck=null,Kl(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?V.tagCheck=e.ADD_TAGS:Fl(e.ADD_TAGS)&&(R===z&&(R=Ql(R)),$(R,e.ADD_TAGS,W))),Kl(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?V.attributeCheck=e.ADD_ATTR:Fl(e.ADD_ATTR)&&(B===fe&&(B=Ql(B)),$(B,e.ADD_ATTR,W))),Kl(e,`ADD_FORBID_CONTENTS`)&&Fl(e.ADD_FORBID_CONTENTS)&&(Ie===Le&&(Ie=Ql(Ie)),$(Ie,e.ADD_FORBID_CONTENTS,W)),Ne&&(R[`#text`]=!0),Se&&$(R,[`html`,`head`,`body`]),R.table&&($(R,[`tbody`]),delete me.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Yl(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Yl(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=A(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=M()),T&&typeof E==`string`&&(E=A(``)));wl&&wl(e),et=e},it=$({},[...ru,...iu,...au]),at=$({},[...ou,...su]),ot=function(e,t,n){return t.namespaceURI===H?e===`svg`:t.namespaceURI===He?e===`svg`&&(n===`annotation-xml`||Je[n]):!!it[e]},st=function(e,t,n){return t.namespaceURI===H?e===`math`:t.namespaceURI===Ue?e===`math`&&Xe[n]:!!at[e]},ct=function(e,t,n){return t.namespaceURI===Ue&&!Xe[n]||t.namespaceURI===He&&!Je[n]?!1:!at[e]&&(Ze[e]||!it[e])},lt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:U,tagName:`template`});let n=Il(e.tagName),r=Il(t.tagName);return Ge[e.namespaceURI]?e.namespaceURI===Ue?ot(n,t,r):e.namespaceURI===He?st(n,t,r):e.namespaceURI===H?ct(n,t,r):!!(Qe===`application/xhtml+xml`&&Ge[e.namespaceURI]):!1},ut=function(e){Nl(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw Yl(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},dt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},ft=function(e){ht(e);let t=g(e);if(t){let e=[];Al(t,t=>{Nl(e,t)}),Al(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&dt(e,r,i)}},pt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Nl(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(De||Oe)try{ut(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},mt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||B[W(i)]||dt(e,r,i)}},ht=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===Du.element&&mt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},gt=function(e,t){return xe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},_t=function(e){if(!xe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===Du.processingInstruction||n===Du.comment&&Jl(wu,e.data)){try{p(e)}catch{}continue}if(n===Du.element){let t=e,n=W(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&>(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},vt=function(e){let t=null,r=null;if(Ee)e=`<remove></remove>`+e;else{let t=Rl(e,/^[\r\n\t ]+/);r=t&&t[0]}Qe===`application/xhtml+xml`&&U===H&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?A(e):e;if(U===H)try{t=new l().parseFromString(i,Qe)}catch{}if(!t||!t.documentElement){t=te.createDocument(U,`template`,null);try{t.documentElement.innerHTML=We?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),U===H?F.call(t,Se?`html`:`body`)[0]:Se?t.documentElement:a},yt=function(e){let t=S?S(e):e.ownerDocument;return P.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},bt=function(e){return e=zl(e,ie,` `),e=zl(e,ae,` `),e=zl(e,oe,` `),e},xt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=P.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=bt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&Al(i,e=>{Ct(e.content)&&xt(e.content)})},St=function(e){let t=x?x(e):null;return typeof t!=`string`||W(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Ct=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===Du.documentFragment}catch{return!1}},wt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Tt(e,n,r){e.length!==0&&Al(e,e=>{e.call(t,n,r,et)})}let Et=function(e,t){return!!(xe&&e.hasChildNodes()&&!wt(e.firstElementChild)&&Jl(Cu,e.textContent)&&Jl(Cu,e.innerHTML)||xe&&e.namespaceURI===H&&ku[t]&&(wt(e.firstElementChild)||typeof e.textContent==`string`&&Jl(Au[t],e.textContent))||e.nodeType===Du.processingInstruction||xe&&e.nodeType===Du.comment&&Jl(wu,e.data))},Dt=function(e,t){return e instanceof RegExp?Jl(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Ot=function(e,t,n){if(!me[t]&&Pt(t)&&Dt(pe.tagNameCheck,t))return!1;if(Ne&&!Ie[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return ut(e),!0},kt=function(e,t,n,r){return e.length===0?t:t===n||t===r?Ql(t):t},At=function(e,t){return e===t||_(e)!==null?!1:(Pe&&ht(e),!0)},jt=function(e,n){if(Tt(I.beforeSanitizeElements,e,null),At(e,n))return!0;if(St(e))return ut(e),!0;let r=W(w(e));if(R=kt(I.uponSanitizeElement,R,z,we),Tt(I.uponSanitizeElement,e,{tagName:r,allowedTags:R}),At(e,n))return!0;if(Et(e,r))return ut(e),!0;if(me[r]||!(V.tagCheck instanceof Function&&V.tagCheck(r))&&!R[r]){let t=Ot(e,r,n);return t===!1&&(Tt(I.afterSanitizeElements,e,null),At(e,n))?!0:t}if(C(e)===Du.element&&!lt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Jl(Tu,e.innerHTML))return ut(e),!0;if(be&&e.nodeType===Du.text){let n=bt(e.textContent);e.textContent!==n&&(Nl(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Tt(I.afterSanitizeElements,e,null),At(e,n)},Mt=function(e,t,r){if(he[t]||gt(t,e)||Ae&&(t===`id`||t===`name`)&&(r in n||r in tt))return!1;let i=B[t]||V.attributeCheck instanceof Function&&V.attributeCheck(t,e);return _e&&Jl(L,t)||ge&&Jl(se,t)?!0:i?Be[t]||Jl(de,zl(r,le,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Bl(r,`data:`)===0&&Re[e]||ve&&!Jl(ce,zl(r,le,``))?!0:!r:Pt(e)&&Dt(pe.tagNameCheck,e)&&Dt(pe.attributeNameCheck,t,e)||t===`is`&&pe.allowCustomizedBuiltInElements&&Dt(pe.tagNameCheck,r)},Nt=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Pt=function(e){return!Nt[Il(e)]&&Jl(ue,e)},Ft=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return A(r);case`TrustedScriptURL`:return j(r)}return r},It=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!St(e)||(ut(e),!1)}catch{return pt(t,e),!1}},Lt=function(e,n){if(Tt(I.beforeSanitizeAttributes,e,null),At(e,n))return;let r=e.attributes;if(!r||St(e))return;B=kt(I.uponSanitizeAttribute,B,fe,Te);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0},a=r.length,o=W(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=W(s),d=l,f=s===`value`?d:Vl(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Tt(I.uponSanitizeAttribute,e,i),f=i.attrValue,je&&(u===`id`||u===`name`)&&Bl(f,Me)!==0&&(pt(s,e,n),f=Me+f,p=!0),xe&&Jl(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){pt(s,e,n);continue}if(u===`attributename`&&Rl(f,`href`)){pt(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){pt(s,e,n);continue}if(!ye&&Jl(Eu,f)){pt(s,e,n);continue}if(be&&(f=bt(f)),!Mt(o,u,f)){pt(s,e,n);continue}f=Ft(o,u,c,f),f!==d&&It(e,s,c,f)&&p&&Ml(t.removed)}}Tt(I.afterSanitizeAttributes,e,null),At(e,n)},Rt=function(e){let t=null,n=yt(e);for(Tt(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Tt(I.uponSanitizeShadowNode,t,null),jt(t,e),Lt(t,e),Ct(t.content)&&Rt(t.content),C(t)===Du.element){let e=v(t);Ct(e)&&(zt(e),Rt(e))}Tt(I.afterSanitizeShadowDOM,e,null)},zt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Rt(e.shadow);continue}let n=e.node,r=C(n)===Du.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&W(e)===`template`){let e=n.content;Ct(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Ct(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(We=!e,We&&(e=`<!-->`),typeof e!=`string`&&!wt(e)&&(e=$l(e),typeof e!=`string`))throw Yl(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ce?(R=we,B=Te):rt(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(R=Ql(R)),I.uponSanitizeAttribute.length>0&&(B=Ql(B)),t.removed=[];let c=Pe&&typeof e!=`string`&&wt(e);if(c){_t(e);let t=w(e);if(typeof t==`string`){let n=W(t);if(!R[n]||me[n])throw ft(e),Yl(`root node is forbidden and cannot be sanitized in-place`)}if(St(e))throw ft(e),Yl(`root node is clobbered and cannot be sanitized in-place`);try{zt(e)}catch(t){throw ft(e),t}}else if(wt(e))i=vt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Du.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),zt(i);else{if(!De&&!be&&!Se&&e.indexOf(`<`)===-1)return T&&ke?A(e):e;if(i=vt(e),!i)return De?null:ke?E:``}i&&Ee&&ut(i.firstChild);let l=c?e:i;try{let e=yt(l);for(;o=e.nextNode();)jt(o,l),Lt(o,l),Ct(o.content)&&Rt(o.content)}catch(n){throw c&&(ft(e),Al(t.removed,e=>{e.element&&ht(e.element)})),n}if(c){let n=!1;if(Al(t.removed,t=>{t.element&&(t.element===e&&(n=!0),ht(t.element))}),n)throw Yl(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return be&&xt(e),e}if(De){if(be&&xt(i),Oe)for(s=ne.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(B.shadowroot||B.shadowrootmode)&&(s=re.call(r,s,!0)),s}let u=Se?i.outerHTML:i.innerHTML;return Se&&R[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Jl(xu,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
164
|
-
`+u),be&&(u=bt(u)),T&&ke?A(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};rt(e),Ce=!0,we=R,Te=B},t.clearConfig=function(){et=null,Ce=!1,we=null,Te=null,T=
|
|
163
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _l(e,t){return ml(e)||hl(e,t)||vl(e,t)||gl()}function vl(e,t){if(e){if(typeof e==`string`)return pl(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pl(e,t):void 0}}var yl=Object.entries,bl=Object.setPrototypeOf,xl=Object.isFrozen,Sl=Object.getPrototypeOf,Cl=Object.getOwnPropertyDescriptor,wl=Object.freeze,Tl=Object.seal,El=Object.create,Dl=typeof Reflect<`u`&&Reflect,Ol=Dl.apply,kl=Dl.construct;wl||=function(e){return e},Tl||=function(e){return e},Ol||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},kl||=function(e){return new e(...[...arguments].slice(1))};var Al=Q(Array.prototype.forEach),jl=Q(Array.prototype.lastIndexOf),Ml=Q(Array.prototype.pop),Nl=Q(Array.prototype.push),Pl=Q(Array.prototype.splice),Fl=Array.isArray,Il=Q(String.prototype.toLowerCase),Ll=Q(String.prototype.toString),Rl=Q(String.prototype.match),zl=Q(String.prototype.replace),Bl=Q(String.prototype.indexOf),Vl=Q(String.prototype.trim),Hl=Q(Number.prototype.toString),Ul=Q(Boolean.prototype.toString),Wl=typeof BigInt>`u`?null:Q(BigInt.prototype.toString),Gl=typeof Symbol>`u`?null:Q(Symbol.prototype.toString),Kl=Q(Object.prototype.hasOwnProperty),ql=Q(Object.prototype.toString),Jl=Q(RegExp.prototype.test),Yl=Xl(TypeError);function Q(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Ol(e,t,n)}}function Xl(e){return function(){return kl(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Il;if(bl&&bl(e,null),!Fl(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(xl(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Zl(e){for(let t=0;t<e.length;t++)Kl(e,t)||(e[t]=null);return e}function Ql(e){let t=El(null);for(let r of yl(e)){var n=_l(r,2);let i=n[0],a=n[1];Kl(e,i)&&(t[i]=Fl(a)?Zl(a):a&&typeof a==`object`&&a.constructor===Object?Ql(a):a)}return t}function $l(e){switch(typeof e){case`string`:return e;case`number`:return Hl(e);case`boolean`:return Ul(e);case`bigint`:return Wl?Wl(e):`0`;case`symbol`:return Gl?Gl(e):`Symbol()`;case`undefined`:return ql(e);case`function`:case`object`:{if(e===null)return ql(e);let t=e,n=eu(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:ql(e)}return ql(e)}default:return ql(e)}}function eu(e,t){for(;e!==null;){let n=Cl(e,t);if(n){if(n.get)return Q(n.get);if(typeof n.value==`function`)return Q(n.value)}e=Sl(e)}function n(){return null}return n}function tu(e){try{return Jl(e,``),!0}catch{return!1}}var nu=wl(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),ru=wl(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),iu=wl([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),au=wl([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),ou=wl(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),su=wl([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),cu=wl([`#text`]),lu=wl(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),uu=wl(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),du=wl(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),fu=wl([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),pu=Tl(/{{[\w\W]*|^[\w\W]*}}/g),mu=Tl(/<%[\w\W]*|^[\w\W]*%>/g),hu=Tl(/\${[\w\W]*/g),gu=Tl(/^data-[\-\w.\u00B7-\uFFFF]+$/),_u=Tl(/^aria-[\-\w]+$/),vu=Tl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yu=Tl(/^(?:\w+script|data):/i),bu=Tl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),xu=Tl(/^html$/i),Su=Tl(/^[a-z][.\w]*(-[.\w]+)+$/i),Cu=Tl(/<[/\w!]/g),wu=Tl(/<[/\w]/g),Tu=Tl(/<\/no(script|embed|frames)/i),Eu=Tl(/\/>/i),Du={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ou=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],ku=wl($({},Ou)),Au=function(){let e={};return Al(Ou,t=>{e[t]=Tl(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),wl(e)}(),ju=function(){return typeof window>`u`?null:window},Mu=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Nu=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Pu=function(e,t,n,r){return Kl(e,t)&&Fl(e[t])?$(r.base?Ql(r.base):{},e[t],r.transform):n},Fu=function(e,t,n){let r=Kl(e,t)?e[t]:void 0;return r&&typeof r==`object`?Ql(r):n()};function Iu(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ju(),t=e=>Iu(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==Du.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=eu(d,`cloneNode`),p=eu(d,`remove`),m=eu(d,`removeAttributeNode`),h=eu(d,`nextSibling`),g=eu(d,`childNodes`),_=eu(d,`parentNode`),v=eu(d,`shadowRoot`),y=eu(d,`attributes`),b=o&&o.prototype?eu(o.prototype,`nodeType`):null,x=o&&o.prototype?eu(o.prototype,`nodeName`):null,S=o&&o.prototype?eu(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,ee,D=!1,O=0,k=function(){if(O>0)throw Yl(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},A=function(e){k(),O++;try{return T.createHTML(e)}finally{O--}},j=function(e){k(),O++;try{return T.createScriptURL(e)}finally{O--}},M=function(){return D||=(ee=Mu(u,i),!0),ee},N=n,te=N.implementation,P=N.createNodeIterator,ne=N.createDocumentFragment,F=N.getElementsByTagName,re=r.importNode,I=Nu();t.isSupported=typeof yl==`function`&&typeof _==`function`&&te&&te.createHTMLDocument!==void 0;let ie=pu,ae=mu,oe=hu,L=gu,se=_u,ce=yu,le=bu,ue=Su,de=vu,R=null,z=$({},[...nu,...ru,...iu,...ou,...cu]),B=null,fe=$({},[...lu,...uu,...du,...fu]),pe=Object.seal(El(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),me=null,he=null,V=Object.seal(El(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ge=!0,_e=!0,ve=!1,ye=!0,be=!1,xe=!0,Se=!1,Ce=!1,we=null,Te=null,Ee=!1,De=!1,Oe=!1,ke=!1,Ae=!0,je=!1,Me=`user-content-`,Ne=!0,Pe=!1,Fe={},Ie=null,Le=$({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Re=null,ze=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Be=null,Ve=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),He=`http://www.w3.org/1998/Math/MathML`,Ue=`http://www.w3.org/2000/svg`,H=`http://www.w3.org/1999/xhtml`,U=H,We=!1,Ge=null,Ke=$({},[He,Ue,H],Ll),qe=wl([`mi`,`mo`,`mn`,`ms`,`mtext`]),Je=$({},qe),Ye=wl([`annotation-xml`]),Xe=$({},Ye),Ze=$({},[`title`,`style`,`font`,`a`,`script`]),Qe=null,$e=[`application/xhtml+xml`,`text/html`],W=null,et=null,tt=n.createElement(`form`),nt=function(e){return e instanceof RegExp||e instanceof Function},rt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(et&&et===e)return;(!e||typeof e!=`object`)&&(e={}),e=Ql(e),Qe=$e.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,W=Qe===`application/xhtml+xml`?Ll:Il,R=Pu(e,`ALLOWED_TAGS`,z,{transform:W}),B=Pu(e,`ALLOWED_ATTR`,fe,{transform:W}),Ge=Pu(e,`ALLOWED_NAMESPACES`,Ke,{transform:Ll}),Be=Pu(e,`ADD_URI_SAFE_ATTR`,Ve,{transform:W,base:Ve}),Re=Pu(e,`ADD_DATA_URI_TAGS`,ze,{transform:W,base:ze}),Ie=Pu(e,`FORBID_CONTENTS`,Le,{transform:W}),me=Pu(e,`FORBID_TAGS`,Ql({}),{transform:W}),he=Pu(e,`FORBID_ATTR`,Ql({}),{transform:W}),Fe=Kl(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Ql(e.USE_PROFILES):e.USE_PROFILES:!1,ge=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,ve=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,be=e.SAFE_FOR_TEMPLATES||!1,xe=e.SAFE_FOR_XML!==!1,Se=e.WHOLE_DOCUMENT||!1,De=e.RETURN_DOM||!1,Oe=e.RETURN_DOM_FRAGMENT||!1,ke=e.RETURN_TRUSTED_TYPE||!1,Ee=e.FORCE_BODY||!1,Ae=e.SANITIZE_DOM!==!1,je=e.SANITIZE_NAMED_PROPS||!1,Ne=e.KEEP_CONTENT!==!1,Pe=e.IN_PLACE||!1,de=tu(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:vu,U=typeof e.NAMESPACE==`string`?e.NAMESPACE:H,Je=Fu(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>$({},qe)),Xe=Fu(e,`HTML_INTEGRATION_POINTS`,()=>$({},Ye));let t=Fu(e,`CUSTOM_ELEMENT_HANDLING`,()=>El(null));if(pe=El(null),Kl(t,`tagNameCheck`)&&nt(t.tagNameCheck)&&(pe.tagNameCheck=t.tagNameCheck),Kl(t,`attributeNameCheck`)&&nt(t.attributeNameCheck)&&(pe.attributeNameCheck=t.attributeNameCheck),Kl(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(pe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),Tl(pe),be&&(_e=!1),Oe&&(De=!0),Fe&&(R=$({},cu),B=El(null),Fe.html===!0&&($(R,nu),$(B,lu)),Fe.svg===!0&&($(R,ru),$(B,uu),$(B,fu)),Fe.svgFilters===!0&&($(R,iu),$(B,uu),$(B,fu)),Fe.mathMl===!0&&($(R,ou),$(B,du),$(B,fu))),V.tagCheck=null,V.attributeCheck=null,Kl(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?V.tagCheck=e.ADD_TAGS:Fl(e.ADD_TAGS)&&(R===z&&(R=Ql(R)),$(R,e.ADD_TAGS,W))),Kl(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?V.attributeCheck=e.ADD_ATTR:Fl(e.ADD_ATTR)&&(B===fe&&(B=Ql(B)),$(B,e.ADD_ATTR,W))),Kl(e,`ADD_FORBID_CONTENTS`)&&Fl(e.ADD_FORBID_CONTENTS)&&(Ie===Le&&(Ie=Ql(Ie)),$(Ie,e.ADD_FORBID_CONTENTS,W)),Ne&&(R[`#text`]=!0),Se&&$(R,[`html`,`head`,`body`]),R.table&&($(R,[`tbody`]),delete me.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Yl(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Yl(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=A(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=M()),T&&typeof E==`string`&&(E=A(``)));wl&&wl(e),et=e},it=$({},[...ru,...iu,...au]),at=$({},[...ou,...su]),ot=function(e,t,n){return t.namespaceURI===H?e===`svg`:t.namespaceURI===He?e===`svg`&&(n===`annotation-xml`||Je[n]):!!it[e]},st=function(e,t,n){return t.namespaceURI===H?e===`math`:t.namespaceURI===Ue?e===`math`&&Xe[n]:!!at[e]},ct=function(e,t,n){return t.namespaceURI===Ue&&!Xe[n]||t.namespaceURI===He&&!Je[n]?!1:!at[e]&&(Ze[e]||!it[e])},lt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:U,tagName:`template`});let n=Il(e.tagName),r=Il(t.tagName);return Ge[e.namespaceURI]?e.namespaceURI===Ue?ot(n,t,r):e.namespaceURI===He?st(n,t,r):e.namespaceURI===H?ct(n,t,r):!!(Qe===`application/xhtml+xml`&&Ge[e.namespaceURI]):!1},ut=function(e){Nl(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw Yl(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},dt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},ft=function(e){ht(e);let t=g(e);if(t){let e=[];Al(t,t=>{Nl(e,t)}),Al(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&dt(e,r,i)}},pt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Nl(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(De||Oe)try{ut(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},mt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||B[W(i)]||dt(e,r,i)}},ht=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===Du.element&&mt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},gt=function(e,t){return xe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},_t=function(e){if(!xe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===Du.processingInstruction||n===Du.comment&&Jl(wu,e.data)){try{p(e)}catch{}continue}if(n===Du.element){let t=e,n=W(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&>(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},vt=function(e){let t=null,r=null;if(Ee)e=`<remove></remove>`+e;else{let t=Rl(e,/^[\r\n\t ]+/);r=t&&t[0]}Qe===`application/xhtml+xml`&&U===H&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?A(e):e;if(U===H)try{t=new l().parseFromString(i,Qe)}catch{}if(!t||!t.documentElement){t=te.createDocument(U,`template`,null);try{t.documentElement.innerHTML=We?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),U===H?F.call(t,Se?`html`:`body`)[0]:Se?t.documentElement:a},yt=function(e){let t=S?S(e):e.ownerDocument;return P.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},bt=function(e){return e=zl(e,ie,` `),e=zl(e,ae,` `),e=zl(e,oe,` `),e},xt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=P.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=bt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&Al(i,e=>{Ct(e.content)&&xt(e.content)})},St=function(e){let t=x?x(e):null;return typeof t!=`string`||W(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Ct=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===Du.documentFragment}catch{return!1}},wt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Tt(e,n,r){e.length!==0&&Al(e,e=>{e.call(t,n,r,et)})}let Et=function(e,t){return!!(xe&&e.hasChildNodes()&&!wt(e.firstElementChild)&&Jl(Cu,e.textContent)&&Jl(Cu,e.innerHTML)||xe&&e.namespaceURI===H&&ku[t]&&(wt(e.firstElementChild)||typeof e.textContent==`string`&&Jl(Au[t],e.textContent))||e.nodeType===Du.processingInstruction||xe&&e.nodeType===Du.comment&&Jl(wu,e.data))},Dt=function(e,t){return e instanceof RegExp?Jl(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Ot=function(e,t,n){if(!me[t]&&Pt(t)&&Dt(pe.tagNameCheck,t))return!1;if(Ne&&!Ie[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return ut(e),!0},kt=function(e,t,n,r){return e.length===0?t:t===n||t===r?Ql(t):t},At=function(e,t){return e===t||_(e)!==null?!1:(Pe&&ht(e),!0)},jt=function(e,n){if(Tt(I.beforeSanitizeElements,e,null),At(e,n))return!0;if(St(e))return ut(e),!0;let r=W(w(e));if(R=kt(I.uponSanitizeElement,R,z,we),Tt(I.uponSanitizeElement,e,{tagName:r,allowedTags:R}),At(e,n))return!0;if(Et(e,r))return ut(e),!0;if(me[r]||!(V.tagCheck instanceof Function&&V.tagCheck(r))&&!R[r]){let t=Ot(e,r,n);return t===!1&&(Tt(I.afterSanitizeElements,e,null),At(e,n))?!0:t}if(C(e)===Du.element&&!lt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Jl(Tu,e.innerHTML))return ut(e),!0;if(be&&e.nodeType===Du.text){let n=bt(e.textContent);e.textContent!==n&&(Nl(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Tt(I.afterSanitizeElements,e,null),At(e,n)},Mt=function(e,t,r){if(he[t]||gt(t,e)||Ae&&(t===`id`||t===`name`)&&(r in n||r in tt))return!1;let i=B[t]||V.attributeCheck instanceof Function&&V.attributeCheck(t,e);return _e&&Jl(L,t)||ge&&Jl(se,t)?!0:i?Be[t]||Jl(de,zl(r,le,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Bl(r,`data:`)===0&&Re[e]||ve&&!Jl(ce,zl(r,le,``))?!0:!r:Pt(e)&&Dt(pe.tagNameCheck,e)&&Dt(pe.attributeNameCheck,t,e)||t===`is`&&pe.allowCustomizedBuiltInElements&&Dt(pe.tagNameCheck,r)},Nt=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Pt=function(e){return!Nt[Il(e)]&&Jl(ue,e)},Ft=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return A(r);case`TrustedScriptURL`:return j(r)}return r},It=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!St(e)||(ut(e),!1)}catch{return pt(t,e),!1}},Lt=function(e,n){if(Tt(I.beforeSanitizeAttributes,e,null),At(e,n))return;let r=e.attributes;if(!r||St(e))return;B=kt(I.uponSanitizeAttribute,B,fe,Te);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0},a=r.length,o=W(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=W(s),d=l,f=s===`value`?d:Vl(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Tt(I.uponSanitizeAttribute,e,i),f=i.attrValue,je&&(u===`id`||u===`name`)&&Bl(f,Me)!==0&&(pt(s,e,n),f=Me+f,p=!0),xe&&Jl(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){pt(s,e,n);continue}if(u===`attributename`&&Rl(f,`href`)){pt(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){pt(s,e,n);continue}if(!ye&&Jl(Eu,f)){pt(s,e,n);continue}if(be&&(f=bt(f)),!Mt(o,u,f)){pt(s,e,n);continue}f=Ft(o,u,c,f),f!==d&&It(e,s,c,f)&&p&&Ml(t.removed)}}Tt(I.afterSanitizeAttributes,e,null),At(e,n)},Rt=function(e){let t=null,n=yt(e);for(Tt(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Tt(I.uponSanitizeShadowNode,t,null),jt(t,e),Lt(t,e),Ct(t.content)&&Rt(t.content),C(t)===Du.element){let e=v(t);Ct(e)&&(zt(e),Rt(e))}Tt(I.afterSanitizeShadowDOM,e,null)},zt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Rt(e.shadow);continue}let n=e.node,r=C(n)===Du.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&W(e)===`template`){let e=n.content;Ct(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Ct(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(We=!e,We&&(e=`<!-->`),typeof e!=`string`&&!wt(e)&&(e=$l(e),typeof e!=`string`))throw Yl(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ce?(R=we,B=Te):rt(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(R=Ql(R)),I.uponSanitizeAttribute.length>0&&(B=Ql(B)),t.removed=[];let c=Pe&&typeof e!=`string`&&wt(e);if(c){_t(e);let t=w(e);if(typeof t==`string`){let n=W(t);if(!R[n]||me[n])throw ft(e),Yl(`root node is forbidden and cannot be sanitized in-place`)}if(St(e))throw ft(e),Yl(`root node is clobbered and cannot be sanitized in-place`);try{zt(e)}catch(t){throw ft(e),t}}else if(wt(e))i=vt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Du.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),zt(i);else{if(!De&&!be&&!Se&&e.indexOf(`<`)===-1)return T&&ke?A(e):e;if(i=vt(e),!i)return De?null:ke?E:``}i&&Ee&&ut(i.firstChild);let l=c?e:i;try{let e=yt(l);for(;o=e.nextNode();)jt(o,l),Lt(o,l),Ct(o.content)&&Rt(o.content)}catch(n){throw c&&(ft(e),Al(t.removed,e=>{e.element&&ht(e.element)})),n}if(c){let n=!1;if(Al(t.removed,t=>{t.element&&(t.element===e&&(n=!0),ht(t.element))}),n)throw Yl(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return be&&xt(e),e}if(De){if(be&&xt(i),Oe)for(s=ne.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(B.shadowroot||B.shadowrootmode)&&(s=re.call(r,s,!0)),s}let u=Se?i.outerHTML:i.innerHTML;return Se&&R[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Jl(xu,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
164
|
+
`+u),be&&(u=bt(u)),T&&ke?A(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};rt(e),Ce=!0,we=R,Te=B},t.clearConfig=function(){et=null,Ce=!1,we=null,Te=null,T=ee,E=``},t.isValidAttribute=function(e,t,n){et||rt({});let r=W(e),i=W(t);return Mt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Kl(I,e)&&Nl(I[e],t)},t.removeHook=function(e,t){if(Kl(I,e)){if(t!==void 0){let n=jl(I[e],t);return n===-1?void 0:Pl(I[e],n,1)[0]}return Ml(I[e])}},t.removeHooks=function(e){Kl(I,e)&&(I[e]=[])},t.removeAllHooks=function(){I=Nu()},t}var Lu=Iu(),Ru=new dl({gfm:!0,breaks:!0,pedantic:!1,renderer:(()=>{let e=new ol;return e.code=({text:e,lang:t})=>{let n=(t??``).toLowerCase(),r=Ms(e,n);return`<pre><code${n?` class="language-${n}"`:``}>${r}</code></pre>`},e})()}),zu=`p.br.strong.em.del.s.u.a.ul.ol.li.h1.h2.h3.h4.h5.h6.blockquote.code.pre.hr.table.thead.tbody.tr.th.td.img.span.input`.split(`.`),Bu=[`href`,`title`,`target`,`rel`,`src`,`alt`,`class`,`checked`,`type`,`disabled`],Vu=/^(?:(?:https?|mailto|tel|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;function Hu(e){if(!e)return``;let t=Ru.parse(e,{async:!1});return Lu.sanitize(t,{ALLOWED_TAGS:zu,ALLOWED_ATTR:Bu,ALLOWED_URI_REGEXP:Vu})}var Uu=d({__name:`NotePanel`,props:{selectedNode:{type:[Object,null],required:!0},readonly:{type:Boolean,required:!1},focusTick:{type:Number,required:!1}},emits:[`apply`,`remove`,`set-link`,`set-image`,`set-rich`],setup(e,{expose:t,emit:r}){t();let i=e,a=r,s=A(``),c=A(null);la(c,{minRows:4,maxRows:10});let l=n(()=>!s.value||s.value.trim()===``),u=n(()=>Hu(s.value)),d=A(!0);function f(){d.value=!d.value}C(()=>[i.selectedNode?.id,i.selectedNode?.note?.text],()=>{s.value=i.selectedNode?.note?.text??``},{immediate:!0}),C(()=>i.focusTick,async()=>{if(i.readonly)return;await o();let e=document.querySelector(`.zm-note-panel textarea.zm-note-textarea`);if(e){e.focus();let t=e.value.length;e.setSelectionRange(t,t)}});function p(){if(i.readonly)return;let e=s.value;e!==(i.selectedNode?.note?.text??``)&&a(`apply`,e)}function m(e){i.readonly||(e.key===`Escape`?(e.preventDefault(),s.value=i.selectedNode?.note?.text??``,e.target.blur()):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),p(),e.target.blur()))}function h(){i.readonly||confirm(`移除该节点的笔记?`)&&(s.value=``,a(`remove`))}let g=n(()=>{var e;return!!((e=i.selectedNode?.link)!=null&&e.url)}),_=n(()=>{var e;return!!((e=i.selectedNode?.image)!=null&&e.src)}),v=n(()=>i.selectedNode?.richContent?.kind),y=n(()=>v.value===`code`),b=n(()=>v.value===`table`),x=A(!1),S=A(!1),w=A(!1),T=A(!1);C(()=>i.selectedNode?.id,()=>{x.value=!1,S.value=!1,w.value=!1,T.value=!1});let E=A(``);C(()=>[i.selectedNode?.id,i.selectedNode?.link?.url],()=>{E.value=i.selectedNode?.link?.url??``},{immediate:!0});function ee(){if(i.readonly)return;let e=E.value.trim();e!==(i.selectedNode?.link?.url??``)&&a(`set-link`,e)}let D=A(``);C(()=>[i.selectedNode?.id,i.selectedNode?.image?.src],()=>{D.value=i.selectedNode?.image?.src??``},{immediate:!0});function O(){if(i.readonly)return;let e=D.value.trim();e!==(i.selectedNode?.image?.src??``)&&a(`set-image`,e)}function k(e){let t=e.target;t.style.display=`none`}function j(e){let t=e.target;t.style.display=``}let M=A(``),N=A(null);la(N,{minRows:4,maxRows:18}),C(()=>[i.selectedNode?.id,i.selectedNode?.richContent?.raw],()=>{M.value=i.selectedNode?.richContent?.raw??``},{immediate:!0});let te=n(()=>Ms(As(M.value),js(M.value)));function P(){if(i.readonly)return;let e=M.value;if(e===(i.selectedNode?.richContent?.raw??``))return;let t=js(e)||void 0;a(`set-rich`,e?{kind:`code`,raw:e,lang:t}:null)}let ne=A(``),F=A(null);la(F,{minRows:4,maxRows:14}),C(()=>[i.selectedNode?.id,i.selectedNode?.richContent?.raw],()=>{ne.value=i.selectedNode?.richContent?.raw??``},{immediate:!0});function re(){if(i.readonly)return;let e=ne.value;e!==(i.selectedNode?.richContent?.raw??``)&&a(`set-rich`,e?{kind:`table`,raw:e}:null)}let I={props:i,emit:a,draft:s,noteRef:c,isEmpty:l,noteHtml:u,showPreview:d,togglePreview:f,commitNote:p,onNoteKeydown:m,onRemoveNote:h,hasLink:g,hasImage:_,richKind:v,hasCode:y,hasTable:b,showLink:x,showImage:S,showCode:w,showTable:T,linkDraft:E,commitLink:ee,imageDraft:D,commitImage:O,onImageError:k,onImageLoad:j,codeDraft:M,codeRef:N,codePreviewHtml:te,commitCode:P,tableDraft:ne,tableRef:F,commitTable:re,tableParsedRows:n(()=>Ns(ne.value)),summary:n(()=>{let e=[];return l.value||e.push(`${s.value.length} 字`),g.value&&e.push(`1 链接`),_.value&&e.push(`1 图片`),y.value&&e.push(`代码块`),b.value&&e.push(`表格`),e.length===0?`节点没有额外内容`:e.join(` · `)}),get codeLang(){return js}};return Object.defineProperty(I,"__isScriptSetup",{enumerable:!1,value:!0}),I}}),Wu={class:`zm-note-panel`},Gu={key:0,class:`zm-note-empty`},Ku={class:`zm-note-header`},qu={class:`zm-note-title-row`},Ju={class:`zm-note-name`},Yu={class:`zm-note-meta`},Xu={class:`zm-note-scroll`},Zu={class:`zm-note-section`},Qu={class:`zm-note-section-head`},$u={class:`zm-note-split`},ed=[`disabled`],td={key:0,class:`zm-note-preview`},nd=[`innerHTML`],rd={key:1,class:`zm-note-preview-hint`},id={key:0,class:`zm-note-section-actions`},ad={key:0,class:`zm-note-add-row`},od={key:1,class:`zm-note-section`},sd=[`disabled`],cd=[`href`,`title`],ld={key:2,class:`zm-note-section`},ud=[`disabled`],dd=[`src`,`alt`],fd={key:3,class:`zm-note-section`},pd={class:`zm-note-section-head`},md={key:0,class:`zm-note-section-tag`},hd=[`disabled`],gd={key:0,class:`zm-note-code`},_d=[`innerHTML`],vd={key:4,class:`zm-note-section`},yd=[`disabled`],bd={key:0,class:`zm-note-table`};function xd(e,t,n,a,o,s){return g(),r(`div`,Wu,[n.selectedNode?(g(),r(M,{key:1},[j(`div`,Ku,[j(`div`,qu,[t[12]||=j(`span`,{class:`zm-note-label`},`节点`,-1),j(`span`,Ju,p(n.selectedNode.text||`(无标题)`),1)]),j(`div`,Yu,p(a.summary),1)]),j(`div`,Xu,[i(` Note `),j(`section`,Zu,[j(`header`,Qu,[t[13]||=j(`span`,{class:`zm-note-section-title`},`笔记`,-1),t[14]||=j(`span`,{class:`zm-note-section-hint`},`Ctrl+Enter 提交, Esc 取消`,-1),n.readonly?i(`v-if`,!0):(g(),r(`button`,{key:0,type:`button`,class:`zm-note-preview-toggle`,onClick:a.togglePreview},p(a.showPreview?`隐藏预览`:`显示预览`),1))]),j(`div`,$u,[O(j(`textarea`,{ref:`noteRef`,"onUpdate:modelValue":t[0]||=e=>a.draft=e,class:`zm-note-textarea`,placeholder:`写点什么吧… 支持 Markdown`,spellcheck:`false`,disabled:n.readonly,onBlur:a.commitNote,onKeydown:a.onNoteKeydown},null,40,ed),[[S,a.draft]]),a.showPreview?(g(),r(`div`,td,[a.isEmpty?(g(),r(`div`,rd,` 渲染后的 Markdown 仅在此面板显示,不会撑大节点框。 `)):(g(),r(`div`,{key:0,class:`zm-note-preview-body`,innerHTML:a.noteHtml},null,8,nd))])):i(`v-if`,!0)]),!n.readonly&&!a.isEmpty?(g(),r(`div`,id,[j(`button`,{class:`zm-note-action-btn is-danger`,onClick:a.onRemoveNote},`移除笔记`)])):i(`v-if`,!0)]),i(` Add-row: chips for sections that are not yet populated. `),n.readonly?i(`v-if`,!0):(g(),r(`div`,ad,[!a.hasLink&&!a.showLink?(g(),r(`button`,{key:0,class:`zm-note-add-chip`,onClick:t[1]||=e=>a.showLink=!0},`+ 链接`)):i(`v-if`,!0),!a.hasImage&&!a.showImage?(g(),r(`button`,{key:1,class:`zm-note-add-chip`,onClick:t[2]||=e=>a.showImage=!0},`+ 图片`)):i(`v-if`,!0),!a.hasCode&&!a.showCode?(g(),r(`button`,{key:2,class:`zm-note-add-chip`,onClick:t[3]||=e=>a.showCode=!0},`+ 代码块`)):i(`v-if`,!0),!a.hasTable&&!a.showTable?(g(),r(`button`,{key:3,class:`zm-note-add-chip`,onClick:t[4]||=e=>a.showTable=!0},`+ 表格`)):i(`v-if`,!0)])),i(` Link `),a.hasLink||a.showLink?(g(),r(`section`,od,[t[15]||=j(`header`,{class:`zm-note-section-head`},[j(`span`,{class:`zm-note-section-title`},`链接`)],-1),O(j(`input`,{"onUpdate:modelValue":t[5]||=e=>a.linkDraft=e,class:`zm-note-input`,type:`url`,placeholder:`https://…`,disabled:n.readonly,onBlur:a.commitLink,onKeydown:t[6]||=v(k(e=>e.target.blur(),[`prevent`]),[`enter`])},null,40,sd),[[S,a.linkDraft]]),a.hasLink?(g(),r(`a`,{key:0,class:`zm-note-link-chip`,href:n.selectedNode.link?.url,target:`_blank`,rel:`noopener noreferrer`,title:n.selectedNode.link?.url},p(n.selectedNode.link?.url),9,cd)):i(`v-if`,!0)])):i(`v-if`,!0),i(` Image `),a.hasImage||a.showImage?(g(),r(`section`,ld,[t[16]||=j(`header`,{class:`zm-note-section-head`},[j(`span`,{class:`zm-note-section-title`},`图片`)],-1),O(j(`input`,{"onUpdate:modelValue":t[7]||=e=>a.imageDraft=e,class:`zm-note-input`,type:`url`,placeholder:`data:image/… 或 https://…`,disabled:n.readonly,onBlur:a.commitImage,onKeydown:t[8]||=v(k(e=>e.target.blur(),[`prevent`]),[`enter`])},null,40,ud),[[S,a.imageDraft]]),a.hasImage?(g(),r(`img`,{key:0,class:`zm-note-image`,src:n.selectedNode.image?.src,alt:n.selectedNode.text,onError:a.onImageError,onLoad:a.onImageLoad},null,40,dd)):i(`v-if`,!0)])):i(`v-if`,!0),i(` Code `),a.hasCode||a.showCode?(g(),r(`section`,fd,[j(`header`,pd,[t[17]||=j(`span`,{class:`zm-note-section-title`},`代码块`,-1),a.codeLang(a.codeDraft)?(g(),r(`span`,md,p(a.codeLang(a.codeDraft)),1)):i(`v-if`,!0)]),O(j(`textarea`,{ref:`codeRef`,"onUpdate:modelValue":t[9]||=e=>a.codeDraft=e,class:`zm-note-input zm-note-input-code`,placeholder:"```ts\nconsole.log(123)\n```",spellcheck:`false`,disabled:n.readonly,onBlur:a.commitCode},null,40,hd),[[S,a.codeDraft]]),a.codeDraft.trim()?(g(),r(`pre`,gd,[j(`code`,{innerHTML:a.codePreviewHtml},null,8,_d)])):i(`v-if`,!0)])):i(`v-if`,!0),i(` Table `),a.hasTable||a.showTable?(g(),r(`section`,vd,[t[18]||=j(`header`,{class:`zm-note-section-head`},[j(`span`,{class:`zm-note-section-title`},`表格`)],-1),O(j(`textarea`,{ref:`tableRef`,"onUpdate:modelValue":t[10]||=e=>a.tableDraft=e,class:`zm-note-input zm-note-input-code`,placeholder:`| 列1 | 列2 |
|
|
165
165
|
| --- | --- |
|
|
166
|
-
| a | b |`,spellcheck:`false`,disabled:n.readonly,onBlur:a.commitTable},null,40,yd),[[
|
|
166
|
+
| a | b |`,spellcheck:`false`,disabled:n.readonly,onBlur:a.commitTable},null,40,yd),[[S,a.tableDraft]]),a.tableParsedRows.length?(g(),r(`table`,bd,[j(`tbody`,null,[(g(!0),r(M,null,_(a.tableParsedRows,(e,t)=>(g(),r(`tr`,{key:t},[t===0?(g(!0),r(M,{key:0},_(e,(e,t)=>(g(),r(`th`,{key:`h${t}`},p(e),1))),128)):(g(!0),r(M,{key:1},_(e,(e,t)=>(g(),r(`td`,{key:`c${t}`},p(e),1))),128))]))),128))])])):i(`v-if`,!0)])):i(`v-if`,!0)])],64)):(g(),r(`div`,Gu,[...t[11]||=[j(`p`,null,`请先在画布上选中一个节点。`,-1),j(`p`,{class:`zm-note-hint`},` 选中节点后,会在这里展示并可编辑节点的笔记、链接、图片、代码块、表格。 `,-1)]]))])}var Sd=F(Uu,[[`render`,xd],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/NotePanel.vue`]]),Cd=24,wd=400,Td=160,Ed=4,Dd=d({__name:`MindMap`,props:{data:{type:Object,required:!0},theme:{type:Object,required:!1},previewMode:{type:Boolean,required:!1,default:!1},markdown:{type:String,required:!1},lineColors:{type:Array,required:!1},hideCanvasActions:{type:Boolean,required:!1,default:!1},builtInDrawers:{type:Boolean,required:!1,default:!0}},emits:[`change`,`select`,`edit-note`,`markdownChange`,`canvas-toggle-preview`,`canvas-outline`,`canvas-settings`,`canvas-data`,`canvas-import`],setup(e,{expose:t,emit:r}){let i=e,s=r,c=A(null),l=A(null),u=A(``),d=A(new Set),f=n(()=>d.value.values().next().value??null),p=A(new Set),m=A(!1),h=A(null),g=A(0),_=A(0),v=n(()=>{let e=h.value;if(!e||!e.currentTargetId||!e.dropPosition||e.dropPosition===`child`)return null;let t=kn.value.find(t=>t.id===e.currentTargetId);if(!t)return null;let n=t.width/2,r=t.height/2;if(t._dir===`down`){let i=e.dropPosition===`before`?t.x-n:t.x+n;return{x1:i,y1:t.y-r,x2:i,y2:t.y+r,horizontal:!1}}let i=e.dropPosition===`before`?t.y-r:t.y+r;return{x1:t.x-n,y1:i,x2:t.x+n,y2:i,horizontal:!0}}),y=A(null),b=A(null),S=A(null),w=A(``),T=A(H(i.data)),E=A({}),D=A({}),O=A(i.markdown!==void 0),k=!1;C(()=>i.markdown,e=>{if(e===void 0){O.value=!1;return}O.value=!0;let t=lt(e||``);k=!0,T.value=H(t),d.value=new Set,p.value=new Set,K(),o(()=>{k=!1,ri()})}),C(T,()=>{O.value&&!k&&s(`markdownChange`,ut(T.value))},{deep:!0});let j=n(()=>q.showOrderBadge===!0),M=A(new Map),N=M.value;function te(e,t){let n={};t.bg&&(n.bg=t.bg),t.textColor&&(n.textColor=t.textColor),t.borderColor&&(n.borderColor=t.borderColor),t.fontWeight&&(n.fontWeight=t.fontWeight),t.fontSize&&(n.fontSize=t.fontSize),Object.keys(n).length===0?N.delete(e):N.set(e,n),M.value=new Map(N)}function P(e){return N.get(e)??{}}function ne(e,t){return N.get(e)??t}function F(e,t){let n=U(T.value,e);n&&(n.image={src:t.src,naturalW:t.naturalW,naturalH:t.naturalH,width:L(t.width,Cd,wd),height:L(t.height,Cd,wd)},G(),K(),s(`change`,T.value))}function re(e){let t=U(T.value,e);!t||!t.image||(delete t.image,G(),K(),s(`change`,T.value))}function I(e,t){let n=t.trim();if(!U(T.value,e))return;if(!n){re(e);return}let r=new Image;r.onload=()=>{let t=U(T.value,e);if(!t)return;let i=r.naturalWidth&&r.naturalHeight?r.naturalWidth/r.naturalHeight:1,a=L(r.naturalWidth||Td,Cd,wd),o=Math.round(a/i);t.image={src:n,naturalW:r.naturalWidth||a,naturalH:r.naturalHeight||o,width:a,height:o},G(),K(),s(`change`,T.value)},r.onerror=()=>{},r.src=n}function L(e,t,n){return Math.min(n,Math.max(t,e))}function se(e,t){let n=new FileReader;n.onload=()=>{if(typeof n.result!=`string`)return;let e=n.result,r=new window.Image;r.onload=()=>{let n=r.naturalWidth||Td,i=r.naturalHeight||Td,a=L(n,Cd,Td),o=L(Math.round(i*a/n),Cd,wd);t({src:e,naturalW:n,naturalH:i,width:a,height:o})},r.onerror=()=>{t({src:e,naturalW:Td,naturalH:Td,width:Td,height:Td})},r.src=e},n.readAsDataURL(e)}function ce(e){let t=document.createElement(`input`);t.type=`file`,t.accept=`image/*`,t.style.display=`none`,t.onchange=()=>{let n=t.files?.[0];n&&(se(n,t=>F(e,t)),document.body.removeChild(t))},document.body.appendChild(t),t.click()}function le(e,t){let n=t.trim(),r=U(T.value,e);r&&(n?r.link={url:n}:delete r.link,G(),K(),s(`change`,T.value))}function ue(e){le(e,``)}function de(e,t){let n=U(T.value,e);n&&(t?n.note={text:t}:delete n.note,G(),K(),s(`change`,T.value))}function R(e){de(e,``)}function z(e,t){let n=U(T.value,e);n&&(t?n.richContent=t:delete n.richContent,G(),K(),s(`change`,T.value))}let B=A(null),fe=A(null),pe=n(()=>[`zm-canvas-fab`,`zm-canvas-fab-preview`,!i.hideCanvasActions&&(!i.previewMode||m.value)?`is-visible`:``].filter(Boolean).join(` `)),me=n(()=>[`zm-canvas-fab`,`zm-canvas-fab-outline`,!i.hideCanvasActions&&(!i.previewMode||m.value)?`is-visible`:``].filter(Boolean).join(` `));function he(e,t){i.previewMode||(e.preventDefault(),e.stopPropagation(),fe.value=null,d.value=new Set([t.id]),Y(),B.value={nodeId:t.id,x:e.clientX,y:e.clientY})}function V(){B.value=null}function ge(e){let t=e.target;if(!(t!=null&&t.closest(`.zm-toolbar, button, input, textarea, .zm-canvas-fab-preview, .zm-canvas-fab-outline`))){if(Jr&&J.panMoved.value){Jr=!1,e.preventDefault();return}e.preventDefault(),B.value&&=null,fe.value={x:e.clientX,y:e.clientY}}}function _e(){fe.value=null}function ve(){_e(),i.builtInDrawers&&(ke(),Te.value=!0),s(`canvas-settings`)}function ye(){_e(),i.builtInDrawers&&(ke(),Se.value=!0),s(`canvas-data`)}function be(e){_e(),i.builtInDrawers&&(ke(),De.value=e,Se.value=!0),s(`canvas-import`,e)}let xe=A(!1),Se=A(!1),Ce=A(!1),we=A(!1),Te=A(!1),Ee=A(0),De=A(null),Oe=A(new Set);function ke(){Se.value=!1,Ce.value=!1,we.value=!1,Te.value=!1}let je=n(()=>{let e=f.value;return e?U(T.value,e)??null:null}),Me=n(()=>je.value?P(je.value.id):{});function Ne(e){e.autoBalanceOnChange!==void 0&&(q.autoBalanceOnChange=e.autoBalanceOnChange),e.lineWidthStart!==void 0&&(q.lineWidthStart=Math.max(.5,Math.min(20,e.lineWidthStart))),e.lineWidthEnd!==void 0&&(q.lineWidthEnd=Math.max(.1,Math.min(10,e.lineWidthEnd))),e.rainbowBranch!==void 0&&(q.rainbowBranch=e.rainbowBranch),e.branchPaletteId!==void 0&&(q.branchPaletteId=e.branchPaletteId),e.customPalettes!==void 0&&(q.customPalettes=e.customPalettes),e.lineStyle!==void 0&&(q.lineStyle=e.lineStyle),e.rootLineStyle!==void 0&&(q.rootLineStyle=e.rootLineStyle),e.lineOrigin!==void 0&&(q.lineOrigin=e.lineOrigin),e.taperedEdge!==void 0&&(q.taperedEdge=e.taperedEdge),e.lineWidthTaper!==void 0&&(q.lineWidthTaper=Math.max(.1,Math.min(1,e.lineWidthTaper))),e.uniformLineWidth!==void 0&&(q.uniformLineWidth=e.uniformLineWidth),e.elbowRadius!==void 0&&(q.elbowRadius=Math.max(2,Math.min(40,e.elbowRadius))),e.showOrderBadge!==void 0&&(q.showOrderBadge=e.showOrderBadge),e.canvasBg!==void 0&&(q.canvasBg=e.canvasBg),e.branchGap!==void 0&&(q.branchGap=Math.max(0,Math.min(80,e.branchGap)))}function Pe(e){je.value&&te(je.value.id,e)}function Fe(){let e={autoBalanceOnChange:!0,lineWidthStart:10,lineWidthEnd:2,rainbowBranch:!0,branchPaletteId:`default`,customPalettes:[],lineStyle:`rounded-elbow`,rootLineStyle:`arc`,lineOrigin:`xmind`,layoutMode:`mindmap`,taperedEdge:!0,lineWidthTaper:.3,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20};q.autoBalanceOnChange=e.autoBalanceOnChange,q.lineWidthStart=e.lineWidthStart,q.lineWidthEnd=e.lineWidthEnd,q.rainbowBranch=e.rainbowBranch,q.branchPaletteId=e.branchPaletteId,q.customPalettes=e.customPalettes,q.lineStyle=e.lineStyle,q.rootLineStyle=e.rootLineStyle,q.lineOrigin=e.lineOrigin,q.layoutMode=e.layoutMode,q.taperedEdge=e.taperedEdge,q.lineWidthTaper=e.lineWidthTaper,q.uniformLineWidth=e.uniformLineWidth,q.elbowRadius=e.elbowRadius,q.showOrderBadge=e.showOrderBadge,q.canvasBg=e.canvasBg,q.branchGap=e.branchGap}function Ie(){De.value=null}function ze(e){let t=f.value;t&&de(t,e)}function Be(){let e=f.value;e&&R(e)}function Ve(e){let t=f.value;t&&le(t,e)}function He(e){let t=f.value;t&&I(t,e)}function Ue(e){let t=f.value;t&&z(t,e)}function Je(e){let t=document.querySelector(`[data-node-id="${e.id}"]`);t&&t.click()}function nt(e){pr(e.id,e.text)}function dt(e){Un(e)}function ft(e){Wn(e)}function mt(e){mr(e.srcId,e.targetId,e.position)}function ht(e){let t=new Set(Oe.value);t.has(e)?t.delete(e):t.add(e),Oe.value=t}function vt(){i.builtInDrawers&&(xe.value=!xe.value),s(`canvas-outline`)}function yt(){let e=B.value?.nodeId;e&&ce(e)}function bt(){let e=B.value?.nodeId;if(!e)return;let t=U(T.value,e)?.link?.url??``,n=window.prompt(`输入链接 URL(留空取消)`,t);n!==null&&le(e,n)}function xt(){let e=B.value?.nodeId;e&&ue(e)}function St(){let e=B.value?.nodeId;e&&Pt(e)}function Et(){let e=B.value?.nodeId;e&&R(e)}function Dt(){let e=B.value?.nodeId;e&&re(e)}function Ot(){let e=B.value?.nodeId;if(!e)return;let t=U(T.value,e)?.richContent,n=t?.kind===`code`?As(t.raw):``,r=t?.kind===`code`&&t.lang||``,i=r?"```"+r+`
|
|
167
167
|
`:"```\n",a=window.prompt("输入代码块内容(用 ```lang 包裹;留空取消)",n?i+n+(n.endsWith("```")?``:"\n```"):i+"// 你的代码\n```");if(a===null)return;let o=a.trim();if(!o){z(e,null);return}let s=/^```([^\s`]*)/.exec(o);z(e,{kind:`code`,raw:o,lang:s?s[1]:void 0})}function kt(){let e=B.value?.nodeId;e&&z(e,null)}function At(){let e=B.value?.nodeId;if(!e)return;let t=U(T.value,e)?.richContent,n=t?.kind===`table`?t.raw:``,r=window.prompt(`输入 markdown 表格(每行以 | 分隔;留空取消)`,n||`| 列1 | 列2 | 列3 |
|
|
168
168
|
| --- | --- | --- |
|
|
169
|
-
| a | b | c |`);if(r===null)return;let i=r.trim();if(!i){z(e,null);return}z(e,{kind:`table`,raw:i})}function jt(){let e=B.value?.nodeId;e&&z(e,null)}function Nt(){let e=B.value?.nodeId;e&&zr(e)}function Pt(e){i.previewMode||(d.value=new Set([e]),Y(),i.builtInDrawers&&(ke(),we.value=!0,Ee.value++),a(`edit-note`,e))}function It(e,t=60){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n||`点击编辑笔记`:n.slice(0,t)+`…`}function Lt(e){if(i.previewMode||l.value)return;let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable))return;let n=f.value;if(!n)return;let r=e.clipboardData?.items;if(!r)return;for(let t=0;t<r.length;t++){let i=r[t];if(i.kind===`file`&&i.type.startsWith(`image/`)){let t=i.getAsFile();if(!t)continue;e.preventDefault();let r=U(T.value,n);if(r!=null&&r.image&&!window.confirm(`该节点已有图片,要用剪贴板里的图片替换吗?`))return;se(t,e=>F(n,e));return}}if(x.value&&x.value.nodes.length>0)return;let o=null;for(let t=0;t<r.length;t++){let n=r[t];if(n.kind===`string`&&n.type===`text/plain`){o=e.clipboardData?.getData(`text/plain`)??null;break}}if(!o)return;let s=o.split(/\r?\n/).map(e=>e.replace(/^\s*[-*+]\s+/,``).trim()).filter(e=>e.length>0);if(s.length!==0){e.preventDefault(),G();for(let e of s)Ye(T.value,n,e);K(),a(`change`,T.value)}}o(()=>{window.addEventListener(`paste`,Lt),window.addEventListener(`keydown`,Rt),K()}),c(()=>{window.removeEventListener(`paste`,Lt),window.removeEventListener(`keydown`,Rt)});function Rt(e){if((e.metaKey||e.ctrlKey)&&(e.key===`f`||e.key===`F`)){let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable))return;e.preventDefault(),a(`canvas-outline`);return}if((e.key===`Delete`||e.key===`Backspace`)&&wr.value){let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||i.previewMode)return;e.preventDefault(),Lr(wr.value)}}let zt=v(null),Bt=n(()=>zt.value?.nodeId??null);function Vt(e,t){if(!t.image)return;e.preventDefault(),e.stopPropagation();let n=t.image.naturalW||t.image.width,r=t.image.naturalH||t.image.height,i=r>0?r/n:1;zt.value={nodeId:t.id,startX:e.clientX,startY:e.clientY,startW:t.image.width,startH:t.image.height,naturalW:n,naturalH:r,ratio:i,pendingW:t.image.width,pendingH:t.image.height},window.addEventListener(`mousemove`,Ht),window.addEventListener(`mouseup`,Ut)}function Ht(e){let t=zt.value;if(!t)return;let n=J.scale.value||1,r=e.clientX-t.startX,i=L(t.startW+r/n,Cd,wd),a=L(i*t.ratio,Cd,wd);t.pendingW=i,t.pendingH=a;let o=s.value?.querySelector(`[data-node-id="${t.nodeId}"] .zm-node-img`);o&&(o.style.width=`${i}px`,o.style.height=`${a}px`);let c=s.value?.querySelector(`[data-node-id="${t.nodeId}"]`);c&&(c.style.minWidth=`${Math.max(80,Math.ceil(i+28))}px`,c.style.height=`${Math.ceil(a+8+30)}px`)}function Ut(){let e=zt.value;if(window.removeEventListener(`mousemove`,Ht),window.removeEventListener(`mouseup`,Ut),zt.value=null,!e)return;let t=U(T.value,e.nodeId);!t||!t.image||(F(e.nodeId,{src:t.image.src,naturalW:t.image.naturalW,naturalH:t.image.naturalH,width:e.pendingW,height:e.pendingH}),d.value=new Set([e.nodeId]),Y(),Gt=!0)}let Wt=v(null),Gt=!1,Kt=!1;function Jt(e){Wt.value=e}function Yt(e){Wt.value===e&&(Wt.value=null),S.value&&=null}function Xt(e,t){if(!t.text||t.text.length<14)return;let n=e.currentTarget.getBoundingClientRect(),r=s.value?.getBoundingClientRect();if(!r)return;let i=n.top-r.top>60,a=n.left-r.left+n.width/2,o=r.width-120-10,c=Math.max(130,Math.min(a,o)),l=i?n.top-r.top-8:n.bottom-r.top+8;S.value={text:t.text,x:c,y:l,above:i}}function Zt(e){return Wt.value===e||f.value===e}let Qt=v(0),$t=v(!1),en=_t(100);function G(){en.record({data:T.value,selectedIds:[...d.value]})}function tn(e,t={}){T.value=H(e),t.resetCollapsed&&(p.value=new Set),t.resetSelection&&(d.value=new Set,Y()),K(),a(`change`,T.value)}function K(){p.value=new Set(p.value),Qt.value++,m().then(()=>m()).then(()=>nn()).then(()=>{Qt.value++})}function nn(){let e=document.querySelectorAll(`.zm-rich`),t={},n={};e.forEach(e=>{let r=e,i=null;for(;r&&!i;)i=r.getAttribute(`data-node-id`),r=r.parentElement;if(!i)return;let a=e.offsetHeight,o=e.scrollWidth,s=Math.round(a*2)/2,c=Math.round(o*2)/2;t[i]=s,n[i]=c,E.value[i],ee.value[i]}),E.value=t,ee.value=n}let rn=n(()=>({rootBg:i.theme?.rootBg??`#1f2937`,rootText:i.theme?.rootText??`#ffffff`,branchBg:i.theme?.branchBg??`#ffffff`,branchText:i.theme?.branchText??`#1f2937`,lineColor:i.theme?.lineColor??`#94a3b8`,bgColor:i.theme?.bgColor??`#f8fafc`,fontSize:i.theme?.fontSize??14,lineWidthStart:i.theme?.lineWidthStart??2.2,lineWidthEnd:i.theme?.lineWidthEnd??.8,rainbowBranch:i.theme?.rainbowBranch??!1})),an=n(()=>q.canvasBg||rn.value.bgColor),q=A({autoBalanceOnChange:!0,lineWidthStart:10,lineWidthEnd:2,rainbowBranch:!0,branchPaletteId:`default`,customPalettes:[],lineStyle:`rounded-elbow`,rootLineStyle:`arc`,lineOrigin:`xmind`,layoutMode:`mindmap`,taperedEdge:!0,lineWidthTaper:.3,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20});function on(e){return e?q.rootLineStyle:q.lineStyle}function sn(e){return q.taperedEdge?q.uniformLineWidth&&e>0?q.lineWidthEnd:ln(e):un(e)}function cn(e){return q.taperedEdge?q.lineWidthEnd:un(e)}function ln(e){let t=q.lineWidthTaper,n=q.lineWidthStart*t**+e;return Math.max(q.lineWidthEnd,n)}function un(e){if(e<=0)return q.lineWidthStart;if(e>=3)return q.lineWidthEnd;let t=e/3;return q.lineWidthStart+(q.lineWidthEnd-q.lineWidthStart)*t}function dn(e,t,n,r){let i=1-e;return{x:i*i*i*t.x+3*i*i*e*n.x1+3*i*e*e*n.x2+e*e*e*r.x,y:i*i*i*t.y+3*i*i*e*n.y1+3*i*e*e*n.y2+e*e*e*r.y}}function fn(e,t,n,r){let i=1-e;return{x:i*i*t.x+2*i*e*n.x+e*e*r.x,y:i*i*t.y+2*i*e*n.y+e*e*r.y}}function pn(e,t,n,r,i=32,a=`curve`,o=`right`){if(a===`curve`){let a;if(o===`right`||o===`left`){let n=Math.abs(t.x-e.x)*.45,r=o===`right`?1:-1;a={x1:e.x+r*n,y1:e.y,x2:t.x-r*n,y2:t.y}}else{let n=Math.abs(t.y-e.y)*.45;a={x1:e.x,y1:e.y+n,x2:t.x,y2:t.y-n}}let s=n=>{let r=1-n;return{dx:-3*r*r*e.x+3*(r*r-2*r*n)*a.x1+3*(2*r*n-n*n)*a.x2+3*n*n*t.x,dy:-3*r*r*e.y+3*(r*r-2*r*n)*a.y1+3*(2*r*n-n*n)*a.y2+3*n*n*t.y}},c=[],l=[];for(let o=0;o<=i;o++){let u=o/i,d=o===0?e:o===i?t:dn(u,e,a,t),f=s(u),p=Math.hypot(f.dx,f.dy);p<1e-6&&(p=1);let m=-f.dy/p,h=f.dx/p,g=(n+(r-n)*u)/2;c.push({x:d.x+m*g,y:d.y+h*g}),l.push({x:d.x-m*g,y:d.y-h*g})}let u=`M ${c[0].x.toFixed(2)} ${c[0].y.toFixed(2)}`;for(let e=1;e<=i;e++)u+=` L ${c[e].x.toFixed(2)} ${c[e].y.toFixed(2)}`;for(let e=i;e>=0;e--)u+=` L ${l[e].x.toFixed(2)} ${l[e].y.toFixed(2)}`;return u+=` Z`,u}if(a===`arc`){let a;a=o===`right`||o===`left`?{x:(e.x+t.x)/2,y:t.y}:{x:t.x,y:(e.y+t.y)/2};let s=n=>{let r=1-n;return{dx:2*r*(a.x-e.x)+2*n*(t.x-a.x),dy:2*r*(a.y-e.y)+2*n*(t.y-a.y)}},c=[],l=[];for(let o=0;o<=i;o++){let u=o/i,d=o===0?e:o===i?t:fn(u,e,a,t),f=s(u),p=Math.hypot(f.dx,f.dy);p<1e-6&&(p=1);let m=-f.dy/p,h=f.dx/p,g=(n+(r-n)*u)/2;c.push({x:d.x+m*g,y:d.y+h*g}),l.push({x:d.x-m*g,y:d.y-h*g})}let u=n/2,d=r/2,f=`M ${c[0].x.toFixed(2)} ${c[0].y.toFixed(2)}`;for(let e=1;e<=i;e++)f+=` L ${c[e].x.toFixed(2)} ${c[e].y.toFixed(2)}`;f+=` A ${d.toFixed(2)} ${d.toFixed(2)} 0 0 0 ${l[i].x.toFixed(2)} ${l[i].y.toFixed(2)}`;for(let e=i-1;e>=0;e--)f+=` L ${l[e].x.toFixed(2)} ${l[e].y.toFixed(2)}`;return f+=` A ${u.toFixed(2)} ${u.toFixed(2)} 0 0 0 ${c[0].x.toFixed(2)} ${c[0].y.toFixed(2)}`,f+=` Z`,f}if(a===`elbow`){let i=[];if(o===`down`){let n=(e.y+t.y)/2;i.push(e,{x:e.x,y:n},{x:t.x,y:n},t)}else{let n=(e.x+t.x)/2;i.push(e,{x:n,y:e.y},{x:n,y:t.y},t)}let a=[],s=0;for(let e=0;e<i.length-1;e++){let t=Math.hypot(i[e+1].x-i[e].x,i[e+1].y-i[e].y);a.push(t),s+=t}let c=[n/2],l=0;for(let e=0;e<a.length-1;e++){l+=a[e];let t=s>0?l/s:0;c.push((n+(r-n)*t)/2)}c.push(r/2);let u=[];for(let e=0;e<i.length-1;e++){let t=i[e+1].x-i[e].x,n=i[e+1].y-i[e].y,r=Math.hypot(t,n);r<1e-6&&(r=1),u.push({x:-n/r,y:t/r})}let d=[],f=[];d.push({x:i[0].x+u[0].x*c[0],y:i[0].y+u[0].y*c[0]}),f.push({x:i[0].x-u[0].x*c[0],y:i[0].y-u[0].y*c[0]});for(let e=1;e<i.length-1;e++){let t=u[e-1],n=u[e],r=c[e],a=t.x+n.x,o=t.y+n.y,s=a*a+o*o;if(s<1e-6)d.push({x:i[e].x+t.x*r,y:i[e].y+t.y*r}),f.push({x:i[e].x-t.x*r,y:i[e].y-t.y*r});else{let t=2*r/s;d.push({x:i[e].x+a*t,y:i[e].y+o*t}),f.push({x:i[e].x-a*t,y:i[e].y-o*t})}}let p=u[u.length-1],m=c[c.length-1];d.push({x:i[i.length-1].x+p.x*m,y:i[i.length-1].y+p.y*m}),f.push({x:i[i.length-1].x-p.x*m,y:i[i.length-1].y-p.y*m});let h=`M ${d[0].x.toFixed(2)} ${d[0].y.toFixed(2)}`;for(let e=1;e<d.length;e++)h+=` L ${d[e].x.toFixed(2)} ${d[e].y.toFixed(2)}`;for(let e=f.length-1;e>=0;e--)h+=` L ${f[e].x.toFixed(2)} ${f[e].y.toFixed(2)}`;return h+=` Z`,h}if(a===`rounded-elbow`&&!(o===`down`?Math.abs(e.x-t.x)<.5:Math.abs(e.y-t.y)<.5)){let i=function(e,t,n){let r={x:e.pos.x-t*e.d1.x,y:e.pos.y-t*e.d1.y},i={x:e.pos.x+t*e.d2.x,y:e.pos.y+t*e.d2.y},a={x:e.pos.x+t*(e.d2.x-e.d1.x),y:e.pos.y+t*(e.d2.y-e.d1.y)},o=Math.atan2(r.y-a.y,r.x-a.x),s=Math.atan2(i.y-a.y,i.x-a.x)-o;for(;s>Math.PI;)s-=2*Math.PI;for(;s<-Math.PI;)s+=2*Math.PI;let c=[];for(let e=1;e<n;e++){let r=e/n,i=o+s*r;c.push({x:a.x+t*Math.cos(i),y:a.y+t*Math.sin(i)})}return c},a=[],s;if(o===`down`){let n=(e.y+t.y)/2,r=Math.sign(n-e.y)||1,i=Math.sign(t.x-e.x)||1,a=Math.sign(t.y-n)||1;s=[{pos:{x:e.x,y:n},d1:{x:0,y:r},d2:{x:i,y:0}},{pos:{x:t.x,y:n},d1:{x:i,y:0},d2:{x:0,y:a}}]}else{let n=(e.x+t.x)/2,r=Math.sign(n-e.x)||1,i=Math.sign(t.y-e.y)||1,a=Math.sign(t.x-n)||1;s=[{pos:{x:n,y:e.y},d1:{x:r,y:0},d2:{x:0,y:i}},{pos:{x:n,y:t.y},d1:{x:0,y:i},d2:{x:a,y:0}}]}let c=Math.hypot(s[1].pos.x-s[0].pos.x,s[1].pos.y-s[0].pos.y),l=Math.hypot(t.x-s[1].pos.x,t.y-s[1].pos.y),u=Math.min(c,l,q.elbowRadius)*.5,d=Math.max(2,u);a.push(e),a.push(s[0].pos),a.push({x:s[1].pos.x-d*s[1].d1.x,y:s[1].pos.y-d*s[1].d1.y});for(let e of i(s[1],d,12))a.push(e);a.push(t);let f=[],p=0;for(let e=0;e<a.length-1;e++){let t=Math.hypot(a[e+1].x-a[e].x,a[e+1].y-a[e].y);f.push(t),p+=t}let m=[];for(let e=0;e<a.length-1;e++){let t=a[e+1].x-a[e].x,n=a[e+1].y-a[e].y,r=Math.hypot(t,n);r<1e-6&&(r=1),m.push({x:-n/r,y:t/r})}let h=[],g=0;for(let e=0;e<a.length;e++){e>0&&(g+=f[e-1]);let t=p>0?g/p:0;h.push((n+(r-n)*t)/2)}let _=[],v=[];for(let e=0;e<a.length;e++){let t=h[e];if(e===0){let n=m[0];_.push({x:a[e].x+n.x*t,y:a[e].y+n.y*t}),v.push({x:a[e].x-n.x*t,y:a[e].y-n.y*t})}else if(e===a.length-1){let n=m[m.length-1];_.push({x:a[e].x+n.x*t,y:a[e].y+n.y*t}),v.push({x:a[e].x-n.x*t,y:a[e].y-n.y*t})}else{let n=m[e-1],r=m[e],i=n.x+r.x,o=n.y+r.y,s=i*i+o*o;if(s<1e-6)_.push({x:a[e].x+n.x*t,y:a[e].y+n.y*t}),v.push({x:a[e].x-n.x*t,y:a[e].y-n.y*t});else{let n=2*t/s;_.push({x:a[e].x+i*n,y:a[e].y+o*n}),v.push({x:a[e].x-i*n,y:a[e].y-o*n})}}}let y=`M ${_[0].x.toFixed(2)} ${_[0].y.toFixed(2)}`;for(let e=1;e<_.length;e++)y+=` L ${_[e].x.toFixed(2)} ${_[e].y.toFixed(2)}`;y+=` L ${v[_.length-1].x.toFixed(2)} ${v[_.length-1].y.toFixed(2)}`;for(let e=v.length-2;e>=0;e--)y+=` L ${v[e].x.toFixed(2)} ${v[e].y.toFixed(2)}`;return y+=` Z`,y}{let i=t.x-e.x,a=t.y-e.y,o=Math.hypot(i,a);o<1e-6&&(o=1);let s=-a/o,c=i/o,l=n/2,u=r/2,d={x:e.x+s*l,y:e.y+c*l},f={x:e.x-s*l,y:e.y-c*l},p={x:t.x-s*u,y:t.y-c*u},m={x:t.x+s*u,y:t.y+c*u};return`M ${d.x.toFixed(2)} ${d.y.toFixed(2)} L ${m.x.toFixed(2)} ${m.y.toFixed(2)} L ${p.x.toFixed(2)} ${p.y.toFixed(2)} L ${f.x.toFixed(2)} ${f.y.toFixed(2)} Z`}}let mn=n(()=>Dn.value.root.children),hn=Le[0].colors,gn=n(()=>Re(q.branchPaletteId,q.customPalettes)),_n=n(()=>{let e=new Map;if(!q.rainbowBranch)return e;let t=i.lineColors,n=t&&t.length>0?t:gn.value.colors.length>0?gn.value.colors:hn;for(let t=0;t<mn.value.length;t++){let r=mn.value[t];e.set(r.id,n[t%n.length])}let r=(t,n)=>{e.set(t.id,n);for(let e of t.children)r(e,n)};for(let e=0;e<mn.value.length;e++){let t=mn.value[e];r(t,n[e%n.length])}return e});function vn(e,t){return q.rainbowBranch?_n.value.get(t.id)??rn.value.lineColor:rn.value.lineColor}function yn(e){let t=P(e.id);if(t.bg)return t.bg;if(e.isRoot)return rn.value.rootBg;if(e.depth>=3)return`transparent`;let n=e.depth===1?.15:.08;if(q.rainbowBranch){let t=_n.value.get(e.id);if(t)return Tn(t,n)}return Tn(rn.value.rootBg,n)}function xn(e){let t=P(e.id);if(t.textColor)return t.textColor;if(e.isRoot)return rn.value.rootText;if(q.rainbowBranch){let t=_n.value.get(e.id);if(t)return En(t,.55)}return rn.value.branchText}function Sn(e){let t=P(e.id);return t.borderColor?t.borderColor:`transparent`}function Cn(e){let t=P(e.id);return t.fontWeight?t.fontWeight:e.isRoot?700:e.depth<=1?600:e.depth===2?500:400}function wn(e){return P(e.id).fontSize??e.fontSize??rn.value.fontSize}function Tn(e,t){let n=e.replace(`#`,``),r=n.length===6?n:n.split(``).map(e=>e+e).join(``);return`rgba(${parseInt(r.slice(0,2),16)}, ${parseInt(r.slice(2,4),16)}, ${parseInt(r.slice(4,6),16)}, ${t})`}function En(e,t){let n=e.replace(`#`,``),r=n.length===6?n:n.split(``).map(e=>e+e).join(``);return`rgb(${Math.round(parseInt(r.slice(0,2),16)*(1-t))}, ${Math.round(parseInt(r.slice(2,4),16)*(1-t))}, ${Math.round(parseInt(r.slice(4,6),16)*(1-t))})`}let J=pt({getContainer:()=>s.value});J.setOnMarqueeEnd(Zr),gt({isEditing:()=>l.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>f.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>T.value.id,onAddChild:Un,onAddSibling:Wn,onAddSiblingBefore:Gn,onRemove:or,onStartEdit:Nn,onClearSelection:()=>{if(Tr.value){Tr.value=null;return}if(wr.value){wr.value=null;return}d.value=new Set,Y()},onDuplicate:Kn,onCopy:Zn,onCut:$n,onPaste:er,hasClipboard:()=>!!x.value&&x.value.nodes.length>0,onUndo:tr,onRedo:nr,onNavigate:rr,onMoveSibling:hr,onSelectRoot:()=>{d.value=new Set([T.value.id]),Y()}});let Dn=n(()=>{let e=H(T.value);return Mn(e),Ae(e,{mode:q.layoutMode,baseFontSize:rn.value.fontSize,richHeights:E.value,richWidths:ee.value,branchGap:q.branchGap})}),On=v([]),kn=n(()=>(Qt.value,On.value));D(Dn,e=>{let t=[],n=e=>{t.push(e);for(let t of e.children)n(t)};n(e.root),On.value=t},{immediate:!0});let An=n(()=>{let e=[];for(let t of kn.value)for(let n of t.children)e.push({from:t,to:n,key:`${t.id}->${n.id}`});return e}),jn=n(()=>`${Dn.value.vbX} ${Dn.value.vbY} ${Dn.value.vbW} ${Dn.value.vbH}`);function Mn(e){if(p.value.has(e.id)){e.children=[],e.collapsed=!0;return}e.collapsed=!1;for(let t of e.children)Mn(t)}function Nn(e){let t=U(T.value,e);t&&(l.value=e,u.value=t.text,d.value=new Set([e]),Y(),m(()=>{let e=document.querySelector(`.zm-input`);e?.focus(),e?.select(),In(e)}))}function Pn(){if(!l.value)return;let e=U(T.value,l.value);e&&e.text!==(u.value.trim()||` `)&&(e.text=u.value.trim()||` `,G(),a(`change`,T.value)),l.value=null}function Fn(){l.value=null}function In(e){e&&(e.style.height=`auto`,e.style.height=e.scrollHeight+`px`)}function Ln(e){In(e.target)}function Rn(e){if(i.previewMode)return;let t=U(T.value,e);t!=null&&t.richContent&&(C.value=e,w.value=t.richContent.raw,m(()=>{document.querySelector(`.zm-node .zm-rich textarea`)?.focus()}))}function zn(){if(!C.value)return;let e=C.value,t=U(T.value,e),n=w.value;t&&t.richContent&&t.richContent.raw!==n&&(t.richContent.kind===`code`?z(e,{kind:`code`,raw:n,lang:js(n)||void 0}):z(e,{kind:`table`,raw:n})),C.value=null}function Bn(){C.value=null}function Vn(e){e.key===`Escape`?(e.preventDefault(),Bn()):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),zn())}function Hn(e){let t=e.metaKey||e.ctrlKey;t&&(e.key===`z`||e.key===`Z`)&&!e.shiftKey?(e.preventDefault(),tr()):(t&&e.shiftKey&&(e.key===`z`||e.key===`Z`)||t&&(e.key===`y`||e.key===`Y`)&&!e.shiftKey)&&(e.preventDefault(),nr())}function Un(e){let t=Ye(T.value,e,tt);t&&(G(),K(),a(`change`,T.value),m(()=>Nn(t.id)))}function Wn(e){if(e===T.value.id){Un(e);return}let t=Xe(T.value,e,tt);t&&(G(),K(),a(`change`,T.value),m(()=>Nn(t.id)))}function Gn(e){if(e===T.value.id){Un(e);return}let t=Ze(T.value,e,tt);t&&(G(),K(),a(`change`,T.value),m(()=>Nn(t.id)))}function Kn(e){if(e===T.value.id)return;let t=Qe(T.value,e);t&&(G(),d.value=new Set([t.id]),Y(),a(`change`,T.value),K())}function qn(e){let t=[],n=new Set;for(let r of e)r!==T.value.id&&(n.has(r)||U(T.value,r)&&(n.add(r),t.push(r)));return t}function Jn(e){let t=new Set(e),n=[],r=e=>{t.has(e.id)&&n.push(e.id);for(let t of e.children)r(t)};return r(T.value),n}function Yn(e){var t;try{(t=navigator.clipboard)==null||t.writeText(e)}catch{}}function Xn(e){let t=[],n=(e,r)=>{let i=` `.repeat(r),a=r===0?``:`- `;t.push(i+a+(e.text||``));for(let t of e.children)n(t,r+1)};return n(e,0),t.join(`
|
|
170
|
-
`)}function Zn(e){if(e.includes(T.value.id)){
|
|
171
|
-
`)),K())}function $n(e){let t=Jn(qn(e));if(t.length===0)return;let n=[];for(let e of t){let t=W(T.value,e);t&&n.push(t)}if(n.length===0)return;G();let r=[];for(let e of t){let t=U(T.value,e);t&&r.push(...qr(t))}for(let e of t)Ge(T.value,e);for(let e of r)ct(T.value,e);d.value=new Set,Y(),
|
|
172
|
-
`)),K(),
|
|
173
|
-
`).map(e=>e.replace(/^\s*[-*+]\s+/,``).replace(/^\s*\d+\.\s+/,``).trim()).filter(e=>e.length>0)}function ar(e){return e.replace(/\s+/g,` `).trim()}function or(e){var t;if(e===T.value.id)return;let n=U(T.value,e),r=n?qr(n):[e];if(Ge(T.value,e)){for(let e of r)ct(T.value,e);if((t=Tr.value)!=null&&t.fromId&&r.includes(Tr.value.fromId)&&(Tr.value=null),G(),d.value.has(e)){let t=new Set(d.value);t.delete(e),d.value=t,Y()}K(),a(`change`,T.value)}}function sr(e){p.value.has(e)?p.value.delete(e):p.value.add(e),K()}function cr(e){let t=[{n:T.value,depth:1}];for(;t.length;){let{n,depth:r}=t.pop();e(n,r);for(let e=n.children.length-1;e>=0;e--)t.push({n:n.children[e],depth:r+1})}}function ur(){p.value=new Set,cr(e=>{e.children.length>0&&p.value.add(e.id)}),K()}function dr(e){p.value=new Set,cr((t,n)=>{n>e&&t.children.length>0&&p.value.add(t.id)}),K()}function fr(){p.value=new Set,K()}function pr(e,t){Ke(T.value,e,t)&&(G(),K(),a(`change`,T.value))}function mr(e,t,n){return qe(T.value,e,t,n)?(G(),K(),a(`change`,T.value),!0):!1}function hr(e){let t=f.value;if(!t)return;let n=T.value;if(t===n.id)return;let r=We(n,t);if(!r)return;let i=r.children.findIndex(e=>e.id===t);if(i<0)return;let o=e,s=kn.value.find(e=>e.id===t);if(s&&Sr(s)&&(o=-e),o<0){if(i===0)return;let e=r.children[i-1].id;qe(n,t,e,`before`)}else{if(i>=r.children.length-1)return;let e=r.children[i+1].id;qe(n,t,e,`after`)}G(),K(),a(`change`,n)}function gr(e,t){if(Kt){Kt=!1;return}if(e.stopPropagation(),Tr.value){let e=Tr.value;e.fromId?e.fromId!==t.id&&(Ir(e.fromId,t.id),Tr.value=null):(e.fromId=t.id,d.value=new Set([t.id]),Y());return}if(wr.value=null,e.shiftKey){let e=new Set(d.value);e.has(t.id)?e.delete(t.id):e.add(t.id),d.value=e}else d.value=new Set([t.id]);Y()}function _r(e,t,n){let r=null;for(let i of kn.value){if(i.id===n)continue;let a=i.width/2,o=i.height/2;e>=i.x-a&&e<=i.x+a&&t>=i.y-o&&t<=i.y+o&&(r=i)}return r}let vr=null;function yr(e,t){if(i.previewMode||e.button!==0)return;Kt=!1;let n=e.target;if(n!=null&&n.closest(`.zm-img-resize-handle`))return;if(wr.value){let t=Pr.value.find(e=>e.rel.id===wr.value);if(t){let n=s.value.getBoundingClientRect(),r=J.scale.value,i=e=>n.left+e.x*r+J.offsetX.value,a=e=>n.top+e.y*r+J.offsetY.value,o=Math.hypot(e.clientX-i(t.from),e.clientY-a(t.from)),c=Math.hypot(e.clientX-i(t.to),e.clientY-a(t.to));if(Math.min(o,c)<=20){e.stopPropagation(),e.preventDefault(),Kt=!0,Hr(e,t.rel.id,o<=c?`from`:`to`);return}}}if(t.isRoot)return;e.stopPropagation();let r=s.value.getBoundingClientRect(),a=t.x*J.scale.value+J.offsetX.value,o=t.y*J.scale.value+J.offsetY.value,c=e.clientX-r.left-a,l=e.clientY-r.top-o;vr={srcId:t.id,srcText:t.text,pointerOffsetX:c,pointerOffsetY:l,startX:e.clientX,startY:e.clientY},window.addEventListener(`pointermove`,br),window.addEventListener(`pointerup`,Cr),window.addEventListener(`pointercancel`,Cr)}function br(e){if(vr){let t=e.clientX-vr.startX,n=e.clientY-vr.startY;if(Math.abs(t)<=Ed&&Math.abs(n)<=Ed)return;g.value={srcId:vr.srcId,srcText:vr.srcText,pointerOffsetX:vr.pointerOffsetX,pointerOffsetY:vr.pointerOffsetY,currentTargetId:null,dropPosition:null},document.body.classList.add(`is-dragging`),vr=null}let t=g.value;if(!t)return;let n=s.value.getBoundingClientRect();_.value=e.clientX-n.left-t.pointerOffsetX,y.value=e.clientY-n.top-t.pointerOffsetY;let r=(e.clientX-n.left-J.offsetX.value)/J.scale.value,i=(e.clientY-n.top-J.offsetY.value)/J.scale.value,a=_r(r,i,t.srcId);t.currentTargetId=a?.id??null,t.dropPosition=a?xr(r,i,a):null}function xr(e,t,n){if(n.isRoot)return`child`;let r=n.width/2,i=n.height/2;if(n._dir===`down`){let t=e-n.x;return t<-r*.3?`before`:t>r*.3?`after`:`child`}let a=t-n.y;return a<-i*.3?`before`:a>i*.3?`after`:`child`}function Sr(e){var t;return!!((t=e.parent)!=null&&t.isRoot)&&e._dir===`left`}function Cr(e){if(window.removeEventListener(`pointermove`,br),window.removeEventListener(`pointerup`,Cr),window.removeEventListener(`pointercancel`,Cr),vr){vr=null;return}let t=g.value;if(t){if(t.currentTargetId&&t.dropPosition){let e=t.dropPosition;if(e!==`child`){let n=kn.value.find(e=>e.id===t.currentTargetId);n&&Sr(n)&&(e=e===`before`?`after`:`before`)}mr(t.srcId,t.currentTargetId,e),d.value=new Set([t.srcId]),Y()}g.value=null,_.value=0,y.value=0,document.body.classList.remove(`is-dragging`)}}let wr=v(null),Tr=v(null),Er=v(null),Dr=v(null),Or=v(``);function kr(e,t){let n=e.width/2,r=e.height/2,i=(t%4+4)%4;return i<1?{x:e.x-n+2*n*i,y:e.y-r}:i<2?{x:e.x+n,y:e.y-r+2*r*(i-1)}:i<3?{x:e.x+n-2*n*(i-2),y:e.y+r}:{x:e.x-n,y:e.y+r-2*r*(i-3)}}function Ar(e,t){let n=t.x-e.x,r=t.y-e.y,i=e.width/2,a=e.height/2;if(Math.abs(n)<1e-6&&Math.abs(r)<1e-6)return{x:e.x+i,y:e.y};let o=Math.abs(n)>1e-6?i/Math.abs(n):1/0,s=Math.abs(r)>1e-6?a/Math.abs(r):1/0,c=Math.min(o,s);return{x:e.x+n*c,y:e.y+r*c}}function jr(e,t){let n=e.width/2||1,r=e.height/2||1,i=t.x-e.x,a=t.y-e.y;return Math.abs(i)/n>Math.abs(a)/r?i>0?1+L((a+r)/(2*r),0,1):3+L((r-a)/(2*r),0,1):a<0?L((i+n)/(2*n),0,1):2+L((n-i)/(2*n),0,1)}function Mr(e,t,n,r){let i=t===`from`?n:r,a=t===`from`?r:n,o=Er.value;if(o&&o.id===e.id&&o.end===t)return Ar(i,{x:o.wx,y:o.wy});let s=t===`from`?e.fromT:e.toT;return s===void 0?Ar(i,{x:a.x,y:a.y}):kr(i,s)}function Nr(e,t){let n=Math.hypot(t.x,t.y);if(n<1e-6)return null;let r=t.x/n,i=t.y/n,a=e.x-r*9,o=e.y-i*9,s=-i*(7/2),c=7/2*r;return`M ${e.x.toFixed(2)} ${e.y.toFixed(2)} L ${(a+s).toFixed(2)} ${(o+c).toFixed(2)} L ${(a-s).toFixed(2)} ${(o-c).toFixed(2)} Z`}let Pr=n(()=>{let e=T.value.relations;if(!e||e.length===0)return[];let t=[];for(let n of e){let e=kn.value.find(e=>e.id===n.fromId),r=kn.value.find(e=>e.id===n.toId);if(!e||!r)continue;let i=Mr(n,`from`,e,r),a=Mr(n,`to`,e,r),o=Er.value,s=n.c1,c=n.c2;if(o&&o.id===n.id&&o.end===`c1`&&(s={x:o.wx,y:o.wy}),o&&o.id===n.id&&o.end===`c2`&&(c={x:o.wx,y:o.wy}),!s||!c){let e=a.x-i.x,t=a.y-i.y,n=Math.hypot(e,t)||1,r=-t/n,o=e/n;o>0&&(r=-r,o=-o);let l=L(n*.18,24,160),u={x:(i.x+a.x)/2+r*l,y:(i.y+a.y)/2+o*l};s||=u,c||=u}let l=`M ${i.x.toFixed(2)} ${i.y.toFixed(2)} C ${s.x.toFixed(2)} ${s.y.toFixed(2)} ${c.x.toFixed(2)} ${c.y.toFixed(2)} ${a.x.toFixed(2)} ${a.y.toFixed(2)}`,u=dn(.5,i,{x1:s.x,y1:s.y,x2:c.x,y2:c.y},a),d=n.arrow??`end`,f=d===`none`?null:Nr(a,{x:a.x-c.x,y:a.y-c.y}),p=d===`both`?Nr(i,{x:i.x-s.x,y:i.y-s.y}):null;t.push({rel:n,from:i,to:a,c1:s,c2:c,d:l,labelPos:u,arrowEnd:f,arrowStart:p})}return t}),Fr=n(()=>Pr.value.find(e=>e.rel.id===Dr.value)??null);function Ir(e,t){let n=it(T.value,e,t);return n?(G(),K(),a(`change`,T.value),wr.value=n.id,d.value=new Set,Y(),n.id):null}function Lr(e){at(T.value,e)&&(G(),wr.value===e&&(wr.value=null),Dr.value===e&&(Dr.value=null),K(),a(`change`,T.value))}function Rr(e,t){ot(T.value,e,t)&&(G(),K(),a(`change`,T.value))}function zr(e){i.previewMode||(Tr.value={fromId:e},e&&(d.value=new Set([e]),Y()))}function Br(){if(Tr.value){Tr.value=null;return}zr(f.value)}function Vr(e,t){e.stopPropagation(),wr.value=t,d.value=new Set,Y()}function Hr(e,t,n){if(i.previewMode)return;e.stopPropagation(),e.preventDefault();let r=s.value.getBoundingClientRect();Er.value={id:t,end:n,wx:(e.clientX-r.left-J.offsetX.value)/J.scale.value,wy:(e.clientY-r.top-J.offsetY.value)/J.scale.value,hoverNodeId:null},window.addEventListener(`pointermove`,Ur),window.addEventListener(`pointerup`,Wr),window.addEventListener(`pointercancel`,Wr)}function Ur(e){let t=Er.value;if(!t)return;let n=s.value.getBoundingClientRect();if(t.wx=(e.clientX-n.left-J.offsetX.value)/J.scale.value,t.wy=(e.clientY-n.top-J.offsetY.value)/J.scale.value,t.end===`from`||t.end===`to`){let e=rt(T.value,t.id),n=e?t.end===`from`?e.fromId:e.toId:null;t.hoverNodeId=_r(t.wx,t.wy,n)?.id??null}}function Wr(){window.removeEventListener(`pointermove`,Ur),window.removeEventListener(`pointerup`,Wr),window.removeEventListener(`pointercancel`,Wr);let e=Er.value;if(Er.value=null,!e)return;let t=rt(T.value,e.id);if(t){if(e.end===`c1`||e.end===`c2`)t[e.end]={x:Math.round(e.wx*2)/2,y:Math.round(e.wy*2)/2};else{let n=e.end===`from`?t.fromId:t.toId;if(!(e.hoverNodeId&&e.hoverNodeId!==n&&st(T.value,e.id,e.end,e.hoverNodeId))){let r=kn.value.find(e=>e.id===n);if(r){let n=jr(r,Ar(r,{x:e.wx,y:e.wy}));e.end===`from`?t.fromT=n:t.toT=n}}}G(),K(),a(`change`,T.value),Gt=!0}}function Gr(e){if(i.previewMode)return;let t=rt(T.value,e);t&&(Dr.value=e,Or.value=t.label??``,wr.value=e,m(()=>{let e=document.querySelector(`.zm-relation-label-input`);e?.focus(),e?.select()}))}function Kr(){let e=Dr.value;if(!e)return;Dr.value=null;let t=rt(T.value,e);if(!t)return;let n=Or.value.trim();(t.label??``)!==n&&Rr(e,{label:n||void 0})}function qr(e){let t=[],n=e=>{t.push(e.id);for(let t of e.children)n(t)};return n(e),t}let Jr=!1;function Yr(e){let t=e.target;if(!t||t.closest(`.zm-node, .zm-toolbar, button, input, textarea, .zm-relations`))return;if(e.button===2){Jr=!0,J.startPan(e);return}if(Jr=!1,e.button!==0)return;let n=s.value.getBoundingClientRect(),r=(e.clientX-n.left-J.offsetX.value)/J.scale.value,i=(e.clientY-n.top-J.offsetY.value)/J.scale.value;J.startMarquee(r,i,{shift:e.shiftKey})}function Xr(e){if(Gt){Gt=!1;return}let t=e.target;if(!t||t.closest(`.zm-node`)||t.closest(`.zm-relations`)||t.closest(`.zm-toolbar`))return;let n=J.marquee;if(!(n.width>=4||n.height>=4)){if(Tr.value){Tr.value=null;return}if(wr.value){wr.value=null;return}d.value.size>0&&(d.value=new Set,Y())}}function Zr(){let e=J.marquee;if(e.width<4&&e.height<4)return;let t=e.x,n=e.y,r=e.x+e.width,i=e.y+e.height,a=[];for(let e of kn.value){let o=e.width/2,s=e.height/2,c=e.x-o,l=e.x+o,u=e.y-s,d=e.y+s;c<=r&&l>=t&&u<=i&&d>=n&&a.push(e.id)}d.value=e.shiftKey?new Set([...d.value,...a]):new Set(a),Y()}function Qr(e){return p.value.has(e)}function $r(e){let t=U(T.value,e.id);return!!t&&t.children.length>0}function ei(e){let t=U(T.value,e);return t?et(t):0}function ti(e){if(!U(T.value,e))return 0;let t=[T.value];for(;t.length;){let n=t.pop(),r=n.children.findIndex(t=>t.id===e);if(r>=0)return r;for(let e of n.children)t.push(e)}return 0}function ni(e,t,n,r){let i=r?._dir??e._dir;if(t===`out`&&e.isRoot&&q.lineOrigin===`center`)return{x:e.x,y:e.y};if(t===`out`&&e.isRoot&&q.lineOrigin===`xmind`&&r){if(i===`down`)return{x:e.x,y:e.y};let t=n===void 0?e.side:n,a=e.children.filter(e=>e.side===t).sort((e,t)=>e.y-t.y),o=a.length,s=Math.max(0,a.findIndex(e=>e.id===r.id)),c=0;return o===2?c=.7:o>=3&&(c=s===0||s===o-1?.17:.45),{x:e.x+t*(e.width/2)*c,y:e.y}}if(t===`out`&&e.isRoot&&q.lineOrigin===`proportional`&&r){let t=r.x-e.x,n=r.y-e.y,i=e.width/2,a=e.height/2,o=t===0?1/0:i/Math.abs(t),s=n===0?1/0:a/Math.abs(n),c=Math.min(o,s);return Number.isFinite(c)?{x:e.x+t*c,y:e.y+n*c}:{x:e.x,y:e.y}}if(i===`down`)return t===`out`?{x:e.x,y:e.y+e.height/2}:{x:e.x,y:e.y-e.height/2};let a;a=t===`in`?-e.side:n===void 0?e.side:n;let o=t===`in`?e._richInsetX??0:0;return{x:e.x+a*(e.width/2-o),y:e.y}}function ri(){let e=Dn.value;J.resetView(e.width,e.height,e.root.y)}function ii(){$t.value=!0,G(),K(),m(()=>ri())}function ai(e){q.layoutMode!==e&&(q.layoutMode=e,K(),m(()=>ri()))}function oi(){return JSON.stringify(T.value,null,2)}function si(e){let t=U(T.value,e);return t?!!(t.note&&t.note.text||t.link&&t.link.url||t.image&&t.image.src||t.richContent&&t.richContent.raw||t.markers&&t.markers.length>0||t.tags&&t.tags.length>0):!1}function ci(e){try{let t=JSON.parse(e);return!t.id||!Array.isArray(t.children)?!1:(en.reset(),T.value=H(t),d.value=new Set,p.value=new Set,K(),m(()=>ri()),a(`change`,T.value),!0)}catch{return!1}}function li(){let e=document.createElement(`input`);e.type=`file`,e.accept=`application/json`,e.onchange=()=>{let t=e.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{typeof n.result==`string`&&(ci(n.result)||alert(`导入失败:JSON 格式无效`))},n.readAsText(t)},e.click()}function ui(){let e=new Blob([oi()],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${T.value.text||`mindmap`}.json`,n.click(),URL.revokeObjectURL(t)}let di=v(``),fi=v([]),pi=v(-1);function mi(e){di.value=e;let t=e.trim();if(!t){fi.value=[],pi.value=-1;return}let n=t.toLowerCase(),r=[],i=e=>{var t;(e.text.toLowerCase().includes(n)||(t=e.note)!=null&&t.text&&e.note.text.toLowerCase().includes(n))&&r.push(e.id);for(let t of e.children)i(t)};i(T.value),fi.value=r,pi.value=r.length>0?0:-1,r.length>0&&(xi(r),m(()=>Si(0)))}function hi(){fi.value.length!==0&&(pi.value=(pi.value+1)%fi.value.length,Si(pi.value))}function gi(){fi.value.length!==0&&(pi.value=(pi.value-1+fi.value.length)%fi.value.length,Si(pi.value))}function _i(){di.value=``,fi.value=[],pi.value=-1}function vi(e){return fi.value.includes(e)}function yi(e){return pi.value>=0&&fi.value[pi.value]===e}function bi(e){return di.value.trim().length>0&&fi.value.length>0&&!fi.value.includes(e)}function xi(e){if(e.length===0)return;let t=new Set(e),n=new Set,r=e=>{let i=t.has(e.id);for(let t of e.children)r(t)&&(i=!0);return i&&e.children.length>0&&p.value.has(e.id)&&n.add(e.id),i};if(r(T.value),n.size>0){for(let e of n)p.value.delete(e);K()}}function Si(e){let t=fi.value[e];if(!t)return;let n=kn.value.find(e=>e.id===t);n&&(d.value=new Set([t]),Y(),J.centerOn(n.x,n.y,n.width,n.height))}function Ci(e,t){let n=U(T.value,e);n&&(n.markers||=[],!n.markers.includes(t)&&(n.markers.push(t),G(),K(),a(`change`,T.value)))}function wi(e,t){let n=U(T.value,e);if(!n||!n.markers)return;let r=n.markers.indexOf(t);r<0||(n.markers.splice(r,1),n.markers.length===0&&delete n.markers,G(),K(),a(`change`,T.value))}function Ti(e,t){let n=U(T.value,e);if(!n)return!1;n.markers||=[];let r=n.markers.indexOf(t);return r>=0?(n.markers.splice(r,1),n.markers.length===0&&delete n.markers,G(),K(),a(`change`,T.value),!1):(n.markers.push(t),G(),K(),a(`change`,T.value),!0)}function Ei(e){let t=U(T.value,e);return t!=null&&t.markers?[...t.markers]:[]}function Di(e,t){var n;return!!((n=U(T.value,e)?.markers)!=null&&n.includes(t))}function Oi(e){let t=B.value?.nodeId;t&&Ti(t,e)}function ki(){let e=B.value?.nodeId;if(!e)return;let t=U(T.value,e);!t||!t.markers||(delete t.markers,G(),K(),a(`change`,T.value),V())}function Ai(e,t){let n=U(T.value,e);n&&(t.length===0?n.tags&&delete n.tags:n.tags=[...t],G(),K(),a(`change`,T.value))}function ji(e){let t=U(T.value,e);return t!=null&&t.tags?[...t.tags]:[]}function Mi(){let e=B.value?.nodeId;if(!e)return;let t=(U(T.value,e)?.tags)?.join(`, `)??``,n=window.prompt(`输入标签(多个用逗号分隔)`,t);n!==null&&(Ai(e,n.split(/[,,]/).map(e=>e.trim()).filter(e=>e.length>0)),V())}function Ni(){let e=B.value?.nodeId;e&&(Ai(e,[]),V())}function Pi(){let e=Dn.value,t=`http://www.w3.org/2000/svg`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.setAttribute(`viewBox`,`${e.vbX} ${e.vbY} ${e.vbW} ${e.vbH}`),n.setAttribute(`width`,String(e.vbW)),n.setAttribute(`height`,String(e.vbH));let r=document.createElementNS(t,`rect`);r.setAttribute(`x`,String(e.vbX)),r.setAttribute(`y`,String(e.vbY)),r.setAttribute(`width`,String(e.vbW)),r.setAttribute(`height`,String(e.vbH)),r.setAttribute(`fill`,an.value),n.appendChild(r);for(let e of An.value){let r=document.createElementNS(t,`path`);r.setAttribute(`d`,pn(ni(e.from,`out`,e.to.side,e.to),ni(e.to,`in`),sn(e.from.depth),cn(e.to.depth),32,on(e.from.isRoot),e.to._dir)),r.setAttribute(`fill`,vn(e.from,e.to)),r.setAttribute(`stroke`,`none`),n.appendChild(r)}let i=`-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif`;function a(e,t){let n=0;for(let r of e)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(r)?n+=t:n+=t*.55;return n}for(let e of Pr.value){let r=document.createElementNS(t,`path`);r.setAttribute(`d`,e.d),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,e.rel.color??`#94a3b8`),r.setAttribute(`stroke-width`,`1.5`),r.setAttribute(`stroke-dasharray`,`6 4`),r.setAttribute(`stroke-linecap`,`round`),n.appendChild(r);let a=e.rel.color??`#94a3b8`;for(let r of[e.arrowEnd,e.arrowStart]){if(!r)continue;let e=document.createElementNS(t,`path`);e.setAttribute(`d`,r),e.setAttribute(`fill`,a),e.setAttribute(`stroke`,`none`),n.appendChild(e)}if(e.rel.label){let r=document.createElementNS(t,`text`);r.setAttribute(`x`,String(e.labelPos.x)),r.setAttribute(`y`,String(e.labelPos.y-6)),r.setAttribute(`text-anchor`,`middle`),r.setAttribute(`font-size`,`12`),r.setAttribute(`font-family`,i),r.setAttribute(`fill`,`#64748b`),r.setAttribute(`stroke`,an.value),r.setAttribute(`stroke-width`,`3`),r.setAttribute(`paint-order`,`stroke`),r.textContent=e.rel.label,n.appendChild(r)}}for(let e of kn.value){let r=e.x-e.width/2,o=e.y-e.height/2,s=document.createElementNS(t,`rect`);s.setAttribute(`x`,String(r)),s.setAttribute(`y`,String(o)),s.setAttribute(`width`,String(e.width)),s.setAttribute(`height`,String(e.height)),s.setAttribute(`rx`,`8`),s.setAttribute(`fill`,yn(e));let c=Sn(e);c!==`transparent`&&(s.setAttribute(`stroke`,c),s.setAttribute(`stroke-width`,`1`)),n.appendChild(s);let l=!!(e.tags&&e.tags.length>0),u=!!(e.markers&&e.markers.length>0),d=!!e.image,f=!(!e.richContent||e.richContent.kind!==`code`&&e.richContent.kind!==`table`),p=0,m=0;if(f){let r=e.richContent,s=e.fontSize*.78*.92;if(r.kind===`code`){let c=As(r.raw),l=js(r.raw),u=c.split(`
|
|
169
|
+
| a | b | c |`);if(r===null)return;let i=r.trim();if(!i){z(e,null);return}z(e,{kind:`table`,raw:i})}function jt(){let e=B.value?.nodeId;e&&z(e,null)}function Nt(){let e=B.value?.nodeId;e&&zr(e)}function Pt(e){i.previewMode||(d.value=new Set([e]),Y(),i.builtInDrawers&&(ke(),we.value=!0,Ee.value++),s(`edit-note`,e))}function It(e,t=60){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n||`点击编辑笔记`:n.slice(0,t)+`…`}function Lt(e){if(i.previewMode||l.value)return;let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable))return;let n=f.value;if(!n)return;let r=e.clipboardData?.items;if(!r)return;for(let t=0;t<r.length;t++){let i=r[t];if(i.kind===`file`&&i.type.startsWith(`image/`)){let t=i.getAsFile();if(!t)continue;e.preventDefault();let r=U(T.value,n);if(r!=null&&r.image&&!window.confirm(`该节点已有图片,要用剪贴板里的图片替换吗?`))return;se(t,e=>F(n,e));return}}if(y.value&&y.value.nodes.length>0)return;let a=null;for(let t=0;t<r.length;t++){let n=r[t];if(n.kind===`string`&&n.type===`text/plain`){a=e.clipboardData?.getData(`text/plain`)??null;break}}if(!a)return;let o=a.split(/\r?\n/).map(e=>e.replace(/^\s*[-*+]\s+/,``).trim()).filter(e=>e.length>0);if(o.length!==0){e.preventDefault(),G();for(let e of o)Ye(T.value,n,e);K(),s(`change`,T.value)}}ee(()=>{window.addEventListener(`paste`,Lt),window.addEventListener(`keydown`,Rt),K()}),a(()=>{window.removeEventListener(`paste`,Lt),window.removeEventListener(`keydown`,Rt)});function Rt(e){if((e.metaKey||e.ctrlKey)&&(e.key===`f`||e.key===`F`)){let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable))return;e.preventDefault(),s(`canvas-outline`);return}if((e.key===`Delete`||e.key===`Backspace`)&&wr.value){let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||i.previewMode)return;e.preventDefault(),Lr(wr.value)}}let zt=A(null),Bt=n(()=>zt.value?.nodeId??null);function Vt(e,t){if(!t.image)return;e.preventDefault(),e.stopPropagation();let n=t.image.naturalW||t.image.width,r=t.image.naturalH||t.image.height,i=r>0?r/n:1;zt.value={nodeId:t.id,startX:e.clientX,startY:e.clientY,startW:t.image.width,startH:t.image.height,naturalW:n,naturalH:r,ratio:i,pendingW:t.image.width,pendingH:t.image.height},window.addEventListener(`mousemove`,Ht),window.addEventListener(`mouseup`,Ut)}function Ht(e){let t=zt.value;if(!t)return;let n=J.scale.value||1,r=e.clientX-t.startX,i=L(t.startW+r/n,Cd,wd),a=L(i*t.ratio,Cd,wd);t.pendingW=i,t.pendingH=a;let o=c.value?.querySelector(`[data-node-id="${t.nodeId}"] .zm-node-img`);o&&(o.style.width=`${i}px`,o.style.height=`${a}px`);let s=c.value?.querySelector(`[data-node-id="${t.nodeId}"]`);s&&(s.style.minWidth=`${Math.max(80,Math.ceil(i+28))}px`,s.style.height=`${Math.ceil(a+8+30)}px`)}function Ut(){let e=zt.value;if(window.removeEventListener(`mousemove`,Ht),window.removeEventListener(`mouseup`,Ut),zt.value=null,!e)return;let t=U(T.value,e.nodeId);!t||!t.image||(F(e.nodeId,{src:t.image.src,naturalW:t.image.naturalW,naturalH:t.image.naturalH,width:e.pendingW,height:e.pendingH}),d.value=new Set([e.nodeId]),Y(),Gt=!0)}let Wt=A(null),Gt=!1,Kt=!1;function Jt(e){Wt.value=e}function Yt(e){Wt.value===e&&(Wt.value=null),b.value&&=null}function Xt(e,t){if(!t.text||t.text.length<14)return;let n=e.currentTarget.getBoundingClientRect(),r=c.value?.getBoundingClientRect();if(!r)return;let i=n.top-r.top>60,a=n.left-r.left+n.width/2,o=r.width-120-10,s=Math.max(130,Math.min(a,o)),l=i?n.top-r.top-8:n.bottom-r.top+8;b.value={text:t.text,x:s,y:l,above:i}}function Zt(e){return Wt.value===e||f.value===e}let Qt=A(0),$t=A(!1),en=_t(100);function G(){en.record({data:T.value,selectedIds:[...d.value]})}function tn(e,t={}){T.value=H(e),t.resetCollapsed&&(p.value=new Set),t.resetSelection&&(d.value=new Set,Y()),K(),s(`change`,T.value)}function K(){p.value=new Set(p.value),Qt.value++,o().then(()=>o()).then(()=>nn()).then(()=>{Qt.value++})}function nn(){let e=document.querySelectorAll(`.zm-rich`),t={},n={};e.forEach(e=>{let r=e,i=null;for(;r&&!i;)i=r.getAttribute(`data-node-id`),r=r.parentElement;if(!i)return;let a=e.offsetHeight,o=e.scrollWidth,s=Math.round(a*2)/2,c=Math.round(o*2)/2;t[i]=s,n[i]=c,E.value[i],D.value[i]}),E.value=t,D.value=n}let rn=n(()=>({rootBg:i.theme?.rootBg??`#1f2937`,rootText:i.theme?.rootText??`#ffffff`,branchBg:i.theme?.branchBg??`#ffffff`,branchText:i.theme?.branchText??`#1f2937`,lineColor:i.theme?.lineColor??`#94a3b8`,bgColor:i.theme?.bgColor??`#f8fafc`,fontSize:i.theme?.fontSize??14,lineWidthStart:i.theme?.lineWidthStart??2.2,lineWidthEnd:i.theme?.lineWidthEnd??.8,rainbowBranch:i.theme?.rainbowBranch??!1})),an=n(()=>q.canvasBg||rn.value.bgColor),q=x({autoBalanceOnChange:!0,lineWidthStart:10,lineWidthEnd:2,rainbowBranch:!0,branchPaletteId:`default`,customPalettes:[],lineStyle:`rounded-elbow`,rootLineStyle:`arc`,lineOrigin:`xmind`,layoutMode:`mindmap`,taperedEdge:!0,lineWidthTaper:.3,uniformLineWidth:!0,elbowRadius:20,showOrderBadge:!1,canvasBg:void 0,branchGap:20});function on(e){return e?q.rootLineStyle:q.lineStyle}function sn(e){return q.taperedEdge?q.uniformLineWidth&&e>0?q.lineWidthEnd:ln(e):un(e)}function cn(e){return q.taperedEdge?q.lineWidthEnd:un(e)}function ln(e){let t=q.lineWidthTaper,n=q.lineWidthStart*t**+e;return Math.max(q.lineWidthEnd,n)}function un(e){if(e<=0)return q.lineWidthStart;if(e>=3)return q.lineWidthEnd;let t=e/3;return q.lineWidthStart+(q.lineWidthEnd-q.lineWidthStart)*t}function dn(e,t,n,r){let i=1-e;return{x:i*i*i*t.x+3*i*i*e*n.x1+3*i*e*e*n.x2+e*e*e*r.x,y:i*i*i*t.y+3*i*i*e*n.y1+3*i*e*e*n.y2+e*e*e*r.y}}function fn(e,t,n,r){let i=1-e;return{x:i*i*t.x+2*i*e*n.x+e*e*r.x,y:i*i*t.y+2*i*e*n.y+e*e*r.y}}function pn(e,t,n,r,i=32,a=`curve`,o=`right`){if(a===`curve`){let a;if(o===`right`||o===`left`){let n=Math.abs(t.x-e.x)*.45,r=o===`right`?1:-1;a={x1:e.x+r*n,y1:e.y,x2:t.x-r*n,y2:t.y}}else{let n=Math.abs(t.y-e.y)*.45;a={x1:e.x,y1:e.y+n,x2:t.x,y2:t.y-n}}let s=n=>{let r=1-n;return{dx:-3*r*r*e.x+3*(r*r-2*r*n)*a.x1+3*(2*r*n-n*n)*a.x2+3*n*n*t.x,dy:-3*r*r*e.y+3*(r*r-2*r*n)*a.y1+3*(2*r*n-n*n)*a.y2+3*n*n*t.y}},c=[],l=[];for(let o=0;o<=i;o++){let u=o/i,d=o===0?e:o===i?t:dn(u,e,a,t),f=s(u),p=Math.hypot(f.dx,f.dy);p<1e-6&&(p=1);let m=-f.dy/p,h=f.dx/p,g=(n+(r-n)*u)/2;c.push({x:d.x+m*g,y:d.y+h*g}),l.push({x:d.x-m*g,y:d.y-h*g})}let u=`M ${c[0].x.toFixed(2)} ${c[0].y.toFixed(2)}`;for(let e=1;e<=i;e++)u+=` L ${c[e].x.toFixed(2)} ${c[e].y.toFixed(2)}`;for(let e=i;e>=0;e--)u+=` L ${l[e].x.toFixed(2)} ${l[e].y.toFixed(2)}`;return u+=` Z`,u}if(a===`arc`){let a;a=o===`right`||o===`left`?{x:(e.x+t.x)/2,y:t.y}:{x:t.x,y:(e.y+t.y)/2};let s=n=>{let r=1-n;return{dx:2*r*(a.x-e.x)+2*n*(t.x-a.x),dy:2*r*(a.y-e.y)+2*n*(t.y-a.y)}},c=[],l=[];for(let o=0;o<=i;o++){let u=o/i,d=o===0?e:o===i?t:fn(u,e,a,t),f=s(u),p=Math.hypot(f.dx,f.dy);p<1e-6&&(p=1);let m=-f.dy/p,h=f.dx/p,g=(n+(r-n)*u)/2;c.push({x:d.x+m*g,y:d.y+h*g}),l.push({x:d.x-m*g,y:d.y-h*g})}let u=n/2,d=r/2,f=`M ${c[0].x.toFixed(2)} ${c[0].y.toFixed(2)}`;for(let e=1;e<=i;e++)f+=` L ${c[e].x.toFixed(2)} ${c[e].y.toFixed(2)}`;f+=` A ${d.toFixed(2)} ${d.toFixed(2)} 0 0 0 ${l[i].x.toFixed(2)} ${l[i].y.toFixed(2)}`;for(let e=i-1;e>=0;e--)f+=` L ${l[e].x.toFixed(2)} ${l[e].y.toFixed(2)}`;return f+=` A ${u.toFixed(2)} ${u.toFixed(2)} 0 0 0 ${c[0].x.toFixed(2)} ${c[0].y.toFixed(2)}`,f+=` Z`,f}if(a===`elbow`){let i=[];if(o===`down`){let n=(e.y+t.y)/2;i.push(e,{x:e.x,y:n},{x:t.x,y:n},t)}else{let n=(e.x+t.x)/2;i.push(e,{x:n,y:e.y},{x:n,y:t.y},t)}let a=[],s=0;for(let e=0;e<i.length-1;e++){let t=Math.hypot(i[e+1].x-i[e].x,i[e+1].y-i[e].y);a.push(t),s+=t}let c=[n/2],l=0;for(let e=0;e<a.length-1;e++){l+=a[e];let t=s>0?l/s:0;c.push((n+(r-n)*t)/2)}c.push(r/2);let u=[];for(let e=0;e<i.length-1;e++){let t=i[e+1].x-i[e].x,n=i[e+1].y-i[e].y,r=Math.hypot(t,n);r<1e-6&&(r=1),u.push({x:-n/r,y:t/r})}let d=[],f=[];d.push({x:i[0].x+u[0].x*c[0],y:i[0].y+u[0].y*c[0]}),f.push({x:i[0].x-u[0].x*c[0],y:i[0].y-u[0].y*c[0]});for(let e=1;e<i.length-1;e++){let t=u[e-1],n=u[e],r=c[e],a=t.x+n.x,o=t.y+n.y,s=a*a+o*o;if(s<1e-6)d.push({x:i[e].x+t.x*r,y:i[e].y+t.y*r}),f.push({x:i[e].x-t.x*r,y:i[e].y-t.y*r});else{let t=2*r/s;d.push({x:i[e].x+a*t,y:i[e].y+o*t}),f.push({x:i[e].x-a*t,y:i[e].y-o*t})}}let p=u[u.length-1],m=c[c.length-1];d.push({x:i[i.length-1].x+p.x*m,y:i[i.length-1].y+p.y*m}),f.push({x:i[i.length-1].x-p.x*m,y:i[i.length-1].y-p.y*m});let h=`M ${d[0].x.toFixed(2)} ${d[0].y.toFixed(2)}`;for(let e=1;e<d.length;e++)h+=` L ${d[e].x.toFixed(2)} ${d[e].y.toFixed(2)}`;for(let e=f.length-1;e>=0;e--)h+=` L ${f[e].x.toFixed(2)} ${f[e].y.toFixed(2)}`;return h+=` Z`,h}if(a===`rounded-elbow`&&!(o===`down`?Math.abs(e.x-t.x)<.5:Math.abs(e.y-t.y)<.5)){let i=function(e,t,n){let r={x:e.pos.x-t*e.d1.x,y:e.pos.y-t*e.d1.y},i={x:e.pos.x+t*e.d2.x,y:e.pos.y+t*e.d2.y},a={x:e.pos.x+t*(e.d2.x-e.d1.x),y:e.pos.y+t*(e.d2.y-e.d1.y)},o=Math.atan2(r.y-a.y,r.x-a.x),s=Math.atan2(i.y-a.y,i.x-a.x)-o;for(;s>Math.PI;)s-=2*Math.PI;for(;s<-Math.PI;)s+=2*Math.PI;let c=[];for(let e=1;e<n;e++){let r=e/n,i=o+s*r;c.push({x:a.x+t*Math.cos(i),y:a.y+t*Math.sin(i)})}return c},a=[],s;if(o===`down`){let n=(e.y+t.y)/2,r=Math.sign(n-e.y)||1,i=Math.sign(t.x-e.x)||1,a=Math.sign(t.y-n)||1;s=[{pos:{x:e.x,y:n},d1:{x:0,y:r},d2:{x:i,y:0}},{pos:{x:t.x,y:n},d1:{x:i,y:0},d2:{x:0,y:a}}]}else{let n=(e.x+t.x)/2,r=Math.sign(n-e.x)||1,i=Math.sign(t.y-e.y)||1,a=Math.sign(t.x-n)||1;s=[{pos:{x:n,y:e.y},d1:{x:r,y:0},d2:{x:0,y:i}},{pos:{x:n,y:t.y},d1:{x:0,y:i},d2:{x:a,y:0}}]}let c=Math.hypot(s[1].pos.x-s[0].pos.x,s[1].pos.y-s[0].pos.y),l=Math.hypot(t.x-s[1].pos.x,t.y-s[1].pos.y),u=Math.min(c,l,q.elbowRadius)*.5,d=Math.max(2,u);a.push(e),a.push(s[0].pos),a.push({x:s[1].pos.x-d*s[1].d1.x,y:s[1].pos.y-d*s[1].d1.y});for(let e of i(s[1],d,12))a.push(e);a.push(t);let f=[],p=0;for(let e=0;e<a.length-1;e++){let t=Math.hypot(a[e+1].x-a[e].x,a[e+1].y-a[e].y);f.push(t),p+=t}let m=[];for(let e=0;e<a.length-1;e++){let t=a[e+1].x-a[e].x,n=a[e+1].y-a[e].y,r=Math.hypot(t,n);r<1e-6&&(r=1),m.push({x:-n/r,y:t/r})}let h=[],g=0;for(let e=0;e<a.length;e++){e>0&&(g+=f[e-1]);let t=p>0?g/p:0;h.push((n+(r-n)*t)/2)}let _=[],v=[];for(let e=0;e<a.length;e++){let t=h[e];if(e===0){let n=m[0];_.push({x:a[e].x+n.x*t,y:a[e].y+n.y*t}),v.push({x:a[e].x-n.x*t,y:a[e].y-n.y*t})}else if(e===a.length-1){let n=m[m.length-1];_.push({x:a[e].x+n.x*t,y:a[e].y+n.y*t}),v.push({x:a[e].x-n.x*t,y:a[e].y-n.y*t})}else{let n=m[e-1],r=m[e],i=n.x+r.x,o=n.y+r.y,s=i*i+o*o;if(s<1e-6)_.push({x:a[e].x+n.x*t,y:a[e].y+n.y*t}),v.push({x:a[e].x-n.x*t,y:a[e].y-n.y*t});else{let n=2*t/s;_.push({x:a[e].x+i*n,y:a[e].y+o*n}),v.push({x:a[e].x-i*n,y:a[e].y-o*n})}}}let y=`M ${_[0].x.toFixed(2)} ${_[0].y.toFixed(2)}`;for(let e=1;e<_.length;e++)y+=` L ${_[e].x.toFixed(2)} ${_[e].y.toFixed(2)}`;y+=` L ${v[_.length-1].x.toFixed(2)} ${v[_.length-1].y.toFixed(2)}`;for(let e=v.length-2;e>=0;e--)y+=` L ${v[e].x.toFixed(2)} ${v[e].y.toFixed(2)}`;return y+=` Z`,y}{let i=t.x-e.x,a=t.y-e.y,o=Math.hypot(i,a);o<1e-6&&(o=1);let s=-a/o,c=i/o,l=n/2,u=r/2,d={x:e.x+s*l,y:e.y+c*l},f={x:e.x-s*l,y:e.y-c*l},p={x:t.x-s*u,y:t.y-c*u},m={x:t.x+s*u,y:t.y+c*u};return`M ${d.x.toFixed(2)} ${d.y.toFixed(2)} L ${m.x.toFixed(2)} ${m.y.toFixed(2)} L ${p.x.toFixed(2)} ${p.y.toFixed(2)} L ${f.x.toFixed(2)} ${f.y.toFixed(2)} Z`}}let mn=n(()=>Dn.value.root.children),hn=Le[0].colors,gn=n(()=>Re(q.branchPaletteId,q.customPalettes)),_n=n(()=>{let e=new Map;if(!q.rainbowBranch)return e;let t=i.lineColors,n=t&&t.length>0?t:gn.value.colors.length>0?gn.value.colors:hn;for(let t=0;t<mn.value.length;t++){let r=mn.value[t];e.set(r.id,n[t%n.length])}let r=(t,n)=>{e.set(t.id,n);for(let e of t.children)r(e,n)};for(let e=0;e<mn.value.length;e++){let t=mn.value[e];r(t,n[e%n.length])}return e});function vn(e,t){return q.rainbowBranch?_n.value.get(t.id)??rn.value.lineColor:rn.value.lineColor}function yn(e){let t=P(e.id);if(t.bg)return t.bg;if(e.isRoot)return rn.value.rootBg;if(e.depth>=3)return`transparent`;let n=e.depth===1?.15:.08;if(q.rainbowBranch){let t=_n.value.get(e.id);if(t)return Tn(t,n)}return Tn(rn.value.rootBg,n)}function xn(e){let t=P(e.id);if(t.textColor)return t.textColor;if(e.isRoot)return rn.value.rootText;if(q.rainbowBranch){let t=_n.value.get(e.id);if(t)return En(t,.55)}return rn.value.branchText}function Sn(e){let t=P(e.id);return t.borderColor?t.borderColor:`transparent`}function Cn(e){let t=P(e.id);return t.fontWeight?t.fontWeight:e.isRoot?700:e.depth<=1?600:e.depth===2?500:400}function wn(e){return P(e.id).fontSize??e.fontSize??rn.value.fontSize}function Tn(e,t){let n=e.replace(`#`,``),r=n.length===6?n:n.split(``).map(e=>e+e).join(``);return`rgba(${parseInt(r.slice(0,2),16)}, ${parseInt(r.slice(2,4),16)}, ${parseInt(r.slice(4,6),16)}, ${t})`}function En(e,t){let n=e.replace(`#`,``),r=n.length===6?n:n.split(``).map(e=>e+e).join(``);return`rgb(${Math.round(parseInt(r.slice(0,2),16)*(1-t))}, ${Math.round(parseInt(r.slice(2,4),16)*(1-t))}, ${Math.round(parseInt(r.slice(4,6),16)*(1-t))})`}let J=pt({getContainer:()=>c.value});J.setOnMarqueeEnd(Zr),gt({isEditing:()=>l.value!==null,isReadonly:()=>i.previewMode,getSelectedId:()=>f.value,getSelectedIds:()=>[...d.value],defaultTargetId:()=>T.value.id,onAddChild:Un,onAddSibling:Wn,onAddSiblingBefore:Gn,onRemove:or,onStartEdit:Nn,onClearSelection:()=>{if(Tr.value){Tr.value=null;return}if(wr.value){wr.value=null;return}d.value=new Set,Y()},onDuplicate:Kn,onCopy:Zn,onCut:$n,onPaste:er,hasClipboard:()=>!!y.value&&y.value.nodes.length>0,onUndo:tr,onRedo:nr,onNavigate:rr,onMoveSibling:hr,onSelectRoot:()=>{d.value=new Set([T.value.id]),Y()}});let Dn=n(()=>{let e=H(T.value);return Mn(e),Ae(e,{mode:q.layoutMode,baseFontSize:rn.value.fontSize,richHeights:E.value,richWidths:D.value,branchGap:q.branchGap})}),On=A([]),kn=n(()=>(Qt.value,On.value));C(Dn,e=>{let t=[],n=e=>{t.push(e);for(let t of e.children)n(t)};n(e.root),On.value=t},{immediate:!0});let An=n(()=>{let e=[];for(let t of kn.value)for(let n of t.children)e.push({from:t,to:n,key:`${t.id}->${n.id}`});return e}),jn=n(()=>`${Dn.value.vbX} ${Dn.value.vbY} ${Dn.value.vbW} ${Dn.value.vbH}`);function Mn(e){if(p.value.has(e.id)){e.children=[],e.collapsed=!0;return}e.collapsed=!1;for(let t of e.children)Mn(t)}function Nn(e){let t=U(T.value,e);t&&(l.value=e,u.value=t.text,d.value=new Set([e]),Y(),o(()=>{let e=document.querySelector(`.zm-input`);e?.focus(),e?.select(),In(e)}))}function Pn(){if(!l.value)return;let e=U(T.value,l.value);e&&e.text!==(u.value.trim()||` `)&&(e.text=u.value.trim()||` `,G(),s(`change`,T.value)),l.value=null}function Fn(){l.value=null}function In(e){e&&(e.style.height=`auto`,e.style.height=e.scrollHeight+`px`)}function Ln(e){In(e.target)}function Rn(e){if(i.previewMode)return;let t=U(T.value,e);t!=null&&t.richContent&&(S.value=e,w.value=t.richContent.raw,o(()=>{document.querySelector(`.zm-node .zm-rich textarea`)?.focus()}))}function zn(){if(!S.value)return;let e=S.value,t=U(T.value,e),n=w.value;t&&t.richContent&&t.richContent.raw!==n&&(t.richContent.kind===`code`?z(e,{kind:`code`,raw:n,lang:js(n)||void 0}):z(e,{kind:`table`,raw:n})),S.value=null}function Bn(){S.value=null}function Vn(e){e.key===`Escape`?(e.preventDefault(),Bn()):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),zn())}function Hn(e){let t=e.metaKey||e.ctrlKey;t&&(e.key===`z`||e.key===`Z`)&&!e.shiftKey?(e.preventDefault(),tr()):(t&&e.shiftKey&&(e.key===`z`||e.key===`Z`)||t&&(e.key===`y`||e.key===`Y`)&&!e.shiftKey)&&(e.preventDefault(),nr())}function Un(e){let t=Ye(T.value,e,tt);t&&(G(),K(),s(`change`,T.value),o(()=>Nn(t.id)))}function Wn(e){if(e===T.value.id){Un(e);return}let t=Xe(T.value,e,tt);t&&(G(),K(),s(`change`,T.value),o(()=>Nn(t.id)))}function Gn(e){if(e===T.value.id){Un(e);return}let t=Ze(T.value,e,tt);t&&(G(),K(),s(`change`,T.value),o(()=>Nn(t.id)))}function Kn(e){if(e===T.value.id)return;let t=Qe(T.value,e);t&&(G(),d.value=new Set([t.id]),Y(),s(`change`,T.value),K())}function qn(e){let t=[],n=new Set;for(let r of e)r!==T.value.id&&(n.has(r)||U(T.value,r)&&(n.add(r),t.push(r)));return t}function Jn(e){let t=new Set(e),n=[],r=e=>{t.has(e.id)&&n.push(e.id);for(let t of e.children)r(t)};return r(T.value),n}function Yn(e){var t;try{(t=navigator.clipboard)==null||t.writeText(e)}catch{}}function Xn(e){let t=[],n=(e,r)=>{let i=` `.repeat(r),a=r===0?``:`- `;t.push(i+a+(e.text||``));for(let t of e.children)n(t,r+1)};return n(e,0),t.join(`
|
|
170
|
+
`)}function Zn(e){if(e.includes(T.value.id)){y.value=null,Yn(Xn(T.value)),K();return}let t=Jn(qn(e));if(t.length===0)return;let n=[];for(let e of t){let t=W(T.value,e);t&&n.push(t)}n.length!==0&&(y.value={nodes:n,originalIds:new Set(t)},Yn(n.map(e=>e.text).join(`
|
|
171
|
+
`)),K())}function $n(e){let t=Jn(qn(e));if(t.length===0)return;let n=[];for(let e of t){let t=W(T.value,e);t&&n.push(t)}if(n.length===0)return;G();let r=[];for(let e of t){let t=U(T.value,e);t&&r.push(...qr(t))}for(let e of t)Ge(T.value,e);for(let e of r)ct(T.value,e);d.value=new Set,Y(),y.value={nodes:n,originalIds:new Set(t)},Yn(n.map(e=>e.text).join(`
|
|
172
|
+
`)),K(),s(`change`,T.value)}function er(e){let t=y.value;if(!t||t.nodes.length===0)return;let n=e??T.value.id,r=U(T.value,n);if(r){for(let e of t.originalIds){let t=U(T.value,e);if(t&&U(t,n))return}G();for(let e of t.nodes){let t=H(e);$e(t),r.children.push(t)}y.value=null,K(),s(`change`,T.value)}}function tr(){let e=en.undo();e&&(T.value=e.data,d.value=new Set(e.selectedIds??[]),Y(),K(),s(`change`,T.value))}function nr(){let e=en.redo();e&&(T.value=e.data,d.value=new Set(e.selectedIds??[]),Y(),K(),s(`change`,T.value))}function Y(){let e=[];for(let t of d.value){let n=U(T.value,t);n&&e.push(n)}if(i.builtInDrawers&&!i.previewMode&&e.length>0){let t=e[0];!we.value&&si(t.id)&&(ke(),we.value=!0)}else i.builtInDrawers&&e.length===0&&(we.value=!1);s(`select`,e.length>0?e:null)}function rr(e,t){let n=f.value??T.value.id,r=U(T.value,n);if(!r)return;let i=null;if(t===1){let e=We(T.value,r.id);if(e){let t=e.children.findIndex(e=>e.id===r.id);t>=0&&t<e.children.length-1&&(i=e.children[t+1].id)}}else if(t===-1){let e=We(T.value,r.id);if(e){let t=e.children.findIndex(e=>e.id===r.id);t>0&&(i=e.children[t-1].id)}}else if(e===1){let e=We(T.value,r.id);e&&(i=e.id)}else e===-1&&r.children.length>0&&(i=r.children[0].id);i&&(d.value=new Set([i]),Y())}function ir(e){return e.split(`
|
|
173
|
+
`).map(e=>e.replace(/^\s*[-*+]\s+/,``).replace(/^\s*\d+\.\s+/,``).trim()).filter(e=>e.length>0)}function ar(e){return e.replace(/\s+/g,` `).trim()}function or(e){var t;if(e===T.value.id)return;let n=U(T.value,e),r=n?qr(n):[e];if(Ge(T.value,e)){for(let e of r)ct(T.value,e);if((t=Tr.value)!=null&&t.fromId&&r.includes(Tr.value.fromId)&&(Tr.value=null),G(),d.value.has(e)){let t=new Set(d.value);t.delete(e),d.value=t,Y()}K(),s(`change`,T.value)}}function sr(e){p.value.has(e)?p.value.delete(e):p.value.add(e),K()}function cr(e){let t=[{n:T.value,depth:1}];for(;t.length;){let{n,depth:r}=t.pop();e(n,r);for(let e=n.children.length-1;e>=0;e--)t.push({n:n.children[e],depth:r+1})}}function ur(){p.value=new Set,cr(e=>{e.children.length>0&&p.value.add(e.id)}),K()}function dr(e){p.value=new Set,cr((t,n)=>{n>e&&t.children.length>0&&p.value.add(t.id)}),K()}function fr(){p.value=new Set,K()}function pr(e,t){Ke(T.value,e,t)&&(G(),K(),s(`change`,T.value))}function mr(e,t,n){return qe(T.value,e,t,n)?(G(),K(),s(`change`,T.value),!0):!1}function hr(e){let t=f.value;if(!t)return;let n=T.value;if(t===n.id)return;let r=We(n,t);if(!r)return;let i=r.children.findIndex(e=>e.id===t);if(i<0)return;let a=e,o=kn.value.find(e=>e.id===t);if(o&&Sr(o)&&(a=-e),a<0){if(i===0)return;let e=r.children[i-1].id;qe(n,t,e,`before`)}else{if(i>=r.children.length-1)return;let e=r.children[i+1].id;qe(n,t,e,`after`)}G(),K(),s(`change`,n)}function gr(e,t){if(Kt){Kt=!1;return}if(e.stopPropagation(),Tr.value){let e=Tr.value;e.fromId?e.fromId!==t.id&&(Ir(e.fromId,t.id),Tr.value=null):(e.fromId=t.id,d.value=new Set([t.id]),Y());return}if(wr.value=null,e.shiftKey){let e=new Set(d.value);e.has(t.id)?e.delete(t.id):e.add(t.id),d.value=e}else d.value=new Set([t.id]);Y()}function _r(e,t,n){let r=null;for(let i of kn.value){if(i.id===n)continue;let a=i.width/2,o=i.height/2;e>=i.x-a&&e<=i.x+a&&t>=i.y-o&&t<=i.y+o&&(r=i)}return r}let vr=null;function yr(e,t){if(i.previewMode||e.button!==0)return;Kt=!1;let n=e.target;if(n!=null&&n.closest(`.zm-img-resize-handle`))return;if(wr.value){let t=Pr.value.find(e=>e.rel.id===wr.value);if(t){let n=c.value.getBoundingClientRect(),r=J.scale.value,i=e=>n.left+e.x*r+J.offsetX.value,a=e=>n.top+e.y*r+J.offsetY.value,o=Math.hypot(e.clientX-i(t.from),e.clientY-a(t.from)),s=Math.hypot(e.clientX-i(t.to),e.clientY-a(t.to));if(Math.min(o,s)<=20){e.stopPropagation(),e.preventDefault(),Kt=!0,Hr(e,t.rel.id,o<=s?`from`:`to`);return}}}if(t.isRoot)return;e.stopPropagation();let r=c.value.getBoundingClientRect(),a=t.x*J.scale.value+J.offsetX.value,o=t.y*J.scale.value+J.offsetY.value,s=e.clientX-r.left-a,l=e.clientY-r.top-o;vr={srcId:t.id,srcText:t.text,pointerOffsetX:s,pointerOffsetY:l,startX:e.clientX,startY:e.clientY},window.addEventListener(`pointermove`,br),window.addEventListener(`pointerup`,Cr),window.addEventListener(`pointercancel`,Cr)}function br(e){if(vr){let t=e.clientX-vr.startX,n=e.clientY-vr.startY;if(Math.abs(t)<=Ed&&Math.abs(n)<=Ed)return;h.value={srcId:vr.srcId,srcText:vr.srcText,pointerOffsetX:vr.pointerOffsetX,pointerOffsetY:vr.pointerOffsetY,currentTargetId:null,dropPosition:null},document.body.classList.add(`is-dragging`),vr=null}let t=h.value;if(!t)return;let n=c.value.getBoundingClientRect();g.value=e.clientX-n.left-t.pointerOffsetX,_.value=e.clientY-n.top-t.pointerOffsetY;let r=(e.clientX-n.left-J.offsetX.value)/J.scale.value,i=(e.clientY-n.top-J.offsetY.value)/J.scale.value,a=_r(r,i,t.srcId);t.currentTargetId=a?.id??null,t.dropPosition=a?xr(r,i,a):null}function xr(e,t,n){if(n.isRoot)return`child`;let r=n.width/2,i=n.height/2;if(n._dir===`down`){let t=e-n.x;return t<-r*.3?`before`:t>r*.3?`after`:`child`}let a=t-n.y;return a<-i*.3?`before`:a>i*.3?`after`:`child`}function Sr(e){var t;return!!((t=e.parent)!=null&&t.isRoot)&&e._dir===`left`}function Cr(e){if(window.removeEventListener(`pointermove`,br),window.removeEventListener(`pointerup`,Cr),window.removeEventListener(`pointercancel`,Cr),vr){vr=null;return}let t=h.value;if(t){if(t.currentTargetId&&t.dropPosition){let e=t.dropPosition;if(e!==`child`){let n=kn.value.find(e=>e.id===t.currentTargetId);n&&Sr(n)&&(e=e===`before`?`after`:`before`)}mr(t.srcId,t.currentTargetId,e),d.value=new Set([t.srcId]),Y()}h.value=null,g.value=0,_.value=0,document.body.classList.remove(`is-dragging`)}}let wr=A(null),Tr=A(null),Er=A(null),Dr=A(null),Or=A(``);function kr(e,t){let n=e.width/2,r=e.height/2,i=(t%4+4)%4;return i<1?{x:e.x-n+2*n*i,y:e.y-r}:i<2?{x:e.x+n,y:e.y-r+2*r*(i-1)}:i<3?{x:e.x+n-2*n*(i-2),y:e.y+r}:{x:e.x-n,y:e.y+r-2*r*(i-3)}}function Ar(e,t){let n=t.x-e.x,r=t.y-e.y,i=e.width/2,a=e.height/2;if(Math.abs(n)<1e-6&&Math.abs(r)<1e-6)return{x:e.x+i,y:e.y};let o=Math.abs(n)>1e-6?i/Math.abs(n):1/0,s=Math.abs(r)>1e-6?a/Math.abs(r):1/0,c=Math.min(o,s);return{x:e.x+n*c,y:e.y+r*c}}function jr(e,t){let n=e.width/2||1,r=e.height/2||1,i=t.x-e.x,a=t.y-e.y;return Math.abs(i)/n>Math.abs(a)/r?i>0?1+L((a+r)/(2*r),0,1):3+L((r-a)/(2*r),0,1):a<0?L((i+n)/(2*n),0,1):2+L((n-i)/(2*n),0,1)}function Mr(e,t,n,r){let i=t===`from`?n:r,a=t===`from`?r:n,o=Er.value;if(o&&o.id===e.id&&o.end===t)return Ar(i,{x:o.wx,y:o.wy});let s=t===`from`?e.fromT:e.toT;return s===void 0?Ar(i,{x:a.x,y:a.y}):kr(i,s)}function Nr(e,t){let n=Math.hypot(t.x,t.y);if(n<1e-6)return null;let r=t.x/n,i=t.y/n,a=e.x-r*9,o=e.y-i*9,s=-i*(7/2),c=7/2*r;return`M ${e.x.toFixed(2)} ${e.y.toFixed(2)} L ${(a+s).toFixed(2)} ${(o+c).toFixed(2)} L ${(a-s).toFixed(2)} ${(o-c).toFixed(2)} Z`}let Pr=n(()=>{let e=T.value.relations;if(!e||e.length===0)return[];let t=[];for(let n of e){let e=kn.value.find(e=>e.id===n.fromId),r=kn.value.find(e=>e.id===n.toId);if(!e||!r)continue;let i=Mr(n,`from`,e,r),a=Mr(n,`to`,e,r),o=Er.value,s=n.c1,c=n.c2;if(o&&o.id===n.id&&o.end===`c1`&&(s={x:o.wx,y:o.wy}),o&&o.id===n.id&&o.end===`c2`&&(c={x:o.wx,y:o.wy}),!s||!c){let e=a.x-i.x,t=a.y-i.y,n=Math.hypot(e,t)||1,r=-t/n,o=e/n;o>0&&(r=-r,o=-o);let l=L(n*.18,24,160),u={x:(i.x+a.x)/2+r*l,y:(i.y+a.y)/2+o*l};s||=u,c||=u}let l=`M ${i.x.toFixed(2)} ${i.y.toFixed(2)} C ${s.x.toFixed(2)} ${s.y.toFixed(2)} ${c.x.toFixed(2)} ${c.y.toFixed(2)} ${a.x.toFixed(2)} ${a.y.toFixed(2)}`,u=dn(.5,i,{x1:s.x,y1:s.y,x2:c.x,y2:c.y},a),d=n.arrow??`end`,f=d===`none`?null:Nr(a,{x:a.x-c.x,y:a.y-c.y}),p=d===`both`?Nr(i,{x:i.x-s.x,y:i.y-s.y}):null;t.push({rel:n,from:i,to:a,c1:s,c2:c,d:l,labelPos:u,arrowEnd:f,arrowStart:p})}return t}),Fr=n(()=>Pr.value.find(e=>e.rel.id===Dr.value)??null);function Ir(e,t){let n=it(T.value,e,t);return n?(G(),K(),s(`change`,T.value),wr.value=n.id,d.value=new Set,Y(),n.id):null}function Lr(e){at(T.value,e)&&(G(),wr.value===e&&(wr.value=null),Dr.value===e&&(Dr.value=null),K(),s(`change`,T.value))}function Rr(e,t){ot(T.value,e,t)&&(G(),K(),s(`change`,T.value))}function zr(e){i.previewMode||(Tr.value={fromId:e},e&&(d.value=new Set([e]),Y()))}function Br(){if(Tr.value){Tr.value=null;return}zr(f.value)}function Vr(e,t){e.stopPropagation(),wr.value=t,d.value=new Set,Y()}function Hr(e,t,n){if(i.previewMode)return;e.stopPropagation(),e.preventDefault();let r=c.value.getBoundingClientRect();Er.value={id:t,end:n,wx:(e.clientX-r.left-J.offsetX.value)/J.scale.value,wy:(e.clientY-r.top-J.offsetY.value)/J.scale.value,hoverNodeId:null},window.addEventListener(`pointermove`,Ur),window.addEventListener(`pointerup`,Wr),window.addEventListener(`pointercancel`,Wr)}function Ur(e){let t=Er.value;if(!t)return;let n=c.value.getBoundingClientRect();if(t.wx=(e.clientX-n.left-J.offsetX.value)/J.scale.value,t.wy=(e.clientY-n.top-J.offsetY.value)/J.scale.value,t.end===`from`||t.end===`to`){let e=rt(T.value,t.id),n=e?t.end===`from`?e.fromId:e.toId:null;t.hoverNodeId=_r(t.wx,t.wy,n)?.id??null}}function Wr(){window.removeEventListener(`pointermove`,Ur),window.removeEventListener(`pointerup`,Wr),window.removeEventListener(`pointercancel`,Wr);let e=Er.value;if(Er.value=null,!e)return;let t=rt(T.value,e.id);if(t){if(e.end===`c1`||e.end===`c2`)t[e.end]={x:Math.round(e.wx*2)/2,y:Math.round(e.wy*2)/2};else{let n=e.end===`from`?t.fromId:t.toId;if(!(e.hoverNodeId&&e.hoverNodeId!==n&&st(T.value,e.id,e.end,e.hoverNodeId))){let r=kn.value.find(e=>e.id===n);if(r){let n=jr(r,Ar(r,{x:e.wx,y:e.wy}));e.end===`from`?t.fromT=n:t.toT=n}}}G(),K(),s(`change`,T.value),Gt=!0}}function Gr(e){if(i.previewMode)return;let t=rt(T.value,e);t&&(Dr.value=e,Or.value=t.label??``,wr.value=e,o(()=>{let e=document.querySelector(`.zm-relation-label-input`);e?.focus(),e?.select()}))}function Kr(){let e=Dr.value;if(!e)return;Dr.value=null;let t=rt(T.value,e);if(!t)return;let n=Or.value.trim();(t.label??``)!==n&&Rr(e,{label:n||void 0})}function qr(e){let t=[],n=e=>{t.push(e.id);for(let t of e.children)n(t)};return n(e),t}let Jr=!1;function Yr(e){let t=e.target;if(!t||t.closest(`.zm-node, .zm-toolbar, button, input, textarea, .zm-relations`))return;if(e.button===2){Jr=!0,J.startPan(e);return}if(Jr=!1,e.button!==0)return;let n=c.value.getBoundingClientRect(),r=(e.clientX-n.left-J.offsetX.value)/J.scale.value,i=(e.clientY-n.top-J.offsetY.value)/J.scale.value;J.startMarquee(r,i,{shift:e.shiftKey})}function Xr(e){if(Gt){Gt=!1;return}let t=e.target;if(!t||t.closest(`.zm-node`)||t.closest(`.zm-relations`)||t.closest(`.zm-toolbar`))return;let n=J.marquee;if(!(n.width>=4||n.height>=4)){if(Tr.value){Tr.value=null;return}if(wr.value){wr.value=null;return}d.value.size>0&&(d.value=new Set,Y())}}function Zr(){let e=J.marquee;if(e.width<4&&e.height<4)return;let t=e.x,n=e.y,r=e.x+e.width,i=e.y+e.height,a=[];for(let e of kn.value){let o=e.width/2,s=e.height/2,c=e.x-o,l=e.x+o,u=e.y-s,d=e.y+s;c<=r&&l>=t&&u<=i&&d>=n&&a.push(e.id)}d.value=e.shiftKey?new Set([...d.value,...a]):new Set(a),Y()}function Qr(e){return p.value.has(e)}function $r(e){let t=U(T.value,e.id);return!!t&&t.children.length>0}function ei(e){let t=U(T.value,e);return t?et(t):0}function ti(e){if(!U(T.value,e))return 0;let t=[T.value];for(;t.length;){let n=t.pop(),r=n.children.findIndex(t=>t.id===e);if(r>=0)return r;for(let e of n.children)t.push(e)}return 0}function ni(e,t,n,r){let i=r?._dir??e._dir;if(t===`out`&&e.isRoot&&q.lineOrigin===`center`)return{x:e.x,y:e.y};if(t===`out`&&e.isRoot&&q.lineOrigin===`xmind`&&r){if(i===`down`)return{x:e.x,y:e.y};let t=n===void 0?e.side:n,a=e.children.filter(e=>e.side===t).sort((e,t)=>e.y-t.y),o=a.length,s=Math.max(0,a.findIndex(e=>e.id===r.id)),c=0;return o===2?c=.7:o>=3&&(c=s===0||s===o-1?.17:.45),{x:e.x+t*(e.width/2)*c,y:e.y}}if(t===`out`&&e.isRoot&&q.lineOrigin===`proportional`&&r){let t=r.x-e.x,n=r.y-e.y,i=e.width/2,a=e.height/2,o=t===0?1/0:i/Math.abs(t),s=n===0?1/0:a/Math.abs(n),c=Math.min(o,s);return Number.isFinite(c)?{x:e.x+t*c,y:e.y+n*c}:{x:e.x,y:e.y}}if(i===`down`)return t===`out`?{x:e.x,y:e.y+e.height/2}:{x:e.x,y:e.y-e.height/2};let a;a=t===`in`?-e.side:n===void 0?e.side:n;let o=t===`in`?e._richInsetX??0:0;return{x:e.x+a*(e.width/2-o),y:e.y}}function ri(){let e=Dn.value;J.resetView(e.width,e.height,e.root.y)}function ii(){$t.value=!0,G(),K(),o(()=>ri())}function ai(e){q.layoutMode!==e&&(q.layoutMode=e,K(),o(()=>ri()))}function oi(){return JSON.stringify(T.value,null,2)}function si(e){let t=U(T.value,e);return t?!!(t.note&&t.note.text||t.link&&t.link.url||t.image&&t.image.src||t.richContent&&t.richContent.raw||t.markers&&t.markers.length>0||t.tags&&t.tags.length>0):!1}function ci(e){try{let t=JSON.parse(e);return!t.id||!Array.isArray(t.children)?!1:(en.reset(),T.value=H(t),d.value=new Set,p.value=new Set,K(),o(()=>ri()),s(`change`,T.value),!0)}catch{return!1}}function li(){let e=document.createElement(`input`);e.type=`file`,e.accept=`application/json`,e.onchange=()=>{let t=e.files?.[0];if(!t)return;let n=new FileReader;n.onload=()=>{typeof n.result==`string`&&(ci(n.result)||alert(`导入失败:JSON 格式无效`))},n.readAsText(t)},e.click()}function ui(){let e=new Blob([oi()],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${T.value.text||`mindmap`}.json`,n.click(),URL.revokeObjectURL(t)}let di=A(``),fi=A([]),pi=A(-1);function mi(e){di.value=e;let t=e.trim();if(!t){fi.value=[],pi.value=-1;return}let n=t.toLowerCase(),r=[],i=e=>{var t;(e.text.toLowerCase().includes(n)||(t=e.note)!=null&&t.text&&e.note.text.toLowerCase().includes(n))&&r.push(e.id);for(let t of e.children)i(t)};i(T.value),fi.value=r,pi.value=r.length>0?0:-1,r.length>0&&(xi(r),o(()=>Si(0)))}function hi(){fi.value.length!==0&&(pi.value=(pi.value+1)%fi.value.length,Si(pi.value))}function gi(){fi.value.length!==0&&(pi.value=(pi.value-1+fi.value.length)%fi.value.length,Si(pi.value))}function _i(){di.value=``,fi.value=[],pi.value=-1}function vi(e){return fi.value.includes(e)}function yi(e){return pi.value>=0&&fi.value[pi.value]===e}function bi(e){return di.value.trim().length>0&&fi.value.length>0&&!fi.value.includes(e)}function xi(e){if(e.length===0)return;let t=new Set(e),n=new Set,r=e=>{let i=t.has(e.id);for(let t of e.children)r(t)&&(i=!0);return i&&e.children.length>0&&p.value.has(e.id)&&n.add(e.id),i};if(r(T.value),n.size>0){for(let e of n)p.value.delete(e);K()}}function Si(e){let t=fi.value[e];if(!t)return;let n=kn.value.find(e=>e.id===t);n&&(d.value=new Set([t]),Y(),J.centerOn(n.x,n.y,n.width,n.height))}function Ci(e,t){let n=U(T.value,e);n&&(n.markers||=[],!n.markers.includes(t)&&(n.markers.push(t),G(),K(),s(`change`,T.value)))}function wi(e,t){let n=U(T.value,e);if(!n||!n.markers)return;let r=n.markers.indexOf(t);r<0||(n.markers.splice(r,1),n.markers.length===0&&delete n.markers,G(),K(),s(`change`,T.value))}function Ti(e,t){let n=U(T.value,e);if(!n)return!1;n.markers||=[];let r=n.markers.indexOf(t);return r>=0?(n.markers.splice(r,1),n.markers.length===0&&delete n.markers,G(),K(),s(`change`,T.value),!1):(n.markers.push(t),G(),K(),s(`change`,T.value),!0)}function Ei(e){let t=U(T.value,e);return t!=null&&t.markers?[...t.markers]:[]}function Di(e,t){var n;return!!((n=U(T.value,e)?.markers)!=null&&n.includes(t))}function Oi(e){let t=B.value?.nodeId;t&&Ti(t,e)}function ki(){let e=B.value?.nodeId;if(!e)return;let t=U(T.value,e);!t||!t.markers||(delete t.markers,G(),K(),s(`change`,T.value),V())}function Ai(e,t){let n=U(T.value,e);n&&(t.length===0?n.tags&&delete n.tags:n.tags=[...t],G(),K(),s(`change`,T.value))}function ji(e){let t=U(T.value,e);return t!=null&&t.tags?[...t.tags]:[]}function Mi(){let e=B.value?.nodeId;if(!e)return;let t=(U(T.value,e)?.tags)?.join(`, `)??``,n=window.prompt(`输入标签(多个用逗号分隔)`,t);n!==null&&(Ai(e,n.split(/[,,]/).map(e=>e.trim()).filter(e=>e.length>0)),V())}function Ni(){let e=B.value?.nodeId;e&&(Ai(e,[]),V())}function Pi(){let e=Dn.value,t=`http://www.w3.org/2000/svg`,n=document.createElementNS(t,`svg`);n.setAttribute(`xmlns`,t),n.setAttribute(`viewBox`,`${e.vbX} ${e.vbY} ${e.vbW} ${e.vbH}`),n.setAttribute(`width`,String(e.vbW)),n.setAttribute(`height`,String(e.vbH));let r=document.createElementNS(t,`rect`);r.setAttribute(`x`,String(e.vbX)),r.setAttribute(`y`,String(e.vbY)),r.setAttribute(`width`,String(e.vbW)),r.setAttribute(`height`,String(e.vbH)),r.setAttribute(`fill`,an.value),n.appendChild(r);for(let e of An.value){let r=document.createElementNS(t,`path`);r.setAttribute(`d`,pn(ni(e.from,`out`,e.to.side,e.to),ni(e.to,`in`),sn(e.from.depth),cn(e.to.depth),32,on(e.from.isRoot),e.to._dir)),r.setAttribute(`fill`,vn(e.from,e.to)),r.setAttribute(`stroke`,`none`),n.appendChild(r)}let i=`-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif`;function a(e,t){let n=0;for(let r of e)/[\u4e00-\u9fff\u3000-\u30ff\uff00-\uffef]/.test(r)?n+=t:n+=t*.55;return n}for(let e of Pr.value){let r=document.createElementNS(t,`path`);r.setAttribute(`d`,e.d),r.setAttribute(`fill`,`none`),r.setAttribute(`stroke`,e.rel.color??`#94a3b8`),r.setAttribute(`stroke-width`,`1.5`),r.setAttribute(`stroke-dasharray`,`6 4`),r.setAttribute(`stroke-linecap`,`round`),n.appendChild(r);let a=e.rel.color??`#94a3b8`;for(let r of[e.arrowEnd,e.arrowStart]){if(!r)continue;let e=document.createElementNS(t,`path`);e.setAttribute(`d`,r),e.setAttribute(`fill`,a),e.setAttribute(`stroke`,`none`),n.appendChild(e)}if(e.rel.label){let r=document.createElementNS(t,`text`);r.setAttribute(`x`,String(e.labelPos.x)),r.setAttribute(`y`,String(e.labelPos.y-6)),r.setAttribute(`text-anchor`,`middle`),r.setAttribute(`font-size`,`12`),r.setAttribute(`font-family`,i),r.setAttribute(`fill`,`#64748b`),r.setAttribute(`stroke`,an.value),r.setAttribute(`stroke-width`,`3`),r.setAttribute(`paint-order`,`stroke`),r.textContent=e.rel.label,n.appendChild(r)}}for(let e of kn.value){let r=e.x-e.width/2,o=e.y-e.height/2,s=document.createElementNS(t,`rect`);s.setAttribute(`x`,String(r)),s.setAttribute(`y`,String(o)),s.setAttribute(`width`,String(e.width)),s.setAttribute(`height`,String(e.height)),s.setAttribute(`rx`,`8`),s.setAttribute(`fill`,yn(e));let c=Sn(e);c!==`transparent`&&(s.setAttribute(`stroke`,c),s.setAttribute(`stroke-width`,`1`)),n.appendChild(s);let l=!!(e.tags&&e.tags.length>0),u=!!(e.markers&&e.markers.length>0),d=!!e.image,f=!(!e.richContent||e.richContent.kind!==`code`&&e.richContent.kind!==`table`),p=0,m=0;if(f){let r=e.richContent,s=e.fontSize*.78*.92;if(r.kind===`code`){let c=As(r.raw),l=js(r.raw),u=c.split(`
|
|
174
174
|
`),f=s*1.35,h=0;for(let e of u)h=Math.max(h,a(e,s));m=Math.min(h+12+4,e.width-4),p=u.length*f+8+2;let g=e.x-m/2,_=o+4;d&&(_=o+e.image.height+6);let v=document.createElementNS(t,`rect`);if(v.setAttribute(`x`,String(g)),v.setAttribute(`y`,String(_)),v.setAttribute(`width`,String(m)),v.setAttribute(`height`,String(p-2)),v.setAttribute(`rx`,`6`),v.setAttribute(`fill`,`rgba(255,255,255,0.55)`),v.setAttribute(`stroke`,Sn(e)),v.setAttribute(`stroke-width`,`1`),n.appendChild(v),l){let r=document.createElementNS(t,`text`);r.setAttribute(`x`,String(g+m-6)),r.setAttribute(`y`,String(_+4+4)),r.setAttribute(`text-anchor`,`end`),r.setAttribute(`fill`,xn(e)),r.setAttribute(`font-size`,String(s*.8)),r.setAttribute(`font-family`,i),r.setAttribute(`opacity`,`0.5`),r.textContent=l,n.appendChild(r)}for(let r=0;r<u.length;r++){let i=document.createElementNS(t,`text`);i.setAttribute(`x`,String(g+6)),i.setAttribute(`y`,String(_+4+(r+.5)*f+2)),i.setAttribute(`dominant-baseline`,`central`),i.setAttribute(`fill`,xn(e)),i.setAttribute(`font-size`,String(s)),i.setAttribute(`font-family`,`'JetBrains Mono','Fira Code',Consolas,monospace`);let a=u[r],o=Math.floor((m-12)/(s*.6));a.length>o&&(a=a.substring(0,o-1)+`…`),i.textContent=a,n.appendChild(i)}}else if(r.kind===`table`){let c=Ns(r.raw);if(c.length>0){let r=s*1.35,l=c[0].length,u=[];for(let e=0;e<l;e++){let t=0;for(let n of c)e<n.length&&(t=Math.max(t,a(n[e],s)));u.push(t+12)}m=Math.min(u.reduce((e,t)=>e+t,0),e.width-4);let f=m/u.reduce((e,t)=>e+t,0);for(let e=0;e<l;e++)u[e]*=f;p=c.length*(r+6)+2;let h=e.x-m/2,g=o+4;d&&(g=o+e.image.height+6);let _=document.createElementNS(t,`rect`);_.setAttribute(`x`,String(h)),_.setAttribute(`y`,String(g)),_.setAttribute(`width`,String(m)),_.setAttribute(`height`,String(p-2)),_.setAttribute(`rx`,`6`),_.setAttribute(`fill`,`rgba(255,255,255,0.55)`),_.setAttribute(`stroke`,Sn(e)),_.setAttribute(`stroke-width`,`1`),n.appendChild(_);let v=h,y=g;for(let a=0;a<c.length;a++){let o=c[a],d=r+6;v=h;for(let f=0;f<l;f++){let p=u[f],m=o[f]||``;if(f<l-1){let r=document.createElementNS(t,`line`);r.setAttribute(`x1`,String(v+p)),r.setAttribute(`y1`,String(y)),r.setAttribute(`x2`,String(v+p)),r.setAttribute(`y2`,String(y+d)),r.setAttribute(`stroke`,Sn(e)),r.setAttribute(`stroke-width`,`1`),n.appendChild(r)}if(a<c.length-1){let r=document.createElementNS(t,`line`);r.setAttribute(`x1`,String(v)),r.setAttribute(`y1`,String(y+d)),r.setAttribute(`x2`,String(v+p)),r.setAttribute(`y2`,String(y+d)),r.setAttribute(`stroke`,Sn(e)),r.setAttribute(`stroke-width`,`1`),n.appendChild(r)}if(a===0){let e=document.createElementNS(t,`rect`);e.setAttribute(`x`,String(v)),e.setAttribute(`y`,String(y)),e.setAttribute(`width`,String(p)),e.setAttribute(`height`,String(d)),e.setAttribute(`fill`,`rgba(255,255,255,0.4)`),n.appendChild(e)}let h=document.createElementNS(t,`text`);h.setAttribute(`x`,String(v+6)),h.setAttribute(`y`,String(y+3+r/2+2)),h.setAttribute(`dominant-baseline`,`central`),h.setAttribute(`fill`,xn(e)),h.setAttribute(`font-size`,String(s)),h.setAttribute(`font-family`,i),a===0&&h.setAttribute(`font-weight`,`600`);let g=m,_=Math.floor((p-12)/(s*.55));g.length>_&&_>2&&(g=g.substring(0,_-1)+`…`),h.textContent=g,n.appendChild(h),v+=p}y+=d}}}}let h=0;if(d){let r=e.image,i=o+4,a=e.x-r.width/2,s=document.createElementNS(t,`image`);s.setAttribute(`x`,String(a)),s.setAttribute(`y`,String(i)),s.setAttribute(`width`,String(r.width)),s.setAttribute(`height`,String(r.height)),s.setAttribute(`href`,r.src),s.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,r.src),s.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),n.appendChild(s),h=r.height+6}let g=e.y,_=h+p;_>0?g=o+_+(e.height-_)/2:l&&(g=e.y-8);let v=u?e.markers.length:0,y=v>0?v*14+(v-1)*2+4:0,b=a(e.text,e.fontSize),x=y+b,S=e.x-x/2;if(u){let r=S;for(let i of e.markers){let a=Ct(i);if(a){let i=document.createElementNS(t,`svg`);i.setAttribute(`x`,String(r)),i.setAttribute(`y`,String(g-7)),i.setAttribute(`width`,`14`),i.setAttribute(`height`,`14`),i.setAttribute(`viewBox`,`0 0 24 24`),i.setAttribute(`color`,xn(e));let o=new DOMParser().parseFromString(`<svg xmlns="${t}">${a}</svg>`,`image/svg+xml`);if(!o.querySelector(`parsererror`))for(;o.documentElement.firstChild;)i.appendChild(o.documentElement.firstChild);n.appendChild(i)}r+=16}}let C=u?S+y+b/2:e.x,w=document.createElementNS(t,`text`);if(w.setAttribute(`x`,String(C)),w.setAttribute(`y`,String(g)),w.setAttribute(`text-anchor`,`middle`),w.setAttribute(`dominant-baseline`,`central`),w.setAttribute(`fill`,xn(e)),w.setAttribute(`font-size`,String(wn(e))),w.setAttribute(`font-weight`,String(Cn(e))),w.setAttribute(`font-family`,i),w.textContent=e.text,n.appendChild(w),l){let r=e.y+10,o=e.tags.map(e=>a(e,10)+12),s=o.reduce((e,t)=>e+t+3,-3),c=e.x-s/2;for(let a=0;a<e.tags.length;a++){let s=e.tags[a],l=Tt(s),u=o[a],d=document.createElementNS(t,`rect`);d.setAttribute(`x`,String(c)),d.setAttribute(`y`,String(r-8)),d.setAttribute(`width`,String(u)),d.setAttribute(`height`,`16`),d.setAttribute(`rx`,`8`),d.setAttribute(`fill`,l.background),d.setAttribute(`stroke`,l.borderColor),d.setAttribute(`stroke-width`,`1`),n.appendChild(d);let f=document.createElementNS(t,`text`);f.setAttribute(`x`,String(c+u/2)),f.setAttribute(`y`,String(r)),f.setAttribute(`text-anchor`,`middle`),f.setAttribute(`dominant-baseline`,`central`),f.setAttribute(`fill`,l.color),f.setAttribute(`font-size`,`10`),f.setAttribute(`font-family`,i),f.textContent=s,n.appendChild(f),c+=u+3}}}return n}function Fi(){let e=Pi(),t=new XMLSerializer().serializeToString(e);t.startsWith(`<?xml`)||(t=`<?xml version="1.0" encoding="UTF-8"?>
|
|
175
175
|
`+t);let n=new Blob([t],{type:`image/svg+xml;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${T.value.text||`mindmap`}.svg`,i.click(),URL.revokeObjectURL(r)}function Ii(e=2){let t=Pi(),n=Dn.value,r=new XMLSerializer().serializeToString(t);r.startsWith(`<?xml`)||(r=`<?xml version="1.0" encoding="UTF-8"?>
|
|
176
|
-
`+r);let i=new Blob([r],{type:`image/svg+xml;charset=utf-8`}),a=URL.createObjectURL(i),o=new window.Image;o.onload=()=>{let t=document.createElement(`canvas`);t.width=Math.ceil(n.vbW*e),t.height=Math.ceil(n.vbH*e);let r=t.getContext(`2d`);if(!r){URL.revokeObjectURL(a);return}r.fillStyle=an.value,r.fillRect(0,0,t.width,t.height),r.drawImage(o,0,0,t.width,t.height),URL.revokeObjectURL(a);try{t.toBlob(e=>{if(!e){Fi();return}let t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${T.value.text||`mindmap`}.png`,n.click(),URL.revokeObjectURL(t)},`image/png`)}catch(e){console.warn(`PNG export failed, falling back to SVG:`,e),Fi()}},o.onerror=()=>{URL.revokeObjectURL(a),Fi()},o.src=a}t({addChild:e=>Un(e),addSibling:e=>Wn(e),removeNode:e=>or(e),duplicateNode:e=>Kn(e),setNodeText:(e,t)=>pr(e,t),moveNode:(e,t,n)=>mr(e,t,n),lineWidthForDepth:sn,endWidthForDepth:cn,getData:()=>T.value,nodeHasContent:e=>si(e),getSelectedIds:()=>[...d.value],copyNodes:e=>Zn(e),cutNodes:e=>$n(e),pasteNodes:e=>er(e),setData:e=>{en.reset(),T.value=H(e),d.value=new Set,p.value=new Set,K(),G(),m(()=>ri())},resetView:()=>ri(),exportData:oi,importData:ci,getMarkdown:()=>ut(T.value),setMarkdown:(e,t=!0)=>{let n=lt(e||``);t&&(O.value=!0),k=!t,en.reset(),T.value=H(n),d.value=new Set,p.value=new Set,K(),G(),m(()=>{k=!1,ri()}),a(`change`,T.value)},setBalanced:e=>{$t.value=e},isBalanced:()=>$t.value,balance:()=>ii(),applyNodeStyle:(e,t)=>te(e,t),getNodeStyle:e=>P(e),applyNodeImage:(e,t)=>F(e,t),applyNodeImageByUrl:(e,t)=>I(e,t),removeNodeImage:e=>re(e),applyNodeLink:(e,t)=>le(e,t),removeNodeLink:e=>ue(e),applyNodeNote:(e,t)=>de(e,t),removeNodeNote:e=>R(e),applyNodeRichContent:(e,t)=>z(e,t),addNodeMarker:(e,t)=>Ci(e,t),removeNodeMarker:(e,t)=>wi(e,t),toggleNodeMarker:(e,t)=>Ti(e,t),getNodeMarkers:e=>Ei(e),setNodeTags:(e,t)=>Ai(e,t),getNodeTags:e=>ji(e),exportPNG:e=>Ii(e),exportSVG:()=>Fi(),searchNodes:e=>(mi(e),[...fi.value]),undo:()=>tr(),redo:()=>nr(),canUndo:()=>en.canUndo(),canRedo:()=>en.canRedo(),applySettings:e=>{e.autoBalanceOnChange!==void 0&&(q.autoBalanceOnChange=e.autoBalanceOnChange),e.lineWidthStart!==void 0&&(q.lineWidthStart=Math.max(.5,Math.min(20,e.lineWidthStart))),e.lineWidthEnd!==void 0&&(q.lineWidthEnd=Math.max(.3,Math.min(10,e.lineWidthEnd))),e.rainbowBranch!==void 0&&(q.rainbowBranch=e.rainbowBranch),e.branchPaletteId!==void 0&&(q.branchPaletteId=e.branchPaletteId),e.customPalettes!==void 0&&(q.customPalettes=e.customPalettes),e.lineStyle!==void 0&&(q.lineStyle=e.lineStyle),e.rootLineStyle!==void 0&&(q.rootLineStyle=e.rootLineStyle),e.lineOrigin!==void 0&&(q.lineOrigin=e.lineOrigin),e.taperedEdge!==void 0&&(q.taperedEdge=e.taperedEdge),e.lineWidthTaper!==void 0&&(q.lineWidthTaper=Math.max(.1,Math.min(1,e.lineWidthTaper))),e.uniformLineWidth!==void 0&&(q.uniformLineWidth=e.uniformLineWidth),e.elbowRadius!==void 0&&(q.elbowRadius=Math.max(2,Math.min(40,e.elbowRadius))),e.showOrderBadge!==void 0&&(q.showOrderBadge=e.showOrderBadge),e.canvasBg!==void 0&&(q.canvasBg=e.canvasBg),e.branchGap!==void 0&&(q.branchGap=Math.max(0,Math.min(80,e.branchGap))),e.layoutMode!==void 0&&q.layoutMode!==e.layoutMode&&(q.layoutMode=e.layoutMode,K(),m(()=>ri()))},getSettings:()=>({autoBalanceOnChange:q.autoBalanceOnChange,lineWidthStart:q.lineWidthStart,lineWidthEnd:q.lineWidthEnd,rainbowBranch:q.rainbowBranch,branchPaletteId:q.branchPaletteId,customPalettes:q.customPalettes,lineStyle:q.lineStyle,rootLineStyle:q.rootLineStyle,lineOrigin:q.lineOrigin,layoutMode:q.layoutMode,taperedEdge:q.taperedEdge,lineWidthTaper:q.lineWidthTaper,uniformLineWidth:q.uniformLineWidth,elbowRadius:q.elbowRadius,showOrderBadge:q.showOrderBadge,canvasBg:q.canvasBg,branchGap:q.branchGap}),setBranchPalette:e=>{e&&[...Le,...q.customPalettes].find(t=>t.id===e)&&(q.branchPaletteId=e)},getBranchPalette:()=>q.branchPaletteId,getBranchPalettes:()=>[...Le,...q.customPalettes],getSearchResults:()=>[...fi.value],getSearchIndex:()=>pi.value,addRelation:(e,t)=>Ir(e,t),removeRelation:e=>Lr(e),updateRelation:(e,t)=>Rr(e,t),getRelations:()=>H(T.value.relations??[])}),D(()=>i.data,e=>{T.value=H(e),K()},{deep:!1}),o(()=>{G(),m(()=>ri())});let Li={props:i,emit:a,wrapperRef:s,editingId:l,editText:u,selectedIds:d,selectedId:f,collapsedIds:p,canvasHovered:h,dragState:g,dragGhostX:_,dragGhostY:y,dropIndicator:b,clipboard:x,tooltip:S,richEditingId:C,richEditDraft:w,dataRef:T,richHeights:E,richWidths:ee,usingMarkdown:O,get suppressMarkdownEmit(){return k},set suppressMarkdownEmit(e){k=e},showOrderBadge:j,nodeStylesRef:M,nodeStyles:N,applyNodeStyle:te,getNodeStyle:P,getNodeStyleOr:ne,IMG_MIN_W:Cd,IMG_MAX_W:wd,IMG_DEFAULT_W:Td,applyNodeImage:F,removeNodeImage:re,applyNodeImageByUrl:I,clamp:L,readImageFile:se,onPickImage:ce,applyNodeLink:le,removeNodeLink:ue,applyNodeNote:de,removeNodeNote:R,applyNodeRichContent:z,contextMenu:B,canvasMenu:fe,fabPreviewClass:pe,fabOutlineClass:me,onNodeContextMenu:he,closeContextMenu:V,onCanvasContextMenu:ge,closeCanvasMenu:_e,menuOpenSettings:ve,menuOpenData:ye,menuOpenImport:be,_showOutline:xe,_showData:Se,_showMarkdown:Ce,_showNote:we,_showSettings:Te,_noteFocusTick:Ee,_pendingImportMode:De,_outlineCollapsed:Oe,_closeRightDrawers:ke,_selectedNode:je,_currentNodeStyle:Me,_onSettingsChange:Ne,_onNodeStyleChange:Pe,_resetSettings:Fe,_onDataConsumedMode:Ie,_onNoteApply:ze,_onNoteRemove:Be,_onLinkSet:Ve,_onImageSet:He,_onRichSet:Ue,_onOutlineSelect:Je,_onOutlineEdit:nt,_onOutlineAddChild:dt,_onOutlineAddSibling:ft,_onOutlineMove:mt,_toggleCollapse:ht,_onCanvasOutline:vt,menuPickImage:yt,menuSetLink:bt,menuRemoveLink:xt,menuEditNote:St,menuRemoveNote:Et,menuRemoveImage:Dt,menuAddCode:Ot,menuRemoveCode:kt,menuAddTable:At,menuRemoveTable:jt,menuAddRelation:Nt,emitEditNote:Pt,notePreview:It,onPaste:Lt,onGlobalKeydown:Rt,resizeState:zt,resizingId:Bt,onResizeStart:Vt,onResizeMove:Ht,onResizeEnd:Ut,hoveredId:Wt,get suppressNextCanvasClick(){return Gt},set suppressNextCanvasClick(e){Gt=e},get suppressNextNodeClick(){return Kt},set suppressNextNodeClick(e){Kt=e},onNodeMouseEnter:Jt,onNodeMouseLeave:Yt,onNodeTextHover:Xt,isNodeInteractive:Zt,layoutVersion:Qt,balanced:$t,history:en,record:G,applyData:tn,triggerRef:K,measureRichBodies:nn,theme:rn,effectiveBg:an,settings:q,edgeLineStyle:on,lineWidthForDepth:sn,endWidthForDepth:cn,taperedParentWidth:ln,continuousWidth:un,cubicAt:dn,quadAt:fn,variableWidthPath:pn,lrRootChildren:mn,RAINBOW_FALLBACK:hn,activePalette:gn,branchColor:_n,lineColorFor:vn,nodeBg:yn,nodeFg:xn,nodeBorder:Sn,nodeFontWeight:Cn,nodeFontSize:wn,hexWithAlpha:Tn,darken:En,panZoom:J,layoutResult:Dn,allNodesComputed:On,allNodes:kn,edges:An,viewBox:jn,applyCollapse:Mn,startEdit:Nn,commitEdit:Pn,cancelEdit:Fn,autoresizeEditEl:In,autoresizeEdit:Ln,startRichEdit:Rn,commitRichEdit:zn,cancelRichEdit:Bn,onRichEditKeydown:Vn,onEditKeydown:Hn,doAddChild:Un,doAddSibling:Wn,doAddSiblingBefore:Gn,doDuplicate:Kn,clipboardableIds:qn,preorderIds:Jn,writeSystemClipboard:Yn,outlineClipboardText:Xn,doCopy:Zn,doCut:$n,doPaste:er,doUndo:tr,doRedo:nr,emitSelection:Y,doNavigate:rr,listLines:ir,paragraphText:ar,doRemove:or,toggleCollapse:sr,walkTreeDepth:cr,collapseAll:ur,expandToLevel:dr,expandAll:fr,doSetText:pr,doMove:mr,doMoveSibling:hr,onNodeClick:gr,getNodeAtPointer:_r,get pendingDrag(){return vr},set pendingDrag(e){vr=e},DRAG_THRESHOLD:Ed,onNodePointerDown:yr,onDragPointerMove:br,computeDropPosition:xr,isLeftSideRootChild:Sr,onDragPointerUp:Cr,selectedRelationId:wr,relationMode:Tr,relationDrag:Er,relationEditingId:Dr,relationEditText:Or,perimeterPoint:kr,rectRayPoint:Ar,perimeterParam:jr,relationEndpoint:Mr,arrowHeadPath:Nr,relationGeoms:Pr,editingRelationGeom:Fr,doAddRelation:Ir,doRemoveRelation:Lr,doUpdateRelation:Rr,startRelationMode:zr,onRelationToolbarClick:Br,onRelationClick:Vr,onRelationHandlePointerDown:Hr,onRelationHandleMove:Ur,onRelationHandleUp:Wr,startRelationLabelEdit:Gr,commitRelationLabel:Kr,subtreeIds:qr,get lastPanWasRightButton(){return Jr},set lastPanWasRightButton(e){Jr=e},onCanvasMouseDown:Yr,onCanvasClick:Xr,onMarqueeEnd:Zr,isCollapsed:Qr,nodeHasChildren:$r,collapsedChildCount:ei,siblingIndexOf:ti,lineAnchor:ni,resetView:ri,runBalance:ii,setLayoutMode:ai,exportData:oi,nodeHasContent:si,importData:ci,importFromFile:li,exportToFile:ui,searchQuery:di,searchResults:fi,searchIndex:pi,performSearch:mi,searchNext:hi,searchPrev:gi,clearSearch:_i,isSearchHit:vi,isCurrentSearchHit:yi,isSearchDimmed:bi,expandAncestorsOfMatches:xi,centerOnMatch:Si,applyNodeMarker:Ci,removeNodeMarkerData:wi,toggleNodeMarkerData:Ti,getNodeMarkersData:Ei,hasNodeMarker:Di,menuToggleMarker:Oi,menuClearMarkers:ki,setNodeTagsData:Ai,getNodeTagsData:ji,menuAddTag:Mi,menuRemoveTags:Ni,buildExportSVG:Pi,exportSVGFile:Fi,exportPNGFile:Ii,Icon:ie,get addNodeIcon(){return ae},get addSubNodeIcon(){return oe},get findNode(){return U},NodeContextMenu:Mt,CanvasContextMenu:Ft,Drawer:qt,Outline:bn,DataPanel:Qn,MarkdownPanel:lr,SettingsPanel:oa,NotePanel:Sd,get codeLang(){return js},get highlightCode(){return Ms},get stripCodeFence(){return As},get tableRows(){return Ns},get markerSvg(){return Ct},get markerLabel(){return wt},get tagColor(){return Tt}};return Object.defineProperty(Li,"__isScriptSetup",{enumerable:!1,value:!0}),Li}}),Od=[`viewBox`,`width`,`height`],kd={class:`zm-edges`},Ad=[`d`,`fill`],jd={class:`zm-relations`},Md=[`d`,`onClick`,`onDblclick`],Nd=[`d`],Pd=[`d`],Fd=[`d`],Id=[`x`,`y`,`onClick`,`onDblclick`],Ld=[`x1`,`y1`,`x2`,`y2`],Rd=[`x1`,`y1`,`x2`,`y2`],zd=[`cx`,`cy`,`r`,`onPointerdown`],Bd=[`cx`,`cy`,`r`,`onPointerdown`],Vd=[`x`,`y`,`width`,`height`,`onPointerdown`],Hd=[`x`,`y`,`width`,`height`,`onPointerdown`],Ud=[`cx`,`cy`,`r`,`onPointerdown`],Wd=[`cx`,`cy`,`r`,`onPointerdown`],Gd=[`x`,`y`,`width`,`height`,`onPointerdown`],Kd=[`x`,`y`,`width`,`height`,`onPointerdown`],qd=[`data-node-id`,`onClick`,`onPointerdown`,`onDblclick`,`onContextmenu`,`onMouseenter`,`onMouseleave`],Jd=[`src`,`width`,`height`,`alt`],Yd=[`onDblclick`],Xd={key:0,class:`zm-rich-code`},Zd=[`innerHTML`],Qd={key:1,class:`zm-rich-table`},$d={key:2,class:`zm-text`},ef={key:0,class:`zm-node-markers`},tf=[`title`,`innerHTML`],nf={class:`zm-text-label`},rf=[`href`,`title`],af=[`title`,`onClick`],of={key:4,class:`zm-node-tags`},sf=[`title`],cf=[`title`,`onClick`],lf=[`onClick`],uf=[`onMousedown`],df=[`onClick`],ff=[`onKeydown`],pf=[`title`],mf=[`src`],hf=[`src`];function gf(e,t,n,a,o,c){var u,f,m;return h(),r(`div`,{class:`zm-mindmap`,style:g({background:a.effectiveBg,fontSize:a.theme.fontSize+`px`})},[j(`div`,{ref:`wrapperRef`,class:s([`zm-canvas`,{"is-relation-mode":!!a.relationMode}]),onMousedown:a.onCanvasMouseDown,onContextmenu:a.onCanvasContextMenu,onWheel:t[30]||=(...e)=>a.panZoom.onWheel&&a.panZoom.onWheel(...e),onMouseenter:t[31]||=e=>a.canvasHovered=!0,onMouseleave:t[32]||=e=>a.canvasHovered=!1,onClick:a.onCanvasClick},[i(` SVG layer: positioned in world coords (vbX, vbY) scaled by\r
|
|
176
|
+
`+r);let i=new Blob([r],{type:`image/svg+xml;charset=utf-8`}),a=URL.createObjectURL(i),o=new window.Image;o.onload=()=>{let t=document.createElement(`canvas`);t.width=Math.ceil(n.vbW*e),t.height=Math.ceil(n.vbH*e);let r=t.getContext(`2d`);if(!r){URL.revokeObjectURL(a);return}r.fillStyle=an.value,r.fillRect(0,0,t.width,t.height),r.drawImage(o,0,0,t.width,t.height),URL.revokeObjectURL(a);try{t.toBlob(e=>{if(!e){Fi();return}let t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${T.value.text||`mindmap`}.png`,n.click(),URL.revokeObjectURL(t)},`image/png`)}catch(e){console.warn(`PNG export failed, falling back to SVG:`,e),Fi()}},o.onerror=()=>{URL.revokeObjectURL(a),Fi()},o.src=a}t({addChild:e=>Un(e),addSibling:e=>Wn(e),removeNode:e=>or(e),duplicateNode:e=>Kn(e),setNodeText:(e,t)=>pr(e,t),moveNode:(e,t,n)=>mr(e,t,n),lineWidthForDepth:sn,endWidthForDepth:cn,getData:()=>T.value,nodeHasContent:e=>si(e),getSelectedIds:()=>[...d.value],copyNodes:e=>Zn(e),cutNodes:e=>$n(e),pasteNodes:e=>er(e),setData:e=>{en.reset(),T.value=H(e),d.value=new Set,p.value=new Set,K(),G(),o(()=>ri())},resetView:()=>ri(),exportData:oi,importData:ci,getMarkdown:()=>ut(T.value),setMarkdown:(e,t=!0)=>{let n=lt(e||``);t&&(O.value=!0),k=!t,en.reset(),T.value=H(n),d.value=new Set,p.value=new Set,K(),G(),o(()=>{k=!1,ri()}),s(`change`,T.value)},setBalanced:e=>{$t.value=e},isBalanced:()=>$t.value,balance:()=>ii(),applyNodeStyle:(e,t)=>te(e,t),getNodeStyle:e=>P(e),applyNodeImage:(e,t)=>F(e,t),applyNodeImageByUrl:(e,t)=>I(e,t),removeNodeImage:e=>re(e),applyNodeLink:(e,t)=>le(e,t),removeNodeLink:e=>ue(e),applyNodeNote:(e,t)=>de(e,t),removeNodeNote:e=>R(e),applyNodeRichContent:(e,t)=>z(e,t),addNodeMarker:(e,t)=>Ci(e,t),removeNodeMarker:(e,t)=>wi(e,t),toggleNodeMarker:(e,t)=>Ti(e,t),getNodeMarkers:e=>Ei(e),setNodeTags:(e,t)=>Ai(e,t),getNodeTags:e=>ji(e),exportPNG:e=>Ii(e),exportSVG:()=>Fi(),searchNodes:e=>(mi(e),[...fi.value]),undo:()=>tr(),redo:()=>nr(),canUndo:()=>en.canUndo(),canRedo:()=>en.canRedo(),applySettings:e=>{e.autoBalanceOnChange!==void 0&&(q.autoBalanceOnChange=e.autoBalanceOnChange),e.lineWidthStart!==void 0&&(q.lineWidthStart=Math.max(.5,Math.min(20,e.lineWidthStart))),e.lineWidthEnd!==void 0&&(q.lineWidthEnd=Math.max(.3,Math.min(10,e.lineWidthEnd))),e.rainbowBranch!==void 0&&(q.rainbowBranch=e.rainbowBranch),e.branchPaletteId!==void 0&&(q.branchPaletteId=e.branchPaletteId),e.customPalettes!==void 0&&(q.customPalettes=e.customPalettes),e.lineStyle!==void 0&&(q.lineStyle=e.lineStyle),e.rootLineStyle!==void 0&&(q.rootLineStyle=e.rootLineStyle),e.lineOrigin!==void 0&&(q.lineOrigin=e.lineOrigin),e.taperedEdge!==void 0&&(q.taperedEdge=e.taperedEdge),e.lineWidthTaper!==void 0&&(q.lineWidthTaper=Math.max(.1,Math.min(1,e.lineWidthTaper))),e.uniformLineWidth!==void 0&&(q.uniformLineWidth=e.uniformLineWidth),e.elbowRadius!==void 0&&(q.elbowRadius=Math.max(2,Math.min(40,e.elbowRadius))),e.showOrderBadge!==void 0&&(q.showOrderBadge=e.showOrderBadge),e.canvasBg!==void 0&&(q.canvasBg=e.canvasBg),e.branchGap!==void 0&&(q.branchGap=Math.max(0,Math.min(80,e.branchGap))),e.layoutMode!==void 0&&q.layoutMode!==e.layoutMode&&(q.layoutMode=e.layoutMode,K(),o(()=>ri()))},getSettings:()=>({autoBalanceOnChange:q.autoBalanceOnChange,lineWidthStart:q.lineWidthStart,lineWidthEnd:q.lineWidthEnd,rainbowBranch:q.rainbowBranch,branchPaletteId:q.branchPaletteId,customPalettes:q.customPalettes,lineStyle:q.lineStyle,rootLineStyle:q.rootLineStyle,lineOrigin:q.lineOrigin,layoutMode:q.layoutMode,taperedEdge:q.taperedEdge,lineWidthTaper:q.lineWidthTaper,uniformLineWidth:q.uniformLineWidth,elbowRadius:q.elbowRadius,showOrderBadge:q.showOrderBadge,canvasBg:q.canvasBg,branchGap:q.branchGap}),setBranchPalette:e=>{e&&[...Le,...q.customPalettes].find(t=>t.id===e)&&(q.branchPaletteId=e)},getBranchPalette:()=>q.branchPaletteId,getBranchPalettes:()=>[...Le,...q.customPalettes],getSearchResults:()=>[...fi.value],getSearchIndex:()=>pi.value,addRelation:(e,t)=>Ir(e,t),removeRelation:e=>Lr(e),updateRelation:(e,t)=>Rr(e,t),getRelations:()=>H(T.value.relations??[])}),C(()=>i.data,e=>{T.value=H(e),K()},{deep:!1}),ee(()=>{G(),o(()=>ri())});let Li={props:i,emit:s,wrapperRef:c,editingId:l,editText:u,selectedIds:d,selectedId:f,collapsedIds:p,canvasHovered:m,dragState:h,dragGhostX:g,dragGhostY:_,dropIndicator:v,clipboard:y,tooltip:b,richEditingId:S,richEditDraft:w,dataRef:T,richHeights:E,richWidths:D,usingMarkdown:O,get suppressMarkdownEmit(){return k},set suppressMarkdownEmit(e){k=e},showOrderBadge:j,nodeStylesRef:M,nodeStyles:N,applyNodeStyle:te,getNodeStyle:P,getNodeStyleOr:ne,IMG_MIN_W:Cd,IMG_MAX_W:wd,IMG_DEFAULT_W:Td,applyNodeImage:F,removeNodeImage:re,applyNodeImageByUrl:I,clamp:L,readImageFile:se,onPickImage:ce,applyNodeLink:le,removeNodeLink:ue,applyNodeNote:de,removeNodeNote:R,applyNodeRichContent:z,contextMenu:B,canvasMenu:fe,fabPreviewClass:pe,fabOutlineClass:me,onNodeContextMenu:he,closeContextMenu:V,onCanvasContextMenu:ge,closeCanvasMenu:_e,menuOpenSettings:ve,menuOpenData:ye,menuOpenImport:be,_showOutline:xe,_showData:Se,_showMarkdown:Ce,_showNote:we,_showSettings:Te,_noteFocusTick:Ee,_pendingImportMode:De,_outlineCollapsed:Oe,_closeRightDrawers:ke,_selectedNode:je,_currentNodeStyle:Me,_onSettingsChange:Ne,_onNodeStyleChange:Pe,_resetSettings:Fe,_onDataConsumedMode:Ie,_onNoteApply:ze,_onNoteRemove:Be,_onLinkSet:Ve,_onImageSet:He,_onRichSet:Ue,_onOutlineSelect:Je,_onOutlineEdit:nt,_onOutlineAddChild:dt,_onOutlineAddSibling:ft,_onOutlineMove:mt,_toggleCollapse:ht,_onCanvasOutline:vt,menuPickImage:yt,menuSetLink:bt,menuRemoveLink:xt,menuEditNote:St,menuRemoveNote:Et,menuRemoveImage:Dt,menuAddCode:Ot,menuRemoveCode:kt,menuAddTable:At,menuRemoveTable:jt,menuAddRelation:Nt,emitEditNote:Pt,notePreview:It,onPaste:Lt,onGlobalKeydown:Rt,resizeState:zt,resizingId:Bt,onResizeStart:Vt,onResizeMove:Ht,onResizeEnd:Ut,hoveredId:Wt,get suppressNextCanvasClick(){return Gt},set suppressNextCanvasClick(e){Gt=e},get suppressNextNodeClick(){return Kt},set suppressNextNodeClick(e){Kt=e},onNodeMouseEnter:Jt,onNodeMouseLeave:Yt,onNodeTextHover:Xt,isNodeInteractive:Zt,layoutVersion:Qt,balanced:$t,history:en,record:G,applyData:tn,triggerRef:K,measureRichBodies:nn,theme:rn,effectiveBg:an,settings:q,edgeLineStyle:on,lineWidthForDepth:sn,endWidthForDepth:cn,taperedParentWidth:ln,continuousWidth:un,cubicAt:dn,quadAt:fn,variableWidthPath:pn,lrRootChildren:mn,RAINBOW_FALLBACK:hn,activePalette:gn,branchColor:_n,lineColorFor:vn,nodeBg:yn,nodeFg:xn,nodeBorder:Sn,nodeFontWeight:Cn,nodeFontSize:wn,hexWithAlpha:Tn,darken:En,panZoom:J,layoutResult:Dn,allNodesComputed:On,allNodes:kn,edges:An,viewBox:jn,applyCollapse:Mn,startEdit:Nn,commitEdit:Pn,cancelEdit:Fn,autoresizeEditEl:In,autoresizeEdit:Ln,startRichEdit:Rn,commitRichEdit:zn,cancelRichEdit:Bn,onRichEditKeydown:Vn,onEditKeydown:Hn,doAddChild:Un,doAddSibling:Wn,doAddSiblingBefore:Gn,doDuplicate:Kn,clipboardableIds:qn,preorderIds:Jn,writeSystemClipboard:Yn,outlineClipboardText:Xn,doCopy:Zn,doCut:$n,doPaste:er,doUndo:tr,doRedo:nr,emitSelection:Y,doNavigate:rr,listLines:ir,paragraphText:ar,doRemove:or,toggleCollapse:sr,walkTreeDepth:cr,collapseAll:ur,expandToLevel:dr,expandAll:fr,doSetText:pr,doMove:mr,doMoveSibling:hr,onNodeClick:gr,getNodeAtPointer:_r,get pendingDrag(){return vr},set pendingDrag(e){vr=e},DRAG_THRESHOLD:Ed,onNodePointerDown:yr,onDragPointerMove:br,computeDropPosition:xr,isLeftSideRootChild:Sr,onDragPointerUp:Cr,selectedRelationId:wr,relationMode:Tr,relationDrag:Er,relationEditingId:Dr,relationEditText:Or,perimeterPoint:kr,rectRayPoint:Ar,perimeterParam:jr,relationEndpoint:Mr,arrowHeadPath:Nr,relationGeoms:Pr,editingRelationGeom:Fr,doAddRelation:Ir,doRemoveRelation:Lr,doUpdateRelation:Rr,startRelationMode:zr,onRelationToolbarClick:Br,onRelationClick:Vr,onRelationHandlePointerDown:Hr,onRelationHandleMove:Ur,onRelationHandleUp:Wr,startRelationLabelEdit:Gr,commitRelationLabel:Kr,subtreeIds:qr,get lastPanWasRightButton(){return Jr},set lastPanWasRightButton(e){Jr=e},onCanvasMouseDown:Yr,onCanvasClick:Xr,onMarqueeEnd:Zr,isCollapsed:Qr,nodeHasChildren:$r,collapsedChildCount:ei,siblingIndexOf:ti,lineAnchor:ni,resetView:ri,runBalance:ii,setLayoutMode:ai,exportData:oi,nodeHasContent:si,importData:ci,importFromFile:li,exportToFile:ui,searchQuery:di,searchResults:fi,searchIndex:pi,performSearch:mi,searchNext:hi,searchPrev:gi,clearSearch:_i,isSearchHit:vi,isCurrentSearchHit:yi,isSearchDimmed:bi,expandAncestorsOfMatches:xi,centerOnMatch:Si,applyNodeMarker:Ci,removeNodeMarkerData:wi,toggleNodeMarkerData:Ti,getNodeMarkersData:Ei,hasNodeMarker:Di,menuToggleMarker:Oi,menuClearMarkers:ki,setNodeTagsData:Ai,getNodeTagsData:ji,menuAddTag:Mi,menuRemoveTags:Ni,buildExportSVG:Pi,exportSVGFile:Fi,exportPNGFile:Ii,Icon:ie,get addNodeIcon(){return ae},get addSubNodeIcon(){return oe},get findNode(){return U},NodeContextMenu:Mt,CanvasContextMenu:Ft,Drawer:qt,Outline:bn,DataPanel:Qn,MarkdownPanel:lr,SettingsPanel:oa,NotePanel:Sd,get codeLang(){return js},get highlightCode(){return Ms},get stripCodeFence(){return As},get tableRows(){return Ns},get markerSvg(){return Ct},get markerLabel(){return wt},get tagColor(){return Tt}};return Object.defineProperty(Li,"__isScriptSetup",{enumerable:!1,value:!0}),Li}}),Od=[`viewBox`,`width`,`height`],kd={class:`zm-edges`},Ad=[`d`,`fill`],jd={class:`zm-relations`},Md=[`d`,`onClick`,`onDblclick`],Nd=[`d`],Pd=[`d`],Fd=[`d`],Id=[`x`,`y`,`onClick`,`onDblclick`],Ld=[`x1`,`y1`,`x2`,`y2`],Rd=[`x1`,`y1`,`x2`,`y2`],zd=[`cx`,`cy`,`r`,`onPointerdown`],Bd=[`cx`,`cy`,`r`,`onPointerdown`],Vd=[`x`,`y`,`width`,`height`,`onPointerdown`],Hd=[`x`,`y`,`width`,`height`,`onPointerdown`],Ud=[`cx`,`cy`,`r`,`onPointerdown`],Wd=[`cx`,`cy`,`r`,`onPointerdown`],Gd=[`x`,`y`,`width`,`height`,`onPointerdown`],Kd=[`x`,`y`,`width`,`height`,`onPointerdown`],qd=[`data-node-id`,`onClick`,`onPointerdown`,`onDblclick`,`onContextmenu`,`onMouseenter`,`onMouseleave`],Jd=[`src`,`width`,`height`,`alt`],Yd=[`onDblclick`],Xd={key:0,class:`zm-rich-code`},Zd=[`innerHTML`],Qd={key:1,class:`zm-rich-table`},$d={key:2,class:`zm-text`},ef={key:0,class:`zm-node-markers`},tf=[`title`,`innerHTML`],nf={class:`zm-text-label`},rf=[`href`,`title`],af=[`title`,`onClick`],of={key:4,class:`zm-node-tags`},sf=[`title`],cf=[`title`,`onClick`],lf=[`onClick`],uf=[`onMousedown`],df=[`onClick`],ff=[`onKeydown`],pf=[`title`],mf=[`src`],hf=[`src`];function gf(e,t,n,a,o,u){var d,f,m;return g(),r(`div`,{class:`zm-mindmap`,style:s({background:a.effectiveBg,fontSize:a.theme.fontSize+`px`})},[j(`div`,{ref:`wrapperRef`,class:c([`zm-canvas`,{"is-relation-mode":!!a.relationMode}]),onMousedown:a.onCanvasMouseDown,onContextmenu:a.onCanvasContextMenu,onWheel:t[30]||=(...e)=>a.panZoom.onWheel&&a.panZoom.onWheel(...e),onMouseenter:t[31]||=e=>a.canvasHovered=!0,onMouseleave:t[32]||=e=>a.canvasHovered=!1,onClick:a.onCanvasClick},[i(` SVG layer: positioned in world coords (vbX, vbY) scaled by\r
|
|
177
177
|
panZoom.scale and offset by panZoom.offsetX/Y. This MUST\r
|
|
178
178
|
match the .zm-world's translate+scale exactly so that\r
|
|
179
179
|
SVG edges line up with the DOM node rectangles — without\r
|
|
180
180
|
this alignment, edges and nodes drift apart at any zoom\r
|
|
181
181
|
≠ 1 (the SVG's viewBox-internal (0,0) corresponds to\r
|
|
182
182
|
(vbX, vbY) in world space, so the SVG element's CSS left\r
|
|
183
|
-
is vbX*scale + panX, not panX). `),j(`div`,{class:`zm-svg-layer`,style:
|
|
183
|
+
is vbX*scale + panX, not panX). `),j(`div`,{class:`zm-svg-layer`,style:s({left:a.layoutResult.vbX*a.panZoom.scale.value+a.panZoom.offsetX.value+`px`,top:a.layoutResult.vbY*a.panZoom.scale.value+a.panZoom.offsetY.value+`px`,width:a.layoutResult.vbW*a.panZoom.scale.value+`px`,height:a.layoutResult.vbH*a.panZoom.scale.value+`px`})},[(g(),r(`svg`,{class:`zm-svg`,viewBox:a.viewBox,preserveAspectRatio:`xMinYMin meet`,width:a.layoutResult.vbW*a.panZoom.scale.value,height:a.layoutResult.vbH*a.panZoom.scale.value},[j(`g`,kd,[(g(!0),r(M,null,_(a.edges,e=>(g(),r(`path`,{key:e.key,d:a.variableWidthPath(a.lineAnchor(e.from,`out`,e.to.side,e.to),a.lineAnchor(e.to,`in`),a.lineWidthForDepth(e.from.depth),a.endWidthForDepth(e.to.depth),32,a.edgeLineStyle(e.from.isRoot),e.to._dir),fill:a.lineColorFor(e.from,e.to),stroke:`none`},null,8,Ad))),128))]),i(` Relationship lines ("联系") — dashed curves between\r
|
|
184
184
|
arbitrary node pairs. Rendered above the tree edges\r
|
|
185
185
|
but under the DOM nodes (the .zm-world layer comes\r
|
|
186
186
|
after this SVG). The .zm-svg-layer is\r
|
|
187
187
|
pointer-events:none, so interactive children opt back\r
|
|
188
|
-
in via their own pointer-events CSS. `),j(`g`,jd,[(
|
|
189
|
-
easy to click. `),j(`path`,{class:`zm-relation-hit`,d:e.d,onClick:t=>a.onRelationClick(t,e.rel.id),onDblclick:t=>{t.stopPropagation(),a.startRelationLabelEdit(e.rel.id)}},null,40,Md),j(`path`,{class:
|
|
188
|
+
in via their own pointer-events CSS. `),j(`g`,jd,[(g(!0),r(M,null,_(a.relationGeoms,e=>(g(),r(M,{key:e.rel.id},[i(` Fat invisible hit path so the thin dashed line is\r
|
|
189
|
+
easy to click. `),j(`path`,{class:`zm-relation-hit`,d:e.d,onClick:t=>a.onRelationClick(t,e.rel.id),onDblclick:t=>{t.stopPropagation(),a.startRelationLabelEdit(e.rel.id)}},null,40,Md),j(`path`,{class:c([`zm-relation-path`,{"is-selected":a.selectedRelationId===e.rel.id}]),d:e.d},null,10,Nd),i(` Arrowheads (default: one at the target end). `),e.arrowEnd?(g(),r(`path`,{key:0,class:c([`zm-relation-arrow`,{"is-selected":a.selectedRelationId===e.rel.id}]),d:e.arrowEnd},null,10,Pd)):i(`v-if`,!0),e.arrowStart?(g(),r(`path`,{key:1,class:c([`zm-relation-arrow`,{"is-selected":a.selectedRelationId===e.rel.id}]),d:e.arrowStart},null,10,Fd)):i(`v-if`,!0),e.rel.label&&a.relationEditingId!==e.rel.id?(g(),r(`text`,{key:2,class:`zm-relation-label`,x:e.labelPos.x,y:e.labelPos.y-6,"text-anchor":`middle`,onClick:t=>a.onRelationClick(t,e.rel.id),onDblclick:t=>{t.stopPropagation(),a.startRelationLabelEdit(e.rel.id)}},p(e.rel.label),41,Id)):i(`v-if`,!0),i(` Selection handles: 2 endpoint anchors (circles,\r
|
|
190
190
|
drag along the node edge or drop onto another\r
|
|
191
191
|
node to re-attach) + 2 bezier control points\r
|
|
192
|
-
(squares, free drag). `),a.selectedRelationId===e.rel.id&&!a.props.previewMode?(
|
|
192
|
+
(squares, free drag). `),a.selectedRelationId===e.rel.id&&!a.props.previewMode?(g(),r(M,{key:3},[j(`line`,{class:`zm-relation-guide`,x1:e.from.x,y1:e.from.y,x2:e.c1.x,y2:e.c1.y},null,8,Ld),j(`line`,{class:`zm-relation-guide`,x1:e.to.x,y1:e.to.y,x2:e.c2.x,y2:e.c2.y},null,8,Rd),j(`circle`,{class:`zm-relation-handle-hit`,cx:e.from.x,cy:e.from.y,r:14/a.panZoom.scale.value,onPointerdown:t=>a.onRelationHandlePointerDown(t,e.rel.id,`from`)},null,40,zd),j(`circle`,{class:`zm-relation-handle-hit`,cx:e.to.x,cy:e.to.y,r:14/a.panZoom.scale.value,onPointerdown:t=>a.onRelationHandlePointerDown(t,e.rel.id,`to`)},null,40,Bd),j(`rect`,{class:`zm-relation-handle-hit`,x:e.c1.x-12/a.panZoom.scale.value,y:e.c1.y-12/a.panZoom.scale.value,width:24/a.panZoom.scale.value,height:24/a.panZoom.scale.value,onPointerdown:t=>a.onRelationHandlePointerDown(t,e.rel.id,`c1`)},null,40,Vd),j(`rect`,{class:`zm-relation-handle-hit`,x:e.c2.x-12/a.panZoom.scale.value,y:e.c2.y-12/a.panZoom.scale.value,width:24/a.panZoom.scale.value,height:24/a.panZoom.scale.value,onPointerdown:t=>a.onRelationHandlePointerDown(t,e.rel.id,`c2`)},null,40,Hd),j(`circle`,{class:`zm-relation-handle zm-relation-handle-endpoint`,cx:e.from.x,cy:e.from.y,r:6/a.panZoom.scale.value,onPointerdown:t=>a.onRelationHandlePointerDown(t,e.rel.id,`from`)},null,40,Ud),j(`circle`,{class:`zm-relation-handle zm-relation-handle-endpoint`,cx:e.to.x,cy:e.to.y,r:6/a.panZoom.scale.value,onPointerdown:t=>a.onRelationHandlePointerDown(t,e.rel.id,`to`)},null,40,Wd),j(`rect`,{class:`zm-relation-handle zm-relation-handle-ctrl`,x:e.c1.x-5/a.panZoom.scale.value,y:e.c1.y-5/a.panZoom.scale.value,width:10/a.panZoom.scale.value,height:10/a.panZoom.scale.value,onPointerdown:t=>a.onRelationHandlePointerDown(t,e.rel.id,`c1`)},null,40,Gd),j(`rect`,{class:`zm-relation-handle zm-relation-handle-ctrl`,x:e.c2.x-5/a.panZoom.scale.value,y:e.c2.y-5/a.panZoom.scale.value,width:10/a.panZoom.scale.value,height:10/a.panZoom.scale.value,onPointerdown:t=>a.onRelationHandlePointerDown(t,e.rel.id,`c2`)},null,40,Kd)],64)):i(`v-if`,!0)],64))),128))])],8,Od))],4),i(` Marquee rectangle: shown when the user is dragging on\r
|
|
193
193
|
the empty canvas. Positioned in screen-space (does NOT\r
|
|
194
194
|
follow the world transform) so it tracks the pointer\r
|
|
195
|
-
1:1 regardless of zoom or pan. `),a.panZoom.isMarquee.value?(
|
|
196
|
-
canvas so it stays visually consistent as the user zooms. `),a.dragState?(
|
|
195
|
+
1:1 regardless of zoom or pan. `),a.panZoom.isMarquee.value?(g(),r(`div`,{key:0,class:`zm-marquee`,style:s({left:a.panZoom.marquee.x*a.panZoom.scale.value+a.panZoom.offsetX.value+`px`,top:a.panZoom.marquee.y*a.panZoom.scale.value+a.panZoom.offsetY.value+`px`,width:a.panZoom.marquee.width*a.panZoom.scale.value+`px`,height:a.panZoom.marquee.height*a.panZoom.scale.value+`px`})},null,4)):i(`v-if`,!0),i(` Drag ghost — follows the pointer, scaled to match the\r
|
|
196
|
+
canvas so it stays visually consistent as the user zooms. `),a.dragState?(g(),r(`div`,{key:1,class:`zm-drag-ghost`,style:s({left:a.dragGhostX+`px`,top:a.dragGhostY+`px`,transform:`scale(${a.panZoom.scale.value})`,transformOrigin:`top left`})},p(a.dragState.srcText),5)):i(`v-if`,!0),j(`div`,{class:`zm-world`,style:s({transform:`translate(${a.panZoom.offsetX.value}px, ${a.panZoom.offsetY.value}px) scale(${a.panZoom.scale.value})`})},[i(` Drop indicator: a coloured line shown on the edge of the\r
|
|
197
197
|
target node when the user is hovering for a before/after\r
|
|
198
198
|
(sibling) insert. Rendered in world coordinates so it\r
|
|
199
|
-
tracks the layout naturally through pan/zoom. `),a.dropIndicator?(
|
|
199
|
+
tracks the layout naturally through pan/zoom. `),a.dropIndicator?(g(),r(`div`,{key:0,class:`zm-drop-indicator`,style:s({left:a.dropIndicator.x1+`px`,top:a.dropIndicator.y1+`px`,width:a.dropIndicator.horizontal?a.dropIndicator.x2-a.dropIndicator.x1+`px`:`3px`,height:a.dropIndicator.horizontal?`3px`:a.dropIndicator.y2-a.dropIndicator.y1+`px`,transform:a.dropIndicator.horizontal?`translateY(-1.5px)`:`translateX(-1.5px)`})},null,4)):i(`v-if`,!0),(g(!0),r(M,null,_(a.allNodes,e=>(g(),r(`div`,{key:e.id,class:c([`zm-node`,{"is-root":e.isRoot,"is-selected":a.selectedId===e.id,"is-selected-secondary":a.selectedId!==e.id&&a.selectedIds.has(e.id),"is-editing":a.editingId===e.id,"has-image":!!e.image,"is-resizing":a.resizingId===e.id,"is-dragging-source":a.dragState?.srcId===e.id,"is-drop-target":a.dragState?.currentTargetId===e.id&&a.dragState?.dropPosition===`child`,"is-drop-target-before":a.dragState?.currentTargetId===e.id&&a.dragState?.dropPosition===`before`,"is-drop-target-after":a.dragState?.currentTargetId===e.id&&a.dragState?.dropPosition===`after`,"is-search-hit":a.isSearchHit(e.id),"is-search-current":a.isCurrentSearchHit(e.id),"is-search-dimmed":a.isSearchDimmed(e.id),"is-relation-source":a.relationMode?.fromId===e.id,"is-relation-target":a.relationDrag!==null&&(a.relationDrag.end===`from`||a.relationDrag.end===`to`)&&a.relationDrag.hoverNodeId===e.id}]),"data-node-id":e.id,style:s({left:e.x+`px`,top:e.y+`px`,width:e.width+`px`,minWidth:e.width+`px`,height:e.height+`px`,fontSize:a.nodeFontSize(e)+`px`,background:a.nodeBg(e),color:a.nodeFg(e),borderColor:a.nodeBorder(e),fontWeight:a.nodeFontWeight(e),transform:`translate(-50%, -50%)`}),onClick:t=>a.onNodeClick(t,e),onPointerdown:t=>a.onNodePointerDown(t,e),onDblclick:t=>{t.stopPropagation(),n.previewMode||a.startEdit(e.id)},onContextmenu:t=>a.onNodeContextMenu(t,e),onMouseenter:t=>{a.onNodeMouseEnter(e.id),a.onNodeTextHover(t,e)},onMouseleave:t=>a.onNodeMouseLeave(e.id)},[e.image?(g(),r(`img`,{key:0,class:`zm-node-img`,src:e.image.src,width:e.image.width,height:e.image.height,alt:e.text,draggable:`false`},null,8,Jd)):i(`v-if`,!0),i(`\r
|
|
200
200
|
Rich body (code / table only): produced by hand-built\r
|
|
201
201
|
trees (the \`#rich\` sample in the demo) or by\r
|
|
202
202
|
\`markdownToRichMindMap\`. Rendered as a small framed\r
|
|
@@ -209,21 +209,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
209
209
|
Pointer events are disabled on the body so clicks\r
|
|
210
210
|
fall through to the node (lets the user dblclick\r
|
|
211
211
|
to edit).\r
|
|
212
|
-
`),e.richContent&&(e.richContent.kind===`code`||e.richContent.kind===`table`)&&a.editingId!==e.id?(
|
|
212
|
+
`),e.richContent&&(e.richContent.kind===`code`||e.richContent.kind===`table`)&&a.editingId!==e.id?(g(),r(`div`,{key:1,class:c([`zm-rich zm-rich-above`,{"zm-rich-no-overflow":e.richContent.kind===`table`||e.richContent.kind===`code`}]),onClick:t[1]||=k(()=>{},[`stop`]),onDblclick:k(t=>a.startRichEdit(e.id),[`stop`]),onMousedown:t[2]||=k(()=>{},[`stop`])},[i(` Edit mode: textarea overlays the preview, same size. `),a.richEditingId===e.id?O((g(),r(`textarea`,{key:0,"onUpdate:modelValue":t[0]||=e=>a.richEditDraft=e,class:`zm-rich-edit`,spellcheck:`false`,onBlur:a.commitRichEdit,onKeydown:a.onRichEditKeydown},null,544)),[[S,a.richEditDraft]]):(g(),r(M,{key:1},[e.richContent.kind===`code`?(g(),r(`pre`,Xd,[j(`code`,{innerHTML:a.highlightCode(a.stripCodeFence(e.richContent.raw),a.codeLang(e.richContent.raw))},null,8,Zd)])):e.richContent.kind===`table`?(g(),r(`table`,Qd,[j(`tbody`,null,[(g(!0),r(M,null,_(a.tableRows(e.richContent.raw),(e,t)=>(g(),r(`tr`,{key:t},[t===0?(g(!0),r(M,{key:0},_(e,(e,t)=>(g(),r(`th`,{key:`h${t}`},p(e),1))),128)):(g(!0),r(M,{key:1},_(e,(e,t)=>(g(),r(`td`,{key:`c${t}`},p(e),1))),128))]))),128))])])):i(`v-if`,!0)],64))],42,Yd)):i(`v-if`,!0),a.editingId===e.id?O((g(),r(`textarea`,{key:3,class:`zm-input`,"onUpdate:modelValue":t[6]||=e=>a.editText=e,autofocus:``,rows:`1`,onBlur:t[7]||=e=>a.commitEdit(),onKeydown:[t[8]||=v(k(e=>a.commitEdit(),[`exact`,`prevent`]),[`enter`]),t[9]||=v(k(e=>a.commitEdit(),[`prevent`]),[`tab`]),v(a.cancelEdit,[`esc`]),a.onEditKeydown],onInput:a.autoresizeEdit,onMousedown:t[10]||=k(()=>{},[`stop`]),onClick:t[11]||=k(()=>{},[`stop`])},null,544)),[[S,a.editText]]):(g(),r(`span`,$d,[e.markers&&e.markers.length>0?(g(),r(`span`,ef,[(g(!0),r(M,null,_(e.markers,e=>(g(),r(`span`,{key:e,class:`zm-node-marker`,title:a.markerLabel(e),innerHTML:`<svg viewBox="0 0 24 24" width="14" height="14">`+a.markerSvg(e)+`</svg>`},null,8,tf))),128))])):i(`v-if`,!0),j(`span`,nf,p(e.text),1),e.link&&a.editingId!==e.id?(g(),r(`a`,{key:1,class:`zm-node-link`,href:e.link.url,target:`_blank`,rel:`noopener noreferrer`,title:`打开链接:${e.link.url}`,onClick:t[3]||=k(()=>{},[`stop`]),onMousedown:t[4]||=k(()=>{},[`stop`])},[l(a.Icon,{name:`link`,size:11,stroke:2})],40,rf)):i(`v-if`,!0),e.note&&a.editingId!==e.id?(g(),r(`button`,{key:2,class:`zm-node-note-btn`,type:`button`,title:a.notePreview(e.note.text),onClick:k(t=>a.emitEditNote(e.id),[`stop`]),onMousedown:t[5]||=k(()=>{},[`stop`])},[l(a.Icon,{name:`note`,size:11,stroke:2})],40,af)):i(`v-if`,!0)])),i(` Tags — small colored pills below the title. `),e.tags&&e.tags.length>0&&a.editingId!==e.id?(g(),r(`div`,of,[(g(!0),r(M,null,_(e.tags,e=>(g(),r(`span`,{key:e,class:`zm-node-tag`,style:s(a.tagColor(e))},p(e),5))),128))])):i(`v-if`,!0),a.showOrderBadge?(g(),r(`span`,{key:5,class:`zm-order-badge`,title:`数据顺序:第 ${a.siblingIndexOf(e.id)+1} 个`},p(a.siblingIndexOf(e.id)+1),9,sf)):i(`v-if`,!0),a.isCollapsed(e.id)&&a.collapsedChildCount(e.id)>0?(g(),r(`span`,{key:6,class:c([`zm-collapse-badge`,{"is-on-left":e.side===-1}]),style:s({background:a.branchColor.get(e.id)??`#64748b`}),title:`展开 ${a.collapsedChildCount(e.id)} 个子节点`,onMousedown:t[12]||=k(()=>{},[`stop`]),onClick:k(t=>a.toggleCollapse(e.id),[`stop`])},p(a.collapsedChildCount(e.id)),47,cf)):i(`v-if`,!0),a.nodeHasChildren(e)&&!a.isCollapsed(e.id)?(g(),r(`button`,{key:7,class:c([`zm-btn zm-collapse`,{"is-on-left":e.side===-1}]),style:s({"--zm-collapse-color":a.branchColor.get(e.id)??`#64748b`}),title:`折叠`,onMousedown:t[13]||=k(()=>{},[`stop`]),onClick:k(t=>a.toggleCollapse(e.id),[`stop`])},[...t[40]||=[j(`span`,{class:`zm-collapse-bar`},null,-1)]],46,lf)):i(`v-if`,!0),i(` Resize handle — bottom-right corner of the node,\r
|
|
213
213
|
only on selected image-bearing nodes. Drag to\r
|
|
214
214
|
scale the image. Inline handlers update the DOM\r
|
|
215
215
|
directly for drag-time fluidity; mouseup commits\r
|
|
216
|
-
the new size to the data tree. `),e.image&&a.selectedId===e.id&&a.editingId!==e.id?(
|
|
216
|
+
the new size to the data tree. `),e.image&&a.selectedId===e.id&&a.editingId!==e.id?(g(),r(`span`,{key:8,class:`zm-img-resize-handle`,title:`拖动调整图片大小`,onMousedown:k(t=>a.onResizeStart(t,e),[`stop`])},null,40,uf)):i(`v-if`,!0),i(` "Remove image" button — top-right corner. `),e.image&&a.selectedId===e.id&&a.editingId!==e.id?(g(),r(`button`,{key:9,class:`zm-img-remove-btn`,title:`移除图片`,onMousedown:t[14]||=k(()=>{},[`stop`]),onClick:k(t=>a.removeNodeImage(e.id),[`stop`])},[l(a.Icon,{name:`x`,size:10,stroke:2.2})],40,df)):i(`v-if`,!0)],46,qd))),128)),i(` Relationship-label inline editor — floats at the\r
|
|
217
217
|
curve midpoint (world coords, so it rides the pan/zoom\r
|
|
218
|
-
transform). Enter / blur commits, Esc cancels. `),a.editingRelationGeom?
|
|
218
|
+
transform). Enter / blur commits, Esc cancels. `),a.editingRelationGeom?O((g(),r(`input`,{key:1,"onUpdate:modelValue":t[15]||=e=>a.relationEditText=e,class:`zm-relation-label-input`,placeholder:`联系`,style:s({left:a.editingRelationGeom.labelPos.x+`px`,top:a.editingRelationGeom.labelPos.y+`px`}),onBlur:a.commitRelationLabel,onKeydown:[v(k(a.commitRelationLabel,[`prevent`]),[`enter`]),t[16]||=v(e=>a.relationEditingId=null,[`esc`])],onMousedown:t[17]||=k(()=>{},[`stop`]),onClick:t[18]||=k(()=>{},[`stop`])},null,44,ff)),[[S,a.relationEditText]]):i(`v-if`,!0)],4),i(` Floating tooltip for truncated node labels. Renders\r
|
|
219
219
|
above the zoom layer so it isn't affected by the\r
|
|
220
220
|
canvas's pan/zoom transform. Position is anchored\r
|
|
221
|
-
to the node's screen rect at hover time. `),a.tooltip?(
|
|
221
|
+
to the node's screen rect at hover time. `),a.tooltip?(g(),r(`div`,{key:2,class:c([`zm-tooltip`,{"is-below":!a.tooltip.above}]),style:s({left:a.tooltip.x+`px`,top:a.tooltip.y+`px`})},p(a.tooltip.text),7)):i(`v-if`,!0),i(` Floating context menu — mounted only while the user is\r
|
|
222
222
|
interacting with it. Container is the canvas so the\r
|
|
223
|
-
menu can clamp itself inside the visible area. `),a.contextMenu?(
|
|
223
|
+
menu can clamp itself inside the visible area. `),a.contextMenu?(g(),h(a.NodeContextMenu,{key:3,x:a.contextMenu.x,y:a.contextMenu.y,container:a.wrapperRef,"has-image":!!((d=a.findNode(a.dataRef,a.contextMenu.nodeId))!=null&&d.image),"has-link":!!((f=a.findNode(a.dataRef,a.contextMenu.nodeId))!=null&&f.link),"has-note":!!((m=a.findNode(a.dataRef,a.contextMenu.nodeId))!=null&&m.note),"has-code":a.findNode(a.dataRef,a.contextMenu.nodeId)?.richContent?.kind===`code`,"has-table":a.findNode(a.dataRef,a.contextMenu.nodeId)?.richContent?.kind===`table`,"node-markers":a.findNode(a.dataRef,a.contextMenu.nodeId)?.markers??[],"node-tags":a.findNode(a.dataRef,a.contextMenu.nodeId)?.tags??[],onPickImage:a.menuPickImage,onRemoveImage:a.menuRemoveImage,onSetLink:a.menuSetLink,onRemoveLink:a.menuRemoveLink,onEditNote:a.menuEditNote,onRemoveNote:a.menuRemoveNote,onAddCode:a.menuAddCode,onEditCode:a.menuAddCode,onRemoveCode:a.menuRemoveCode,onAddTable:a.menuAddTable,onEditTable:a.menuAddTable,onRemoveTable:a.menuRemoveTable,onToggleMarker:a.menuToggleMarker,onClearMarkers:a.menuClearMarkers,onAddTag:a.menuAddTag,onRemoveTags:a.menuRemoveTags,onAddRelation:a.menuAddRelation,onClose:a.closeContextMenu},null,8,[`x`,`y`,`container`,`has-image`,`has-link`,`has-note`,`has-code`,`has-table`,`node-markers`,`node-tags`])):i(`v-if`,!0),i(` Canvas right-click menu -- rendered only while the user is\r
|
|
224
224
|
interacting with it. Container is the canvas so the menu can\r
|
|
225
225
|
clamp itself inside the visible area. Actions re-emit to the\r
|
|
226
|
-
parent (App.vue decides which drawer to open). `),a.canvasMenu?(
|
|
226
|
+
parent (App.vue decides which drawer to open). `),a.canvasMenu?(g(),h(a.CanvasContextMenu,{key:4,x:a.canvasMenu.x,y:a.canvasMenu.y,container:a.wrapperRef,onOpenSettings:a.menuOpenSettings,onOpenData:a.menuOpenData,onOpenImport:a.menuOpenImport,onExportPng:a.exportPNGFile,onExportSvg:a.exportSVGFile,onClose:a.closeCanvasMenu},null,8,[`x`,`y`,`container`])):i(`v-if`,!0),i(` FABs. See fabPreviewClass and fabOutlineClass. `),j(`button`,{class:c(a.fabPreviewClass),title:a.props.previewMode?`退出预览模式`:`进入预览模式`,onClick:t[19]||=e=>a.emit(`canvas-toggle-preview`)},[l(a.Icon,{name:a.props.previewMode?`eye-off`:`eye`,size:16},null,8,[`name`])],10,pf),j(`button`,{class:c(a.fabOutlineClass),title:`显示大纲视图`,onClick:a._onCanvasOutline},[l(a.Icon,{name:`outline`,size:16})],2),i(` Bottom toolbar. Always rendered; the parent's previewMode\r
|
|
227
227
|
+ canvasHovered refs drive visibility:\r
|
|
228
228
|
- non-preview: toolbar always visible\r
|
|
229
229
|
- preview: toolbar fades in on canvas hover, fades\r
|
|
@@ -241,9 +241,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
241
241
|
inside .zm-canvas means the cursor is technically still\r
|
|
242
242
|
inside the canvas while it's on the toolbar (because\r
|
|
243
243
|
mouseenter/mouseleave don't fire when moving between\r
|
|
244
|
-
parent and child). `),j(`div`,{class:
|
|
244
|
+
parent and child). `),j(`div`,{class:c([`zm-toolbar`,{"is-preview-only":a.props.previewMode,"is-hovered":a.canvasHovered}])},[i(` 缩放比例 + 放大 / 缩小 / 重置视图: always visible, also\r
|
|
245
245
|
show in preview mode (the canvas still needs to be\r
|
|
246
|
-
navigable in preview). `),j(`span`,{class:`zm-tb-tip zm-tb-zoom`,title:`点击重置为 100%`,onClick:t[20]||=e=>a.panZoom.zoomTo100()},
|
|
246
|
+
navigable in preview). `),j(`span`,{class:`zm-tb-tip zm-tb-zoom`,title:`点击重置为 100%`,onClick:t[20]||=e=>a.panZoom.zoomTo100()},p(Math.round(a.panZoom.scale.value*100))+`%`,1),j(`button`,{class:`zm-tb-btn`,title:`放大`,onClick:t[21]||=(...e)=>a.panZoom.zoomIn&&a.panZoom.zoomIn(...e)},[l(a.Icon,{name:`zoom-in`})]),j(`button`,{class:`zm-tb-btn`,title:`缩小`,onClick:t[22]||=(...e)=>a.panZoom.zoomOut&&a.panZoom.zoomOut(...e)},[l(a.Icon,{name:`zoom-out`})]),j(`button`,{class:`zm-tb-btn`,title:`重置视图`,onClick:a.resetView},[l(a.Icon,{name:`reset`})]),t[43]||=j(`span`,{class:`zm-tb-divider`},null,-1),i(` Bulk expand/collapse: safe in preview mode (it's a view\r
|
|
247
247
|
operation, not an edit). Each button has its own glyph\r
|
|
248
248
|
so they're visually distinct, not three identical\r
|
|
249
249
|
right-chevrons:\r
|
|
@@ -251,7 +251,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
251
251
|
展开一级 → 1 root + 3 children (2-level tree)\r
|
|
252
252
|
展开二级 → 1 root + 3 children + 6 grandchildren\r
|
|
253
253
|
全部展开 → 4 chevrons pointing outward (expand) `),j(`button`,{class:`zm-tb-btn`,title:`全部收起`,onClick:a.collapseAll},[l(a.Icon,{name:`collapse-all`})]),j(`button`,{class:`zm-tb-btn`,title:`展开一级`,onClick:t[23]||=e=>a.expandToLevel(1)},[l(a.Icon,{name:`expand-level-1`})]),j(`button`,{class:`zm-tb-btn`,title:`展开二级`,onClick:t[24]||=e=>a.expandToLevel(2)},[l(a.Icon,{name:`expand-level-2`})]),j(`button`,{class:`zm-tb-btn`,title:`全部展开`,onClick:a.expandAll},[l(a.Icon,{name:`expand-all`})]),i(` <span class="zm-tb-divider" /> `),i(` Non-preview-only: edit + layout. Import/export live in\r
|
|
254
|
-
the right-click context menu so the toolbar stays clean. `),a.props.previewMode?i(`v-if`,!0):(
|
|
254
|
+
the right-click context menu so the toolbar stays clean. `),a.props.previewMode?i(`v-if`,!0):(g(),r(M,{key:0},[t[41]||=j(`span`,{class:`zm-tb-divider`},null,-1),j(`button`,{class:`zm-tb-btn`,title:`添加子节点 (Tab)`,onClick:t[25]||=e=>a.selectedId&&a.doAddChild(a.selectedId)},[j(`img`,{src:a.addSubNodeIcon,width:`14`,height:`14`,alt:`添加子节点`,draggable:`false`},null,8,mf)]),j(`button`,{class:`zm-tb-btn`,title:`添加同级 (Enter)`,onClick:t[26]||=e=>a.selectedId&&a.doAddSibling(a.selectedId)},[j(`img`,{src:a.addNodeIcon,width:`14`,height:`14`,alt:`添加同级`,draggable:`false`},null,8,hf)]),j(`button`,{class:c([`zm-tb-btn`,{active:!!a.relationMode}]),title:`联系(依次点选两个节点,Esc 取消)`,onClick:a.onRelationToolbarClick},[l(a.Icon,{name:`relation`})],2),t[42]||=j(`span`,{class:`zm-tb-divider`},null,-1),j(`button`,{class:c([`zm-tb-btn`,{active:a.settings.layoutMode===`mindmap`}]),title:`思维导图布局 (中心辐射)`,onClick:t[27]||=e=>a.setLayoutMode(`mindmap`)},[l(a.Icon,{name:`mindmap`})],2),j(`button`,{class:c([`zm-tb-btn`,{active:a.settings.layoutMode===`tree`}]),title:`树形布局 (向右展开)`,onClick:t[28]||=e=>a.setLayoutMode(`tree`)},[l(a.Icon,{name:`tree`})],2),j(`button`,{class:c([`zm-tb-btn`,{active:a.settings.layoutMode===`org`}]),title:`组织结构布局 (向下展开)`,onClick:t[29]||=e=>a.setLayoutMode(`org`)},[l(a.Icon,{name:`org`})],2)],64))],2)],34),i(` Built-in drawers — rendered when \`builtInDrawers\` prop is true.\r
|
|
255
255
|
These mirror the package's App.vue, giving consumers a\r
|
|
256
256
|
zero-config experience: right-click → settings / data / import\r
|
|
257
|
-
just works without wiring up events. `),a.props.builtInDrawers?(
|
|
257
|
+
just works without wiring up events. `),a.props.builtInDrawers?(g(),r(M,{key:0},[i(` Outline (left) `),l(a.Drawer,{side:`left`,scope:`canvas`,width:300,open:a._showOutline&&!n.previewMode,title:`大纲`,"onUpdate:open":t[33]||=e=>a._showOutline=e},{default:E(()=>[l(a.Outline,{data:a.dataRef,"selected-id":a.selectedId,"collapsed-ids":a._outlineCollapsed,"show-index":a.showOrderBadge,onSelect:a._onOutlineSelect,onToggleCollapse:a._toggleCollapse,onEdit:a._onOutlineEdit,onAddChild:a._onOutlineAddChild,onAddSibling:a._onOutlineAddSibling,onMove:a._onOutlineMove},null,8,[`data`,`selected-id`,`collapsed-ids`,`show-index`])]),_:1},8,[`open`]),i(` Data (right) `),l(a.Drawer,{side:`right`,scope:`canvas`,width:360,open:a._showData&&!n.previewMode,title:`数据`,"onUpdate:open":t[35]||=e=>a._showData=e},{default:E(()=>[l(a.DataPanel,{data:a.dataRef,"pending-mode":a._pendingImportMode,onImport:t[34]||=e=>a.dataRef=e,onConsumedMode:a._onDataConsumedMode},null,8,[`data`,`pending-mode`])]),_:1},8,[`open`]),i(` Markdown (right) `),l(a.Drawer,{side:`right`,scope:`canvas`,width:420,open:a._showMarkdown&&!n.previewMode,title:`Markdown`,"onUpdate:open":t[37]||=e=>a._showMarkdown=e},{default:E(()=>[l(a.MarkdownPanel,{data:a.dataRef,onImport:t[36]||=e=>a.dataRef=e},null,8,[`data`])]),_:1},8,[`open`]),i(` Note (right) `),l(a.Drawer,{side:`right`,scope:`canvas`,width:360,open:a._showNote&&!n.previewMode,title:`节点内容`,"onUpdate:open":t[38]||=e=>a._showNote=e},{default:E(()=>[l(a.NotePanel,{"selected-node":a._selectedNode,"focus-tick":a._noteFocusTick,onApply:a._onNoteApply,onRemove:a._onNoteRemove,onSetLink:a._onLinkSet,onSetImage:a._onImageSet,onSetRich:a._onRichSet},null,8,[`selected-node`,`focus-tick`])]),_:1},8,[`open`]),i(` Settings (right) `),l(a.Drawer,{side:`right`,scope:`canvas`,width:340,open:a._showSettings&&!n.previewMode,title:`设置`,"onUpdate:open":t[39]||=e=>a._showSettings=e},{default:E(()=>[l(a.SettingsPanel,{settings:a.settings,"has-selection":a.selectedId!==null,"selected-node-text":a._selectedNode?.text,"node-style":a._currentNodeStyle,"onUpdate:settings":a._onSettingsChange,"onUpdate:nodeStyle":a._onNodeStyleChange,onReset:a._resetSettings},null,8,[`settings`,`has-selection`,`selected-node-text`,`node-style`])]),_:1},8,[`open`])],64)):i(`v-if`,!0)],4)}var _f=F(Dd,[[`render`,gf],[`__file`,`C:/workspace/github_workspace/flow-mindmap/src/components/MindMap.vue`]]);export{lt as n,_f as r,ft as t};
|