mind.svg.js
Version:
Display and operate MindMap using SVG in browser
20 lines • 63.3 kB
JavaScript
/**
* mind.svg.js
* @summary Display and operate MindMap using SVG in browser
* @version 0.6.8
* @copyright season studio
* @license MIT
* @time Tue Jul 07 2020 17:07:29 GMT+0800 (GMT+08:00)
*/
/**
* mind.svg.js
* @summary Display and operate MindMap using SVG in browser
* @version 0.6.8
* @copyright season studio
* @license MIT
* @time Tue Jul 07 2020 17:07:29 GMT+0800 (GMT+08:00)
*/
var MindSVG=function(t){"use strict";var e=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){var e=function(t){var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(t,e,n,r){var i=e&&e.prototype instanceof f?e:f,o=Object.create(i.prototype),a=new b(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return w()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var c=k(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var f=s(t,e,n);if("normal"===f.type){if(r=n.done?"completed":"suspendedYield",f.arg===l)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(r="completed",n.method="throw",n.arg=f.arg)}}}(t,n,a),o}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function f(){}function u(){}function h(){}var d={};d[i]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(S([])));y&&y!==e&&n.call(y,i)&&(d=y);var p=h.prototype=f.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function m(t,e){var r;this._invoke=function(i,o){function a(){return new e((function(r,a){!function r(i,o,a,c){var l=s(t[i],t,o);if("throw"!==l.type){var f=l.arg,u=f.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(u).then((function(t){f.value=t,a(f)}),(function(t){return r("throw",t,a,c)}))}c(l.arg)}(i,o,r,a)}))}return r=r?r.then(a,a):a()}}function k(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=s(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function b(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:w}}function w(){return{value:void 0,done:!0}}return u.prototype=p.constructor=h,h.constructor=u,h[a]=u.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===u||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(p),t},t.awrap=function(t){return{__await:t}},g(m.prototype),m.prototype[o]=function(){return this},t.AsyncIterator=m,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new m(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(p),p[a]="Generator",p[i]=function(){return this},p.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=S,b.prototype={constructor:b,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),s=n.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:S(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}function o(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,c=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return c=t.done,t},e:function(t){s=!0,o=t},f:function(){try{c||null==n.return||n.return()}finally{if(s)throw o}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var c={SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink"};function s(t){return"data-".concat(t)}function l(t){return t instanceof window.Node||t instanceof window.HTMLElement}function f(t){return Number(("string"==typeof t?t:String(t)).replace(/\D+/,""))}var u=function(){function t(e,r){n(this,t);var i=this.node=l(e)?e:r?document.createElementNS(r,e):document.createElement(e);this.matches=(i.matches||i.matchesSelector||i.msMatchesSelector||i.mozMatchesSelector||i.webkitMatchesSelector||i.oMatchesSelector).bind(i),this.dispatchEvent=i.dispatchEvent.bind(i)}return i(t,[{key:"getRelativeRect",value:function(e){var n=this.globalRect,r=t.attach(e);if(r)if(r.isSVG){var i=r.node.getScreenCTM().inverse().translate(n.x,n.y);if(n.x=i.e,n.y=i.f,this.isSVG){var o=this.rect;n.width=o.width,n.height=o.height}}else{var a=r.globalRect;n.x-=a.x-r.node.clientLeft,n.y-=a.y-r.node.clientTop}return n}},{key:"setSizeInStyle",value:function(t,e){var n=window.getComputedStyle?window.getComputedStyle(this.node):void 0;n&&(t-=f(n.paddingLeft)+f(n.paddingRight)+f(n.borderLeftWidth)+f(n.borderRightWidth),e-=f(n.paddingTop)+f(n.paddingBottom)+f(n.borderTopWidth)+f(n.borderBottomWidth)),this.node.style.width="".concat(t,"px"),this.node.style.height="".concat(e,"px")}},{key:"translatePoint",value:function(t,e){if(this.isSVG){var n=this.node.getScreenCTM().inverse().translate(t,e);return{x:n.e,y:n.f}}var r=this.globalRect;return{x:t-r.x,y:e-r.y}}},{key:"attr",value:function(t,e){var n=this.node;if("string"==typeof t){if(void 0===e)return n.getAttribute(t);null===e?n.removeAttribute(t):n.setAttribute(t,e)}else{if(t instanceof Array){var r,i={},a=o(t);try{for(a.s();!(r=a.n()).done;){var c=r.value;i[c]=n.getAttribute(c)}}catch(t){a.e(t)}finally{a.f()}return i}for(var s in t){var l=t[s];null===l?n.removeAttribute(s):n.setAttribute(s,l)}}return this}},{key:"style",value:function(t,e){var n=this.node.style;if("string"==typeof t){if(void 0===e)return n[t];n[t]=e}else{if(t instanceof Array){var r,i={},a=o(t);try{for(a.s();!(r=a.n()).done;){var c=r.value;i[c]=n[c]}}catch(t){a.e(t)}finally{a.f()}return i}for(var s in t){var l=t[s];n[s]=l}}return this}},{key:"data",value:function(t,e){var n=this.node;if("string"==typeof t){if(void 0===e)return JSON.parse(n.getAttribute(s(t)));null===e?n.removeAttribute(s(t)):n.setAttribute(s(t),JSON.stringify(e))}else{if(t instanceof Array){var r,i={},a=o(t);try{for(a.s();!(r=a.n()).done;){var c=r.value;i[c]=JSON.parse(n.getAttribute(s(c)))}}catch(t){a.e(t)}finally{a.f()}return i}for(var l in t){var f=t[l];null===f?n.removeAttribute(s(l)):n.setAttribute(s(l),JSON.stringify(f))}}return this}},{key:"hasClass",value:function(t){return this.matches(".".concat(t))}},{key:"addClass",value:function(t){var e=this.node.classList;if(e)e.add(t);else{var n=this.attr("class");(e=n?n.split(/\s+/):[]).indexOf(t)<0&&this.attr("class","".concat(n," ").concat(t))}return this}},{key:"removeClass",value:function(t){var e=this.node.classList;if(e)e.remove(t);else{var n=this.attr("class"),r=(e=n?n.split(/\s+/):[]).indexOf(t);r>=0&&(e[r]="",this.attr("class",e.join(" ")))}return this}},{key:"parent",value:function(e){for(var n,r=this.node;(r=r.parentElement)&&(n=t.attach(r),e)&&!n.matches(e););return n}},{key:"firstDescendant",value:function(e){e=e||"*";var n=this.node.querySelector(e);return n?t.attach(n):void 0}},{key:"descendant",value:function(e){e=e||"*";var n,r=[],i=o(this.node.querySelectorAll(e));try{for(i.s();!(n=i.n()).done;){var a=n.value,c=t.attach(a);c.matches(e)&&r.push(c)}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"getDescandant",value:e.mark((function n(r){var i,a,c,s,l;return e.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=r||"*",i=this.node.querySelectorAll(r),a=o(i),e.prev=3,a.s();case 5:if((c=a.n()).done){e.next=13;break}if(s=c.value,!(l=t.attach(s)).matches(r)){e.next=11;break}return e.next=11,l;case 11:e.next=5;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(3),a.e(e.t0);case 18:return e.prev=18,a.f(),e.finish(18);case 21:case"end":return e.stop()}}),n,this,[[3,15,18,21]])}))},{key:"firstChild",value:function(e){if(e){var n,r,i=o(this.node.children);try{for(i.s();!(r=i.n()).done;){var a=r.value,c=t.attach(a);if(c.matches(e)){n=c;break}}}catch(t){i.e(t)}finally{i.f()}return n}return t.attach(this.node.firstElementChild)}},{key:"children",value:function(e){var n,r=[],i=o(this.node.children);try{for(i.s();!(n=i.n()).done;){var a=n.value,c=t.attach(a);e&&!c.matches(e)||r.push(c)}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"getChildren",value:e.mark((function n(r){var i,a,c,s,l;return e.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this.node.children,a=o(i),e.prev=2,a.s();case 4:if((c=a.n()).done){e.next=12;break}if(s=c.value,l=t.attach(s),r&&!l.matches(r)){e.next=10;break}return e.next=10,l;case 10:e.next=4;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),a.e(e.t0);case 17:return e.prev=17,a.f(),e.finish(17);case 20:case"end":return e.stop()}}),n,this,[[2,14,17,20]])}))},{key:"appendTo",value:function(t){var e=l(t)?t:v(t)?t.node:null;return e&&(this.node.remove(),e.appendChild(this.node)),this}},{key:"insertToTop",value:function(t){var e=l(t)?t:v(t)?t.node:null;return e&&(this.node.remove(),e.insertBefore(this.node,e.firstElementChild)),this}},{key:"insertAfter",value:function(e){var n=t.attach(e);if(n){var r=n.parent();if(r){this.node.remove();var i=n.node.nextSibling;i?r.node.insertBefore(this.node,i):r.node.appendChild(this.node)}}return this}},{key:"insertBefore",value:function(e){var n=t.attach(e);if(n){var r=n.parent();r&&(this.node.remove(),r.node.insertBefore(this.node,n.node))}return this}},{key:"remove",value:function(){return this.node.remove(),this}},{key:"convertPoint",value:function(t,e){var n=t&&t.x||0,r=t&&t.y||0;return e?(n+=this.node.offsetLeft,r+=this.node.offsetTop):(n-=this.node.offsetLeft,r-=this.node.offsetTop),{x:n,y:r}}},{key:"on",value:function(t,e,n){return this.node.addEventListener(t,e,n),this}},{key:"off",value:function(t,e,n){return this.node.removeEventListener(t,e,n),this}},{key:"isSame",value:function(t){return this.node.isSameNode(v(t)?t.node:t)}},{key:"createChild",value:function(e,n){var r=new t(e,n);return r&&r.appendTo(this),r}},{key:"createSVGChild",value:function(t){return this.isSVG?this.createChild(t,c.SVG):d().appendTo(this)}},{key:"clearChildren",value:function(){return this.node.innerHTML="",this}},{key:"id",get:function(){return this.node.getAttribute("id")||""},set:function(t){this.node.setAttribute("id",t)}},{key:"tagName",get:function(){return this.node.tagName.toLowerCase()}},{key:"class",get:function(){return this.node.getAttribute("class")||""},set:function(t){this.node.setAttribute("class",t)}},{key:"isSVG",get:function(){return this.node instanceof SVGElement}},{key:"text",get:function(){return this.node.textContent||""},set:function(t){this.isSVG?(this.node.innerHTML="",this.node.appendChild(document.createTextNode(t))):this.node.innerText=t}},{key:"top",get:function(){return this.isSVG?this.node.getBBox().y:this.node.offsetTop}},{key:"left",get:function(){return this.isSVG?this.node.getBBox().x:this.node.offsetLeft}},{key:"width",get:function(){return this.isSVG?this.node.getBBox().width:this.node.offsetWidth}},{key:"height",get:function(){return this.isSVG?this.node.getBBox().height:this.node.offsetHeight}},{key:"rect",get:function(){var t=this.node;return this.isSVG?t.getBBox():{x:t.offsetLeft,y:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}}},{key:"clientRect",get:function(){var t=this.node;return this.isSVG?t.getBBox():{x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}},{key:"globalRect",get:function(){return this.node.getBoundingClientRect()}},{key:"offsetRect",get:function(){var t=this.node;return this.isSVG?t.getBoundingClientRect():{x:t.offsetLeft,y:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}}},{key:"classList",get:function(){var t=this.attr("class");return t?t.split(/\s+/):[]}},{key:"root",get:function(){return this.isSVG?t.attach(this.node.ownerSVGElement||this.parent("body")):this.parent("body")}}],[{key:"attach",value:function(e){return l(e)?new t(e):v(e)?e:e?t.attach(document.querySelector(e)):void 0}}]),t}();function h(t,e){return arguments.length<=0?u:new u(t,e)}function d(){return new u("svg",c.SVG).attr({xmlns:c.SVG,"xmlns:xlink":c.XLINK,version:"1.1"})}function v(t){return t instanceof u}var y={};function p(t,e){if(e&&t in y){var n=y[t];"function"==typeof e&&(e=e(n));var r={};for(var i in e){var o=e[i];r[i]=n[i],n[i]=o}return r}}function g(t,e,n){if(e&&t in y){var r=y[t],i=r.prototype;"function"==typeof e&&(e=e(r,i));var o={};for(var a in e){var c=e[a],s=o[a]=i[a];s&&!n?s instanceof Array?s.unshift(c):i[a]=[c,s]:i[a]=c}return o}}function m(t,e){if("string"==typeof t)y[t]=e;else if(t)for(var n in t){var r=t[n];y[n]=r}}var k=Object.freeze({__proto__:null,extend:p,extendPrototype:function(t,e){if(t in y){var n=y[t],r=n.prototype;"function"==typeof e&&(e=e(n,r));var i={};for(var o in e){var a=e[o];i[o]=r[o],r[o]=a}return i}},extendEventHandler:g,registryClass:m});function E(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function T(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var S=Symbol("MindSVG.Event.Dispatcher"),w=Symbol("MindSVG.Event.BlockSibling.Private");function x(t,e){return e?"".concat("_$!").concat(t,"|").concat(e):"".concat("_$!").concat(t,"|")}function A(t,e,n){var r=Object.getOwnPropertyNames(t.prototype);if(n)return r.indexOf(x(e,n));var i,o=T(r);try{for(o.s();!(i=o.n()).done;){if(i.value.startsWith("".concat("_$!").concat(e,"|")))return!0}}catch(t){o.e(t)}finally{o.f()}return!1}function _(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&t.preventDefault(),t.stopPropagation()}function N(t){Object.isExtensible(t)&&(t[w]=void 0)}function I(t,e,n){var r=n[0];if(!t.length){var i=void 0;for(var o in t)if(t[o]&&(n[3]=i,i=t[o].apply(this,n),r[w]))break;return i}N(r)}function C(t){var e=t.target;if(e){var n=void 0,r=e.getAttribute("mind-event-stamp");if(r){var i=this[x(t.type,r)];i&&(Object.isExtensible(t)&&(t[w]=!0),n=i instanceof Array?I(i,0,[t,r,e,n]):i.call(this,t,r,e))}if(!t[w]){var o=this[x(t.type)];o&&(Object.isExtensible(t)&&(t[w]=!0),o instanceof Array?I(o,0,[t,r,e,n]):o.call(this,t,r,e,n))}}}function L(t,e,n){if(t&&e){var r,i=n||function(t){var e,n=[],r=T(Object.getOwnPropertyNames(t.prototype));try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.startsWith("_$!")){var o=i.substr("_$!".length).split("|")[0];o.length>0&&n.indexOf(o)<0&&n.push(o)}}}catch(t){r.e(t)}finally{r.f()}return n}(e.constructor),o=e[S]||(e[S]=C.bind(e)),a=(t.on||t.addEventListener).bind(t),c=T(i);try{for(c.s();!(r=c.n()).done;){a(r.value,o)}}catch(t){c.e(t)}finally{c.f()}}}function M(t,e,n){if(v(this)){var r=new CustomEvent(t,{bubbles:!0,cancelable:!0,composed:!0,detail:{value:e,result:n}});return this.node.dispatchEvent(r),r.detail.result}}var V={ATTR_EVENT_STAMP:"mind-event-stamp",EVENT_FOCUS_CHANGE:"mindevent.focus.change",EVENT_REQUIRE_LAYOUT:"mindevent.require.layout",EVENT_QUERY_ATTACHMENT:"mindevent.query.attachment",EVENT_CONFIRM_DRAG:"mindevent.confirm.drag",EVENT_END_DRAG:"mindevent.end.drag",EVENT_INVOKE_IMAGE:"mindevent.invoke.image",EVENT_INVOKE_LABELS:"mindevent.invoke.labels",EVENT_INVOKE_LINK:"mindevent.invoke.link",EVENT_INVOKE_NOTES:"mindevent.invoke.notes",EVENT_INVOKE_MARKERS:"mindevent.invoke.markers"},O=Object.freeze({__proto__:null,namedHandler:x,hasEventHandler:A,handledEvent:_,fromMindSVG:function(t,e){var n=h().attach(t.target);return n&&(n.isSVG||n.isSame(e.container))},continueSiblingHandler:N,mapEventHandler:L,fireEvent:M,eventStamp:function(t){return t&&t.target?t.target.getAttribute("mind-event-stamp"):void 0},Constants:V});var D,R,G,P,j,U,Y,H,B,F,X,W,K,Q,$,Z,z,q,J,tt,et,nt,rt={INVALID_PARAM:function(t){return new Error('The parameter "'.concat(t,'" is invalid!'))},ILLEGAL_INSTANCE:function(t,e){return new Error(e?'"'.concat(t,'" is a illegal instance'):'"'.concat(t,'" is a illegal instance of (').concat(e,")"))}};function it(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ot(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ot(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function ot(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var at=Symbol("MindSVG.Private"),ct="mind-main-basic",st="mind-main-container",lt="mind-svg",ft="mind-topic-group-basic",ut="mind-topic-item-group-basic",ht="mind-topic-focus",dt="mind-text-basic",vt="mind-text",yt="mind-topic",pt="mind-topic-level",gt="mind-topic-children-group-basic",mt="mind-line",kt="mind-topic-fold-icon",Et="mind-topic-labels",Tt="mind-topic-label-background",bt="mind-topic-link",St="mind-topic-notes",wt="mind-topic-markers",xt={paddingX:10,paddingY:10,topicMarginX:46,topicMarginY:17,contentMarginX:6,contentMarginY:6,rectRadius:6,lineBezierCtrlSize:17,subPaddingX:6,subPaddingY:6,maxLabelsPreview:3};function At(t){return"".concat("_data$").concat(t)}function _t(t){return t.startsWith("_data$")?t.substr("_data$".length):void 0}function Nt(t,e){return void 0===e?t[at]:t[at][e]}var It=function(){function t(e){if(n(this,t),!v(e))throw rt.INVALID_PARAM("_svg");if(this.defs=e.createSVGChild("defs")){var r=Object.getOwnPropertyNames(t);for(var i in r){var o=r[i],a=t[o];if("function"==typeof a){var c=a(this);v(c)&&c.attr("id",o)}}}}return i(t,[{key:"createChild",value:function(t){return this.defs.createSVGChild(t)}}]),t}();D=At("customData"),R=At("customData"),G=At("title"),P=At("title"),j=At("image"),U=At("image"),Y=At("labels"),H=At("labels"),B=At("href"),F=At("href"),X=At("notes"),W=At("notes"),K=At("markers"),Q=At("markers");var Ct=function(){function t(e,r,i){if(n(this,t),v(e)){if("g"!==e.tagName||!e.hasClass(ut))throw rt.ILLEGAL_INSTANCE("_data","<g> with item group class");var o=this.content=e;this.fireEvent=M.bind(o),this.titleRect=o.firstDescendant(t.titleSelector),this.titleText=o.firstDescendant("text.".concat(vt)),this.foldIcon=o.firstDescendant("use.".concat(kt))}else{if(!v(i))throw rt.INVALID_PARAM(i);var a=i.attr("id");e=e||{};var c=this.content=i.createSVGChild("g");c.attr({id:a,class:"".concat(ut," ").concat(pt).concat(r)}),this.fireEvent=M.bind(c);var s=this.titleRect=c.createSVGChild("rect"),l=this.titleText=c.createSVGChild("text");l.text=e.title,l.attr(E({id:a,class:"".concat(dt," ").concat(vt)},V.ATTR_EVENT_STAMP,"topic-item-title")),s.attr(E({id:a,class:yt},V.ATTR_EVENT_STAMP,"topic-item-title"));var f,u=it(t.propertyNames());try{for(u.s();!(f=u.n()).done;){var h=f.value;"title"!==h.name&&h.name in e&&(this[h.fullName]=e[h.name])}}catch(t){u.e(t)}finally{u.f()}r>0&&(this.foldIcon=c.createSVGChild("use")).attr(E({id:a,href:"#".concat("icon-minus"),style:"display: none;",class:kt},V.ATTR_EVENT_STAMP,"topic-item-fold-icon"))}}return i(t,[{key:"propertys",value:e.mark((function n(){var r,i,o,a,c;return e.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Object.getOwnPropertyNames(t.prototype),i=it(r),e.prev=2,i.s();case 4:if((o=i.n()).done){e.next=12;break}if(a=o.value,!(c=_t(a))){e.next=10;break}return e.next=10,{name:c,fullName:a,value:this[a]};case 10:e.next=4;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),i.e(e.t0);case 17:return e.prev=17,i.f(),e.finish(17);case 20:case"end":return e.stop()}}),n,this,[[2,14,17,20]])}))},{key:"level",value:function(t){var e=this.content;if(e){var n=e.classList,r=-1;for(var i in n)if(n[i].startsWith(pt)){r=i;break}if(void 0===t)return r>=0?parseInt(n[r].substr(pt.length)):0;r>=0&&(n[r]=""),n.push("".concat(pt).concat(t)),e.attr("class",n.join(" "))}}},{key:"globalZone",value:function(e){var n=t["".concat(e,"Selector")];if(n){var r=this.content.firstDescendant(n);return r?r.globalRect:void 0}}},{key:"relativeZone",value:function(e,n){var r;if(e){var i=t["".concat(e,"Selector")];i&&(r=this.content.firstDescendant(i))}else r=this.content;if(r){var o=h().attach(n)||r.parent("div.".concat(st));return o?r.getRelativeRect(o):void 0}}},{key:"connectPointer",value:function(t){var e,n;if(this.titleRect){var r=this.titleRect.rect;n=r.height>>1,e=1==t?0:r.width}else e=0,n=0;return{x:e,y:n}}},{key:"fold",value:function(t){var e=this.foldIcon;e&&(null==t?(e.style("display","none"),e.attr({href:"#".concat("icon-minus")})):(e.attr({href:"#".concat(t?"icon-plus":"icon-minus")}),e.style("display","unset")))}},{key:"focus",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=void 0,r=this.content;if(r)if(e){if(!r.hasClass(ht)){var i=r.root;if(i){var o=i.firstDescendant(t.focusItemSelector);o&&o.removeClass(ht)}r.addClass(ht)}n=!0}else r.hasClass(ht)&&(r.removeClass(ht),n=!1);return n}},{key:"layout",value:function(e,n){if(!(e instanceof Mt))throw rt.INVALID_PARAM("_mindSVG");var r=this.titleText,i=this.titleRect;if(r&&i){var o=e.config(),a=o.paddingX,c=o.paddingY,s=o.rectRadius,l=o.maxLabelsPreview,f=o.subPaddingX,u=o.subPaddingY,h=r.rect,d=h.width,v=d+(a<<1),y=h.height+(c<<1),p=y+u,g=0,m=[],k=this.content.firstDescendant(t.labelsSelector),T=f;if(k){var b,S=0,w=0,x=it(k.getDescandant("text"));try{for(x.s();!(b=x.n()).done;){var A=b.value;A.attr({transform:"translate(".concat(T,", ").concat(u,")"),x:null,y:null,style:"display: ".concat(S>=l?"none":"unset")});var _=A.rect;0===S&&(w=_.height+u+u),++S<=l&&(T+=_.width+f)}}catch(t){x.e(t)}finally{x.f()}if(S>l){var N,I=k.firstDescendant("use")||k.createSVGChild("use");I.attr((E(N={href:"#".concat("icon-more")},V.ATTR_EVENT_STAMP,"topic-labels-more"),E(N,"transform","translate(".concat(T,", ").concat(u,")")),N)),T+=I.width+f}var C=k.firstDescendant("rect.".concat(Tt));C&&C.attr({x:null,y:null,width:T,height:w,rx:s,ry:s}),k.attr("transform","translate(0, ".concat(p,")")),g+=T}for(var L=0;L<2;L++){var M=this.content.firstDescendant(t.underLineSelectors[L]);if(M){var O=M.width;g+=O+f,m.push({obj:M,width:O})}}var D=this.content.firstDescendant(t.markersSelector);if(T=0,D){var R,G=it(D.getDescandant("use"));try{for(G.s();!(R=G.n()).done;){var P=R.value;0!==T&&(T+=f),P.attr("transform","translate(".concat(T,", 0)")),T+=P.width}}catch(t){G.e(t)}finally{G.f()}g+=T+f,m.push({obj:D,width:T})}m.length>0&&(g+=f),g>v&&(v=g);var j=this.content.firstDescendant(t.imageSelector);if(j){var U=j.rect,Y=U.width,H=U.height,B=0;Y>v?v=Y:B=(v-Y)/2,j.attr({transform:"translate(".concat(B,", -").concat(H+u,")"),x:null,y:null})}for(var F in T=v-f,m){var X=m[F],W=X.obj,K=X.width;W&&(T-=K,W.attr({transform:"translate(".concat(T,", ").concat(p,")"),x:null,y:null}),T-=f)}var Q=(v-d)/2;r.attr({transform:"translate(".concat(Q,", ").concat(c,")"),x:null,y:null}),i.attr({width:v,height:y,rx:s,ry:s,x:null,y:null});var $=this.foldIcon;$&&$.attr("transform","translate(".concat(1===n?0:v,", ").concat(y/2,")"))}}},{key:"size",get:function(){var t=this.content.rect;return{width:t.width,height:t.height}}},{key:"titleZone",get:function(){var t=this.titleRect;return t?t.getRelativeRect(t.root):{x:0,y:0,width:0,height:0}}},{key:D,get:function(){return this.content.data("customData")}},{key:R,set:function(t){this.content.data("customData",t)}},{key:G,get:function(){return this.titleText?this.titleText.text:""}},{key:P,set:function(t){this.titleText&&(this.titleText.text=t)}},{key:j,get:function(){var e=this.content.firstDescendant(t.imageSelector);if(e){var n={},r=e.data("extend");n.src=r||e.attr("href");var i=e.attr("width");i&&(n.width=JSON.parse(i));var o=e.attr("height");return o&&(n.height=JSON.parse(o)),n}}},{key:U,set:function(e){if(e&&e.src){var n=this.content.firstDescendant(t.imageSelector)||this.content.createSVGChild(t.imageSelector);if(n){var r=E({},V.ATTR_EVENT_STAMP,"topic-item-image");void 0!==e.width&&(r.width=e.width),void 0!==e.height&&(r.height=e.height);var i=String(e.src);i.startsWith("xap:")?(n.data("extend",i),i=this.fireEvent(V.EVENT_QUERY_ATTACHMENT,i.substr("xap:".length),"")):n.data("extend",null),(i=i.trim())?(r.href=i,n.attr(r)):n.remove()}}else{var o=this.content.firstDescendant(t.imageSelector);o&&o.remove()}}},{key:Y,get:function(){var e=this.content.firstDescendant(t.labelsSelector);if(e){var n,r=[],i=it(e.getDescandant("text"));try{for(i.s();!(n=i.n()).done;){var o=n.value;r.push(o.text)}}catch(t){i.e(t)}finally{i.f()}return r}}},{key:H,set:function(e){if(e instanceof Array&&e.length>0){var n=this.content.firstDescendant(t.labelsSelector)||this.content.createSVGChild("g");if(n){var r=E({class:Et},V.ATTR_EVENT_STAMP,"topic-labels");n.clearChildren(),n.attr(r);var i=n.createSVGChild("rect");r.class=Tt,i.attr(r),r.class="".concat(vt," ").concat(dt);var o,a=it(e);try{for(a.s();!(o=a.n()).done;){var c=o.value,s=n.createSVGChild("text");s.attr(r),s.text=c}}catch(t){a.e(t)}finally{a.f()}}}else{var l=this.content.firstDescendant(t.labelsSelector);l&&l.remove()}}},{key:B,get:function(){var e=this.content.firstDescendant(t.linkSelector);if(e)return e.data("extend")}},{key:F,set:function(e){if(e&&(e=String(e).trim())){var n=this.content.firstDescendant(t.linkSelector)||this.content.createSVGChild("use");n.data("extend",e),n.attr(E({class:bt,href:"#".concat("icon-link")},V.ATTR_EVENT_STAMP,"topic-link"))}else{var r=this.content.firstDescendant(t.linkSelector);r&&r.remove()}}},{key:X,get:function(){var e=this.content.firstDescendant(t.notesSelector);if(e)return e.data("extend")}},{key:W,set:function(e){if(e){var n=this.content.firstDescendant(t.notesSelector)||this.content.createSVGChild("use");n.data("extend",e),n.attr(E({class:St,href:"#".concat("icon-notes")},V.ATTR_EVENT_STAMP,"topic-notes"))}else{var r=this.content.firstDescendant(t.notesSelector);r&&r.remove()}}},{key:K,get:function(){var e=this.content.firstDescendant(t.markersSelector);if(e){var n,r={},i=it(e.getDescandant("use"));try{for(i.s();!(n=i.n()).done;){var o=n.value.attr("href");if(o){var a=o.split(/[#-]/),c=a[1],s=a[2],l=It["".concat(c,"$translate")];"function"==typeof l&&(s=l(s)),r[c]=s}}}catch(t){i.e(t)}finally{i.f()}return r}}},{key:Q,set:function(e){if(e){var n=this.content.firstDescendant(t.markersSelector)||this.content.createSVGChild("g");if(n){n.attr(E({class:wt},V.ATTR_EVENT_STAMP,"topic-markers")),n.clearChildren();var r=0;for(var i in e){var o=e[i],a=It["".concat(i,"$translate")];"function"==typeof a&&(o=a(o,!0)),n.createSVGChild("use").attr(E({href:"#".concat(i,"-").concat(o)},V.ATTR_EVENT_STAMP,"topic-markers")),r++}r<=0&&n.remove()}}else{var c=this.content.firstDescendant(t.markersSelector);c&&c.remove()}}},{key:"isInFocus",get:function(){return this.content&&this.content.hasClass(ht)}}],[{key:"propertyName",value:function(e){var n=At(e),r=Object.getOwnPropertyNames(t.prototype);return r&&r.indexOf(n)>=0?n:void 0}},{key:"propertyNames",value:e.mark((function n(){var r,i,o,a,c;return e.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Object.getOwnPropertyNames(t.prototype),i=it(r),e.prev=2,i.s();case 4:if((o=i.n()).done){e.next=12;break}if(a=o.value,!(c=_t(a))){e.next=10;break}return e.next=10,{name:c,fullName:a};case 10:e.next=4;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(2),i.e(e.t0);case 17:return e.prev=17,i.f(),e.finish(17);case 20:case"end":return e.stop()}}),n,null,[[2,14,17,20]])}))}]),t}();E(Ct,"imageSelector","image"),E(Ct,"titleSelector","rect.".concat(yt)),E(Ct,"linkSelector","use.".concat(bt)),E(Ct,"notesSelector","use.".concat(St)),E(Ct,"markersSelector","g.".concat(wt)),E(Ct,"labelsSelector","g.".concat(Et)),E(Ct,"focusItemSelector",".".concat(ht)),E(Ct,"underLineSelectors",[Ct.linkSelector,Ct.notesSelector,Ct.markersSelector,Ct.labelsSelector]),$=x("click","topic-item-fold-icon"),Z=x("click","topic-link"),z=x("click","topic-notes"),q=x("click","topic-item-image"),J=x("click","topic-labels"),tt=x("click","topic-labels-more"),et=x("click","topic-markers"),nt=x("click");var Lt=function(){function t(e,r,i){n(this,t);var o,a,c=this[at]={};if(v(e)){if("g"!==e.tagName||!e.hasClass(ft))throw rt.ILLEGAL_INSTANCE("_data","<g> with group class");var s=c.content=e;this.fireEvent=M.bind(s),c.childrenGroup=s.firstDescendant(t.childrenGroupSelector),c.item=new Ct(s.firstDescendant("g.".concat(ut,"#").concat(s.attr("id"))))}else if(v(i)&&i.isSVG){var l=((o=e.id)?(a="string"==typeof o?o:String(o)).startsWith("MID-")||(a="MID-"+a):a="".concat("MID-").concat(Date.now()).concat(Math.random().toString(16).substr(2,3)),a),f=c.content=i.createSVGChild("g");f.attr({id:l,class:ft}),e&&void 0!==e.direction&&f.data("direction",e.direction),this.fireEvent=M.bind(f),(c.childrenGroup=f.createSVGChild("g")).attr({id:l,class:gt}),L((c.item=new Ct(e,r,f)).content,this);var u=e.children;if(u instanceof Array)for(var h in u)this.addNewChild(u[h])}}return i(t,[{key:$,value:function(t,e,n){this.fold(String(n.getAttribute("href")).indexOf("icon-minus")>=0),_(t)}},{key:Z,value:function(t){this.fireEvent(V.EVENT_INVOKE_LINK,{topic:this,data:this.topicData("href")}),N(t)}},{key:z,value:function(t){this.fireEvent(V.EVENT_INVOKE_NOTES,{topic:this,data:this.topicData("notes")}),N(t)}},{key:q,value:function(t){this.fireEvent(V.EVENT_INVOKE_IMAGE,{topic:this,data:this.topicData("image")}),N(t)}},{key:J,value:function(t){this.fireEvent(V.EVENT_INVOKE_LABELS,{topic:this,data:this.topicData("labels")}),N(t)}},{key:tt,value:function(t){this.fireEvent(V.EVENT_INVOKE_LABELS,{topic:this,data:this.topicData("labels"),more:!0}),N(t)}},{key:et,value:function(t){this.fireEvent(V.EVENT_INVOKE_MARKERS,{topic:this,data:this.topicData("markers")}),N(t)}},{key:nt,value:function(t){this.focus(),_(t)}},{key:"direction",value:function(t){var e=Nt(this).content;return void 0===t?e.data("direction")||0:(e.data("direction",t),this)}},{key:"globalZone",value:function(t){var e=Nt(this).item;return e?e.globalZone(t):void 0}},{key:"relativeZone",value:function(t){var e=Nt(this).item;return e?e.relativeZone(t):void 0}},{key:"childrenTopics",value:e.mark((function n(){var r,i,o,a,c;return e.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=Nt(this).childrenGroup)){e.next=20;break}i=r.getChildren(t.contentSelector),o=it(i),e.prev=4,o.s();case 6:if((a=o.n()).done){e.next=12;break}return c=a.value,e.next=10,new t(c);case 10:e.next=6;break;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),o.e(e.t0);case 17:return e.prev=17,o.f(),e.finish(17);case 20:case"end":return e.stop()}}),n,this,[[4,14,17,20]])}))},{key:"topicData",value:function(t,e){var n=Nt(this).item;if(n){if(void 0===t){var r,i={},o=it(n.propertys());try{for(o.s();!(r=o.n()).done;){var a=r.value;void 0!==a.value&&null!==a.value&&(i[a.name]=a.value)}}catch(t){o.e(t)}finally{o.f()}return 1===this.level&&(i.direction=this.direction()),i}if("string"==typeof t){var c=Ct.propertyName(t);if(c){if(void 0===e)return n[c];n[c]=e,this.fireEvent(V.EVENT_REQUIRE_LAYOUT)}}else{var s=0;for(var l in t){var f=Ct.propertyName(l);if(f){var u=t[l];n[f]=u,s++}}0!==s&&this.fireEvent(V.EVENT_REQUIRE_LAYOUT)}}return this}},{key:"isSame",value:function(e){return e instanceof t&&Nt(this).content.isSame(Nt(e).content)}},{key:"translate",value:function(t,e){var n=Nt(this).content;return n&&n.attr("transform","translate(".concat(t,", ").concat(e,")")),this}},{key:"fold",value:function(t){var e=Nt(this).childrenGroup;return this.focus(),void 0===t?e&&e.style("display","none"):(e&&e.style("display",t?"none":"unset"),this.fireEvent(V.EVENT_REQUIRE_LAYOUT),this)}},{key:"focus",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=Nt(this).item;if(e){var n=e.focus(t);void 0!==n&&this.fireEvent(V.EVENT_FOCUS_CHANGE,n?this:null)}return this}},{key:"addNewChild",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e?e.title?e:Object.assign({title:t.DefaultTitle},e):{title:t.DefaultTitle},i=new t(r,this.level+1,Nt(this).childrenGroup);return n&&this.fireEvent(V.EVENT_REQUIRE_LAYOUT),i}},{key:"remove",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.level>0){var n=Nt(this).content;if(n){var r=n.parent(t.childrenGroupSelector),i=r.firstDescendant("path#".concat(this.id));i&&i.remove(),n.remove(),e&&M.call(r,V.EVENT_REQUIRE_LAYOUT)}}return this}},{key:"clearChildren",value:function(){var e,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=it(this.childrenTopics());try{for(r.s();!(e=r.n()).done;){var i=e.value;i instanceof t&&i.remove()}}catch(t){r.e(t)}finally{r.f()}return n&&this.fireEvent(V.EVENT_REQUIRE_LAYOUT),this}},{key:"insertTo",value:function(e,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e instanceof t){var i=Nt(e).childrenGroup,o=Nt(this),a=o.content,c=o.item;i&&a&&(this.remove(),n?a.insertToTop(i):a.appendTo(i),c.level(e.level+1),r&&this.fireEvent(V.EVENT_REQUIRE_LAYOUT))}return this}},{key:"insertNextTo",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e instanceof t){var r=e.content,i=Nt(this),o=i.content,a=i.item;this.remove(),o.insertAfter(r),a.level(e.level),n&&this.fireEvent(V.EVENT_REQUIRE_LAYOUT)}}},{key:"insertAsBrother",value:function(e,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e instanceof t){var i=Nt(e).content,o=Nt(this),a=o.content,c=o.item;i&&a&&(this.remove(),n?a.insertBefore(i):a.insertAfter(i),c.level(e.level),r&&this.fireEvent(V.EVENT_REQUIRE_LAYOUT))}return this}},{key:"layout",value:function(t,e,n){if(!(t instanceof Mt))throw rt.INVALID_PARAM("_mindSVG");var r=Nt(this),i=r.content,o=r.item,a=r.childrenGroup;if(!(i&&o instanceof Ct&&a))throw rt.ILLEGAL_INSTANCE("Topic");o.layout(t,n);var c=o.level(),s=void 0===e?"none"===a.node.style.display:e>0&&e<=c;if(o.fold(this.hasChild&&c>0?s:null),s)a.node.style.display="none";else{a.node.style.display="unset";var l,f=o.connectPointer(0),u=t.config(),h=u.topicMarginX,d=0-f.x-h,v=u.topicMarginY,y={},p=0,g=0,m=n,k=it(this.childrenTopics());try{for(k.s();!(l=k.n()).done;){var E=l.value;if(E.visible){void 0===n&&(m=E.direction()),E.layout(t,e,m);var T=E.originCorner;if(1===m){var b=T.y<0?g-T.y:g,S=E.titleZone;g+=E.size.height+v,y[E.id]={obj:E,x:d-S.width,y:b,lineY:b+S.height/2,left:!0}}else{var w=T.y<0?p-T.y:p;p+=E.size.height+v,y[E.id]={obj:E,x:h,y:w,lineY:w+E.titleZone.height/2,left:!1}}}}}catch(t){k.e(t)}finally{k.f()}p>g?(g=(p-g)/2,p=0):(p=(g-p)/2,g=0);var x=u.lineBezierCtrlSize,A=a.height>>1,_="M0 ".concat(A,"C").concat(x," ").concat(A," ").concat(h-x," "),N="M".concat(0-f.x," ").concat(A,"C").concat(0-f.x-x," ").concat(A," ").concat(d+x," ");for(var I in y){var C=y[I],L=C.obj,M=C.x,V=C.y,O=C.lineY,D=C.left,R=D?g:p;L.translate(M,V+R),O+=R,(a.firstDescendant("path#".concat(I))||a.createSVGChild("path")).attr({id:I,d:D?"".concat(N).concat(O," ").concat(d," ").concat(O):"".concat(_).concat(O," ").concat(h," ").concat(O),class:mt})}a.attr("transform","translate(".concat(f.x,", ").concat(0-A+f.y,")"))}}},{key:"toString",value:function(){return JSON.stringify(this.topicData())}},{key:"content",get:function(){return Nt(this).content}},{key:"parent",get:function(){if(this.level>0){var e=Nt(this).content.parent(t.contentSelector);return e?new t(e):void 0}}},{key:"size",get:function(){var t=Nt(this).content,e=0,n=0;if(t){var r=t.rect;e=r.width,n=r.height}return{width:e,height:n}}},{key:"originCorner",get:function(){var t,e,n=Nt(this).content;if(n){var r=n.rect;t=r.x,e=r.y}else t=0,e=0;return{x:t,y:e}}},{key:"id",get:function(){var t=Nt(this).content;return t&&t.attr("id")||""}},{key:"titleZone",get:function(){var t=Nt(this).item;return t?t.titleZone:{x:0,y:0,width:0,height:0}}},{key:"itemZone",get:function(){var t=Nt(this).item;return t&&t.content?t.content.globalRect:{x:0,y:0,width:0,height:0}}},{key:"totalZone",get:function(){var t=Nt(this).content;return t?t.globalRect:{x:0,y:0,width:0,height:0}}},{key:"hasChild",get:function(){var e=Nt(this).childrenGroup;return e&&void 0!==e.firstDescendant(t.contentSelector)}},{key:"level",get:function(){return Nt(this).item.level()}},{key:"data",get:function(){var t=this.topicData();if(t){t.id=this.id;var e,n=t.children=[],r=it(this.childrenTopics());try{for(r.s();!(e=r.n()).done;){var i=e.value;n.push(i.data)}}catch(t){r.e(t)}finally{r.f()}}return t}},{key:"isInFocus",get:function(){var t=Nt(this);return t&&t.isInFocus}},{key:"visible",get:function(){return"none"!==Nt(this).content.style("display")},set:function(t){var e=Nt(this).content;if("none"!==e.style("display")!==(t=t||!1)){var n=t?"unset":"none";e.style("display",n);var r=e.root.firstDescendant("path#".concat(e.attr("id")));r&&(r.node.style.display=n),!t&&this.isInFocus&&this.focus(!1),t&&this.fireEvent(V.EVENT_REQUIRE_LAYOUT)}}},{key:"nextSibling",get:function(){for(var e=this.content;e=h().attach(e.node.nextSibling);)if(e.matches(t.contentSelector))return new t(e)}},{key:"previousSibling",get:function(){for(var e=this.content;e=h().attach(e.node.previousSibling);)if(e.matches(t.contentSelector))return new t(e)}},{key:"firstDescendant",get:function(){var e=this.content.firstDescendant(t.contentSelector);return e?new t(e):void 0}}]),t}();E(Lt,"DefaultTitle","默认主题"),E(Lt,"contentSelector","g.".concat(ft)),E(Lt,"childrenGroupSelector","g.".concat(gt));var Mt=function(){function t(e){n(this,t);var r=this[at]={configs:{},rootTopic:void 0,container:h("div")},i=h().attach(e)||h().attach("body"),o=r.container;o.attr({class:"".concat(ct," ").concat(st),tabindex:"1"}),o.appendTo(i),this.fireEvent=M.bind(o),r.timerID=setInterval(t.checkState,100,this);var a=o.firstDescendant("svg")||o.createSVGChild("svg");r.svg=a,r.containerWidth=o.width,r.containerHeight=o.height,r.offsetX=0,r.offsetY=0,r.scaleRate=1,a.attr({viewBox:"".concat(r.offsetX," ").concat(r.offsetY," ").concat(r.containerWidth," ").concat(r.containerHeight),class:lt,width:"100%",height:"100%"}),r.content=void 0,Object.assign(r.configs,xt),new It(a),L(o,this)}return i(t,[{key:x(V.EVENT_REQUIRE_LAYOUT),value:function(){this.fold()}},{key:x("click"),value:function(t){this.clearFocus(),_(t)}},{key:"release",value:function(){var t=Nt(this);t.timerID&&(clearInterval(t.timerID),t.timerID=void 0)}},{key:"on",value:function(t,e,n){var r=Nt(this).container;return r&&r.on(t,e,n),this}},{key:"off",value:function(e,n,r){var i=Nt(this).container;return i&&(i.off(e,n,r),A(t,e)&&!n&&L(i,this,[e])),this}},{key:"clear",value:function(){var t=Nt(this);return t.content&&(t.content.remove(),t.content=void 0,t.rootTopic=void 0),this}},{key:"show",value:function(t){var e=Nt(this);if(e.svg){this.clear();var n=e.content=e.svg.createSVGChild("g");if(n.attr("class",ct),t)(e.rootTopic=new Lt(t,0,n)).layout(this,0),this.toCenter()}return this}},{key:"setTheme",value:function(t){var e=Nt(this),n=e.content,r=e.container,i=t?"".concat(ct," ").concat(t):ct;return n&&n.attr("class",i),r&&r.attr("class","".concat(i," ").concat(st)),this}},{key:"config",value:function(t,e){if(void 0===t)return Object.assign({},Nt(this).configs);if("string"==typeof t){var n=Nt(this,"configs");if(void 0===e)return n[t];n[t]=null===e?xt[t]:e}else for(var r in t)this.config(String(r),t[r]);return this}},{key:"toCenter",value:function(t){var e=Nt(this);if(e.svg&&this.content){var n=e.containerWidth/e.scaleRate,r=e.containerHeight/e.scaleRate,i=this.content.rect;if(t instanceof Lt){var o=t.titleZone;e.offsetX=parseInt(o.x-(n-o.width)/2),e.offsetY=parseInt(o.y-(r-o.height)/2)}else{var a=e.svg.firstDescendant("g.".concat(pt,"0")),c=a?a.rect:{width:0,height:0};if(i.width<n)e.offsetX=i.x-(n-i.width)/2;else{var s=parseInt(0-(n-c.width)/2);i.x>s?e.offsetX=i.x:n+s>i.width+i.x?e.offsetX=i.width+i.x-n:e.offsetX=s}if(i.height<r)e.offsetY=i.y-(r-i.height)/2;else{var l=parseInt(0-(r-c.height)/2);i.y>l?e.offsetY=i.y:r+l>i.height+i.y?e.offsetY=i.height+i.y-r:e.offsetY=l}}e.svg.attr("viewBox","".concat(e.offsetX," ").concat(e.offsetY," ").concat(n," ").concat(r))}return this}},{key:"move",value:function(t,e){var n=Nt(this);if(n.svg){var r=n.containerWidth/n.scaleRate,i=n.containerHeight/n.scaleRate;n.offsetX=t,n.offsetY=e,n.svg.attr("viewBox","".concat(n.offsetX," ").concat(n.offsetY," ").concat(r," ").concat(i))}return this}},{key:"moveBy",value:function(t,e){var n=Nt(this);if(n.svg){var r=n.containerWidth/n.scaleRate,i=n.containerHeight/n.scaleRate;t=parseInt(t),e=parseInt(e),isNaN(t)||(n.offsetX+=t),isNaN(e)||(n.offsetY+=e),n.svg.attr("viewBox","".concat(n.offsetX," ").concat(n.offsetY," ").concat(r," ").concat(i))}return this}},{key:"scaleBy",value:function(t){var e=Nt(this);return e.svg&&(t=parseFloat(t),isNaN(t)||this.scale(e.scaleRate*t)),this}},{key:"scale",value:function(t){var e=Nt(this);if(e.svg&&(t=parseFloat(t),!isNaN(t))){var n=!isNaN(e.configs.maxScale)&&t>e.configs.maxScale;if(!(n=n||!isNaN(e.configs.minScale)&&t<e.configs.minScale)){e.scaleRate=t;var r=e.containerWidth/t,i=e.containerHeight/t;e.svg.attr("viewBox","".concat(e.offsetX," ").concat(e.offsetY," ").concat(r," ").concat(i))}}return this}},{key:"fold",value:function(t){var e=Nt(this).rootTopic;return e&&(t>0&&this.clearFocus(),e.layout(this,t)),this}},{key:"clearFocus",value:function(){var t=Nt(this).svg;if(t){var e=t.firstDescendant(Ct.focusItemSelector);e&&(e.removeClass(ht),M.call(e,V.EVENT_FOCUS_CHANGE,null))}return this}},{key:"getTopicByID",value:function(t){var e=Nt(this).svg;if(e&&t){var n=e.firstDescendant("".concat(Lt.contentSelector,"[id=").concat(t,"]"));return n?new Lt(n):void 0}}},{key:"getTopicIterator",value:e.mark((function t(){var n,r,i,o,a;return e.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=Nt(this).svg)){t.next=21;break}r=n.getDescandant(Lt.contentSelector),i=it(r),t.prev=4,i.s();case 6:if((o=i.n()).done){t.next=13;break}if(!(a=o.value)){t.next=11;break}return t.next=11,new Lt(a);case 11:t.next=6;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(4),i.e(t.t0);case 18:return t.prev=18,i.f(),t.finish(18);case 21:case"end":return t.stop()}}),t,this,[[4,15,18,21]])}))},{key:"getDefs",value:e.mark((function t(){var n,r,i,o,a,c,s,l,f,u,h,d;return e.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=Nt(this).svg)){t.next=39;break}r=it(n.getDescandant("defs")),t.prev=3,r.s();case 5:if((i=r.n()).done){t.next=31;break}o=i.value,a=it(o.getChildren()),t.prev=8,a.s();case 10:if((c=a.n()).done){t.next=21;break}if(s=c.value,!(l=s.attr("id"))){t.next=19;break}return f=l.split("-"),u=f[0],h=f[1],"function"==typeof(d=It["".concat(u,"$translate")])&&(h=d(h)),t.next=19,{type:u,value:h,node:s.node};case 19:t.next=10;break;case 21:t.next=26;break;case 23:t.prev=23,t.t0=t.catch(8),a.e(t.t0);case 26:return t.prev=26,a.f(),t.finish(26);case 29:t.next=5;break;case 31:t.next=36;break;case 33:t.prev=33,t.t1=t.catch(3),r.e(t.t1);case 36:return t.prev=36,r.f(),t.finish(36);case 39:case"end":return t.stop()}}),t,this,[[3,33,36,39],[8,23,26,29]])}))},{key:"container",get:function(){return Nt(this).container}},{key:"svg",get:function(){return Nt(this).svg}},{key:"content",get:function(){return Nt(this).content}},{key:"rootTopic",get:function(){return Nt(this).rootTopic}},{key:"zone",get:function(){var t=Nt(this);return{x:t.offsetX,y:t.offsetY,width:t.containerWidth/t.scaleRate,height:t.containerHeight/t.scaleRate}}},{key:"data",get:function(){var t=Nt(this).rootTopic;return t instanceof Lt?t.data:{}}},{key:"totalSize",get:function(){var t=Nt(this).content,e=0,n=0;if(t){var r=t.rect;e=r.width,n=r.height}return{width:e,height:n}}},{key:"scaleRate",get:function(){var t=Nt(this);return t?t.scaleRate:1}},{key:"offset",get:function(){var t=Nt(this);return t?{x:t.offsetX,y:t.offsetY}:{x:0,y:0}}},{key:"focusTopic",get:function(){var t=Nt(this).svg;if(t){var e=t.firstDescendant(Ct.focusItemSelector);if(e)return(e=e.parent(Lt.contentSelector))?new Lt(e):void 0}}}],[{key:"checkState",value:function(t){var e=Nt(t);if(e.svg){var n=e.container.width,r=e.container.height;if(n!==e.containerWidth||r!==e.containerHeight){e.containerWidth=n,e.containerHeight=r,n/=e.scaleRate,r/=e.scaleRate,e.svg.attr("viewBox","".concat(e.offsetX," ").concat(e.offsetY," ").concat(n," ").concat(r));var i=document.createEvent("UIEvents");i.initUIEvent("resize",!1,!0,window||global,this),e.container.dispatchEvent(i)}}}}]),t}();m({MindSVG:Mt,Topic:Lt,TopicItem:Ct,Defs:It,DEFAULT_CONFIGS:xt});var Vt,Ot,Dt={ATTACHMENT_LINK_PREFIX:"xap:",STAMP_TOPIC_TITLE:"topic-item-title",STAMP_FOLD_ICON:"topic-item-fold-icon",STAMP_TOPIC_IMAGE:"topic-item-image",STAMP_TOPIC_LABEL_MORE:"topic-labels-more",STAMP_TOPIC_LABELS:"topic-labels",STAMP_TOPIC_LINK:"topic-link",STAMP_TOPIC_MARKERS:"topic-markers",STAMP_TOPIC_NOTES:"topic-notes",CONNECT_DIRECTION_LEFT:1,CONNECT_DIRECTION_RIGHT:0,ID_ICON_MINUS:"icon-minus",ID_ICON_PLUS:"icon-plus",ID_ICON_MORE:"icon-more",ID_ICON_LINK:"icon-link",ID_ICON_NOTES:"icon-notes"};function Rt(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Gt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Gt(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function Gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Pt=V,jt=Symbol("mind.svg.drag.event.log");function Ut(t){return t[jt]||(t[jt]={})}function Yt(t,e,n,r){var i=t.container,o=i.firstDescendant("div.".concat("mind-topic-drag-box"));o||(o=i.createChild("div").attr("class","mind-topic-drag-box"));var a=e.dragingTopic;if(a&&(o.text=a.topicData("title")),void 0!==n&&void 0!==r){var c=i.translatePoint(n,r),s=c.x,l=c.y;o.attr("style","".concat("position: absolute;"," left:").concat(s+3,"px; top:").concat(l-o.height/2-i.top,"px;"))}return o}function Ht(t,e,n){var r,i=t.svg,o=i.firstDescendant("path.".concat("mind-topic-drag-line"))||i.createSVGChild("path").attr("class","mind-topic-drag-line");if(n&&(r=n.hoverTopic)){var a=r.titleZone,c=e.globalRect,s=i.translatePoint(c.x+c.width/2,c.y+c.height/2),l=s.x,f=s.y;o.attr({d:"M".concat(a.x+a.width/2," ").concat(a.y+a.height/2,"L").concat(l," ").concat(f),style:"display: unset;"})}return o}function Bt(t){Ut(t).hoverTimer=void 0,t.fireEvent("mindevent.drag.potential.hover",{topic:t})}g("Topic",(E(Vt={},x("mousedown",Dt.STAMP_TOPIC_TITLE),(function(t){var e=Ut(this);1===(t.which||t.button+1)&&this.level>0&&(e.waitDrag=this.fireEvent("mindevent.query.draggable",this,!0),_(t))})),E(Vt,x("mousemove",Dt.STAMP_TOPIC_TITLE),(function(t){var e=Ut(this);1===(t.which||t.button+1)&&e.waitDrag&&(e.waitDrag=void 0,e.hoverTimer&&clearTimeout(e.hoverTimer),e.hoverTimer=void 0,this.fireEvent("mindevent.drag.start",{topic:this,x:t.clientX,y:t.clientY})),N(t)})),E(Vt,x("mouseover",Dt.STAMP_TOPIC_TITLE),(function(t){var e=Ut(this);1===(t.which||t.button+1)&&(e.hoverTimer&&clearTimeout(e.hoverTimer),e.hoverTimer=setTimeout(Bt,900,this)),N(t)})),E(Vt,x("mouseout",Dt.STAMP_TOPIC_TITLE),(function(t){var e=Ut(this);e.waitDrag=void 0,e.hoverTimer&&clearTimeout(e.hoverTimer),e.hoverTimer=void 0,N(t)})),E(Vt,x("mouseup",Dt.STAMP_TOPIC_TITLE),(function(t){var e=Ut(this);e.waitDrag=void 0,e.hoverTimer&&clearTimeout(e.hoverTimer),e.hoverTimer=void 0,N(t)})),Vt)),g("MindSVG",(E(Ot={},x("mindevent.query.draggable"),(function(t){t.detail.result=this.config("draggable")})),E(Ot,x("mindevent.drag.start"),(function(t){var e=Ut(this),n=t.detail.value,r=n.topic;if(e.dragingTopic=r,r){var i=Yt(this,e,n.x,n.y);e.hoverTopic=r.parent,Ht(this,i,e),r.visible=!1}_(t)})),E(Ot,x("mindevent.drag.potential.hover"),(function(t){var e=Ut(this),n=t.detail.value.topic;e.dragingTopic&&(e.hoverTopic=n,Ht(this,Yt(this,e),e));_(t)})),E(Ot,x("mousemove"),(function(t){var e=Ut(this);1===(t.which||t.button+1)&&e.dragingTopic&&(Ht(this,Yt(this,e,t.clientX,t.clientY),e),_(t))})),E(Ot,x("mouseup"),(function(t){var e=Ut(this);if(1===(t.which||t.button+1)&&e.dragingTopic){var n=Yt(this,e);n.attr("style","display: none;"),Ht(this,n).attr("style","display:none;");var r=e.dragingTopic,i=e.hoverTopic,o=r.parent,a=r.previousSibling,c=0===o.level?r.direction():null,s=this.fireEvent(Pt.EVENT_CONFIRM_DRAG,{dragingTopic:r,originParent:o,newParent:i},!0),l=void 0;if(i&&s){var f,u=t.clientY,h=!1;0===i.level?t.clientX<i.itemZone.x?(f=Dt.CONNECT_DIRECTION_LEFT,h=!0):f=Dt.CONNECT_DIRECTION_RIGHT:f=null,r.direction(f);var d,v=void 0,y=Rt(i.childrenTopics());try{for(y.s();!(d=y.n()).done;){var p=d.value;if(!(r.isSame(p)||h&&p.direction()!==Dt.CONNECT_DIRECTION_LEFT)){if(u<p.itemZone.y)break;v=p}}}catch(t){y.e(t)}finally{y.f()}v?e.dragingTopic.insertNextTo(v,!1):e.dragingTopic.insertTo(i,!0,!1),l={dragingTopic:r,originParent:o,originSibling:a,originDirection:c,newParent:i,newSibling:v,newDirection:f}}r.focus(!0),e.dragingTopic.visible=!0,e.dragingTopic=void 0,_(t),this.fireEvent(Pt.EVENT_END_DRAG,l)}})),Ot)),p("DEFAULT_CONFIGS",{draggable:!1});var Ft=["start","oct","quarter","3oct","half","5oct","3quar","7oct","done","unknown"];p("Defs",{$std$defs$declare:function(t){t.defs&&t.defs.node.insertAdjacentHTML("beforeend",'\n <path id="'.concat(Dt.ID_ICON_PLUS,'" fill="#fff" fill-opacity="0.8" stroke="#000" stroke-width="1" \n transform="translate(-6, -4), scale(1.25, 1.25)" \n d="M1 4A3 3 0 1 0 8 4A3 3 0 1 0 1 4M2.5 4L6.5 4M4.5 2L4.5 6" />\n <path id="').concat(Dt.ID_ICON_MINUS,'" fill="#fff" fill-opacity="0.8" stroke="#000" stroke-width="1" \n transform="translate(-6, -4), scale(1.25, 1.25)" \n d="M1 4A3 3 0 1 0 8 4A3 3 0 1 0 1 4M2.5 4L6.5 4" />\n <path id="').concat(Dt.ID_ICON_MORE,'" fill="#fff" fill-opacity="0.8" stroke="#000" stroke-width="1" stroke-opacity="0.6"\n d="M4 1H7Q10 1 10 4V7Q10 10 7 10H4Q1 10 1 7V4 Q1 1 4 1M4 3L7 5.5L4 8" />\n <path id="').concat(Dt.ID_ICON_NOTES,'" fill="#ffd" fill-opacity="0.8" stroke="#000" stroke-width="1" stroke-opacity="0.6"\n d="M3 1H13L18 6V20H3V1M13 1V6H18M6 4H10M6 7H10M6 10H15M6 13H15M6 16H13" />\n <g id="').concat(Dt.ID_ICON_LINK,'">\n <rect width="20" height="20" rx="3" ry="3" fill="#eee" fill-opacity="0.3" stroke-width="0" />\n <path fill="none" fill-opacity="0.8" stroke="#000" stroke-width="1.5" stroke-opacity="0.6"\n d="M9 7L11 5A2 2 0 0 1 15 9L13 11M7 9L5 11A2 2 0 0 0 9 15L11 13M7 13L13 7" />\n </g>\n <path id="priority-1" fill="#f00" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M8 7L10.5 6V16" />\n <path id="priority-2" fill="#f00" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M7 8C10.5 1 20 8 7 14M6 14H16" />\n <path id="priority-3" fill="#f0f" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M7 7C10.5 1 20 8 10 10C21 10 10.5 21 6 12" />\n <path id="priority-4" fill="#f0f" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M12 4Q10 10 6 13M5 13H15M13 8L11 16" />\n <path id="priority-5" fill="#06f" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M9 4Q9 7 8 9M7 9C18 5 16 20 6 14M9 5H14" />\n <path id="priority-6" fill="#06f" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M7 9C13 7 16 13 10 15C4 15 4 9 13 4" />\n <path id="priority-7" fill="#093" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M7 8V6Q11 7 13 6.5Q10 12 9 16" />\n <path id="priority-8" fill="#093" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M10 9C6 8 7 3 12 4C15 5 15 10 10 9C16 10 16 16.5 10 16C4 15 4 9 10 9" />\n <path id="priority-9" fill="#993" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M15 10C6 16 5 3.5 12 4.5C18 6 16 17 7 16" />\n <path id="task-0" fill="#fff" fill-opacity="0.8" stroke="#093" stroke-width="1" stroke-opacity="0.8"\n d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M8 14V5L15 10L8 15V6" />\n <g id="task-1">\n <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 1 0 16.5 4.5L10.5 10.5" />\n </g>\n <g id="task-2">\n <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 1 0 19 10.5L10.5 10.5" />\n </g>\n <g id="task-3">\n <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 1 0 16.5 16.5L10.5 10.5" />\n </g>\n <g id="task-4">\n <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 0 0 10.5 19L10.5 10.5" />\n </g>\n <g id="task-5">\n <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 0 0 4.5 16.5L10.5 10.5" />\n </g>\n <g id="task-6">\n <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 0 0 2 10.5L10.5 10.5" />\n </g>\n <g id="task-7">\n <circle cx="10.5" cy="10.5" r="10" stroke="none" fill="#093" fill-opacity="0.8" />\n <path stroke="none" fill="#fff" fill-opacity="0.8" d="M10.5 10.5V2A8.5 8.5 180 0 0 4.5 4.5L10.5 10.5" />\n </g>\n <path id="task-8" fill="#093" fill-opacity="0.8" stroke="#fff" stroke-width="2" stroke-opacity="0.8"\n d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M15 6L10 13L6 9" />\n <path id="task-9" fill="#fff" fill-opacity="0.8" stroke="#093" stroke-width="1" stroke-opacity="0.8"\n d="M1 10A9 9 0 1 1 20 10A9 9 0 1 1 1 10M7 8A3.5 3.5 0 1 1 10.5 10.5V13M10.5 14V16M9.5 15H11.5" />\n '))},priority$translate:function(t){return t=parseInt(t),t=isNaN(t)||t<1?1:t>9?9:t},task$translate:function(t,e){if(e){var n=Ft.indexOf(t);return n>=0?n:9}var r=parseInt(t);return r>=0&&r<=9?Ft[r]:Ft[9]}});var Xt=Symbol("mind.attachment.url"),Wt=Symbol("mind.attachment.data"),Kt=Symbol("mind.attachment.list"),Qt=function(){function t(e){n(this,t),this[Wt]=e,this[Xt]=e instanceof Blob?URL.createObjectURL(e):void 0}return i(t,[{key:"release",value:function(){this[Xt]&&(URL.revokeObjectURL(this[Xt]),this[Xt]=void 0)}},{key:"toString",value:function(){return this[Wt]instanceof Blob?this[Xt]:String(this[Wt])}},{key:"data",get:function(){return this[Wt]}}]),t}(),$t=function(){function t(){n(this,t),this[Kt]={}}return i(t,[{key:"item",value:function(t,e){if(void 0===e)return this[Kt][t];if(null===e){var n=this[Kt][t];return n&&n.release(),delete this[Kt][t],this}t||(t="".concat(Date.now().toString(16),"-").concat(Math.random().toString(16).substr(2,3)));var r=this[Kt][t];return r&&r.release(),this[Kt][t]=new Qt(e),{name:t,value:this[Kt][t]}}},{key:"items",value:e.mark((function t(){var n,r;return e.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this[Kt],t.t0=e.keys(n);case 2:if((t.t1=t.t0()).done){t.next=8;break}return r=t.t1.value,t.next=6,{name:r,value:n[r]};case 6:t.next=2;break;case 8:case"end":return t.stop()}}),t,this)}))},{key:"clear",value:function(){var t=this[Kt];for(var e in t)t[e].release();this[Kt]={}}}]),t}(),Zt=V,zt=O,qt=k;return t.AttachmentCollection=$t,t.Constants=Dt,t.ENode=h,t.ENodeClass=u,t.ERROR=rt,t.EVENT=Zt,t.Event=zt,t.Extend=qt,t.MindSVG=Mt,t.NS=c,t.SVG=d,t.isENode=v,t.isNode=l,t.unused=function(){},t}({});
//# sourceMappingURL=mind.svg.iife.min.js.map