1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.f6=e():t.f6=e()}(this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=204)}({0:function(t,e,n){"use strict";n.d(e,"e",(function(){return x})),n.d(e,"x",(function(){return w})),n.d(e,"l",(function(){return S})),n.d(e,"p",(function(){return g})),n.d(e,"q",(function(){return v})),n.d(e,"s",(function(){return O})),n.d(e,"u",(function(){return C})),n.d(e,"w",(function(){return P})),n.d(e,"f",(function(){return u})),n.d(e,"g",(function(){return j})),n.d(e,"i",(function(){return a})),n.d(e,"j",(function(){return s})),n.d(e,"k",(function(){return M})),n.d(e,"m",(function(){return h})),n.d(e,"n",(function(){return p})),n.d(e,"o",(function(){return m})),n.d(e,"a",(function(){return N})),n.d(e,"b",(function(){return _})),n.d(e,"c",(function(){return l})),n.d(e,"h",(function(){return L})),n.d(e,"r",(function(){return I})),n.d(e,"d",(function(){return D})),n.d(e,"v",(function(){return F})),n.d(e,"t",(function(){return X}));var r=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},i={}.toString,o=function(t,e){return i.call(t)==="[object "+e+"]"},a=function(t){return o(t,"Function")},s=function(t){return null==t},u=function(t){return Array.isArray?Array.isArray(t):o(t,"Array")};function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var h=function(t){var e=c(t);return null!==t&&"object"===e||"function"===e};var l=function(t,e){if(t)if(u(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(h(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break};Object.keys;function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var d=function(t){return"object"===f(t)&&null!==t},p=function(t){if(!d(t)||!o(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var g=function(t){if(u(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},v=function(t){if(u(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},y=Array.prototype,m=(y.splice,y.indexOf,Array.prototype.splice,function(t){return o(t,"String")});var b=Object.prototype.hasOwnProperty;var x=function(t,e){if(!e||!u(t))return{};for(var n,r={},i=a(e)?e:function(t){return t[e]},o=0;o<t.length;o++){var s=t[o];n=i(s),b.call(r,n)?r[n].push(s):r[n]=[s]}return r};var w=function(t,e){if(t["_wrap_"+e])return t["_wrap_"+e];var n=function(n){t[e](n)};return t["_wrap_"+e]=n,n};var M=function(t){return o(t,"Number")};Number.isInteger&&Number.isInteger;function S(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}var O=function(t,e){return(t%e+e)%e},k=(Math.PI,parseInt,Math.PI/180),C=function(t){return k*t},E=(Object.values,function(t){return s(t)?"":t.toString()});var P=function(t){var e=E(t);return e.charAt(0).toUpperCase()+e.substring(1)},j=function(t){return o(t,"Boolean")};Object.prototype;function A(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function I(t,e,n,r){return e&&A(t,e),n&&A(t,n),r&&A(t,r),t}function T(t){return(T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var N=function t(e){if("object"!==T(e)||null===e)return e;var n;if(u(e)){n=[];for(var r=0,i=e.length;r<i;r++)"object"===T(e[r])&&null!=e[r]?n[r]=t(e[r]):n[r]=e[r]}else for(var o in n={},e)"object"===T(e[o])&&null!=e[o]?n[o]=t(e[o]):n[o]=e[o];return n};function B(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&p(o)?(p(t[i])||(t[i]={}),n<r?B(t[i],o,n+1,r):t[i]=e[i]):u(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var _=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)B(t,e[r]);return t};Object.prototype.hasOwnProperty;var L=function t(e,n){if(e===n)return!0;if(!e||!n)return!1;if(m(e)||m(n))return!1;if(r(e)||r(n)){if(e.length!==n.length)return!1;for(var i=!0,o=0;o<e.length&&(i=t(e[o],n[o]));o++);return i}if(d(e)||d(n)){var a=Object.keys(e),s=Object.keys(n);if(a.length!==s.length)return!1;for(i=!0,o=0;o<a.length&&(i=t(e[a[o]],n[a[o]]));o++);return i}return!1},D=function(t,e,n){for(var r=0,i=m(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},R=(Object.prototype.hasOwnProperty,{}),F=function(t){return R[t=t||"g"]?R[t]+=1:R[t]=1,t+R[t]},X=function(){};!function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}()},1:function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return u})),n.d(e,"g",(function(){return c})),n.d(e,"f",(function(){return h}));
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function u(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;function c(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function h(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||e)}Object.create},10:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||r(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),i(n(11),e),i(n(12),e),i(n(13),e),i(n(14),e),i(n(15),e),i(n(16),e)},103:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assembleFont=e.getTextWidth=e.getLineSpaceing=e.getTextHeight=void 0;var r=n(205),i=n(206);function o(t,e){return e?e-t:.14*t}e.getTextHeight=function(t,e,n){var i=1;return r.isString(t)&&(i=t.split("\n").length),i>1?e*i+o(e,n)*(i-1):e},e.getLineSpaceing=o,e.getTextWidth=function(t,e){var n=i.getOffScreenContext(),o=0;if(r.isNil(t)||""===t)return o;if(n.save(),n.font=e,r.isString(t)&&t.includes("\n")){var a=t.split("\n");r.each(a,(function(t){var e=n.measureText(t).width;o<e&&(o=e)}))}else o=n.measureText(t).width;return n.restore(),o},e.assembleFont=function(t){var e=t.fontSize,n=t.fontFamily,r=t.fontWeight;return[t.fontStyle,t.fontVariant,r,e+"px",n].join(" ").trim()}},105:function(t,e){},106:function(t,e){},107:function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],h=!1,l=-1;function f(){h&&u&&(h=!1,u.length?c=u.concat(c):l=-1,c.length&&d())}function d(){if(!h){var t=s(f);h=!0;for(var e=c.length;e;){for(u=c,c=[];++l<e;)u&&u[l].run();l=-1,e=c.length}u=null,h=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||h||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},108:function(t,e,n){"use strict";var r=n(1);!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Object(r.c)(e,t),e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=this.getChildren(),r=0;r<n.length;r++){var i=n[r];e.add(i.clone())}return e}}(n(80).a)},109:function(t,e,n){"use strict";var r=n(1),i=n(81),o=n(20);!function(t){function e(e){return t.call(this,e)||this}Object(r.c)(e,t),e.prototype._isInBBox=function(t,e){var n=this.getBBox();return n.minX<=t&&n.maxX>=t&&n.minY<=e&&n.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,r=t.minY,i=t.maxX,a=t.maxY;if(e){var s=Object(o.c)(e,[t.minX,t.minY]),u=Object(o.c)(e,[t.maxX,t.minY]),c=Object(o.c)(e,[t.minX,t.maxY]),h=Object(o.c)(e,[t.maxX,t.maxY]);n=Math.min(s[0],u[0],c[0],h[0]),i=Math.max(s[0],u[0],c[0],h[0]),r=Math.min(s[1],u[1],c[1],h[1]),a=Math.max(s[1],u[1],c[1],h[1])}var l=this.attrs;if(l.shadowColor){var f=l.shadowBlur,d=void 0===f?0:f,p=l.shadowOffsetX,g=void 0===p?0:p,v=l.shadowOffsetY,y=void 0===v?0:v,m=n-d+g,b=i+d+g,x=r-d+y,w=a+d+y;n=Math.min(n,m),i=Math.max(i,b),r=Math.min(r,x),a=Math.max(a,w)}return{x:n,y:r,minX:n,minY:r,maxX:i,maxY:a,width:i-n,height:a-r}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),r=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(n&&n.isHit(o,a))return!0;if(r&&r.isHit(o,a))return!0}return!1}}(i.a)},11:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.camelize=e.isString=void 0;e.isString=function(t){return"string"==typeof t};var r,i,o=/-(\w)/g;e.camelize=(r=function(t){return t.replace(o,(function(t,e){return e?e.toUpperCase():""}))},i=Object.create(null),function(t){return i[t]||(i[t]=r(t))})},110:function(t,e,n){var r=n(212),i={};for(var o in r)r.hasOwnProperty(o)&&(i[r[o]]=o);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var u=a[s].channels,c=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:u}),Object.defineProperty(a[s],"labels",{value:c})}a.rgb.hsl=function(t){var e,n,r=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),u=s-a;return s===a?e=0:r===s?e=(i-o)/u:i===s?e=2+(o-r)/u:o===s&&(e=4+(r-i)/u),(e=Math.min(60*e,360))<0&&(e+=360),n=(a+s)/2,[e,100*(s===a?0:n<=.5?u/(s+a):u/(2-s-a)),100*n]},a.rgb.hsv=function(t){var e,n,r,i,o,a=t[0]/255,s=t[1]/255,u=t[2]/255,c=Math.max(a,s,u),h=c-Math.min(a,s,u),l=function(t){return(c-t)/6/h+.5};return 0===h?i=o=0:(o=h/c,e=l(a),n=l(s),r=l(u),a===c?i=r-n:s===c?i=1/3+e-r:u===c&&(i=2/3+n-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},a.rgb.hwb=function(t){var e=t[0],n=t[1],r=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,r))),100*(r=1-1/255*Math.max(e,Math.max(n,r)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-r,1-i)))/(1-e)||0),100*((1-r-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var e=i[t];if(e)return e;var n,o,a,s=1/0;for(var u in r)if(r.hasOwnProperty(u)){var c=r[u],h=(o=t,a=c,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2));h<s&&(s=h,n=u)}return n},a.keyword.rgb=function(t){return r[t]},a.rgb.xyz=function(t){var e=t[0]/255,n=t[1]/255,r=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)),100*(.2126*e+.7152*n+.0722*r),100*(.0193*e+.1192*n+.9505*r)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],r=e[1],i=e[2];return r/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(n-r),200*(r-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(t){var e,n,r,i,o,a=t[0]/360,s=t[1]/100,u=t[2]/100;if(0===s)return[o=255*u,o,o];e=2*u-(n=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var c=0;c<3;c++)(r=a+1/3*-(c-1))<0&&r++,r>1&&r--,o=6*r<1?e+6*(n-e)*r:2*r<1?n:3*r<2?e+(n-e)*(2/3-r)*6:e,i[c]=255*o;return i},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,r=t[2]/100,i=n,o=Math.max(r,.01);return n*=(r*=2)<=1?r:2-r,i*=o<=1?o:2-o,[e,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,r=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*r*(1-n),s=255*r*(1-n*o),u=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,u,a];case 1:return[s,r,a];case 2:return[a,r,u];case 3:return[a,s,r];case 4:return[u,a,r];case 5:return[r,a,s]}},a.hsv.hsl=function(t){var e,n,r,i=t[0],o=t[1]/100,a=t[2]/100,s=Math.max(a,.01);return r=(2-o)*a,n=o*s,[i,100*(n=(n/=(e=(2-o)*s)<=1?e:2-e)||0),100*(r/=2)]},a.hwb.rgb=function(t){var e,n,r,i,o,a,s,u=t[0]/360,c=t[1]/100,h=t[2]/100,l=c+h;switch(l>1&&(c/=l,h/=l),r=6*u-(e=Math.floor(6*u)),0!=(1&e)&&(r=1-r),i=c+r*((n=1-h)-c),e){default:case 6:case 0:o=n,a=i,s=c;break;case 1:o=i,a=n,s=c;break;case 2:o=c,a=n,s=i;break;case 3:o=c,a=i,s=n;break;case 4:o=i,a=c,s=n;break;case 5:o=n,a=c,s=i}return[255*o,255*a,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,r=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},a.xyz.rgb=function(t){var e,n,r,i=t[0]/100,o=t[1]/100,a=t[2]/100;return n=-.9689*i+1.8758*o+.0415*a,r=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],r=t[2];return n/=100,r/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.lab.xyz=function(t){var e,n,r,i=t[0];e=t[1]/500+(n=(i+16)/116),r=n-t[2]/200;var o=Math.pow(n,3),a=Math.pow(e,3),s=Math.pow(r,3);return n=o>.008856?o:(n-16/116)/7.787,e=a>.008856?a:(e-16/116)/7.787,r=s>.008856?s:(r-16/116)/7.787,[e*=95.047,n*=100,r*=108.883]},a.lab.lch=function(t){var e,n=t[0],r=t[1],i=t[2];return(e=360*Math.atan2(i,r)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(r*r+i*i),e]},a.lch.lab=function(t){var e,n=t[0],r=t[1];return e=t[2]/360*2*Math.PI,[n,r*Math.cos(e),r*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],r=t[2],i=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(r/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],r=t[2];return e===n&&n===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},a.rgb.hcg=function(t){var e,n=t[0]/255,r=t[1]/255,i=t[2]/255,o=Math.max(Math.max(n,r),i),a=Math.min(Math.min(n,r),i),s=o-a;return e=s<=0?0:o===n?(r-i)/s%6:o===r?2+(i-n)/s:4+(n-r)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?a/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=1,i=0;return(r=n<.5?2*e*n:2*e*(1-n))<1&&(i=(n-.5*r)/(1-r)),[t[0],100*r,100*i]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,r=e*n,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,r=t[2]/100;if(0===n)return[255*r,255*r,255*r];var i,o=[0,0,0],a=e%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return i=(1-n)*r,[255*(n*o[0]+i),255*(n*o[1]+i),255*(n*o[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,r=n-e,i=0;return r<1&&(i=(n-r)/(1-r)),[t[0],100*r,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},111:function(t,e){},112:function(t,e){},12:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=void 0,e.isArray=Array.isArray},13:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toNumber=e.isNaN=e.isNumber=void 0;e.isNumber=function(t){return"number"==typeof t};e.isNaN=function(t){return Number.isNaN(Number(t))};e.toNumber=function(t){var n=parseFloat(t);return e.isNaN(n)?t:n}},14:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.traverseTreeUp=e.scaleMatrix=e.getAdjMatrix=e.floydWarshall=e.getDegree=void 0;e.getDegree=function(t,e,n){for(var r=[],i=0;i<t;i++)r[i]=0;return n?(n.forEach((function(t){t.source&&(r[e[t.source]]+=1),t.target&&(r[e[t.target]]+=1)})),r):r};e.floydWarshall=function(t){for(var e=[],n=t.length,r=0;r<n;r+=1){e[r]=[];for(var i=0;i<n;i+=1)r===i?e[r][i]=0:0!==t[r][i]&&t[r][i]?e[r][i]=t[r][i]:e[r][i]=1/0}for(var o=0;o<n;o+=1)for(r=0;r<n;r+=1)for(i=0;i<n;i+=1)e[r][i]>e[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e};e.getAdjMatrix=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],s=o[r];i[a][s]=1,e||(i[s][a]=1)})),i};e.scaleMatrix=function(t,e){var n=[];return t.forEach((function(t){var r=[];t.forEach((function(t){r.push(t*e)})),n.push(r)})),n};e.traverseTreeUp=function(t,e){"function"==typeof e&&function t(e,n){if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return;return!!n(e)}(t,e)}},15:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.isObject=void 0;e.isObject=function(t){return null!==t&&"object"===r(t)};e.clone=function(t){if(null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){var n=[];return t.forEach((function(t){n.push(t)})),n.map((function(t){return e.clone(t)}))}if("object"===r(t)&&t!=={}){var o=i({},t);return Object.keys(o).forEach((function(t){o[t]=e.clone(o[t])})),o}return t}},16:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isFunction=void 0;e.isFunction=function(t){return"function"==typeof t}},166:function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"easeLinear",(function(){return E})),n.d(r,"easeQuad",(function(){return A})),n.d(r,"easeQuadIn",(function(){return P})),n.d(r,"easeQuadOut",(function(){return j})),n.d(r,"easeQuadInOut",(function(){return A})),n.d(r,"easeCubic",(function(){return N})),n.d(r,"easeCubicIn",(function(){return I})),n.d(r,"easeCubicOut",(function(){return T})),n.d(r,"easeCubicInOut",(function(){return N})),n.d(r,"easePoly",(function(){return L})),n.d(r,"easePolyIn",(function(){return B})),n.d(r,"easePolyOut",(function(){return _})),n.d(r,"easePolyInOut",(function(){return L})),n.d(r,"easeSin",(function(){return Y})),n.d(r,"easeSinIn",(function(){return F})),n.d(r,"easeSinOut",(function(){return X})),n.d(r,"easeSinInOut",(function(){return Y})),n.d(r,"easeExp",(function(){return G})),n.d(r,"easeExpIn",(function(){return W})),n.d(r,"easeExpOut",(function(){return q})),n.d(r,"easeExpInOut",(function(){return G})),n.d(r,"easeCircle",(function(){return U})),n.d(r,"easeCircleIn",(function(){return V})),n.d(r,"easeCircleOut",(function(){return H})),n.d(r,"easeCircleInOut",(function(){return U})),n.d(r,"easeBounce",(function(){return K})),n.d(r,"easeBounceIn",(function(){return Q})),n.d(r,"easeBounceOut",(function(){return K})),n.d(r,"easeBounceInOut",(function(){return $})),n.d(r,"easeBack",(function(){return et})),n.d(r,"easeBackIn",(function(){return J})),n.d(r,"easeBackOut",(function(){return tt})),n.d(r,"easeBackInOut",(function(){return et})),n.d(r,"easeElastic",(function(){return it})),n.d(r,"easeElasticIn",(function(){return rt})),n.d(r,"easeElasticOut",(function(){return it})),n.d(r,"easeElasticInOut",(function(){return ot}));var i=n(1),o=n(169),a=n(80),s=n(5),u=n(0);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var h,l,f=0,d=0,p=0,g=0,v=0,y=0,m="object"===("undefined"==typeof performance?"undefined":c(performance))&&performance.now?performance:Date,b="object"===("undefined"==typeof window?"undefined":c(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function x(){return v||(b(w),v=m.now()+y)}function w(){v=0}function M(){this._call=this._time=this._next=null}function S(t,e,n){var r=new M;return r.restart(t,e,n),r}function O(){v=(g=m.now())+y,f=d=0;try{!function(){x(),++f;for(var t,e=h;e;)(t=v-e._time)>=0&&e._call.call(null,t),e=e._next;--f}()}finally{f=0,function(){var t,e,n=h,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:h=e);l=t,C(r)}(),v=0}}function k(){var t=m.now(),e=t-g;e>1e3&&(y-=e,g=t)}function C(t){f||(d&&(d=clearTimeout(d)),t-v>24?(t<1/0&&(d=setTimeout(O,t-m.now()-y)),p&&(p=clearInterval(p))):(p||(g=m.now(),p=setInterval(k,1e3)),f=1,b(O)))}function E(t){return+t}function P(t){return t*t}function j(t){return t*(2-t)}function A(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function I(t){return t*t*t}function T(t){return--t*t*t+1}function N(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}M.prototype=S.prototype={constructor:M,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?x():+n)+(null==e?0:+e),this._next||l===this||(l?l._next=this:h=this,l=this),this._call=t,this._time=n,C()},stop:function(){this._call&&(this._call=null,this._time=1/0,C())}};var B=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),_=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),L=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),D=Math.PI,R=D/2;function F(t){return 1==+t?1:1-Math.cos(t*R)}function X(t){return Math.sin(t*R)}function Y(t){return(1-Math.cos(D*t))/2}function z(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function W(t){return z(1-+t)}function q(t){return 1-z(t)}function G(t){return((t*=2)<=1?z(1-t):2-z(t-1))/2}function V(t){return 1-Math.sqrt(1-t*t)}function H(t){return Math.sqrt(1- --t*t)}function U(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var Z=7.5625;function Q(t){return 1-K(1-t)}function K(t){return(t=+t)<4/11?Z*t*t:t<8/11?Z*(t-=6/11)*t+3/4:t<10/11?Z*(t-=9/11)*t+15/16:Z*(t-=21/22)*t+63/64}function $(t){return((t*=2)<=1?1-K(1-t):K(t-1)+1)/2}var J=function t(e){function n(t){return(t=+t)*t*(e*(t-1)+t)}return e=+e,n.overshoot=t,n}(1.70158),tt=function t(e){function n(t){return--t*t*((t+1)*e+t)+1}return e=+e,n.overshoot=t,n}(1.70158),et=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),nt=2*Math.PI,rt=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return e*z(- --t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),it=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return 1-e*z(t=+t)*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),ot=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=nt);function i(t){return((t=2*t-1)<0?e*z(-t)*Math.sin((r-t)/n):2-e*z(t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*nt)},i.period=function(n){return t(e,n)},i}(1,.3),at=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function st(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ut(){}var ct="\\s*([+-]?\\d+)\\s*",ht="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",lt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ft=/^#([0-9a-f]{3,8})$/,dt=new RegExp("^rgb\\("+[ct,ct,ct]+"\\)$"),pt=new RegExp("^rgb\\("+[lt,lt,lt]+"\\)$"),gt=new RegExp("^rgba\\("+[ct,ct,ct,ht]+"\\)$"),vt=new RegExp("^rgba\\("+[lt,lt,lt,ht]+"\\)$"),yt=new RegExp("^hsl\\("+[ht,lt,lt]+"\\)$"),mt=new RegExp("^hsla\\("+[ht,lt,lt,ht]+"\\)$"),bt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function xt(){return this.rgb().formatHex()}function wt(){return this.rgb().formatRgb()}function Mt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ft.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?St(e):3===n?new Et(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ot(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ot(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=dt.exec(t))?new Et(e[1],e[2],e[3],1):(e=pt.exec(t))?new Et(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=gt.exec(t))?Ot(e[1],e[2],e[3],e[4]):(e=vt.exec(t))?Ot(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=yt.exec(t))?It(e[1],e[2]/100,e[3]/100,1):(e=mt.exec(t))?It(e[1],e[2]/100,e[3]/100,e[4]):bt.hasOwnProperty(t)?St(bt[t]):"transparent"===t?new Et(NaN,NaN,NaN,0):null}function St(t){return new Et(t>>16&255,t>>8&255,255&t,1)}function Ot(t,e,n,r){return r<=0&&(t=e=n=NaN),new Et(t,e,n,r)}function kt(t){return t instanceof ut||(t=Mt(t)),t?new Et((t=t.rgb()).r,t.g,t.b,t.opacity):new Et}function Ct(t,e,n,r){return 1===arguments.length?kt(t):new Et(t,e,n,null==r?1:r)}function Et(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Pt(){return"#"+At(this.r)+At(this.g)+At(this.b)}function jt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function At(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function It(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Nt(t,e,n,r)}function Tt(t){if(t instanceof Nt)return new Nt(t.h,t.s,t.l,t.opacity);if(t instanceof ut||(t=Mt(t)),!t)return new Nt;if(t instanceof Nt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Nt(a,s,u,t.opacity)}function Nt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Bt(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function _t(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}at(ut,Mt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:xt,formatHex:xt,formatHsl:function(){return Tt(this).formatHsl()},formatRgb:wt,toString:wt}),at(Et,Ct,st(ut,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Et(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Et(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Pt,formatHex:Pt,formatRgb:jt,toString:jt})),at(Nt,(function(t,e,n,r){return 1===arguments.length?Tt(t):new Nt(t,e,n,null==r?1:r)}),st(ut,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Nt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Nt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Et(Bt(t>=240?t-240:t+120,i,r),Bt(t,i,r),Bt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Lt=function(t){return function(){return t}};function Dt(t,e){return function(n){return t+n*e}}function Rt(t){return 1==(t=+t)?Ft:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Lt(isNaN(e)?n:e)}}function Ft(t,e){var n=e-t;return n?Dt(t,n):Lt(isNaN(t)?e:t)}var Xt=function t(e){var n=Rt(e);function r(t,e){var r=n((t=Ct(t)).r,(e=Ct(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Ft(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Yt(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=Ct(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}Yt((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return _t((n-r/e)*e,a,i,o,s)}})),Yt((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return _t((n-r/e)*e,i,o,a,s)}}));var zt=function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}};function Wt(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function qt(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Jt(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}var Gt=function(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}},Vt=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}};function Ht(t){return(Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Ut=function(t,e){var n,r={},i={};for(n in null!==t&&"object"===Ht(t)||(t={}),null!==e&&"object"===Ht(e)||(e={}),e)n in t?r[n]=Jt(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},Zt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qt=new RegExp(Zt.source,"g");var Kt=function(t,e){var n,r,i,o=Zt.lastIndex=Qt.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=Zt.exec(t))&&(r=Qt.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Vt(n,r)})),o=Qt.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})};function $t(t){return($t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Jt=function(t,e){var n,r=$t(e);return null==e||"boolean"===r?Lt(e):("number"===r?Vt:"string"===r?(n=Mt(e))?(e=n,Xt):Kt:e instanceof Mt?Xt:e instanceof Date?Gt:Wt(e)?zt:Array.isArray(e)?qt:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Ut:Vt)(t,e)},te=n(28),ee=[1,0,0,0,1,0,0,0,1];function ne(t,e,n){var i,o=e.startTime;if(n<o+e.delay||e._paused)return!1;var a=e.duration,s=e.easing;if(n=n-o-e.delay,e.repeat)i=n%a/a,i=r[s](i);else{if(!((i=n/a)<1))return e.onFrame?t.attr(e.onFrame(1)):t.attr(e.toAttrs),!0;i=r[s](i)}if(e.onFrame){var c=e.onFrame(i);t.attr(c)}else!function(t,e,n){var r={},i=e.fromAttrs,o=e.toAttrs;if(!t.destroyed){var a,s,c,h;for(var l in o)if(!Object(u.h)(i[l],o[l]))if("path"===l){var f=o[l],d=i[l];f.length>d.length?(f=te.c(o[l]),d=te.c(i[l]),d=te.a(d,f),d=te.b(d,f),e.fromAttrs.path=d,e.toAttrs.path=f):e.pathFormatted||(f=te.c(o[l]),d=te.c(i[l]),d=te.b(d,f),e.fromAttrs.path=d,e.toAttrs.path=f,e.pathFormatted=!0),r[l]=[];for(var p=0;p<f.length;p++){for(var g=f[p],v=d[p],y=[],m=0;m<g.length;m++)Object(u.k)(g[m])&&v&&Object(u.k)(v[m])?(a=Jt(v[m],g[m]),y.push(a(n))):y.push(g[m]);r[l].push(y)}}else if("matrix"===l){var b=(c=i[l]||ee,(Wt(h=o[l]||ee)?zt:qt)(c,h))(n);r[l]=b}else["fill","stroke","fillStyle","strokeStyle"].includes(l)&&(s=o[l],/^[r,R,L,l]{1}[\s]*\(/.test(s))?r[l]=o[l]:Object(u.i)(o[l])||(a=Jt(i[l],o[l]),r[l]=a(n));t.attr(r)}}(t,e,i);return!1}var re=function(){function t(t){this.animators=[],this.current=0,this.timer=null,this.canvas=t}return t.prototype.initTimer=function(){var t,e,n,r=this;this.timer=S((function(i){if(r.current=i,r.animators.length>0){for(var o=r.animators.length-1;o>=0;o--)if((t=r.animators[o]).destroyed)r.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],ne(t,n,i)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&r.removeAnimator(o)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),ie=n(76),oe=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function ae(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function se(t,e,n){if(n.bubbles){var r=void 0,i=!1;if("mouseenter"===e?(r=n.fromShape,i=!0):"mouseleave"===e&&(i=!0,r=n.toShape),t.isCanvas()&&i)return;if(r&&Object(s.g)(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var ue=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");Object(s.a)(oe,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");Object(s.a)(oe,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new ie.a(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t],o=!1;if(i)i.call(this,n,r,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}if(o||(this.currentShape=r),r&&!r.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=r.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,r){var i=this.canvas.get("el");n!==r&&(n&&(this._emitEvent("mouseout",t,e,n,n,r),this._emitEvent("mouseleave",t,e,n,n,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,e,r,n,r),this._emitEvent("mouseenter",t,e,r,n,r)))},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);r!==t&&this._emitMouseoverEvents(n,e,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var r=this.currentShape;this._emitDragoverEvents(n,t,r,e,!0)},t.prototype._onmousemove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=n.timeStamp-this.mousedownTimeStamp,c=a.clientX-t.clientX,h=a.clientY-t.clientY;u>120||c*c+h*h>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,ae(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||se(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{ae(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),ce=Object(o.a)(),he=ce&&"firefox"===ce.name;!function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}Object(i.c)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");Object(s.h)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new ue({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new re(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");s.c&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");s.c&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(he&&!Object(s.e)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(s.e)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,r=e.y;return this.getPointByClient(n,r)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))}}(a.a)},168:function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"distance",(function(){return h})),n.d(r,"isNumberEqual",(function(){return l})),n.d(r,"getBBoxByArray",(function(){return f})),n.d(r,"getBBoxRange",(function(){return d})),n.d(r,"piMod",(function(){return p}));var i=new Map;function o(t,e){i.set(t,e)}var a=function(t){var e=t.attr();return{x:e.x,y:e.y,width:e.width,height:e.height}},s=function(t){var e=t.attr(),n=e.x,r=e.y,i=e.r;return{x:n-i,y:r-i,width:2*i,height:2*i}};function u(t){return Math.min.apply(null,t)}function c(t){return Math.max.apply(null,t)}function h(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function l(t,e){return Math.abs(t-e)<.001}function f(t,e){var n=u(t),r=u(e);return{x:n,y:r,width:c(t)-n,height:c(e)-r}}function d(t,e,n,r){return{minX:u([t,n]),maxX:c([t,n]),minY:u([e,r]),maxY:c([e,r])}}function p(t){return(t+2*Math.PI)%(2*Math.PI)}n(47);function g(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function v(t,e,n){var r=t+n-2*e;if(l(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}var y=function(t,e,n,r,i,o){var a=v(t,n,i)[0],s=v(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(g(t,n,i,a)),void 0!==s&&c.push(g(e,r,o,s)),f(u,c)};function m(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function b(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,h=[];if(l(s,0))l(u,0)||(i=-c/u)>=0&&i<=1&&h.push(i);else{var f=u*u-4*s*c;l(f,0)?h.push(-u/(2*s)):f>0&&(o=(-u-(a=Math.sqrt(f)))/(2*s),(i=(-u+a)/(2*s))>=0&&i<=1&&h.push(i),o>=0&&o<=1&&h.push(o))}return h}var x=function(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],h=b(t,n,i,a),l=b(e,r,o,s),d=0;d<h.length;d++)u.push(m(t,n,i,a,h[d]));for(d=0;d<l.length;d++)c.push(m(e,r,o,s,l[d]));return f(u,c)};function w(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function M(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}var S=function(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,c=-1/0,h=[o,a],l=2*-Math.PI;l<=2*Math.PI;l+=Math.PI){var f=s+l;o<a?o<f&&f<a&&h.push(f):a<f&&f<o&&h.push(f)}for(l=0;l<h.length;l++){var d=w(t,0,n,r,i,h[l]);d<u&&(u=d),d>c&&(c=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,v=-1/0,y=[o,a];for(l=2*-Math.PI;l<=2*Math.PI;l+=Math.PI){var m=p+l;o<a?o<m&&m<a&&y.push(m):a<m&&m<o&&y.push(m)}for(l=0;l<y.length;l++){var b=M(0,e,n,r,i,y[l]);b<g&&(g=b),b>v&&(v=b)}return{x:u,y:g,width:c-u,height:v-g}};function O(t,e){return t&&e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t||e}function k(t,e){var n=t.get("startArrowShape"),r=t.get("endArrowShape");return n&&(e=O(e,n.getCanvasBBox())),r&&(e=O(e,r.getCanvasBBox())),e}var C=n(39),E=n(40),P=n(0);function j(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),u=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!u||0===Math.sin(u)||Object(P.l)(u,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),h=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,h=h>Math.PI/2?Math.PI-h:h,{xExtra:Math.cos(u/2-c)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(h-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}o("rect",a),o("image",a),o("circle",s),o("marker",s),o("polyline",(function(t){for(var e=t.attr().points,n=[],i=[],o=0;o<e.length;o++){var a=e[o];n.push(a[0]),i.push(a[1])}var s=r.getBBoxByArray(n,i),u=s.x,c=s.y,h={minX:u,minY:c,maxX:u+s.width,maxY:c+s.height};return{x:(h=k(t,h)).minX,y:h.minY,width:h.maxX-h.minX,height:h.maxY-h.minY}})),o("polygon",(function(t){for(var e=t.attr().points,n=[],i=[],o=0;o<e.length;o++){var a=e[o];n.push(a[0]),i.push(a[1])}return r.getBBoxByArray(n,i)})),o("text",(function(t){var e=t.attr(),n=e.x,r=e.y,i=e.text,o=e.fontSize,a=e.lineHeight,s=e.font;s||(s=Object(C.a)(e));var u,c=Object(C.c)(i,s);if(c){var h=e.textAlign,l=e.textBaseline,f=Object(C.b)(i,o,a),d={x:n,y:r-f};h&&("end"===h||"right"===h?d.x-=c:"center"===h&&(d.x-=c/2)),l&&("top"===l?d.y+=f:"middle"===l&&(d.y+=f/2)),u={x:d.x,y:d.y,width:c,height:f}}else u={x:n,y:r,width:0,height:0};return u})),o("path",(function(t){var e=t.attr(),n=e.path,r=e.stroke?e.lineWidth:0,i=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=(g=t[o]).currentPoint,s=g.params,u=g.prePoint,c=void 0;switch(g.command){case"Q":c=y(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":c=x(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var h=g.arcParams;c=S(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(a[0]),r.push(a[1])}c&&(g.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===g.command||"M"===g.command)&&g.prePoint&&g.nextPoint&&i.push(g)}n=n.filter((function(t){return!Number.isNaN(t)})),r=r.filter((function(t){return!Number.isNaN(t)}));var l=Object(P.q)(n),f=Object(P.q)(r),d=Object(P.p)(n),p=Object(P.p)(r);if(0===i.length)return{x:l,y:f,width:d-l,height:p-f};for(o=0;o<i.length;o++){var g;(a=(g=i[o]).currentPoint)[0]===l?l-=j(g,e).xExtra:a[0]===d&&(d+=j(g,e).xExtra),a[1]===f?f-=j(g,e).yExtra:a[1]===p&&(p+=j(g,e).yExtra)}return{x:l,y:f,width:d-l,height:p-f}}(t.get("segments")||Object(E.c)(n),r),o=i.x,a=i.y,s={minX:o,minY:a,maxX:o+i.width,maxY:a+i.height};return{x:(s=k(t,s)).minX,y:s.minY,width:s.maxX-s.minX,height:s.maxY-s.minY}})),o("line",(function(t){var e=t.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2,a={minX:Math.min(n,i),maxX:Math.max(n,i),minY:Math.min(r,o),maxY:Math.max(r,o)};return{x:(a=k(t,a)).minX,y:a.minY,width:a.maxX-a.minX,height:a.maxY-a.minY}})),o("ellipse",(function(t){var e=t.attr(),n=e.x,r=e.y,i=e.rx,o=e.ry;return{x:n-i,y:r-o,width:2*i,height:2*o}}))},169:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return f}));var r=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r},i=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},o=function(e){this.version=e,this.type="node",this.name="node",this.os=t.platform},a=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},s=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},u=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},c=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,h=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],l=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function f(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new u:"undefined"!=typeof navigator?p(navigator.userAgent):void 0!==t&&t.version?new o(t.version.slice(1)):null}function d(t){return""!==t&&h.reduce((function(e,n){var r=n[0],i=n[1];if(e)return e;var o=i.exec(t);return!!o&&[r,o]}),!1)}function p(t){var e=d(t);if(!e)return null;var n=e[0],o=e[1];if("searchbot"===n)return new s;var u=o[1]&&o[1].split(/[._]/).slice(0,3);u?u.length<3&&(u=r(u,function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-u.length))):u=[];var h=u.join("."),f=function(t){for(var e=0,n=l.length;e<n;e++){var r=l[e],i=r[0];if(r[1].exec(t))return i}return null}(t),p=c.exec(t);return p&&p[1]?new a(n,h,f,p[1]):new i(n,h,f)}}).call(this,n(107))},170:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return f}));var r=function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r},i=function(t,e,n){this.name=t,this.version=e,this.os=n,this.type="browser"},o=function(e){this.version=e,this.type="node",this.name="node",this.os=t.platform},a=function(t,e,n,r){this.name=t,this.version=e,this.os=n,this.bot=r,this.type="bot-device"},s=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},u=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},c=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,h=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],l=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function f(e){return e?p(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new u:"undefined"!=typeof navigator?p(navigator.userAgent):void 0!==t&&t.version?new o(t.version.slice(1)):null}function d(t){return""!==t&&h.reduce((function(e,n){var r=n[0],i=n[1];if(e)return e;var o=i.exec(t);return!!o&&[r,o]}),!1)}function p(t){var e=d(t);if(!e)return null;var n=e[0],o=e[1];if("searchbot"===n)return new s;var u=o[1]&&o[1].split(/[._]/).slice(0,3);u?u.length<3&&(u=r(u,function(t){for(var e=[],n=0;n<t;n++)e.push("0");return e}(3-u.length))):u=[];var h=u.join("."),f=function(t){for(var e=0,n=l.length;e<n;e++){var r=l[e],i=r[0];if(r[1].exec(t))return i}return null}(t),p=c.exec(t);return p&&p[1]?new a(n,h,f,p[1]):new i(n,h,f)}}).call(this,n(107))},18:function(t,e,n){"use strict";var r=n(83),i=Object(r.getColorsWithSubjectColor)("rgb(95, 149, 255)","rgb(255, 255, 255)");e.a={version:"0.0.11",rootContainerClassName:"root-container",uiContainerClassName:"ui-container",waterContainerClassName:"water-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:i.mainStroke,fill:i.mainFill},size:20,color:i.mainStroke,linkPoints:{size:8,lineWidth:1,fill:i.activeFill,stroke:i.activeStroke}},nodeStateStyles:{active:{fill:i.activeFill,stroke:i.activeStroke,lineWidth:2,shadowColor:i.mainStroke,shadowBlur:10},selected:{fill:i.selectedFill,stroke:i.selectedStroke,lineWidth:4,shadowColor:i.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:i.highlightFill,stroke:i.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:i.inactiveFill,stroke:i.inactiveStroke,lineWidth:1},disable:{fill:i.disableFill,stroke:i.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:"rgb(0, 0, 0)",textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:i.edgeMainStroke,lineAppendWidth:2},color:i.edgeMainStroke},edgeStateStyles:{active:{stroke:i.edgeActiveStroke,lineWidth:1},selected:{stroke:i.edgeSelectedStroke,lineWidth:2,shadowColor:i.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:i.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:i.edgeInactiveStroke,lineWidth:1},disable:{stroke:i.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:"rgb(0, 0, 0)",textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:i.comboMainFill,lineWidth:1,stroke:i.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:i.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:i.comboActiveStroke,lineWidth:1,fill:i.comboActiveFill},selected:{stroke:i.comboSelectedStroke,lineWidth:2,fill:i.comboSelectedFill,shadowColor:i.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:i.comboHighlightStroke,lineWidth:2,fill:i.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:i.comboInactiveStroke,fill:i.comboInactiveFill,lineWidth:1},disable:{stroke:i.comboDisableStroke,fill:i.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"}},2:function(t,e,n){"use strict";n.d(e,"i",(function(){return kt})),n.d(e,"h",(function(){return Be})),n.d(e,"d",(function(){return _e})),n.d(e,"m",(function(){return De})),n.d(e,"l",(function(){return Ht})),n.d(e,"g",(function(){return Vt})),n.d(e,"f",(function(){return Ut})),n.d(e,"j",(function(){return be})),n.d(e,"k",(function(){return Le})),n.d(e,"r",(function(){return We})),n.d(e,"p",(function(){return Ge})),n.d(e,"b",(function(){return we})),n.d(e,"n",(function(){return Xe})),n.d(e,"q",(function(){return qe})),n.d(e,"o",(function(){return Ve})),n.d(e,"c",(function(){return Ye})),n.d(e,"a",(function(){return ze})),n.d(e,"e",(function(){return He}));var r={};n.r(r),n.d(r,"compare",(function(){return m})),n.d(r,"getLineIntersect",(function(){return x})),n.d(r,"getRectIntersectByPoint",(function(){return w})),n.d(r,"getCircleIntersectByPoint",(function(){return M})),n.d(r,"getEllipseIntersectByPoint",(function(){return S})),n.d(r,"applyMatrix",(function(){return O})),n.d(r,"invertMatrix",(function(){return k})),n.d(r,"getCircleCenterByPoints",(function(){return C})),n.d(r,"distance",(function(){return E})),n.d(r,"scaleMatrix",(function(){return P})),n.d(r,"floydWarshall",(function(){return j})),n.d(r,"getAdjMatrix",(function(){return A})),n.d(r,"translate",(function(){return I})),n.d(r,"move",(function(){return T})),n.d(r,"scale",(function(){return N})),n.d(r,"rotate",(function(){return B})),n.d(r,"getDegree",(function(){return _})),n.d(r,"isPointInPolygon",(function(){return D})),n.d(r,"intersectBBox",(function(){return R})),n.d(r,"isPolygonsIntersect",(function(){return F})),n.d(r,"Line",(function(){return X})),n.d(r,"getBBoxBoundLine",(function(){return Y})),n.d(r,"itemIntersectByLine",(function(){return W})),n.d(r,"fractionToLine",(function(){return q})),n.d(r,"getPointsCenter",(function(){return G})),n.d(r,"squareDist",(function(){return V})),n.d(r,"pointLineSquareDist",(function(){return H})),n.d(r,"isPointsOverlap",(function(){return U})),n.d(r,"pointRectSquareDist",(function(){return Z})),n.d(r,"pointLineDistance",(function(){return Q}));var i={};n.r(i),n.d(i,"getBBox",(function(){return ct})),n.d(i,"getLoopCfgs",(function(){return ht})),n.d(i,"getLabelPosition",(function(){return lt})),n.d(i,"traverseTree",(function(){return dt})),n.d(i,"traverseTreeUp",(function(){return pt})),n.d(i,"getLetterWidth",(function(){return gt})),n.d(i,"getTextSize",(function(){return vt})),n.d(i,"plainCombosToTrees",(function(){return yt})),n.d(i,"reconstructTree",(function(){return mt})),n.d(i,"getComboBBox",(function(){return bt})),n.d(i,"shouldRefreshEdge",(function(){return xt})),n.d(i,"cloneBesidesImg",(function(){return wt}));var o={};n.r(o),n.d(o,"uniqueId",(function(){return Ct})),n.d(o,"formatPadding",(function(){return Et})),n.d(o,"cloneEvent",(function(){return Pt})),n.d(o,"isViewportChanged",(function(){return jt})),n.d(o,"isNaN",(function(){return At})),n.d(o,"calculationItemsBBox",(function(){return It})),n.d(o,"processParallelEdges",(function(){return Tt}));var a={};n.r(a),n.d(a,"getSpline",(function(){return te})),n.d(a,"getControlPoint",(function(){return ee})),n.d(a,"pointsToPolygon",(function(){return ne})),n.d(a,"pathToPoints",(function(){return re})),n.d(a,"getClosedSpline",(function(){return ie})),n.d(a,"roundedHull",(function(){return ue})),n.d(a,"paddedHull",(function(){return ce}));var s={};n.r(s),n.d(s,"defaultSubjectColors",(function(){return Re}));var u=n(0),c={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(t){return Object.assign(this,t),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(t){var e=this.events;this.graph=t,"drag-canvas"!==this.type&&"brush-select"!==this.type&&"lasso-select"!==this.type||t.get("canvas").set("draggable",!0),Object(u.c)(e,(function(e,n){t.on(n,e)}))},unbind:function(t){var e=this.events;"drag-canvas"!==this.type&&"brush-select"!==this.type&&"lasso-select"!==this.type||t.get("canvas").set("draggable",!1),Object(u.c)(e,(function(e,n){t.off(n,e)}))},get:function(t){return this[t]},set:function(t,e){return this[t]=e,this}},h=function(){function t(){}return t.registerBehavior=function(e,n){if(!n)throw new Error("please specify handler for this behavior: "+e);var r=Object(u.a)(c);Object.assign(r,n);var i=function(t){var e=this;Object.assign(this,this.getDefaultCfg(),t);var n=this.getEvents();this.events=null;var r={};n&&(Object(u.c)(n,(function(t,n){r[n]=Object(u.x)(e,t)})),this.events=r)};i.prototype=r,t.types[e]=i},t.hasBehavior=function(e){return!!t.types[e]},t.getBehavior=function(e){return t.types[e]},t.types={},t}(),l=h,f=n(1),d=n(79),p=n(25),g=n(4),v=n(29),y=g.a.transform,m=function(t){return function(e,n){return e[t]-n[t]}},b=function(t,e,n){return t>=e&&t<=n},x=function(t,e,n,r){var i=n.x-t.x,o=n.y-t.y,a=e.x-t.x,s=e.y-t.y,u=r.x-n.x,c=r.y-n.y,h=a*c-s*u,l=1/h;if(h*h>1e-4*(a*a+s*s)*(u*u+c*c)){var f=(i*c-o*u)*l,d=(i*s-o*a)*l;return b(f,0,1)&&b(d,0,1)?{x:t.x+f*a,y:t.y+f*s}:null}return null},w=function(t,e){var n=t.x,r=t.y,i=t.width,o=t.height,a=[],s={x:n+i/2,y:r+o/2};a.push({x:n,y:r}),a.push({x:n+i,y:r}),a.push({x:n+i,y:r+o}),a.push({x:n,y:r+o}),a.push({x:n,y:r});for(var u=null,c=1;c<a.length&&!(u=x(a[c-1],a[c],s,e));c++);return u},M=function(t,e){var n=t.x,r=t.y,i=t.r,o=e.x-n,a=e.y-r;if(Math.sqrt(o*o+a*a)<i)return null;var s=Math.sign(o),u=Math.sign(a),c=Math.atan(a/o);return{x:n+Math.abs(i*Math.cos(c))*s,y:r+Math.abs(i*Math.sin(c))*u}},S=function(t,e){var n=t.rx,r=t.ry,i=t.x,o=t.y,a=e.x-i,s=e.y-o,u=Math.atan2(s/r,a/n);return u<0&&(u+=2*Math.PI),{x:i+n*Math.cos(u),y:o+r*Math.sin(u)}},O=function(t,e,n){void 0===n&&(n=1);var r=[t.x,t.y,n];return e&&!isNaN(e[0])||(e=[1,0,0,0,1,0,0,0,1]),g.d.transformMat3(r,r,e),{x:r[0],y:r[1]}},k=function(t,e,n){void 0===n&&(n=1),e&&!isNaN(e[0])||(e=[1,0,0,0,1,0,0,0,1]);var r=g.b.invert([1,0,0,0,1,0,0,0,1],e);r||(r=[1,0,0,0,1,0,0,0,1]);var i=[t.x,t.y,n];return g.d.transformMat3(i,i,r),{x:i[0],y:i[1]}},C=function(t,e,n){var r=t.x-e.x,i=t.y-e.y,o=t.x-n.x,a=t.y-n.y,s=(t.x*t.x-e.x*e.x-e.y*e.y+t.y*t.y)/2,u=(t.x*t.x-n.x*n.x-n.y*n.y+t.y*t.y)/2,c=i*o-r*a;return{x:-(a*s-i*u)/c,y:-(r*u-o*s)/c}},E=function(t,e){var n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)},P=function(t,e){var n=[];return t.forEach((function(t){var r=[];t.forEach((function(t){r.push(t*e)})),n.push(r)})),n},j=function(t){for(var e=[],n=t.length,r=0;r<n;r+=1){e[r]=[];for(var i=0;i<n;i+=1)r===i?e[r][i]=0:0!==t[r][i]&&t[r][i]?e[r][i]=t[r][i]:e[r][i]=1/0}for(var o=0;o<n;o+=1)for(r=0;r<n;r+=1)for(i=0;i<n;i+=1)e[r][i]>e[r][o]+e[o][i]&&(e[r][i]=e[r][o]+e[o][i]);return e},A=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],s=o[r];i[a][s]=1,e||(i[s][a]=1)})),i},I=function(t,e){t.translate(e.x,e.y)},T=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=t.getCanvasBBox(),i=e.x-r.minX,o=e.y-r.minY,a=y(n,[["t",i,o]]);t.setMatrix(a)},N=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=e;Object(u.f)(e)||(r=[e,e]),Object(u.f)(e)&&1===e.length&&(r=[e[0],e[0]]),n=y(n,[["s",r[0],r[1]]]),t.setMatrix(n)},B=function(t,e){var n=t.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]),n=y(n,[["r",e]]),t.setMatrix(n)},_=function(t,e,n){for(var r=[],i=0;i<t;i++)r[i]=0;return n.forEach((function(t){t.source&&(r[e[t.source]]+=1),t.target&&(r[e[t.target]]+=1)})),r};function L(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}var D=function(t,e,n){var r=!1,i=t.length;function o(t){return Math.abs(t)<1e-6?0:t<0?-1:1}if(i<=2)return!1;for(var a=0;a<i;a++){var s=t[a],u=t[(a+1)%i];if(L(s,u,[e,n]))return!0;o(s[1]-n)>0!=o(u[1]-n)>0&&o(e-(n-s[1])*(s[0]-u[0])/(s[1]-u[1])-s[0])<0&&(r=!r)}return r},R=function(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)},F=function(t,e){var n=function(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]}));return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,n),maxY:Math.max.apply(null,n)}},r=function(t){for(var e=[],n=t.length,r=0;r<n-1;r++){var i=t[r],o=t[r+1];e.push({from:{x:i[0],y:i[1]},to:{x:o[0],y:o[1]}})}if(e.length>1){var a=t[0],s=t[n-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e};if(t.length<2||e.length<2)return!1;var i=n(t),o=n(e);if(!R(i,o))return!1;var a=!1;if(Object(u.c)(e,(function(e){if(D(t,e[0],e[1]))return a=!0,!1})),a)return!0;if(Object(u.c)(t,(function(t){if(D(e,t[0],t[1]))return a=!0,!1})),a)return!0;var s=r(t),c=r(e),h=!1;return Object(u.c)(c,(function(t){if(function(t,e){var n=!1;return Object(u.c)(t,(function(t){if(x(t.from,t.to,e.from,e.to))return n=!0,!1})),n}(s,t))return h=!0,!1})),h},X=function(){function t(t,e,n,r){this.x1=t,this.y1=e,this.x2=n,this.y2=r}return t.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),n=Math.max(this.x1,this.x2),r=Math.max(this.y1,this.y2);return{x:t,y:e,minX:t,minY:e,maxX:n,maxY:r,width:n-t,height:r-e}},t}(),Y=function(t,e){return{top:[t.minX,t.minY,t.maxX,t.minY],left:[t.minX,t.minY,t.minX,t.maxY],bottom:[t.minX,t.maxY,t.maxX,t.maxY],right:[t.maxX,t.minY,t.maxX,t.maxY]}[e]},z=function(t,e){var n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),r=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),i=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(i){var o=n/i,a=r/i;if(o>=0&&o<=1&&a>=0&&a<=1)return o}return Number.POSITIVE_INFINITY},W=function(t,e){for(var n=["top","left","bottom","right"],r=t.getBBox(),i=0,o=[],a=0;a<4;a++){var s=Y(r,n[a]),u=s[0],c=s[1],h=s[2],l=s[3];o[a]=x({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:u,y:c},{x:h,y:l}),o[a]&&(i+=1)}return[o,i]},q=function(t,e){for(var n=["top","left","bottom","right"],r=t.getBBox(),i=Number.POSITIVE_INFINITY,o=0,a=0;a<4;a++){var s=Y(r,n[a]),u=s[0],c=s[1],h=s[2],l=s[3],f=z(e,new X(u,c,h,l));(f=Math.abs(f-.5))>=0&&f<=1&&(o+=1,i=f<i?f:i)}return 0===o?-1:i},G=function(t){var e=0,n=0;if(t.length>0){for(var r=0,i=t;r<i.length;r++){var o=i[r];e+=o.x,n+=o.y}e/=t.length,n/=t.length}return{x:e,y:n}},V=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},H=function(t,e){var n,r=e.x1,i=e.y1,o=e.x2-r,a=e.y2-i,s=t.x-r,u=t.y-i,c=s*o+u*a;n=c<=0||(c=(s=o-s)*o+(u=a-u)*a)<=0?0:c*c/(o*o+a*a);var h=s*s+u*u-n;return h<0&&(h=0),h},U=function(t,e,n){return void 0===n&&(n=.001),Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(n,2)},Z=function(t,e){var n=t.x<e.x,r=t.x>e.x+e.width,i=t.y>e.y+e.height,o=t.y<e.y;if(!(n||r||i||o))return 0;if(i&&!n&&!r)return Math.pow(e.y+e.height-t.y,2);if(o&&!n&&!r)return Math.pow(t.y-e.y,2);if(n&&!i&&!o)return Math.pow(e.x-t.x,2);if(r&&!i&&!o)return Math.pow(e.x+e.width-t.x,2);var a=Math.min(Math.abs(e.x-t.x),Math.abs(e.x+e.width-t.x)),s=Math.min(Math.abs(e.y-t.y),Math.abs(e.y+e.height-t.y));return a*a+s*s},Q=function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=e.x,s=e.y,u=[i-n,o-r];if(g.c.exactEquals(u,[0,0]))return NaN;var c=[-u[1],u[0]];g.c.normalize(c,c);var h=[a-n,s-r];return Math.abs(g.c.dot(h,c))},K="rgb(95, 149, 255)",$="rgb(253, 253, 253)",J="rgb(247, 250, 255)",tt="rgb(224, 224, 224)",et="rgb(224, 224, 224)",nt={version:"0.3.0",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:K,fill:"rgb(239, 244, 255)"},size:20,color:K,linkPoints:{size:8,lineWidth:1,fill:J,stroke:K}},nodeStateStyles:{active:{fill:J,stroke:K,lineWidth:2,shadowColor:K,shadowBlur:10},selected:{fill:"rgb(255, 255, 255)",stroke:K,lineWidth:4,shadowColor:K,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:"rgb(223, 234, 255)",stroke:"#4572d9",lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:"rgb(247, 250, 255)",stroke:"rgb(191, 213, 255)",lineWidth:1},disable:{fill:"rgb(250, 250, 250)",stroke:"rgb(224, 224, 224)",lineWidth:1}},edgeLabel:{style:{fill:"rgb(0, 0, 0)",textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:tt,lineAppendWidth:2},color:tt},edgeStateStyles:{active:{stroke:K,lineWidth:1},selected:{stroke:K,lineWidth:2,shadowColor:K,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:K,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:"rgb(234, 234, 234)",lineWidth:1},disable:{stroke:"rgb(245, 245, 245)",lineWidth:1}},comboLabel:{style:{fill:"rgb(0, 0, 0)",textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:$,lineWidth:1,stroke:et,r:5,width:20,height:10},size:[20,5],color:et,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:K,lineWidth:1,fill:"rgb(247, 250, 255)"},selected:{stroke:K,lineWidth:2,fill:$,shadowColor:K,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:"#4572d9",lineWidth:2,fill:$,"text-shape":{fontWeight:500}},inactive:{stroke:"rgb(224, 224, 224)",fill:$,lineWidth:1},disable:{stroke:"rgb(234, 234, 234)",fill:"rgb(250, 250, 250)",lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]}},rt={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,0:.6,1:.40099945068359377,2:.6,3:.6,4:.6,5:.6,6:.6,7:.5469985961914062,8:.6,9:.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875},it=Math.PI,ot=Math.sin,at=Math.cos,st=ot(it/8),ut=at(it/8),ct=function(t,e){var n=t.getBBox(),r={x:n.minX,y:n.minY},i={x:n.maxX,y:n.maxY};if(e){var o=e.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),r=O(r,o),i=O(i,o)}var a=r.x,s=r.y,u=i.x,c=i.y;return{x:a,y:s,minX:a,minY:s,maxX:u,maxY:c,width:u-a,height:c-s}},ht=function(t){var e=t.sourceNode||t.targetNode,n=e.get("group").getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var r=e.getKeyShape().getBBox(),i=t.loopCfg||{},o=i.dist||2*Math.max(r.width,r.height),a=i.position||nt.defaultLoopPosition,s=[n[6],n[7]],u=[t.startPoint.x,t.startPoint.y],c=[t.endPoint.x,t.endPoint.y],h=r.height/2,l=r.height/2,f=h*st,d=h*ut,p=l*st,v=l*ut;if(u[0]===c[0]&&u[1]===c[1]){switch(a){case"top":u=[s[0]-f,s[1]-d],c=[s[0]+p,s[1]-v];break;case"top-right":h=r.height/2,l=r.width/2,u=[s[0]+(f=h*st),s[1]-(d=h*ut)],c=[s[0]+(v=l*ut),s[1]-(p=l*st)];break;case"right":h=r.width/2,l=r.width/2,u=[s[0]+(d=h*ut),s[1]-(f=h*st)],c=[s[0]+(v=l*ut),s[1]+(p=l*st)];break;case"bottom-right":h=r.width/2,l=r.height/2,u=[s[0]+(d=h*ut),s[1]+(f=h*st)],c=[s[0]+(p=l*st),s[1]+(v=l*ut)];break;case"bottom":h=r.height/2,l=r.height/2,u=[s[0]+(f=h*st),s[1]+(d=h*ut)],c=[s[0]-(p=l*st),s[1]+(v=l*ut)];break;case"bottom-left":h=r.height/2,l=r.width/2,u=[s[0]-(f=h*st),s[1]+(d=h*ut)],c=[s[0]-(v=l*ut),s[1]+(p=l*st)];break;case"left":h=r.width/2,l=r.width/2,u=[s[0]-(d=h*ut),s[1]+(f=h*st)],c=[s[0]-(v=l*ut),s[1]-(p=l*st)];break;case"top-left":h=r.width/2,l=r.height/2,u=[s[0]-(d=h*ut),s[1]-(f=h*st)],c=[s[0]-(p=l*st),s[1]-(v=l*ut)];break;default:h=r.width/2,l=r.width/2,u=[s[0]-(f=h*st),s[1]-(d=h*ut)],c=[s[0]+(p=l*st),s[1]-(v=l*ut)]}if(!1===i.clockwise){var y=[u[0],u[1]];u=[c[0],c[1]],c=[y[0],y[1]]}}var m=[u[0]-s[0],u[1]-s[1]],b=(h+o)/h,x=(l+o)/l;!1===i.clockwise&&(b=(l+o)/l,x=(h+o)/h);var w=g.c.scale([0,0],m,b),M=[s[0]+w[0],s[1]+w[1]],S=[c[0]-s[0],c[1]-s[1]],O=g.c.scale([0,0],S,x),k=[s[0]+O[0],s[1]+O[1]];return t.startPoint={x:u[0],y:u[1]},t.endPoint={x:c[0],y:c[1]},t.controlPoints=[{x:M[0],y:M[1]},{x:k[0],y:k[1]}],t},lt=function(t,e,n,r,i){var o=[],a=t.getPoint(e);if(null===a)return{x:0,y:0,angle:0};if(e<1e-4)o=t.getStartTangent().reverse();else if(e>.9999)o=t.getEndTangent();else{var s=t.getPoint(e+1e-4);o.push([a.x,a.y]),o.push([s.x,s.y])}var u=Math.atan2(o[1][1]-o[0][1],o[1][0]-o[0][0]);if(u<0&&(u+=2*it),n&&(a.x+=at(u)*n,a.y+=ot(u)*n),r){var c=u-it/2;u>.5*it&&u<1.5*it&&(c-=it),a.x+=at(c)*r,a.y+=ot(c)*r}var h={x:a.x,y:a.y,angle:u};return i?(u>.5*it&&u<1.5*it&&(u-=it),Object(f.a)({rotate:u},h)):h},ft=function t(e,n){if(!1===n(e))return!1;if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return!1;return!0},dt=function(t,e){"function"==typeof e&&ft(t,e)},pt=function(t,e){"function"==typeof e&&function t(e,n){if(e&&e.children)for(var r=e.children.length-1;r>=0;r--)if(!t(e.children[r],n))return;return!1!==n(e)}(t,e)},gt=function(t,e){return e*(rt[t]||1)},vt=function(t,e){var n=0,r=new RegExp("[一-龥]+");return t.split("").forEach((function(t){r.test(t)?n+=e:n+=gt(t,e)})),[n,e]},yt=function(t,e){var n=[],r={},i={};t.forEach((function(t){i[t.id]=t})),t.forEach((function(t,e){var o=Object(u.a)(t);o.itemType="combo",o.children=void 0,o.parentId===o.id?(console.warn("The parentId for combo "+o.id+" can not be the same as the combo's id"),delete o.parentId):o.parentId&&!i[o.parentId]&&(console.warn("The parent combo for combo "+o.id+" does not exist!"),delete o.parentId);var a=r[o.id];if(a){if(o.children=a.children,r[o.id]=o,!(a=o).parentId)return void n.push(a);var s=r[a.parentId];if(s)s.children?s.children.push(o):s.children=[o];else{var c={id:a.parentId,children:[a]};r[a.parentId]=c,r[o.id]=o}}else if(Object(u.o)(t.parentId)){var h=r[t.parentId];if(h)h.children?h.children.push(o):h.children=[o],r[o.id]=o;else{var l={id:t.parentId,children:[o]};r[l.id]=l,r[o.id]=o}}else n.push(o),r[o.id]=o}));var o={};(e||[]).forEach((function(t){o[t.id]=t;var e=r[t.comboId];if(e){var n={id:t.id,comboId:t.comboId};e.children?e.children.push(n):e.children=[n],n.itemType="node",r[t.id]=n}}));var a=0;return n.forEach((function(t){t.depth=a+10,ft(t,(function(t){var e,n=r[t.id].itemType;e="node"===n?r[t.comboId]:r[t.parentId],t.depth=e&&"node"===n?a+1:a+10,a<t.depth&&(a=t.depth);var i=o[t.id];return i&&(i.depth=t.depth),!0}))})),n},mt=function(t,e,n){var r,i=t,o={root:{children:t}},a=!1,s="root";(t||[]).forEach((function(t){if(!a)return t.id===e?(r=t,"combo"===t.itemType?r.parentId=n:r.comboId=n,void(a=!0)):void dt(t,(function(t){return o[t.id]={children:t.children},i=o[t.parentId||t.comboId||"root"].children,!t||!t.removed&&e!==t.id||!i||(s=t.parentId||t.comboId||"root",r=t,"combo"===t.itemType?r.parentId=n:r.comboId=n,a=!0,!1)}))}));var u=(i=o[s].children)?i.indexOf(r):-1;if(u>-1&&i.splice(u,1),a||(r={id:e,itemType:"node",comboId:n},o[e]={children:void 0}),e){var c=!1;if(n){var h=0;(t||[]).forEach((function(t){c||dt(t,(function(t){return n!==t.id||(c=!0,t.children?t.children.push(r):t.children=[r],h=t.depth,"node"===r.itemType?r.depth=h+2:r.depth=h+1,!1)}))}))}else n&&c||"node"===r.itemType||t.push(r);var l=r.depth;dt(r,(function(t){return"node"===t.itemType?l+=2:l+=1,t.depth=l,!0}))}return t},bt=function(t,e){var n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};return t&&0!==t.length?(t.forEach((function(t){var r=e.findById(t.id);if(r&&r.isVisible()){r.set("bboxCanvasCache",void 0);var i=r.getCanvasBBox();i.x&&n.minX>i.minX&&(n.minX=i.minX),i.y&&n.minY>i.minY&&(n.minY=i.minY),i.x&&n.maxX<i.maxX&&(n.maxX=i.maxX),i.y&&n.maxY<i.maxY&&(n.maxY=i.maxY)}})),n.x=(n.minX+n.maxX)/2,n.y=(n.minY+n.maxY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,Object.keys(n).forEach((function(t){n[t]!==1/0&&n[t]!==-1/0||(n[t]=void 0)})),n):n},xt=function(t){var e=Object(u.k)(t.x)||Object(u.k)(t.y)||t.type||t.anchorPoints||t.size;return t.style&&(e=e||Object(u.k)(t.style.r)||Object(u.k)(t.style.width)||Object(u.k)(t.style.height)||Object(u.k)(t.style.rx)||Object(u.k)(t.style.ry)),e},wt=function(t){var e={};return Object.keys(t).forEach((function(n){var r=t[n];if(Object(u.m)(r)){var i={};Object.keys(r).forEach((function(t){var e=r[t];("img"!==t||Object(u.o)(e))&&(i[t]=Object(u.a)(e))})),e[n]=i}else e[n]=Object(u.a)(r)})),e},Mt=function(t){if(!t)return console.error("G6 Error Tips: the data must be defined"),!1;var e=t.nodes,n=t.edges,r=t.combos,i=void 0===r?[]:r;if(!e&&!n){var o=!0;return dt(t,(function(t){return!!Object(u.o)(t.id)||(o=!1,!1)})),o}var a=(e||[]).find((function(t){return!Object(u.o)(t.id)}));if(a)return console.warn("G6 Warning Tips: missing 'id' property, or %c"+a.id+"%c is not a string.","font-size: 20px; color: red;",""),!1;var s=(e||[]).map((function(t){return t.id})),c=i.map((function(t){return t.id})),h=Object(f.f)(Object(f.f)([],s),c),l=(n||[]).find((function(t){return!h.includes(t.source)||!h.includes(t.target)}));return!l||(console.warn("G6 Warning Tips: The source %c"+l.source+"%c or the target %c"+l.target+"%c of the edge do not exist in the nodes or combos.","font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1)},St=function(){function t(t){this.graph=t,this.destroyed=!1,this.modes=t.get("modes")||{default:[]},this.formatModes(),this.mode=t.get("defaultMode")||"default",this.currentBehaves=[],this.setMode(this.mode)}return t.prototype.formatModes=function(){var t=this.modes;Object(u.c)(t,(function(t){Object(u.c)(t,(function(e,n){Object(u.o)(e)&&(t[n]={type:e})}))}))},t.prototype.setBehaviors=function(t){var e,n=this.graph,r=this.modes[t],i=[];Object(u.c)(r||[],(function(t){var r=h.getBehavior(t.type||t);r&&(e=new r(t))&&(e.bind(n),i.push(e))})),this.currentBehaves=i},t.mergeBehaviors=function(t,e){return Object(u.c)(e,(function(e){t.indexOf(e)<0&&(Object(u.o)(e)&&(e={type:e}),t.push(e))})),t},t.filterBehaviors=function(t,e){var n=[];return t.forEach((function(t){var r="";r=Object(u.o)(t)?t:t.type,e.indexOf(r)<0&&n.push(t)})),n},t.prototype.setMode=function(t){var e=this.modes,n=this.graph,r=t;e[r]&&(n.emit("beforemodechange",{mode:t}),Object(u.c)(this.currentBehaves,(function(t){t.delegate&&t.delegate.remove(),t.unbind(n)})),this.setBehaviors(r),n.emit("aftermodechange",{mode:t}),this.mode=t)},t.prototype.getMode=function(){return this.mode},t.prototype.manipulateBehaviors=function(e,n,r){var i,o=this;if(i=Object(u.f)(e)?e:[e],Object(u.f)(n))return Object(u.c)(n,(function(e){o.modes[e]?o.modes[e]=r?t.mergeBehaviors(o.modes[e]||[],i):t.filterBehaviors(o.modes[e]||[],i):r&&(o.modes[e]=i)})),this;var a=n;return n||(a=this.mode),this.modes[a]||r&&(this.modes[a]=i),this.modes[a]=r?t.mergeBehaviors(this.modes[a]||[],i):t.filterBehaviors(this.modes[a]||[],i),this.setMode(this.mode),this},t.prototype.updateBehavior=function(t,e,n){Object(u.o)(t)&&(t={type:t});var r=[];if(n&&n!==this.mode&&"default"!==n){if(!(r=this.modes[n])||!r.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;var i=r.length;for(a=0;a<i;a++){if((s=r[a]).type===t.type||s===t.type)return s===t.type&&(s={type:s}),Object.assign(s,e),r[a]=s,this;a===i-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}else{if(!(r=this.currentBehaves)||!r.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var o=r.length,a=0;a<o;a++){var s;if((s=r[a]).type===t.type)return s.updateCfg(e),this;a===o-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}return this},t.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},t}(),Ot=n(48),kt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.item=n.item,r.canvasX=n.canvasX,r.canvasY=n.canvasY,r.detail=n.detail,r}return Object(f.c)(e,t),e}(n(46).Event),Ct=function(t){return t+"-"+Math.random()+Date.now()},Et=function(t){var e=0,n=0,r=0,i=0;if(Object(u.k)(t))e=n=r=i=t;else if(Object(u.o)(t)){e=n=r=i=parseInt(t,10)}else Object(u.f)(t)&&(e=t[0],r=Object(u.j)(t[1])?t[0]:t[1],i=Object(u.j)(t[2])?t[0]:t[2],n=Object(u.j)(t[3])?r:t[3]);return[e,r,i,n]},Pt=function(t){var e=new kt(t.type,t);return e.clientX=t.clientX,e.clientY=t.clientY,e.x=t.x,e.y=t.y,e.target=t.target,e.currentTarget=t.currentTarget,e.bubbles=!0,e.item=t.item,e},jt=function(t){if(!t)return!1;for(var e=[1,0,0,0,1,0,0,0,1],n=0;n<9;n++)if(t[n]!==e[n])return!0;return!1},At=function(t){return Number.isNaN(Number(t))},It=function(t){for(var e=1/0,n=-1/0,r=1/0,i=-1/0,o=0;o<t.length;o++){var a=t[o].getBBox(),s=a.minX,u=a.minY,c=a.maxX,h=a.maxY;s<e&&(e=s),u<r&&(r=u),c>n&&(n=c),h>i&&(i=h)}return{x:Math.floor(e),y:Math.floor(r),width:Math.ceil(n)-Math.floor(e),height:Math.ceil(i)-Math.floor(r),minX:e,minY:r,maxX:n,maxY:i}},Tt=function(t,e,n,r,i){void 0===e&&(e=15),void 0===n&&(n="quadratic"),void 0===r&&(r=void 0),void 0===i&&(i=void 0);for(var o=t.length,a=2*e,s=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],u={},c=[],h={},l=0;l<o;l++){var f=t[l],d=f.source,p=f.target,g=d+"-"+p;if(!c[l]){u[g]||(u[g]=[]),c[l]=!0,u[g].push(f);for(var v=0;v<o;v++)if(l!==v){var y=t[v],m=y.source,b=y.target;c[v]||(d===b&&p===m?(u[g].push(y),c[v]=!0,h[m+"|"+b+"|"+(u[g].length-1)]=!0):d===m&&p===b&&(u[g].push(y),c[v]=!0))}}}for(var x in u)for(var w=u[x],M=w.length,S=0;S<M;S++){var O=w[S];if(O.source!==O.target)if(1===M&&r&&O.source!==O.target)O.type=r;else{O.type=n;var k=(S%2==0?1:-1)*(h[O.source+"|"+O.target+"|"+S]?-1:1);O.curveOffset=M%2==1?k*Math.ceil(S/2)*a:k*(Math.floor(S/2)*a+e)}else i&&(O.type=i),O.loopCfg={position:s[S%8],dist:20*Math.floor(S/8)+50}}return t},Nt=function(){function t(t){this.destroyed=!1,this.graph=t,this.destroyed=!1}return t.prototype.getViewCenter=function(){var t=this.getFormatPadding(),e=this.graph,n=this.graph.get("width"),r=e.get("height");return{x:(n-t[1]-t[3])/2+t[3],y:(r-t[0]-t[2])/2+t[0]}},t.prototype.fitCenter=function(){var t=this.graph,e=t.get("group");e.resetMatrix();var n=e.getCanvasBBox();if(0!==n.width&&0!==n.height){var r=this.getViewCenter(),i=n.x+n.width/2,o=n.y+n.height/2;t.translate(r.x-i,r.y-o)}},t.prototype.fitView=function(){var t=this.graph,e=this.getFormatPadding(),n=t.get("width"),r=t.get("height"),i=t.get("group");i.resetMatrix();var o=i.getCanvasBBox();if(0!==o.width&&0!==o.height){var a=this.getViewCenter(),s=o.x+o.width/2,u=o.y+o.height/2;t.translate(a.x-s,a.y-u);var c=(n-e[1]-e[3])/o.width,h=(r-e[0]-e[2])/o.height,l=c;c>h&&(l=h),t.zoom(l,a)}},t.prototype.getFormatPadding=function(){var t=this.graph.get("fitViewPadding");return Et(t)},t.prototype.focusPoint=function(t,e,n){var r=this,i=this.getViewCenter(),o=this.getPointByCanvas(i.x,i.y),a=this.graph.get("group").getMatrix();if(a||(a=[1,0,0,0,1,0,0,0,1]),e){var s=(o.x-t.x)*a[0],u=(o.y-t.y)*a[4],c=0,h=0,l=0,d=0;this.graph.get("canvas").animate((function(t){l=s*t,d=u*t,r.graph.translate(l-c,d-h),c=l,h=d}),Object(f.a)({},n))}else this.graph.translate((o.x-t.x)*a[0],(o.y-t.y)*a[4])},t.prototype.getPointByCanvas=function(t,e){var n=this.graph.get("group").getMatrix();return n||(n=[1,0,0,0,1,0,0,0,1]),k({x:t,y:e},n)},t.prototype.getPointByClient=function(t,e){var n=this.graph.get("canvas").getPointByClient(t,e);return this.getPointByCanvas(n.x,n.y)},t.prototype.getClientByPoint=function(t,e){var n=this.graph.get("canvas"),r=this.getCanvasByPoint(t,e),i=n.getClientByPoint(r.x,r.y);return{x:i.x,y:i.y}},t.prototype.getCanvasByPoint=function(t,e){var n=this.graph.get("group").getMatrix();return n||(n=[1,0,0,0,1,0,0,0,1]),O({x:t,y:e},n)},t.prototype.focus=function(t,e,n){if(Object(u.o)(t)&&(t=this.graph.findById(t)),t){var r=0,i=0;if(t.getType&&"edge"===t.getType()){var o=t.getSource().get("group").getMatrix(),a=t.getTarget().get("group").getMatrix();o&&a?(r=(o[6]+a[6])/2,i=(o[7]+a[7])/2):(o||a)&&(r=o?o[6]:a[6],i=o?o[7]:a[7])}else{var s=t.get("group").getMatrix();s||(s=[1,0,0,0,1,0,0,0,1]),r=s[6],i=s[7]}this.focusPoint({x:r,y:i},e,n)}},t.prototype.changeSize=function(t,e){var n=this.graph;if(!Object(u.k)(t)||!Object(u.k)(e))throw Error("invalid canvas width & height, please make sure width & height type is number");n.set({width:t,height:e}),n.get("canvas").changeSize(t,e),n.get("plugins").forEach((function(r){if(r.get("gridContainer")){var i=n.get("minZoom");Object(Ot.b)(r.get("container"),{width:t+"px",height:e+"px"}),Object(Ot.b)(r.get("gridContainer"),{width:t/i+"px",height:e/i+"px",left:0,top:0})}}))},t.prototype.destroy=function(){this.graph=null,this.destroyed=!1},t}();function Bt(t){return(Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _t(t){if("string"!=typeof t)return t;var e=function(t){if("string"!=typeof t)return t;try{return JSON.parse(t.trim())}catch(e){return t.trim()}},n=e(t);if("string"!=typeof n)return n;for(var r=function(t){return t[t.length-1]},i=t.trim(),o=[],a=[],s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.some((function(t){return r(a)===t}))},u=null,c=0,h="";c<i.length;){var l=i[c],f=s('"',"'");if(f||l.trim()){var d="\\"===i[c-1],p=s("}"),g=s("]"),v=s(","),y=r(o);if(f)if(r(a)!==l||d)h+=l;else{a.pop();var m=e(h);y.push(m),u=m,h=""}else if(g&&","===l)h&&(y.push(e(h)),h="");else if(p&&":"===l)a.push(","),h&&(y.push(h),h="");else if(v&&","===l)h&&(y.push(e(h)),h=""),a.pop();else if("}"===l&&(p||v)){h&&(y.push(e(h)),h=""),v&&a.pop();for(var b={},x=1;x<y.length;x+=2)b[y[x-1]]=y[x];o.pop(),o.length&&r(o).push(b),a.pop(),u=b}else"]"===l&&g?(h&&(y.push(e(h)),h=""),o.pop(),o.length&&r(o).push(y),a.pop(),u=y):"{"===l?(o.push([]),a.push("}")):"["===l?(o.push([]),a.push("]")):'"'===l?a.push('"'):"'"===l?a.push("'"):h+=l;c+=1}else c+=1}return u||h}function Lt(t,e){var n;void 0===e&&(e={x:0,y:0});var r=Object(f.a)({x:0,y:0,width:0,height:0},e);if(null===(n=t.children)||void 0===n?void 0:n.length){var i=t.attrs,o=void 0===i?{}:i,a=o.marginTop,s=Object(f.a)({},e);a&&(s.y+=a);for(var u=0;u<t.children.length;u++){t.children[u].attrs.key=(o.key||"root")+" -"+u+" ";var c=Lt(t.children[u],s);if(c.bbox){var h=c.bbox;"inline"===c.attrs.next?s.x+=c.bbox.width:s.y+=c.bbox.height,h.width+h.x>r.width&&(r.width=h.width+h.x),h.height+h.y>r.height&&(r.height=h.height+h.y)}}}return t.bbox=function(t,e,n){var r,i,o=t.attrs,a=void 0===o?{}:o,s={x:e.x||0,y:e.y||0,width:n.width||0,height:n.height||0};switch(t.type){case"maker":case"circle":a.r&&(i=2*a.r,r=2*a.r);break;case"text":a.text&&(i=vt(a.text,a.fontSize||12)[0],r=16,s.y+=r,s.height=r,s.width=i,t.attrs=Object(f.a)({fontSize:12,fill:"#000"},a));break;default:a.width&&(i=a.width),a.height&&(r=a.height)}return r>=0&&(s.height=r),i>=0&&(s.width=i),a.marginTop&&(s.y+=a.marginTop),a.marginLeft&&(s.x+=a.marginLeft),s}(t,e,r),t.attrs=Object(f.a)(Object(f.a)({},t.attrs),t.bbox),t}function Dt(t){var e={},n=function(e){var n=function(t){return function(e){for(var n=t.length,r=[],i=0,o="";i<n;)if("{"===t[i]&&"{"===t[i+1])r.push(o),o="",i+=2;else if("}"===t[i]&&"}"===t[i+1]){if(r.length){var a=r.pop();o=Object(u.d)(e,o,a.endsWith("=")?'"{'+o+'}"':o),r.push(a+o)}i+=2,o=""}else o+=t[i],i+=1;return r.push(o),r.map((function(t,e){return r[e-1]&&r[e-1].endsWith("=")?'"{'+t+'}"':t})).join("")}}("function"==typeof t?t(e):t)(e),r=document.createElement("div");r.innerHTML=n;var i=Lt(function t(e,n){var r={},i=e.getAttributeNames&&e.getAttributeNames()||[],o=e.children&&Array.from(e.children).map((function(e){return t(e,n)})),a={},s=e.tagName?e.tagName.toLowerCase():"group";return"text"===s&&(r.text=e.innerText),a.type=s,"img"===s&&(a.type="image"),Array.from(i).forEach((function(t){var n=t.split("-").reduce((function(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)})),i=e.getAttribute(t);try{if("style"===n||"attrs"===n){var o=_t(i);r=Object(f.a)(Object(f.a)({},r),o)}else a[n]=_t(i)}catch(t){if("style"===n)throw t;a[n]=i}})),a.attrs=r,n&&n.style&&a.name&&"object"===Bt(n.style[a.name])&&(a.attrs=Object(f.a)(Object(f.a)({},a.attrs),n.style[a.name])),n&&n.style&&a.keyshape&&(a.attrs=Object(f.a)(Object(f.a)({},a.attrs),n.style)),o.length&&(a.children=o),a}(r.children[0],e));return r.remove(),i};return{draw:function(t,r){var i=n(t),o=r;return function t(e){var n=e.attrs,i=void 0===n?{}:n,a=e.bbox,s=e.type,u=e.children,c=Object(f.e)(e,["attrs","bbox","type","children"]);if("group"!==e.type){var h=r.addShape(e.type,Object(f.a)({attrs:i,origin:{bbox:a,type:s,children:u}},c));e.keyshape&&(o=h)}e.children&&e.children.forEach((function(e){return t(e)}))}(i),e[t.id]=[i],o},update:function(t,r){e[t.id]||(e[t.id]=[]);var i=r.getContainer(),o=i.get("children"),a=n(t),s=function t(e,n){var r,i,o,a,s=(e||{}).type,u=((null==n?void 0:n.attrs)||{}).key;if(u&&e&&(e.attrs.key=u),!e&&n)return{action:"delete",val:n,type:s,key:u};if(e&&!n)return{action:"add",val:e,type:s};if(!e&&!n)return{action:"same",type:s};var c=[];if((null===(r=e.children)||void 0===r?void 0:r.length)>0||(null===(i=n.children)||void 0===i?void 0:i.length)>0)for(var h=Math.max(null===(o=e.children)||void 0===o?void 0:o.length,null===(a=n.children)||void 0===a?void 0:a.length),l=n.children||[],f=e.children||[],d=0;d<h;d+=1)c.push(t(f[d],l[d]));var p=Object.keys(n.attrs),g=Object.keys(e.attrs);return n.type!==e.type?{action:"restructure",nowTarget:e,formerTarget:n,key:u,children:c}:p.filter((function(t){return"children"!==t})).some((function(t){return e.attrs[t]!==n.attrs[t]||!g.includes(t)}))?{action:"change",val:e,children:c,type:s,key:u}:{action:"same",children:c,type:s,key:u}}(a,e[t.id].pop()),u=function t(e){var n;"group"!==e.type&&i.addShape(e.type,{attrs:e.attrs}),(null===(n=e.children)||void 0===n?void 0:n.length)&&e.children.map((function(e){return t(e)}))},c=function t(e){var n,r=o.find((function(t){return t.attrs.key===e.attrs.key}));r&&i.removeChild(r),(null===(n=e.children)||void 0===n?void 0:n.length)&&e.children.map((function(e){return t(e)}))};!function t(e){var n=e.key;if("group"!==e.type){var i=o.find((function(t){return t.attrs.key===n}));switch(e.action){case"change":if(i){var a=e.val.keyshape?r.getOriginStyle():{};i.attr(Object(f.a)(Object(f.a)({},a),e.val.attrs))}break;case"add":u(e.val);break;case"delete":c(e.val);break;case"restructure":c(e.formerTarget),u(e.nowTarget)}}e.children&&e.children.forEach((function(e){return t(e)}))}(s),e[t.id].push(a)},getAnchorPoints:function(){return[[0,.5],[1,.5],[.5,1],[.5,0]]}}}var Rt={};function Ft(t){return Rt[t]||(Rt[t]=Object(u.w)(t)),Rt[t]}var Xt={defaultShapeType:"defaultType",className:null,getShape:function(t){return this[t]||this[this.defaultShapeType]||this["simple-circle"]},draw:function(t,e,n){var r=this.getShape(t),i=r.draw(e,n);return r.afterDraw&&r.afterDraw(e,n,i),i},baseUpdate:function(t,e,n){var r=this.getShape(t);r.update&&r.update(e,n),r.afterUpdate&&r.afterUpdate(e,n)},setState:function(t,e,n,r){this.getShape(t).setState(e,n,r)},shouldUpdate:function(t){return!!this.getShape(t).update},getControlPoints:function(t,e){return this.getShape(t).getControlPoints(e)},getAnchorPoints:function(t,e){return this.getShape(t).getAnchorPoints(e)}},Yt={options:{},draw:function(t,e){return this.drawShape(t,e)},drawShape:function(){},afterDraw:function(){},afterUpdate:function(){},setState:function(){},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e=this.options.anchorPoints;return t.anchorPoints||e}},zt=function(){function t(){}return t.registerFactory=function(e,n){var r=Ft(e),i=Xt,o=Object(f.a)(Object(f.a)({},i),n);return t[r]=o,o.className=r,o},t.getFactory=function(e){return t[Ft(e)]},t.registerNode=function(e,n,r){var i,o=t.Node;if("string"==typeof n||"function"==typeof n){var a=Dt(n);i=Object(f.a)(Object(f.a)({},o.getShape("single-node")),a)}else if(n.jsx){a=Dt(n.jsx);i=Object(f.a)(Object(f.a)(Object(f.a)({},o.getShape("single-node")),a),n)}else{o.getShape(r);var s=r?o.getShape(r):Yt;i=Object(f.a)(Object(f.a)({},s),n)}return i.type=e,i.itemType="node",o[e]=i,i},t.registerEdge=function(e,n,r){var i=t.Edge,o=r?i.getShape(r):Yt,a=Object(f.a)(Object(f.a)({},o),n);return a.type=e,a.itemType="edge",i[e]=a,a},t.registerCombo=function(e,n,r){var i=t.Combo,o=r?i.getShape(r):Yt,a=Object(f.a)(Object(f.a)({},o),n);return a.type=e,a.itemType="combo",i[e]=a,a},t}(),Wt=zt;zt.registerFactory("node",{defaultShapeType:"circle"}),zt.registerFactory("edge",{defaultShapeType:"line"}),zt.registerFactory("combo",{defaultShapeType:"circle"});var qt=function(){function t(t){this._cfg={},this.destroyed=!1;var e={id:void 0,type:"item",model:{},group:void 0,animate:!1,visible:!0,locked:!1,event:!0,keyShape:void 0,states:[]};this._cfg=Object.assign(e,this.getDefaultCfg(),t);var n=this.get("model"),r=n.id,i=this.get("type");r||(r=Ct(i),this.get("model").id=r),this.set("id",r);var o=t.group;o&&(o.set("item",this),o.set("id",r)),this.init(),this.draw();var a=n.shape||n.type||("edge"===i?"line":"circle"),s=this.get("shapeFactory");if(s&&s[a]){var c=s[a].options;if(c&&c.stateStyles){var h=this.get("styles")||n.stateStyles;h=Object(u.b)({},c.stateStyles,h),this.set("styles",h)}}}return t.prototype.calculateBBox=function(){var t=this.get("keyShape"),e=this.get("group"),n=ct(t,e);return n.x=n.minX,n.y=n.minY,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,n},t.prototype.calculateCanvasBBox=function(){var t=this.get("keyShape"),e=this.get("group"),n=ct(t,e);return n.x=n.minX,n.y=n.minY,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,n},t.prototype.drawInner=function(){var t=this.get("shapeFactory"),e=this.get("group"),n=this.get("model");e.clear();var r=n.visible;if(void 0===r||r||this.changeVisibility(r),t){this.updatePosition(n);var i=this.getShapeCfg(n),o=i.type,a=t.draw(o,i,e);a&&(this.set("keyShape",a),a.set("isKeyShape",!0),a.set("draggable",!0)),this.setOriginStyle(),this.set("currentShape",o),this.restoreStates(t,o)}},t.prototype.setOriginStyle=function(){var t=this.get("group").get("children"),e=this.getKeyShape(),n=this,r=e.get("name");if(this.get("originStyle")){var i=this.getOriginStyle();r&&!i[r]&&(i[r]={});var o=this.getCurrentStatesStyle();Object(u.c)(t,(function(t){var e=t.get("name"),a=t.attr();if(e&&e!==r){var s=o[e];i[e]||(i[e]={}),s?Object.keys(a).forEach((function(t){var n=a[t];n!==s[t]&&(i[e][t]=n)})):i[e]="image"!==t.get("type")?Object(u.a)(a):n.getShapeStyleByName(e)}else{var c=t.attr(),h=Object(f.a)(Object(f.a)({},o),o[r]);Object.keys(c).forEach((function(t){var e=c[t];h[t]!==e&&(r?i[r][t]=e:i[t]=e)}))}})),i.path&&delete i.path,i.matrix&&delete i.matrix,i.x&&delete i.x,i.y&&delete i.y,i[r]&&i[r].x&&delete i[r].x,i[r]&&i[r].y&&delete i[r].y,n.set("originStyle",i)}else{var a={};Object(u.c)(t,(function(t){var e=t.get("type"),i=t.get("name");if(i&&i!==r)a[i]="image"!==e?Object(u.a)(t.attr()):n.getShapeStyleByName(i);else{var o=n.getShapeStyleByName();if(o.path&&delete o.path,o.matrix&&delete o.matrix,r)if(i)a[r]=o;else{var s=Ct("shape");t.set("name",s),a[s]="image"!==e?Object(u.a)(t.attr()):n.getShapeStyleByName(i)}else Object.assign(a,o)}})),n.set("originStyle",a)}},t.prototype.restoreStates=function(t,e){var n=this,r=n.get("states");Object(u.c)(r,(function(r){t.setState(e,r,!0,n)}))},t.prototype.init=function(){var t=Wt.getFactory(this.get("type"));this.set("shapeFactory",t)},t.prototype.get=function(t){return this._cfg[t]},t.prototype.set=function(t,e){Object(u.n)(t)?this._cfg=Object(f.a)(Object(f.a)({},this._cfg),t):this._cfg[t]=e},t.prototype.getDefaultCfg=function(){return{}},t.prototype.clearCache=function(){this.set("bboxCache",null),this.set("bboxCanvasCache",null)},t.prototype.beforeDraw=function(){},t.prototype.afterDraw=function(){},t.prototype.afterUpdate=function(){},t.prototype.draw=function(){this.beforeDraw(),this.drawInner(),this.afterDraw()},t.prototype.getShapeStyleByName=function(t){var e,n=this.get("group");if(e=t?n.find((function(e){return e.get("name")===t})):this.getKeyShape()){var r={};return Object(u.c)(e.attr(),(function(t,e){"img"!==e&&(r[e]=t)})),r}return{}},t.prototype.getShapeCfg=function(t){var e=this.get("styles");if(e){var n=t;return n.style=Object(f.a)(Object(f.a)({},e),t.style),n}return t},t.prototype.getStateStyle=function(t){var e=this.get("styles");return e&&e[t]},t.prototype.getOriginStyle=function(){return this.get("originStyle")},t.prototype.getCurrentStatesStyle=function(){var t=this,e={},n=t.getStates();return n&&n.length?(Object(u.c)(t.getStates(),(function(n){e=Object.assign(e,t.getStateStyle(n))})),e):this.getOriginStyle()},t.prototype.setState=function(t,e){var n=this.get("states"),r=this.get("shapeFactory"),i=t,o=t;Object(u.o)(e)&&(i=t+":"+e,o=t+":");var a=n;if(Object(u.g)(e)){var s=n.indexOf(o);if(e){if(s>-1)return;n.push(i)}else s>-1&&n.splice(s,1)}else if(Object(u.o)(e)){var c=n.filter((function(t){return t.includes(o)}));c.length>0&&this.clearStates(c),(a=a.filter((function(t){return!t.includes(o)}))).push(i),this.set("states",a)}if(r){var h=this.get("model").type;r.setState(h,t,e,this)}},t.prototype.clearStates=function(t){var e=this,n=e.getStates(),r=e.get("shapeFactory"),i=e.get("model").type;t||(t=n),Object(u.o)(t)&&(t=[t]);var o=n.filter((function(e){return-1===t.indexOf(e)}));e.set("states",o),t.forEach((function(t){r.setState(i,t,!1,e)}))},t.prototype.getContainer=function(){return this.get("group")},t.prototype.getKeyShape=function(){return this.get("keyShape")},t.prototype.getModel=function(){return this.get("model")},t.prototype.getType=function(){return this.get("type")},t.prototype.getID=function(){return this.get("id")},t.prototype.isItem=function(){return!0},t.prototype.getStates=function(){return this.get("states")},t.prototype.hasState=function(t){return this.getStates().indexOf(t)>=0},t.prototype.refresh=function(){var t=this.get("model");this.updatePosition(t),this.updateShape(),this.afterUpdate(),this.clearCache()},t.prototype.isOnlyMove=function(t){return!1},t.prototype.update=function(t,e){void 0===e&&(e=!1);var n=this.get("model"),r=n.visible,i=t.visible;r!==i&&void 0!==i&&this.changeVisibility(i);var o=n.x,a=n.y;t.x=isNaN(t.x)?n.x:t.x,t.y=isNaN(t.y)?n.y:t.y;var s=this.get("styles");if(t.stateStyles){var c=t.stateStyles;Object(u.r)(s,c),delete t.stateStyles}Object.assign(n,t),e?this.updatePosition(t):(o===t.x&&a===t.y||this.updatePosition(t),this.updateShape()),this.afterUpdate(),this.clearCache()},t.prototype.updateShape=function(){var t=this.get("shapeFactory"),e=this.get("model"),n=e.type;if(t.shouldUpdate(n)&&n===this.get("currentShape")){var r=this.getShapeCfg(e);t.baseUpdate(n,r,this),this.setOriginStyle()}else this.draw();this.restoreStates(t,n)},t.prototype.updatePosition=function(t){var e=this.get("model"),n=Object(u.j)(t.x)?e.x:t.x,r=Object(u.j)(t.y)?e.y:t.y,i=this.get("group");if(Object(u.j)(n)||Object(u.j)(r))return!1;e.x=n,e.y=r;var o=i.getMatrix();return(!o||o[6]!==n||o[7]!==r)&&(i.resetMatrix(),I(i,{x:n,y:r}),this.clearCache(),!0)},t.prototype.getBBox=function(){var t=this.get("bboxCache");return t||(t=this.calculateBBox(),this.set("bboxCache",t)),t},t.prototype.getCanvasBBox=function(){var t=this.get("bboxCanvasCache");return t||(t=this.calculateCanvasBBox(),this.set("bboxCanvasCache",t)),t},t.prototype.toFront=function(){this.get("group").toFront()},t.prototype.toBack=function(){this.get("group").toBack()},t.prototype.show=function(){this.changeVisibility(!0)},t.prototype.hide=function(){this.changeVisibility(!1)},t.prototype.changeVisibility=function(t){var e=this.get("group");t?e.show():e.hide(),this.set("visible",t)},t.prototype.isVisible=function(){return this.get("visible")},t.prototype.enableCapture=function(t){var e=this.get("group");e&&e.set("capture",t)},t.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),this.clearCache(),e.remove(),this._cfg=null,this.destroyed=!0}},t}(),Gt={source:"start",target:"end"},Vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(f.c)(e,t),e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,e){var n=Gt[t]+"Point",r=t+"Node",i=this.get(r);i&&!i.destroyed&&i.removeEdge(this),Object(u.n)(e)?(this.set(n,e),this.set(r,null)):(e.addEdge(this),this.set(r,e),this.set(n,null))},e.prototype.getLinkPoint=function(t,e,n){var r=Gt[t]+"Point",i=t+"Node",o=this.get(r);if(!o){var a=this.get(i),s=t+"Anchor",c=this.getPrePoint(t,n),h=e[s];Object(u.j)(h)||(o=a.getLinkPointByAnchor(h)),o=o||a.getLinkPoint(c),Object(u.j)(o.index)||this.set(t+"AnchorIndex",o.index)}return o},e.prototype.getPrePoint=function(t,e){if(e&&e.length)return e["source"===t?0:e.length-1];var n="source"===t?"target":"source";return this.getEndPoint(n)},e.prototype.getEndPoint=function(t){var e=t+"Node",n=Gt[t]+"Point",r=this.get(e);return r?r.get("model"):this.get(n)},e.prototype.getControlPointsByCenter=function(t){var e=this.getEndPoint("source"),n=this.getEndPoint("target"),r=this.get("shapeFactory"),i=t.type;return r.getControlPoints(i,{startPoint:e,endPoint:n})},e.prototype.getEndCenter=function(t){var e=t+"Node",n=Gt[t]+"Point",r=this.get(e);if(r){var i=r.getBBox();return{x:i.centerX,y:i.centerY}}return this.get(n)},e.prototype.init=function(){t.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(e){var n=this.get("linkCenter"),r=t.prototype.getShapeCfg.call(this,e);if(n)r.startPoint=this.getEndCenter("source"),r.endPoint=this.getEndCenter("target");else{var i=r.controlPoints||this.getControlPointsByCenter(r);r.startPoint=this.getLinkPoint("source",e,i),r.endPoint=this.getLinkPoint("target",e,i)}return r.sourceNode=this.get("sourceNode"),r.targetNode=this.get("targetNode"),r},e.prototype.getModel=function(){var t=this.get("model"),e=this.get("sourceNode"),n=this.get("targetNode");return e?delete t.sourceNode:t.source=this.get("startPoint"),n?delete t.targetNode:t.target=this.get("endPoint"),Object(u.o)(t.source)||Object(u.n)(t.source)||(t.source=t.source.getID()),Object(u.o)(t.target)||Object(u.n)(t.target)||(t.target=t.target.getID()),t},e.prototype.setSource=function(t){this.setEnd("source",t),this.set("source",t)},e.prototype.setTarget=function(t){this.setEnd("target",t),this.set("target",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.getTarget=function(){return this.get("target")},e.prototype.updatePosition=function(){return!1},e.prototype.update=function(t,e){void 0===e&&(e=!1);var n=this.get("model"),r=n.visible,i=t.visible;r!==i&&void 0!==i&&this.changeVisibility(i);var o=this.get("styles");if(t.stateStyles){var a=t.stateStyles;Object(u.r)(o,a),delete t.stateStyles}Object.assign(n,t),this.updateShape(),this.afterUpdate(),this.clearCache()},e.prototype.destroy=function(){var e=this.get("sourceNode"),n=this.get("targetNode");e&&!e.destroyed&&e.removeEdge(this),n&&!n.destroyed&&n.removeEdge(this),t.prototype.destroy.call(this)},e}(qt),Ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(f.c)(e,t),e.prototype.getNearestPoint=function(t,e){for(var n=0,r=t[0],i=E(t[0],e),o=0;o<t.length;o++){var a=t[o],s=E(a,e);s<i&&(r=a,i=s,n=o)}return r.anchorIndex=n,r},e.prototype.getDefaultCfg=function(){return{type:"node",edges:[]}},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getInEdges=function(){var t=this;return this.get("edges").filter((function(e){return e.get("target")===t}))},e.prototype.getOutEdges=function(){var t=this;return this.get("edges").filter((function(e){return e.get("source")===t}))},e.prototype.getNeighbors=function(t){var e=this,n=this.get("edges");if("target"===t){return n.filter((function(t){return t.getSource()===e})).map((function(t){return t.getTarget()}))}if("source"===t){return n.filter((function(t){return t.getTarget()===e})).map((function(t){return t.getSource()}))}return n.map((function(t){return t.getSource()===e?t.getTarget():t.getSource()}))},e.prototype.getLinkPointByAnchor=function(t){return this.getAnchorPoints()[t]},e.prototype.getLinkPoint=function(t){var e,n,r=this.get("keyShape").get("type"),i=this.get("type"),o=this.getBBox();"combo"===i?(e=o.centerX||(o.maxX+o.minX)/2,n=o.centerY||(o.maxY+o.minY)/2):(e=o.centerX,n=o.centerY);var a,s=this.getAnchorPoints();switch(r){case"circle":a=M({x:e,y:n,r:o.width/2},t);break;case"ellipse":a=S({x:e,y:n,rx:o.width/2,ry:o.height/2},t);break;default:a=w(o,t)}var u=a;return s.length&&(u||(u=t),u=this.getNearestPoint(s,u)),u||(u={x:e,y:n}),u},e.prototype.getAnchorPoints=function(){var t=this.get("anchorPointsCache");if(!t){t=[];var e=this.get("shapeFactory"),n=this.getBBox(),r=this.get("model"),i=this.getShapeCfg(r),o=r.type,a=e.getAnchorPoints(o,i)||[];Object(u.c)(a,(function(e,r){var i={x:n.minX+e[0]*n.width,y:n.minY+e[1]*n.height,anchorIndex:r};t.push(i)})),this.set("anchorPointsCache",t)}return t},e.prototype.addEdge=function(t){this.get("edges").push(t)},e.prototype.lock=function(){this.set("locked",!0)},e.prototype.unlock=function(){this.set("locked",!1)},e.prototype.hasLocked=function(){return this.get("locked")},e.prototype.removeEdge=function(t){var e=this.getEdges(),n=e.indexOf(t);n>-1&&e.splice(n,1)},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("anchorPointsCache",null)},e.prototype.isOnlyMove=function(t){if(!t)return!1;var e=!Object(u.j)(t.x),n=!Object(u.j)(t.y),r=Object.keys(t);return 1===r.length&&(e||n)||2===r.length&&e&&n},e}(qt),Ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(f.c)(e,t),e.prototype.getDefaultCfg=function(){return{type:"combo",nodes:[],edges:[],combos:[]}},e.prototype.getShapeCfg=function(t){var e=this.get("styles"),n=this.get("bbox");if(e&&n){var r=t,i={r:Math.hypot(n.height,n.width)/2||nt.defaultCombo.size[0]/2,width:n.width||nt.defaultCombo.size[0],height:n.height||nt.defaultCombo.size[1]};r.style=Object(f.a)(Object(f.a)(Object(f.a)({},e),t.style),i);var o=t.padding||nt.defaultCombo.padding;return Object(u.k)(o)?(i.r+=o,i.width+=2*o,i.height+=2*o):(i.r+=o[0],i.width+=o[1]+o[3]||2*o[1],i.height+=o[0]+o[2]||2*o[0]),this.set("sizeCache",i),r}return t},e.prototype.calculateCanvasBBox=function(){if(!this.destroyed){var t=this.get("keyShape"),e=this.get("group"),n=ct(t,e);n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2;var r=this.get("sizeCache"),i=this.get("bboxCache")||{},o=i.x,a=i.x;if(r)r.width=Math.max(r.width,n.width),r.height=Math.max(r.height,n.height),"circle"===t.get("type")?(n.width=2*r.r,n.height=2*r.r):(n.width=r.width,n.height=r.height),n.minX=n.centerX-n.width/2,n.minY=n.centerY-n.height/2,n.maxX=n.centerX+n.width/2,n.maxY=n.centerY+n.height/2;else n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2;return n.x=n.minX,n.y=n.minY,n.x===o&&n.y===a||this.set("anchorPointsCache",null),n}},e.prototype.getChildren=function(){return{nodes:this.getNodes(),combos:this.getCombos()}},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.addChild=function(t){switch(t.getType()){case"node":this.addNode(t);break;case"combo":this.addCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.addCombo=function(t){return this.get("combos").push(t),!0},e.prototype.addNode=function(t){return this.get("nodes").push(t),!0},e.prototype.removeChild=function(t){switch(t.getType()){case"node":this.removeNode(t);break;case"combo":this.removeCombo(t);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},e.prototype.removeCombo=function(t){if(t){var e=this.getCombos(),n=e.indexOf(t);return n>-1&&(e.splice(n,1),!0)}},e.prototype.removeNode=function(t){if(t){var e=this.getNodes(),n=e.indexOf(t);return n>-1&&(e.splice(n,1),!0)}},e.prototype.isOnlyMove=function(t){return!1},e.prototype.getBBox=function(){return this.set("bboxCanvasCache",null),this.calculateCanvasBBox()},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("bboxCanvasCache",null),this.set("anchorPointsCache",null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),this.clearCache(),this.set("sizeCache",null),this.set("bbox",null),e.remove(),this._cfg=null,this.destroyed=!0}},e}(Ht),Zt=function(){function t(t){this.graph=t,this.destroyed=!1}return t.prototype.addItem=function(t,e){var n=this.graph,r="vedge"===t?"edge":t,i=n.get(r+"Group")||n.get("group"),o=Object(u.w)(r),a=null,s=n.get(r+Object(u.w)("stateStyles"))||{},c=n.get("default"+o);e.stateStyles&&(s=e.stateStyles),c&&Object(u.c)(c,(function(t,n){Object(u.m)(t)&&!Object(u.f)(t)?e[n]=Object(u.b)({},t,e[n]):Object(u.f)(t)?e[n]=e[n]||Object(u.a)(c[n]):e[n]=e[n]||c[n]}));var h=n.get(r+"Mapper");if(h){var l=h(e);l.stateStyles&&(s=l.stateStyles,delete l.stateStyles),Object(u.c)(l,(function(t,n){Object(u.m)(t)&&!Object(u.f)(t)?e[n]=Object(u.b)({},e[n],t):e[n]=l[n]||e[n]}))}if(n.emit("beforeadditem",{type:t,model:e}),"edge"===t||"vedge"===t){var f=void 0,d=void 0;if(f=e.source,d=e.target,f&&Object(u.o)(f)&&(f=n.findById(f)),d&&Object(u.o)(d)&&(d=n.findById(d)),!f||!d)return void console.warn("The source or target node of edge "+e.id+" does not exist!");f.getType&&"combo"===f.getType()&&(e.isComboEdge=!0),d.getType&&"combo"===d.getType()&&(e.isComboEdge=!0),a=new Vt({model:e,source:f,target:d,styles:s,linkCenter:n.get("linkCenter"),group:i.addGroup()})}else if("node"===t)a=new Ht({model:e,styles:s,group:i.addGroup()});else if("combo"===t){var p=e.children,g=bt(p,n);isNaN(g.x)?isNaN(e.x)&&(e.x=100*Math.random()):e.x=g.x,isNaN(g.y)?isNaN(e.y)&&(e.y=100*Math.random()):e.y=g.y;var v=i.addGroup();v.setZIndex(e.depth);var y=(a=new Ut({model:e,styles:s,bbox:e.collapsed?bt([],n):g,group:v})).getModel();(p||[]).forEach((function(t){var e=n.findById(t.id);a.addChild(e),t.depth=y.depth+2})),e.collapsed&&setTimeout((function(){n.collapseCombo(a)}),16)}if(a)return n.get(t+"s").push(a),n.get("itemMap")[a.get("id")]=a,n.emit("afteradditem",{item:a,model:e}),a},t.prototype.updateItem=function(t,e){var n,r,i=this.graph;if(Object(u.o)(t)&&(t=i.findById(t)),t&&!t.destroyed){var o="";t.getType&&(o=t.getType());var a=i.get(o+"Mapper"),s=t.getModel(),c=t.isOnlyMove(e);if(a){var h=a(Object(u.b)({},s,e)),l=Object(u.b)({},s,h,e);h.stateStyles&&(t.set("styles",l.stateStyles),delete l.stateStyles),Object(u.c)(l,(function(t,n){e[n]=t}))}else Object(u.c)(e,(function(t,n){s[n]&&Object(u.m)(t)&&!Object(u.f)(t)&&(e[n]=Object(f.a)(Object(f.a)({},s[n]),e[n]))}));if(i.emit("beforeupdateitem",{item:t,cfg:e}),"edge"===o){if(e.source){var d=e.source;Object(u.o)(d)&&(d=i.findById(d)),t.setSource(d)}if(e.target){var p=e.target;Object(u.o)(p)&&(p=i.findById(p)),t.setTarget(p)}t.update(e)}if("node"===o||"combo"===o){t.update(e,c);var g=t.getEdges(),v=xt(e);if(v&&"node"===o)Object(u.c)(g,(function(t){t.refresh()}));else if(v&&"combo"===o){var y=t.get("shapeFactory"),m=s.type||"circle";(void 0===s.animate||void 0===e.animate?null===(r=null===(n=y[m])||void 0===n?void 0:n.options)||void 0===r?void 0:r.animate:s.animate||e.animate)?setTimeout((function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&Object(u.c)(g,(function(t){t&&!t.destroyed&&t.refresh()}))}}),201):Object(u.c)(g,(function(t){t.refresh()}))}}i.emit("afterupdateitem",{item:t,cfg:e})}},t.prototype.updateCombo=function(t,e){var n,r,i=this,o=this.graph;if(Object(u.o)(t)&&(t=o.findById(t)),t&&!t.destroyed){var a=t.getModel(),s=bt(a.collapsed?[]:e,o);t.set("bbox",s),t.update({x:s.x,y:s.y});var c=t.get("shapeFactory"),h=a.type||"circle";(void 0===a.animate?null===(r=null===(n=c[h])||void 0===n?void 0:n.options)||void 0===r?void 0:r.animate:a.animate)?setTimeout((function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&(t.getShapeCfg(a),i.updateComboEdges(t))}}),201):this.updateComboEdges(t)}},t.prototype.updateComboEdges=function(t){for(var e=t.getEdges()||[],n=0;n<e.length;n++){var r=e[n];if(r&&!r.destroyed){var i=r.get("shapeFactory"),o=r.getShapeCfg(r.getModel()),a=r.getContainer();a.clear();var s=i.draw(o.type,o,a);r.set("keyShape",s),s.set("isKeyShape",!0),s.set("draggable",!0),r.setOriginStyle()}}},t.prototype.collapseCombo=function(t){var e=this.graph;Object(u.o)(t)&&(t=e.findById(t));var n=t.getChildren();n.nodes.forEach((function(t){e.hideItem(t)})),n.combos.forEach((function(t){e.hideItem(t)}))},t.prototype.expandCombo=function(t){var e=this.graph;Object(u.o)(t)&&(t=e.findById(t));var n=t.getChildren();n.nodes.forEach((function(t){e.showItem(t)})),n.combos.forEach((function(t){t.getModel().collapsed?t.show():e.showItem(t)}))},t.prototype.removeItem=function(t){var e=this,n=this.graph;if(Object(u.o)(t)&&(t=n.findById(t)),t&&!t.destroyed){var r=Object(u.a)(t.getModel());n.emit("beforeremoveitem",{item:r});var i="";t.getType&&(i=t.getType());var o=n.get(i+"s"),a=o.indexOf(t);if(a>-1&&o.splice(a,1),"edge"===i){var s=n.get("v"+i+"s"),c=s.indexOf(t);c>-1&&s.splice(c,1)}var h=t.get("id");delete n.get("itemMap")[h];var l=n.get("comboTrees"),f=t.get("id");if("node"===i){var d=t.getModel().comboId;if(l&&d){var p=l,g=!1;l.forEach((function(t){g||dt(t,(function(t){if(t.id===f&&p){var e=p.indexOf(t);return p.splice(e,1),g=!0,!1}return p=t.children,!0}))}))}for(var v=(x=t.getEdges()).length-1;v>=0;v--)n.removeItem(x[v],!1);d&&n.updateCombo(d)}else if("combo"===i){var y,m=t.getModel().parentId,b=!1;(l||[]).forEach((function(t){b||dt(t,(function(t){return t.id!==f||(y=t,b=!0,!1)}))})),y.removed=!0,y&&y.children&&y.children.forEach((function(t){e.removeItem(t.id)}));var x;for(v=(x=t.getEdges()).length;v>=0;v--)n.removeItem(x[v],!1);m&&n.updateCombo(m)}t.destroy(),n.emit("afterremoveitem",{item:r})}},t.prototype.setItemState=function(t,e,n){var r=this.graph,i=e;Object(u.o)(n)&&(i=e+":"+n),t.hasState(i)===n&&n||Object(u.o)(n)&&t.hasState(i)||(r.emit("beforeitemstatechange",{item:t,state:i,enabled:n}),t.setState(e,n),r.autoPaint(),r.emit("afteritemstatechange",{item:t,state:i,enabled:n}))},t.prototype.priorityState=function(t,e){var n=this.graph,r=t;Object(u.o)(t)&&(r=n.findById(t)),this.setItemState(r,e,!1),this.setItemState(r,e,!0)},t.prototype.clearItemStates=function(t,e){var n=this.graph;Object(u.o)(t)&&(t=n.findById(t)),n.emit("beforeitemstatesclear",{item:t,states:e}),t.clearStates(e),n.emit("afteritemstatesclear",{item:t,states:e})},t.prototype.refreshItem=function(t){var e=this.graph;Object(u.o)(t)&&(t=e.findById(t)),e.emit("beforeitemrefresh",{item:t}),t.refresh(),e.emit("afteritemrefresh",{item:t})},t.prototype.addCombos=function(t,e){var n=this,r=this.graph;(t||[]).forEach((function(t){pt(t,(function(t){var r;return e.forEach((function(e){e.id===t.id&&(e.children=t.children,e.depth=t.depth,r=e)})),r&&n.addItem("combo",r),!0}))}));var i=r.get("comboGroup");i&&i.sort()},t.prototype.changeItemVisibility=function(t,e){var n=this,r=this.graph;if(Object(u.o)(t)&&(t=r.findById(t)),t){if(r.emit("beforeitemvisibilitychange",{item:t,visible:e}),t.changeVisibility(e),t.getType&&"node"===t.getType()){var i=t.getEdges();Object(u.c)(i,(function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&n.changeItemVisibility(t,e)}))}else if(t.getType&&"combo"===t.getType()){var o=r.get("comboTrees"),a=t.get("id"),s=[],c=!1;(o||[]).forEach((function(t){c||t.children&&0!==t.children.length&&dt(t,(function(t){return t.id!==a||(s=t.children,c=!0,!1)}))})),s&&(!e||e&&!t.getModel().collapsed)&&s.forEach((function(t){var i=r.findById(t.id);n.changeItemVisibility(i,e)}));i=t.getEdges();Object(u.c)(i,(function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&n.changeItemVisibility(t,e)}))}return r.emit("afteritemvisibilitychange",{item:t,visible:e}),t}console.warn("The item to be shown or hidden does not exist!")},t.prototype.destroy=function(){this.graph=null,this.destroyed=!0},t}(),Qt=null,Kt=function(){function t(t){this.graph=t,this.cachedStates={enabled:{},disabled:{}},this.destroyed=!1}return t.checkCache=function(t,e,n){if(n[e]){var r=n[e].indexOf(t);r>=0&&n[e].splice(r,1)}},t.cacheState=function(t,e,n){n[e]||(n[e]=[]),n[e].push(t)},t.prototype.updateState=function(e,n,r){var i=this,o=t.checkCache,a=t.cacheState;if(!e.destroyed){var s=this.cachedStates,u=s.enabled,c=s.disabled;r?(o(e,n,c),a(e,n,u)):(o(e,n,u),a(e,n,c)),Qt&&clearTimeout(Qt),Qt=setTimeout((function(){Qt=null,i.updateGraphStates()}),16)}},t.prototype.updateStates=function(t,e,n){var r=this;Object(u.o)(e)?this.updateState(t,e,n):e.forEach((function(e){r.updateState(t,e,n)}))},t.prototype.updateGraphStates=function(){var t=this.graph.get("states"),e=this.cachedStates;Object(u.c)(e.disabled,(function(e,n){t[n]&&(t[n]=t[n].filter((function(t){return e.indexOf(t)<0&&!e.destroyed})))})),Object(u.c)(e.enabled,(function(e,n){if(t[n]){var r={};t[n].forEach((function(t){t.destroyed||(r[t.get("id")]=!0)})),e.forEach((function(e){if(!e.destroyed){var i=e.get("id");r[i]||(r[i]=!0,t[n].push(e))}}))}else t[n]=e})),this.graph.emit("graphstatechange",{states:t}),this.cachedStates={enabled:{},disabled:{}}},t.prototype.destroy=function(){this.graph=null,this.cachedStates=null,Qt&&clearTimeout(Qt),Qt=null,this.destroyed=!0},t}(),$t=n(40),Jt=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){if("\\"===t.charAt(0))return t.slice(1);var r=e[n];return 0===r&&(r="0"),r||""})):t},te=function(t){var e=[];if(t.length<2)throw new Error("point length must largn than 2, now it's "+t.length);for(var n=0,r=t;n<r.length;n++){var i=r[n],o=i.x,a=i.y;e.push(o),e.push(a)}var s=Object($t.a)(e);return s.unshift(["M",t[0].x,t[0].y]),s},ee=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i={x:(1-n)*t.x+n*e.x,y:(1-n)*t.y+n*e.y},o=[0,0];g.c.normalize(o,[e.x-t.x,e.y-t.y]),o&&(o[0]||o[1])||(o=[0,0]);var a=[-o[1]*r,o[0]*r];return i.x+=a[0],i.y+=a[1],i},ne=function(t,e){var n=t.length;if(!n)return"";for(var r="",i=0;i<n;i++){var o=t[i];r+=Jt(0===i?"M{x} {y}":"L{x} {y}",o)}return e&&(r+="Z"),r},re=function(t){var e=[];return t.forEach((function(t){if("A"!==t[0])for(var n=1;n<t.length;n+=2)e.push([t[n],t[n+1]]);else{var r=t.length;e.push([t[r-2],t[r-1]])}})),e},ie=function(t){if(t.length<2)throw new Error("point length must largn than 2, now it's "+t.length);var e=t[0],n=t[1],r=t[t.length-1],i=t[t.length-2];t.unshift(r),t.unshift(i),t.push(e),t.push(n);for(var o=[],a=1;a<t.length-2;a+=1){var s=t[a-1].x,u=t[a-1].y,c=t[a].x,h=t[a].y,l=t[a+1].x,f=t[a+1].y,d=c+(l-s)/6,p=h+(f-u)/6,g=l-((a!==t.length-2?t[a+2].x:l)-c)/6,v=f-((a!==t.length-2?t[a+2].y:f)-h)/6;o.push(["C",d,p,g,v,l,f])}return o.unshift(["M",r.x,r.y]),o},oe=function(t,e){return g.c.scale([0,0],g.c.normalize([0,0],t),e)},ae=function(t,e){var n=[t[1]-e[1],e[0]-t[0]],r=Math.sqrt(n[0]*n[0]+n[1]*n[1]);if(0===r)throw new Error("p0 should not be equal to p1");return[n[0]/r,n[1]/r]},se=function(t,e){return[e[0]-t[0],e[1]-t[1]]};function ue(t,e){if(!t||t.length<1)return"";if(1===t.length)return function(t){var n=[t[0][0],t[0][1]-e],r=[t[0][0],t[0][1]+e];return"M "+n+" A "+e+","+e+",0,0,0,"+r+" A "+e+","+e+",0,0,0,"+n}(t);if(2===t.length)return function(t){var n=g.c.scale([0,0],ae(t[0],t[1]),e),r=g.c.scale([0,0],n,-1),i=g.c.add([0,0],t[0],n),o=g.c.add([0,0],t[1],n),a=g.c.add([0,0],t[1],r),s=g.c.add([0,0],t[0],r);return"M "+i+" L "+o+" A "+[e,e,"0,0,0",a].join(",")+" L "+s+" A "+[e,e,"0,0,0",i].join(",")}(t);for(var n=new Array(t.length),r=0;r<n.length;++r){var i=0===r?t[t.length-1]:t[r-1],o=t[r],a=g.c.scale([0,0],ae(i,o),e);n[r]=[g.c.add([0,0],i,a),g.c.add([0,0],o,a)]}var s="A "+[e,e,"0,0,0,"].join(",");return(n=n.map((function(t,e){var r="";return 0===e&&(r="M "+n[n.length-1][1]+" "),r+=s+t[0]+" L "+t[1]}))).join(" ")}function ce(t,e){var n,r,i,o=t.length;if(!t||o<1)return"";if(1===o)return r=[(n=t)[0][0],n[0][1]-e],i=[n[0][0],n[0][1]+e],"M "+r+" A "+[e,e,"0,0,0",i].join(",")+" A "+[e,e,"0,0,0",r].join(",");if(2===o)return function(t){var n=se(t[0],t[1]),r=oe(n,e),i=g.c.add([0,0],t[0],g.c.scale([0,0],r,-1)),o=g.c.add([0,0],t[1],r),a=1.2*e,s=oe(g.c.normalize([0,0],n),a),u=g.c.scale([0,0],s,-1),c=g.c.add([0,0],i,u),h=g.c.add([0,0],o,u),l=g.c.add([0,0],i,s);return"M "+i+" C "+[c,h,o].join(",")+" S "+[l,i].join(",")+" Z"}(t);for(var a=t.map((function(e,n){var r=t[(n+1)%o];return{p:e,v:g.c.normalize([0,0],se(e,r))}})),s=0;s<a.length;++s){var u=s>0?s-1:o-1,c=g.c.normalize([0,0],g.c.add([0,0],a[u].v,g.c.scale([0,0],a[s].v,-1)));a[s].p=g.c.add([0,0],a[s].p,g.c.scale([0,0],c,e))}return a.map((function(t){var e=t.p;return{x:e[0],y:e[1]}}))}var he=function(t,e,n){return(t.y-n.y)*(e.x-n.x)-(t.x-n.x)*(e.y-n.y)},le=function(t){var e=t.map((function(t){return{x:t.getModel().x,y:t.getModel().y}}));if(e.sort((function(t,e){return t.x===e.x?t.y-e.y:t.x-e.x})),1===e.length)return e;for(var n=[],r=0;r<e.length;r++){for(;n.length>=2&&he(n[n.length-2],n[n.length-1],e[r])<=0;)n.pop();n.push(e[r])}var i=[];for(r=e.length-1;r>=0;r--){for(;i.length>=2&&he(i[i.length-2],i[i.length-1],e[r])<=0;)i.pop();i.push(e[r])}return i.pop(),n.pop(),n.concat(i)},fe={maxRoutingIterations:100,maxMarchingIterations:100,pixelGroupSize:2,edgeR0:10,edgeR1:10,nodeR0:5,nodeR1:10,morphBuffer:5,threshold:.001,skip:16,nodeInfluenceFactor:1,edgeInfluenceFactor:1,negativeNodeInfluenceFactor:-.5};function de(t,e,n){var r=!1,i=function(t,n){return e.cells[t+n*e.width]},o=function(t,e){var r=0;return i(t-1,e-1)>=n&&(r+=1),i(t,e-1)>n&&(r+=2),i(t-1,e)>n&&(r+=4),i(t,e)>n&&(r+=8),r},a=function(n,r){for(var i,a,s=n,u=r,c=0;c<e.width*e.height;c++){if(i=s,a=u,t.findIndex((function(t){return t.x===s&&t.y===u}))>-1){if(t[0].x===s&&t[0].y===u)return!0}else t.push({x:s,y:u});var h=o(s,u);switch(h){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:s++;break;case 12:case 14:case 4:s--;break;case 6:0===i&&(-1===a?s-=1:s+=1);break;case 1:case 13:case 5:u--;break;case 9:1===i&&(0===a?u-=1:u+=1);break;case 10:case 8:case 11:u++;break;default:return console.warn("Marching squares invalid state: "+h),!0}}};this.march=function(){for(var t=0;t<e.width&&!r;t+=1)for(var s=0;s<e.height&&!r;s+=1)i(t,s)>n&&15!==o(t,s)&&(r=a(t,s));return r}}var pe=function(t,e){var n=Number.POSITIVE_INFINITY,r=null;return t.forEach((function(t){var i=q(t,e);i>=0&&i<n&&(r=t,n=i)})),r};function ge(t,e,n,r,i){var o=function(t,e,n){var r=null,i=Number.POSITIVE_INFINITY;return e.forEach((function(e){var o={x:t.getModel().x,y:t.getModel().y},a={x:e.getModel().x,y:e.getModel().y},s=V(o,a),u=new X(o.x,o.y,a.x,a.y),c=n.reduce((function(t,e){return q(e,u)>0?t+1:t}),0);s*Math.pow(c+1,2)<i&&(r=e,i=s*Math.pow(c+1,2))})),r}(t,n,e);if(null===o)return[];return function(t){for(var n=[];t.length>0;){var r=t.pop();if(0===t.length){n.push(r);break}var i=t.pop(),o=new X(r.x1,r.y1,i.x2,i.y2);pe(e,o)?(n.push(r),t.push(i)):t.push(o)}return n}(function(t,e,n,r){var i=[],o=[];o.push(t);for(var a=!0,s=0,u=function(t,e){var n=!1;return e.forEach((function(e){n||(U(t,{x:e.x1,y:e.y1})||U(t,{x:e.x2,y:e.y2}))&&(n=!0)})),n},c=function(t,e){for(var n=0,r=e;n<r.length;n++){var i=r[n].getBBox(),o=[[i.x,i.y],[i.x+i.width,i.y],[i.x,i.y+i.height],[i.x+i.width,i.y+i.height]];if(D(o,t.x,t.y))return!0}return!1};a&&s<n;){a=!1;for(var h=function(){var t=o.pop(),n=pe(e,t);if(n){var h=W(n,t),l=h[0];if(2===h[1]){var f=function(s){for(var h=r,f=me(n,h,l,s),d=u(f,o)||u(f,i),p=c(f,e);!d&&p&&h>=1;)f=me(n,h/=1.5,l,s),d=u(f,o)||u(f,i),p=c(f,e);!f||d||s&&p||(o.push(new X(t.x1,t.y1,f.x,f.y)),o.push(new X(f.x,f.y,t.x2,t.y2)),a=!0)};f(!0),a||f(!1)}}a||i.push(t),s+=1};!a&&o.length;)h()}for(;o.length;)i.push(o.pop());return i}(new X(t.getModel().x,t.getModel().y,o.getModel().x,o.getModel().y),e,r,i))}var ve=function(t,e,n){var r=Object.assign(fe,n),i=G(t.map((function(t){return{x:t.getModel().x,y:t.getModel().y}})));t=t.sort((function(t,e){return V({x:t.getModel().x,y:t.getModel().y},i)-V({x:e.getModel().x,y:e.getModel().y},i)}));var o=[],a=[];t.forEach((function(t){ge(t,e,o,r.maxRoutingIterations,r.morphBuffer).forEach((function(t){a.push(t)})),o.push(t)}));for(var s,u,c,h,l,f=function(t,e,n){var r={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,width:0,height:0,x:0,y:0},i=[];t.forEach((function(t){i.push(t.getBBox())})),e.forEach((function(t){i.push(t.getBBox())}));for(var o=0,a=i;o<a.length;o++){var s=a[o];r.minX=(s.minX<r.minX?s.minX:r.minX)-n,r.minY=(s.minY<r.minY?s.minY:r.minY)-n,r.maxX=(s.maxX>r.maxX?s.maxX:r.maxX)+n,r.maxY=(s.maxY>r.maxY?s.maxY:r.maxY)+n}return r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.x=r.minX,r.y=r.minY,r}(t,a,r.nodeR0),d=(s=f.width,u=f.height,c=r.pixelGroupSize,h=Math.ceil(s/c),l=Math.ceil(u/c),{cells:new Float32Array(Math.max(0,h*l)).fill(0),width:h,height:l}),p=[],g=[],v=0;v<r.maxMarchingIterations;v++)if(ye(t,e,a,f,d,r),g=[],new de(p=[],d,r.threshold).march()){var y=p.map((function(t){return{x:Math.round(t.x*r.pixelGroupSize+f.minX),y:Math.round(t.y*r.pixelGroupSize+f.minY)}}));if(y){var m=y.length;if(r.skip>1)for(m=Math.floor(y.length/r.skip);m<3&&r.skip>1;)r.skip-=1,m=Math.floor(y.length/r.skip);for(var b=0,x=0;x<m;x+=1,b+=r.skip)g.push({x:y[b].x,y:y[b].y})}if(g&&function(){for(var e=0,n=t;e<n.length;e++){var r=n[e],i=g.map((function(t){return[t.x,t.y]}));if(!D(i,r.getBBox().centerX,r.getBBox().centerY))return!1}return!0}())return g;if(r.threshold*=.9,v<=.5*r.maxMarchingIterations)r.memberInfluenceFactor*=1.2,r.edgeInfluenceFactor*=1.2;else{if(!(0!==r.nonMemberInfluenceFactor&&e.length>0))break;r.nonMemberInfluenceFactor*=.8}}return g};function ye(t,e,n,r,i,o){function a(t,e){var n=Math.floor((t-e)/o.pixelGroupSize);return n<0?0:n}function s(t,e){return t*o.pixelGroupSize+e}var u=(o.nodeR0-o.nodeR1)*(o.nodeR0-o.nodeR1),c=(o.edgeR0-o.edgeR1)*(o.edgeR0-o.edgeR1),h=function(t,e){return[Math.min(a(t.minX,e+r.minX),i.width),Math.min(a(t.minY,e+r.minY),i.height),Math.min(a(t.maxX,-e+r.minX),i.width),Math.min(a(t.maxY,-e+r.minY),i.height)]},l=function(t,e){for(var n=t.getBBox(),a=h(n,o.nodeR1),u=a[0],c=a[1],l=a[2],f=a[3],d=c;d<f;d+=1)for(var p=u;p<l;p+=1)if(!(e<0&&i[p+d*i.width]<=0)){var g=s(p,r.minX),v=s(d,r.minY),y=Z({x:g,y:v},{x:n.minX,y:n.minY,width:n.width,height:n.height});if(y<Math.pow(o.nodeR1,2)){var m=Math.sqrt(y)-o.nodeR1;i.cells[p+d*i.width]+=e*m*m}}};o.nodeInfluenceFactor&&t.forEach((function(t){l(t,o.nodeInfluenceFactor/u)})),o.edgeInfluenceFactor&&n.forEach((function(t){!function(t,e){for(var n=t.getBBox(),a=h(n,o.edgeR1),u=a[0],c=a[1],l=a[2],f=a[3],d=c;d<f;d+=1)for(var p=u;p<l;p+=1)if(!(e<0&&i.cells[p+d*i.width]<=0)){var g=s(p,r.minX),v=s(d,r.minY),y=H({x:g,y:v},t);if(y<Math.pow(o.edgeR1,2)){var m=Math.sqrt(y)-o.edgeR1;i.cells[p+d*i.width]+=e*m*m}}}(t,o.edgeInfluenceFactor/c)})),o.negativeNodeInfluenceFactor&&e.forEach((function(t){l(t,o.negativeNodeInfluenceFactor/u)}))}function me(t,e,n,r){var i=t.getBBox(),o=n[0],a=n[1],s=n[2],u=n[3],c={topLeft:{x:i.minX-e,y:i.minY-e},topRight:{x:i.maxX+e,y:i.minY-e},bottomLeft:{x:i.minX-e,y:i.maxY+e},bottomRight:{x:i.maxX+e,y:i.maxY+e}},h=i.height*i.width;function l(t,e){return i.width*(.5*(t.y-i.minY+(e.y-i.minY)))}if(a)return o?r?c.topLeft:c.bottomRight:s?r?c.bottomLeft:c.topRight:l(a,u)<.5*h?a.y>u.y?r?c.topLeft:c.bottomRight:r?c.topRight:c.bottomLeft:a.y<u.y?r?c.bottomLeft:c.topRight:r?c.bottomRight:c.topLeft;if(u){if(o)return r?c.topRight:c.bottomLeft;if(s)return r?c.bottomRight:c.topLeft}return l(o,s)<.5*h?o.x>s.x?r?c.topLeft:c.bottomRight:r?c.bottomLeft:c.topRight:o.x<s.x?r?c.topRight:c.bottomLeft:r?c.bottomRight:c.topLeft}var be=function(){function t(t,e){this.cfg=Object(u.b)(this.getDefaultCfg(),e),this.graph=t,this.id=this.cfg.id,this.group=this.cfg.group,this.members=this.cfg.members.map((function(e){return Object(u.o)(e)?t.findById(e):e})),this.nonMembers=this.cfg.nonMembers.map((function(e){return Object(u.o)(e)?t.findById(e):e})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()}return t.prototype.getDefaultCfg=function(){return{id:"g6-hull",type:"round-convex",members:[],nonMembers:[],style:{fill:"lightblue",stroke:"blue",opacity:.2},padding:10}},t.prototype.setPadding=function(){var t=this.members.length&&this.members[0].getKeyShape().getCanvasBBox().width/2;this.padding=this.cfg.padding>0?this.cfg.padding+t:10+t,this.cfg.bubbleCfg={nodeR0:this.padding-t,nodeR1:this.padding-t,morphBuffer:this.padding-t}},t.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),"round-convex"!==this.type&&"smooth-convex"!==this.type&&"bubble"!==this.type&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},t.prototype.calcPath=function(t,e){var n,r,i;switch(this.type){case"round-convex":i=ue((n=le(t)).map((function(t){return[t.x,t.y]})),this.padding),r=Object($t.b)(i);break;case"smooth-convex":2===(n=le(t)).length?(i=ue(n.map((function(t){return[t.x,t.y]})),this.padding),r=Object($t.b)(i)):n.length>2&&(i=ce(n.map((function(t){return[t.x,t.y]})),this.padding),r=ie(i));break;case"bubble":r=(n=ve(t,e,this.cfg.bubbleCfg)).length>=2&&ie(n)}return r},t.prototype.render=function(){this.group.addShape("path",{attrs:Object(f.a)({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id}),this.group.toBack()},t.prototype.addMember=function(t){if(t){Object(u.o)(t)&&(t=this.graph.findById(t)),this.members.push(t);var e=this.nonMembers.indexOf(t);return e>-1&&this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.addNonMember=function(t){if(t){Object(u.o)(t)&&(t=this.graph.findById(t)),this.nonMembers.push(t);var e=this.members.indexOf(t);return e>-1&&this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.removeMember=function(t){if(t){Object(u.o)(t)&&(t=this.graph.findById(t));var e=this.members.indexOf(t);return e>-1&&(this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.removeNonMember=function(t){if(t){Object(u.o)(t)&&(t=this.graph.findById(t));var e=this.nonMembers.indexOf(t);return e>-1&&(this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.updateData=function(t,e){var n=this;this.group.findById(this.id).remove(),t&&(this.members=t.map((function(t){return Object(u.o)(t)?n.graph.findById(t):t}))),e&&(this.nonMembers=e.map((function(t){return Object(u.o)(t)?n.graph.findById(t):t}))),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.updateStyle=function(t){this.group.findById(this.id).attr(Object(f.a)({},t))},t.prototype.updateCfg=function(t){var e=this;this.cfg=Object(u.b)(this.cfg,t),this.id=this.cfg.id,this.group=this.cfg.group,t.members&&(this.members=this.cfg.members.map((function(t){return Object(u.o)(t)?e.graph.findById(t):t}))),t.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map((function(t){return Object(u.o)(t)?e.graph.findById(t):t}))),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.contain=function(t){var e,n,r=this,i=(e=Object(u.o)(t)?this.graph.findById(t):t).getKeyShape();if("path"===e.get("type"))n=re(i.attr("path"));else{var o=i.getCanvasBBox();n=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return n=n.map((function(t){var e=r.graph.getPointByCanvas(t[0],t[1]);return[e.x,e.y]})),F(n,re(this.path))},t.prototype.destroy=function(){this.group.remove(),this.cfg=null},t}(),xe=g.a.transform,we=function(t){function e(e){var n=t.call(this)||this;return n.cfg=Object(u.b)(n.getDefaultCfg(),e),n.init(),n.animating=!1,n.destroyed=!1,n.cfg.enabledStack&&(n.undoStack=new v.Stack(n.cfg.maxStep),n.redoStack=new v.Stack(n.cfg.maxStep)),n}return Object(f.c)(e,t),e.prototype.init=function(){this.initCanvas();var t=new Nt(this),e=new St(this),n=new Zt(this),r=new Kt(this);this.set({viewController:t,modeController:e,itemController:n,stateController:r}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins(),Object(p.b)(this.onTick.bind(this))},e.prototype.initGroups=function(){var t=this.get("canvas"),e=this.get("canvas").get("el").id,n=t.addGroup({id:e+"-root",className:nt.rootContainerClassName});if(this.get("groupByTypes")){var r=n.addGroup({id:e+"-edge",className:nt.edgeContainerClassName}),i=n.addGroup({id:e+"-node",className:nt.nodeContainerClassName}),o=n.addGroup({id:e+"-combo",className:nt.comboContainerClassName});o.toBack(),this.set({nodeGroup:i,edgeGroup:r,comboGroup:o})}var a=n.addGroup({id:e+"-delegate",className:nt.delegateContainerClassName});this.set({delegateGroup:a}),this.set("group",n)},e.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.2,maxZoom:10,event:!0,groupByTypes:!0,directed:!1,autoPaint:!0,nodes:[],edges:[],combos:[],vedges:[],itemMap:{},linkCenter:!1,defaultNode:{},defaultEdge:{},nodeStateStyles:{},edgeStateStyles:{},states:{},animate:!1,animateCfg:{onFrame:void 0,duration:500,easing:"easeLinear"},callback:void 0,enabledStack:!1,maxStep:10,tooltips:[]}},e.prototype.set=function(t,e){return Object(u.n)(t)?this.cfg=Object(f.a)(Object(f.a)({},this.cfg),t):this.cfg[t]=e,this},e.prototype.get=function(t){return this.cfg[t]},e.prototype.getGroup=function(){return this.get("group")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.getMinZoom=function(){return this.get("minZoom")},e.prototype.setMinZoom=function(t){return this.set("minZoom",t)},e.prototype.getMaxZoom=function(){return this.get("maxZoom")},e.prototype.setMaxZoom=function(t){return this.set("maxZoom",t)},e.prototype.getWidth=function(){return this.get("width")},e.prototype.getHeight=function(){return this.get("height")},e.prototype.clearItemStates=function(t,e){Object(u.o)(t)&&(t=this.findById(t));var n=this.get("itemController");e||(e=t.get("states")),n.clearItemStates(t,e),this.get("stateController").updateStates(t,e,!1)},e.prototype.node=function(t){"function"==typeof t&&this.set("nodeMapper",t)},e.prototype.edge=function(t){"function"==typeof t&&this.set("edgeMapper",t)},e.prototype.combo=function(t){"function"==typeof t&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,e){var n,r=this.get(t+"s");return Object(u.c)(r,(function(t,r){if(e(t,r))return n=t})),n},e.prototype.findAll=function(t,e){var n=[];return Object(u.c)(this.get(t+"s"),(function(t,r){e(t,r)&&n.push(t)})),n},e.prototype.findAllByState=function(t,e){return this.findAll(t,(function(t){return t.hasState(e)}))},e.prototype.translate=function(t,e){var n=this.get("group"),r=Object(u.a)(n.getMatrix());r||(r=[1,0,0,0,1,0,0,0,1]),r=xe(r,[["t",t,e]]),n.setMatrix(r),this.emit("viewportchange",{action:"translate",matrix:n.getMatrix()}),this.autoPaint()},e.prototype.moveTo=function(t,e){var n=this.get("group");T(n,{x:t,y:e}),this.emit("viewportchange",{action:"move",matrix:n.getMatrix()})},e.prototype.fitView=function(t){t&&this.set("fitViewPadding",t),this.get("viewController").fitView(),this.autoPaint()},e.prototype.fitCenter=function(){this.get("viewController").fitCenter(),this.autoPaint()},e.prototype.addBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!0),this},e.prototype.removeBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!1),this},e.prototype.updateBehavior=function(t,e,n){return this.get("modeController").updateBehavior(t,e,n),this},e.prototype.zoom=function(t,e){var n=this.get("group"),r=Object(u.a)(n.getMatrix()),i=this.get("minZoom"),o=this.get("maxZoom");r||(r=[1,0,0,0,1,0,0,0,1]),r=xe(r,e?[["t",-e.x,-e.y],["s",t,t],["t",e.x,e.y]]:[["s",t,t]]),i&&r[0]<i||o&&r[0]>o||(n.setMatrix(r),this.emit("viewportchange",{action:"zoom",matrix:r}),this.autoPaint())},e.prototype.zoomTo=function(t,e){var n=t/this.getZoom();this.zoom(n,e)},e.prototype.focusItem=function(t,e,n){var r=this.get("viewController"),i=!1;e?i=!0:void 0===e&&(i=this.get("animate"));var o={};n?o=n:void 0===n&&(o=this.get("animateCfg")),r.focus(t,i,o),this.autoPaint()},e.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},e.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},e.prototype.getPointByClient=function(t,e){return this.get("viewController").getPointByClient(t,e)},e.prototype.getClientByPoint=function(t,e){return this.get("viewController").getClientByPoint(t,e)},e.prototype.getPointByCanvas=function(t,e){return this.get("viewController").getPointByCanvas(t,e)},e.prototype.getCanvasByPoint=function(t,e){return this.get("viewController").getCanvasByPoint(t,e)},e.prototype.getGraphCenterPoint=function(){var t=this.get("group").getCanvasBBox();return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}},e.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},e.prototype.showItem=function(t,e){void 0===e&&(e=!0);var n=this.get("itemController").changeItemVisibility(t,!0);if(e&&this.get("enabledStack")){var r=n.getID(),i={},o={};switch(n.getType()){case"node":i.nodes=[{id:r,visible:!1}],o.nodes=[{id:r,visible:!0}];break;case"edge":i.nodes=[{id:r,visible:!1}],o.edges=[{id:r,visible:!0}];break;case"combo":i.nodes=[{id:r,visible:!1}],o.combos=[{id:r,visible:!0}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.hideItem=function(t,e){void 0===e&&(e=!0);var n=this.get("itemController").changeItemVisibility(t,!1);if(e&&this.get("enabledStack")){var r=n.getID(),i={},o={};switch(n.getType()){case"node":i.nodes=[{id:r,visible:!0}],o.nodes=[{id:r,visible:!1}];break;case"edge":i.nodes=[{id:r,visible:!0}],o.edges=[{id:r,visible:!1}];break;case"combo":i.nodes=[{id:r,visible:!0}],o.combos=[{id:r,visible:!1}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.refreshItem=function(t){this.get("itemController").refreshItem(t)},e.prototype.setAutoPaint=function(t){this.set("autoPaint",t),this.get("canvas").set("autoDraw",t)},e.prototype.remove=function(t,e){void 0===e&&(e=!0),this.removeItem(t,e)},e.prototype.removeItem=function(t,e){void 0===e&&(e=!0);var n=t;if(Object(u.o)(t)&&(n=this.findById(t)),!n&&Object(u.o)(t))console.warn("The item to be removed does not exist!");else if(n){var r="";if(n.getType&&(r=n.getType()),e&&this.get("enabledStack")){var i=Object(f.a)(Object(f.a)({},n.getModel()),{itemType:r}),o={};switch(r){case"node":o.nodes=[i],o.edges=[];for(var a=n.getEdges(),s=a.length-1;s>=0;s--)o.edges.push(Object(f.a)(Object(f.a)({},a[s].getModel()),{itemType:"edge"}));break;case"edge":o.edges=[i];break;case"combo":o.combos=[i]}this.pushStack("delete",{before:o,after:{}})}if("node"===r)n.getModel().comboId&&this.updateComboTree(n);if(this.get("itemController").removeItem(n),"combo"===r){var c=mt(this.get("comboTrees"));this.set("comboTrees",c)}}},e.prototype.addItem=function(t,e,n,r){void 0===n&&(n=!0),void 0===r&&(r=!0);var i=this.get("comboSorted");this.set("comboSorted",i&&!r);var o=this.get("itemController");if(!function(t,e){if("node"===t||"combo"===t){if(e.id&&!Object(u.o)(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c"+e.id+"%c is not a string.","font-size: 20px; color: red;",""),!1}else if(!("edge"!==t||e.source&&e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0}(t,e))return!1;if(!e.id||!this.findById(e.id)){var a,s=this.get("comboTrees");if(s||(s=[]),"combo"===t){var c=this.get("itemMap"),h=!1;if(s.forEach((function(n){h||pt(n,(function(n){if(e.parentId===n.id){h=!0;var r=Object(f.a)({id:e.id,depth:n.depth+2},e);n.children?n.children.push(r):n.children=[r],e.depth=r.depth,a=o.addItem(t,e)}var i=c[n.id];return h&&i&&i.getType&&"combo"===i.getType()&&o.updateCombo(i,n.children),!0}))})),!h){var l=Object(f.a)({id:e.id,depth:0},e);e.depth=l.depth,s.push(l),a=o.addItem(t,e)}this.set("comboTrees",s)}else if("node"===t&&Object(u.o)(e.comboId)&&s){var d;(d=this.findById(e.comboId))&&d.getType&&"combo"!==d.getType()&&console.warn("'"+e.comboId+"' is not a id of a combo in the graph, the node will be added without combo."),a=o.addItem(t,e);var p=this.get("itemMap"),g=!1,v=!1;(s||[]).forEach((function(t){v||g||pt(t,(function(t){if(t.id===e.id)return v=!0,!1;if(e.comboId===t.id&&!v){g=!0;var n=Object(u.a)(e);n.itemType="node",t.children?t.children.push(n):t.children=[n],n.depth=t.depth+1}return g&&p[t.id].getType&&"combo"===p[t.id].getType()&&o.updateCombo(p[t.id],t.children),!0}))}))}else a=o.addItem(t,e);if("node"===t&&e.comboId||"combo"===t&&e.parentId)(d=this.findById(e.comboId||e.parentId))&&d.getType&&"combo"===d.getType()&&d.addChild(a);var y=this.get("combos");if(y&&y.length>0&&this.sortCombos(),this.autoPaint(),n&&this.get("enabledStack")){var m=Object(f.a)(Object(f.a)({},a.getModel()),{itemType:t}),b={};switch(t){case"node":b.nodes=[m];break;case"edge":b.edges=[m];break;case"combo":b.combos=[m]}this.pushStack("add",{before:{},after:b})}return a}console.warn("This item exists already. Be sure the id %c"+e.id+"%c is unique.","font-size: 20px; color: red;","")},e.prototype.add=function(t,e,n,r){return void 0===n&&(n=!0),void 0===r&&(r=!0),this.addItem(t,e,n,r)},e.prototype.updateItem=function(t,e,n){var r=this;void 0===n&&(n=!0);var i,o=this.get("itemController");i=Object(u.o)(t)?this.findById(t):t;var a=Object(u.a)(i.getModel()),s="";i.getType&&(s=i.getType());var c=Object(f.f)([],i.getStates());if("combo"===s&&Object(u.c)(c,(function(t){return r.setItemState(i,t,!1)})),o.updateItem(i,e),"combo"===s&&Object(u.c)(c,(function(t){return r.setItemState(i,t,!0)})),n&&this.get("enabledStack")){var h={nodes:[],edges:[],combos:[]},l={nodes:[],edges:[],combos:[]},d=Object(f.a)({id:a.id},e);switch(s){case"node":h.nodes.push(a),l.nodes.push(d);break;case"edge":h.edges.push(a),l.edges.push(d);break;case"combo":h.combos.push(a),l.combos.push(d)}"node"===s&&h.nodes.push(a),this.pushStack("update",{before:h,after:l})}},e.prototype.update=function(t,e,n){void 0===n&&(n=!0),this.updateItem(t,e,n)},e.prototype.setItemState=function(t,e,n){Object(u.o)(t)&&(t=this.findById(t)),this.get("itemController").setItemState(t,e,n);var r=this.get("stateController");Object(u.o)(n)?r.updateState(t,e+":"+n,!0):r.updateState(t,e,n)},e.prototype.priorityState=function(t,e){this.get("itemController").priorityState(t,e)},e.prototype.data=function(t){Mt(t),this.set("data",t)},e.prototype.render=function(){var t=this;this.set("comboSorted",!1);var e=this.get("data");if(this.get("enabledStack")&&this.clearStack(),!e)throw new Error("data must be defined first");var n=e.nodes,r=void 0===n?[]:n,i=e.edges,o=void 0===i?[]:i,a=e.combos,s=void 0===a?[]:a;if(this.clear(!0),this.emit("beforerender"),Object(u.c)(r,(function(e){t.add("node",e,!1,!1)})),s&&0!==s.length){var c=yt(s,r);this.set("comboTrees",c),t.addCombos(s)}Object(u.c)(o,(function(e){t.add("edge",e,!1,!1)}));var h=t.get("animate");(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",!1);var l=t.get("layoutController");if(l){if(l.layout((function(){t.get("fitView")?t.fitView():t.get("fitCenter")&&t.fitCenter();t.autoPaint(),t.emit("afterrender"),(t.get("fitView")||t.get("fitCenter"))&&t.set("animate",h)})),this.refreshPositions(),this.destroyed)return}else t.get("fitView")&&t.fitView(),t.get("fitCenter")&&t.fitCenter(),t.emit("afterrender"),t.set("animate",h);this.get("groupByTypes")||(s&&0!==s.length?this.sortCombos():e.nodes&&e.edges&&e.nodes.length<e.edges.length?this.getNodes().forEach((function(t){t.toFront()})):this.getEdges().forEach((function(t){t.toBack()})));this.get("enabledStack")&&this.pushStack("render")},e.prototype.read=function(t){this.data(t),this.render()},e.prototype.diffItems=function(t,e,n){var r,i=this,o=this.get("itemMap");Object(u.c)(n,(function(n){if(r=o[n.id]){if(i.get("animate")&&"node"===t){var a=r.getContainer().getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]),r.set("originAttrs",{x:a[6],y:a[7]})}i.updateItem(r,n,!1)}else r=i.addItem(t,n,!1);r&&e[t+"s"].push(r)}))},e.prototype.changeData=function(t,e){void 0===e&&(e=!0);var n=this;if(!Mt(t))return this;e&&this.get("enabledStack")&&this.pushStack("changedata",{before:n.save(),after:t}),this.set("comboSorted",!1),this.removeHulls(),this.getNodes().map((function(t){return n.clearItemStates(t)})),this.getEdges().map((function(t){return n.clearItemStates(t)}));var r=this.get("canvas"),i=r.get("localRefresh");r.set("localRefresh",!1),n.get("data")||(n.data(t),n.render());var o=this.get("itemMap"),a={nodes:[],edges:[]},s=t.combos;if(s){var c=yt(s,t.nodes);this.set("comboTrees",c)}this.diffItems("node",a,t.nodes),Object(u.c)(o,(function(t,e){o[e].getModel().depth=0,t.getType&&"edge"===t.getType()||(t.getType&&"combo"===t.getType()?(delete o[e],t.destroy()):a.nodes.indexOf(t)<0&&(delete o[e],n.remove(t,!1)))}));for(var h=this.getCombos(),l=h.length-1;l>=0;l--)h[l].destroyed&&h.splice(l,1);s&&(n.addCombos(s),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",a,t.edges),Object(u.c)(o,(function(t,e){(!t.getType||"node"!==t.getType()&&"combo"!==t.getType())&&a.edges.indexOf(t)<0&&(delete o[e],n.remove(t,!1))})),this.set({nodes:a.nodes,edges:a.edges});var f=this.get("layoutController");return f&&(f.changeData(),n.get("animate")&&!f.getLayoutType()?n.positionsAnimate():n.autoPaint()),setTimeout((function(){r.set("localRefresh",i)}),16),this},e.prototype.addCombos=function(t){var e=this.get("comboTrees");this.get("itemController").addCombos(e,t)},e.prototype.createCombo=function(t,e){var n=this;this.set("comboSorted",!1);var r,i="";if(t){if(Object(u.o)(t))i=t,r={id:t};else{if(!(i=t.id))return void console.warn("Create combo failed. Please assign a unique string id for the adding combo.");r=t}var o=e.map((function(t){var e=n.findById(t),r=e.getModel(),o="";e.getType&&(o=e.getType());var a={id:e.getID(),itemType:o};return"combo"===o?(a.parentId=i,r.parentId=i):"node"===o&&(a.comboId=i,r.comboId=i),a}));r.children=o,this.addItem("combo",r,!1),this.set("comboSorted",!1);var a=this.get("comboTrees");(a||[]).forEach((function(t){pt(t,(function(t){return t.id!==i||(t.itemType="combo",t.children=o,!1)}))})),a&&this.sortCombos()}},e.prototype.uncombo=function(t){var e=this,n=t;if(Object(u.o)(t)&&(n=this.findById(t)),!n||n.getType&&"combo"!==n.getType())console.warn("The item is not a combo!");else{var r=n.getModel().parentId,i=this.get("comboTrees");i||(i=[]);var o,a=this.get("itemMap"),s=n.get("id"),c=[],h=this.get("combos"),l=this.findById(r);if(i.forEach((function(i){o||pt(i,(function(i){if(i.id===s){o=i,n.getEdges().forEach((function(t){e.removeItem(t,!1)}));var u=h.indexOf(t);h.splice(u,1),delete a[s],n.destroy()}return!r||!o||i.id!==r||(l.removeCombo(n),-1!==(u=(c=i.children).indexOf(o))&&c.splice(u,1),o.children.forEach((function(t){var n=e.findById(t.id),i=n.getModel();n.getType&&"combo"===n.getType()?(t.parentId=r,delete t.comboId,i.parentId=r,delete i.comboId):n.getType&&"node"===n.getType()&&(t.comboId=r,i.comboId=r),l.addChild(n),c.push(t)})),!1)}))})),!r&&o){var f=i.indexOf(o);i.splice(f,1),o.children.forEach((function(t){t.parentId=void 0;var n=e.findById(t.id).getModel();delete n.parentId,delete n.comboId,"node"!==t.itemType&&i.push(t)}))}}},e.prototype.updateCombos=function(){var t=this,e=this.get("comboTrees"),n=this.get("itemController"),r=this.get("itemMap");(e||[]).forEach((function(e){pt(e,(function(e){if(!e)return!0;var i=r[e.id];if(i&&i.getType&&"combo"===i.getType()){var o=Object(f.f)([],i.getStates());Object(u.c)(o,(function(e){return t.setItemState(i,e,!1)})),n.updateCombo(i,e.children),Object(u.c)(o,(function(e){return t.setItemState(i,e,!0)}))}return!0}))})),this.sortCombos()},e.prototype.updateCombo=function(t){var e,n=this,r=t;if(Object(u.o)(t)&&(r=this.findById(t)),!r||r.getType&&"combo"!==r.getType())console.warn("The item to be updated is not a combo!");else{e=r.get("id");var i=this.get("comboTrees"),o=this.get("itemController"),a=this.get("itemMap");(i||[]).forEach((function(t){pt(t,(function(t){if(!t)return!0;var r=a[t.id];if(e===t.id&&r&&r.getType&&"combo"===r.getType()){var i=Object(f.f)([],r.getStates());Object(u.c)(i,(function(t){r.getStateStyle(t)&&n.setItemState(r,t,!1)})),o.updateCombo(r,t.children),Object(u.c)(i,(function(t){r.getStateStyle(t)&&n.setItemState(r,t,!0)})),e&&(e=t.parentId)}return!0}))}))}},e.prototype.updateComboTree=function(t,e,n){void 0===n&&(n=!0);var r;this.set("comboSorted",!1);var i,o=(r=Object(u.o)(t)?this.findById(t):t).getModel(),a=o.comboId||o.parentId,s="";if(r.getType&&(s=r.getType()),e&&"combo"===s){var c,h=this.get("comboTrees"),l=!0;if((h||[]).forEach((function(t){c||dt(t,(function(t){if(!c)return t.id===r.getID()&&(c=t),!0}))})),dt(c,(function(t){return t.id!==e||(l=!1,!1)})),!l)return void console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!")}if(n&&this.get("enabledStack")){var f={},d={};"combo"===s?(f.combos=[{id:o.id,parentId:o.parentId}],d.combos=[{id:o.id,parentId:e}]):"node"===s&&(f.nodes=[{id:o.id,parentId:o.comboId}],d.nodes=[{id:o.id,parentId:e}]),this.pushStack("updateComboTree",{before:f,after:d})}if(o.parentId||o.comboId){var p=this.findById(o.parentId||o.comboId);p&&p.removeChild(r)}("combo"===s?o.parentId=e:"node"===s&&(o.comboId=e),e)&&((i=this.findById(e))&&i.addChild(r));a&&((i=this.findById(a))&&i.removeChild(r));var g=mt(this.get("comboTrees"),o.id,e);this.set("comboTrees",g),this.updateCombos()},e.prototype.save=function(){var t=[],e=[],n=[];return Object(u.c)(this.get("nodes"),(function(e){t.push(e.getModel())})),Object(u.c)(this.get("edges"),(function(t){e.push(t.getModel())})),Object(u.c)(this.get("combos"),(function(t){n.push(t.getModel())})),{nodes:t,edges:e,combos:n}},e.prototype.changeSize=function(t,e){return this.get("viewController").changeSize(t,e),this},e.prototype.refresh=function(){if(this.emit("beforegraphrefresh"),this.get("animate"))this.positionsAnimate();else{var t=this.get("nodes"),e=this.get("edges"),n=this.get("edges");Object(u.c)(t,(function(t){t.refresh()})),Object(u.c)(e,(function(t){t.refresh()})),Object(u.c)(n,(function(t){t.refresh()}))}this.emit("aftergraphrefresh"),this.autoPaint()},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.getComboChildren=function(t){if(Object(u.o)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType()))return t.getChildren();console.warn("The combo does not exist!")},e.prototype.positionsAnimate=function(){var t=this;t.emit("beforeanimate");var e=t.get("animateCfg"),n=e.onFrame,r=t.getNodes(),i=r.map((function(t){var e=t.getModel();return{id:e.id,x:e.x,y:e.y}}));t.isAnimating()&&t.stopAnimate(),t.get("canvas").animate((function(e){Object(u.c)(i,(function(r){var i=t.findById(r.id);if(i&&!i.destroyed){var o=i.get("originAttrs"),a=i.get("model");if(!o){var s=i.getContainer().getMatrix();s||(s=[1,0,0,0,1,0,0,0,1]),o={x:s[6],y:s[7]},i.set("originAttrs",o)}if(n){var u=n(i,e,r,o);i.set("model",Object.assign(a,u))}else a.x=o.x+(r.x-o.x)*e,a.y=o.y+(r.y-o.y)*e}})),t.refreshPositions()}),{duration:e.duration,easing:e.easing,callback:function(){Object(u.c)(r,(function(t){t.set("originAttrs",null)})),e.callback&&e.callback(),t.emit("afteranimate"),t.animating=!1}})},e.prototype.refreshPositions=function(){this.emit("beforegraphrefreshposition");var t,e=this.get("nodes"),n=this.get("edges"),r=this.get("vedges"),i=this.get("combos"),o={};Object(u.c)(e,(function(e){t=e.getModel();var n=e.get("originAttrs");if(!n||t.x!==n.x||t.y!==n.y){var r=e.updatePosition({x:t.x,y:t.y});o[t.id]=r,t.comboId&&(o[t.comboId]=o[t.comboId]||r)}})),i&&0!==i.length&&this.updateCombos(),Object(u.c)(n,(function(t){var e=t.getSource().getModel(),n=t.getTarget();if(!Object(u.n)(n)){var r=n.getModel();(o[e.id]||o[r.id]||t.getModel().isComboEdge)&&t.refresh()}})),Object(u.c)(r,(function(t){t.refresh()})),this.emit("aftergraphrefreshposition"),this.autoPaint()},e.prototype.stopAnimate=function(){this.get("canvas").stopAnimate()},e.prototype.isAnimating=function(){return this.animating},e.prototype.getZoom=function(){var t=this.get("group").getMatrix();return t?t[0]:1},e.prototype.getCurrentMode=function(){return this.get("modeController").getMode()},e.prototype.setMode=function(t){return this.get("modeController").setMode(t),this},e.prototype.clear=function(t){return void 0===t&&(t=!1),this.get("canvas").clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],groups:[],combos:[],comboTrees:[]}),t||this.emit("afterrender"),this},e.prototype.updateLayout=function(t){var e=this.get("layoutController");Object(u.o)(t)&&(t={type:t});var n=this.get("layout"),r={};Object.assign(r,n,t),this.set("layout",r),e.isLayoutTypeSame(r)&&r.gpuEnabled===n.gpuEnabled?e.updateLayoutCfg(r):e.changeLayout(r)},e.prototype.destroyLayout=function(){this.get("layoutController").destroyLayout()},e.prototype.layout=function(){var t=this.get("layoutController"),e=this.get("layout");e&&t&&(e.workerEnabled?t.layout():t.layoutMethod?t.relayout(!0):t.layout())},e.prototype.collapseCombo=function(t){var e=this;if(Object(u.o)(t)&&(t=this.findById(t)),t){this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var n=t.getModel();this.get("itemController").collapseCombo(t),n.collapsed=!0;var r=this.getEdges().concat(this.get("vedges")),i=[],o=[],a=this.get("comboTrees"),s=!1;(a||[]).forEach((function(t){s||dt(t,(function(t){if(s&&t.depth<=n.depth)return!1;if(n.id===t.id&&(s=!0),s){var r=e.findById(t.id);r&&r.getType&&"combo"===r.getType()&&(i=i.concat(r.getNodes()),o=o.concat(r.getCombos()))}return!0}))}));var c={},h=[];r.forEach((function(t){if(!t.isVisible()||t.getModel().isVEdge){var r=t.getSource(),a=t.getTarget();if((i.includes(r)||o.includes(r))&&!i.includes(a)&&!o.includes(a)||r.getModel().id===n.id){if((f=t.getModel()).isVEdge)return void e.removeItem(t,!1);for(var s=a.getModel();!a.isVisible();){if(!(a=e.findById(s.parentId||s.comboId))||!s.parentId&&!s.comboId)return;s=a.getModel()}var u=s.id;if(c[n.id+"-"+u])return void(c[n.id+"-"+u]+=f.size||1);var l=e.addItem("vedge",{source:n.id,target:u,isVEdge:!0},!1);c[n.id+"-"+u]=f.size||1,h.push(l)}else if(!i.includes(r)&&!o.includes(r)&&(i.includes(a)||o.includes(a))||a.getModel().id===n.id){var f;if((f=t.getModel()).isVEdge)return void e.removeItem(t,!1);for(var d=r.getModel();!r.isVisible();){if(!(r=e.findById(d.parentId||d.comboId))||!d.parentId&&!d.comboId)return;d=r.getModel()}var p=d.id;if(c[p+"-"+n.id])return void(c[p+"-"+n.id]+=f.size||1);l=e.addItem("vedge",{target:n.id,source:p,isVEdge:!0},!1);c[p+"-"+n.id]=f.size||1,h.push(l)}}})),h.forEach((function(t){var n=t.getModel();e.updateItem(t,{size:c[n.source+"-"+n.target]},!1)})),this.emit("aftercollapseexpandcombo",{action:"collapse",item:t})}else console.warn("The combo to be collapsed does not exist!")},e.prototype.expandCombo=function(t){var e=this;if(Object(u.o)(t)&&(t=this.findById(t)),!t||t.getType&&"combo"!==t.getType())console.warn("The combo to be collapsed does not exist!");else{this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var n=t.getModel();this.get("itemController").expandCombo(t),n.collapsed=!1;var r=this.getEdges().concat(this.get("vedges")),i=[],o=[],a=this.get("comboTrees"),s=!1;(a||[]).forEach((function(t){s||dt(t,(function(t){if(s&&t.depth<=n.depth)return!1;if(n.id===t.id&&(s=!0),s){var r=e.findById(t.id);r&&r.getType&&"combo"===r.getType()&&(i=i.concat(r.getNodes()),o=o.concat(r.getCombos()))}return!0}))}));var c={},h={};r.forEach((function(t){if(!t.isVisible()||t.getModel().isVEdge){var r=t.getSource(),a=t.getTarget(),s=r.get("id"),u=a.get("id");if((i.includes(r)||o.includes(r))&&!i.includes(a)&&!o.includes(a)||s===n.id){if(t.getModel().isVEdge)return void e.removeItem(t,!1);for(var l=a.getModel();!a.isVisible();){if(!(a=e.findById(l.comboId||l.parentId))||!l.parentId&&!l.comboId)return;l=a.getModel()}u=l.id;for(var f=r.getModel();!r.isVisible();){if(!(r=e.findById(f.comboId||f.parentId))||!f.parentId&&!f.comboId)return;if(f.comboId===n.id||f.parentId===n.id)break;f=r.getModel()}if(s=f.id,u){if(c[p=s+"-"+u])return c[p]+=t.getModel().size||1,void e.updateItem(h[p],{size:c[p]},!1);var d=e.addItem("vedge",{source:s,target:u,isVEdge:!0},!1);c[p]=t.getModel().size||1,h[p]=d}}else if(!i.includes(r)&&!o.includes(r)&&(i.includes(a)||o.includes(a))||u===n.id){if(t.getModel().isVEdge)return void e.removeItem(t,!1);for(f=r.getModel();!r.isVisible();){if(!(r=e.findById(f.comboId||f.parentId))||!f.parentId&&!f.comboId)return;f=r.getModel()}s=f.id;for(l=a.getModel();!a.isVisible();){if(!(a=e.findById(l.comboId||l.parentId))||!l.parentId&&!l.comboId)return;if(l.comboId===n.id||l.parentId===n.id)break;l=a.getModel()}if(u=l.id,s){var p;if(c[p=s+"-"+u])return c[p]+=t.getModel().size||1,void e.updateItem(h[p],{size:c[p]},!1);d=e.addItem("vedge",{target:u,source:s,isVEdge:!0},!1);c[p]=t.getModel().size||1,h[p]=d}}else(i.includes(r)||o.includes(r))&&(i.includes(a)||o.includes(a))&&r.isVisible()&&a.isVisible()&&t.show()}})),this.emit("aftercollapseexpandcombo",{action:"expand",item:t})}},e.prototype.collapseExpandCombo=function(t){if(Object(u.o)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType())){for(var e=t.getModel(),n=this.findById(e.parentId);n;){var r=n.getModel();if(r.collapsed)return console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),void(n=void 0);n=this.findById(r.parentId)}e.collapsed?this.expandCombo(t):this.collapseCombo(t),this.updateCombo(t)}},e.prototype.sortCombos=function(){var t=this;if(!this.get("comboSorted")){this.set("comboSorted",!0);var e=[],n={};(this.get("comboTrees")||[]).forEach((function(t){dt(t,(function(t){return e[t.depth]?e[t.depth].push(t.id):e[t.depth]=[t.id],n[t.id]=t.depth,!0}))})),(this.getEdges().concat(this.get("vedges"))||[]).forEach((function(t){var r=t.getModel(),i=n[r.source]||0,o=n[r.target]||0,a=Math.max(i,o);e[a]?e[a].push(r.id):e[a]=[r.id]})),e.forEach((function(e){if(e&&e.length)for(var n=e.length-1;n>=0;n--){var r=t.findById(e[n]);r&&r.toFront()}}))}},e.prototype.getNeighbors=function(t,e){var n=t;return Object(u.o)(t)&&(n=this.findById(t)),n.getNeighbors(e)},e.prototype.getNodeDegree=function(t,e,n){void 0===e&&(e=void 0),void 0===n&&(n=!1);var r=t;Object(u.o)(t)&&(r=this.findById(t));var i=this.get("degrees");i&&!n||(i=Object(v.getDegree)(this.save()),this.set("degrees",i));var o=i[r.getID()],a=0;if(!o)return 0;switch(e){case"in":a=o.inDegree;break;case"out":a=o.outDegree;break;case"all":a=o;break;default:a=o.degree}return a},e.prototype.getUndoStack=function(){return this.undoStack},e.prototype.getRedoStack=function(){return this.redoStack},e.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},e.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear())},e.prototype.pushStack=function(t,e,n){if(void 0===t&&(t="update"),void 0===n&&(n="undo"),this.get("enabledStack")){var r=e?Object(u.a)(e):{before:{},after:Object(u.a)(this.save())};"redo"===n?this.redoStack.push({action:t,data:r}):this.undoStack.push({action:t,data:r}),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack})}else console.warn("请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !")},e.prototype.getAdjMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var n=this.get("adjMatrix");return n&&t||(n=Object(v.getAdjMatrix)(this.save(),e),this.set("adjMatrix",n)),n},e.prototype.getShortestPathMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var n=this.get("adjMatrix"),r=this.get("shortestPathMatrix");return n&&t||(n=Object(v.getAdjMatrix)(this.save(),e),this.set("adjMatrix",n)),r&&t||(r=Object(v.floydWarshall)(this.save(),e),this.set("shortestPathMatrix",r)),r},e.prototype.on=function(e,n,r){return t.prototype.on.call(this,e,n,r)},e.prototype.destroy=function(){this.clear(),this.clearStack(),this.get("itemController").destroy(),this.get("modeController").destroy(),this.get("viewController").destroy(),this.get("stateController").destroy(),this.get("canvas").destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null},e.prototype.createHull=function(t){if(t.members&&!(t.members.length<1)){var e=this.get("hullGroup"),n=this.get("hullMap");if(n||(n={},this.set("hullMap",n)),e&&!e.get("destroyed")||((e=this.get("group").addGroup({id:"hullGroup"})).toBack(),this.set("hullGroup",e)),n[t.id])return console.warn("Existed hull id."),n[t.id];var r=e.addGroup({id:t.id+"-container"}),i=new be(this,Object(f.a)(Object(f.a)({},t),{group:r}));return n[i.id]=i,i}console.warn("Create hull failed! The members is empty.")},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var e;e=Object(u.o)(t)?this.getHullById(t):t,delete this.get("hullMap")[e.id],e.destroy()},e.prototype.removeHulls=function(){var t=this.getHulls();t&&Object.keys(t).length&&(Object.keys(t).forEach((function(e){t[e].destroy()})),this.set("hullMap",{}))},e.prototype.onTick=function(t){this.get("layoutController").onTick(t),Object(p.b)(this.onTick.bind(this))},e}(d.a);function Me(t){return(Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Se=g.a.transform,Oe=["startArrow","endArrow"],ke={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},Ce={edge:{lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},node:ke,combo:ke},Ee={options:{},itemType:"",type:"",getCustomConfig:function(t){return{}},getOptions:function(t){return Object(u.b)({labelCfg:{style:{fontFamily:"undefined"!=typeof window&&window.getComputedStyle&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"}},descriptionCfg:{style:{fontFamily:"undefined"!=typeof window&&window.getComputedStyle&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"}}},this.options,this.getCustomConfig(t)||{},t)},draw:function(t,e){var n=this.drawShape(t,e);(n.set("className",this.itemType+"-shape"),t.label)&&this.drawLabel(t,e).set("className",this.itemType+"-label");return n},afterDraw:function(t,e,n){},drawShape:function(t,e){return null},drawLabel:function(t,e){var n=this.getOptions(t).labelCfg||{},r=this.getLabelStyle(t,n,e),i=r.rotate;delete r.rotate;var o=e.addShape("text",{attrs:r,draggable:!0,className:"text-shape",name:"text-shape"});if(i){var a=o.getBBox(),s=o.getMatrix();if(s||(s=[1,0,0,0,1,0,0,0,1]),r.rotateCenter)switch(r.rotateCenter){case"center":s=Se(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]]);break;case"lefttop":s=Se(s,[["t",-r.x,-r.y],["r",i],["t",r.x,r.y]]);break;case"leftcenter":s=Se(s,[["t",-r.x,-r.y-a.height/2],["r",i],["t",r.x,r.y+a.height/2]]);break;default:s=Se(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]])}else s=Se(s,[["t",-r.x,-r.y-a.height/2],["r",i],["t",r.x,r.y+a.height/2]]);o.setMatrix(s)}if(r.background){var u=this.drawLabelBg(t,e,o),c=this.itemType+"-label-bg";u.set("classname",c),o.toFront()}return o},drawLabelBg:function(t,e,n){var r=this.options.labelCfg,i=Object(u.r)({},r,t.labelCfg),o=this.getLabelBgStyleByPosition(n,t,i,e);return e.addShape("rect",{name:"text-bg-shape",attrs:o})},getLabelStyleByPosition:function(t,e,n){return{text:t.label}},getLabelBgStyleByPosition:function(t,e,n,r){return{}},getLabelStyle:function(t,e,n){var r=this.getLabelStyleByPosition(t,e,n),i=this.itemType+"Label",o=nt[i]?nt[i].style:null;return Object(f.a)(Object(f.a)(Object(f.a)({},o),r),e.style)},getShapeStyle:function(t){return t.style},update:function(t,e){this.updateShapeStyle(t,e),this.updateLabel(t,e)},updateShapeStyle:function(t,e){var n=e.getContainer(),r=e.getKeyShape(),i=Object(u.r)({},r.attr(),t.style),o=function(t){var e,o=i[t];if(Object(u.n)(o)){var a=n.find((function(e){return e.get("name")===t}));a&&a.attr(o)}else r.attr(((e={})[t]=o,e))};for(var a in i)o(a)},updateLabel:function(t,e){var n=e.getContainer(),r=this.getOptions({}).labelCfg,i=this.itemType+"-label",o=n.find((function(t){return t.get("className")===i})),a=this.itemType+"-label-bg",s=n.find((function(t){return t.get("classname")===a}));if(t.label||""===t.label)if(o){var c={};e.getModel&&(c=e.getModel().labelCfg);var h=Object(u.b)({},r,c,t.labelCfg),l=this.getLabelStyleByPosition(t,h,n),d=t.labelCfg?t.labelCfg.style:void 0,p=h.style&&h.style.background,g=Object(f.a)(Object(f.a)(Object(f.a)({},o.attr()),l),d),v=g.rotate;if(delete g.rotate,v){var y=[1,0,0,0,1,0,0,0,1];y=Se(y,[["t",-g.x,-g.y],["r",v],["t",g.x,g.y]]),o.resetMatrix(),o.attr(Object(f.a)(Object(f.a)({},g),{matrix:y}))}else o.resetMatrix(),o.attr(g);if(s)if(g.background){var m=this.getLabelBgStyleByPosition(o,t,h,n),b=Object(f.a)(Object(f.a)({},m),p);if(s.resetMatrix(),v){var x=[1,0,0,0,1,0,0,0,1];x=Se(x,[["t",-b.x,-b.y],["r",v],["t",b.x,b.y]]),b.matrix=x}s.attr(b)}else n.removeChild(s);else g.background&&((s=this.drawLabelBg(t,n,o)).set("classname",a),o.toFront())}else{this.drawLabel(t,n).set("className",i)}},afterUpdate:function(t,e){},setState:function(t,e,n){var r,i,o=n.get("keyShape");if(o&&!o.destroyed){var a=n.getType(),s=Object(u.g)(e)?t:t+":"+e,c=this.getStateStyle(s,n),h=n.getStateStyle(s);if(h||c){var l=Object(u.r)({},h||c),f=n.getContainer(),d={x:1,y:1,cx:1,cy:1};if("combo"===a&&(d.r=1,d.width=1,d.height=1),e){var p=function(t){var e,n=l[t];if(Object(u.n)(n)&&!Oe.includes(t)){var r=f.find((function(e){return e.get("name")===t}));r&&r.attr(n)}else o.attr(((e={})[t]=n,e))};for(var g in l)p(g)}else{var v=wt(n.getCurrentStatesStyle()),y=n.getModel(),m=Object(u.r)({},y.style,wt(n.getOriginStyle())),b=o.get("name"),x=o.attr(),w={};Object.keys(x).forEach((function(t){if("img"!==t){var e=x[t];e&&"object"===Me(e)?w[t]=Object(u.a)(e):w[t]=e}}));var M={},S=function(t){var e=l[t];if(Object(u.n)(e)&&!Oe.includes(t)){var n=f.find((function(e){return e.get("name")===t}));if(n){var r=Object(u.a)(n.attr());Object(u.c)(e,(function(e,i){if(t===b&&w[i]&&!d[i]){delete w[i];var s=m[t][i]||Ce[a][i];o.attr(i,s)}else if(r[i]||0===r[i]){delete r[i];var u=m[t][i]||Ce[a][i];n.attr(i,u)}})),M[t]=r}}else if(w[t]&&!d[t]){delete w[t];var i=m[t]||(m[b]?m[b][t]:void 0)||Ce[a][t];o.attr(t,i)}};for(var O in l)S(O);for(var g in b?M[b]=w:Object(u.r)(M,w),v)if(!d[g]){var k=v[g];Object(u.n)(k)&&!Oe.includes(g)||(b?(Object(u.r)(m[b],((i={})[g]=k,i)),delete m[g]):Object(u.r)(m,((r={})[g]=k,r)),delete v[g])}var C={};Object(u.b)(C,m,M,v);var E=!1,P=function(t){var e,n,r=C[t];if(Object(u.n)(r)&&!Oe.includes(t)){var i=f.find((function(e){return e.get("name")===t}));i&&(t===b&&("combo"===a&&(delete r.r,delete r.width,delete r.height),E=!0),i.attr(r))}else if(!E){var s=r||Ce[a][t];"combo"===a?b||o.attr(((e={})[t]=s,e)):o.attr(((n={})[t]=s,n))}};for(var j in C)P(j)}}}},getStateStyle:function(t,e){var n=e.getModel(),r=e.getType(),i=this.getOptions(n),o=i.stateStyles,a=i.style,s=void 0===a?{}:a,c=n.stateStyles?n.stateStyles[t]:o&&o[t];return"combo"===r?Object(u.a)(c):Object(u.r)({},s,c)},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){return this.getOptions(t).anchorPoints}},Pe={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:nt.nodeLabel.offset,getSize:function(t){var e=t.size||this.getOptions({}).size||nt.defaultNode.size;return Object(u.f)(e)&&1===e.length&&(e=[e[0],e[0]]),Object(u.f)(e)||(e=[e,e]),e},getLabelStyleByPosition:function(t,e){var n=e.position||this.labelPosition;if("center"===n)return{x:0,y:0,text:t.label};var r=e.offset;Object(u.j)(r)&&(r=this.offset);var i,o=this.getSize(t),a=o[0],s=o[1];switch(n){case"top":i={x:0,y:0-s/2-r,textBaseline:"bottom"};break;case"bottom":i={x:0,y:s/2+r,textBaseline:"top"};break;case"left":i={x:0-a/2-r,y:0,textAlign:"right"};break;default:i={x:a/2+r,y:0,textAlign:"left"}}return i.text=t.label,i},getLabelBgStyleByPosition:function(t,e,n,r){if(!t)return{};var i=t.getBBox(),o=n.style&&n.style.background;if(!o)return{};var a,s=Et(o.padding),c=i.width+s[1]+s[3],h=i.height+s[0]+s[2],l=n.offset;return Object(u.j)(l)&&(l=this.offset),a={x:i.minX-s[3],y:i.minY-s[0]},a=Object(f.a)(Object(f.a)(Object(f.a)({},a),o),{width:c,height:h})},drawShape:function(t,e){var n=this.shapeType,r=this.getShapeStyle(t);return e.addShape(n,{attrs:r,draggable:!0,name:"node-shape"})},updateLinkPoints:function(t,e){var n,r=this.getOptions(t).linkPoints,i=e.find((function(t){return"link-point-left"===t.get("className")})),o=e.find((function(t){return"link-point-right"===t.get("className")})),a=e.find((function(t){return"link-point-top"===t.get("className")})),s=e.find((function(t){return"link-point-bottom"===t.get("className")}));i&&(n=i.attr()),o&&!n&&(n=o.attr()),a&&!n&&(n=a.attr()),s&&!n&&(n=s.attr()),n||(n=r);var c=Object(u.r)({},n,t.linkPoints),h=c.fill,l=c.stroke,d=c.lineWidth,p=c.size/2;p||(p=c.r);var g=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},v=g.left,y=g.right,m=g.top,b=g.bottom,x=this.getSize(t),w=x[0],M=x[1],S={r:p,fill:h,stroke:l,lineWidth:d};i?v||void 0===v?i.attr(Object(f.a)(Object(f.a)({},S),{x:-w/2,y:0})):i.remove():v&&e.addShape("circle",{attrs:Object(f.a)(Object(f.a)({},S),{x:-w/2,y:0}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),o?(y||void 0===y||o.remove(),o.attr(Object(f.a)(Object(f.a)({},S),{x:w/2,y:0}))):y&&e.addShape("circle",{attrs:Object(f.a)(Object(f.a)({},S),{x:w/2,y:0}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),a?(m||void 0===m||a.remove(),a.attr(Object(f.a)(Object(f.a)({},S),{x:0,y:-M/2}))):m&&e.addShape("circle",{attrs:Object(f.a)(Object(f.a)({},S),{x:0,y:-M/2}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),s?b||void 0===b?s.attr(Object(f.a)(Object(f.a)({},S),{x:0,y:M/2})):s.remove():b&&e.addShape("circle",{attrs:Object(f.a)(Object(f.a)({},S),{x:0,y:M/2}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},updateShape:function(t,e,n,r){e.get("keyShape").attr(Object(f.a)({},n)),this.updateLabel(t,e),r&&this.updateIcon(t,e)},updateIcon:function(t,e){var n=this,r=e.getContainer(),i=this.getOptions(t).icon,o=(t.icon?t.icon:{show:void 0}).show,a=r.find((function(t){return t.get("className")===n.type+"-icon"}));if(a)if(o||void 0===o){var s=Object(u.r)({},a.attr(),i),c=s.width,h=s.height;a.attr(Object(f.a)(Object(f.a)({},s),{x:-c/2,y:-h/2}))}else a.remove();else if(o){c=i.width,h=i.height;r.addShape("image",{attrs:Object(f.a)(Object(f.a)({},i),{x:-c/2,y:-h/2}),className:this.type+"-icon",name:this.type+"-icon"});var l=r.find((function(t){return"node-label"===t.get("className")}));l&&l.toFront()}}},je=Object(f.a)(Object(f.a)({},Ee),Pe);Wt.registerNode("single-node",je);var Ae={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:nt.defaultEdge.size,style:{x:0,y:0,stroke:nt.defaultEdge.style.stroke,lineAppendWidth:nt.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:nt.edgeLabel.style.fill,fontSize:nt.edgeLabel.style.fontSize}},stateStyles:Object(f.a)({},nt.edgeStateStyles)},getPath:function(t){var e=[];return Object(u.c)(t,(function(t,n){0===n?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])})),e},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},r=Object(u.r)({},e,n,t.style),i=t.size||nt.defaultEdge.size,o=(t=this.getPathPoints(t)).startPoint,a=t.endPoint,s=this.getControlPoints(t),c=[o];s&&(c=c.concat(s)),c.push(a);var h=this.getPath(c);return Object(u.r)({},nt.defaultEdge.style,{stroke:nt.defaultEdge.color,lineWidth:i,path:h},r)},updateShapeStyle:function(t,e){var n=e.getContainer(),r={stroke:t.color},i=n.find((function(t){return"edge-shape"===t.get("className")}))||e.getKeyShape(),o=t.size,a=(t=this.getPathPoints(t)).startPoint,s=t.endPoint,c=this.getControlPoints(t),h=[a];c&&(h=h.concat(c)),h.push(s);var l=i.attr(),f=Object(u.r)({},r,l,t.style),d=t.sourceNode,p=t.targetNode,g={radius:f.radius};c||(g={source:d,target:p,offset:f.offset,radius:f.radius}),l.endArrow&&!1===f.endArrow&&(t.style.endArrow={path:""}),l.startArrow&&!1===f.startArrow&&(t.style.startArrow={path:""});var v=this.getPath(h,g),y=Object(u.r)(r,i.attr(),{lineWidth:o,path:v},t.style);i&&i.attr(y)},getLabelStyleByPosition:function(t,e,n){var r,i=e.position||this.labelPosition,o={},a=n&&n.find((function(t){return"edge-shape"===t.get("className")}));r="start"===i?0:"end"===i?1:.5;var s,c=e.refX||this.refX,h=e.refY||this.refY;if(t.startPoint.x===t.endPoint.x&&t.startPoint.y===t.endPoint.y)return o.x=t.startPoint.x+c,o.y=t.startPoint.y+h,o.text=t.label,o;s=Object(u.j)(e.autoRotate)?this.labelAutoRotate:e.autoRotate;var l=lt(a,r,c,h,s);return o.x=l.x,o.y=l.y,o.rotate=l.rotate,o.textAlign=this._getTextAlign(i,l.angle),o.text=t.label,o},getLabelBgStyleByPosition:function(t,e,n,r){if(!t)return{};var i=t.getBBox(),o=n.style&&n.style.background;if(!o)return{};var a,s=o.padding,c=i.width+s[1]+s[3],h=i.height+s[0]+s[2],l=n.position||this.labelPosition,d=Object(f.a)(Object(f.a)({},o),{width:c,height:h,x:i.minX-s[2],y:i.minY-s[0],rotate:0});a=Object(u.j)(n.autoRotate)?this.labelAutoRotate:n.autoRotate;var p,g=r&&r.find((function(t){return"edge-shape"===t.get("className")}));p="start"===l?0:"end"===l?1:.5;var v=n.refX||this.refX,y=n.refY||this.refY;if(e.startPoint.x===e.endPoint.x&&e.startPoint.y===e.endPoint.y)return d.x=e.startPoint.x+v-c/2,d.y=e.startPoint.y+y-h/2,d;var m=lt(g,p,v-c/2,y+h/2,a),b=m.angle;return b>.5*Math.PI&&b<1.5*Math.PI&&(m=lt(g,p,v+c/2,y+h/2,a)),a&&(d.x=m.x,d.y=m.y),d.rotate=m.rotate,d},_getTextAlign:function(t,e){var n="center";return e?(e%=2*Math.PI,"center"!==t&&(n=e>=0&&e<=Math.PI/2||e>=1.5*Math.PI&&e<2*Math.PI?t:function(t){var e=t;return"start"===t?e="end":"end"===t&&(e="start"),e}(t)),n):t},getControlPoints:function(t){return t.controlPoints},getPathPoints:function(t){return t},drawShape:function(t,e){var n=this.getShapeStyle(t);return e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n})},drawLabel:function(t,e){var n,r=this.options.labelCfg;n="undefined"!=typeof window&&void 0!==window.getComputedStyle&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";var i=Object(u.b)({fontFamily:n},r,t.labelCfg),o=this.getLabelStyle(t,i,e),a=o.rotate;delete o.rotate;var s=e.addShape("text",{attrs:o,name:"text-shape"});if(a&&s.rotateAtStart(a),o.background){var c=this.drawLabelBg(t,e,s),h=this.itemType+"-label-bg";c.set("classname",h),s.toFront()}return s},drawLabelBg:function(t,e,n){var r=this.options.labelCfg,i=Object(u.b)({},r,t.labelCfg),o=this.getLabelStyle(t,i,e).rotate,a=this.getLabelBgStyleByPosition(n,t,i,e);delete a.rotate;var s=e.addShape("rect",{name:"text-bg-shape",attrs:a});return o&&s.rotateAtStart(o),s}},Ie=Object(f.a)(Object(f.a)({},Ee),Ae);Wt.registerEdge("single-edge",Ie),Wt.registerEdge("line",{getControlPoints:function(){}},"single-edge"),Wt.registerEdge("spline",{getPath:function(t){return te(t)}},"single-edge"),Wt.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(t){var e,n,r=t.startPoint,i=t.endPoint,o=(r.x+i.x)/2,a=(r.y+i.y)/2;if(void 0!==t.controlPoints){if(n=t.controlPoints[0],e=C(r,n,i),r.x<=i.x&&r.y>i.y?this.clockwise=e.x>n.x?0:1:r.x<=i.x&&r.y<i.y?this.clockwise=e.x>n.x?1:0:r.x>i.x&&r.y<=i.y?this.clockwise=e.y<n.y?0:1:this.clockwise=e.y<n.y?1:0,(n.x-r.x)/(n.y-r.y)==(i.x-r.x)/(i.y-r.y))return[]}else{void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),Object(u.f)(t.curveOffset)&&(t.curveOffset=t.curveOffset[0]),t.curveOffset<0?this.clockwise=0:this.clockwise=1;var s={x:i.x-r.x,y:i.y-r.y},c=Math.atan2(s.y,s.x);n={x:t.curveOffset*Math.cos(-Math.PI/2+c)+o,y:t.curveOffset*Math.sin(-Math.PI/2+c)+a},e=C(r,n,i)}var h=E(r,e);return[{x:h,y:h}]},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),2===t.length?e.push(["L",t[1].x,t[1].y]):e.push(["A",t[1].x,t[1].y,0,0,this.clockwise,t[2].x,t[2].y]),e}},"single-edge"),Wt.registerEdge("quadratic",{curvePosition:.5,curveOffset:-20,getControlPoints:function(t){var e=t.controlPoints;if(!e||!e.length){var n=t.startPoint,r=t.endPoint;void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),void 0===t.curvePosition&&(t.curvePosition=this.curvePosition),Object(u.f)(this.curveOffset)&&(t.curveOffset=t.curveOffset[0]),Object(u.f)(this.curvePosition)&&(t.curvePosition=t.curveOffset[0]),e=[ee(n,r,t.curvePosition,t.curveOffset)]}return e},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),e.push(["Q",t[1].x,t[1].y,t[2].x,t[2].y]),e}},"single-edge"),Wt.registerEdge("cubic",{curvePosition:[.5,.5],curveOffset:[-20,20],getControlPoints:function(t){var e=t.controlPoints;if(void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),void 0===t.curvePosition&&(t.curvePosition=this.curvePosition),Object(u.k)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),Object(u.k)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]),!e||!e.length||e.length<2){var n=t.startPoint,r=t.endPoint;e=[ee(n,r,t.curvePosition[0],t.curveOffset[0]),ee(n,r,t.curvePosition[1],t.curveOffset[1])]}return e},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),e.push(["C",t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y]),e}},"single-edge"),Wt.registerEdge("cubic-vertical",{curvePosition:[.5,.5],minCurveOffset:[0,0],curveOffset:void 0,getControlPoints:function(t){var e=t.startPoint,n=t.endPoint;void 0===t.curvePosition&&(t.curvePosition=this.curvePosition),void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),void 0===t.minCurveOffset&&(t.minCurveOffset=this.minCurveOffset),Object(u.k)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),Object(u.k)(t.minCurveOffset)&&(t.minCurveOffset=[t.minCurveOffset,-t.minCurveOffset]),Object(u.k)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]);var r=n.y-e.y,i=[0,0];return t.curveOffset?i=t.curveOffset:Math.abs(r)<Math.abs(t.minCurveOffset[0])&&(i=t.minCurveOffset),[{x:e.x,y:e.y+r*this.curvePosition[0]+i[0]},{x:n.x,y:n.y-r*this.curvePosition[1]+i[1]}]}},"cubic"),Wt.registerEdge("cubic-horizontal",{curvePosition:[.5,.5],minCurveOffset:[0,0],curveOffset:void 0,getControlPoints:function(t){var e=t.startPoint,n=t.endPoint;void 0===t.curvePosition&&(t.curvePosition=this.curvePosition),void 0===t.curveOffset&&(t.curveOffset=this.curveOffset),void 0===t.minCurveOffset&&(t.minCurveOffset=this.minCurveOffset),Object(u.k)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),Object(u.k)(t.minCurveOffset)&&(t.minCurveOffset=[t.minCurveOffset,-t.minCurveOffset]),Object(u.k)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]);var r=n.x-e.x,i=[0,0];return t.curveOffset?i=t.curveOffset:Math.abs(r)<Math.abs(t.minCurveOffset[0])&&(i=t.minCurveOffset),[{x:e.x+r*this.curvePosition[0]+i[0],y:e.y},{x:n.x-r*this.curvePosition[1]+i[1],y:n.y}]}},"cubic"),Wt.registerEdge("loop",{getPathPoints:function(t){return ht(t)},getControlPoints:function(t){return t.controlPoints},afterDraw:function(t){t.controlPoints=void 0},afterUpdate:function(t){t.controlPoints=void 0}},"cubic");var Te={itemType:"combo",shapeType:"single-combo",labelPosition:"top",refX:nt.comboLabel.refX,refY:nt.comboLabel.refY,options:{style:{stroke:nt.defaultCombo.style.stroke,fill:nt.defaultCombo.style.fill,lineWidth:nt.defaultCombo.style.lineWidth},labelCfg:{style:{fill:nt.comboLabel.style.fill,fontSize:nt.comboLabel.style.fontSize}},stateStyles:Object(f.a)({},nt.comboStateStyles)},getSize:function(t){var e=Object(u.a)(t.size||this.options.size||nt.defaultCombo.size);return Object(u.f)(e)&&1===e.length&&(e=[e[0],e[0]]),Object(u.f)(e)||(e=[e,e]),e},getLabelStyleByPosition:function(t,e){var n=e.position||this.labelPosition,r=t.style,i=t.padding||this.options.padding;Object(u.f)(i)&&(i=i[0]);var o=e.refX,a=e.refY;Object(u.j)(o)&&(o=this.refX),Object(u.j)(a)&&(a=this.refY);var s,c=this.getSize(t),h=(Math.max(r.r,c[0]/2)||c[0]/2)+i;switch(n){case"top":s={x:0,y:-h-a,textBaseline:"bottom",textAlign:"center"};break;case"bottom":s={x:0,y:h+a,textBaseline:"bottom",textAlign:"center"};break;case"left":s={x:-h+o,y:0,textAlign:"left"};break;case"center":s={x:0,y:0,text:t.label,textAlign:"center"};break;default:s={x:h+o,y:0,textAlign:"right"}}return s.text=t.label,s},drawShape:function(t,e){var n=this.shapeType,r=this.getShapeStyle(t);return e.addShape(n,{attrs:r,draggable:!0,name:"combo-shape"})},updateShape:function(t,e,n){var r=e.get("keyShape");(void 0===t.animate?this.options.animate:t.animate)&&r.animate?r.animate(n,{duration:200,easing:"easeLinear"}):r.attr(Object(f.a)({},n)),this.updateLabel(t,e)}},Ne=Object(f.a)(Object(f.a)({},Ee),Te);Wt.registerCombo("single-combo",Ne),Wt.registerCombo("circle",{options:{size:[nt.defaultCombo.size[0],nt.defaultCombo.size[0]],padding:nt.defaultCombo.padding[0],animate:!0,style:{stroke:nt.defaultCombo.style.stroke,fill:nt.defaultCombo.style.fill,lineWidth:nt.defaultCombo.style.lineWidth},labelCfg:{style:{fill:nt.comboLabel.style.fill,fontSize:nt.comboLabel.style.fontSize},refX:0,refY:0},stateStyles:Object(f.a)({},nt.comboStateStyles)},shapeType:"circle",labelPosition:"top",drawShape:function(t,e){var n=this.getShapeStyle(t);return delete n.height,delete n.width,e.addShape("circle",{attrs:n,className:"circle-combo",name:"circle-combo",draggable:!0})},getShapeStyle:function(t){var e=this.options.style,n=t.padding||this.options.padding;Object(u.f)(n)&&(n=n[0]);var r,i={stroke:t.color},o=Object(u.r)({},e,i,t.style);if(t.fixSize)r=Object(u.k)(t.fixSize)?t.fixSize:t.fixSize[0];else{var a=this.getSize(t);r=!Object(u.k)(o.r)||isNaN(o.r)?a[0]/2||nt.defaultCombo.style.r:Math.max(o.r,a[0]/2)||a[0]/2}o.r=r+n;var s=Object(f.a)({x:0,y:0},o);return t.style?t.style.r=r:t.style={r:r},s},update:function(t,e){var n=this.getSize(t),r=t.padding||this.options.padding;Object(u.f)(r)&&(r=r[0]);var i,o=Object(u.a)(t.style);i=t.fixSize?Object(u.k)(t.fixSize)?t.fixSize:t.fixSize[0]:Math.max(o.r,n[0]/2)||n[0]/2,o.r=i+r;var a=e.get("sizeCache");a&&(a.r=o.r);var s={stroke:t.color},c=e.get("keyShape"),h=Object(u.r)({},c.attr(),s,o);t.style?t.style.r=i:t.style={r:i},this.updateShape(t,e,h,!0)}},"single-combo"),Wt.registerCombo("rect",{options:{size:[40,5],padding:[25,20,15,20],animate:!0,style:{radius:0,stroke:nt.defaultCombo.style.stroke,fill:nt.defaultCombo.style.fill,lineWidth:nt.defaultCombo.style.lineWidth},labelCfg:{style:{fill:nt.comboLabel.style.fill,fontSize:nt.comboLabel.style.fontSize}},anchorPoints:[[0,.5],[1,.5]],stateStyles:Object(f.a)({},nt.comboStateStyles)},shapeType:"rect",labelPosition:"top",drawShape:function(t,e){var n=this.getShapeStyle(t);return e.addShape("rect",{attrs:n,className:"rect-combo",name:"rect-combo",draggable:!0})},getLabelStyleByPosition:function(t,e){var n=e.position||this.labelPosition,r=t.style,i=t.padding||this.options.padding;Object(u.k)(i)&&(i=[i,i,i,i]);var o=e.refX,a=e.refY;Object(u.j)(o)&&(o=this.refX),Object(u.j)(a)&&(a=this.refY);var s,c=r.width/2+i[3],h=r.height/2+i[0];switch(n){case"top":s={x:0-c+o,y:0-h+a,textBaseline:"top",textAlign:"left"};break;case"bottom":s={x:0,y:h+a,textBaseline:"bottom",textAlign:"center"};break;case"left":s={x:0-c+a,y:0,textAlign:"left"};break;case"center":s={x:0,y:0,text:t.label,textAlign:"center"};break;default:s={x:c+o,y:0,textAlign:"right"}}return s.text=t.label,s},getShapeStyle:function(t){var e=this.options.style,n=t.padding||this.options.padding;Object(u.k)(n)&&(n=[n,n,n,n]);var r,i,o={stroke:t.color},a=Object(u.r)({},e,o,t.style),s=this.getSize(t),c=t.collapsed&&t.fixCollapseSize?t.fixCollapseSize:t.fixSize;c?Object(u.k)(c)?(r=c,i=c):(r=c[0],i=c[1]):(r=!Object(u.k)(a.width)||isNaN(a.width)?s[0]||nt.defaultCombo.style.width:Math.max(a.width,s[0])||s[0],i=!Object(u.k)(a.height)||isNaN(a.height)?s[1]||nt.defaultCombo.style.height:Math.max(a.height,s[1])||s[1]);var h=-r/2-n[3],l=-i/2-n[0];a.width=r+n[1]+n[3],a.height=i+n[0]+n[2];var d=Object(f.a)({x:h,y:l},a);return t.style?(t.style.width=r,t.style.height=i):t.style={width:r,height:i},d},update:function(t,e){var n=this.getSize(t),r=t.padding||this.options.padding;Object(u.k)(r)&&(r=[r,r,r,r]);var i,o,a=Object(u.a)(t.style),s=t.collapsed&&t.fixCollapseSize?t.fixCollapseSize:t.fixSize;s?Object(u.k)(s)?(i=s,o=s):(i=s[0],o=s[1]):(i=Math.max(a.width,n[0])||n[0],o=Math.max(a.height,n[1])||n[1]),a.width=i+r[1]+r[3],a.height=o+r[0]+r[2];var c=e.get("sizeCache");c&&(c.width=a.width,c.height=a.height),a.x=-i/2-r[3],a.y=-o/2-r[0];var h={stroke:t.color},l=e.get("keyShape"),f=Object(u.r)({},l.attr(),h,a);t.style?(t.style.width=i,t.style.height=o):t.style={width:i,height:o},this.updateShape(t,e,f,!1)},updateShape:function(t,e,n){var r=e.get("keyShape");(void 0===t.animate?this.options.animate:t.animate)&&r.animate?r.animate(n,{duration:200,easing:"easeLinear"}):r.attr(Object(f.a)({},n)),this.updateLabel(t,e)}},"single-combo"),Wt.registerNode("simple-circle",{options:{size:nt.defaultNode.size,style:{x:0,y:0,stroke:nt.defaultNode.style.stroke,fill:nt.defaultNode.style.fill,lineWidth:nt.defaultNode.style.lineWidth},labelCfg:{style:{fill:nt.nodeLabel.style.fill,fontSize:nt.nodeLabel.style.fontSize}},stateStyles:Object(f.a)({},nt.nodeStateStyles)},shapeType:"simple-circle",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t);return e.addShape("circle",{attrs:n,className:this.type+"-keyShape",draggable:!0})},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},r=Object(u.b)({},e,n),i=this.getSize(t)[0]/2;return Object(f.a)({x:0,y:0,r:i},r)},update:function(t,e){var n=this.getSize(t),r={stroke:t.color,r:n[0]/2},i=e.get("keyShape"),o=Object(u.b)({},i.attr(),r,t.style);this.updateShape(t,e,o,!0)}},"single-node"),Wt.registerNode("simple-rect",{options:{size:[100,30],style:{radius:0,stroke:nt.defaultNode.style.stroke,fill:nt.defaultNode.style.fill,lineWidth:nt.defaultNode.style.lineWidth},labelCfg:{style:{fill:nt.nodeLabel.style.fill,fontSize:nt.nodeLabel.style.fontSize}},anchorPoints:[[0,.5],[1,.5]],stateStyles:Object(f.a)({},nt.nodeStateStyles)},shapeType:"simple-rect",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t);return e.addShape("rect",{attrs:n,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0})},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},r=Object(u.r)({},e,n),i=this.getSize(t),o=r.width||i[0],a=r.height||i[1];return Object(f.a)({x:-o/2,y:-a/2,width:o,height:a},r)},update:function(t,e){e.getContainer();var n=this.getOptions({}).style,r=this.getSize(t),i=e.get("keyShape");t.size||(r[0]=i.attr("width")||n.width,r[1]=i.attr("height")||n.height);var o={stroke:t.color,x:-r[0]/2,y:-r[1]/2,width:r[0],height:r[1]},a=Object(u.r)({},n,i.attr(),o);a=Object(u.r)(a,t.style),this.updateShape(t,e,a,!1)}},"single-node"),Wt.registerNode("image",{options:{img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ",size:200,clipCfg:{show:!1,type:"circle",r:50,rx:50,ry:35,width:50,height:35,points:[[30,12],[12,30],[30,48],[48,30]],path:[["M",25,25],["L",50,25],["A",12.5,12.5,0,1,1,50,50],["A",12.5,12.5,0,1,0,50,50],["L",25,75],["Z"]],x:0,y:0}},shapeType:"image",labelPosition:"bottom",drawShape:function(t,e){var n=this.shapeType,r=this.getShapeStyle(t);delete r.fill;var i=e.addShape(n,{attrs:r,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0});return this.drawClip(t,i),i},drawClip:function(t,e){var n=this.getOptions(t).clipCfg;if(n.show){var r=n.type,i=n.x,o=n.y,a=n.style;if("circle"===r){var s=n.r;e.setClip({type:"circle",attrs:Object(f.a)({r:s,x:i,y:o},a)})}else if("rect"===r){var u=n.width,c=n.height,h=i-u/2,l=o-c/2;e.setClip({type:"rect",attrs:Object(f.a)({x:h,y:l,width:u,height:c},a)})}else if("ellipse"===r){var d=n.rx,p=n.ry;e.setClip({type:"ellipse",attrs:Object(f.a)({x:i,y:o,rx:d,ry:p},a)})}else if("polygon"===r){var g=n.points;e.setClip({type:"polygon",attrs:Object(f.a)({points:g},a)})}else if("path"===r){var v=n.path;e.setClip({type:"path",attrs:Object(f.a)({path:v},a)})}}},getShapeStyle:function(t){var e=this.getOptions(t).style,n=this.getSize(t),r=this.getOptions(t).img,i=n[0],o=n[1];return e&&(i=e.width||n[0],o=e.height||n[1]),Object(f.a)({x:-i/2,y:-o/2,width:i,height:o,img:r},e)},updateShapeStyle:function(t,e){var n=e.getContainer(),r=this.itemType+"-shape",i=n.find((function(t){return t.get("className")===r}))||e.getKeyShape(),o=this.getShapeStyle(t);i&&i.attr(o)}},"single-node");var Be,_e={triangle:function(t,e,n){void 0===t&&(t=10),void 0===e&&(e=15),void 0===n&&(n=0);var r=2*n;return"M "+r+",0 L "+(r+e)+",-"+t/2+" L "+(r+e)+","+t/2+" Z"},vee:function(t,e,n){void 0===t&&(t=15),void 0===e&&(e=20),void 0===n&&(n=0);var r=2*n;return"M "+r+",0 L "+(r+e)+",-"+t/2+"\n L "+(r+2*e/3)+",0 L "+(r+e)+","+t/2+" Z"},circle:function(t,e){return void 0===t&&(t=5),void 0===e&&(e=0),"M "+2*e+", 0\n a "+t+","+t+" 0 1,0 "+2*t+",0\n a "+t+","+t+" 0 1,0 "+2*-t+",0"},rect:function(t,e,n){void 0===t&&(t=10),void 0===e&&(e=10),void 0===n&&(n=0);var r=2*n;return"M "+r+","+-t/2+" \n L "+(r+e)+","+-t/2+" \n L "+(r+e)+","+t/2+" \n L "+r+","+t/2+" Z"},diamond:function(t,e,n){void 0===t&&(t=15),void 0===e&&(e=15),void 0===n&&(n=0);var r=2*n;return"M "+r+",0 \n L "+(r+e/2)+","+-t/2+" \n L "+(r+e)+",0 \n L "+(r+e/2)+","+t/2+" Z"},triangleRect:function(t,e,n,r,i,o){void 0===t&&(t=15),void 0===e&&(e=15),void 0===n&&(n=15),void 0===r&&(r=3),void 0===i&&(i=5),void 0===o&&(o=0);var a=2*o,s=a+e+i;return"M "+a+",0 L "+(a+e)+",-"+t/2+" L "+(a+e)+","+t/2+" Z\n M "+s+", -"+n/2+"\n L "+(s+r)+" -"+n/2+"\n L "+(s+r)+" "+n/2+"\n L "+s+" "+n/2+"\n Z"}},Le={collapse:function(t,e,n){return[["M",t-n,e],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0],["M",t-n+4,e],["L",t+n-4,e]]},expand:function(t,e,n){return[["M",t-n,e],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0],["M",t-n+4,e],["L",t-n+2*n-4,e],["M",t-n+n,e-n+4],["L",t,e+n-4]]},upTriangle:function(t,e,n){var r=n*Math.cos(Math.PI/6),i=n*Math.sin(Math.PI/6);return[["M",t-r,e+i],["L",t+r,e+i],["L",t,e-n],["Z"]]},downTriangle:function(t,e,n){var r=n*Math.cos(Math.PI/6),i=n*Math.sin(Math.PI/6);return[["M",t-r,e-i],["L",t+r,e-i],["L",t,e+n],["Z"]]}},De=Wt,Re=["#5F95FF","#61DDAA","#65789B","#F6BD16","#7262FD","#78D3F8","#9661BC","#F6903D","#008685","#F08BB4"],Fe=g.a.transform,Xe=Object(f.a)(Object(f.a)(Object(f.a)(Object(f.a)(Object(f.a)(Object(f.a)({},o),i),a),r),s),{transform:Fe,mat3:g.b}),Ye=function(){function t(t){this.graph=t,this.layoutCfg=t.get("layout")||{},this.layoutType=this.getLayoutType(),this.layoutMethods=[],this.initLayout()}return t.prototype.initLayout=function(){},t.prototype.getLayoutType=function(){return this.getLayoutCfgType(this.layoutCfg)},t.prototype.getLayoutCfgType=function(t){var e=t.type;if(e)return e;var n=t.pipes;return Array.isArray(n)?n.map((function(t){return(null==t?void 0:t.type)||""})):null},t.prototype.isLayoutTypeSame=function(t){var e=this.getLayoutCfgType(t);return Array.isArray(this.layoutType)?this.layoutType.every((function(t,n){return t===e[n]})):(null==t?void 0:t.type)===this.layoutType},t.prototype.refreshLayout=function(){var t=this.graph;t&&(t.get("animate")?t.positionsAnimate():t.refreshPositions())},t.prototype.changeLayout=function(t){this.layoutCfg=t,this.destoryLayoutMethods(),this.layout()},t.prototype.changeData=function(){this.destoryLayoutMethods(),this.layout()},t.prototype.destoryLayoutMethods=function(){var t=this.layoutMethods;null==t||t.forEach((function(t){t.destroy()})),this.layoutMethods=[]},t.prototype.destroyLayout=function(){var t=this.graph;this.destoryLayoutMethods(),t.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0},t.prototype.setDataFromGraph=function(){for(var t=[],e=[],n=[],r=[],i=[],o=[],a=this.graph.getNodes(),s=this.graph.getEdges(),u=this.graph.getCombos(),c=a.length,h=0;h<c;h++){var l=a[h];if(l&&!l.destroyed){var f=l.getModel();l.isVisible()?t.push(f):e.push(f)}}var d=s.length;for(h=0;h<d;h++){var p=s[h];if(p&&!p.destroyed){f=p.getModel();p.isVisible()?f.isComboEdge?i.push(f):n.push(f):r.push(f)}}var g=u.length;for(h=0;h<g;h++){var v=u[h];if(!v.destroyed){f=v.getModel();v.isVisible()?o.push(f):r.push(f)}}return{nodes:t,hiddenNodes:e,edges:n,hiddenEdges:r,combos:o,hiddenCombos:[],comboEdges:i}},t.prototype.reLayoutMethod=function(t,e){var n=this;return new Promise((function(r,i){var o=n.graph,a=null==e?void 0:e.type;e.onLayoutEnd=function(){o.emit("aftersublayout",{type:a}),r()},t.init(n.data),"force"===a&&(t.ticking=!1,t.forceSimulation.stop()),o.emit("beforesublayout",{type:a}),t.execute(),t.isCustomLayout&&e.onLayoutEnd&&e.onLayoutEnd()}))},t.prototype.relayout=function(t){var e=this,n=this.graph,r=this.layoutMethods,i=this.layoutCfg;if(t){this.data=this.setDataFromGraph();var o=this.data.nodes;if(!o)return!1;this.initPositions(i.center,o)}n.emit("beforelayout");var a=Promise.resolve();null==r||r.forEach((function(t,n){var r=i[n];a=a.then((function(){return e.reLayoutMethod(t,r)}))})),a.then((function(){i.onAllLayoutEnd&&i.onAllLayoutEnd()})).catch((function(t){console.warn("relayout failed",t)}))},t.prototype.filterLayoutData=function(t,e){var n,r,i=t.nodes,o=t.edges,a=Object(f.e)(t,["nodes","edges"]);if(!i)return t;if(n=Object(u.i)(null==e?void 0:e.nodesFilter)?e.nodesFilter:function(){return!0},Object(u.i)(null==e?void 0:e.edgesFilter))r=e.edgesFilter;else{var s=i.reduce((function(t,e){return t[e.id]=!0,t}),{});r=function(t){return s[t.source]&&s[t.target]}}return Object(f.a)({nodes:i.filter(n),edges:o.filter(r)},a)},t.prototype.getLayoutBBox=function(t){var e=this.graph,n=Object(u.e)(e.getNodes(),(function(t){return t.getModel().layoutOrder})),r=Object.values(n).map((function(t){var e=It(t);return e.size=[e.width,e.height],e}));return{groupNodes:Object.values(Object(u.e)(t,"layoutOrder")),layoutNodes:r}},t.prototype.layoutAnimate=function(){},t.prototype.moveToZero=function(){var t=this.graph.get("data").nodes;if(void 0!==t[0].x&&null!==t[0].x&&!At(t[0].x)){for(var e=[0,0],n=t.length,r=0;r<n;r++){var i=t[r];e[0]+=i.x,e[1]+=i.y}e[0]/=t.length,e[1]/=t.length;for(r=0;r<n;r++){(i=t[r]).x-=e[0],i.y-=e[1]}}},t.prototype.initPositions=function(t,e){var n=this.graph;if(!e)return!1;var r=e?e.length:0;if(r){var i=.85*n.get("width"),o=.85*n.get("height"),a=Math.ceil(Math.sqrt(r)*(i/o)),s=i/(a-1),u=o/(Math.ceil(r/a)-1);isFinite(s)&&s||(s=0),isFinite(u)&&s||(u=0);for(var c=t[0]-i/2,h=t[1]-o/2,l=!0,f=0;f<r;f++){var d=e[f];At(d.x)&&(l=!1,d.x=f%a*s+c),At(d.y)&&(l=!1,d.y=Math.floor(f/a)*u+h)}return l}},t.prototype.destroy=function(){this.graph=null,this.destoryLayoutMethods(),this.destroyed=!0},t.prototype.onTick=function(t){var e;null===(e=this.layoutMethods)||void 0===e||e.forEach((function(e){null==e||e.onTick(t)}))},t}(),ze=function(t){this.graph=t,this.destroyed=!1,this.initEvents()};!function(t){t.CLICK="click",t.DBLCLICK="dblclick",t.TAP="tap",t.DBLTAP="dbltap",t.DRAGSTART="dragstart",t.DRAGEND="dragend",t.DRAG="drag",t.DRAGENTER="dragenter",t.DRAGLEAVE="dragleave",t.DRAGOVER="dragover",t.DRAGOUT="dragout",t.DDROP="drop",t.PINCHSTART="pinchstart",t.PINCHMOVE="pinchmove",t.PANSTART="panstart",t.PANMOVE="panmove",t.PANEND="panend",t.PRESS="press",t.ACTION_END="actionend",t.TOUCHSTART="touchstart",t.TOUCHMOVE="touchmove",t.TOUCHEND="touchend",t.CANVAS_TOUCHSTART="canvas:touchstart",t.CANVAS_TOUCHMOVE="canvas:touchmove",t.CANVAS_TOUCHEND="canvas:touchend",t.NODE_TOUCHSTART="node:touchstart",t.NODE_TOUCHMOVE="node:touchmove",t.NODE_TOUCHEND="node:touchend",t.COMBO_TOUCHSTART="combo:touchstart",t.COMBO_TOUCHMOVE="combo:touchmove",t.COMBO_TOUCHEND="combo:touchend",t.EDGE_TOUCHSTART="edge:touchstart",t.EDGE_TOUCHMOVE="edge:touchmove",t.EDGE_TOUCHEND="edge:touchend",t.NODE_CLICK="node:click",t.NODE_DBLCLICK="node:dblclick",t.NODE_DROP="node:drop",t.NODE_DRAGOVER="node:dragover",t.NODE_DRAGENTER="node:dragenter",t.NODE_DRAGLEAVE="node:dragleave",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DRAGEND="node:dragend",t.NODE_TAP="node:tap",t.NODE_DBLTAP="node:dbltap",t.NODE_PANSTART="node:panstart",t.NODE_PANMOVE="node:panmove",t.NODE_PANEND="node:panend",t.NODE_PRESS="node:press",t.COMBO_CLICK="combo:click",t.COMBO_DBLCLICK="combo:dblclick",t.COMBO_DROP="combo:drop",t.COMBO_DRAGOVER="combo:dragover",t.COMBO_DRAGENTER="combo:dragenter",t.COMBO_DRAGLEAVE="combo:dragleave",t.COMBO_DRAGSTART="combo:dragstart",t.COMBO_DRAG="combo:drag",t.COMBO_DRAGEND="combo:dragend",t.COMBO_TAP="combo:tap",t.COMBO_DBLTAP="combo:dbltap",t.COMBO_PANSTART="combo:panstart",t.COMBO_PANMOVE="combo:panmove",t.COMBO_PANEND="combo:panend",t.COMBO_PRESS="combo:press",t.EDGE_CLICK="edge:click",t.EDGE_DBLCLICK="edge:dblclick",t.EDGE_DROP="edge:drop",t.EDGE_DRAGOVER="edge:dragover",t.EDGE_DRAGENTER="edge:dragenter",t.EDGE_DRAGLEAVE="edge:dragleave",t.EDGE_TAP="edge:tap",t.EDGE_DBLTAP="edge:dbltap",t.EDGE_PRESS="edge:press",t.CANVAS_CLICK="canvas:click",t.CANVAS_DBLCLICK="canvas:dblclick",t.CANVAS_DROP="canvas:drop",t.CANVAS_DRAGENTER="canvas:dragenter",t.CANVAS_DRAGLEAVE="canvas:dragleave",t.CANVAS_DRAGSTART="canvas:dragstart",t.CANVAS_DRAG="canvas:drag",t.CANVAS_DRAGEND="canvas:dragend",t.CANVAS_TAP="canvas:tap",t.CANVAS_DBLTAP="canvas:dbltap",t.CANVAS_PANSTART="canvas:panstart",t.CANVAS_PANMOVE="canvas:panmove",t.CANVAS_PANEND="canvas:panend",t.CANVAS_PRESS="canvas:press",t.BEFORERENDER="beforerender",t.AFTERRENDER="afterrender",t.BEFOREADDITEM="beforeadditem",t.AFTERADDITEM="afteradditem",t.BEFOREREMOVEITEM="beforeremoveitem",t.AFTERREMOVEITEM="afterremoveitem",t.BEFOREUPDATEITEM="beforeupdateitem",t.AFTERUPDATEITEM="afterupdateitem",t.BEFOREITEMVISIBILITYCHANGE="beforeitemvisibilitychange",t.AFTERITEMVISIBILITYCHANGE="afteritemvisibilitychange",t.BEFOREITEMSTATECHANGE="beforeitemstatechange",t.AFTERITEMSTATECHANGE="afteritemstatechange",t.BEFOREITEMREFRESH="beforeitemrefresh",t.AFTERITEMREFRESH="afteritemrefresh",t.BEFOREITEMSTATESCLEAR="beforeitemstatesclear",t.AFTERITEMSTATESCLEAR="afteritemstatesclear",t.BEFOREMODECHANGE="beforemodechange",t.AFTERMODECHANGE="aftermodechange",t.BEFORELAYOUT="beforelayout",t.AFTERLAYOUT="afterlayout",t.BEFORECREATEEDGE="beforecreateedge",t.AFTERCREATEEDGE="aftercreateedge",t.BEFOREGRAPHREFRESHPOSITION="beforegraphrefreshposition",t.AFTERGRAPHREFRESHPOSITION="aftergraphrefreshposition",t.BEFOREGRAPHREFRESH="beforegraphrefresh",t.AFTERGRAPHREFRESH="aftergraphrefresh",t.BEFOREANIMATE="beforeanimate",t.AFTERANIMATE="afteranimate",t.BEFOREPAINT="beforepaint",t.AFTERPAINT="afterpaint",t.BEFORECOLLAPSEEXPANDCOMBO="beforecollapseexpandcombo",t.AFTERCOLLAPSEEXPANDCOMBO="aftercollapseexpandcombo",t.GRAPHSTATECHANGE="graphstatechange",t.AFTERACTIVATERELATIONS="afteractivaterelations",t.NODESELECTCHANGE="nodeselectchange",t.TOOLTIPCHANGE="tooltipchange",t.WHEELZOOM="wheelzoom",t.VIEWPORTCHANGE="viewportchange",t.DRAGNODEEND="dragnodeend",t.STACKCHANGE="stackchange"}(Be||(Be={}));var We=De.registerNode,qe=De.registerEdge,Ge=De.registerCombo,Ve=l.registerBehavior,He=nt;De.registerNode,De.registerEdge,De.registerCombo,l.registerBehavior},20:function(t,e,n){"use strict";function r(t,e){var n=[],r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],h=t[7],l=t[8],f=e[0],d=e[1],p=e[2],g=e[3],v=e[4],y=e[5],m=e[6],b=e[7],x=e[8];return n[0]=f*r+d*a+p*c,n[1]=f*i+d*s+p*h,n[2]=f*o+d*u+p*l,n[3]=g*r+v*a+y*c,n[4]=g*i+v*s+y*h,n[5]=g*o+v*u+y*l,n[6]=m*r+b*a+x*c,n[7]=m*i+b*s+x*h,n[8]=m*o+b*u+x*l,n}function i(t,e){var n=[],r=e[0],i=e[1];return n[0]=t[0]*r+t[3]*i+t[6],n[1]=t[1]*r+t[4]*i+t[7],n}function o(t){var e=[],n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],h=t[8],l=h*a-s*c,f=-h*o+s*u,d=c*o-a*u,p=n*l+r*f+i*d;return p?(p=1/p,e[0]=l*p,e[1]=(-h*r+i*c)*p,e[2]=(s*r-i*a)*p,e[3]=f*p,e[4]=(h*n-i*u)*p,e[5]=(-s*n+i*o)*p,e[6]=d*p,e[7]=(-c*n+r*u)*p,e[8]=(a*n-r*o)*p,e):null}n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}))},204:function(t,e,n){"use strict";n.r(e),n.d(e,"registerGraph",(function(){return v}));var r=n(1),i=n(2);n.d(e,"Arrow",(function(){return i.d})),n.d(e,"Marker",(function(){return i.k})),n.d(e,"Shape",(function(){return i.m}));var o=n(46);n.d(e,"ICanvas",(function(){return o.ICanvas})),n.d(e,"IGroup",(function(){return o.IGroup})),n.d(e,"IShape",(function(){return o.IShape}));var a=n(29);n.d(e,"Algorithm",(function(){return a}));var s=n(82);n.d(e,"Graph",(function(){return s.a}));var u=n(27);n.d(e,"Layout",(function(){return u.a})),n.d(e,"registerLayout",(function(){return u.c}));var c=n(18);n.d(e,"Global",(function(){return c.a}));var h=n(34);n.d(e,"Util",(function(){return h.a}));n(414),n(415);n.d(e,"G6GraphEvent",(function(){return i.i})),n.d(e,"G6Event",(function(){return i.h})),n.d(e,"Node",(function(){return i.l})),n.d(e,"Edge",(function(){return i.g})),n.d(e,"Combo",(function(){return i.f})),n.d(e,"Hull",(function(){return i.j})),n.d(e,"registerNode",(function(){return i.r})),n.d(e,"registerCombo",(function(){return i.p})),n.d(e,"AbstractGraph",(function(){return i.b})),n.d(e,"registerEdge",(function(){return i.q})),n.d(e,"registerBehavior",(function(){return i.o})),n.d(e,"AbstractLayout",(function(){return i.c})),n.d(e,"AbstractEvent",(function(){return i.a})),n.d(e,"BaseGlobal",(function(){return i.e}));var l=n(111);for(var f in l)["default","Graph","Util","Layout","registerLayout","registerGraph","Global","Algorithm","Arrow","Marker","Shape","ICanvas","IGroup","IShape","G6GraphEvent","G6Event","Node","Edge","Combo","Hull","registerNode","registerCombo","AbstractGraph","registerEdge","registerBehavior","AbstractLayout","AbstractEvent","BaseGlobal"].indexOf(f)<0&&function(t){n.d(e,t,(function(){return l[t]}))}(f);var d=n(112);for(var f in d)["default","Graph","Util","Layout","registerLayout","registerGraph","Global","Algorithm","Arrow","Marker","Shape","ICanvas","IGroup","IShape","G6GraphEvent","G6Event","Node","Edge","Combo","Hull","registerNode","registerCombo","AbstractGraph","registerEdge","registerBehavior","AbstractLayout","AbstractEvent","BaseGlobal"].indexOf(f)<0&&function(t){n.d(e,t,(function(){return d[t]}))}(f);var p={version:c.a.version,Graph:s.a,Util:h.a,Layout:u.a,Layouts:u.b,registerLayout:u.c,unRegisterLayout:u.d,Global:c.a,registerBehavior:i.o,registerCombo:i.p,registerEdge:i.q,registerNode:i.r,Algorithm:a,Arrow:i.d,Marker:i.k,Shape:i.m};var g,v=(g=s.b,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return g.apply(null,Object(r.g)(t,[p]))});p.registerGraph=v,e.default=p},205:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isAllowCapture=e.isParent=e.upperFirst=e.each=e.mix=e.isArray=e.isObject=e.isString=e.isFunction=e.isNil=e.isBrowser=e.removeFromArray=void 0,e.removeFromArray=function(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)},e.isBrowser="undefined"!=typeof window&&void 0!==window.document;var r=n(3);Object.defineProperty(e,"isNil",{enumerable:!0,get:function(){return r.isNil}}),Object.defineProperty(e,"isFunction",{enumerable:!0,get:function(){return r.isFunction}}),Object.defineProperty(e,"isString",{enumerable:!0,get:function(){return r.isString}}),Object.defineProperty(e,"isObject",{enumerable:!0,get:function(){return r.isObject}}),Object.defineProperty(e,"isArray",{enumerable:!0,get:function(){return r.isArray}}),Object.defineProperty(e,"mix",{enumerable:!0,get:function(){return r.mix}}),Object.defineProperty(e,"each",{enumerable:!0,get:function(){return r.each}}),Object.defineProperty(e,"upperFirst",{enumerable:!0,get:function(){return r.upperFirst}}),e.isParent=function(t,e){if(t.isCanvas())return!0;for(var n=e.getParent(),r=!1;n;){if(n===t){r=!0;break}n=n.getParent()}return r},e.isAllowCapture=function(t){return t.cfg.visible&&t.cfg.capture}},206:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getOffScreenContext=void 0;var r=null;e.getOffScreenContext=function(){if(!r){var t=document.createElement("canvas");t.width=1,t.height=1,r=t.getContext("2d")}return r}},207:function(t,e,n){var r=n(208),i=n(209),o={};for(var a in r)r.hasOwnProperty(a)&&(o[r[a]]=a);var s=t.exports={to:{},get:{}};function u(t,e,n){return Math.min(Math.max(e,t),n)}function c(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}s.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=s.get.hsl(t),n="hsl";break;case"hwb":e=s.get.hwb(t),n="hwb";break;default:e=s.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},s.get.rgb=function(t){if(!t)return null;var e,n,i,o=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var a=2*n;o[n]=parseInt(e.slice(a,a+2),16)}i&&(o[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)o[n]=parseInt(e[n]+e[n],16);i&&(o[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)){for(n=0;n<3;n++)o[n]=parseInt(e[n+1],0);e[4]&&(o[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/)))return(e=t.match(/(\D+)/))?"transparent"===e[1]?[0,0,0,0]:(o=r[e[1]])?(o[3]=1,o):null:null;for(n=0;n<3;n++)o[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(o[3]=parseFloat(e[4]))}for(n=0;n<3;n++)o[n]=u(o[n],0,255);return o[3]=u(o[3],0,1),o},s.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])+360)%360,u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},s.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},s.to.hex=function(){var t=i(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},s.to.rgb=function(){var t=i(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},s.to.rgb.percent=function(){var t=i(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},s.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},s.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},s.to.keyword=function(t){return o[t.slice(0,3)]}},208:function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},209:function(t,e,n){"use strict";var r=n(210),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var s=t[n];r(s)?e=i.call(e,o.call(s)):e.push(s)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},210:function(t,e){t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},211:function(t,e,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(110),o=n(213),a={};Object.keys(i).forEach((function(t){a[t]={},Object.defineProperty(a[t],"channels",{value:i[t].channels}),Object.defineProperty(a[t],"labels",{value:i[t].labels});var e=o(t);Object.keys(e).forEach((function(n){var i=e[n];a[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"===r(n))for(var i=n.length,o=0;o<i;o++)n[o]=Math.round(n[o]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}(i),a[t][n].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))})),t.exports=a},212:function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},213:function(t,e,n){var r=n(110);function i(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,i=0;i<n;i++)t[e[i]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;)for(var i=n.pop(),o=Object.keys(r[i]),a=o.length,s=0;s<a;s++){var u=o[s],c=e[u];-1===c.distance&&(c.distance=e[i].distance+1,c.parent=i,n.unshift(u))}return e}function o(t,e){return function(n){return e(t(n))}}function a(t,e){for(var n=[e[t].parent,t],i=r[e[t].parent][t],a=e[t].parent;e[a].parent;)n.unshift(e[a].parent),i=o(r[e[a].parent][a],i),a=e[a].parent;return i.conversion=n,i}t.exports=function(t){for(var e=i(t),n={},r=Object.keys(e),o=r.length,s=0;s<o;s++){var u=r[s];null!==e[u].parent&&(n[u]=a(u,e))}return n}},25:function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r={};function i(t){void 0===t&&(t={}),t=t}function o(t){return(null==r?void 0:r.requestAnimationFrame)?r.requestAnimationFrame(t):("object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:function(t){return setTimeout(t,16)})(t)}function a(t){return(null==r?void 0:r.clearAnimationFrame)?r.clearAnimationFrame(t):("object"==typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame:clearTimeout)(t)}},27:function(t,e,n){"use strict";var r=n(84);n.d(e,"a",(function(){return r.Layout})),n.d(e,"b",(function(){return r.Layouts}));var i=n(56);n.d(e,"c",(function(){return i.registerLayout})),n.d(e,"d",(function(){return i.unRegisterLayout}));var o=n(57);Object(i.registerLayout)("random",o.RandomLayout)},28:function(t,e,n){"use strict";n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return s}));var r=n(0),i="\t\n\v\f\r \u2028\u2029",o=new RegExp("([a-z])["+i+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+i+"]*,?["+i+"]*)+)","ig"),a=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+i+"]*,?["+i+"]*","ig"),s=function(t){if(!t)return null;if(Object(r.f)(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(o,(function(r,i,o){var s=[],u=i.toLowerCase();if(o.replace(a,(function(t,e){e&&s.push(+e)})),"m"===u&&s.length>2&&(n.push([i].concat(s.splice(0,2))),u="l",i="m"===i?"l":"L"),"o"===u&&1===s.length&&n.push([i,s[0]]),"r"===u)n.push([i].concat(s));else for(;s.length>=e[u]&&(n.push([i].concat(s.splice(0,e[u]))),e[u]););return t})),n};var u=function(t,e){if(t.length!==e.length)return!1;var n=!0;return Object(r.c)(t,(function(t,r){if(t!==e[r])return n=!1,!1})),n};function c(t,e,n){var r=null,i=n;return e<i&&(i=e,r="add"),t<i&&(i=t,r="del"),{type:r,min:i}}var h=function(t,e){var n=function(t,e){var n,r,i=t.length,o=e.length,a=0;if(0===i||0===o)return null;for(var s=[],h=0;h<=i;h++)s[h]=[],s[h][0]={min:h};for(var l=0;l<=o;l++)s[0][l]={min:l};for(h=1;h<=i;h++){n=t[h-1];for(l=1;l<=o;l++){r=e[l-1],a=u(n,r)?0:1;var f=s[h-1][l].min+1,d=s[h][l-1].min+1,p=s[h-1][l-1].min+a;s[h][l]=c(f,d,p)}}return s}(t,e),r=t.length,i=e.length,o=[],a=1,s=1;if(n[r][i].min!==r){for(var h=1;h<=r;h++){var l=n[h][h].min;s=h;for(var f=a;f<=i;f++)n[h][f].min<l&&(l=n[h][f].min,s=f);a=s,n[h][a].type&&o.push({index:h-1,type:n[h][a].type})}for(h=o.length-1;h>=0;h--)a=o[h].index,"add"===o[h].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var d=i-(r=t.length);if(r<i)for(h=0;h<d;h++)"z"===t[r-1][0]||"Z"===t[r-1][0]?t.splice(r-2,0,t[r-2]):t.push(t[r-1]),r+=1;return t};function l(t,e,n){for(var r,i=[].concat(t),o=1/(n+1),a=f(e)[0],s=1;s<=n;s++)o*=s,0===(r=Math.floor(t.length*o))?i.unshift([a[0]*o+t[r][0]*(1-o),a[1]*o+t[r][1]*(1-o)]):i.splice(r,0,[a[0]*o+t[r][0]*(1-o),a[1]*o+t[r][1]*(1-o)]);return i}function f(t){var e=[];switch(t[0]){case"M":case"L":e.push([t[1],t[2]]);break;case"A":e.push([t[6],t[7]]);break;case"Q":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"T":e.push([t[1],t[2]]);break;case"C":e.push([t[5],t[6]]),e.push([t[1],t[2]]),e.push([t[3],t[4]]);break;case"S":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"H":case"V":e.push([t[1],t[1]])}return e}var d=function(t,e){if(t.length<=1)return t;for(var n,r=0;r<e.length;r++)if(t[r][0]!==e[r][0])switch(n=f(t[r]),e[r][0]){case"M":t[r]=["M"].concat(n[0]);break;case"L":t[r]=["L"].concat(n[0]);break;case"A":t[r]=[].concat(e[r]),t[r][6]=n[0][0],t[r][7]=n[0][1];break;case"Q":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=l(n,t[r-1],1)}t[r]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[r]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(r>0)){t[r]=e[r];break}n=l(n,t[r-1],2)}t[r]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=l(n,t[r-1],1)}t[r]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[r]=e[r]}return t}},29:function(t,e,n){"use strict";n.r(e),n.d(e,"getAdjMatrix",(function(){return r})),n.d(e,"breadthFirstSearch",(function(){return l})),n.d(e,"connectedComponent",(function(){return d})),n.d(e,"getDegree",(function(){return g})),n.d(e,"getInDegree",(function(){return v})),n.d(e,"getOutDegree",(function(){return y})),n.d(e,"detectCycle",(function(){return M})),n.d(e,"detectDirectedCycle",(function(){return it})),n.d(e,"detectAllCycles",(function(){return w})),n.d(e,"detectAllDirectedCycle",(function(){return x})),n.d(e,"detectAllUndirectedCycle",(function(){return b})),n.d(e,"depthFirstSearch",(function(){return m})),n.d(e,"dijkstra",(function(){return k})),n.d(e,"findAllPath",(function(){return P})),n.d(e,"findShortestPath",(function(){return E})),n.d(e,"floydWarshall",(function(){return j})),n.d(e,"labelPropagation",(function(){return A})),n.d(e,"louvain",(function(){return T})),n.d(e,"minimumSpanningTree",(function(){return R})),n.d(e,"pageRank",(function(){return F})),n.d(e,"getNeighbors",(function(){return u})),n.d(e,"Stack",(function(){return rt})),n.d(e,"GADDI",(function(){return nt}));var r=function(t,e){var n=t.nodes,r=t.edges,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach((function(t,e){o[t.id]=e;i.push([])})),r&&r.forEach((function(t){var n=t.source,r=t.target,a=o[n],s=o[r];!a&&0!==a||!s&&0!==s||(i[a][s]=1,e||(i[s][a]=1))})),i},i=function(t,e){return t===e},o=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):""+this.value},t}(),a=function(){function t(t){void 0===t&&(t=i),this.head=null,this.tail=null,this.compare=t}return t.prototype.prepend=function(t){var e=new o(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new o(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(null!==n)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},t.prototype.find=function(t){var e=t.value,n=void 0===e?void 0:e,r=t.callback,i=void 0===r?void 0:r;if(!this.head)return null;for(var o=this.head;o;){if(i&&i(o.value))return o;if(void 0!==n&&this.compare(o.value,n))return o;o=o.next}return null},t.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},t.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},t.prototype.fromArray=function(t){var e=this;return t.forEach((function(t){return e.append(t)})),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,n=null;t;)n=t.next,t.next=e,e=t,t=n;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map((function(e){return e.toString(t)})).toString()},t}(),s=function(){function t(){this.linkedList=new a}return t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)},t}(),u=function(t,e,n){void 0===e&&(e=[]);var r=e.filter((function(e){return e.source===t||e.target===t}));if("target"===n){return r.filter((function(e){return e.source===t})).map((function(t){return t.target}))}if("source"===n){return r.filter((function(e){return e.target===t})).map((function(t){return t.source}))}return r.map((function(e){return e.source===t?e.target:e.source}))},c=function(t,e){return e.filter((function(e){return e.source===t||e.target===t}))},h=function(t){return void 0===t&&(t=0),t+"-"+(""+Math.random()).split(".")[1].substr(0,5)+(""+Math.random()).split(".")[1].substr(0,5)};var l=function(t,e,n){var r=function(t){void 0===t&&(t={});var e,n=t,r=function(){},i=(e={},function(t){var n=t.next;return!e[n]&&(e[n]=!0,!0)});return n.allowTraversal=t.allowTraversal||i,n.enter=t.enter||r,n.leave=t.leave||r,n}(n),i=new s,o=t.edges,a=void 0===o?[]:o;i.enqueue(e);for(var c="",h=function(){var t=i.dequeue();r.enter({current:t,previous:c}),u(t,a,"target").forEach((function(e){r.allowTraversal({previous:c,current:t,next:e})&&i.enqueue(e)})),r.leave({current:t,previous:c}),c=t};!i.isEmpty();)h()},f=function(t){for(var e=t.nodes,n=void 0===e?[]:e,r=t.edges,i=void 0===r?[]:r,o=[],a={},s={},c={},h=[],l=0,f=function t(e){s[e.id]=l,c[e.id]=l,l+=1,o.push(e),a[e.id]=!0;for(var r=u(e.id,i,"target").filter((function(t){return n.map((function(t){return t.id})).indexOf(t)>-1})),f=function(i){var o=r[i];if(s[o]||0===s[o])a[o]&&(c[e.id]=Math.min(c[e.id],s[o]));else{var u=n.filter((function(t){return t.id===o}));u.length>0&&t(u[0]),c[e.id]=Math.min(c[e.id],c[o])}},d=0;d<r.length;d++)f(d);if(c[e.id]===s[e.id]){for(var p=[];o.length>0;){var g=o.pop();if(a[g.id]=!1,p.push(g),g===e)break}p.length>0&&h.push(p)}},d=0,p=n;d<p.length;d++){var g=p[d];s[g.id]||0===s[g.id]||f(g)}return h};function d(t,e){return e?f(t):function(t){for(var e=t.nodes,n=void 0===e?[]:e,r=t.edges,i=void 0===r?[]:r,o=[],a={},s=[],c=function t(e){s.push(e),a[e.id]=!0;for(var r=u(e.id,i),o=function(e){var i=r[e];if(!a[i]){var o=n.filter((function(t){return t.id===i}));o.length>0&&t(o[0])}},c=0;c<r.length;++c)o(c)},h=0;h<n.length;h++){var l=n[h];if(!a[l.id]){c(l);for(var f=[];s.length>0;)f.push(s.pop());o.push(f)}}return o}(t)}var p=function(t){var e={},n=t.nodes,r=void 0===n?[]:n,i=t.edges,o=void 0===i?[]:i;return r.forEach((function(t){e[t.id]={degree:0,inDegree:0,outDegree:0}})),o.forEach((function(t){e[t.source].degree++,e[t.source].outDegree++,e[t.target].degree++,e[t.target].inDegree++})),e},g=p,v=function(t,e){return p(t)[e]?p(t)[e].inDegree:0},y=function(t,e){return p(t)[e]?p(t)[e].outDegree:0};function m(t,e,n){!function t(e,n,r,i){i.enter({current:n,previous:r});var o=e.edges;u(n,void 0===o?[]:o,"target").forEach((function(o){i.allowTraversal({previous:r,current:n,next:o})&&t(e,o,n,i)})),i.leave({current:n,previous:r})}(t,e,"",function(t){void 0===t&&(t={});var e,n=t,r=function(){},i=(e={},function(t){var n=t.next;return!e[n]&&(e[n]=!0,!0)});return n.allowTraversal=t.allowTraversal||i,n.enter=t.enter||r,n.leave=t.leave||r,n}(n))}var b=function(t,e,n){var r,i;void 0===n&&(n=!0);for(var o=[],a=0,s=d(t,!1);a<s.length;a++){var c=s[a];if(c.length)for(var h=c[0],l=h.id,f=[h],p=((r={})[l]=h,r),g=((i={})[l]=new Set,i);f.length>0;)for(var v=f.pop(),y=v.id,m=u(y,t.edges),b=function(r){var i,a=m[r],s=t.nodes.find((function(t){return t.id===a}));if(a===y)o.push(((i={})[a]=v,i));else if(a in g){if(!g[y].has(s)){for(var u=!0,c=[s,v],h=p[y];g[a].size&&!g[a].has(h)&&(c.push(h),h!==p[h.id]);)h=p[h.id];if(c.push(h),e&&n?(u=!1,c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!0)):e&&!n&&c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!1),u){for(var l={},d=1;d<c.length;d+=1)l[c[d-1].id]=c[d];c.length&&(l[c[c.length-1].id]=c[0]),o.push(l)}g[a].add(v)}}else p[a]=v,f.push(s),g[a]=new Set([v])},x=0;x<m.length;x+=1)b(x)}return o},x=function(t,e,n){void 0===n&&(n=!0);for(var r=[],i=new Set,o=[],a=[],s={},c={},h=function t(u,c,h){var l=!1;if(e&&!1===n&&e.indexOf(u.id)>-1)return l;r.push(u),i.add(u);for(var f=h[u.id],d=0;d<f.length;d+=1){if((v=s[f[d]])===c){for(var p={},g=1;g<r.length;g+=1)p[r[g-1].id]=r[g];r.length&&(p[r[r.length-1].id]=r[0]),a.push(p),l=!0}else i.has(v)||t(v,c,h)&&(l=!0)}if(l)!function(t){for(var e=[t];e.length>0;){var n=e.pop();i.has(n)&&(i.delete(n),o[n.id].forEach((function(t){e.push(t)})),o[n.id].clear())}}(u);else for(d=0;d<f.length;d+=1){var v=s[f[d]];o[v.id].has(u)||o[v.id].add(u)}return r.pop(),l},l=t.nodes,d=void 0===l?[]:l,p=0;p<d.length;p+=1){var g=d[p],v=g.id;c[v]=p,s[p]=g}if(e&&n){var y=function(t){var n=e[t];c[d[t].id]=c[n],c[n]=0,s[0]=d.find((function(t){return t.id===n})),s[c[d[t].id]]=d[t]};for(p=0;p<e.length;p++)y(p)}for(var m=function(r){for(var i,o,s=1/0,h=0;h<r.length;h+=1)for(var l=r[h],f=0;f<l.length;f++){var d=c[l[f].id];d<s&&(s=d,o=h)}var p=r[o],g=[];for(h=0;h<p.length;h+=1){var v=p[h];g[v.id]=[];for(var y=0,m=u(v.id,t.edges,"target").filter((function(t){return p.map((function(t){return t.id})).indexOf(t)>-1}));y<m.length;y++){var b=m[y];b!==v.id||!1===n&&e.indexOf(v.id)>-1?g[v.id].push(c[b]):a.push(((i={})[v.id]=v,i))}}return{component:p,adjList:g,minIdx:s}},b=0;b<d.length;){var x=d.filter((function(t){return c[t.id]>=b})),w=f({nodes:x,edges:t.edges}).filter((function(t){return t.length>1}));if(0===w.length)break;var M=m(w),S=M.minIdx,O=M.adjList,k=M.component;if(!(k.length>1))break;k.forEach((function(t){o[t.id]=new Set}));var C=s[S];if(e&&n&&-1===e.indexOf(C.id))return a;h(C,C,O),b=S+1}return a},w=function(t,e,n,r){return void 0===r&&(r=!0),e?x(t,n,r):b(t,n,r)},M=function(t){var e=null,n=t.nodes,r={},i={},o={},a={};(void 0===n?[]:n).forEach((function(t){i[t.id]=t}));for(var s={enter:function(t){var n=t.current,a=t.previous;if(o[n]){e={};for(var s=n,u=a;u!==n;)e[s]=u,s=u,u=r[u];e[s]=u}else o[n]=n,delete i[n],r[n]=a},leave:function(t){var e=t.current;a[e]=e,delete o[e]},allowTraversal:function(t){var n=t.next;return!e&&!a[n]}};Object.keys(i).length;){m(t,Object.keys(i)[0],s)}return e},S=n(1),O=n(0),k=function(t,e,n,r){var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u=[],h={},l={},f={};o.forEach((function(t,n){var r=t.id;u.push(r),l[r]=1/0,r===e&&(l[r]=0)}));for(var d=o.length,p=function(t){var e=function(t,e,n){for(var r,i=1/0,o=0;o<e.length;o++){var a=e[o].id;!n[a]&&t[a]<=i&&(i=t[a],r=e[o])}return r}(l,o,h),i=e.id;if(h[i]=!0,l[i]===1/0)return"continue";(n?function(t,e){return e.filter((function(e){return e.source===t}))}(i,s):c(i,s)).forEach((function(t){var n=t.target,o=t.source,a=n===i?o:n,s=r&&t[r]?t[r]:1;l[a]>l[e.id]+s?(l[a]=l[e.id]+s,f[a]=[e.id]):l[a]===l[e.id]+s&&f[a].push(e.id)}))},g=0;g<d;g++)p();f[e]=[e];var v={};for(var y in l)l[y]!==1/0&&C(e,y,f,v);var m={};for(var y in v)m[y]=v[y][0];return{length:l,path:m,allPath:v}};function C(t,e,n,r){if(t===e)return[t];if(r[e])return r[e];for(var i=[],o=0,a=n[e];o<a.length;o++){var s=C(t,a[o],n,r);if(!s)return;for(var u=0,c=s;u<c.length;u++){var h=c[u];Object(O.f)(h)?i.push(Object(S.f)(Object(S.f)([],h),[e])):i.push([h,e])}}return r[e]=i,r[e]}var E=function(t,e,n,r,i){var o=k(t,e,r,i),a=o.length,s=o.path,u=o.allPath;return{length:a[n],path:s[n],allPath:u[n]}},P=function(t,e,n,r){var i;if(e===n)return[[e]];var o=t.edges,a=void 0===o?[]:o,s=[e],c=((i={})[e]=!0,i),h=[],l=[],f=r?u(e,a,"target"):u(e,a);for(h.push(f);s.length>0&&h.length>0;){var d=h[h.length-1];if(d.length){var p=d.shift();if(p&&(s.push(p),c[p]=!0,f=r?u(p,a,"target"):u(p,a),h.push(f.filter((function(t){return!c[t]})))),s[s.length-1]===n){var g=s.map((function(t){return t}));l.push(g);v=s.pop();c[v]=!1,h.pop()}}else{var v=s.pop();c[v]=!1,h.pop()}}return l},j=function(t,e){for(var n=r(t,e),i=[],o=n.length,a=0;a<o;a+=1){i[a]=[];for(var s=0;s<o;s+=1)a===s?i[a][s]=0:0!==n[a][s]&&n[a][s]?i[a][s]=n[a][s]:i[a][s]=1/0}for(var u=0;u<o;u+=1)for(a=0;a<o;a+=1)for(s=0;s<o;s+=1)i[a][s]>i[a][u]+i[u][s]&&(i[a][s]=i[a][u]+i[u][s]);return i},A=function(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===i&&(i=1e3);var o=t.nodes,a=void 0===o?[]:o,s=t.edges,u=void 0===s?[]:s,c={},l={};a.forEach((function(t,e){var n=h();t.clusterId=n,c[n]={id:n,nodes:[t]},l[t.id]={node:t,idx:e}}));var f=r(t,e),d=[],p={};f.forEach((function(t,e){var n=0,r=a[e].id;p[r]={},t.forEach((function(t,e){if(t){n+=t;var i=a[e].id;p[r][i]=t}})),d.push(n)}));for(var g=0,v=function(){var t=!1;if(a.forEach((function(e){var n={};Object.keys(p[e.id]).forEach((function(t){var r=p[e.id][t],i=l[t].node.clusterId;n[i]||(n[i]=0),n[i]+=r}));var r=-1/0,i=[];if(Object.keys(n).forEach((function(t){r<n[t]?(r=n[t],i=[t]):r===n[t]&&i.push(t)})),1!==i.length||i[0]!==e.clusterId){var o=i.indexOf(e.clusterId);if(o>=0&&i.splice(o,1),i&&i.length){t=!0;var a=c[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var u=Math.floor(Math.random()*i.length),h=c[i[u]];h.nodes.push(e),e.clusterId=h.id}}})),!t)return"break";g++};g<i;){if("break"===v())break}Object.keys(c).forEach((function(t){var e=c[t];e.nodes&&e.nodes.length||delete c[t]}));var y=[],m={};u.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=l[e].node.clusterId,a=l[r].node.clusterId,s=o+"---"+a;if(m[s])m[s].weight+=i,m[s].count++;else{var u={source:o,target:a,weight:i,count:1};m[s]=u,y.push(u)}}));var b=[];return Object.keys(c).forEach((function(t){b.push(c[t])})),{clusters:b,clusterEdges:y}},I=function(t,e,n,r){for(var i=e.length,o=2*r,a=0,s=0;s<i;s++)for(var u=t[s].clusterId,c=0;c<i;c++){if(u===t[c].clusterId)a+=(e[s][c]||0)-(n[s]||0)*(n[c]||0)/o}return a*=1/o},T=function(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===i&&(i=1e-4);var o=t.nodes,a=void 0===o?[]:o,s=t.edges,u=void 0===s?[]:s,c=1,h={},l={};a.forEach((function(t,e){var n=String(c++);t.clusterId=n,h[n]={id:n,nodes:[t]},l[t.id]={node:t,idx:e}}));var f=r(t,e),d=[],p={},g=0;f.forEach((function(t,e){var n=0,r=a[e].id;p[r]={},t.forEach((function(t,e){if(t){n+=t;var i=a[e].id;p[r][i]=t,g+=t}})),d.push(n)})),g/=2;for(var v=1/0,y=1/0,m=0;v=I(a,f,d,g),!(Math.abs(v-y)<i||m>100);)y=v,m++,Object.keys(h).forEach((function(t){var e=0;u.forEach((function(r){var i=r.source,o=r.target,a=l[i].node.clusterId,s=l[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=r[n]||1)})),h[t].sumTot=e})),a.forEach((function(t,e){var r,i=h[t.clusterId],o=0,a=d[e]/(2*g),s=0;i.nodes.forEach((function(t){var n=l[t.id].idx;s+=f[e][n]||0}));var c=s-i.sumTot*a,v=p[t.id];if(Object.keys(v).forEach((function(n){var i=l[n].node.clusterId;if(i!==t.clusterId){var s=h[i],u=s.nodes;if(u&&u.length){var d=0;u.forEach((function(t){var n=l[t.id].idx;d+=f[e][n]||0}));var p=d-s.sumTot*a-c;p>o&&(o=p,r=s)}}})),o>0){r.nodes.push(t);var y=t.clusterId;t.clusterId=r.id;var m=i.nodes.indexOf(t);i.nodes.splice(m,1);var b=0,x=0;u.forEach((function(t){var e=t.source,i=t.target,o=l[e].node.clusterId,a=l[i].node.clusterId;(o===r.id&&a!==r.id||a===r.id&&o!==r.id)&&(b+=t[n]||1),(o===y&&a!==y||a===y&&o!==y)&&(x+=t[n]||1)})),r.sumTot=b,i.sumTot=x}}));var b={},x=0;Object.keys(h).forEach((function(t){var e=h[t];if(e.nodes&&e.nodes.length){var n=String(x+1);n!==t&&(e.id=n,e.nodes=e.nodes.map((function(t){return{id:t.id,clusterId:n}})),h[n]=e,b[t]=n,delete h[t],x++)}else delete h[t]})),a.forEach((function(t){t.clusterId&&b[t.clusterId]&&(t.clusterId=b[t.clusterId])}));var w=[],M={};u.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=l[e].node.clusterId,a=l[r].node.clusterId,s=o+"---"+a;if(M[s])M[s].weight+=i,M[s].count++;else{var u={source:o,target:a,weight:i,count:1};M[s]=u,w.push(u)}}));var S=[];return Object.keys(h).forEach((function(t){S.push(h[t])})),{clusters:S,clusterEdges:w}},N=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e<n.length;e++){var r=n[e];this.parent[r]=r}}return t.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},t.prototype.union=function(t,e){var n=this.find(t),r=this.find(e);n!==r&&(n<r?(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]):(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]))},t.prototype.connected=function(t,e){return this.find(t)===this.find(e)},t}(),B=function(t,e){return t-e},_=function(){function t(t){void 0===t&&(t=B),this.compareFn=t,this.list=[]}return t.prototype.getLeft=function(t){return 2*t+1},t.prototype.getRight=function(t){return 2*t+2},t.prototype.getParent=function(t){return 0===t?null:Math.floor((t-1)/2)},t.prototype.isEmpty=function(){return this.list.length<=0},t.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},t.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,n=t,r=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==r&&r<o&&this.compareFn(this.list[n],this.list[r])>0?n=r:null!==i&&i<o&&this.compareFn(this.list[n],this.list[i])>0&&(n=i),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},t}(),L=function(t,e){var n=[],r=t.nodes,i=void 0===r?[]:r,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return n;var s=i[0],u=new Set;u.add(s);var h=new _((function(t,n){return e?t.weight-n.weight:0}));for(c(s.id,a).forEach((function(t){h.insert(t)}));!h.isEmpty();){var l=h.delMin(),f=l.source,d=l.target;u.has(f)&&u.has(d)||(n.push(l),u.has(f)||(u.add(f),c(f,a).forEach((function(t){h.insert(t)}))),u.has(d)||(u.add(d),c(d,a).forEach((function(t){h.insert(t)}))))}return n},D=function(t,e){var n=[],r=t.nodes,i=void 0===r?[]:r,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return n;var s=a.map((function(t){return t}));e&&s.sort((function(t,e){return t.weight-e.weight}));for(var u=new N(i.map((function(t){return t.id})));s.length>0;){var c=s.shift(),h=c.source,l=c.target;u.connected(h,l)||(n.push(c),u.union(h,l))}return n},R=function(t,e,n){return n?{prim:L,kruskal:D}[n](t,e):D(t,e)},F=function(t,e,n){"number"!=typeof e&&(e=1e-6),"number"!=typeof n&&(n=.85);for(var r,i=1,o=0,a=1e3,s=t.nodes,c=void 0===s?[]:s,h=t.edges,l=void 0===h?[]:h,f=c.length,d={},p={},v=0;v<f;++v){d[m=(S=c[v]).id]=1/f,p[m]=1/f}for(var y=g(t);a>0&&i>e;){o=0;for(v=0;v<f;++v){var m=(S=c[v]).id;if(r=0,0===y[S.id].inDegree)d[m]=0;else{for(var b=u(m,l,"source"),x=0;x<b.length;++x){var w=b[x],M=y[w].outDegree;M>0&&(r+=p[w]/M)}d[m]=n*r,o+=d[m]}}o=(1-o)/f,i=0;for(v=0;v<f;++v){var S;r=d[m=(S=c[v]).id]+o,i+=Math.abs(r-p[m]),p[m]=r}a-=1}return p},X=function(t,e,n,r){void 0===t&&(t=-1),void 0===e&&(e=-1),void 0===n&&(n=-1),void 0===r&&(r="-1"),this.id=t,this.from=e,this.to=n,this.label=r},Y=function(){function t(t,e){void 0===t&&(t=-1),void 0===e&&(e="-1"),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return t.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},t}(),z=function(){function t(t,e,n){void 0===t&&(t=-1),void 0===e&&(e=!0),void 0===n&&(n=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return t.prototype.getNodeNum=function(){return this.nodes.length},t.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var n=new Y(t,e);this.nodes.push(n),this.nodeMap[t]=n,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},t.prototype.addEdge=function(t,e,n,r){if((this.edgeIdAutoIncrease||void 0===t)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[t])){var i=new X(t,e,n,r);if(this.edges.push(i),this.edgeMap[t]=i,this.nodeMap[e].addEdge(i),this.edgeLabelMap[r]||(this.edgeLabelMap[r]=[]),this.edgeLabelMap[r].push(i),!this.directed){var o=new X(t,n,e,r);this.nodeMap[n].addEdge(o),this.edgeLabelMap[r].push(o)}}},t}(),W=function(){function t(t,e,n,r,i){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||"-1",edgeLabel:r||"-1",nodeLabel2:i||"-1"}}return t.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t}(),q=function(){function t(){this.rmpath=[],this.dfsEdgeList=[]}return t.prototype.equalTo=function(t){var e=this.dfsEdgeList.length;if(e!==t.length)return!1;for(var n=0;n<e;n++)if(this.dfsEdgeList[n]!==t[n])return!1;return!0},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t.prototype.pushBack=function(t,e,n,r,i){return this.dfsEdgeList.push(new W(t,e,n,r,i)),this.dfsEdgeList},t.prototype.toGraph=function(t,e){void 0===t&&(t=-1),void 0===e&&(e=!1);var n=new z(t,!0,e);return this.dfsEdgeList.forEach((function(t){var e=t.fromNode,r=t.toNode,i=t.nodeEdgeNodeLabel,o=i.nodeLabel1,a=i.edgeLabel,s=i.nodeLabel2;"-1"!==o&&n.addNode(e,o),"-1"!==s&&n.addNode(r,s),n.addEdge(void 0,e,r,a)})),n},t.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length-1;e>=0;e--){var n=this.dfsEdgeList[e],r=n.fromNode,i=n.toNode;r<i&&(void 0===t||i===t)&&(this.rmpath.push(e),t=r)}return this.rmpath},t.prototype.getNodeNum=function(){var t={};return this.dfsEdgeList.forEach((function(e){t[e.fromNode]||(t[e.fromNode]=!0),t[e.toNode]||(t[e.toNode]=!0)})),Object.keys(t).length},t}(),G=function(){function t(t){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],t){for(;t;){var e=t.edge;this.edges.push(e),this.nodesUsed[e.from]=1,this.nodesUsed[e.to]=1,this.edgesUsed[e.id]=1,t=t.preNode}this.edges=this.edges.reverse()}}return t.prototype.hasNode=function(t){return 1===this.nodesUsed[t.id]},t.prototype.hasEdge=function(t){return 1===this.edgesUsed[t.id]},t}(),V=function(){function t(t){var e=t.graphs,n=t.minSupport,r=void 0===n?2:n,i=t.minNodeNum,o=void 0===i?1:i,a=t.maxNodeNum,s=void 0===a?4:a,u=t.top,c=void 0===u?10:u,h=t.directed,l=void 0!==h&&h,f=t.verbose,d=void 0!==f&&f;this.graphs=e,this.dfsCode=new q,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=r,this.top=c,this.directed=l,this.counter=0,this.maxNodeNum=s,this.minNodeNum=o,this.verbose=d,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return t.prototype.findForwardRootEdges=function(t,e){var n=this,r=[],i=t.nodeMap;return e.edges.forEach((function(t){(n.directed||e.label<=i[t.to].label)&&r.push(t)})),r},t.prototype.findBackwardEdge=function(t,e,n,r){if(!this.directed&&e===n)return null;for(var i=t.nodeMap,o=i[n.to].edges,a=o.length,s=0;s<a;s++){var u=o[s];if(!r.hasEdge(u)&&u.to===e.from)if(this.directed){if(i[e.from].label<i[n.to].label||i[e.from].label===i[n.to].label&&e.label<=u.label)return u}else if(e.label<u.label||e.label===u.label&&i[e.to].label<=i[n.to].label)return u}return null},t.prototype.findForwardPureEdges=function(t,e,n,r){for(var i=[],o=e.to,a=t.nodeMap[o].edges,s=a.length,u=0;u<s;u++){var c=a[u],h=t.nodeMap[c.to];n<=h.label&&!r.hasNode(h)&&i.push(c)}return i},t.prototype.findForwardRmpathEdges=function(t,e,n,r){for(var i=[],o=t.nodeMap,a=o[e.to].label,s=o[e.from].edges,u=s.length,c=0;c<u;c++){var h=s[c],l=o[h.to].label;e.to===h.to||n>l||r.hasNode(o[h.to])||(e.label<h.label||e.label===h.label&&a<=l)&&i.push(h)}return i},t.prototype.getSupport=function(t){var e={};return t.forEach((function(t){e[t.graphId]||(e[t.graphId]=!0)})),Object.keys(e).length},t.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach((function(n){var r=t[n],i=r.nodeLabel1,o=r.edgeLabel,a=r.nodeLabel2;e?(i<e.nodeLabel1||i===e.nodeLabel1&&o<e.edgeLabel||i===e.nodeLabel1&&o===e.edgeLabel&&a<e.nodeLabel2)&&(e={nodeLabel1:i,edgeLabel:o,nodeLabel2:a}):e={nodeLabel1:i,edgeLabel:o,nodeLabel2:a}})),e},t.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),1===e.dfsEdgeList.length)return!0;var n=this.directed,r=e.toGraph(-1,n),i=r.nodeMap,o=new q,a={};r.nodes.forEach((function(e){t.findForwardRootEdges(r,e).forEach((function(t){var n=i[t.to],o=e.label+"-"+t.label+"-"+n.label;a[o]||(a[o]={projected:[],nodeLabel1:e.label,edgeLabel:t.label,nodeLabel2:n.label});var s={graphId:r.id,edge:t,preNode:null};a[o].projected.push(s)}))}));var s=this.findMinLabel(a);o.dfsEdgeList.push(new W(0,1,s.nodeLabel1,s.edgeLabel,s.nodeLabel2));var u=s.nodeLabel1+"-"+s.edgeLabel+"-"+s.nodeLabel2;return function a(s){for(var u=o.buildRmpath(),c=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,h=o.dfsEdgeList[u[0]].toNode,l={},f=!1,d=0,p=n?-1:0,g=function(e){if(f)return"break";s.forEach((function(n){var i=new G(n),a=t.findBackwardEdge(r,i.edges[u[e]],i.edges[u[0]],i);a&&(l[a.label]||(l[a.label]={projected:[],edgeLabel:a.label}),l[a.label].projected.push({graphId:r.id,edge:l,preNode:n}),d=o.dfsEdgeList[u[e]].fromNode,f=!0)}))},v=u.length-1;v>p;v--){if("break"===g(v))break}if(f){var y=t.findMinLabel(l);o.dfsEdgeList.push(new W(h,d,"-1",y.edgeLabel,"-1"));var m=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[m]===o.dfsEdgeList[m]&&a(l[y.edgeLabel].projected)}var b={};f=!1;var x=0;s.forEach((function(e){var n=new G(e),o=t.findForwardPureEdges(r,n.edges[u[0]],c,n);o.length>0&&(f=!0,x=h,o.forEach((function(t){var n=t.label+"-"+i[t.to].label;b[n]||(b[n]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}));var w=u.length,M=function(e){if(f)return"break";var n=u[e];s.forEach((function(e){var a=new G(e),s=t.findForwardRmpathEdges(r,a.edges[n],c,a);s.length>0&&(f=!0,x=o.dfsEdgeList[n].fromNode,s.forEach((function(t){var n=t.label+"-"+i[t.to].label;b[n]||(b[n]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}))};for(v=0;v<w;v++){if("break"===M(v))break}if(!f)return!0;var S=t.findMinLabel(b);o.dfsEdgeList.push(new W(x,h+1,"-1",S.edgeLabel,S.nodeLabel2));var O=o.dfsEdgeList.length-1;return e.dfsEdgeList[O]===o.dfsEdgeList[O]&&a(b[S.edgeLabel+"-"+S.nodeLabel2].projected)}(a[u].projected)},t.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(Object(O.a)(t))}},t.prototype.subGraphMining=function(t){var e=this;if(!(this.getSupport(t)<this.minSupport)&&this.isMin()){this.report();var n=this.dfsCode.getNodeNum(),r=this.dfsCode.buildRmpath(),i=this.dfsCode.dfsEdgeList[r[0]].toNode,o=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,a={},s={};t.forEach((function(t){for(var u=e.graphs[t.graphId],c=u.nodeMap,h=new G(t),l=r.length-1;l>=0;l--){var f=e.findBackwardEdge(u,h.edges[r[l]],h.edges[r[0]],h);if(f){var d=e.dfsCode.dfsEdgeList[r[l]].fromNode+"-"+f.label;s[d]||(s[d]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[r[l]].fromNode,edgeLabel:f.label}),s[d].projected.push({graphId:t.graphId,edge:f,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(u,h.edges[r[0]],o,h).forEach((function(e){var n=i+"-"+e.label+"-"+c[e.to].label;a[n]||(a[n]={projected:[],fromNodeId:i,edgeLabel:e.label,nodeLabel2:c[e.to].label}),a[n].projected.push({graphId:t.graphId,edge:e,preNode:t})}));var p=function(n){e.findForwardRmpathEdges(u,h.edges[r[n]],o,h).forEach((function(i){var o=e.dfsCode.dfsEdgeList[r[n]].fromNode+"-"+i.label+"-"+c[i.to].label;a[o]||(a[o]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[r[n]].fromNode,edgeLabel:i.label,nodeLabel2:c[i.to].label}),a[o].projected.push({graphId:t.graphId,edge:i,preNode:t})}))};for(l=0;l<r.length;l++)p(l)}})),Object.keys(s).forEach((function(t){var n=s[t],r=n.toNodeId,o=n.edgeLabel;e.dfsCode.dfsEdgeList.push(new W(i,r,"-1",o,"-1")),e.subGraphMining(s[t].projected),e.dfsCode.dfsEdgeList.pop()})),Object.keys(a).forEach((function(t){var n=a[t],r=n.fromNodeId,o=n.edgeLabel,s=n.nodeLabel2;e.dfsCode.dfsEdgeList.push(new W(r,i+1,"-1",o,s)),e.subGraphMining(a[t].projected),e.dfsCode.dfsEdgeList.pop()}))}},t.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,n=this.minSupport,r=this.frequentSize1Subgraphs,i={},o={},a={},s={};return Object.keys(t).forEach((function(n){var r=t[n],u=r.nodeMap;r.nodes.forEach((function(t,r){var c=t.label,h=n+"-"+c;if(!a[h]){var l=i[c]||0;l++,i[c]=l}a[h]={graphKey:n,label:c},t.edges.forEach((function(t){var r=c,i=u[t.to].label;if(!e&&r>i){var a=i;i=r,r=a}var h=t.label,l=n+"-"+r+"-"+h+"-"+i,f=r+"-"+h+"-"+i;if(!o[f]){var d=o[f]||0;d++,o[f]=d}s[l]={graphId:n,nodeLabel1:r,edgeLabel:h,nodeLabel2:i}}))}))})),Object.keys(i).forEach((function(t){if(!(i[t]<n)){var e={nodes:[],edges:[]};e.nodes.push({id:"0",label:t}),r.push(e)}})),r},t.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs,n=(this.directed,{});Object.keys(e).forEach((function(r){var i=e[r],o=i.nodeMap;i.nodes.forEach((function(e){t.findForwardRootEdges(i,e).forEach((function(t){var i=o[t.to],a=e.label+"-"+t.label+"-"+i.label;n[a]||(n[a]={projected:[],nodeLabel1:e.label,edgeLabel:t.label,nodeLabel2:i.label});var s={graphId:r,edge:t,preNode:null};n[a].projected.push(s)}))}))})),Object.keys(n).forEach((function(e){var r=n[e],i=r.projected,o=r.nodeLabel1,a=r.edgeLabel,s=r.nodeLabel2;t.dfsCode.dfsEdgeList.push(new W(0,1,o,a,s)),t.subGraphMining(i),t.dfsCode.dfsEdgeList.pop()}))}},t}(),H=function(t){var e=t.graphs,n=t.directed,r=void 0!==n&&n,i=t.nodeLabelProp,o=void 0===i?"cluster":i,a=t.edgeLabelProp,s=void 0===a?"cluster":a,u=function(t,e,n,r){var i={};return Object.keys(t).forEach((function(o,a){var s=t[o],u=new z(a,!0,e),c={};s.nodes.forEach((function(t,e){u.addNode(e,t[n]),c[t.id]=e})),s.edges.forEach((function(t,e){var n=c[t.source],i=c[t.target];u.addEdge(-1,n,i,t[r])})),u&&u.getNodeNum()&&(i[u.id]=u)})),i}(e,r,o,s),c=t.minSupport,h=t.maxNodeNum,l=t.minNodeNum,f=t.verbose,d=t.top,p=new V({graphs:u,minSupport:c,maxNodeNum:h,minNodeNum:l,top:d,verbose:f,directed:r});return p.run(),function(t,e,n){var r=[];return t.forEach((function(t){var i={nodes:[],edges:[]};t.nodes.forEach((function(t){var n;i.nodes.push(((n={id:""+t.id})[e]=t.label,n))})),t.edges.forEach((function(t){var e;i.edges.push(((e={source:""+t.from,target:""+t.to})[n]=t.label,e))})),r.push(i)})),r}(p.frequentSubgraphs,o,s)};function U(t){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Z=function(t,e,n,r){void 0===n&&(n="cluster"),void 0===r&&(r=2);var i=[],o=t.nodes;return e.forEach((function(t,e){i.push(Q(o,t,e,n,r))})),i},Q=function(t,e,n,r,i){var o=[n],a=[],s={};return e.forEach((function(e,u){if(e<=i&&n!==u){o.push(u),a.push(t[u]);var c=t[u][r];s[c]?(s[c].count++,s[c].dists.push(e)):s[c]={count:1,dists:[e]}}})),Object.keys(s).forEach((function(t){s[t].dists=s[t].dists.sort((function(t,e){return t-e}))})),{nodeIdx:n,nodeId:t[n].id,nodeIdxs:o,neighbors:a,neighborNum:o.length-1,nodeLabelCountMap:s}},K=function(t,e,n,r){var i=n.nodes;return r||(r={}),Object.keys(t).forEach((function(o){var a,s;if(!r||!r[o]){r[o]={nodes:[],edges:[]};var u=t[o],c=null===(a=e[u.start])||void 0===a?void 0:a.nodeIdxs,h=null===(s=e[u.end])||void 0===s?void 0:s.nodeIdxs;if(c&&h){var l=new Set(h),f=c.filter((function(t){return l.has(t)}));if(f&&f.length){for(var d={},p=f.length,g=0;g<p;g++){var v=i[f[g]];r[o].nodes.push(v),d[v.id]=!0}n.edges.forEach((function(t){d[t.source]&&d[t.target]&&r[o].edges.push(t)}))}}}})),r},$=function(t,e,n,r){var i={};t.nodes.forEach((function(t){i[t.id]=t}));var o=0;return t.edges.forEach((function(t){var a=i[t.source][n],s=i[t.target][n],u=e.nodes[0][n],c=e.nodes[1][n],h=e.edges[0][r];t[r]===h&&(a===u&&s===c||a===c&&s===u)&&o++})),o},J=function(t,e){var n={},r={};return t.forEach((function(t,i){n[t.id]={idx:i,node:t,degree:0};var o=t[e];r[o]||(r[o]=[]),r[o].push(t)})),{nodeMap:n,nodeLabelMap:r}},tt=function(t,e,n){var r={},i={};return t.forEach((function(t,o){r[""+h]={idx:o,edge:t};var a=t[e];i[a]||(i[a]=[]),i[a].push(t);var s=n[t.source];s&&s.degree++;var u=n[t.target];u&&u.degree++})),{edgeMap:r,edgeLabelMap:i}},et=function(t,e,n){var r=e.length,i={};return e.forEach((function(e,o){for(var a=n?0:o+1,s=t[o].id,u=a;u<r;u++)if(o!==u){var c=t[u].id,h=e[u];i[s+"-"+c]=h,n||(i[c+"-"+s]=h)}})),i},nt=function(t,e,n,r,i,o,a){if(void 0===n&&(n=!1),void 0===o&&(o="cluster"),void 0===a&&(a="cluster"),t&&t.nodes){var s=t.nodes.length;if(s){var u=j(t,n),c=j(e,n),h=et(t.nodes,u,n),l=et(e.nodes,c,n),f=J(t.nodes,o),d=f.nodeMap,p=f.nodeLabelMap,g=J(e.nodes,o),v=g.nodeMap,y=g.nodeLabelMap;tt(t.edges,a,d);var m=tt(e.edges,a,v).edgeLabelMap;i||(i=Math.max.apply(Math,Object(S.f)(Object(S.f)([],c[0]),[2]))),r||(r=i);var b=Z(t,u,o,r),x=Z(e,c,o,r),w=function(t,e,n,r,i){var o=Math.ceil(n/e),a={},s=0;return r.forEach((function(t,r){for(var u=0,c=0,h=t.nodeIdxs,l=t.neighborNum-1;u<o;){for(var f=h[1+Math.floor(Math.random()*l)],d=0;(a[r+"-"+f]||a[f+"-"+r])&&(f=Math.floor(Math.random()*e),!(++d>2*e)););if(d<2*e&&(a[r+"-"+f]={start:r,end:f,distance:i[r][f]},u++,++s>=n))return a;if(++c>2*e)break}u<o&&(o=(o+(o-u))/(e-r-1))})),a}(0,s,Math.min(100,s*(s-1)/2),x,u),M=K(w,b,t),O=H({graphs:M,nodeLabelProp:o,edgeLabelProp:a,minSupport:1,minNodeNum:1,maxNodeNum:4,directed:n}).slice(0,10),C=O.length,E=[];O.forEach((function(t,e){E[e]={},Object.keys(M).forEach((function(n){var r=M[n],i=$(r,t,o,a);E[e][n]=i}))}));var P=function(t,e,n){for(var r=1/0,i=0,o=function(e){var n=t[e],o=Object.keys(n).sort((function(t,e){return n[t]-n[e]})),a=[];o.forEach((function(t,e){a[e%10]||(a[e%10]={graphs:[],totalCount:0,aveCount:0}),a[e%10].graphs.push(t),a[e%10].totalCount+=n[t]}));var s=0,u=[];a.forEach((function(t){var e=t.totalCount/t.graphs.length;t.aveCount=e,u.push(e);var r=0,i=t.length;t.graphs.forEach((function(e,i){var o=n[e];t.graphs.forEach((function(t,e){i!==e&&(r+=Math.abs(o-n[t]))}))})),s+=r/=i*(i-1)/2})),s/=a.length;var c=0;u.forEach((function(t,e){u.forEach((function(n,r){e!==r&&(c+=Math.abs(t-n))})),c/=u.length*(u.length-1)/2}));var h=c-s;r<h&&(r=h,i=e)},a=0;a<e;a++)o(a);return{structure:n[i],structureCountMap:t[i]}}(E,C,O),A=P.structure,I=P.structureCountMap,T=e.nodes[0],N=T[o],B=p[N],_={},L={},D={},R={},F={};Object.keys(y).forEach((function(n,r){F[n]=[];var i=-1/0,s=y[n],u={};s.forEach((function(t){var e=l[T.id+"-"+t.id];e&&F[n].push(e),i<e&&(i=e),u[T.id+"-"+t.id]={start:0,end:v[t.id].idx,distance:e}})),F[n]=F[n].sort((function(t,e){return t-e})),L=K(u,x,e,L);var c=[];if(Object.keys(u).forEach((function(t){if(D[t])c.push(D[t]);else{var e=L[t];D[t]=$(e,A,o,a),c.push(D[t])}})),c=c.sort((function(t,e){return e-t})),R[T.id+"-"+n]=c,n!==N)for(var f=function(e){var r=B[e],i=b[d[r.id].idx],s=i.nodeLabelCountMap[n],u=y[n].length;if(!s||s.count<u)return B.splice(e,1),"continue";for(var l=!1,f=0;f<u;f++)if(s.dists[f]>F[n][f]){l=!0;break}if(l)return B.splice(e,1),"continue";var p={};i.neighbors.forEach((function(t){var e=h[r.id+"-"+t.id];p[r.id+"-"+t.id]={start:d[r.id].idx,end:d[t.id].idx,distance:e}})),M=K(p,b,t,M);var g=[];Object.keys(p).forEach((function(t){if(I[t])g.push(I[t]);else{var e=M[t];I[t]=$(e,A,o,a),g.push(I[t])}})),g=g.sort((function(t,e){return e-t}));var v=!1;for(f=0;f<u;f++)if(g[f]<c[f]){v=!0;break}return v?(B.splice(e,1),"continue"):void 0},p=B.length-1;p>=0;p--)f(p)}));var X=[];B.forEach((function(n){for(var r=d[n.id].idx,s=Q(t.nodes,u[r],r,o,i).neighbors,c=s.length,l=!1,f=function(r){if(s.length+1<e.nodes.length)return l=!0,{value:void 0};var i=s[r],u=i[o];if(!y[u]||!y[u].length)return s.splice(r,1),"continue";var c=n.id+"-"+i.id;if(!F[u]||!F[u].length)return s.splice(r,1),"continue";var f=h[c];if(f>F[u][F[u].length-1])return s.splice(r,1),"continue";var p=I[c]?I[c]:function(t,e,n,r,i,o,a,s,u,c,h){var l,f=e.id+"-"+n.id;if(c&&c[f])return c[f];var d=h?h[f]:void 0;if(!d){var p=((l={})[f]={start:r[e.id].idx,end:r[n.id].idx,distance:i},l);d=(h=K(p,o,t,h))[f]}return $(d,a,s,u)}(t,n,i,d,f,b,A,o,a,I,M),g=T.id+"-"+u;if(p<R[g][R[g].length-1])return s.splice(r,1),"continue";var m=_[u];return void 0===m&&(m=1/0,y[u].forEach((function(t){var e=v[t.id].degree;m>e&&(m=e)})),_[u]=m),d[i.id].degree<m?(s.splice(r,1),"continue"):void 0},p=c-1;p>=0;p--){var g=f(p);if("object"===U(g))return g.value}l||X.push({nodes:[n].concat(s)})}));var Y=k(e,T.id,!1).length,z={};n?(Object.keys(Y).forEach((function(t){var e=v[t].node[o];z[e]?z[e].push(Y[t]):z[e]=[Y[t]]})),Object.keys(z).forEach((function(t){z[t].sort((function(t,e){return t-e}))}))):z=F;for(var W=function(r){var i=X[r],s=i.nodes[0],u={},c={};i.nodes.forEach((function(t,e){c[t.id]={idx:e,node:t,degree:0};var n=t[o];u[n]?u[n]++:u[n]=1}));var h=[],l={};t.edges.forEach((function(t){c[t.source]&&c[t.target]&&(h.push(t),l[t[a]]?l[t[a]]++:l[t[a]]=1,c[t.source].degree++,c[t.target].degree++)}));for(var f=Object.keys(m).length,p=!1,g=0;g<f;g++){var b=Object.keys(m)[g];if(!l[b]||l[b]<m[b].length){p=!0;break}}if(p)return X.splice(r,1),"continue";var x=h.length;if(x<e.edges.length)return X.splice(r,1),"break";var w=!1,M=function(t){var e=h[t],r=e[a],i=m[r];if(!i||!i.length)return l[r]--,i&&l[r]<i.length?(w=!0,"break"):(h.splice(t,1),c[e.source].degree--,c[e.target].degree--,"continue");var s=c[e.source].node[o],u=c[e.target].node[o],f=!1;return i.forEach((function(t){var e=v[t.source].node,r=v[t.target].node;e[o]===s&&r[o]===u&&(f=!0),n||e[o]!==u||r[o]!==s||(f=!0)})),f?void 0:(l[r]--,i&&l[r]<i.length?(w=!0,"break"):(h.splice(t,1),c[e.source].degree--,c[e.target].degree--,"continue"))};for(g=x-1;g>=0;g--){if("break"===M(g))break}if(w)return X.splice(r,1),"continue";i.edges=h;var S=k(i,i.nodes[0].id,!1).length;if(Object.keys(S).reverse().forEach((function(t){if(t!==i.nodes[0].id&&!w){if(S[t]===1/0){var e=c[t].node[o];if(u[e]--,u[e]<y[e].length)return void(w=!0);var n=i.nodes.indexOf(c[t].node);return i.nodes.splice(n,1),void(c[t]=void 0)}var r=d[t].node[o];if(!z[r]||!z[r].length||S[t]>z[r][z[r].length-1]){e=c[t].node[o];if(u[e]--,u[e]<y[e].length)return void(w=!0);n=i.nodes.indexOf(c[t].node);i.nodes.splice(n,1),c[t]=void 0}}})),w)return X.splice(r,1),"continue";for(var O=!0,C=0;O&&!w;){if(O=!1,c[s.id].degree<v[T.id].degree){w=!0;break}if(u[s[o]]<y[s[o]].length){w=!0;break}for(var E=i.nodes.length-1;E>=0;E--){var P=i.nodes[E],j=c[P.id].degree,A=P[o];if(j<_[A]){if(u[P[o]]--,u[P[o]]<y[P[o]].length){w=!0;break}i.nodes.splice(E,1),c[P.id]=void 0,O=!0}}if(w||!O&&0!==C)break;for(var I=(x=h.length)-1;I>=0;I--){var N=h[I];if(!c[N.source]||!c[N.target]){h.splice(I,1);var B=N[a];if(l[B]--,c[N.source]&&c[N.source].degree--,c[N.target]&&c[N.target].degree--,m[B]&&l[B]<m[B].length){w=!0;break}O=!0}}C++}return w||w||i.nodes.length<e.nodes.length||h.length<e.edges.length?(X.splice(r,1),"continue"):void 0},q=X.length-1;q>=0;q--){if("break"===W(q))break}var G=X.length,V=function(t){var e=X[t],n={};e.edges.forEach((function(t){var e=t.source+"-"+t.target+"-"+t.label;n[e]?n[e]++:n[e]=1}));for(var r=function(t){var e=X[t],r={};e.edges.forEach((function(t){var e=t.source+"-"+t.target+"-"+t.label;r[e]?r[e]++:r[e]=1}));var i=!0;Object.keys(r).length!==Object.keys(n).length?i=!1:Object.keys(n).forEach((function(t){r[t]!==n[t]&&(i=!1)})),i&&X.splice(t,1)},i=G-1;i>t;i--)r(i);G=X.length};for(q=0;q<=G-1;q++)V(q);return X}}},rt=function(){function t(t){void 0===t&&(t=10),this.linkedList=new a,this.maxStep=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},t.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},t.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},t.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toArray=function(){return this.linkedList.toArray().map((function(t){return t.value}))},t.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},t}(),it=M;e.default={getAdjMatrix:r,breadthFirstSearch:l,connectedComponent:d,getDegree:g,getInDegree:v,getOutDegree:y,detectCycle:M,detectDirectedCycle:it,detectAllCycles:w,detectAllDirectedCycle:x,detectAllUndirectedCycle:b,depthFirstSearch:m,dijkstra:k,findAllPath:P,findShortestPath:E,floydWarshall:j,labelPropagation:A,louvain:T,minimumSpanningTree:R,pageRank:F,getNeighbors:u,Stack:rt,GADDI:nt}},3:function(t,e,n){"use strict";n.r(e),n.d(e,"contains",(function(){return i})),n.d(e,"includes",(function(){return i})),n.d(e,"difference",(function(){return a})),n.d(e,"find",(function(){return x})),n.d(e,"findIndex",(function(){return w})),n.d(e,"firstValue",(function(){return M})),n.d(e,"flatten",(function(){return S})),n.d(e,"flattenDeep",(function(){return O})),n.d(e,"getRange",(function(){return E})),n.d(e,"pull",(function(){return I})),n.d(e,"pullAt",(function(){return N})),n.d(e,"reduce",(function(){return B})),n.d(e,"remove",(function(){return _})),n.d(e,"sortBy",(function(){return D})),n.d(e,"union",(function(){return F})),n.d(e,"uniq",(function(){return R})),n.d(e,"valuesOfKey",(function(){return X})),n.d(e,"head",(function(){return Y})),n.d(e,"last",(function(){return z})),n.d(e,"startsWith",(function(){return W})),n.d(e,"endsWith",(function(){return q})),n.d(e,"filter",(function(){return o})),n.d(e,"every",(function(){return G})),n.d(e,"some",(function(){return V})),n.d(e,"group",(function(){return Q})),n.d(e,"groupBy",(function(){return U})),n.d(e,"groupToMap",(function(){return Z})),n.d(e,"getWrapBehavior",(function(){return K})),n.d(e,"wrapBehavior",(function(){return $})),n.d(e,"number2color",(function(){return tt})),n.d(e,"parseRadius",(function(){return et})),n.d(e,"clamp",(function(){return nt})),n.d(e,"fixedBase",(function(){return rt})),n.d(e,"isDecimal",(function(){return ot})),n.d(e,"isEven",(function(){return at})),n.d(e,"isInteger",(function(){return st})),n.d(e,"isNegative",(function(){return ut})),n.d(e,"isNumberEqual",(function(){return ct})),n.d(e,"isOdd",(function(){return ht})),n.d(e,"isPositive",(function(){return lt})),n.d(e,"max",(function(){return k})),n.d(e,"maxBy",(function(){return ft})),n.d(e,"min",(function(){return C})),n.d(e,"minBy",(function(){return dt})),n.d(e,"mod",(function(){return pt})),n.d(e,"toDegree",(function(){return vt})),n.d(e,"toInteger",(function(){return yt})),n.d(e,"toRadian",(function(){return bt})),n.d(e,"forIn",(function(){return xt})),n.d(e,"has",(function(){return wt})),n.d(e,"hasKey",(function(){return Mt})),n.d(e,"hasValue",(function(){return Ot})),n.d(e,"keys",(function(){return g})),n.d(e,"isMatch",(function(){return v})),n.d(e,"values",(function(){return St})),n.d(e,"lowerCase",(function(){return Ct})),n.d(e,"lowerFirst",(function(){return Et})),n.d(e,"substitute",(function(){return Pt})),n.d(e,"upperCase",(function(){return jt})),n.d(e,"upperFirst",(function(){return At})),n.d(e,"getType",(function(){return Tt})),n.d(e,"isArguments",(function(){return Nt})),n.d(e,"isArray",(function(){return l})),n.d(e,"isArrayLike",(function(){return r})),n.d(e,"isBoolean",(function(){return Bt})),n.d(e,"isDate",(function(){return _t})),n.d(e,"isError",(function(){return Lt})),n.d(e,"isFunction",(function(){return c})),n.d(e,"isFinite",(function(){return Dt})),n.d(e,"isNil",(function(){return h})),n.d(e,"isNull",(function(){return Rt})),n.d(e,"isNumber",(function(){return it})),n.d(e,"isObject",(function(){return d})),n.d(e,"isObjectLike",(function(){return m})),n.d(e,"isPlainObject",(function(){return b})),n.d(e,"isPrototype",(function(){return Xt})),n.d(e,"isRegExp",(function(){return Yt})),n.d(e,"isString",(function(){return L})),n.d(e,"isType",(function(){return u})),n.d(e,"isUndefined",(function(){return zt})),n.d(e,"isElement",(function(){return Wt})),n.d(e,"requestAnimationFrame",(function(){return qt})),n.d(e,"clearAnimationFrame",(function(){return Gt})),n.d(e,"augment",(function(){return Ut})),n.d(e,"clone",(function(){return Qt})),n.d(e,"debounce",(function(){return Kt})),n.d(e,"memoize",(function(){return $t})),n.d(e,"deepMix",(function(){return te})),n.d(e,"each",(function(){return p})),n.d(e,"extend",(function(){return ee})),n.d(e,"indexOf",(function(){return ne})),n.d(e,"isEmpty",(function(){return ie})),n.d(e,"isEqual",(function(){return oe})),n.d(e,"isEqualWith",(function(){return ae})),n.d(e,"map",(function(){return se})),n.d(e,"mapValues",(function(){return ce})),n.d(e,"mix",(function(){return Ht})),n.d(e,"assign",(function(){return Ht})),n.d(e,"get",(function(){return he})),n.d(e,"set",(function(){return le})),n.d(e,"pick",(function(){return de})),n.d(e,"omit",(function(){return pe})),n.d(e,"throttle",(function(){return ge})),n.d(e,"toArray",(function(){return ve})),n.d(e,"toString",(function(){return kt})),n.d(e,"uniqueId",(function(){return me})),n.d(e,"noop",(function(){return be})),n.d(e,"identity",(function(){return xe})),n.d(e,"size",(function(){return we})),n.d(e,"Cache",(function(){return Me}));var r=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},i=function(t,e){return!!r(t)&&t.indexOf(e)>-1},o=function(t,e){if(!r(t))return t;for(var n=[],i=0;i<t.length;i++){var o=t[i];e(o,i)&&n.push(o)}return n},a=function(t,e){return void 0===e&&(e=[]),o(t,(function(t){return!i(e,t)}))},s={}.toString,u=function(t,e){return s.call(t)==="[object "+e+"]"},c=function(t){return u(t,"Function")},h=function(t){return null==t},l=function(t){return Array.isArray?Array.isArray(t):u(t,"Array")};function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var d=function(t){var e=f(t);return null!==t&&"object"===e||"function"===e};var p=function(t,e){if(t)if(l(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(d(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break},g=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return p(t,(function(n,r){c(t)&&"prototype"===r||e.push(r)})),e};var v=function(t,e){var n=g(e),r=n.length;if(h(t))return!r;for(var i=0;i<r;i+=1){var o=n[i];if(e[o]!==t[o]||!(o in t))return!1}return!0};function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var m=function(t){return"object"===y(t)&&null!==t},b=function(t){if(!m(t)||!u(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var x=function(t,e){if(!l(t))return null;var n;if(c(e)&&(n=e),b(e)&&(n=function(t){return v(t,e)}),n)for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r];return null};var w=function(t,e,n){void 0===n&&(n=0);for(var r=n;r<t.length;r++)if(e(t[r],r))return r;return-1},M=function(t,e){for(var n=null,r=0;r<t.length;r++){var i=t[r][e];if(!h(i)){n=l(i)?i[0]:i;break}}return n},S=function(t){if(!l(t))return[];for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e},O=function t(e,n){if(void 0===n&&(n=[]),l(e))for(var r=0;r<e.length;r+=1)t(e[r],n);else n.push(e);return n},k=function(t){if(l(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},C=function(t){if(l(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},E=function(t){var e=t.filter((function(t){return!isNaN(t)}));if(!e.length)return{min:0,max:0};if(l(t[0])){for(var n=[],r=0;r<t.length;r++)n=n.concat(t[r]);e=n}var i=k(e);return{min:C(e),max:i}},P=Array.prototype,j=P.splice,A=P.indexOf,I=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)for(var i=e[r],o=-1;(o=A.call(t,i))>-1;)j.call(t,o,1);return t},T=Array.prototype.splice,N=function(t,e){if(!r(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var o=void 0,a=e[n];n!==i&&a===o||(o=a,T.call(t,a,1))}return t},B=function(t,e,n){if(!l(t)&&!b(t))return t;var r=n;return p(t,(function(t,n){r=e(r,t,n)})),r},_=function(t,e){var n=[];if(!r(t))return n;for(var i=-1,o=[],a=t.length;++i<a;){var s=t[i];e(s,i,t)&&(n.push(s),o.push(i))}return N(t,o),n},L=function(t){return u(t,"String")};var D=function(t,e){var n;if(c(e))n=function(t,n){return e(t)-e(n)};else{var r=[];L(e)?r.push(e):l(e)&&(r=e),n=function(t,e){for(var n=0;n<r.length;n+=1){var i=r[n];if(t[i]>e[i])return 1;if(t[i]<e[i])return-1}return 0}}return t.sort(n),t};function R(t,e){void 0===e&&(e=new Map);var n=[];if(Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var o=t[r];e.has(o)||(n.push(o),e.set(o,!0))}return n}var F=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return R([].concat.apply([],t))},X=function(t,e){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i][e];if(!h(o)){l(o)||(o=[o]);for(var a=0;a<o.length;a++){var s=o[a];r[s]||(n.push(s),r[s]=!0)}}}return n};function Y(t){if(r(t))return t[0]}function z(t){if(r(t)){return t[t.length-1]}}var W=function(t,e){return!(!l(t)&&!L(t))&&t[0]===e};var q=function(t,e){return!(!l(t)&&!L(t))&&t[t.length-1]===e},G=function(t,e){for(var n=0;n<t.length;n++)if(!e(t[n],n))return!1;return!0},V=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n],n))return!0;return!1},H=Object.prototype.hasOwnProperty;var U=function(t,e){if(!e||!l(t))return{};for(var n,r={},i=c(e)?e:function(t){return t[e]},o=0;o<t.length;o++){var a=t[o];n=i(a),H.call(r,n)?r[n].push(a):r[n]=[a]}return r};function Z(t,e){if(!e)return{0:t};if(!c(e)){var n=l(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,i=n.length;r<i;r++)e+=t[n[r]]&&t[n[r]].toString();return e}}return U(t,e)}var Q=function(t,e){if(!e)return[t];var n=Z(t,e),r=[];for(var i in n)r.push(n[i]);return r};var K=function(t,e){return t["_wrap_"+e]};var $=function(t,e){if(t["_wrap_"+e])return t["_wrap_"+e];var n=function(n){t[e](n)};return t["_wrap_"+e]=n,n},J={};var tt=function(t){var e=J[t];if(!e){for(var n=t.toString(16),r=n.length;r<6;r++)n="0"+n;e="#"+n,J[t]=e}return e};var et=function(t){var e=0,n=0,r=0,i=0;return l(t)?1===t.length?e=n=r=i=t[0]:2===t.length?(e=r=t[0],n=i=t[1]):3===t.length?(e=t[0],n=i=t[1],r=t[2]):(e=t[0],n=t[1],r=t[2],i=t[3]):e=n=r=i=t,{r1:e,r2:n,r3:r,r4:i}},nt=function(t,e,n){return t<e?e:t>n?n:t},rt=function(t,e){var n=e.toString(),r=n.indexOf(".");if(-1===r)return Math.round(t);var i=n.substr(r+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},it=function(t){return u(t,"Number")},ot=function(t){return it(t)&&t%1!=0},at=function(t){return it(t)&&t%2==0},st=Number.isInteger?Number.isInteger:function(t){return it(t)&&t%1==0},ut=function(t){return it(t)&&t<0};function ct(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}var ht=function(t){return it(t)&&t%2!=0},lt=function(t){return it(t)&&t>0},ft=function(t,e){if(l(t)){var n,r,i=t[0];return n=c(e)?e(t[0]):t[0][e],p(t,(function(t){(r=c(e)?e(t):t[e])>n&&(i=t,n=r)})),i}},dt=function(t,e){if(l(t)){var n,r,i=t[0];return n=c(e)?e(t[0]):t[0][e],p(t,(function(t){(r=c(e)?e(t):t[e])<n&&(i=t,n=r)})),i}},pt=function(t,e){return(t%e+e)%e},gt=180/Math.PI,vt=function(t){return gt*t},yt=parseInt,mt=Math.PI/180,bt=function(t){return mt*t},xt=p,wt=function(t,e){return t.hasOwnProperty(e)},Mt=wt,St=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return p(t,(function(n,r){c(t)&&"prototype"===r||e.push(n)})),e},Ot=function(t,e){return i(St(t),e)},kt=function(t){return h(t)?"":t.toString()},Ct=function(t){return kt(t).toLowerCase()},Et=function(t){var e=kt(t);return e.charAt(0).toLowerCase()+e.substring(1)};var Pt=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t},jt=function(t){return kt(t).toUpperCase()},At=function(t){var e=kt(t);return e.charAt(0).toUpperCase()+e.substring(1)},It={}.toString,Tt=function(t){return It.call(t).replace(/^\[object /,"").replace(/]$/,"")},Nt=function(t){return u(t,"Arguments")},Bt=function(t){return u(t,"Boolean")},_t=function(t){return u(t,"Date")},Lt=function(t){return u(t,"Error")},Dt=function(t){return it(t)&&isFinite(t)},Rt=function(t){return null===t},Ft=Object.prototype,Xt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Ft)},Yt=function(t){return u(t,"RegExp")},zt=function(t){return void 0===t},Wt=function(t){return t instanceof Element||t instanceof HTMLDocument};function qt(t){return(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)})(t)}function Gt(t){(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout)(t)}function Vt(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function Ht(t,e,n,r){return e&&Vt(t,e),n&&Vt(t,n),r&&Vt(t,r),t}var Ut=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=t[0],r=1;r<t.length;r++){var i=t[r];c(i)&&(i=i.prototype),Ht(n.prototype,i)}};function Zt(t){return(Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Qt=function t(e){if("object"!==Zt(e)||null===e)return e;var n;if(l(e)){n=[];for(var r=0,i=e.length;r<i;r++)"object"===Zt(e[r])&&null!=e[r]?n[r]=t(e[r]):n[r]=e[r]}else for(var o in n={},e)"object"===Zt(e[o])&&null!=e[o]?n[o]=t(e[o]):n[o]=e[o];return n};var Kt=function(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}},$t=function(t,e){if(!c(t))throw new TypeError("Expected a function");var n=function n(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n};function Jt(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&b(o)?(b(t[i])||(t[i]={}),n<r?Jt(t[i],o,n+1,r):t[i]=e[i]):l(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var te=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)Jt(t,e[r]);return t},ee=function(t,e,n,r){c(e)||(n=e,e=t,t=function(){});var i=Object.create?function(t,e){return Object.create(t,{constructor:{value:e}})}:function(t,e){function n(){}n.prototype=t;var r=new n;return r.constructor=e,r},o=i(e.prototype,t);return t.prototype=Ht(o,t.prototype),t.superclass=i(e.prototype,e),Ht(o,n),Ht(t,r),t},ne=function(t,e){if(!r(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var i=-1,o=0;o<t.length;o++)if(t[o]===e){i=o;break}return i},re=Object.prototype.hasOwnProperty;var ie=function(t){if(h(t))return!0;if(r(t))return!t.length;var e=Tt(t);if("Map"===e||"Set"===e)return!t.size;if(Xt(t))return!Object.keys(t).length;for(var n in t)if(re.call(t,n))return!1;return!0},oe=function t(e,n){if(e===n)return!0;if(!e||!n)return!1;if(L(e)||L(n))return!1;if(r(e)||r(n)){if(e.length!==n.length)return!1;for(var i=!0,o=0;o<e.length&&(i=t(e[o],n[o]));o++);return i}if(m(e)||m(n)){var a=Object.keys(e),s=Object.keys(n);if(a.length!==s.length)return!1;for(i=!0,o=0;o<a.length&&(i=t(e[a[o]],n[a[o]]));o++);return i}return!1},ae=function(t,e,n){return c(n)?!!n(t,e):oe(t,e)},se=function(t,e){if(!r(t))return t;for(var n=[],i=0;i<t.length;i++){var o=t[i];n.push(e(o,i))}return n},ue=function(t){return t},ce=function(t,e){void 0===e&&(e=ue);var n={};return d(t)&&!h(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n},he=function(t,e,n){for(var r=0,i=L(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},le=function(t,e,n){var r=t,i=L(e)?e.split("."):e;return i.forEach((function(t,e){e<i.length-1?(d(r[t])||(r[t]=it(i[e+1])?[]:{}),r=r[t]):r[t]=n})),t},fe=Object.prototype.hasOwnProperty,de=function(t,e){if(null===t||!b(t))return{};var n={};return p(e,(function(e){fe.call(t,e)&&(n[e]=t[e])})),n},pe=function(t,e){return B(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},ge=function(t,e,n){var r,i,o,a,s=0;n||(n={});var u=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},c=function(){var c=Date.now();s||!1!==n.leading||(s=c);var h=e-(c-s);return i=this,o=arguments,h<=0||h>e?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,h)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c},ve=function(t){return r(t)?Array.prototype.slice.call(t):[]},ye={},me=function(t){return ye[t=t||"g"]?ye[t]+=1:ye[t]=1,t+ye[t]},be=function(){},xe=function(t){return t};function we(t){return h(t)?0:r(t)?t.length:Object.keys(t).length}var Me=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},32:function(t,e,n){self,t.exports=function(){"use strict";var t={d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t,e){return void 0===t?e:t}t.r(e),t.d(e,{default:function(){return ue}});var r,i=Math.round,o=Math.abs,a=Date.now,s="compute",u="auto",c="manipulation",h="none",l="pan-x",f="pan-y",d=(r={},["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(t){return r[t]=!0})),r),p="touch",g=["x","y"],v=["clientX","clientY"],y=32,m="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}:Object.assign,b=1;function x(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(void 0!==t.length)for(r=0;r<t.length;)e.call(n,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t)}function w(t,e,n){return!!Array.isArray(t)&&(x(t,n[e],n),!0)}function M(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;r<t.length;){if(n&&t[r][n]==e||!n&&t[r]===e)return r;r++}return-1}function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function O(t,e){return"function"===S(t)?t.apply(e&&e[0]||void 0,e):t}function k(t,e){var n=e.manager;return n?n.get(t):t}function C(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}var E=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=m({},this.defaults,e||{}),this.id=b++,this.manager=null,this.options.enable=n(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}var e;return(e=[{key:"set",value:function(t){return m(this.options,t),this.manager&&this.manager.touchAction.update(),this}},{key:"recognizeWith",value:function(t){if(w(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=k(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this}},{key:"dropRecognizeWith",value:function(t){return w(t,"dropRecognizeWith",this)||(t=k(t,this),delete this.simultaneous[t.id]),this}},{key:"requireFailure",value:function(t){if(w(t,"requireFailure",this))return this;var e=this.requireFail;return-1===M(e,t=k(t,this))&&(e.push(t),t.requireFailure(this)),this}},{key:"dropRequireFailure",value:function(t){if(w(t,"dropRequireFailure",this))return this;t=k(t,this);var e=M(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this}},{key:"hasRequireFailures",value:function(){return this.requireFail.length>0}},{key:"canRecognizeWith",value:function(t){return!!this.simultaneous[t.id]}},{key:"emit",value:function(t){var e=this,n=this.state;function r(n){e.manager.emit(n,t)}n<8&&r(e.options.event+C(n)),r(e.options.event),t.additionalEvent&&r(t.additionalEvent),n>=8&&r(e.options.event+C(n))}},{key:"tryEmit",value:function(t){if(this.canEmit())return this.emit(t);this.state=y}},{key:"canEmit",value:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0}},{key:"recognize",value:function(t){var e=m({},t);if(!O(this.options.enable,[this,e]))return this.reset(),void(this.state=y);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)}},{key:"process",value:function(t){}},{key:"getTouchAction",value:function(){}},{key:"reset",value:function(){}}])&&function(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)}}(t.prototype,e),t}();function P(t){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){return(A=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function I(t,e){return!e||"object"!==P(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function T(t){return(T=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}E.prototype.defaults={};var N=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&A(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=T(n);if(r){var i=T(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return I(this,t)});function o(){return j(this,o),i.apply(this,arguments)}return(e=[{key:"attrTest",value:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e}},{key:"process",value:function(t){var e=this.state,n=t.eventType,r=6&e,i=this.attrTest(t);return r&&(8&n||!i)?16|e:r||i?4&n?8|e:2&e?4|e:2:y}}])&&function(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)}}(o.prototype,e),o}(E);function B(t){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L(t,e,n){return(L="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=F(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function D(t,e){return(D=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function R(t,e){return!e||"object"!==B(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function F(t){return(F=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}N.prototype.defaults={pointers:1};var X=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&D(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=F(n);if(r){var i=F(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return R(this,t)});function o(){return _(this,o),i.apply(this,arguments)}return(e=[{key:"getTouchAction",value:function(){return[h]}},{key:"attrTest",value:function(t){return L(F(o.prototype),"attrTest",this).call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}])&&function(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)}}(o.prototype,e),o}(N);function Y(t){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function z(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function W(t,e,n){return(W="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=V(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function q(t,e){return(q=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function G(t,e){return!e||"object"!==Y(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function V(t){return(V=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}X.prototype.defaults={event:"rotate",threshold:0,pointers:2};var H=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&q(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=V(n);if(r){var i=V(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return G(this,t)});function o(){return z(this,o),i.apply(this,arguments)}return(e=[{key:"getTouchAction",value:function(){return[h]}},{key:"attrTest",value:function(t){return W(V(o.prototype),"attrTest",this).call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)}},{key:"emit",value:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}W(V(o.prototype),"emit",this).call(this,t)}}])&&function(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)}}(o.prototype,e),o}(N);function U(t){return 16===t?"down":8===t?"up":2===t?"left":4===t?"right":""}function Z(t){return(Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Q(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function K(t,e,n){return(K="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=tt(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function $(t,e){return($=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function J(t,e){return!e||"object"!==Z(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function tt(t){return(tt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}H.prototype.defaults={event:"pinch",threshold:0,pointers:2};var et=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&$(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=tt(n);if(r){var i=tt(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return J(this,t)});function o(){var t;return Q(this,o),(t=i.apply(this,arguments)).pX=null,t.pY=null,t}return(e=[{key:"getTouchAction",value:function(){var t=this.options.direction,e=[];return 6&t&&e.push(f),24&t&&e.push(l),e}},{key:"directionTest",value:function(t){var e=this.options,n=!0,r=t.distance,i=t.direction,o=t.deltaX,a=t.deltaY;return i&e.direction||(6&e.direction?(i=0===o?1:o<0?2:4,n=o!==this.pX,r=Math.abs(t.deltaX)):(i=0===a?1:a<0?8:16,n=a!==this.pY,r=Math.abs(t.deltaY))),t.direction=i,n&&r>e.threshold&&i&e.direction}},{key:"attrTest",value:function(t){return N.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))}},{key:"emit",value:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=U(t.direction);e&&(t.additionalEvent=this.options.event+e),K(tt(o.prototype),"emit",this).call(this,t)}}])&&function(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)}}(o.prototype,e),o}(N);function nt(t){return(nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function it(t,e,n){return(it="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=st(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function ot(t,e){return(ot=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function at(t,e){return!e||"object"!==nt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function st(t){return(st=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}et.prototype.defaults={event:"pan",threshold:10,pointers:1,direction:30};var ut=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&ot(t,e)}(a,t);var e,n,r,i=(n=a,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=st(n);if(r){var i=st(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return at(this,t)});function a(){return rt(this,a),i.apply(this,arguments)}return(e=[{key:"getTouchAction",value:function(){return et.prototype.getTouchAction.call(this)}},{key:"attrTest",value:function(t){var e,n=this.options.direction;return 30&n?e=t.overallVelocity:6&n?e=t.overallVelocityX:24&n&&(e=t.overallVelocityY),it(st(a.prototype),"attrTest",this).call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers===this.options.pointers&&o(e)>this.options.velocity&&4&t.eventType}},{key:"emit",value:function(t){var e=U(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}])&&function(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)}}(a.prototype,e),a}(N);function ct(t,e){return function(){return t.apply(e,arguments)}}function ht(t,e,n){return setTimeout(ct(t,n),e)}function lt(t,e,n){n||(n=g);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function ft(t){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pt(t,e){return(pt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function gt(t,e){return!e||"object"!==ft(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function vt(t){return(vt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}ut.prototype.defaults={event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1};var yt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&pt(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=vt(n);if(r){var i=vt(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return gt(this,t)});function o(){var t;return dt(this,o),(t=i.apply(this,arguments)).pTime=!1,t.pCenter=!1,t._timer=null,t._input=null,t.count=0,t}return(e=[{key:"getTouchAction",value:function(){return[c]}},{key:"process",value:function(t){var e=this,n=this.options,r=t.pointers.length===n.pointers,i=t.distance<n.threshold,o=t.deltaTime<n.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(i&&o&&r){if(4!==t.eventType)return this.failTimeout();var a=!this.pTime||t.timeStamp-this.pTime<n.interval,s=!this.pCenter||lt(this.pCenter,t.center)<n.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,s&&a?this.count+=1:this.count=1,this._input=t,0==this.count%n.taps)return this.hasRequireFailures()?(this._timer=ht((function(){e.state=8,e.tryEmit()}),n.interval,this),2):8}return y}},{key:"failTimeout",value:function(){var t=this;return this._timer=ht((function(){t.state=y}),this.options.interval,this),y}},{key:"reset",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"emit",value:function(){8===this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}])&&function(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)}}(o.prototype,e),o}(E);function mt(t){return(mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xt(t,e){return(xt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function wt(t,e){return!e||"object"!==mt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Mt(t){return(Mt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}yt.prototype.defaults={event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10};var St=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&xt(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Mt(n);if(r){var i=Mt(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return wt(this,t)});function o(){var t;return bt(this,o),(t=i.apply(this,arguments))._timer=null,t._input=null,t}return(e=[{key:"getTouchAction",value:function(){return[u]}},{key:"process",value:function(t){var e=this,n=this.options,r=t.pointers.length===n.pointers,i=t.distance<n.threshold,o=t.deltaTime>n.time;if(this._input=t,!i||!r||12&t.eventType&&!o)this.reset();else if(1&t.eventType)this.reset(),this._timer=ht((function(){e.state=8,e.tryEmit()}),n.time,this);else if(4&t.eventType)return 8;return y}},{key:"reset",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"emit",value:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit("".concat(this.options.event,"up"),t):(this._input.timeStamp=a(),this.manager.emit(this.options.event,this._input)))}}])&&function(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)}}(o.prototype,e),o}(E);function Ot(t,e){return t.indexOf(e)>-1}St.prototype.defaults={event:"press",pointers:1,time:251,threshold:9};var kt=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.manager=e,this.set(n)}var e;return(e=[{key:"set",value:function(t){t===s&&(t=this.compute()),this.actions=t.toLowerCase().trim()}},{key:"update",value:function(){this.set(this.manager.options.touchAction)}},{key:"compute",value:function(){var t=[];return x(this.manager.recognizers,(function(e){O(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(Ot(t,h))return h;var e=Ot(t,l),n=Ot(t,f);return e&&n?h:e||n?e?l:f:Ot(t,c)?c:u}(t.join(" "))}},{key:"preventDefaults",value:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var r=this.actions,i=Ot(r,h)&&!d.none,o=Ot(r,f)&&!d["pan-y"],a=Ot(r,l)&&!d["pan-x"];if(i){var s=1===t.pointers.length,u=t.distance<2,c=t.deltaTime<250;if(s&&u&&c)return}if(!a||!o)return i||o&&6&n||a&&24&n?this.preventSrc(e):void 0}}},{key:"preventSrc",value:function(t){this.manager.session.prevented=!0,t.preventDefault()}}])&&function(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)}}(t.prototype,e),t}();function Ct(t){var e=t.length;if(1===e)return{x:i(t[0].clientX),y:i(t[0].clientY)};for(var n=0,r=0,o=0;o<e;)n+=t[o].clientX,r+=t[o].clientY,o++;return{x:i(n/e),y:i(r/e)}}function Et(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:i(t.pointers[n].clientX),clientY:i(t.pointers[n].clientY)},n++;return{timeStamp:a(),pointers:e,center:Ct(e),deltaX:t.deltaX,deltaY:t.deltaY}}function Pt(t,e,n){n||(n=g);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}function jt(t,e){return t===e?1:o(t)>=o(e)?t<0?2:4:e<0?8:16}function At(t,e,n){return{x:e/t||0,y:n/t||0}}function It(t,e,n){var r=n.pointers.length,i=n.changedPointers.length,s=1&e&&r-i==0,u=12&e&&r-i==0;n.isFirst=!!s,n.isFinal=!!u,s&&(t.session={}),n.eventType=e,function(t,e){var n=t.session,r=e.pointers,i=r.length;n.firstInput||(n.firstInput=Et(e)),i>1&&!n.firstMultiple?n.firstMultiple=Et(e):1===i&&(n.firstMultiple=!1);var s=n.firstInput,u=n.firstMultiple,c=u?u.center:s.center,h=e.center=Ct(r);e.timeStamp=a(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Pt(c,h),e.distance=lt(c,h),function(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}(n,e),e.offsetDirection=jt(e.deltaX,e.deltaY);var l,f,d=At(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=o(d.x)>o(d.y)?d.x:d.y,e.scale=u?(l=u.pointers,lt((f=r)[0],f[1],v)/lt(l[0],l[1],v)):1,e.rotation=u?function(t,e){return Pt(e[1],e[0],v)+Pt(t[1],t[0],v)}(u.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,function(t,e){var n,r,i,a,s=t.lastInterval||e,u=e.timeStamp-s.timeStamp;if(8!==e.eventType&&(u>25||void 0===s.velocity)){var c=e.deltaX-s.deltaX,h=e.deltaY-s.deltaY,l=At(u,c,h);r=l.x,i=l.y,n=o(l.x)>o(l.y)?l.x:l.y,a=jt(c,h),t.lastInterval=e}else n=s.velocity,r=s.velocityX,i=s.velocityY,a=s.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=a}(n,e)}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function Tt(t){return t.trim().split(/\s+/g)}function Nt(t,e,n){x(Tt(e),(function(e){t.addEventListener(e,n,!1)}))}var Bt=function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=this;this.manager=e,this.callback=n,this.eventHandler=function(t){O(e.options.enable,[e])&&r.handler(t)},this.init()}var e;return(e=[{key:"handler",value:function(){}},{key:"init",value:function(){var t,e,n;t=this.manager,e=this.events||"",n=this.eventHandler,x(Tt(e),(function(e){t.on("origin_input:".concat(e),n)}))}},{key:"destroy",value:function(){removeManagerListeners(this.manager,this.events||"",this.eventHandler)}}])&&function(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)}}(t.prototype,e),t}();function _t(t){return Array.prototype.slice.call(t,0)}function Lt(t,e,n){for(var r=[],i=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];M(i,a)<0&&r.push(t[o]),i[o]=a,o++}return n&&(r=e?r.sort((function(t,n){return t[e]>n[e]})):r.sort()),r}function Dt(t){return(Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ft(t,e){return(Ft=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Xt(t,e){return!e||"object"!==Dt(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Yt(t){return(Yt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var zt={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Wt="touchstart touchmove touchend touchcancel",qt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ft(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Yt(n);if(r){var i=Yt(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return Xt(this,t)});function o(){var t;return Rt(this,o),o.prototype.evTarget=Wt,o.prototype.targetIds={},o.prototype.events=Wt,(t=i.apply(this,arguments)).evTarget=Wt,t.targetIds={},t}return(e=[{key:"handler",value:function(t){var e=zt[t.type],n=Gt.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:p,srcEvent:t})}}])&&function(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)}}(o.prototype,e),o}(Bt);function Gt(t,e){var n,r,i=_t(t.touches),o=this.targetIds;if(3&e&&1===i.length)return o[i[0].identifier]=!0,[i,i];var a=_t(t.changedTouches),s=[];if(this.target,r=i,1===e)for(n=0;n<r.length;)o[r[n].identifier]=!0,n++;for(n=0;n<a.length;)o[a[n].identifier]&&s.push(a[n]),12&e&&delete o[a[n].identifier],n++;return s.length?[Lt(r.concat(s),"identifier",!0),s]:void 0}var Vt=function(){function t(e){var n,r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=m({},Ht.defaults,e||{}),this.handlers={},this.filters=[],this.session={},this.recognizers=[],this.input=(n=qt,this.options.inputClass&&(n=inputClass),new n(this,It)),this.touchAction=new kt(this,this.options.touchAction),x(this.options.recognizers,(function(t){var e=r.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}var e;return(e=[{key:"set",value:function(t){return m(this.options,t),t.touchAction&&this.touchAction.update(),this}},{key:"stop",value:function(t){this.session.stopped=t?2:1}},{key:"addFilter",value:function(t){if("function"!=typeof t)throw new Error("filter must be a function");this.filters.push(t)}},{key:"recognize",value:function(t){var e=this.session;if(!e.stopped){var n;this.touchAction.preventDefaults(t);var r=this.recognizers,i=e.curRecognizer;(!i||i&&8&i.state)&&(i=e.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===e.stopped||i&&n!==i&&!n.canRecognizeWith(i)?n.reset():n.recognize(t),!i&&14&n.state&&(i=e.curRecognizer=n),o++}}},{key:"get",value:function(t){if(t instanceof E)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event===t)return e[n];return null}},{key:"add",value:function(t){if(w(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t}},{key:"remove",value:function(t){if(w(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=M(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this}},{key:"on",value:function(t,e){if(void 0!==t&&void 0!==e){var n=this.handlers;return x(Tt(t),(function(t){n[t]=n[t]||[],n[t].push(e)})),this}}},{key:"off",value:function(t,e){if(void 0!==t){var n=this.handlers;return x(Tt(t),(function(t){e?n[t]&&n[t].splice(M(n[t],e),1):delete n[t]})),this}}},{key:"emit",value:function(t,e){var n=this.handlers[t]&&this.handlers[t].slice();if(this.filters,n&&n.length){t.startsWith("origin_input")||(e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault&&e.srcEvent.preventDefault()});for(var r=0;r<n.length;)n[r](e),r++}}},{key:"destroy",value:function(){this.handlers={},this.filters=[],this.session={},this.input.destroy()}}])&&function(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)}}(t.prototype,e),t}(),Ht=function t(e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),(e=e||{}).recognizers=n(e.recognizers,t.defaults.preset),new Vt(e)};function Ut(t){return(Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qt(t,e){return(Qt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Kt(t,e){return!e||"object"!==Ut(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function $t(t){return($t=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}Ht.defaults={domEvents:!1,touchAction:s,enable:!0,inputClass:null,preset:[[X,{enable:!1}],[H,{enable:!1},["rotate"]],[ut,{direction:6}],[et,{direction:6},["swipe"]],[yt],[yt,{event:"doubletap",taps:2},["tap"]],[St]]};var Jt={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},te={2:p,3:"pen",4:"mouse",5:"kinect"},ee="pointerdown",ne="pointermove pointerup pointercancel",re=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Qt(t,e)}(o,t);var e,n,r,i=(n=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=$t(n);if(r){var i=$t(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return Kt(this,t)});function o(){var t;return Zt(this,o),o.prototype.events="".concat(ee," ").concat(ne),(t=i.apply(this,arguments)).evEl=ee,t.evWin=ne,t.store=t.manager.session.pointerEvents=[],t}return(e=[{key:"handler",value:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=Jt[r],o=te[t.pointerType]||t.pointerType,a=o===p,s=M(e,t.pointerId,"pointerId");1&i&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):12&i&&(n=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))}}])&&function(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)}}(o.prototype,e),o}(Bt);function ie(t,e,n){x(Tt(e),(function(e){t.removeEventListener(e,n,!1)}))}function oe(t,e,n){var r="DEPRECATED METHOD: ".concat(e,"\n").concat(n," AT \n");return function(){var e=new Error("get-stack-trace"),n=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",i=console.warn;return i&&i(r,n),t.apply(this,arguments)}}var ae=oe((function(t,e,n){for(var r=Object.keys(e),i=0;i<r.length;)(!n||n&&void 0===t[r[i]])&&(t[r[i]]=e[r[i]]),i++;return t}),"extend","Use `assign`."),se=oe((function(t,e){return ae(t,e,!0)}),"merge","Use `assign`."),ue=m(Ht,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:y,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Vt,Input:Bt,TouchAction:kt,TouchInput:qt,PointerEventInput:re,Recognizer:E,AttrRecognizer:N,Tap:yt,Pan:et,Swipe:ut,Pinch:H,Rotate:X,Press:St,on:Nt,off:ie,each:x,merge:se,extend:ae,assign:m,inherit:function(t,e,n){var r,i=e.prototype;(r=t.prototype=Object.create(i)).constructor=t,r._super=i,n&&m(r,n)},bindFn:ct,toArray:_t,inArray:M,uniqueArray:Lt,splitStr:Tt,boolOrFn:O,hasParent:function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1},addEventListeners:Nt,removeEventListeners:ie});return e}()},34:function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"proccessToFunc",(function(){return c})),n.d(r,"buildTextureData",(function(){return h})),n.d(r,"buildTextureDataWithOneEdgeAttr",(function(){return l})),n.d(r,"buildTextureDataWithTwoEdgeAttr",(function(){return f})),n.d(r,"attributesToTextureData",(function(){return d})),n.d(r,"arrayToTextureData",(function(){return p})),n.d(r,"radialLayout",(function(){return g}));var i=n(1),o=n(83),a=n(2),s=n(0),u=a.n.traverseTree,c=function(t,e){return t?Object(s.k)(t)?function(e){return t}:t:function(t){return e||1}},h=function(t,e){var n=[],r=[],i={},o=0;for(o=0;o<t.length;o++){var a=t[o];i[a.id]=o,n.push(a.x),n.push(a.y),n.push(0),n.push(0),r.push([])}for(o=0;o<e.length;o++){var s=e[o];r[i[s.source]].push(i[s.target]),r[i[s.target]].push(i[s.source])}var u=0;for(o=0;o<t.length;o++){var c=n.length,h=r[o],l=h.length;n[4*o+2]=c,n[4*o+3]=h.length,u=Math.max(u,h.length);for(var f=0;f<l;++f){var d=h[f];n.push(+d)}}for(;n.length%4!=0;)n.push(0);return{array:new Float32Array(n),maxEdgePerVetex:u}},l=function(t,e,n){var r=[],i=[],o={},a=0;for(a=0;a<t.length;a++){var s=t[a];o[s.id]=a,r.push(s.x),r.push(s.y),r.push(0),r.push(0),i.push([])}for(a=0;a<e.length;a++){var u=e[a];i[o[u.source]].push(o[u.target]),i[o[u.source]].push(n(u)),i[o[u.target]].push(o[u.source]),i[o[u.target]].push(n(u))}var c=0;for(a=0;a<t.length;a++){var h=r.length,l=i[a],f=l.length;r[4*a+2]=h,r[4*a+3]=f/2,c=Math.max(c,f/2);for(var d=0;d<f;++d){var p=l[d];r.push(+p)}}for(;r.length%4!=0;)r.push(0);return{array:new Float32Array(r),maxEdgePerVetex:c}},f=function(t,e,n,r){var i=[],o=[],a={},s=0;for(s=0;s<t.length;s++){var u=t[s];a[u.id]=s,i.push(u.x),i.push(u.y),i.push(0),i.push(0),o.push([])}for(s=0;s<e.length;s++){var c=e[s];o[a[c.source]].push(a[c.target]),o[a[c.source]].push(n(c)),o[a[c.source]].push(r(c)),o[a[c.source]].push(0),o[a[c.target]].push(a[c.source]),o[a[c.target]].push(n(c)),o[a[c.target]].push(r(c)),o[a[c.target]].push(0)}var h=0;for(s=0;s<t.length;s++){var l=i.length,f=o[s],d=f.length;i[4*s+2]=l+1048576*d/4,i[4*s+3]=0,h=Math.max(h,d/4);for(var p=0;p<d;++p){var g=f[p];i.push(+g)}}for(;i.length%4!=0;)i.push(0);return{array:new Float32Array(i),maxEdgePerVetex:h}},d=function(t,e){var n=[],r=t.length,i={};return e.forEach((function(e){t.forEach((function(t,o){if(void 0===i[e[t]]&&(i[e[t]]=Object.keys(i).length),n.push(i[e[t]]),o===r-1)for(;n.length%4!=0;)n.push(0)}))})),{array:new Float32Array(n),count:Object.keys(i).length}},p=function(t){for(var e=[],n=t.length,r=t[0].length,i=function(r){t.forEach((function(t,i){if(e.push(t[r]),i===n-1)for(;e.length%4!=0;)e.push(0)}))},o=0;o<r;o++)i(o);return new Float32Array(e)},g=function(t,e){var n={x:1/0,y:1/0},r={x:-1/0,y:-1/0},i="x",o="y";e&&["V","TB","BT"].indexOf(e)>=0&&(o="x",i="y");var a=0;u(t,(function(t){return a++,t.x>r.x&&(r.x=t.x),t.x<n.x&&(n.x=t.x),t.y>r.y&&(r.y=t.y),t.y<n.y&&(n.y=t.y),!0}));var s=2*Math.PI/a,c=r[o]-n[o];return 0===c||u(t,(function(e){var r=(e[o]-n[o])/c*(2*Math.PI-s)+s,a=Math.abs("x"===i?e.x-t.x:e.y-t.y);return e.x=a*Math.cos(r),e.y=a*Math.sin(r),!0})),t},v=Object(i.a)(Object(i.a)(Object(i.a)({},a.n),o),r);e.a=v},39:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return s}));var r=n(5),i=n(78);function o(t,e,n){var i=1;return Object(r.h)(t)&&(i=t.split("\n").length),i>1?e*i+function(t,e){return e?e-t:.14*t}(e,n)*(i-1):e}function a(t,e){var n=Object(i.a)(),o=0;if(Object(r.e)(t)||""===t)return o;if(n.save(),n.font=e,Object(r.h)(t)&&t.includes("\n")){var a=t.split("\n");Object(r.a)(a,(function(t){var e=n.measureText(t).width;o<e&&(o=e)}))}else o=n.measureText(t).width;return n.restore(),o}function s(t){var e=t.fontSize,n=t.fontFamily,r=t.fontWeight;return[t.fontStyle,t.fontVariant,r,e+"px",n].join(" ").trim()}},4:function(t,e,n){"use strict";n.d(e,"b",(function(){return i.a})),n.d(e,"c",(function(){return i.b})),n.d(e,"d",(function(){return i.c})),n.d(e,"a",(function(){return r}));var r={};n.r(r),n.d(r,"leftTranslate",(function(){return o})),n.d(r,"leftRotate",(function(){return a})),n.d(r,"leftScale",(function(){return s})),n.d(r,"transform",(function(){return u})),n.d(r,"direction",(function(){return c})),n.d(r,"angleTo",(function(){return h})),n.d(r,"vertical",(function(){return l}));var i=n(8);function o(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return i.a.fromTranslation(r,n),i.a.multiply(t,r,e)}function a(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return i.a.fromRotation(r,n),i.a.multiply(t,r,e)}function s(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return i.a.fromScaling(r,n),i.a.multiply(t,r,e)}function u(t,e){for(var n,r,u,c=t?[].concat(t):[1,0,0,0,1,0,0,0,1],h=0,l=e.length;h<l;h++){var f=e[h];switch(f[0]){case"t":o(c,c,[f[1],f[2]]);break;case"s":s(c,c,[f[1],f[2]]);break;case"r":a(c,c,f[1]);break;case"m":n=c,r=c,u=f[1],i.a.multiply(n,u,r)}}return c}function c(t,e){return t[0]*e[1]-e[0]*t[1]}function h(t,e,n){var r=i.b.angle(t,e),o=c(t,e)>=0;return n?o?2*Math.PI-r:r:o?r:2*Math.PI-r}function l(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}},40:function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return m}));var r=n(0),i=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,o=/[^\s\,]+/gi;var a=function(t){var e=t||[];return Object(r.f)(e)?e:Object(r.o)(e)?(e=e.match(i),Object(r.c)(e,(function(t,n){if((t=t.match(o))[0].length>1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}Object(r.c)(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0};function s(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?o[3]={x:+t[0],y:+t[1]}:i-2===r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n}var u="\t\n\v\f\r \u2028\u2029",c=new RegExp("([a-z])["+u+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+u+"]*,?["+u+"]*)+)","ig"),h=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+u+"]*,?["+u+"]*","ig");function l(t){if(!t)return null;if(Object(r.f)(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(c,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(h,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}function f(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function d(t,e){return f(t)*f(e)?(t[0]*e[0]+t[1]*e[1])/(f(t)*f(e)):1}function p(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(d(t,e))}function g(t,e){return t[0]===e[0]&&t[1]===e[1]}function v(t,e){var n=e[1],i=e[2],o=Object(r.s)(Object(r.u)(e[3]),2*Math.PI),a=e[4],s=e[5],u=t[0],c=t[1],h=e[6],l=e[7],f=Math.cos(o)*(u-h)/2+Math.sin(o)*(c-l)/2,v=-1*Math.sin(o)*(u-h)/2+Math.cos(o)*(c-l)/2,y=f*f/(n*n)+v*v/(i*i);y>1&&(n*=Math.sqrt(y),i*=Math.sqrt(y));var m=n*n*(v*v)+i*i*(f*f),b=m?Math.sqrt((n*n*(i*i)-m)/m):1;a===s&&(b*=-1),isNaN(b)&&(b=0);var x=i?b*n*v/i:0,w=n?b*-i*f/n:0,M=(u+h)/2+Math.cos(o)*x-Math.sin(o)*w,S=(c+l)/2+Math.sin(o)*x+Math.cos(o)*w,O=[(f-x)/n,(v-w)/i],k=[(-1*f-x)/n,(-1*v-w)/i],C=p([1,0],O),E=p(O,k);return d(O,k)<=-1&&(E=Math.PI),d(O,k)>=1&&(E=0),0===s&&E>0&&(E-=2*Math.PI),1===s&&E<0&&(E+=2*Math.PI),{cx:M,cy:S,rx:g(t,[h,l])?0:n,ry:g(t,[h,l])?0:i,startAngle:C,endAngle:C+E,xRotation:o,arcFlag:a,sweepFlag:s}}function y(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function m(t){for(var e=[],n=null,r=null,i=null,o=0,s=(t=a(t)).length,u=0;u<s;u++){var c=t[u];r=t[u+1];var h=c[0],l={command:h,prePoint:n,params:c,startTangent:null,endTangent:null};switch(h){case"M":i=[c[1],c[2]],o=u;break;case"A":var f=v(n,c);l.arcParams=f}if("Z"===h)n=i,r=t[o+1];else{var d=c.length;n=[c[d-2],c[d-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&g(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint);var p=r?[r[r.length-2],r[r.length-1]]:null;l.nextPoint=p;var m=l.prePoint;if(["L","H","V"].includes(h))l.startTangent=[m[0]-n[0],m[1]-n[1]],l.endTangent=[n[0]-m[0],n[1]-m[1]];else if("Q"===h){var b=[c[1],c[2]];l.startTangent=[m[0]-b[0],m[1]-b[1]],l.endTangent=[n[0]-b[0],n[1]-b[1]]}else if("T"===h){b=y((M=e[u-1]).currentPoint,m);"Q"===M.command?(l.command="Q",l.startTangent=[m[0]-b[0],m[1]-b[1]],l.endTangent=[n[0]-b[0],n[1]-b[1]]):(l.command="TL",l.startTangent=[m[0]-n[0],m[1]-n[1]],l.endTangent=[n[0]-m[0],n[1]-m[1]])}else if("C"===h){var x=[c[1],c[2]],w=[c[3],c[4]];l.startTangent=[m[0]-x[0],m[1]-x[1]],l.endTangent=[n[0]-w[0],n[1]-w[1]]}else if("S"===h){var M;x=y((M=e[u-1]).currentPoint,m),w=[c[1],c[2]];"C"===M.command?(l.command="C",l.startTangent=[m[0]-x[0],m[1]-x[1]],l.endTangent=[n[0]-w[0],n[1]-w[1]]):(l.command="SQ",l.startTangent=[m[0]-w[0],m[1]-w[1]],l.endTangent=[n[0]-w[0],n[1]-w[1]])}else if("A"===h){var S=.001,O=l.arcParams||{},k=O.cx,C=void 0===k?0:k,E=O.cy,P=void 0===E?0:E,j=O.rx,A=void 0===j?0:j,I=O.ry,T=void 0===I?0:I,N=O.sweepFlag,B=void 0===N?0:N,_=O.startAngle,L=void 0===_?0:_,D=O.endAngle,R=void 0===D?0:D;0===B&&(S*=-1);var F=A*Math.cos(L-S)+C,X=T*Math.sin(L-S)+P;l.startTangent=[F-i[0],X-i[1]];var Y=A*Math.cos(L+R+S)+C,z=T*Math.sin(L+R-S)+P;l.endTangent=[m[0]-Y,m[1]-z]}e.push(l)}return e}},414:function(t,e,n){"use strict";var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function i(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}var o=n(2),a=n(0);Object(o.r)("circle",{options:{size:o.e.defaultNode.size,style:{x:0,y:0,stroke:o.e.defaultNode.style.stroke,fill:o.e.defaultNode.style.fill,lineWidth:o.e.defaultNode.style.lineWidth},labelCfg:{style:{fill:o.e.nodeLabel.style.fill,fontSize:o.e.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:o.e.defaultNode.linkPoints.size,lineWidth:o.e.defaultNode.linkPoints.lineWidth,fill:o.e.defaultNode.linkPoints.fill,stroke:o.e.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:r({},o.e.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=this.getOptions(t).icon,i=void 0===n?{}:n,o=this.getShapeStyle(t),s=Object(a.b)({},i,t.icon),u=e.addShape("circle",{attrs:o,className:this.type+"-keyShape",draggable:!0}),c=s.width,h=s.height,l=s.show,f=s.text;return l&&(f?e.addShape("text",{attrs:r({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},s),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}):e.addShape("image",{attrs:r({x:-c/2,y:-h/2},s),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})),this.drawLinkPoints(t,e),u},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,o=void 0===n?{}:n,a=o.top,s=o.left,u=o.right,c=o.bottom,h=o.size,l=o.r,f=i(o,["top","left","right","bottom","size","r"]),d=this.getSize(t)[0]/2;s&&e.addShape("circle",{attrs:r(r({},f),{x:-d,y:0,r:h/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),u&&e.addShape("circle",{attrs:r(r({},f),{x:d,y:0,r:h/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:r(r({},f),{x:0,y:-d,r:h/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),c&&e.addShape("circle",{attrs:r(r({},f),{x:0,y:d,r:h/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},i=Object(a.b)({},e,n),o=this.getSize(t)[0]/2;return r({x:0,y:0,r:o},i)},update:function(t,e){var n=e.getContainer(),r=this.getSize(t),i={stroke:t.color,r:r[0]/2},o=e.get("keyShape"),s=Object(a.b)({},o.attr(),i,t.style);this.updateShape(t,e,s,!0),this.updateLinkPoints(t,n)}},"single-node"),Object(o.r)("rect",{options:{size:[100,30],style:{radius:0,stroke:o.e.defaultNode.style.stroke,fill:o.e.defaultNode.style.fill,lineWidth:o.e.defaultNode.style.lineWidth},labelCfg:{style:{fill:o.e.nodeLabel.style.fill,fontSize:o.e.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:o.e.defaultNode.linkPoints.size,lineWidth:o.e.defaultNode.linkPoints.lineWidth,fill:o.e.defaultNode.linkPoints.fill,stroke:o.e.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:r({},o.e.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t),r=e.addShape("rect",{attrs:n,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0});return this.drawLinkPoints(t,e),r},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,o=void 0===n?{}:n,a=o.top,s=o.left,u=o.right,c=o.bottom,h=o.size,l=o.r,f=i(o,["top","left","right","bottom","size","r"]),d=this.getSize(t),p=d[0],g=d[1];s&&e.addShape("circle",{attrs:r(r({},f),{x:-p/2,y:0,r:h/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),u&&e.addShape("circle",{attrs:r(r({},f),{x:p/2,y:0,r:h/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:r(r({},f),{x:0,y:-g/2,r:h/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),c&&e.addShape("circle",{attrs:r(r({},f),{x:0,y:g/2,r:h/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},i=Object(a.r)({},e,n),o=this.getSize(t),s=i.width||o[0],u=i.height||o[1];return r({x:-s/2,y:-u/2,width:s,height:u},i)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getSize(t),o=e.get("keyShape");t.size||(i[0]=o.attr("width")||r.width,i[1]=o.attr("height")||r.height);var s={stroke:t.color,x:-i[0]/2,y:-i[1]/2,width:i[0],height:i[1]},u=Object(a.r)({},r,o.attr(),s);u=Object(a.r)(u,t.style),this.updateShape(t,e,u,!1),this.updateLinkPoints(t,n)}},"single-node"),Object(o.r)("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:o.e.defaultNode.style.stroke,fill:o.e.defaultNode.style.fill,lineWidth:o.e.defaultNode.style.lineWidth},labelCfg:{style:{fill:o.e.nodeLabel.style.fill,fontSize:o.e.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:o.e.defaultNode.linkPoints.size,lineWidth:o.e.defaultNode.linkPoints.lineWidth,fill:o.e.defaultNode.linkPoints.fill,stroke:o.e.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:r({},o.e.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(t,e){var n=this.getOptions(t).icon,i=void 0===n?{}:n,o=this.getShapeStyle(t),a=e.addShape("ellipse",{attrs:o,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0}),s=i.width,u=i.height,c=i.show,h=i.text;return c&&(h?e.addShape("text",{attrs:r({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}):e.addShape("image",{attrs:r({x:-s/2,y:-u/2},i),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})),this.drawLinkPoints(t,e),a},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,o=void 0===n?{}:n,a=o.top,s=o.left,u=o.right,c=o.bottom,h=o.size,l=o.r,f=i(o,["top","left","right","bottom","size","r"]),d=this.getSize(t),p=d[0]/2,g=d[1]/2;s&&e.addShape("circle",{attrs:r(r({},f),{x:-p,y:0,r:h/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),u&&e.addShape("circle",{attrs:r(r({},f),{x:p,y:0,r:h/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:r(r({},f),{x:0,y:-g,r:h/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),c&&e.addShape("circle",{attrs:r(r({},f),{x:0,y:g,r:h/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},i=Object(a.r)({},e,n),o=this.getSize(t),s=o[0]/2,u=o[1]/2;return r({x:0,y:0,rx:s,ry:u},i)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getSize(t),o={stroke:t.color,rx:i[0]/2,ry:i[1]/2},s=e.get("keyShape"),u=Object(a.r)({},r,s.attr(),o);u=Object(a.r)(u,t.style),this.updateShape(t,e,u,!0),this.updateLinkPoints(t,n)}},"single-node"),Object(o.r)("diamond",{options:{size:[80,80],style:{stroke:o.e.defaultNode.style.stroke,fill:o.e.defaultNode.style.fill,lineWidth:o.e.defaultNode.style.lineWidth},labelCfg:{style:{fill:o.e.nodeLabel.style.fill,fontSize:o.e.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:o.e.defaultNode.linkPoints.size,lineWidth:o.e.defaultNode.linkPoints.lineWidth,fill:o.e.defaultNode.linkPoints.fill,stroke:o.e.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:r({},o.e.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(t,e){var n=this.getOptions(t).icon,i=void 0===n?{}:n,o=this.getShapeStyle(t),a=e.addShape("path",{attrs:o,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0}),s=i.width,u=i.height,c=i.show,h=i.text;return c&&(h?e.addShape("text",{attrs:r({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}):e.addShape("image",{attrs:r({x:-s/2,y:-u/2},i),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})),this.drawLinkPoints(t,e),a},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,o=void 0===n?{}:n,a=o.top,s=o.left,u=o.right,c=o.bottom,h=o.size,l=o.r,f=i(o,["top","left","right","bottom","size","r"]),d=this.getSize(t),p=d[0],g=d[1];s&&e.addShape("circle",{attrs:r(r({},f),{x:-p/2,y:0,r:h/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),u&&e.addShape("circle",{attrs:r(r({},f),{x:p/2,y:0,r:h/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:r(r({},f),{x:0,y:-g/2,r:h/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),c&&e.addShape("circle",{attrs:r(r({},f),{x:0,y:g/2,r:h/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},getPath:function(t){var e=this.getSize(t),n=e[0],r=e[1];return[["M",0,-r/2],["L",n/2,0],["L",0,r/2],["L",-n/2,0],["Z"]]},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},i=Object(a.r)({},e,n),o=this.getPath(t);return r({path:o},i)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},s=e.get("keyShape"),u=Object(a.r)({},r,s.attr(),o);u=Object(a.r)(u,t.style),this.updateShape(t,e,u,!0),this.updateLinkPoints(t,n)}},"single-node"),Object(o.r)("triangle",{options:{size:40,direction:"up",style:{stroke:o.e.defaultNode.style.stroke,fill:o.e.defaultNode.style.fill,lineWidth:o.e.defaultNode.style.lineWidth},labelCfg:{style:{fill:o.e.nodeLabel.style.fill,fontSize:o.e.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:o.e.defaultNode.linkPoints.size,lineWidth:o.e.defaultNode.linkPoints.lineWidth,fill:o.e.defaultNode.linkPoints.fill,stroke:o.e.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:r({},o.e.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(t,e){var n=this.getOptions(t),i=n.icon,o=void 0===i?{}:i,a=n.direction,s=this.getShapeStyle(t),u=t.direction||a,c=e.addShape("path",{attrs:s,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0}),h=o.width,l=o.height,f=o.show,d=o.offset,p=o.text;if(f)if(p)e.addShape("text",{attrs:r({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:this.type+"-icon",name:this.type+"-icon",draggable:!0});else{var g=-h/2,v=-l/2;"up"!==u&&"down"!==u||(v+=d),"left"!==u&&"right"!==u||(g+=d),e.addShape("image",{attrs:r({x:g,y:v},o),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})}return this.drawLinkPoints(t,e),c},drawLinkPoints:function(t,e){var n=this.getOptions(t),o=n.linkPoints,a=void 0===o?{}:o,s=n.direction,u=t.direction||s,c=a.top,h=a.left,l=a.right,f=a.bottom,d=a.size,p=a.r,g=i(a,["top","left","right","bottom","size","r"]),v=this.getSize(t)[0];if(h){var y=null,m=v*Math.sin(1/3*Math.PI),b=v*Math.sin(1/3*Math.PI);"up"===u?y=[-b,m]:"down"===u?y=[-b,-m]:"left"===u&&(y=[-b,b-m]),y&&e.addShape("circle",{attrs:r(r({},g),{x:y[0],y:y[1],r:d/2||p||5}),className:"link-point-left",name:"link-point-left"})}if(l){var x=null;m=v*Math.sin(1/3*Math.PI),b=v*Math.sin(1/3*Math.PI);"up"===u?x=[b,m]:"down"===u?x=[b,-m]:"right"===u&&(x=[b,b-m]),x&&e.addShape("circle",{attrs:r(r({},g),{x:x[0],y:x[1],r:d/2||p||5}),className:"link-point-right",name:"link-point-right"})}if(c){var w=null;m=v*Math.sin(1/3*Math.PI),b=v*Math.sin(1/3*Math.PI);"up"===u?w=[b-m,-m]:"left"===u?w=[b,-m]:"right"===u&&(w=[-b,-m]),w&&e.addShape("circle",{attrs:r(r({},g),{x:w[0],y:w[1],r:d/2||p||5}),className:"link-point-top",name:"link-point-top"})}if(f){var M=null;m=v*Math.sin(1/3*Math.PI),b=v*Math.sin(1/3*Math.PI);"down"===u?M=[-b+m,m]:"left"===u?M=[b,m]:"right"===u&&(M=[-b,m]),M&&e.addShape("circle",{attrs:r(r({},g),{x:M[0],y:M[1],r:d/2||p||5}),className:"link-point-bottom",name:"link-point-bottom"})}},getPath:function(t){var e=this.getOptions(t).direction,n=t.direction||e,r=this.getSize(t)[0],i=r*Math.sin(1/3*Math.PI),o=r*Math.sin(1/3*Math.PI),a=[["M",-o,i],["L",0,-i],["L",o,i],["Z"]];return"down"===n?a=[["M",-o,-i],["L",o,-i],["L",0,i],["Z"]]:"left"===n?a=[["M",-o,o-i],["L",o,-o],["L",o,o],["Z"]]:"right"===n&&(a=[["M",o,o-i],["L",-o,o],["L",-o,-o],["Z"]]),a},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},i=Object(a.r)({},e,n),o=this.getPath(t);return r({path:o},i)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},s=e.get("keyShape"),u=Object(a.r)({},r,s.attr(),o);u=Object(a.r)(u,t.style),this.updateShape(t,e,u,!0),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var n=this.getOptions({}),i=n.linkPoints,o=n.direction,s=t.direction||o,u=e.find((function(t){return"link-point-left"===t.get("className")})),c=e.find((function(t){return"link-point-right"===t.get("className")})),h=e.find((function(t){return"link-point-top"===t.get("className")})),l=e.find((function(t){return"link-point-bottom"===t.get("className")})),f=i,d=u||c||h||l;d&&(f=d.attr());var p=Object(a.r)({},f,t.linkPoints),g=p.fill,v=p.stroke,y=p.lineWidth,m=p.size/2;m||(m=p.r);var b=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},x=b.left,w=b.right,M=b.top,S=b.bottom,O=this.getSize(t)[0],k={r:m,fill:g,stroke:v,lineWidth:y},C=null,E=O*Math.sin(1/3*Math.PI),P=O*Math.sin(1/3*Math.PI);"up"===s?C=[-P,E]:"down"===s?C=[-P,-E]:"left"===s&&(C=[-P,P-E]),C&&(u?x||void 0===x?u.attr(r(r({},k),{x:C[0],y:C[1]})):u.remove():x&&e.addShape("circle",{attrs:r(r({},k),{x:C[0],y:C[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}));var j=null;"up"===s?j=[P,E]:"down"===s?j=[P,-E]:"right"===s&&(j=[P,P-E]),j&&(c?w||void 0===w?c.attr(r(r({},k),{x:j[0],y:j[1]})):c.remove():w&&e.addShape("circle",{attrs:r(r({},k),{x:j[0],y:j[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}));var A=null;"up"===s?A=[P-E,-E]:"left"===s?A=[P,-E]:"right"===s&&(A=[-P,-E]),A&&(h?M||void 0===M?h.attr(r(r({},k),{x:A[0],y:A[1]})):h.remove():M&&e.addShape("circle",{attrs:r(r({},k),{x:A[0],y:A[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}));var I=null;"down"===s?I=[-P+E,E]:"left"===s?I=[P,E]:"right"===s&&(I=[-P,E]),I&&(l?S||void 0===S?l.attr(r(r({},k),{x:I[0],y:I[1]})):l.remove():S&&e.addShape("circle",{attrs:r(r({},k),{x:I[0],y:I[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))}},"single-node"),Object(o.r)("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:o.e.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf"},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(t,e){var n=this.getOptions(t).preRect,o=void 0===n?{}:n,a=this.getShapeStyle(t),s=this.getSize(t),u=s[0],c=s[1],h=e.addShape("rect",{attrs:a,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0}),l=o.show,f=i(o,["show"]);return l&&e.addShape("rect",{attrs:r({x:-u/2,y:-c/2,height:c},f),className:"pre-rect",name:"pre-rect",draggable:!0}),this.drawLogoIcon(t,e),this.drawStateIcon(t,e),this.drawLinkPoints(t,e),h},drawLogoIcon:function(t,e){var n=this.getOptions(t).logoIcon,o=void 0===n?{}:n,a=this.getSize(t)[0];if(o.show){var s=o.width,u=o.height,c=o.x,h=o.y,l=o.offset,f=o.text,d=i(o,["width","height","x","y","offset","text"]);f?e.addShape("text",{attrs:r({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):e.addShape("image",{attrs:r(r({},d),{x:c||-a/2+s+l,y:h||-u/2,width:s,height:u}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(t,e){var n=this.getOptions(t).stateIcon,o=void 0===n?{}:n,a=this.getSize(t)[0];if(o.show){var s=o.width,u=o.height,c=o.x,h=o.y,l=o.offset,f=o.text,d=i(o,["width","height","x","y","offset","text"]);f?e.addShape("text",{attrs:r({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},d),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):e.addShape("image",{attrs:r(r({},d),{x:c||a/2-s+l,y:h||-u/2,width:s,height:u}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,o=void 0===n?{}:n,a=o.top,s=o.left,u=o.right,c=o.bottom,h=o.size,l=o.r,f=i(o,["top","left","right","bottom","size","r"]),d=this.getSize(t),p=d[0],g=d[1];s&&e.addShape("circle",{attrs:r(r({},f),{x:-p/2,y:0,r:h/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),u&&e.addShape("circle",{attrs:r(r({},f),{x:p/2,y:0,r:h/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),a&&e.addShape("circle",{attrs:r(r({},f),{x:0,y:-g/2,r:h/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),c&&e.addShape("circle",{attrs:r(r({},f),{x:0,y:g/2,r:h/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})},drawLabel:function(t,e){var n=this.getOptions(t),i=n.labelCfg,o=void 0===i?{}:i,s=n.logoIcon,u=void 0===s?{}:s,c=n.descriptionCfg,h=void 0===c?{}:c,l=this.getSize(t)[0],f=null,d=u.show,p=u.width,g=-l/2+o.offset;d&&(g=-l/2+p+o.offset);var v=o.style,y=h.style,m=h.paddingTop;return Object(a.o)(t.description)?(f=e.addShape("text",{attrs:r(r({},v),{x:g,y:-5,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0}),e.addShape("text",{attrs:r(r({},y),{x:g,y:17+(m||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0})):f=e.addShape("text",{attrs:r(r({},v),{x:g,y:7,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0}),f},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},i=Object(a.r)({},e,n),o=this.getSize(t),s=i.width||o[0],u=i.height||o[1];return r({x:-s/2,y:-u/2,width:s,height:u},i)},update:function(t,e){var n=this.getOptions(t),o=n.style,s=void 0===o?{}:o,u=n.labelCfg,c=void 0===u?{}:u,h=n.descriptionCfg,l=void 0===h?{}:h,f=this.getSize(t),d=f[0],p=f[1];e.get("keyShape").attr(r(r({},s),{x:-d/2,y:-p/2,width:d,height:p}));var g=e.getContainer(),v=g.find((function(t){return"rect-logo-icon"===t.get("className")})),y=v?v.attr():{},m=Object(a.r)({},y,t.logoIcon),b=m.width;void 0===b&&(b=this.options.logoIcon.width);var x=t.logoIcon?t.logoIcon.show:void 0,w=c.offset,M=-d/2+b+w;x||void 0===x||(M=-d/2+w);var S=g.find((function(t){return"node-label"===t.get("className")})),O=g.find((function(t){return"rect-description"===t.get("className")}));if(t.label)if(S){var k=t.labelCfg?t.labelCfg.style:{},C=Object(a.r)({},S.attr(),k);t.label&&(C.text=t.label),C.x=M,Object(a.o)(t.description)&&(C.y=-5),O&&(O.resetMatrix(),O.attr({x:M})),S.resetMatrix(),S.attr(C)}else g.addShape("text",{attrs:r(r({},c.style),{x:M,y:t.description?-5:7,text:t.label}),className:"node-label",name:"node-label",draggable:!0});if(Object(a.o)(t.description)){var E=l.paddingTop;if(O){k=t.descriptionCfg?t.descriptionCfg.style:{};var P=Object(a.r)({},O.attr(),k);Object(a.o)(t.description)&&(P.text=t.description),P.x=M,O.resetMatrix(),O.attr(r(r({},P),{y:17+(E||0)}))}else g.addShape("text",{attrs:r(r({},l.style),{x:M,y:17+(E||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0})}var j=g.find((function(t){return"pre-rect"===t.get("className")}));if(j){var A=Object(a.r)({},j.attr(),t.preRect);j.attr(r(r({},A),{x:-d/2,y:-p/2,height:p}))}if(v)if(x||void 0===x){var I=m.width,T=m.height,N=m.x,B=m.y,_=m.offset,L=i(m,["width","height","x","y","offset"]);v.attr(r(r({},L),{x:N||-d/2+I+_,y:B||-T/2,width:I,height:T}))}else v.remove();else x&&this.drawLogoIcon(t,g);var D=g.find((function(t){return"rect-state-icon"===t.get("className")})),R=D?D.attr():{},F=Object(a.r)({},R,t.stateIcon);if(D){F.show||void 0===F.show||D.remove();var X=F.width,Y=(T=F.height,N=F.x,B=F.y,F.offset),z=i(F,["width","height","x","y","offset"]);D.attr(r(r({},z),{x:N||d/2-X+Y,y:B||-T/2,width:X,height:T}))}else F.show&&this.drawStateIcon(t,g);this.updateLinkPoints(t,g)}},"single-node"),Object(o.r)("star",{options:{size:60,style:{stroke:o.e.defaultNode.style.stroke,fill:o.e.defaultNode.style.fill,lineWidth:o.e.defaultNode.style.lineWidth},labelCfg:{style:{fill:o.e.nodeLabel.style.fill,fontSize:o.e.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:o.e.defaultNode.linkPoints.size,lineWidth:o.e.defaultNode.linkPoints.lineWidth,fill:o.e.defaultNode.linkPoints.fill,stroke:o.e.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:r({},o.e.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(t,e){var n=this.getOptions(t).icon,i=void 0===n?{}:n,o=this.getShapeStyle(t),a=e.addShape("path",{attrs:o,className:this.type+"-keyShape",name:this.type+"-keyShape",draggable:!0}),s=i.width,u=i.height,c=i.show,h=i.text;return c&&(h?e.addShape("text",{attrs:r({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}):e.addShape("image",{attrs:r({x:-s/2,y:-u/2},i),className:this.type+"-icon",name:this.type+"-icon",draggable:!0})),this.drawLinkPoints(t,e),a},drawLinkPoints:function(t,e){var n=this.getOptions(t).linkPoints,o=void 0===n?{}:n,a=o.top,s=o.left,u=o.right,c=o.leftBottom,h=o.rightBottom,l=o.size,f=o.r,d=i(o,["top","left","right","leftBottom","rightBottom","size","r"]),p=this.getSize(t)[0];if(u){var g=Math.cos(.1*Math.PI)*p,v=Math.sin(.1*Math.PI)*p;e.addShape("circle",{attrs:r(r({},d),{x:g,y:-v,r:l/2||f||5}),className:"link-point-right",name:"link-point-right"})}if(a){g=Math.cos(.5*Math.PI)*p,v=Math.sin(.5*Math.PI)*p;e.addShape("circle",{attrs:r(r({},d),{x:g,y:-v,r:l/2||f||5}),className:"link-point-top",name:"link-point-top"})}if(s){g=Math.cos(.9*Math.PI)*p,v=Math.sin(.9*Math.PI)*p;e.addShape("circle",{attrs:r(r({},d),{x:g,y:-v,r:l/2||f||5}),className:"link-point-left",name:"link-point-left"})}if(c){g=Math.cos(1.3*Math.PI)*p,v=Math.sin(1.3*Math.PI)*p;e.addShape("circle",{attrs:r(r({},d),{x:g,y:-v,r:l/2||f||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(h){g=Math.cos(1.7*Math.PI)*p,v=Math.sin(1.7*Math.PI)*p;e.addShape("circle",{attrs:r(r({},d),{x:g,y:-v,r:l/2||f||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(t){for(var e=this.getSize(t)[0],n=3*e/8,r=t.innerR||n,i=[],o=0;o<5;o++){var a=Math.cos((18+72*o)/180*Math.PI)*e,s=Math.sin((18+72*o)/180*Math.PI)*e,u=Math.cos((54+72*o)/180*Math.PI)*r,c=Math.sin((54+72*o)/180*Math.PI)*r;0===o?i.push(["M",a,-s]):i.push(["L",a,-s]),i.push(["L",u,-c])}return i.push(["Z"]),i},getShapeStyle:function(t){var e=this.getOptions(t).style,n={stroke:t.color},i=Object(a.r)({},e,n),o=this.getPath(t);return r({path:o},i)},update:function(t,e){var n=e.getContainer(),r=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},s=e.get("keyShape"),u=Object(a.r)({},r,s.attr(),o);u=Object(a.r)(u,t.style),this.updateShape(t,e,u,!0),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var n=this.getOptions({}).linkPoints,i=e.find((function(t){return"link-point-left"===t.get("className")})),o=e.find((function(t){return"link-point-right"===t.get("className")})),s=e.find((function(t){return"link-point-top"===t.get("className")})),u=e.find((function(t){return"link-point-left-bottom"===t.get("className")})),c=e.find((function(t){return"link-point-right-bottom"===t.get("className")})),h=n,l=i||o||s||u||c;l&&(h=l.attr());var f=Object(a.r)({},h,t.linkPoints),d=f.fill,p=f.stroke,g=f.lineWidth,v=f.size/2;v||(v=f.r);var y=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},m=y.left,b=y.right,x=y.top,w=y.leftBottom,M=y.rightBottom,S=this.getSize(t)[0],O={r:v,fill:d,stroke:p,lineWidth:g},k=Math.cos(.1*Math.PI)*S,C=Math.sin(.1*Math.PI)*S;o?b||void 0===b?o.attr(r(r({},O),{x:k,y:-C})):o.remove():b&&e.addShape("circle",{attrs:r(r({},O),{x:k,y:-C}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0}),k=Math.cos(.5*Math.PI)*S,C=Math.sin(.5*Math.PI)*S,s?x||void 0===x?s.attr(r(r({},O),{x:k,y:-C})):s.remove():x&&e.addShape("circle",{attrs:r(r({},O),{x:k,y:-C}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0}),k=Math.cos(.9*Math.PI)*S,C=Math.sin(.9*Math.PI)*S,i?m||void 0===m?i.attr(r(r({},O),{x:k,y:-C})):i.remove():m&&e.addShape("circle",{attrs:r(r({},O),{x:k,y:-C}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0}),k=Math.cos(1.3*Math.PI)*S,C=Math.sin(1.3*Math.PI)*S,u?w||void 0===w?u.attr(r(r({},O),{x:k,y:-C})):u.remove():w&&e.addShape("circle",{attrs:r(r({},O),{x:k,y:-C}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0}),k=Math.cos(1.7*Math.PI)*S,C=Math.sin(1.7*Math.PI)*S,c?M||void 0===M?c.attr(r(r({},O),{x:k,y:-C})):u.remove():M&&e.addShape("circle",{attrs:r(r({},O),{x:k,y:-C}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0})}},"single-node");var s=o.n.defaultSubjectColors;Object(o.r)("donut",{options:{size:o.e.defaultNode.size,style:{x:0,y:0,stroke:o.e.defaultNode.style.stroke,fill:o.e.defaultNode.style.fill,lineWidth:o.e.defaultNode.style.lineWidth},labelCfg:{style:{fill:o.e.nodeLabel.style.fill,fontSize:o.e.nodeLabel.style.fontSize}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:o.e.defaultNode.linkPoints.size,lineWidth:o.e.defaultNode.linkPoints.lineWidth,fill:o.e.defaultNode.linkPoints.fill,stroke:o.e.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:r({},o.e.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var n=this.getOptions(t).icon,i=void 0===n?{}:n,o=this.getShapeStyle(t),u=Object(a.b)({},i,t.icon),c=e.addShape("circle",{attrs:o,className:this.type+"-keyShape",draggable:!0,name:this.type+"-keyShape"}),h=u.width,l=u.height,f=u.show,d=u.text;f&&(d?e.addShape("text",{attrs:r({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},u),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}):e.addShape("image",{attrs:r({x:-h/2,y:-l/2},u),className:this.type+"-icon",name:this.type+"-icon",draggable:!0}));var p=c.attr("r"),g=.6*p,v=(p+g)/2,y=t,m=y.donutAttrs,b=void 0===m?{}:m,x=y.donutColorMap,w=void 0===x?{}:x,M=Object.keys(b).length;if(b&&M>1){var S=[],O=0;if(Object.keys(b).forEach((function(t){var e=b[t]||0;Object(a.k)(e)&&(S.push({key:t,value:e,color:w[t]}),O+=e)})),O){var k=p-g;if(1===M)return void e.addShape("circle",{attrs:{r:v,x:0,y:0,stroke:S[0].color||s[0],lineWidth:k},name:"fan-shape-0"});var C=[v,0],E=0;S.forEach((function(t,n){var r=t.value/O;if(!(r<.001))if(r>.999&&(r=1),1!==r){t.percent=r,t.angle=r*Math.PI*2,t.beginAgnle=E,E+=t.angle,t.endAngle=E,t.arcBegin=C,t.arcEnd=[v*Math.cos(t.endAngle),-v*Math.sin(t.endAngle)];var i=t.angle>Math.PI?1:0,o=[["M",t.arcBegin[0],t.arcBegin[1]],["A",v,v,0,i,0,t.arcEnd[0],t.arcEnd[1]],["L",t.arcEnd[0],t.arcEnd[1]]];e.addShape("path",{attrs:{path:o,lineWidth:k,stroke:t.color||s[n%s.length]},name:"fan-shape-"+n}),C=t.arcEnd}else e.addShape("circle",{attrs:{r:v,x:0,y:0,stroke:t.color||s[n%s.length],lineWidth:k},name:"fan-shape-"+n})}))}}return this.drawLinkPoints(t,e),c},update:void 0},"circle");var u=function(t){var e=t.x,n=t.y;return{x:e,y:n,centerX:e,centerY:n,minX:e,minY:n,maxX:e,maxY:n,height:0,width:0}},c=function(t){for(var e=[],n={},r=t.length-1;r>=0;r--){var i=t[r];i.id=i.x+"|||"+i.y,n[i.id]=i,e.push(i)}return e},h=function(t){return c(t)},l=function(t,e){return t.width||t.height?{centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}:t},f=function(t,e,n){var r=function(t,e){var n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return 0===n&&0===r?0:n/e.width>r/e.height}(e,t);if(0===r){var i=t.centerX,o=t.centerY;return n.y<e.y?o=t.minY:n.x>e.x?i=t.maxX:n.x<e.x?i=t.minX:n.x===e.x&&(o=t.maxY),{x:i,y:o}}return r?{x:e.x>t.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},d=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{centerX:(n+i)/2,centerY:(r+o)/2,minX:n,minY:r,maxX:i,maxY:o,height:o-r,width:i-n}},p=function(t){return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},g=function(t,e){var n=t.x,r=t.y;return n<e.minX||n>e.maxX||r<e.minY||r>e.maxY},v=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},y=function(t,e,n,r,i){return v(t,e)+v(t,n)+function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n}(t,[e,n,r,i])},m=function t(e,n,r,i,o){void 0===o&&(o=0),e.unshift(n[i]),r[i]&&r[i]!==i&&o<=100&&t(e,n,r,r[i],o+1)},b=function(t,e,n,r){var i=n.x-t.x,o=n.y-t.y,a=r.x-t.x,s=r.y-t.y,u=n.x-e.x,c=n.y-e.y,h=r.x-e.x,l=r.y-e.y;return(i*s-o*a)*(u*l-c*h)<=0&&(i*c-o*u)*(a*l-s*h)<=0},x=function(t,e,n){if(n.width||n.height){var r=p(n),i=r[0],o=r[1],a=r[2],s=r[3];return b(t,e,i,o)||b(t,e,i,s)||b(t,e,o,a)||b(t,e,a,s)}return!1},w=function(t,e,n,r){var i=[];return t.forEach((function(t){if(t!==e&&(t.x===e.x||t.y===e.y)){if(x(t,e,n)||x(t,e,r))return;i.push(t)}})),c(i)},M=function(t,e){var n=[],r=t[0];return n.push("M"+r.x+" "+r.y),t.forEach((function(r,i){var o=t[i+1],a=t[i+2];if(o&&a)if(function(t,e,n){return!(t.x===e.x&&e.x===n.x||t.y===e.y&&e.y===n.y)}(r,o,a)){var s=function(t,e,n,r){var i=v(t,e),o=v(n,e);return i<r&&(r=i),o<r&&(r=o),[{x:e.x-r/i*(e.x-t.x),y:e.y-r/i*(e.y-t.y)},{x:e.x-r/o*(e.x-n.x),y:e.y-r/o*(e.y-n.y)}]}(r,o,a,e),u=s[0],c=s[1];n.push("L"+u.x+" "+u.y),n.push("Q"+o.x+" "+o.y+" "+c.x+" "+c.y),n.push("L"+c.x+" "+c.y)}else n.push("L"+o.x+" "+o.y);else o&&n.push("L"+o.x+" "+o.y)})),n.join("")},S=function(t,e,n,r,i){var o,a;if(n&&n.getType())if("combo"===n.getType()){(o=n.getKeyShape().getCanvasBBox()||u(t)).centerX=(o.minX+o.maxX)/2,o.centerY=(o.minY+o.maxY)/2}else o=n.getBBox();else o=u(t);if(r&&r.getType())if("combo"===r.getType()){var s=r.getKeyShape().getBBox();if(s){var b=r.getModel(),x=b.x,M=b.y;(a={x:x,y:M,width:s.width,height:s.height,minX:s.minX+x,maxX:s.maxX+x,minY:s.minY+M,maxY:s.maxY+M}).centerX=(a.minX+a.maxX)/2,a.centerY=(a.minY+a.maxY)/2}else a=u(e)}else a=r&&r.getBBox();else a=u(e);var S=l(o,i),O=l(a,i),k=f(S,t,e),C=f(O,e,t),E=function(t){void 0===t&&(t=[]);var e=[],n=[];t.forEach((function(t){e.push(t.x),n.push(t.y)}));var r=Math.min.apply(Math,e),i=Math.max.apply(Math,e),o=Math.min.apply(Math,n),a=Math.max.apply(Math,n);return{centerX:(r+i)/2,centerY:(o+a)/2,maxX:i,maxY:a,minX:r,minY:o,height:a-o,width:i-r}}([k,C]),P=d(S,E),j=d(O,E),A=[];A=A.concat(p(P)).concat(p(j));var I={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[E,P,j].forEach((function(t){A=A.concat(function(t,e){return function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x).concat(function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y))}(t,I).filter((function(t){return g(t,S)&&g(t,O)})))})),[{x:k.x,y:C.y},{x:C.x,y:k.y}].forEach((function(t){g(t,S)&&g(t,O)&&A.push(t)})),A.unshift(k),A.push(C);var T=function(t,e,n,r,i,o,a){var s=[],u=[e],c={},h={},l={};h[e.id]=0,l[e.id]=y(e,n,e);var f,d,p,g,b,x={};for(t.forEach((function(t){x[t.id]=t}));u.length;){if(f=void 0,d=1/0,u.forEach((function(t){l[t.id]<=d&&(d=l[t.id],f=t)})),f===n){var M=[];return m(M,x,c,n.id),M}g=f,b=void 0,(b=(p=u).indexOf(g))>-1&&p.splice(b,1),s.push(f),w(t,f,r,i).forEach((function(t){if(-1===s.indexOf(t)){-1===u.indexOf(t)&&u.push(t);var r=l[f.id]+v(f,t);h[t.id]&&r>=h[t.id]||(c[t.id]=f.id,h[t.id]=r,l[t.id]=h[t.id]+y(t,n,e,o,a))}}))}return[e,n]}(A=c(A),k,C,o,a,t,e);return T.unshift(t),T.push(e),h(T)},O={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},fallbackRoute:function(t,e,n,r,i){return h(S(t,e,n,r,i.offset))}},k=(Math.PI,function(t,e){var n=Math.round(Math.abs(t/e));return n<0?0:(t<0?-1:1)*n}),C=function(t,e){var n=e.x-t.x,r=e.y-t.y;return n||r?Math.atan2(r,n):0},E=function(t,e){var n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n},P=function(t,e,n){for(var r=1/0,i=0,o=e.length;i<o;i++){var a=n(t,e[i]);a<r&&(r=a)}return r},j=function(t,e,n,r,i){var a=[];if(!n)return[t];var s=i.directions,u=i.offset,c=n.getBBox(),h=e.x>c.minX&&e.x<c.maxX&&e.y>c.minY&&e.y<c.maxY,d=l(c,u);for(var p in d)d[p]=k(d[p],i.gridSize);if(h){for(var g=0,v=s;g<v.length;g++){var y=v[g],m=[[{x:d.minX,y:d.minY},{x:d.maxX,y:d.minY}],[{x:d.minX,y:d.minY},{x:d.minX,y:d.maxY}],[{x:d.maxX,y:d.minY},{x:d.maxX,y:d.maxY}],[{x:d.minX,y:d.maxY},{x:d.maxX,y:d.maxY}]];for(p=0;p<4;p++){var b=m[p],w=o.n.getLineIntersect(t,{x:t.x+y.stepX*d.width,y:t.y+y.stepY*d.height},b[0],b[1]);w&&!x(t,w,c)&&(w.id=w.x+"|||"+w.y,a.push(w))}}return a}var M=f(d,t,r);return M.id=M.x+"|||"+M.y,[M]},A=function(t,e,n,r){var i=C(t,e);if(!n[t.id]){var o=C(r,t);return E(o,i)}var a=C({x:n[t.id].x,y:n[t.id].y},t);return E(a,i)},I=function(t,e,n,r,i,o,a){var s=[r],u=t.id,c=t.x,h=t.y,l={x:c,y:h,id:u};for(A(l,o,e,n)&&s.unshift({x:o.x===r.x?r.x:l.x*a,y:o.y===r.y?r.y:l.y*a});e[u]&&e[u].id!==u;){var f={x:c,y:h,id:u},d=e[u].id,p=e[u].x,g=e[u].y,v={x:p,y:g,id:d};A(v,f,e,n)&&s.unshift({x:v.x===f.x?s[0].x:v.x*a,y:v.y===f.y?s[0].y:v.y*a}),u=d,c=p,h=g}var y=c,m=h;return s[0].x=y===n.x?i.x:s[0].x,s[0].y=m===n.y?i.y:s[0].y,s.unshift(i),s},T=function(t,e,n,r,i){if(isNaN(t.x)||isNaN(e.x))return[];var o=Object(a.b)(O,i);o.obstacles=o.obstacles||[];var s=o.gridSize,u=function(t,e,n){var r={};return t.forEach((function(t){if(t)for(var i=l(t.getBBox(),n),o=k(i.minX,e);o<=k(i.maxX,e);o+=1)for(var a=k(i.minY,e);a<=k(i.maxY,e);a+=1)r[o+"|||"+a]=!0})),r}(o.obstacles.concat([n,r]),s,o.offset),c={x:k(t.x,s),y:k(t.y,s)},h={x:k(e.x,s),y:k(e.y,s)};t.id=c.x+"|||"+c.y,e.id=h.x+"|||"+h.y;var f=j(c,t,n,h,o),d=j(h,e,r,c,o);f.forEach((function(t){delete u[t.id]})),d.forEach((function(t){delete u[t.id]}));for(var p={},g={},v={},y={},m={},b=0;b<f.length;b++){var x=f[b];p[x.id]=x,y[x.id]=0,m[x.id]=P(x,d,o.distFunc)}for(var w,M,S,C,E,T,N,B=o.maximumLoops,_=o.penalties;Object.keys(p).length>0&&B>0&&(w=void 0,M=1/0,Object.keys(p).forEach((function(t){var e=p[t].id;m[e]<=M&&(M=m[e],w=p[e])})),w);){if(d.findIndex((function(t){return t.x===w.x&&t.y===w.y}))>-1)return I(w,v,c,e,t,h,s);delete p[w.id],g[w.id]=!0;for(b=0;b<o.directions.length;b++)S=o.directions[b],g[(C={x:w.x+S.stepX,y:w.y+S.stepY,id:Math.round(w.x)+S.stepX+"|||"+(Math.round(w.y)+S.stepY)}).id]||(N=A(w,C,v,c))>o.maxAllowedDirectionChange||u[C.id]||(p[C.id]||(p[C.id]=C),E=o.distFunc(w,C)+(isNaN(_[N])?s:_[N]),T=y[w.id]+E,y[C.id]&&T>=y[C.id]||(v[C.id]=w,y[C.id]=T,m[C.id]=T+P(C,d,o.distFunc)));B-=1}return o.fallbackRoute(t,e,n,r,o)};Object(o.q)("polyline",{options:{color:o.e.defaultEdge.color,size:o.e.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:o.e.defaultEdge.style.stroke,lineAppendWidth:o.e.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:o.e.edgeLabel.style.fill,fontSize:o.e.edgeLabel.style.fontSize}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:r({},o.e.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var n=this.getShapeStyle(t);return 0===n.radius&&delete n.radius,e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:n})},getShapeStyle:function(t){var e=this.options.style,n={stroke:t.color},r=Object(a.r)({},e,n,t.style);t=this.getPathPoints(t),this.radius=r.radius,this.offset=r.offset;var i=t.startPoint,s=t.endPoint,u=this.getControlPoints(t),c=[i];u&&(c=c.concat(u)),c.push(s);var h=t.sourceNode,l=t.targetNode,f=r.radius,d=this.options.routeCfg,p=Object(a.r)({},d,t.routeCfg);p.offset=r.offset;var g=this.getPath(c,h,l,f,p);return(Object(a.f)(g)&&g.length<=1||Object(a.o)(g)&&-1===g.indexOf("L"))&&(g="M0 0, L0 0"),(isNaN(i.x)||isNaN(i.y)||isNaN(s.x)||isNaN(s.y))&&(g="M0 0, L0 0"),Object(a.r)({},o.e.defaultEdge.style,r,{lineWidth:t.size,path:g})},updateShapeStyle:function(t,e){var n=e.getContainer();if(e.isVisible()){var r={stroke:t.color},i=n.find((function(t){return"edge-shape"===t.get("className")}))||e.getKeyShape(),o=t.size,s=(t=this.getPathPoints(t)).startPoint,u=t.endPoint,c=this.getControlPoints(t),h=[s];c&&(h=h.concat(c)),h.push(u);var l=i.attr(),f=Object(a.r)({},r,l,t.style),d=t.sourceNode,p=t.targetNode,g=f.radius,v=this.options.routeCfg,y=Object(a.r)({},v,t.routeCfg);y.offset=f.offset;var m=this.getPath(h,d,p,g,y);(Object(a.f)(m)&&m.length<=1||Object(a.o)(m)&&-1===m.indexOf("L"))&&(m="M0 0, L0 0"),(isNaN(s.x)||isNaN(s.y)||isNaN(u.x)||isNaN(u.y))&&(m="M0 0, L0 0"),l.endArrow&&!1===f.endArrow&&(t.style.endArrow={path:""}),l.startArrow&&!1===f.startArrow&&(t.style.startArrow={path:""});var b=Object(a.r)(r,i.attr(),{lineWidth:o,path:m},t.style);i&&i.attr(b)}},getPath:function(t,e,n,r,i){var s=i.offset,u=i.simple;if(!s||t.length>2){if(r)return M(t,r);var c=[];return Object(a.c)(t,(function(t,e){0===e?c.push(["M",t.x,t.y]):c.push(["L",t.x,t.y])})),c}var h=u?S(t[t.length-1],t[0],n,e,s):T(t[0],t[t.length-1],e,n,i);return h&&h.length?r?M(h,r):o.n.pointsToPolygon(h):"M0 0, L0 0"}},"single-edge")},415:function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(2),a=n(34),s=a.a.cloneEvent,u=a.a.isNaN,c=Math.abs,h={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd"}},updateViewport:function(t){var e=this.origin,n=+t.clientX,r=+t.clientY;if(!u(n)&&!u(r)){var i=n-e.x,o=r-e.y;"x"===this.get("direction")?o=0:"y"===this.get("direction")&&(i=0),this.origin={x:n,y:r};var a=this.graph.get("width"),s=this.graph.get("height"),c=this.graph.get("canvas").getCanvasBBox();(c.minX<=a+this.scalableRange&&c.minX+i>a+this.scalableRange||c.maxX+this.scalableRange>=0&&c.maxX+this.scalableRange+i<0)&&(i=0),(c.minY<=s+this.scalableRange&&c.minY+o>s+this.scalableRange||c.maxY+this.scalableRange>=0&&c.maxY+this.scalableRange+o<0)&&(o=0),this.graph.translate(i,o)}},onDragStart:function(t){t.originalEvent;if(this.shouldBegin.call(this,t)){var e=t.target,n=e&&e.isCanvas&&e.isCanvas();if((this.allowDragOnItem||n)&&(this.origin={x:t.clientX,y:t.clientY},this.dragging=!1,this.enableOptimize)){for(var r=this.graph,i=r.getEdges(),o=0,a=i.length;o<a;o++){var s=i[o].get("group").get("children");s&&s.forEach((function(t){t.set("ori-visibility",t.get("ori-visibility")||t.get("visible")),t.hide()}))}for(var u=r.getNodes(),c=0,h=u.length;c<h;c++)for(var l=0,f=u[c].getContainer().get("children");l<f.length;l++){var d=f[l];d.get("isKeyShape")||(d.set("ori-visibility",d.get("ori-visibility")||d.get("visible")),d.hide())}}}},onDragMove:function(t){this.graph;var e=t.target,n=e&&e.isCanvas&&e.isCanvas();if((this.allowDragOnItem||n)&&(t=s(t),this.origin)){if(!this.dragging){if(c(this.origin.x-t.clientX)+c(this.origin.y-t.clientY)<10)return;this.shouldBegin.call(this,t)&&(t.type="dragstart",this.dragging=!0)}this.shouldUpdate.call(this,t)&&this.updateViewport(t)}},onDragEnd:function(t){var e=this.graph;if(this.enableOptimize){for(var n=e.getEdges(),r=0,i=n.length;r<i;r++){var o=n[r].get("group").get("children");o&&o.forEach((function(t){t.get("ori-visibility")&&t.show()}))}for(var a=e.getNodes(),u=0,c=a.length;u<c;u++)for(var h=0,l=a[u].getContainer().get("children");h<l.length;h++){var f=l[h];if(!f.get("isKeyShape"))f.get("ori-visibility")&&f.show()}}this.dragging?(t=s(t),this.shouldEnd.call(this,t)&&this.updateViewport(t),t.type="dragend",this.endDrag()):this.origin=null},endDrag:function(){this.origin=null,this.dragging=!1,this.dragbegin=!1}},l=n(18),f={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected"}},getEvents:function(){return{"node:dragstart":"onDragStart","node:drag":"onDrag","node:dragend":"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas"}},validationCombo:function(t){return!(!this.origin||!t||t.destroyed)&&"combo"===t.getType()},onDragStart:function(t){var e=this;if(this.shouldBegin.call(this,t)){var n=t.item;if(n&&!n.destroyed&&!n.hasLocked()){var r=t.target;if(r)if(r.get("isAnchorPoint"))return;var o=this.graph;this.targets=[],this.targetCombo=null;var a=o.findAllByState("node",this.selectedState),s=n.get("id");0===a.filter((function(t){var e=t.get("id");return s===e})).length?this.targets.push(n):a.length>1?a.forEach((function(t){t.hasLocked()||e.targets.push(t)})):this.targets.push(n);var u=[];this.targets.forEach((function(t){u.push(Object(i.a)(t.getModel()))})),this.set("beforeDragNodes",u),this.origin={x:t.x,y:t.y},this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;this.origin&&this.shouldUpdate(this,t)&&(this.get("enableDelegate")?this.updateDelegate(t):this.targets.map((function(n){e.update(n,t)})))},onDragEnd:function(t){if(this.origin&&this.shouldEnd.call(this,t)){var e=t.item;if(e)e.getContainer().set("capture",!0);this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.updatePositions(t);var n=this.graph;if(n.get("enabledStack")){var r={before:{nodes:this.get("beforeDragNodes"),edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.targets.forEach((function(t){r.after.nodes.push(t.getModel())})),n.pushStack("update",Object(i.a)(r))}n.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(t){var e=t.item;if(this.validationCombo(e)){this.updatePositions(t);var n=this.graph;if(this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)n.updateCombos();else{var r=e.getModel();this.targets.map((function(t){t.getModel().comboId!==r.id&&n.updateComboTree(t,r.id)})),n.updateCombo(e)}n.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.targets&&0!==this.targets.length&&(this.updatePositions(t),this.onlyChangeComboSize?e.updateCombos():this.targets.map((function(t){t.getModel().comboId&&e.updateComboTree(t)})))},onDropNode:function(t){if(this.targets&&0!==this.targets.length){var e=t.item;this.updatePositions(t);var n=this.graph,r=e.getModel().comboId;if(r){var i=n.findById(r);this.comboActiveState&&n.setItemState(i,this.comboActiveState,!1),this.targets.map((function(t){var e=t.getModel();r!==e.comboId&&n.updateComboTree(t,r)})),n.updateCombo(i)}else this.targets.map((function(t){t.getModel().comboId&&n.updateComboTree(t)}));n.emit("dragnodeend",{items:this.targets,targetItem:e})}},onDragEnter:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!0)}},onDragLeave:function(t){var e=t.item;if(this.validationCombo(e)){var n=this.graph;this.comboActiveState&&n.setItemState(e,this.comboActiveState,!1)}},updatePositions:function(t){var e=this;this.targets&&0!==this.targets.length&&this.get("enableDelegate")&&this.targets.map((function(n){return e.update(n,t)}))},update:function(t,e){var n=this.origin,r=t.get("model"),i=t.get("id");this.point[i]||(this.point[i]={x:r.x||0,y:r.y||0});var o={x:e.x-n.x+this.point[i].x,y:e.y-n.y+this.point[i].y};this.get("updateEdge")?this.graph.updateItem(t,o,!1):t.updatePosition(o)},updateDelegate:function(t){this.graph;if(this.delegateRect){var e=t.x-this.origin.x+this.originPoint.minX,n=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:e,y:n})}else{var o=this.graph.get("group"),a=Object(i.b)({},l.a.delegateStyle,this.delegateStyle),s=this.calculationGroupPosition(t),u=s.x,c=s.y,h=s.width,f=s.height,d=s.minX,p=s.minY;this.originPoint={x:u,y:c,width:h,height:f,minX:d,minY:p},this.delegateRect=o.addShape("rect",{attrs:Object(r.a)({width:h,height:f,x:u,y:c},a),name:"rect-delegate-shape"})}},calculationGroupPosition:function(t){var e=this.graph.findAllByState("node",this.selectedState);0===e.length&&e.push(t.item);for(var n=1/0,r=-1/0,i=1/0,o=-1/0,a=0;a<e.length;a++){var s=e[a].getBBox(),u=s.minX,c=s.minY,h=s.maxX,l=s.maxY;u<n&&(n=u),c<i&&(i=c),h>r&&(r=h),l>o&&(o=l)}return{x:Math.floor(n),y:Math.floor(i),width:Math.ceil(r)-Math.floor(n),height:Math.ceil(o)-Math.floor(i),minX:n,minY:i}}},d={getDefaultCfg:function(){return{multiple:!0,selectedState:"selected"}},getEvents:function(){return{"node:tap":"onClick","combo:tap":"onClick","canvas:tap":"onCanvasClick"}},onClick:function(t){var e=this,n=t.item;if(n&&!n.destroyed){var r=n.getType(),o=e.graph,a=e.multiple,s=e.shouldUpdate;if(e.shouldBegin.call(e,t)){if(!a){var u=o.findAllByState(r,e.selectedState);Object(i.c)(u,(function(t){t!==n&&o.setItemState(t,e.selectedState,!1)}))}if(n.hasState(e.selectedState)){s.call(e,t)&&o.setItemState(n,e.selectedState,!1);var c=o.findAllByState("node",e.selectedState),h=o.findAllByState("combo",e.selectedState);o.emit("nodeselectchange",{target:n,selectedItems:{nodes:c,combos:h},select:!1})}else{s.call(e,t)&&o.setItemState(n,e.selectedState,!0);c=o.findAllByState("node",e.selectedState),h=o.findAllByState("combo",e.selectedState);o.emit("nodeselectchange",{target:n,selectedItems:{nodes:c,combos:h},select:!0})}}}},onCanvasClick:function(){var t=this,e=this.graph,n=e.findAllByState("node",this.selectedState);Object(i.c)(n,(function(n){e.setItemState(n,t.selectedState,!1)}));var r=e.findAllByState("combo",this.selectedState);Object(i.c)(r,(function(n){e.setItemState(n,t.selectedState,!1)})),e.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},p={firstScale:null,getDefaultCfg:function(){return{originScale:1,sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"}}},getEvents:function(){var t=this.fixSelectedItems;return t.fixState||(t.fixState="selected"),t.fixAll&&(t.fixLineWidth=!0,t.fixLabel=!0),{pinchstart:"onPinch",pinchmove:"onPinch"}},onPinch:function(t){t.preventDefault&&t.preventDefault(),t.originalEvent.preventDefault&&t.originalEvent.preventDefault();var e=t.originalEvent.pointers;if(!(e.length<2)){"pinchstart"===t.type&&(this.firstScale=this.graph.getZoom());var n=t.originalEvent.scale||t.originalEvent.srcEvent.extra.scale,r=this.firstScale*n;this.currentScale=r;var i=this.get("minZoom")||this.graph.get("minZoom");if(!(r>(this.get("maxZoom")||this.graph.get("maxZoom"))||r<i)){var o=this.graph.get("canvas"),a=e[0].clientX,s=e[0].clientY,u=e[1].clientX,c=e[1].clientY,h=o.getPointByClient((a+u)/2,(s+c)/2);this.graph.zoomTo(r,{x:h.x,y:h.y})}}}},g=["tap","dbltap"],v={getDefaultCfg:function(){return{trigger:"tap",onChange:function(){}}},getEvents:function(){var t,e;return g.includes(this.trigger)?e=this.trigger:(e="tap",console.warn("Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["node:"+e]="onNodeTap",t.touchstart="onNodeTap",t},onNodeTap:function(t){var e=t.item,n=this.graph.findDataById(e.get("id"));if(n){var r=n.children;if(r&&0!==r.length){var i=!n.collapsed;if(this.shouldBegin(t,i)&&(n.collapsed=i,e.getModel().collapsed=i,this.graph.emit("itemcollapsed",{item:t.item,collapsed:i}),this.shouldUpdate(t,i))){try{this.onChange(e,i)}catch(t){console.warn(t)}this.graph.layout()}}}}},y=a.a.calculationItemsBBox,m=function(t,e){if(!1!==e(t)&&t){var n=t.get("combos");if(0===n.length)return!1;Object(i.c)(n,(function(t){m(t,e)}))}},b=["click","dblclick"],x=["tap","drag"],w=["shift","ctrl","control","alt","meta",void 0],M={bind:function(t){"drag-canvas"===this.type&&t.get("canvas").set("draggable",!0);var e=this.events;this.graph=t,Object(i.c)(e,(function(e,n){t.on(n,e)}))},unbind:function(t){var e=this.events;"drag-canvas"===this.type&&t.get("canvas").set("draggable",!1),this.graph=null,Object(i.c)(e,(function(e,n){t.off(n,e)}))}},S={"drag-canvas":h,"zoom-canvas":p,"drag-node":f,"activate-relations":{getDefaultCfg:function(){return{activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return{"node:tap":"setAllItemStates","canvas:tap":"clearAllItemStates"}},setAllItemStates:function(t){var e=t.item,n=this.graph;if(this.item=e,this.shouldUpdate(t.item,{event:t,action:"activate"})){for(var r=this.activeState,i=this.inactiveState,o=n.getNodes(),a=n.getEdges(),s=o.length,u=a.length,c=0;c<s;c++){var h=o[c],l=h.hasState("selected");this.resetSelected&&l&&n.setItemState(h,"selected",!1),n.setItemState(h,r,!1),i&&n.setItemState(h,i,!0)}for(c=0;c<u;c++){var f=a[c];n.setItemState(f,r,!1),i&&n.setItemState(f,i,!0)}i&&n.setItemState(e,i,!1),n.setItemState(e,r,!0);var d=e.getEdges(),p=d.length;for(c=0;c<p;c++){var g=void 0;g=(f=d[c]).getSource()===e?f.getTarget():f.getSource(),i&&n.setItemState(g,i,!1),n.setItemState(g,r,!0),n.setItemState(f,i,!1),n.setItemState(f,r,!0),f.toFront()}n.emit("afteractivaterelations",{item:t.item,action:"activate"})}},clearActiveState:function(t){var e=this.get("graph");if(this.shouldUpdate(t.item,{event:t,action:"deactivate"})){var n=this.activeState,r=this.inactiveState,i=e.get("autoPaint");e.setAutoPaint(!1);for(var o=e.getNodes(),a=e.getEdges(),s=o.length,u=a.length,c=0;c<s;c++){var h=o[c];e.clearItemStates(h,[n,r])}for(c=0;c<u;c++){var l=a[c];e.clearItemStates(l,[n,r,"deactivate"])}e.paint(),e.setAutoPaint(i),e.emit("afteractivaterelations",{item:t.item||this.get("item"),action:"deactivate"})}},clearAllItemStates:function(t){var e=this.graph;if(this.shouldUpdate(t.item,{event:t,action:"deactivate"})){for(var n=this.activeState,r=this.inactiveState,i=e.getNodes(),o=e.getEdges(),a=i.length,s=o.length,u=0;u<a;u++){var c=i[u];e.clearItemStates(c,[n,r])}for(u=0;u<s;u++){var h=o[u];e.clearItemStates(h,[n,r,"deactivate"])}e.emit("afteractivaterelations",{item:t.item||this.get("item"),action:"deactivate"})}}},"click-select":d,"collapse-expand":v,"drag-combo":{getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected"}},getEvents:function(){return{"combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(t){var e=t.item;return!(!e||e.destroyed)&&(!!this.shouldUpdate(this,t)&&"combo"===e.getType())},onDragStart:function(t){var e=this,n=this.graph,r=t.item;if(this.validationCombo(t)){this.targets=[];var i=n.findAllByState("combo",this.selectedState),o=r.get("id");0===i.filter((function(t){var e=t.get("id");return o===e})).length?this.targets.push(r):this.targets=i,this.activeState&&this.targets.map((function(t){var r=t.getModel();if(r.parentId){var i=n.findById(r.parentId);i&&n.setItemState(i,e.activeState,!0)}})),this.point={},this.originPoint={},this.origin={x:t.x,y:t.y},this.currentItemChildCombos=[],m(r,(function(t){if(t.destroyed)return!1;var n=t.getModel();return e.currentItemChildCombos.push(n.id),!0}))}},onDrag:function(t){var e=this;if(this.origin&&this.validationCombo(t))if(this.enableDelegate)this.updateDelegate(t);else{if(this.activeState){var n=this.graph,r=t.item,o=r.getModel(),a=n.getCombos(),s=r.getBBox(),u=s.centerX,c=s.centerY,h=s.width;a.filter((function(t){var n=t.getModel();return o.parentId,n.id!==o.id&&!e.currentItemChildCombos.includes(n.id)})).map((function(t){var r=t.getBBox(),i=r.centerX,o=r.centerY,a=r.width,s=u-i,l=c-o,f=2*Math.sqrt(s*s+l*l);h+a-f>.8*h?n.setItemState(t,e.activeState,!0):n.setItemState(t,e.activeState,!1)}))}Object(i.c)(this.targets,(function(n){e.updateCombo(n,t)}))}},updatePositions:function(t){var e=this;this.enableDelegate&&Object(i.c)(this.targets,(function(n){e.updateCombo(n,t)}))},onDrop:function(t){var e=this,n=t.item;if(n&&this.targets&&!n.destroyed){this.updatePositions(t);var r=this.graph,i=n.getModel();this.targets.map((function(t){t.getModel().parentId!==i.id?(e.activeState&&r.setItemState(n,e.activeState,!1),e.onlyChangeComboSize?r.updateCombo(t):r.updateComboTree(t,i.id)):r.updateCombo(n)})),this.end(n,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(this.targets&&0!==this.targets.length){this.updatePositions(t);var n,r=this.graph,i=t.item.getModel().comboId;if(i){if(this.activeState){var o=r.findById(i);r.setItemState(o,this.activeState,!1)}this.targets.map((function(t){e.onlyChangeComboSize?r.updateCombo(t):i!==t.getID()&&(n=r.findById(i),i!==t.getModel().parentId&&r.updateComboTree(t,i))}))}else this.targets.map((function(t){e.onlyChangeComboSize?r.updateCombo(t):t.getModel().comboId&&r.updateComboTree(t)}));this.endComparison=!0,this.end(n,t)}},onDragEnter:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!0)}},onDragLeave:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,n=this.graph;this.activeState&&n.setItemState(e,this.activeState,!1)}},onDragEnd:function(t){if(this.targets&&0!==this.targets.length){var e=t.item;this.updatePositions(t);var n=this.getParentCombo(e.getModel().parentId),r=this.graph;n&&this.activeState&&r.setItemState(n,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var n=this;if(this.origin){var r=this.graph;if(this.delegateShape)r.get("delegateGroup").clear(),this.delegateShape=null;t&&this.activeState&&r.setItemState(t,this.activeState,!1),t||this.targets.map((function(t){n.onlyChangeComboSize?r.updateCombo(t):r.updateComboTree(t)})),this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e){var n=this;if(!1!==e(t)&&t){var r=t.get("combos");Object(i.c)(r,(function(t){n.traverse(t,e)}));var o=t.get("nodes");Object(i.c)(o,(function(t){n.traverse(t,e)}))}},updateCombo:function(t,e){var n=this;this.traverse(t,(function(t){return!t.destroyed&&(n.updateSignleItem(t,e),!0)}))},updateSignleItem:function(t,e){var n=this.origin,r=this.graph,i=t.getModel(),o=t.get("id");this.point[o]||(this.point[o]={x:i.x,y:i.y});var a=e.x-n.x+this.point[o].x,s=e.y-n.y+this.point[o].y;r.updateItem(t,{x:a,y:s})},getParentCombo:function(t){var e=this.graph;if(t){var n=e.findById(t);if(n)return n}},updateDelegate:function(t){var e=this.graph;if(this.delegateShape){var n=t.x-this.origin.x+this.originPoint.minX,i=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:n,y:i})}else{var o=e.get("delegateGroup"),a=null,s=(a=this.targets.length>1?y(this.targets):this.targets[0].getBBox()).x,u=a.y,c=a.width,h=a.height,f=a.minX,d=a.minY;this.originPoint={x:s,y:u,width:c,height:h,minX:f,minY:d};var p=Object(r.a)(Object(r.a)({},l.a.delegateStyle),this.delegateStyle);this.delegateShape=o.addShape("rect",{attrs:Object(r.a)({width:a.width,height:a.height,x:a.x,y:a.y},p),name:"combo-delegate-shape"})}}},"collapse-expand-combo":{getDefaultCfg:function(){return{trigger:"dblclick",relayout:!0}},getEvents:function(){var t,e;return b.includes(this.trigger)?e=this.trigger:(e="dblclick",console.warn("Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["combo:"+e]="onComboClick",t},onComboClick:function(t){var e=t.item,n=this.graph,r=this.relayout;if(e&&!e.destroyed&&"combo"===e.getType()){var i=e.getModel().id;i&&(n.collapseExpandCombo(i),r&&n.get("layout")?n.layout():n.refreshPositions())}}},"create-edge":{getDefaultCfg:function(){return{trigger:"tap",key:void 0,edgeConfig:{}}},getEvents:function(){var t;return x.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="tap",console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),this.key&&-1===w.indexOf(this.key.toLowerCase())&&(this.trigger=void 0,console.warn("Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined")),"drag"===this.trigger?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:"click"===this.trigger&&(t={"node:tap":"onClick",mousemove:"updateEndPoint","edge:tap":"cancelCreating","canvas:tap":"cancelCreating","combo:tap":"onClick"}),this.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(t){if(!this.key||this.keydown){var e=t.item;e&&e.getID()!==this.source&&"node"===e.getType()||this.cancelCreating({item:this.edge,x:t.x,y:t.y})}},onClick:function(t){if(!this.key||this.keydown){var e=t.item,n=this.graph,i=e.getModel();if(this.addingEdge&&this.edge){if(!this.shouldEnd.call(this,t))return;var o={target:i.id};this.source===i.id&&(o.type="loop"),n.emit("beforecreateedge",{}),n.updateItem(this.edge,o),n.emit("aftercreateedge",{edge:this.edge}),this.edge.getKeyShape().set("capture",!0),this.edge=null,this.addingEdge=!1}else{if(!this.shouldBegin.call(this,t))return;this.edge=n.addItem("edge",Object(r.a)({source:i.id,target:i.id},this.edgeConfig),!1),this.source=i.id,this.addingEdge=!0,this.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){if(!this.key||this.keydown){var e={x:t.x,y:t.y};this.graph.findById(this.source)?this.addingEdge&&this.edge&&this.graph.updateItem(this.edge,{target:e},!1):this.addingEdge=!1}},cancelCreating:function(t){if(!this.key||this.keydown){var e=this.graph,n=t.item;if(this.addingEdge&&t.target&&t.target.isCanvas&&t.target.isCanvas())return e.removeItem(this.edge,!1),this.edge=null,void(this.addingEdge=!1);if(this.addingEdge&&this.edge===n){var r=!0;if(!e.get("groupByTypes"))for(var i=t.x,o=t.y,a=e.getNodes(),s=a.length,u=0;u<s;u++){var c=a[u],h=c.getModel(),l=c.getBBox();if(i<=l.maxX&&i>=l.minX&&o<=l.maxY&&o>=l.minY){if(!this.shouldEnd.call(this,{x:t.x,y:t.y,canvasX:t.canvasX,canvasY:t.canvasY,clientX:t.clientX,clientY:t.clientY,item:c}))return;e.emit("beforecreateedge",{}),e.updateItem(this.edge,{target:h.id}),e.emit("aftercreateedge",{edge:this.edge}),r=!1;break}}r&&e.removeItem(this.edge,!1),this.edge=null,this.addingEdge=!1}}},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.key.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.addingEdge&&this.edge&&(this.graph.removeItem(this.edge,!1),this.addingEdge=!1,this.edge=null),this.keydown=!1}}};Object(i.c)(S,(function(t,e){Object(o.o)(e,Object(r.a)(Object(r.a)({},t),M))}))},46:function(t,e,n){"use strict";n(28);var r=n(105);n.o(r,"ICanvas")&&n.d(e,"ICanvas",(function(){return r.ICanvas})),n.o(r,"IGroup")&&n.d(e,"IGroup",(function(){return r.IGroup})),n.o(r,"IShape")&&n.d(e,"IShape",(function(){return r.IShape}));var i=n(106);n.o(i,"ICanvas")&&n.d(e,"ICanvas",(function(){return i.ICanvas})),n.o(i,"IGroup")&&n.d(e,"IGroup",(function(){return i.IGroup})),n.o(i,"IShape")&&n.d(e,"IShape",(function(){return i.IShape}));var o=n(76);n.d(e,"Event",(function(){return o.a}));n(77),n(166),n(108),n(109),n(168),n(39),n(5),n(20),n(78)},47:function(t,e,n){"use strict";n.r(e),n.d(e,"create",(function(){return i})),n.d(e,"clone",(function(){return o})),n.d(e,"fromValues",(function(){return a})),n.d(e,"copy",(function(){return s})),n.d(e,"set",(function(){return u})),n.d(e,"add",(function(){return c})),n.d(e,"subtract",(function(){return h})),n.d(e,"multiply",(function(){return l})),n.d(e,"divide",(function(){return f})),n.d(e,"ceil",(function(){return d})),n.d(e,"floor",(function(){return p})),n.d(e,"min",(function(){return g})),n.d(e,"max",(function(){return v})),n.d(e,"round",(function(){return y})),n.d(e,"scale",(function(){return m})),n.d(e,"scaleAndAdd",(function(){return b})),n.d(e,"distance",(function(){return x})),n.d(e,"squaredDistance",(function(){return w})),n.d(e,"length",(function(){return M})),n.d(e,"squaredLength",(function(){return S})),n.d(e,"negate",(function(){return O})),n.d(e,"inverse",(function(){return k})),n.d(e,"normalize",(function(){return C})),n.d(e,"dot",(function(){return E})),n.d(e,"cross",(function(){return P})),n.d(e,"lerp",(function(){return j})),n.d(e,"random",(function(){return A})),n.d(e,"transformMat2",(function(){return I})),n.d(e,"transformMat2d",(function(){return T})),n.d(e,"transformMat3",(function(){return N})),n.d(e,"transformMat4",(function(){return B})),n.d(e,"rotate",(function(){return _})),n.d(e,"angle",(function(){return L})),n.d(e,"zero",(function(){return D})),n.d(e,"str",(function(){return R})),n.d(e,"exactEquals",(function(){return F})),n.d(e,"equals",(function(){return X})),n.d(e,"len",(function(){return z})),n.d(e,"sub",(function(){return W})),n.d(e,"mul",(function(){return q})),n.d(e,"div",(function(){return G})),n.d(e,"dist",(function(){return V})),n.d(e,"sqrDist",(function(){return H})),n.d(e,"sqrLen",(function(){return U})),n.d(e,"forEach",(function(){return Z}));var r=n(6);function i(){var t=new r.a(2);return r.a!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t){var e=new r.a(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e){var n=new r.a(2);return n[0]=t,n[1]=e,n}function s(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,n){return t[0]=e,t[1]=n,t}function c(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function h(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function l(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function f(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function d(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function p(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function g(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function v(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function y(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function m(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function b(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function x(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function w(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function M(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function S(t){var e=t[0],n=t[1];return e*e+n*n}function O(t,e){return t[0]=-e[0],t[1]=-e[1],t}function k(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function C(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function E(t,e){return t[0]*e[0]+t[1]*e[1]}function P(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function j(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function A(t,e){e=e||1;var n=2*r.c()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function I(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function T(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function N(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function B(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function _(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function L(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function D(t){return t[0]=0,t[1]=0,t}function R(t){return"vec2("+t[0]+", "+t[1]+")"}function F(t,e){return t[0]===e[0]&&t[1]===e[1]}function X(t,e){var n=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=r.b*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=r.b*Math.max(1,Math.abs(i),Math.abs(a))}var Y,z=M,W=h,q=l,G=f,V=x,H=w,U=S,Z=(Y=i(),function(t,e,n,r,i,o){var a,s;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)Y[0]=t[a],Y[1]=t[a+1],i(Y,Y,o),t[a]=Y[0],t[a+1]=Y[1];return t})},48:function(t,e,n){"use strict";var r,i,o,a;function s(t){r||(r=document.createElement("table"),i=document.createElement("tr"),o=/^\s*<(\w+|!)[^>]*>/,a={tr:document.createElement("tbody"),tbody:r,thead:r,tfoot:r,td:i,th:i,"*":document.createElement("div")});var e=o.test(t)&&RegExp.$1;e&&e in a||(e="*");var n=a[e];t=t.replace(/(^\s*)|(\s*$)/g,""),n.innerHTML=""+t;var s=n.childNodes[0];return n.removeChild(s),s}function u(t,e){if(t)for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n]);return t}n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u}))},49:function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=n(207),o=n(211),a=[].slice,s=["keyword","gray","hex"],u={};Object.keys(o).forEach((function(t){u[a.call(o[t].labels).sort().join("")]=t}));var c={};function h(t,e){if(!(this instanceof h))return new h(t,e);if(e&&e in s&&(e=null),e&&!(e in o))throw new Error("Unknown model: "+e);var n,r;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof h)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var l=i.get(t);if(null===l)throw new Error("Unable to parse color from string: "+t);this.model=l.model,r=o[this.model].channels,this.color=l.value.slice(0,r),this.valpha="number"==typeof l.value[r]?l.value[r]:1}else if(t.length){this.model=e||"rgb",r=o[this.model].channels;var f=a.call(t,0,r);this.color=p(f,r),this.valpha="number"==typeof t[r]?t[r]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var d=Object.keys(t);"alpha"in t&&(d.splice(d.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var g=d.sort().join("");if(!(g in u))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=u[g];var v=o[this.model].labels,y=[];for(n=0;n<v.length;n++)y.push(t[v[n]]);this.color=p(y)}if(c[this.model])for(r=o[this.model].channels,n=0;n<r;n++){var m=c[this.model][n];m&&(this.color[n]=m(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function l(t,e,n){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(c[t]||(c[t]=[]))[e]=n})),t=t[0],function(r){var i;return arguments.length?(n&&(r=n(r)),(i=this[t]()).color[e]=r,i):(i=this[t]().color[e],n&&(i=n(i)),i)}}function f(t){return function(e){return Math.max(0,Math.min(t,e))}}function d(t){return Array.isArray(t)?t:[t]}function p(t,e){for(var n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}h.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e=this.model in i.to?this:this.rgb(),n=1===(e=e.round("number"==typeof t?t:1)).valpha?e.color:e.color.concat(this.valpha);return i.to[e.model](n)},percentString:function(t){var e=this.rgb().round("number"==typeof t?t:1),n=1===e.valpha?e.color:e.color.concat(this.valpha);return i.to.rgb.percent(n)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},e=o[this.model].channels,n=o[this.model].labels,r=0;r<e;r++)t[n[r]]=this.color[r];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new h(this.color.map(function(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}(t)).concat(this.valpha),this.model)},alpha:function(t){return arguments.length?new h(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:l("rgb",0,f(255)),green:l("rgb",1,f(255)),blue:l("rgb",2,f(255)),hue:l(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:l("hsl",1,f(100)),lightness:l("hsl",2,f(100)),saturationv:l("hsv",1,f(100)),value:l("hsv",2,f(100)),chroma:l("hcg",1,f(100)),gray:l("hcg",2,f(100)),white:l("hwb",1,f(100)),wblack:l("hwb",2,f(100)),cyan:l("cmyk",0,f(100)),magenta:l("cmyk",1,f(100)),yellow:l("cmyk",2,f(100)),black:l("cmyk",3,f(100)),x:l("xyz",0,f(100)),y:l("xyz",1,f(100)),z:l("xyz",2,f(100)),l:l("lab",0,f(100)),a:l("lab",1),b:l("lab",2),keyword:function(t){return arguments.length?new h(t):o[this.model].keyword(this.color)},hex:function(t){return arguments.length?new h(t):i.to.hex(this.rgb().round().color)},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){for(var t=this.rgb().color,e=[],n=0;n<t.length;n++){var r=t[n]/255;e[n]=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return h.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),n=e.color[0];return n=(n=(n+t)%360)<0?360+n:n,e.color[0]=n,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+r(t));var n=t.rgb(),i=this.rgb(),o=void 0===e?.5:e,a=2*o-1,s=n.alpha()-i.alpha(),u=((a*s==-1?a:(a+s)/(1+a*s))+1)/2,c=1-u;return h.rgb(u*n.red()+c*i.red(),u*n.green()+c*i.green(),u*n.blue()+c*i.blue(),n.alpha()*o+i.alpha()*(1-o))}},Object.keys(o).forEach((function(t){if(-1===s.indexOf(t)){var e=o[t].channels;h.prototype[t]=function(){if(this.model===t)return new h(this);if(arguments.length)return new h(arguments,t);var n="number"==typeof arguments[e]?e:this.valpha;return new h(d(o[this.model][t].raw(this.color)).concat(n),t)},h[t]=function(n){return"number"==typeof n&&(n=p(a.call(arguments),e)),new h(n,t)}}})),t.exports=h},5:function(t,e,n){"use strict";n.d(e,"j",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"g",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(0);function i(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}n.d(e,"e",(function(){return r.j})),n.d(e,"d",(function(){return r.i})),n.d(e,"h",(function(){return r.o})),n.d(e,"f",(function(){return r.m})),n.d(e,"i",(function(){return r.r})),n.d(e,"a",(function(){return r.c})),n.d(e,"k",(function(){return r.w}));var o="undefined"!=typeof window&&void 0!==window.document;function a(t,e){if(t.isCanvas())return!0;for(var n=e.getParent(),r=!1;n;){if(n===t){r=!0;break}n=n.getParent()}return r}function s(t){return t.cfg.visible&&t.cfg.capture}},56:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.getLayoutByName=e.unRegisterLayout=e.registerLayout=void 0;var o=n(7),a=n(10),s=new Map;e.registerLayout=function(t,e){if(s.get(t)&&console.warn("The layout with the name "+t+" exists already, it will be overridden"),a.isObject(e)){var n=function(t){function n(n){var r=t.call(this)||this,i=r,o={},a=i.getDefaultCfg();return Object.assign(o,a,e,n),Object.keys(o).forEach((function(t){var e=o[t];i[t]=e})),r}return i(n,t),n}(o.Base);s.set(t,n)}else s.set(t,e)};e.unRegisterLayout=function(t){s.has(t)&&s.delete(t)};e.getLayoutByName=function(t){return s.has(t)?s.get(t):null}},57:function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.RandomLayout=void 0;var o=function(t){function e(e){var n=t.call(this)||this;return n.center=[0,0],n.width=300,n.height=300,n.nodes=[],n.edges=[],n.onLayoutEnd=function(){},n.updateCfg(e),n}return i(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,n=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach((function(e){e.x=.9*(Math.random()-.5)*t.width+n[0],e.y=.9*(Math.random()-.5)*t.height+n[1]})),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(n(7).Base);e.RandomLayout=o},6:function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}));var r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},7:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Base=void 0;var r=function(){function t(){this.nodes=[],this.edges=[],this.combos=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return t.prototype.layout=function(t){return this.init(t),this.execute(!0)},t.prototype.init=function(t){this.nodes=t.nodes||[],this.edges=t.edges||[],this.combos=t.combos||[]},t.prototype.execute=function(t){},t.prototype.executeWithWorker=function(){},t.prototype.getDefaultCfg=function(){return{}},t.prototype.updateCfg=function(t){t&&Object.assign(this,t)},t.prototype.getType=function(){return"base"},t.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},t}();e.Base=r},76:function(t,e,n){"use strict";var r=function(){function t(t,e){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=e,this.timeStamp=e.timeStamp}return t.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.toString=function(){return"[Event (type="+this.type+")]"},t.prototype.save=function(){},t.prototype.restore=function(){},t}();e.a=r},77:function(t,e,n){"use strict";var r=n(1),i=n(79),o=n(5),a=function(t){function e(e){var n=t.call(this)||this;n.destroyed=!1;var r=n.getDefaultCfg();return n.cfg=Object(o.i)(r,e),n}return Object(r.c)(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,e){this.cfg[t]=e},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(i.a);e.a=a},78:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=null;function i(){if(!r){var t=document.createElement("canvas");t.width=1,t.height=1,r=t.getContext("2d")}return r}},79:function(t,e,n){"use strict";var r=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0),this},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}();e.a=r},8:function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return R})),n.d(e,"c",(function(){return i}));var r={};n.r(r),n.d(r,"create",(function(){return a})),n.d(r,"fromMat4",(function(){return s})),n.d(r,"clone",(function(){return u})),n.d(r,"copy",(function(){return c})),n.d(r,"fromValues",(function(){return h})),n.d(r,"set",(function(){return l})),n.d(r,"identity",(function(){return f})),n.d(r,"transpose",(function(){return d})),n.d(r,"invert",(function(){return p})),n.d(r,"adjoint",(function(){return g})),n.d(r,"determinant",(function(){return v})),n.d(r,"multiply",(function(){return y})),n.d(r,"translate",(function(){return m})),n.d(r,"rotate",(function(){return b})),n.d(r,"scale",(function(){return x})),n.d(r,"fromTranslation",(function(){return w})),n.d(r,"fromRotation",(function(){return M})),n.d(r,"fromScaling",(function(){return S})),n.d(r,"fromMat2d",(function(){return O})),n.d(r,"fromQuat",(function(){return k})),n.d(r,"normalFromMat4",(function(){return C})),n.d(r,"projection",(function(){return E})),n.d(r,"str",(function(){return P})),n.d(r,"frob",(function(){return j})),n.d(r,"add",(function(){return A})),n.d(r,"subtract",(function(){return I})),n.d(r,"multiplyScalar",(function(){return T})),n.d(r,"multiplyScalarAndAdd",(function(){return N})),n.d(r,"exactEquals",(function(){return B})),n.d(r,"equals",(function(){return _})),n.d(r,"mul",(function(){return L})),n.d(r,"sub",(function(){return D}));var i={};n.r(i),n.d(i,"create",(function(){return F})),n.d(i,"clone",(function(){return X})),n.d(i,"length",(function(){return Y})),n.d(i,"fromValues",(function(){return z})),n.d(i,"copy",(function(){return W})),n.d(i,"set",(function(){return q})),n.d(i,"add",(function(){return G})),n.d(i,"subtract",(function(){return V})),n.d(i,"multiply",(function(){return H})),n.d(i,"divide",(function(){return U})),n.d(i,"ceil",(function(){return Z})),n.d(i,"floor",(function(){return Q})),n.d(i,"min",(function(){return K})),n.d(i,"max",(function(){return $})),n.d(i,"round",(function(){return J})),n.d(i,"scale",(function(){return tt})),n.d(i,"scaleAndAdd",(function(){return et})),n.d(i,"distance",(function(){return nt})),n.d(i,"squaredDistance",(function(){return rt})),n.d(i,"squaredLength",(function(){return it})),n.d(i,"negate",(function(){return ot})),n.d(i,"inverse",(function(){return at})),n.d(i,"normalize",(function(){return st})),n.d(i,"dot",(function(){return ut})),n.d(i,"cross",(function(){return ct})),n.d(i,"lerp",(function(){return ht})),n.d(i,"hermite",(function(){return lt})),n.d(i,"bezier",(function(){return ft})),n.d(i,"random",(function(){return dt})),n.d(i,"transformMat4",(function(){return pt})),n.d(i,"transformMat3",(function(){return gt})),n.d(i,"transformQuat",(function(){return vt})),n.d(i,"rotateX",(function(){return yt})),n.d(i,"rotateY",(function(){return mt})),n.d(i,"rotateZ",(function(){return bt})),n.d(i,"angle",(function(){return xt})),n.d(i,"zero",(function(){return wt})),n.d(i,"str",(function(){return Mt})),n.d(i,"exactEquals",(function(){return St})),n.d(i,"equals",(function(){return Ot})),n.d(i,"sub",(function(){return Ct})),n.d(i,"mul",(function(){return Et})),n.d(i,"div",(function(){return Pt})),n.d(i,"dist",(function(){return jt})),n.d(i,"sqrDist",(function(){return At})),n.d(i,"len",(function(){return It})),n.d(i,"sqrLen",(function(){return Tt})),n.d(i,"forEach",(function(){return Nt}));var o=n(6);function a(){var t=new o.a(9);return o.a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function u(t){var e=new o.a(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function h(t,e,n,r,i,a,s,u,c){var h=new o.a(9);return h[0]=t,h[1]=e,h[2]=n,h[3]=r,h[4]=i,h[5]=a,h[6]=s,h[7]=u,h[8]=c,h}function l(t,e,n,r,i,o,a,s,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t}function f(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function d(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function p(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8],l=h*a-s*c,f=-h*o+s*u,d=c*o-a*u,p=n*l+r*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-h*r+i*c)*p,t[2]=(s*r-i*a)*p,t[3]=f*p,t[4]=(h*n-i*u)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-c*n+r*u)*p,t[8]=(a*n-r*o)*p,t):null}function g(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8];return t[0]=a*h-s*c,t[1]=i*c-r*h,t[2]=r*s-i*a,t[3]=s*u-o*h,t[4]=n*h-i*u,t[5]=i*o-n*s,t[6]=o*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*o,t}function v(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+n*(-c*i+a*s)+r*(u*i-o*s)}function y(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=n[0],d=n[1],p=n[2],g=n[3],v=n[4],y=n[5],m=n[6],b=n[7],x=n[8];return t[0]=f*r+d*a+p*c,t[1]=f*i+d*s+p*h,t[2]=f*o+d*u+p*l,t[3]=g*r+v*a+y*c,t[4]=g*i+v*s+y*h,t[5]=g*o+v*u+y*l,t[6]=m*r+b*a+x*c,t[7]=m*i+b*s+x*h,t[8]=m*o+b*u+x*l,t}function m(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=f*r+d*a+c,t[7]=f*i+d*s+h,t[8]=f*o+d*u+l,t}function b(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=Math.sin(n),d=Math.cos(n);return t[0]=d*r+f*a,t[1]=d*i+f*s,t[2]=d*o+f*u,t[3]=d*a-f*r,t[4]=d*s-f*i,t[5]=d*u-f*o,t[6]=c,t[7]=h,t[8]=l,t}function x(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function w(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function M(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function S(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function O(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function k(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,h=r*a,l=r*s,f=i*a,d=i*s,p=i*u,g=o*a,v=o*s,y=o*u;return t[0]=1-l-p,t[3]=h-y,t[6]=f+v,t[1]=h+y,t[4]=1-c-p,t[7]=d-g,t[2]=f-v,t[5]=d+g,t[8]=1-c-l,t}function C(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=n*s-r*a,b=n*u-i*a,x=n*c-o*a,w=r*u-i*s,M=r*c-o*s,S=i*c-o*u,O=h*g-l*p,k=h*v-f*p,C=h*y-d*p,E=l*v-f*g,P=l*y-d*g,j=f*y-d*v,A=m*j-b*P+x*E+w*C-M*k+S*O;return A?(A=1/A,t[0]=(s*j-u*P+c*E)*A,t[1]=(u*C-a*j-c*k)*A,t[2]=(a*P-s*C+c*O)*A,t[3]=(i*P-r*j-o*E)*A,t[4]=(n*j-i*C+o*k)*A,t[5]=(r*C-n*P-o*O)*A,t[6]=(g*S-v*M+y*w)*A,t[7]=(v*x-p*S-y*b)*A,t[8]=(p*M-g*x+y*m)*A,t):null}function E(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function P(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function j(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function A(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function I(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function T(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function N(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function B(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function _(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],s=t[4],u=t[5],c=t[6],h=t[7],l=t[8],f=e[0],d=e[1],p=e[2],g=e[3],v=e[4],y=e[5],m=e[6],b=e[7],x=e[8];return Math.abs(n-f)<=o.b*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-d)<=o.b*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(i-p)<=o.b*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(a-g)<=o.b*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-v)<=o.b*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-y)<=o.b*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=o.b*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(h-b)<=o.b*Math.max(1,Math.abs(h),Math.abs(b))&&Math.abs(l-x)<=o.b*Math.max(1,Math.abs(l),Math.abs(x))}var L=y,D=I,R=n(47);function F(){var t=new o.a(3);return o.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function X(t){var e=new o.a(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Y(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function z(t,e,n){var r=new o.a(3);return r[0]=t,r[1]=e,r[2]=n,r}function W(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function q(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function G(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function V(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function H(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function U(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function Z(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Q(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function K(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function $(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function J(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function tt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function et(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function nt(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function rt(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function it(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function ot(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function at(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function st(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function ut(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ct(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function ht(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function lt(t,e,n,r,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,c=a*(o-1),h=a*(3-2*o);return t[0]=e[0]*s+n[0]*u+r[0]*c+i[0]*h,t[1]=e[1]*s+n[1]*u+r[1]*c+i[1]*h,t[2]=e[2]*s+n[2]*u+r[2]*c+i[2]*h,t}function ft(t,e,n,r,i,o){var a=1-o,s=a*a,u=o*o,c=s*a,h=3*o*s,l=3*u*a,f=u*o;return t[0]=e[0]*c+n[0]*h+r[0]*l+i[0]*f,t[1]=e[1]*c+n[1]*h+r[1]*l+i[1]*f,t[2]=e[2]*c+n[2]*h+r[2]*l+i[2]*f,t}function dt(t,e){e=e||1;var n=2*o.c()*Math.PI,r=2*o.c()-1,i=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*i,t[1]=Math.sin(n)*i,t[2]=r*e,t}function pt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function gt(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function vt(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],c=e[2],h=i*c-o*u,l=o*s-r*c,f=r*u-i*s,d=i*f-o*l,p=o*h-r*f,g=r*l-i*h,v=2*a;return h*=v,l*=v,f*=v,d*=2,p*=2,g*=2,t[0]=s+h+d,t[1]=u+l+p,t[2]=c+f+g,t}function yt(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function mt(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function bt(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function xt(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),c=u&&ut(t,e)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function wt(t){return t[0]=0,t[1]=0,t[2]=0,t}function Mt(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function St(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Ot(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(n-a)<=o.b*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=o.b*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-u)<=o.b*Math.max(1,Math.abs(i),Math.abs(u))}var kt,Ct=V,Et=H,Pt=U,jt=nt,At=rt,It=Y,Tt=it,Nt=(kt=F(),function(t,e,n,r,i,o){var a,s;for(e||(e=3),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)kt[0]=t[a],kt[1]=t[a+1],kt[2]=t[a+2],i(kt,kt,o),t[a]=kt[0],t[a+1]=kt[1],t[a+2]=kt[2];return t})},80:function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(81),a=n(5),s={};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.c)(e,t),e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,o=[],s=[],u=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return u.length>0?(Object(a.a)(u,(function(t){var e=t.getBBox();o.push(e.minX,e.maxX),s.push(e.minY,e.maxY)})),t=Object(i.q)(o),e=Object(i.p)(o),n=Object(i.q)(s),r=Object(i.p)(s)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,o=[],s=[],u=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return u.length>0?(Object(a.a)(u,(function(t){var e=t.getCanvasBBox();o.push(e.minX,e.maxX),s.push(e.minY,e.maxY)})),t=Object(i.q)(o),e=Object(i.p)(o),n=Object(i.q)(s),r=Object(i.p)(s)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,n,r){if(t.prototype.onAttrChange.call(this,e,n,r),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var r=this.getTotalMatrix();r!==n&&this._applyChildrenMarix(r)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();Object(a.a)(e,(function(e){e.applyMatrix(t)}))},e.prototype.addShape=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],r=t[1];Object(a.f)(n)?r=n:r.type=n;var i=s[r.type];i||(i=Object(a.k)(r.type),s[r.type]=i);var o=this.getShapeBase(),u=new o[i](r);return this.add(u),u},e.prototype.addGroup=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=t[0],i=t[1];if(Object(a.d)(r))n=new r(i||{parent:this});else{var o=r||{},s=this.getGroupBase();n=new s(o)}return this.add(n),n},e.prototype.getCanvas=function(){return this.isCanvas()?this:this.get("canvas")},e.prototype.getShape=function(t,e,n){if(!Object(a.b)(this))return null;var r,i=this.getChildren();if(this.isCanvas())r=this._findShape(i,t,e,n);else{var o=[t,e,1];o=this.invertFromMatrix(o),this.isClipped(o[0],o[1])||(r=this._findShape(i,o[0],o[1],n))}return r},e.prototype._findShape=function(t,e,n,r){for(var i=null,o=t.length-1;o>=0;o--){var s=t[o];if(Object(a.b)(s)&&(s.isGroup()?i=s.getShape(e,n,r):s.isHit(e,n)&&(i=s)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),r=this.get("timeline"),i=t.getParent();i&&function(t,e,n){void 0===n&&(n=!0),n?e.destroy():(e.set("parent",null),e.set("canvas",null)),Object(a.j)(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&function t(e,n){if(e.set("canvas",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,e),r&&function t(e,n){if(e.set("timeline",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,r),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t,e=this.getChildren();Object(a.a)(e,(function(t,e){return t._INDEX=e,t})),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,n){var r=t(e,n);return 0===r?e._INDEX-n._INDEX:r})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],n=this.getChildren();return Object(a.a)(n,(function(n){t(n)&&e.push(n),n.isGroup()&&(e=e.concat(n.findAll(t)))})),e},e.prototype.find=function(t){var e=null,n=this.getChildren();return Object(a.a)(n,(function(n){if(t(n)?e=n:n.isGroup()&&(e=n.find(t)),e)return!1})),e},e.prototype.findById=function(t){return this.find((function(e){return e.get("id")===t}))},e.prototype.findByClassName=function(t){return this.find((function(e){return e.get("className")===t}))},e.prototype.findAllByName=function(t){return this.findAll((function(e){return e.get("name")===t}))},e}(o.a);e.a=u},81:function(t,e,n){"use strict";var r=n(1),i=n(0),o=n(4),a=n(5),s=n(20),u=n(77),c=o.a.transform,h=["zIndex","capture","visible","type"],l=["repeat"];function f(t,e){var n={},r=e.attrs;for(var i in t)n[i]=r[i];return n}function d(t,e){var n={},r=e.attr();return Object(i.c)(t,(function(t,e){-1!==l.indexOf(e)||Object(i.h)(r[e],t)||(n[e]=t)})),n}function p(t,e){if(e.onFrame)return t;var n=e.startTime,r=e.delay,o=e.duration,a=Object.prototype.hasOwnProperty;return Object(i.c)(t,(function(t){n+r<t.startTime+t.delay+t.duration&&o>t.delay&&Object(i.c)(e.toAttrs,(function(e,n){a.call(t.toAttrs,n)&&(delete t.toAttrs[n],delete t.fromAttrs[n])}))})),t}var g=function(t){function e(e){var n=t.call(this,e)||this;n.attrs={};var r=n.getDefaultAttrs();return Object(i.r)(r,e.attrs),n.attrs=r,n.initAttrs(r),n.initAnimate(),n}return Object(r.c)(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],o=e[1];if(!r)return this.attrs;if(Object(i.m)(r)){for(var a in r)this.setAttr(a,r[a]);return this.afterAttrsChange(r),this}return 2===e.length?(this.setAttr(r,o),this.afterAttrsChange(((t={})[r]=o,t)),this):this.attrs[r]},e.prototype.isClipped=function(t,e){var n=this.getClip();return n&&!n.isHit(t,e)},e.prototype.setAttr=function(t,e){var n=this.attrs[t];n!==e&&(this.attrs[t]=e,this.onAttrChange(t,e,n))},e.prototype.onAttrChange=function(t,e,n){"matrix"===t&&this.set("totalMatrix",null)},e.prototype.afterAttrsChange=function(t){if(this.cfg.isClipShape){var e=this.cfg.applyTo;e&&e.onCanvasChange("clip")}else this.onCanvasChange("attr")},e.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},e.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},e.prototype.setZIndex=function(t){this.set("zIndex",t);var e=this.getParent();return e&&e.sort(),this},e.prototype.toFront=function(){var t=this.getParent();if(t){var e=t.getChildren(),n=(this.get("el"),e.indexOf(this));e.splice(n,1),e.push(this),this.onCanvasChange("zIndex")}},e.prototype.toBack=function(){var t=this.getParent();if(t){var e=t.getChildren(),n=(this.get("el"),e.indexOf(this));e.splice(n,1),e.unshift(this),this.onCanvasChange("zIndex")}},e.prototype.remove=function(t){void 0===t&&(t=!0);var e=this.getParent();e?(Object(a.j)(e.getChildren(),this),e.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),t&&this.destroy()},e.prototype.resetMatrix=function(){this.attr("matrix",this.getDefaultMatrix()),this.onCanvasChange("matrix")},e.prototype.getMatrix=function(){return this.attr("matrix")},e.prototype.setMatrix=function(t){this.attr("matrix",t),this.onCanvasChange("matrix")},e.prototype.getTotalMatrix=function(){var t=this.cfg.totalMatrix;if(!t){var e=this.attr("matrix"),n=this.cfg.parentMatrix;t=n&&e?Object(s.b)(n,e):e||n,this.set("totalMatrix",t)}return t},e.prototype.applyMatrix=function(t){var e=this.attr("matrix"),n=null;n=t&&e?Object(s.b)(t,e):e||t,this.set("totalMatrix",n),this.set("parentMatrix",t)},e.prototype.getDefaultMatrix=function(){return null},e.prototype.applyToMatrix=function(t){var e=this.attr("matrix");return e?Object(s.c)(e,t):t},e.prototype.invertFromMatrix=function(t){var e=this.attr("matrix");if(e){var n=Object(s.a)(e);if(n)return Object(s.c)(n,t)}return t},e.prototype.setClip=function(t){var e=this.getCanvas(),n=null;if(t){var r=this.getShapeBase()[Object(i.w)(t.type)];r&&(n=new r({type:t.type,isClipShape:!0,applyTo:this,attrs:t.attrs,canvas:e}))}return this.set("clipShape",n),this.onCanvasChange("clip"),n},e.prototype.getClip=function(){var t=this.cfg.clipShape;return t||null},e.prototype.clone=function(){var t=this,e=this.attrs,n={};Object(i.c)(e,(function(t,r){Object(i.f)(e[r])?n[r]=function(t){for(var e=[],n=0;n<t.length;n++)Object(i.f)(t[n])?e.push([].concat(t[n])):e.push(t[n]);return e}(e[r]):n[r]=e[r]}));var r=new(0,this.constructor)({attrs:n});return Object(i.c)(h,(function(e){r.set(e,t.get(e))})),r},e.prototype.destroy=function(){this.destroyed||(this.attrs={},t.prototype.destroy.call(this))},e.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},e.prototype.animate=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(this.get("timeline")||this.get("canvas")){this.set("animating",!0);var n=this.get("timeline");n||(n=this.get("canvas").get("timeline"),this.set("timeline",n));var r=this.get("animations")||[];n.timer||n.initTimer();var o,a,s,u,c,h=t[0],l=t[1],g=t[2],v=void 0===g?"easeLinear":g,y=t[3],m=void 0===y?i.t:y,b=t[4],x=void 0===b?0:b;Object(i.i)(h)?(o=h,h={}):Object(i.m)(h)&&h.onFrame&&(o=h.onFrame,a=h.repeat),Object(i.m)(l)?(l=(c=l).duration,v=c.easing||"easeLinear",x=c.delay||0,a=c.repeat||a||!1,m=c.callback||i.t,s=c.pauseCallback||i.t,u=c.resumeCallback||i.t):(Object(i.k)(m)&&(x=m,m=null),Object(i.i)(v)?(m=v,v="easeLinear"):v=v||"easeLinear");var w=d(h,this),M={fromAttrs:f(w,this),toAttrs:w,duration:l,easing:v,repeat:a,callback:m,pauseCallback:s,resumeCallback:u,delay:x,startTime:n.getTime(),id:Object(i.v)(),onFrame:o,pathFormatted:!1};r.length>0?r=p(r,M):n.addAnimator(this),r.push(M),this.set("animations",r),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var n=this.get("animations");Object(i.c)(n,(function(n){t&&(n.onFrame?e.attr(n.onFrame(1)):e.attr(n.toAttrs)),n.callback&&n.callback()})),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return Object(i.c)(e,(function(t){t._paused=!0,t._pauseTime=n,t.pauseCallback&&t.pauseCallback()})),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),n=this.get("_pause").pauseTime;return Object(i.c)(e,(function(e){e.startTime=e.startTime+(t-n),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()})),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var n,r=this,o=e.propagationPath;this.getEvents();"mouseenter"===t?n=e.fromShape:"mouseleave"===t&&(n=e.toShape);for(var s=function(t){var s=o[t],c=s.get("name");if(c){if((s.isGroup()||s.isCanvas&&s.isCanvas())&&n&&Object(a.g)(s,n))return"break";Object(i.f)(c)?Object(i.c)(c,(function(t){r.emitDelegateEvent(s,t,e)})):u.emitDelegateEvent(s,c,e)}},u=this,c=0;c<o.length;c++){if("break"===s(c))break}},e.prototype.emitDelegateEvent=function(t,e,n){var r=this.getEvents(),i=e+":"+n.type;(r[i]||r["*"])&&(n.name=i,n.currentTarget=t,n.delegateTarget=this,n.delegateObject=t.get("delegateObject"),this.emit(i,n))},e.prototype.translate=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var n=this.getMatrix(),r=c(n,[["t",t,e]]);return this.setMatrix(r),this},e.prototype.move=function(t,e){var n=this.attr("x")||0,r=this.attr("y")||0;return this.translate(t-n,e-r),this},e.prototype.moveTo=function(t,e){return this.move(t,e)},e.prototype.scale=function(t,e){var n=this.getMatrix(),r=c(n,[["s",t,e||t]]);return this.setMatrix(r),this},e.prototype.rotate=function(t){var e=this.getMatrix(),n=c(e,[["r",t]]);return this.setMatrix(n),this},e.prototype.rotateAtStart=function(t){var e=this.attr(),n=e.x,r=e.y,i=this.getMatrix(),o=c(i,[["t",-n,-r],["r",t],["t",n,r]]);return this.setMatrix(o),this},e.prototype.rotateAtPoint=function(t,e,n){var r=this.getMatrix(),i=c(r,[["t",-t,-e],["r",n],["t",t,e]]);return this.setMatrix(i),this},e}(u.a);e.a=g},82:function(t,e,n){"use strict";n.d(e,"b",(function(){return Fu}));var r={};n.r(r),n.d(r,"catmullRomToBezier",(function(){return M})),n.d(r,"fillPath",(function(){return q})),n.d(r,"fillPathByDiff",(function(){return H})),n.d(r,"formatPath",(function(){return Q})),n.d(r,"intersection",(function(){return Y})),n.d(r,"parsePathArray",(function(){return A})),n.d(r,"parsePathString",(function(){return w})),n.d(r,"pathToAbsolute",(function(){return O})),n.d(r,"pathToCurve",(function(){return P})),n.d(r,"rectPath",(function(){return L}));var i={};n.r(i),n.d(i,"create",(function(){return ct})),n.d(i,"fromMat4",(function(){return ht})),n.d(i,"clone",(function(){return lt})),n.d(i,"copy",(function(){return ft})),n.d(i,"fromValues",(function(){return dt})),n.d(i,"set",(function(){return pt})),n.d(i,"identity",(function(){return gt})),n.d(i,"transpose",(function(){return vt})),n.d(i,"invert",(function(){return yt})),n.d(i,"adjoint",(function(){return mt})),n.d(i,"determinant",(function(){return bt})),n.d(i,"multiply",(function(){return xt})),n.d(i,"translate",(function(){return wt})),n.d(i,"rotate",(function(){return Mt})),n.d(i,"scale",(function(){return St})),n.d(i,"fromTranslation",(function(){return Ot})),n.d(i,"fromRotation",(function(){return kt})),n.d(i,"fromScaling",(function(){return Ct})),n.d(i,"fromMat2d",(function(){return Et})),n.d(i,"fromQuat",(function(){return Pt})),n.d(i,"normalFromMat4",(function(){return jt})),n.d(i,"projection",(function(){return At})),n.d(i,"str",(function(){return It})),n.d(i,"frob",(function(){return Tt})),n.d(i,"add",(function(){return Nt})),n.d(i,"subtract",(function(){return Bt})),n.d(i,"multiplyScalar",(function(){return _t})),n.d(i,"multiplyScalarAndAdd",(function(){return Lt})),n.d(i,"exactEquals",(function(){return Dt})),n.d(i,"equals",(function(){return Rt})),n.d(i,"mul",(function(){return Ft})),n.d(i,"sub",(function(){return Xt}));var o={};n.r(o),n.d(o,"create",(function(){return Yt})),n.d(o,"clone",(function(){return zt})),n.d(o,"fromValues",(function(){return Wt})),n.d(o,"copy",(function(){return qt})),n.d(o,"set",(function(){return Gt})),n.d(o,"add",(function(){return Vt})),n.d(o,"subtract",(function(){return Ht})),n.d(o,"multiply",(function(){return Ut})),n.d(o,"divide",(function(){return Zt})),n.d(o,"ceil",(function(){return Qt})),n.d(o,"floor",(function(){return Kt})),n.d(o,"min",(function(){return $t})),n.d(o,"max",(function(){return Jt})),n.d(o,"round",(function(){return te})),n.d(o,"scale",(function(){return ee})),n.d(o,"scaleAndAdd",(function(){return ne})),n.d(o,"distance",(function(){return re})),n.d(o,"squaredDistance",(function(){return ie})),n.d(o,"length",(function(){return oe})),n.d(o,"squaredLength",(function(){return ae})),n.d(o,"negate",(function(){return se})),n.d(o,"inverse",(function(){return ue})),n.d(o,"normalize",(function(){return ce})),n.d(o,"dot",(function(){return he})),n.d(o,"cross",(function(){return le})),n.d(o,"lerp",(function(){return fe})),n.d(o,"random",(function(){return de})),n.d(o,"transformMat2",(function(){return pe})),n.d(o,"transformMat2d",(function(){return ge})),n.d(o,"transformMat3",(function(){return ve})),n.d(o,"transformMat4",(function(){return ye})),n.d(o,"rotate",(function(){return me})),n.d(o,"angle",(function(){return be})),n.d(o,"zero",(function(){return xe})),n.d(o,"str",(function(){return we})),n.d(o,"exactEquals",(function(){return Me})),n.d(o,"equals",(function(){return Se})),n.d(o,"len",(function(){return ke})),n.d(o,"sub",(function(){return Ce})),n.d(o,"mul",(function(){return Ee})),n.d(o,"div",(function(){return Pe})),n.d(o,"dist",(function(){return je})),n.d(o,"sqrDist",(function(){return Ae})),n.d(o,"sqrLen",(function(){return Ie})),n.d(o,"forEach",(function(){return Te}));var a={};n.r(a),n.d(a,"leftTranslate",(function(){return Ne})),n.d(a,"leftRotate",(function(){return Be})),n.d(a,"leftScale",(function(){return _e})),n.d(a,"transform",(function(){return Le})),n.d(a,"direction",(function(){return De})),n.d(a,"angleTo",(function(){return Re})),n.d(a,"vertical",(function(){return Fe}));var s={};n.r(s),n.d(s,"easeLinear",(function(){return yn})),n.d(s,"easeQuad",(function(){return xn})),n.d(s,"easeQuadIn",(function(){return mn})),n.d(s,"easeQuadOut",(function(){return bn})),n.d(s,"easeQuadInOut",(function(){return xn})),n.d(s,"easeCubic",(function(){return Sn})),n.d(s,"easeCubicIn",(function(){return wn})),n.d(s,"easeCubicOut",(function(){return Mn})),n.d(s,"easeCubicInOut",(function(){return Sn})),n.d(s,"easePoly",(function(){return Cn})),n.d(s,"easePolyIn",(function(){return On})),n.d(s,"easePolyOut",(function(){return kn})),n.d(s,"easePolyInOut",(function(){return Cn})),n.d(s,"easeSin",(function(){return In})),n.d(s,"easeSinIn",(function(){return jn})),n.d(s,"easeSinOut",(function(){return An})),n.d(s,"easeSinInOut",(function(){return In})),n.d(s,"easeExp",(function(){return _n})),n.d(s,"easeExpIn",(function(){return Nn})),n.d(s,"easeExpOut",(function(){return Bn})),n.d(s,"easeExpInOut",(function(){return _n})),n.d(s,"easeCircle",(function(){return Rn})),n.d(s,"easeCircleIn",(function(){return Ln})),n.d(s,"easeCircleOut",(function(){return Dn})),n.d(s,"easeCircleInOut",(function(){return Rn})),n.d(s,"easeBounce",(function(){return Xn})),n.d(s,"easeBounceIn",(function(){return Fn})),n.d(s,"easeBounceOut",(function(){return Xn})),n.d(s,"easeBounceInOut",(function(){return Yn})),n.d(s,"easeBack",(function(){return qn})),n.d(s,"easeBackIn",(function(){return zn})),n.d(s,"easeBackOut",(function(){return Wn})),n.d(s,"easeBackInOut",(function(){return qn})),n.d(s,"easeElastic",(function(){return Hn})),n.d(s,"easeElasticIn",(function(){return Vn})),n.d(s,"easeElasticOut",(function(){return Hn})),n.d(s,"easeElasticInOut",(function(){return Un}));var u={};n.r(u),n.d(u,"distance",(function(){return vi})),n.d(u,"isNumberEqual",(function(){return yi})),n.d(u,"getBBoxByArray",(function(){return mi})),n.d(u,"getBBoxRange",(function(){return bi})),n.d(u,"piMod",(function(){return xi}));var c={};n.r(c),n.d(c,"create",(function(){return Ea})),n.d(c,"fromMat4",(function(){return Pa})),n.d(c,"clone",(function(){return ja})),n.d(c,"copy",(function(){return Aa})),n.d(c,"fromValues",(function(){return Ia})),n.d(c,"set",(function(){return Ta})),n.d(c,"identity",(function(){return Na})),n.d(c,"transpose",(function(){return Ba})),n.d(c,"invert",(function(){return _a})),n.d(c,"adjoint",(function(){return La})),n.d(c,"determinant",(function(){return Da})),n.d(c,"multiply",(function(){return Ra})),n.d(c,"translate",(function(){return Fa})),n.d(c,"rotate",(function(){return Xa})),n.d(c,"scale",(function(){return Ya})),n.d(c,"fromTranslation",(function(){return za})),n.d(c,"fromRotation",(function(){return Wa})),n.d(c,"fromScaling",(function(){return qa})),n.d(c,"fromMat2d",(function(){return Ga})),n.d(c,"fromQuat",(function(){return Va})),n.d(c,"normalFromMat4",(function(){return Ha})),n.d(c,"projection",(function(){return Ua})),n.d(c,"str",(function(){return Za})),n.d(c,"frob",(function(){return Qa})),n.d(c,"add",(function(){return Ka})),n.d(c,"subtract",(function(){return $a})),n.d(c,"multiplyScalar",(function(){return Ja})),n.d(c,"multiplyScalarAndAdd",(function(){return ts})),n.d(c,"exactEquals",(function(){return es})),n.d(c,"equals",(function(){return ns})),n.d(c,"mul",(function(){return rs})),n.d(c,"sub",(function(){return is}));var h={};n.r(h),n.d(h,"create",(function(){return os})),n.d(h,"clone",(function(){return as})),n.d(h,"fromValues",(function(){return ss})),n.d(h,"copy",(function(){return us})),n.d(h,"set",(function(){return cs})),n.d(h,"add",(function(){return hs})),n.d(h,"subtract",(function(){return ls})),n.d(h,"multiply",(function(){return fs})),n.d(h,"divide",(function(){return ds})),n.d(h,"ceil",(function(){return ps})),n.d(h,"floor",(function(){return gs})),n.d(h,"min",(function(){return vs})),n.d(h,"max",(function(){return ys})),n.d(h,"round",(function(){return ms})),n.d(h,"scale",(function(){return bs})),n.d(h,"scaleAndAdd",(function(){return xs})),n.d(h,"distance",(function(){return ws})),n.d(h,"squaredDistance",(function(){return Ms})),n.d(h,"length",(function(){return Ss})),n.d(h,"squaredLength",(function(){return Os})),n.d(h,"negate",(function(){return ks})),n.d(h,"inverse",(function(){return Cs})),n.d(h,"normalize",(function(){return Es})),n.d(h,"dot",(function(){return Ps})),n.d(h,"cross",(function(){return js})),n.d(h,"lerp",(function(){return As})),n.d(h,"random",(function(){return Is})),n.d(h,"transformMat2",(function(){return Ts})),n.d(h,"transformMat2d",(function(){return Ns})),n.d(h,"transformMat3",(function(){return Bs})),n.d(h,"transformMat4",(function(){return _s})),n.d(h,"rotate",(function(){return Ls})),n.d(h,"angle",(function(){return Ds})),n.d(h,"zero",(function(){return Rs})),n.d(h,"str",(function(){return Fs})),n.d(h,"exactEquals",(function(){return Xs})),n.d(h,"equals",(function(){return Ys})),n.d(h,"len",(function(){return zs})),n.d(h,"sub",(function(){return Ws})),n.d(h,"mul",(function(){return qs})),n.d(h,"div",(function(){return Gs})),n.d(h,"dist",(function(){return Vs})),n.d(h,"sqrDist",(function(){return Hs})),n.d(h,"sqrLen",(function(){return Us})),n.d(h,"forEach",(function(){return Zs}));var l={};n.r(l),n.d(l,"leftTranslate",(function(){return Qs})),n.d(l,"leftRotate",(function(){return Ks})),n.d(l,"leftScale",(function(){return $s})),n.d(l,"transform",(function(){return Js})),n.d(l,"direction",(function(){return tu})),n.d(l,"angleTo",(function(){return eu})),n.d(l,"vertical",(function(){return nu}));var f={};n.r(f),n.d(f,"Base",(function(){return Ko})),n.d(f,"Circle",(function(){return $o})),n.d(f,"Ellipse",(function(){return ta})),n.d(f,"Image",(function(){return ra})),n.d(f,"Line",(function(){return oa})),n.d(f,"Marker",(function(){return wa})),n.d(f,"Path",(function(){return uu})),n.d(f,"Polygon",(function(){return hu})),n.d(f,"Polyline",(function(){return lu})),n.d(f,"Rect",(function(){return fu})),n.d(f,"Text",(function(){return du}));var d=n(1);
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- var p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function g(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var v=function(){return(v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};Object.create;Object.create;var y=n(3),m="\t\n\v\f\r \u2028\u2029",b=new RegExp("([a-z])["+m+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+m+"]*,?["+m+"]*)+)","ig"),x=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+m+"]*,?["+m+"]*","ig"),w=function(t){if(!t)return null;if(Object(y.isArray)(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(b,(function(r,i,o){var a=[],s=i.toLowerCase();if(o.replace(x,(function(t,e){e&&a.push(+e)})),"m"===s&&a.length>2&&(n.push([i].concat(a.splice(0,2))),s="l",i="m"===i?"l":"L"),"o"===s&&1===a.length&&n.push([i,a[0]]),"r"===s)n.push([i].concat(a));else for(;a.length>=e[s]&&(n.push([i].concat(a.splice(0,e[s]))),e[s]););return t})),n},M=function(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var o=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4===r?o[3]={x:+t[0],y:+t[1]}:i-2===r&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===r?o[3]=o[2]:r||(o[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n},S=function(t,e,n,r,i){var o=[];if(null===i&&null===r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!==i){var a=Math.PI/180,s=t+n*Math.cos(-r*a),u=t+n*Math.cos(-i*a);o=[["M",s,e+n*Math.sin(-r*a)],["A",n,n,0,+(i-r>180),0,u,e+n*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return o},O=function(t){if(!(t=w(t))||!t.length)return[["M",0,0]];var e,n,r=[],i=0,o=0,a=0,s=0,u=0;"M"===t[0][0]&&(a=i=+t[0][1],s=o=+t[0][2],u++,r[0]=["M",i,o]);for(var c=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),h=void 0,l=void 0,f=u,d=t.length;f<d;f++){if(r.push(h=[]),(e=(l=t[f])[0])!==e.toUpperCase())switch(h[0]=e.toUpperCase(),h[0]){case"A":h[1]=l[1],h[2]=l[2],h[3]=l[3],h[4]=l[4],h[5]=l[5],h[6]=+l[6]+i,h[7]=+l[7]+o;break;case"V":h[1]=+l[1]+o;break;case"H":h[1]=+l[1]+i;break;case"R":for(var p=2,g=(n=[i,o].concat(l.slice(1))).length;p<g;p++)n[p]=+n[p]+i,n[++p]=+n[p]+o;r.pop(),r=r.concat(M(n,c));break;case"O":r.pop(),(n=S(i,o,l[1],l[2])).push(n[0]),r=r.concat(n);break;case"U":r.pop(),r=r.concat(S(i,o,l[1],l[2],l[3])),h=["U"].concat(r[r.length-1].slice(-2));break;case"M":a=+l[1]+i,s=+l[2]+o;break;default:for(p=1,g=l.length;p<g;p++)h[p]=+l[p]+(p%2?i:o)}else if("R"===e)n=[i,o].concat(l.slice(1)),r.pop(),r=r.concat(M(n,c)),h=["R"].concat(l.slice(-2));else if("O"===e)r.pop(),(n=S(i,o,l[1],l[2])).push(n[0]),r=r.concat(n);else if("U"===e)r.pop(),r=r.concat(S(i,o,l[1],l[2],l[3])),h=["U"].concat(r[r.length-1].slice(-2));else for(var v=0,y=l.length;v<y;v++)h[v]=l[v];if("O"!==(e=e.toUpperCase()))switch(h[0]){case"Z":i=+a,o=+s;break;case"H":i=h[1];break;case"V":o=h[1];break;case"M":a=h[h.length-2],s=h[h.length-1];break;default:i=h[h.length-2],o=h[h.length-1]}}return r},k=function(t,e,n,r){return[t,e,n,r,n,r]},C=function(t,e,n,r,i,o){return[1/3*t+2/3*n,1/3*e+2/3*r,1/3*i+2/3*n,1/3*o+2/3*r,i,o]},E=function(t,e,n,r,i,o,a,s,u,c){n===r&&(n+=1);var h,l,f,d,p,g=120*Math.PI/180,v=Math.PI/180*(+i||0),y=[],m=function(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}};if(c)l=c[0],f=c[1],d=c[2],p=c[3];else{t=(h=m(t,e,-v)).x,e=h.y,s=(h=m(s,u,-v)).x,u=h.y,t===s&&e===u&&(s+=1,u+=1);var b=(t-s)/2,x=(e-u)/2,w=b*b/(n*n)+x*x/(r*r);w>1&&(n*=w=Math.sqrt(w),r*=w);var M=n*n,S=r*r,O=(o===a?-1:1)*Math.sqrt(Math.abs((M*S-M*x*x-S*b*b)/(M*x*x+S*b*b)));d=O*n*x/r+(t+s)/2,p=O*-r*b/n+(e+u)/2,l=Math.asin(((e-p)/r).toFixed(9)),f=Math.asin(((u-p)/r).toFixed(9)),l=t<d?Math.PI-l:l,f=s<d?Math.PI-f:f,l<0&&(l=2*Math.PI+l),f<0&&(f=2*Math.PI+f),a&&l>f&&(l-=2*Math.PI),!a&&f>l&&(f-=2*Math.PI)}var k=f-l;if(Math.abs(k)>g){var C=f,P=s,j=u;f=l+g*(a&&f>l?1:-1),s=d+n*Math.cos(f),u=p+r*Math.sin(f),y=E(s,u,n,r,i,0,a,P,j,[f,C,d,p])}k=f-l;var A=Math.cos(l),I=Math.sin(l),T=Math.cos(f),N=Math.sin(f),B=Math.tan(k/4),_=4/3*n*B,L=4/3*r*B,D=[t,e],R=[t+_*I,e-L*A],F=[s+_*N,u-L*T],X=[s,u];if(R[0]=2*D[0]-R[0],R[1]=2*D[1]-R[1],c)return[R,F,X].concat(y);for(var Y=[],z=0,W=(y=[R,F,X].concat(y).join().split(",")).length;z<W;z++)Y[z]=z%2?m(y[z-1],y[z],v).y:m(y[z],y[z+1],v).x;return Y},P=function(t,e){var n,r=O(t),i=e&&O(e),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=[],u=[],c="",h="",l=function(t,e,n){var r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(E.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":"C"===n||"S"===n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),t=["C",r,i].concat(t.slice(1));break;case"T":"Q"===n||"T"===n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(C(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(C(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(k(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(k(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(k(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(k(e.x,e.y,e.X,e.Y))}return t},f=function(t,e){if(t[e].length>7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",i&&(u[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),n=Math.max(r.length,i&&i.length||0)}},d=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],n=Math.max(r.length,i&&i.length||0))};n=Math.max(r.length,i&&i.length||0);for(var p=0;p<n;p++){r[p]&&(c=r[p][0]),"C"!==c&&(s[p]=c,p&&(h=s[p-1])),r[p]=l(r[p],o,h),"A"!==s[p]&&"C"===c&&(s[p]="C"),f(r,p),i&&(i[p]&&(c=i[p][0]),"C"!==c&&(u[p]=c,p&&(h=u[p-1])),i[p]=l(i[p],a,h),"A"!==u[p]&&"C"===c&&(u[p]="C"),f(i,p)),d(r,i,o,a,p),d(i,r,a,o,p);var g=r[p],v=i&&i[p],y=g.length,m=i&&v.length;o.x=g[y-2],o.y=g[y-1],o.bx=parseFloat(g[y-4])||o.x,o.by=parseFloat(g[y-3])||o.y,a.bx=i&&(parseFloat(v[m-4])||a.x),a.by=i&&(parseFloat(v[m-3])||a.y),a.x=i&&v[m-2],a.y=i&&v[m-1]}return i?[r,i]:r},j=/,?([a-z]),?/gi,A=function(t){return t.join(",").replace(j,"$1")},I=function(t,e,n,r,i){return t*(t*(-3*e+9*n-9*r+3*i)+6*e-12*n+6*r)-3*e+3*n},T=function(t,e,n,r,i,o,a,s,u){null===u&&(u=1);for(var c=(u=u>1?1:u<0?0:u)/2,h=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],l=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,d=0;d<12;d++){var p=c*h[d]+c,g=I(p,t,n,i,a),v=I(p,e,r,o,s),y=g*g+v*v;f+=l[d]*Math.sqrt(y)}return c*f},N=function(t,e,n,r,i,o,a,s){for(var u,c,h,l,f=[],d=[[],[]],p=0;p<2;++p)if(0===p?(c=6*t-12*n+6*i,u=-3*t+9*n-9*i+3*a,h=3*n-3*t):(c=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*s,h=3*r-3*e),Math.abs(u)<1e-12){if(Math.abs(c)<1e-12)continue;(l=-h/c)>0&&l<1&&f.push(l)}else{var g=c*c-4*h*u,v=Math.sqrt(g);if(!(g<0)){var y=(-c+v)/(2*u);y>0&&y<1&&f.push(y);var m=(-c-v)/(2*u);m>0&&m<1&&f.push(m)}}for(var b,x=f.length,w=x;x--;)b=1-(l=f[x]),d[0][x]=b*b*b*t+3*b*b*l*n+3*b*l*l*i+l*l*l*a,d[1][x]=b*b*b*e+3*b*b*l*r+3*b*l*l*o+l*l*l*s;return d[0][w]=t,d[1][w]=e,d[0][w+1]=a,d[1][w+1]=s,d[0].length=d[1].length=w+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}},B=function(t,e,n,r,i,o,a,s){if(!(Math.max(t,n)<Math.min(i,a)||Math.min(t,n)>Math.max(i,a)||Math.max(e,r)<Math.min(o,s)||Math.min(e,r)>Math.max(o,s))){var u=(t-n)*(o-s)-(e-r)*(i-a);if(u){var c=((t*r-e*n)*(i-a)-(t-n)*(i*s-o*a))/u,h=((t*r-e*n)*(o-s)-(e-r)*(i*s-o*a))/u,l=+c.toFixed(2),f=+h.toFixed(2);if(!(l<+Math.min(t,n).toFixed(2)||l>+Math.max(t,n).toFixed(2)||l<+Math.min(i,a).toFixed(2)||l>+Math.max(i,a).toFixed(2)||f<+Math.min(e,r).toFixed(2)||f>+Math.max(e,r).toFixed(2)||f<+Math.min(o,s).toFixed(2)||f>+Math.max(o,s).toFixed(2)))return{x:c,y:h}}}},_=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},L=function(t,e,n,r,i){if(i)return[["M",+t+ +i,e],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]];return o.parsePathArray=A,o},D=function(t,e,n,r){return null===t&&(t=e=n=r=0),null===e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:Math.min(n,r)/2,r2:Math.max(n,r)/2,r0:Math.sqrt(n*n+r*r)/2,path:L(t,e,n,r),vb:[t,e,n,r].join(" ")}},R=function(t,e,n,r,i,o,a,s){Object(y.isArray)(t)||(t=[t,e,n,r,i,o,a,s]);var u=N.apply(null,t);return D(u.min.x,u.min.y,u.max.x-u.min.x,u.max.y-u.min.y)},F=function(t,e,n,r,i,o,a,s,u){var c=1-u,h=Math.pow(c,3),l=Math.pow(c,2),f=u*u,d=f*u,p=t+2*u*(n-t)+f*(i-2*n+t),g=e+2*u*(r-e)+f*(o-2*r+e),v=n+2*u*(i-n)+f*(a-2*i+n),y=r+2*u*(o-r)+f*(s-2*o+r);return{x:h*t+3*l*u*n+3*c*u*u*i+d*a,y:h*e+3*l*u*r+3*c*u*u*o+d*s,m:{x:p,y:g},n:{x:v,y:y},start:{x:c*t+u*n,y:c*e+u*r},end:{x:c*i+u*a,y:c*o+u*s},alpha:90-180*Math.atan2(p-v,g-y)/Math.PI}},X=function(t,e,n){if(!function(t,e){return t=D(t),e=D(e),_(e,t.x,t.y)||_(e,t.x2,t.y)||_(e,t.x,t.y2)||_(e,t.x2,t.y2)||_(t,e.x,e.y)||_(t,e.x2,e.y)||_(t,e.x,e.y2)||_(t,e.x2,e.y2)||(t.x<e.x2&&t.x>e.x||e.x<t.x2&&e.x>t.x)&&(t.y<e.y2&&t.y>e.y||e.y<t.y2&&e.y>t.y)}(R(t),R(e)))return n?0:[];for(var r=~~(T.apply(0,t)/8),i=~~(T.apply(0,e)/8),o=[],a=[],s={},u=n?0:[],c=0;c<r+1;c++){var h=F.apply(0,t.concat(c/r));o.push({x:h.x,y:h.y,t:c/r})}for(c=0;c<i+1;c++){h=F.apply(0,e.concat(c/i));a.push({x:h.x,y:h.y,t:c/i})}for(c=0;c<r;c++)for(var l=0;l<i;l++){var f=o[c],d=o[c+1],p=a[l],g=a[l+1],v=Math.abs(d.x-f.x)<.001?"y":"x",y=Math.abs(g.x-p.x)<.001?"y":"x",m=B(f.x,f.y,d.x,d.y,p.x,p.y,g.x,g.y);if(m){if(s[m.x.toFixed(4)]===m.y.toFixed(4))continue;s[m.x.toFixed(4)]=m.y.toFixed(4);var b=f.t+Math.abs((m[v]-f[v])/(d[v]-f[v]))*(d.t-f.t),x=p.t+Math.abs((m[y]-p[y])/(g[y]-p[y]))*(g.t-p.t);b>=0&&b<=1&&x>=0&&x<=1&&(n?u+=1:u.push({x:m.x,y:m.y,t1:b,t2:x}))}}return u},Y=function(t,e){return function(t,e,n){var r,i,o,a,s,u,c,h,l,f;t=P(t),e=P(e);for(var d=n?0:[],p=0,g=t.length;p<g;p++){var v=t[p];if("M"===v[0])r=s=v[1],i=u=v[2];else{"C"===v[0]?(l=[r,i].concat(v.slice(1)),r=l[6],i=l[7]):(l=[r,i,r,i,s,u,s,u],r=s,i=u);for(var y=0,m=e.length;y<m;y++){var b=e[y];if("M"===b[0])o=c=b[1],a=h=b[2];else{"C"===b[0]?(f=[o,a].concat(b.slice(1)),o=f[6],a=f[7]):(f=[o,a,o,a,c,h,c,h],o=c,a=h);var x=X(l,f,n);if(n)d+=x;else{for(var w=0,M=x.length;w<M;w++)x[w].segment1=p,x[w].segment2=y,x[w].bez1=l,x[w].bez2=f;d=d.concat(x)}}}}}return d}(t,e)};function z(t,e){var n=[],r=[];return t.length&&function t(e,i){if(1===e.length)n.push(e[0]),r.push(e[0]);else{for(var o=[],a=0;a<e.length-1;a++)0===a&&n.push(e[0]),a===e.length-2&&r.push(e[a+1]),o[a]=[(1-i)*e[a][0]+i*e[a+1][0],(1-i)*e[a][1]+i*e[a+1][1]];t(o,i)}}(t,e),{left:n,right:r.reverse()}}var W=function(t,e,n){if(1===n)return[[].concat(t)];var r=[];if("L"===e[0]||"C"===e[0]||"Q"===e[0])r=r.concat(function(t,e,n){var r=[[t[1],t[2]]];n=n||2;var i=[];"A"===e[0]?(r.push(e[6]),r.push(e[7])):"C"===e[0]?(r.push([e[1],e[2]]),r.push([e[3],e[4]]),r.push([e[5],e[6]])):"S"===e[0]||"Q"===e[0]?(r.push([e[1],e[2]]),r.push([e[3],e[4]])):r.push([e[1],e[2]]);for(var o=r,a=1/n,s=0;s<n-1;s++){var u=z(o,a/(1-a*s));i.push(u.left),o=u.right}return i.push(o),i.map((function(t){var e=[];return 4===t.length&&(e.push("C"),e=e.concat(t[2])),t.length>=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])}))}(t,e,n));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var o=0;o<=n-1;o++)r.push(i)}return r},q=function(t,e){if(1===t.length)return t;var n=t.length-1,r=e.length-1,i=n/r,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a<r-n;a++)t.push(t[0]);return t}for(a=0;a<r;a++){var s=Math.floor(i*a);o[s]=(o[s]||0)+1}var u=o.reduce((function(e,r,i){return i===n?e.concat(t[n]):e.concat(W(t[i],t[i+1],r))}),[]);return u.unshift(t[0]),"Z"!==e[r]&&"z"!==e[r]||u.push("Z"),u},G=function(t,e){if(t.length!==e.length)return!1;var n=!0;return Object(y.each)(t,(function(t,r){if(t!==e[r])return n=!1,!1})),n};function V(t,e,n){var r=null,i=n;return e<i&&(i=e,r="add"),t<i&&(i=t,r="del"),{type:r,min:i}}var H=function(t,e){var n=function(t,e){var n,r,i=t.length,o=e.length,a=0;if(0===i||0===o)return null;for(var s=[],u=0;u<=i;u++)s[u]=[],s[u][0]={min:u};for(var c=0;c<=o;c++)s[0][c]={min:c};for(u=1;u<=i;u++){n=t[u-1];for(c=1;c<=o;c++){r=e[c-1],a=G(n,r)?0:1;var h=s[u-1][c].min+1,l=s[u][c-1].min+1,f=s[u-1][c-1].min+a;s[u][c]=V(h,l,f)}}return s}(t,e),r=t.length,i=e.length,o=[],a=1,s=1;if(n[r][i].min!==r){for(var u=1;u<=r;u++){var c=n[u][u].min;s=u;for(var h=a;h<=i;h++)n[u][h].min<c&&(c=n[u][h].min,s=h);a=s,n[u][a].type&&o.push({index:u-1,type:n[u][a].type})}for(u=o.length-1;u>=0;u--)a=o[u].index,"add"===o[u].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var l=i-(r=t.length);if(r<i)for(u=0;u<l;u++)"z"===t[r-1][0]||"Z"===t[r-1][0]?t.splice(r-2,0,t[r-2]):t.push(t[r-1]),r+=1;return t};function U(t,e,n){for(var r,i=[].concat(t),o=1/(n+1),a=Z(e)[0],s=1;s<=n;s++)o*=s,0===(r=Math.floor(t.length*o))?i.unshift([a[0]*o+t[r][0]*(1-o),a[1]*o+t[r][1]*(1-o)]):i.splice(r,0,[a[0]*o+t[r][0]*(1-o),a[1]*o+t[r][1]*(1-o)]);return i}function Z(t){var e=[];switch(t[0]){case"M":case"L":e.push([t[1],t[2]]);break;case"A":e.push([t[6],t[7]]);break;case"Q":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"T":e.push([t[1],t[2]]);break;case"C":e.push([t[5],t[6]]),e.push([t[1],t[2]]),e.push([t[3],t[4]]);break;case"S":e.push([t[3],t[4]]),e.push([t[1],t[2]]);break;case"H":case"V":e.push([t[1],t[1]])}return e}var Q=function(t,e){if(t.length<=1)return t;for(var n,r=0;r<e.length;r++)if(t[r][0]!==e[r][0])switch(n=Z(t[r]),e[r][0]){case"M":t[r]=["M"].concat(n[0]);break;case"L":t[r]=["L"].concat(n[0]);break;case"A":t[r]=[].concat(e[r]),t[r][6]=n[0][0],t[r][7]=n[0][1];break;case"Q":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=U(n,t[r-1],1)}t[r]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[r]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(r>0)){t[r]=e[r];break}n=U(n,t[r-1],2)}t[r]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(r>0)){t[r]=e[r];break}n=U(n,t[r-1],1)}t[r]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[r]=e[r]}return t},K=function(){function t(t,e){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=e,this.timeStamp=e.timeStamp}return t.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.toString=function(){return"[Event (type="+this.type+")]"},t.prototype.save=function(){},t.prototype.restore=function(){},t}();
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- var $=function(t,e){return($=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function J(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}$(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}Object.create;Object.create;var tt=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0),this},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}();function et(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}var nt="undefined"!=typeof window&&void 0!==window.document;function rt(t,e){if(t.isCanvas())return!0;for(var n=e.getParent(),r=!1;n;){if(n===t){r=!0;break}n=n.getParent()}return r}function it(t){return t.cfg.visible&&t.cfg.capture}var ot=function(t){function e(e){var n=t.call(this)||this;n.destroyed=!1;var r=n.getDefaultCfg();return n.cfg=Object(y.mix)(r,e),n}return J(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,e){this.cfg[t]=e},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(tt),at=n(170),st="undefined"!=typeof Float32Array?Float32Array:Array,ut=Math.random;Math.PI;function ct(){var t=new st(9);return st!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function ht(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function lt(t){var e=new st(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function ft(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function dt(t,e,n,r,i,o,a,s,u){var c=new st(9);return c[0]=t,c[1]=e,c[2]=n,c[3]=r,c[4]=i,c[5]=o,c[6]=a,c[7]=s,c[8]=u,c}function pt(t,e,n,r,i,o,a,s,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t}function gt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function vt(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function yt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8],l=h*a-s*c,f=-h*o+s*u,d=c*o-a*u,p=n*l+r*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-h*r+i*c)*p,t[2]=(s*r-i*a)*p,t[3]=f*p,t[4]=(h*n-i*u)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-c*n+r*u)*p,t[8]=(a*n-r*o)*p,t):null}function mt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8];return t[0]=a*h-s*c,t[1]=i*c-r*h,t[2]=r*s-i*a,t[3]=s*u-o*h,t[4]=n*h-i*u,t[5]=i*o-n*s,t[6]=o*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*o,t}function bt(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+n*(-c*i+a*s)+r*(u*i-o*s)}function xt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=n[0],d=n[1],p=n[2],g=n[3],v=n[4],y=n[5],m=n[6],b=n[7],x=n[8];return t[0]=f*r+d*a+p*c,t[1]=f*i+d*s+p*h,t[2]=f*o+d*u+p*l,t[3]=g*r+v*a+y*c,t[4]=g*i+v*s+y*h,t[5]=g*o+v*u+y*l,t[6]=m*r+b*a+x*c,t[7]=m*i+b*s+x*h,t[8]=m*o+b*u+x*l,t}function wt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=f*r+d*a+c,t[7]=f*i+d*s+h,t[8]=f*o+d*u+l,t}function Mt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=Math.sin(n),d=Math.cos(n);return t[0]=d*r+f*a,t[1]=d*i+f*s,t[2]=d*o+f*u,t[3]=d*a-f*r,t[4]=d*s-f*i,t[5]=d*u-f*o,t[6]=c,t[7]=h,t[8]=l,t}function St(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function kt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ct(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Et(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Pt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,h=r*a,l=r*s,f=i*a,d=i*s,p=i*u,g=o*a,v=o*s,y=o*u;return t[0]=1-l-p,t[3]=h-y,t[6]=f+v,t[1]=h+y,t[4]=1-c-p,t[7]=d-g,t[2]=f-v,t[5]=d+g,t[8]=1-c-l,t}function jt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=n*s-r*a,b=n*u-i*a,x=n*c-o*a,w=r*u-i*s,M=r*c-o*s,S=i*c-o*u,O=h*g-l*p,k=h*v-f*p,C=h*y-d*p,E=l*v-f*g,P=l*y-d*g,j=f*y-d*v,A=m*j-b*P+x*E+w*C-M*k+S*O;return A?(A=1/A,t[0]=(s*j-u*P+c*E)*A,t[1]=(u*C-a*j-c*k)*A,t[2]=(a*P-s*C+c*O)*A,t[3]=(i*P-r*j-o*E)*A,t[4]=(n*j-i*C+o*k)*A,t[5]=(r*C-n*P-o*O)*A,t[6]=(g*S-v*M+y*w)*A,t[7]=(v*x-p*S-y*b)*A,t[8]=(p*M-g*x+y*m)*A,t):null}function At(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function It(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Tt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Nt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function Bt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function _t(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function Lt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function Dt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function Rt(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],h=t[8],l=e[0],f=e[1],d=e[2],p=e[3],g=e[4],v=e[5],y=e[6],m=e[7],b=e[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(r-f)<=1e-6*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=1e-6*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-g)<=1e-6*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-v)<=1e-6*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-y)<=1e-6*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(h-b)<=1e-6*Math.max(1,Math.abs(h),Math.abs(b))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Ft=xt,Xt=Bt;function Yt(){var t=new st(2);return st!=Float32Array&&(t[0]=0,t[1]=0),t}function zt(t){var e=new st(2);return e[0]=t[0],e[1]=t[1],e}function Wt(t,e){var n=new st(2);return n[0]=t,n[1]=e,n}function qt(t,e){return t[0]=e[0],t[1]=e[1],t}function Gt(t,e,n){return t[0]=e,t[1]=n,t}function Vt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function Ht(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function Ut(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function Zt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function Qt(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function Kt(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function $t(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function Jt(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function te(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function ee(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function ne(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function re(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function ie(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function oe(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function ae(t){var e=t[0],n=t[1];return e*e+n*n}function se(t,e){return t[0]=-e[0],t[1]=-e[1],t}function ue(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function ce(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function he(t,e){return t[0]*e[0]+t[1]*e[1]}function le(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function fe(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function de(t,e){e=e||1;var n=2*ut()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function pe(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function ge(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function ve(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function ye(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function me(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function be(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function xe(t){return t[0]=0,t[1]=0,t}function we(t){return"vec2("+t[0]+", "+t[1]+")"}function Me(t,e){return t[0]===e[0]&&t[1]===e[1]}function Se(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))}var Oe,ke=oe,Ce=Ht,Ee=Ut,Pe=Zt,je=re,Ae=ie,Ie=ae,Te=(Oe=Yt(),function(t,e,n,r,i,o){var a,s;for(e||(e=2),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)Oe[0]=t[a],Oe[1]=t[a+1],i(Oe,Oe,o),t[a]=Oe[0],t[a+1]=Oe[1];return t});function Ne(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return i.fromTranslation(r,n),i.multiply(t,r,e)}function Be(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return i.fromRotation(r,n),i.multiply(t,r,e)}function _e(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return i.fromScaling(r,n),i.multiply(t,r,e)}function Le(t,e){for(var n,r,o,a=t?[].concat(t):[1,0,0,0,1,0,0,0,1],s=0,u=e.length;s<u;s++){var c=e[s];switch(c[0]){case"t":Ne(a,a,[c[1],c[2]]);break;case"s":_e(a,a,[c[1],c[2]]);break;case"r":Be(a,a,c[1]);break;case"m":n=a,r=a,o=c[1],i.multiply(n,o,r)}}return a}function De(t,e){return t[0]*e[1]-e[0]*t[1]}function Re(t,e,n){var r=o.angle(t,e),i=De(t,e)>=0;return n?i?2*Math.PI-r:r:i?r:2*Math.PI-r}function Fe(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}function Xe(t,e){var n=[],r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],h=t[7],l=t[8],f=e[0],d=e[1],p=e[2],g=e[3],v=e[4],y=e[5],m=e[6],b=e[7],x=e[8];return n[0]=f*r+d*a+p*c,n[1]=f*i+d*s+p*h,n[2]=f*o+d*u+p*l,n[3]=g*r+v*a+y*c,n[4]=g*i+v*s+y*h,n[5]=g*o+v*u+y*l,n[6]=m*r+b*a+x*c,n[7]=m*i+b*s+x*h,n[8]=m*o+b*u+x*l,n}function Ye(t,e){var n=[],r=e[0],i=e[1];return n[0]=t[0]*r+t[3]*i+t[6],n[1]=t[1]*r+t[4]*i+t[7],n}function ze(t){var e=[],n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],h=t[8],l=h*a-s*c,f=-h*o+s*u,d=c*o-a*u,p=n*l+r*f+i*d;return p?(p=1/p,e[0]=l*p,e[1]=(-h*r+i*c)*p,e[2]=(s*r-i*a)*p,e[3]=f*p,e[4]=(h*n-i*u)*p,e[5]=(-s*n+i*o)*p,e[6]=d*p,e[7]=(-c*n+r*u)*p,e[8]=(a*n-r*o)*p,e):null}var We=a.transform,qe=["zIndex","capture","visible","type"],Ge=["repeat"];function Ve(t,e){var n={},r=e.attrs;for(var i in t)n[i]=r[i];return n}function He(t,e){var n={},r=e.attr();return Object(y.each)(t,(function(t,e){-1!==Ge.indexOf(e)||Object(y.isEqual)(r[e],t)||(n[e]=t)})),n}function Ue(t,e){if(e.onFrame)return t;var n=e.startTime,r=e.delay,i=e.duration,o=Object.prototype.hasOwnProperty;return Object(y.each)(t,(function(t){n+r<t.startTime+t.delay+t.duration&&i>t.delay&&Object(y.each)(e.toAttrs,(function(e,n){o.call(t.toAttrs,n)&&(delete t.toAttrs[n],delete t.fromAttrs[n])}))})),t}var Ze=function(t){function e(e){var n=t.call(this,e)||this;n.attrs={};var r=n.getDefaultAttrs();return Object(y.mix)(r,e.attrs),n.attrs=r,n.initAttrs(r),n.initAnimate(),n}return J(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],i=e[1];if(!r)return this.attrs;if(Object(y.isObject)(r)){for(var o in r)this.setAttr(o,r[o]);return this.afterAttrsChange(r),this}return 2===e.length?(this.setAttr(r,i),this.afterAttrsChange(((t={})[r]=i,t)),this):this.attrs[r]},e.prototype.isClipped=function(t,e){var n=this.getClip();return n&&!n.isHit(t,e)},e.prototype.setAttr=function(t,e){var n=this.attrs[t];n!==e&&(this.attrs[t]=e,this.onAttrChange(t,e,n))},e.prototype.onAttrChange=function(t,e,n){"matrix"===t&&this.set("totalMatrix",null)},e.prototype.afterAttrsChange=function(t){if(this.cfg.isClipShape){var e=this.cfg.applyTo;e&&e.onCanvasChange("clip")}else this.onCanvasChange("attr")},e.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},e.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},e.prototype.setZIndex=function(t){this.set("zIndex",t);var e=this.getParent();return e&&e.sort(),this},e.prototype.toFront=function(){var t=this.getParent();if(t){var e=t.getChildren(),n=(this.get("el"),e.indexOf(this));e.splice(n,1),e.push(this),this.onCanvasChange("zIndex")}},e.prototype.toBack=function(){var t=this.getParent();if(t){var e=t.getChildren(),n=(this.get("el"),e.indexOf(this));e.splice(n,1),e.unshift(this),this.onCanvasChange("zIndex")}},e.prototype.remove=function(t){void 0===t&&(t=!0);var e=this.getParent();e?(et(e.getChildren(),this),e.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),t&&this.destroy()},e.prototype.resetMatrix=function(){this.attr("matrix",this.getDefaultMatrix()),this.onCanvasChange("matrix")},e.prototype.getMatrix=function(){return this.attr("matrix")},e.prototype.setMatrix=function(t){this.attr("matrix",t),this.onCanvasChange("matrix")},e.prototype.getTotalMatrix=function(){var t=this.cfg.totalMatrix;if(!t){var e=this.attr("matrix"),n=this.cfg.parentMatrix;t=n&&e?Xe(n,e):e||n,this.set("totalMatrix",t)}return t},e.prototype.applyMatrix=function(t){var e=this.attr("matrix"),n=null;n=t&&e?Xe(t,e):e||t,this.set("totalMatrix",n),this.set("parentMatrix",t)},e.prototype.getDefaultMatrix=function(){return null},e.prototype.applyToMatrix=function(t){var e=this.attr("matrix");return e?Ye(e,t):t},e.prototype.invertFromMatrix=function(t){var e=this.attr("matrix");if(e){var n=ze(e);if(n)return Ye(n,t)}return t},e.prototype.setClip=function(t){var e=this.getCanvas(),n=null;if(t){var r=this.getShapeBase()[Object(y.upperFirst)(t.type)];r&&(n=new r({type:t.type,isClipShape:!0,applyTo:this,attrs:t.attrs,canvas:e}))}return this.set("clipShape",n),this.onCanvasChange("clip"),n},e.prototype.getClip=function(){var t=this.cfg.clipShape;return t||null},e.prototype.clone=function(){var t=this,e=this.attrs,n={};Object(y.each)(e,(function(t,r){Object(y.isArray)(e[r])?n[r]=function(t){for(var e=[],n=0;n<t.length;n++)Object(y.isArray)(t[n])?e.push([].concat(t[n])):e.push(t[n]);return e}(e[r]):n[r]=e[r]}));var r=new(0,this.constructor)({attrs:n});return Object(y.each)(qe,(function(e){r.set(e,t.get(e))})),r},e.prototype.destroy=function(){this.destroyed||(this.attrs={},t.prototype.destroy.call(this))},e.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},e.prototype.animate=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(this.get("timeline")||this.get("canvas")){this.set("animating",!0);var n=this.get("timeline");n||(n=this.get("canvas").get("timeline"),this.set("timeline",n));var r=this.get("animations")||[];n.timer||n.initTimer();var i,o,a,s,u,c=t[0],h=t[1],l=t[2],f=void 0===l?"easeLinear":l,d=t[3],p=void 0===d?y.noop:d,g=t[4],v=void 0===g?0:g;Object(y.isFunction)(c)?(i=c,c={}):Object(y.isObject)(c)&&c.onFrame&&(i=c.onFrame,o=c.repeat),Object(y.isObject)(h)?(h=(u=h).duration,f=u.easing||"easeLinear",v=u.delay||0,o=u.repeat||o||!1,p=u.callback||y.noop,a=u.pauseCallback||y.noop,s=u.resumeCallback||y.noop):(Object(y.isNumber)(p)&&(v=p,p=null),Object(y.isFunction)(f)?(p=f,f="easeLinear"):f=f||"easeLinear");var m=He(c,this),b={fromAttrs:Ve(m,this),toAttrs:m,duration:h,easing:f,repeat:o,callback:p,pauseCallback:a,resumeCallback:s,delay:v,startTime:n.getTime(),id:Object(y.uniqueId)(),onFrame:i,pathFormatted:!1};r.length>0?r=Ue(r,b):n.addAnimator(this),r.push(b),this.set("animations",r),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var n=this.get("animations");Object(y.each)(n,(function(n){t&&(n.onFrame?e.attr(n.onFrame(1)):e.attr(n.toAttrs)),n.callback&&n.callback()})),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return Object(y.each)(e,(function(t){t._paused=!0,t._pauseTime=n,t.pauseCallback&&t.pauseCallback()})),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),n=this.get("_pause").pauseTime;return Object(y.each)(e,(function(e){e.startTime=e.startTime+(t-n),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()})),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var n,r=this,i=e.propagationPath;this.getEvents();"mouseenter"===t?n=e.fromShape:"mouseleave"===t&&(n=e.toShape);for(var o=function(t){var o=i[t],s=o.get("name");if(s){if((o.isGroup()||o.isCanvas&&o.isCanvas())&&n&&rt(o,n))return"break";Object(y.isArray)(s)?Object(y.each)(s,(function(t){r.emitDelegateEvent(o,t,e)})):a.emitDelegateEvent(o,s,e)}},a=this,s=0;s<i.length;s++){if("break"===o(s))break}},e.prototype.emitDelegateEvent=function(t,e,n){var r=this.getEvents(),i=e+":"+n.type;(r[i]||r["*"])&&(n.name=i,n.currentTarget=t,n.delegateTarget=this,n.delegateObject=t.get("delegateObject"),this.emit(i,n))},e.prototype.translate=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var n=this.getMatrix(),r=We(n,[["t",t,e]]);return this.setMatrix(r),this},e.prototype.move=function(t,e){var n=this.attr("x")||0,r=this.attr("y")||0;return this.translate(t-n,e-r),this},e.prototype.moveTo=function(t,e){return this.move(t,e)},e.prototype.scale=function(t,e){var n=this.getMatrix(),r=We(n,[["s",t,e||t]]);return this.setMatrix(r),this},e.prototype.rotate=function(t){var e=this.getMatrix(),n=We(e,[["r",t]]);return this.setMatrix(n),this},e.prototype.rotateAtStart=function(t){var e=this.attr(),n=e.x,r=e.y,i=this.getMatrix(),o=We(i,[["t",-n,-r],["r",t],["t",n,r]]);return this.setMatrix(o),this},e.prototype.rotateAtPoint=function(t,e,n){var r=this.getMatrix(),i=We(r,[["t",-t,-e],["r",n],["t",t,e]]);return this.setMatrix(i),this},e}(ot),Qe={};var Ke=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return J(e,t),e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,i=[],o=[],a=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return a.length>0?(Object(y.each)(a,(function(t){var e=t.getBBox();i.push(e.minX,e.maxX),o.push(e.minY,e.maxY)})),t=Object(y.min)(i),e=Object(y.max)(i),n=Object(y.min)(o),r=Object(y.max)(o)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,r=-1/0,i=[],o=[],a=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return a.length>0?(Object(y.each)(a,(function(t){var e=t.getCanvasBBox();i.push(e.minX,e.maxX),o.push(e.minY,e.maxY)})),t=Object(y.min)(i),e=Object(y.max)(i),n=Object(y.min)(o),r=Object(y.max)(o)):(t=0,e=0,n=0,r=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:r,width:e-t,height:r-n}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,n,r){if(t.prototype.onAttrChange.call(this,e,n,r),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var r=this.getTotalMatrix();r!==n&&this._applyChildrenMarix(r)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();Object(y.each)(e,(function(e){e.applyMatrix(t)}))},e.prototype.addShape=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],r=t[1];Object(y.isObject)(n)?r=n:r.type=n;var i=Qe[r.type];i||(i=Object(y.upperFirst)(r.type),Qe[r.type]=i);var o=this.getShapeBase(),a=new o[i](r);return this.add(a),a},e.prototype.addGroup=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=t[0],i=t[1];if(Object(y.isFunction)(r))n=new r(i||{parent:this});else{var o=r||{},a=this.getGroupBase();n=new a(o)}return this.add(n),n},e.prototype.getCanvas=function(){return this.isCanvas()?this:this.get("canvas")},e.prototype.getShape=function(t,e,n){if(!it(this))return null;var r,i=this.getChildren();if(this.isCanvas())r=this._findShape(i,t,e,n);else{var o=[t,e,1];o=this.invertFromMatrix(o),this.isClipped(o[0],o[1])||(r=this._findShape(i,o[0],o[1],n))}return r},e.prototype._findShape=function(t,e,n,r){for(var i=null,o=t.length-1;o>=0;o--){var a=t[o];if(it(a)&&(a.isGroup()?i=a.getShape(e,n,r):a.isHit(e,n)&&(i=a)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),r=this.get("timeline"),i=t.getParent();i&&function(t,e,n){void 0===n&&(n=!0),n?e.destroy():(e.set("parent",null),e.set("canvas",null)),et(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&function t(e,n){if(e.set("canvas",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,e),r&&function t(e,n){if(e.set("timeline",n),e.isGroup()){var r=e.get("children");r.length&&r.forEach((function(e){t(e,n)}))}}(t,r),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t,e=this.getChildren();Object(y.each)(e,(function(t,e){return t._INDEX=e,t})),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,n){var r=t(e,n);return 0===r?e._INDEX-n._INDEX:r})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],n=this.getChildren();return Object(y.each)(n,(function(n){t(n)&&e.push(n),n.isGroup()&&(e=e.concat(n.findAll(t)))})),e},e.prototype.find=function(t){var e=null,n=this.getChildren();return Object(y.each)(n,(function(n){if(t(n)?e=n:n.isGroup()&&(e=n.find(t)),e)return!1})),e},e.prototype.findById=function(t){return this.find((function(e){return e.get("id")===t}))},e.prototype.findByClassName=function(t){return this.find((function(e){return e.get("className")===t}))},e.prototype.findAllByName=function(t){return this.findAll((function(e){return e.get("name")===t}))},e}(Ze);function $e(t){return($e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Je,tn,en=0,nn=0,rn=0,on=0,an=0,sn=0,un="object"===("undefined"==typeof performance?"undefined":$e(performance))&&performance.now?performance:Date,cn="object"===("undefined"==typeof window?"undefined":$e(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function hn(){return an||(cn(ln),an=un.now()+sn)}function ln(){an=0}function fn(){this._call=this._time=this._next=null}function dn(t,e,n){var r=new fn;return r.restart(t,e,n),r}function pn(){an=(on=un.now())+sn,en=nn=0;try{!function(){hn(),++en;for(var t,e=Je;e;)(t=an-e._time)>=0&&e._call.call(null,t),e=e._next;--en}()}finally{en=0,function(){var t,e,n=Je,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Je=e);tn=t,vn(r)}(),an=0}}function gn(){var t=un.now(),e=t-on;e>1e3&&(sn-=e,on=t)}function vn(t){en||(nn&&(nn=clearTimeout(nn)),t-an>24?(t<1/0&&(nn=setTimeout(pn,t-un.now()-sn)),rn&&(rn=clearInterval(rn))):(rn||(on=un.now(),rn=setInterval(gn,1e3)),en=1,cn(pn)))}function yn(t){return+t}function mn(t){return t*t}function bn(t){return t*(2-t)}function xn(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function wn(t){return t*t*t}function Mn(t){return--t*t*t+1}function Sn(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}fn.prototype=dn.prototype={constructor:fn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?hn():+n)+(null==e?0:+e),this._next||tn===this||(tn?tn._next=this:Je=this,tn=this),this._call=t,this._time=n,vn()},stop:function(){this._call&&(this._call=null,this._time=1/0,vn())}};var On=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),kn=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),Cn=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),En=Math.PI,Pn=En/2;function jn(t){return 1==+t?1:1-Math.cos(t*Pn)}function An(t){return Math.sin(t*Pn)}function In(t){return(1-Math.cos(En*t))/2}function Tn(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function Nn(t){return Tn(1-+t)}function Bn(t){return 1-Tn(t)}function _n(t){return((t*=2)<=1?Tn(1-t):2-Tn(t-1))/2}function Ln(t){return 1-Math.sqrt(1-t*t)}function Dn(t){return Math.sqrt(1- --t*t)}function Rn(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}function Fn(t){return 1-Xn(1-t)}function Xn(t){return(t=+t)<4/11?7.5625*t*t:t<8/11?7.5625*(t-=6/11)*t+3/4:t<10/11?7.5625*(t-=9/11)*t+15/16:7.5625*(t-=21/22)*t+63/64}function Yn(t){return((t*=2)<=1?1-Xn(1-t):Xn(t-1)+1)/2}var zn=function t(e){function n(t){return(t=+t)*t*(e*(t-1)+t)}return e=+e,n.overshoot=t,n}(1.70158),Wn=function t(e){function n(t){return--t*t*((t+1)*e+t)+1}return e=+e,n.overshoot=t,n}(1.70158),qn=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),Gn=2*Math.PI,Vn=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Gn);function i(t){return e*Tn(- --t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*Gn)},i.period=function(n){return t(e,n)},i}(1,.3),Hn=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Gn);function i(t){return 1-e*Tn(t=+t)*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*Gn)},i.period=function(n){return t(e,n)},i}(1,.3),Un=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=Gn);function i(t){return((t=2*t-1)<0?e*Tn(-t)*Math.sin((r-t)/n):2-e*Tn(t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*Gn)},i.period=function(n){return t(e,n)},i}(1,.3),Zn=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function Qn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Kn(){}var $n="\\s*([+-]?\\d+)\\s*",Jn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",tr="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",er=/^#([0-9a-f]{3,8})$/,nr=new RegExp("^rgb\\("+[$n,$n,$n]+"\\)$"),rr=new RegExp("^rgb\\("+[tr,tr,tr]+"\\)$"),ir=new RegExp("^rgba\\("+[$n,$n,$n,Jn]+"\\)$"),or=new RegExp("^rgba\\("+[tr,tr,tr,Jn]+"\\)$"),ar=new RegExp("^hsl\\("+[Jn,tr,tr]+"\\)$"),sr=new RegExp("^hsla\\("+[Jn,tr,tr,Jn]+"\\)$"),ur={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function cr(){return this.rgb().formatHex()}function hr(){return this.rgb().formatRgb()}function lr(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=er.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?fr(e):3===n?new vr(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?dr(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?dr(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=nr.exec(t))?new vr(e[1],e[2],e[3],1):(e=rr.exec(t))?new vr(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ir.exec(t))?dr(e[1],e[2],e[3],e[4]):(e=or.exec(t))?dr(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ar.exec(t))?xr(e[1],e[2]/100,e[3]/100,1):(e=sr.exec(t))?xr(e[1],e[2]/100,e[3]/100,e[4]):ur.hasOwnProperty(t)?fr(ur[t]):"transparent"===t?new vr(NaN,NaN,NaN,0):null}function fr(t){return new vr(t>>16&255,t>>8&255,255&t,1)}function dr(t,e,n,r){return r<=0&&(t=e=n=NaN),new vr(t,e,n,r)}function pr(t){return t instanceof Kn||(t=lr(t)),t?new vr((t=t.rgb()).r,t.g,t.b,t.opacity):new vr}function gr(t,e,n,r){return 1===arguments.length?pr(t):new vr(t,e,n,null==r?1:r)}function vr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function yr(){return"#"+br(this.r)+br(this.g)+br(this.b)}function mr(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function br(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function xr(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Mr(t,e,n,r)}function wr(t){if(t instanceof Mr)return new Mr(t.h,t.s,t.l,t.opacity);if(t instanceof Kn||(t=lr(t)),!t)return new Mr;if(t instanceof Mr)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Mr(a,s,u,t.opacity)}function Mr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Sr(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Or(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}Zn(Kn,lr,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:cr,formatHex:cr,formatHsl:function(){return wr(this).formatHsl()},formatRgb:hr,toString:hr}),Zn(vr,gr,Qn(Kn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new vr(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new vr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yr,formatHex:yr,formatRgb:mr,toString:mr})),Zn(Mr,(function(t,e,n,r){return 1===arguments.length?wr(t):new Mr(t,e,n,null==r?1:r)}),Qn(Kn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Mr(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Mr(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new vr(Sr(t>=240?t-240:t+120,i,r),Sr(t,i,r),Sr(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var kr=function(t){return function(){return t}};function Cr(t,e){return function(n){return t+n*e}}function Er(t){return 1==(t=+t)?Pr:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):kr(isNaN(e)?n:e)}}function Pr(t,e){var n=e-t;return n?Cr(t,n):kr(isNaN(t)?e:t)}var jr=function t(e){var n=Er(e);function r(t,e){var r=n((t=gr(t)).r,(e=gr(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Pr(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Ar(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=gr(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}Ar((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return Or((n-r/e)*e,a,i,o,s)}})),Ar((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return Or((n-r/e)*e,i,o,a,s)}}));var Ir=function(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(o){for(n=0;n<r;++n)i[n]=t[n]*(1-o)+e[n]*o;return i}};function Tr(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Nr(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=zr(t[n],e[n]);for(;n<r;++n)a[n]=e[n];return function(t){for(n=0;n<i;++n)a[n]=o[n](t);return a}}var Br=function(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}},_r=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}};function Lr(t){return(Lr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Dr=function(t,e){var n,r={},i={};for(n in null!==t&&"object"===Lr(t)||(t={}),null!==e&&"object"===Lr(e)||(e={}),e)n in t?r[n]=zr(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}},Rr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fr=new RegExp(Rr.source,"g");var Xr=function(t,e){var n,r,i,o=Rr.lastIndex=Fr.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=Rr.exec(t))&&(r=Fr.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:_r(n,r)})),o=Fr.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})};function Yr(t){return(Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var zr=function(t,e){var n,r=Yr(e);return null==e||"boolean"===r?kr(e):("number"===r?_r:"string"===r?(n=lr(e))?(e=n,jr):Xr:e instanceof lr?jr:e instanceof Date?Br:Tr(e)?Ir:Array.isArray(e)?Nr:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Dr:_r)(t,e)},Wr=[1,0,0,0,1,0,0,0,1];function qr(t,e,n){var r,i=e.startTime;if(n<i+e.delay||e._paused)return!1;var o=e.duration,a=e.easing;if(n=n-i-e.delay,e.repeat)r=n%o/o,r=s[a](r);else{if(!((r=n/o)<1))return e.onFrame?t.attr(e.onFrame(1)):t.attr(e.toAttrs),!0;r=s[a](r)}if(e.onFrame){var u=e.onFrame(r);t.attr(u)}else!function(t,e,n){var r={},i=e.fromAttrs,o=e.toAttrs;if(!t.destroyed){var a,s,u,c;for(var h in o)if(!Object(y.isEqual)(i[h],o[h]))if("path"===h){var l=o[h],f=i[h];l.length>f.length?(l=w(o[h]),f=w(i[h]),f=H(f,l),f=Q(f,l),e.fromAttrs.path=f,e.toAttrs.path=l):e.pathFormatted||(l=w(o[h]),f=w(i[h]),f=Q(f,l),e.fromAttrs.path=f,e.toAttrs.path=l,e.pathFormatted=!0),r[h]=[];for(var d=0;d<l.length;d++){for(var p=l[d],g=f[d],v=[],m=0;m<p.length;m++)Object(y.isNumber)(p[m])&&g&&Object(y.isNumber)(g[m])?(a=zr(g[m],p[m]),v.push(a(n))):v.push(p[m]);r[h].push(v)}}else if("matrix"===h){var b=(u=i[h]||Wr,(Tr(c=o[h]||Wr)?Ir:Nr)(u,c))(n);r[h]=b}else["fill","stroke","fillStyle","strokeStyle"].includes(h)&&(s=o[h],/^[r,R,L,l]{1}[\s]*\(/.test(s))?r[h]=o[h]:Object(y.isFunction)(o[h])||(a=zr(i[h],o[h]),r[h]=a(n));t.attr(r)}}(t,e,r);return!1}var Gr=function(){function t(t){this.animators=[],this.current=0,this.timer=null,this.canvas=t}return t.prototype.initTimer=function(){var t,e,n,r=this;this.timer=dn((function(i){if(r.current=i,r.animators.length>0){for(var o=r.animators.length-1;o>=0;o--)if((t=r.animators[o]).destroyed)r.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],qr(t,n,i)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&r.removeAnimator(o)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),Vr=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function Hr(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function Ur(t,e,n){if(n.bubbles){var r=void 0,i=!1;if("mouseenter"===e?(r=n.fromShape,i=!0):"mouseleave"===e&&(i=!0,r=n.toShape),t.isCanvas()&&i)return;if(r&&rt(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var Zr=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");Object(y.each)(Vr,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");Object(y.each)(Vr,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new K(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t],o=!1;if(i)i.call(this,n,r,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}if(o||(this.currentShape=r),r&&!r.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=r.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,r){var i=this.canvas.get("el");n!==r&&(n&&(this._emitEvent("mouseout",t,e,n,n,r),this._emitEvent("mouseleave",t,e,n,n,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,e,r,n,r),this._emitEvent("mouseenter",t,e,r,n,r)))},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);r!==t&&this._emitMouseoverEvents(n,e,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var r=this.currentShape;this._emitDragoverEvents(n,t,r,e,!0)},t.prototype._onmousemove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=n.timeStamp-this.mousedownTimeStamp,c=a.clientX-t.clientX,h=a.clientY-t.clientY;u>120||c*c+h*h>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,Hr(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||Ur(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{Hr(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),Qr=Object(at.a)(),Kr=Qr&&"firefox"===Qr.name,$r=function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return J(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");Object(y.isString)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new Zr({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new Gr(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");nt&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");nt&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(Kr&&!Object(y.isNil)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(y.isNil)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,r=e.y;return this.getPointByClient(n,r)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(Ke),Jr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return J(e,t),e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=this.getChildren(),r=0;r<n.length;r++){var i=n[r];e.add(i.clone())}return e},e}(Ke),ti=function(t){function e(e){return t.call(this,e)||this}return J(e,t),e.prototype._isInBBox=function(t,e){var n=this.getBBox();return n.minX<=t&&n.maxX>=t&&n.minY<=e&&n.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,r=t.minY,i=t.maxX,o=t.maxY;if(e){var a=Ye(e,[t.minX,t.minY]),s=Ye(e,[t.maxX,t.minY]),u=Ye(e,[t.minX,t.maxY]),c=Ye(e,[t.maxX,t.maxY]);n=Math.min(a[0],s[0],u[0],c[0]),i=Math.max(a[0],s[0],u[0],c[0]),r=Math.min(a[1],s[1],u[1],c[1]),o=Math.max(a[1],s[1],u[1],c[1])}var h=this.attrs;if(h.shadowColor){var l=h.shadowBlur,f=void 0===l?0:l,d=h.shadowOffsetX,p=void 0===d?0:d,g=h.shadowOffsetY,v=void 0===g?0:g,y=n-f+p,m=i+f+p,b=r-f+v,x=o+f+v;n=Math.min(n,y),i=Math.max(i,m),r=Math.min(r,b),o=Math.max(o,x)}return{x:n,y:r,minX:n,minY:r,maxX:i,maxY:o,width:i-n,height:o-r}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),r=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(n&&n.isHit(o,a))return!0;if(r&&r.isHit(o,a))return!0}return!1},e}(Ze),ei=new Map;function ni(t,e){ei.set(t,e)}var ri=function(t){var e=t.attr();return{x:e.x,y:e.y,width:e.width,height:e.height}},ii=function(t){var e=t.attr(),n=e.x,r=e.y,i=e.r;return{x:n-i,y:r-i,width:2*i,height:2*i}},oi={}.toString,ai=function(t,e){return oi.call(t)==="[object "+e+"]"},si=function(t){return ai(t,"Function")},ui=function(t){return Array.isArray?Array.isArray(t):ai(t,"Array")};function ci(t){return(ci="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var hi=function(t){var e=ci(t);return null!==t&&"object"===e||"function"===e};var li=function(t,e){if(t)if(ui(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(hi(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break};Object.keys;var fi=function(t){if(ui(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},di=function(t){if(ui(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},pi=Array.prototype;pi.splice,pi.indexOf,Array.prototype.splice;Object.prototype.hasOwnProperty;var gi=function(t){return ai(t,"Number")};Number.isInteger&&Number.isInteger;Math.PI,parseInt,Math.PI,Object.values;Object.prototype;Object.prototype.hasOwnProperty;Object.prototype.hasOwnProperty;!function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}();function vi(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function yi(t,e){return Math.abs(t-e)<.001}function mi(t,e){var n=di(t),r=di(e);return{x:n,y:r,width:fi(t)-n,height:fi(e)-r}}function bi(t,e,n,r){return{minX:di([t,n]),maxX:fi([t,n]),minY:di([e,r]),maxY:fi([e,r])}}function xi(t){return(t+2*Math.PI)%(2*Math.PI)}var wi="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});!function(){var t,e=(t=new wi(2),wi!=Float32Array&&(t[0]=0,t[1]=0),t)}();var Mi={box:function(t,e,n,r){return mi([t,n],[e,r])},length:function(t,e,n,r){return vi(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,o){var a=(n-t)*(i-t)+(r-e)*(o-e);return a<0?vi(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?vi(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var u=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(u,s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function Si(t,e,n,r,i,o){var a,s=1/0,u=[n,r],c=20;o&&o>200&&(c=o/10);for(var h=1/c,l=h/10,f=0;f<=c;f++){var d=f*h,p=[i.apply(null,t.concat([d])),i.apply(null,e.concat([d]))];(m=vi(u[0],u[1],p[0],p[1]))<s&&(a=d,s=m)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(f=0;f<32&&!(l<1e-4);f++){var v=a-l,y=a+l,m=(p=[i.apply(null,t.concat([v])),i.apply(null,e.concat([v]))],vi(u[0],u[1],p[0],p[1]));if(v>=0&&m<s)a=v,s=m;else{var b=[i.apply(null,t.concat([y])),i.apply(null,e.concat([y]))],x=vi(u[0],u[1],b[0],b[1]);y<=1&&x<s?(a=y,s=x):l*=.5}}return{x:i.apply(null,t.concat([a])),y:i.apply(null,e.concat([a]))}}function Oi(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function ki(t,e,n){var r=t+n-2*e;if(yi(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function Ci(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function Ei(t,e,n,r,i,o,a){var s=Oi(t,n,i,a),u=Oi(e,r,o,a),c=Mi.pointAt(t,e,n,r,a),h=Mi.pointAt(n,r,i,o,a);return[[t,e,c.x,c.y,s,u],[s,u,h.x,h.y,i,o]]}var Pi={box:function(t,e,n,r,i,o){var a=ki(t,n,i)[0],s=ki(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(Oi(t,n,i,a)),void 0!==s&&c.push(Oi(e,r,o,s)),mi(u,c)},length:function(t,e,n,r,i,o){return function t(e,n,r,i,o,a,s){if(0===s)return(vi(e,n,r,i)+vi(r,i,o,a)+vi(e,n,o,a))/2;var u=Ei(e,n,r,i,o,a,.5),c=u[0],h=u[1];return c.push(s-1),h.push(s-1),t.apply(null,c)+t.apply(null,h)}(t,e,n,r,i,o,3)},nearestPoint:function(t,e,n,r,i,o,a,s){return Si([t,n,i],[e,r,o],a,s,Oi)},pointDistance:function(t,e,n,r,i,o,a,s){var u=this.nearestPoint(t,e,n,r,i,o,a,s);return vi(u.x,u.y,a,s)},interpolationAt:Oi,pointAt:function(t,e,n,r,i,o,a){return{x:Oi(t,n,i,a),y:Oi(e,r,o,a)}},divide:function(t,e,n,r,i,o,a){return Ei(t,e,n,r,i,o,a)},tangentAngle:function(t,e,n,r,i,o,a){var s=Ci(t,n,i,a),u=Ci(e,r,o,a);return xi(Math.atan2(u,s))}};function ji(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function Ai(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function Ii(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,h=[];if(yi(s,0))yi(u,0)||(i=-c/u)>=0&&i<=1&&h.push(i);else{var l=u*u-4*s*c;yi(l,0)?h.push(-u/(2*s)):l>0&&(o=(-u-(a=Math.sqrt(l)))/(2*s),(i=(-u+a)/(2*s))>=0&&i<=1&&h.push(i),o>=0&&o<=1&&h.push(o))}return h}function Ti(t,e,n,r,i,o,a,s,u){var c=ji(t,n,i,a,u),h=ji(e,r,o,s,u),l=Mi.pointAt(t,e,n,r,u),f=Mi.pointAt(n,r,i,o,u),d=Mi.pointAt(i,o,a,s,u),p=Mi.pointAt(l.x,l.y,f.x,f.y,u),g=Mi.pointAt(f.x,f.y,d.x,d.y,u);return[[t,e,l.x,l.y,p.x,p.y,c,h],[c,h,g.x,g.y,d.x,d.y,a,s]]}function Ni(t,e,n,r,i,o,a,s,u){if(0===u)return function(t,e){for(var n=0,r=t.length,i=0;i<r;i++){n+=vi(t[i],e[i],t[(i+1)%r],e[(i+1)%r])}return n/2}([t,n,i,a],[e,r,o,s]);var c=Ti(t,e,n,r,i,o,a,s,.5),h=c[0],l=c[1];return h.push(u-1),l.push(u-1),Ni.apply(null,h)+Ni.apply(null,l)}var Bi={extrema:Ii,box:function(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],h=Ii(t,n,i,a),l=Ii(e,r,o,s),f=0;f<h.length;f++)u.push(ji(t,n,i,a,h[f]));for(f=0;f<l.length;f++)c.push(ji(e,r,o,s,l[f]));return mi(u,c)},length:function(t,e,n,r,i,o,a,s){return Ni(t,e,n,r,i,o,a,s,3)},nearestPoint:function(t,e,n,r,i,o,a,s,u,c,h){return Si([t,n,i,a],[e,r,o,s],u,c,ji,h)},pointDistance:function(t,e,n,r,i,o,a,s,u,c,h){var l=this.nearestPoint(t,e,n,r,i,o,a,s,u,c,h);return vi(l.x,l.y,u,c)},interpolationAt:ji,pointAt:function(t,e,n,r,i,o,a,s,u){return{x:ji(t,n,i,a,u),y:ji(e,r,o,s,u)}},divide:function(t,e,n,r,i,o,a,s,u){return Ti(t,e,n,r,i,o,a,s,u)},tangentAngle:function(t,e,n,r,i,o,a,s,u){var c=Ai(t,n,i,a,u),h=Ai(e,r,o,s,u);return xi(Math.atan2(h,c))}};function _i(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Li(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}var Di=function(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,c=-1/0,h=[o,a],l=2*-Math.PI;l<=2*Math.PI;l+=Math.PI){var f=s+l;o<a?o<f&&f<a&&h.push(f):a<f&&f<o&&h.push(f)}for(l=0;l<h.length;l++){var d=_i(t,0,n,r,i,h[l]);d<u&&(u=d),d>c&&(c=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,v=-1/0,y=[o,a];for(l=2*-Math.PI;l<=2*Math.PI;l+=Math.PI){var m=p+l;o<a?o<m&&m<a&&y.push(m):a<m&&m<o&&y.push(m)}for(l=0;l<y.length;l++){var b=Li(0,e,n,r,i,y[l]);b<g&&(g=b),b>v&&(v=b)}return{x:u,y:g,width:c-u,height:v-g}};function Ri(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=vi(r[0],r[1],i[0],i[1])}return e}var Fi=function(t){return Ri(t)};function Xi(t,e){return t&&e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t||e}function Yi(t,e){var n=t.get("startArrowShape"),r=t.get("endArrowShape");return n&&(e=Xi(e,n.getCanvasBBox())),r&&(e=Xi(e,r.getCanvasBBox())),e}var zi=null;function Wi(t,e,n){var r=1;return Object(y.isString)(t)&&(r=t.split("\n").length),r>1?e*r+function(t,e){return e?e-t:.14*t}(e,n)*(r-1):e}function qi(t,e){var n=function(){if(!zi){var t=document.createElement("canvas");t.width=1,t.height=1,zi=t.getContext("2d")}return zi}(),r=0;if(Object(y.isNil)(t)||""===t)return r;if(n.save(),n.font=e,Object(y.isString)(t)&&t.includes("\n")){var i=t.split("\n");Object(y.each)(i,(function(t){var e=n.measureText(t).width;r<e&&(r=e)}))}else r=n.measureText(t).width;return n.restore(),r}function Gi(t){var e=t.fontSize,n=t.fontFamily,r=t.fontWeight;return[t.fontStyle,t.fontVariant,r,e+"px",n].join(" ").trim()}var Vi=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,Hi=/[^\s\,]+/gi;var Ui=function(t){var e=t||[];return Object(y.isArray)(e)?e:Object(y.isString)(e)?(e=e.match(Vi),Object(y.each)(e,(function(t,n){if((t=t.match(Hi))[0].length>1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}Object(y.each)(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0};new RegExp("([a-z])[\t\n\v\f\r \u2028\u2029,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\t\n\v\f\r \u2028\u2029]*,?[\t\n\v\f\r \u2028\u2029]*)+)","ig"),new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[\t\n\v\f\r \u2028\u2029]*,?[\t\n\v\f\r \u2028\u2029]*","ig");function Zi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Qi(t,e){return Zi(t)*Zi(e)?(t[0]*e[0]+t[1]*e[1])/(Zi(t)*Zi(e)):1}function Ki(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Qi(t,e))}function $i(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ji(t,e){var n=e[1],r=e[2],i=Object(y.mod)(Object(y.toRadian)(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],c=e[6],h=e[7],l=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-h)/2,f=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-h)/2,d=l*l/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(f*f)+r*r*(l*l),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var v=r?g*n*f/r:0,m=n?g*-r*l/n:0,b=(s+c)/2+Math.cos(i)*v-Math.sin(i)*m,x=(u+h)/2+Math.sin(i)*v+Math.cos(i)*m,w=[(l-v)/n,(f-m)/r],M=[(-1*l-v)/n,(-1*f-m)/r],S=Ki([1,0],w),O=Ki(w,M);return Qi(w,M)<=-1&&(O=Math.PI),Qi(w,M)>=1&&(O=0),0===a&&O>0&&(O-=2*Math.PI),1===a&&O<0&&(O+=2*Math.PI),{cx:b,cy:x,rx:$i(t,[c,h])?0:n,ry:$i(t,[c,h])?0:r,startAngle:S,endAngle:S+O,xRotation:i,arcFlag:o,sweepFlag:a}}function to(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function eo(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),u=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!u||0===Math.sin(u)||Object(y.isNumberEqual)(u,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),h=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,h=h>Math.PI/2?Math.PI-h:h,{xExtra:Math.cos(u/2-c)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(h-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}ni("rect",ri),ni("image",ri),ni("circle",ii),ni("marker",ii),ni("polyline",(function(t){for(var e=t.attr().points,n=[],r=[],i=0;i<e.length;i++){var o=e[i];n.push(o[0]),r.push(o[1])}var a=u.getBBoxByArray(n,r),s=a.x,c=a.y,h={minX:s,minY:c,maxX:s+a.width,maxY:c+a.height};return{x:(h=Yi(t,h)).minX,y:h.minY,width:h.maxX-h.minX,height:h.maxY-h.minY}})),ni("polygon",(function(t){for(var e=t.attr().points,n=[],r=[],i=0;i<e.length;i++){var o=e[i];n.push(o[0]),r.push(o[1])}return u.getBBoxByArray(n,r)})),ni("text",(function(t){var e=t.attr(),n=e.x,r=e.y,i=e.text,o=e.fontSize,a=e.lineHeight,s=e.font;s||(s=Gi(e));var u,c=qi(i,s);if(c){var h=e.textAlign,l=e.textBaseline,f=Wi(i,o,a),d={x:n,y:r-f};h&&("end"===h||"right"===h?d.x-=c:"center"===h&&(d.x-=c/2)),l&&("top"===l?d.y+=f:"middle"===l&&(d.y+=f/2)),u={x:d.x,y:d.y,width:c,height:f}}else u={x:n,y:r,width:0,height:0};return u})),ni("path",(function(t){var e=t.attr(),n=e.path,r=e.stroke?e.lineWidth:0,i=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=(g=t[o]).currentPoint,s=g.params,u=g.prePoint,c=void 0;switch(g.command){case"Q":c=Pi.box(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":c=Bi.box(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var h=g.arcParams;c=Di(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(a[0]),r.push(a[1])}c&&(g.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===g.command||"M"===g.command)&&g.prePoint&&g.nextPoint&&i.push(g)}n=n.filter((function(t){return!Number.isNaN(t)})),r=r.filter((function(t){return!Number.isNaN(t)}));var l=Object(y.min)(n),f=Object(y.min)(r),d=Object(y.max)(n),p=Object(y.max)(r);if(0===i.length)return{x:l,y:f,width:d-l,height:p-f};for(o=0;o<i.length;o++){var g;(a=(g=i[o]).currentPoint)[0]===l?l-=eo(g,e).xExtra:a[0]===d&&(d+=eo(g,e).xExtra),a[1]===f?f-=eo(g,e).yExtra:a[1]===p&&(p+=eo(g,e).yExtra)}return{x:l,y:f,width:d-l,height:p-f}}(t.get("segments")||function(t){for(var e=[],n=null,r=null,i=null,o=0,a=(t=Ui(t)).length,s=0;s<a;s++){var u=t[s];r=t[s+1];var c=u[0],h={command:c,prePoint:n,params:u,startTangent:null,endTangent:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var l=Ji(n,u);h.arcParams=l}if("Z"===c)n=i,r=t[o+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),h.currentPoint=n,e[o]&&$i(n,e[o].currentPoint)&&(e[o].prePoint=h.prePoint);var d=r?[r[r.length-2],r[r.length-1]]:null;h.nextPoint=d;var p=h.prePoint;if(["L","H","V"].includes(c))h.startTangent=[p[0]-n[0],p[1]-n[1]],h.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===c){var g=[u[1],u[2]];h.startTangent=[p[0]-g[0],p[1]-g[1]],h.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===c){g=to((m=e[s-1]).currentPoint,p);"Q"===m.command?(h.command="Q",h.startTangent=[p[0]-g[0],p[1]-g[1]],h.endTangent=[n[0]-g[0],n[1]-g[1]]):(h.command="TL",h.startTangent=[p[0]-n[0],p[1]-n[1]],h.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===c){var v=[u[1],u[2]],y=[u[3],u[4]];h.startTangent=[p[0]-v[0],p[1]-v[1]],h.endTangent=[n[0]-y[0],n[1]-y[1]]}else if("S"===c){var m;v=to((m=e[s-1]).currentPoint,p),y=[u[1],u[2]];"C"===m.command?(h.command="C",h.startTangent=[p[0]-v[0],p[1]-v[1]],h.endTangent=[n[0]-y[0],n[1]-y[1]]):(h.command="SQ",h.startTangent=[p[0]-y[0],p[1]-y[1]],h.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===c){var b=.001,x=h.arcParams||{},w=x.cx,M=void 0===w?0:w,S=x.cy,O=void 0===S?0:S,k=x.rx,C=void 0===k?0:k,E=x.ry,P=void 0===E?0:E,j=x.sweepFlag,A=void 0===j?0:j,I=x.startAngle,T=void 0===I?0:I,N=x.endAngle,B=void 0===N?0:N;0===A&&(b*=-1);var _=C*Math.cos(T-b)+M,L=P*Math.sin(T-b)+O;h.startTangent=[_-i[0],L-i[1]];var D=C*Math.cos(T+B+b)+M,R=P*Math.sin(T+B-b)+O;h.endTangent=[p[0]-D,p[1]-R]}e.push(h)}return e}(n),r),o=i.x,a=i.y,s={minX:o,minY:a,maxX:o+i.width,maxY:a+i.height};return{x:(s=Yi(t,s)).minX,y:s.minY,width:s.maxX-s.minX,height:s.maxY-s.minY}})),ni("line",(function(t){var e=t.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2,a={minX:Math.min(n,i),maxX:Math.max(n,i),minY:Math.min(r,o),maxY:Math.max(r,o)};return{x:(a=Yi(t,a)).minX,y:a.minY,width:a.maxX-a.minX,height:a.maxY-a.minY}})),ni("ellipse",(function(t){var e=t.attr(),n=e.x,r=e.y,i=e.rx,o=e.ry;return{x:n-i,y:r-o,width:2*i,height:2*o}}));var no={}.toString,ro=function(t,e){return no.call(t)==="[object "+e+"]"},io=function(t){return ro(t,"Function")},oo=function(t){return null==t},ao=function(t){return Array.isArray?Array.isArray(t):ro(t,"Array")};function so(t){return(so="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var uo=function(t){var e=so(t);return null!==t&&"object"===e||"function"===e};var co=function(t,e){if(t)if(ao(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(uo(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break};Object.keys;var ho=Array.prototype,lo=(ho.splice,ho.indexOf,Array.prototype.splice,function(t){return ro(t,"String")});Object.prototype.hasOwnProperty;var fo=function(t){return ro(t,"Number")};Number.isInteger&&Number.isInteger;var po=function(t,e){return(t%e+e)%e},go=(Math.PI,parseInt,Math.PI/180),vo=function(t){return go*t};Object.values;Object.prototype;Object.prototype.hasOwnProperty;Object.prototype.hasOwnProperty;!function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}();var yo=n(25);function mo(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function bo(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function xo(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)}function wo(t,e){return t[0]===e[0]&&t[1]===e[1]}var Mo=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,So=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Oo=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ko=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function Co(t,e){var n=t.match(ko);co(n,(function(t){var n=t.split(":");e.addColorStop(n[0],n[1])}))}function Eo(t,e,n){if(lo(n)){if("("===n[1]||"("===n[2]){if("l"===n[0])return function(t,e,n){var r,i,o=Mo.exec(n),a=parseFloat(o[1])%360*(Math.PI/180),s=o[2],u=e.getBBox();a>=0&&a<.5*Math.PI?(r={x:u.minX,y:u.minY},i={x:u.maxX,y:u.maxY}):.5*Math.PI<=a&&a<Math.PI?(r={x:u.maxX,y:u.minY},i={x:u.minX,y:u.maxY}):Math.PI<=a&&a<1.5*Math.PI?(r={x:u.maxX,y:u.maxY},i={x:u.minX,y:u.minY}):(r={x:u.minX,y:u.maxY},i={x:u.maxX,y:u.minY});var c=Math.tan(a),h=c*c,l=(i.x-r.x+c*(i.y-r.y))/(h+1)+r.x,f=c*(i.x-r.x+c*(i.y-r.y))/(h+1)+r.y,d=t.createLinearGradient(r.x,r.y,l,f);return Co(s,d),d}(t,e,n);if("r"===n[0])return function(t,e,n){var r=So.exec(n),i=parseFloat(r[1]),o=parseFloat(r[2]),a=parseFloat(r[3]),s=r[4];if(0===a){var u=s.match(ko);return u[u.length-1].split(":")[1]}var c=e.getBBox(),h=c.maxX-c.minX,l=c.maxY-c.minY,f=Math.sqrt(h*h+l*l)/2,d=t.createRadialGradient(c.minX+h*i,c.minY+l*o,0,c.minX+h/2,c.minY+l/2,a*f);return Co(s,d),d}(t,e,n);if("p"===n[0])return function(t,e,n){if(e.get("patternSource")&&e.get("patternSource")===n)return e.get("pattern");var r,i,o=Oo.exec(n),a=o[1],s=o[2];function u(){r=t.createPattern(i,a),e.set("pattern",r),e.set("patternSource",n)}switch(a){case"a":a="repeat";break;case"x":a="repeat-x";break;case"y":a="repeat-y";break;case"n":a="no-repeat";break;default:a="no-repeat"}return i=new Image,s.match(/^data:/i)||(i.crossOrigin="Anonymous"),i.src=s,i.complete?u():(i.onload=u,i.src=i.src),r}(t,e,n)}return n}}function Po(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function jo(t,e){return Po(t)*Po(e)?(t[0]*e[0]+t[1]*e[1])/(Po(t)*Po(e)):1}function Ao(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(jo(t,e))}function Io(t,e){var n=e[1],r=e[2],i=po(vo(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],c=e[6],h=e[7],l=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-h)/2,f=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-h)/2,d=l*l/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(f*f)+r*r*(l*l),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var v=r?g*n*f/r:0,y=n?g*-r*l/n:0,m=(s+c)/2+Math.cos(i)*v-Math.sin(i)*y,b=(u+h)/2+Math.sin(i)*v+Math.cos(i)*y,x=[(l-v)/n,(f-y)/r],w=[(-1*l-v)/n,(-1*f-y)/r],M=Ao([1,0],x),S=Ao(x,w);return jo(x,w)<=-1&&(S=Math.PI),jo(x,w)>=1&&(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&S<0&&(S+=2*Math.PI),{cx:m,cy:b,rx:wo(t,[c,h])?0:n,ry:wo(t,[c,h])?0:r,startAngle:M,endAngle:M+S,xRotation:i,arcFlag:o,sweepFlag:a}}var To=Math.sin,No=Math.cos,Bo=Math.atan2,_o=Math.PI;function Lo(t,e,n,r,i,o,a){var s=e.stroke,u=e.lineWidth,c=Bo(r-o,n-i),h=new uu({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*No(_o/6)+","+10*To(_o/6)+" L0,0 L"+10*No(_o/6)+",-"+10*To(_o/6),stroke:s,lineWidth:u}});h.translate(i,o),h.rotateAtPoint(i,o,c),t.set(a?"startArrowShape":"endArrowShape",h)}function Do(t,e,n,r,i,o,a){var s=e.startArrow,u=e.endArrow,c=e.stroke,h=e.lineWidth,l=a?s:u,f=l.d,d=l.fill,p=l.stroke,g=l.lineWidth,y=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(l,["d","fill","stroke","lineWidth"]),m=Bo(r-o,n-i);f&&(i-=No(m)*f,o-=To(m)*f);var b=new uu({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:v(v({},y),{stroke:p||c,lineWidth:g||h,fill:d})});b.translate(i,o),b.rotateAtPoint(i,o,m),t.set(a?"startArrowShape":"endArrowShape",b)}function Ro(t,e,n,r,i){var o=Bo(r-e,n-t);return{dx:No(o)*i,dy:To(o)*i}}function Fo(t,e,n,r,i,o){"object"==typeof e.startArrow?Do(t,e,n,r,i,o,!0):e.startArrow?Lo(t,e,n,r,i,o,!0):t.set("startArrowShape",null)}function Xo(t,e,n,r,i,o){"object"==typeof e.endArrow?Do(t,e,n,r,i,o,!1):e.endArrow?Lo(t,e,n,r,i,o,!1):t.set("startArrowShape",null)}var Yo={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function zo(t,e){var n=e.attr();for(var r in n){var i=n[r],o=Yo[r]?Yo[r]:r;"matrix"===o&&i?t.transform(i[0],i[1],i[3],i[4],i[6],i[7]):"lineDash"===o&&t.setLineDash?ao(i)&&t.setLineDash(i):("strokeStyle"===o||"fillStyle"===o?i=Eo(t,e,i):"globalAlpha"===o&&(i*=t.globalAlpha),t[o]=i)}}function Wo(t,e,n){for(var r=0;r<e.length;r++){var i=e[r];i.cfg.visible?i.draw(t,n):i.skipDraw()}}function qo(t,e,n){var r=t.get("refreshElements");co(r,(function(e){if(e!==t)for(var n=e.cfg.parent;n&&n!==t&&!n.cfg.refresh;)n.cfg.refresh=!0,n=n.cfg.parent})),r[0]===t?Go(e,n):function t(e,n){for(var r=0;r<e.length;r++){var i=e[r];if(i.cfg.visible)if(i.cfg.hasChanged)i.cfg.refresh=!0,i.isGroup()&&Go(i.cfg.children,n);else if(i.cfg.refresh)i.isGroup()&&t(i.cfg.children,n);else{var o=Vo(i,n);i.cfg.refresh=o,o&&i.isGroup()&&t(i.cfg.children,n)}}}(e,n)}function Go(t,e){for(var n=0;n<t.length;n++){var r=t[n];r.cfg.refresh=!0,r.isGroup()&&Go(r.get("children"),e)}}function Vo(t,e){var n=t.cfg.cacheCanvasBBox;return t.cfg.isInView&&n&&xo(n,e)}function Ho(t,e,n,r){var i=n.path,o=n.startArrow,a=n.endArrow;if(i){var s=[0,0],u=[0,0],c={dx:0,dy:0};e.beginPath();for(var h=0;h<i.length;h++){var l=i[h],f=l[0];if(0===h&&o&&o.d)c=Ro((d=t.getStartTangent())[0][0],d[0][1],d[1][0],d[1][1],o.d);else if(h===i.length-2&&"Z"===i[h+1][0]&&a&&a.d){if("Z"===i[h+1][0])c=Ro((d=t.getEndTangent())[0][0],d[0][1],d[1][0],d[1][1],a.d)}else if(h===i.length-1&&a&&a.d){var d;if("Z"!==i[0])c=Ro((d=t.getEndTangent())[0][0],d[0][1],d[1][0],d[1][1],a.d)}var p=c.dx,g=c.dy;switch(f){case"M":e.moveTo(l[1]-p,l[2]-g),u=[l[1],l[2]];break;case"L":e.lineTo(l[1]-p,l[2]-g);break;case"Q":e.quadraticCurveTo(l[1],l[2],l[3]-p,l[4]-g);break;case"C":e.bezierCurveTo(l[1],l[2],l[3],l[4],l[5]-p,l[6]-g);break;case"A":var v=void 0;r?(v=r[h])||(v=Io(s,l),r[h]=v):v=Io(s,l);var y=v.cx,m=v.cy,b=v.rx,x=v.ry,w=v.startAngle,M=v.endAngle,S=v.xRotation,O=v.sweepFlag;if(e.ellipse)e.ellipse(y,m,b,x,S,w,M,1-O);else{var k=b>x?b:x,C=b>x?1:b/x,E=b>x?x/b:1;e.translate(y,m),e.rotate(S),e.scale(C,E),e.arc(0,0,k,w,M,1-O),e.scale(1/C,1/E),e.rotate(-S),e.translate(-y,-m)}break;case"Z":e.closePath()}if("Z"===f)s=u;else{var P=l.length;s=[l[P-2],l[P-1]]}}}}function Uo(t,e){var n=t.get("canvas");n&&("remove"===e&&(t._cacheCanvasBBox=t.get("cacheCanvasBBox")),t.get("hasChanged")||(t.set("hasChanged",!0),t.cfg.parent&&t.cfg.parent.get("hasChanged")||(n.refreshElement(t,e,n),n.get("autoDraw")&&n.draw())))}function Zo(t){var e,n,r;if(t.destroyed)e=t._cacheCanvasBBox;else{var i=t.get("cacheCanvasBBox"),o=i&&!(!i.width||!i.height),a=t.getCanvasBBox(),s=a&&!(!a.width||!a.height);o&&s?(r=a,e=(n=i)&&r?{minX:Math.min(n.minX,r.minX),minY:Math.min(n.minY,r.minY),maxX:Math.max(n.maxX,r.maxX),maxY:Math.max(n.maxY,r.maxY)}:n||r):o?e=i:s&&(e=a)}return e}var Qo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.onCanvasChange=function(t){Uo(this,t)},e.prototype.getShapeBase=function(){return f},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,e){e&&(t.save(),zo(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],n=[];co(t,(function(t){var r=t.cfg.cacheCanvasBBox;r&&t.cfg.isInView&&(e.push(r.minX,r.maxX),n.push(r.minY,r.maxY))}));var r=null;if(e.length){var i=Math.min.apply(null,e),o=Math.max.apply(null,e),a=Math.min.apply(null,n),s=Math.max.apply(null,n);r={minX:i,minY:a,x:i,y:a,maxX:o,maxY:s,width:o-i,height:s-a};var u=this.cfg.canvas;if(u){var c=u.getViewRange();this.set("isInView",xo(r,c))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",r)},e.prototype.draw=function(t,e){var n=this.cfg.children,r=!e||this.cfg.refresh;n.length&&r&&(t.save(),zo(t,this),this._applyClip(t,this.getClip()),Wo(t,n,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(Jr),Ko=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return f},e.prototype.getGroupBase=function(){return Qo},e.prototype.onCanvasChange=function(t){Uo(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),n=function(t){return ei.get(t)}(t)(this),r=e/2,i=n.x-r,o=n.y-r,a=n.x+n.width+r,s=n.y+n.height+r;return{x:i,minX:i,y:o,minY:o,width:n.width+e,height:n.height+e,maxX:a,maxY:s}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,e){e&&(t.save(),zo(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.draw=function(t,e){var n=this.cfg.clipShape;if(e){if(!1===this.cfg.refresh)return void this.set("hasChanged",!1);if(!xo(e,this.getCanvasBBox()))return this.set("hasChanged",!1),void(this.cfg.isInView&&this._afterDraw())}t.save(),zo(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),n=xo(e,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isFill()&&(oo(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.isStroke()&&n>0&&(oo(i)||1===i||(t.globalAlpha=i),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,e){var n=this.isStroke(),r=this.isFill(),i=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(ti),$o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=o.x,s=o.y,u=o.r,c=i/2,h=mo(a,s,t,e);return r&&n?h<=u+c:r?h<=u:!!n&&(h>=u-c&&h<=u+c)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.r;t.beginPath(),t.arc(n,r,i,0,2*Math.PI,!1),t.closePath()},e}(Ko);function Jo(t,e,n,r){return t/(n*n)+e/(r*r)}var ta=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=i/2,s=o.x,u=o.y,c=o.rx,h=o.ry,l=(t-s)*(t-s),f=(e-u)*(e-u);return r&&n?Jo(l,f,c+a,h+a)<=1:r?Jo(l,f,c,h)<=1:!!n&&(Jo(l,f,c-a,h-a)>=1&&Jo(l,f,c+a,h+a)<=1)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.rx,o=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(n,r,i,o,0,0,2*Math.PI,!1);else{var a=i>o?i:o,s=i>o?1:i/o,u=i>o?o/i:1;t.save(),t.translate(n,r),t.scale(s,u),t.arc(0,0,a,0,2*Math.PI),t.restore(),t.closePath()}},e}(Ko);function ea(t){return t instanceof HTMLElement&&lo(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()}var na=null;var ra=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(!0===this.get("toDraw")){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var e=this,n=this.attrs;if(!(null==na?void 0:na.isMini())||(null==na?void 0:na.isMiniNative()))if(lo(t)){var r=null;(r=(null==na?void 0:na.isMiniNative())?null==na?void 0:na.get("container").createImage():new Image).onload=function(){if(e.destroyed)return!1;e.attr("img",r),e.set("loading",!1),e._afterLoading();var t=e.get("callback");t&&t.call(e)},r.crossOrigin="Anonymous",r.src=t,this.set("loading",!0)}else(null==na?void 0:na.isMiniNative())||t instanceof Image?(n.width||(n.width=t.width),n.height||(n.height=t.height)):ea(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))));else this.attr("img",t)},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),"img"===e&&this._setImage(n)},e.prototype.createPath=function(t){var e=this.attr(),n=e.img,r=e.x,i=e.y,o=e.width,a=e.height,s=e.sx,u=e.sy,c=e.swidth,h=e.sheight;if(this.get("loading"))return this.set("toDraw",!0),void this.set("context",t);(null==na?void 0:na.isMini())?t.drawImage(n,r,i,o,a):(n instanceof Image||ea(n))&&(oo(s)||oo(u)||oo(c)||oo(h)?t.drawImage(n,r,i,o,a):t.drawImage(n,s,u,c,h,r,i,o,a))},e}(Ko);function ia(t,e,n,r,i,o,a){var s=Math.min(t,n),u=Math.max(t,n),c=Math.min(e,r),h=Math.max(e,r),l=i/2;return o>=s-l&&o<=u+l&&a>=c-l&&a<=h+l&&Mi.pointToLine(t,e,n,r,o,a)<=i/2}var oa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=t.startArrow,a=t.endArrow;o&&Fo(this,t,r,i,e,n),a&&Xo(this,t,e,n,r,i)},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){if(!n||!i)return!1;var o=this.attr();return ia(o.x1,o.y1,o.x2,o.y2,i,t,e)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.startArrow,s=e.endArrow,u={dx:0,dy:0},c={dx:0,dy:0};a&&a.d&&(u=Ro(n,r,i,o,e.startArrow.d)),s&&s.d&&(c=Ro(n,r,i,o,e.endArrow.d)),t.beginPath(),t.moveTo(n+u.dx,r+u.dy),t.lineTo(i-c.dx,o-c.dy)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,r=t.x2,i=t.y2;return Mi.length(e,n,r,i)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,r=e.y1,i=e.x2,o=e.y2;return Mi.pointAt(n,r,i,o,t)},e}(Ko),aa=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,sa=/[^\s\,]+/gi;var ua=function(t){var e=t||[];return ao(e)?e:lo(e)?(e=e.match(aa),co(e,(function(t,n){if((t=t.match(sa))[0].length>1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}co(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0};var ca=new RegExp("([a-z])[\t\n\v\f\r \u2028\u2029,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\t\n\v\f\r \u2028\u2029]*,?[\t\n\v\f\r \u2028\u2029]*)+)","ig"),ha=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[\t\n\v\f\r \u2028\u2029]*,?[\t\n\v\f\r \u2028\u2029]*","ig");var la=/[a-z]/;function fa(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function da(t){var e=function(t){if(!t)return null;if(ao(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(ca,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(ha,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,r=0;r<e.length;r++){var i=e[r][0];if(la.test(i)||["V","H","T","S"].indexOf(i)>=0){n=!0;break}}if(!n)return e;var o=[],a=0,s=0,u=0,c=0,h=0,l=e[0];"M"!==l[0]&&"m"!==l[0]||(u=a=+l[1],c=s=+l[2],h++,o[0]=["M",a,s]);r=h;for(var f=e.length;r<f;r++){var d=e[r],p=o[r-1],g=[],v=(i=d[0]).toUpperCase();if(i!==v)switch(g[0]=v,v){case"A":g[1]=d[1],g[2]=d[2],g[3]=d[3],g[4]=d[4],g[5]=d[5],g[6]=+d[6]+a,g[7]=+d[7]+s;break;case"V":g[1]=+d[1]+s;break;case"H":g[1]=+d[1]+a;break;case"M":u=+d[1]+a,c=+d[2]+s;break;default:for(var y=1,m=d.length;y<m;y++)g[y]=+d[y]+(y%2?a:s)}else g=e[r];switch(v){case"Z":a=+u,s=+c;break;case"H":g=["L",a=g[1],s];break;case"V":g=["L",a,s=g[1]];break;case"T":a=g[1],s=g[2];var b=fa([p[1],p[2]],[p[3],p[4]]);g=["Q",b[0],b[1],a,s];break;case"S":a=g[g.length-2],s=g[g.length-1];var x=p.length,w=fa([p[x-4],p[x-3]],[p[x-2],p[x-1]]);g=["C",w[0],w[1],g[1],g[2],a,s];break;case"M":u=g[g.length-2],c=g[g.length-1];break;default:a=g[g.length-2],s=g[g.length-1]}o.push(g)}return o}function pa(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ga(t,e){return pa(t)*pa(e)?(t[0]*e[0]+t[1]*e[1])/(pa(t)*pa(e)):1}function va(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(ga(t,e))}function ya(t,e){return t[0]===e[0]&&t[1]===e[1]}function ma(t,e){var n=e[1],r=e[2],i=po(vo(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],c=e[6],h=e[7],l=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-h)/2,f=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-h)/2,d=l*l/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(f*f)+r*r*(l*l),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var v=r?g*n*f/r:0,y=n?g*-r*l/n:0,m=(s+c)/2+Math.cos(i)*v-Math.sin(i)*y,b=(u+h)/2+Math.sin(i)*v+Math.cos(i)*y,x=[(l-v)/n,(f-y)/r],w=[(-1*l-v)/n,(-1*f-y)/r],M=va([1,0],x),S=va(x,w);return ga(x,w)<=-1&&(S=Math.PI),ga(x,w)>=1&&(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&S<0&&(S+=2*Math.PI),{cx:m,cy:b,rx:ya(t,[c,h])?0:n,ry:ya(t,[c,h])?0:r,startAngle:M,endAngle:M+S,xRotation:i,arcFlag:o,sweepFlag:a}}function ba(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}var xa={circle:function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]},"triangle-down":function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}},wa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),-1!==["symbol","x","y","r","radius"].indexOf(e)&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return oo(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t,n,r=this.attr(),i=r.x,o=r.y,a=r.symbol||"circle",s=this._getR(r);if(io(a))n=da(n=(t=a)(i,o,s));else{if(!(t=e.Symbols[a]))return console.warn(a+" marker is not supported."),null;n=t(i,o,s)}return n},e.prototype.createPath=function(t){Ho(this,t,{path:this._getPath()},this.get("paramsCache"))},e.Symbols=xa,e}(Ko);function Ma(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function Sa(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function Oa(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(Sa(a,s,[e,n]))return!0;Ma(a[1]-n)>0!=Ma(s[1]-n)>0&&Ma(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}var ka="undefined"!=typeof Float32Array?Float32Array:Array,Ca=Math.random;Math.PI;function Ea(){var t=new ka(9);return ka!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Pa(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function ja(t){var e=new ka(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Aa(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Ia(t,e,n,r,i,o,a,s,u){var c=new ka(9);return c[0]=t,c[1]=e,c[2]=n,c[3]=r,c[4]=i,c[5]=o,c[6]=a,c[7]=s,c[8]=u,c}function Ta(t,e,n,r,i,o,a,s,u,c){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t}function Na(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ba(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function _a(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8],l=h*a-s*c,f=-h*o+s*u,d=c*o-a*u,p=n*l+r*f+i*d;return p?(p=1/p,t[0]=l*p,t[1]=(-h*r+i*c)*p,t[2]=(s*r-i*a)*p,t[3]=f*p,t[4]=(h*n-i*u)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-c*n+r*u)*p,t[8]=(a*n-r*o)*p,t):null}function La(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8];return t[0]=a*h-s*c,t[1]=i*c-r*h,t[2]=r*s-i*a,t[3]=s*u-o*h,t[4]=n*h-i*u,t[5]=i*o-n*s,t[6]=o*c-a*u,t[7]=r*u-n*c,t[8]=n*a-r*o,t}function Da(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8];return e*(c*o-a*u)+n*(-c*i+a*s)+r*(u*i-o*s)}function Ra(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=n[0],d=n[1],p=n[2],g=n[3],v=n[4],y=n[5],m=n[6],b=n[7],x=n[8];return t[0]=f*r+d*a+p*c,t[1]=f*i+d*s+p*h,t[2]=f*o+d*u+p*l,t[3]=g*r+v*a+y*c,t[4]=g*i+v*s+y*h,t[5]=g*o+v*u+y*l,t[6]=m*r+b*a+x*c,t[7]=m*i+b*s+x*h,t[8]=m*o+b*u+x*l,t}function Fa(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=n[0],d=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=f*r+d*a+c,t[7]=f*i+d*s+h,t[8]=f*o+d*u+l,t}function Xa(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],h=e[7],l=e[8],f=Math.sin(n),d=Math.cos(n);return t[0]=d*r+f*a,t[1]=d*i+f*s,t[2]=d*o+f*u,t[3]=d*a-f*r,t[4]=d*s-f*i,t[5]=d*u-f*o,t[6]=c,t[7]=h,t[8]=l,t}function Ya(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function za(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Wa(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function qa(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Ga(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function Va(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,h=r*a,l=r*s,f=i*a,d=i*s,p=i*u,g=o*a,v=o*s,y=o*u;return t[0]=1-l-p,t[3]=h-y,t[6]=f+v,t[1]=h+y,t[4]=1-c-p,t[7]=d-g,t[2]=f-v,t[5]=d+g,t[8]=1-c-l,t}function Ha(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=n*s-r*a,b=n*u-i*a,x=n*c-o*a,w=r*u-i*s,M=r*c-o*s,S=i*c-o*u,O=h*g-l*p,k=h*v-f*p,C=h*y-d*p,E=l*v-f*g,P=l*y-d*g,j=f*y-d*v,A=m*j-b*P+x*E+w*C-M*k+S*O;return A?(A=1/A,t[0]=(s*j-u*P+c*E)*A,t[1]=(u*C-a*j-c*k)*A,t[2]=(a*P-s*C+c*O)*A,t[3]=(i*P-r*j-o*E)*A,t[4]=(n*j-i*C+o*k)*A,t[5]=(r*C-n*P-o*O)*A,t[6]=(g*S-v*M+y*w)*A,t[7]=(v*x-p*S-y*b)*A,t[8]=(p*M-g*x+y*m)*A,t):null}function Ua(t,e,n){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/n,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Za(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Qa(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function Ka(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t}function $a(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t}function Ja(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t}function ts(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t}function es(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function ns(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],h=t[8],l=e[0],f=e[1],d=e[2],p=e[3],g=e[4],v=e[5],y=e[6],m=e[7],b=e[8];return Math.abs(n-l)<=1e-6*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(r-f)<=1e-6*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(i-d)<=1e-6*Math.max(1,Math.abs(i),Math.abs(d))&&Math.abs(o-p)<=1e-6*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(a-g)<=1e-6*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(s-v)<=1e-6*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-y)<=1e-6*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(c-m)<=1e-6*Math.max(1,Math.abs(c),Math.abs(m))&&Math.abs(h-b)<=1e-6*Math.max(1,Math.abs(h),Math.abs(b))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var rs=Ra,is=$a;function os(){var t=new ka(2);return ka!=Float32Array&&(t[0]=0,t[1]=0),t}function as(t){var e=new ka(2);return e[0]=t[0],e[1]=t[1],e}function ss(t,e){var n=new ka(2);return n[0]=t,n[1]=e,n}function us(t,e){return t[0]=e[0],t[1]=e[1],t}function cs(t,e,n){return t[0]=e,t[1]=n,t}function hs(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function ls(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function fs(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function ds(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function ps(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function gs(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function vs(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function ys(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function ms(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function bs(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function xs(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function ws(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function Ms(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function Ss(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function Os(t){var e=t[0],n=t[1];return e*e+n*n}function ks(t,e){return t[0]=-e[0],t[1]=-e[1],t}function Cs(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function Es(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function Ps(t,e){return t[0]*e[0]+t[1]*e[1]}function js(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function As(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function Is(t,e){e=e||1;var n=2*Ca()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function Ts(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function Ns(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function Bs(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function _s(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function Ls(t,e,n,r){var i=e[0]-n[0],o=e[1]-n[1],a=Math.sin(r),s=Math.cos(r);return t[0]=i*s-o*a+n[0],t[1]=i*a+o*s+n[1],t}function Ds(t,e){var n=t[0],r=t[1],i=e[0],o=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+o*o),s=a&&(n*i+r*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function Rs(t){return t[0]=0,t[1]=0,t}function Fs(t){return"vec2("+t[0]+", "+t[1]+")"}function Xs(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ys(t,e){var n=t[0],r=t[1],i=e[0],o=e[1];return Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))}var zs=Ss,Ws=ls,qs=fs,Gs=ds,Vs=ws,Hs=Ms,Us=Os,Zs=function(){var t=os();return function(e,n,r,i,o,a){var s,u;for(n||(n=2),r||(r=0),u=i?Math.min(i*n+r,e.length):e.length,s=r;s<u;s+=n)t[0]=e[s],t[1]=e[s+1],o(t,t,a),e[s]=t[0],e[s+1]=t[1];return e}}();function Qs(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return c.fromTranslation(r,n),c.multiply(t,r,e)}function Ks(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return c.fromRotation(r,n),c.multiply(t,r,e)}function $s(t,e,n){var r=[0,0,0,0,0,0,0,0,0];return c.fromScaling(r,n),c.multiply(t,r,e)}function Js(t,e){for(var n,r,i,o=t?[].concat(t):[1,0,0,0,1,0,0,0,1],a=0,s=e.length;a<s;a++){var u=e[a];switch(u[0]){case"t":Qs(o,o,[u[1],u[2]]);break;case"s":$s(o,o,[u[1],u[2]]);break;case"r":Ks(o,o,u[1]);break;case"m":n=o,r=o,i=u[1],c.multiply(n,i,r)}}return o}function tu(t,e){return t[0]*e[1]-e[0]*t[1]}function eu(t,e,n){var r=h.angle(t,e),i=tu(t,e)>=0;return n?i?2*Math.PI-r:r:i?r:2*Math.PI-r}function nu(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}function ru(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}!function(){var t,e=(t=new ka(3),ka!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t)}();function iu(t,e,n,r,i,o,a,s){var u=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI);if(u<r||u>i)return!1;var c={x:t+n*Math.cos(u),y:e+n*Math.sin(u)};return mo(c.x,c.y,a,s)<=o/2}var ou=l.transform;var au=v({hasArc:function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e},extractPolygons:function(t){for(var e=t.length,n=[],r=[],i=[],o=0;o<e;o++){var a=t[o],s=a[0];"M"===s?(i.length&&(r.push(i),i=[]),i.push([a[1],a[2]])):"Z"===s?i.length&&(n.push(i),i=[]):i.push([a[1],a[2]])}return i.length>0&&r.push(i),{polygons:n,polylines:r}},isPointInStroke:function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var u=t[s],c=u.currentPoint,h=u.params,l=u.prePoint,f=u.box;if(!f||bo(f.x-a,f.y-a,f.width+e,f.height+e,n,r)){switch(u.command){case"L":case"Z":o=ia(l[0],l[1],c[0],c[1],e,n,r);break;case"Q":o=Pi.pointDistance(l[0],l[1],h[1],h[2],h[3],h[4],n,r)<=e/2;break;case"C":o=Bi.pointDistance(l[0],l[1],h[1],h[2],h[3],h[4],h[5],h[6],n,r,i)<=e/2;break;case"A":var d=u.arcParams,p=d.cx,g=d.cy,v=d.rx,y=d.ry,m=d.startAngle,b=d.endAngle,x=d.xRotation,w=[n,r,1],M=v>y?v:y;ru(w,w,ou(null,[["t",-p,-g],["r",-x],["s",1/(v>y?1:v/y),1/(v>y?y/v:1)]])),o=iu(0,0,M,m,b,e,w[0],w[1])}if(o)break}}return o}},r);function su(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=Oa(t[i],e,n))break}return r}var uu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this._setPathArr(t.path),this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),"path"===e&&this._setPathArr(n),this.setArrow()},e.prototype._setPathArr=function(t){this.attrs.path=da(t);var e=au.hasArc(t);this.set("hasArc",e),this.set("paramsCache",{}),this.set("segments",null),this.set("curve",null),this.set("tCache",null),this.set("totalLength",null)},e.prototype.getSegments=function(){var t=this.get("segements");return t||(t=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=(t=ua(t)).length,s=0;s<a;s++){var u=t[s];r=t[s+1];var c=u[0],h={command:c,prePoint:n,params:u,startTangent:null,endTangent:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var l=ma(n,u);h.arcParams=l}if("Z"===c)n=i,r=t[o+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),h.currentPoint=n,e[o]&&ya(n,e[o].currentPoint)&&(e[o].prePoint=h.prePoint);var d=r?[r[r.length-2],r[r.length-1]]:null;h.nextPoint=d;var p=h.prePoint;if(["L","H","V"].includes(c))h.startTangent=[p[0]-n[0],p[1]-n[1]],h.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===c){var g=[u[1],u[2]];h.startTangent=[p[0]-g[0],p[1]-g[1]],h.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===c){g=ba((m=e[s-1]).currentPoint,p);"Q"===m.command?(h.command="Q",h.startTangent=[p[0]-g[0],p[1]-g[1]],h.endTangent=[n[0]-g[0],n[1]-g[1]]):(h.command="TL",h.startTangent=[p[0]-n[0],p[1]-n[1]],h.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===c){var v=[u[1],u[2]],y=[u[3],u[4]];h.startTangent=[p[0]-v[0],p[1]-v[1]],h.endTangent=[n[0]-y[0],n[1]-y[1]]}else if("S"===c){var m;v=ba((m=e[s-1]).currentPoint,p),y=[u[1],u[2]];"C"===m.command?(h.command="C",h.startTangent=[p[0]-v[0],p[1]-v[1]],h.endTangent=[n[0]-y[0],n[1]-y[1]]):(h.command="SQ",h.startTangent=[p[0]-y[0],p[1]-y[1]],h.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===c){var b=.001,x=h.arcParams||{},w=x.cx,M=void 0===w?0:w,S=x.cy,O=void 0===S?0:S,k=x.rx,C=void 0===k?0:k,E=x.ry,P=void 0===E?0:E,j=x.sweepFlag,A=void 0===j?0:j,I=x.startAngle,T=void 0===I?0:I,N=x.endAngle,B=void 0===N?0:N;0===A&&(b*=-1);var _=C*Math.cos(T-b)+M,L=P*Math.sin(T-b)+O;h.startTangent=[_-i[0],L-i[1]];var D=C*Math.cos(T+B+b)+M,R=P*Math.sin(T+B-b)+O;h.endTangent=[p[0]-D,p[1]-R]}e.push(h)}return e}(this.attr("path")),this.set("segments",t)),t},e.prototype.setArrow=function(){var t,e=this.attr(),n=e.startArrow,r=e.endArrow;n&&Fo(this,e,(t=this.getStartTangent())[0][0],t[0][1],t[1][0],t[1][1]);r&&Xo(this,e,(t=this.getEndTangent())[0][0],t[0][1],t[1][0],t[1][1])},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.getSegments(),a=(this.get("hasArc"),!1);if(n){var s=this.getTotalLength();a=au.isPointInStroke(o,i,t,e,s)}if(!a&&r){var u=this.attr("path"),c=au.extractPolygons(u);a=su(c.polygons,t,e)||su(c.polylines,t,e)}return a},e.prototype.createPath=function(t){Ho(this,t,this.attr(),this.get("paramsCache"))},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.get("totalLength");return oo(t)?(this._calculateCurve(),this._setTcache(),this.get("totalLength")):t},e.prototype.getPoint=function(t){var e,n,r=this.get("tCache");r||(this._calculateCurve(),this._setTcache(),r=this.get("tCache"));var i=this.get("curve");if(!r||0===r.length)return i?{x:i[0][1],y:i[0][2]}:null;co(r,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)}));var o=i[n];if(oo(o)||oo(n))return null;var a=o.length,s=i[n+1];return Bi.pointAt(o[a-2],o[a-1],s[1],s[2],s[3],s[4],s[5],s[6],e)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",au.pathToCurve(t))},e.prototype._setTcache=function(){var t,e,n,r,i=0,o=0,a=[],s=this.get("curve");s&&(co(s,(function(t,e){n=s[e+1],r=t.length,n&&(i+=Bi.length(t[r-2],t[r-1],n[1],n[2],n[3],n[4],n[5],n[6])||0)})),this.set("totalLength",i),0!==i?(co(s,(function(u,c){n=s[c+1],r=u.length,n&&((t=[])[0]=o/i,e=Bi.length(u[r-2],u[r-1],n[1],n[2],n[3],n[4],n[5],n[6]),o+=e||0,t[1]=o/i,a.push(t))})),this.set("tCache",a)):this.set("tCache",[]))},e.prototype.getStartTangent=function(){var t,e=this.getSegments();if(e.length>1){var n=e[0].currentPoint,r=e[1].currentPoint,i=e[1].startTangent;t=[],i?(t.push([n[0]-i[0],n[1]-i[1]]),t.push([n[0],n[1]])):(t.push([r[0],r[1]]),t.push([n[0],n[1]]))}return t},e.prototype.getEndTangent=function(){var t,e=this.getSegments(),n=e.length;if(n>1){var r=e[n-2].currentPoint,i=e[n-1].currentPoint,o=e[n-1].endTangent;t=[],o?(t.push([i[0]-o[0],i[1]-o[1]]),t.push([i[0],i[1]])):(t.push([r[0],r[1]]),t.push([i[0],i[1]]))}return t},e}(Ko);function cu(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(ia(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],u=t[o-1];if(ia(s[0],s[1],u[0],u[1],e,n,r))return!0}return!1}var hu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr().points,a=!1;return n&&(a=cu(o,i,t,e,!0)),!a&&r&&(a=Oa(o,t,e)),a},e.prototype.createPath=function(t){var e=this.attr().points;if(!(e.length<2)){t.beginPath();for(var n=0;n<e.length;n++){var r=e[n];0===n?t.moveTo(r[0],r[1]):t.lineTo(r[0],r[1])}t.closePath()}},e}(Ko),lu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),this.setArrow(),-1!==["points"].indexOf(e)&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.setArrow=function(){var t=this.attr(),e=this.attrs,n=e.points,r=e.startArrow,i=e.endArrow,o=n.length,a=n[0][0],s=n[0][1],u=n[o-1][0],c=n[o-1][1];r&&Fo(this,t,n[1][0],n[1][1],a,s),i&&Xo(this,t,n[o-2][0],n[o-2][1],u,c)},e.prototype.isFill=function(){return!1},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){return!(!n||!i)&&cu(this.attr().points,i,t,e,!1)},e.prototype.isStroke=function(){return!0},e.prototype.createPath=function(t){var e=this.attr(),n=e.points,r=e.startArrow,i=e.endArrow,o=n.length;if(!(n.length<2)){var a,s=n[0][0],u=n[0][1],c=n[o-1][0],h=n[o-1][1];if(r&&r.d)s+=(a=Ro(s,u,n[1][0],n[1][1],r.d)).dx,u+=a.dy;if(i&&i.d)c-=(a=Ro(n[o-2][0],n[o-2][1],c,h,i.d)).dx,h-=a.dy;t.beginPath(),t.moveTo(s,u);for(var l=0;l<o-1;l++){var f=n[l];t.lineTo(f[0],f[1])}t.lineTo(c,h)}},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return oo(e)?(this.set("totalLength",Fi(t)),this.get("totalLength")):e},e.prototype.getPoint=function(t){var e,n,r=this.attr().points,i=this.get("tCache");return i||(this._setTcache(),i=this.get("tCache")),co(i,(function(r,i){t>=r[0]&&t<=r[1]&&(e=(t-r[0])/(r[1]-r[0]),n=i)})),Mi.pointAt(r[n][0],r[n][1],r[n+1][0],r[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,r,i=0,o=[];co(t,(function(a,s){t[s+1]&&((n=[])[0]=i/e,r=Mi.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=r,n[1]=i/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(Ko);var fu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,e,n,r,i){var o=this.attr(),a=o.x,s=o.y,u=o.width,c=o.height,h=o.radius;if(h){var l=!1;return n&&(l=function(t,e,n,r,i,o,a,s){return ia(t+i,e,t+n-i,e,o,a,s)||ia(t+n,e+i,t+n,e+r-i,o,a,s)||ia(t+n-i,e+r,t+i,e+r,o,a,s)||ia(t,e+r-i,t,e+i,o,a,s)||iu(t+n-i,e+i,i,1.5*Math.PI,2*Math.PI,o,a,s)||iu(t+n-i,e+r-i,i,0,.5*Math.PI,o,a,s)||iu(t+i,e+r-i,i,.5*Math.PI,Math.PI,o,a,s)||iu(t+i,e+i,i,Math.PI,1.5*Math.PI,o,a,s)}(a,s,u,c,h,i,t,e)),!l&&r&&(l=bo(a,s,u,c,t,e)),l}var f=i/2;return r&&n?bo(a-f,s-f,u+f,c+f,t,e):r?bo(a,s,u,c,t,e):n?function(t,e,n,r,i,o,a){var s=i/2;return bo(t-s,e-s,n,i,o,a)||bo(t+n-s,e-s,i,r,o,a)||bo(t+s,e+r-s,n,i,o,a)||bo(t-s,e+s,i,r,o,a)}(a,s,u,c,i,t,e):void 0},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,r=e.y,i=e.width,o=e.height,a=e.radius;if(t.beginPath(),0===a)t.rect(n,r,i,o);else{var s=function(t){var e=0,n=0,r=0,i=0;return ao(t)?1===t.length?e=n=r=i=t[0]:2===t.length?(e=r=t[0],n=i=t[1]):3===t.length?(e=t[0],n=i=t[1],r=t[2]):(e=t[0],n=t[1],r=t[2],i=t[3]):e=n=r=i=t,[e,n,r,i]}(a),u=s[0],c=s[1],h=s[2],l=s[3];t.moveTo(n+u,r),t.lineTo(n+i-c,r),0!==c&&t.arc(n+i-c,r+c,c,-Math.PI/2,0),t.lineTo(n+i,r+o-h),0!==h&&t.arc(n+i-h,r+o-h,h,0,Math.PI/2),t.lineTo(n+l,r+o),0!==l&&t.arc(n+l,r+o-l,l,Math.PI/2,Math.PI),t.lineTo(n,r+u),0!==u&&t.arc(n+u,r+u,u,Math.PI,1.5*Math.PI),t.closePath()}},e}(Ko),du=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return g(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return v(v({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=Gi(t)},e.prototype._setText=function(t){var e=null;lo(t)&&-1!==t.indexOf("\n")&&(e=t.split("\n")),this.set("textArr",e)},e.prototype.onAttrChange=function(e,n,r){t.prototype.onAttrChange.call(this,e,n,r),e.startsWith("font")&&this._assembleFont(),"text"===e&&this._setText(n)},e.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,n=1*t.fontSize;return e?e-n:.14*n},e.prototype._drawTextArr=function(t,e,n){var r,i=this.attrs,o=i.textBaseline,a=i.x,s=i.y,u=1*i.fontSize,c=this._getSpaceingY(),h=Wi(i.text,i.fontSize,i.lineHeight);co(e,(function(e,i){r=s+i*(c+u)-h+u,"middle"===o&&(r+=h-u-(h-u)/2),"top"===o&&(r+=h-u),n?t.fillText(e,a,r):t.strokeText(e,a,r)}))},e.prototype._drawText=function(t,e){var n=this.attr(),r=n.x,i=n.y,o=this.get("textArr");if(o)this._drawTextArr(t,o,e);else{var a=n.text;e?t.fillText(a,r,i):t.strokeText(a,r,i)}},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,r=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isStroke()&&n>0&&(oo(i)||1===i||(t.globalAlpha=r),this.stroke(t)),this.isFill()&&(oo(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=r)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(Ko);function pu(t,e,n){var r,i,o=t.getTotalMatrix();if(o){var a=(r=[e,n,1],(i=o)?Ye(ze(i),r):r);return[a[0],a[1]]}return[e,n]}function gu(t,e,n){if(t.isCanvas&&t.isCanvas())return!0;if(!it(t)||!1===t.cfg.isInView)return!1;if(t.cfg.clipShape){var r=pu(t,e,n),i=r[0],o=r[1];if(t.isClipped(i,o))return!1}var a=t.cfg.cacheCanvasBBox||t.getCanvasBBox();return e>=a.minX&&e<=a.maxX&&n>=a.minY&&n<=a.maxY}var vu=n(32),yu=n.n(vu);function mu(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function bu(t,e,n){if(n.bubbles){t.isCanvas(),0,n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var xu=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.panstartShape=null,this.panstartPoint=null,this.handleEvent=function(t){e.hammerRuntime.emit("origin_input:"+t.type,t)},this.canvas=t.canvas,this._initEvent()}return t.prototype._initEvent=function(){var t=this;this.hammerRuntime=new yu.a({},{inputClass:vu.TouchInput}),this.hammerRuntime.add(new yu.a.Pan({threshold:0,pointers:1})),this.hammerRuntime.add(new yu.a.Swipe).recognizeWith(this.hammerRuntime.get("pan")),this.hammerRuntime.add(new yu.a.Pinch({threshold:0,pointers:2})),this.hammerRuntime.add(new yu.a.Tap({event:"dbltap",taps:2})),this.hammerRuntime.add(new yu.a.Tap),this.hammerRuntime.add(new yu.a.Press({time:500})),this.hammerRuntime.on("panstart panmove panend pancancel",(function(e){e.srcEvent.extra=e;var n=t._getPointInfo(e),r=t._getShape(n,e);"panend"!==e.type&&"pancancel"!==e.type||t._onpanend(n,r,e),"panstart"===e.type&&(t.dragging&&(t.draggingShape=null,t.dragging=!1,t.panstartShape=null,t.panstartPoint=null),t._onpanstart(n,r,e)),"panmove"===e.type&&t._onpanmove(n,r,e),t.currentShape=r})),this.hammerRuntime.on("tap dbltap press swipe rotatestart rotatemove",(function(e){t._emitMobileEvent(e.type,e)})),this.hammerRuntime.on("pinchstart pinchmove pinchend pinchcancel",(function(e){"pinchend"!==e.type&&"pinchcancel"!==e.type?(e.srcEvent.extra={scale:e.scale},t._emitMobileEvent(e.type,e)):t._emitMobileEvent(e.type,e)}))},t.prototype._emitMobileEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e);this._emitEvent(t,e,n,r)},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new K(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){var n=e.srcEvent;return this.canvas.getShape(t.x,t.y,n)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t];if(i)i.call(this,n,r,e);else{var o=this.currentShape;"panstart"===t||"dragenter"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"panstart"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"panend"===t||"dragleave"===t?(o&&this._emitEvent(t,e,n,o,o,null),this._emitEvent(t,e,n,null,o,null),"panend"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}},t.prototype._onpanstart=function(t,e,n){this.panstartShape=e,this.panstartPoint=t,this.panstartTimeStamp=n.timeStamp,this._emitEvent("panstart",n,t,e,null,null)},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);this.currentShape=r},t.prototype._onpanend=function(t,e,n){var r=this.draggingShape;this.dragging&&(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)),this._emitEvent("panend",n,t,e),this.panstartShape=null,this.panstartPoint=null},t.prototype._onpanmove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.panstartPoint;if(a){var s=this.panstartShape,u=n.timeStamp-this.panstartTimeStamp,c=a.clientX-t.clientX,h=a.clientY-t.clientY;(u>120||c*c+h*h>40)&&(s&&s.get("draggable")?((o=this.panstartShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.panstartShape=null,this.panstartPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.panstartShape=null,this.panstartPoint=null):this._emitEvent("panmove",n,t,e))}}this._emitEvent("panmove",n,t,e)},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,mu(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||bu(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{mu(this.canvas,t,a)}},t.prototype.destroy=function(){this.canvas=null,this.currentShape=null,this.draggingShape=null,this.panstartPoint=null,this.panstartShape=null,this.panstartTimeStamp=null},t}(),wu=function(){function t(){}return t.prototype.set=function(t,e,n){switch(e){case"strokeStyle":t.setStrokeStyle(n);break;case"fillStyle":t.setFillStyle(n);break;case"lineWidth":t.setLineWidth(n);break;case"lineDash":t.setLineDash(n);break;case"globalAlpha":(n||0===n)&&(t.globalAlpha=n,t.setGlobalAlpha(n));break;case"fontSize":t.setFontSize(n);break;case"textAlign":t.setTextAlign(n);break;case"fontStyle":case"font":t.setFont(n);break;case"textBaseline":t.setTextBaseline(n);break;default:t[e]=n}return!0},t.prototype.get=function(t,e){return"globalAlpha"===e&&void 0===t[e]?1:"function"==typeof t[e]?t[e].bind(t):t[e]},t}(),Mu=n(103),Su=null;var Ou=function(t){var e=t.attr(),n=e.x,r=e.y,i=e.text,o=e.fontSize,a=e.lineHeight,s=e.font;s||(s=Object(Mu.assembleFont)(e));var u,c=function(t,e){var n=0;if(oo(t)||""===t)return n;if(Su.save(),Su.font=e,lo(t)&&t.includes("\n")){var r=t.split("\n");co(r,(function(t){var e=Su.measureText(t).width;n<e&&(n=e)}))}else n=Su.measureText(t).width;return Su.restore(),n}(i,s);if(c){var h=e.textAlign,l=e.textBaseline,f=Object(Mu.getTextHeight)(i,o,a),d={x:n,y:r-f};h&&("end"===h||"right"===h?d.x-=c:"center"===h&&(d.x-=c/2)),l&&("top"===l?d.y+=f:"middle"===l&&(d.y+=f/2)),u={x:d.x,y:d.y,width:c,height:f}}else u={x:n,y:r,width:0,height:0};return u},ku=function(t){Su=t,ni("text",Ou)},Cu=function(t,e){!function(t){na=t}(e),ku(t)},Eu=function(t){function e(e){var n=t.call(this,e)||this,r=n.get("context");return n.isMini()&&(n.isMiniNative()?Object(yo.c)(n.get("container")):n.set("context",new Proxy(r,new wu)),Cu(r,n)),n}return g(e,t),e.prototype.isMiniNative=function(){return"mini-native"===this.get("renderer")},e.prototype.isMini=function(){return this.get("renderer").startsWith("mini")},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.renderer="canvas",e.autoDraw=!0,e.localRefresh=!0,e.refreshElements=[],e.clipView=!0,e.quickHit=!1,e.boundingClientRect={width:0,height:0,left:0,top:0,bottom:0,right:0},e},e.prototype.initEvents=function(){var t=new xu({canvas:this});this.set("eventController",t)},e.prototype.registerEventCallback=function(t){this.get("eventController").handleEvent(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return f},e.prototype.getGroupBase=function(){return Qo},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||("object"==typeof window&&window.devicePixelRatio?window.devicePixelRatio:1);return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.initDom=function(){if(this.isMini()){var e=this.get("context"),n=this.getPixelRatio();n>1&&e.scale(n,n)}else t.prototype.initDom.call(this)},e.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},e.prototype.setDOMSize=function(e,n){t.prototype.setDOMSize.call(this,e,n);var r=this.get("context"),i=this.get("el"),o=this.getPixelRatio();i.width=o*e,i.height=o*n,o>1&&r.scale(o,o)},e.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame(),this.get("context").clearRect(0,0,this.get("width"),this.get("height"))},e.prototype.getShape=function(e,n){return this.get("quickHit")?function t(e,n,r){if(!gu(e,n,r))return null;for(var i=null,o=e.getChildren(),a=o.length-1;a>=0;a--){var s=o[a];if(s.isGroup())i=t(s,n,r);else if(gu(s,n,r)){var u=s,c=pu(s,n,r),h=c[0],l=c[1];u.isInShape(h,l)&&(i=s)}if(i)break}return i}(this,e,n):t.prototype.getShape.call(this,e,n,null)},e.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),n=this.getViewRange();e.length&&e[0]===this?t=n:(t=function(t){if(!t.length)return null;var e=[],n=[],r=[],i=[];return co(t,(function(t){var o=Zo(t);o&&(e.push(o.minX),n.push(o.minY),r.push(o.maxX),i.push(o.maxY))})),{minX:Math.min.apply(null,e),minY:Math.min.apply(null,n),maxX:Math.max.apply(null,r),maxY:Math.max.apply(null,i)}}(e))&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=function(t,e){return t&&e&&xo(t,e)?{minX:Math.max(t.minX,e.minX),minY:Math.max(t.minY,e.minY),maxX:Math.min(t.maxX,e.maxX),maxY:Math.min(t.maxY,e.maxY)}:null}(t,n)));return t},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(Object(yo.a)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._startDraw=function(){var t=this,e=this.get("drawFrame");e||(e=Object(yo.b)((function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),Object(yo.a)(e),t.set("drawFrame",null)})),this.set("drawFrame",e))},e.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),n=this.getChildren(),r=this._getRefreshRegion();r?(t.clearRect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.save(),t.beginPath(),t.rect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.clip(),zo(t,this),qo(this,n,r),Wo(t,n,r),t.restore()):e.length&&function t(e){for(var n=0;n<e.length;n++){var r=e[n];r.cfg.hasChanged=!1,r.isGroup()&&!r.destroyed&&t(r.cfg.children)}}(e),co(e,(function(t){t.get("hasChanged")&&t.set("hasChanged",!1)})),this.isMini()&&!this.isMiniNative()&&t.draw(!0),this.set("refreshElements",[])},e.prototype._drawAll=function(){var t=this.get("context"),e=this.getChildren();t.clearRect(0,0,this.get("width"),this.get("height")),zo(t,this),Wo(t,e),this.isMini()&&!this.isMiniNative()&&t.draw(!0),this.set("refreshElements",[])},e.prototype.skipDraw=function(){},e.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},e.prototype.getPointByEvent=function(e){if(this.isMini()){var n=this.getClientByEvent(e),r=n.x,i=n.y;return this.getPointByClient(r,i)}return t.prototype.getPointByEvent.call(this,e)},e.prototype.getClientByEvent=function(t){var e=t.srcEvent,n=null;return e.touches&&(n="touchend"===e.type?e.changedTouches[0]:e.touches[0]),n?{x:n.clientX,y:n.clientY}:{}},e.prototype.getPointByClient=function(t,e){if(this.isMini()){var n=this.get("boundingClientRect");return{x:t+n.left,y:e+n.top}}var r=this.get("el").getBoundingClientRect();return{x:t-r.left,y:e-r.top}},e.prototype.removeDom=function(){this.isMini()||t.prototype.removeDom.call(this)},e.prototype.getClientByPoint=function(t,e){if(this.isMini()){var n=this.get("boundingClientRect");return{x:t+n.left,y:e+n.top}}var r=this.get("el").getBoundingClientRect();return{x:t+r.left,y:e+r.top}},e}($r),Pu=n(8);var ju=n(0),Au=n(2),Iu=n(18),Tu=Au.n.cloneEvent,Nu=Au.n.isViewportChanged,Bu=function(t){function e(e){var n=t.call(this,e)||this;return n.extendEvents=[],n.dragging=!1,n.preItem=null,n.graph=e,n.destroyed=!1,n}return Object(d.c)(e,t),e.prototype.initEvents=function(){var t=this.graph,e=(this.extendEvents,t.get("canvas"));this.canvasHandler=Object(ju.x)(this,"onCanvasEvents"),e.off("*").on("*",this.canvasHandler)},e.getItemRoot=function(t){for(;t&&!t.get("item");)t=t.get("parent");return t},e.prototype.onCanvasEvents=function(t){var n=this.graph,r=n.get("canvas"),i=t.target,o=t.type;t.canvasX=t.x,t.canvasY=t.y;var a={x:t.canvasX,y:t.canvasY},s=n.get("group").getMatrix();if(s||(s=[1,0,0,0,1,0,0,0,1]),Nu(s)&&(a=n.getPointByClient(t.clientX,t.clientY)),t.x=a.x,t.y=a.y,t.currentTarget=n,i===r)return"panmove"===o&&this.handleTouchMove(t,"canvas"),t.target=r,t.item=null,n.emit(o,t),void n.emit("canvas:"+o,t);var u=e.getItemRoot(i);if(u){var c=u.get("item");if(!c.destroyed){var h=c.getType();if(t.target=i,t.item=c,t.canvasX===t.x&&t.canvasY===t.y){var l=n.getCanvasByPoint(t.x,t.y);t.canvasX=l.x,t.canvasY=l.y}n.emit(o,t),t.name&&!t.name.includes(":")?n.emit(h+":"+o,t):n.emit(t.name,t),"dragstart"===o&&(this.dragging=!0),"dragend"===o&&(this.dragging=!1),"panmove"===o&&this.handleTouchMove(t,h)}}else n.emit(o,t)},e.prototype.onExtendEvents=function(t){this.graph.emit(t.type,t)},e.prototype.emitCustomEvent=function(t,e,n){n.type=e,this.graph.emit(t+":"+e,n)},e.prototype.destroy=function(){var t=this.graph,e=this.canvasHandler,n=this.extendEvents;t.get("canvas").off("*",e),Object(ju.c)(n,(function(t){t.remove()})),this.dragging=!1,this.preItem=null,this.extendEvents.length=0,this.canvasHandler=null,this.destroyed=!0},e.prototype.handleTouchMove=function(t,e){var n=this.graph,r=this.preItem,i=n.get("canvas"),o=t.target===i?null:t.item;t=Tu(t),r&&r!==o&&!r.destroyed&&(t.item=r,this.emitCustomEvent(r.getType(),"touchleave",t),this.dragging&&this.emitCustomEvent(r.getType(),"dragleave",t)),o&&r!==o&&(t.item=o,this.emitCustomEvent(e,"touchenter",t),this.dragging&&this.emitCustomEvent(e,"dragenter",t)),this.preItem=o},e}(Au.a),_u=n(27),Lu=["force","grid","circular"],Du=function(t){function e(e){var n=t.call(this,e)||this;return n.graph=e,n.layoutCfg=e.get("layout")||{},n.layoutType=n.getLayoutType(),n}return Object(d.c)(e,t),e.prototype.updateLayoutCfg=function(t){var e=this,n=this.graph,r=this.layoutMethods,i=Object(ju.r)({},this.layoutCfg,t);if(this.layoutCfg=i,null==r?void 0:r.length){this.data=this.setDataFromGraph(),n.emit("beforelayout");var o=Promise.resolve();1===r.length?o=o.then((function(){return e.updateLayoutMethod(r[0],i)})):null==r||r.forEach((function(t,n){var r=i.pipes[n];o=o.then((function(){return e.updateLayoutMethod(t,r)}))})),this.data=this.setDataFromGraph(),o.then((function(){i.onAllLayoutEnd&&i.onAllLayoutEnd()})).catch((function(t){console.warn("layout failed",t)}))}else this.layout()},e.prototype.layout=function(t){var e=this,n=this.graph;this.data=this.setDataFromGraph();var r=this.data,i=r.nodes,o=r.hiddenNodes;if(!i)return!1;var a=n.get("width"),s=n.get("height"),u={};Object.assign(u,{width:a,height:s,center:[a/2,s/2]},this.layoutCfg),this.layoutCfg=u,this.destoryLayoutMethods(),n.emit("beforelayout"),this.initPositions(u.center,i),this.initPositions(u.center,o);var c=u.onLayoutEnd,h=u.layoutEndFormatted,l=u.adjust;h||(u.layoutEndFormatted=!0,u.onAllLayoutEnd=function(){return Object(d.b)(e,void 0,void 0,(function(){return Object(d.d)(this,(function(t){switch(t.label){case 0:return c&&c(),this.refreshLayout(),l&&u.pipes?[4,this.adjustPipesBox(this.data,l)]:[3,2];case 1:t.sent(),this.refreshLayout(),t.label=2;case 2:return n.emit("afterlayout"),[2]}}))}))});var f=Promise.resolve();return u.type?f=f.then((function(){return e.execLayoutMethod(u,0)})):u.pipes&&u.pipes.forEach((function(t,n){f=f.then((function(){return e.execLayoutMethod(t,n)}))})),f.then((function(){u.onAllLayoutEnd&&u.onAllLayoutEnd(),t&&t()})).catch((function(t){console.warn("graph layout failed,",t)})),!1},e.prototype.execLayoutMethod=function(t,e){var n=this;return new Promise((function(r,i){var o=n.graph,a=t.type;if(t.onLayoutEnd=function(){o.emit("aftersublayout",{type:a}),r()},"force"===a||"g6force"===a||"gForce"===a){var s=t.onTick,u=function(){s&&s(),o.refreshPositions()};t.tick=u}else"comboForce"===t.type&&(t.comboTrees=o.get("comboTrees"));var c;try{c=new _u.a(t)}catch(t){console.warn("The layout method: '"+a+"' does not exist! Please specify it first."),i()}if(c.enableTick){var h=t.onTick;u=function(){h&&h(),o.refreshPositions()};c.tick=u}var l=n.filterLayoutData(n.data,t);!function(t,e){var n;if(!(null===(n=null==t?void 0:t.nodes)||void 0===n?void 0:n.length))return;t.nodes.forEach((function(t){t.layoutOrder=e}))}(l,e),c.init(l),o.emit("beforesublayout",{type:a}),c.execute(),c.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd(),n.layoutMethods.push(c)}))},e.prototype.updateLayoutMethod=function(t,e){var n=this;return new Promise((function(r,i){var o=n.graph,a=null==e?void 0:e.type;e.onLayoutEnd=function(){o.emit("aftersublayout",{type:a}),r()};var s=n.filterLayoutData(n.data,e);t.init(s),t.updateCfg(e),o.emit("beforesublayout",{type:a}),t.execute(),t.isCustomLayout&&e.onLayoutEnd&&e.onLayoutEnd()}))},e.prototype.adjustPipesBox=function(t,e){var n=this;return new Promise((function(r){var i=t.nodes;(null==i?void 0:i.length)||r(),Lu.includes(e)||(console.warn("The adjust type "+e+" is not supported yet, please assign it with 'force', 'grid', or 'circular'."),r());var o={center:n.layoutCfg.center,nodeSize:function(t){return Math.max(t.height,t.width)},preventOverlap:!0,onLayoutEnd:function(){}},a=n.getLayoutBBox(i),s=a.groupNodes,u=a.layoutNodes,c=Object(ju.a)(u);o.onLayoutEnd=function(){null==u||u.forEach((function(t,e){var n,r,i,o=t.x-(null===(n=c[e])||void 0===n?void 0:n.x),a=t.y-(null===(r=c[e])||void 0===r?void 0:r.y);null===(i=s[e])||void 0===i||i.forEach((function(t){t.x+=o,t.y+=a}))})),r()},new _u.a(o).layout({nodes:u})}))},e.prototype.destroy=function(){this.destoryLayoutMethods(),this.destroyed=!0,this.graph.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0,this.graph=null},e}(Au.c);var Ru=n(48),Fu=function(t,e,n){return n[t]&&console.warn("The graph with the name "+t+" exists already, it will be overridden"),n[t]=e(n),n},Xu=function(t){function e(e){var n=t.call(this,e)||this;n.get("renderer").startsWith("mini")&&n.set("context",e.context),t.prototype.init.call(n);var r=n.get("defaultNode");return r||n.set("defaultNode",{type:"circle"}),r.type||(r.type="circle",n.set("defaultNode",r)),n.destroyed=!1,n}return Object(d.c)(e,t),e.prototype.init=function(){},e.prototype.emitEvent=function(t){var e=this.get("canvas");t.type=t.type.toLowerCase(),e.registerEventCallback(t)},e.prototype.initLayoutController=function(){var t=new Du(this);this.set({layoutController:t})},e.prototype.initEventController=function(){var t=new Bu(this);if(this.set({eventController:t}),!this.get("renderer").startsWith("mini")){var e=this.get("canvas"),n=e.get("el");"touchstart touchmove touchend touchcancel".split(" ").forEach((function(t){n.addEventListener(t,e.registerEventCallback.bind(e),!1)}))}},e.prototype.initCanvas=function(){var t=this.get("container");null!==t&&"string"==typeof t&&(t=document.getElementById(t),this.set("container",t));var e=this.get("renderer");if(!t&&!e.startsWith("mini"))throw new Error("invalid container");var n=this.get("width"),r=this.get("height"),i={container:t,context:this.get("context"),width:n,height:r,renderer:e,fitView:this.get("fitView")},o=this.get("pixelRatio");o&&(i.pixelRatio=o);var a=new Eu(i);this.set("canvas",a)},e.prototype.initPlugins=function(){var t=this;Object(ju.c)(t.get("plugins"),(function(e){!e.destroyed&&e.initPlugin&&e.initPlugin(t)}))},e.prototype.toDataURL=function(t,e){var n=this.get("canvas"),r=n.getRenderer(),i=n.get("el");t||(t="image/png");var o="";if("svg"===r){var a=i.cloneNode(!0),s=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),u=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",s);u.replaceChild(a,u.documentElement);var c=(new XMLSerializer).serializeToString(u);o="data:image/svg+xml;charset=utf8,"+encodeURIComponent(c)}else{var h=void 0,l=i.getContext("2d"),f=this.get("width"),d=this.get("height"),p=void 0;if(e){var g="undefined"!=typeof window?window.devicePixelRatio:1;h=l.getImageData(0,0,f*g,d*g),p=l.globalCompositeOperation,l.globalCompositeOperation="destination-over",l.fillStyle=e,l.fillRect(0,0,f,d)}o=i.toDataURL(t),e&&(l.clearRect(0,0,f,d),l.putImageData(h,0,0),l.globalCompositeOperation=p)}return o},e.prototype.toFullDataURL=function(t,e,n){var r=this.get("group").getCanvasBBox(),i=r.height,o=r.width,a=this.get("renderer"),s=Object(Ru.a)('<id="virtual-image"></div>'),u=n?n.backgroundColor:void 0,c=n?n.padding:void 0;c?Object(ju.k)(c)&&(c=[c,c,c,c]):c=[0,0,0,0];var h=i+c[0]+c[2],l=o+c[1]+c[3],f=new Eu({container:s,height:h,width:l,quickHit:!0}),d=this.get("group").clone(),p=Object(ju.a)(d.getMatrix());p||(p=[1,0,0,0,1,0,0,0,1]);var g=(r.maxX+r.minX)/2,v=(r.maxY+r.minY)/2;Pu.a.translate(p,p,[-g,-v]),Pu.a.translate(p,p,[o/2+c[3],i/2+c[0]]),d.resetMatrix(),d.setMatrix(p),f.add(d);var y=f.get("el"),m="";e||(e="image/png"),setTimeout((function(){if("svg"===a){var n=y.cloneNode(!0),r=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),i=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",r);i.replaceChild(n,i.documentElement);var o=(new XMLSerializer).serializeToString(i);m="data:image/svg+xml;charset=utf8,"+encodeURIComponent(o)}else{var s=void 0,c=y.getContext("2d"),f=void 0;if(u){var d="undefined"!=typeof window?window.devicePixelRatio:1;s=c.getImageData(0,0,l*d,h*d),f=c.globalCompositeOperation,c.globalCompositeOperation="destination-over",c.fillStyle=u,c.fillRect(0,0,l,h)}m=y.toDataURL(e),u&&(c.clearRect(0,0,l,h),c.putImageData(s,0,0),c.globalCompositeOperation=f)}t&&t(m)}),16)},e.prototype.downloadFullImage=function(t,e,n){var r=this,i=this.get("group").getCanvasBBox(),o=i.height,a=i.width,s=this.get("renderer"),u=Object(Ru.a)('<id="virtual-image"></div>'),c=n?n.backgroundColor:void 0,h=n?n.padding:void 0;h?Object(ju.k)(h)&&(h=[h,h,h,h]):h=[0,0,0,0];var l=o+h[0]+h[2],f=a+h[1]+h[3],d=new Eu({container:u,height:l,width:f}),p=this.get("group").clone(),g=Object(ju.a)(p.getMatrix());g||(g=[1,0,0,0,1,0,0,0,1]);var v=(i.maxX+i.minX)/2,y=(i.maxY+i.minY)/2;Pu.a.translate(g,g,[-v,-y]),Pu.a.translate(g,g,[a/2+h[3],o/2+h[0]]),p.resetMatrix(),p.setMatrix(g),d.add(p);var m=d.get("el");e||(e="image/png"),setTimeout((function(){var n="";if("svg"===s){var i=m.cloneNode(!0),o=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),a=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",o);a.replaceChild(i,a.documentElement);var u=(new XMLSerializer).serializeToString(a);n="data:image/svg+xml;charset=utf8,"+encodeURIComponent(u)}else{var h=void 0,d=m.getContext("2d"),p=void 0;if(c){var g="undefined"!=typeof window?window.devicePixelRatio:1;h=d.getImageData(0,0,f*g,l*g),p=d.globalCompositeOperation,d.globalCompositeOperation="destination-over",d.fillStyle=c,d.fillRect(0,0,f,l)}n=m.toDataURL(e),c&&(d.clearRect(0,0,f,l),d.putImageData(h,0,0),d.globalCompositeOperation=p)}var v=document.createElement("a"),y=(t||"graph")+("svg"===s?".svg":"."+e.split("/")[1]);r.dataURLToImage(n,s,v,y);var b=document.createEvent("MouseEvents");b.initEvent("click",!1,!1),v.dispatchEvent(b)}),16)},e.prototype.downloadImage=function(t,e,n){var r=this,i=this;i.isAnimating()&&i.stopAnimate();var o=i.get("canvas").getRenderer();e||(e="image/png");var a=(t||"graph")+("svg"===o?".svg":e.split("/")[1]),s=document.createElement("a");setTimeout((function(){var t=i.toDataURL(e,n);r.dataURLToImage(t,o,s,a);var u=document.createEvent("MouseEvents");u.initEvent("click",!1,!1),s.dispatchEvent(u)}),16)},e.prototype.dataURLToImage=function(t,e,n,r){if("undefined"!=typeof window)if(window.Blob&&window.URL&&"svg"!==e){var i=t.split(","),o="";if(i&&i.length>0){var a=i[0].match(/:(.*?);/);a&&a.length>=2&&(o=a[1])}for(var s=atob(i[1]),u=s.length,c=new Uint8Array(u);u--;)c[u]=s.charCodeAt(u);var h=new Blob([c],{type:o});window.navigator.msSaveBlob?window.navigator.msSaveBlob(h,r):n.addEventListener("click",(function(){n.download=r,n.href=window.URL.createObjectURL(h)}))}else n.addEventListener("click",(function(){n.download=r,n.href=t}))},e.prototype.addPlugin=function(t){t.destroyed||(this.get("plugins").push(t),t.initPlugin(this))},e.prototype.removePlugin=function(t){var e=this.get("plugins"),n=e.indexOf(t);n>=0&&(t.destroyPlugin(),e.splice(n,1))},e.prototype.isMiniNative=function(){return"mini-native"===this.get("renderer")},e.prototype.isMini=function(){return this.get("renderer").startsWith("mini")},e.prototype.isBrowser=function(){return"canvas"===this.get("renderer")},e.prototype.setImageWaterMarker=function(t,e,n){var r=this,i=Object(ju.b)({},Iu.a.imageWaterMarkerConfig,e),o=i.width,a=i.height,s=i.image,u=s.rotate,c=(s.x,s.y,s.width),h=s.height;if(this.isMini()&&this.isMiniNative(),this.isMiniNative()){n.width=o||this.get("width"),n.height=a||this.get("height");var l=n.getContext("2d"),f=(0,this.get("extra").createImage)();f.crossOrigin="anonymous",f.src=t,f.onload=function(){var t=c/f.width,e=h/f.height;l.rotate(-u*Math.PI/180);var i=l.createPattern(f,"repeat");l.fillStyle=i,l.scale(t,e),l.fillRect(2*-r.get("width"),-r.get("height"),10*r.get("width"),10*r.get("height")),r.get("waterGroup").addShape("image",{attrs:{img:n}})}}if(this.isBrowser()){var d=document.createElement("canvas");d.width=o||this.get("width"),d.height=a||this.get("height");var p=d.getContext("2d"),g=new Image;g.crossOrigin="anonymous",g.src=t,g.onload=function(){var t=c/g.width,e=h/g.height;p.rotate(-u*Math.PI/180);var n=p.createPattern(g,"repeat");p.fillStyle=n,p.scale(t,e),p.fillRect(2*-r.get("width"),-r.get("height"),10*r.get("width"),10*r.get("height"));var i=d.toDataURL();r.get("waterGroup").addShape("image",{attrs:{img:i}})}}},e.prototype.setTextWaterMarker=function(t,e){var n=this.get("container");Object(ju.o)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var r=this.get("graphWaterMarker"),i=Object(ju.b)({},Iu.a.textWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.text;if(!r){var c={container:n,width:o,height:a,capture:!1},h=this.get("pixelRatio");h&&(c.pixelRatio=h),r=new Eu(c),this.set("graphWaterMarker",r)}r.get("el").style.display="none";var l=r.get("context"),f=u.rotate,d=u.fill,p=u.fontFamily,g=u.fontSize,v=u.baseline,y=u.x,m=u.y,b=u.lineHeight;l.rotate(-f*Math.PI/180),l.font=g+"px "+p,l.fillStyle=d,l.textBaseline=v;for(var x=t.length-1;x>=0;x--)l.fillText(t[x],y,m+x*b);if(l.rotate(f*Math.PI/180),s)n.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;";else{var w=document.querySelector(".g6-graph-watermarker");w||((w=document.createElement("div")).className="g6-graph-watermarker"),w.style.cssText="background-image: url("+r.get("el").toDataURL("image/png")+");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;",n.appendChild(w)}},e.prototype.destroy=function(){Object(ju.c)(this.get("plugins"),(function(t){t.destroyPlugin()}));var e=this.get("tooltips");if(e)for(var n=0;n<e.length;n++){var r=e[n];if(r){var i=r.parentElement;i&&i.removeChild(r)}}this.get("eventController").destroy(),this.get("layoutController").destroy(),this.get("graphWaterMarker")&&this.get("graphWaterMarker").destroy(),"undefined"!=typeof document&&document.querySelector(".g6-graph-watermarker")&&document.querySelector(".g6-graph-watermarker").remove(),t.prototype.destroy.call(this)},e.prototype.initGroups=function(){var t=this.get("canvas"),e=t.addGroup({id:"root",className:Iu.a.rootContainerClassName}),n=t.addGroup({id:"water",className:Iu.a.waterContainerClassName});if(this.get("groupByTypes")){var r=e.addGroup({id:"edge",className:Iu.a.edgeContainerClassName}),i=e.addGroup({id:"node",className:Iu.a.nodeContainerClassName}),o=e.addGroup({id:"combo",className:Iu.a.comboContainerClassName});o.toBack(),this.set({nodeGroup:i,edgeGroup:r,comboGroup:o})}var a=t.addGroup({id:"uiGroup",className:Iu.a.uiContainerClassName}),s=e.addGroup({id:"delegate",className:Iu.a.delegateContainerClassName});this.set({delegateGroup:s}),this.set("group",e),this.set("uiGroup",a),this.set("waterGroup",n)},e}(Au.b);e.a=Xu},83:function(t,e,n){"use strict";n.r(e),n.d(e,"mixColor",(function(){return B})),n.d(e,"getColorsWithSubjectColor",(function(){return _})),n.d(e,"getColorSetsBySubjectColors",(function(){return L}));var r=n(49),i=n.n(r);function o(t,e){(function(t){return"string"==typeof t&&-1!==t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function a(t){return Math.min(1,Math.max(0,t))}function s(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function u(t){return t<=1?100*Number(t)+"%":t}function c(t){return 1===t.length?"0"+t:String(t)}function h(t,e,n){t=o(t,255),e=o(e,255),n=o(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),a=0,s=0,u=(r+i)/2;if(r===i)s=0,a=0;else{var c=r-i;switch(s=u>.5?c/(2-r-i):c/(r+i),r){case t:a=(e-n)/c+(e<n?6:0);break;case e:a=(n-t)/c+2;break;case n:a=(t-e)/c+4}a/=6}return{h:a,s:s,l:u}}function l(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*n*(e-t):n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function f(t,e,n){t=o(t,255),e=o(e,255),n=o(n,255);var r=Math.max(t,e,n),i=Math.min(t,e,n),a=0,s=r,u=r-i,c=0===r?0:u/r;if(r===i)a=0;else{switch(r){case t:a=(e-n)/u+(e<n?6:0);break;case e:a=(n-t)/u+2;break;case n:a=(t-e)/u+4}a/=6}return{h:a,s:c,v:s}}function d(t,e,n,r){var i=[c(Math.round(t).toString(16)),c(Math.round(e).toString(16)),c(Math.round(n).toString(16))];return r&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function p(t){return Math.round(255*parseFloat(t)).toString(16)}function g(t){return v(t)/255}function v(t){return parseInt(t,16)}var y={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function b(t){var e,n,r,i={r:0,g:0,b:0},a=1,c=null,h=null,f=null,d=!1,p=!1;return"string"==typeof t&&(t=function(t){if(0===(t=t.trim().toLowerCase()).length)return!1;var e=!1;if(y[t])t=y[t],e=!0;else if("transparent"===t)return{r:0,g:0,b:0,a:0,format:"name"};var n=S.rgb.exec(t);if(n)return{r:n[1],g:n[2],b:n[3]};if(n=S.rgba.exec(t))return{r:n[1],g:n[2],b:n[3],a:n[4]};if(n=S.hsl.exec(t))return{h:n[1],s:n[2],l:n[3]};if(n=S.hsla.exec(t))return{h:n[1],s:n[2],l:n[3],a:n[4]};if(n=S.hsv.exec(t))return{h:n[1],s:n[2],v:n[3]};if(n=S.hsva.exec(t))return{h:n[1],s:n[2],v:n[3],a:n[4]};if(n=S.hex8.exec(t))return{r:v(n[1]),g:v(n[2]),b:v(n[3]),a:g(n[4]),format:e?"name":"hex8"};if(n=S.hex6.exec(t))return{r:v(n[1]),g:v(n[2]),b:v(n[3]),format:e?"name":"hex"};if(n=S.hex4.exec(t))return{r:v(n[1]+n[1]),g:v(n[2]+n[2]),b:v(n[3]+n[3]),a:g(n[4]+n[4]),format:e?"name":"hex8"};if(n=S.hex3.exec(t))return{r:v(n[1]+n[1]),g:v(n[2]+n[2]),b:v(n[3]+n[3]),format:e?"name":"hex"};return!1}(t)),"object"===m(t)&&(O(t.r)&&O(t.g)&&O(t.b)?(e=t.r,n=t.g,r=t.b,i={r:255*o(e,255),g:255*o(n,255),b:255*o(r,255)},d=!0,p="%"===String(t.r).substr(-1)?"prgb":"rgb"):O(t.h)&&O(t.s)&&O(t.v)?(c=u(t.s),h=u(t.v),i=function(t,e,n){t=6*o(t,360),e=o(e,100),n=o(n,100);var r=Math.floor(t),i=t-r,a=n*(1-e),s=n*(1-i*e),u=n*(1-(1-i)*e),c=r%6;return{r:255*[n,s,a,a,u,n][c],g:255*[u,n,n,s,a,a][c],b:255*[a,a,u,n,n,s][c]}}(t.h,c,h),d=!0,p="hsv"):O(t.h)&&O(t.s)&&O(t.l)&&(c=u(t.s),f=u(t.l),i=function(t,e,n){var r,i,a;if(t=o(t,360),e=o(e,100),n=o(n,100),0===e)i=n,a=n,r=n;else{var s=n<.5?n*(1+e):n+e-n*e,u=2*n-s;r=l(u,s,t+1/3),i=l(u,s,t),a=l(u,s,t-1/3)}return{r:255*r,g:255*i,b:255*a}}(t.h,c,f),d=!0,p="hsl"),Object.prototype.hasOwnProperty.call(t,"a")&&(a=t.a)),a=s(a),{ok:d,format:t.format||p,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:a}}var x="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",w="[\\s|\\(]+("+x+")[,|\\s]+("+x+")[,|\\s]+("+x+")\\s*\\)?",M="[\\s|\\(]+("+x+")[,|\\s]+("+x+")[,|\\s]+("+x+")[,|\\s]+("+x+")\\s*\\)?",S={CSS_UNIT:new RegExp(x),rgb:new RegExp("rgb"+w),rgba:new RegExp("rgba"+M),hsl:new RegExp("hsl"+w),hsla:new RegExp("hsla"+M),hsv:new RegExp("hsv"+w),hsva:new RegExp("hsva"+M),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function O(t){return Boolean(S.CSS_UNIT.exec(String(t)))}var k=function(){function t(e,n){var r;if(void 0===e&&(e=""),void 0===n&&(n={}),e instanceof t)return e;"number"==typeof e&&(e=function(t){return{r:t>>16,g:(65280&t)>>8,b:255&t}}(e)),this.originalInput=e;var i=b(e);this.originalInput=e,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=n.format)&&void 0!==r?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},t.prototype.getLuminance=function(){var t=this.toRgb(),e=t.r/255,n=t.g/255,r=t.b/255;return.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(t){return this.a=s(t),this.roundA=Math.round(100*this.a)/100,this},t.prototype.toHsv=function(){var t=f(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}},t.prototype.toHsvString=function(){var t=f(this.r,this.g,this.b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.v);return 1===this.a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this.roundA+")"},t.prototype.toHsl=function(){var t=h(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}},t.prototype.toHslString=function(){var t=h(this.r,this.g,this.b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.l);return 1===this.a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this.roundA+")"},t.prototype.toHex=function(t){return void 0===t&&(t=!1),d(this.r,this.g,this.b,t)},t.prototype.toHexString=function(t){return void 0===t&&(t=!1),"#"+this.toHex(t)},t.prototype.toHex8=function(t){return void 0===t&&(t=!1),function(t,e,n,r,i){var o=[c(Math.round(t).toString(16)),c(Math.round(e).toString(16)),c(Math.round(n).toString(16)),c(p(r))];return i&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this.r,this.g,this.b,this.a,t)},t.prototype.toHex8String=function(t){return void 0===t&&(t=!1),"#"+this.toHex8(t)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var t=Math.round(this.r),e=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb("+t+", "+e+", "+n+")":"rgba("+t+", "+e+", "+n+", "+this.roundA+")"},t.prototype.toPercentageRgb=function(){var t=function(t){return Math.round(100*o(t,255))+"%"};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var t=function(t){return Math.round(100*o(t,255))};return 1===this.a?"rgb("+t(this.r)+"%, "+t(this.g)+"%, "+t(this.b)+"%)":"rgba("+t(this.r)+"%, "+t(this.g)+"%, "+t(this.b)+"%, "+this.roundA+")"},t.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var t="#"+d(this.r,this.g,this.b,!1),e=0,n=Object.entries(y);e<n.length;e++){var r=n[e],i=r[0];if(t===r[1])return i}return!1},t.prototype.toString=function(t){var e=Boolean(t);t=null!=t?t:this.format;var n=!1,r=this.a<1&&this.a>=0;return e||!r||!t.startsWith("hex")&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this.a?this.toName():this.toRgbString()},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.l+=e/100,n.l=a(n.l),new t(n)},t.prototype.brighten=function(e){void 0===e&&(e=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),new t(n)},t.prototype.darken=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.l-=e/100,n.l=a(n.l),new t(n)},t.prototype.tint=function(t){return void 0===t&&(t=10),this.mix("white",t)},t.prototype.shade=function(t){return void 0===t&&(t=10),this.mix("black",t)},t.prototype.desaturate=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.s-=e/100,n.s=a(n.s),new t(n)},t.prototype.saturate=function(e){void 0===e&&(e=10);var n=this.toHsl();return n.s+=e/100,n.s=a(n.s),new t(n)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var n=this.toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,new t(n)},t.prototype.mix=function(e,n){void 0===n&&(n=50);var r=this.toRgb(),i=new t(e).toRgb(),o=n/100;return new t({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},t.prototype.analogous=function(e,n){void 0===e&&(e=6),void 0===n&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,o.push(new t(r));return o},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){void 0===e&&(e=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/e;e--;)a.push(new t({h:r,s:i,v:o})),o=(o+s)%1;return a},t.prototype.splitcomplement=function(){var e=this.toHsl(),n=e.h;return[this,new t({h:(n+72)%360,s:e.s,l:e.l}),new t({h:(n+216)%360,s:e.s,l:e.l})]},t.prototype.onBackground=function(e){var n=this.toRgb(),r=new t(e).toRgb();return new t({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var n=this.toHsl(),r=n.h,i=[this],o=360/e,a=1;a<e;a++)i.push(new t({h:(r+a*o)%360,s:n.s,l:n.l}));return i},t.prototype.equals=function(e){return this.toRgbString()===new t(e).toRgbString()},t}();var C=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function E(t,e,n){var r;return(r=Math.round(t.h)>=60&&Math.round(t.h)<=240?n?Math.round(t.h)-2*e:Math.round(t.h)+2*e:n?Math.round(t.h)+2*e:Math.round(t.h)-2*e)<0?r+=360:r>=360&&(r-=360),r}function P(t,e,n){return 0===t.h&&0===t.s?t.s:((r=n?t.s-.16*e:4===e?t.s+.16:t.s+.05*e)>1&&(r=1),n&&5===e&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function j(t,e,n){var r;return(r=n?t.v+.05*e:t.v-.15*e)>1&&(r=1),Number(r.toFixed(2))}function A(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=new k(t),i=5;i>0;i-=1){var o=r.toHsv(),a=new k({h:E(o,i,!0),s:P(o,i,!0),v:j(o,i,!0)}).toHexString();n.push(a)}n.push(r.toHexString());for(var s=1;s<=4;s+=1){var u=r.toHsv(),c=new k({h:E(u,s),s:P(u,s),v:j(u,s)}).toHexString();n.push(c)}return"dark"===e.theme?C.map((function(t){var r=t.index,i=t.opacity;return new k(e.backgroundColor||"#141414").mix(n[r],100*i).toHexString()})):n}var I={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},T={},N={};Object.keys(I).forEach((function(t){T[t]=A(I[t]),T[t].primary=T[t][5],N[t]=A(I[t],{theme:"dark",backgroundColor:"#141414"}),N[t].primary=N[t][5]}));T.red,T.volcano,T.gold,T.orange,T.yellow,T.lime,T.green,T.cyan,T.blue,T.geekblue,T.purple,T.magenta,T.grey;var B=function(t,e,n){var r=i()(t),o=i()(e);return i()([(1-n)*r.red()+n*o.red(),(1-n)*r.green()+n*o.green(),(1-n)*r.blue()+n*o.blue()]).rgb()},_=function(t,e,n,r){return void 0===e&&(e="#fff"),void 0===n&&(n="default"),void 0===r&&(r="rgb(150, 150, 150)"),"default"===n?function(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="rgb(150, 150, 150)");var r=B(e,t,.05).rgb().toString(),o=B(e,t,.1).rgb().toString(),a=B(e,t,.2).rgb().toString(),s=B(e,t,.4).rgb().toString(),u=B(e,n,.02).rgb().toString(),c=B(e,n,.05).rgb().toString(),h=B(e,n,.1).rgb().toString(),l=B(e,n,.2).rgb().toString(),f=B(e,n,.3).rgb().toString(),d=A(t,{theme:"default",backgroundColor:e}),p=i()(t).hex().toLowerCase(),g=d.indexOf(p),v=t;return-1!==g&&(v=d[g+1]),{mainStroke:t,mainFill:o,activeStroke:t,activeFill:r,inactiveStroke:s,inactiveFill:r,selectedStroke:t,selectedFill:e,highlightStroke:v,highlightFill:a,disableStroke:f,disableFill:c,edgeMainStroke:f,edgeActiveStroke:t,edgeInactiveStroke:l,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:h,comboMainStroke:f,comboMainFill:u,comboActiveStroke:t,comboActiveFill:r,comboInactiveStroke:f,comboInactiveFill:u,comboSelectedStroke:t,comboSelectedFill:u,comboHighlightStroke:v,comboHighlightFill:u,comboDisableStroke:l,comboDisableFill:c}}(t,e,"rgb(150, 150, 150)"):function(t,e,n){void 0===e&&(e="#fff"),void 0===n&&(n="#777");var r=B(e,t,.2).rgb().toString(),o=B(e,t,.3).rgb().toString(),a=B(e,t,.6).rgb().toString(),s=B(e,t,.8).rgb().toString(),u=B(e,n,.2).rgb().toString(),c=B(e,n,.25).rgb().toString(),h=B(e,n,.3).rgb().toString(),l=B(e,n,.4).rgb().toString(),f=B(e,n,.5).rgb().toString(),d=A(t,{theme:"dark",backgroundColor:e}),p=i()(t).hex().toLowerCase(),g=d.indexOf(p),v=t;return-1!==g&&(v=d[g+1]),{mainStroke:s,mainFill:r,activeStroke:t,activeFill:o,inactiveStroke:s,inactiveFill:r,selectedStroke:t,selectedFill:r,highlightStroke:t,highlightFill:a,disableStroke:f,disableFill:c,edgeMainStroke:n,edgeActiveStroke:t,edgeInactiveStroke:n,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:h,comboMainStroke:l,comboMainFill:c,comboActiveStroke:t,comboActiveFill:u,comboInactiveStroke:l,comboInactiveFill:c,comboSelectedStroke:t,comboSelectedFill:u,comboHighlightStroke:v,comboHighlightFill:c,comboDisableStroke:l,comboDisableFill:u}}(t,e,"#777")},L=function(t,e,n,r){void 0===e&&(e="#fff"),void 0===n&&(n="default"),void 0===r&&(r="rgb(150, 150, 150)");var i=[];return t.forEach((function(t){i.push(_(t,e,n,r))})),i}},84:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Layouts=e.Layout=void 0;var r=n(56),i=function(){function t(t){var e=r.getLayoutByName(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.layoutInstance.init(t)},t.prototype.execute=function(){this.layoutInstance.execute()},t.prototype.getDefaultCfg=function(){return this.layoutInstance.getDefaultCfg()},t.prototype.destroy=function(){return this.layoutInstance.destroy()},t}();e.Layout=i,e.Layouts=new Proxy({},{get:function(t,e){return r.getLayoutByName(e)},set:function(t,e,n){return r.registerLayout(e,n),!0}})}}).default}));
- //# sourceMappingURL=f6.js.map
|