mind-elixir 5.11.0 → 5.11.1-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.
@@ -1 +1 @@
1
- .map-container{-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;user-select:none;-webkit-user-select:none;height:100%;width:100%;overflow:hidden;font-size:16px;outline:none;touch-action:none;background-color:var(--bgcolor)}.map-container p{margin:0}.map-container *{box-sizing:border-box}.map-container::-webkit-scrollbar{width:0px;height:0px}.map-container .selected{outline:2px solid var(--selected);outline-offset:1px}.map-container.space-pressed,.map-container.space-pressed *{cursor:grab!important}.map-container.space-pressed:active,.map-container.space-pressed:active *{cursor:grabbing!important}.map-container .hyper-link{text-decoration:none;margin-left:.3em}.map-container me-main>me-wrapper>me-parent>me-epd{top:50%;transform:translateY(-50%)}.map-container me-epd{top:100%;transform:translateY(-50%)}.map-container .lhs{direction:rtl}.map-container .lhs>me-wrapper>me-parent>me-epd{left:-10px}.map-container .lhs me-epd{left:5px}.map-container .lhs me-tpc{direction:ltr}.map-container .rhs>me-wrapper>me-parent>me-epd{right:-10px}.map-container .rhs me-epd{right:5px}.map-container .map-canvas{position:relative;-webkit-user-select:none;user-select:none;width:fit-content;transform:scale(1)}.map-container .map-canvas me-nodes{position:relative;display:flex;justify-content:center;align-items:center;height:max-content;width:max-content;padding:var(--map-padding)}.map-container me-main>me-wrapper{position:relative;margin:var(--main-gap-y) var(--main-gap-x)}.map-container me-main>me-wrapper>me-parent{margin:10px;padding:0}.map-container me-main>me-wrapper>me-parent>me-tpc{border-radius:var(--main-radius);background-color:var(--main-bgcolor);border:2px solid var(--main-color);color:var(--main-color);padding:8px 25px}.map-container me-wrapper{display:block;pointer-events:none;width:fit-content}.map-container me-children,.map-container me-parent{display:inline-block;vertical-align:middle}.map-container me-root{position:relative;margin:45px 0;z-index:10}.map-container me-root me-tpc{font-size:25px;color:var(--root-color);padding:10px 30px;border-radius:var(--root-radius);border:var(--root-border-color) 2px solid;background-color:var(--root-bgcolor)}.map-container me-parent{position:relative;cursor:pointer;padding:6px var(--node-gap-x);margin-top:var(--node-gap-y);z-index:10}.map-container me-parent me-tpc{position:relative;border-radius:3px;color:var(--color);padding:var(--topic-padding)}.map-container me-parent me-tpc .insert-preview{position:absolute;width:100%;left:0;z-index:9}.map-container me-parent me-tpc .show{background:#7ad5ff;pointer-events:none;opacity:.7;border-radius:3px}.map-container me-parent me-tpc .before{height:14px;top:-14px}.map-container me-parent me-tpc .in{height:100%;top:0}.map-container me-parent me-tpc .after{height:14px;bottom:-14px}.map-container me-parent me-epd{position:absolute;height:18px;width:18px;opacity:.8;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NDcxNzI0MiIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNDgwaC0xMzguNjY2NjY3VjM0MS4zMzMzMzNjMC0xNy4wNjY2NjctMTQuOTMzMzMzLTMyLTMyLTMycy0zMiAxNC45MzMzMzMtMzIgMzJ2MTM4LjY2NjY2N0gzNDEuMzMzMzMzYy0xNy4wNjY2NjcgMC0zMiAxNC45MzMzMzMtMzIgMzJzMTQuOTMzMzMzIDMyIDMyIDMyaDEzOC42NjY2NjdWNjgyLjY2NjY2N2MwIDE3LjA2NjY2NyAxNC45MzMzMzMgMzIgMzIgMzJzMzItMTQuOTMzMzMzIDMyLTMydi0xMzguNjY2NjY3SDY4Mi42NjY2NjdjMTcuMDY2NjY3IDAgMzItMTQuOTMzMzMzIDMyLTMycy0xNC45MzMzMzMtMzItMzItMzJ6Ij48L3BhdGg+Cjwvc3ZnPg==);background-repeat:no-repeat;background-size:contain;background-position:center;pointer-events:all;z-index:9}.map-container me-parent me-epd.minus{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NTU2NDk4NSIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNTQ0SDM0MS4zMzMzMzNjLTE3LjA2NjY2NyAwLTMyLTE0LjkzMzMzMy0zMi0zMnMxNC45MzMzMzMtMzIgMzItMzJoMzQxLjMzMzMzNGMxNy4wNjY2NjcgMCAzMiAxNC45MzMzMzMgMzIgMzJzLTE0LjkzMzMzMyAzMi0zMiAzMnoiPjwvcGF0aD4KPC9zdmc+)!important;transition:opacity .3s;opacity:0}@media (hover: hover){.map-container me-parent me-epd.minus:hover{opacity:.8}}@media (hover: none){.map-container me-parent me-epd.minus{opacity:.8}}.map-container .icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}.map-container .lines,.map-container .summary,.map-container .subLines,.map-container .topiclinks,.map-container .linkcontroller{position:absolute;height:102%;width:100%;top:0;left:0}.map-container .topiclinks,.map-container .linkcontroller,.map-container .summary{pointer-events:none;z-index:20}.map-container .summary>g,.map-container .topiclinks>g{cursor:pointer;pointer-events:stroke;z-index:20}.map-container .label-container{z-index:21}.map-container .lines,.map-container .subLines{pointer-events:none}.map-container #input-box{position:absolute;top:0;left:0;width:max-content;max-width:35em;direction:ltr;-webkit-user-select:auto;user-select:auto;pointer-events:auto;color:var(--color);background-color:var(--bgcolor);outline:1px solid #ccc;border-radius:2px;z-index:100}.map-container me-tpc{display:block;max-width:35em;white-space:pre-wrap;pointer-events:all}.map-container me-tpc>*{pointer-events:none}.map-container me-tpc>a,.map-container me-tpc>iframe{pointer-events:auto}.map-container me-tpc>.text{display:inline-block}.map-container me-tpc>.text a{pointer-events:auto}.map-container me-tpc>img{display:block;margin-bottom:8px;object-fit:cover}.map-container .circle{position:absolute;height:10px;width:10px;margin-top:-5px;margin-left:-5px;border-radius:100%;background:#757575;border:2px solid #ffffff;z-index:50;cursor:pointer}.map-container .circle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:30px;height:30px;background:transparent}.map-container .tags{direction:ltr}.map-container .tags span{display:inline-block;border-radius:3px;padding:2px 4px;background:#d6f0f8;color:#276f86;margin:2px 4px 0 0;font-size:12px;line-height:1.3em}.map-container .icons{display:inline-block;direction:ltr;margin-left:5px}.map-container .icons span{display:inline-block;line-height:1.3em}.map-container .mind-elixir-ghost{position:absolute;top:0;left:0;box-sizing:content-box;opacity:.7;background-color:var(--main-bgcolor);border:2px solid var(--main-color);color:var(--main-color);max-width:200px;width:fit-content;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:8px 16px;border-radius:6px;display:none;pointer-events:none;z-index:1000}.map-container .selection-area{background:#4f90f22d;border:1px solid #4f90f2}.map-container .svg-label{position:absolute;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;line-height:1.2;pointer-events:auto;cursor:pointer;z-index:10;width:max-content;max-width:200px;border-radius:3px;padding:var(--topic-padding)}.map-container .svg-label[data-type=arrow]{background-color:var(--main-bgcolor-transparent)}.map-container h1{font-size:1.5rem;font-weight:700;color:var(--selected)}.map-container h2{font-size:1.25rem;font-weight:600;color:var(--selected)}.map-container h3{font-size:1.125rem;font-weight:600;color:var(--selected)}.map-container h4{font-size:1rem;font-weight:600;color:var(--selected)}.map-container h5{font-size:.875rem;font-weight:600;color:var(--selected)}.map-container h6{font-size:.875rem;font-weight:500;margin:.1rem 0;color:var(--selected);font-style:italic}.map-container strong.asterisk-emphasis,.map-container em{color:var(--selected)}.map-container strong.underscore-emphasis{background:#ffeb3b40;padding:.05em .15em;border-radius:.15em}.map-container a{color:var(--selected)}.map-container a:hover{color:var(--selected);text-decoration:underline}.map-container .context-menu{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99}.map-container .context-menu .menu-list{position:fixed;list-style:none;margin:0;padding:0;color:var(--panel-color);box-shadow:0 12px 15px #0003;border-radius:5px;overflow:hidden}.map-container .context-menu .menu-list li{min-width:200px;overflow:hidden;white-space:nowrap;padding:6px 10px;background:var(--panel-bgcolor);border-bottom:1px solid var(--panel-border-color);cursor:pointer}.map-container .context-menu .menu-list li span{line-height:20px}.map-container .context-menu .menu-list li a{color:#333;text-decoration:none}.map-container .context-menu .menu-list li.disabled{display:none}.map-container .context-menu .menu-list li:hover{filter:brightness(.95)}.map-container .context-menu .menu-list li:last-child{border-bottom:0}.map-container .context-menu .menu-list li span:last-child{float:right}.map-container .context-menu .key{font-size:10px;background-color:#f1f1f1;color:#333;padding:2px 5px;border-radius:3px}.map-container .tips{position:absolute;bottom:28px;left:50%;transform:translate(-50%);color:var(--panel-color);background:var(--panel-bgcolor);opacity:.8;padding:5px 10px;border-radius:5px;font-weight:700}.mind-elixir-toolbar{position:absolute;color:var(--panel-color);background:var(--panel-bgcolor);padding:10px;border-radius:5px;box-shadow:0 1px 2px #0003}.mind-elixir-toolbar svg{display:inline-block}.mind-elixir-toolbar span:active{opacity:.5}.mind-elixir-toolbar.rb{right:20px;bottom:20px}.mind-elixir-toolbar.rb span+span{margin-left:10px}.mind-elixir-toolbar.lt{font-size:20px;left:20px;top:20px}.mind-elixir-toolbar.lt span{display:block}.mind-elixir-toolbar.lt span+span{margin-top:10px}
1
+ .map-container{-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;user-select:none;-webkit-user-select:none;height:100%;width:100%;overflow:hidden;font-size:16px;outline:none;touch-action:none;background-color:var(--bgcolor)}.map-container p{margin:0}.map-container *{box-sizing:border-box}.map-container::-webkit-scrollbar{width:0px;height:0px}.map-container .selected{outline:2px solid var(--selected);outline-offset:1px}.map-container.space-pressed,.map-container.space-pressed *{cursor:grab!important}.map-container.space-pressed:active,.map-container.space-pressed:active *{cursor:grabbing!important}.map-container .hyper-link{text-decoration:none;margin-left:.3em}.map-container me-main>me-wrapper>me-parent>me-epd{top:50%;transform:translateY(-50%)}.map-container me-epd{top:100%;transform:translateY(-50%)}.map-container .lhs{direction:rtl}.map-container .lhs>me-wrapper>me-parent>me-epd{left:-10px}.map-container .lhs me-epd{left:5px}.map-container .lhs me-tpc{direction:ltr}.map-container .rhs>me-wrapper>me-parent>me-epd{right:-10px}.map-container .rhs me-epd{right:5px}.map-container .map-canvas{pointer-events:none;position:relative;-webkit-user-select:none;user-select:none;width:fit-content;transform:scale(1)}.map-container .map-canvas me-nodes{position:relative;display:flex;justify-content:center;align-items:center;height:max-content;width:max-content;padding:var(--map-padding)}.map-container me-main>me-wrapper{position:relative;margin:var(--main-gap-y) var(--main-gap-x)}.map-container me-main>me-wrapper>me-parent{margin:10px;padding:0}.map-container me-main>me-wrapper>me-parent>me-tpc{border-radius:var(--main-radius);background-color:var(--main-bgcolor);border:2px solid var(--main-color);color:var(--main-color);padding:8px 25px}.map-container me-wrapper{display:block;width:fit-content}.map-container me-children,.map-container me-parent{display:inline-block;vertical-align:middle}.map-container me-root{position:relative;margin:45px 0;z-index:10}.map-container me-root me-tpc{font-size:25px;color:var(--root-color);padding:10px 30px;border-radius:var(--root-radius);border:var(--root-border-color) 2px solid;background-color:var(--root-bgcolor)}.map-container me-parent{position:relative;cursor:pointer;padding:6px var(--node-gap-x);margin-top:var(--node-gap-y);z-index:10}.map-container me-parent me-tpc{position:relative;border-radius:3px;color:var(--color);padding:var(--topic-padding)}.map-container me-parent me-tpc .insert-preview{position:absolute;width:100%;left:0;z-index:9}.map-container me-parent me-tpc .show{background:#7ad5ff;pointer-events:none;opacity:.7;border-radius:3px}.map-container me-parent me-tpc .before{height:14px;top:-14px}.map-container me-parent me-tpc .in{height:100%;top:0}.map-container me-parent me-tpc .after{height:14px;bottom:-14px}.map-container me-parent me-epd{position:absolute;height:18px;width:18px;opacity:.8;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NDcxNzI0MiIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNDgwaC0xMzguNjY2NjY3VjM0MS4zMzMzMzNjMC0xNy4wNjY2NjctMTQuOTMzMzMzLTMyLTMyLTMycy0zMiAxNC45MzMzMzMtMzIgMzJ2MTM4LjY2NjY2N0gzNDEuMzMzMzMzYy0xNy4wNjY2NjcgMC0zMiAxNC45MzMzMzMtMzIgMzJzMTQuOTMzMzMzIDMyIDMyIDMyaDEzOC42NjY2NjdWNjgyLjY2NjY2N2MwIDE3LjA2NjY2NyAxNC45MzMzMzMgMzIgMzIgMzJzMzItMTQuOTMzMzMzIDMyLTMydi0xMzguNjY2NjY3SDY4Mi42NjY2NjdjMTcuMDY2NjY3IDAgMzItMTQuOTMzMzMzIDMyLTMycy0xNC45MzMzMzMtMzItMzItMzJ6Ij48L3BhdGg+Cjwvc3ZnPg==);background-repeat:no-repeat;background-size:contain;background-position:center;pointer-events:all;z-index:9}.map-container me-parent me-epd.minus{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NTU2NDk4NSIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNTQ0SDM0MS4zMzMzMzNjLTE3LjA2NjY2NyAwLTMyLTE0LjkzMzMzMy0zMi0zMnMxNC45MzMzMzMtMzIgMzItMzJoMzQxLjMzMzMzNGMxNy4wNjY2NjcgMCAzMiAxNC45MzMzMzMgMzIgMzJzLTE0LjkzMzMzMyAzMi0zMiAzMnoiPjwvcGF0aD4KPC9zdmc+)!important;transition:opacity .3s;opacity:0}@media (hover: hover){.map-container me-parent me-epd.minus:hover{opacity:.8}}@media (hover: none){.map-container me-parent me-epd.minus{opacity:.8}}.map-container .icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}.map-container .lines,.map-container .summary,.map-container .subLines,.map-container .topiclinks,.map-container .linkcontroller{position:absolute;height:102%;width:100%;top:0;left:0}.map-container .topiclinks,.map-container .linkcontroller,.map-container .summary{pointer-events:none;z-index:20}.map-container .summary>g,.map-container .topiclinks>g{cursor:pointer;pointer-events:stroke;z-index:20}.map-container .label-container{z-index:21}.map-container .lines,.map-container .subLines{pointer-events:none}.map-container #input-box{position:absolute;top:0;left:0;width:max-content;max-width:35em;direction:ltr;-webkit-user-select:auto;user-select:auto;pointer-events:auto;color:var(--color);background-color:var(--bgcolor);outline:1px solid #ccc;border-radius:2px;z-index:100}.map-container me-tpc{display:block;max-width:35em;white-space:pre-wrap;pointer-events:all}.map-container me-tpc>*{pointer-events:none}.map-container me-tpc>a,.map-container me-tpc>iframe{pointer-events:auto}.map-container me-tpc>.text{display:inline-block}.map-container me-tpc>.text a{pointer-events:auto}.map-container me-tpc>img{display:block;margin-bottom:8px;object-fit:cover}.map-container .circle{position:absolute;pointer-events:all;height:10px;width:10px;margin-top:-5px;margin-left:-5px;border-radius:100%;background:#757575;border:2px solid #ffffff;z-index:50;cursor:pointer}.map-container .circle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:30px;height:30px;background:transparent}.map-container .tags{direction:ltr}.map-container .tags span{display:inline-block;border-radius:3px;padding:2px 4px;background:#d6f0f8;color:#276f86;margin:2px 4px 0 0;font-size:12px;line-height:1.3em}.map-container .icons{display:inline-block;direction:ltr;margin-left:5px}.map-container .icons span{display:inline-block;line-height:1.3em}.map-container .mind-elixir-ghost{position:absolute;top:0;left:0;box-sizing:content-box;opacity:.7;background-color:var(--main-bgcolor);border:2px solid var(--main-color);color:var(--main-color);max-width:200px;width:fit-content;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:8px 16px;border-radius:6px;display:none;pointer-events:none;z-index:1000}.map-container .selection-area{background:#4f90f22d;border:1px solid #4f90f2}.map-container .svg-label{position:absolute;overflow-wrap:break-word;-webkit-hyphens:auto;hyphens:auto;line-height:1.2;pointer-events:auto;cursor:pointer;z-index:10;width:max-content;max-width:200px;border-radius:3px;padding:var(--topic-padding)}.map-container .svg-label[data-type=arrow]{background-color:var(--main-bgcolor-transparent)}.map-container h1{font-size:1.5rem;font-weight:700;color:var(--selected)}.map-container h2{font-size:1.25rem;font-weight:600;color:var(--selected)}.map-container h3{font-size:1.125rem;font-weight:600;color:var(--selected)}.map-container h4{font-size:1rem;font-weight:600;color:var(--selected)}.map-container h5{font-size:.875rem;font-weight:600;color:var(--selected)}.map-container h6{font-size:.875rem;font-weight:500;margin:.1rem 0;color:var(--selected);font-style:italic}.map-container strong.asterisk-emphasis,.map-container em{color:var(--selected)}.map-container strong.underscore-emphasis{background:#ffeb3b40;padding:.05em .15em;border-radius:.15em}.map-container a{color:var(--selected)}.map-container a:hover{color:var(--selected);text-decoration:underline}.map-container .context-menu{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99}.map-container .context-menu .menu-list{position:fixed;list-style:none;margin:0;padding:0;color:var(--panel-color);box-shadow:0 12px 15px #0003;border-radius:5px;overflow:hidden}.map-container .context-menu .menu-list li{min-width:200px;overflow:hidden;white-space:nowrap;padding:6px 10px;background:var(--panel-bgcolor);border-bottom:1px solid var(--panel-border-color);cursor:pointer}.map-container .context-menu .menu-list li span{line-height:20px}.map-container .context-menu .menu-list li a{color:#333;text-decoration:none}.map-container .context-menu .menu-list li.disabled{display:none}.map-container .context-menu .menu-list li:hover{filter:brightness(.95)}.map-container .context-menu .menu-list li:last-child{border-bottom:0}.map-container .context-menu .menu-list li span:last-child{float:right}.map-container .context-menu .key{font-size:10px;background-color:#f1f1f1;color:#333;padding:2px 5px;border-radius:3px}.map-container .tips{position:absolute;bottom:28px;left:50%;transform:translate(-50%);color:var(--panel-color);background:var(--panel-bgcolor);opacity:.8;padding:5px 10px;border-radius:5px;font-weight:700}.mind-elixir-toolbar{position:absolute;color:var(--panel-color);background:var(--panel-bgcolor);padding:10px;border-radius:5px;box-shadow:0 1px 2px #0003}.mind-elixir-toolbar svg{display:inline-block}.mind-elixir-toolbar span:active{opacity:.5}.mind-elixir-toolbar.rb{right:20px;bottom:20px}.mind-elixir-toolbar.rb span+span{margin-left:10px}.mind-elixir-toolbar.lt{font-size:20px;left:20px;top:20px}.mind-elixir-toolbar.lt span{display:block}.mind-elixir-toolbar.lt span+span{margin-top:10px}
@@ -1,4 +1,4 @@
1
- var MindElixirLite=(function(Y){"use strict";const j={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","--main-bgcolor-transparent":"rgba(255, 255, 255, 0.8)","--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 80px"}},U={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","--main-bgcolor-transparent":"rgba(76, 79, 105, 0.8)","--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 Ht(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}const K=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=K(t,e.children[n]);if(o)return o}return null}else return null},rt=(t,e)=>{if(t.parent=e,t.children)for(let n=0;n<t.children.length;n++)rt(t.children[n],t)},pt=(t,e,n)=>{t.expanded=e,t.children&&t.children.forEach(o=>{pt(o,e)})};function J(t,e,n,o){const s=n-t,i=o-e,c=Math.atan2(i,s)*180/Math.PI,d=12,a=30,h=(c+180-a)*Math.PI/180,f=(c+180+a)*Math.PI/180;return{x1:n+Math.cos(h)*d,y1:o+Math.sin(h)*d,x2:n+Math.cos(f)*d,y2:o+Math.sin(f)*d}}function V(){return(new Date().getTime().toString(16)+Math.random().toString(16).substring(2)).substring(2,18)}const It=function(){const t=V();return{topic:this.newTopicName,id:t}},H=(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}},M=(t,e)=>{for(const n in e)t.setAttribute(n,e[n])},Z=t=>t?t.tagName==="ME-TPC":!1,ct=t=>{const e=/translate3d\(([^,]+),\s*([^,]+)/,n=t.match(e);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},gt=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)}}},mt=(t,e)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},Ot=function(t,e){if(!e)return Q(t),t;let n=t.querySelector(".insert-preview");const o=`insert-preview ${e} show`;return n||(n=document.createElement("div"),t.appendChild(n)),n.className=o,t},Q=function(t){if(!t)return;const e=t.querySelectorAll(".insert-preview");for(const n of e||[])n.remove()},yt=function(t,e){for(const n of e){const o=n.parentElement.parentElement.contains(t);if(!(t&&t.tagName==="ME-TPC"&&t!==n&&!o&&t.nodeObj.parent))return!1}return!0},Yt=function(t){const e=document.createElement("div");return e.className="mind-elixir-ghost",t.container.appendChild(e),e};class Rt{mind;isMoving=!1;interval=null;speed=20;constructor(e){this.mind=e}move(e,n){this.isMoving||(this.isMoving=!0,this.interval=setInterval(()=>{this.mind.move(e*this.speed*this.mind.scaleVal,n*this.speed*this.mind.scaleVal)},100))}stop(){this.isMoving=!1,this.interval&&(clearInterval(this.interval),this.interval=null)}}function Bt(t){return{isDragging:!1,insertType:null,meet:null,ghost:Yt(t),edgeMoveController:new Rt(t),startX:0,startY:0,pointerId:null}}const Wt=5;function vt(t,e,n,o=!1){if(t.spacePressed)return!1;const s=n.target;return s?.tagName!=="ME-TPC"||!s.nodeObj.parent?!1:(e.startX=n.clientX,e.startY=n.clientY,e.pointerId=n.pointerId,t.dragged=t.currentNodes,o&&bt(t,e),!0)}function wt(t,e,n){t.style.transform=`translate(${e-10}px, ${n-10}px)`,t.style.display="block"}function bt(t,e){const{dragged:n}=t;if(!n)return;const o=document.activeElement;o&&o.isContentEditable&&o.blur(),e.isDragging=!0,n.length>1?e.ghost.innerHTML=n.length+"":e.ghost.innerHTML=n[0].innerHTML;for(const s of n)s.parentElement.parentElement.style.opacity="0.5";t.panHelper.clear()}function Xt(t,e,n){const{dragged:o}=t;if(!o||e.pointerId!==n.pointerId)return;const s=n.clientX-e.startX,i=n.clientY-e.startY,r=Math.sqrt(s*s+i*i);if(!e.isDragging&&r>Wt&&bt(t,e),!e.isDragging)return;const c=t.container.getBoundingClientRect();wt(e.ghost,n.clientX-c.x,n.clientY-c.y),n.clientX<c.x+50?e.edgeMoveController.move(1,0):n.clientX>c.x+c.width-50?e.edgeMoveController.move(-1,0):n.clientY<c.y+50?e.edgeMoveController.move(0,1):n.clientY>c.y+c.height-50?e.edgeMoveController.move(0,-1):e.edgeMoveController.stop(),Q(e.meet);const d=12*t.scaleVal,a=document.elementFromPoint(n.clientX,n.clientY-d);if(yt(a,o)){e.meet=a;const h=a.getBoundingClientRect(),f=h.y;n.clientY>f+h.height?e.insertType="after":e.insertType="in"}else{const h=document.elementFromPoint(n.clientX,n.clientY+d);if(yt(h,o)){e.meet=h;const p=h.getBoundingClientRect().y;n.clientY<p?e.insertType="before":e.insertType="in"}else e.insertType=null,e.meet=null}e.meet&&Ot(e.meet,e.insertType)}function Gt(t,e,n){const{dragged:o}=t;if(!(!o||e.pointerId!==n.pointerId)){e.edgeMoveController.stop();for(const s of o)s.parentElement.parentElement.style.opacity="1";e.ghost.style.display="none",e.ghost.innerHTML="",e.isDragging&&e.meet&&(Q(e.meet),e.insertType==="before"?t.moveNodeBefore(o,e.meet):e.insertType==="after"?t.moveNodeAfter(o,e.meet):e.insertType==="in"&&t.moveNodeIn(o,e.meet)),t.dragged=null,e.isDragging=!1,e.insertType=null,e.meet=null,e.pointerId=null}}function lt(t,e){const{dragged:n}=t;if(n){e.edgeMoveController.stop();for(const o of n)o.parentElement.parentElement.style.opacity="1";e.meet&&Q(e.meet),e.ghost.style.display="none",e.ghost.innerHTML="",t.dragged=null,e.isDragging=!1,e.insertType=null,e.meet=null,e.pointerId=null}}const X={LHS:"lhs",RHS:"rhs"},zt=function(){this.nodes.innerHTML="";const t=this.createTopic(this.nodeData);Ct.call(this,t,this.nodeData),t.draggable=!1;const e=document.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)})}Vt(this,n,e)},Vt=function(t,e,n){const o=document.createElement("me-main");o.className=X.LHS;const s=document.createElement("me-main");s.className=X.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)},Ft=function(t,e){const n=document.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},xt=function(t,e){const o=(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},Ct=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=document.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=document.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=document.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=document.createElement("span");n.className="icons",n.innerHTML=e.icons.map(o=>`<span>${Ht(o)}</span>`).join(""),t.appendChild(n),t.icons=n}else t.icons&&(t.icons=void 0);if(e.tags&&e.tags.length){const n=document.createElement("div");n.className="tags",e.tags.forEach(o=>{const s=document.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)},_t=function(t,e){const n=document.createElement("me-wrapper"),{p:o,tpc:s}=this.createParent(t);if(n.appendChild(o),!e&&t.children&&t.children.length>0){const i=Jt(t.expanded);if(o.appendChild(i),t.expanded!==!1){const r=Ft(this,t.children);n.appendChild(r)}}return{grp:n,top:o,tpc:s}},qt=function(t){const e=document.createElement("me-parent"),n=this.createTopic(t);return Ct.call(this,n,t),e.appendChild(n),{p:e,tpc:n}},jt=function(t){const e=document.createElement("me-children");return e.append(...t),e},Ut=function(t){const e=document.createElement("me-tpc");return e.nodeObj=t,e.dataset.nodeid="me"+t.id,e};function Et(t){const e=document.createRange();e.selectNodeContents(t);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(e))}const Kt=function(t){if(!t)return;const e=document.createElement("div"),n=t.nodeObj,o=n.topic,{offsetLeft:s,offsetTop:i}=H(this.nodes,t);this.nodes.appendChild(e),e.id="input-box",e.textContent=o,e.contentEditable="plaintext-only",e.spellcheck=!1;const r=getComputedStyle(t);e.style.cssText=`
1
+ var MindElixirLite=(function($){"use strict";const X={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","--main-bgcolor-transparent":"rgba(255, 255, 255, 0.8)","--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 80px"}},V={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","--main-bgcolor-transparent":"rgba(76, 79, 105, 0.8)","--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 At(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;")}const z=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=z(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)},lt=(t,e,n)=>{t.expanded=e,t.children&&t.children.forEach(o=>{lt(o,e)})};function F(t,e,n,o){const s=n-t,i=o-e,c=Math.atan2(i,s)*180/Math.PI,l=12,a=30,d=(c+180-a)*Math.PI/180,f=(c+180+a)*Math.PI/180;return{x1:n+Math.cos(d)*l,y1:o+Math.sin(d)*l,x2:n+Math.cos(f)*l,y2:o+Math.sin(f)*l}}function B(){return(new Date().getTime().toString(16)+Math.random().toString(16).substring(2)).substring(2,18)}const $t=function(){const t=B();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}},D=(t,e)=>{for(const n in e)t.setAttribute(n,e[n])},et=t=>t?t.tagName==="ME-TPC":!1,nt=t=>{const e=/translate3d\(([^,]+),\s*([^,]+)/,n=t.match(e);return n?{x:parseFloat(n[1]),y:parseFloat(n[2])}:{x:0,y:0}},at=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)}}},ht=(t,e)=>{const n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},Ht=function(t,e){if(!e)return G(t),t;let n=t.querySelector(".insert-preview");const o=`insert-preview ${e} show`;return n||(n=document.createElement("div"),t.appendChild(n)),n.className=o,t},G=function(t){if(!t)return;const e=t.querySelectorAll(".insert-preview");for(const n of e||[])n.remove()},dt=function(t,e){for(const n of e){const o=n.parentElement.parentElement.contains(t);if(!(t&&t.tagName==="ME-TPC"&&t!==n&&!o&&t.nodeObj.parent))return!1}return!0},It=function(t){const e=document.createElement("div");return e.className="mind-elixir-ghost",t.container.appendChild(e),e};class Ot{mind;isMoving=!1;interval=null;speed=20;constructor(e){this.mind=e}move(e,n){this.isMoving||(this.isMoving=!0,this.interval=setInterval(()=>{this.mind.move(e*this.speed*this.mind.scaleVal,n*this.speed*this.mind.scaleVal)},100))}stop(){this.isMoving=!1,this.interval&&(clearInterval(this.interval),this.interval=null)}}function Bt(t){return{isDragging:!1,insertType:null,meet:null,ghost:It(t),edgeMoveController:new Ot(t),startX:0,startY:0,pointerId:null}}const Rt=5;function ft(t,e,n,o=!1){if(t.spacePressed)return!1;const s=n.target;if(s?.tagName!=="ME-TPC"||!s.nodeObj.parent)return!1;if(e.startX=n.clientX,e.startY=n.clientY,e.pointerId=n.pointerId,t.dragged=t.currentNodes,o){pt(t,e);const i=t.container.getBoundingClientRect();ut(e.ghost,n.clientX-i.x,n.clientY-i.y)}return!0}function ut(t,e,n){t.style.transform=`translate(${e-10}px, ${n-10}px)`,t.style.display="block"}function pt(t,e){const{dragged:n}=t;if(!n)return;const o=document.activeElement;o&&o.isContentEditable&&o.blur(),e.isDragging=!0,n.length>1?e.ghost.innerHTML=n.length+"":e.ghost.innerHTML=n[0].innerHTML;for(const s of n)s.parentElement.parentElement.style.opacity="0.5";t.panHelper.clear()}function Wt(t,e,n){const{dragged:o}=t;if(!o||e.pointerId!==n.pointerId)return;const s=n.clientX-e.startX,i=n.clientY-e.startY,r=Math.sqrt(s*s+i*i);if(!e.isDragging&&r>Rt&&pt(t,e),!e.isDragging)return;const c=t.container.getBoundingClientRect();ut(e.ghost,n.clientX-c.x,n.clientY-c.y),n.clientX<c.x+50?e.edgeMoveController.move(1,0):n.clientX>c.x+c.width-50?e.edgeMoveController.move(-1,0):n.clientY<c.y+50?e.edgeMoveController.move(0,1):n.clientY>c.y+c.height-50?e.edgeMoveController.move(0,-1):e.edgeMoveController.stop(),G(e.meet);const l=12*t.scaleVal,a=document.elementFromPoint(n.clientX,n.clientY-l);if(dt(a,o)){e.meet=a;const d=a.getBoundingClientRect(),f=d.y;n.clientY>f+d.height?e.insertType="after":e.insertType="in"}else{const d=document.elementFromPoint(n.clientX,n.clientY+l);if(dt(d,o)){e.meet=d;const p=d.getBoundingClientRect().y;n.clientY<p?e.insertType="before":e.insertType="in"}else e.insertType=null,e.meet=null}e.meet&&Ht(e.meet,e.insertType)}function Yt(t,e,n){const{dragged:o}=t;if(!(!o||e.pointerId!==n.pointerId)){e.edgeMoveController.stop();for(const s of o)s.parentElement.parentElement.style.opacity="1";e.ghost.style.display="none",e.ghost.innerHTML="",e.isDragging&&e.meet&&(G(e.meet),e.insertType==="before"?t.moveNodeBefore(o,e.meet):e.insertType==="after"?t.moveNodeAfter(o,e.meet):e.insertType==="in"&&t.moveNodeIn(o,e.meet)),t.dragged=null,e.isDragging=!1,e.insertType=null,e.meet=null,e.pointerId=null}}function gt(t,e){const{dragged:n}=t;if(n){e.edgeMoveController.stop();for(const o of n)o.parentElement.parentElement.style.opacity="1";e.meet&&G(e.meet),e.ghost.style.display="none",e.ghost.innerHTML="",t.dragged=null,e.isDragging=!1,e.insertType=null,e.meet=null,e.pointerId=null}}const I={LHS:"lhs",RHS:"rhs"},Xt=function(){this.nodes.innerHTML="";const t=this.createTopic(this.nodeData);yt.call(this,t,this.nodeData),t.draggable=!1;const e=document.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)})}Vt(this,n,e)},Vt=function(t,e,n){const o=document.createElement("me-main");o.className=I.LHS;const s=document.createElement("me-main");s.className=I.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)},zt=function(t,e){const n=document.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},mt=function(t,e){const o=(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},yt=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=document.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=document.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=document.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=document.createElement("span");n.className="icons",n.innerHTML=e.icons.map(o=>`<span>${At(o)}</span>`).join(""),t.appendChild(n),t.icons=n}else t.icons&&(t.icons=void 0);if(e.tags&&e.tags.length){const n=document.createElement("div");n.className="tags",e.tags.forEach(o=>{const s=document.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)},Ft=function(t,e){const n=document.createElement("me-wrapper"),{p:o,tpc:s}=this.createParent(t);if(n.appendChild(o),!e&&t.children&&t.children.length>0){const i=Ut(t.expanded);if(o.appendChild(i),t.expanded!==!1){const r=zt(this,t.children);n.appendChild(r)}}return{grp:n,top:o,tpc:s}},Gt=function(t){const e=document.createElement("me-parent"),n=this.createTopic(t);return yt.call(this,n,t),e.appendChild(n),{p:e,tpc:n}},_t=function(t){const e=document.createElement("me-children");return e.append(...t),e},qt=function(t){const e=document.createElement("me-tpc");return e.nodeObj=t,e.dataset.nodeid="me"+t.id,e};function vt(t){const e=document.createRange();e.selectNodeContents(t);const n=window.getSelection();n&&(n.removeAllRanges(),n.addRange(e))}const jt=function(t){if(!t)return;const e=document.createElement("div"),n=t.nodeObj,o=n.topic,{offsetLeft:s,offsetTop:i}=M(this.nodes,t);this.nodes.appendChild(e),e.id="input-box",e.textContent=o,e.contentEditable="plaintext-only",e.spellcheck=!1;const r=getComputedStyle(t);e.style.cssText=`
2
2
  left: ${s}px;
3
3
  top: ${i}px;
4
4
  min-width:${t.offsetWidth-8}px;
@@ -8,9 +8,9 @@ var MindElixirLite=(function(Y){"use strict";const j={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"),Et(e),this.bus.fire("operation",{name:"beginEdit",obj:t.nodeObj}),e.addEventListener("keydown",c=>{c.stopPropagation();const d=c.key;if(d==="Enter"||d==="Tab"){if(c.shiftKey)return;c.preventDefault(),e.blur(),this.container.focus()}else d==="Escape"&&(c.preventDefault(),e.textContent=o,e.blur(),this.container.focus())}),e.addEventListener("blur",()=>{if(!e)return;e.remove();const c=e.innerText?.trim()||"";c===o||c===""||(n.topic=c,this.markdown?t.text.innerHTML=this.markdown(n.topic,n):t.text.textContent=c,this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:n,origin:o}))})},Jt=function(t){const e=document.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},Zt=function(t){const n=t.parentElement.parentElement.lastElementChild;n?.tagName==="svg"&&n?.remove()};function Qt(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-50||n.bottom<o.top+50||n.left>o.right-50||n.right<o.left+50){const i=n.left+n.width/2,r=n.top+n.height/2,c=o.left+o.width/2,d=o.top+o.height/2,a=i-c,h=r-d;this.move(-a,-h,!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()},St=function(t){return JSON.stringify(t,(e,n)=>{if(!(e==="parent"&&typeof n!="string"))return n})},ie=function(){const t=Qt(this);return St(t)},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.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}=at(this),c=this.map.style.transform,{x:d,y:a}=ct(c),h=d-i,f=a-r,p=this.scaleVal,m=(-o+h)*(1-t/p),y=(-s+f)*(1-t/p);this.map.style.transform=`translate3d(${d-m}px, ${a-y}px, 0) 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;const{dx:o,dy:s}=at(this,!0);this.map.style.transform=`translate3d(${o}px, ${s}px, 0) scale(${n})`,this.bus.fire("scale",n)},he=function(t,e,n=!1){const{map:o,scaleVal:s,bus:i,container:r,nodes:c}=this;if(n&&o.style.transition==="transform 0.3s")return;const d=o.style.transform;let{x:a,y:h}=ct(d);const f=r.getBoundingClientRect(),p=c.getBoundingClientRect(),m=p.left<f.right&&p.right>f.left,y=p.top<f.bottom&&p.bottom>f.top;if(m){const u=p.left+t,g=p.right+t;(u>=f.right||g<=f.left)&&(t=0)}if(y){const u=p.top+e,g=p.bottom+e;(u>=f.bottom||g<=f.top)&&(e=0)}a+=t,h+=e,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate3d(${a}px, ${h}px, 0) scale(${s})`,i.fire("move",{dx:t,dy:e})},at=(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 c=o.querySelector("me-root"),d=c.offsetTop,a=c.offsetLeft,h=c.offsetWidth,f=c.offsetHeight;i=n.offsetWidth/2-a-h/2,r=n.offsetHeight/2-d-f/2,o.style.transformOrigin=`${a+h/2}px 50%`}return{dx:i,dy:r}},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":"",Zt(t),n.expanded){const f=this.createChildren(n.children.map(p=>this.createWrapper(p).grp));i.parentNode.appendChild(f)}else i.parentNode.children[1].remove();this.linkDiv(t.closest("me-main > me-wrapper"));const c=t.getBoundingClientRect(),d={x:c.left,y:c.top},a=s.x-d.x,h=s.y-d.y;this.move(a,h),this.bus.fire("expandNode",n)},expandNodeAll:function(t,e){const n=t.nodeObj,o=t.getBoundingClientRect(),s={x:o.left,y:o.top};pt(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,d=s.y-r.y;this.move(c,d)},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(),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:he,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)),rt(this.nodeData),this.layout(),this.linkDiv()},scale:ae,scaleFit:de,scrollIntoView:te,selectNode:ee,selectNodes:ne,stringifyData:St,toCenter:function(){const{map:t,container:e}=this,{dx:n,dy:o}=at(this);e.scrollTop=0,e.scrollLeft=0,t.style.transform=`translate3d(${n}px, ${o}px, 0) scale(${this.scaleVal})`},unselectNodes:oe},Symbol.toStringTag,{value:"Module"})),ue=40,pe=10,ge=({deltaMode:t,deltaY:e,viewportHeight:n})=>t===WheelEvent.DOM_DELTA_LINE?e*ue:t===WheelEvent.DOM_DELTA_PAGE?e*n:e,me=({deltaMode:t,deltaY:e,scaleSensitivity:n,viewportHeight:o})=>{const i=-ge({deltaMode:t,deltaY:e,viewportHeight:o})/pe*n;return Math.max(-n,Math.min(n,i))},ye=(t,e,n)=>{e!==0&&t.scale(t.scaleVal+e,n)},ve=(t,e)=>{const n=me({deltaMode:e.deltaMode,deltaY:e.deltaY,scaleSensitivity:t.scaleSensitivity,viewportHeight:t.container.clientHeight||window.innerHeight});ye(t,n,{x:e.clientX,y:e.clientY})};function we(t){const{panHelper:e}=t;let n=0,o=null;t.spacePressed=!1;let s=null;const i=new Map,r=Bt(t);let c=null,d=null,a=null,h=null;const f=500,p=10,m=()=>{c!==null&&(clearTimeout(c),c=null,d=null,a=null,h=null)},y=(l,v)=>{l.hasPointerCapture&&l.hasPointerCapture(v)&&l.releasePointerCapture(v)},u=(l,v)=>{if(l.id==="input-box"||l.closest("#input-box"))return!1;const E=l.closest(".svg-label");if(E){const D=E.dataset.svgId,_=E.dataset.type,q=document.getElementById(D);if(q){if(_==="arrow")return v?t.editArrowLabel(q):t.selectArrow(q),!0;if(_==="summary")return v?t.editSummary(q):t.selectSummary(q),!0}}if(l.closest(".topiclinks")){const D=l.closest("g");if(D)return v?t.editArrowLabel(D):t.selectArrow(D),!0}if(l.closest(".summary")){const D=l.closest("g");if(D)return v?t.editSummary(D):t.selectSummary(D),!0}return!1},g=l=>{if(l.pointerType==="mouse"&&l.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(r?.isDragging)return;const v=l.target;if(v.tagName==="ME-EPD")l.ctrlKey||l.metaKey?t.expandNodeAll(v.previousSibling):t.expandNode(v.previousSibling);else if(!t.editable)return;u(v,!1)},b=l=>{if(!t.editable)return;const v=l.target;Z(v)&&t.beginEdit(v),u(v,!0)},w=l=>{l.code==="Space"&&(t.spacePressed=!0,t.container.classList.add("space-pressed"))},x=l=>{l.code==="Space"&&(t.spacePressed=!1,t.container.classList.remove("space-pressed"))},S=l=>{if(l.pointerType==="touch"&&(i.set(l.pointerId,{x:l.clientX,y:l.clientY}),i.size===2)){const[D,_]=Array.from(i.values());s=mt(D,_),m()}e.moved=!1;const v=l.target,E=t.mouseSelectionButton===0?2:0;if(t.editable&&(l.button===0||l.pointerType==="touch")&&Z(v)){t.selection?.cancel();const D=t.currentNodes||[];if(l.ctrlKey||l.metaKey)if(D.includes(v)){t.selection?.deselect(v);return}else t.selection?.select(v);else D.includes(v)||t.selectNode(v)}if(t.editable&&(l.button===0||l.pointerType==="touch")){if(l.pointerType==="touch"&&i.size>1)(r.isDragging||r.pointerId!==null)&&lt(t,r);else if(l.pointerType==="touch"&&i.size===1)(Z(v)||v.closest("me-tpc"))&&(d={x:l.clientX,y:l.clientY},a=v,h=l.pointerId,c=window.setTimeout(()=>{vt(t,r,l,!0)&&(a&&a.setPointerCapture(l.pointerId),wt(r.ghost,l.clientX,l.clientY)),c=null,d=null,a=null,h=null},f));else if(l.pointerType==="mouse"&&vt(t,r,l,!1)){v.setPointerCapture(l.pointerId);return}}const N=t.spacePressed&&l.button===0&&l.pointerType==="mouse",W=!t.editable||l.button===E&&l.pointerType==="mouse"||l.pointerType==="touch";!N&&!W||(e.x=l.clientX,e.y=l.clientY,v.className!=="circle"&&v.contentEditable!=="plaintext-only"&&(e.mousedown=!0,v.setPointerCapture(l.pointerId)))},T=l=>{if(l.pointerType==="touch"&&i.has(l.pointerId)){if(i.set(l.pointerId,{x:l.clientX,y:l.clientY}),c!==null&&d!==null&&l.pointerId===h){const v=l.clientX-d.x,E=l.clientY-d.y;Math.sqrt(v*v+E*E)>p&&m()}if(i.size>=2){const[v,E]=Array.from(i.values()),N=mt(v,E);if(s==null)s=N;else{if(s>0){const W=N/s;t.scale(t.scaleVal*W,{x:(v.x+E.x)/2,y:(v.y+E.y)/2})}s=N}return}}if(!(r&&r.pointerId!==null&&(Xt(t,r,l),r.isDragging))){if(l.target.contentEditable!=="plaintext-only"||t.spacePressed&&e.mousedown){const v=l.clientX-e.x,E=l.clientY-e.y;e.onMove(v,E)}e.x=l.clientX,e.y=l.clientY}},L=l=>{if(l.pointerType==="touch"&&(i.delete(l.pointerId),i.size<2&&(s=null),m()),r&&r.pointerId!==null){const E=r.isDragging;if(Gt(t,r,l),y(l.target,l.pointerId),E)return}if(l.pointerType==="touch"&&i.size===0&&!e.moved){const E=new Date().getTime(),N=E-n;N<300&&N>0&&o===l.target&&b(l),n=E,o=l.target}e.mousedown&&(y(l.target,l.pointerId),e.clear())},C=()=>{m(),e.mousedown&&e.clear(),r&&(r.isDragging||r.pointerId!==null)&&lt(t,r)},P=l=>{l.pointerType==="touch"&&(i.delete(l.pointerId),i.size<2&&(s=null),m()),r&&r.pointerId===l.pointerId&&lt(t,r),L(l)},k=l=>{if(l.preventDefault(),l.button!==2||!t.editable)return;const v=l.target;Z(v)&&!v.classList.contains("selected")&&t.selectNode(v),setTimeout(()=>{t.panHelper.moved||t.bus.fire("showContextMenu",l)},200)},R=l=>{if(l.stopPropagation(),l.preventDefault(),l.ctrlKey||l.metaKey)return ve(t,l);if(l.shiftKey)return t.move(-l.deltaY,0);t.move(-l.deltaX,-l.deltaY)},{container:A}=t;return gt([{dom:A,evt:"pointerdown",func:S},{dom:A,evt:"pointermove",func:T},{dom:A,evt:"pointerup",func:L},{dom:A,evt:"pointercancel",func:P},{dom:A,evt:"click",func:g},{dom:A,evt:"dblclick",func:b},{dom:A,evt:"contextmenu",func:k},{dom:A,evt:"wheel",func:typeof t.handleWheel=="function"?t.handleWheel:R},{dom:A,evt:"blur",func:C},{dom:A,evt:"keydown",func:w},{dom:A,evt:"keyup",func:x}])}function be(){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 I="http://www.w3.org/2000/svg",tt=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"},dt=function(t,e,n,o){const{anchor:s="middle",color:i,dataType:r,svgId:c}=o,d=document.createElement("div");d.className="svg-label",d.style.color=i||"#666";const a="label-"+c;return d.id=a,d.innerHTML=t,d.dataset.type=r,d.dataset.svgId=c,d.dataset.x=e.toString(),d.dataset.y=n.toString(),d.dataset.anchor=s,d},Tt=function(t,e,n){const o=document.createElementNS(I,"path");return M(o,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),o},F=function(t){const e=document.createElementNS(I,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},Lt=function(){const t=document.createElementNS(I,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},xe=function(t,e,n,o){const s=document.createElementNS(I,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((r,c)=>{const d=r.d,a=document.createElementNS(I,"path"),h={d,stroke:o?.stroke||"rgb(227, 125, 116)",fill:"none","stroke-linecap":o?.strokeLinecap||"cap","stroke-width":String(o?.strokeWidth||"2")};o?.opacity!==void 0&&(h.opacity=String(o.opacity)),M(a,h),c===0&&a.setAttribute("stroke-dasharray",o?.strokeDasharray||"8,2");const f=document.createElementNS(I,"path");M(f,{d,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(f),s.appendChild(a),s[r.name]=a}),s},Dt=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=`
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",c=>{c.stopPropagation();const l=c.key;if(l==="Enter"||l==="Tab"){if(c.shiftKey)return;c.preventDefault(),e.blur(),this.container.focus()}else l==="Escape"&&(c.preventDefault(),e.textContent=o,e.blur(),this.container.focus())}),e.addEventListener("blur",()=>{if(!e)return;t.style.opacity="1",e.remove();const c=e.innerText?.trim()||"";c===o||c===""||(n.topic=c,this.markdown?t.text.innerHTML=this.markdown(n.topic,n):t.text.textContent=c,this.linkDiv(),this.bus.fire("operation",{name:"finishEdit",obj:n,origin:o}))})},Ut=function(t){const e=document.createElement("me-epd");return e.expanded=t!==!1,e.className=t!==!1?"minus":"",e},Kt=function(t){const n=t.parentElement.parentElement.lastElementChild;n?.tagName==="svg"&&n?.remove()};function Jt(t){return{nodeData:t.isFocusMode?t.nodeDataBackup:t.nodeData,arrows:t.arrows,summaries:t.summaries,direction:t.direction,theme:t.theme}}const Zt=function(t){const e=this.container,n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.top>o.bottom-50||n.bottom<o.top+50||n.left>o.right-50||n.right<o.left+50){const i=n.left+n.width/2,r=n.top+n.height/2,c=o.left+o.width/2,l=o.top+o.height/2,a=i-c,d=r-l;this.move(-a,-d,!0)}},Qt=function(t,e,n){this.clearSelection(),this.scrollIntoView(t),this.selection?.select(t),e&&this.bus.fire("selectNewNode",t.nodeObj)},te=function(t){this.selection?.select(t)},ee=function(t){this.selection?.deselect(t)},ne=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})},oe=function(){const t=Jt(this);return wt(t)},se=function(){return JSON.parse(this.getDataString())},ie=function(){this.editable=!0},re=function(){this.editable=!1},ce=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),c=this.map.style.transform,{x:l,y:a}=nt(c),d=l-i,f=a-r,p=this.scaleVal,v=(-o+d)*(1-t/p),y=(-s+f)*(1-t/p);this.map.style.transform=`translate3d(${l-v}px, ${a-y}px, 0) scale(${t})`,this.scaleVal=t,this.bus.fire("scale",t)},le=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)},ae=function(t,e,n=!1){const{map:o,scaleVal:s,bus:i,container:r,nodes:c}=this;if(n&&o.style.transition==="transform 0.3s")return;const l=o.style.transform;let{x:a,y:d}=nt(l);const f=r.getBoundingClientRect(),p=c.getBoundingClientRect(),v=p.left<f.right&&p.right>f.left,y=p.top<f.bottom&&p.bottom>f.top;if(v){const u=p.left+t,g=p.right+t;(u>=f.right||g<=f.left)&&(t=0)}if(y){const u=p.top+e,g=p.bottom+e;(u>=f.bottom||g<=f.top)&&(e=0)}a+=t,d+=e,n&&(o.style.transition="transform 0.3s",setTimeout(()=>{o.style.transition="none"},300)),o.style.transform=`translate3d(${a}px, ${d}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 c=o.querySelector("me-root"),l=c.offsetTop,a=c.offsetLeft,d=c.offsetWidth,f=c.offsetHeight;i=n.offsetWidth/2-a-d/2,r=n.offsetHeight/2-l-f/2,o.style.transformOrigin=`${a+d/2}px 50%`}return{dx:i,dy:r}},he=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:ne,disableEdit:re,enableEdit:ie,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":"",Kt(t),n.expanded){const f=this.createChildren(n.children.map(p=>this.createWrapper(p).grp));i.parentNode.appendChild(f)}else i.parentNode.children[1].remove();this.linkDiv(t.closest("me-main > me-wrapper"));const c=t.getBoundingClientRect(),l={x:c.left,y:c.top},a=s.x-l.x,d=s.y-l.y;this.move(a,d),this.bus.fire("expandNode",n)},expandNodeAll:function(t,e){const n=t.nodeObj,o=t.getBoundingClientRect(),s={x:o.left,y:o.top};lt(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,l=s.y-r.y;this.move(c,l)},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:se,getDataString:oe,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:ae,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:ce,scaleFit:le,scrollIntoView:Zt,selectNode:Qt,selectNodes:te,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:ee},Symbol.toStringTag,{value:"Module"})),de=40,fe=10,ue=({deltaMode:t,deltaY:e,viewportHeight:n})=>t===WheelEvent.DOM_DELTA_LINE?e*de:t===WheelEvent.DOM_DELTA_PAGE?e*n:e,pe=({deltaMode:t,deltaY:e,scaleSensitivity:n,viewportHeight:o})=>{const i=-ue({deltaMode:t,deltaY:e,viewportHeight:o})/fe*n;return Math.max(-n,Math.min(n,i))},ge=(t,e,n)=>{e!==0&&t.scale(t.scaleVal+e,n)},me=(t,e)=>{const n=pe({deltaMode:e.deltaMode,deltaY:e.deltaY,scaleSensitivity:t.scaleSensitivity,viewportHeight:t.container.clientHeight||window.innerHeight});ge(t,n,{x:e.clientX,y:e.clientY})};function ye(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){const x=new Date().getTime(),S=x-this.lastTap,E=S<this.DOUBLE_CLICK_THRESHOLD&&S>0&&this.lastTapTarget===h.target;this.lastTap=x,this.lastTapTarget=h.target,E&&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=ht(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()),S=ht(m,x);if(this.lastDistance!==null&&this.lastDistance>0){const E=S/this.lastDistance;t.scale(t.scaleVal*E,{x:(m.x+x.x)/2,y:(m.y+x.y)/2})}return this.lastDistance=S,!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}},c=Bt(t),l={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()}}},a=(h,m)=>{if(h.closest("#input-box"))return!1;const x=h.closest(".svg-label"),S=h.closest(".topiclinks, .summary"),E=x?{type:x.dataset.type,element:document.getElementById(x.dataset.svgId)}:S?{type:S.classList.contains("topiclinks")?"arrow":"summary",element:h.closest("g")}:null;if(!E?.type||!E?.element)return!1;const{type:N,element:A}=E;return t.clearSelection(),N==="arrow"?m?t.editArrowLabel(A):t.selectArrow(A):m?t.editSummary(A):t.selectSummary(A),!0},d=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(c?.isDragging)return;const m=h.target;m.tagName==="ME-EPD"&&(h.ctrlKey||h.metaKey?t.expandNodeAll(m.previousSibling):t.expandNode(m.previousSibling))},f=h=>{if(!t.editable)return;const m=h.target;if(et(m)){t.selectNode(m),t.beginEdit(m);return}a(m,!0)},p=h=>{if(h.pointerType==="touch"&&r.handlePointerDown(h)){t.ptState=i.Pinch,l.clear(),e.clear(),(c.isDragging||c.pointerId!==null)&&gt(t,c);return}if(t.ptState===i.Pinch)return;const m=h.target;if(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 S=t.currentNodes||[];h.ctrlKey||h.metaKey||t.mobileMultiSelect?S.includes(m)?o=m:((t.currentArrow||t.currentSummary)&&t.clearSelection(),t.selection?.select(m)):S.includes(m)||t.selectNode(m),h.pointerType==="touch"?(t.ptState=i.DragWait,l.start(h,N=>{ft(t,c,N,!0)&&(t.ptState=i.Drag,m.setPointerCapture(N.pointerId))})):ft(t,c,h,!1)&&(t.ptState=i.Drag,m.setPointerCapture(h.pointerId))}else a(m,!1)},v=h=>{switch(t.ptState){case i.Pinch:r.handlePointerMove(h);break;case i.DragWait:l.handleMove(h),l.timer===null&&(t.ptState=i.Idle);break;case i.Drag:Wt(t,c,h);break;case i.Pan:e.handlePointerMove(h);break}},y=h=>{h.pointerType==="touch"&&r.handlePointerUp(h);const m=c.isDragging,x=e.moved;switch(t.ptState){case i.DragWait:l.clear();break;case i.Drag:Yt(t,c,h);break;case i.Pan:e.handlePointerUp(h);break}s.detect(h,f),(t.ptState!==i.Pinch||r.activePointers.size<2)&&(t.ptState=i.Idle),o&&(!m&&!x&&t.selection?.deselect(o),o=null)},u=()=>{r.clear(),l.clear(),e.clear(),s.clear(),(c.isDragging||c.pointerId!==null)&&gt(t,c),t.ptState=i.Idle,o=null},g=h=>{h.preventDefault(),h.button===2&&t.editable&&setTimeout(()=>{if(t.panHelper.moved)return;const m=h.target;et(m)&&!m.classList.contains("selected")&&t.selectNode(m),t.bus.fire("showContextMenu",h)},200)},b=h=>{if(h.stopPropagation(),h.preventDefault(),h.ctrlKey||h.metaKey)return me(t,h);if(h.shiftKey)return t.move(-h.deltaY,0);t.move(-h.deltaX,-h.deltaY)},w=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 at([{dom:n,evt:"pointerdown",func:p},{dom:n,evt:"pointermove",func:v},{dom:n,evt:"pointerup",func:y},{dom:n,evt:"pointercancel",func:u},{dom:n,evt:"click",func:d},{dom:n,evt:"contextmenu",func:g},{dom:n,evt:"wheel",func:typeof t.handleWheel=="function"?t.handleWheel:b},{dom:n,evt:"blur",func:u},{dom:n,evt:"keydown",func:w},{dom:n,evt:"keyup",func:C}])}function ve(){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 P="http://www.w3.org/2000/svg",_=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"},st=function(t,e,n,o){const{anchor:s="middle",color:i,dataType:r,svgId:c}=o,l=document.createElement("div");l.className="svg-label",l.style.color=i||"#666";const a="label-"+c;return l.id=a,l.innerHTML=t,l.dataset.type=r,l.dataset.svgId=c,l.dataset.x=e.toString(),l.dataset.y=n.toString(),l.dataset.anchor=s,l},bt=function(t,e,n){const o=document.createElementNS(P,"path");return D(o,{d:t,stroke:e||"#666",fill:"none","stroke-width":n}),o},R=function(t){const e=document.createElementNS(P,"svg");return e.setAttribute("class",t),e.setAttribute("overflow","visible"),e},xt=function(){const t=document.createElementNS(P,"line");return t.setAttribute("stroke","#4dc4ff"),t.setAttribute("fill","none"),t.setAttribute("stroke-width","2"),t.setAttribute("opacity","0.45"),t},we=function(t,e,n,o){const s=document.createElementNS(P,"g");return[{name:"line",d:t},{name:"arrow1",d:e},{name:"arrow2",d:n}].forEach((r,c)=>{const l=r.d,a=document.createElementNS(P,"path"),d={d:l,stroke:o?.stroke||"rgb(227, 125, 116)",fill:"none","stroke-linecap":o?.strokeLinecap||"cap","stroke-width":String(o?.strokeWidth||"2")};o?.opacity!==void 0&&(d.opacity=String(o.opacity)),D(a,d),c===0&&a.setAttribute("stroke-dasharray",o?.strokeDasharray||"8,2");const f=document.createElementNS(P,"path");D(f,{d:l,stroke:"transparent",fill:"none","stroke-width":"15"}),s.appendChild(f),s.appendChild(a),s[r.name]=a}),s},Ct=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
- `,Et(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",()=>{if(!s)return;const i=s.innerText?.trim()||"";i===""?n.label=o:n.label=i,s.remove(),i!==o&&(t.markdown?e.innerHTML=t.markdown(n.label,n):e.textContent=n.label,tt(e),"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},Ce=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 d=r[c],a=d.querySelector("me-tpc"),{offsetLeft:h,offsetTop:f}=H(this.nodes,a),p=a.offsetWidth,m=a.offsetHeight,y=d.parentNode.className,u=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:f,cL:h,cW:p,cH:m,direction:y,containerHeight:this.nodes.offsetHeight}),g=this.theme.palette,b=a.nodeObj.branchColor||g[c%g.length];if(a.style.borderColor=b,this.lines.appendChild(Tt(u,b,"3")),t&&t!==d)continue;const w=F("subLines"),x=d.lastChild;x.tagName==="svg"&&x.remove(),d.appendChild(w),Mt(this,w,b,d,y,!0)}this.labelContainer.innerHTML="",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 d=r.offsetTop,a=r.offsetLeft,h=r.offsetWidth,f=r.offsetHeight;for(let p=0;p<c.length;p++){const m=c[p],y=m.firstChild,u=y.offsetTop,g=y.offsetLeft,b=y.offsetWidth,w=y.offsetHeight,x=y.firstChild.nodeObj.branchColor||n,S=t.generateSubBranch({pT:d,pL:a,pW:h,pH:f,cT:u,cL:g,cW:b,cH:w,direction:s,isFirst:i});e.appendChild(Tt(S,x,"2"));const T=y.children[1];if(T){if(!T.expanded)continue}else continue;Mt(t,e,x,m,s)}},Ee={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>'},B=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=Ee[e],n};function Se(t){const e=document.createElement("div"),n=B("fullscreen","full"),o=B("toCenter","living"),s=B("zoomout","zoomout"),i=B("zoomin","zoomin");e.appendChild(n),e.appendChild(o),e.appendChild(s),e.appendChild(i),e.className="mind-elixir-toolbar rb";let r=null;const c=()=>{const a=t.container.getBoundingClientRect(),h=ct(t.map.style.transform),f=a.width/2,p=a.height/2,m=(f-h.x)/t.scaleVal,y=(p-h.y)/t.scaleVal;r={containerRect:a,currentTransform:h,mapCenterX:m,mapCenterY:y}},d=()=>{if(r){const a=t.container.getBoundingClientRect(),h=a.width/2,f=a.height/2,p=h-r.mapCenterX*t.scaleVal,m=f-r.mapCenterY*t.scaleVal,y=p-r.currentTransform.x,u=m-r.currentTransform.y;t.move(y,u)}};return t.el.addEventListener("fullscreenchange",d),n.onclick=()=>{c(),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 Te(t){const e=document.createElement("div"),n=B("tbltl","left"),o=B("tbltr","right"),s=B("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 Le(t){t.container.append(Se(t)),t.container.append(Te(t))}const De=function(t,e=!0){this.theme=t;const o={...(t.type==="dark"?U:j).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()},kt={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=gt([{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}}}},Me="#4dc4ff";function Nt(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 ke(t,e,n){t&&(t.dataset.x=e.toString(),t.dataset.y=n.toString(),tt(t))}function et(t,e,n,o,s){M(t,{x1:e+"",y1:n+"",x2:o+"",y2:s+""})}function Pt(t,e,n,o,s,i,r,c,d,a){const h=`M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${d}`;if(t.line.setAttribute("d",h),a.style){const u=a.style;u.stroke&&t.line.setAttribute("stroke",u.stroke),u.strokeWidth&&t.line.setAttribute("stroke-width",String(u.strokeWidth)),u.strokeDasharray&&t.line.setAttribute("stroke-dasharray",u.strokeDasharray),u.strokeLinecap&&t.line.setAttribute("stroke-linecap",u.strokeLinecap),u.opacity!==void 0&&t.line.setAttribute("opacity",String(u.opacity))}const f=t.querySelectorAll('path[stroke="transparent"]');f.length>0&&f[0].setAttribute("d",h);const p=J(i,r,c,d);if(p){const u=`M ${p.x1} ${p.y1} L ${c} ${d} L ${p.x2} ${p.y2}`;if(t.arrow1.setAttribute("d",u),f.length>1&&f[1].setAttribute("d",u),a.style){const g=a.style;g.stroke&&t.arrow1.setAttribute("stroke",g.stroke),g.strokeWidth&&t.arrow1.setAttribute("stroke-width",String(g.strokeWidth)),g.strokeLinecap&&t.arrow1.setAttribute("stroke-linecap",g.strokeLinecap),g.opacity!==void 0&&t.arrow1.setAttribute("opacity",String(g.opacity))}}if(a.bidirectional){const u=J(o,s,e,n);if(u){const g=`M ${u.x1} ${u.y1} L ${e} ${n} L ${u.x2} ${u.y2}`;if(t.arrow2.setAttribute("d",g),f.length>2&&f[2].setAttribute("d",g),a.style){const b=a.style;b.stroke&&t.arrow2.setAttribute("stroke",b.stroke),b.strokeWidth&&t.arrow2.setAttribute("stroke-width",String(b.strokeWidth)),b.strokeLinecap&&t.arrow2.setAttribute("stroke-linecap",b.strokeLinecap),b.opacity!==void 0&&t.arrow2.setAttribute("opacity",String(b.opacity))}}}const{x:m,y}=Nt(e,n,o,s,i,r,c,d);if(t.labelEl&&ke(t.labelEl,m,y),a.style?.labelColor){const u=t.labelEl;u&&(u.style.color=a.style.labelColor)}Re(t)}function nt(t,e,n){const{offsetLeft:o,offsetTop:s}=H(t.nodes,e),i=e.offsetWidth,r=e.offsetHeight,c=o+i/2,d=s+r/2,a=c+n.x,h=d+n.y;return{w:i,h:r,cx:c,cy:d,ctrlX:a,ctrlY:h}}function G(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 Ne=function(t,e,n){const o=H(t.nodes,e),s=H(t.nodes,n),i=o.offsetLeft+e.offsetWidth/2,r=o.offsetTop+e.offsetHeight/2,c=s.offsetLeft+n.offsetWidth/2,d=s.offsetTop+n.offsetHeight/2,a=c-i,h=d-r,f=Math.sqrt(a*a+h*h),p=Math.max(50,Math.min(200,f*.3)),m=Math.abs(a),y=Math.abs(h);let u,g;if(f<150){const w=e.closest("me-main").className==="lhs"?-1:1;u={x:200*w,y:0},g={x:200*w,y:0}}else if(m>y*1.5){const w=a>0?e.offsetWidth/2:-e.offsetWidth/2,x=a>0?-n.offsetWidth/2:n.offsetWidth/2;u={x:w+(a>0?p:-p),y:0},g={x:x+(a>0?-p:p),y:0}}else if(y>m*1.5){const w=h>0?e.offsetHeight/2:-e.offsetHeight/2,x=h>0?-n.offsetHeight/2:n.offsetHeight/2;u={x:0,y:w+(h>0?p:-p)},g={x:0,y:x+(h>0?-p:p)}}else{const w=Math.atan2(h,a),x=e.offsetWidth/2*Math.cos(w),S=e.offsetHeight/2*Math.sin(w),T=-(n.offsetWidth/2)*Math.cos(w),L=-(n.offsetHeight/2)*Math.sin(w),C=p*.7*(a>0?1:-1),P=p*.7*(h>0?1:-1);u={x:x+C,y:S+P},g={x:T-C,y:L-P}}return{delta1:{x:Math.round(u.x),y:Math.round(u.y)},delta2:{x:Math.round(g.x),y:Math.round(g.y)}}},ht=function(t,e,n,o,s){if(!e||!n)return;if(!o.delta1||!o.delta2){const k=Ne(t,e,n);o.delta1=k.delta1,o.delta2=k.delta2}const i=nt(t,e,o.delta1),r=nt(t,n,o.delta2),{x:c,y:d}=G(i),{ctrlX:a,ctrlY:h}=i,{ctrlX:f,ctrlY:p}=r,{x:m,y}=G(r),u=J(f,p,m,y);if(!u)return;const g=`M ${u.x1} ${u.y1} L ${m} ${y} L ${u.x2} ${u.y2}`;let b="";if(o.bidirectional){const k=J(a,h,c,d);if(!k)return;b=`M ${k.x1} ${k.y1} L ${c} ${d} L ${k.x2} ${k.y2}`}const w=xe(`M ${c} ${d} C ${a} ${h} ${f} ${p} ${m} ${y}`,g,b,o.style),{x,y:S}=Nt(c,d,a,h,f,p,m,y),T=o.style?.labelColor||"rgb(235, 95, 82)",L="arrow-"+o.id;w.id=L;const C=t.markdown?t.markdown(o.label,o):o.label,P=dt(C,x,S,{anchor:"middle",color:T,dataType:"arrow",svgId:L});w.labelEl=P,w.arrowObj=o,w.dataset.linkid=o.id,t.labelContainer.appendChild(P),t.linkSvgGroup.appendChild(w),tt(P),s||(t.arrows.push(o),t.currentArrow=w,At(t,o,i,r))},Pe=function(t,e,n={}){const o={id:V(),label:"Custom Link",from:t.nodeObj.id,to:e.nodeObj.id,...n};ht(this,t,e,o),this.bus.fire("operation",{name:"createArrow",obj:o})},Ae=function(t){ot(this);const e={...t,id:V()};ht(this,this.findEle(e.from),this.findEle(e.to),e),this.bus.fire("operation",{name:"createArrow",obj:e})},$e=function(t){let e;if(t?e=t:e=this.currentArrow,!e)return;ot(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}})},He=function(t){this.currentArrow=t;const e=t.arrowObj,n=this.findEle(e.from),o=this.findEle(e.to),s=nt(this,n,e.delta1),i=nt(this,o,e.delta2);At(this,e,s,i)},Ie=function(){ot(this),this.currentArrow=null},ft=function(t,e){const n=document.createElementNS(I,"path");return M(n,{d:t,stroke:e,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},Oe=function(t,e){const n=document.createElementNS(I,"g");n.setAttribute("class","arrow-highlight"),n.setAttribute("opacity","0.45");const o=ft(t.line.getAttribute("d"),e);n.appendChild(o);const s=ft(t.arrow1.getAttribute("d"),e);if(n.appendChild(s),t.arrow2.getAttribute("d")){const i=ft(t.arrow2.getAttribute("d"),e);n.appendChild(i)}t.insertBefore(n,t.firstChild)},Ye=function(t){const e=t.querySelector(".arrow-highlight");e&&e.remove()},Re=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"))},ot=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&&Ye(t.currentArrow)},At=function(t,e,n,o){const{linkController:s,P2:i,P3:r,line1:c,line2:d,nodes:a,map:h,currentArrow:f,bus:p}=t;if(!f)return;s.style.display="initial",i.style.display="initial",r.style.display="initial",a.appendChild(s),a.appendChild(i),a.appendChild(r),Oe(f,Me);let{x:m,y}=G(n),{ctrlX:u,ctrlY:g}=n,{ctrlX:b,ctrlY:w}=o,{x,y:S}=G(o);i.style.cssText=`top:${g}px;left:${u}px;`,r.style.cssText=`top:${w}px;left:${b}px;`,et(c,m,y,u,g),et(d,b,w,x,S),t.helper1=kt.create(i),t.helper2=kt.create(r),t.helper1.init(h,(T,L)=>{u=u+T/t.scaleVal,g=g+L/t.scaleVal;const C=G({...n,ctrlX:u,ctrlY:g});m=C.x,y=C.y,i.style.top=g+"px",i.style.left=u+"px",Pt(f,m,y,u,g,b,w,x,S,e),et(c,m,y,u,g),e.delta1.x=Math.round(u-n.cx),e.delta1.y=Math.round(g-n.cy),p.fire("updateArrowDelta",e)}),t.helper2.init(h,(T,L)=>{b=b+T/t.scaleVal,w=w+L/t.scaleVal;const C=G({...o,ctrlX:b,ctrlY:w});x=C.x,S=C.y,r.style.top=w+"px",r.style.left=b+"px",Pt(f,m,y,u,g,b,w,x,S,e),et(d,b,w,x,S),e.delta2.x=Math.round(b-o.cx),e.delta2.y=Math.round(w-o.cy),p.fire("updateArrowDelta",e)})};function Be(){this.linkSvgGroup.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{ht(this,this.findEle(n.from),this.findEle(n.to),n,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function We(t){ot(this),t&&t.labelEl&&Dt(this,t.labelEl,t.arrowObj)}function Xe(){this.arrows=this.arrows.filter(t=>K(t.from,this.nodeData)&&K(t.to,this.nodeData))}const Ge=Object.freeze(Object.defineProperty({__proto__:null,createArrow:Pe,createArrowFrom:Ae,editArrowLabel:We,removeArrow:$e,renderArrow:Be,selectArrow:He,tidyArrow:Xe,unselectArrow:Ie},Symbol.toStringTag,{value:"Module"})),ze=function(t){if(t.length===0)throw new Error("No selected node.");if(t.length===1){const d=t[0].nodeObj,a=t[0].nodeObj.parent;if(!a)throw new Error("Can not select root node.");const h=a.children.findIndex(f=>d===f);return{parent:a.id,start:h,end:h}}let e=0;const n=t.map(d=>{let a=d.nodeObj;const h=[];for(;a.parent;){const f=a.parent,m=f.children?.indexOf(a);a=f,h.unshift({node:a,index:m})}return h.length>e&&(e=h.length),h});let o=0;t:for(;o<e;o++){const d=n[0][o]?.node;for(let a=1;a<n.length;a++)if(n[a][o]?.node!==d)break t}if(!o)throw new Error("Can not select root node.");const s=n.map(d=>d[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}},Ve=function(t){const e=document.createElementNS(I,"g");return e.setAttribute("id",t),e},$t=function(t,e){const n=document.createElementNS(I,"path");return M(n,{d:t,stroke:e||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},Fe=t=>t.parentElement.parentElement,_e=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},ut=function(t,e){const{id:n,label:o,parent:s,start:i,end:r,style:c}=e,{nodes:d,theme:a,summarySvg:h}=t,p=t.findEle(s).nodeObj,m=_e(t,e);let y=1/0,u=0,g=0,b=0;for(let l=i;l<=r;l++){const v=p.children?.[l];if(!v)return t.removeSummary(n),null;const E=Fe(t.findEle(v.id)),{offsetLeft:N,offsetTop:W}=H(d,E),D=i===r?10:20;l===i&&(g=W+D),l===r&&(b=W+E.offsetHeight-D),N<y&&(y=N),E.offsetWidth+N>u&&(u=E.offsetWidth+N)}let w,x;const S=p.parent?10:0,T=g+S,L=b+S,C=(T+L)/2,P=c?.stroke||a.cssVar["--color"],k=c?.labelColor||a.cssVar["--color"],R="s-"+n,A=t.markdown?t.markdown(o,e):o;m===X.LHS?(w=$t(`M ${y+10} ${T} c -5 0 -10 5 -10 10 L ${y} ${L-10} c 0 5 5 10 10 10 M ${y} ${C} h -10`,P),x=dt(A,y-20,C,{anchor:"end",color:k,dataType:"summary",svgId:R})):(w=$t(`M ${u-10} ${T} c 5 0 10 5 10 10 L ${u} ${L-10} c 0 5 -5 10 -10 10 M ${u} ${C} h 10`,P),x=dt(A,u+20,C,{anchor:"start",color:k,dataType:"summary",svgId:R}));const z=Ve(R);return z.appendChild(w),t.labelContainer.appendChild(x),tt(x),z.summaryObj=e,z.labelEl=x,h.appendChild(z),z},qe=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}=ze(e),c={id:V(),parent:s,start:i,end:r,label:"summary",style:t.style},d=ut(this,c);n.push(c),this.editSummary(d),o.fire("operation",{name:"createSummary",obj:c})},createSummaryFrom:function(t){const e=V(),n={...t,id:e};ut(this,n),this.summaries.push(n),this.bus.fire("operation",{name:"createSummary",obj:n})},editSummary:function(t){t&&t.labelEl&&Dt(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{ut(this,t)}catch{}}),this.nodes.insertAdjacentElement("beforeend",this.summarySvg)},selectSummary:function(t){const e=t.labelEl;e&&e.classList.add("selected"),this.currentSummary=t},unselectSummary:function(){this.currentSummary?.labelEl?.classList.remove("selected"),this.currentSummary=null}},Symbol.toStringTag,{value:"Module"})),$="http://www.w3.org/2000/svg";function je(t,e){const n=document.createElementNS($,"svg");return M(n,{version:"1.1",xmlns:$,height:t,width:e}),n}function Ue(t,e){return(parseInt(t)-parseInt(e))/2}function Ke(t,e,n,o){const s=document.createElementNS($,"g");let i="";return t.text?i=t.text.textContent:i=t.childNodes[0].textContent,i.split(`
16
- `).forEach((c,d)=>{const a=document.createElementNS($,"text");M(a,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+Ue(e.lineHeight,e.fontSize)*(d+1)+parseFloat(e.fontSize)*(d+1)+"","text-anchor":"start","font-family":e.fontFamily,"font-size":`${e.fontSize}`,"font-weight":`${e.fontWeight}`,fill:`${e.color}`}),a.innerHTML=c,s.appendChild(a)}),s}function Je(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($,"foreignObject");M(i,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+"",width:e.width,height:e.height});const r=document.createElement("div");return M(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 Ze(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=H(t.nodes,e),i=document.createElementNS($,"rect");return M(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 st(t,e,n=!1){const o=getComputedStyle(e),{offsetLeft:s,offsetTop:i}=H(t.nodes,e),r=document.createElementNS($,"rect");M(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($,"g");c.appendChild(r);let d;return n?d=Je(e,o,s,i):d=Ke(e,o,s,i),c.appendChild(d),c}function Qe(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=H(t.nodes,e),i=document.createElementNS($,"a"),r=document.createElementNS($,"text");return M(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 tn(t,e){const n=getComputedStyle(e),{offsetLeft:o,offsetTop:s}=H(t.nodes,e),i=document.createElementNS($,"image");return M(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:e.src}),i}const it=100,en='<?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">',nn=(t,e=!1)=>{const n=t.nodes,o=n.offsetHeight+it*2,s=n.offsetWidth+it*2,i=je(o+"px",s+"px"),r=document.createElementNS($,"svg"),c=document.createElementNS($,"rect");M(c,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:t.theme.cssVar["--bgcolor"]}),i.appendChild(c),n.querySelectorAll(".subLines").forEach(f=>{const p=f.cloneNode(!0),{offsetLeft:m,offsetTop:y}=H(n,f.parentElement);p.setAttribute("x",`${m}`),p.setAttribute("y",`${y}`),r.appendChild(p)});const d=n.querySelector(".lines")?.cloneNode(!0);d&&r.appendChild(d);const a=n.querySelector(".topiclinks")?.cloneNode(!0);a&&r.appendChild(a);const h=n.querySelector(".summary")?.cloneNode(!0);return h&&r.appendChild(h),n.querySelectorAll("me-tpc").forEach(f=>{f.nodeObj.dangerouslySetInnerHTML?r.appendChild(st(t,f,!e)):(r.appendChild(Ze(t,f)),r.appendChild(st(t,f.text,!e)))}),n.querySelectorAll(".tags > span").forEach(f=>{r.appendChild(st(t,f))}),n.querySelectorAll(".icons > span").forEach(f=>{r.appendChild(st(t,f))}),n.querySelectorAll(".hyper-link").forEach(f=>{r.appendChild(Qe(t,f))}),n.querySelectorAll("img").forEach(f=>{r.appendChild(tn(t,f))}),M(r,{x:it+"",y:it+"",overflow:"visible"}),i.appendChild(r),i},on=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),en+t.outerHTML);function sn(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 rn={getObjById:K,generateNewObj:It,layout:zt,linkDiv:Ce,editTopic:Kt,createWrapper:_t,createParent:qt,createChildren:jt,createTopic:Ut,findEle:xt,changeTheme:De,...fe,...{},...Ge,...qe,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(t=!1,e){const n=this.exportSvg(t,e),o=await sn(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=nn(this,t),o=on(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,rt(this.nodeData),this.arrows=t.arrows||[],this.summaries=t.summaries||[],this.tidyArrow(),this.toolBar&&Le(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.linkSvgGroup=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}};function cn({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:d,containerHeight:a}){let h=e+n/2;const f=t+o/2;let p;d===X.LHS?p=i+r:p=i;const m=s+c/2,u=(1-Math.abs(m-f)/a)*.25*(n/2);return d===X.LHS?h=h-n/10-u:h=h+n/10+u,`M ${h} ${f} Q ${h} ${m} ${p} ${m}`}function ln({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:d,isFirst:a}){const h=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let f=0,p=0;a?f=t+o/2:f=t+o;const m=s+c;let y=0,u=0,g=0;const b=Math.abs(f-m)/300*h;return d===X.LHS?(g=e,y=g+h,u=g-h,p=i+h,`M ${y} ${f} C ${g} ${f} ${g+b} ${m} ${u} ${m} H ${p}`):(g=e+n,y=g-h,u=g+h,p=i+r-h,`M ${y} ${f} C ${g} ${f} ${g-b} ${m} ${u} ${m} H ${p}`)}const an="5.11.0";function dn(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}}}function O({el:t,direction:e,editable:n,contextMenu:o,toolBar:s,keypress:i,mouseSelectionButton:r,selectionContainer:c,before:d,newTopicName:a,allowUndo:h,generateMainBranch:f,generateSubBranch:p,overflowHidden:m,theme:y,alignment:u,scaleSensitivity:g,scaleMax:b,scaleMin:w,handleWheel:x,markdown:S,imageProxy:T,pasteHandler:L}){let C=null;const P=Object.prototype.toString.call(t);if(P==="[object HTMLDivElement]"?C=t:P==="[object String]"&&(C=document.querySelector(t)),!C)throw new Error("MindElixir: el is not a valid element");C.style.position="relative",C.innerHTML="",this.el=C,this.disposable=[],this.before=d||{},this.newTopicName=a||"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=h??!0,this.scaleSensitivity=g??.1,this.scaleMax=b??1.4,this.scaleMin=w??.2,this.generateMainBranch=f||cn,this.generateSubBranch=p||ln,this.overflowHidden=m??!1,this.alignment=u??"root",this.handleWheel=x??!0,this.markdown=S||void 0,this.imageProxy=T||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.panHelper=dn(this),this.bus=be(),this.container=document.createElement("div"),this.selectionContainer=c||this.container,this.container.className="map-container";const k=window.matchMedia("(prefers-color-scheme: dark)");this.theme=y||(k.matches?U:j);const R=document.createElement("div");R.className="map-canvas",this.map=R,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=document.createElement("me-nodes"),this.lines=F("lines"),this.summarySvg=F("summary"),this.linkController=F("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=Lt(),this.line2=Lt(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=F("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(we(this)),L&&(this.pasteHandler=L)}return O.prototype=rn,Object.defineProperty(O.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),O.LEFT=0,O.RIGHT=1,O.SIDE=2,O.THEME=j,O.DARK_THEME=U,O.version=an,O.E=xt,Y.DARK_THEME=U,Y.LEFT=0,Y.RIGHT=1,Y.SIDE=2,Y.THEME=j,Y.default=O,Object.defineProperties(Y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),Y})({});
15
+ `,vt(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",()=>{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,_(e),"parent"in n?t.bus.fire("operation",{name:"finishEditSummary",obj:n}):t.bus.fire("operation",{name:"finishEditArrowLabel",obj:n}))})},be=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 l=r[c],a=l.querySelector("me-tpc"),{offsetLeft:d,offsetTop:f}=M(this.nodes,a),p=a.offsetWidth,v=a.offsetHeight,y=l.parentNode.className,u=this.generateMainBranch({pT:n,pL:o,pW:s,pH:i,cT:f,cL:d,cW:p,cH:v,direction:y,containerHeight:this.nodes.offsetHeight}),g=this.theme.palette,b=a.nodeObj.branchColor||g[c%g.length];if(a.style.borderColor=b,this.lines.appendChild(bt(u,b,"3")),t&&t!==l)continue;const w=R("subLines"),C=l.lastChild;C.tagName==="svg"&&C.remove(),l.appendChild(w),St(this,w,b,l,y,!0)}this.labelContainer.innerHTML="",this.renderArrow(),this.renderSummary(),this.bus.fire("linkDiv")},St=function(t,e,n,o,s,i){const r=o.firstChild,c=o.children[1].children;if(c.length===0)return;const l=r.offsetTop,a=r.offsetLeft,d=r.offsetWidth,f=r.offsetHeight;for(let p=0;p<c.length;p++){const v=c[p],y=v.firstChild,u=y.offsetTop,g=y.offsetLeft,b=y.offsetWidth,w=y.offsetHeight,C=y.firstChild.nodeObj.branchColor||n,T=t.generateSubBranch({pT:l,pL:a,pW:d,pH:f,cT:u,cL:g,cW:b,cH:w,direction:s,isFirst:i});e.appendChild(bt(T,C,"2"));const h=y.children[1];if(h){if(!h.expanded)continue}else continue;St(t,e,C,v,s)}},xe={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>'},H=(t,e)=>{const n=document.createElement("span");return n.id=t,n.innerHTML=xe[e],n};function Ce(t){const e=document.createElement("div"),n=H("fullscreen","full"),o=H("toCenter","living"),s=H("zoomout","zoomout"),i=H("zoomin","zoomin");e.appendChild(n),e.appendChild(o),e.appendChild(s),e.appendChild(i),e.className="mind-elixir-toolbar rb";let r=null;const c=()=>{const a=t.container.getBoundingClientRect(),d=nt(t.map.style.transform),f=a.width/2,p=a.height/2,v=(f-d.x)/t.scaleVal,y=(p-d.y)/t.scaleVal;r={containerRect:a,currentTransform:d,mapCenterX:v,mapCenterY:y}},l=()=>{if(r){const a=t.container.getBoundingClientRect(),d=a.width/2,f=a.height/2,p=d-r.mapCenterX*t.scaleVal,v=f-r.mapCenterY*t.scaleVal,y=p-r.currentTransform.x,u=v-r.currentTransform.y;t.move(y,u)}};return t.el.addEventListener("fullscreenchange",l),n.onclick=()=>{c(),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 Se(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 Ee(t){t.container.append(Ce(t)),t.container.append(Se(t))}const Te=function(t,e=!0){this.theme=t;const o={...(t.type==="dark"?V:X).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()},Et={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=at([{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}}}},De="#4dc4ff";function Tt(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 Le(t,e,n){t&&(t.dataset.x=e.toString(),t.dataset.y=n.toString(),_(t))}function q(t,e,n,o,s){D(t,{x1:e+"",y1:n+"",x2:o+"",y2:s+""})}function Dt(t,e,n,o,s,i,r,c,l,a){const d=`M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${l}`;if(t.line.setAttribute("d",d),a.style){const u=a.style;u.stroke&&t.line.setAttribute("stroke",u.stroke),u.strokeWidth&&t.line.setAttribute("stroke-width",String(u.strokeWidth)),u.strokeDasharray&&t.line.setAttribute("stroke-dasharray",u.strokeDasharray),u.strokeLinecap&&t.line.setAttribute("stroke-linecap",u.strokeLinecap),u.opacity!==void 0&&t.line.setAttribute("opacity",String(u.opacity))}const f=t.querySelectorAll('path[stroke="transparent"]');f.length>0&&f[0].setAttribute("d",d);const p=F(i,r,c,l);if(p){const u=`M ${p.x1} ${p.y1} L ${c} ${l} L ${p.x2} ${p.y2}`;if(t.arrow1.setAttribute("d",u),f.length>1&&f[1].setAttribute("d",u),a.style){const g=a.style;g.stroke&&t.arrow1.setAttribute("stroke",g.stroke),g.strokeWidth&&t.arrow1.setAttribute("stroke-width",String(g.strokeWidth)),g.strokeLinecap&&t.arrow1.setAttribute("stroke-linecap",g.strokeLinecap),g.opacity!==void 0&&t.arrow1.setAttribute("opacity",String(g.opacity))}}if(a.bidirectional){const u=F(o,s,e,n);if(u){const g=`M ${u.x1} ${u.y1} L ${e} ${n} L ${u.x2} ${u.y2}`;if(t.arrow2.setAttribute("d",g),f.length>2&&f[2].setAttribute("d",g),a.style){const b=a.style;b.stroke&&t.arrow2.setAttribute("stroke",b.stroke),b.strokeWidth&&t.arrow2.setAttribute("stroke-width",String(b.strokeWidth)),b.strokeLinecap&&t.arrow2.setAttribute("stroke-linecap",b.strokeLinecap),b.opacity!==void 0&&t.arrow2.setAttribute("opacity",String(b.opacity))}}}const{x:v,y}=Tt(e,n,o,s,i,r,c,l);if(t.labelEl&&Le(t.labelEl,v,y),a.style?.labelColor){const u=t.labelEl;u&&(u.style.color=a.style.labelColor)}Oe(t)}function j(t,e,n){const{offsetLeft:o,offsetTop:s}=M(t.nodes,e),i=e.offsetWidth,r=e.offsetHeight,c=o+i/2,l=s+r/2,a=c+n.x,d=l+n.y;return{w:i,h:r,cx:c,cy:l,ctrlX:a,ctrlY:d}}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 Me=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,c=s.offsetLeft+n.offsetWidth/2,l=s.offsetTop+n.offsetHeight/2,a=c-i,d=l-r,f=Math.sqrt(a*a+d*d),p=Math.max(50,Math.min(200,f*.3)),v=Math.abs(a),y=Math.abs(d);let u,g;if(f<150){const w=e.closest("me-main").className==="lhs"?-1:1;u={x:200*w,y:0},g={x:200*w,y:0}}else if(v>y*1.5){const w=a>0?e.offsetWidth/2:-e.offsetWidth/2,C=a>0?-n.offsetWidth/2:n.offsetWidth/2;u={x:w+(a>0?p:-p),y:0},g={x:C+(a>0?-p:p),y:0}}else if(y>v*1.5){const w=d>0?e.offsetHeight/2:-e.offsetHeight/2,C=d>0?-n.offsetHeight/2:n.offsetHeight/2;u={x:0,y:w+(d>0?p:-p)},g={x:0,y:C+(d>0?-p:p)}}else{const w=Math.atan2(d,a),C=e.offsetWidth/2*Math.cos(w),T=e.offsetHeight/2*Math.sin(w),h=-(n.offsetWidth/2)*Math.cos(w),m=-(n.offsetHeight/2)*Math.sin(w),x=p*.7*(a>0?1:-1),S=p*.7*(d>0?1:-1);u={x:C+x,y:T+S},g={x:h-x,y:m-S}}return{delta1:{x:Math.round(u.x),y:Math.round(u.y)},delta2:{x:Math.round(g.x),y:Math.round(g.y)}}},it=function(t,e,n,o,s){if(!e||!n)return;if(!o.delta1||!o.delta2){const E=Me(t,e,n);o.delta1=E.delta1,o.delta2=E.delta2}const i=j(t,e,o.delta1),r=j(t,n,o.delta2),{x:c,y:l}=O(i),{ctrlX:a,ctrlY:d}=i,{ctrlX:f,ctrlY:p}=r,{x:v,y}=O(r),u=F(f,p,v,y);if(!u)return;const g=`M ${u.x1} ${u.y1} L ${v} ${y} L ${u.x2} ${u.y2}`;let b="";if(o.bidirectional){const E=F(a,d,c,l);if(!E)return;b=`M ${E.x1} ${E.y1} L ${c} ${l} L ${E.x2} ${E.y2}`}const w=we(`M ${c} ${l} C ${a} ${d} ${f} ${p} ${v} ${y}`,g,b,o.style),{x:C,y:T}=Tt(c,l,a,d,f,p,v,y),h=o.style?.labelColor||"rgb(235, 95, 82)",m="a-"+o.id;w.id=m;const x=t.markdown?t.markdown(o.label,o):o.label,S=st(x,C,T,{anchor:"middle",color:h,dataType:"arrow",svgId:m});w.labelEl=S,w.arrowObj=o,w.dataset.linkid=o.id,t.labelContainer.appendChild(S),t.arrowSvg.appendChild(w),_(S),s||(t.arrows.push(o),t.currentArrow=w,Lt(t,o,i,r))},Pe=function(t,e,n={}){const o={id:B(),label:"Custom Link",from:t.nodeObj.id,to:e.nodeObj.id,...n};it(this,t,e,o),this.bus.fire("operation",{name:"createArrow",obj:o})},ke=function(t){U(this);const e={...t,id:B()};it(this,this.findEle(e.from),this.findEle(e.to),e),this.bus.fire("operation",{name:"createArrow",obj:e})},Ne=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}})},Ae=function(t){this.currentArrow=t;const e=t.arrowObj,n=this.findEle(e.from),o=this.findEle(e.to),s=j(this,n,e.delta1),i=j(this,o,e.delta2);Lt(this,e,s,i),this.bus.fire("selectArrow",e)},$e=function(){U(this),this.currentArrow=null,this.bus.fire("unselectArrow")},rt=function(t,e){const n=document.createElementNS(P,"path");return D(n,{d:t,stroke:e,fill:"none","stroke-width":"6","stroke-linecap":"round","stroke-linejoin":"round"}),n},He=function(t,e){const n=document.createElementNS(P,"g");n.setAttribute("class","arrow-highlight"),n.setAttribute("opacity","0.45");const o=rt(t.line.getAttribute("d"),e);n.appendChild(o);const s=rt(t.arrow1.getAttribute("d"),e);if(n.appendChild(s),t.arrow2.getAttribute("d")){const i=rt(t.arrow2.getAttribute("d"),e);n.appendChild(i)}t.insertBefore(n,t.firstChild)},Ie=function(t){const e=t.querySelector(".arrow-highlight");e&&e.remove()},Oe=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&&Ie(t.currentArrow)},Lt=function(t,e,n,o){const{linkController:s,P2:i,P3:r,line1:c,line2:l,nodes:a,map:d,currentArrow:f,bus:p}=t;if(!f)return;s.style.display="initial",i.style.display="initial",r.style.display="initial",a.appendChild(s),a.appendChild(i),a.appendChild(r),He(f,De);let{x:v,y}=O(n),{ctrlX:u,ctrlY:g}=n,{ctrlX:b,ctrlY:w}=o,{x:C,y:T}=O(o);i.style.cssText=`top:${g}px;left:${u}px;`,r.style.cssText=`top:${w}px;left:${b}px;`,q(c,v,y,u,g),q(l,b,w,C,T),t.helper1=Et.create(i),t.helper2=Et.create(r),t.helper1.init(d,(h,m)=>{u=u+h/t.scaleVal,g=g+m/t.scaleVal;const x=O({...n,ctrlX:u,ctrlY:g});v=x.x,y=x.y,i.style.top=g+"px",i.style.left=u+"px",Dt(f,v,y,u,g,b,w,C,T,e),q(c,v,y,u,g),e.delta1.x=Math.round(u-n.cx),e.delta1.y=Math.round(g-n.cy),p.fire("updateArrowDelta",e)}),t.helper2.init(d,(h,m)=>{b=b+h/t.scaleVal,w=w+m/t.scaleVal;const x=O({...o,ctrlX:b,ctrlY:w});C=x.x,T=x.y,r.style.top=w+"px",r.style.left=b+"px",Dt(f,v,y,u,g,b,w,C,T,e),q(l,b,w,C,T),e.delta2.x=Math.round(b-o.cx),e.delta2.y=Math.round(w-o.cy),p.fire("updateArrowDelta",e)})};function Be(){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{it(this,this.findEle(n.from),this.findEle(n.to),n,!0)}catch{}}this.nodes.appendChild(this.arrowSvg)}function Re(t){U(this),t&&t.labelEl&&Ct(this,t.labelEl,t.arrowObj)}function We(){this.arrows=this.arrows.filter(t=>z(t.from,this.nodeData)&&z(t.to,this.nodeData))}const Ye=Object.freeze(Object.defineProperty({__proto__:null,createArrow:Pe,createArrowFrom:ke,editArrowLabel:Re,removeArrow:Ne,renderArrow:Be,selectArrow:Ae,tidyArrow:We,unselectArrow:$e},Symbol.toStringTag,{value:"Module"})),Xe=function(t){if(t.length===0)throw new Error("No selected node.");if(t.length===1){const l=t[0].nodeObj,a=t[0].nodeObj.parent;if(!a)throw new Error("Can not select root node.");const d=a.children.findIndex(f=>l===f);return{parent:a.id,start:d,end:d}}let e=0;const n=t.map(l=>{let a=l.nodeObj;const d=[];for(;a.parent;){const f=a.parent,v=f.children?.indexOf(a);a=f,d.unshift({node:a,index:v})}return d.length>e&&(e=d.length),d});let o=0;t:for(;o<e;o++){const l=n[0][o]?.node;for(let a=1;a<n.length;a++)if(n[a][o]?.node!==l)break t}if(!o)throw new Error("Can not select root node.");const s=n.map(l=>l[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}},Ve=function(t){const e=document.createElementNS(P,"g");return e.setAttribute("id",t),e},Mt=function(t,e){const n=document.createElementNS(P,"path");return D(n,{d:t,stroke:e||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},ze=t=>t.parentElement.parentElement,Fe=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:c}=e,{nodes:l,theme:a,summarySvg:d}=t,p=t.findEle(s).nodeObj,v=Fe(t,e);let y=1/0,u=0,g=0,b=0;for(let Y=i;Y<=r;Y++){const Pt=p.children?.[Y];if(!Pt)return t.removeSummary(n),null;const Z=ze(t.findEle(Pt.id)),{offsetLeft:Q,offsetTop:kt}=M(l,Z),Nt=i===r?10:20;Y===i&&(g=kt+Nt),Y===r&&(b=kt+Z.offsetHeight-Nt),Q<y&&(y=Q),Z.offsetWidth+Q>u&&(u=Z.offsetWidth+Q)}let w,C;const T=p.parent?10:0,h=g+T,m=b+T,x=(h+m)/2,S=c?.stroke||a.cssVar["--color"],E=c?.labelColor||a.cssVar["--color"],N="s-"+n,A=t.markdown?t.markdown(o,e):o;v===I.LHS?(w=Mt(`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`,S),C=st(A,y-20,x,{anchor:"end",color:E,dataType:"summary",svgId:N})):(w=Mt(`M ${u-10} ${h} c 5 0 10 5 10 10 L ${u} ${m-10} c 0 5 -5 10 -10 10 M ${u} ${x} h 10`,S),C=st(A,u+20,x,{anchor:"start",color:E,dataType:"summary",svgId:N}));const W=Ve(N);return W.appendChild(w),t.labelContainer.appendChild(C),_(C),W.summaryObj=e,W.labelEl=C,d.appendChild(W),W},Ge=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}=Xe(e),c={id:B(),parent:s,start:i,end:r,label:"summary",style:t.style},l=ct(this,c);n.push(c),this.editSummary(l),o.fire("operation",{name:"createSummary",obj:c})},createSummaryFrom:function(t){const e=B(),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&&Ct(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 _e(t,e){const n=document.createElementNS(L,"svg");return D(n,{version:"1.1",xmlns:L,height:t,width:e}),n}function qe(t,e){return(parseInt(t)-parseInt(e))/2}function je(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((c,l)=>{const a=document.createElementNS(L,"text");D(a,{x:n+parseInt(e.paddingLeft)+"",y:o+parseInt(e.paddingTop)+qe(e.lineHeight,e.fontSize)*(l+1)+parseFloat(e.fontSize)*(l+1)+"","text-anchor":"start","font-family":e.fontFamily,"font-size":`${e.fontSize}`,"font-weight":`${e.fontWeight}`,fill:`${e.color}`}),a.innerHTML=c,s.appendChild(a)}),s}function Ue(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 Ke(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 c=document.createElementNS(L,"g");c.appendChild(r);let l;return n?l=Ue(e,o,s,i):l=je(e,o,s,i),c.appendChild(l),c}function Je(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 Ze(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,Qe='<?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">',tn=(t,e=!1)=>{const n=t.nodes,o=n.offsetHeight+J*2,s=n.offsetWidth+J*2,i=_e(o+"px",s+"px"),r=document.createElementNS(L,"svg"),c=document.createElementNS(L,"rect");D(c,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:t.theme.cssVar["--bgcolor"]}),i.appendChild(c),n.querySelectorAll(".subLines").forEach(f=>{const p=f.cloneNode(!0),{offsetLeft:v,offsetTop:y}=M(n,f.parentElement);p.setAttribute("x",`${v}`),p.setAttribute("y",`${y}`),r.appendChild(p)});const l=n.querySelector(".lines")?.cloneNode(!0);l&&r.appendChild(l);const a=n.querySelector(".topiclinks")?.cloneNode(!0);a&&r.appendChild(a);const d=n.querySelector(".summary")?.cloneNode(!0);return d&&r.appendChild(d),n.querySelectorAll("me-tpc").forEach(f=>{f.nodeObj.dangerouslySetInnerHTML?r.appendChild(K(t,f,!e)):(r.appendChild(Ke(t,f)),r.appendChild(K(t,f.text,!e)))}),n.querySelectorAll(".tags > span").forEach(f=>{r.appendChild(K(t,f))}),n.querySelectorAll(".icons > span").forEach(f=>{r.appendChild(K(t,f))}),n.querySelectorAll(".hyper-link").forEach(f=>{r.appendChild(Je(t,f))}),n.querySelectorAll("img").forEach(f=>{r.appendChild(Ze(t,f))}),D(r,{x:J+"",y:J+"",overflow:"visible"}),i.appendChild(r),i},en=(t,e)=>(e&&t.insertAdjacentHTML("afterbegin","<style>"+e+"</style>"),Qe+t.outerHTML);function nn(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 on={getObjById:z,generateNewObj:$t,layout:Xt,linkDiv:be,editTopic:jt,createWrapper:Ft,createParent:Gt,createChildren:_t,createTopic:qt,findEle:mt,changeTheme:Te,...he,...{},...Ye,...Ge,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(t=!1,e){const n=this.exportSvg(t,e),o=await nn(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=tn(this,t),o=en(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&&Ee(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}};function sn({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:l,containerHeight:a}){let d=e+n/2;const f=t+o/2;let p;l===I.LHS?p=i+r:p=i;const v=s+c/2,u=(1-Math.abs(v-f)/a)*.25*(n/2);return l===I.LHS?d=d-n/10-u:d=d+n/10+u,`M ${d} ${f} Q ${d} ${v} ${p} ${v}`}function rn({pT:t,pL:e,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:l,isFirst:a}){const d=parseInt(this.container.style.getPropertyValue("--node-gap-x"));let f=0,p=0;a?f=t+o/2:f=t+o;const v=s+c;let y=0,u=0,g=0;const b=Math.abs(f-v)/300*d;return l===I.LHS?(g=e,y=g+d,u=g-d,p=i+d,`M ${y} ${f} C ${g} ${f} ${g+b} ${v} ${u} ${v} H ${p}`):(g=e+n,y=g-d,u=g+d,p=i+r-d,`M ${y} ${f} C ${g} ${f} ${g-b} ${v} ${u} ${v} H ${p}`)}const cn="5.11.1-beta.1";function ln(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 k({el:t,direction:e,editable:n,contextMenu:o,toolBar:s,keypress:i,mouseSelectionButton:r,selectionContainer:c,before:l,newTopicName:a,allowUndo:d,generateMainBranch:f,generateSubBranch:p,overflowHidden:v,theme:y,alignment:u,scaleSensitivity:g,scaleMax:b,scaleMin:w,handleWheel:C,markdown:T,imageProxy:h,pasteHandler:m,mobileMultiSelect:x}){let S=null;const E=Object.prototype.toString.call(t);if(E==="[object HTMLDivElement]"?S=t:E==="[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=l||{},this.newTopicName=a||"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=d??!0,this.scaleSensitivity=g??.1,this.scaleMax=b??1.4,this.scaleMin=w??.2,this.generateMainBranch=f||sn,this.generateSubBranch=p||rn,this.overflowHidden=v??!1,this.alignment=u??"root",this.handleWheel=C??!0,this.markdown=T||void 0,this.imageProxy=h||void 0,this.currentNodes=[],this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.mobileMultiSelect=x??!1,this.panHelper=ln(this),this.bus=ve(),this.container=document.createElement("div"),this.selectionContainer=c||this.container,this.container.className="map-container";const N=window.matchMedia("(prefers-color-scheme: dark)");this.theme=y||(N.matches?V:X);const A=document.createElement("div");A.className="map-canvas",this.map=A,this.container.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.el.appendChild(this.container),this.nodes=document.createElement("me-nodes"),this.lines=R("lines"),this.summarySvg=R("summary"),this.linkController=R("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=xt(),this.line2=xt(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.arrowSvg=R("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(ye(this)),m&&(this.pasteHandler=m)}return k.prototype=on,Object.defineProperty(k.prototype,"currentNode",{get(){return this.currentNodes[this.currentNodes.length-1]},enumerable:!0}),k.LEFT=0,k.RIGHT=1,k.SIDE=2,k.THEME=X,k.DARK_THEME=V,k.version=cn,k.E=mt,$.DARK_THEME=V,$.LEFT=0,$.RIGHT=1,$.SIDE=2,$.THEME=X,$.default=k,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),$})({});