mind-elixir 5.14.0-beta.1 → 5.14.0

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.
@@ -8,9 +8,9 @@ var MindElixirLite=(function($){"use strict";const z={name:"Latte",type:"light",
8
8
  margin:${r.margin};
9
9
  background-color:${r.backgroundColor!=="rgba(0, 0, 0, 0)"&&r.backgroundColor};
10
10
  border: ${r.border};
11
- border-radius:${r.borderRadius}; `,this.direction===0&&(e.style.right="0"),t.style.opacity="0",vt(e),this.bus.fire("operation",{name:"beginEdit",obj:t.nodeObj}),e.addEventListener("keydown",l=>{if(l.stopPropagation(),l.isComposing)return;const a=l.key;if(a==="Enter"||a==="Tab"){if(l.shiftKey)return;l.preventDefault(),e.blur(),this.container.focus()}else a==="Escape"&&(l.preventDefault(),e.textContent=o,e.blur(),this.container.focus())}),e.addEventListener("blur",()=>{if(!e)return;t.style.opacity="1",e.remove();const l=e.innerText?.trim()||"";l===o||l===""||(n.topic=l,this.markdown?t.text.innerHTML=this.markdown(n.topic,n):t.text.textContent=l,this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:n,origin:o}))})},ee=function(t){const e=document.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},ne=function(t){const n=t.parentElement.parentElement.lastElementChild;n?.tagName==="svg"&&n?.remove()};function oe(t){return{nodeData:t.isFocusMode?t.nodeDataBackup:t.nodeData,arrows:t.arrows,summaries:t.summaries,direction:t.direction,theme:t.theme,compact:t.compact,meta:t.meta}}const se=function(t,e=!1){const n=this.container,o=t.getBoundingClientRect(),s=n.getBoundingClientRect();if(e||o.top>s.bottom-50||o.bottom<s.top+50||o.left>s.right-50||o.right<s.left+50){const r=o.left+o.width/2,l=o.top+o.height/2,a=s.left+s.width/2,d=s.top+s.height/2,f=r-a,c=l-d;this.move(-f,-c,!0)}},ie=function(t,e,n){this.clearSelection(),this.scrollIntoView(t),this.selection?.select(t),e&&this.bus.fire("selectNewNode",t.nodeObj)},re=function(t){this.selection?.select(t)},le=function(t){this.selection?.deselect(t)},ce=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},wt=function(t){return JSON.stringify(t,(e,n)=>{if(!(e==="parent"&&typeof n!="string"))return n})},ae=function(){const t=oe(this);return wt(t)},he=function(){return JSON.parse(this.getDataString())},de=function(){this.editable=!0},fe=function(){this.editable=!1},ue=function(t,e={x:0,y:0}){if(t<this.scaleMin&&t<this.scaleVal||t>this.scaleMax&&t>this.scaleVal)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}=ot(this),l=this.map.style.transform,{x:a,y:d}=nt(l),f=a-i,c=d-r,u=this.scaleVal,g=(-o+f)*(1-t/u),y=(-s+c)*(1-t/u);this.map.style.transform=`translate3d(${a-g}px, ${d-y}px, 0) scale(${t})`,this.scaleVal=t,this.bus.fire("scale",t)},pe=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;const{dx:o,dy:s}=ot(this,!0);this.map.style.transform=`translate3d(${o}px, ${s}px, 0) scale(${n})`,this.bus.fire("scale",n)},ge=function(t,e,n=!1){const{map:o,scaleVal:s,bus:i,container:r,nodes:l}=this;if(n&&o.style.transition==="transform 0.3s")return;const a=o.style.transform;let{x:d,y:f}=nt(a);const c=r.getBoundingClientRect(),u=l.getBoundingClientRect(),g=u.left<c.right&&u.right>c.left,y=u.top<c.bottom&&u.bottom>c.top;if(g){const p=u.left+t,b=u.right+t;(p>=c.right||b<=c.left)&&(t=0)}if(y){const p=u.top+e,b=u.bottom+e;(p>=c.bottom||b<=c.top)&&(e=0)}d+=t,f+=e,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate3d(${d}px, ${f}px, 0) scale(${s})`,i.fire("move",{dx:t,dy:e})},ot=(t,e=!1)=>{const{container:n,map:o,nodes:s}=t;let i,r;if(t.alignment==="nodes"||e)i=(n.offsetWidth-s.offsetWidth)/2,r=(n.offsetHeight-s.offsetHeight)/2,o.style.transformOrigin="50% 50%";else{const l=o.querySelector("me-root"),a=l.offsetTop,d=l.offsetLeft,f=l.offsetWidth,c=l.offsetHeight;i=n.offsetWidth/2-d-f/2,r=n.offsetHeight/2-a-c/2,o.style.transformOrigin=`${d+f/2}px 50%`}return{dx:i,dy:r}},me=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:ce,disableEdit:fe,enableEdit:de,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":"",ne(t),n.expanded){const c=this.createChildren(n.children.map(u=>this.createWrapper(u).grp));i.parentNode.appendChild(c)}else i.parentNode.children[1].remove();this.linkDiv(t.closest("me-main > me-wrapper"));const l=t.getBoundingClientRect(),a={x:l.left,y:l.top},d=s.x-a.x,f=s.y-a.y;this.move(d,f),this.bus.fire("expandNode",n)},expandNodeAll:function(t,e){const n=t.nodeObj,o=t.getBoundingClientRect(),s={x:o.left,y:o.top};at(n,e??!n.expanded),this.refresh();const i=this.findEle(n.id).getBoundingClientRect(),r={x:i.left,y:i.top},l=s.x-r.x,a=s.y-r.y;this.move(l,a)},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:he,getDataString:ae,initLeft:function(){this.direction=0,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},initRight:function(){this.direction=1,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},initSide:function(){this.direction=2,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},install:function(t){t(this)},move:ge,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.meta&&(this.meta=t.meta),t.theme&&this.changeTheme(t.theme)),tt(this.nodeData),this.layout(),this.linkDiv()},scale:ue,scaleFit:pe,scrollIntoView:se,selectNode:ie,selectNodes:re,stringifyData:wt,toCenter:function(){const{map:t,container:e}=this,{dx:n,dy:o}=ot(this);e.scrollTop=0,e.scrollLeft=0,t.style.transform=`translate3d(${n}px, ${o}px, 0) scale(${this.scaleVal})`},unselectNodes:le},Symbol.toStringTag,{value:"Module"})),ye=40,be=10,ve=({deltaMode:t,deltaY:e,viewportHeight:n})=>t===WheelEvent.DOM_DELTA_LINE?e*ye:t===WheelEvent.DOM_DELTA_PAGE?e*n:e,we=({deltaMode:t,deltaY:e,scaleSensitivity:n,viewportHeight:o})=>{const i=-ve({deltaMode:t,deltaY:e,viewportHeight:o})/be*n;return Math.max(-n,Math.min(n,i))},xe=(t,e,n)=>{e!==0&&t.scale(t.scaleVal+e,n)},Ce=(t,e)=>{const n=we({deltaMode:e.deltaMode,deltaY:e.deltaY,scaleSensitivity:t.scaleSensitivity,viewportHeight:t.container.clientHeight||window.innerHeight});xe(t,n,{x:e.clientX,y:e.clientY})};function Se(t){const{panHelper:e,container:n}=t;let o=null;t.spacePressed=!1;const s={lastTap:0,lastTapTarget:null,DOUBLE_CLICK_THRESHOLD:300,detect(h,m){if(h.button!==0){this.clear();return}const x=new Date().getTime(),E=x-this.lastTap,S=E<this.DOUBLE_CLICK_THRESHOLD&&E>0&&this.lastTapTarget===h.target;this.lastTap=x,this.lastTapTarget=h.target,S&&m(h)},clear(){this.lastTap=0,this.lastTapTarget=null}},i={Idle:0,Pinch:1,DragWait:2,Drag:3,Pan:4,BoxSelect:5};t.ptState=i.Idle;const r={lastDistance:null,activePointers:new Map,handlePointerDown(h){if(h.pointerType!=="touch")return!1;if(this.activePointers.set(h.pointerId,{x:h.clientX,y:h.clientY}),this.activePointers.size>=2){const[m,x]=Array.from(this.activePointers.values());return this.lastDistance=dt(m,x),!0}return!1},handlePointerMove(h){if(h.pointerType!=="touch"||!this.activePointers.has(h.pointerId))return!1;if(this.activePointers.set(h.pointerId,{x:h.clientX,y:h.clientY}),this.activePointers.size>=2){const[m,x]=Array.from(this.activePointers.values()),E=dt(m,x);if(this.lastDistance!==null&&this.lastDistance>0){const S=E/this.lastDistance;t.scale(t.scaleVal*S,{x:(m.x+x.x)/2,y:(m.y+x.y)/2})}return this.lastDistance=E,!0}return!1},handlePointerUp(h){h.pointerType==="touch"&&(this.activePointers.delete(h.pointerId),this.activePointers.size<2&&(this.lastDistance=null))},clear(){this.activePointers.clear(),this.lastDistance=null}},l=zt(t),a={timer:null,startPos:null,pointerId:null,DURATION:500,MOVE_THRESHOLD:10,clear(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null,this.startPos=null,this.pointerId=null)},start(h,m){this.timer=window.setTimeout(()=>{m(h),this.timer=null,this.startPos=null,this.pointerId=null},this.DURATION),this.startPos={x:h.clientX,y:h.clientY},this.pointerId=h.pointerId},handleMove(h){if(this.timer!==null&&this.startPos!==null&&h.pointerId===this.pointerId){const m=h.clientX-this.startPos.x,x=h.clientY-this.startPos.y;Math.sqrt(m*m+x*x)>this.MOVE_THRESHOLD&&this.clear()}}},d=(h,m)=>{if(h.closest("#input-box"))return!1;const x=h.closest(".svg-label"),E=h.closest(".topiclinks, .summary"),S=x?{type:x.dataset.type,element:document.getElementById(x.dataset.svgId)}:E?{type:E.classList.contains("topiclinks")?"arrow":"summary",element:h.closest("g")}:null;if(!S?.type||!S?.element)return!1;const{type:P,element:N}=S;return t.clearSelection(),P==="arrow"?m?t.editArrowLabel(N):t.selectArrow(N):m?t.editSummary(N):t.selectSummary(N),!0},f=h=>{if(h.pointerType==="mouse"&&h.button!==0)return;if(t.helper1?.moved){t.helper1.clear();return}if(t.helper2?.moved){t.helper2.clear();return}if(e.moved){e.clear();return}if(l?.isDragging)return;const m=h.target;m.tagName==="ME-EPD"&&(h.ctrlKey||h.metaKey?t.expandNodeAll(m.previousSibling):t.expandNode(m.previousSibling))},c=h=>{if(!t.editable)return;const m=h.target;if(et(m)){t.selectNode(m),t.beginEdit(m);return}d(m,!0)},u=h=>{if(h.pointerType==="touch"&&r.handlePointerDown(h)){t.ptState=i.Pinch,a.clear(),e.clear(),(l.isDragging||l.pointerId!==null)&&mt(t,l);return}if(t.ptState===i.Pinch)return;const m=h.target;if(t.editable&&m.className==="map-container"&&h.button===0&&h.pointerType==="mouse"){t.ptState=i.BoxSelect;return}if(e.handlePointerDown(h),e.mousedown&&(t.ptState=i.Pan),h.button===0||h.pointerType==="touch")if(et(m)){t.selection?.cancel();const E=t.currentNodes||[];if(h.ctrlKey||h.metaKey||t.mobileMultiSelect?E.includes(m)?o=m:((t.currentArrow||t.currentSummary)&&t.clearSelection(),t.selection?.select(m)):E.includes(m)||t.selectNode(m),!t.editable)return;h.pointerType==="touch"?(t.ptState=i.DragWait,a.start(h,P=>{ut(t,l,P,!0)&&(t.ptState=i.Drag,m.setPointerCapture(P.pointerId))})):ut(t,l,h,!1)&&(t.ptState=i.Drag,m.setPointerCapture(h.pointerId))}else d(m,!1)},g=h=>{switch(t.ptState){case i.Pinch:r.handlePointerMove(h);break;case i.DragWait:a.handleMove(h),a.timer===null&&(t.ptState=i.Idle);break;case i.Drag:Gt(t,l,h);break;case i.Pan:e.handlePointerMove(h);break}},y=h=>{h.pointerType==="touch"&&r.handlePointerUp(h);const m=l.isDragging,x=e.moved;switch(t.ptState){case i.DragWait:a.clear();break;case i.Drag:_t(t,l,h);break;case i.Pan:e.handlePointerUp(h);break}s.detect(h,c),(t.ptState!==i.Pinch||r.activePointers.size<2)&&(t.ptState=i.Idle),o&&(!m&&!x&&t.selection?.deselect(o),o=null)},p=()=>{r.clear(),a.clear(),e.clear(),s.clear(),(l.isDragging||l.pointerId!==null)&&mt(t,l),t.ptState=i.Idle,o=null},b=h=>{h.preventDefault(),h.button===2&&t.editable&&setTimeout(()=>{if(t.panHelper.moved||t.ptState!==i.Idle&&t.ptState!==i.Pan)return;const m=h.target;et(m)&&!m.classList.contains("selected")&&t.selectNode(m),t.bus.fire("showContextMenu",h)},200)},w=h=>{if(h.stopPropagation(),h.preventDefault(),h.ctrlKey||h.metaKey)return Ce(t,h);if(h.shiftKey)return t.move(-h.deltaY,0);t.move(-h.deltaX,-h.deltaY)},v=h=>{h.code==="Space"&&(t.spacePressed=!0,t.container.classList.add("space-pressed"))},C=h=>{h.code==="Space"&&(t.spacePressed=!1,t.container.classList.remove("space-pressed"))};return ht([{dom:n,evt:"pointerdown",func:u},{dom:n,evt:"pointermove",func:g},{dom:n,evt:"pointerup",func:y},{dom:n,evt:"pointercancel",func:p},{dom:n,evt:"click",func:f},{dom:n,evt:"contextmenu",func:b},{dom:n,evt:"wheel",func:typeof t.handleWheel=="function"?t.handleWheel:w},{dom:n,evt:"blur",func:p},{dom:n,evt:"keydown",func:v},{dom:n,evt:"keyup",func:C}])}function Ee(){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 k="http://www.w3.org/2000/svg",q=function(t){const e=t.clientWidth,n=t.clientHeight,o=t.dataset,s=Number(o.x),i=Number(o.y),r=o.anchor;let l=s;r==="middle"?l=s-e/2:r==="end"&&(l=s-e),t.style.left=`${l}px`,t.style.top=`${i-n/2}px`,t.style.visibility="visible"},st=function(t,e,n,o){const{anchor:s="middle",color:i,dataType:r,svgId:l}=o,a=document.createElement("div");a.className="svg-label",a.style.color=i||"#666";const d="label-"+l;return a.id=d,a.innerHTML=t,a.dataset.type=r,a.dataset.svgId=l,a.dataset.x=e.toString(),a.dataset.y=n.toString(),a.dataset.anchor=s,a},xt=function(t,e,n){const o=document.createElementNS(k,"path");return D(o,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),o},X=function(t){const e=document.createElementNS(k,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},Ct=function(){const t=document.createElementNS(k,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},Te=function(t,e,n,o){const s=document.createElementNS(k,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((r,l)=>{const a=r.d,d=document.createElementNS(k,"path"),f={d:a,stroke:o?.stroke||"rgb(227, 125, 116)",fill:"none","stroke-linecap":o?.strokeLinecap||"cap","stroke-width":String(o?.strokeWidth||"2")};o?.opacity!==void 0&&(f.opacity=String(o.opacity)),D(d,f),l===0&&d.setAttribute("stroke-dasharray",o?.strokeDasharray||"8,2");const c=document.createElementNS(k,"path");D(c,{d:a,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(c),s.appendChild(d),s[r.name]=d}),s},St=function(t,e,n){if(!e)return;const o=n.label;e.style.opacity="0";const 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=`
11
+ border-radius:${r.borderRadius}; `,this.direction===0&&(e.style.right="0"),t.style.opacity="0",vt(e),this.bus.fire("operation",{name:"beginEdit",obj:t.nodeObj}),e.addEventListener("keydown",l=>{if(l.stopPropagation(),l.isComposing)return;const a=l.key;if(a==="Enter"||a==="Tab"){if(l.shiftKey)return;l.preventDefault(),e.blur(),this.container.focus()}else a==="Escape"&&(l.preventDefault(),e.textContent=o,e.blur(),this.container.focus())}),e.addEventListener("blur",()=>{if(!e)return;t.style.opacity="1",e.remove();const l=e.innerText?.trim()||"";l===o||l===""||(n.topic=l,this.markdown?t.text.innerHTML=this.markdown(n.topic,n):t.text.textContent=l,this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:n,origin:o}))})},ee=function(t){const e=document.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},ne=function(t){const n=t.parentElement.parentElement.lastElementChild;n?.tagName==="svg"&&n?.remove()};function oe(t){return{nodeData:t.isFocusMode?t.nodeDataBackup:t.nodeData,arrows:t.arrows,summaries:t.summaries,direction:t.direction,theme:t.theme,compact:t.compact,meta:t.meta}}const se=function(t,e=!1){const n=this.container,o=t.getBoundingClientRect(),s=n.getBoundingClientRect();if(e||o.top>s.bottom-50||o.bottom<s.top+50||o.left>s.right-50||o.right<s.left+50){const r=o.left+o.width/2,l=o.top+o.height/2,a=s.left+s.width/2,d=s.top+s.height/2,f=r-a,c=l-d;this.move(-f,-c,!0)}},ie=function(t,e,n){this.clearSelection(),this.scrollIntoView(t),this.selection?.select(t),e&&this.bus.fire("selectNewNode",t.nodeObj)},re=function(t){this.selection?.select(t)},le=function(t){this.selection?.deselect(t)},ce=function(){this.unselectNodes(this.currentNodes),this.unselectSummary(),this.unselectArrow()},wt=function(t){return JSON.stringify(t,(e,n)=>{if(!(e==="parent"&&typeof n!="string"))return n})},ae=function(){const t=oe(this);return wt(t)},he=function(){return JSON.parse(this.getDataString())},de=function(){this.editable=!0},fe=function(){this.editable=!1},ue=function(t,e={x:0,y:0}){if(t<this.scaleMin&&t<this.scaleVal||t>this.scaleMax&&t>this.scaleVal)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}=ot(this),l=this.map.style.transform,{x:a,y:d}=nt(l),f=a-i,c=d-r,u=this.scaleVal,g=(-o+f)*(1-t/u),y=(-s+c)*(1-t/u);this.map.style.transform=`translate3d(${a-g}px, ${d-y}px, 0) scale(${t})`,this.scaleVal=t,this.bus.fire("scale",t)},pe=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;const{dx:o,dy:s}=ot(this,!0);this.map.style.transform=`translate3d(${o}px, ${s}px, 0) scale(${n})`,this.bus.fire("scale",n)},ge=function(t,e,n=!1){const{map:o,scaleVal:s,bus:i,container:r,nodes:l}=this;if(n&&o.style.transition==="transform 0.3s")return;const a=o.style.transform;let{x:d,y:f}=nt(a);const c=r.getBoundingClientRect(),u=l.getBoundingClientRect(),g=u.left<c.right&&u.right>c.left,y=u.top<c.bottom&&u.bottom>c.top;if(g){const p=u.left+t,b=u.right+t;(p>=c.right||b<=c.left)&&(t=0)}if(y){const p=u.top+e,b=u.bottom+e;(p>=c.bottom||b<=c.top)&&(e=0)}d+=t,f+=e,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate3d(${d}px, ${f}px, 0) scale(${s})`,i.fire("move",{dx:t,dy:e})},ot=(t,e=!1)=>{const{container:n,map:o,nodes:s}=t;let i,r;if(t.alignment==="nodes"||e)i=(n.offsetWidth-s.offsetWidth)/2,r=(n.offsetHeight-s.offsetHeight)/2,o.style.transformOrigin="50% 50%";else{const l=o.querySelector("me-root"),a=l.offsetTop,d=l.offsetLeft,f=l.offsetWidth,c=l.offsetHeight;i=n.offsetWidth/2-d-f/2,r=n.offsetHeight/2-a-c/2,o.style.transformOrigin=`${d+f/2}px 50%`}return{dx:i,dy:r}},me=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:ce,disableEdit:fe,enableEdit:de,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":"",ne(t),n.expanded){const c=this.createChildren(n.children.map(u=>this.createWrapper(u).grp));i.parentNode.appendChild(c)}else i.parentNode.children[1].remove();this.linkDiv(t.closest("me-main > me-wrapper"));const l=t.getBoundingClientRect(),a={x:l.left,y:l.top},d=s.x-a.x,f=s.y-a.y;this.move(d,f),this.bus.fire("expandNode",n)},expandNodeAll:function(t,e){const n=t.nodeObj,o=t.getBoundingClientRect(),s={x:o.left,y:o.top};at(n,e??!n.expanded),this.refresh();const i=this.findEle(n.id).getBoundingClientRect(),r={x:i.left,y:i.top},l=s.x-r.x,a=s.y-r.y;this.move(l,a)},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:he,getDataString:ae,initLeft:function(){this.direction=0,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},initRight:function(){this.direction=1,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},initSide:function(){this.direction=2,this.refresh(),this.toCenter(),this.bus.fire("changeDirection",this.direction)},install:function(t){t(this)},move:ge,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.meta&&(this.meta=t.meta),t.theme&&this.changeTheme(t.theme)),tt(this.nodeData),this.layout(),this.linkDiv()},scale:ue,scaleFit:pe,scrollIntoView:se,selectNode:ie,selectNodes:re,stringifyData:wt,toCenter:function(){const{map:t,container:e}=this,{dx:n,dy:o}=ot(this);e.scrollTop=0,e.scrollLeft=0,t.style.transform=`translate3d(${n}px, ${o}px, 0) scale(${this.scaleVal})`},unselectNodes:le},Symbol.toStringTag,{value:"Module"})),ye=40,be=10,ve=({deltaMode:t,deltaY:e,viewportHeight:n})=>t===WheelEvent.DOM_DELTA_LINE?e*ye:t===WheelEvent.DOM_DELTA_PAGE?e*n:e,we=({deltaMode:t,deltaY:e,scaleSensitivity:n,viewportHeight:o})=>{const i=-ve({deltaMode:t,deltaY:e,viewportHeight:o})/be*n;return Math.max(-n,Math.min(n,i))},xe=(t,e,n)=>{e!==0&&t.scale(t.scaleVal+e,n)},Ce=(t,e)=>{const n=we({deltaMode:e.deltaMode,deltaY:e.deltaY,scaleSensitivity:t.scaleSensitivity,viewportHeight:t.container.clientHeight||window.innerHeight});xe(t,n,{x:e.clientX,y:e.clientY})};function Se(t){const{panHelper:e,container:n}=t;let o=null;t.spacePressed=!1;const s={lastTap:0,lastTapTarget:null,DOUBLE_CLICK_THRESHOLD:300,detect(h,m){if(h.button!==0){this.clear();return}const x=new Date().getTime(),E=x-this.lastTap,S=E<this.DOUBLE_CLICK_THRESHOLD&&E>0&&this.lastTapTarget===h.target;this.lastTap=x,this.lastTapTarget=h.target,S&&m(h)},clear(){this.lastTap=0,this.lastTapTarget=null}},i={Idle:0,Pinch:1,DragWait:2,Drag:3,Pan:4,BoxSelect:5};t.ptState=i.Idle;const r={lastDistance:null,activePointers:new Map,handlePointerDown(h){if(h.pointerType!=="touch")return!1;if(this.activePointers.set(h.pointerId,{x:h.clientX,y:h.clientY}),this.activePointers.size>=2){const[m,x]=Array.from(this.activePointers.values());return this.lastDistance=dt(m,x),!0}return!1},handlePointerMove(h){if(h.pointerType!=="touch"||!this.activePointers.has(h.pointerId))return!1;if(this.activePointers.set(h.pointerId,{x:h.clientX,y:h.clientY}),this.activePointers.size>=2){const[m,x]=Array.from(this.activePointers.values()),E=dt(m,x);if(this.lastDistance!==null&&this.lastDistance>0){const S=E/this.lastDistance;t.scale(t.scaleVal*S,{x:(m.x+x.x)/2,y:(m.y+x.y)/2})}return this.lastDistance=E,!0}return!1},handlePointerUp(h){h.pointerType==="touch"&&(this.activePointers.delete(h.pointerId),this.activePointers.size<2&&(this.lastDistance=null))},clear(){this.activePointers.clear(),this.lastDistance=null}},l=zt(t),a={timer:null,startPos:null,pointerId:null,DURATION:500,MOVE_THRESHOLD:10,clear(){this.timer!==null&&(clearTimeout(this.timer),this.timer=null,this.startPos=null,this.pointerId=null)},start(h,m){this.timer=window.setTimeout(()=>{m(h),this.timer=null,this.startPos=null,this.pointerId=null},this.DURATION),this.startPos={x:h.clientX,y:h.clientY},this.pointerId=h.pointerId},handleMove(h){if(this.timer!==null&&this.startPos!==null&&h.pointerId===this.pointerId){const m=h.clientX-this.startPos.x,x=h.clientY-this.startPos.y;Math.sqrt(m*m+x*x)>this.MOVE_THRESHOLD&&this.clear()}}},d=(h,m)=>{if(h.closest("#input-box"))return!1;const x=h.closest(".svg-label"),E=h.closest(".topiclinks, .summary"),S=x?{type:x.dataset.type,element:document.getElementById(x.dataset.svgId)}:E?{type:E.classList.contains("topiclinks")?"arrow":"summary",element:h.closest("g")}:null;if(!S?.type||!S?.element)return!1;const{type:P,element:N}=S;return t.clearSelection(),P==="arrow"?m?t.editArrowLabel(N):t.selectArrow(N):m?t.editSummary(N):t.selectSummary(N),!0},f=h=>{if(h.pointerType==="mouse"&&h.button!==0)return;if(t.helper1?.moved){t.helper1.clear();return}if(t.helper2?.moved){t.helper2.clear();return}if(e.moved){e.clear();return}if(l?.isDragging)return;const m=h.target;m.tagName==="ME-EPD"&&(h.ctrlKey||h.metaKey?t.expandNodeAll(m.previousSibling):t.expandNode(m.previousSibling))},c=h=>{if(!t.editable)return;const m=h.target;if(et(m)){t.selectNode(m),t.beginEdit(m);return}d(m,!0)},u=h=>{if(h.pointerType==="touch"&&r.handlePointerDown(h)){t.ptState=i.Pinch,a.clear(),e.clear(),(l.isDragging||l.pointerId!==null)&&mt(t,l);return}if(t.ptState===i.Pinch)return;const m=h.target;if(t.editable&&m.className==="map-container"&&h.button===0&&h.pointerType==="mouse"){t.ptState=i.BoxSelect;return}if(e.handlePointerDown(h),e.mousedown&&(t.ptState=i.Pan),h.button===0||h.pointerType==="touch")if(et(m)){t.selection?.cancel();const E=t.currentNodes||[];if(h.ctrlKey||h.metaKey||t.mobileMultiSelect?E.includes(m)?o=m:((t.currentArrow||t.currentSummary)&&t.clearSelection(),t.selection?.select(m)):E.includes(m)||t.selectNode(m),!t.editable)return;h.pointerType==="touch"?(t.ptState=i.DragWait,a.start(h,P=>{ut(t,l,P,!0)&&(t.ptState=i.Drag,m.setPointerCapture(P.pointerId))})):ut(t,l,h,!1)&&(t.ptState=i.Drag,m.setPointerCapture(h.pointerId))}else d(m,!1)},g=h=>{switch(t.ptState){case i.Pinch:r.handlePointerMove(h);break;case i.DragWait:a.handleMove(h),a.timer===null&&(t.ptState=i.Pan,e.handlePointerMove(h));break;case i.Drag:Gt(t,l,h);break;case i.Pan:e.handlePointerMove(h);break}},y=h=>{h.pointerType==="touch"&&r.handlePointerUp(h);const m=l.isDragging,x=e.moved;switch(t.ptState){case i.DragWait:a.clear();break;case i.Drag:_t(t,l,h);break;case i.Pan:e.handlePointerUp(h);break}s.detect(h,c),(t.ptState!==i.Pinch||r.activePointers.size<2)&&(t.ptState=i.Idle),o&&(!m&&!x&&t.selection?.deselect(o),o=null)},p=()=>{r.clear(),a.clear(),e.clear(),s.clear(),(l.isDragging||l.pointerId!==null)&&mt(t,l),t.ptState=i.Idle,o=null},b=h=>{h.preventDefault(),h.button===2&&t.editable&&setTimeout(()=>{if(t.panHelper.moved||t.ptState!==i.Idle&&t.ptState!==i.Pan)return;const m=h.target;et(m)&&!m.classList.contains("selected")&&t.selectNode(m),t.bus.fire("showContextMenu",h)},200)},w=h=>{if(h.stopPropagation(),h.preventDefault(),h.ctrlKey||h.metaKey)return Ce(t,h);if(h.shiftKey)return t.move(-h.deltaY,0);t.move(-h.deltaX,-h.deltaY)},v=h=>{h.code==="Space"&&(t.spacePressed=!0,t.container.classList.add("space-pressed"))},C=h=>{h.code==="Space"&&(t.spacePressed=!1,t.container.classList.remove("space-pressed"))};return ht([{dom:n,evt:"pointerdown",func:u},{dom:n,evt:"pointermove",func:g},{dom:n,evt:"pointerup",func:y},{dom:n,evt:"pointercancel",func:p},{dom:n,evt:"click",func:f},{dom:n,evt:"contextmenu",func:b},{dom:n,evt:"wheel",func:typeof t.handleWheel=="function"?t.handleWheel:w},{dom:n,evt:"blur",func:p},{dom:n,evt:"keydown",func:v},{dom:n,evt:"keyup",func:C}])}function Ee(){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 k="http://www.w3.org/2000/svg",q=function(t){const e=t.clientWidth,n=t.clientHeight,o=t.dataset,s=Number(o.x),i=Number(o.y),r=o.anchor;let l=s;r==="middle"?l=s-e/2:r==="end"&&(l=s-e),t.style.left=`${l}px`,t.style.top=`${i-n/2}px`,t.style.visibility="visible"},st=function(t,e,n,o){const{anchor:s="middle",color:i,dataType:r,svgId:l}=o,a=document.createElement("div");a.className="svg-label",a.style.color=i||"#666";const d="label-"+l;return a.id=d,a.innerHTML=t,a.dataset.type=r,a.dataset.svgId=l,a.dataset.x=e.toString(),a.dataset.y=n.toString(),a.dataset.anchor=s,a},xt=function(t,e,n){const o=document.createElementNS(k,"path");return D(o,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),o},X=function(t){const e=document.createElementNS(k,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},Ct=function(){const t=document.createElementNS(k,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},Te=function(t,e,n,o){const s=document.createElementNS(k,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((r,l)=>{const a=r.d,d=document.createElementNS(k,"path"),f={d:a,stroke:o?.stroke||"rgb(227, 125, 116)",fill:"none","stroke-linecap":o?.strokeLinecap||"cap","stroke-width":String(o?.strokeWidth||"2")};o?.opacity!==void 0&&(f.opacity=String(o.opacity)),D(d,f),l===0&&d.setAttribute("stroke-dasharray",o?.strokeDasharray||"8,2");const c=document.createElementNS(k,"path");D(c,{d:a,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(c),s.appendChild(d),s[r.name]=d}),s},St=function(t,e,n){if(!e)return;const o=n.label;e.style.opacity="0";const 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=`
12
12
  left:${e.style.left};
13
13
  top:${e.style.top};
14
14
  max-width: 200px;
15
15
  `,vt(s),t.scrollIntoView(s),s.addEventListener("keydown",i=>{if(i.stopPropagation(),i.isComposing)return;const r=i.key;if(r==="Enter"||r==="Tab"){if(i.shiftKey)return;i.preventDefault(),s.blur(),t.container.focus()}}),s.addEventListener("blur",()=>{if(!s)return;const i=s.innerText?.trim()||"";i===""?n.label=o:n.label=i,e.style.opacity="1",s.remove(),i!==o&&(t.markdown?e.innerHTML=t.markdown(n.label,n):e.textContent=n.label,q(e),"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},De=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 l=0;l<r.length;l++){const a=r[l],d=a.querySelector("me-tpc"),{offsetLeft:f,offsetTop:c}=M(this.nodes,d),u=d.offsetWidth,g=d.offsetHeight,y=a.parentNode.className,p=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:c,cL:f,cW:u,cH:g,direction:y,containerHeight:this.nodes.offsetHeight}),b=this.theme.palette,w=d.nodeObj.branchColor||b[l%b.length];if(d.style.borderColor=w,this.lines.appendChild(xt(p,w,"3")),t&&t!==a)continue;const v=X("subLines"),C=a.lastChild;C.tagName==="svg"&&C.remove(),a.appendChild(v),Et(this,v,w,a,y,!0)}this.labelContainer.innerHTML="",this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},Et=function(t,e,n,o,s,i){const r=o.firstChild,l=o.children[1].children;if(l.length===0)return;const a=r.offsetTop,d=r.offsetLeft,f=r.offsetWidth,c=r.offsetHeight;for(let u=0;u<l.length;u++){const g=l[u],y=g.firstChild,p=y.offsetTop,b=y.offsetLeft,w=y.offsetWidth,v=y.offsetHeight,C=y.firstChild.nodeObj.branchColor||n,T=t.generateSubBranch({pT:a,pL:d,pW:f,pH:c,cT:p,cL:b,cW:w,cH:v,direction:s,isFirst:i});e.appendChild(xt(T,C,"2"));const h=y.children[1];if(h){if(!h.expanded)continue}else continue;Et(t,e,C,g,s)}},Le={side:'<?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>',left:'<?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>',right:'<?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>',full:'<?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>',living:'<?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>',zoomin:'<?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>',zoomout:'<?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>'},O=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=Le[e],n};function Me(t){const e=document.createElement("div"),n=O("fullscreen","full"),o=O("toCenter","living"),s=O("zoomout","zoomout"),i=O("zoomin","zoomin");e.appendChild(n),e.appendChild(o),e.appendChild(s),e.appendChild(i),e.className="mind-elixir-toolbar rb";let r=null;const l=()=>{const d=t.container.getBoundingClientRect(),f=nt(t.map.style.transform),c=d.width/2,u=d.height/2,g=(c-f.x)/t.scaleVal,y=(u-f.y)/t.scaleVal;r={containerRect:d,currentTransform:f,mapCenterX:g,mapCenterY:y}},a=()=>{if(r){const d=t.container.getBoundingClientRect(),f=d.width/2,c=d.height/2,u=f-r.mapCenterX*t.scaleVal,g=c-r.mapCenterY*t.scaleVal,y=u-r.currentTransform.x,p=g-r.currentTransform.y;t.move(y,p)}};return t.el.addEventListener("fullscreenchange",a),n.onclick=()=>{l(),document.fullscreenElement!==t.el?t.el.requestFullscreen():document.exitFullscreen()},o.onclick=()=>{t.toCenter()},s.onclick=()=>{t.scale(t.scaleVal-t.scaleSensitivity)},i.onclick=()=>{t.scale(t.scaleVal+t.scaleSensitivity)},e}function Pe(t){const e=document.createElement("div"),n=O("tbltl","left"),o=O("tbltr","right"),s=O("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 ke(t){t.container.append(Me(t)),t.container.append(Pe(t))}function Tt({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:l,direction:a,containerHeight:d}){let f=e+n/2;const c=t+o/2;let u;a===B.LHS?u=i+r:u=i;const g=s+l/2,p=(1-Math.abs(g-c)/d)*.25*(n/2);return a===B.LHS?f=f-n/10-p:f=f+n/10+p,`M ${f} ${c} Q ${f} ${g} ${u} ${g}`}function Dt({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:l,direction:a,isFirst:d}){const f=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let c=0,u=0;d?c=t+o/2:c=t+o;const g=s+l;let y=0,p=0,b=0;const w=Math.abs(c-g)/300*f;return a===B.LHS?(b=e,y=b+f,p=b-f,u=i+f,`M ${y} ${c} C ${b} ${c} ${b+w} ${g} ${p} ${g} H ${u}`):(b=e+n,y=b-f,p=b+f,u=i+r-f,`M ${y} ${c} C ${b} ${c} ${b-w} ${g} ${p} ${g} H ${u}`)}const Ae=function(t,e=!0){this.theme=t,this.generateMainBranch=this.theme.generateMainBranch||Tt,this.generateSubBranch=this.theme.generateSubBranch||Dt;const o={...(this.theme.type==="dark"?F:z).cssVar,...this.theme.cssVar};this.compact&&(o["--node-gap-x"]="15px",o["--node-gap-y"]="2px",o["--main-gap-x"]="30px",o["--main-gap-y"]="6px");const 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()},Ne=function(t){this.compact=t,this.theme&&this.changeTheme(this.theme)},Lt={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=ht([{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}}}},Mt="#4dc4ff";function Pt(t,e,n,o,s,i,r,l){return{x:t/8+n*3/8+s*3/8+r/8,y:e/8+o*3/8+i*3/8+l/8}}function $e(t,e,n){t&&(t.dataset.x=e.toString(),t.dataset.y=n.toString(),q(t))}function Y(t,e,n,o,s){D(t,{x1:e+"",y1:n+"",x2:o+"",y2:s+""})}function it(t,e,n,o,s,i,r,l,a,d){const f=`M ${e} ${n} C ${o} ${s} ${i} ${r} ${l} ${a}`;t.line.setAttribute("d",f);const c=d.style||{};t.line.setAttribute("stroke",c.stroke||"rgb(227, 125, 116)"),t.line.setAttribute("stroke-width",String(c.strokeWidth||"2")),t.line.setAttribute("stroke-dasharray",c.strokeDasharray||"8,2"),t.line.setAttribute("stroke-linecap",c.strokeLinecap||"cap"),c.opacity!==void 0&&c.opacity!==null&&c.opacity!==""?t.line.setAttribute("opacity",String(c.opacity)):t.line.removeAttribute("opacity");const u=t.querySelectorAll('path[stroke="transparent"]');u.length>0&&u[0].setAttribute("d",f);const g=_(i,r,l,a);if(g){const w=`M ${g.x1} ${g.y1} L ${l} ${a} L ${g.x2} ${g.y2}`;t.arrow1.setAttribute("d",w),u.length>1&&u[1].setAttribute("d",w),t.arrow1.setAttribute("stroke",c.stroke||"rgb(227, 125, 116)"),t.arrow1.setAttribute("stroke-width",String(c.strokeWidth||"2")),t.arrow1.setAttribute("stroke-linecap",c.strokeLinecap||"cap"),c.opacity!==void 0&&c.opacity!==null&&c.opacity!==""?t.arrow1.setAttribute("opacity",String(c.opacity)):t.arrow1.removeAttribute("opacity")}if(d.bidirectional){const w=_(o,s,e,n);if(w){const v=`M ${w.x1} ${w.y1} L ${e} ${n} L ${w.x2} ${w.y2}`;t.arrow2.setAttribute("d",v),u.length>2&&u[2].setAttribute("d",v)}}else t.arrow2.setAttribute("d",""),u.length>2&&u[2].setAttribute("d","");t.arrow2.setAttribute("stroke",c.stroke||"rgb(227, 125, 116)"),t.arrow2.setAttribute("stroke-width",String(c.strokeWidth||"2")),t.arrow2.setAttribute("stroke-linecap",c.strokeLinecap||"cap"),c.opacity!==void 0&&c.opacity!==null&&c.opacity!==""?t.arrow2.setAttribute("opacity",String(c.opacity)):t.arrow2.removeAttribute("opacity");const{x:y,y:p}=Pt(e,n,o,s,i,r,l,a);t.labelEl&&$e(t.labelEl,y,p);const b=t.labelEl;b&&(b.style.color=c.labelColor||"rgb(235, 95, 82)"),We(t)}function R(t,e,n){const{offsetLeft:o,offsetTop:s}=M(t.nodes,e),i=e.offsetWidth,r=e.offsetHeight,l=o+i/2,a=s+r/2,d=l+n.x,f=a+n.y;return{w:i,h:r,cx:l,cy:a,ctrlX:d,ctrlY:f}}function H(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 kt=function(t,e,n){const o=M(t.nodes,e),s=M(t.nodes,n),i=o.offsetLeft+e.offsetWidth/2,r=o.offsetTop+e.offsetHeight/2,l=s.offsetLeft+n.offsetWidth/2,a=s.offsetTop+n.offsetHeight/2,d=l-i,f=a-r,c=Math.sqrt(d*d+f*f),u=Math.max(50,Math.min(200,c*.3)),g=Math.abs(d),y=Math.abs(f);let p,b;if(c<150){const v=e.closest("me-main").className==="lhs"?-1:1;p={x:200*v,y:0},b={x:200*v,y:0}}else if(g>y*1.5){const v=d>0?e.offsetWidth/2:-e.offsetWidth/2,C=d>0?-n.offsetWidth/2:n.offsetWidth/2;p={x:v+(d>0?u:-u),y:0},b={x:C+(d>0?-u:u),y:0}}else if(y>g*1.5){const v=f>0?e.offsetHeight/2:-e.offsetHeight/2,C=f>0?-n.offsetHeight/2:n.offsetHeight/2;p={x:0,y:v+(f>0?u:-u)},b={x:0,y:C+(f>0?-u:u)}}else{const v=Math.atan2(f,d),C=e.offsetWidth/2*Math.cos(v),T=e.offsetHeight/2*Math.sin(v),h=-(n.offsetWidth/2)*Math.cos(v),m=-(n.offsetHeight/2)*Math.sin(v),x=u*.7*(d>0?1:-1),E=u*.7*(f>0?1:-1);p={x:C+x,y:T+E},b={x:h-x,y:m-E}}return{delta1:{x:Math.round(p.x),y:Math.round(p.y)},delta2:{x:Math.round(b.x),y:Math.round(b.y)}}},rt=function(t,e,n,o,s){if(!e||!n)return;if(!o.delta1||!o.delta2){const S=kt(t,e,n);o.delta1=S.delta1,o.delta2=S.delta2}const i=R(t,e,o.delta1),r=R(t,n,o.delta2),{x:l,y:a}=H(i),{ctrlX:d,ctrlY:f}=i,{ctrlX:c,ctrlY:u}=r,{x:g,y}=H(r),p=_(c,u,g,y);if(!p)return;const b=`M ${p.x1} ${p.y1} L ${g} ${y} L ${p.x2} ${p.y2}`;let w="";if(o.bidirectional){const S=_(d,f,l,a);if(!S)return;w=`M ${S.x1} ${S.y1} L ${l} ${a} L ${S.x2} ${S.y2}`}const v=Te(`M ${l} ${a} C ${d} ${f} ${c} ${u} ${g} ${y}`,b,w,o.style),{x:C,y:T}=Pt(l,a,d,f,c,u,g,y),h=o.style?.labelColor||"rgb(235, 95, 82)",m="a-"+o.id;v.id=m;const x=t.markdown?t.markdown(o.label,o):o.label,E=st(x,C,T,{anchor:"middle",color:h,dataType:"arrow",svgId:m});v.labelEl=E,v.arrowObj=o,v.dataset.linkid=o.id,t.labelContainer.appendChild(E),t.arrowSvg.appendChild(v),q(E),s||(t.arrows.push(o),t.currentArrow=v,Nt(t,o,i,r))},He=function(t,e,n={}){const o={id:W(),label:"Custom Link",from:t.nodeObj.id,to:e.nodeObj.id,...n};rt(this,t,e,o),this.bus.fire("operation",{name:"createArrow",obj:o})},Ie=function(t){U(this);const e={...t,id:W()};rt(this,this.findEle(e.from),this.findEle(e.to),e),this.bus.fire("operation",{name:"createArrow",obj:e})},Oe=function(t){let e;if(t?e=t:e=this.currentArrow,!e)return;U(this);const n=e.arrowObj.id;this.arrows=this.arrows.filter(o=>o.id!==n),e.labelEl?.remove(),e.remove(),this.bus.fire("operation",{name:"removeArrow",obj:{id:n}})},Be=function(t){this.currentArrow=t;const e=t.arrowObj,n=this.findEle(e.from),o=this.findEle(e.to),s=R(this,n,e.delta1),i=R(this,o,e.delta2);this.editable?Nt(this,e,s,i):At(t,Mt),this.bus.fire("selectArrow",e)},Ye=function(){U(this),this.currentArrow=null,this.bus.fire("unselectArrow")},lt=function(t,e){const n=document.createElementNS(k,"path");return D(n,{d:t,stroke:e,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},At=function(t,e){const n=document.createElementNS(k,"g");n.setAttribute("class","arrow-highlight"),n.setAttribute("opacity","0.45");const o=lt(t.line.getAttribute("d"),e);n.appendChild(o);const s=lt(t.arrow1.getAttribute("d"),e);if(n.appendChild(s),t.arrow2.getAttribute("d")){const i=lt(t.arrow2.getAttribute("d"),e);n.appendChild(i)}t.insertBefore(n,t.firstChild)},Re=function(t){const e=t.querySelector(".arrow-highlight");e&&e.remove()},We=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"))},U=function(t){t.helper1?.destroy(),t.helper2?.destroy(),t.linkController.style.display="none",t.P2.style.display="none",t.P3.style.display="none",t.currentArrow&&Re(t.currentArrow)},Nt=function(t,e,n,o){const{linkController:s,P2:i,P3:r,line1:l,line2:a,nodes:d,map:f,currentArrow:c,bus:u}=t;if(!c)return;s.style.display="initial",i.style.display="initial",r.style.display="initial",d.appendChild(s),d.appendChild(i),d.appendChild(r),At(c,Mt);let{x:g,y}=H(n),{ctrlX:p,ctrlY:b}=n,{ctrlX:w,ctrlY:v}=o,{x:C,y:T}=H(o);i.style.cssText=`top:${b}px;left:${p}px;`,r.style.cssText=`top:${v}px;left:${w}px;`,Y(l,g,y,p,b),Y(a,w,v,C,T),t.helper1=Lt.create(i),t.helper2=Lt.create(r),t.helper1.init(f,(h,m)=>{p=p+h/t.scaleVal,b=b+m/t.scaleVal;const x=H({...n,ctrlX:p,ctrlY:b});g=x.x,y=x.y,i.style.top=b+"px",i.style.left=p+"px",it(c,g,y,p,b,w,v,C,T,e),Y(l,g,y,p,b),e.delta1.x=Math.round(p-n.cx),e.delta1.y=Math.round(b-n.cy),u.fire("updateArrowDelta",e)}),t.helper2.init(f,(h,m)=>{w=w+h/t.scaleVal,v=v+m/t.scaleVal;const x=H({...o,ctrlX:w,ctrlY:v});C=x.x,T=x.y,r.style.top=v+"px",r.style.left=w+"px",it(c,g,y,p,b,w,v,C,T,e),Y(a,w,v,C,T),e.delta2.x=Math.round(w-o.cx),e.delta2.y=Math.round(v-o.cy),u.fire("updateArrowDelta",e)})};function Xe(){this.arrowSvg.innerHTML="",this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach(e=>e.remove());for(let e=0;e<this.arrows.length;e++){const n=this.arrows[e];try{rt(this,this.findEle(n.from),this.findEle(n.to),n,!0)}catch{}}this.nodes.appendChild(this.arrowSvg)}function Ve(t){U(this),t&&t.labelEl&&St(this,t.labelEl,t.arrowObj)}function ze(){this.arrows=this.arrows.filter(t=>G(t.from,this.nodeData)&&G(t.to,this.nodeData))}const Fe=Object.freeze(Object.defineProperty({__proto__:null,createArrow:He,createArrowFrom:Ie,editArrowLabel:Ve,removeArrow:Oe,renderArrow:Xe,reshapeArrow:function(t,e){const n=Rt(t);n.style&&e.style&&(e.style=Object.assign({},n.style,e.style)),Object.assign(t,e);const o=this.arrowSvg.querySelector(`g[data-linkid="${t.id}"]`);if(o){if(e.label!==void 0&&o.labelEl){const r=this.markdown?this.markdown(t.label,t):t.label;o.labelEl.innerHTML=r}const s=this.findEle(t.from),i=this.findEle(t.to);if(s&&i){if(!t.delta1||!t.delta2){const b=kt(this,s,i);t.delta1=t.delta1||b.delta1,t.delta2=t.delta2||b.delta2}const r=R(this,s,t.delta1),l=R(this,i,t.delta2),{x:a,y:d}=H(r),{ctrlX:f,ctrlY:c}=r,{ctrlX:u,ctrlY:g}=l,{x:y,y:p}=H(l);it(o,a,d,f,c,u,g,y,p,t),this.currentArrow?.arrowObj?.id===t.id&&(this.P2.style.cssText=`top:${c}px;left:${f}px;`,this.P3.style.cssText=`top:${g}px;left:${u}px;`,Y(this.line1,a,d,f,c),Y(this.line2,u,g,y,p))}}this.bus.fire("operation",{name:"reshapeArrow",obj:t,origin:n})},selectArrow:Be,tidyArrow:ze,unselectArrow:Ye},Symbol.toStringTag,{value:"Module"})),Ge=function(t){if(t.length===0)throw new Error("No selected node.");if(t.length===1){const a=t[0].nodeObj,d=t[0].nodeObj.parent;if(!d)throw new Error("Can not select root node.");const f=d.children.findIndex(c=>a===c);return{parent:d.id,start:f,end:f}}let e=0;const n=t.map(a=>{let d=a.nodeObj;const f=[];for(;d.parent;){const c=d.parent,g=c.children?.indexOf(d);d=c,f.unshift({node:d,index:g})}return f.length>e&&(e=f.length),f});let o=0;t:for(;o<e;o++){const a=n[0][o]?.node;for(let d=1;d<n.length;d++)if(n[d][o]?.node!==a)break t}if(!o)throw new Error("Can not select root node.");const s=n.map(a=>a[o-1].index).sort(),i=s[0]||0,r=s[s.length-1]||0,l=n[0][o-1].node;if(!l.parent)throw new Error("Please select nodes in the same main topic.");return{parent:l.id,start:i,end:r}},_e=function(t){const e=document.createElementNS(k,"g");return e.setAttribute("id",t),e},$t=function(t,e){const n=document.createElementNS(k,"path");return D(n,{d:t,stroke:e||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},je=t=>t.parentElement.parentElement,qe=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},ct=function(t,e){const{id:n,label:o,parent:s,start:i,end:r,style:l}=e,{nodes:a,theme:d,summarySvg:f}=t,u=t.findEle(s).nodeObj,g=qe(t,e);let y=1/0,p=0,b=0,w=0;for(let V=i;V<=r;V++){const Ht=u.children?.[V];if(!Ht)return t.removeSummary(n),null;const Z=je(t.findEle(Ht.id)),{offsetLeft:Q,offsetTop:It}=M(a,Z),Ot=i===r?10:20;V===i&&(b=It+Ot),V===r&&(w=It+Z.offsetHeight-Ot),Q<y&&(y=Q),Z.offsetWidth+Q>p&&(p=Z.offsetWidth+Q)}let v,C;const T=u.parent?10:0,h=b+T,m=w+T,x=(h+m)/2,E=l?.stroke||d.cssVar["--color"],S=l?.labelColor||d.cssVar["--color"],P="s-"+n,N=t.markdown?t.markdown(o,e):o;g===B.LHS?(v=$t(`M ${y+10} ${h} c -5 0 -10 5 -10 10 L ${y} ${m-10} c 0 5 5 10 10 10 M ${y} ${x} h -10`,E),C=st(N,y-20,x,{anchor:"end",color:S,dataType:"summary",svgId:P})):(v=$t(`M ${p-10} ${h} c 5 0 10 5 10 10 L ${p} ${m-10} c 0 5 -5 10 -10 10 M ${p} ${x} h 10`,E),C=st(N,p+20,x,{anchor:"start",color:S,dataType:"summary",svgId:P}));const I=_e(P);return I.appendChild(v),t.labelContainer.appendChild(C),q(C),I.summaryObj=e,I.labelEl=C,f.appendChild(I),I},Ue=Object.freeze(Object.defineProperty({__proto__:null,createSummary:function(t={}){if(!this.currentNodes)return;const{currentNodes:e,summaries:n,bus:o}=this,{parent:s,start:i,end:r}=Ge(e),l={id:W(),parent:s,start:i,end:r,label:"summary",style:t.style},a=ct(this,l);n.push(l),this.editSummary(a),o.fire("operation",{name:"createSummary",obj:l})},createSummaryFrom:function(t){const e=W(),n={...t,id:e};ct(this,n),this.summaries.push(n),this.bus.fire("operation",{name:"createSummary",obj:n})},editSummary:function(t){t&&t.labelEl&&St(this,t.labelEl,t.summaryObj)},removeSummary:function(t){const e=this.summaries.findIndex(n=>n.id===t);e>-1&&(this.summaries.splice(e,1),this.nodes.querySelector("#s-"+t)?.remove(),this.nodes.querySelector("#label-s-"+t)?.remove()),this.bus.fire("operation",{name:"removeSummary",obj:{id:t}})},renderSummary:function(){this.summarySvg.innerHTML="",this.summaries.forEach(t=>{try{ct(this,t)}catch{}}),this.nodes.insertAdjacentElement("beforeend",this.summarySvg)},selectSummary:function(t){const e=t.labelEl;e&&e.classList.add("selected"),this.currentSummary=t,this.bus.fire("selectSummary",t.summaryObj)},unselectSummary:function(){this.currentSummary?.labelEl?.classList.remove("selected"),this.currentSummary=null,this.bus.fire("unselectSummary")}},Symbol.toStringTag,{value:"Module"})),L="http://www.w3.org/2000/svg";function Ke(t,e){const n=document.createElementNS(L,"svg");return D(n,{version:"1.1",xmlns:L,height:t,width:e}),n}function Je(t,e){return(parseInt(t)-parseInt(e))/2}function Ze(t,e,n,o){const s=document.createElementNS(L,"g");let i="";return t.text?i=t.text.textContent:i=t.childNodes[0].textContent,i.split(`
16
- `).forEach((l,a)=>{const d=document.createElementNS(L,"text");D(d,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+Je(e.lineHeight,e.fontSize)*(a+1)+parseFloat(e.fontSize)*(a+1)+"","text-anchor":"start","font-family":e.fontFamily,"font-size":`${e.fontSize}`,"font-weight":`${e.fontWeight}`,fill:`${e.color}`}),d.innerHTML=l,s.appendChild(d)}),s}function Qe(t,e,n,o){let s="";t.nodeObj?.dangerouslySetInnerHTML?s=t.nodeObj.dangerouslySetInnerHTML:t.text?s=t.text.textContent:s=t.childNodes[0].textContent;const i=document.createElementNS(L,"foreignObject");D(i,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+"",width:e.width,height:e.height});const r=document.createElement("div");return D(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 tn(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=M(t.nodes,e),i=document.createElementNS(L,"rect");return D(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 K(t,e,n=!1){const o=getComputedStyle(e),{offsetLeft:s,offsetTop:i}=M(t.nodes,e),r=document.createElementNS(L,"rect");D(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 l=document.createElementNS(L,"g");l.appendChild(r);let a;return n?a=Qe(e,o,s,i):a=Ze(e,o,s,i),l.appendChild(a),l}function en(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=M(t.nodes,e),i=document.createElementNS(L,"a"),r=document.createElementNS(L,"text");return D(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 nn(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=M(t.nodes,e),i=document.createElementNS(L,"image");return D(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:e.src}),i}const J=100,on='<?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">',sn=(t,e=!1)=>{const n=t.nodes,o=n.offsetHeight+J*2,s=n.offsetWidth+J*2,i=Ke(o+"px",s+"px"),r=document.createElementNS(L,"svg"),l=document.createElementNS(L,"rect");D(l,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:t.theme.cssVar["--bgcolor"]}),i.appendChild(l),n.querySelectorAll(".subLines").forEach(c=>{const u=c.cloneNode(!0),{offsetLeft:g,offsetTop:y}=M(n,c.parentElement);u.setAttribute("x",`${g}`),u.setAttribute("y",`${y}`),r.appendChild(u)});const a=n.querySelector(".lines")?.cloneNode(!0);a&&r.appendChild(a);const d=n.querySelector(".topiclinks")?.cloneNode(!0);d&&r.appendChild(d);const f=n.querySelector(".summary")?.cloneNode(!0);return f&&r.appendChild(f),n.querySelectorAll("me-tpc").forEach(c=>{c.nodeObj.dangerouslySetInnerHTML?r.appendChild(K(t,c,!e)):(r.appendChild(tn(t,c)),r.appendChild(K(t,c.text,!e)))}),n.querySelectorAll(".tags > span").forEach(c=>{r.appendChild(K(t,c))}),n.querySelectorAll(".icons > span").forEach(c=>{r.appendChild(K(t,c))}),n.querySelectorAll(".hyper-link").forEach(c=>{r.appendChild(en(t,c))}),n.querySelectorAll("img").forEach(c=>{r.appendChild(nn(t,c))}),D(r,{x:J+"",y:J+"",overflow:"visible"}),i.appendChild(r),i},rn=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),on+t.outerHTML);function ln(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 cn={getObjById:G,generateNewObj:Yt,layout:jt,linkDiv:De,editTopic:te,createWrapper:Kt,createParent:Jt,createChildren:Zt,createTopic:Qt,findEle:yt,changeTheme:Ae,changeCompact:Ne,...me,...{},...Fe,...Ue,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(t=!1,e){const n=this.exportSvg(t,e),o=await ln(n);return new Promise((s,i)=>{const r=new Image;r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{const l=document.createElement("canvas");l.width=r.width,l.height=r.height,l.getContext("2d").drawImage(r,0,0),l.toBlob(s,"image/png",1)},r.src=o,r.onerror=i})},exportSvg:function(t=!1,e){const n=sn(this,t),o=rn(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),t.compact!==void 0&&(this.compact=t.compact),this.changeTheme(t.theme||this.theme,!1),t.meta&&(this.meta=t.meta),this.nodeData=t.nodeData,tt(this.nodeData),this.arrows=t.arrows||[],this.summaries=t.summaries||[],this.tidyArrow(),this.toolBar&&ke(this),this.layout(),this.linkDiv(),this.toCenter()},destroy(){this.disposable.forEach(t=>t()),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.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.arrowSvg=void 0,this.P2=void 0,this.P3=void 0,this.line1=void 0,this.line2=void 0,this.nodes=void 0,this.selection?.destroy(),this.selection=void 0},enableMobileMultiSelect(t){this.mobileMultiSelect=t}},an="5.14.0-beta.1";function hn(t){return{x:0,y:0,moved:!1,mousedown:!1,handlePointerDown(e){this.moved=!1;const n=e.target,o=t.mouseSelectionButton===0?2:0,s=t.spacePressed&&e.button===0&&e.pointerType==="mouse",i=!t.editable||e.button===o&&e.pointerType==="mouse"||e.pointerType==="touch";!s&&!i||(this.x=e.clientX,this.y=e.clientY,n.className!=="circle"&&n.contentEditable!=="plaintext-only"&&(this.mousedown=!0,n.setPointerCapture(e.pointerId)))},handlePointerMove(e){if(!this.mousedown||e.target.contentEditable==="plaintext-only"&&!t.spacePressed)return!1;const n=e.clientX-this.x,o=e.clientY-this.y;return this.x=e.clientX,this.y=e.clientY,this.moved=!0,t.move(n,o),!0},handlePointerUp(e){if(!this.mousedown)return;const n=e.target;n.hasPointerCapture&&n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),this.mousedown=!1},clear(){this.mousedown=!1,this.moved=!1}}}function A({el:t,direction:e,editable:n,contextMenu:o,toolBar:s,keypress:i,mouseSelectionButton:r,selectionContainer:l,before:a,newTopicName:d,allowUndo:f,generateMainBranch:c,generateSubBranch:u,overflowHidden:g,compact:y,theme:p,alignment:b,scaleSensitivity:w,scaleMax:v,scaleMin:C,handleWheel:T,markdown:h,imageProxy:m,pasteHandler:x,mobileMultiSelect:E}){let S=null;const P=Object.prototype.toString.call(t);if(P==="[object HTMLDivElement]"?S=t:P==="[object String]"&&(S=document.querySelector(t)),!S)throw new Error("MindElixir: el is not a valid element");S.style.position="relative",S.innerHTML="",this.el=S,this.disposable=[],this.before=a||{},this.newTopicName=d||"New Node",this.contextMenu=o??!0,this.toolBar=s??!0,this.keypress=i??!0,this.mouseSelectionButton=r??0,this.direction=e??1,this.editable=n??!0,this.allowUndo=f??!0,this.scaleSensitivity=w??.1,this.scaleMax=v??1.4,this.scaleMin=C??.2,this.generateMainBranch=c||Tt,this.generateSubBranch=u||Dt,this.overflowHidden=g??!1,this.compact=y??!1,this.alignment=b??"root",this.handleWheel=T??!0,this.markdown=h||void 0,this.imageProxy=m||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.mobileMultiSelect=E??!1,this.panHelper=hn(this),this.bus=Ee(),this.container=document.createElement("div"),this.selectionContainer=l||this.container,this.container.className="map-container";const N=window.matchMedia("(prefers-color-scheme: dark)");this.theme=p||(N.matches?F:z);const I=document.createElement("div");I.className="map-canvas",this.map=I,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=document.createElement("me-nodes"),this.lines=X("lines"),this.summarySvg=X("summary"),this.linkController=X("linkcontroller"),this.P2=document.createElement("div"),this.P3=document.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=Ct(),this.line2=Ct(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.arrowSvg=X("topiclinks"),this.labelContainer=document.createElement("div"),this.labelContainer.className="label-container",this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push(Se(this)),x&&(this.pasteHandler=x)}return A.prototype=cn,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=z,A.DARK_THEME=F,A.version=an,A.E=yt,$.DARK_THEME=F,$.LEFT=0,$.RIGHT=1,$.SIDE=2,$.THEME=z,$.default=A,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),$})({});
16
+ `).forEach((l,a)=>{const d=document.createElementNS(L,"text");D(d,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+Je(e.lineHeight,e.fontSize)*(a+1)+parseFloat(e.fontSize)*(a+1)+"","text-anchor":"start","font-family":e.fontFamily,"font-size":`${e.fontSize}`,"font-weight":`${e.fontWeight}`,fill:`${e.color}`}),d.innerHTML=l,s.appendChild(d)}),s}function Qe(t,e,n,o){let s="";t.nodeObj?.dangerouslySetInnerHTML?s=t.nodeObj.dangerouslySetInnerHTML:t.text?s=t.text.textContent:s=t.childNodes[0].textContent;const i=document.createElementNS(L,"foreignObject");D(i,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+"",width:e.width,height:e.height});const r=document.createElement("div");return D(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 tn(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=M(t.nodes,e),i=document.createElementNS(L,"rect");return D(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 K(t,e,n=!1){const o=getComputedStyle(e),{offsetLeft:s,offsetTop:i}=M(t.nodes,e),r=document.createElementNS(L,"rect");D(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 l=document.createElementNS(L,"g");l.appendChild(r);let a;return n?a=Qe(e,o,s,i):a=Ze(e,o,s,i),l.appendChild(a),l}function en(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=M(t.nodes,e),i=document.createElementNS(L,"a"),r=document.createElementNS(L,"text");return D(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 nn(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=M(t.nodes,e),i=document.createElementNS(L,"image");return D(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:e.src}),i}const J=100,on='<?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">',sn=(t,e=!1)=>{const n=t.nodes,o=n.offsetHeight+J*2,s=n.offsetWidth+J*2,i=Ke(o+"px",s+"px"),r=document.createElementNS(L,"svg"),l=document.createElementNS(L,"rect");D(l,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:t.theme.cssVar["--bgcolor"]}),i.appendChild(l),n.querySelectorAll(".subLines").forEach(c=>{const u=c.cloneNode(!0),{offsetLeft:g,offsetTop:y}=M(n,c.parentElement);u.setAttribute("x",`${g}`),u.setAttribute("y",`${y}`),r.appendChild(u)});const a=n.querySelector(".lines")?.cloneNode(!0);a&&r.appendChild(a);const d=n.querySelector(".topiclinks")?.cloneNode(!0);d&&r.appendChild(d);const f=n.querySelector(".summary")?.cloneNode(!0);return f&&r.appendChild(f),n.querySelectorAll("me-tpc").forEach(c=>{c.nodeObj.dangerouslySetInnerHTML?r.appendChild(K(t,c,!e)):(r.appendChild(tn(t,c)),r.appendChild(K(t,c.text,!e)))}),n.querySelectorAll(".tags > span").forEach(c=>{r.appendChild(K(t,c))}),n.querySelectorAll(".icons > span").forEach(c=>{r.appendChild(K(t,c))}),n.querySelectorAll(".hyper-link").forEach(c=>{r.appendChild(en(t,c))}),n.querySelectorAll("img").forEach(c=>{r.appendChild(nn(t,c))}),D(r,{x:J+"",y:J+"",overflow:"visible"}),i.appendChild(r),i},rn=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),on+t.outerHTML);function ln(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 cn={getObjById:G,generateNewObj:Yt,layout:jt,linkDiv:De,editTopic:te,createWrapper:Kt,createParent:Jt,createChildren:Zt,createTopic:Qt,findEle:yt,changeTheme:Ae,changeCompact:Ne,...me,...{},...Fe,...Ue,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(t=!1,e){const n=this.exportSvg(t,e),o=await ln(n);return new Promise((s,i)=>{const r=new Image;r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{const l=document.createElement("canvas");l.width=r.width,l.height=r.height,l.getContext("2d").drawImage(r,0,0),l.toBlob(s,"image/png",1)},r.src=o,r.onerror=i})},exportSvg:function(t=!1,e){const n=sn(this,t),o=rn(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),t.compact!==void 0&&(this.compact=t.compact),this.changeTheme(t.theme||this.theme,!1),t.meta&&(this.meta=t.meta),this.nodeData=t.nodeData,tt(this.nodeData),this.arrows=t.arrows||[],this.summaries=t.summaries||[],this.tidyArrow(),this.toolBar&&ke(this),this.layout(),this.linkDiv(),this.toCenter()},destroy(){this.disposable.forEach(t=>t()),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.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.arrowSvg=void 0,this.P2=void 0,this.P3=void 0,this.line1=void 0,this.line2=void 0,this.nodes=void 0,this.selection?.destroy(),this.selection=void 0},enableMobileMultiSelect(t){this.mobileMultiSelect=t}},an="5.14.0";function hn(t){return{x:0,y:0,moved:!1,mousedown:!1,handlePointerDown(e){this.moved=!1;const n=e.target,o=t.mouseSelectionButton===0?2:0,s=t.spacePressed&&e.button===0&&e.pointerType==="mouse",i=!t.editable||e.button===o&&e.pointerType==="mouse"||e.pointerType==="touch";!s&&!i||(this.x=e.clientX,this.y=e.clientY,n.className!=="circle"&&n.contentEditable!=="plaintext-only"&&(this.mousedown=!0,n.setPointerCapture(e.pointerId)))},handlePointerMove(e){if(!this.mousedown||e.target.contentEditable==="plaintext-only"&&!t.spacePressed)return!1;const n=e.clientX-this.x,o=e.clientY-this.y;return this.x=e.clientX,this.y=e.clientY,this.moved=!0,t.move(n,o),!0},handlePointerUp(e){if(!this.mousedown)return;const n=e.target;n.hasPointerCapture&&n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),this.mousedown=!1},clear(){this.mousedown=!1,this.moved=!1}}}function A({el:t,direction:e,editable:n,contextMenu:o,toolBar:s,keypress:i,mouseSelectionButton:r,selectionContainer:l,before:a,newTopicName:d,allowUndo:f,generateMainBranch:c,generateSubBranch:u,overflowHidden:g,compact:y,theme:p,alignment:b,scaleSensitivity:w,scaleMax:v,scaleMin:C,handleWheel:T,markdown:h,imageProxy:m,pasteHandler:x,mobileMultiSelect:E}){let S=null;const P=Object.prototype.toString.call(t);if(P==="[object HTMLDivElement]"?S=t:P==="[object String]"&&(S=document.querySelector(t)),!S)throw new Error("MindElixir: el is not a valid element");S.style.position="relative",S.innerHTML="",this.el=S,this.disposable=[],this.before=a||{},this.newTopicName=d||"New Node",this.contextMenu=o??!0,this.toolBar=s??!0,this.keypress=i??!0,this.mouseSelectionButton=r??0,this.direction=e??1,this.editable=n??!0,this.allowUndo=f??!0,this.scaleSensitivity=w??.1,this.scaleMax=v??1.4,this.scaleMin=C??.2,this.generateMainBranch=c||Tt,this.generateSubBranch=u||Dt,this.overflowHidden=g??!1,this.compact=y??!1,this.alignment=b??"root",this.handleWheel=T??!0,this.markdown=h||void 0,this.imageProxy=m||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.mobileMultiSelect=E??!1,this.panHelper=hn(this),this.bus=Ee(),this.container=document.createElement("div"),this.selectionContainer=l||this.container,this.container.className="map-container";const N=window.matchMedia("(prefers-color-scheme: dark)");this.theme=p||(N.matches?F:z);const I=document.createElement("div");I.className="map-canvas",this.map=I,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=document.createElement("me-nodes"),this.lines=X("lines"),this.summarySvg=X("summary"),this.linkController=X("linkcontroller"),this.P2=document.createElement("div"),this.P3=document.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=Ct(),this.line2=Ct(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.arrowSvg=X("topiclinks"),this.labelContainer=document.createElement("div"),this.labelContainer.className="label-container",this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":this.disposable.push(Se(this)),x&&(this.pasteHandler=x)}return A.prototype=cn,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=z,A.DARK_THEME=F,A.version=an,A.E=yt,$.DARK_THEME=F,$.LEFT=0,$.RIGHT=1,$.SIDE=2,$.THEME=z,$.default=A,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),$})({});
@@ -690,7 +690,7 @@ function Ne(t) {
690
690
  r.handlePointerMove(h);
691
691
  break;
692
692
  case i.DragWait:
693
- a.handleMove(h), a.timer === null && (t.ptState = i.Idle);
693
+ a.handleMove(h), a.timer === null && (t.ptState = i.Pan, e.handlePointerMove(h));
694
694
  break;
695
695
  case i.Drag:
696
696
  Ft(t, c, h);
@@ -1540,7 +1540,7 @@ const $n = function(t = !1, e) {
1540
1540
  enableMobileMultiSelect(t) {
1541
1541
  this.mobileMultiSelect = t;
1542
1542
  }
1543
- }, Yn = "5.14.0-beta.1";
1543
+ }, Yn = "5.14.0";
1544
1544
  function Wn(t) {
1545
1545
  return {
1546
1546
  x: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mind-elixir",
3
- "version": "5.14.0-beta.1",
3
+ "version": "5.14.0",
4
4
  "type": "module",
5
5
  "description": "Mind elixir is a free open source mind map core.",
6
6
  "keywords": [
@@ -9,6 +9,21 @@
9
9
  "dom",
10
10
  "visualization"
11
11
  ],
12
+ "scripts": {
13
+ "lint": "eslint --cache --max-warnings 0 \"src/**/*.{js,json,ts}\" --fix",
14
+ "dev": "vite",
15
+ "build": "node build.js && tsc",
16
+ "tsc": "tsc",
17
+ "preview": "vite preview",
18
+ "test": "playwright test",
19
+ "test:ui": "playwright test --ui",
20
+ "test:clean": "rimraf .nyc_output coverage",
21
+ "test:coverage": "pnpm test:clean && pnpm test && pnpm nyc && npx http-server ./coverage",
22
+ "nyc": "nyc report --reporter=html",
23
+ "doc": "api-extractor run --local --verbose",
24
+ "doc:md": "api-documenter markdown --input-folder ./api --output-folder ./md",
25
+ "beta": "npm run build && npm publish --tag beta"
26
+ },
12
27
  "exports": {
13
28
  ".": {
14
29
  "types": "./dist/types/index.d.ts",
@@ -87,20 +102,5 @@
87
102
  "typescript": "^5.9.2",
88
103
  "vite": "^7.1.7",
89
104
  "vite-plugin-istanbul": "^7.2.0"
90
- },
91
- "scripts": {
92
- "lint": "eslint --cache --max-warnings 0 \"src/**/*.{js,json,ts}\" --fix",
93
- "dev": "vite",
94
- "build": "node build.js && tsc",
95
- "tsc": "tsc",
96
- "preview": "vite preview",
97
- "test": "playwright test",
98
- "test:ui": "playwright test --ui",
99
- "test:clean": "rimraf .nyc_output coverage",
100
- "test:coverage": "pnpm test:clean && pnpm test && pnpm nyc && npx http-server ./coverage",
101
- "nyc": "nyc report --reporter=html",
102
- "doc": "api-extractor run --local --verbose",
103
- "doc:md": "api-documenter markdown --input-folder ./api --output-folder ./md",
104
- "beta": "npm run build && npm publish --tag beta"
105
105
  }
106
- }
106
+ }