mind-elixir 5.1.1 → 5.2.0-beta.1

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.
Files changed (54) hide show
  1. package/LICENSE +21 -21
  2. package/dist/MindElixir.iife.js +9 -10
  3. package/dist/MindElixir.js +835 -836
  4. package/dist/MindElixirLite.iife.js +14 -15
  5. package/dist/MindElixirLite.js +618 -619
  6. package/dist/example.iife.js +7 -2
  7. package/dist/example.js +77 -19
  8. package/dist/style.css +1 -1
  9. package/dist/types/{arrow.d.ts → src/arrow.d.ts} +1 -1
  10. package/dist/types/src/dev.d.ts +1 -0
  11. package/dist/types/src/exampleData/1.d.ts +3 -0
  12. package/dist/types/{index.d.ts → src/index.d.ts} +13 -14
  13. package/dist/types/{methods.d.ts → src/methods.d.ts} +10 -10
  14. package/dist/types/{nodeOperation.d.ts → src/nodeOperation.d.ts} +1 -1
  15. package/dist/types/{plugin → src/plugin}/keypress.d.ts +1 -1
  16. package/dist/types/{summary.d.ts → src/summary.d.ts} +3 -2
  17. package/dist/types/{types → src/types}/dom.d.ts +2 -1
  18. package/dist/types/{types → src/types}/index.d.ts +3 -2
  19. package/dist/types/src/utils/index.d.ts +440 -0
  20. package/dist/types/{utils → src/utils}/pubsub.d.ts +2 -2
  21. package/dist/types/{utils → src/utils}/svg.d.ts +15 -5
  22. package/package.json +107 -105
  23. package/readme.md +432 -432
  24. package/dist/types/dev.d.ts +0 -1
  25. package/dist/types/exampleData/1.d.ts +0 -3
  26. package/dist/types/exampleData/markdown.d.ts +0 -8
  27. package/dist/types/utils/index.d.ts +0 -40
  28. package/dist/types/utils/markdown.d.ts +0 -25
  29. /package/dist/types/{const.d.ts → src/const.d.ts} +0 -0
  30. /package/dist/types/{docs.d.ts → src/docs.d.ts} +0 -0
  31. /package/dist/types/{exampleData → src/exampleData}/1.cn.d.ts +0 -0
  32. /package/dist/types/{exampleData → src/exampleData}/2.d.ts +0 -0
  33. /package/dist/types/{exampleData → src/exampleData}/3.d.ts +0 -0
  34. /package/dist/types/{exampleData → src/exampleData}/htmlText.d.ts +0 -0
  35. /package/dist/types/{i18n.d.ts → src/i18n.d.ts} +0 -0
  36. /package/dist/types/{interact.d.ts → src/interact.d.ts} +0 -0
  37. /package/dist/types/{linkDiv.d.ts → src/linkDiv.d.ts} +0 -0
  38. /package/dist/types/{mouse.d.ts → src/mouse.d.ts} +0 -0
  39. /package/dist/types/{plugin → src/plugin}/contextMenu.d.ts +0 -0
  40. /package/dist/types/{plugin → src/plugin}/exportImage.d.ts +0 -0
  41. /package/dist/types/{plugin → src/plugin}/nodeDraggable.d.ts +0 -0
  42. /package/dist/types/{plugin → src/plugin}/operationHistory.d.ts +0 -0
  43. /package/dist/types/{plugin → src/plugin}/selection.d.ts +0 -0
  44. /package/dist/types/{plugin → src/plugin}/toolBar.d.ts +0 -0
  45. /package/dist/types/{types → src/types}/global.d.ts +0 -0
  46. /package/dist/types/{utils → src/utils}/LinkDragMoveHelper.d.ts +0 -0
  47. /package/dist/types/{utils → src/utils}/dom.d.ts +0 -0
  48. /package/dist/types/{utils → src/utils}/domManipulation.d.ts +0 -0
  49. /package/dist/types/{utils → src/utils}/dragMoveHelper.d.ts +0 -0
  50. /package/dist/types/{utils → src/utils}/generateBranch.d.ts +0 -0
  51. /package/dist/types/{utils → src/utils}/layout-ssr.d.ts +0 -0
  52. /package/dist/types/{utils → src/utils}/layout.d.ts +0 -0
  53. /package/dist/types/{utils → src/utils}/objectManipulation.d.ts +0 -0
  54. /package/dist/types/{utils → src/utils}/theme.d.ts +0 -0
@@ -1,15 +1,14 @@
1
- var MindElixirLite=function(){"use strict";const Ue="",K={name:"Latte",type:"light",palette:["#dd7878","#ea76cb","#8839ef","#e64553","#fe640b","#df8e1d","#40a02b","#209fb5","#1e66f5","#7287fd"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#4c4f69","--root-border-color":"rgba(0, 0, 0, 0)","--main-color":"#444446","--main-bgcolor":"#ffffff","--topic-padding":"3px","--color":"#777777","--bgcolor":"#f6f6f6","--selected":"#4dc4ff","--accent-color":"#e64553","--panel-color":"#444446","--panel-bgcolor":"#ffffff","--panel-border-color":"#eaeaea","--map-padding":"50px"}},J={name:"Dark",type:"dark",palette:["#848FA0","#748BE9","#D2F9FE","#4145A5","#789AFA","#706CF4","#EF987F","#775DD5","#FCEECF","#DA7FBC"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#2d3748","--root-border-color":"rgba(255, 255, 255, 0.1)","--main-color":"#ffffff","--main-bgcolor":"#4c4f69","--topic-padding":"3px","--color":"#cccccc","--bgcolor":"#252526","--selected":"#4dc4ff","--accent-color":"#789AFA","--panel-color":"#ffffff","--panel-bgcolor":"#2d3748","--panel-border-color":"#696969","--map-padding":"50px 80px"}};function Tt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}const I=function(t,e){if(e.id===t)return e;if(e.children&&e.children.length){for(let n=0;n<e.children.length;n++){const o=I(t,e.children[n]);if(o)return o}return null}else return null},Q=(t,e)=>{if(t.parent=e,t.children)for(let n=0;n<t.children.length;n++)Q(t.children[n],t)},Z=(t,e,n)=>{if(t.expanded=e,t.children)if(n===void 0||n>0){const o=n!==void 0?n-1:void 0;t.children.forEach(i=>{Z(i,e,o)})}else t.children.forEach(o=>{Z(o,!1)})};function V(t,e,n,o){const i=o-e,s=t-n;let r=Math.atan(Math.abs(i)/Math.abs(s))/3.14*180;if(isNaN(r))return;s<0&&i>0&&(r=180-r),s<0&&i<0&&(r=180+r),s>0&&i<0&&(r=360-r);const c=12,h=30,f=r+h,u=r-h;return{x1:n+Math.cos(Math.PI*f/180)*c,y1:o-Math.sin(Math.PI*f/180)*c,x2:n+Math.cos(Math.PI*u/180)*c,y2:o-Math.sin(Math.PI*u/180)*c}}function W(){return(new Date().getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const Lt=function(){const t=W();return{topic:this.newTopicName,id:t}},M=(t,e)=>{let n=0,o=0;for(;e&&e!==t;)n+=e.offsetLeft,o+=e.offsetTop,e=e.offsetParent;return{offsetLeft:n,offsetTop:o}},y=(t,e)=>{for(const n in e)t.setAttribute(n,e[n])},st=t=>t?t.tagName==="ME-TPC":!1,rt=t=>{const e=/translate\(([^,]+),\s*([^)]+)\)/,n=t.match(e);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},ct=function(t){for(let e=0;e<t.length;e++){const{dom:n,evt:o,func:i}=t[e];n.addEventListener(o,i)}return function(){for(let n=0;n<t.length;n++){const{dom:o,evt:i,func:s}=t[n];o.removeEventListener(i,s)}}};var D=(t=>(t.LHS="lhs",t.RHS="rhs",t))(D||{});const lt=function(t,e,n){const{scaleVal:o,scaleSensitivity:i}=t;switch(e){case"in":t.scale(o+i,n);break;case"out":t.scale(o-i,n)}};function $t(t){const{dragMoveHelper:e}=t,n=l=>{var g,x,w;if(l.button!==0)return;if((g=t.helper1)!=null&&g.moved){t.helper1.clear();return}if((x=t.helper2)!=null&&x.moved){t.helper2.clear();return}if(e.moved){e.clear();return}const a=l.target;if(a.tagName==="ME-EPD")l.ctrlKey||l.metaKey?t.expandNodeAll(a.previousSibling):t.expandNode(a.previousSibling);else if(a.tagName==="ME-TPC"&&t.currentNodes.length>1)t.selectNode(a);else if(!t.editable)return;const p=(w=a.parentElement)==null?void 0:w.parentElement;p.getAttribute("class")==="topiclinks"?t.selectArrow(a.parentElement):p.getAttribute("class")==="summary"&&t.selectSummary(a.parentElement)},o=l=>{var g;if(!t.editable)return;const a=l.target;st(a)&&t.beginEdit(a);const p=(g=a.parentElement)==null?void 0:g.parentElement;p.getAttribute("class")==="topiclinks"?t.editArrowLabel(a.parentElement):p.getAttribute("class")==="summary"&&t.editSummary(a.parentElement)};let i=0;const s=l=>{if(l.pointerType==="mouse")return;const a=new Date().getTime(),p=a-i;p<300&&p>0&&o(l),i=a},r=l=>{e.moved=!1;const a=t.mouseSelectionButton===0?2:0;if(l.button!==a&&l.pointerType==="mouse")return;e.x=l.clientX,e.y=l.clientY;const p=l.target;p.className!=="circle"&&p.contentEditable!=="plaintext-only"&&(e.mousedown=!0,p.setPointerCapture(l.pointerId))},c=l=>{if(l.target.contentEditable!=="plaintext-only"){const a=l.clientX-e.x,p=l.clientY-e.y;e.onMove(a,p)}e.x=l.clientX,e.y=l.clientY},h=l=>{const a=t.mouseSelectionButton===0?2:0;if(l.button!==a&&l.pointerType==="mouse")return;const p=l.target;p.hasPointerCapture&&p.hasPointerCapture(l.pointerId)&&p.releasePointerCapture(l.pointerId),e.clear()},f=l=>{if(l.preventDefault(),l.button!==2||!t.editable)return;const a=l.target;st(a)&&!a.classList.contains("selected")&&t.selectNode(a),setTimeout(()=>{t.dragMoveHelper.moved||t.bus.fire("showContextMenu",l)},200)},u=l=>{l.stopPropagation(),l.preventDefault(),l.ctrlKey||l.metaKey?l.deltaY<0?lt(t,"in",t.dragMoveHelper):t.scaleVal-t.scaleSensitivity>0&&lt(t,"out",t.dragMoveHelper):l.shiftKey?t.move(-l.deltaY,0):t.move(-l.deltaX,-l.deltaY)},{container:d}=t;return ct([{dom:d,evt:"pointerdown",func:r},{dom:d,evt:"pointermove",func:c},{dom:d,evt:"pointerup",func:h},{dom:d,evt:"pointerup",func:s},{dom:d,evt:"click",func:n},{dom:d,evt:"dblclick",func:o},{dom:d,evt:"contextmenu",func:f},{dom:d,evt:"wheel",func:typeof t.handleWheel=="function"?t.handleWheel:u}])}function At(){return{handlers:{},addListener:function(t,e){this.handlers[t]===void 0&&(this.handlers[t]=[]),this.handlers[t].push(e)},fire:function(t,...e){if(this.handlers[t]instanceof Array){const n=this.handlers[t];for(let o=0;o<n.length;o++)n[o](...e)}},removeListener:function(t,e){if(!this.handlers[t])return;const n=this.handlers[t];if(!e)n.length=0;else if(n.length)for(let o=0;o<n.length;o++)n[o]===e&&this.handlers[t].splice(o,1)}}}const R=document,Mt=function(){this.nodes.innerHTML="";const t=this.createTopic(this.nodeData);ft.call(this,t,this.nodeData),t.draggable=!1;const e=R.createElement("me-root");e.appendChild(t);const n=this.nodeData.children||[];if(this.direction===2){let o=0,i=0;n.map(s=>{s.direction===0?o+=1:s.direction===1?i+=1:o<=i?(s.direction=0,o+=1):(s.direction=1,i+=1)})}Nt(this,n,e)},Nt=function(t,e,n){const o=R.createElement("me-main");o.className=D.LHS;const i=R.createElement("me-main");i.className=D.RHS;for(let s=0;s<e.length;s++){const r=e[s],{grp:c}=t.createWrapper(r);t.direction===2?r.direction===0?o.appendChild(c):i.appendChild(c):t.direction===0?o.appendChild(c):i.appendChild(c)}t.nodes.appendChild(o),t.nodes.appendChild(n),t.nodes.appendChild(i),t.nodes.appendChild(t.lines)},Dt=function(t,e){const n=R.createElement("me-children");for(let o=0;o<e.length;o++){const i=e[o],{grp:s}=t.createWrapper(i);n.appendChild(s)}return n};function at(t,e){return t?e&&tt(t)?e(t):ht(t):""}function tt(t){return t?[/\*\*.*?\*\*/,/\*.*?\*/,/__.*?__/,/_.*?_/,/`.*?`/,/\[.*?\]\(.*?\)/,/!\[.*?\]\(.*?\)/,/^#{1,6}\s/,/^>\s/,/^[*\-+]\s/,/^\d+\.\s/,/```[\s\S]*?```/,/~~.*?~~/].some(n=>n.test(t)):!1}function ht(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}const k=document,dt=function(t,e){const o=(this!=null&&this.el?this.el:e||document).querySelector(`[data-nodeid="me${t}"]`);if(!o)throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);return o},ft=function(t,e){if(t.innerHTML="",e.style){const n=e.style;for(const o in n)t.style[o]=n[o]}if(e.dangerouslySetInnerHTML){t.innerHTML=e.dangerouslySetInnerHTML;return}if(e.image){const n=e.image;if(n.url&&n.width&&n.height){const o=k.createElement("img");o.src=this.imageProxy?this.imageProxy(n.url):n.url,o.style.width=n.width+"px",o.style.height=n.height+"px",n.fit&&(o.style.objectFit=n.fit),t.appendChild(o),t.image=o}}else t.image&&(t.image=void 0);{const n=k.createElement("span");n.className="text",this.markdown&&tt(e.topic)?n.innerHTML=at(e.topic,this.markdown).trim():n.textContent=e.topic,t.appendChild(n),t.text=n}if(e.hyperLink){const n=k.createElement("a");n.className="hyper-link",n.target="_blank",n.innerText="🔗",n.href=e.hyperLink,t.appendChild(n),t.link=n}else t.link&&(t.link=void 0);if(e.icons&&e.icons.length){const n=k.createElement("span");n.className="icons",n.innerHTML=e.icons.map(o=>`<span>${Tt(o)}</span>`).join(""),t.appendChild(n),t.icons=n}else t.icons&&(t.icons=void 0);if(e.tags&&e.tags.length){const n=k.createElement("div");n.className="tags",e.tags.forEach(o=>{const i=k.createElement("span");typeof o=="string"?i.textContent=o:(i.textContent=o.text,o.className&&(i.className=o.className),o.style&&Object.assign(i.style,o.style)),n.appendChild(i)}),t.appendChild(n),t.tags=n}else t.tags&&(t.tags=void 0)},Pt=function(t,e){const n=k.createElement("me-wrapper"),{p:o,tpc:i}=this.createParent(t);if(n.appendChild(o),!e&&t.children&&t.children.length>0){const s=Ft(t.expanded);if(o.appendChild(s),t.expanded!==!1){const r=Dt(this,t.children);n.appendChild(r)}}return{grp:n,top:o,tpc:i}},Ht=function(t){const e=k.createElement("me-parent"),n=this.createTopic(t);return ft.call(this,n,t),e.appendChild(n),{p:e,tpc:n}},Bt=function(t){const e=k.createElement("me-children");return e.append(...t),e},Ot=function(t){const e=k.createElement("me-tpc");return e.nodeObj=t,e.dataset.nodeid="me"+t.id,e.draggable=this.draggable,e};function ut(t){const e=k.createRange();e.selectNodeContents(t);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(e))}const Wt=function(t){if(!t)return;const e=k.createElement("div"),n=t.nodeObj,o=n.topic;t.appendChild(e),e.id="input-box",e.textContent=o,e.contentEditable="plaintext-only",e.spellcheck=!1;const i=getComputedStyle(t);e.style.cssText=`min-width:${t.offsetWidth-8}px;
2
- color:${i.color};
3
- padding:${i.padding};
4
- margin:${i.margin};
5
- font:${i.font};
6
- background-color:${i.backgroundColor!=="rgba(0, 0, 0, 0)"&&i.backgroundColor};
7
- border-radius:${i.borderRadius};`,this.direction===0&&(e.style.right="0"),ut(e),this.bus.fire("operation",{name:"beginEdit",obj:t.nodeObj}),e.addEventListener("keydown",s=>{s.stopPropagation();const r=s.key;if(r==="Enter"||r==="Tab"){if(s.shiftKey)return;s.preventDefault(),e.blur(),this.container.focus()}}),e.addEventListener("blur",()=>{var r;if(!e)return;const s=((r=e.textContent)==null?void 0:r.trim())||"";if(s==="")n.topic=o;else if(n.topic=s,this.markdown&&tt(s)){const c=at(s,this.markdown).trim();t.text.innerHTML=c}else t.text.textContent=s;e.remove(),s!==o&&(this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:n,origin:o}))})},Ft=function(t){const e=k.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},P=document,$="http://www.w3.org/2000/svg",et=function(t,e,n,o={}){const{anchor:i="middle",color:s,dataType:r}=o,c=document.createElementNS($,"text");return y(c,{"text-anchor":i,x:e+"",y:n+"",fill:s||(i==="middle"?"rgb(235, 95, 82)":"#666")}),r&&(c.dataset.type=r),c.innerHTML=t,c},pt=function(t,e,n){const o=P.createElementNS($,"path");return y(o,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),o},F=function(t){const e=P.createElementNS($,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},gt=function(){const t=P.createElementNS($,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},Gt=function(t,e,n,o){const i=P.createElementNS($,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((r,c)=>{const h=r.d,f=P.createElementNS($,"path"),u={d:h,stroke:(o==null?void 0:o.stroke)||"rgb(235, 95, 82)",fill:"none","stroke-linecap":(o==null?void 0:o.strokeLinecap)||"cap","stroke-width":String((o==null?void 0:o.strokeWidth)||"2")};(o==null?void 0:o.opacity)!==void 0&&(u.opacity=String(o.opacity)),y(f,u),c===0&&f.setAttribute("stroke-dasharray",(o==null?void 0:o.strokeDasharray)||"8,2");const d=P.createElementNS($,"path");y(d,{d:h,stroke:"transparent",fill:"none","stroke-width":"15"}),i.appendChild(d),i.appendChild(f),i[r.name]=f}),i},mt=function(t,e,n){if(!e)return;const o=P.createElement("div");t.nodes.appendChild(o);const i=e.innerHTML;o.id="input-box",o.textContent=i,o.contentEditable="plaintext-only",o.spellcheck=!1;const s=e.getBBox();o.style.cssText=`
8
- min-width:${Math.max(88,s.width)}px;
9
- position:absolute;
10
- left:${s.x}px;
11
- top:${s.y}px;
12
- padding: 2px 4px;
13
- margin: -2px -4px;
14
- `,ut(o),t.scrollIntoView(o),o.addEventListener("keydown",r=>{r.stopPropagation();const c=r.key;if(c==="Enter"||c==="Tab"){if(r.shiftKey)return;r.preventDefault(),o.blur(),t.container.focus()}}),o.addEventListener("blur",()=>{var c;if(!o)return;const r=((c=o.textContent)==null?void 0:c.trim())||"";r===""?n.label=i:n.label=r,o.remove(),r!==i&&(e.innerHTML=n.label,t.linkDiv(),"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},It=function(t){const e=this.map.querySelector("me-root"),n=e.offsetTop,o=e.offsetLeft,i=e.offsetWidth,s=e.offsetHeight,r=this.map.querySelectorAll("me-main > me-wrapper");this.lines.innerHTML="";for(let c=0;c<r.length;c++){const h=r[c],f=h.querySelector("me-tpc"),{offsetLeft:u,offsetTop:d}=M(this.nodes,f),m=f.offsetWidth,l=f.offsetHeight,a=h.parentNode.className,p=this.generateMainBranch({pT:n,pL:o,pW:i,pH:s,cT:d,cL:u,cW:m,cH:l,direction:a,containerHeight:this.nodes.offsetHeight}),g=this.theme.palette,x=f.nodeObj.branchColor||g[c%g.length];if(f.style.borderColor=x,this.lines.appendChild(pt(p,x,"3")),t&&t!==h)continue;const w=F("subLines"),v=h.lastChild;v.tagName==="svg"&&v.remove(),h.appendChild(w),xt(this,w,x,h,a,!0)}this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},xt=function(t,e,n,o,i,s){const r=o.firstChild,c=o.children[1].children;if(c.length===0)return;const h=r.offsetTop,f=r.offsetLeft,u=r.offsetWidth,d=r.offsetHeight;for(let m=0;m<c.length;m++){const l=c[m],a=l.firstChild,p=a.offsetTop,g=a.offsetLeft,x=a.offsetWidth,w=a.offsetHeight,v=a.firstChild.nodeObj.branchColor||n,C=t.generateSubBranch({pT:h,pL:f,pW:u,pH:d,cT:p,cL:g,cW:x,cH:w,direction:i,isFirst:s});e.appendChild(pt(C,v,"2"));const S=a.children[1];if(S){if(!S.expanded)continue}else continue;xt(t,e,v,l,i)}},Ze="",Vt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" p-id="2022"></path></svg>',Rt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="currentColor" p-id="1776"></path></svg>',Yt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="currentColor" p-id="3038"></path></svg>',zt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" p-id="2171"></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" p-id="2172"></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" p-id="2173"></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" p-id="2174"></path></svg>',jt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169573443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2883" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="currentColor" p-id="2884"></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="currentColor" p-id="2885"></path></svg>',Xt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169419447" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" p-id="2481"></path></svg>',_t='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169426515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" p-id="2731"></path></svg>',tn="",qt={side:Vt,left:Rt,right:Yt,full:zt,living:jt,zoomin:Xt,zoomout:_t},H=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=qt[e],n};function Ut(t){const e=document.createElement("div"),n=H("fullscreen","full"),o=H("toCenter","living"),i=H("zoomout","zoomout"),s=H("zoomin","zoomin"),r=document.createElement("span");return r.innerText="100%",e.appendChild(n),e.appendChild(o),e.appendChild(i),e.appendChild(s),e.className="mind-elixir-toolbar rb",n.onclick=()=>{document.fullscreenElement===t.el?document.exitFullscreen():t.el.requestFullscreen()},o.onclick=()=>{t.toCenter()},i.onclick=()=>{t.scale(t.scaleVal-t.scaleSensitivity)},s.onclick=()=>{t.scale(t.scaleVal+t.scaleSensitivity)},e}function Kt(t){const e=document.createElement("div"),n=H("tbltl","left"),o=H("tbltr","right"),i=H("tblts","side");return e.appendChild(n),e.appendChild(o),e.appendChild(i),e.className="mind-elixir-toolbar lt",n.onclick=()=>{t.initLeft()},o.onclick=()=>{t.initRight()},i.onclick=()=>{t.initSide()},e}function Jt(t){t.container.append(Ut(t)),t.container.append(Kt(t))}const Qt=function(t,e=!0){this.theme=t;const o={...(t.type==="dark"?J:K).cssVar,...t.cssVar},i=Object.keys(o);for(let s=0;s<i.length;s++){const r=i[s];this.container.style.setProperty(r,o[r])}e&&this.refresh()},Zt=function(t){const n=t.parentElement.parentElement.lastElementChild;(n==null?void 0:n.tagName)==="svg"&&(n==null||n.remove())};function te(t){return{nodeData:t.isFocusMode?t.nodeDataBackup:t.nodeData,arrows:t.arrows,summaries:t.summaries,direction:t.direction,theme:t.theme}}const ee=function(t){const e=this.container,n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.top>o.bottom||n.bottom<o.top||n.left>o.right||n.right<o.left){const s=n.left+n.width/2,r=n.top+n.height/2,c=o.left+o.width/2,h=o.top+o.height/2,f=s-c,u=r-h;this.move(-f,-u,!0)}},ne=function(t,e,n){this.clearSelection(),this.scrollIntoView(t),this.selection.select(t),e&&this.bus.fire("selectNewNode",t.nodeObj)},oe=function(t){this.selection.select(t)},ie=function(t){this.selection.deselect(t)},se=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},re=function(){const t=te(this);return JSON.stringify(t,(e,n)=>{if(!(e==="parent"&&typeof n!="string"))return n})},ce=function(){return JSON.parse(this.getDataString())},le=function(){this.editable=!0},ae=function(){this.editable=!1},he=function(t,e={x:0,y:0}){if(t<this.scaleMin||t>this.scaleMax)return;const n=this.container.getBoundingClientRect(),o=e.x?e.x-n.left-n.width/2:0,i=e.y?e.y-n.top-n.height/2:0,{dx:s,dy:r}=wt(this),c=this.map.style.transform,{x:h,y:f}=rt(c),u=h-s,d=f-r,m=this.scaleVal,l=(-o+u)*(1-t/m),a=(-i+d)*(1-t/m);this.map.style.transform=`translate(${h-l}px, ${f-a}px) scale(${t})`,this.scaleVal=t,this.bus.fire("scale",t)},de=function(){const t=this.nodes.offsetHeight/this.container.offsetHeight,e=this.nodes.offsetWidth/this.container.offsetWidth,n=1/Math.max(1,Math.max(t,e));this.scaleVal=n,this.map.style.transform="scale("+n+")",this.bus.fire("scale",n)},fe=function(t,e,n=!1){const{map:o,scaleVal:i,bus:s}=this,r=o.style.transform;let{x:c,y:h}=rt(r);c+=t,h+=e,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate(${c}px, ${h}px) scale(${i})`,s.fire("move",{dx:t,dy:e})},wt=t=>{const{container:e,map:n,nodes:o}=t,i=n.querySelector("me-root"),s=i.offsetTop,r=i.offsetLeft,c=i.offsetWidth,h=i.offsetHeight;let f,u;return t.alignment==="root"?(f=e.offsetWidth/2-r-c/2,u=e.offsetHeight/2-s-h/2,n.style.transformOrigin=`${r+c/2}px 50%`):(f=(e.offsetWidth-o.offsetWidth)/2,u=(e.offsetHeight-o.offsetHeight)/2,n.style.transformOrigin="50% 50%"),{dx:f,dy:u}},ue=Object.freeze(Object.defineProperty({__proto__:null,cancelFocus:function(){this.isFocusMode=!1,this.tempDirection!==null&&(this.nodeData=this.nodeDataBackup,this.direction=this.tempDirection,this.tempDirection=null,this.refresh(),this.toCenter())},clearSelection:se,disableEdit:ae,enableEdit:le,expandNode:function(t,e){const n=t.nodeObj;typeof e=="boolean"?n.expanded=e:n.expanded!==!1?n.expanded=!1:n.expanded=!0;const o=t.getBoundingClientRect(),i={x:o.left,y:o.top},s=t.parentNode,r=s.children[1];if(r.expanded=n.expanded,r.className=n.expanded?"minus":"",Zt(t),n.expanded){const d=this.createChildren(n.children.map(m=>this.createWrapper(m).grp));s.parentNode.appendChild(d)}else s.parentNode.children[1].remove();this.linkDiv(t.closest("me-main > me-wrapper"));const c=t.getBoundingClientRect(),h={x:c.left,y:c.top},f=i.x-h.x,u=i.y-h.y;this.move(f,u),this.bus.fire("expandNode",n)},expandNodeAll:function(t,e){const n=t.nodeObj,o=t.getBoundingClientRect(),i={x:o.left,y:o.top};Z(n,e??!n.expanded),this.refresh();const s=this.findEle(n.id).getBoundingClientRect(),r={x:s.left,y:s.top},c=i.x-r.x,h=i.y-r.y;this.move(c,h)},focusNode:function(t){t.nodeObj.parent&&(this.clearSelection(),this.tempDirection===null&&(this.tempDirection=this.direction),this.isFocusMode||(this.nodeDataBackup=this.nodeData,this.isFocusMode=!0),this.nodeData=t.nodeObj,this.initRight(),this.toCenter())},getData:ce,getDataString:re,initLeft:function(){this.direction=0,this.refresh(),this.toCenter()},initRight:function(){this.direction=1,this.refresh(),this.toCenter()},initSide:function(){this.direction=2,this.refresh(),this.toCenter()},install:function(t){t(this)},move:fe,refresh:function(t){this.clearSelection(),t&&(t=JSON.parse(JSON.stringify(t)),this.nodeData=t.nodeData,this.arrows=t.arrows||[],this.summaries=t.summaries||[],t.theme&&this.changeTheme(t.theme)),Q(this.nodeData),this.layout(),this.linkDiv()},scale:he,scaleFit:de,scrollIntoView:ee,selectNode:ne,selectNodes:oe,setLocale:function(t){this.locale=t,this.refresh()},toCenter:function(){const{map:t}=this,{dx:e,dy:n}=wt(this);t.style.transform=`translate(${e}px, ${n}px) scale(${this.scaleVal})`},unselectNodes:ie},Symbol.toStringTag,{value:"Module"})),yt={create:function(t){return{dom:t,moved:!1,pointerdown:!1,lastX:0,lastY:0,handlePointerMove(e){if(this.pointerdown){this.moved=!0;const n=e.clientX-this.lastX,o=e.clientY-this.lastY;this.lastX=e.clientX,this.lastY=e.clientY,this.cb&&this.cb(n,o)}},handlePointerDown(e){e.button===0&&(this.pointerdown=!0,this.lastX=e.clientX,this.lastY=e.clientY,this.dom.setPointerCapture(e.pointerId))},handleClear(e){this.pointerdown=!1,e.pointerId!==void 0&&this.dom.releasePointerCapture(e.pointerId)},cb:null,init(e,n){this.cb=n,this.handleClear=this.handleClear.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this),this.destroy=ct([{dom:e,evt:"pointermove",func:this.handlePointerMove},{dom:e,evt:"pointerleave",func:this.handleClear},{dom:e,evt:"pointerup",func:this.handleClear},{dom:this.dom,evt:"pointerdown",func:this.handlePointerDown}])},destroy:null,clear(){this.moved=!1,this.pointerdown=!1}}}},pe="#4dc4ff";function vt(t,e,n,o,i,s,r,c){return{x:t/8+n*3/8+i*3/8+r/8,y:e/8+o*3/8+s*3/8+c/8}}function ge(t,e,n){y(t,{x:e+"",y:n+""})}function Y(t,e,n,o,i){y(t,{x1:e+"",y1:n+"",x2:o+"",y2:i+""})}function bt(t,e,n,o,i,s,r,c,h,f){var p;const u=`M ${e} ${n} C ${o} ${i} ${s} ${r} ${c} ${h}`;if(t.line.setAttribute("d",u),f.style){const g=f.style;g.stroke&&t.line.setAttribute("stroke",g.stroke),g.strokeWidth&&t.line.setAttribute("stroke-width",String(g.strokeWidth)),g.strokeDasharray&&t.line.setAttribute("stroke-dasharray",g.strokeDasharray),g.strokeLinecap&&t.line.setAttribute("stroke-linecap",g.strokeLinecap),g.opacity!==void 0&&t.line.setAttribute("opacity",String(g.opacity))}const d=t.querySelectorAll('path[stroke="transparent"]');d.length>0&&d[0].setAttribute("d",u);const m=V(s,r,c,h);if(m){const g=`M ${m.x1} ${m.y1} L ${c} ${h} L ${m.x2} ${m.y2}`;if(t.arrow1.setAttribute("d",g),d.length>1&&d[1].setAttribute("d",g),f.style){const x=f.style;x.stroke&&t.arrow1.setAttribute("stroke",x.stroke),x.strokeWidth&&t.arrow1.setAttribute("stroke-width",String(x.strokeWidth)),x.strokeLinecap&&t.arrow1.setAttribute("stroke-linecap",x.strokeLinecap),x.opacity!==void 0&&t.arrow1.setAttribute("opacity",String(x.opacity))}}if(f.bidirectional){const g=V(o,i,e,n);if(g){const x=`M ${g.x1} ${g.y1} L ${e} ${n} L ${g.x2} ${g.y2}`;if(t.arrow2.setAttribute("d",x),d.length>2&&d[2].setAttribute("d",x),f.style){const w=f.style;w.stroke&&t.arrow2.setAttribute("stroke",w.stroke),w.strokeWidth&&t.arrow2.setAttribute("stroke-width",String(w.strokeWidth)),w.strokeLinecap&&t.arrow2.setAttribute("stroke-linecap",w.strokeLinecap),w.opacity!==void 0&&t.arrow2.setAttribute("opacity",String(w.opacity))}}}const{x:l,y:a}=vt(e,n,o,i,s,r,c,h);ge(t.label,l,a),(p=f.style)!=null&&p.labelColor&&t.label.setAttribute("fill",f.style.labelColor),Se(t)}function z(t,e,n){const{offsetLeft:o,offsetTop:i}=M(t.nodes,e),s=e.offsetWidth,r=e.offsetHeight,c=o+s/2,h=i+r/2,f=c+n.x,u=h+n.y;return{w:s,h:r,cx:c,cy:h,ctrlX:f,ctrlY:u}}function O(t){let e,n;const o=(t.cy-t.ctrlY)/(t.ctrlX-t.cx);return o>t.h/t.w||o<-t.h/t.w?t.cy-t.ctrlY<0?(e=t.cx-t.h/2/o,n=t.cy+t.h/2):(e=t.cx+t.h/2/o,n=t.cy-t.h/2):t.cx-t.ctrlX<0?(e=t.cx+t.w/2,n=t.cy-t.w*o/2):(e=t.cx-t.w/2,n=t.cy+t.w*o/2),{x:e,y:n}}const nt=function(t,e,n,o,i){var b;if(!e||!n)return;const s=z(t,e,o.delta1),r=z(t,n,o.delta2),{x:c,y:h}=O(s),{ctrlX:f,ctrlY:u}=s,{ctrlX:d,ctrlY:m}=r,{x:l,y:a}=O(r),p=V(d,m,l,a);if(!p)return;const g=`M ${p.x1} ${p.y1} L ${l} ${a} L ${p.x2} ${p.y2}`;let x="";if(o.bidirectional){const E=V(f,u,c,h);if(!E)return;x=`M ${E.x1} ${E.y1} L ${c} ${h} L ${E.x2} ${E.y2}`}const w=Gt(`M ${c} ${h} C ${f} ${u} ${d} ${m} ${l} ${a}`,g,x,o.style),{x:v,y:C}=vt(c,h,f,u,d,m,l,a),S=(b=o.style)==null?void 0:b.labelColor,L=et(o.label,v,C,{anchor:"middle",color:S,dataType:"custom-link"});w.appendChild(L),w.label=L,w.arrowObj=o,w.dataset.linkid=o.id,t.linkSvgGroup.appendChild(w),i||(t.arrows.push(o),t.currentArrow=w,Ct(t,o,s,r))},me=function(t,e,n={}){const o={id:W(),label:"Custom Link",from:t.nodeObj.id,to:e.nodeObj.id,delta1:{x:t.offsetWidth/2+100,y:0},delta2:{x:e.offsetWidth/2+100,y:0},...n};nt(this,t,e,o),this.bus.fire("operation",{name:"createArrow",obj:o})},xe=function(t){j(this);const e={...t,id:W()};nt(this,this.findEle(e.from),this.findEle(e.to),e),this.bus.fire("operation",{name:"createArrow",obj:e})},we=function(t){let e;if(t?e=t:e=this.currentArrow,!e)return;j(this);const n=e.arrowObj.id;this.arrows=this.arrows.filter(o=>o.id!==n),e.remove(),this.bus.fire("operation",{name:"removeArrow",obj:{id:n}})},ye=function(t){this.currentArrow=t;const e=t.arrowObj,n=this.findEle(e.from),o=this.findEle(e.to),i=z(this,n,e.delta1),s=z(this,o,e.delta2);Ct(this,e,i,s)},ve=function(){j(this),this.currentArrow=null},ot=function(t,e){const n=document.createElementNS($,"path");return y(n,{d:t,stroke:e,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},be=function(t,e){const n=document.createElementNS($,"g");n.setAttribute("class","arrow-highlight"),n.setAttribute("opacity","0.45");const o=ot(t.line.getAttribute("d"),e);n.appendChild(o);const i=ot(t.arrow1.getAttribute("d"),e);if(n.appendChild(i),t.arrow2.getAttribute("d")){const s=ot(t.arrow2.getAttribute("d"),e);n.appendChild(s)}t.insertBefore(n,t.firstChild)},Ce=function(t){const e=t.querySelector(".arrow-highlight");e&&e.remove()},Se=function(t){const e=t.querySelector(".arrow-highlight");if(!e)return;const n=e.querySelectorAll("path");n.length>=1&&n[0].setAttribute("d",t.line.getAttribute("d")),n.length>=2&&n[1].setAttribute("d",t.arrow1.getAttribute("d")),n.length>=3&&t.arrow2.getAttribute("d")&&n[2].setAttribute("d",t.arrow2.getAttribute("d"))},j=function(t){var e,n;(e=t.helper1)==null||e.destroy(),(n=t.helper2)==null||n.destroy(),t.linkController.style.display="none",t.P2.style.display="none",t.P3.style.display="none",t.currentArrow&&Ce(t.currentArrow)},Ct=function(t,e,n,o){const{linkController:i,P2:s,P3:r,line1:c,line2:h,nodes:f,map:u,currentArrow:d,bus:m}=t;if(!d)return;i.style.display="initial",s.style.display="initial",r.style.display="initial",f.appendChild(i),f.appendChild(s),f.appendChild(r),be(d,pe);let{x:l,y:a}=O(n),{ctrlX:p,ctrlY:g}=n,{ctrlX:x,ctrlY:w}=o,{x:v,y:C}=O(o);s.style.cssText=`top:${g}px;left:${p}px;`,r.style.cssText=`top:${w}px;left:${x}px;`,Y(c,l,a,p,g),Y(h,x,w,v,C),t.helper1=yt.create(s),t.helper2=yt.create(r),t.helper1.init(u,(S,L)=>{p=p+S/t.scaleVal,g=g+L/t.scaleVal;const b=O({...n,ctrlX:p,ctrlY:g});l=b.x,a=b.y,s.style.top=g+"px",s.style.left=p+"px",bt(d,l,a,p,g,x,w,v,C,e),Y(c,l,a,p,g),e.delta1.x=p-n.cx,e.delta1.y=g-n.cy,m.fire("updateArrowDelta",e)}),t.helper2.init(u,(S,L)=>{x=x+S/t.scaleVal,w=w+L/t.scaleVal;const b=O({...o,ctrlX:x,ctrlY:w});v=b.x,C=b.y,r.style.top=w+"px",r.style.left=x+"px",bt(d,l,a,p,g,x,w,v,C,e),Y(h,x,w,v,C),e.delta2.x=x-o.cx,e.delta2.y=w-o.cy,m.fire("updateArrowDelta",e)})};function Ee(){this.linkSvgGroup.innerHTML="";for(let t=0;t<this.arrows.length;t++){const e=this.arrows[t];try{nt(this,this.findEle(e.from),this.findEle(e.to),e,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function ke(t){if(j(this),!t)return;const e=t.label;mt(this,e,t.arrowObj)}function Te(){this.arrows=this.arrows.filter(t=>I(t.from,this.nodeData)&&I(t.to,this.nodeData))}const Le=Object.freeze(Object.defineProperty({__proto__:null,createArrow:me,createArrowFrom:xe,editArrowLabel:ke,removeArrow:we,renderArrow:Ee,selectArrow:ye,tidyArrow:Te,unselectArrow:ve},Symbol.toStringTag,{value:"Module"})),$e=function(t){var h,f;if(t.length===0)throw new Error("No selected node.");if(t.length===1){const u=t[0].nodeObj,d=t[0].nodeObj.parent;if(!d)throw new Error("Can not select root node.");const m=d.children.findIndex(l=>u===l);return{parent:d.id,start:m,end:m}}let e=0;const n=t.map(u=>{let d=u.nodeObj;const m=[];for(;d.parent;){const l=d.parent,a=l.children,p=a==null?void 0:a.indexOf(d);d=l,m.unshift({node:d,index:p})}return m.length>e&&(e=m.length),m});let o=0;t:for(;o<e;o++){const u=(h=n[0][o])==null?void 0:h.node;for(let d=1;d<n.length;d++)if(((f=n[d][o])==null?void 0:f.node)!==u)break t}if(!o)throw new Error("Can not select root node.");const i=n.map(u=>u[o-1].index).sort(),s=i[0]||0,r=i[i.length-1]||0,c=n[0][o-1].node;if(!c.parent)throw new Error("Please select nodes in the same main topic.");return{parent:c.id,start:s,end:r}},Ae=function(t){const e=document.createElementNS($,"g");return e.setAttribute("id",t),e},St=function(t,e){const n=document.createElementNS($,"path");return y(n,{d:t,stroke:e||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},Me=t=>t.parentElement.parentElement,Ne=function(t,{parent:e,start:n}){const o=t.findEle(e),i=o.nodeObj;let s;return i.parent?s=o.closest("me-main").className:s=t.findEle(i.children[n].id).closest("me-main").className,s},it=function(t,e){var E;const{id:n,label:o,parent:i,start:s,end:r}=e,{nodes:c,theme:h,summarySvg:f}=t,d=t.findEle(i).nodeObj,m=Ne(t,e);let l=1/0,a=0,p=0,g=0;for(let N=s;N<=r;N++){const q=(E=d.children)==null?void 0:E[N];if(!q)return t.removeSummary(n),null;const B=Me(t.findEle(q.id)),{offsetLeft:U,offsetTop:Et}=M(c,B),kt=s===r?10:20;N===s&&(p=Et+kt),N===r&&(g=Et+B.offsetHeight-kt),U<l&&(l=U),B.offsetWidth+U>a&&(a=B.offsetWidth+U)}let x,w;const v=p+10,C=g+10,S=(v+C)/2,L=h.cssVar["--color"];m===D.LHS?(x=St(`M ${l+10} ${v} c -5 0 -10 5 -10 10 L ${l} ${C-10} c 0 5 5 10 10 10 M ${l} ${S} h -10`,L),w=et(o,l-20,S+6,{anchor:"end",color:L})):(x=St(`M ${a-10} ${v} c 5 0 10 5 10 10 L ${a} ${C-10} c 0 5 -5 10 -10 10 M ${a} ${S} h 10`,L),w=et(o,a+20,S+6,{anchor:"start",color:L}));const b=Ae("s-"+n);return b.appendChild(x),b.appendChild(w),b.summaryObj=e,f.appendChild(b),b},De=Object.freeze(Object.defineProperty({__proto__:null,createSummary:function(){if(!this.currentNodes)return;const{currentNodes:t,summaries:e,bus:n}=this,{parent:o,start:i,end:s}=$e(t),r={id:W(),parent:o,start:i,end:s,label:"summary"},c=it(this,r);e.push(r),this.editSummary(c),n.fire("operation",{name:"createSummary",obj:r})},createSummaryFrom:function(t){const e=W(),n={...t,id:e};it(this,n),this.summaries.push(n),this.bus.fire("operation",{name:"createSummary",obj:n})},editSummary:function(t){if(!t)return;const e=t.childNodes[1];mt(this,e,t.summaryObj)},removeSummary:function(t){var n;const e=this.summaries.findIndex(o=>o.id===t);e>-1&&(this.summaries.splice(e,1),(n=document.querySelector("#s-"+t))==null||n.remove()),this.bus.fire("operation",{name:"removeSummary",obj:{id:t}})},renderSummary:function(){this.summarySvg.innerHTML="",this.summaries.forEach(t=>{try{it(this,t)}catch{}}),this.nodes.insertAdjacentElement("beforeend",this.summarySvg)},selectSummary:function(t){const e=t.children[1].getBBox(),n=6,o=3,i=document.createElementNS($,"rect");y(i,{x:e.x-n+"",y:e.y-n+"",width:e.width+n*2+"",height:e.height+n*2+"",rx:o+"",stroke:this.theme.cssVar["--selected"]||"#4dc4ff","stroke-width":"2",fill:"none"}),t.appendChild(i),this.currentSummary=t},unselectSummary:function(){var t,e;(e=(t=this.currentSummary)==null?void 0:t.querySelector("rect"))==null||e.remove(),this.currentSummary=null}},Symbol.toStringTag,{value:"Module"})),T="http://www.w3.org/2000/svg";function Pe(t,e){const n=document.createElementNS(T,"svg");return y(n,{version:"1.1",xmlns:T,height:t,width:e}),n}function He(t,e){return(parseInt(t)-parseInt(e))/2}function Be(t,e,n,o){const i=document.createElementNS(T,"g");let s="";return t.text?s=t.text.textContent:s=t.childNodes[0].textContent,s.split(`
15
- `).forEach((c,h)=>{const f=document.createElementNS(T,"text");y(f,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+He(e.lineHeight,e.fontSize)*(h+1)+parseFloat(e.fontSize)*(h+1)+"","text-anchor":"start","font-family":e.fontFamily,"font-size":`${e.fontSize}`,"font-weight":`${e.fontWeight}`,fill:`${e.color}`}),f.innerHTML=c,i.appendChild(f)}),i}function Oe(t,e,n,o){var c;let i="";(c=t.nodeObj)!=null&&c.dangerouslySetInnerHTML?i=t.nodeObj.dangerouslySetInnerHTML:t.text?i=t.text.textContent:i=t.childNodes[0].textContent;const s=document.createElementNS(T,"foreignObject");y(s,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+"",width:e.width,height:e.height});const r=document.createElement("div");return y(r,{xmlns:"http://www.w3.org/1999/xhtml",style:`font-family: ${e.fontFamily}; font-size: ${e.fontSize}; font-weight: ${e.fontWeight}; color: ${e.color}; white-space: pre-wrap;`}),r.innerHTML=i,s.appendChild(r),s}function We(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:i}=M(t.nodes,e),s=document.createElementNS(T,"rect");return y(s,{x:o+"",y:i+"",rx:n.borderRadius,ry:n.borderRadius,width:n.width,height:n.height,fill:n.backgroundColor,stroke:n.borderColor,"stroke-width":n.borderWidth}),s}function X(t,e,n=!1){const o=getComputedStyle(e),{offsetLeft:i,offsetTop:s}=M(t.nodes,e),r=document.createElementNS(T,"rect");y(r,{x:i+"",y:s+"",rx:o.borderRadius,ry:o.borderRadius,width:o.width,height:o.height,fill:o.backgroundColor,stroke:o.borderColor,"stroke-width":o.borderWidth});const c=document.createElementNS(T,"g");c.appendChild(r);let h;return n?h=Oe(e,o,i,s):h=Be(e,o,i,s),c.appendChild(h),c}function Fe(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:i}=M(t.nodes,e),s=document.createElementNS(T,"a"),r=document.createElementNS(T,"text");return y(r,{x:o+"",y:i+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),r.innerHTML=e.textContent,s.appendChild(r),s.setAttribute("href",e.href),s}function Ge(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:i}=M(t.nodes,e),s=document.createElementNS(T,"image");return y(s,{x:o+"",y:i+"",width:n.width+"",height:n.height+"",href:e.src}),s}const _=100,Ie='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',Ve=(t,e=!1)=>{var d,m,l;const n=t.nodes,o=n.offsetHeight+_*2,i=n.offsetWidth+_*2,s=Pe(o+"px",i+"px"),r=document.createElementNS(T,"svg"),c=document.createElementNS(T,"rect");y(c,{x:"0",y:"0",width:`${i}`,height:`${o}`,fill:t.theme.cssVar["--bgcolor"]}),s.appendChild(c),n.querySelectorAll(".subLines").forEach(a=>{const p=a.cloneNode(!0),{offsetLeft:g,offsetTop:x}=M(n,a.parentElement);p.setAttribute("x",`${g}`),p.setAttribute("y",`${x}`),r.appendChild(p)});const h=(d=n.querySelector(".lines"))==null?void 0:d.cloneNode(!0);h&&r.appendChild(h);const f=(m=n.querySelector(".topiclinks"))==null?void 0:m.cloneNode(!0);f&&r.appendChild(f);const u=(l=n.querySelector(".summary"))==null?void 0:l.cloneNode(!0);return u&&r.appendChild(u),n.querySelectorAll("me-tpc").forEach(a=>{a.nodeObj.dangerouslySetInnerHTML?r.appendChild(X(t,a,!e)):(r.appendChild(We(t,a)),r.appendChild(X(t,a.text,!e)))}),n.querySelectorAll(".tags > span").forEach(a=>{r.appendChild(X(t,a))}),n.querySelectorAll(".icons > span").forEach(a=>{r.appendChild(X(t,a))}),n.querySelectorAll(".hyper-link").forEach(a=>{r.appendChild(Fe(t,a))}),n.querySelectorAll("img").forEach(a=>{r.appendChild(Ge(t,a))}),y(r,{x:_+"",y:_+"",overflow:"visible"}),s.appendChild(r),s},Re=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),Ie+t.outerHTML);function Ye(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=i=>{e(i.target.result)},o.onerror=i=>{n(i)},o.readAsDataURL(t)})}const ze={getObjById:I,generateNewObj:Lt,layout:Mt,linkDiv:It,editTopic:Wt,createWrapper:Pt,createParent:Ht,createChildren:Bt,createTopic:Ot,findEle:dt,changeTheme:Qt,...ue,...{},...Le,...De,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(t=!1,e){const n=this.exportSvg(t,e),o=await Ye(n);return new Promise((i,s)=>{const r=new Image;r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{const c=document.createElement("canvas");c.width=r.width,c.height=r.height,c.getContext("2d").drawImage(r,0,0),c.toBlob(i,"image/png",1)},r.src=o,r.onerror=s})},exportSvg:function(t=!1,e){const n=Ve(this,t),o=Re(n,e);return new Blob([o],{type:"image/svg+xml"})}},Symbol.toStringTag,{value:"Module"})),init(t){if(t=JSON.parse(JSON.stringify(t)),!t||!t.nodeData)return new Error("MindElixir: `data` is required");t.direction!==void 0&&(this.direction=t.direction),this.changeTheme(t.theme||this.theme,!1),this.nodeData=t.nodeData,Q(this.nodeData),this.arrows=t.arrows||[],this.summaries=t.summaries||[],this.tidyArrow(),this.toolBar&&Jt(this),this.layout(),this.linkDiv(),this.toCenter()},destroy(){var t;this.disposable.forEach(e=>e()),this.el&&(this.el.innerHTML=""),this.el=void 0,this.nodeData=void 0,this.arrows=void 0,this.summaries=void 0,this.currentArrow=void 0,this.currentNodes=void 0,this.currentSummary=void 0,this.waitCopy=void 0,this.theme=void 0,this.direction=void 0,this.bus=void 0,this.container=void 0,this.map=void 0,this.lines=void 0,this.linkController=void 0,this.linkSvgGroup=void 0,this.P2=void 0,this.P3=void 0,this.line1=void 0,this.line2=void 0,this.nodes=void 0,(t=this.selection)==null||t.destroy(),this.selection=void 0}};function je({pT:t,pL:e,pW:n,pH:o,cT:i,cL:s,cW:r,cH:c,direction:h,containerHeight:f}){let u=e+n/2;const d=t+o/2;let m;h===D.LHS?m=s+r:m=s;const l=i+c/2,p=(1-Math.abs(l-d)/f)*.25*(n/2);return h===D.LHS?u=u-n/10-p:u=u+n/10+p,`M ${u} ${d} Q ${u} ${l} ${m} ${l}`}function Xe({pT:t,pL:e,pW:n,pH:o,cT:i,cL:s,cW:r,cH:c,direction:h,isFirst:f}){const u=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let d=0,m=0;f?d=t+o/2:d=t+o;const l=i+c;let a=0,p=0,g=0;const x=Math.abs(d-l)/300*u;return h===D.LHS?(g=e,a=g+u,p=g-u,m=s+u,`M ${a} ${d} C ${g} ${d} ${g+x} ${l} ${p} ${l} H ${m}`):(g=e+n,a=g-u,p=g+u,m=s+r-u,`M ${a} ${d} C ${g} ${d} ${g-x} ${l} ${p} ${l} H ${m}`)}const _e="5.1.1";function qe(t){return{x:0,y:0,moved:!1,mousedown:!1,onMove(e,n){this.mousedown&&(this.moved=!0,t.move(e,n))},clear(){this.mousedown=!1}}}const G=document;function A({el:t,direction:e,locale:n,draggable:o,editable:i,contextMenu:s,toolBar:r,keypress:c,mouseSelectionButton:h,selectionContainer:f,before:u,newTopicName:d,allowUndo:m,generateMainBranch:l,generateSubBranch:a,overflowHidden:p,theme:g,alignment:x,scaleSensitivity:w,scaleMax:v,scaleMin:C,handleWheel:S,markdown:L,imageProxy:b}){let E=null;const N=Object.prototype.toString.call(t);if(N==="[object HTMLDivElement]"?E=t:N==="[object String]"&&(E=document.querySelector(t)),!E)throw new Error("MindElixir: el is not a valid element");E.style.position="relative",E.innerHTML="",this.el=E,this.disposable=[],this.before=u||{},this.locale=n||"en",this.newTopicName=d||"New Node",this.contextMenu=s??!0,this.toolBar=r??!0,this.keypress=c??!0,this.mouseSelectionButton=h??0,this.direction=e??1,this.draggable=o??!0,this.editable=i??!0,this.allowUndo=m??!0,this.scaleSensitivity=w??.1,this.scaleMax=v??1.4,this.scaleMin=C??.2,this.generateMainBranch=l||je,this.generateSubBranch=a||Xe,this.overflowHidden=p??!1,this.alignment=x??"root",this.handleWheel=S??!0,this.markdown=L||void 0,this.imageProxy=b||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.dragMoveHelper=qe(this),this.bus=At(),this.container=G.createElement("div"),this.selectionContainer=f||this.container,this.container.className="map-container";const q=window.matchMedia("(prefers-color-scheme: dark)");this.theme=g||(q.matches?J:K);const B=G.createElement("div");B.className="map-canvas",this.map=B,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=G.createElement("me-nodes"),this.lines=F("lines"),this.summarySvg=F("summary"),this.linkController=F("linkcontroller"),this.P2=G.createElement("div"),this.P3=G.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=gt(),this.line2=gt(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=F("topiclinks"),this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push($t(this))}return A.prototype=ze,Object.defineProperty(A.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),A.LEFT=0,A.RIGHT=1,A.SIDE=2,A.THEME=K,A.DARK_THEME=J,A.version=_e,A.E=dt,A}();
1
+ var MindElixirLite=function(){"use strict";const _e="",Q={name:"Latte",type:"light",palette:["#dd7878","#ea76cb","#8839ef","#e64553","#fe640b","#df8e1d","#40a02b","#209fb5","#1e66f5","#7287fd"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#4c4f69","--root-border-color":"rgba(0, 0, 0, 0)","--main-color":"#444446","--main-bgcolor":"#ffffff","--topic-padding":"3px","--color":"#777777","--bgcolor":"#f6f6f6","--selected":"#4dc4ff","--accent-color":"#e64553","--panel-color":"#444446","--panel-bgcolor":"#ffffff","--panel-border-color":"#eaeaea","--map-padding":"50px"}},Z={name:"Dark",type:"dark",palette:["#848FA0","#748BE9","#D2F9FE","#4145A5","#789AFA","#706CF4","#EF987F","#775DD5","#FCEECF","#DA7FBC"],cssVar:{"--node-gap-x":"30px","--node-gap-y":"10px","--main-gap-x":"65px","--main-gap-y":"45px","--root-radius":"30px","--main-radius":"20px","--root-color":"#ffffff","--root-bgcolor":"#2d3748","--root-border-color":"rgba(255, 255, 255, 0.1)","--main-color":"#ffffff","--main-bgcolor":"#4c4f69","--topic-padding":"3px","--color":"#cccccc","--bgcolor":"#252526","--selected":"#4dc4ff","--accent-color":"#789AFA","--panel-color":"#ffffff","--panel-bgcolor":"#2d3748","--panel-border-color":"#696969","--map-padding":"50px 80px"}};function kt(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}const R=function(t,e){if(e.id===t)return e;if(e.children&&e.children.length){for(let n=0;n<e.children.length;n++){const o=R(t,e.children[n]);if(o)return o}return null}else return null},tt=(t,e)=>{if(t.parent=e,t.children)for(let n=0;n<t.children.length;n++)tt(t.children[n],t)},et=(t,e,n)=>{if(t.expanded=e,t.children)if(n===void 0||n>0){const o=n!==void 0?n-1:void 0;t.children.forEach(s=>{et(s,e,o)})}else t.children.forEach(o=>{et(o,!1)})};function V(t,e,n,o){const s=o-e,i=t-n;let r=Math.atan(Math.abs(s)/Math.abs(i))/3.14*180;if(isNaN(r))return;i<0&&s>0&&(r=180-r),i<0&&s<0&&(r=180+r),i>0&&s<0&&(r=360-r);const c=12,h=30,d=r+h,p=r-h;return{x1:n+Math.cos(Math.PI*d/180)*c,y1:o-Math.sin(Math.PI*d/180)*c,x2:n+Math.cos(Math.PI*p/180)*c,y2:o-Math.sin(Math.PI*p/180)*c}}function W(){return(new Date().getTime().toString(16)+Math.random().toString(16).substr(2)).substr(2,16)}const Lt=function(){const t=W();return{topic:this.newTopicName,id:t}},D=(t,e)=>{let n=0,o=0;for(;e&&e!==t;)n+=e.offsetLeft,o+=e.offsetTop,e=e.offsetParent;return{offsetLeft:n,offsetTop:o}},S=(t,e)=>{for(const n in e)t.setAttribute(n,e[n])},rt=t=>t?t.tagName==="ME-TPC":!1,ct=t=>{const e=/translate\(([^,]+),\s*([^)]+)\)/,n=t.match(e);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},lt=function(t){for(let e=0;e<t.length;e++){const{dom:n,evt:o,func:s}=t[e];n.addEventListener(o,s)}return function(){for(let n=0;n<t.length;n++){const{dom:o,evt:s,func:i}=t[n];o.removeEventListener(s,i)}}};var P=(t=>(t.LHS="lhs",t.RHS="rhs",t))(P||{});const at=function(t,e,n){const{scaleVal:o,scaleSensitivity:s}=t;switch(e){case"in":t.scale(o+s,n);break;case"out":t.scale(o-s,n)}};function Tt(t){const{dragMoveHelper:e}=t,n=l=>{var m,w;if(l.button!==0)return;if((m=t.helper1)!=null&&m.moved){t.helper1.clear();return}if((w=t.helper2)!=null&&w.moved){t.helper2.clear();return}if(e.moved){e.clear();return}const a=l.target;if(a.tagName==="ME-EPD")l.ctrlKey||l.metaKey?t.expandNodeAll(a.previousSibling):t.expandNode(a.previousSibling);else if(a.tagName==="ME-TPC"&&t.currentNodes.length>1)t.selectNode(a);else if(!t.editable)return;const u=a.closest(".svg-label");if(u&&u.dataset.svgId){const b=document.getElementById(u.dataset.svgId);if(b){const x=b.closest("g");if(x){const E=x.closest(".topiclinks"),C=x.closest(".summary");if(E){t.selectArrow(x);return}else if(C){t.selectSummary(x);return}}}}if(a.closest(".topiclinks")){const b=a.closest("g");if(b){t.selectArrow(b);return}}if(a.closest(".summary")){const b=a.closest("g");if(b){t.selectSummary(b);return}}},o=l=>{if(!t.editable)return;const a=l.target;rt(a)&&t.beginEdit(a);const u=a.closest(".svg-label");if(u&&u.dataset.svgId){const m=document.getElementById(u.dataset.svgId);if(m){const w=m.closest("g");if(w){const b=w.closest(".topiclinks"),x=w.closest(".summary");if(b){t.editArrowLabel(w);return}else if(x){t.editSummary(w);return}}}}if(a.closest(".topiclinks")){const m=a.closest("g");if(m){t.editArrowLabel(m);return}}if(a.closest(".summary")){const m=a.closest("g");if(m){t.editSummary(m);return}}};let s=0;const i=l=>{if(l.pointerType==="mouse")return;const a=new Date().getTime(),u=a-s;u<300&&u>0&&o(l),s=a},r=l=>{e.moved=!1;const a=t.mouseSelectionButton===0?2:0;if(l.button!==a&&l.pointerType==="mouse")return;e.x=l.clientX,e.y=l.clientY;const u=l.target;u.className!=="circle"&&u.contentEditable!=="plaintext-only"&&(e.mousedown=!0,u.setPointerCapture(l.pointerId))},c=l=>{if(l.target.contentEditable!=="plaintext-only"){const a=l.clientX-e.x,u=l.clientY-e.y;e.onMove(a,u)}e.x=l.clientX,e.y=l.clientY},h=l=>{const a=t.mouseSelectionButton===0?2:0;if(l.button!==a&&l.pointerType==="mouse")return;const u=l.target;u.hasPointerCapture&&u.hasPointerCapture(l.pointerId)&&u.releasePointerCapture(l.pointerId),e.clear()},d=l=>{if(l.preventDefault(),l.button!==2||!t.editable)return;const a=l.target;rt(a)&&!a.classList.contains("selected")&&t.selectNode(a),setTimeout(()=>{t.dragMoveHelper.moved||t.bus.fire("showContextMenu",l)},200)},p=l=>{l.stopPropagation(),l.preventDefault(),l.ctrlKey||l.metaKey?l.deltaY<0?at(t,"in",t.dragMoveHelper):t.scaleVal-t.scaleSensitivity>0&&at(t,"out",t.dragMoveHelper):l.shiftKey?t.move(-l.deltaY,0):t.move(-l.deltaX,-l.deltaY)},{container:f}=t;return lt([{dom:f,evt:"pointerdown",func:r},{dom:f,evt:"pointermove",func:c},{dom:f,evt:"pointerup",func:h},{dom:f,evt:"pointerup",func:i},{dom:f,evt:"click",func:n},{dom:f,evt:"dblclick",func:o},{dom:f,evt:"contextmenu",func:d},{dom:f,evt:"wheel",func:typeof t.handleWheel=="function"?t.handleWheel:p}])}function $t(){return{handlers:{},addListener:function(t,e){this.handlers[t]===void 0&&(this.handlers[t]=[]),this.handlers[t].push(e)},fire:function(t,...e){if(this.handlers[t]instanceof Array){const n=this.handlers[t];for(let o=0;o<n.length;o++)n[o](...e)}},removeListener:function(t,e){if(!this.handlers[t])return;const n=this.handlers[t];if(!e)n.length=0;else if(n.length)for(let o=0;o<n.length;o++)n[o]===e&&this.handlers[t].splice(o,1)}}}const Y=document,At=function(){this.nodes.innerHTML="";const t=this.createTopic(this.nodeData);dt.call(this,t,this.nodeData),t.draggable=!1;const e=Y.createElement("me-root");e.appendChild(t);const n=this.nodeData.children||[];if(this.direction===2){let o=0,s=0;n.map(i=>{i.direction===0?o+=1:i.direction===1?s+=1:o<=s?(i.direction=0,o+=1):(i.direction=1,s+=1)})}Nt(this,n,e)},Nt=function(t,e,n){const o=Y.createElement("me-main");o.className=P.LHS;const s=Y.createElement("me-main");s.className=P.RHS;for(let i=0;i<e.length;i++){const r=e[i],{grp:c}=t.createWrapper(r);t.direction===2?r.direction===0?o.appendChild(c):s.appendChild(c):t.direction===0?o.appendChild(c):s.appendChild(c)}t.nodes.appendChild(o),t.nodes.appendChild(n),t.nodes.appendChild(s),t.nodes.appendChild(t.lines),t.nodes.appendChild(t.labelContainer)},Dt=function(t,e){const n=Y.createElement("me-children");for(let o=0;o<e.length;o++){const s=e[o],{grp:i}=t.createWrapper(s);n.appendChild(i)}return n},L=document,ht=function(t,e){const o=(this!=null&&this.el?this.el:e||document).querySelector(`[data-nodeid="me${t}"]`);if(!o)throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);return o},dt=function(t,e){if(t.innerHTML="",e.style){const n=e.style;for(const o in n)t.style[o]=n[o]}if(e.dangerouslySetInnerHTML){t.innerHTML=e.dangerouslySetInnerHTML;return}if(e.image){const n=e.image;if(n.url&&n.width&&n.height){const o=L.createElement("img");o.src=this.imageProxy?this.imageProxy(n.url):n.url,o.style.width=n.width+"px",o.style.height=n.height+"px",n.fit&&(o.style.objectFit=n.fit),t.appendChild(o),t.image=o}}else t.image&&(t.image=void 0);{const n=L.createElement("span");n.className="text",this.markdown?n.innerHTML=this.markdown(e.topic,e):n.textContent=e.topic,t.appendChild(n),t.text=n}if(e.hyperLink){const n=L.createElement("a");n.className="hyper-link",n.target="_blank",n.innerText="🔗",n.href=e.hyperLink,t.appendChild(n),t.link=n}else t.link&&(t.link=void 0);if(e.icons&&e.icons.length){const n=L.createElement("span");n.className="icons",n.innerHTML=e.icons.map(o=>`<span>${kt(o)}</span>`).join(""),t.appendChild(n),t.icons=n}else t.icons&&(t.icons=void 0);if(e.tags&&e.tags.length){const n=L.createElement("div");n.className="tags",e.tags.forEach(o=>{const s=L.createElement("span");typeof o=="string"?s.textContent=o:(s.textContent=o.text,o.className&&(s.className=o.className),o.style&&Object.assign(s.style,o.style)),n.appendChild(s)}),t.appendChild(n),t.tags=n}else t.tags&&(t.tags=void 0)},Mt=function(t,e){const n=L.createElement("me-wrapper"),{p:o,tpc:s}=this.createParent(t);if(n.appendChild(o),!e&&t.children&&t.children.length>0){const i=Ot(t.expanded);if(o.appendChild(i),t.expanded!==!1){const r=Dt(this,t.children);n.appendChild(r)}}return{grp:n,top:o,tpc:s}},Pt=function(t){const e=L.createElement("me-parent"),n=this.createTopic(t);return dt.call(this,n,t),e.appendChild(n),{p:e,tpc:n}},Ht=function(t){const e=L.createElement("me-children");return e.append(...t),e},Bt=function(t){const e=L.createElement("me-tpc");return e.nodeObj=t,e.dataset.nodeid="me"+t.id,e.draggable=this.draggable,e};function ft(t){const e=L.createRange();e.selectNodeContents(t);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(e))}const It=function(t){if(!t)return;const e=L.createElement("div"),n=t.nodeObj,o=n.topic;t.appendChild(e),e.id="input-box",e.textContent=o,e.contentEditable="plaintext-only",e.spellcheck=!1;const s=getComputedStyle(t);e.style.cssText=`min-width:${t.offsetWidth-8}px;
2
+ color:${s.color};
3
+ padding:${s.padding};
4
+ margin:${s.margin};
5
+ font:${s.font};
6
+ background-color:${s.backgroundColor!=="rgba(0, 0, 0, 0)"&&s.backgroundColor};
7
+ border-radius:${s.borderRadius};`,this.direction===0&&(e.style.right="0"),ft(e),this.bus.fire("operation",{name:"beginEdit",obj:t.nodeObj}),e.addEventListener("keydown",i=>{i.stopPropagation();const r=i.key;if(r==="Enter"||r==="Tab"){if(i.shiftKey)return;i.preventDefault(),e.blur(),this.container.focus()}}),e.addEventListener("blur",()=>{var r;if(!e)return;const i=((r=e.textContent)==null?void 0:r.trim())||"";i===""?n.topic=o:(n.topic=i,this.markdown?t.text.innerHTML=this.markdown(n.topic,n):t.text.textContent=i),e.remove(),i!==o&&(this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:n,origin:o}))})},Ot=function(t){const e=L.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},B=document,A="http://www.w3.org/2000/svg",j=function(t){const e=t.clientWidth,n=t.clientHeight,o=t.dataset,s=Number(o.x),i=Number(o.y),r=o.anchor;let c=s;r==="middle"?c=s-e/2:r==="end"&&(c=s-e),t.style.left=`${c}px`,t.style.top=`${i-n/2}px`,t.style.visibility="visible"},nt=function(t,e,n,o){const{anchor:s="middle",color:i,dataType:r,svgId:c}=o,h=document.createElement("div");h.className="svg-label",h.style.color=i||"#666";const d="label-"+c;return h.id=d,h.innerHTML=t,h.dataset.type=r,h.dataset.svgId=c,h.dataset.x=e.toString(),h.dataset.y=n.toString(),h.dataset.anchor=s,h},ut=function(t,e,n){const o=B.createElementNS(A,"path");return S(o,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),o},G=function(t){const e=B.createElementNS(A,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},pt=function(){const t=B.createElementNS(A,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},Wt=function(t,e,n,o){const s=B.createElementNS(A,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((r,c)=>{const h=r.d,d=B.createElementNS(A,"path"),p={d:h,stroke:(o==null?void 0:o.stroke)||"rgb(235, 95, 82)",fill:"none","stroke-linecap":(o==null?void 0:o.strokeLinecap)||"cap","stroke-width":String((o==null?void 0:o.strokeWidth)||"2")};(o==null?void 0:o.opacity)!==void 0&&(p.opacity=String(o.opacity)),S(d,p),c===0&&d.setAttribute("stroke-dasharray",(o==null?void 0:o.strokeDasharray)||"8,2");const f=B.createElementNS(A,"path");S(f,{d:h,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(f),s.appendChild(d),s[r.name]=d}),s},gt=function(t,e,n){if(!e)return;const o=n.label,s=e.cloneNode(!0);t.nodes.appendChild(s),s.id="input-box",s.textContent=o,s.contentEditable="plaintext-only",s.spellcheck=!1,s.style.cssText=`
8
+ left:${e.style.left};
9
+ top:${e.style.top};
10
+ max-width: 200px;
11
+ border: 1px solid #ccc;
12
+ border-radius: 2px;
13
+ `,ft(s),t.scrollIntoView(s),s.addEventListener("keydown",i=>{i.stopPropagation();const r=i.key;if(r==="Enter"||r==="Tab"){if(i.shiftKey)return;i.preventDefault(),s.blur(),t.container.focus()}}),s.addEventListener("blur",()=>{var r;if(!s)return;const i=((r=s.textContent)==null?void 0:r.trim())||"";i===""?n.label=o:n.label=i,s.remove(),i!==o&&(e.textContent=n.label,j(e),"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},Gt=function(t){const e=this.map.querySelector("me-root"),n=e.offsetTop,o=e.offsetLeft,s=e.offsetWidth,i=e.offsetHeight,r=this.map.querySelectorAll("me-main > me-wrapper");this.lines.innerHTML="";for(let c=0;c<r.length;c++){const h=r[c],d=h.querySelector("me-tpc"),{offsetLeft:p,offsetTop:f}=D(this.nodes,d),y=d.offsetWidth,l=d.offsetHeight,a=h.parentNode.className,u=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:f,cL:p,cW:y,cH:l,direction:a,containerHeight:this.nodes.offsetHeight}),g=this.theme.palette,v=d.nodeObj.branchColor||g[c%g.length];if(d.style.borderColor=v,this.lines.appendChild(ut(u,v,"3")),t&&t!==h)continue;const m=G("subLines"),w=h.lastChild;w.tagName==="svg"&&w.remove(),h.appendChild(m),mt(this,m,v,h,a,!0)}this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},mt=function(t,e,n,o,s,i){const r=o.firstChild,c=o.children[1].children;if(c.length===0)return;const h=r.offsetTop,d=r.offsetLeft,p=r.offsetWidth,f=r.offsetHeight;for(let y=0;y<c.length;y++){const l=c[y],a=l.firstChild,u=a.offsetTop,g=a.offsetLeft,v=a.offsetWidth,m=a.offsetHeight,w=a.firstChild.nodeObj.branchColor||n,b=t.generateSubBranch({pT:h,pL:d,pW:p,pH:f,cT:u,cL:g,cW:v,cH:m,direction:s,isFirst:i});e.appendChild(ut(b,w,"2"));const x=a.children[1];if(x){if(!x.expanded)continue}else continue;mt(t,e,w,l,s)}},Qe="",Ft='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" p-id="2022"></path></svg>',Rt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="currentColor" p-id="1776"></path></svg>',Vt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="currentColor" p-id="3038"></path></svg>',Yt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" p-id="2171"></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" p-id="2172"></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" p-id="2173"></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" p-id="2174"></path></svg>',jt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169573443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2883" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="currentColor" p-id="2884"></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="currentColor" p-id="2885"></path></svg>',zt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169419447" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" p-id="2481"></path></svg>',Xt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169426515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" p-id="2731"></path></svg>',Ze="",qt={side:Ft,left:Rt,right:Vt,full:Yt,living:jt,zoomin:zt,zoomout:Xt},H=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=qt[e],n};function _t(t){const e=document.createElement("div"),n=H("fullscreen","full"),o=H("toCenter","living"),s=H("zoomout","zoomout"),i=H("zoomin","zoomin"),r=document.createElement("span");return r.innerText="100%",e.appendChild(n),e.appendChild(o),e.appendChild(s),e.appendChild(i),e.className="mind-elixir-toolbar rb",n.onclick=()=>{document.fullscreenElement===t.el?document.exitFullscreen():t.el.requestFullscreen()},o.onclick=()=>{t.toCenter()},s.onclick=()=>{t.scale(t.scaleVal-t.scaleSensitivity)},i.onclick=()=>{t.scale(t.scaleVal+t.scaleSensitivity)},e}function Ut(t){const e=document.createElement("div"),n=H("tbltl","left"),o=H("tbltr","right"),s=H("tblts","side");return e.appendChild(n),e.appendChild(o),e.appendChild(s),e.className="mind-elixir-toolbar lt",n.onclick=()=>{t.initLeft()},o.onclick=()=>{t.initRight()},s.onclick=()=>{t.initSide()},e}function Kt(t){t.container.append(_t(t)),t.container.append(Ut(t))}const Jt=function(t,e=!0){this.theme=t;const o={...(t.type==="dark"?Z:Q).cssVar,...t.cssVar},s=Object.keys(o);for(let i=0;i<s.length;i++){const r=s[i];this.container.style.setProperty(r,o[r])}e&&this.refresh()},Qt=function(t){const n=t.parentElement.parentElement.lastElementChild;(n==null?void 0:n.tagName)==="svg"&&(n==null||n.remove())};function Zt(t){return{nodeData:t.isFocusMode?t.nodeDataBackup:t.nodeData,arrows:t.arrows,summaries:t.summaries,direction:t.direction,theme:t.theme}}const te=function(t){const e=this.container,n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.top>o.bottom||n.bottom<o.top||n.left>o.right||n.right<o.left){const i=n.left+n.width/2,r=n.top+n.height/2,c=o.left+o.width/2,h=o.top+o.height/2,d=i-c,p=r-h;this.move(-d,-p,!0)}},ee=function(t,e,n){this.clearSelection(),this.scrollIntoView(t),this.selection.select(t),e&&this.bus.fire("selectNewNode",t.nodeObj)},ne=function(t){this.selection.select(t)},oe=function(t){this.selection.deselect(t)},se=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},ie=function(){const t=Zt(this);return JSON.stringify(t,(e,n)=>{if(!(e==="parent"&&typeof n!="string"))return n})},re=function(){return JSON.parse(this.getDataString())},ce=function(){this.editable=!0},le=function(){this.editable=!1},ae=function(t,e={x:0,y:0}){if(t<this.scaleMin||t>this.scaleMax)return;const n=this.container.getBoundingClientRect(),o=e.x?e.x-n.left-n.width/2:0,s=e.y?e.y-n.top-n.height/2:0,{dx:i,dy:r}=yt(this),c=this.map.style.transform,{x:h,y:d}=ct(c),p=h-i,f=d-r,y=this.scaleVal,l=(-o+p)*(1-t/y),a=(-s+f)*(1-t/y);this.map.style.transform=`translate(${h-l}px, ${d-a}px) scale(${t})`,this.scaleVal=t,this.bus.fire("scale",t)},he=function(){const t=this.nodes.offsetHeight/this.container.offsetHeight,e=this.nodes.offsetWidth/this.container.offsetWidth,n=1/Math.max(1,Math.max(t,e));this.scaleVal=n,this.map.style.transform="scale("+n+")",this.bus.fire("scale",n)},de=function(t,e,n=!1){const{map:o,scaleVal:s,bus:i}=this,r=o.style.transform;let{x:c,y:h}=ct(r);c+=t,h+=e,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate(${c}px, ${h}px) scale(${s})`,i.fire("move",{dx:t,dy:e})},yt=t=>{const{container:e,map:n,nodes:o}=t,s=n.querySelector("me-root"),i=s.offsetTop,r=s.offsetLeft,c=s.offsetWidth,h=s.offsetHeight;let d,p;return t.alignment==="root"?(d=e.offsetWidth/2-r-c/2,p=e.offsetHeight/2-i-h/2,n.style.transformOrigin=`${r+c/2}px 50%`):(d=(e.offsetWidth-o.offsetWidth)/2,p=(e.offsetHeight-o.offsetHeight)/2,n.style.transformOrigin="50% 50%"),{dx:d,dy:p}},fe=Object.freeze(Object.defineProperty({__proto__:null,cancelFocus:function(){this.isFocusMode=!1,this.tempDirection!==null&&(this.nodeData=this.nodeDataBackup,this.direction=this.tempDirection,this.tempDirection=null,this.refresh(),this.toCenter())},clearSelection:se,disableEdit:le,enableEdit:ce,expandNode:function(t,e){const n=t.nodeObj;typeof e=="boolean"?n.expanded=e:n.expanded!==!1?n.expanded=!1:n.expanded=!0;const o=t.getBoundingClientRect(),s={x:o.left,y:o.top},i=t.parentNode,r=i.children[1];if(r.expanded=n.expanded,r.className=n.expanded?"minus":"",Qt(t),n.expanded){const f=this.createChildren(n.children.map(y=>this.createWrapper(y).grp));i.parentNode.appendChild(f)}else i.parentNode.children[1].remove();this.linkDiv(t.closest("me-main > me-wrapper"));const c=t.getBoundingClientRect(),h={x:c.left,y:c.top},d=s.x-h.x,p=s.y-h.y;this.move(d,p),this.bus.fire("expandNode",n)},expandNodeAll:function(t,e){const n=t.nodeObj,o=t.getBoundingClientRect(),s={x:o.left,y:o.top};et(n,e??!n.expanded),this.refresh();const i=this.findEle(n.id).getBoundingClientRect(),r={x:i.left,y:i.top},c=s.x-r.x,h=s.y-r.y;this.move(c,h)},focusNode:function(t){t.nodeObj.parent&&(this.clearSelection(),this.tempDirection===null&&(this.tempDirection=this.direction),this.isFocusMode||(this.nodeDataBackup=this.nodeData,this.isFocusMode=!0),this.nodeData=t.nodeObj,this.initRight(),this.toCenter())},getData:re,getDataString:ie,initLeft:function(){this.direction=0,this.refresh(),this.toCenter()},initRight:function(){this.direction=1,this.refresh(),this.toCenter()},initSide:function(){this.direction=2,this.refresh(),this.toCenter()},install:function(t){t(this)},move:de,refresh:function(t){this.clearSelection(),t&&(t=JSON.parse(JSON.stringify(t)),this.nodeData=t.nodeData,this.arrows=t.arrows||[],this.summaries=t.summaries||[],t.theme&&this.changeTheme(t.theme)),tt(this.nodeData),this.layout(),this.linkDiv()},scale:ae,scaleFit:he,scrollIntoView:te,selectNode:ee,selectNodes:ne,setLocale:function(t){this.locale=t,this.refresh()},toCenter:function(){const{map:t}=this,{dx:e,dy:n}=yt(this);t.style.transform=`translate(${e}px, ${n}px) scale(${this.scaleVal})`},unselectNodes:oe},Symbol.toStringTag,{value:"Module"})),vt={create:function(t){return{dom:t,moved:!1,pointerdown:!1,lastX:0,lastY:0,handlePointerMove(e){if(this.pointerdown){this.moved=!0;const n=e.clientX-this.lastX,o=e.clientY-this.lastY;this.lastX=e.clientX,this.lastY=e.clientY,this.cb&&this.cb(n,o)}},handlePointerDown(e){e.button===0&&(this.pointerdown=!0,this.lastX=e.clientX,this.lastY=e.clientY,this.dom.setPointerCapture(e.pointerId))},handleClear(e){this.pointerdown=!1,e.pointerId!==void 0&&this.dom.releasePointerCapture(e.pointerId)},cb:null,init(e,n){this.cb=n,this.handleClear=this.handleClear.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this),this.destroy=lt([{dom:e,evt:"pointermove",func:this.handlePointerMove},{dom:e,evt:"pointerleave",func:this.handleClear},{dom:e,evt:"pointerup",func:this.handleClear},{dom:this.dom,evt:"pointerdown",func:this.handlePointerDown}])},destroy:null,clear(){this.moved=!1,this.pointerdown=!1}}}},ue="#4dc4ff";function wt(t,e,n,o,s,i,r,c){return{x:t/8+n*3/8+s*3/8+r/8,y:e/8+o*3/8+i*3/8+c/8}}function pe(t,e,n){t&&(t.dataset.x=e.toString(),t.dataset.y=n.toString(),j(t))}function z(t,e,n,o,s){S(t,{x1:e+"",y1:n+"",x2:o+"",y2:s+""})}function bt(t,e,n,o,s,i,r,c,h,d){var u;const p=`M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${h}`;if(t.line.setAttribute("d",p),d.style){const g=d.style;g.stroke&&t.line.setAttribute("stroke",g.stroke),g.strokeWidth&&t.line.setAttribute("stroke-width",String(g.strokeWidth)),g.strokeDasharray&&t.line.setAttribute("stroke-dasharray",g.strokeDasharray),g.strokeLinecap&&t.line.setAttribute("stroke-linecap",g.strokeLinecap),g.opacity!==void 0&&t.line.setAttribute("opacity",String(g.opacity))}const f=t.querySelectorAll('path[stroke="transparent"]');f.length>0&&f[0].setAttribute("d",p);const y=V(i,r,c,h);if(y){const g=`M ${y.x1} ${y.y1} L ${c} ${h} L ${y.x2} ${y.y2}`;if(t.arrow1.setAttribute("d",g),f.length>1&&f[1].setAttribute("d",g),d.style){const v=d.style;v.stroke&&t.arrow1.setAttribute("stroke",v.stroke),v.strokeWidth&&t.arrow1.setAttribute("stroke-width",String(v.strokeWidth)),v.strokeLinecap&&t.arrow1.setAttribute("stroke-linecap",v.strokeLinecap),v.opacity!==void 0&&t.arrow1.setAttribute("opacity",String(v.opacity))}}if(d.bidirectional){const g=V(o,s,e,n);if(g){const v=`M ${g.x1} ${g.y1} L ${e} ${n} L ${g.x2} ${g.y2}`;if(t.arrow2.setAttribute("d",v),f.length>2&&f[2].setAttribute("d",v),d.style){const m=d.style;m.stroke&&t.arrow2.setAttribute("stroke",m.stroke),m.strokeWidth&&t.arrow2.setAttribute("stroke-width",String(m.strokeWidth)),m.strokeLinecap&&t.arrow2.setAttribute("stroke-linecap",m.strokeLinecap),m.opacity!==void 0&&t.arrow2.setAttribute("opacity",String(m.opacity))}}}const{x:l,y:a}=wt(e,n,o,s,i,r,c,h);if(t.labelElement&&pe(t.labelElement,l,a),(u=d.style)!=null&&u.labelColor){const g=t.label.querySelector("div");g&&(g.style.color=d.style.labelColor)}Ce(t)}function X(t,e,n){const{offsetLeft:o,offsetTop:s}=D(t.nodes,e),i=e.offsetWidth,r=e.offsetHeight,c=o+i/2,h=s+r/2,d=c+n.x,p=h+n.y;return{w:i,h:r,cx:c,cy:h,ctrlX:d,ctrlY:p}}function I(t){let e,n;const o=(t.cy-t.ctrlY)/(t.ctrlX-t.cx);return o>t.h/t.w||o<-t.h/t.w?t.cy-t.ctrlY<0?(e=t.cx-t.h/2/o,n=t.cy+t.h/2):(e=t.cx+t.h/2/o,n=t.cy-t.h/2):t.cx-t.ctrlX<0?(e=t.cx+t.w/2,n=t.cy-t.w*o/2):(e=t.cx-t.w/2,n=t.cy+t.w*o/2),{x:e,y:n}}const ot=function(t,e,n,o,s){var M;if(!e||!n)return;const i=X(t,e,o.delta1),r=X(t,n,o.delta2),{x:c,y:h}=I(i),{ctrlX:d,ctrlY:p}=i,{ctrlX:f,ctrlY:y}=r,{x:l,y:a}=I(r),u=V(f,y,l,a);if(!u)return;const g=`M ${u.x1} ${u.y1} L ${l} ${a} L ${u.x2} ${u.y2}`;let v="";if(o.bidirectional){const $=V(d,p,c,h);if(!$)return;v=`M ${$.x1} ${$.y1} L ${c} ${h} L ${$.x2} ${$.y2}`}const m=Wt(`M ${c} ${h} C ${d} ${p} ${f} ${y} ${l} ${a}`,g,v,o.style),{x:w,y:b}=wt(c,h,d,p,f,y,l,a),x=(M=o.style)==null?void 0:M.labelColor,E="arrow-"+o.id;m.id=E;const C=nt(o.label,w,b,{anchor:"middle",color:x,dataType:"link-label",svgId:E});t.labelContainer.appendChild(C),j(C);const k=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");m.label=k,m.labelElement=C,m.arrowObj=o,m.dataset.linkid=o.id,t.linkSvgGroup.appendChild(m),s||(t.arrows.push(o),t.currentArrow=m,xt(t,o,i,r))},ge=function(t,e,n={}){const o={id:W(),label:"Custom Link",from:t.nodeObj.id,to:e.nodeObj.id,delta1:{x:t.offsetWidth/2+100,y:0},delta2:{x:e.offsetWidth/2+100,y:0},...n};ot(this,t,e,o),this.bus.fire("operation",{name:"createArrow",obj:o})},me=function(t){q(this);const e={...t,id:W()};ot(this,this.findEle(e.from),this.findEle(e.to),e),this.bus.fire("operation",{name:"createArrow",obj:e})},ye=function(t){let e;if(t?e=t:e=this.currentArrow,!e)return;q(this);const n=e.arrowObj.id;this.arrows=this.arrows.filter(o=>o.id!==n),e.remove(),this.bus.fire("operation",{name:"removeArrow",obj:{id:n}})},ve=function(t){this.currentArrow=t;const e=t.arrowObj,n=this.findEle(e.from),o=this.findEle(e.to),s=X(this,n,e.delta1),i=X(this,o,e.delta2);xt(this,e,s,i)},we=function(){q(this),this.currentArrow=null},st=function(t,e){const n=document.createElementNS(A,"path");return S(n,{d:t,stroke:e,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},be=function(t,e){const n=document.createElementNS(A,"g");n.setAttribute("class","arrow-highlight"),n.setAttribute("opacity","0.45");const o=st(t.line.getAttribute("d"),e);n.appendChild(o);const s=st(t.arrow1.getAttribute("d"),e);if(n.appendChild(s),t.arrow2.getAttribute("d")){const i=st(t.arrow2.getAttribute("d"),e);n.appendChild(i)}t.insertBefore(n,t.firstChild)},xe=function(t){const e=t.querySelector(".arrow-highlight");e&&e.remove()},Ce=function(t){const e=t.querySelector(".arrow-highlight");if(!e)return;const n=e.querySelectorAll("path");n.length>=1&&n[0].setAttribute("d",t.line.getAttribute("d")),n.length>=2&&n[1].setAttribute("d",t.arrow1.getAttribute("d")),n.length>=3&&t.arrow2.getAttribute("d")&&n[2].setAttribute("d",t.arrow2.getAttribute("d"))},q=function(t){var e,n;(e=t.helper1)==null||e.destroy(),(n=t.helper2)==null||n.destroy(),t.linkController.style.display="none",t.P2.style.display="none",t.P3.style.display="none",t.currentArrow&&xe(t.currentArrow)},xt=function(t,e,n,o){const{linkController:s,P2:i,P3:r,line1:c,line2:h,nodes:d,map:p,currentArrow:f,bus:y}=t;if(!f)return;s.style.display="initial",i.style.display="initial",r.style.display="initial",d.appendChild(s),d.appendChild(i),d.appendChild(r),be(f,ue);let{x:l,y:a}=I(n),{ctrlX:u,ctrlY:g}=n,{ctrlX:v,ctrlY:m}=o,{x:w,y:b}=I(o);i.style.cssText=`top:${g}px;left:${u}px;`,r.style.cssText=`top:${m}px;left:${v}px;`,z(c,l,a,u,g),z(h,v,m,w,b),t.helper1=vt.create(i),t.helper2=vt.create(r),t.helper1.init(p,(x,E)=>{u=u+x/t.scaleVal,g=g+E/t.scaleVal;const C=I({...n,ctrlX:u,ctrlY:g});l=C.x,a=C.y,i.style.top=g+"px",i.style.left=u+"px",bt(f,l,a,u,g,v,m,w,b,e),z(c,l,a,u,g),e.delta1.x=u-n.cx,e.delta1.y=g-n.cy,y.fire("updateArrowDelta",e)}),t.helper2.init(p,(x,E)=>{v=v+x/t.scaleVal,m=m+E/t.scaleVal;const C=I({...o,ctrlX:v,ctrlY:m});w=C.x,b=C.y,r.style.top=m+"px",r.style.left=v+"px",bt(f,l,a,u,g,v,m,w,b,e),z(h,v,m,w,b),e.delta2.x=v-o.cx,e.delta2.y=m-o.cy,y.fire("updateArrowDelta",e)})};function Se(){this.linkSvgGroup.innerHTML="";for(let t=0;t<this.arrows.length;t++){const e=this.arrows[t];try{ot(this,this.findEle(e.from),this.findEle(e.to),e,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function Ee(t){q(this),t&&t.labelElement&&gt(this,t.labelElement,t.arrowObj)}function ke(){this.arrows=this.arrows.filter(t=>R(t.from,this.nodeData)&&R(t.to,this.nodeData))}const Le=Object.freeze(Object.defineProperty({__proto__:null,createArrow:ge,createArrowFrom:me,editArrowLabel:Ee,removeArrow:ye,renderArrow:Se,selectArrow:ve,tidyArrow:ke,unselectArrow:we},Symbol.toStringTag,{value:"Module"})),Te=function(t){var h,d;if(t.length===0)throw new Error("No selected node.");if(t.length===1){const p=t[0].nodeObj,f=t[0].nodeObj.parent;if(!f)throw new Error("Can not select root node.");const y=f.children.findIndex(l=>p===l);return{parent:f.id,start:y,end:y}}let e=0;const n=t.map(p=>{let f=p.nodeObj;const y=[];for(;f.parent;){const l=f.parent,a=l.children,u=a==null?void 0:a.indexOf(f);f=l,y.unshift({node:f,index:u})}return y.length>e&&(e=y.length),y});let o=0;t:for(;o<e;o++){const p=(h=n[0][o])==null?void 0:h.node;for(let f=1;f<n.length;f++)if(((d=n[f][o])==null?void 0:d.node)!==p)break t}if(!o)throw new Error("Can not select root node.");const s=n.map(p=>p[o-1].index).sort(),i=s[0]||0,r=s[s.length-1]||0,c=n[0][o-1].node;if(!c.parent)throw new Error("Please select nodes in the same main topic.");return{parent:c.id,start:i,end:r}},$e=function(t){const e=document.createElementNS(A,"g");return e.setAttribute("id",t),e},Ct=function(t,e){const n=document.createElementNS(A,"path");return S(n,{d:t,stroke:e||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},Ae=t=>t.parentElement.parentElement,Ne=function(t,{parent:e,start:n}){const o=t.findEle(e),s=o.nodeObj;let i;return s.parent?i=o.closest("me-main").className:i=t.findEle(s.children[n].id).closest("me-main").className,i},it=function(t,e){var M;const{id:n,label:o,parent:s,start:i,end:r}=e,{nodes:c,theme:h,summarySvg:d}=t,f=t.findEle(s).nodeObj,y=Ne(t,e);let l=1/0,a=0,u=0,g=0;for(let $=i;$<=r;$++){const F=(M=f.children)==null?void 0:M[$];if(!F)return t.removeSummary(n),null;const K=Ae(t.findEle(F.id)),{offsetLeft:J,offsetTop:St}=D(c,K),Et=i===r?10:20;$===i&&(u=St+Et),$===r&&(g=St+K.offsetHeight-Et),J<l&&(l=J),K.offsetWidth+J>a&&(a=K.offsetWidth+J)}let v,m;const w=u+10,b=g+10,x=(w+b)/2,E=h.cssVar["--color"],C="s-"+n;y===P.LHS?(v=Ct(`M ${l+10} ${w} c -5 0 -10 5 -10 10 L ${l} ${b-10} c 0 5 5 10 10 10 M ${l} ${x} h -10`,E),m=nt(o,l-20,x,{anchor:"end",color:E,dataType:"s-label",svgId:C})):(v=Ct(`M ${a-10} ${w} c 5 0 10 5 10 10 L ${a} ${b-10} c 0 5 -5 10 -10 10 M ${a} ${x} h 10`,E),m=nt(o,a+20,x,{anchor:"start",color:E,dataType:"s-label",svgId:C}));const k=$e(C);return k.appendChild(v),t.labelContainer.appendChild(m),j(m),k.summaryObj=e,k.labelElement=m,d.appendChild(k),k},De=Object.freeze(Object.defineProperty({__proto__:null,createSummary:function(){if(!this.currentNodes)return;const{currentNodes:t,summaries:e,bus:n}=this,{parent:o,start:s,end:i}=Te(t),r={id:W(),parent:o,start:s,end:i,label:"summary"},c=it(this,r);e.push(r),this.editSummary(c),n.fire("operation",{name:"createSummary",obj:r})},createSummaryFrom:function(t){const e=W(),n={...t,id:e};it(this,n),this.summaries.push(n),this.bus.fire("operation",{name:"createSummary",obj:n})},editSummary:function(t){t&&t.labelElement&&gt(this,t.labelElement,t.summaryObj)},removeSummary:function(t){var n,o;const e=this.summaries.findIndex(s=>s.id===t);e>-1&&(this.summaries.splice(e,1),(n=this.nodes.querySelector("#s-"+t))==null||n.remove(),(o=this.nodes.querySelector("#label-s-"+t))==null||o.remove()),this.bus.fire("operation",{name:"removeSummary",obj:{id:t}})},renderSummary:function(){this.summarySvg.innerHTML="",this.summaries.forEach(t=>{try{it(this,t)}catch{}}),this.nodes.insertAdjacentElement("beforeend",this.summarySvg)},selectSummary:function(t){const e=t.labelElement;e&&e.classList.add("selected"),this.currentSummary=t},unselectSummary:function(){var t,e;(e=(t=this.currentSummary)==null?void 0:t.labelElement)==null||e.classList.remove("selected"),this.currentSummary=null}},Symbol.toStringTag,{value:"Module"})),T="http://www.w3.org/2000/svg";function Me(t,e){const n=document.createElementNS(T,"svg");return S(n,{version:"1.1",xmlns:T,height:t,width:e}),n}function Pe(t,e){return(parseInt(t)-parseInt(e))/2}function He(t,e,n,o){const s=document.createElementNS(T,"g");let i="";return t.text?i=t.text.textContent:i=t.childNodes[0].textContent,i.split(`
14
+ `).forEach((c,h)=>{const d=document.createElementNS(T,"text");S(d,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+Pe(e.lineHeight,e.fontSize)*(h+1)+parseFloat(e.fontSize)*(h+1)+"","text-anchor":"start","font-family":e.fontFamily,"font-size":`${e.fontSize}`,"font-weight":`${e.fontWeight}`,fill:`${e.color}`}),d.innerHTML=c,s.appendChild(d)}),s}function Be(t,e,n,o){var c;let s="";(c=t.nodeObj)!=null&&c.dangerouslySetInnerHTML?s=t.nodeObj.dangerouslySetInnerHTML:t.text?s=t.text.textContent:s=t.childNodes[0].textContent;const i=document.createElementNS(T,"foreignObject");S(i,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+"",width:e.width,height:e.height});const r=document.createElement("div");return S(r,{xmlns:"http://www.w3.org/1999/xhtml",style:`font-family: ${e.fontFamily}; font-size: ${e.fontSize}; font-weight: ${e.fontWeight}; color: ${e.color}; white-space: pre-wrap;`}),r.innerHTML=s,i.appendChild(r),i}function Ie(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=D(t.nodes,e),i=document.createElementNS(T,"rect");return S(i,{x:o+"",y:s+"",rx:n.borderRadius,ry:n.borderRadius,width:n.width,height:n.height,fill:n.backgroundColor,stroke:n.borderColor,"stroke-width":n.borderWidth}),i}function _(t,e,n=!1){const o=getComputedStyle(e),{offsetLeft:s,offsetTop:i}=D(t.nodes,e),r=document.createElementNS(T,"rect");S(r,{x:s+"",y:i+"",rx:o.borderRadius,ry:o.borderRadius,width:o.width,height:o.height,fill:o.backgroundColor,stroke:o.borderColor,"stroke-width":o.borderWidth});const c=document.createElementNS(T,"g");c.appendChild(r);let h;return n?h=Be(e,o,s,i):h=He(e,o,s,i),c.appendChild(h),c}function Oe(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=D(t.nodes,e),i=document.createElementNS(T,"a"),r=document.createElementNS(T,"text");return S(r,{x:o+"",y:s+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),r.innerHTML=e.textContent,i.appendChild(r),i.setAttribute("href",e.href),i}function We(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=D(t.nodes,e),i=document.createElementNS(T,"image");return S(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:e.src}),i}const U=100,Ge='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',Fe=(t,e=!1)=>{var f,y,l;const n=t.nodes,o=n.offsetHeight+U*2,s=n.offsetWidth+U*2,i=Me(o+"px",s+"px"),r=document.createElementNS(T,"svg"),c=document.createElementNS(T,"rect");S(c,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:t.theme.cssVar["--bgcolor"]}),i.appendChild(c),n.querySelectorAll(".subLines").forEach(a=>{const u=a.cloneNode(!0),{offsetLeft:g,offsetTop:v}=D(n,a.parentElement);u.setAttribute("x",`${g}`),u.setAttribute("y",`${v}`),r.appendChild(u)});const h=(f=n.querySelector(".lines"))==null?void 0:f.cloneNode(!0);h&&r.appendChild(h);const d=(y=n.querySelector(".topiclinks"))==null?void 0:y.cloneNode(!0);d&&r.appendChild(d);const p=(l=n.querySelector(".summary"))==null?void 0:l.cloneNode(!0);return p&&r.appendChild(p),n.querySelectorAll("me-tpc").forEach(a=>{a.nodeObj.dangerouslySetInnerHTML?r.appendChild(_(t,a,!e)):(r.appendChild(Ie(t,a)),r.appendChild(_(t,a.text,!e)))}),n.querySelectorAll(".tags > span").forEach(a=>{r.appendChild(_(t,a))}),n.querySelectorAll(".icons > span").forEach(a=>{r.appendChild(_(t,a))}),n.querySelectorAll(".hyper-link").forEach(a=>{r.appendChild(Oe(t,a))}),n.querySelectorAll("img").forEach(a=>{r.appendChild(We(t,a))}),S(r,{x:U+"",y:U+"",overflow:"visible"}),i.appendChild(r),i},Re=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),Ge+t.outerHTML);function Ve(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=s=>{e(s.target.result)},o.onerror=s=>{n(s)},o.readAsDataURL(t)})}const Ye={getObjById:R,generateNewObj:Lt,layout:At,linkDiv:Gt,editTopic:It,createWrapper:Mt,createParent:Pt,createChildren:Ht,createTopic:Bt,findEle:ht,changeTheme:Jt,...fe,...{},...Le,...De,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(t=!1,e){const n=this.exportSvg(t,e),o=await Ve(n);return new Promise((s,i)=>{const r=new Image;r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{const c=document.createElement("canvas");c.width=r.width,c.height=r.height,c.getContext("2d").drawImage(r,0,0),c.toBlob(s,"image/png",1)},r.src=o,r.onerror=i})},exportSvg:function(t=!1,e){const n=Fe(this,t),o=Re(n,e);return new Blob([o],{type:"image/svg+xml"})}},Symbol.toStringTag,{value:"Module"})),init(t){if(t=JSON.parse(JSON.stringify(t)),!t||!t.nodeData)return new Error("MindElixir: `data` is required");t.direction!==void 0&&(this.direction=t.direction),this.changeTheme(t.theme||this.theme,!1),this.nodeData=t.nodeData,tt(this.nodeData),this.arrows=t.arrows||[],this.summaries=t.summaries||[],this.tidyArrow(),this.toolBar&&Kt(this),this.layout(),this.linkDiv(),this.toCenter()},destroy(){var t;this.disposable.forEach(e=>e()),this.el&&(this.el.innerHTML=""),this.el=void 0,this.nodeData=void 0,this.arrows=void 0,this.summaries=void 0,this.currentArrow=void 0,this.currentNodes=void 0,this.currentSummary=void 0,this.waitCopy=void 0,this.theme=void 0,this.direction=void 0,this.bus=void 0,this.container=void 0,this.map=void 0,this.lines=void 0,this.linkController=void 0,this.linkSvgGroup=void 0,this.P2=void 0,this.P3=void 0,this.line1=void 0,this.line2=void 0,this.nodes=void 0,(t=this.selection)==null||t.destroy(),this.selection=void 0}};function je({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:h,containerHeight:d}){let p=e+n/2;const f=t+o/2;let y;h===P.LHS?y=i+r:y=i;const l=s+c/2,u=(1-Math.abs(l-f)/d)*.25*(n/2);return h===P.LHS?p=p-n/10-u:p=p+n/10+u,`M ${p} ${f} Q ${p} ${l} ${y} ${l}`}function ze({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:h,isFirst:d}){const p=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let f=0,y=0;d?f=t+o/2:f=t+o;const l=s+c;let a=0,u=0,g=0;const v=Math.abs(f-l)/300*p;return h===P.LHS?(g=e,a=g+p,u=g-p,y=i+p,`M ${a} ${f} C ${g} ${f} ${g+v} ${l} ${u} ${l} H ${y}`):(g=e+n,a=g-p,u=g+p,y=i+r-p,`M ${a} ${f} C ${g} ${f} ${g-v} ${l} ${u} ${l} H ${y}`)}const Xe="5.2.0-beta.1";function qe(t){return{x:0,y:0,moved:!1,mousedown:!1,onMove(e,n){this.mousedown&&(this.moved=!0,t.move(e,n))},clear(){this.mousedown=!1}}}const O=document;function N({el:t,direction:e,locale:n,draggable:o,editable:s,contextMenu:i,toolBar:r,keypress:c,mouseSelectionButton:h,selectionContainer:d,before:p,newTopicName:f,allowUndo:y,generateMainBranch:l,generateSubBranch:a,overflowHidden:u,theme:g,alignment:v,scaleSensitivity:m,scaleMax:w,scaleMin:b,handleWheel:x,markdown:E,imageProxy:C}){let k=null;const M=Object.prototype.toString.call(t);if(M==="[object HTMLDivElement]"?k=t:M==="[object String]"&&(k=document.querySelector(t)),!k)throw new Error("MindElixir: el is not a valid element");k.style.position="relative",k.innerHTML="",this.el=k,this.disposable=[],this.before=p||{},this.locale=n||"en",this.newTopicName=f||"New Node",this.contextMenu=i??!0,this.toolBar=r??!0,this.keypress=c??!0,this.mouseSelectionButton=h??0,this.direction=e??1,this.draggable=o??!0,this.editable=s??!0,this.allowUndo=y??!0,this.scaleSensitivity=m??.1,this.scaleMax=w??1.4,this.scaleMin=b??.2,this.generateMainBranch=l||je,this.generateSubBranch=a||ze,this.overflowHidden=u??!1,this.alignment=v??"root",this.handleWheel=x??!0,this.markdown=E||void 0,this.imageProxy=C||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.dragMoveHelper=qe(this),this.bus=$t(),this.container=O.createElement("div"),this.selectionContainer=d||this.container,this.container.className="map-container";const $=window.matchMedia("(prefers-color-scheme: dark)");this.theme=g||($.matches?Z:Q);const F=O.createElement("div");F.className="map-canvas",this.map=F,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=O.createElement("me-nodes"),this.lines=G("lines"),this.summarySvg=G("summary"),this.linkController=G("linkcontroller"),this.P2=O.createElement("div"),this.P3=O.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=pt(),this.line2=pt(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=G("topiclinks"),this.labelContainer=O.createElement("div"),this.labelContainer.className="label-container",this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push(Tt(this))}return N.prototype=Ye,Object.defineProperty(N.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),N.LEFT=0,N.RIGHT=1,N.SIDE=2,N.THEME=Q,N.DARK_THEME=Z,N.version=Xe,N.E=ht,N}();