databasir/api/src/main/resources/static/js/83-legacy.baa0174c.js

33 lines
868 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[83],{7556:function(t,e,n){var i=n(7293);t.exports=i((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},8457:function(t,e,n){"use strict";var i=n(7854),r=n(9974),s=n(6916),o=n(7908),a=n(3411),l=n(7659),c=n(4411),h=n(6244),u=n(6135),d=n(8554),p=n(1246),g=i.Array;t.exports=function(t){var e=o(t),n=c(this),i=arguments.length,f=i>1?arguments[1]:void 0,m=void 0!==f;m&&(f=r(f,i>2?arguments[2]:void 0));var y,b,v,w,C,x,E=p(e),k=0;if(!E||this==g&&l(E))for(y=h(e),b=n?new this(y):g(y);y>k;k++)x=m?f(e[k],k):e[k],u(b,k,x);else for(w=d(e,E),C=w.next,b=n?new this:[];!(v=s(C,w)).done;k++)x=m?a(w,f,[v.value,k],!0):v.value,u(b,k,x);return b.length=k,b}},1589:function(t,e,n){var i=n(7854),r=n(1400),s=n(6244),o=n(6135),a=i.Array,l=Math.max;t.exports=function(t,e,n){for(var i=s(t),c=r(e,i),h=r(void 0===n?i:n,i),u=a(l(h-c,0)),d=0;c<h;c++,d++)o(u,d,t[c]);return u.length=d,u}},4362:function(t,e,n){var i=n(1589),r=Math.floor,s=function(t,e){var n=t.length,l=r(n/2);return n<8?o(t,e):a(t,s(i(t,0,l),e),s(i(t,l),e),e)},o=function(t,e){var n,i,r=t.length,s=1;while(s<r){i=s,n=t[s];while(i&&e(t[i-1],n)>0)t[i]=t[--i];i!==s++&&(t[i]=n)}return t},a=function(t,e,n,i){var r=e.length,s=n.length,o=0,a=0;while(o<r||a<s)t[o+a]=o<r&&a<s?i(e[o],n[a])<=0?e[o++]:n[a++]:o<r?e[o++]:n[a++];return t};t.exports=s},3411:function(t,e,n){var i=n(9670),r=n(9212);t.exports=function(t,e,n,s){try{return s?e(i(n)[0],n[1]):e(n)}catch(o){r(t,"throw",o)}}},7741:function(t,e,n){var i=n(1702),r=i("".replace),s=function(t){return String(Error(t).stack)}("zxcasd"),o=/\n\s*at [^:]*:[^\n]*/,a=o.test(s);t.exports=function(t,e){if(a&&"string"==typeof t)while(e--)t=r(t,o,"");return t}},5631:function(t,e,n){"use strict";var i=n(3070).f,r=n(30),s=n(2248),o=n(9974),a=n(5787),l=n(408),c=n(654),h=n(6340),u=n(9781),d=n(2423).fastKey,p=n(9909),g=p.set,f=p.getterFor;t.exports={getConstructor:function(t,e,n,c){var h=t((function(t,i){a(t,p),g(t,{type:e,index:r(null),first:void 0,last:void 0,size:0}),u||(t.size=0),void 0!=i&&l(i,t[c],{that:t,AS_ENTRIES:n})})),p=h.prototype,m=f(e),y=function(t,e,n){var i,r,s=m(t),o=b(t,e);return o?o.value=n:(s.last=o={index:r=d(e,!0),key:e,value:n,previous:i=s.last,next:void 0,removed:!1},s.first||(s.first=o),i&&(i.next=o),u?s.size++:t.size++,"F"!==r&&(s.index[r]=o)),t},b=function(t,e){var n,i=m(t),r=d(e);if("F"!==r)return i.index[r];for(n=i.first;n;n=n.next)if(n.key==e)return n};return s(p,{clear:function(){var t=this,e=m(t),n=e.index,i=e.first;while(i)i.removed=!0,i.previous&&(i.previous=i.previous.next=void 0),delete n[i.index],i=i.next;e.first=e.last=void 0,u?e.size=0:t.size=0},delete:function(t){var e=this,n=m(e),i=b(e,t);if(i){var r=i.next,s=i.previous;delete n.index[i.index],i.removed=!0,s&&(s.next=r),r&&(r.previous=s),n.first==i&&(n.first=r),n.last==i&&(n.last=s),u?n.size--:e.size--}return!!i},forEach:function(t){var e,n=m(this),i=o(t,arguments.length>1?arguments[1]:void 0);while(e=e?e.next:n.first){i(e.value,e.key,this);while(e&&e.removed)e=e.previous}},has:function(t){return!!b(this,t)}}),s(p,n?{get:function(t){var e=b(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),u&&i(p,"size",{get:function(){return m(this).size}}),h},setStrong:function(t,e,n){var i=e+" Iterator",r=f(e),s=f(i);c(t,e,(function(t,e){g(this,{type:i,target:t,state:r(t),kind:e,last:void 0})}),(function(){var t=s(this),e=t.kind,n=t.last;while(n&&n.removed)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?"keys"==e?{value:n.key,done:!1}:"values"==e?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),h(e)}}},7710:function(t,e,n){"use strict";var i=n(2109),r=n(7854),s=n(1702),o=n(4705),a=n(1320),l=n(2423),c=n(408),h=n(5787),u=n(614),d=n(111),p=n(7293),g=n(7072),f=n(8003),m=n(9587);t.exports=function(t,e,n){var y=-1!==t.indexOf("Map"),b=-1!==t.indexOf("Weak"),v=y?"set":"add",w=r[t],C=w&&w.prototype,x=w,E={},k=function(t){var e=s(C[t]);a(C,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(b&&!d(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return b&&!d(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(b&&!d(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})},M=o(t,!u(w)||!(b||C.forEach&&!p((function(){(new w).entries().next()}))));if(M)x=n.getConstructor(e,t,y,v),l.enable();else if(o(t,!0)){var S=new x,A=S[v](b?{}:-0,1)!=S,D=p((function(){S.has(1)})),O=g((function(t){new w(t)})),P=!b&&p((function(){var t=new w,e=5;while(e--)t[v](e,e);return!t.has(-0)}));O||(x=e((function(t,e){h(t,C);var n=m(new w,t,x);return void 0!=e&&c(e,n[v],{that:n,AS_ENTRIES:y}),n})),x.prototype=C,C.constructor=x),(D||P)&&(k("delete"),k("has"),y&&k("get")),(P||A)&&k(v),b&&C.clear&&delete C.clear}return E[t]=x,i({global:!0,forced:x!=w},E),f(x,t),b||n.setStrong(x,t,y),x}},6135:function(t,e,n){"use strict";var i=n(4948),r=n(3070),s=n(9114);t.exports=function(t,e,n){var o=i(e);o in t?r.f(t,o,s(0,n)):t[o]=n}},7235:function(t,e,n){var i=n(857),r=n(2597),s=n(6061),o=n(3070).f;t.exports=function(t){var e=i.Symbol||(i.Symbol={});r(e,t)||o(e,t,{value:s.f(t)})}},2914:function(t,e,n){var i=n(7293),r=n(9114);t.exports=!i((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",r(1,7)),7!==t.stack)}))},6790:function(t,e,n){"use strict";var i=n(7854),r=n(3157),s=n(6244),o=n(9974),a=i.TypeError,l=function(t,e,n,i,c,h,u,d){var p,g,f=c,m=0,y=!!u&&o(u,d);while(m<i){if(m in n){if(p=y?y(n[m],m,e):n[m],h>0&&r(p))g=s(p),f=l(t,e,p,g,f,h-1)-1;else{if(f>=9007199254740991)throw a("Exceed the acceptable array length");t[f]=p}f++}m++}return f};t.exports=l},6677:function(t,e,n){var i=n(7293);t.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},9587:function(t,e,n){var i=n(614),r=n(111),s=n(7674);t.exports=function(t,e,n){var o,a;return s&&i(o=e.constructor)&&o!==n&&r(a=o.prototype)&&a!==n.prototype&&s(t,a),t}},8340:function(t,e,n){var i=n(111),r=n(8880);t.exports=function(t,e){i(e)&&"cause"in e&&r(t,"cause",e.cause)}},2423:function(t,e,n){var i=n(2109),r=n(1702),s=n(3501),o=n(111),a=n(2597),l=n(3070).f,c=n(8006),h=n(1156),u=n(2050),d=n(9711),p=n(6677),g=!1,f=d("meta"),m=0,y=function(t){l(t,f,{value:{objectID:"O"+m++,weakData:{}}})},b=function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!a(t,f)){if(!u(t))return"F";if(!e)return"E";y(t)}return t[f].objectID},v=function(t,e){if(!a(t,f)){if(!u(t))return!0;if(!e)return!1;y(t)}return t[f].weakData},w=function(t){return p&&g&&u(t)&&!a(t,f)&&y(t),t},C=function(){x.enable=function(){},g=!0;var t=c.f,e=r([].splice),n={};n[f]=1,t(n).length&&(c.f=function(n){for(var i=t(n),r=0,s=i.length;r<s;r++)if(i[r]===f){e(i,r,1);break}return i},i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:h.f}))},x=t.exports={enable:C,fastKey:b,getWeakData:v,onFreeze:w};s[f]=!0},590:function(t,e,n){var i=n(7293),r=n(5112),s=n(1913),o=r("iterator");t.exports=!i((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,n="";return t.pathname="c%20d",e.forEach((function(t,i){e["delete"]("b"),n+=i+t})),s&&!t.toJSON||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[o]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},6277:function(t,e,n){var i=n(1340);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:i(t)}},1156:function(t,e,n){var i=n(4326),r=n(5656),s=n(8006).f,o=n(1589),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],l=function(t){try{return s(t)}catch(e){return o(a)}};t.exports.f=function(t){return a&&"Window"==i(t)?l(t):s(r(t))}},2050:function(t,e,n){var i=n(7293),r=n(111),s=n(4326),o=n(7556),a=Object.isExtensible,l=i((function(){a(1)}));t.exports=l||o?function(t){return!!r(t)&&((!o||"ArrayBuffer"!=s(t))&&(!a||a(t)))}:a},857:function(t,e,n){var i=n(7854);t.exports=i},3197:function(t,e,n){"use strict";var i=n(7854),r=n(1702),s=2147483647,o=36,a=1,l=26,c=38,h=700,u=72,d=128,p="-",g=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,m="Overflow: input needs wider integers to process",y=o-a,b=i.RangeError,v=r(f.exec),w=Math.floor,C=String.fromCharCode,x=r("".charCodeAt),E=r([].join),k=r([].push),M=r("".replace),S=r("".split),A=r("".toLowerCase),D=function(t){var e=[],n=0,i=t.length;while(n<i){var r=x(t,n++);if(r>=55296&&r<=56319&&n<i){var s=x(t,n++);56320==(64512&s)?k(e,((1023&r)<<10)+(1023&s)+65536):(k(e,r),n--)}else k(e,r)}return e},O=function(t){return t+22+75*(t<26)},P=function(t,e,n){var i=0;t=n?w(t/h):t>>1,t+=w(t/e);while(t>y*l>>1)t=w(t/y),i+=o;return w(i+(y+1)*t/(t+c))},T=function(t){var e=[];t=D(t);var n,i,r=t.length,c=d,h=0,g=u;for(n=0;n<t.length;n++)i=t[n],i<128&&k(e,C(i));var f=e.length,y=f;f&&k(e,p);while(y<r){var v=s;for(n=0;n<t.length;n++)i=t[n],i>=c&&i<v&&(v=i);var x=y+1;if(v-c>w((s-h)/x))throw b(m);for(h+=(v-c)*x,c=v,n=0;n<t.length;n++){if(i=t[n],i<c&&++h>s)throw b(m);if(i==c){var M=h,S=o;while(1){var A=S<=g?a:S>=g+l?l:S-g;if(M<A)break;var T=M-A,N=o-A;k(e,C(O(A+T%N))),M=w(T/N),S+=o}k(e,C(O(M))),g=P(h,x,y==f),h=0,y++}}h++,c++}return E(e,"")};t.exports=function(t){var e,n,i=[],r=S(M(A(t),f,"."),".");for(e=0;e<r.length;e++)n=r[e],k(i,v(g,n)?"xn--"+T(n):n);return E(i,".")}},6061:function(t,e,n){var i=n(5112);e.f=i},9191:function(t,e,n){"use strict";var i=n(5005),r=n(2597),s=n(8880),o=n(7976),a=n(7674),l=n(9920),c=n(9587),h=n(6277),u=n(8340),d=n(7741),p=n(2914),g=n(1913);t.exports=function(t,e,n,f){var m=f?2:1,y=t.split("."),b=y[y.length-1],v=i.apply(null,y);if(v){var w=v.prototype;if(!g&&r(w,"cause")&&delete w.cause,!n)return v;var C=i("Error"),x=e((function(t,e){var n=h(f?e:t,void 0),i=f?new v(t):new v;return void 0!==n&&s(i,"message",n),p&&s(i,"stack",d(i.stack,2)),this&&o(w,this)&&c(i,this,x),arguments.length>m&&u(i,arguments[m]),i}));if(x.prototype=w,"Error"!==b&&(a?a(x,C):l(x,C,{name:!0})),l(x,v),!g)try{w.name!==b&&s(w,"name",b),w.constructor=x}catch(E){}return x}}},7327:function(t,e,n){"use strict";var i=n(2109),r=n(2092).filter,s=n(1194),o=s("filter");i({target:"Array",proto:!0,forced:!o},{filter:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},9826:function(t,e,n){"use strict";var i=n(2109),r=n(2092).find,s=n(1223),o="find",a=!0;o in[]&&Array(1)[o]((function(){a=!1})),i({target:"Array",proto:!0,forced:a},{find:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),s(o)},6535:function(t,e,n){"use strict";var i=n(2109),r=n(6790),s=n(9662),o=n(7908),a=n(6244),l=n(5417);i({target:"Array",proto:!0},{flatMap:function(t){var e,n=o(this),i=a(n);return s(t),e=l(n,0),e.length=r(e,n,n,i,0,1,t,arguments.length>1?arguments[1]:void 0),e}})},1038:function(t,e,n){var i=n(2109),r=n(8457),s=n(7072),o=!s((function(t){Array.from(t)}));i({target:"Array",stat:!0,forced:o},{from:r})},6699:function(t,e,n){"use strict";var i=n(2109),r=n(1318).includes,s=n(1223);i({target:"Array",proto:!0},{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),s("includes")},7042:function(t,e,n){"use strict";var i=n(2109),r=n(7854),s=n(3157),o=n(4411),a=n(111),l=n(1400),c=n(6244),h=n(5656),u=n(6135),d=n(5112),p=n(1194),g=n(206),f=p("slice"),m=d("species"),y=r.Array,b=Math.max;i({target:"Array",proto:!0,forced:!f},{slice:function(t,e){var n,i,r,d=h(this),p=c(d),f=l(t,p),v=l(void 0===e?p:e,p);if(s(d)&&(n=d.constructor,o(n)&&(n===y||s(n.prototype))?n=void 0:a(n)&&(n=n[m],null===n&&(n=void 0)),n===y||void 0===n))return g(d,f,v);for(i=new(void 0===n?y:n)(b(v-f,0)),r=0;f<v;f++,r++)f in d&&u(i,r,d[f]);return i.length=r,i}})},9244:function(t,e,n){var i=n(1223);i("flatMap")},1703:function(t,e,n){var i=n(2109),r=n(7854),s=n(2104),o=n(9191),a="WebAssembly",l=r[a],c=7!==Error("e",{cause:7}).cause,h=function(t,e){var n={};n[t]=o(t,e,c),i({global:!0,forced:c},n)},u=function(t,e){if(l&&l[t]){var n={};n[t]=o(a+"."+t,e,c),i({target:a,stat:!0,forced:c},n)}};h("Error",(function(t){return function(e){return s(t,this,arguments)}})),h("EvalError",(function(t){return function(e){return s(t,this,arguments)}})),h("RangeError",(function(t){return function(e){return s(t,this,arguments)}})),h("ReferenceError",(function(t){return function(e){return s(t,this,arguments)}})),h("SyntaxError",(function(t){return function(e){return s(t,this,arguments)}})),h("TypeError",(function(t){return function(e){return s(t,this,arguments)}})),h("URIError",(function(t){return function(e){return s(t,this,arguments)}})),u("CompileError",(function(t){return function(e){return s(t,this,arguments)}})),u("LinkError",(function(t){return function(e){return s(t,this,arguments)}})),u("RuntimeError",(function(t){return function(e){return s(t,this,arguments)}}))},1532:function(t,e,n){"use strict";var i=n(7710),r=n(5631);i("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r)},7601:function(t,e,n){"use strict";n(4916);var i=n(2109),r=n(7854),s=n(6916),o=n(1702),a=n(614),l=n(111),c=function(){var t=!1,e=/[ac]/;return e.exec=function(){return t=!0,/./.exec.apply(this,arguments)},!0===e.test("abc")&&t}(),h=r.Error,u=o(/./.test);i({target:"RegExp",proto:!0,forced:!c},{test:function(t){var e=this.exec;if(!a(e))return u(this,t);var n=s(e,this,t);if(null!==n&&!l(n))throw new h("RegExp exec method returned something other than an Object or null");return!!n}})},189:function(t,e,n){"use strict";var i=n(7710),r=n(5631);i("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),r)},2023:function(t,e,n){"use strict";var i=n(2109),r=n(1702),s=n(3929),o=n(4488),a=n(1340),l=n(4964),c=r("".indexOf);i({target:"String",proto:!0,forced:!l("includes")},{includes:function(t){return!!~c(a(o(this)),a(s(t)),arguments.length>1?arguments[1]:void 0)}})},3123:function(t,e,n){"use strict";var i=n(2104),r=n(6916),s=n(1702),o=n(7007),a=n(7850),l=n(9670),c=n(4488),h=n(6707),u=n(1530),d=n(7466),p=n(1340),g=n(8173),f=n(1589),m=n(7651),y=n(2261),b=n(2999),v=n(7293),w=b.UNSUPPORTED_Y,C=4294967295,x=Math.min,E=[].push,k=s(/./.exec),M=s(E),S=s("".slice),A=!v((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));o("split",(function(t,e,n){var s;return s="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var s=p(c(this)),o=void 0===n?C:n>>>0;if(0===o)return[];if(void 0===t)return[s];if(!a(t))return r(e,s,t,o);var l,h,u,d=[],g=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),m=0,b=new RegExp(t.source,g+"g");while(l=r(y,b,s)){if(h=b.lastIndex,h>m&&(M(d,S(s,m,l.index)),l.length>1&&l.index<s.length&&i(E,d,f(l,1)),u=l[0].length,m=h,d.length>=o))break;b.lastIndex===l.index&&b.lastIndex++}return m===s.length?!u&&k(b,"")||M(d,""):M(d,S(s,m)),d.length>o?f(d,0,o):d}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:r(e,this,t,n)}:e,[function(e,n){var i=c(this),o=void 0==e?void 0:g(e,t);return o?r(o,e,i,n):r(s,p(i),e,n)},function(t,i){var r=l(this),o=p(t),a=n(s,r,o,i,s!==e);if(a.done)return a.value;var c=h(r,RegExp),g=r.unicode,f=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(w?"g":"y"),y=new c(w?"^(?:"+r.source+")":r,f),b=void 0===i?C:i>>>0;if(0===b)return[];if(0===o.length)return null===m(y,o)?[o]:[];var v=0,E=0,k=[];while(E<o.length){y.lastIndex=w?0:E;var A,D=m(y,w?S(o,E):o);if(null===D||(A=x(d(y.lastIndex+(w?E:0)),o.length))===v)E=u(o,E,g);else{if(M(k,S(o,v,E)),k.length===b)return k;for(var O=1;O<=D.length-1;O++)if(M(k,D[O]),k.length===b)return k;E=v=A}}return M(k,S(o,v)),k}]}),!A,w)},1817:function(t,e,n){"use strict";var i=n(2109),r=n(9781),s=n(7854),o=n(1702),a=n(2597),l=n(614),c=n(7976),h=n(1340),u=n(3070).f,d=n(9920),p=s.Symbol,g=p&&p.prototype;if(r&&l(p)&&(!("description"in g)||void 0!==p().description)){var f={},m=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:h(arguments[0]),e=c(g,this)?new p(t):void 0===t?p():p(t);return""===t&&(f[e]=!0),e};d(m,p),m.prototype=g,g.constructor=m;var y="Symbol(test)"==String(p("test")),b=o(g.toString),v=o(g.valueOf),w=/^Symbol\((.*)\)[^)]+$/,C=o("".replace),x=o("".slice);u(g,"description",{configurable:!0,get:function(){var t=v(this),e=b(t);if(a(f,t))return"";var n=y?x(e,7,-1):C(e,w,"$1");return""===n?void 0:n}}),i({global:!0,forced:!0},{Symbol:m})}},2165:function(t,e,n){var i=n(7235);i("iterator")},2526:function(t,e,n){"use strict";var i=n(2109),r=n(7854),s=n(5005),o=n(2104),a=n(6916),l=n(1702),c=n(1913),h=n(9781),u=n(133),d=n(7293),p=n(2597),g=n(3157),f=n(614),m=n(111),y=n(7976),b=n(2190),v=n(9670),w=n(7908),C=n(5656),x=n(4948),E=n(1340),k=n(9114),M=n(30),S=n(1956),A=n(8006),D=n(1156),O=n(5181),P=n(1236),T=n(3070),N=n(5296),j=n(206),L=n(1320),F=n(2309),z=n(6200),R=n(3501),B=n(9711),I=n(5112),$=n(6061),V=n(7235),_=n(8003),G=n(9909),H=n(2092).forEach,U=z("hidden"),W="Symbol",q="prototype",X=I("toPrimitive"),Y=G.set,J=G.getterFor(W),Z=Object[q],K=r.Symbol,Q=K&&K[q],tt=r.TypeError,et=r.QObject,nt=s("JSON","stringify"),it=P.f,rt=T.f,st=D.f,ot=N.f,at=l([].push),lt=F("symbols"),ct=F("op-symbols"),ht=F("string-to-symbol-registry"),ut=F("symbol-to-string-registry"),dt=F("wks"),pt=!et||!et[q]||!et[q].findChild,gt=h&&d((function(){return 7!=M(rt({},"a",{get:function(){return rt(this,"a",{value:7}).a}})).a}))?function(t,e,n){var i=it(Z,e);i&&delete Z[e],rt(t,e,n),i&&t!==Z&&rt(Z,e,i)}:rt,ft=function(t,e){var n=lt[t]=M(Q);return Y(n,{type:W,tag:t,description:e}),h||(n.description=e),n},mt=function(t,e,n){t===Z&&mt(ct,e,n),v(t);var i=x(e);return v(n),p(lt,i)?(n.enumerable?(p(t,U)&&t[U][i]&&(t[U][i]=!1),n=M(n,{enumerable:k(0,!1)})):(p(t,U)||rt(t,U,k(1,{})),t[U][i]=!0),gt(t,i,n)):rt(t,i,n)},yt=function(t,e){v(t);var n=C(e),i=S(n).concat(xt(n));return H(i,(function(e){h&&!a(vt,n,e)||mt(t,e,n[e])})),t},bt=function(t,e){return void 0===e?M(t):yt(M(t),e)},vt=function(t){var e=x(t),n=a(ot,this,e);return!(this===Z&&p(lt,e)&&!p(ct,e))&&(!(n||!p(this,e)||!p(lt,e)||p(this,U)&&this[U][e])||n)},wt=function(t,e){var n=C(t),i=x(e);if(n!==Z||!p(lt,i)||p(ct,i)){var r=it(n,i);return!r||!p(lt,i)||p(n,U)&&n[U][i]||(r.enumerable=!0),r}},Ct=function(t){var e=st(C(t)),n=[];return H(e,(function(t){p(lt,t)||p(R,t)||at(n,t)})),n},xt=function(t){var e=t===Z,n=st(e?ct:C(t)),i=[];return H(n,(function(t){!p(lt,t)||e&&!p(Z,t)||at(i,lt[t])})),i};if(u||(K=function(){if(y(Q,this))throw tt("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?E(arguments[0]):void 0,e=B(t),n=function(t){this===Z&&a(n,ct,t),p(this,U)&&p(this[U],e)&&(this[U][e]=!1),gt(this,e,k(1,t))};return h&&pt&&gt(Z,e,{configurable:!0,set:n}),ft(e,t)},Q=K[q],L(Q,"toString",(function(){return J(this).tag})),L(K,"withoutSetter",(function(t){return ft(B(t),t)})),N.f=vt,T.f=mt,P.f=wt,A.f=D.f=Ct,O.f=xt,$.f=function(t){return ft(I(t),t)},h&&(rt(Q,"description",{configurable:!0,get:function(){return J(this).description}}),c||L(Z,"propertyIsEnumerable",vt,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:K}),H(S(dt),(function(t){V(t)})),i({target:W,stat:!0,forced:!u},{for:function(t){var e=E(t);if(p(ht,e))return ht[e];var n=K(e);return ht[e]=n,ut[n]=e,n},keyFor:function(t){if(!b(t))throw tt(t+" is not a symbol");if(p(ut,t))return ut[t]},useSetter:function(){pt=!0},useSimple:function(){pt=!1}}),i({target:"Object",stat:!0,forced:!u,sham:!h},{create:bt,defineProperty:mt,defineProperties:yt,getOwnPropertyDescriptor:wt}),i({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:Ct,getOwnPropertySymbols:xt}),i({target:"Object",stat:!0,forced:d((function(){O.f(1)}))},{getOwnPropertySymbols:function(t){return O.f(w(t))}}),nt){var Et=!u||d((function(){var t=K();return"[null]"!=nt([t])||"{}"!=nt({a:t})||"{}"!=nt(Object(t))}));i({target:"JSON",stat:!0,forced:Et},{stringify:function(t,e,n){var i=j(arguments),r=e;if((m(e)||void 0!==t)&&!b(t))return g(e)||(e=function(t,e){if(f(r)&&(e=a(r,this,t,e)),!b(e))return e}),i[1]=e,o(nt,null,i)}})}if(!Q[X]){var kt=Q.valueOf;L(Q,X,(function(t){return a(kt,this)}))}_(K,W),R[U]=!0},1637:function(t,e,n){"use strict";n(6992);var i=n(2109),r=n(7854),s=n(5005),o=n(6916),a=n(1702),l=n(590),c=n(1320),h=n(2248),u=n(8003),d=n(4994),p=n(9909),g=n(5787),f=n(614),m=n(2597),y=n(9974),b=n(648),v=n(9670),w=n(111),C=n(1340),x=n(30),E=n(9114),k=n(8554),M=n(1246),S=n(5112),A=n(4362),D=S("iterator"),O="URLSearchParams",P=O+"Iterator",T=p.set,N=p.getterFor(O),j=p.getterFor(P),L=s("fetch"),F=s("Request"),z=s("Headers"),R=F&&F.prototype,B=z&&z.prototype,I=r.RegExp,$=r.TypeError,V=r.decodeURIComponent,_=r.encodeURIComponent,G=a("".charAt),H=a([].join),U=a([].push),W=a("".replace),q=a([].shift),X=a([].splice),Y=a("".split),J=a("".slice),Z=/\+/g,K=Array(4),Q=function(t){return K[t-1]||(K[t-1]=I("((?:%[\\da-f]{2}){"+t+"})","gi"))},tt=function(t){try{return V(t)}catch(e){return t}},et=function(t){var e=W(t,Z," "),n=4;try{return V(e)}catch(i){while(n)e=W(e,Q(n--),tt);return e}},nt=/[!'()~]|%20/g,it={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},rt=function(t){return it[t]},st=function(t){return W(_(t),nt,rt)},ot=function(t,e){if(t<e)throw $("Not enough arguments")},at=d((function(t,e){T(this,{type:P,iterator:k(N(t).entries),kind:e})}),"Iterator",(function(){var t=j(this),e=t.kind,n=t.iterator.next(),i=n.value;return n.done||(n.value="keys"===e?i.key:"values"===e?i.value:[i.key,i.value]),n}),!0),lt=function(t){this.entries=[],this.url=null,void 0!==t&&(w(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===G(t,0)?J(t,1):t:C(t)))};lt.prototype={type:O,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,n,i,r,s,a,l,c=M(t);if(c){e=k(t,c),n=e.next;while(!(i=o(n,e)).done){if(r=k(v(i.value)),s=r.next,(a=o(s,r)).done||(l=o(s,r)).done||!o(s,r).done)throw $("Expected sequence with length 2");U(this.entries,{key:C(a.value),value:C(l.value)})}}else for(var h in t)m(t,h)&&U(this.entries,{key:h,value:C(t[h])})},parseQuery:function(t){if(t){var e,n,i=Y(t,"&"),r=0;while(r<i.length)e=i[r++],e.length&&(n=Y(e,"="),U(this.entries,{key:et(q(n)),value:et(H(n,"="))}))}},serialize:function(){var t,e=this.entries,n=[],i=0;while(i<e.length)t=e[i++],U(n,st(t.key)+"="+st(t.value));return H(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ct=function(){g(this,ht);var t=arguments.length>0?arguments[0]:void 0;T(this,new lt(t))},ht=ct.prototype;if(h(ht,{append:function(t,e){ot(arguments.length,2);var n=N(this);U(n.entries,{key:C(t),value:C(e)}),n.updateURL()},delete:function(t){ot(arguments.length,1);var e=N(this),n=e.entries,i=C(t),r=0;while(r<n.length)n[r].key===i?X(n,r,1):r++;e.updateURL()},get:function(t){ot(arguments.length,1);for(var e=N(this).entries,n=C(t),i=0;i<e.length;i++)if(e[i].key===n)return e[i].value;return null},getAll:function(t){ot(arguments.length,1);for(var e=N(this).entries,n=C(t),i=[],r=0;r<e.length;r++)e[r].key===n&&U(i,e[r].value);return i},has:function(t){ot(arguments.length,1);var e=N(this).entries,n=C(t),i=0;while(i<e.length)if(e[i++].key===n)return!0;return!1},set:function(t,e){ot(arguments.length,1);for(var n,i=N(this),r=i.entries,s=!1,o=C(t),a=C(e),l=0;l<r.length;l++)n=r[l],n.key===o&&(s?X(r,l--,1):(s=!0,n.value=a));s||U(r,{key:o,value:a}),i.updateURL()},sort:function(){var t=N(this);A(t.entries,(function(t,e){return t.key>e.key?1:-1})),t.updateURL()},forEach:function(t){var e,n=N(this).entries,i=y(t,arguments.length>1?arguments[1]:void 0),r=0;while(r<n.length)e=n[r++],i(e.value,e.key,this)},keys:function(){return new at(this,"keys")},values:function(){return new at(this,"values")},entries:function(){return new at(this,"entries")}},{enumerable:!0}),c(ht,D,ht.entries,{name:"entries"}),c(ht,"toString",(function(){return N(this).serialize()}),{enumerable:!0}),u(ct,O),i({global:!0,forced:!l},{URLSearchParams:ct}),!l&&f(z)){var ut=a(B.has),dt=a(B.set),pt=function(t){if(w(t)){var e,n=t.body;if(b(n)===O)return e=t.headers?new z(t.headers):new z,ut(e,"content-type")||dt(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),x(t,{body:E(0,C(n)),headers:E(0,e)})}return t};if(f(L)&&i({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return L(t,arguments.length>1?pt(arguments[1]):{})}}),f(F)){var gt=function(t){return g(this,R),new F(t,arguments.length>1?pt(arguments[1]):{})};R.constructor=gt,gt.prototype=R,i({global:!0,forced:!0},{Request:gt})}}t.exports={URLSearchParams:ct,getState:N}},6456:function(t,e,n){"use strict";n(8783);var i,r=n(2109),s=n(9781),o=n(590),a=n(7854),l=n(9974),c=n(1702),h=n(6048),u=n(1320),d=n(5787),p=n(2597),g=n(1574),f=n(8457),m=n(1589),y=n(8710).codeAt,b=n(3197),v=n(1340),w=n(8003),C=n(1637),x=n(9909),E=x.set,k=x.getterFor("URL"),M=C.URLSearchParams,S=C.getState,A=a.URL,D=a.TypeError,O=a.parseInt,P=Math.floor,T=Math.pow,N=c("".charAt),j=c(/./.exec),L=c([].join),F=c(1..toString),z=c([].pop),R=c([].push),B=c("".replace),I=c([].shift),$=c("".split),V=c("".slice),_=c("".toLowerCase),G=c([].unshift),H="Invalid authority",U="Invalid scheme",W="Invalid host",q="Invalid port",X=/[a-z]/i,Y=/[\d+-.a-z]/i,J=/\d/,Z=/^0x/i,K=/^[0-7]+$/,Q=/^\d+$/,tt=/^[\da-f]+$/i,et=/[\0\t\n\r #%/:<>?@[\\\]^|]/,nt=/[\0\t\n\r #/:<>?@[\\\]^|]/,it=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,rt=/[\t\n\r]/g,st=function(t){var e,n,i,r,s,o,a,l=$(t,".");if(l.length&&""==l[l.length-1]&&l.length--,e=l.length,e>4)return t;for(n=[],i=0;i<e;i++){if(r=l[i],""==r)return t;if(s=10,r.length>1&&"0"==N(r,0)&&(s=j(Z,r)?16:8,r=V(r,8==s?1:2)),""===r)o=0;else{if(!j(10==s?Q:8==s?K:tt,r))return t;o=O(r,s)}R(n,o)}for(i=0;i<e;i++)if(o=n[i],i==e-1){if(o>=T(256,5-e))return null}else if(o>255)return null;for(a=z(n),i=0;i<n.length;i++)a+=n[i]*T(256,3-i);return a},ot=function(t){var e,n,i,r,s,o,a,l=[0,0,0,0,0,0,0,0],c=0,h=null,u=0,d=function(){return N(t,u)};if(":"==d()){if(":"!=N(t,1))return;u+=2,c++,h=c}while(d()){if(8==c)return;if(":"!=d()){e=n=0;while(n<4&&j(tt,d()))e=16*e+O(d(),16),u++,n++;if("."==d()){if(0==n)return;if(u-=n,c>6)return;i=0;while(d()){if(r=null,i>0){if(!("."==d()&&i<4))return;u++}if(!j(J,d()))return;while(j(J,d())){if(s=O(d(),10),null===r)r=s;else{if(0==r)return;r=10*r+s}if(r>255)return;u++}l[c]=256*l[c]+r,i++,2!=i&&4!=i||c++}if(4!=i)return;break}if(":"==d()){if(u++,!d())return}else if(d())return;l[c++]=e}else{if(null!==h)return;u++,c++,h=c}}if(null!==h){o=c-h,c=7;while(0!=c&&o>0)a=l[c],l[c--]=l[h+o-1],l[h+--o]=a}else if(8!=c)return;return l},at=function(t){for(var e=null,n=1,i=null,r=0,s=0;s<8;s++)0!==t[s]?(r>n&&(e=i,n=r),i=null,r=0):(null===i&&(i=s),++r);return r>n&&(e=i,n=r),e},lt=function(t){var e,n,i,r;if("number"==typeof t){for(e=[],n=0;n<4;n++)G(e,t%256),t=P(t/256);return L(e,".")}if("object"==typeof t){for(e="",i=at(t),n=0;n<8;n++)r&&0===t[n]||(r&&(r=!1),i===n?(e+=n?":":"::",r=!0):(e+=F(t[n],16),n<7&&(e+=":")));return"["+e+"]"}return t},ct={},ht=g({},ct,{" ":1,'"':1,"<":1,">":1,"`":1}),ut=g({},ht,{"#":1,"?":1,"{":1,"}":1}),dt=g({},ut,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),pt=function(t,e){var n=y(t,0);return n>32&&n<127&&!p(e,t)?t:encodeURIComponent(t)},gt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ft=function(t,e){var n;return 2==t.length&&j(X,N(t,0))&&(":"==(n=N(t,1))||!e&&"|"==n)},mt=function(t){var e;return t.length>1&&ft(V(t,0,2))&&(2==t.length||"/"===(e=N(t,2))||"\\"===e||"?"===e||"#"===e)},yt=function(t){return"."===t||"%2e"===_(t)},bt=function(t){return t=_(t),".."===t||"%2e."===t||".%2e"===t||"%2e%2e"===t},vt={},wt={},Ct={},xt={},Et={},kt={},Mt={},St={},At={},Dt={},Ot={},Pt={},Tt={},Nt={},jt={},Lt={},Ft={},zt={},Rt={},Bt={},It={},$t=function(t,e,n){var i,r,s,o=v(t);if(e){if(r=this.parse(o),r)throw D(r);this.searchParams=null}else{if(void 0!==n&&(i=new $t(n,!0)),r=this.parse(o,null,i),r)throw D(r);s=S(new M),s.bindURL(this),this.searchParams=s}};$t.prototype={type:"URL",parse:function(t,e,n){var r,s,o,a,l=this,c=e||vt,h=0,u="",d=!1,g=!1,y=!1;t=v(t),e||(l.scheme="",l.username="",l.password="",l.host=null,l.port=null,l.path=[],l.query=null,l.fragment=null,l.cannotBeABaseURL=!1,t=B(t,it,"")),t=B(t,rt,""),r=f(t);while(h<=r.length){switch(s=r[h],c){case vt:if(!s||!j(X,s)){if(e)return U;c=Ct;continue}u+=_(s),c=wt;break;case wt:if(s&&(j(Y,s)||"+"==s||"-"==s||"."==s))u+=_(s);else{if(":"!=s){if(e)return U;u="",c=Ct,h=0;continue}if(e&&(l.isSpecial()!=p(gt,u)||"file"==u&&(l.includesCredentials()||null!==l.port)||"file"==l.scheme&&!l.host))return;if(l.scheme=u,e)return void(l.isSpecial()&&gt[l.scheme]==l.port&&(l.port=null));u="","file"==l.scheme?c=Nt:l.isSpecial()&&n&&n.scheme==l.scheme?c=xt:l.isSpecial()?c=St:"/"==r[h+1]?(c=Et,h++):(l.cannotBeABaseURL=!0,R(l.path,""),c=Rt)}break;case Ct:if(!n||n.cannotBeABaseURL&&"#"!=s)return U;if(n.cannotBeABaseURL&&"#"==s){l.scheme=n.scheme,l.path=m(n.path),l.query=n.query,l.fragment="",l.cannotBeABaseURL=!0,c=It;break}c="file"==n.scheme?Nt:kt;continue;case xt:if("/"!=s||"/"!=r[h+1]){c=kt;continue}c=At,h++;break;case Et:if("/"==s){c=Dt;break}c=zt;continue;case kt:if(l.scheme=n.scheme,s==i)l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=m(n.path),l.query=n.query;else if("/"==s||"\\"==s&&l.isSpecial())c=Mt;else if("?"==s)l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=m(n.path),l.query="",c=Bt;else{if("#"!=s){l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=m(n.path),l.path.length--,c=zt;continue}l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,l.path=m(n.path),l.query=n.query,l.fragment="",c=It}break;case Mt:if(!l.isSpecial()||"/"!=s&&"\\"!=s){if("/"!=s){l.username=n.username,l.password=n.password,l.host=n.host,l.port=n.port,c=zt;continue}c=Dt}else c=At;break;case St:if(c=At,"/"!=s||"/"!=N(u,h+1))continue;h++;break;case At:if("/"!=s&&"\\"!=s){c=Dt;continue}break;case Dt:if("@"==s){d&&(u="%40"+u),d=!0,o=f(u);for(var b=0;b<o.length;b++){var w=o[b];if(":"!=w||y){var C=pt(w,dt);y?l.password+=C:l.username+=C}else y=!0}u=""}else if(s==i||"/"==s||"?"==s||"#"==s||"\\"==s&&l.isSpecial()){if(d&&""==u)return H;h-=f(u).length+1,u="",c=Ot}else u+=s;break;case Ot:case Pt:if(e&&"file"==l.scheme){c=Lt;continue}if(":"!=s||g){if(s==i||"/"==s||"?"==s||"#"==s||"\\"==s&&l.isSpecial()){if(l.isSpecial()&&""==u)return W;if(e&&""==u&&(l.includesCredentials()||null!==l.port))return;if(a=l.parseHost(u),a)return a;if(u="",c=Ft,e)return;continue}"["==s?g=!0:"]"==s&&(g=!1),u+=s}else{if(""==u)return W;if(a=l.parseHost(u),a)return a;if(u="",c=Tt,e==Pt)return}break;case Tt:if(!j(J,s)){if(s==i||"/"==s||"?"==s||"#"==s||"\\"==s&&l.isSpecial()||e){if(""!=u){var x=O(u,10);if(x>65535)return q;l.port=l.isSpecial()&&x===gt[l.scheme]?null:x,u=""}if(e)return;c=Ft;continue}return q}u+=s;break;case Nt:if(l.scheme="file","/"==s||"\\"==s)c=jt;else{if(!n||"file"!=n.scheme){c=zt;continue}if(s==i)l.host=n.host,l.path=m(n.path),l.query=n.query;else if("?"==s)l.host=n.host,l.path=m(n.path),l.query="",c=Bt;else{if("#"!=s){mt(L(m(r,h),""))||(l.host=n.host,l.path=m(n.path),l.shortenPath()),c=zt;continue}l.host=n.host,l.path=m(n.path),l.query=n.query,l.fragment="",c=It}}break;case jt:if("/"==s||"\\"==s){c=Lt;break}n&&"file"==n.scheme&&!mt(L(m(r,h),""))&&(ft(n.path[0],!0)?R(l.path,n.path[0]):l.host=n.host),c=zt;continue;case Lt:if(s==i||"/"==s||"\\"==s||"?"==s||"#"==s){if(!e&&ft(u))c=zt;else if(""==u){if(l.host="",e)return;c=Ft}else{if(a=l.parseHost(u),a)return a;if("localhost"==l.host&&(l.host=""),e)return;u="",c=Ft}continue}u+=s;break;case Ft:if(l.isSpecial()){if(c=zt,"/"!=s&&"\\"!=s)continue}else if(e||"?"!=s)if(e||"#"!=s){if(s!=i&&(c=zt,"/"!=s))continue}else l.fragment="",c=It;else l.query="",c=Bt;break;case zt:if(s==i||"/"==s||"\\"==s&&l.isSpecial()||!e&&("?"==s||"#"==s)){if(bt(u)?(l.shortenPath(),"/"==s||"\\"==s&&l.isSpecial()||R(l.path,"")):yt(u)?"/"==s||"\\"==s&&l.isSpecial()||R(l.path,""):("file"==l.scheme&&!l.path.length&&ft(u)&&(l.host&&(l.host=""),u=N(u,0)+":"),R(l.path,u)),u="","file"==l.scheme&&(s==i||"?"==s||"#"==s))while(l.path.length>1&&""===l.path[0])I(l.path);"?"==s?(l.query="",c=Bt):"#"==s&&(l.fragment="",c=It)}else u+=pt(s,ut);break;case Rt:"?"==s?(l.query="",c=Bt):"#"==s?(l.fragment="",c=It):s!=i&&(l.path[0]+=pt(s,ct));break;case Bt:e||"#"!=s?s!=i&&("'"==s&&l.isSpecial()?l.query+="%27":l.query+="#"==s?"%23":pt(s,ct)):(l.fragment="",c=It);break;case It:s!=i&&(l.fragment+=pt(s,ht));break}h++}},parseHost:function(t){var e,n,i;if("["==N(t,0)){if("]"!=N(t,t.length-1))return W;if(e=ot(V(t,1,-1)),!e)return W;this.host=e}else if(this.isSpecial()){if(t=b(t),j(et,t))return W;if(e=st(t),null===e)return W;this.host=e}else{if(j(nt,t))return W;for(e="",n=f(t),i=0;i<n.length;i++)e+=pt(n[i],ct);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return p(gt,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"==this.scheme&&1==e&&ft(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,n=t.username,i=t.password,r=t.host,s=t.port,o=t.path,a=t.query,l=t.fragment,c=e+":";return null!==r?(c+="//",t.includesCredentials()&&(c+=n+(i?":"+i:"")+"@"),c+=lt(r),null!==s&&(c+=":"+s)):"file"==e&&(c+="//"),c+=t.cannotBeABaseURL?o[0]:o.length?"/"+L(o,"/"):"",null!==a&&(c+="?"+a),null!==l&&(c+="#"+l),c},setHref:function(t){var e=this.parse(t);if(e)throw D(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"==t)try{return new Vt(t.path[0]).origin}catch(n){return"null"}return"file"!=t&&this.isSpecial()?t+"://"+lt(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(v(t)+":",vt)},getUsername:function(){return this.username},setUsername:function(t){var e=f(v(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<e.length;n++)this.username+=pt(e[n],dt)}},getPassword:function(){return this.password},setPassword:function(t){var e=f(v(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<e.length;n++)this.password+=pt(e[n],dt)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?lt(t):lt(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Ot)},getHostname:function(){var t=this.host;return null===t?"":lt(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,Pt)},getPort:function(){var t=this.port;return null===t?"":v(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(t=v(t),""==t?this.port=null:this.parse(t,Tt))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+L(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,Ft))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){t=v(t),""==t?this.query=null:("?"==N(t,0)&&(t=V(t,1)),this.query="",this.parse(t,Bt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){t=v(t),""!=t?("#"==N(t,0)&&(t=V(t,1)),this.fragment="",this.parse(t,It)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Vt=function(t){var e=d(this,_t),n=arguments.length>1?arguments[1]:void 0,i=E(e,new $t(t,!1,n));s||(e.href=i.serialize(),e.origin=i.getOrigin(),e.protocol=i.getProtocol(),e.username=i.getUsername(),e.password=i.getPassword(),e.host=i.getHost(),e.hostname=i.getHostname(),e.port=i.getPort(),e.pathname=i.getPathname(),e.search=i.getSearch(),e.searchParams=i.getSearchParams(),e.hash=i.getHash())},_t=Vt.prototype,Gt=function(t,e){return{get:function(){return k(this)[t]()},set:e&&function(t){return k(this)[e](t)},configurable:!0,enumerable:!0}};if(s&&h(_t,{href:Gt("serialize","setHref"),origin:Gt("getOrigin"),protocol:Gt("getProtocol","setProtocol"),username:Gt("getUsername","setUsername"),password:Gt("getPassword","setPassword"),host:Gt("getHost","setHost"),hostname:Gt("getHostname","setHostname"),port:Gt("getPort","setPort"),pathname:Gt("getPathname","setPathname"),search:Gt("getSearch","setSearch"),searchParams:Gt("getSearchParams"),hash:Gt("getHash","setHash")}),u(_t,"toJSON",(function(){return k(this).serialize()}),{enumerable:!0}),u(_t,"toString",(function(){return k(this).serialize()}),{enumerable:!0}),A){var Ht=A.createObjectURL,Ut=A.revokeObjectURL;Ht&&u(Vt,"createObjectURL",l(Ht,A)),Ut&&u(Vt,"revokeObjectURL",l(Ut,A))}w(Vt,"URL"),r({global:!0,forced:!o,sham:!s},{URL:Vt})},450:function(t,e,n){var i,r,s;
/*!
* jQuery Mousewheel 3.1.13
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
*/(function(o){r=[n(9755)],i=o,s="function"===typeof i?i.apply(e,r):i,void 0===s||(t.exports=s)})((function(t){var e,n,i=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],s=Array.prototype.slice;if(t.event.fixHooks)for(var o=i.length;o;)t.event.fixHooks[i[--o]]=t.event.mouseHooks;var a=t.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=r.length;e;)this.addEventListener(r[--e],l,!1);else this.onmousewheel=l;t.data(this,"mousewheel-line-height",a.getLineHeight(this)),t.data(this,"mousewheel-page-height",a.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=r.length;e;)this.removeEventListener(r[--e],l,!1);else this.onmousewheel=null;t.removeData(this,"mousewheel-line-height"),t.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var n=t(e),i=n["offsetParent"in t.fn?"offsetParent":"parent"]();return i.length||(i=t("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(e){return t(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function l(i){var r=i||window.event,o=s.call(arguments,1),l=0,u=0,d=0,p=0,g=0,f=0;if(i=t.event.fix(r),i.type="mousewheel","detail"in r&&(d=-1*r.detail),"wheelDelta"in r&&(d=r.wheelDelta),"wheelDeltaY"in r&&(d=r.wheelDeltaY),"wheelDeltaX"in r&&(u=-1*r.wheelDeltaX),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(u=-1*d,d=0),l=0===d?u:d,"deltaY"in r&&(d=-1*r.deltaY,l=d),"deltaX"in r&&(u=r.deltaX,0===d&&(l=-1*u)),0!==d||0!==u){if(1===r.deltaMode){var m=t.data(this,"mousewheel-line-height");l*=m,d*=m,u*=m}else if(2===r.deltaMode){var y=t.data(this,"mousewheel-page-height");l*=y,d*=y,u*=y}if(p=Math.max(Math.abs(d),Math.abs(u)),(!n||p<n)&&(n=p,h(r,p)&&(n/=40)),h(r,p)&&(l/=40,u/=40,d/=40),l=Math[l>=1?"floor":"ceil"](l/n),u=Math[u>=1?"floor":"ceil"](u/n),d=Math[d>=1?"floor":"ceil"](d/n),a.settings.normalizeOffset&&this.getBoundingClientRect){var b=this.getBoundingClientRect();g=i.clientX-b.left,f=i.clientY-b.top}return i.deltaX=u,i.deltaY=d,i.deltaFactor=n,i.offsetX=g,i.offsetY=f,i.deltaMode=0,o.unshift(i,l,u,d),e&&clearTimeout(e),e=setTimeout(c,200),(t.event.dispatch||t.event.handle).apply(this,o)}}function c(){n=null}function h(t,e){return a.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120===0}t.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})}))},9755:function(t,e){var n,i;
/*!
* jQuery JavaScript Library v3.6.0
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright OpenJS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2021-03-02T17:08Z
*/(function(e,n){"use strict";"object"===typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)})("undefined"!==typeof window?window:this,(function(r,s){"use strict";var o=[],a=Object.getPrototypeOf,l=o.slice,c=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},h=o.push,u=o.indexOf,d={},p=d.toString,g=d.hasOwnProperty,f=g.toString,m=f.call(Object),y={},b=function(t){return"function"===typeof t&&"number"!==typeof t.nodeType&&"function"!==typeof t.item},v=function(t){return null!=t&&t===t.window},w=r.document,C={type:!0,src:!0,nonce:!0,noModule:!0};function x(t,e,n){n=n||w;var i,r,s=n.createElement("script");if(s.text=t,e)for(i in C)r=e[i]||e.getAttribute&&e.getAttribute(i),r&&s.setAttribute(i,r);n.head.appendChild(s).parentNode.removeChild(s)}function E(t){return null==t?t+"":"object"===typeof t||"function"===typeof t?d[p.call(t)]||"object":typeof t}var k="3.6.0",M=function(t,e){return new M.fn.init(t,e)};function S(t){var e=!!t&&"length"in t&&t.length,n=E(t);return!b(t)&&!v(t)&&("array"===n||0===e||"number"===typeof e&&e>0&&e-1 in t)}M.fn=M.prototype={jquery:k,constructor:M,length:0,toArray:function(){return l.call(this)},get:function(t){return null==t?l.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=M.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return M.each(this,t)},map:function(t){return this.pushStack(M.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(M.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(M.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:o.sort,splice:o.splice},M.extend=M.fn.extend=function(){var t,e,n,i,r,s,o=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"===typeof o&&(c=o,o=arguments[a]||{},a++),"object"===typeof o||b(o)||(o={}),a===l&&(o=this,a--);a<l;a++)if(null!=(t=arguments[a]))for(e in t)i=t[e],"__proto__"!==e&&o!==i&&(c&&i&&(M.isPlainObject(i)||(r=Array.isArray(i)))?(n=o[e],s=r&&!Array.isArray(n)?[]:r||M.isPlainObject(n)?n:{},r=!1,o[e]=M.extend(c,s,i)):void 0!==i&&(o[e]=i));return o},M.extend({expando:"jQuery"+(k+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==p.call(t))&&(e=a(t),!e||(n=g.call(e,"constructor")&&e.constructor,"function"===typeof n&&f.call(n)===m))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){x(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,i=0;if(S(t)){for(n=t.length;i<n;i++)if(!1===e.call(t[i],i,t[i]))break}else for(i in t)if(!1===e.call(t[i],i,t[i]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(S(Object(t))?M.merge(n,"string"===typeof t?[t]:t):h.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:u.call(e,t,n)},merge:function(t,e){for(var n=+e.length,i=0,r=t.length;i<n;i++)t[r++]=e[i];return t.length=r,t},grep:function(t,e,n){for(var i,r=[],s=0,o=t.length,a=!n;s<o;s++)i=!e(t[s],s),i!==a&&r.push(t[s]);return r},map:function(t,e,n){var i,r,s=0,o=[];if(S(t))for(i=t.length;s<i;s++)r=e(t[s],s,n),null!=r&&o.push(r);else for(s in t)r=e(t[s],s,n),null!=r&&o.push(r);return c(o)},guid:1,support:y}),"function"===typeof Symbol&&(M.fn[Symbol.iterator]=o[Symbol.iterator]),M.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){d["[object "+e+"]"]=e.toLowerCase()}));var A=
/*!
* Sizzle CSS Selector Engine v2.3.6
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2021-02-16
*/
function(t){var e,n,i,r,s,o,a,l,c,h,u,d,p,g,f,m,y,b,v,w="sizzle"+1*new Date,C=t.document,x=0,E=0,k=lt(),M=lt(),S=lt(),A=lt(),D=function(t,e){return t===e&&(u=!0),0},O={}.hasOwnProperty,P=[],T=P.pop,N=P.push,j=P.push,L=P.slice,F=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},z="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="[\\x20\\t\\r\\n\\f]",B="(?:\\\\[\\da-fA-F]{1,6}"+R+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",I="\\["+R+"*("+B+")(?:"+R+"*([*^$|!~]?=)"+R+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+B+"))|)"+R+"*\\]",$=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",V=new RegExp(R+"+","g"),_=new RegExp("^"+R+"+|((?:^|[^\\\\])(?:\\\\.)*)"+R+"+$","g"),G=new RegExp("^"+R+"*,"+R+"*"),H=new RegExp("^"+R+"*([>+~]|"+R+")"+R+"*"),U=new RegExp(R+"|>"),W=new RegExp($),q=new RegExp("^"+B+"$"),X={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+z+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,J=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+R+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},it=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,rt=function(t,e){return e?"\0"===t?"<22>":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},st=function(){d()},ot=wt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{j.apply(P=L.call(C.childNodes),C.childNodes),P[C.childNodes.length].nodeType}catch(At){j={apply:P.length?function(t,e){N.apply(t,L.call(e))}:function(t,e){var n=t.length,i=0;while(t[n++]=e[i++]);t.length=n-1}}}function at(t,e,i,r){var s,a,c,h,u,g,y,b=e&&e.ownerDocument,C=e?e.nodeType:9;if(i=i||[],"string"!==typeof t||!t||1!==C&&9!==C&&11!==C)return i;if(!r&&(d(e),e=e||p,f)){if(11!==C&&(u=Q.exec(t)))if(s=u[1]){if(9===C){if(!(c=e.getElementById(s)))return i;if(c.id===s)return i.push(c),i}else if(b&&(c=b.getElementById(s))&&v(e,c)&&c.id===s)return i.push(c),i}else{if(u[2])return j.apply(i,e.getElementsByTagName(t)),i;if((s=u[3])&&n.getElementsByClassName&&e.getElementsByClassName)return j.apply(i,e.getElementsByClassName(s)),i}if(n.qsa&&!A[t+" "]&&(!m||!m.test(t))&&(1!==C||"object"!==e.nodeName.toLowerCase())){if(y=t,b=e,1===C&&(U.test(t)||H.test(t))){b=tt.test(t)&&yt(e.parentNode)||e,b===e&&n.scope||((h=e.getAttribute("id"))?h=h.replace(it,rt):e.setAttribute("id",h=w)),g=o(t),a=g.length;while(a--)g[a]=(h?"#"+h:":scope")+" "+vt(g[a]);y=g.join(",")}try{return j.apply(i,b.querySelectorAll(y)),i}catch(x){A(t,!0)}finally{h===w&&e.removeAttribute("id")}}}return l(t.replace(_,"$1"),e,i,r)}function lt(){var t=[];function e(n,r){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=r}return e}function ct(t){return t[w]=!0,t}function ht(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(At){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ut(t,e){var n=t.split("|"),r=n.length;while(r--)i.attrHandle[n[r]]=e}function dt(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)while(n=n.nextSibling)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function gt(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function ft(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ot(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function mt(t){return ct((function(e){return e=+e,ct((function(n,i){var r,s=t([],n.length,e),o=s.length;while(o--)n[r=s[o]]&&(n[r]=!(i[r]=n[r]))}))}))}function yt(t){return t&&"undefined"!==typeof t.getElementsByTagName&&t}for(e in n=at.support={},s=at.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!Y.test(e||n&&n.nodeName||"HTML")},d=at.setDocument=function(t){var e,r,o=t?t.ownerDocument||t:C;return o!=p&&9===o.nodeType&&o.documentElement?(p=o,g=p.documentElement,f=!s(p),C!=p&&(r=p.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",st,!1):r.attachEvent&&r.attachEvent("onunload",st)),n.scope=ht((function(t){return g.appendChild(t).appendChild(p.createElement("div")),"undefined"!==typeof t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ht((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ht((function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(p.getElementsByClassName),n.getById=ht((function(t){return g.appendChild(t).id=w,!p.getElementsByName||!p.getElementsByName(w).length})),n.getById?(i.filter["ID"]=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},i.find["ID"]=function(t,e){if("undefined"!==typeof e.getElementById&&f){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter["ID"]=function(t){var e=t.replace(et,nt);return function(t){var n="undefined"!==typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find["ID"]=function(t,e){if("undefined"!==typeof e.getElementById&&f){var n,i,r,s=e.getElementById(t);if(s){if(n=s.getAttributeNode("id"),n&&n.value===t)return[s];r=e.getElementsByName(t),i=0;while(s=r[i++])if(n=s.getAttributeNode("id"),n&&n.value===t)return[s]}return[]}}),i.find["TAG"]=n.getElementsByTagName?function(t,e){return"undefined"!==typeof e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,s=e.getElementsByTagName(t);if("*"===t){while(n=s[r++])1===n.nodeType&&i.push(n);return i}return s},i.find["CLASS"]=n.getElementsByClassName&&function(t,e){if("undefined"!==typeof e.getElementsByClassName&&f)return e.getElementsByClassName(t)},y=[],m=[],(n.qsa=K.test(p.querySelectorAll))&&(ht((function(t){var e;g.appendChild(t).innerHTML="<a id='"+w+"'></a><select id='"+w+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+R+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\["+R+"*(?:value|"+z+")"),t.querySelectorAll("[id~="+w+"-]").length||m.push("~="),e=p.createElement("input"),e.setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||m.push("\\["+R+"*name"+R+"*="+R+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+w+"+*").length||m.push(".#.+[+~]"),t.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]")})),ht((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&m.push("name"+R+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),g.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),m.push(",.*:")}))),(n.matchesSelector=K.test(b=g.matches||g.webkitMatchesSelector||g.mozMatchesSelector||g.oMatchesSelector||g.msMatchesSelector))&&ht((function(t){n.disconnectedMatch=b.call(t,"*"),b.call(t,"[s!='']:x"),y.push("!=",$)})),m=m.length&&new RegExp(m.join("|")),y=y.length&&new RegExp(y.join("|")),e=K.test(g.compareDocumentPosition),v=e||K.test(g.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)while(e=e.parentNode)if(e===t)return!0;return!1},D=e?function(t,e){if(t===e)return u=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&i||!n.sortDetached&&e.compareDocumentPosition(t)===i?t==p||t.ownerDocument==C&&v(C,t)?-1:e==p||e.ownerDocument==C&&v(C,e)?1:h?F(h,t)-F(h,e):0:4&i?-1:1)}:function(t,e){if(t===e)return u=!0,0;var n,i=0,r=t.parentNode,s=e.parentNode,o=[t],a=[e];if(!r||!s)return t==p?-1:e==p?1:r?-1:s?1:h?F(h,t)-F(h,e):0;if(r===s)return dt(t,e);n=t;while(n=n.parentNode)o.unshift(n);n=e;while(n=n.parentNode)a.unshift(n);while(o[i]===a[i])i++;return i?dt(o[i],a[i]):o[i]==C?-1:a[i]==C?1:0},p):p},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&f&&!A[e+" "]&&(!y||!y.test(e))&&(!m||!m.test(e)))try{var i=b.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(At){A(e,!0)}return at(e,p,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=p&&d(t),v(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=p&&d(t);var r=i.attrHandle[e.toLowerCase()],s=r&&O.call(i.attrHandle,e.toLowerCase())?r(t,e,!f):void 0;return void 0!==s?s:n.attributes||!f?t.getAttribute(e):(s=t.getAttributeNode(e))&&s.specified?s.value:null},at.escape=function(t){return(t+"").replace(it,rt)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,i=[],r=0,s=0;if(u=!n.detectDuplicates,h=!n.sortStable&&t.slice(0),t.sort(D),u){while(e=t[s++])e===t[s]&&(r=i.push(s));while(r--)t.splice(i[r],1)}return h=null,t},r=at.getText=function(t){var e,n="",i=0,s=t.nodeType;if(s){if(1===s||9===s||11===s){if("string"===typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=r(t)}else if(3===s||4===s)return t.nodeValue}else while(e=t[i++])n+=r(e);return n},i=at.selectors={cacheLength:50,createPseudo:ct,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return X["CHILD"].test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&W.test(n)&&(e=o(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=k[t+" "];return e||(e=new RegExp("(^|"+R+")"+t+"("+R+"|$)"))&&k(t,(function(t){return e.test("string"===typeof t.className&&t.className||"undefined"!==typeof t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var r=at.attr(i,t);return null==r?"!="===e:!e||(r+="","="===e?r===n:"!="===e?r!==n:"^="===e?n&&0===r.indexOf(n):"*="===e?n&&r.indexOf(n)>-1:"$="===e?n&&r.slice(-n.length)===n:"~="===e?(" "+r.replace(V," ")+" ").indexOf(n)>-1:"|="===e&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,r){var s="nth"!==t.slice(0,3),o="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,l){var c,h,u,d,p,g,f=s!==o?"nextSibling":"previousSibling",m=e.parentNode,y=a&&e.nodeName.toLowerCase(),b=!l&&!a,v=!1;if(m){if(s){while(f){d=e;while(d=d[f])if(a?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;g=f="only"===t&&!g&&"nextSibling"}return!0}if(g=[o?m.firstChild:m.lastChild],o&&b){d=m,u=d[w]||(d[w]={}),h=u[d.uniqueID]||(u[d.uniqueID]={}),c=h[t]||[],p=c[0]===x&&c[1],v=p&&c[2],d=p&&m.childNodes[p];while(d=++p&&d&&d[f]||(v=p=0)||g.pop())if(1===d.nodeType&&++v&&d===e){h[t]=[x,p,v];break}}else if(b&&(d=e,u=d[w]||(d[w]={}),h=u[d.uniqueID]||(u[d.uniqueID]={}),c=h[t]||[],p=c[0]===x&&c[1],v=p),!1===v)while(d=++p&&d&&d[f]||(v=p=0)||g.pop())if((a?d.nodeName.toLowerCase()===y:1===d.nodeType)&&++v&&(b&&(u=d[w]||(d[w]={}),h=u[d.uniqueID]||(u[d.uniqueID]={}),h[t]=[x,v]),d===e))break;return v-=r,v===i||v%i===0&&v/i>=0}}},PSEUDO:function(t,e){var n,r=i.pseudos[t]||i.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return r[w]?r(e):r.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?ct((function(t,n){var i,s=r(t,e),o=s.length;while(o--)i=F(t,s[o]),t[i]=!(n[i]=s[o])})):function(t){return r(t,0,n)}):r}},pseudos:{not:ct((function(t){var e=[],n=[],i=a(t.replace(_,"$1"));return i[w]?ct((function(t,e,n,r){var s,o=i(t,null,r,[]),a=t.length;while(a--)(s=o[a])&&(t[a]=!(e[a]=s))})):function(t,r,s){return e[0]=t,i(e,null,s,n),e[0]=null,!n.pop()}})),has:ct((function(t){return function(e){return at(t,e).length>0}})),contains:ct((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||r(e)).indexOf(t)>-1}})),lang:ct((function(t){return q.test(t||"")||at.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=f?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===g},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:ft(!1),disabled:ft(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos["empty"](t)},header:function(t){return Z.test(t.nodeName)},input:function(t){return J.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:mt((function(){return[0]})),last:mt((function(t,e){return[e-1]})),eq:mt((function(t,e,n){return[n<0?n+e:n]})),even:mt((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:mt((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:mt((function(t,e,n){for(var i=n<0?n+e:n>e?e:n;--i>=0;)t.push(i);return t})),gt:mt((function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t}))}},i.pseudos["nth"]=i.pseudos["eq"],{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[e]=pt(e);for(e in{submit:!0,reset:!0})i.pseudos[e]=gt(e);function bt(){}function vt(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function wt(t,e,n){var i=e.dir,r=e.next,s=r||i,o=n&&"parentNode"===s,a=E++;return e.first?function(e,n,r){while(e=e[i])if(1===e.nodeType||o)return t(e,n,r);return!1}:function(e,n,l){var c,h,u,d=[x,a];if(l){while(e=e[i])if((1===e.nodeType||o)&&t(e,n,l))return!0}else while(e=e[i])if(1===e.nodeType||o)if(u=e[w]||(e[w]={}),h=u[e.uniqueID]||(u[e.uniqueID]={}),r&&r===e.nodeName.toLowerCase())e=e[i]||e;else{if((c=h[s])&&c[0]===x&&c[1]===a)return d[2]=c[2];if(h[s]=d,d[2]=t(e,n,l))return!0}return!1}}function Ct(t){return t.length>1?function(e,n,i){var r=t.length;while(r--)if(!t[r](e,n,i))return!1;return!0}:t[0]}function xt(t,e,n){for(var i=0,r=e.length;i<r;i++)at(t,e[i],n);return n}function Et(t,e,n,i,r){for(var s,o=[],a=0,l=t.length,c=null!=e;a<l;a++)(s=t[a])&&(n&&!n(s,i,r)||(o.push(s),c&&e.push(a)));return o}function kt(t,e,n,i,r,s){return i&&!i[w]&&(i=kt(i)),r&&!r[w]&&(r=kt(r,s)),ct((function(s,o,a,l){var c,h,u,d=[],p=[],g=o.length,f=s||xt(e||"*",a.nodeType?[a]:a,[]),m=!t||!s&&e?f:Et(f,d,t,a,l),y=n?r||(s?t:g||i)?[]:o:m;if(n&&n(m,y,a,l),i){c=Et(y,p),i(c,[],a,l),h=c.length;while(h--)(u=c[h])&&(y[p[h]]=!(m[p[h]]=u))}if(s){if(r||t){if(r){c=[],h=y.length;while(h--)(u=y[h])&&c.push(m[h]=u);r(null,y=[],c,l)}h=y.length;while(h--)(u=y[h])&&(c=r?F(s,u):d[h])>-1&&(s[c]=!(o[c]=u))}}else y=Et(y===o?y.splice(g,y.length):y),r?r(null,o,y,l):j.apply(o,y)}))}function Mt(t){for(var e,n,r,s=t.length,o=i.relative[t[0].type],a=o||i.relative[" "],l=o?1:0,h=wt((function(t){return t===e}),a,!0),u=wt((function(t){return F(e,t)>-1}),a,!0),d=[function(t,n,i){var r=!o&&(i||n!==c)||((e=n).nodeType?h(t,n,i):u(t,n,i));return e=null,r}];l<s;l++)if(n=i.relative[t[l].type])d=[wt(Ct(d),n)];else{if(n=i.filter[t[l].type].apply(null,t[l].matches),n[w]){for(r=++l;r<s;r++)if(i.relative[t[r].type])break;return kt(l>1&&Ct(d),l>1&&vt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(_,"$1"),n,l<r&&Mt(t.slice(l,r)),r<s&&Mt(t=t.slice(r)),r<s&&vt(t))}d.push(n)}return Ct(d)}function St(t,e){var n=e.length>0,r=t.length>0,s=function(s,o,a,l,h){var u,g,m,y=0,b="0",v=s&&[],w=[],C=c,E=s||r&&i.find["TAG"]("*",h),k=x+=null==C?1:Math.random()||.1,M=E.length;for(h&&(c=o==p||o||h);b!==M&&null!=(u=E[b]);b++){if(r&&u){g=0,o||u.ownerDocument==p||(d(u),a=!f);while(m=t[g++])if(m(u,o||p,a)){l.push(u);break}h&&(x=k)}n&&((u=!m&&u)&&y--,s&&v.push(u))}if(y+=b,n&&b!==y){g=0;while(m=e[g++])m(v,w,o,a);if(s){if(y>0)while(b--)v[b]||w[b]||(w[b]=T.call(l));w=Et(w)}j.apply(l,w),h&&!s&&w.length>0&&y+e.length>1&&at.uniqueSort(l)}return h&&(x=k,c=C),v};return n?ct(s):s}return bt.prototype=i.filters=i.pseudos,i.setFilters=new bt,o=at.tokenize=function(t,e){var n,r,s,o,a,l,c,h=M[t+" "];if(h)return e?0:h.slice(0);a=t,l=[],c=i.preFilter;while(a){for(o in n&&!(r=G.exec(a))||(r&&(a=a.slice(r[0].length)||a),l.push(s=[])),n=!1,(r=H.exec(a))&&(n=r.shift(),s.push({value:n,type:r[0].replace(_," ")}),a=a.slice(n.length)),i.filter)!(r=X[o].exec(a))||c[o]&&!(r=c[o](r))||(n=r.shift(),s.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return e?a.length:a?at.error(t):M(t,l).slice(0)},a=at.compile=function(t,e){var n,i=[],r=[],s=S[t+" "];if(!s){e||(e=o(t)),n=e.length;while(n--)s=Mt(e[n]),s[w]?i.push(s):r.push(s);s=S(t,St(r,i)),s.selector=t}return s},l=at.select=function(t,e,n,r){var s,l,c,h,u,d="function"===typeof t&&t,p=!r&&o(t=d.selector||t);if(n=n||[],1===p.length){if(l=p[0]=p[0].slice(0),l.length>2&&"ID"===(c=l[0]).type&&9===e.nodeType&&f&&i.relative[l[1].type]){if(e=(i.find["ID"](c.matches[0].replace(et,nt),e)||[])[0],!e)return n;d&&(e=e.parentNode),t=t.slice(l.shift().value.length)}s=X["needsContext"].test(t)?0:l.length;while(s--){if(c=l[s],i.relative[h=c.type])break;if((u=i.find[h])&&(r=u(c.matches[0].replace(et,nt),tt.test(l[0].type)&&yt(e.parentNode)||e))){if(l.splice(s,1),t=r.length&&vt(l),!t)return j.apply(n,r),n;break}}}return(d||a(t,p))(r,e,!f,n,!e||tt.test(t)&&yt(e.parentNode)||e),n},n.sortStable=w.split("").sort(D).join("")===w,n.detectDuplicates=!!u,d(),n.sortDetached=ht((function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))})),ht((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||ut("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ht((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ut("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ht((function(t){return null==t.getAttribute("disabled")}))||ut(z,(function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null})),at}(r);M.find=A,M.expr=A.selectors,M.expr[":"]=M.expr.pseudos,M.uniqueSort=M.unique=A.uniqueSort,M.text=A.getText,M.isXMLDoc=A.isXML,M.contains=A.contains,M.escapeSelector=A.escape;var D=function(t,e,n){var i=[],r=void 0!==n;while((t=t[e])&&9!==t.nodeType)if(1===t.nodeType){if(r&&M(t).is(n))break;i.push(t)}return i},O=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},P=M.expr.match.needsContext;function T(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(t,e,n){return b(e)?M.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?M.grep(t,(function(t){return t===e!==n})):"string"!==typeof e?M.grep(t,(function(t){return u.call(e,t)>-1!==n})):M.filter(e,t,n)}M.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?M.find.matchesSelector(i,t)?[i]:[]:M.find.matches(t,M.grep(e,(function(t){return 1===t.nodeType})))},M.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!==typeof t)return this.pushStack(M(t).filter((function(){for(e=0;e<i;e++)if(M.contains(r[e],this))return!0})));for(n=this.pushStack([]),e=0;e<i;e++)M.find(t,r[e],n);return i>1?M.uniqueSort(n):n},filter:function(t){return this.pushStack(j(this,t||[],!1))},not:function(t){return this.pushStack(j(this,t||[],!0))},is:function(t){return!!j(this,"string"===typeof t&&P.test(t)?M(t):t||[],!1).length}});var L,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,z=M.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||L,"string"===typeof t){if(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:F.exec(t),!i||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof M?e[0]:e,M.merge(this,M.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:w,!0)),N.test(i[1])&&M.isPlainObject(e))for(i in e)b(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return r=w.getElementById(i[2]),r&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):b(t)?void 0!==n.ready?n.ready(t):t(M):M.makeArray(t,this)};z.prototype=M.fn,L=M(w);var R=/^(?:parents|prev(?:Until|All))/,B={children:!0,contents:!0,next:!0,prev:!0};function I(t,e){while((t=t[e])&&1!==t.nodeType);return t}M.fn.extend({has:function(t){var e=M(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(M.contains(this,e[t]))return!0}))},closest:function(t,e){var n,i=0,r=this.length,s=[],o="string"!==typeof t&&M(t);if(!P.test(t))for(;i<r;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&M.find.matchesSelector(n,t))){s.push(n);break}return this.pushStack(s.length>1?M.uniqueSort(s):s)},index:function(t){return t?"string"===typeof t?u.call(M(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(M.uniqueSort(M.merge(this.get(),M(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),M.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return D(t,"parentNode")},parentsUntil:function(t,e,n){return D(t,"parentNode",n)},next:function(t){return I(t,"nextSibling")},prev:function(t){return I(t,"previousSibling")},nextAll:function(t){return D(t,"nextSibling")},prevAll:function(t){return D(t,"previousSibling")},nextUntil:function(t,e,n){return D(t,"nextSibling",n)},prevUntil:function(t,e,n){return D(t,"previousSibling",n)},siblings:function(t){return O((t.parentNode||{}).firstChild,t)},children:function(t){return O(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(T(t,"template")&&(t=t.content||t),M.merge([],t.childNodes))}},(function(t,e){M.fn[t]=function(n,i){var r=M.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"===typeof i&&(r=M.filter(i,r)),this.length>1&&(B[t]||M.uniqueSort(r),R.test(t)&&r.reverse()),this.pushStack(r)}}));var $=/[^\x20\t\r\n\f]+/g;function V(t){var e={};return M.each(t.match($)||[],(function(t,n){e[n]=!0})),e}function _(t){return t}function G(t){throw t}function H(t,e,n,i){var r;try{t&&b(r=t.promise)?r.call(t).done(e).fail(n):t&&b(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}M.Callbacks=function(t){t="string"===typeof t?V(t):M.extend({},t);var e,n,i,r,s=[],o=[],a=-1,l=function(){for(r=r||t.once,i=e=!0;o.length;a=-1){n=o.shift();while(++a<s.length)!1===s[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=s.length,n=!1)}t.memory||(n=!1),e=!1,r&&(s=n?[]:"")},c={add:function(){return s&&(n&&!e&&(a=s.length-1,o.push(n)),function e(n){M.each(n,(function(n,i){b(i)?t.unique&&c.has(i)||s.push(i):i&&i.length&&"string"!==E(i)&&e(i)}))}(arguments),n&&!e&&l()),this},remove:function(){return M.each(arguments,(function(t,e){var n;while((n=M.inArray(e,s,n))>-1)s.splice(n,1),n<=a&&a--})),this},has:function(t){return t?M.inArray(t,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return r=o=[],s=n="",this},disabled:function(){return!s},lock:function(){return r=o=[],n||e||(s=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=n||[],n=[t,n.slice?n.slice():n],o.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},M.extend({Deferred:function(t){var e=[["notify","progress",M.Callbacks("memory"),M.Callbacks("memory"),2],["resolve","done",M.Callbacks("once memory"),M.Callbacks("once memory"),0,"resolved"],["reject","fail",M.Callbacks("once memory"),M.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return s.done(arguments).fail(arguments),this},catch:function(t){return i.then(null,t)},pipe:function(){var t=arguments;return M.Deferred((function(n){M.each(e,(function(e,i){var r=b(t[i[4]])&&t[i[4]];s[i[1]]((function(){var t=r&&r.apply(this,arguments);t&&b(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,i){var s=0;function o(t,e,n,i){return function(){var a=this,l=arguments,c=function(){var r,c;if(!(t<s)){if(r=n.apply(a,l),r===e.promise())throw new TypeError("Thenable self-resolution");c=r&&("object"===typeof r||"function"===typeof r)&&r.then,b(c)?i?c.call(r,o(s,e,_,i),o(s,e,G,i)):(s++,c.call(r,o(s,e,_,i),o(s,e,G,i),o(s,e,_,e.notifyWith))):(n!==_&&(a=void 0,l=[r]),(i||e.resolveWith)(a,l))}},h=i?c:function(){try{c()}catch(i){M.Deferred.exceptionHook&&M.Deferred.exceptionHook(i,h.stackTrace),t+1>=s&&(n!==G&&(a=void 0,l=[i]),e.rejectWith(a,l))}};t?h():(M.Deferred.getStackHook&&(h.stackTrace=M.Deferred.getStackHook()),r.setTimeout(h))}}return M.Deferred((function(r){e[0][3].add(o(0,r,b(i)?i:_,r.notifyWith)),e[1][3].add(o(0,r,b(t)?t:_)),e[2][3].add(o(0,r,b(n)?n:G))})).promise()},promise:function(t){return null!=t?M.extend(t,i):i}},s={};return M.each(e,(function(t,r){var o=r[2],a=r[5];i[r[1]]=o.add,a&&o.add((function(){n=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),o.add(r[3].fire),s[r[0]]=function(){return s[r[0]+"With"](this===s?void 0:this,arguments),this},s[r[0]+"With"]=o.fireWith})),i.promise(s),t&&t.call(s,s),s},when:function(t){var e=arguments.length,n=e,i=Array(n),r=l.call(arguments),s=M.Deferred(),o=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?l.call(arguments):n,--e||s.resolveWith(i,r)}};if(e<=1&&(H(t,s.done(o(n)).resolve,s.reject,!e),"pending"===s.state()||b(r[n]&&r[n].then)))return s.then();while(n--)H(r[n],o(n),s.reject);return s.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;M.Deferred.exceptionHook=function(t,e){r.console&&r.console.warn&&t&&U.test(t.name)&&r.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},M.readyException=function(t){r.setTimeout((function(){throw t}))};var W=M.Deferred();function q(){w.removeEventListener("DOMContentLoaded",q),r.removeEventListener("load",q),M.ready()}M.fn.ready=function(t){return W.then(t).catch((function(t){M.readyException(t)})),this},M.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--M.readyWait:M.isReady)||(M.isReady=!0,!0!==t&&--M.readyWait>0||W.resolveWith(w,[M]))}}),M.ready.then=W.then,"complete"===w.readyState||"loading"!==w.readyState&&!w.documentElement.doScroll?r.setTimeout(M.ready):(w.addEventListener("DOMContentLoaded",q),r.addEventListener("load",q));var X=function(t,e,n,i,r,s,o){var a=0,l=t.length,c=null==n;if("object"===E(n))for(a in r=!0,n)X(t,e,a,n[a],!0,s,o);else if(void 0!==i&&(r=!0,b(i)||(o=!0),c&&(o?(e.call(t,i),e=null):(c=e,e=function(t,e,n){return c.call(M(t),n)})),e))for(;a<l;a++)e(t[a],n,o?i:i.call(t[a],a,e(t[a],n)));return r?t:c?e.call(t):l?e(t[0],n):s},Y=/^-ms-/,J=/-([a-z])/g;function Z(t,e){return e.toUpperCase()}function K(t){return t.replace(Y,"ms-").replace(J,Z)}var Q=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function tt(){this.expando=M.expando+tt.uid++}tt.uid=1,tt.prototype={cache:function(t){var e=t[this.expando];return e||(e={},Q(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var i,r=this.cache(t);if("string"===typeof e)r[K(e)]=n;else for(i in e)r[K(i)]=e[i];return r},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][K(e)]},access:function(t,e,n){return void 0===e||e&&"string"===typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,i=t[this.expando];if(void 0!==i){if(void 0!==e){Array.isArray(e)?e=e.map(K):(e=K(e),e=e in i?[e]:e.match($)||[]),n=e.length;while(n--)delete i[e[n]]}(void 0===e||M.isEmptyObject(i))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!M.isEmptyObject(e)}};var et=new tt,nt=new tt,it=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,rt=/[A-Z]/g;function st(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:it.test(t)?JSON.parse(t):t)}function ot(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(rt,"-$&").toLowerCase(),n=t.getAttribute(i),"string"===typeof n){try{n=st(n)}catch(r){}nt.set(t,e,n)}else n=void 0;return n}M.extend({hasData:function(t){return nt.hasData(t)||et.hasData(t)},data:function(t,e,n){return nt.access(t,e,n)},removeData:function(t,e){nt.remove(t,e)},_data:function(t,e,n){return et.access(t,e,n)},_removeData:function(t,e){et.remove(t,e)}}),M.fn.extend({data:function(t,e){var n,i,r,s=this[0],o=s&&s.attributes;if(void 0===t){if(this.length&&(r=nt.get(s),1===s.nodeType&&!et.get(s,"hasDataAttrs"))){n=o.length;while(n--)o[n]&&(i=o[n].name,0===i.indexOf("data-")&&(i=K(i.slice(5)),ot(s,i,r[i])));et.set(s,"hasDataAttrs",!0)}return r}return"object"===typeof t?this.each((function(){nt.set(this,t)})):X(this,(function(e){var n;if(s&&void 0===e)return n=nt.get(s,t),void 0!==n?n:(n=ot(s,t),void 0!==n?n:void 0);this.each((function(){nt.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){nt.remove(this,t)}))}}),M.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=et.get(t,e),n&&(!i||Array.isArray(n)?i=et.access(t,e,M.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=M.queue(t,e),i=n.length,r=n.shift(),s=M._queueHooks(t,e),o=function(){M.dequeue(t,e)};"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete s.stop,r.call(t,o,s)),!i&&s&&s.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return et.get(t,n)||et.access(t,n,{empty:M.Callbacks("once memory").add((function(){et.remove(t,[e+"queue",n])}))})}}),M.fn.extend({queue:function(t,e){var n=2;return"string"!==typeof t&&(e=t,t="fx",n--),arguments.length<n?M.queue(this[0],t):void 0===e?this:this.each((function(){var n=M.queue(this,t,e);M._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&M.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){M.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,r=M.Deferred(),s=this,o=this.length,a=function(){--i||r.resolveWith(s,[s])};"string"!==typeof t&&(e=t,t=void 0),t=t||"fx";while(o--)n=et.get(s[o],t+"queueHooks"),n&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(e)}});var at=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,lt=new RegExp("^(?:([+-])=|)("+at+")([a-z%]*)$","i"),ct=["Top","Right","Bottom","Left"],ht=w.documentElement,ut=function(t){return M.contains(t.ownerDocument,t)},dt={composed:!0};ht.getRootNode&&(ut=function(t){return M.contains(t.ownerDocument,t)||t.getRootNode(dt)===t.ownerDocument});var pt=function(t,e){return t=e||t,"none"===t.style.display||""===t.style.display&&ut(t)&&"none"===M.css(t,"display")};function gt(t,e,n,i){var r,s,o=20,a=i?function(){return i.cur()}:function(){return M.css(t,e,"")},l=a(),c=n&&n[3]||(M.cssNumber[e]?"":"px"),h=t.nodeType&&(M.cssNumber[e]||"px"!==c&&+l)&&lt.exec(M.css(t,e));if(h&&h[3]!==c){l/=2,c=c||h[3],h=+l||1;while(o--)M.style(t,e,h+c),(1-s)*(1-(s=a()/l||.5))<=0&&(o=0),h/=s;h*=2,M.style(t,e,h+c),n=n||[]}return n&&(h=+h||+l||0,r=n[1]?h+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=h,i.end=r)),r}var ft={};function mt(t){var e,n=t.ownerDocument,i=t.nodeName,r=ft[i];return r||(e=n.body.appendChild(n.createElement(i)),r=M.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),ft[i]=r,r)}function yt(t,e){for(var n,i,r=[],s=0,o=t.length;s<o;s++)i=t[s],i.style&&(n=i.style.display,e?("none"===n&&(r[s]=et.get(i,"display")||null,r[s]||(i.style.display="")),""===i.style.display&&pt(i)&&(r[s]=mt(i))):"none"!==n&&(r[s]="none",et.set(i,"display",n)));for(s=0;s<o;s++)null!=r[s]&&(t[s].style.display=r[s]);return t}M.fn.extend({show:function(){return yt(this,!0)},hide:function(){return yt(this)},toggle:function(t){return"boolean"===typeof t?t?this.show():this.hide():this.each((function(){pt(this)?M(this).show():M(this).hide()}))}});var bt=/^(?:checkbox|radio)$/i,vt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,wt=/^$|^module$|\/(?:java|ecma)script/i;(function(){var t=w.createDocumentFragment(),e=t.appendChild(w.createElement("div")),n=w.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),y.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,e.innerHTML="<option></option>",y.option=!!e.lastChild})();var Ct={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function xt(t,e){var n;return n="undefined"!==typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!==typeof t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&T(t,e)?M.merge([t],n):n}function Et(t,e){for(var n=0,i=t.length;n<i;n++)et.set(t[n],"globalEval",!e||et.get(e[n],"globalEval"))}Ct.tbody=Ct.tfoot=Ct.colgroup=Ct.caption=Ct.thead,Ct.th=Ct.td,y.option||(Ct.optgroup=Ct.option=[1,"<select multiple='multiple'>","</select>"]);var kt=/<|&#?\w+;/;function Mt(t,e,n,i,r){for(var s,o,a,l,c,h,u=e.createDocumentFragment(),d=[],p=0,g=t.length;p<g;p++)if(s=t[p],s||0===s)if("object"===E(s))M.merge(d,s.nodeType?[s]:s);else if(kt.test(s)){o=o||u.appendChild(e.createElement("div")),a=(vt.exec(s)||["",""])[1].toLowerCase(),l=Ct[a]||Ct._default,o.innerHTML=l[1]+M.htmlPrefilter(s)+l[2],h=l[0];while(h--)o=o.lastChild;M.merge(d,o.childNodes),o=u.firstChild,o.textContent=""}else d.push(e.createTextNode(s));u.textContent="",p=0;while(s=d[p++])if(i&&M.inArray(s,i)>-1)r&&r.push(s);else if(c=ut(s),o=xt(u.appendChild(s),"script"),c&&Et(o),n){h=0;while(s=o[h++])wt.test(s.type||"")&&n.push(s)}return u}var St=/^([^.]*)(?:\.(.+)|)/;function At(){return!0}function Dt(){return!1}function Ot(t,e){return t===Pt()===("focus"===e)}function Pt(){try{return w.activeElement}catch(t){}}function Tt(t,e,n,i,r,s){var o,a;if("object"===typeof e){for(a in"string"!==typeof n&&(i=i||n,n=void 0),e)Tt(t,a,n,i,e[a],s);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"===typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=Dt;else if(!r)return t;return 1===s&&(o=r,r=function(t){return M().off(t),o.apply(this,arguments)},r.guid=o.guid||(o.guid=M.guid++)),t.each((function(){M.event.add(this,e,r,i,n)}))}function Nt(t,e,n){n?(et.set(t,e,!1),M.event.add(t,e,{namespace:!1,handler:function(t){var i,r,s=et.get(this,e);if(1&t.isTrigger&&this[e]){if(s.length)(M.event.special[e]||{}).delegateType&&t.stopPropagation();else if(s=l.call(arguments),et.set(this,e,s),i=n(this,e),this[e](),r=et.get(this,e),s!==r||i?et.set(this,e,!1):r={},s!==r)return t.stopImmediatePropagation(),t.preventDefault(),r&&r.value}else s.length&&(et.set(this,e,{value:M.event.trigger(M.extend(s[0],M.Event.prototype),s.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===et.get(t,e)&&M.event.add(t,e,At)}M.event={global:{},add:function(t,e,n,i,r){var s,o,a,l,c,h,u,d,p,g,f,m=et.get(t);if(Q(t)){n.handler&&(s=n,n=s.handler,r=s.selector),r&&M.find.matchesSelector(ht,r),n.guid||(n.guid=M.guid++),(l=m.events)||(l=m.events=Object.create(null)),(o=m.handle)||(o=m.handle=function(e){return"undefined"!==typeof M&&M.event.triggered!==e.type?M.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match($)||[""],c=e.length;while(c--)a=St.exec(e[c])||[],p=f=a[1],g=(a[2]||"").split(".").sort(),p&&(u=M.event.special[p]||{},p=(r?u.delegateType:u.bindType)||p,u=M.event.special[p]||{},h=M.extend({type:p,origType:f,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&M.expr.match.needsContext.test(r),namespace:g.join(".")},s),(d=l[p])||(d=l[p]=[],d.delegateCount=0,u.setup&&!1!==u.setup.call(t,i,g,o)||t.addEventListener&&t.addEventListener(p,o)),u.add&&(u.add.call(t,h),h.handler.guid||(h.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,h):d.push(h),M.event.global[p]=!0)}},remove:function(t,e,n,i,r){var s,o,a,l,c,h,u,d,p,g,f,m=et.hasData(t)&&et.get(t);if(m&&(l=m.events)){e=(e||"").match($)||[""],c=e.length;while(c--)if(a=St.exec(e[c])||[],p=f=a[1],g=(a[2]||"").split(".").sort(),p){u=M.event.special[p]||{},p=(i?u.delegateType:u.bindType)||p,d=l[p]||[],a=a[2]&&new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=d.length;while(s--)h=d[s],!r&&f!==h.origType||n&&n.guid!==h.guid||a&&!a.test(h.namespace)||i&&i!==h.selector&&("**"!==i||!h.selector)||(d.splice(s,1),h.selector&&d.delegateCount--,u.remove&&u.remove.call(t,h));o&&!d.length&&(u.teardown&&!1!==u.teardown.call(t,g,m.handle)||M.removeEvent(t,p,m.handle),delete l[p])}else for(p in l)M.event.remove(t,p+e[c],n,i,!0);M.isEmptyObject(l)&&et.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,s,o,a=new Array(arguments.length),l=M.event.fix(t),c=(et.get(this,"events")||Object.create(null))[l.type]||[],h=M.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,l)){o=M.event.handlers.call(this,l,c),e=0;while((r=o[e++])&&!l.isPropagationStopped()){l.currentTarget=r.elem,n=0;while((s=r.handlers[n++])&&!l.isImmediatePropagationStopped())l.rnamespace&&!1!==s.namespace&&!l.rnamespace.test(s.namespace)||(l.handleObj=s,l.data=s.data,i=((M.event.special[s.origType]||{}).handle||s.handler).apply(r.elem,a),void 0!==i&&!1===(l.result=i)&&(l.preventDefault(),l.stopPropagation()))}return h.postDispatch&&h.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,i,r,s,o,a=[],l=e.delegateCount,c=t.target;if(l&&c.nodeType&&!("click"===t.type&&t.button>=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(s=[],o={},n=0;n<l;n++)i=e[n],r=i.selector+" ",void 0===o[r]&&(o[r]=i.needsContext?M(r,this).index(c)>-1:M.find(r,this,null,[c]).length),o[r]&&s.push(i);s.length&&a.push({elem:c,handlers:s})}return c=this,l<e.length&&a.push({elem:c,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(M.Event.prototype,t,{enumerable:!0,configurable:!0,get:b(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[M.expando]?t:new M.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return bt.test(e.type)&&e.click&&T(e,"input")&&Nt(e,"click",At),!1},trigger:function(t){var e=this||t;return bt.test(e.type)&&e.click&&T(e,"input")&&Nt(e,"click"),!0},_default:function(t){var e=t.target;return bt.test(e.type)&&e.click&&T(e,"input")&&et.get(e,"click")||T(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},M.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},M.Event=function(t,e){if(!(this instanceof M.Event))return new M.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?At:Dt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&M.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[M.expando]=!0},M.Event.prototype={constructor:M.Event,isDefaultPrevented:Dt,isPropagationStopped:Dt,isImmediatePropagationStopped:Dt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=At,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=At,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=At,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},M.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},M.event.addProp),M.each({focus:"focusin",blur:"focusout"},(function(t,e){M.event.special[t]={setup:function(){return Nt(this,t,Ot),!1},trigger:function(){return Nt(this,t),!0},_default:function(){return!0},delegateType:e}})),M.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){M.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=this,r=t.relatedTarget,s=t.handleObj;return r&&(r===i||M.contains(i,r))||(t.type=s.origType,n=s.handler.apply(this,arguments),t.type=e),n}}})),M.fn.extend({on:function(t,e,n,i){return Tt(this,t,e,n,i)},one:function(t,e,n,i){return Tt(this,t,e,n,i,1)},off:function(t,e,n){var i,r;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,M(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"===typeof t){for(r in t)this.off(r,e,t[r]);return this}return!1!==e&&"function"!==typeof e||(n=e,e=void 0),!1===n&&(n=Dt),this.each((function(){M.event.remove(this,t,n,e)}))}});var jt=/<script|<style|<link/i,Lt=/checked\s*(?:[^=]|=\s*.checked.)/i,Ft=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function zt(t,e){return T(t,"table")&&T(11!==e.nodeType?e:e.firstChild,"tr")&&M(t).children("tbody")[0]||t}function Rt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Bt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function It(t,e){var n,i,r,s,o,a,l;if(1===e.nodeType){if(et.hasData(t)&&(s=et.get(t),l=s.events,l))for(r in et.remove(e,"handle events"),l)for(n=0,i=l[r].length;n<i;n++)M.event.add(e,r,l[r][n]);nt.hasData(t)&&(o=nt.access(t),a=M.extend({},o),nt.set(e,a))}}function $t(t,e){var n=e.nodeName.toLowerCase();"input"===n&&bt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function Vt(t,e,n,i){e=c(e);var r,s,o,a,l,h,u=0,d=t.length,p=d-1,g=e[0],f=b(g);if(f||d>1&&"string"===typeof g&&!y.checkClone&&Lt.test(g))return t.each((function(r){var s=t.eq(r);f&&(e[0]=g.call(this,r,s.html())),Vt(s,e,n,i)}));if(d&&(r=Mt(e,t[0].ownerDocument,!1,t,i),s=r.firstChild,1===r.childNodes.length&&(r=s),s||i)){for(o=M.map(xt(r,"script"),Rt),a=o.length;u<d;u++)l=r,u!==p&&(l=M.clone(l,!0,!0),a&&M.merge(o,xt(l,"script"))),n.call(t[u],l,u);if(a)for(h=o[o.length-1].ownerDocument,M.map(o,Bt),u=0;u<a;u++)l=o[u],wt.test(l.type||"")&&!et.access(l,"globalEval")&&M.contains(h,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?M._evalUrl&&!l.noModule&&M._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},h):x(l.textContent.replace(Ft,""),l,h))}return t}function _t(t,e,n){for(var i,r=e?M.filter(e,t):t,s=0;null!=(i=r[s]);s++)n||1!==i.nodeType||M.cleanData(xt(i)),i.parentNode&&(n&&ut(i)&&Et(xt(i,"script")),i.parentNode.removeChild(i));return t}M.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var i,r,s,o,a=t.cloneNode(!0),l=ut(t);if(!y.noCloneChecked&&(1===t.nodeType||11===t.nodeType)&&!M.isXMLDoc(t))for(o=xt(a),s=xt(t),i=0,r=s.length;i<r;i++)$t(s[i],o[i]);if(e)if(n)for(s=s||xt(t),o=o||xt(a),i=0,r=s.length;i<r;i++)It(s[i],o[i]);else It(t,a);return o=xt(a,"script"),o.length>0&&Et(o,!l&&xt(t,"script")),a},cleanData:function(t){for(var e,n,i,r=M.event.special,s=0;void 0!==(n=t[s]);s++)if(Q(n)){if(e=n[et.expando]){if(e.events)for(i in e.events)r[i]?M.event.remove(n,i):M.removeEvent(n,i,e.handle);n[et.expando]=void 0}n[nt.expando]&&(n[nt.expando]=void 0)}}}),M.fn.extend({detach:function(t){return _t(this,t,!0)},remove:function(t){return _t(this,t)},text:function(t){return X(this,(function(t){return void 0===t?M.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Vt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=zt(this,t);e.appendChild(t)}}))},prepend:function(){return Vt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=zt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Vt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Vt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(M.cleanData(xt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return M.clone(this,t,e)}))},html:function(t){return X(this,(function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"===typeof t&&!jt.test(t)&&!Ct[(vt.exec(t)||["",""])[1].toLowerCase()]){t=M.htmlPrefilter(t);try{for(;n<i;n++)e=this[n]||{},1===e.nodeType&&(M.cleanData(xt(e,!1)),e.innerHTML=t);e=0}catch(r){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Vt(this,arguments,(function(e){var n=this.parentNode;M.inArray(this,t)<0&&(M.cleanData(xt(this)),n&&n.replaceChild(e,this))}),t)}}),M.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){M.fn[t]=function(t){for(var n,i=[],r=M(t),s=r.length-1,o=0;o<=s;o++)n=o===s?this:this.clone(!0),M(r[o])[e](n),h.apply(i,n.get());return this.pushStack(i)}}));var Gt=new RegExp("^("+at+")(?!px)[a-z%]+$","i"),Ht=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=r),e.getComputedStyle(t)},Ut=function(t,e,n){var i,r,s={};for(r in e)s[r]=t.style[r],t.style[r]=e[r];for(r in i=n.call(t),e)t.style[r]=s[r];return i},Wt=new RegExp(ct.join("|"),"i");function qt(t,e,n){var i,r,s,o,a=t.style;return n=n||Ht(t),n&&(o=n.getPropertyValue(e)||n[e],""!==o||ut(t)||(o=M.style(t,e)),!y.pixelBoxStyles()&&Gt.test(o)&&Wt.test(e)&&(i=a.width,r=a.minWidth,s=a.maxWidth,a.minWidth=a.maxWidth=a.width=o,o=n.width,a.width=i,a.minWidth=r,a.maxWidth=s)),void 0!==o?o+"":o}function Xt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}(function(){function t(){if(h){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",h.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ht.appendChild(c).appendChild(h);var t=r.getComputedStyle(h);n="1%"!==t.top,l=12===e(t.marginLeft),h.style.right="60%",o=36===e(t.right),i=36===e(t.width),h.style.position="absolute",s=12===e(h.offsetWidth/3),ht.removeChild(c),h=null}}function e(t){return Math.round(parseFloat(t))}var n,i,s,o,a,l,c=w.createElement("div"),h=w.createElement("div");h.style&&(h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===h.style.backgroundClip,M.extend(y,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),o},pixelPosition:function(){return t(),n},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),s},reliableTrDimensions:function(){var t,e,n,i;return null==a&&(t=w.createElement("table"),e=w.createElement("tr"),n=w.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="border:1px solid",e.style.height="1px",n.style.height="9px",n.style.display="block",ht.appendChild(t).appendChild(e).appendChild(n),i=r.getComputedStyle(e),a=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===e.offsetHeight,ht.removeChild(t)),a}}))})();var Yt=["Webkit","Moz","ms"],Jt=w.createElement("div").style,Zt={};function Kt(t){var e=t[0].toUpperCase()+t.slice(1),n=Yt.length;while(n--)if(t=Yt[n]+e,t in Jt)return t}function Qt(t){var e=M.cssProps[t]||Zt[t];return e||(t in Jt?t:Zt[t]=Kt(t)||t)}var te=/^(none|table(?!-c[ea]).+)/,ee=/^--/,ne={position:"absolute",visibility:"hidden",display:"block"},ie={letterSpacing:"0",fontWeight:"400"};function re(t,e,n){var i=lt.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function se(t,e,n,i,r,s){var o="width"===e?1:0,a=0,l=0;if(n===(i?"border":"content"))return 0;for(;o<4;o+=2)"margin"===n&&(l+=M.css(t,n+ct[o],!0,r)),i?("content"===n&&(l-=M.css(t,"padding"+ct[o],!0,r)),"margin"!==n&&(l-=M.css(t,"border"+ct[o]+"Width",!0,r))):(l+=M.css(t,"padding"+ct[o],!0,r),"padding"!==n?l+=M.css(t,"border"+ct[o]+"Width",!0,r):a+=M.css(t,"border"+ct[o]+"Width",!0,r));return!i&&s>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-s-l-a-.5))||0),l}function oe(t,e,n){var i=Ht(t),r=!y.boxSizingReliable()||n,s=r&&"border-box"===M.css(t,"boxSizing",!1,i),o=s,a=qt(t,e,i),l="offset"+e[0].toUpperCase()+e.slice(1);if(Gt.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&s||!y.reliableTrDimensions()&&T(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===M.css(t,"display",!1,i))&&t.getClientRects().length&&(s="border-box"===M.css(t,"boxSizing",!1,i),o=l in t,o&&(a=t[l])),a=parseFloat(a)||0,a+se(t,e,n||(s?"border":"content"),o,i,a)+"px"}function ae(t,e,n,i,r){return new ae.prototype.init(t,e,n,i,r)}M.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=qt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,s,o,a=K(e),l=ee.test(e),c=t.style;if(l||(e=Qt(a)),o=M.cssHooks[e]||M.cssHooks[a],void 0===n)return o&&"get"in o&&void 0!==(r=o.get(t,!1,i))?r:c[e];s=typeof n,"string"===s&&(r=lt.exec(n))&&r[1]&&(n=gt(t,e,r),s="number"),null!=n&&n===n&&("number"!==s||l||(n+=r&&r[3]||(M.cssNumber[a]?"":"px")),y.clearCloneStyle||""!==n||0!==e.indexOf("background")||(c[e]="inherit"),o&&"set"in o&&void 0===(n=o.set(t,n,i))||(l?c.setProperty(e,n):c[e]=n))}},css:function(t,e,n,i){var r,s,o,a=K(e),l=ee.test(e);return l||(e=Qt(a)),o=M.cssHooks[e]||M.cssHooks[a],o&&"get"in o&&(r=o.get(t,!0,n)),void 0===r&&(r=qt(t,e,i)),"normal"===r&&e in ie&&(r=ie[e]),""===n||n?(s=parseFloat(r),!0===n||isFinite(s)?s||0:r):r}}),M.each(["height","width"],(function(t,e){M.cssHooks[e]={get:function(t,n,i){if(n)return!te.test(M.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?oe(t,e,i):Ut(t,ne,(function(){return oe(t,e,i)}))},set:function(t,n,i){var r,s=Ht(t),o=!y.scrollboxSize()&&"absolute"===s.position,a=o||i,l=a&&"border-box"===M.css(t,"boxSizing",!1,s),c=i?se(t,e,i,l,s):0;return l&&o&&(c-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(s[e])-se(t,e,"border",!1,s)-.5)),c&&(r=lt.exec(n))&&"px"!==(r[3]||"px")&&(t.style[e]=n,n=M.css(t,e)),re(t,n,c)}}})),M.cssHooks.marginLeft=Xt(y.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(qt(t,"marginLeft"))||t.getBoundingClientRect().left-Ut(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),M.each({margin:"",padding:"",border:"Width"},(function(t,e){M.cssHooks[t+e]={expand:function(n){for(var i=0,r={},s="string"===typeof n?n.split(" "):[n];i<4;i++)r[t+ct[i]+e]=s[i]||s[i-2]||s[0];return r}},"margin"!==t&&(M.cssHooks[t+e].set=re)})),M.fn.extend({css:function(t,e){return X(this,(function(t,e,n){var i,r,s={},o=0;if(Array.isArray(e)){for(i=Ht(t),r=e.length;o<r;o++)s[e[o]]=M.css(t,e[o],!1,i);return s}return void 0!==n?M.style(t,e,n):M.css(t,e)}),t,e,arguments.length>1)}}),M.Tween=ae,ae.prototype={constructor:ae,init:function(t,e,n,i,r,s){this.elem=t,this.prop=n,this.easing=r||M.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=s||(M.cssNumber[n]?"":"px")},cur:function(){var t=ae.propHooks[this.prop];return t&&t.get?t.get(this):ae.propHooks._default.get(this)},run:function(t){var e,n=ae.propHooks[this.prop];return this.options.duration?this.pos=e=M.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ae.propHooks._default.set(this),this}},ae.prototype.init.prototype=ae.prototype,ae.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=M.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){M.fx.step[t.prop]?M.fx.step[t.prop](t):1!==t.elem.nodeType||!M.cssHooks[t.prop]&&null==t.elem.style[Qt(t.prop)]?t.elem[t.prop]=t.now:M.style(t.elem,t.prop,t.now+t.unit)}}},ae.propHooks.scrollTop=ae.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},M.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},M.fx=ae.prototype.init,M.fx.step={};var le,ce,he=/^(?:toggle|show|hide)$/,ue=/queueHooks$/;function de(){ce&&(!1===w.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(de):r.setTimeout(de,M.fx.interval),M.fx.tick())}function pe(){return r.setTimeout((function(){le=void 0})),le=Date.now()}function ge(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)n=ct[i],r["margin"+n]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function fe(t,e,n){for(var i,r=(be.tweeners[e]||[]).concat(be.tweeners["*"]),s=0,o=r.length;s<o;s++)if(i=r[s].call(n,e,t))return i}function me(t,e,n){var i,r,s,o,a,l,c,h,u="width"in e||"height"in e,d=this,p={},g=t.style,f=t.nodeType&&pt(t),m=et.get(t,"fxshow");for(i in n.queue||(o=M._queueHooks(t,"fx"),null==o.unqueued&&(o.unqueued=0,a=o.empty.fire,o.empty.fire=function(){o.unqueued||a()}),o.unqueued++,d.always((function(){d.always((function(){o.unqueued--,M.queue(t,"fx").length||o.empty.fire()}))}))),e)if(r=e[i],he.test(r)){if(delete e[i],s=s||"toggle"===r,r===(f?"hide":"show")){if("show"!==r||!m||void 0===m[i])continue;f=!0}p[i]=m&&m[i]||M.style(t,i)}if(l=!M.isEmptyObject(e),l||!M.isEmptyObject(p))for(i in u&&1===t.nodeType&&(n.overflow=[g.overflow,g.overflowX,g.overflowY],c=m&&m.display,null==c&&(c=et.get(t,"display")),h=M.css(t,"display"),"none"===h&&(c?h=c:(yt([t],!0),c=t.style.display||c,h=M.css(t,"display"),yt([t]))),("inline"===h||"inline-block"===h&&null!=c)&&"none"===M.css(t,"float")&&(l||(d.done((function(){g.display=c})),null==c&&(h=g.display,c="none"===h?"":h)),g.display="inline-block")),n.overflow&&(g.overflow="hidden",d.always((function(){g.overflow=n.overflow[0],g.overflowX=n.overflow[1],g.overflowY=n.overflow[2]}))),l=!1,p)l||(m?"hidden"in m&&(f=m.hidden):m=et.access(t,"fxshow",{display:c}),s&&(m.hidden=!f),f&&yt([t],!0),d.done((function(){for(i in f||yt([t]),et.remove(t,"fxshow"),p)M.style(t,i,p[i])}))),l=fe(f?m[i]:0,i,d),i in m||(m[i]=l.start,f&&(l.end=l.start,l.start=0))}function ye(t,e){var n,i,r,s,o;for(n in t)if(i=K(n),r=e[i],s=t[n],Array.isArray(s)&&(r=s[1],s=t[n]=s[0]),n!==i&&(t[i]=s,delete t[n]),o=M.cssHooks[i],o&&"expand"in o)for(n in s=o.expand(s),delete t[i],s)n in t||(t[n]=s[n],e[n]=r);else e[i]=r}function be(t,e,n){var i,r,s=0,o=be.prefilters.length,a=M.Deferred().always((function(){delete l.elem})),l=function(){if(r)return!1;for(var e=le||pe(),n=Math.max(0,c.startTime+c.duration-e),i=n/c.duration||0,s=1-i,o=0,l=c.tweens.length;o<l;o++)c.tweens[o].run(s);return a.notifyWith(t,[c,s,n]),s<1&&l?n:(l||a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c]),!1)},c=a.promise({elem:t,props:M.extend({},e),opts:M.extend(!0,{specialEasing:{},easing:M.easing._default},n),originalProperties:e,originalOptions:n,startTime:le||pe(),duration:n.duration,tweens:[],createTween:function(e,n){var i=M.Tween(t,c.opts,e,n,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(i),i},stop:function(e){var n=0,i=e?c.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)c.tweens[n].run(1);return e?(a.notifyWith(t,[c,1,0]),a.resolveWith(t,[c,e])):a.rejectWith(t,[c,e]),this}}),h=c.props;for(ye(h,c.opts.specialEasing);s<o;s++)if(i=be.prefilters[s].call(c,t,h,c.opts),i)return b(i.stop)&&(M._queueHooks(c.elem,c.opts.queue).stop=i.stop.bind(i)),i;return M.map(h,fe,c),b(c.opts.start)&&c.opts.start.call(t,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),M.fx.timer(M.extend(l,{elem:t,anim:c,queue:c.opts.queue})),c}M.Animation=M.extend(be,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return gt(n.elem,t,lt.exec(e),n),n}]},tweener:function(t,e){b(t)?(e=t,t=["*"]):t=t.match($);for(var n,i=0,r=t.length;i<r;i++)n=t[i],be.tweeners[n]=be.tweeners[n]||[],be.tweeners[n].unshift(e)},prefilters:[me],prefilter:function(t,e){e?be.prefilters.unshift(t):be.prefilters.push(t)}}),M.speed=function(t,e,n){var i=t&&"object"===typeof t?M.extend({},t):{complete:n||!n&&e||b(t)&&t,duration:t,easing:n&&e||e&&!b(e)&&e};return M.fx.off?i.duration=0:"number"!==typeof i.duration&&(i.duration in M.fx.speeds?i.duration=M.fx.speeds[i.duration]:i.duration=M.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){b(i.old)&&i.old.call(this),i.queue&&M.dequeue(this,i.queue)},i},M.fn.extend({fadeTo:function(t,e,n,i){return this.filter(pt).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var r=M.isEmptyObject(t),s=M.speed(e,n,i),o=function(){var e=be(this,M.extend({},t),s);(r||et.get(this,"finish"))&&e.stop(!0)};return o.finish=o,r||!1===s.queue?this.each(o):this.queue(s.queue,o)},stop:function(t,e,n){var i=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!==typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,r=null!=t&&t+"queueHooks",s=M.timers,o=et.get(this);if(r)o[r]&&o[r].stop&&i(o[r]);else for(r in o)o[r]&&o[r].stop&&ue.test(r)&&i(o[r]);for(r=s.length;r--;)s[r].elem!==this||null!=t&&s[r].queue!==t||(s[r].anim.stop(n),e=!1,s.splice(r,1));!e&&n||M.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=et.get(this),i=n[t+"queue"],r=n[t+"queueHooks"],s=M.timers,o=i?i.length:0;for(n.finish=!0,M.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=s.length;e--;)s[e].elem===this&&s[e].queue===t&&(s[e].anim.stop(!0),s.splice(e,1));for(e=0;e<o;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish}))}}),M.each(["toggle","show","hide"],(function(t,e){var n=M.fn[e];M.fn[e]=function(t,i,r){return null==t||"boolean"===typeof t?n.apply(this,arguments):this.animate(ge(e,!0),t,i,r)}})),M.each({slideDown:ge("show"),slideUp:ge("hide"),slideToggle:ge("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){M.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),M.timers=[],M.fx.tick=function(){var t,e=0,n=M.timers;for(le=Date.now();e<n.length;e++)t=n[e],t()||n[e]!==t||n.splice(e--,1);n.length||M.fx.stop(),le=void 0},M.fx.timer=function(t){M.timers.push(t),M.fx.start()},M.fx.interval=13,M.fx.start=function(){ce||(ce=!0,de())},M.fx.stop=function(){ce=null},M.fx.speeds={slow:600,fast:200,_default:400},M.fn.delay=function(t,e){return t=M.fx&&M.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,n){var i=r.setTimeout(e,t);n.stop=function(){r.clearTimeout(i)}}))},function(){var t=w.createElement("input"),e=w.createElement("select"),n=e.appendChild(w.createElement("option"));t.type="checkbox",y.checkOn=""!==t.value,y.optSelected=n.selected,t=w.createElement("input"),t.value="t",t.type="radio",y.radioValue="t"===t.value}();var ve,we=M.expr.attrHandle;M.fn.extend({attr:function(t,e){return X(this,M.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){M.removeAttr(this,t)}))}}),M.extend({attr:function(t,e,n){var i,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return"undefined"===typeof t.getAttribute?M.prop(t,e,n):(1===s&&M.isXMLDoc(t)||(r=M.attrHooks[e.toLowerCase()]||(M.expr.match.bool.test(e)?ve:void 0)),void 0!==n?null===n?void M.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:(i=M.find.attr(t,e),null==i?void 0:i))},attrHooks:{type:{set:function(t,e){if(!y.radioValue&&"radio"===e&&T(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match($);if(r&&1===t.nodeType)while(n=r[i++])t.removeAttribute(n)}}),ve={set:function(t,e,n){return!1===e?M.removeAttr(t,n):t.setAttribute(n,n),n}},M.each(M.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=we[e]||M.find.attr;we[e]=function(t,e,i){var r,s,o=e.toLowerCase();return i||(s=we[o],we[o]=r,r=null!=n(t,e,i)?o:null,we[o]=s),r}}));var Ce=/^(?:input|select|textarea|button)$/i,xe=/^(?:a|area)$/i;function Ee(t){var e=t.match($)||[];return e.join(" ")}function ke(t){return t.getAttribute&&t.getAttribute("class")||""}function Me(t){return Array.isArray(t)?t:"string"===typeof t&&t.match($)||[]}M.fn.extend({prop:function(t,e){return X(this,M.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[M.propFix[t]||t]}))}}),M.extend({prop:function(t,e,n){var i,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&M.isXMLDoc(t)||(e=M.propFix[e]||e,r=M.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=M.find.attr(t,"tabindex");return e?parseInt(e,10):Ce.test(t.nodeName)||xe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),y.optSelected||(M.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),M.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){M.propFix[this.toLowerCase()]=this})),M.fn.extend({addClass:function(t){var e,n,i,r,s,o,a,l=0;if(b(t))return this.each((function(e){M(this).addClass(t.call(this,e,ke(this)))}));if(e=Me(t),e.length)while(n=this[l++])if(r=ke(n),i=1===n.nodeType&&" "+Ee(r)+" ",i){o=0;while(s=e[o++])i.indexOf(" "+s+" ")<0&&(i+=s+" ");a=Ee(i),r!==a&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,r,s,o,a,l=0;if(b(t))return this.each((function(e){M(this).removeClass(t.call(this,e,ke(this)))}));if(!arguments.length)return this.attr("class","");if(e=Me(t),e.length)while(n=this[l++])if(r=ke(n),i=1===n.nodeType&&" "+Ee(r)+" ",i){o=0;while(s=e[o++])while(i.indexOf(" "+s+" ")>-1)i=i.replace(" "+s+" "," ");a=Ee(i),r!==a&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t,i="string"===n||Array.isArray(t);return"boolean"===typeof e&&i?e?this.addClass(t):this.removeClass(t):b(t)?this.each((function(n){M(this).toggleClass(t.call(this,n,ke(this),e),e)})):this.each((function(){var e,r,s,o;if(i){r=0,s=M(this),o=Me(t);while(e=o[r++])s.hasClass(e)?s.removeClass(e):s.addClass(e)}else void 0!==t&&"boolean"!==n||(e=ke(this),e&&et.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":et.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,i=0;e=" "+t+" ";while(n=this[i++])if(1===n.nodeType&&(" "+Ee(ke(n))+" ").indexOf(e)>-1)return!0;return!1}});var Se=/\r/g;M.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=b(t),this.each((function(n){var r;1===this.nodeType&&(r=i?t.call(this,n,M(this).val()):t,null==r?r="":"number"===typeof r?r+="":Array.isArray(r)&&(r=M.map(r,(function(t){return null==t?"":t+""}))),e=M.valHooks[this.type]||M.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=M.valHooks[r.type]||M.valHooks[r.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:(n=r.value,"string"===typeof n?n.replace(Se,""):null==n?"":n)):void 0}}),M.extend({valHooks:{option:{get:function(t){var e=M.find.attr(t,"value");return null!=e?e:Ee(M.text(t))}},select:{get:function(t){var e,n,i,r=t.options,s=t.selectedIndex,o="select-one"===t.type,a=o?null:[],l=o?s+1:r.length;for(i=s<0?l:o?s:0;i<l;i++)if(n=r[i],(n.selected||i===s)&&!n.disabled&&(!n.parentNode.disabled||!T(n.parentNode,"optgroup"))){if(e=M(n).val(),o)return e;a.push(e)}return a},set:function(t,e){var n,i,r=t.options,s=M.makeArray(e),o=r.length;while(o--)i=r[o],(i.selected=M.inArray(M.valHooks.option.get(i),s)>-1)&&(n=!0);return n||(t.selectedIndex=-1),s}}}}),M.each(["radio","checkbox"],(function(){M.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=M.inArray(M(t).val(),e)>-1}},y.checkOn||(M.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),y.focusin="onfocusin"in r;var Ae=/^(?:focusinfocus|focusoutblur)$/,De=function(t){t.stopPropagation()};M.extend(M.event,{trigger:function(t,e,n,i){var s,o,a,l,c,h,u,d,p=[n||w],f=g.call(t,"type")?t.type:t,m=g.call(t,"namespace")?t.namespace.split("."):[];if(o=d=a=n=n||w,3!==n.nodeType&&8!==n.nodeType&&!Ae.test(f+M.event.triggered)&&(f.indexOf(".")>-1&&(m=f.split("."),f=m.shift(),m.sort()),c=f.indexOf(":")<0&&"on"+f,t=t[M.expando]?t:new M.Event(f,"object"===typeof t&&t),t.isTrigger=i?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:M.makeArray(e,[t]),u=M.event.special[f]||{},i||!u.trigger||!1!==u.trigger.apply(n,e))){if(!i&&!u.noBubble&&!v(n)){for(l=u.delegateType||f,Ae.test(l+f)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||w)&&p.push(a.defaultView||a.parentWindow||r)}s=0;while((o=p[s++])&&!t.isPropagationStopped())d=o,t.type=s>1?l:u.bindType||f,h=(et.get(o,"events")||Object.create(null))[t.type]&&et.get(o,"handle"),h&&h.apply(o,e),h=c&&o[c],h&&h.apply&&Q(o)&&(t.result=h.apply(o,e),!1===t.result&&t.preventDefault());return t.type=f,i||t.isDefaultPrevented()||u._default&&!1!==u._default.apply(p.pop(),e)||!Q(n)||c&&b(n[f])&&!v(n)&&(a=n[c],a&&(n[c]=null),M.event.triggered=f,t.isPropagationStopped()&&d.addEventListener(f,De),n[f](),t.isPropagationStopped()&&d.removeEventListener(f,De),M.event.triggered=void 0,a&&(n[c]=a)),t.result}},simulate:function(t,e,n){var i=M.extend(new M.Event,n,{type:t,isSimulated:!0});M.event.trigger(i,null,e)}}),M.fn.extend({trigger:function(t,e){return this.each((function(){M.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return M.event.trigger(t,e,n,!0)}}),y.focusin||M.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){M.event.simulate(e,t.target,M.event.fix(t))};M.event.special[e]={setup:function(){var i=this.ownerDocument||this.document||this,r=et.access(i,e);r||i.addEventListener(t,n,!0),et.access(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,r=et.access(i,e)-1;r?et.access(i,e,r):(i.removeEventListener(t,n,!0),et.remove(i,e))}}}));var Oe=r.location,Pe={guid:Date.now()},Te=/\?/;M.parseXML=function(t){var e,n;if(!t||"string"!==typeof t)return null;try{e=(new r.DOMParser).parseFromString(t,"text/xml")}catch(i){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||M.error("Invalid XML: "+(n?M.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Ne=/\[\]$/,je=/\r?\n/g,Le=/^(?:submit|button|image|reset|file)$/i,Fe=/^(?:input|select|textarea|keygen)/i;function ze(t,e,n,i){var r;if(Array.isArray(e))M.each(e,(function(e,r){n||Ne.test(t)?i(t,r):ze(t+"["+("object"===typeof r&&null!=r?e:"")+"]",r,n,i)}));else if(n||"object"!==E(e))i(t,e);else for(r in e)ze(t+"["+r+"]",e[r],n,i)}M.param=function(t,e){var n,i=[],r=function(t,e){var n=b(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!M.isPlainObject(t))M.each(t,(function(){r(this.name,this.value)}));else for(n in t)ze(n,t[n],e,r);return i.join("&")},M.fn.extend({serialize:function(){return M.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=M.prop(this,"elements");return t?M.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!M(this).is(":disabled")&&Fe.test(this.nodeName)&&!Le.test(t)&&(this.checked||!bt.test(t))})).map((function(t,e){var n=M(this).val();return null==n?null:Array.isArray(n)?M.map(n,(function(t){return{name:e.name,value:t.replace(je,"\r\n")}})):{name:e.name,value:n.replace(je,"\r\n")}})).get()}});var Re=/%20/g,Be=/#.*$/,Ie=/([?&])_=[^&]*/,$e=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ve=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,_e=/^(?:GET|HEAD)$/,Ge=/^\/\//,He={},Ue={},We="*/".concat("*"),qe=w.createElement("a");function Xe(t){return function(e,n){"string"!==typeof e&&(n=e,e="*");var i,r=0,s=e.toLowerCase().match($)||[];if(b(n))while(i=s[r++])"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Ye(t,e,n,i){var r={},s=t===Ue;function o(a){var l;return r[a]=!0,M.each(t[a]||[],(function(t,a){var c=a(e,n,i);return"string"!==typeof c||s||r[c]?s?!(l=c):void 0:(e.dataTypes.unshift(c),o(c),!1)})),l}return o(e.dataTypes[0])||!r["*"]&&o("*")}function Je(t,e){var n,i,r=M.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&M.extend(!0,t,i),t}function Ze(t,e,n){var i,r,s,o,a=t.contents,l=t.dataTypes;while("*"===l[0])l.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){l.unshift(r);break}if(l[0]in n)s=l[0];else{for(r in n){if(!l[0]||t.converters[r+" "+l[0]]){s=r;break}o||(o=r)}s=s||o}if(s)return s!==l[0]&&l.unshift(s),n[s]}function Ke(t,e,n,i){var r,s,o,a,l,c={},h=t.dataTypes.slice();if(h[1])for(o in t.converters)c[o.toLowerCase()]=t.converters[o];s=h.shift();while(s)if(t.responseFields[s]&&(n[t.responseFields[s]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=s,s=h.shift(),s)if("*"===s)s=l;else if("*"!==l&&l!==s){if(o=c[l+" "+s]||c["* "+s],!o)for(r in c)if(a=r.split(" "),a[1]===s&&(o=c[l+" "+a[0]]||c["* "+a[0]],o)){!0===o?o=c[r]:!0!==c[r]&&(s=a[0],h.unshift(a[1]));break}if(!0!==o)if(o&&t.throws)e=o(e);else try{e=o(e)}catch(u){return{state:"parsererror",error:o?u:"No conversion from "+l+" to "+s}}}return{state:"success",data:e}}qe.href=Oe.href,M.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Oe.href,type:"GET",isLocal:Ve.test(Oe.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":We,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":M.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Je(Je(t,M.ajaxSettings),e):Je(M.ajaxSettings,t)},ajaxPrefilter:Xe(He),ajaxTransport:Xe(Ue),ajax:function(t,e){"object"===typeof t&&(e=t,t=void 0),e=e||{};var n,i,s,o,a,l,c,h,u,d,p=M.ajaxSetup({},e),g=p.context||p,f=p.context&&(g.nodeType||g.jquery)?M(g):M.event,m=M.Deferred(),y=M.Callbacks("once memory"),b=p.statusCode||{},v={},C={},x="canceled",E={readyState:0,getResponseHeader:function(t){var e;if(c){if(!o){o={};while(e=$e.exec(s))o[e[1].toLowerCase()+" "]=(o[e[1].toLowerCase()+" "]||[]).concat(e[2])}e=o[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?s:null},setRequestHeader:function(t,e){return null==c&&(t=C[t.toLowerCase()]=C[t.toLowerCase()]||t,v[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)E.always(t[E.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||x;return n&&n.abort(e),k(0,e),this}};if(m.promise(E),p.url=((t||p.url||Oe.href)+"").replace(Ge,Oe.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match($)||[""],null==p.crossDomain){l=w.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=qe.protocol+"//"+qe.host!==l.protocol+"//"+l.host}catch(S){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!==typeof p.data&&(p.data=M.param(p.data,p.traditional)),Ye(He,p,e,E),c)return E;for(u in h=M.event&&p.global,h&&0===M.active++&&M.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!_e.test(p.type),i=p.url.replace(Be,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Re,"+")):(d=p.url.slice(i.length),p.data&&(p.processData||"string"===typeof p.data)&&(i+=(Te.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(Ie,"$1"),d=(Te.test(i)?"&":"?")+"_="+Pe.guid+++d),p.url=i+d),p.ifModified&&(M.lastModified[i]&&E.setRequestHeader("If-Modified-Since",M.lastModified[i]),M.etag[i]&&E.setRequestHeader("If-None-Match",M.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&E.setRequestHeader("Content-Type",p.contentType),E.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+We+"; q=0.01":""):p.accepts["*"]),p.headers)E.setRequestHeader(u,p.headers[u]);if(p.beforeSend&&(!1===p.beforeSend.call(g,E,p)||c))return E.abort();if(x="abort",y.add(p.complete),E.done(p.success),E.fail(p.error),n=Ye(Ue,p,e,E),n){if(E.readyState=1,h&&f.trigger("ajaxSend",[E,p]),c)return E;p.async&&p.timeout>0&&(a=r.setTimeout((function(){E.abort("timeout")}),p.timeout));try{c=!1,n.send(v,k)}catch(S){if(c)throw S;k(-1,S)}}else k(-1,"No Transport");function k(t,e,o,l){var u,d,v,w,C,x=e;c||(c=!0,a&&r.clearTimeout(a),n=void 0,s=l||"",E.readyState=t>0?4:0,u=t>=200&&t<300||304===t,o&&(w=Ze(p,E,o)),!u&&M.inArray("script",p.dataTypes)>-1&&M.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=Ke(p,w,E,u),u?(p.ifModified&&(C=E.getResponseHeader("Last-Modified"),C&&(M.lastModified[i]=C),C=E.getResponseHeader("etag"),C&&(M.etag[i]=C)),204===t||"HEAD"===p.type?x="nocontent":304===t?x="notmodified":(x=w.state,d=w.data,v=w.error,u=!v)):(v=x,!t&&x||(x="error",t<0&&(t=0))),E.status=t,E.statusText=(e||x)+"",u?m.resolveWith(g,[d,x,E]):m.rejectWith(g,[E,x,v]),E.statusCode(b),b=void 0,h&&f.trigger(u?"ajaxSuccess":"ajaxError",[E,p,u?d:v]),y.fireWith(g,[E,x]),h&&(f.trigger("ajaxComplete",[E,p]),--M.active||M.event.trigger("ajaxStop")))}return E},getJSON:function(t,e,n){return M.get(t,e,n,"json")},getScript:function(t,e){return M.get(t,void 0,e,"script")}}),M.each(["get","post"],(function(t,e){M[e]=function(t,n,i,r){return b(n)&&(r=r||i,i=n,n=void 0),M.ajax(M.extend({url:t,type:e,dataType:r,data:n,success:i},M.isPlainObject(t)&&t))}})),M.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),M._evalUrl=function(t,e,n){return M.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){M.globalEval(t,e,n)}})},M.fn.extend({wrapAll:function(t){var e;return this[0]&&(b(t)&&(t=t.call(this[0])),e=M(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){var t=this;while(t.firstElementChild)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return b(t)?this.each((function(e){M(this).wrapInner(t.call(this,e))})):this.each((function(){var e=M(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=b(t);return this.each((function(n){M(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){M(this).replaceWith(this.childNodes)})),this}}),M.expr.pseudos.hidden=function(t){return!M.expr.pseudos.visible(t)},M.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},M.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(t){}};var Qe={0:200,1223:204},tn=M.ajaxSettings.xhr();y.cors=!!tn&&"withCredentials"in tn,y.ajax=tn=!!tn,M.ajaxTransport((function(t){var e,n;if(y.cors||tn&&!t.crossDomain)return{send:function(i,s){var o,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];for(o in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(o,i[o]);e=function(t){return function(){e&&(e=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!==typeof a.status?s(0,"error"):s(a.status,a.statusText):s(Qe[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!==typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),n=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&r.setTimeout((function(){e&&n()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(l){if(e)throw l}},abort:function(){e&&e()}}})),M.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),M.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return M.globalEval(t),t}}}),M.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),M.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,r){e=M("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&r("error"===t.type?404:200,t.type)}),w.head.appendChild(e[0])},abort:function(){n&&n()}}}));var en=[],nn=/(=)\?(?=&|$)|\?\?/;M.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=en.pop()||M.expando+"_"+Pe.guid++;return this[t]=!0,t}}),M.ajaxPrefilter("json jsonp",(function(t,e,n){var i,s,o,a=!1!==t.jsonp&&(nn.test(t.url)?"url":"string"===typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&nn.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=b(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(nn,"$1"+i):!1!==t.jsonp&&(t.url+=(Te.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return o||M.error(i+" was not called"),o[0]},t.dataTypes[0]="json",s=r[i],r[i]=function(){o=arguments},n.always((function(){void 0===s?M(r).removeProp(i):r[i]=s,t[i]&&(t.jsonpCallback=e.jsonpCallback,en.push(i)),o&&b(s)&&s(o[0]),o=s=void 0})),"script"})),y.createHTMLDocument=function(){var t=w.implementation.createHTMLDocument("").body;return t.innerHTML="<form></form><form></form>",2===t.childNodes.length}(),M.parseHTML=function(t,e,n){return"string"!==typeof t?[]:("boolean"===typeof e&&(n=e,e=!1),e||(y.createHTMLDocument?(e=w.implementation.createHTMLDocument(""),i=e.createElement("base"),i.href=w.location.href,e.head.appendChild(i)):e=w),r=N.exec(t),s=!n&&[],r?[e.createElement(r[1])]:(r=Mt([t],e,s),s&&s.length&&M(s).remove(),M.merge([],r.childNodes)));var i,r,s},M.fn.load=function(t,e,n){var i,r,s,o=this,a=t.indexOf(" ");return a>-1&&(i=Ee(t.slice(a)),t=t.slice(0,a)),b(e)?(n=e,e=void 0):e&&"object"===typeof e&&(r="POST"),o.length>0&&M.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done((function(t){s=arguments,o.html(i?M("<div>").append(M.parseHTML(t)).find(i):t)})).always(n&&function(t,e){o.each((function(){n.apply(this,s||[t.responseText,e,t])}))}),this},M.expr.pseudos.animated=function(t){return M.grep(M.timers,(function(e){return t===e.elem})).length},M.offset={setOffset:function(t,e,n){var i,r,s,o,a,l,c,h=M.css(t,"position"),u=M(t),d={};"static"===h&&(t.style.position="relative"),a=u.offset(),s=M.css(t,"top"),l=M.css(t,"left"),c=("absolute"===h||"fixed"===h)&&(s+l).indexOf("auto")>-1,c?(i=u.position(),o=i.top,r=i.left):(o=parseFloat(s)||0,r=parseFloat(l)||0),b(e)&&(e=e.call(t,n,M.extend({},a))),null!=e.top&&(d.top=e.top-a.top+o),null!=e.left&&(d.left=e.left-a.left+r),"using"in e?e.using.call(t,d):u.css(d)}},M.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){M.offset.setOffset(this,t,e)}));var e,n,i=this[0];return i?i.getClientRects().length?(e=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,i=this[0],r={top:0,left:0};if("fixed"===M.css(i,"position"))e=i.getBoundingClientRect();else{e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;while(t&&(t===n.body||t===n.documentElement)&&"static"===M.css(t,"position"))t=t.parentNode;t&&t!==i&&1===t.nodeType&&(r=M(t).offset(),r.top+=M.css(t,"borderTopWidth",!0),r.left+=M.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-M.css(i,"marginTop",!0),left:e.left-r.left-M.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){var t=this.offsetParent;while(t&&"static"===M.css(t,"position"))t=t.offsetParent;return t||ht}))}}),M.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;M.fn[t]=function(i){return X(this,(function(t,i,r){var s;if(v(t)?s=t:9===t.nodeType&&(s=t.defaultView),void 0===r)return s?s[e]:t[i];s?s.scrollTo(n?s.pageXOffset:r,n?r:s.pageYOffset):t[i]=r}),t,i,arguments.length)}})),M.each(["top","left"],(function(t,e){M.cssHooks[e]=Xt(y.pixelPosition,(function(t,n){if(n)return n=qt(t,e),Gt.test(n)?M(t).position()[e]+"px":n}))})),M.each({Height:"height",Width:"width"},(function(t,e){M.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){M.fn[i]=function(r,s){var o=arguments.length&&(n||"boolean"!==typeof r),a=n||(!0===r||!0===s?"margin":"border");return X(this,(function(e,n,r){var s;return v(e)?0===i.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(s=e.documentElement,Math.max(e.body["scroll"+t],s["scroll"+t],e.body["offset"+t],s["offset"+t],s["client"+t])):void 0===r?M.css(e,n,a):M.style(e,n,r,a)}),e,o?r:void 0,o)}}))})),M.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){M.fn[e]=function(t){return this.on(e,t)}})),M.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),M.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){M.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var rn=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;M.proxy=function(t,e){var n,i,r;if("string"===typeof e&&(n=t[e],e=t,t=n),b(t))return i=l.call(arguments,2),r=function(){return t.apply(e||this,i.concat(l.call(arguments)))},r.guid=t.guid=t.guid||M.guid++,r},M.holdReady=function(t){t?M.readyWait++:M.ready(!0)},M.isArray=Array.isArray,M.parseJSON=JSON.parse,M.nodeName=T,M.isFunction=b,M.isWindow=v,M.camelCase=K,M.type=E,M.now=Date.now,M.isNumeric=function(t){var e=M.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},M.trim=function(t){return null==t?"":(t+"").replace(rn,"")},n=[],i=function(){return M}.apply(e,n),void 0===i||(t.exports=i);var sn=r.jQuery,on=r.$;return M.noConflict=function(t){return r.$===M&&(r.$=on),t&&r.jQuery===M&&(r.jQuery=sn),M},"undefined"===typeof s&&(r.jQuery=r.$=M),M}))},2441:function(t,e,n){var i;(function(r,s,o){if(r){for(var a,l={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},c={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},h={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},u={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},d=1;d<20;++d)l[111+d]="f"+d;for(d=0;d<=9;++d)l[d+96]=d.toString();M.prototype.bind=function(t,e,n){var i=this;return t=t instanceof Array?t:[t],i._bindMultiple.call(i,t,e,n),i},M.prototype.unbind=function(t,e){var n=this;return n.bind.call(n,t,(function(){}),e)},M.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},M.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},M.prototype.stopCallback=function(t,e){var n=this;if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(k(e,n.target))return!1;if("composedPath"in t&&"function"===typeof t.composedPath){var i=t.composedPath()[0];i!==t.target&&(e=i)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},M.prototype.handleKey=function(){var t=this;return t._handleKey.apply(t,arguments)},M.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(l[e]=t[e]);a=null},M.init=function(){var t=M(s);for(var e in t)"_"!==e.charAt(0)&&(M[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},M.init(),r.Mousetrap=M,t.exports&&(t.exports=M),i=function(){return M}.call(e,n,e,t),i===o||(t.exports=i)}function p(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function g(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return l[t.which]?l[t.which]:c[t.which]?c[t.which]:String.fromCharCode(t.which).toLowerCase()}function f(t,e){return t.sort().join(",")===e.sort().join(",")}function m(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}function y(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function b(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function v(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function w(){if(!a)for(var t in a={},l)t>95&&t<112||l.hasOwnProperty(t)&&(a[l[t]]=t);return a}function C(t,e,n){return n||(n=w()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function x(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus"),t.split("+"))}function E(t,e){var n,i,r,s=[];for(n=x(t),r=0;r<n.length;++r)i=n[r],u[i]&&(i=u[i]),e&&"keypress"!=e&&h[i]&&(i=h[i],s.push("shift")),v(i)&&s.push(i);return e=C(i,s,e),{key:i,modifiers:s,action:e}}function k(t,e){return null!==t&&t!==s&&(t===e||k(t.parentNode,e))}function M(t){var e=this;if(t=t||s,!(e instanceof M))return new M(t);e.target=t,e._callbacks={},e._directMap={};var n,i={},r=!1,o=!1,a=!1;function l(t){t=t||{};var e,n=!1;for(e in i)t[e]?n=!0:i[e]=0;n||(a=!1)}function c(t,n,r,s,o,a){var l,c,h=[],u=r.type;if(!e._callbacks[t])return[];for("keyup"==u&&v(t)&&(n=[t]),l=0;l<e._callbacks[t].length;++l)if(c=e._callbacks[t][l],(s||!c.seq||i[c.seq]==c.level)&&u==c.action&&("keypress"==u&&!r.metaKey&&!r.ctrlKey||f(n,c.modifiers))){var d=!s&&c.combo==o,p=s&&c.seq==s&&c.level==a;(d||p)&&e._callbacks[t].splice(l,1),h.push(c)}return h}function h(t,n,i,r){e.stopCallback(n,n.target||n.srcElement,i,r)||!1===t(n,i)&&(y(n),b(n))}function u(t){"number"!==typeof t.which&&(t.which=t.keyCode);var n=g(t);n&&("keyup"!=t.type||r!==n?e.handleKey(n,m(t),t):r=!1)}function d(){clearTimeout(n),n=setTimeout(l,1e3)}function w(t,e,n,s){function o(e){return function(){a=e,++i[t],d()}}function c(e){h(n,e,t),"keyup"!==s&&(r=g(e)),setTimeout(l,10)}i[t]=0;for(var u=0;u<e.length;++u){var p=u+1===e.length,f=p?c:o(s||E(e[u+1]).action);C(e[u],f,s,t,u)}}function C(t,n,i,r,s){e._directMap[t+":"+i]=n,t=t.replace(/\s+/g," ");var o,a=t.split(" ");a.length>1?w(t,a,n,i):(o=E(t,i),e._callbacks[o.key]=e._callbacks[o.key]||[],c(o.key,o.modifiers,{type:o.action},r,t,s),e._callbacks[o.key][r?"unshift":"push"]({callback:n,modifiers:o.modifiers,action:o.action,seq:r,level:s,combo:t}))}e._handleKey=function(t,e,n){var i,r=c(t,e,n),s={},u=0,d=!1;for(i=0;i<r.length;++i)r[i].seq&&(u=Math.max(u,r[i].level));for(i=0;i<r.length;++i)if(r[i].seq){if(r[i].level!=u)continue;d=!0,s[r[i].seq]=1,h(r[i].callback,n,r[i].combo,r[i].seq)}else d||h(r[i].callback,n,r[i].combo);var p="keypress"==n.type&&o;n.type!=a||v(t)||p||l(s),o=d&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var i=0;i<t.length;++i)C(t[i],e,n)},p(t,"keypress",u),p(t,"keydown",u),p(t,"keyup",u)}})("undefined"!==typeof window?window:null,"undefined"!==typeof window?document:null)},4339:function(t,e,n){"use strict";n.d(e,{b:function(){return i}});var i="document_template_properties"},6631:function(t,e,n){"use strict";n.d(e,{D:function(){return s},z:function(){return o}});var i=n(3872),r="/api/v1.0",s=function(){return i.Z.get(r+"/document_template/properties")},o=function(t){return i.Z.patch(r+"/document_template/properties",t)}},9324:function(t,e,n){"use strict";n.d(e,{hW:function(){return s},Rp:function(){return o},Iu:function(){return a},M7:function(){return c},Dg:function(){return h},jI:function(){return p}});var i=n(3872),r="/api/v1.0/projects",s=function(t){return i.Z.get(r,{params:t})},o=function(t){return i.Z.get(r+"/"+t)},a=function(t){return t.id?d(t):l(t)},l=function(t){return i.Z.post(r,t)},c=function(t){return i.Z.post(r+"/test_connection",t)},h=function(t,e){return i.Z.post(r+"/"+t+"/list_manual_tasks",e)},u="/api/v1.0/groups",d=function(t){return i.Z.patch(u+"/"+t.groupId+"/projects",t)},p=function(t,e){return i.Z["delete"](u+"/"+t+"/projects/"+e)}},8083:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return fO}});var i={};n.r(i),n.d(i,{async:function(){return rC},block:function(){return Xw},circle:function(){return oC},circlePlus:function(){return aC},classic:function(){return Yw},cross:function(){return nC},diamond:function(){return Kw},ellipse:function(){return cC},path:function(){return tC}});var r={};n.r(r),n.d(r,{annotations:function(){return Lw},atConnectionLength:function(){return kC},atConnectionLengthIgnoreGradient:function(){return CC},atConnectionLengthKeepGradient:function(){return wC},atConnectionRatio:function(){return MC},atConnectionRatioIgnoreGradient:function(){return EC},atConnectionRatioKeepGradient:function(){return xC},connection:function(){return vC},displayEmpty:function(){return zw},eol:function(){return Fw},fill:function(){return Sw},filter:function(){return Hw},html:function(){return Gw},lineHeight:function(){return Tw},port:function(){return Uw},ref:function(){return Zv},refCx:function(){return lw},refCy:function(){return cw},refD:function(){return fw},refDKeepOffset:function(){return uw},refDResetOffset:function(){return hw},refDx:function(){return tw},refDy:function(){return ew},refHeight:function(){return iw},refHeight2:function(){return ww},refPoints:function(){return mw},refPointsKeepOffset:function(){return pw},refPointsResetOffset:function(){return dw},refR:function(){return gw},refRCircumscribed:function(){return aw},refRInscribed:function(){return ow},refRx:function(){return rw},refRy:function(){return sw},refWidth:function(){return nw},refWidth2:function(){return vw},refX:function(){return Kv},refX2:function(){return yw},refY:function(){return Qv},refY2:function(){return bw},resetOffset:function(){return $w},sourceMarker:function(){return pC},stroke:function(){return Aw},style:function(){return _w},targetMarker:function(){return gC},text:function(){return Dw},textPath:function(){return jw},textVerticalAnchor:function(){return Nw},textWrap:function(){return Ow},title:function(){return Rw},vertexMarker:function(){return fC},xAlign:function(){return Bw},yAlign:function(){return Iw}});var s={};n.r(s),n.d(s,{dot:function(){return DC},doubleMesh:function(){return TC},fixedDot:function(){return OC},mesh:function(){return PC}});var o={};n.r(o),n.d(o,{blur:function(){return RC},brightness:function(){return HC},contrast:function(){return UC},dropShadow:function(){return BC},grayScale:function(){return IC},highlight:function(){return zC},hueRotate:function(){return _C},invert:function(){return GC},outline:function(){return FC},saturate:function(){return VC},sepia:function(){return $C}});var a={};n.r(a),n.d(a,{flipX:function(){return qC},flipXY:function(){return YC},flipY:function(){return XC},watermark:function(){return JC}});var l={};n.r(l),n.d(l,{className:function(){return ex},opacity:function(){return ix},stroke:function(){return sx}});var c={};n.r(c),n.d(c,{absolute:function(){return hx},bottom:function(){return vx},ellipse:function(){return ux},ellipseSpread:function(){return dx},left:function(){return mx},line:function(){return fx},right:function(){return yx},top:function(){return bx}});var h={};n.r(h),n.d(h,{bottom:function(){return Dx},inside:function(){return Tx},insideOriented:function(){return Nx},left:function(){return Mx},manual:function(){return kx},outside:function(){return Ox},outsideOriented:function(){return Px},radial:function(){return zx},radialOriented:function(){return Rx},right:function(){return Sx},top:function(){return Ax}});var u={};n.r(u),n.d(u,{noop:function(){return nE},pinAbsolute:function(){return lE},pinRelative:function(){return aE}});var d={};n.r(d),n.d(d,{bottom:function(){return RE},bottomLeft:function(){return _E},bottomRight:function(){return GE},center:function(){return FE},left:function(){return BE},midSide:function(){return ZE},nodeCenter:function(){return YE},orth:function(){return XE},right:function(){return IE},top:function(){return zE},topLeft:function(){return $E},topRight:function(){return VE}});var p={};n.r(p),n.d(p,{closest:function(){return nk},length:function(){return tk},orth:function(){return rk},ratio:function(){return QE}});var g={};n.r(g),n.d(g,{anchor:function(){return pk},bbox:function(){return ck},boundary:function(){return uk},rect:function(){return hk}});var f={};n.r(f),n.d(f,{er:function(){return eM},loop:function(){return iM},manhattan:function(){return Kk},metro:function(){return tM},normal:function(){return fk},oneSide:function(){return mk},orth:function(){return Ek}});var m={};n.r(m),n.d(m,{jumpover:function(){return CM},loop:function(){return oM},normal:function(){return sM},rounded:function(){return aM},smooth:function(){return lM}});n(8309),n(2526),n(1817);var y=n(6252),b=n(9963),v=n(3577),w={class:"span-ellipsis"},C={key:0,style:{color:"#b1b3b8"}},x={key:1,style:{color:"#b1b3b8"}},E=(0,y.Uk)(" 导出"),k=(0,y.Uk)("Markdown"),M=(0,y.Uk)("UML PNG"),S=(0,y.Uk)("UML SVG");function A(t,e,n,i,r,s){var o=(0,y.up)("document-sync-task-dropdown"),a=(0,y.up)("el-empty"),l=(0,y.up)("el-skeleton"),c=(0,y.up)("el-switch"),h=(0,y.up)("el-tooltip"),u=(0,y.up)("el-tree"),d=(0,y.up)("el-space"),p=(0,y.up)("el-aside"),g=(0,y.up)("arrow-down"),f=(0,y.up)("el-icon"),m=(0,y.up)("el-button"),A=(0,y.up)("el-dropdown-item"),D=(0,y.up)("el-dropdown-menu"),O=(0,y.up)("el-dropdown"),P=(0,y.up)("el-option"),T=(0,y.up)("el-select"),N=(0,y.up)("el-header"),j=(0,y.up)("DocumentList"),L=(0,y.up)("el-tab-pane"),F=(0,y.up)("el-col"),z=(0,y.up)("el-row"),R=(0,y.up)("diagram"),B=(0,y.up)("el-tabs"),I=(0,y.up)("document-discussion"),$=(0,y.up)("el-main"),V=(0,y.up)("el-container"),_=(0,y.Q2)("loading"),G=(0,y.Q2)("require-roles"),H=(0,y.Q2)("select-more");return i.isShowNoDataPage?((0,y.wg)(),(0,y.j4)(a,{key:0,description:"似乎还没有同步过文档"},{default:(0,y.w5)((function(){return[(0,y.Wm)(o,{projectData:i.projectData,projectTaskData:i.projectTaskData,loading:i.loadings.handleSync,onOnSync:i.onSyncProjectDocument,onOnProgressBarClick:i.onClickTaskProgress},null,8,["projectData","projectTaskData","loading","onOnSync","onOnProgressBarClick"])]})),_:1})):i.isShowLoadingPage?(0,y.wy)(((0,y.wg)(),(0,y.j4)(l,{key:1,rows:12},null,512)),[[_,!i.loadings.init]]):((0,y.wg)(),(0,y.j4)(V,{key:2},{default:(0,y.w5)((function(){return[(0,y.Wm)(p,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(d,{direction:"vertical",size:26,alignment:"left",class:"doc-toc-aside"},{default:(0,y.w5)((function(){return[(0,y.Wm)(c,{modelValue:i.tocData.isMultiSelectionMode,"onUpdate:modelValue":e[0]||(e[0]=function(t){return i.tocData.isMultiSelectionMode=t}),"active-text":"多选模式","inactive-text":"单选模式",onChange:i.onMultiSelectionModeChange,loading:i.loadings.multiSelectionModeChanging},null,8,["modelValue","onChange","loading"]),(0,y.wy)((0,y._)("input",{type:"text",class:"search-input",placeholder:"输入表名、注释进行搜索","onUpdate:modelValue":e[1]||(e[1]=function(t){return i.searchTableText=t})},null,512),[[b.nr,i.searchTableText]]),(0,y.Wm)(u,{ref:"treeRef",data:i.tocData.value,"show-checkbox":i.tocData.isMultiSelectionMode,"default-checked-keys":i.defaultCheckedKeys,"node-key":"id","highlight-current":"",onNodeClick:i.onTocNodeClick,onCheckChange:i.onTocNodeCheckChange,"filter-node-method":i.searchTables},{default:(0,y.w5)((function(t){var e=t.data;return[(0,y._)("span",w,[(0,y.Wm)(h,{content:e.comment&&""!=e.comment?e.name+" /*"+e.comment+"*/":e.name,effect:"light"},{default:(0,y.w5)((function(){return[(0,y._)("span",null,[(0,y.Uk)((0,v.zw)(e.name)+" ",1),e.comment&&""!=e.comment?((0,y.wg)(),(0,y.iD)("span",C,(0,v.zw)("/*"+e.comment+"*/"),1)):e.description&&""!=e.description?((0,y.wg)(),(0,y.iD)("span",x,(0,v.zw)("/*"+e.description+"*/"),1)):(0,y.kq)("",!0)])]})),_:2},1032,["content"])])]})),_:1},8,["data","show-checkbox","default-checked-keys","onNodeClick","onCheckChange","filter-node-method"])]})),_:1})]})),_:1}),(0,y.Wm)(V,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(N,null,{default:(0,y.w5)((function(){return[(0,y._)("div",null,[(0,y.Wm)(d,{size:28,style:{"margin-bottom":"33px"}},{default:(0,y.w5)((function(){return[(0,y.Wm)(o,{projectData:i.projectData,projectTaskData:i.projectTaskData,loading:i.loadings.handleSync,onOnSync:i.onSyncProjectDocument,onOnProgressBarClick:i.onClickTaskProgress},null,8,["projectData","projectTaskData","loading","onOnSync","onOnProgressBarClick"]),(0,y.wy)(((0,y.wg)(),(0,y.j4)(O,null,{dropdown:(0,y.w5)((function(){return[(0,y.Wm)(D,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(A,{onClick:e[2]||(e[2]=function(t){return i.onMarkdownExport()})},{default:(0,y.w5)((function(){return[k]})),_:1}),(0,y.Wm)(A,{onClick:e[3]||(e[3]=function(t){return i.onUmlExport("png")})},{default:(0,y.w5)((function(){return[M]})),_:1}),(0,y.Wm)(A,{onClick:e[4]||(e[4]=function(t){return i.onUmlExport("svg")})},{default:(0,y.w5)((function(){return[S]})),_:1})]})),_:1})]})),default:(0,y.w5)((function(){return[(0,y.Wm)(m,{type:"primary",style:{width:"100%"},icon:"Download",loading:i.loadings.export},{default:(0,y.w5)((function(){return[E,(0,y.Wm)(f,{style:{"margin-left":"8px"}},{default:(0,y.w5)((function(){return[(0,y.Wm)(g)]})),_:1})]})),_:1},8,["loading"])]})),_:1})),[[G,["SYS_OWNER","GROUP_OWNER?groupId="+i.projectData.groupId,"GROUP_MEMBER?groupId="+i.projectData.groupId]]]),(0,y.wy)(((0,y.wg)(),(0,y.j4)(T,{onChange:i.onProjectDocumentVersionChange,modelValue:i.projectData.documentFilter.version,"onUpdate:modelValue":e[5]||(e[5]=function(t){return i.projectData.documentFilter.version=t}),placeholder:"当前版本",clearable:""},{default:(0,y.w5)((function(){return[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(i.versionData.versions,(function(t){return(0,y.wg)(),(0,y.j4)(P,{key:t.version,label:"["+t.createAt+"]->"+t.version,value:t.version},null,8,["label","value"])})),128))]})),_:1},8,["onChange","modelValue"])),[[H,i.loadMoreDocumentVersions],[_,i.loadings.loadingVersions]]),i.documentDiffData.diffModeEnabled?(0,y.wy)(((0,y.wg)(),(0,y.j4)(T,{key:0,onChange:i.onProjectDocumentCompareVersionChange,modelValue:i.documentDiffData.originalVersion,"onUpdate:modelValue":e[6]||(e[6]=function(t){return i.documentDiffData.originalVersion=t}),placeholder:"对比版本",clearable:""},{default:(0,y.w5)((function(){return[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(i.versionData.versions,(function(t){return(0,y.wg)(),(0,y.j4)(P,{key:t.version,label:"["+t.createAt+"]->"+t.version,value:t.version},null,8,["label","value"])})),128))]})),_:1},8,["onChange","modelValue"])),[[H,i.loadMoreDocumentVersions],[_,i.loadings.loadingVersions]]):(0,y.kq)("",!0),"tableDocument"==i.activeTab?((0,y.wg)(),(0,y.j4)(c,{key:1,modelValue:i.documentDiffData.diffModeEnabled,"onUpdate:modelValue":e[7]||(e[7]=function(t){return i.documentDiffData.diffModeEnabled=t}),"before-change":i.onDiffModeChange,"active-text":"显示版本差异"},null,8,["modelValue","before-change"])):(0,y.kq)("",!0)]})),_:1})])]})),_:1}),(0,y.Wm)($,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(B,{"model-value":"tableDocument",onTabClick:i.onTabClick},{default:(0,y.w5)((function(){return[(0,y.Wm)(L,{label:"列表",name:"tableDocument"},{default:(0,y.w5)((function(){return[(0,y.Wm)(j,{tablesData:i.documentData.tables,overviewData:i.documentData.overview,overviewDiff:i.documentDiffData.overviewDiff,tablesDiff:i.documentDiffData.tablesDiff,diffEnabled:i.documentDiffData.diffModeEnabled,docVersion:i.projectData.documentFilter.version,onOnRemark:i.showDiscussionDrawer},null,8,["tablesData","overviewData","overviewDiff","tablesDiff","diffEnabled","docVersion","onOnRemark"])]})),_:1}),(0,y.Wm)(L,{label:"UML",name:"umlPanel",style:{width:"100%"},lazy:!0},{default:(0,y.w5)((function(){return[(0,y.Wm)(z,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(F,{span:5},{default:(0,y.w5)((function(){return[(0,y.Wm)(c,{modelValue:i.umlData.showComment,"onUpdate:modelValue":e[8]||(e[8]=function(t){return i.umlData.showComment=t}),"active-text":"显示注释","inactive-text":"隐藏注释"},null,8,["modelValue"])]})),_:1})]})),_:1}),(0,y.Wm)(R,{"model-data":i.umlData.tables,"show-comment":i.umlData.showComment,ref:"umlDiagramComponentRef"},null,8,["model-data","show-comment"])]})),_:1})]})),_:1},8,["onTabClick"]),(0,y.Wm)(I,{groupId:i.documentDiscussionData.groupId,projectId:i.documentDiscussionData.projectId,tableName:i.documentDiscussionData.tableName,columnName:i.documentDiscussionData.columnName,isShowDrawer:i.documentDiscussionData.isShowDrawer,onOnClose:e[9]||(e[9]=function(t){return i.documentDiscussionData.isShowDrawer=!1})},null,8,["groupId","projectId","tableName","columnName","isShowDrawer"])]})),_:1})]})),_:1})]})),_:1}))}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function O(t){if(Array.isArray(t))return D(t)}n(1539),n(2165),n(8783),n(3948),n(1038);function P(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}n(7042),n(4916),n(7601);function T(t,e){if(t){if("string"===typeof t)return D(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(t,e):void 0}}n(1703);function N(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(t){return O(t)||P(t)||T(t)||N()}var L=n(8534),F=(n(5666),n(7327),n(6699),n(2023),n(1249),n(189),n(4747),n(1532),n(9826),n(2262)),z=n(2119),R=(n(6456),n(1637),n(3872)),B="/api/v1.0",I=function(t,e,n){return R.Z.post(B+"/projects/"+t+"/documents/"+e+"/table_documents",n)},$=function(t,e){return R.Z.get(B+"/projects/"+t+"/documents/simple",{params:e})},V=function(t){return R.Z.post(B+"/projects/"+t+"/documents")},_=function(t,e){return R.Z.get(B+"/projects/"+t+"/document_versions",{params:e})},G=function(t,e){return R.Z.get(B+"/projects/"+t+"/diff_documents",{params:e})},H=function(t,e,n,i){return W(B+"/projects/"+t+"/document_files",e,n,i)},U=function(t,e){return R.Z.get(B+"/projects/"+t+"/tables",{params:e})};function W(t,e,n,i){R.Z.get(t,{responseType:"blob",params:e}).then((function(t){var e=window.URL||window.webkitURL||window,r=document.createElement("a");r.href=e.createObjectURL(new Blob([t])),r.download=n+".md",document.body.appendChild(r),r.click(),i()})).catch((function(){return i()}))}var q=n(9324),X=n(7234),Y=n(6302),J={id:"diagram-container",style:{"min-width":"100vw","min-height":"100vh"}};function Z(t,e,n,i,r,s){return(0,y.wg)(),(0,y.iD)("div",J)}n(6535),n(9244);var K=n(9755),Q=n.n(K);n(450);const tt=navigator.userAgent;var et;if(function(t){t.IS_MAC=navigator.appVersion.indexOf("Mac")>0,t.IS_IOS=!!tt.match(/(iPad|iPhone|iPod)/g),t.IS_WINDOWS=navigator.appVersion.indexOf("Win")>0,t.IS_IE=tt.indexOf("MSIE")>=0,t.IS_IE11=!!tt.match(/Trident\/7\./),t.IS_EDGE=!!tt.match(/Edge\//),t.IS_NETSCAPE=tt.indexOf("Mozilla/")>=0&&tt.indexOf("MSIE")<0&&tt.indexOf("Edge/")<0,t.IS_CHROME_APP=null!=window.chrome&&null!=window.chrome.app&&null!=window.chrome.app.runtime,t.IS_CHROME=tt.indexOf("Chrome/")>=0&&tt.indexOf("Edge/")<0,t.IS_OPERA=tt.indexOf("Opera/")>=0||tt.indexOf("OPR/")>=0,t.IS_FIREFOX=tt.indexOf("Firefox/")>=0,t.IS_SAFARI=tt.indexOf("AppleWebKit/")>=0&&tt.indexOf("Chrome/")<0&&tt.indexOf("Edge/")<0,t.SUPPORT_TOUCH="ontouchstart"in document.documentElement,t.SUPPORT_POINTER=null!=window.PointerEvent&&!t.IS_MAC,t.SUPPORT_PASSIVE=!1;try{const e=Object.defineProperty({},"passive",{get(){t.SUPPORT_PASSIVE=!0}}),n=document.createElement("div");n.addEventListener&&n.addEventListener("click",(()=>{}),e)}catch(e){}t.NO_FOREIGNOBJECT=!document.createElementNS||"[object SVGForeignObjectElement]"!==`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`||tt.indexOf("Opera/")>=0,t.SUPPORT_FOREIGNOBJECT=!t.NO_FOREIGNOBJECT}(et||(et={})),function(t){function e(){const t=window.module;return null!=t&&null!=t.hot&&null!=t.hot.status?t.hot.status():"unkonwn"}function n(){return"apply"===e()}t.getHMRStatus=e,t.isApplyingHMR=n;const i={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function r(t){const e=document.createElement(i[t]||"div"),n=`on${t}`;let r=n in e;return r||(e.setAttribute(n,"return;"),r="function"===typeof e[n]),r}t.isEventSupported=r}(et||(et={})),et.SUPPORT_PASSIVE){Q().event.special.touchstart={setup(t,e,n){if(!this.addEventListener)return!1;this.addEventListener("touchstart",n,{passive:!0})}};const t=Q().event.special.mousewheel;if(t){const e=t.setup;t.setup=function(){const t=this.addEventListener;if(!t)return!1;this.addEventListener=(e,n)=>{t.call(this,e,n,{passive:!0})},e.call(this),this.addEventListener=t}}}window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),function(t){t.forEach((t=>{Object.prototype.hasOwnProperty.call(t,"append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value(...t){const e=document.createDocumentFragment();t.forEach((t=>{const n=t instanceof Node;e.appendChild(n?t:document.createTextNode(String(t)))})),this.appendChild(e)}})}))}([Element.prototype,Document.prototype,DocumentFragment.prototype]);var nt=Array.isArray,it=nt,rt="object"==typeof global&&global&&global.Object===Object&&global,st=rt,ot="object"==typeof self&&self&&self.Object===Object&&self,at=st||ot||Function("return this")(),lt=at,ct=lt.Symbol,ht=ct,ut=Object.prototype,dt=ut.hasOwnProperty,pt=ut.toString,gt=ht?ht.toStringTag:void 0;function ft(t){var e=dt.call(t,gt),n=t[gt];try{t[gt]=void 0;var i=!0}catch(s){}var r=pt.call(t);return i&&(e?t[gt]=n:delete t[gt]),r}var mt=ft,yt=Object.prototype,bt=yt.toString;function vt(t){return bt.call(t)}var wt=vt,Ct="[object Null]",xt="[object Undefined]",Et=ht?ht.toStringTag:void 0;function kt(t){return null==t?void 0===t?xt:Ct:Et&&Et in Object(t)?mt(t):wt(t)}var Mt=kt;function St(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var At=St,Dt="[object AsyncFunction]",Ot="[object Function]",Pt="[object GeneratorFunction]",Tt="[object Proxy]";function Nt(t){if(!At(t))return!1;var e=Mt(t);return e==Ot||e==Pt||e==Dt||e==Tt}var jt=Nt,Lt=9007199254740991;function Ft(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Lt}var zt=Ft;function Rt(t){return null!=t&&zt(t.length)&&!jt(t)}var Bt=Rt,It=lt["__core-js_shared__"],$t=It,Vt=function(){var t=/[^.]+$/.exec($t&&$t.keys&&$t.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function _t(t){return!!Vt&&Vt in t}var Gt=_t,Ht=Function.prototype,Ut=Ht.toString;function Wt(t){if(null!=t){try{return Ut.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var qt=Wt,Xt=/[\\^$.*+?()[\]{}|]/g,Yt=/^\[object .+?Constructor\]$/,Jt=Function.prototype,Zt=Object.prototype,Kt=Jt.toString,Qt=Zt.hasOwnProperty,te=RegExp("^"+Kt.call(Qt).replace(Xt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ee(t){if(!At(t)||Gt(t))return!1;var e=jt(t)?te:Yt;return e.test(qt(t))}var ne=ee;function ie(t,e){return null==t?void 0:t[e]}var re=ie;function se(t,e){var n=re(t,e);return ne(n)?n:void 0}var oe=se,ae=oe(Object,"create"),le=ae;function ce(){this.__data__=le?le(null):{},this.size=0}var he=ce;function ue(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var de=ue,pe="__lodash_hash_undefined__",ge=Object.prototype,fe=ge.hasOwnProperty;function me(t){var e=this.__data__;if(le){var n=e[t];return n===pe?void 0:n}return fe.call(e,t)?e[t]:void 0}var ye=me,be=Object.prototype,ve=be.hasOwnProperty;function we(t){var e=this.__data__;return le?void 0!==e[t]:ve.call(e,t)}var Ce=we,xe="__lodash_hash_undefined__";function Ee(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=le&&void 0===e?xe:e,this}var ke=Ee;function Me(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e<n){var i=t[e];this.set(i[0],i[1])}}Me.prototype.clear=he,Me.prototype["delete"]=de,Me.prototype.get=ye,Me.prototype.has=Ce,Me.prototype.set=ke;var Se=Me;function Ae(){this.__data__=[],this.size=0}var De=Ae;function Oe(t,e){return t===e||t!==t&&e!==e}var Pe=Oe;function Te(t,e){var n=t.length;while(n--)if(Pe(t[n][0],e))return n;return-1}var Ne=Te,je=Array.prototype,Le=je.splice;function Fe(t){var e=this.__data__,n=Ne(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():Le.call(e,n,1),--this.size,!0}var ze=Fe;function Re(t){var e=this.__data__,n=Ne(e,t);return n<0?void 0:e[n][1]}var Be=Re;function Ie(t){return Ne(this.__data__,t)>-1}var $e=Ie;function Ve(t,e){var n=this.__data__,i=Ne(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}var _e=Ve;function Ge(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e<n){var i=t[e];this.set(i[0],i[1])}}Ge.prototype.clear=De,Ge.prototype["delete"]=ze,Ge.prototype.get=Be,Ge.prototype.has=$e,Ge.prototype.set=_e;var He=Ge,Ue=oe(lt,"Map"),We=Ue;function qe(){this.size=0,this.__data__={hash:new Se,map:new(We||He),string:new Se}}var Xe=qe;function Ye(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}var Je=Ye;function Ze(t,e){var n=t.__data__;return Je(e)?n["string"==typeof e?"string":"hash"]:n.map}var Ke=Ze;function Qe(t){var e=Ke(this,t)["delete"](t);return this.size-=e?1:0,e}var tn=Qe;function en(t){return Ke(this,t).get(t)}var nn=en;function rn(t){return Ke(this,t).has(t)}var sn=rn;function on(t,e){var n=Ke(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}var an=on;function ln(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e<n){var i=t[e];this.set(i[0],i[1])}}ln.prototype.clear=Xe,ln.prototype["delete"]=tn,ln.prototype.get=nn,ln.prototype.has=sn,ln.prototype.set=an;var cn=ln,hn="__lodash_hash_undefined__";function un(t){return this.__data__.set(t,hn),this}var dn=un;function pn(t){return this.__data__.has(t)}var gn=pn;function fn(t){var e=-1,n=null==t?0:t.length;this.__data__=new cn;while(++e<n)this.add(t[e])}fn.prototype.add=fn.prototype.push=dn,fn.prototype.has=gn;var mn=fn;function yn(t,e,n,i){var r=t.length,s=n+(i?1:-1);while(i?s--:++s<r)if(e(t[s],s,t))return s;return-1}var bn=yn;function vn(t){return t!==t}var wn=vn;function Cn(t,e,n){var i=n-1,r=t.length;while(++i<r)if(t[i]===e)return i;return-1}var xn=Cn;function En(t,e,n){return e===e?xn(t,e,n):bn(t,wn,n)}var kn=En;function Mn(t,e){var n=null==t?0:t.length;return!!n&&kn(t,e,0)>-1}var Sn=Mn;function An(t,e,n){var i=-1,r=null==t?0:t.length;while(++i<r)if(n(e,t[i]))return!0;return!1}var Dn=An;function On(t,e){return t.has(e)}var Pn=On,Tn=oe(lt,"Set"),Nn=Tn;function jn(){}var Ln=jn;function Fn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var zn=Fn,Rn=1/0,Bn=Nn&&1/zn(new Nn([,-0]))[1]==Rn?function(t){return new Nn(t)}:Ln,In=Bn,$n=200;function Vn(t,e,n){var i=-1,r=Sn,s=t.length,o=!0,a=[],l=a;if(n)o=!1,r=Dn;else if(s>=$n){var c=e?null:In(t);if(c)return zn(c);o=!1,r=Pn,l=new mn}else l=e?[]:a;t:while(++i<s){var h=t[i],u=e?e(h):h;if(h=n||0!==h?h:0,o&&u===u){var d=l.length;while(d--)if(l[d]===u)continue t;e&&l.push(u),a.push(h)}else r(l,u,n)||(l!==a&&l.push(u),a.push(h))}return a}var _n=Vn;function Gn(t){return t&&t.length?_n(t):[]}var Hn=Gn;function Un(t,e){var n=-1,i=e.length,r=t.length;while(++n<i)t[r+n]=e[n];return t}var Wn=Un;function qn(t){return null!=t&&"object"==typeof t}var Xn=qn,Yn="[object Arguments]";function Jn(t){return Xn(t)&&Mt(t)==Yn}var Zn=Jn,Kn=Object.prototype,Qn=Kn.hasOwnProperty,ti=Kn.propertyIsEnumerable,ei=Zn(function(){return arguments}())?Zn:function(t){return Xn(t)&&Qn.call(t,"callee")&&!ti.call(t,"callee")},ni=ei,ii=ht?ht.isConcatSpreadable:void 0;function ri(t){return it(t)||ni(t)||!!(ii&&t&&t[ii])}var si=ri;function oi(t,e,n,i,r){var s=-1,o=t.length;n||(n=si),r||(r=[]);while(++s<o){var a=t[s];e>0&&n(a)?e>1?oi(a,e-1,n,i,r):Wn(r,a):i||(r[r.length]=a)}return r}var ai=oi;function li(t){return t}var ci=li;function hi(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var ui=hi,di=Math.max;function pi(t,e,n){return e=di(void 0===e?t.length-1:e,0),function(){var i=arguments,r=-1,s=di(i.length-e,0),o=Array(s);while(++r<s)o[r]=i[e+r];r=-1;var a=Array(e+1);while(++r<e)a[r]=i[r];return a[e]=n(o),ui(t,this,a)}}var gi=pi;function fi(t){return function(){return t}}var mi=fi,yi=function(){try{var t=oe(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),bi=yi,vi=bi?function(t,e){return bi(t,"toString",{configurable:!0,enumerable:!1,value:mi(e),writable:!0})}:ci,wi=vi,Ci=800,xi=16,Ei=Date.now;function ki(t){var e=0,n=0;return function(){var i=Ei(),r=xi-(i-n);if(n=i,r>0){if(++e>=Ci)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Mi=ki,Si=Mi(wi),Ai=Si;function Di(t,e){return Ai(gi(t,e,ci),t+"")}var Oi=Di;function Pi(t){return Xn(t)&&Bt(t)}var Ti=Pi,Ni=Oi((function(t){return _n(ai(t,1,Ti,!0))})),ji=Ni,Li="[object Symbol]";function Fi(t){return"symbol"==typeof t||Xn(t)&&Mt(t)==Li}var zi=Fi,Ri=4294967295,Bi=Ri-1,Ii=Math.floor,$i=Math.min;function Vi(t,e,n,i){var r=0,s=null==t?0:t.length;if(0===s)return 0;e=n(e);var o=e!==e,a=null===e,l=zi(e),c=void 0===e;while(r<s){var h=Ii((r+s)/2),u=n(t[h]),d=void 0!==u,p=null===u,g=u===u,f=zi(u);if(o)var m=i||g;else m=c?g&&(i||d):a?g&&d&&(i||!p):l?g&&d&&!p&&(i||!f):!p&&!f&&(i?u<=e:u<e);m?r=h+1:s=h}return $i(s,Bi)}var _i=Vi,Gi=4294967295,Hi=Gi>>>1;function Ui(t,e,n){var i=0,r=null==t?i:t.length;if("number"==typeof e&&e===e&&r<=Hi){while(i<r){var s=i+r>>>1,o=t[s];null!==o&&!zi(o)&&(n?o<=e:o<e)?i=s+1:r=s}return r}return _i(t,e,ci,n)}var Wi=Ui;function qi(t,e){return Wi(t,e)}var Xi=qi;function Yi(){this.__data__=new He,this.size=0}var Ji=Yi;function Zi(t){var e=this.__data__,n=e["delete"](t);return this.size=e.size,n}var Ki=Zi;function Qi(t){return this.__data__.get(t)}var tr=Qi;function er(t){return this.__data__.has(t)}var nr=er,ir=200;function rr(t,e){var n=this.__data__;if(n instanceof He){var i=n.__data__;if(!We||i.length<ir-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new cn(i)}return n.set(t,e),this.size=n.size,this}var sr=rr;function or(t){var e=this.__data__=new He(t);this.size=e.size}or.prototype.clear=Ji,or.prototype["delete"]=Ki,or.prototype.get=tr,or.prototype.has=nr,or.prototype.set=sr;var ar=or;function lr(t,e){var n=-1,i=null==t?0:t.length;while(++n<i)if(e(t[n],n,t))return!0;return!1}var cr=lr,hr=1,ur=2;function dr(t,e,n,i,r,s){var o=n&hr,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(t),h=s.get(e);if(c&&h)return c==e&&h==t;var u=-1,d=!0,p=n&ur?new mn:void 0;s.set(t,e),s.set(e,t);while(++u<a){var g=t[u],f=e[u];if(i)var m=o?i(f,g,u,e,t,s):i(g,f,u,t,e,s);if(void 0!==m){if(m)continue;d=!1;break}if(p){if(!cr(e,(function(t,e){if(!Pn(p,e)&&(g===t||r(g,t,n,i,s)))return p.push(e)}))){d=!1;break}}else if(g!==f&&!r(g,f,n,i,s)){d=!1;break}}return s["delete"](t),s["delete"](e),d}var pr=dr,gr=lt.Uint8Array,fr=gr;function mr(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n}var yr=mr,br=1,vr=2,wr="[object Boolean]",Cr="[object Date]",xr="[object Error]",Er="[object Map]",kr="[object Number]",Mr="[object RegExp]",Sr="[object Set]",Ar="[object String]",Dr="[object Symbol]",Or="[object ArrayBuffer]",Pr="[object DataView]",Tr=ht?ht.prototype:void 0,Nr=Tr?Tr.valueOf:void 0;function jr(t,e,n,i,r,s,o){switch(n){case Pr:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Or:return!(t.byteLength!=e.byteLength||!s(new fr(t),new fr(e)));case wr:case Cr:case kr:return Pe(+t,+e);case xr:return t.name==e.name&&t.message==e.message;case Mr:case Ar:return t==e+"";case Er:var a=yr;case Sr:var l=i&br;if(a||(a=zn),t.size!=e.size&&!l)return!1;var c=o.get(t);if(c)return c==e;i|=vr,o.set(t,e);var h=pr(a(t),a(e),i,r,s,o);return o["delete"](t),h;case Dr:if(Nr)return Nr.call(t)==Nr.call(e)}return!1}var Lr=jr;function Fr(t,e,n){var i=e(t);return it(t)?i:Wn(i,n(t))}var zr=Fr;function Rr(t,e){var n=-1,i=null==t?0:t.length,r=0,s=[];while(++n<i){var o=t[n];e(o,n,t)&&(s[r++]=o)}return s}var Br=Rr;function Ir(){return[]}var $r=Ir,Vr=Object.prototype,_r=Vr.propertyIsEnumerable,Gr=Object.getOwnPropertySymbols,Hr=Gr?function(t){return null==t?[]:(t=Object(t),Br(Gr(t),(function(e){return _r.call(t,e)})))}:$r,Ur=Hr;function Wr(t,e){var n=-1,i=Array(t);while(++n<t)i[n]=e(n);return i}var qr=Wr;function Xr(){return!1}var Yr=Xr,Jr="object"==typeof exports&&exports&&!exports.nodeType&&exports,Zr=Jr&&"object"==typeof module&&module&&!module.nodeType&&module,Kr=Zr&&Zr.exports===Jr,Qr=Kr?lt.Buffer:void 0,ts=Qr?Qr.isBuffer:void 0,es=ts||Yr,ns=es,is=9007199254740991,rs=/^(?:0|[1-9]\d*)$/;function ss(t,e){var n=typeof t;return e=null==e?is:e,!!e&&("number"==n||"symbol"!=n&&rs.test(t))&&t>-1&&t%1==0&&t<e}var os=ss,as="[object Arguments]",ls="[object Array]",cs="[object Boolean]",hs="[object Date]",us="[object Error]",ds="[object Function]",ps="[object Map]",gs="[object Number]",fs="[object Object]",ms="[object RegExp]",ys="[object Set]",bs="[object String]",vs="[object WeakMap]",ws="[object ArrayBuffer]",Cs="[object DataView]",xs="[object Float32Array]",Es="[object Float64Array]",ks="[object Int8Array]",Ms="[object Int16Array]",Ss="[object Int32Array]",As="[object Uint8Array]",Ds="[object Uint8ClampedArray]",Os="[object Uint16Array]",Ps="[object Uint32Array]",Ts={};function Ns(t){return Xn(t)&&zt(t.length)&&!!Ts[Mt(t)]}Ts[xs]=Ts[Es]=Ts[ks]=Ts[Ms]=Ts[Ss]=Ts[As]=Ts[Ds]=Ts[Os]=Ts[Ps]=!0,Ts[as]=Ts[ls]=Ts[ws]=Ts[cs]=Ts[Cs]=Ts[hs]=Ts[us]=Ts[ds]=Ts[ps]=Ts[gs]=Ts[fs]=Ts[ms]=Ts[ys]=Ts[bs]=Ts[vs]=!1;var js=Ns;function Ls(t){return function(e){return t(e)}}var Fs=Ls,zs="object"==typeof exports&&exports&&!exports.nodeType&&exports,Rs=zs&&"object"==typeof module&&module&&!module.nodeType&&module,Bs=Rs&&Rs.exports===zs,Is=Bs&&st.process,$s=function(){try{var t=Rs&&Rs.require&&Rs.require("util").types;return t||Is&&Is.binding&&Is.binding("util")}catch(e){}}(),Vs=$s,_s=Vs&&Vs.isTypedArray,Gs=_s?Fs(_s):js,Hs=Gs,Us=Object.prototype,Ws=Us.hasOwnProperty;function qs(t,e){var n=it(t),i=!n&&ni(t),r=!n&&!i&&ns(t),s=!n&&!i&&!r&&Hs(t),o=n||i||r||s,a=o?qr(t.length,String):[],l=a.length;for(var c in t)!e&&!Ws.call(t,c)||o&&("length"==c||r&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||os(c,l))||a.push(c);return a}var Xs=qs,Ys=Object.prototype;function Js(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||Ys;return t===n}var Zs=Js;function Ks(t,e){return function(n){return t(e(n))}}var Qs=Ks,to=Qs(Object.keys,Object),eo=to,no=Object.prototype,io=no.hasOwnProperty;function ro(t){if(!Zs(t))return eo(t);var e=[];for(var n in Object(t))io.call(t,n)&&"constructor"!=n&&e.push(n);return e}var so=ro;function oo(t){return Bt(t)?Xs(t):so(t)}var ao=oo;function lo(t){return zr(t,ao,Ur)}var co=lo,ho=1,uo=Object.prototype,po=uo.hasOwnProperty;function go(t,e,n,i,r,s){var o=n&ho,a=co(t),l=a.length,c=co(e),h=c.length;if(l!=h&&!o)return!1;var u=l;while(u--){var d=a[u];if(!(o?d in e:po.call(e,d)))return!1}var p=s.get(t),g=s.get(e);if(p&&g)return p==e&&g==t;var f=!0;s.set(t,e),s.set(e,t);var m=o;while(++u<l){d=a[u];var y=t[d],b=e[d];if(i)var v=o?i(b,y,d,e,t,s):i(y,b,d,t,e,s);if(!(void 0===v?y===b||r(y,b,n,i,s):v)){f=!1;break}m||(m="constructor"==d)}if(f&&!m){var w=t.constructor,C=e.constructor;w==C||!("constructor"in t)||!("constructor"in e)||"function"==typeof w&&w instanceof w&&"function"==typeof C&&C instanceof C||(f=!1)}return s["delete"](t),s["delete"](e),f}var fo=go,mo=oe(lt,"DataView"),yo=mo,bo=oe(lt,"Promise"),vo=bo,wo=oe(lt,"WeakMap"),Co=wo,xo="[object Map]",Eo="[object Object]",ko="[object Promise]",Mo="[object Set]",So="[object WeakMap]",Ao="[object DataView]",Do=qt(yo),Oo=qt(We),Po=qt(vo),To=qt(Nn),No=qt(Co),jo=Mt;(yo&&jo(new yo(new ArrayBuffer(1)))!=Ao||We&&jo(new We)!=xo||vo&&jo(vo.resolve())!=ko||Nn&&jo(new Nn)!=Mo||Co&&jo(new Co)!=So)&&(jo=function(t){var e=Mt(t),n=e==Eo?t.constructor:void 0,i=n?qt(n):"";if(i)switch(i){case Do:return Ao;case Oo:return xo;case Po:return ko;case To:return Mo;case No:return So}return e});var Lo=jo,Fo=1,zo="[object Arguments]",Ro="[object Array]",Bo="[object Object]",Io=Object.prototype,$o=Io.hasOwnProperty;function Vo(t,e,n,i,r,s){var o=it(t),a=it(e),l=o?Ro:Lo(t),c=a?Ro:Lo(e);l=l==zo?Bo:l,c=c==zo?Bo:c;var h=l==Bo,u=c==Bo,d=l==c;if(d&&ns(t)){if(!ns(e))return!1;o=!0,h=!1}if(d&&!h)return s||(s=new ar),o||Hs(t)?pr(t,e,n,i,r,s):Lr(t,e,l,n,i,r,s);if(!(n&Fo)){var p=h&&$o.call(t,"__wrapped__"),g=u&&$o.call(e,"__wrapped__");if(p||g){var f=p?t.value():t,m=g?e.value():e;return s||(s=new ar),r(f,m,n,i,s)}}return!!d&&(s||(s=new ar),fo(t,e,n,i,r,s))}var _o=Vo;function Go(t,e,n,i,r){return t===e||(null==t||null==e||!Xn(t)&&!Xn(e)?t!==t&&e!==e:_o(t,e,n,i,Go,r))}var Ho=Go,Uo=1,Wo=2;function qo(t,e,n,i){var r=n.length,s=r,o=!i;if(null==t)return!s;t=Object(t);while(r--){var a=n[r];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}while(++r<s){a=n[r];var l=a[0],c=t[l],h=a[1];if(o&&a[2]){if(void 0===c&&!(l in t))return!1}else{var u=new ar;if(i)var d=i(c,h,l,t,e,u);if(!(void 0===d?Ho(h,c,Uo|Wo,i,u):d))return!1}}return!0}var Xo=qo;function Yo(t){return t===t&&!At(t)}var Jo=Yo;function Zo(t){var e=ao(t),n=e.length;while(n--){var i=e[n],r=t[i];e[n]=[i,r,Jo(r)]}return e}var Ko=Zo;function Qo(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}var ta=Qo;function ea(t){var e=Ko(t);return 1==e.length&&e[0][2]?ta(e[0][0],e[0][1]):function(n){return n===t||Xo(n,t,e)}}var na=ea,ia=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ra=/^\w*$/;function sa(t,e){if(it(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!zi(t))||(ra.test(t)||!ia.test(t)||null!=e&&t in Object(e))}var oa=sa,aa="Expected a function";function la(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(aa);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(la.Cache||cn),n}la.Cache=cn;var ca=la,ha=500;function ua(t){var e=ca(t,(function(t){return n.size===ha&&n.clear(),t})),n=e.cache;return e}var da=ua,pa=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ga=/\\(\\)?/g,fa=da((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(pa,(function(t,n,i,r){e.push(i?r.replace(ga,"$1"):n||t)})),e})),ma=fa;function ya(t,e){var n=-1,i=null==t?0:t.length,r=Array(i);while(++n<i)r[n]=e(t[n],n,t);return r}var ba=ya,va=1/0,wa=ht?ht.prototype:void 0,Ca=wa?wa.toString:void 0;function xa(t){if("string"==typeof t)return t;if(it(t))return ba(t,xa)+"";if(zi(t))return Ca?Ca.call(t):"";var e=t+"";return"0"==e&&1/t==-va?"-0":e}var Ea=xa;function ka(t){return null==t?"":Ea(t)}var Ma=ka;function Sa(t,e){return it(t)?t:oa(t,e)?[t]:ma(Ma(t))}var Aa=Sa,Da=1/0;function Oa(t){if("string"==typeof t||zi(t))return t;var e=t+"";return"0"==e&&1/t==-Da?"-0":e}var Pa=Oa;function Ta(t,e){e=Aa(e,t);var n=0,i=e.length;while(null!=t&&n<i)t=t[Pa(e[n++])];return n&&n==i?t:void 0}var Na=Ta;function ja(t,e,n){var i=null==t?void 0:Na(t,e);return void 0===i?n:i}var La=ja;function Fa(t,e){return null!=t&&e in Object(t)}var za=Fa;function Ra(t,e,n){e=Aa(e,t);var i=-1,r=e.length,s=!1;while(++i<r){var o=Pa(e[i]);if(!(s=null!=t&&n(t,o)))break;t=t[o]}return s||++i!=r?s:(r=null==t?0:t.length,!!r&&zt(r)&&os(o,r)&&(it(t)||ni(t)))}var Ba=Ra;function Ia(t,e){return null!=t&&Ba(t,e,za)}var $a=Ia,Va=1,_a=2;function Ga(t,e){return oa(t)&&Jo(e)?ta(Pa(t),e):function(n){var i=La(n,t);return void 0===i&&i===e?$a(n,t):Ho(e,i,Va|_a)}}var Ha=Ga;function Ua(t){return function(e){return null==e?void 0:e[t]}}var Wa=Ua;function qa(t){return function(e){return Na(e,t)}}var Xa=qa;function Ya(t){return oa(t)?Wa(Pa(t)):Xa(t)}var Ja=Ya;function Za(t){return"function"==typeof t?t:null==t?ci:"object"==typeof t?it(t)?Ha(t[0],t[1]):na(t):Ja(t)}var Ka=Za;function Qa(t,e,n){return _i(t,e,Ka(n,2))}var tl=Qa;function el(t){return function(e,n,i){var r=-1,s=Object(e),o=i(e),a=o.length;while(a--){var l=o[t?a:++r];if(!1===n(s[l],l,s))break}return e}}var nl=el,il=nl(),rl=il;function sl(t,e){return t&&rl(t,e,ao)}var ol=sl;function al(t,e){return function(n,i){if(null==n)return n;if(!Bt(n))return t(n,i);var r=n.length,s=e?r:-1,o=Object(n);while(e?s--:++s<r)if(!1===i(o[s],s,o))break;return n}}var ll=al,cl=ll(ol),hl=cl;function ul(t,e){var n=-1,i=Bt(t)?Array(t.length):[];return hl(t,(function(t,r,s){i[++n]=e(t,r,s)})),i}var dl=ul;function pl(t,e){var n=t.length;t.sort(e);while(n--)t[n]=t[n].value;return t}var gl=pl;function fl(t,e){if(t!==e){var n=void 0!==t,i=null===t,r=t===t,s=zi(t),o=void 0!==e,a=null===e,l=e===e,c=zi(e);if(!a&&!c&&!s&&t>e||s&&o&&l&&!a&&!c||i&&o&&l||!n&&l||!r)return 1;if(!i&&!s&&!c&&t<e||c&&n&&r&&!i&&!s||a&&n&&r||!o&&r||!l)return-1}return 0}var ml=fl;function yl(t,e,n){var i=-1,r=t.criteria,s=e.criteria,o=r.length,a=n.length;while(++i<o){var l=ml(r[i],s[i]);if(l){if(i>=a)return l;var c=n[i];return l*("desc"==c?-1:1)}}return t.index-e.index}var bl=yl;function vl(t,e,n){e=e.length?ba(e,(function(t){return it(t)?function(e){return Na(e,1===t.length?t[0]:t)}:t})):[ci];var i=-1;e=ba(e,Fs(Ka));var r=dl(t,(function(t,n,r){var s=ba(e,(function(e){return e(t)}));return{criteria:s,index:++i,value:t}}));return gl(r,(function(t,e){return bl(t,e,n)}))}var wl=vl;function Cl(t,e,n){if(!At(n))return!1;var i=typeof e;return!!("number"==i?Bt(n)&&os(e,n.length):"string"==i&&e in n)&&Pe(n[e],t)}var xl=Cl,El=Oi((function(t,e){if(null==t)return[];var n=e.length;return n>1&&xl(t,e[0],e[1])?e=[]:n>2&&xl(e[0],e[1],e[2])&&(e=[e[0]]),wl(t,ai(e,1),[])})),kl=El;function Ml(t,e,n){"__proto__"==e&&bi?bi(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var Sl=Ml;function Al(t,e,n,i){var r=-1,s=null==t?0:t.length;while(++r<s){var o=t[r];e(i,o,n(o),t)}return i}var Dl=Al;function Ol(t,e,n,i){return hl(t,(function(t,r,s){e(i,t,n(t),s)})),i}var Pl=Ol;function Tl(t,e){return function(n,i){var r=it(n)?Dl:Pl,s=e?e():{};return r(n,t,Ka(i,2),s)}}var Nl=Tl,jl=Object.prototype,Ll=jl.hasOwnProperty,Fl=Nl((function(t,e,n){Ll.call(t,n)?t[n].push(e):Sl(t,n,[e])})),zl=Fl,Rl=200;function Bl(t,e,n,i){var r=-1,s=Sn,o=!0,a=t.length,l=[],c=e.length;if(!a)return l;n&&(e=ba(e,Fs(n))),i?(s=Dn,o=!1):e.length>=Rl&&(s=Pn,o=!1,e=new mn(e));t:while(++r<a){var h=t[r],u=null==n?h:n(h);if(h=i||0!==h?h:0,o&&u===u){var d=c;while(d--)if(e[d]===u)continue t;l.push(h)}else s(e,u,i)||l.push(h)}return l}var Il=Bl,$l=Oi((function(t,e){return Ti(t)?Il(t,ai(e,1,Ti,!0)):[]})),Vl=$l;var _l=Object.prototype,Gl=_l.hasOwnProperty;function Hl(t,e){return null!=t&&Gl.call(t,e)}var Ul=Hl;function Wl(t,e){return null!=t&&Ba(t,e,Ul)}var ql=Wl,Xl=Object.prototype,Yl=Xl.hasOwnProperty;function Jl(t,e,n){var i=t[e];Yl.call(t,e)&&Pe(i,n)&&(void 0!==n||e in t)||Sl(t,e,n)}var Zl=Jl;function Kl(t,e,n,i){if(!At(t))return t;e=Aa(e,t);var r=-1,s=e.length,o=s-1,a=t;while(null!=a&&++r<s){var l=Pa(e[r]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(r!=o){var h=a[l];c=i?i(h,l,a):void 0,void 0===c&&(c=At(h)?h:os(e[r+1])?[]:{})}Zl(a,l,c),a=a[l]}return t}var Ql=Kl;function tc(t,e,n){var i=-1,r=e.length,s={};while(++i<r){var o=e[i],a=Na(t,o);n(a,o)&&Ql(s,Aa(o,t),a)}return s}var ec=tc;function nc(t,e){return ec(t,e,(function(e,n){return $a(t,n)}))}var ic=nc;function rc(t){var e=null==t?0:t.length;return e?ai(t,1):[]}var sc=rc;function oc(t){return Ai(gi(t,void 0,sc),t+"")}var ac=oc,lc=ac((function(t,e){return null==t?{}:ic(t,e)})),cc=lc;function hc(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}var uc=hc,dc=Object.prototype,pc=dc.hasOwnProperty;function gc(t){if(!At(t))return uc(t);var e=Zs(t),n=[];for(var i in t)("constructor"!=i||!e&&pc.call(t,i))&&n.push(i);return n}var fc=gc;function mc(t){return Bt(t)?Xs(t,!0):fc(t)}var yc=mc;function bc(t,e,n){(void 0!==n&&!Pe(t[e],n)||void 0===n&&!(e in t))&&Sl(t,e,n)}var vc=bc,wc="object"==typeof exports&&exports&&!exports.nodeType&&exports,Cc=wc&&"object"==typeof module&&module&&!module.nodeType&&module,xc=Cc&&Cc.exports===wc,Ec=xc?lt.Buffer:void 0,kc=Ec?Ec.allocUnsafe:void 0;function Mc(t,e){if(e)return t.slice();var n=t.length,i=kc?kc(n):new t.constructor(n);return t.copy(i),i}var Sc=Mc;function Ac(t){var e=new t.constructor(t.byteLength);return new fr(e).set(new fr(t)),e}var Dc=Ac;function Oc(t,e){var n=e?Dc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var Pc=Oc;function Tc(t,e){var n=-1,i=t.length;e||(e=Array(i));while(++n<i)e[n]=t[n];return e}var Nc=Tc,jc=Object.create,Lc=function(){function t(){}return function(e){if(!At(e))return{};if(jc)return jc(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),Fc=Lc,zc=Qs(Object.getPrototypeOf,Object),Rc=zc;function Bc(t){return"function"!=typeof t.constructor||Zs(t)?{}:Fc(Rc(t))}var Ic=Bc,$c="[object Object]",Vc=Function.prototype,_c=Object.prototype,Gc=Vc.toString,Hc=_c.hasOwnProperty,Uc=Gc.call(Object);function Wc(t){if(!Xn(t)||Mt(t)!=$c)return!1;var e=Rc(t);if(null===e)return!0;var n=Hc.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Gc.call(n)==Uc}var qc=Wc;function Xc(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}var Yc=Xc;function Jc(t,e,n,i){var r=!n;n||(n={});var s=-1,o=e.length;while(++s<o){var a=e[s],l=i?i(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),r?Sl(n,a,l):Zl(n,a,l)}return n}var Zc=Jc;function Kc(t){return Zc(t,yc(t))}var Qc=Kc;function th(t,e,n,i,r,s,o){var a=Yc(t,n),l=Yc(e,n),c=o.get(l);if(c)vc(t,n,c);else{var h=s?s(a,l,n+"",t,e,o):void 0,u=void 0===h;if(u){var d=it(l),p=!d&&ns(l),g=!d&&!p&&Hs(l);h=l,d||p||g?it(a)?h=a:Ti(a)?h=Nc(a):p?(u=!1,h=Sc(l,!0)):g?(u=!1,h=Pc(l,!0)):h=[]:qc(l)||ni(l)?(h=a,ni(a)?h=Qc(a):At(a)&&!jt(a)||(h=Ic(l))):u=!1}u&&(o.set(l,h),r(h,l,i,s,o),o["delete"](l)),vc(t,n,h)}}var eh=th;function nh(t,e,n,i,r){t!==e&&rl(e,(function(s,o){if(r||(r=new ar),At(s))eh(t,e,o,n,nh,i,r);else{var a=i?i(Yc(t,o),s,o+"",t,e,r):void 0;void 0===a&&(a=s),vc(t,o,a)}}),yc)}var ih=nh;function rh(t){return Oi((function(e,n){var i=-1,r=n.length,s=r>1?n[r-1]:void 0,o=r>2?n[2]:void 0;s=t.length>3&&"function"==typeof s?(r--,s):void 0,o&&xl(n[0],n[1],o)&&(s=r<3?void 0:s,r=1),e=Object(e);while(++i<r){var a=n[i];a&&t(e,a,i,s)}return e}))}var sh=rh,oh=sh((function(t,e,n){ih(t,e,n)})),ah=oh;sh((function(t,e){Zc(e,yc(e),t)}));function lh(t,e){return Ho(t,e)}var ch=lh,hh="[object Map]",uh="[object Set]",dh=Object.prototype,ph=dh.hasOwnProperty;function gh(t){if(null==t)return!0;if(Bt(t)&&(it(t)||"string"==typeof t||"function"==typeof t.splice||ns(t)||Hs(t)||ni(t)))return!t.length;var e=Lo(t);if(e==hh||e==uh)return!t.size;if(Zs(t))return!so(t).length;for(var n in t)if(ph.call(t,n))return!1;return!0}var fh=gh;function mh(t,e){var n=-1,i=null==t?0:t.length;while(++n<i)if(!1===e(t[n],n,t))break;return t}var yh=mh;function bh(t,e){return t&&Zc(e,ao(e),t)}var vh=bh;function wh(t,e){return t&&Zc(e,yc(e),t)}var Ch=wh;function xh(t,e){return Zc(t,Ur(t),e)}var Eh=xh,kh=Object.getOwnPropertySymbols,Mh=kh?function(t){var e=[];while(t)Wn(e,Ur(t)),t=Rc(t);return e}:$r,Sh=Mh;function Ah(t,e){return Zc(t,Sh(t),e)}var Dh=Ah;function Oh(t){return zr(t,yc,Sh)}var Ph=Oh,Th=Object.prototype,Nh=Th.hasOwnProperty;function jh(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Nh.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Lh=jh;function Fh(t,e){var n=e?Dc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var zh=Fh,Rh=/\w*$/;function Bh(t){var e=new t.constructor(t.source,Rh.exec(t));return e.lastIndex=t.lastIndex,e}var Ih=Bh,$h=ht?ht.prototype:void 0,Vh=$h?$h.valueOf:void 0;function _h(t){return Vh?Object(Vh.call(t)):{}}var Gh=_h,Hh="[object Boolean]",Uh="[object Date]",Wh="[object Map]",qh="[object Number]",Xh="[object RegExp]",Yh="[object Set]",Jh="[object String]",Zh="[object Symbol]",Kh="[object ArrayBuffer]",Qh="[object DataView]",tu="[object Float32Array]",eu="[object Float64Array]",nu="[object Int8Array]",iu="[object Int16Array]",ru="[object Int32Array]",su="[object Uint8Array]",ou="[object Uint8ClampedArray]",au="[object Uint16Array]",lu="[object Uint32Array]";function cu(t,e,n){var i=t.constructor;switch(e){case Kh:return Dc(t);case Hh:case Uh:return new i(+t);case Qh:return zh(t,n);case tu:case eu:case nu:case iu:case ru:case su:case ou:case au:case lu:return Pc(t,n);case Wh:return new i;case qh:case Jh:return new i(t);case Xh:return Ih(t);case Yh:return new i;case Zh:return Gh(t)}}var hu=cu,uu="[object Map]";function du(t){return Xn(t)&&Lo(t)==uu}var pu=du,gu=Vs&&Vs.isMap,fu=gu?Fs(gu):pu,mu=fu,yu="[object Set]";function bu(t){return Xn(t)&&Lo(t)==yu}var vu=bu,wu=Vs&&Vs.isSet,Cu=wu?Fs(wu):vu,xu=Cu,Eu=1,ku=2,Mu=4,Su="[object Arguments]",Au="[object Array]",Du="[object Boolean]",Ou="[object Date]",Pu="[object Error]",Tu="[object Function]",Nu="[object GeneratorFunction]",ju="[object Map]",Lu="[object Number]",Fu="[object Object]",zu="[object RegExp]",Ru="[object Set]",Bu="[object String]",Iu="[object Symbol]",$u="[object WeakMap]",Vu="[object ArrayBuffer]",_u="[object DataView]",Gu="[object Float32Array]",Hu="[object Float64Array]",Uu="[object Int8Array]",Wu="[object Int16Array]",qu="[object Int32Array]",Xu="[object Uint8Array]",Yu="[object Uint8ClampedArray]",Ju="[object Uint16Array]",Zu="[object Uint32Array]",Ku={};function Qu(t,e,n,i,r,s){var o,a=e&Eu,l=e&ku,c=e&Mu;if(n&&(o=r?n(t,i,r,s):n(t)),void 0!==o)return o;if(!At(t))return t;var h=it(t);if(h){if(o=Lh(t),!a)return Nc(t,o)}else{var u=Lo(t),d=u==Tu||u==Nu;if(ns(t))return Sc(t,a);if(u==Fu||u==Su||d&&!r){if(o=l||d?{}:Ic(t),!a)return l?Dh(t,Ch(o,t)):Eh(t,vh(o,t))}else{if(!Ku[u])return r?t:{};o=hu(t,u,a)}}s||(s=new ar);var p=s.get(t);if(p)return p;s.set(t,o),xu(t)?t.forEach((function(i){o.add(Qu(i,e,n,i,t,s))})):mu(t)&&t.forEach((function(i,r){o.set(r,Qu(i,e,n,r,t,s))}));var g=c?l?Ph:co:l?yc:ao,f=h?void 0:g(t);return yh(f||t,(function(i,r){f&&(r=i,i=t[r]),Zl(o,r,Qu(i,e,n,r,t,s))})),o}Ku[Su]=Ku[Au]=Ku[Vu]=Ku[_u]=Ku[Du]=Ku[Ou]=Ku[Gu]=Ku[Hu]=Ku[Uu]=Ku[Wu]=Ku[qu]=Ku[ju]=Ku[Lu]=Ku[Fu]=Ku[zu]=Ku[Ru]=Ku[Bu]=Ku[Iu]=Ku[Xu]=Ku[Yu]=Ku[Ju]=Ku[Zu]=!0,Ku[Pu]=Ku[Tu]=Ku[$u]=!1;var td=Qu,ed=4;function nd(t){return td(t,ed)}var id=nd,rd=1,sd=4;function od(t){return td(t,rd|sd)}var ad=od,ld=Object.prototype,cd=ld.hasOwnProperty,hd=Oi((function(t,e){t=Object(t);var n=-1,i=e.length,r=i>2?e[2]:void 0;r&&xl(e[0],e[1],r)&&(i=1);while(++n<i){var s=e[n],o=yc(s),a=-1,l=o.length;while(++a<l){var c=o[a],h=t[c];(void 0===h||Pe(h,ld[c])&&!cd.call(t,c))&&(t[c]=s[c])}}return t})),ud=hd;function dd(t,e,n,i,r,s){return At(t)&&At(e)&&(s.set(e,t),ih(t,e,void 0,dd,s),s["delete"](e)),t}var pd=dd,gd=sh((function(t,e,n,i){ih(t,e,n,i)})),fd=gd,md=Oi((function(t){return t.push(void 0,pd),ui(fd,void 0,t)})),yd=md;function bd(t,...e){e.forEach((e=>{Object.getOwnPropertyNames(e.prototype).forEach((n=>{"constructor"!==n&&Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n))}))}))}const vd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])};function wd(t,e){function n(){this.constructor=t}vd(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}class Cd{}const xd=/^\s*class\s+/.test(`${Cd}`)||/^\s*class\s*\{/.test(`${class{}}`);function Ed(t,e){let n;return xd?n=new Function("base",`return class ${t} extends base { }`)(e):(n=new Function("base",`return function ${t}() { return base.apply(this, arguments) }`)(e),wd(n,e)),n}function kd(t,e,n="/"){let i;const r=Array.isArray(e)?e:e.split(n);if(r.length){i=t;while(r.length){const t=r.shift();if(Object(i)!==i||!t||!(t in i))return;i=i[t]}}return i}function Md(t,e,n,i="/"){const r=Array.isArray(e)?e:e.split(i),s=r.pop();if(s){let e=t;r.forEach((t=>{null==e[t]&&(e[t]={}),e=e[t]})),e[s]=n}return t}function Sd(t,e,n="/"){const i=Array.isArray(e)?e.slice():e.split(n),r=i.pop();if(r)if(i.length>0){const e=kd(t,i);e&&delete e[r]}else delete t[r];return t}function Ad(t){return function(e){return null==t?void 0:t[e]}}var Dd=Ad,Od={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Pd=Dd(Od),Td=Pd,Nd=/[&<>"']/g,jd=RegExp(Nd.source);function Ld(t){return t=Ma(t),t&&jd.test(t)?t.replace(Nd,Td):t}var Fd=Ld,zd={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Rd=(Dd(zd),/&(?:amp|lt|gt|quot|#39);/g);RegExp(Rd.source);function Bd(t,e,n){return t===t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}var Id=Bd,$d=/\s/;function Vd(t){var e=t.length;while(e--&&$d.test(t.charAt(e)));return e}var _d=Vd,Gd=/^\s+/;function Hd(t){return t?t.slice(0,_d(t)+1).replace(Gd,""):t}var Ud=Hd,Wd=NaN,qd=/^[-+]0x[0-9a-f]+$/i,Xd=/^0b[01]+$/i,Yd=/^0o[0-7]+$/i,Jd=parseInt;function Zd(t){if("number"==typeof t)return t;if(zi(t))return Wd;if(At(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=At(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ud(t);var n=Xd.test(t);return n||Yd.test(t)?Jd(t.slice(2),n?2:8):qd.test(t)?Wd:+t}var Kd=Zd;function Qd(t,e,n){var i=-1,r=t.length;e<0&&(e=-e>r?0:r+e),n=n>r?r:n,n<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;var s=Array(r);while(++i<r)s[i]=t[i+e];return s}var tp=Qd;function ep(t,e,n){var i=t.length;return n=void 0===n?i:n,!e&&n>=i?t:tp(t,e,n)}var np=ep,ip="\\ud800-\\udfff",rp="\\u0300-\\u036f",sp="\\ufe20-\\ufe2f",op="\\u20d0-\\u20ff",ap=rp+sp+op,lp="\\ufe0e\\ufe0f",cp="\\u200d",hp=RegExp("["+cp+ip+ap+lp+"]");function up(t){return hp.test(t)}var dp=up,pp="[object RegExp]";function gp(t){return Xn(t)&&Mt(t)==pp}var fp=gp,mp=Vs&&Vs.isRegExp;mp&&Fs(mp);function yp(t){return t.split("")}var bp=yp,vp="\\ud800-\\udfff",wp="\\u0300-\\u036f",Cp="\\ufe20-\\ufe2f",xp="\\u20d0-\\u20ff",Ep=wp+Cp+xp,kp="\\ufe0e\\ufe0f",Mp="["+vp+"]",Sp="["+Ep+"]",Ap="\\ud83c[\\udffb-\\udfff]",Dp="(?:"+Sp+"|"+Ap+")",Op="[^"+vp+"]",Pp="(?:\\ud83c[\\udde6-\\uddff]){2}",Tp="[\\ud800-\\udbff][\\udc00-\\udfff]",Np="\\u200d",jp=Dp+"?",Lp="["+kp+"]?",Fp="(?:"+Np+"(?:"+[Op,Pp,Tp].join("|")+")"+Lp+jp+")*",zp=Lp+jp+Fp,Rp="(?:"+[Op+Sp+"?",Sp,Pp,Tp,Mp].join("|")+")",Bp=RegExp(Ap+"(?="+Ap+")|"+Rp+zp,"g");function Ip(t){return t.match(Bp)||[]}var $p=Ip;function Vp(t){return dp(t)?$p(t):bp(t)}var _p=Vp;Math.floor;Wa("length");var Gp="\\ud800-\\udfff",Hp="\\u0300-\\u036f",Up="\\ufe20-\\ufe2f",Wp="\\u20d0-\\u20ff",qp=Hp+Up+Wp,Xp="\\ufe0e\\ufe0f",Yp="["+Gp+"]",Jp="["+qp+"]",Zp="\\ud83c[\\udffb-\\udfff]",Kp="(?:"+Jp+"|"+Zp+")",Qp="[^"+Gp+"]",tg="(?:\\ud83c[\\udde6-\\uddff]){2}",eg="[\\ud800-\\udbff][\\udc00-\\udfff]",ng="\\u200d",ig=Kp+"?",rg="["+Xp+"]?",sg="(?:"+ng+"(?:"+[Qp,tg,eg].join("|")+")"+rg+ig+")*",og=rg+ig+sg,ag="(?:"+[Qp+Jp+"?",Jp,tg,eg,Yp].join("|")+")";RegExp(Zp+"(?="+Zp+")|"+ag+og,"g");Math.ceil;Math.ceil,Math.floor;var lg=sh((function(t,e,n,i){Zc(e,yc(e),t,i)})),cg=lg,hg="[object DOMException]",ug="[object Error]";function dg(t){if(!Xn(t))return!1;var e=Mt(t);return e==ug||e==hg||"string"==typeof t.message&&"string"==typeof t.name&&!qc(t)}var pg=dg,gg=Oi((function(t,e){try{return ui(t,void 0,e)}catch(n){return pg(n)?n:new Error(n)}})),fg=gg;function mg(t,e){return ba(e,(function(e){return t[e]}))}var yg=mg,bg=Object.prototype,vg=bg.hasOwnProperty;function wg(t,e,n,i){return void 0===t||Pe(t,bg[n])&&!vg.call(i,n)?e:t}var Cg=wg,xg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Eg(t){return"\\"+xg[t]}var kg=Eg,Mg=/<%=([\s\S]+?)%>/g,Sg=Mg,Ag=/<%-([\s\S]+?)%>/g,Dg=Ag,Og=/<%([\s\S]+?)%>/g,Pg=Og,Tg={escape:Dg,evaluate:Pg,interpolate:Sg,variable:"",imports:{_:{escape:Fd}}},Ng=Tg,jg="Invalid `variable` option passed into `_.template`",Lg=/\b__p \+= '';/g,Fg=/\b(__p \+=) '' \+/g,zg=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Rg=/[()=,{}\[\]\/\s]/,Bg=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ig=/($^)/,$g=/['\n\r\u2028\u2029\\]/g,Vg=Object.prototype,_g=Vg.hasOwnProperty;function Gg(t,e,n){var i=Ng.imports._.templateSettings||Ng;n&&xl(t,e,n)&&(e=void 0),t=Ma(t),e=cg({},e,i,Cg);var r,s,o=cg({},e.imports,i.imports,Cg),a=ao(o),l=yg(o,a),c=0,h=e.interpolate||Ig,u="__p += '",d=RegExp((e.escape||Ig).source+"|"+h.source+"|"+(h===Sg?Bg:Ig).source+"|"+(e.evaluate||Ig).source+"|$","g"),p=_g.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(d,(function(e,n,i,o,a,l){return i||(i=o),u+=t.slice(c,l).replace($g,kg),n&&(r=!0,u+="' +\n__e("+n+") +\n'"),a&&(s=!0,u+="';\n"+a+";\n__p += '"),i&&(u+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),c=l+e.length,e})),u+="';\n";var g=_g.call(e,"variable")&&e.variable;if(g){if(Rg.test(g))throw new Error(jg)}else u="with (obj) {\n"+u+"\n}\n";u=(s?u.replace(Lg,""):u).replace(Fg,"$1").replace(zg,"$1;"),u="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+u+"return __p\n}";var f=fg((function(){return Function(a,p+"return "+u).apply(void 0,l)}));if(f.source=u,pg(f))throw f;return f}var Hg=Gg,Ug=0;function Wg(t){var e=++Ug;return Ma(t)+e}var qg=Wg;function Xg(t,e,n,i){var r=-1,s=null==t?0:t.length;i&&s&&(n=t[++r]);while(++r<s)n=e(n,t[r],r,t);return n}var Yg=Xg,Jg={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},Zg=Dd(Jg),Kg=Zg,Qg=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,tf="\\u0300-\\u036f",ef="\\ufe20-\\ufe2f",nf="\\u20d0-\\u20ff",rf=tf+ef+nf,sf="["+rf+"]",of=RegExp(sf,"g");function af(t){return t=Ma(t),t&&t.replace(Qg,Kg).replace(of,"")}var lf=af,cf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function hf(t){return t.match(cf)||[]}var uf=hf,df=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function pf(t){return df.test(t)}var gf=pf,ff="\\ud800-\\udfff",mf="\\u0300-\\u036f",yf="\\ufe20-\\ufe2f",bf="\\u20d0-\\u20ff",vf=mf+yf+bf,wf="\\u2700-\\u27bf",Cf="a-z\\xdf-\\xf6\\xf8-\\xff",xf="\\xac\\xb1\\xd7\\xf7",Ef="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",kf="\\u2000-\\u206f",Mf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Sf="A-Z\\xc0-\\xd6\\xd8-\\xde",Af="\\ufe0e\\ufe0f",Df=xf+Ef+kf+Mf,Of="[']",Pf="["+Df+"]",Tf="["+vf+"]",Nf="\\d+",jf="["+wf+"]",Lf="["+Cf+"]",Ff="[^"+ff+Df+Nf+wf+Cf+Sf+"]",zf="\\ud83c[\\udffb-\\udfff]",Rf="(?:"+Tf+"|"+zf+")",Bf="[^"+ff+"]",If="(?:\\ud83c[\\udde6-\\uddff]){2}",$f="[\\ud800-\\udbff][\\udc00-\\udfff]",Vf="["+Sf+"]",_f="\\u200d",Gf="(?:"+Lf+"|"+Ff+")",Hf="(?:"+Vf+"|"+Ff+")",Uf="(?:"+Of+"(?:d|ll|m|re|s|t|ve))?",Wf="(?:"+Of+"(?:D|LL|M|RE|S|T|VE))?",qf=Rf+"?",Xf="["+Af+"]?",Yf="(?:"+_f+"(?:"+[Bf,If,$f].join("|")+")"+Xf+qf+")*",Jf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Kf=Xf+qf+Yf,Qf="(?:"+[jf,If,$f].join("|")+")"+Kf,tm=RegExp([Vf+"?"+Lf+"+"+Uf+"(?="+[Pf,Vf,"$"].join("|")+")",Hf+"+"+Wf+"(?="+[Pf,Vf+Gf,"$"].join("|")+")",Vf+"?"+Gf+"+"+Uf,Vf+"+"+Wf,Zf,Jf,Nf,Qf].join("|"),"g");function em(t){return t.match(tm)||[]}var nm=em;function im(t,e,n){return t=Ma(t),e=n?void 0:e,void 0===e?gf(t)?nm(t):uf(t):t.match(e)||[]}var rm=im,sm="[']",om=RegExp(sm,"g");function am(t){return function(e){return Yg(rm(lf(e).replace(om,"")),t,"")}}var lm=am;function cm(t){return function(e){e=Ma(e);var n=dp(e)?_p(e):void 0,i=n?n[0]:e.charAt(0),r=n?np(n,1).join(""):e.slice(1);return i[t]()+r}}var hm=cm,um=hm("toUpperCase"),dm=um,pm=lm((function(t,e,n){return t+(n?" ":"")+dm(e)})),gm=pm;function fm(t){return dm(Ma(t).toLowerCase())}var mm=fm,ym=lm((function(t,e,n){return e=e.toLowerCase(),t+(n?mm(e):e)})),bm=ym,vm=lm((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),wm=vm,Cm=lm((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),xm=Cm,Em=hm("toLowerCase"),km=Em;const Mm=t=>{const e=Object.create(null);return n=>{const i=e[n];return i||(e[n]=t(n))}},Sm=Mm((t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase())),Am=Mm((t=>gm(bm(t)).replace(/ /g,"")));Mm((t=>wm(t).replace(/ /g,"_"))),Mm((t=>xm(t).replace(/ /g,"."))),Mm((t=>xm(t).replace(/ /g,"/"))),Mm((t=>dm(xm(t)))),Mm((t=>gm(bm(t))));function Dm(t){let e=2166136261,n=!1,i=t;for(let r=0,s=i.length;r<s;r+=1){let t=i.charCodeAt(r);t>127&&!n&&(i=unescape(encodeURIComponent(i)),t=i.charCodeAt(r),n=!0),e^=t,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function Om(){let t="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let n=0,i=e.length;n<i;n+=1){const i=e[n],r=16*Math.random()|0,s="x"===i?r:"y"===i?3&r|8:i;t+=s.toString(16)}return t}function Pm(t,e={}){const n=Q().parseHTML(t,null,!1);return n.forEach((t=>{const e=t;if(e){const t=e.attributes;if(t)for(let n=0,i=t.length;n<i;n+=1){const i=t.item(n);if(i){const t=i.value.toLowerCase(),n=i.name.toLowerCase();(n.startsWith("on")||t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:"))&&e.removeAttribute(n)}}}})),e.raw?n:Q()("<div/>").append(n).html()}function Tm(t,e,n){const i=Math.min(2,Math.floor(.34*t.length));let r,s=Math.floor(.4*t.length)+1,o=!1;const a=t.toLowerCase();for(const l of e){const e=n(l);if(void 0!==e&&Math.abs(e.length-a.length)<=i){const n=e.toLowerCase();if(n===a){if(e===t)continue;return l}if(o)continue;if(e.length<3)continue;const i=Nm(a,n,s-1);if(void 0===i)continue;i<3?(o=!0,r=l):(s=i,r=l)}}return r}function Nm(t,e,n){let i=new Array(e.length+1),r=new Array(e.length+1);const s=n+1;for(let a=0;a<=e.length;a+=1)i[a]=a;for(let a=1;a<=t.length;a+=1){const o=t.charCodeAt(a-1),l=a>n?a-n:1,c=e.length>n+a?n+a:e.length;r[0]=a;let h=a;for(let t=1;t<l;t+=1)r[t]=s;for(let t=l;t<=c;t+=1){const n=o===e.charCodeAt(t-1)?i[t-1]:Math.min(i[t]+1,r[t-1]+1,i[t-1]+2);r[t]=n,h=Math.min(h,n)}for(let t=c+1;t<=e.length;t+=1)r[t]=s;if(h>n)return;const u=i;i=r,r=u}const o=i[e.length];return o>n?void 0:o}var jm="[object Number]";function Lm(t){return"number"==typeof t||Xn(t)&&Mt(t)==jm}var Fm=Lm;lt.isFinite;function zm(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=Kd(n),n=n===n?n:0),void 0!==e&&(e=Kd(e),e=e===e?e:0),Id(Kd(t),e,n)}var Rm=zm;Math.max,Math.min;lt.parseInt;function Bm(t){return"string"===typeof t&&"%"===t.slice(-1)}function Im(t,e){if(null==t)return 0;let n;if("string"===typeof t){if(n=parseFloat(t),Bm(t)&&(n/=100,Number.isFinite(n)))return n*e}else n=t;return Number.isFinite(n)?n>0&&n<1?n*e:n:0}function $m(t,e){function n(e){const n=new RegExp(`(?:\\d+(?:\\.\\d+)*)(${e})$`).exec(t);return n?n[1]:null}const i=parseFloat(t);if(Number.isNaN(i))return null;let r;if(null==e)r="[A-Za-z]*";else if(Array.isArray(e)){if(0===e.length)return null;r=e.join("|")}else"string"===typeof e&&(r=e);const s=n(r);return null===s?null:{unit:s,value:i}}function Vm(t){if("object"===typeof t){let e=0,n=0,i=0,r=0;return null!=t.vertical&&Number.isFinite(t.vertical)&&(n=r=t.vertical),null!=t.horizontal&&Number.isFinite(t.horizontal)&&(i=e=t.horizontal),null!=t.left&&Number.isFinite(t.left)&&(e=t.left),null!=t.top&&Number.isFinite(t.top)&&(n=t.top),null!=t.right&&Number.isFinite(t.right)&&(i=t.right),null!=t.bottom&&Number.isFinite(t.bottom)&&(r=t.bottom),{top:n,right:i,bottom:r,left:e}}let e=0;return null!=t&&Number.isFinite(t)&&(e=t),{top:e,right:e,bottom:e,left:e}}var _m=function(){return lt.Date.now()},Gm=_m,Hm="Expected a function",Um=Math.max,Wm=Math.min;function qm(t,e,n){var i,r,s,o,a,l,c=0,h=!1,u=!1,d=!0;if("function"!=typeof t)throw new TypeError(Hm);function p(e){var n=i,s=r;return i=r=void 0,c=e,o=t.apply(s,n),o}function g(t){return c=t,a=setTimeout(y,e),h?p(t):o}function f(t){var n=t-l,i=t-c,r=e-n;return u?Wm(r,s-i):r}function m(t){var n=t-l,i=t-c;return void 0===l||n>=e||n<0||u&&i>=s}function y(){var t=Gm();if(m(t))return b(t);a=setTimeout(y,f(t))}function b(t){return a=void 0,d&&i?p(t):(i=r=void 0,o)}function v(){void 0!==a&&clearTimeout(a),c=0,i=l=r=a=void 0}function w(){return void 0===a?o:b(Gm())}function C(){var t=Gm(),n=m(t);if(i=arguments,r=this,l=t,n){if(void 0===a)return g(l);if(u)return clearTimeout(a),a=setTimeout(y,e),p(l)}return void 0===a&&(a=setTimeout(y,e)),o}return e=Kd(e)||0,At(n)&&(h=!!n.leading,u="maxWait"in n,s=u?Um(Kd(n.maxWait)||0,e):s,d="trailing"in n?!!n.trailing:d),C.cancel=v,C.flush=w,C}var Xm=qm,Ym="Expected a function";function Jm(t,e,n){if("function"!=typeof t)throw new TypeError(Ym);return setTimeout((function(){t.apply(void 0,n)}),e)}var Zm=Jm,Km=Oi((function(t,e){return Zm(t,1,e)})),Qm=Km;function ty(t,e,n){if(n)switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2]);case 4:return t.call(e,n[0],n[1],n[2],n[3]);case 5:return t.call(e,n[0],n[1],n[2],n[3],n[4]);case 6:return t.call(e,n[0],n[1],n[2],n[3],n[4],n[5]);default:return t.apply(e,n)}return t.call(e)}function ey(t,e,...n){return ty(t,e,n)}function ny(t){return"object"===typeof t&&t.then&&"function"===typeof t.then}function iy(t){return null!=t&&(t instanceof Promise||ny(t))}function ry(...t){const e=[];t.forEach((t=>{Array.isArray(t)?e.push(...t):e.push(t)}));const n=e.some((t=>iy(t)));if(n){const t=e.map((t=>iy(t)?t:Promise.resolve(!1!==t)));return Promise.all(t).then((t=>t.reduce(((t,e)=>!1!==e&&t),!0)))}return e.every((t=>!1!==t))}function sy(...t){const e=ry(t);return"boolean"===typeof e?Promise.resolve(e):e}const oy=/[\t\r\n\f]/g,ay=/\S+/g,ly=t=>` ${t} `;function cy(t){return t&&t.getAttribute&&t.getAttribute("class")||""}function hy(t,e){if(null==t||null==e)return!1;const n=ly(cy(t)),i=ly(e);return 1===t.nodeType&&n.replace(oy," ").includes(i)}function uy(t,e){if(null!=t&&null!=e){if("function"===typeof e)return uy(t,e(cy(t)));if("string"===typeof e&&1===t.nodeType){const n=e.match(ay)||[],i=ly(cy(t)).replace(oy," ");let r=n.reduce(((t,e)=>t.indexOf(ly(e))<0?`${t}${e} `:t),i);r=r.trim(),i!==r&&t.setAttribute("class",r)}}}function dy(t,e){if(null!=t){if("function"===typeof e)return dy(t,e(cy(t)));if((!e||"string"===typeof e)&&1===t.nodeType){const n=(e||"").match(ay)||[],i=ly(cy(t)).replace(oy," ");let r=n.reduce(((t,e)=>{const n=ly(e);return t.indexOf(n)>-1?t.replace(n," "):t}),i);r=e?r.trim():"",i!==r&&t.setAttribute("class",r)}}}function py(t,e,n){if(null!=t&&null!=e)if(null==n||"string"!==typeof e){if("function"===typeof e)return py(t,e(cy(t),n),n);if("string"===typeof e){const n=e.match(ay)||[];n.forEach((e=>{hy(t,e)?dy(t,e):uy(t,e)}))}}else n?uy(t,e):dy(t,e)}let gy=0;function fy(){return gy+=1,`v${gy}`}function my(t){return null!=t.id&&""!==t.id||(t.id=fy()),t.id}function yy(t){return null!=t&&("function"===typeof t.getScreenCTM&&t instanceof SVGElement)}const by={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},vy="1.1";function wy(t,e=document){return e.createElement(t)}function Cy(t,e=by.xhtml,n=document){return n.createElementNS(e,t)}function xy(t,e=document){return Cy(t,by.svg,e)}function Ey(t){if(t){const e=`<svg xmlns="${by.svg}" xmlns:xlink="${by.xlink}" version="${vy}">${t}</svg>`,{documentElement:n}=ky(e,{async:!1});return n}const e=document.createElementNS(by.svg,"svg");return e.setAttributeNS(by.xmlns,"xmlns:xlink",by.xlink),e.setAttribute("version",vy),e}function ky(t,e={}){let n;try{const i=new DOMParser;if(null!=e.async){const t=i;t.async=e.async}n=i.parseFromString(t,e.mimeType||"text/xml")}catch(i){n=void 0}if(!n||n.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${t}`);return n}function My(t,e=!0){const n=t.nodeName;return e?n.toLowerCase():n.toUpperCase()}function Sy(t){let e=0,n=t.previousSibling;while(n)1===n.nodeType&&(e+=1),n=n.previousSibling;return e}function Ay(t,e){return t.querySelectorAll(e)}function Dy(t,e){return t.querySelector(e)}function Oy(t,e,n){const i=t.ownerSVGElement;let r=t.parentNode;while(r&&r!==n&&r!==i){if(hy(r,e))return r;r=r.parentNode}return null}function Py(t,e){const n=e&&e.parentNode;return t===n||!!(n&&1===n.nodeType&&16&t.compareDocumentPosition(n))}function Ty(t){t.parentNode&&t.parentNode.removeChild(t)}function Ny(t){while(t.firstChild)t.removeChild(t.firstChild)}function jy(t,e){const n=Array.isArray(e)?e:[e];n.forEach((e=>{null!=e&&t.appendChild(e)}))}function Ly(t,e){const n=t.firstChild;return n?Fy(n,e):jy(t,e)}function Fy(t,e){const n=t.parentNode;if(n){const i=Array.isArray(e)?e:[e];i.forEach((e=>{null!=e&&n.insertBefore(e,t)}))}}function zy(t,e){null!=e&&e.appendChild(t)}function Ry(t){try{return t instanceof HTMLElement}catch(e){return"object"===typeof t&&1===t.nodeType&&"object"===typeof t.style&&"object"===typeof t.ownerDocument}}function By(t,e){return t.getAttribute(e)}function Iy(t,e){const n=Gy(e);n.ns?t.hasAttributeNS(n.ns,n.local)&&t.removeAttributeNS(n.ns,n.local):t.hasAttribute(e)&&t.removeAttribute(e)}function $y(t,e,n){if(null==n)return Iy(t,e);const i=Gy(e);i.ns&&"string"===typeof n?t.setAttributeNS(i.ns,e,n):"id"===e?t.id=`${n}`:t.setAttribute(e,`${n}`)}function Vy(t,e){Object.keys(e).forEach((n=>{$y(t,n,e[n])}))}function _y(t,e,n){if(null==e){const e=t.attributes,n={};for(let t=0;t<e.length;t+=1)n[e[t].name]=e[t].value;return n}if("string"===typeof e&&void 0===n)return t.getAttribute(e);"object"===typeof e?Vy(t,e):$y(t,e,n)}function Gy(t){if(-1!==t.indexOf(":")){const e=t.split(":");return{ns:by[e[0]],local:e[1]}}return{ns:null,local:t}}function Hy(t){const e={};return Object.keys(t).forEach((n=>{const i=Sm(n);e[i]=t[n]})),e}function Uy(t){const e={},n=t.split(";");return n.forEach((t=>{const n=t.trim();if(n){const t=n.split("=");t.length&&(e[t[0].trim()]=t[1]?t[1].trim():"")}})),e}function Wy(t,e){return Object.keys(e).forEach((n=>{if("class"===n)t[n]=t[n]?`${t[n]} ${e[n]}`:e[n];else if("style"===n){const i="object"===typeof t[n],r="object"===typeof e[n];let s,o;i&&r?(s=t[n],o=e[n]):i?(s=t[n],o=Uy(e[n])):r?(s=Uy(t[n]),o=e[n]):(s=Uy(t[n]),o=Uy(e[n])),t[n]=Wy(s,o)}else t[n]=e[n]})),t}function qy(t,e,n={}){const i=n.offset||0,r=[],s=[];let o,a,l=null;for(let c=0;c<t.length;c+=1){o=s[c]=t[c];for(let r=0,a=e.length;r<a;r+=1){const a=e[r],l=a.start+i,h=a.end+i;c>=l&&c<h&&("string"===typeof o?o=s[c]={t:t[c],attrs:a.attrs}:o.attrs=Wy(Wy({},o.attrs),a.attrs),n.includeAnnotationIndices&&(null==o.annotations&&(o.annotations=[]),o.annotations.push(r)))}a=s[c-1],a?At(o)&&At(a)?(l=l,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?l.t+=o.t:(r.push(l),l=o)):At(o)||At(a)?(l=l,r.push(l),l=o):l=(l||"")+o:l=o}return null!=l&&r.push(l),r}function Xy(t){return t.replace(/ /g," ")}var Yy,Jy;let Zy;(function(t){function e(t){return null===t||void 0===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t}function n(t){return Array.isArray(t)}function i(t){return!e(t)&&!n(t)}function r(t,i){if(t===i)return!0;if(e(t)||e(i))return!1;const r=n(t),s=n(i);return r===s&&(r&&s?o(t,i):a(t,i))}function s(t){return e(t)?t:n(t)?l(t):c(t)}function o(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n+=1)if(!r(t[n],e[n]))return!1;return!0}function a(t,e){if(t===e)return!0;for(const n in t)if(!(n in e))return!1;for(const n in e)if(!(n in t))return!1;for(const n in t)if(!r(t[n],e[n]))return!1;return!0}function l(t){const e=new Array(t.length);for(let n=0,i=t.length;n<i;n+=1)e[n]=s(t[n]);return e}function c(t){const e={};return Object.keys(t).forEach((n=>{e[n]=s(t[n])})),e}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=n,t.isObject=i,t.deepEqual=r,t.deepCopy=s})(Yy||(Yy={})),function(t){function e(t){const e="data:";return t.substr(0,e.length)===e}function n(t,n){if(!t||e(t))return void setTimeout((()=>n(null,t)));const i=()=>{n(new Error(`Failed to load image: ${t}`))},r=window.FileReader?t=>{if(200===t.status){const e=new FileReader;e.onload=t=>{const e=t.target.result;n(null,e)},e.onerror=i,e.readAsDataURL(t.response)}else i()}:e=>{const r=t=>{const e=32768,n=[];for(let i=0;i<t.length;i+=e)n.push(String.fromCharCode.apply(null,t.subarray(i,i+e)));return n.join("")};if(200===e.status){let i=t.split(".").pop()||"png";"svg"===i&&(i="svg+xml");const s=`data:image/${i};base64,`,o=new Uint8Array(e.response),a=s+btoa(r(o));n(null,a)}else i()},s=new XMLHttpRequest;s.responseType=window.FileReader?"blob":"arraybuffer",s.open("GET",t,!0),s.addEventListener("error",i),s.addEventListener("load",(()=>r(s))),s.send()}function i(t){let e=t.replace(/\s/g,"");e=decodeURIComponent(e);const n=e.indexOf(","),i=e.slice(0,n),r=i.split(":")[1].split(";")[0],s=e.slice(n+1);let o;o=i.indexOf("base64")>=0?atob(s):unescape(encodeURIComponent(s));const a=new Uint8Array(o.length);for(let l=0;l<o.length;l+=1)a[l]=o.charCodeAt(l);return new Blob([a],{type:r})}function r(t,e){const n=window.navigator.msSaveBlob;if(n)n(t,e);else{const n=window.URL.createObjectURL(t),i=document.createElement("a");i.href=n,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)}}function s(t,e){const n=i(t);r(n,e)}function o(t){const e=t.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return e&&e[2]?e[2].replace(/\s+/," ").split(" "):null}function a(t){const e=parseFloat(t);return Number.isNaN(e)?null:e}function l(t,e={}){let n=null;const i=e=>(null==n&&(n=o(t)),null!=n?a(n[e]):null),r=e=>{const n=t.match(e);return n&&n[2]?a(n[2]):null};let s=e.width;if(null==s&&(s=r(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==s&&(s=i(2)),null==s)throw new Error("Can not parse width from svg string");let l=e.height;if(null==l&&(l=r(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==l&&(l=i(3)),null==l)throw new Error("Can not parse height from svg string");const c=encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22"),h="data:image/svg+xml",u=`${h},${c}`;return u}t.isDataUrl=e,t.imageToDataUri=n,t.dataUriToBlob=i,t.downloadBlob=r,t.downloadDataUri=s,t.svgToDataUrl=l}(Jy||(Jy={}));const Ky={px(t){return t},mm(t){return Zy*t},cm(t){return Zy*t*10},in(t){return Zy*t*25.4},pt(t){return Zy*(25.4*t/72)},pc(t){return Zy*(25.4*t/6)}};var Qy;(function(t){function e(t,e,n){const i=Q()("<div/>").css({display:"inline-block",position:"absolute",left:-15e3,top:-15e3,width:t+(n||""),height:e+(n||"")}).appendTo(document.body),r={width:i.width()||0,height:i.height()||0};return i.remove(),r}function n(t,n){null==Zy&&(Zy=e("1","1","mm").width);const i=n?Ky[n]:null;return i?i(t):t}t.measure=e,t.toPx=n})(Qy||(Qy={}));const tb=function(){let t;const e=window;if(null!=e&&(t=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame,null!=t&&(t=t.bind(e))),null==t){let e=0;t=t=>{const n=(new Date).getTime(),i=Math.max(0,16-(n-e)),r=setTimeout((()=>{t(n+i)}),i);return e=n+i,r}}return t}(),eb=function(){let t;const e=window;return null!=e&&(t=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.webkitCancelRequestAnimationFrame||e.msCancelAnimationFrame||e.msCancelRequestAnimationFrame||e.oCancelAnimationFrame||e.oCancelRequestAnimationFrame||e.mozCancelAnimationFrame||e.mozCancelRequestAnimationFrame,t&&(t=t.bind(e))),null==t&&(t=clearTimeout),t}();document&&document.createElement("div").style;function nb(t,e){const n=t.ownerDocument&&t.ownerDocument.defaultView&&t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):window.getComputedStyle(t,null);return n&&e?n.getPropertyValue(e)||n[e]:n}(function(){const t=document;t.selection||window.getSelection})();var ib;function rb(t,e=0){return Number.isInteger(t)?t:+t.toFixed(e)}function sb(t,e){let n,i;if(null==e?(i=null==t?1:t,n=0):(i=e,n=null==t?0:t),i<n){const t=n;n=i,i=t}return Math.floor(Math.random()*(i-n+1)+n)}function ob(t,e,n){return Number.isNaN(t)?NaN:Number.isNaN(e)||Number.isNaN(n)?0:e<n?t<e?e:t>n?n:t:t<n?n:t>e?e:t}function ab(t,e){return e*Math.round(t/e)}function lb(t,e){return null!=e&&null!=t&&e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function cb(t,e){const n=t.x-e.x,i=t.y-e.y;return n*n+i*i}(function(t){function e(t){return 180*t/Math.PI%360}function n(t){return t%360+(t<0?360:0)}t.toDeg=e,t.toRad=function(t,e=!1){const n=e?t:t%360;return n*Math.PI/180},t.normalize=n})(ib||(ib={}));class hb{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class ub extends hb{constructor(t,e){super(),this.x=null==t?0:t,this.y=null==e?0:e}get[Symbol.toStringTag](){return ub.toStringTag}round(t=0){return this.x=rb(this.x,t),this.y=rb(this.y,t),this}add(t,e){const n=ub.create(t,e);return this.x+=n.x,this.y+=n.y,this}update(t,e){const n=ub.create(t,e);return this.x=n.x,this.y=n.y,this}translate(t,e){const n=ub.create(t,e);return this.x+=n.x,this.y+=n.y,this}rotate(t,e){const n=ub.rotate(this,t,e);return this.x=n.x,this.y=n.y,this}scale(t,e,n=new ub){const i=ub.create(n);return this.x=i.x+t*(this.x-i.x),this.y=i.y+e*(this.y-i.y),this}closest(t){if(1===t.length)return ub.create(t[0]);let e=null,n=1/0;return t.forEach((t=>{const i=this.squaredDistance(t);i<n&&(e=t,n=i)})),e?ub.create(e):null}distance(t){return Math.sqrt(this.squaredDistance(t))}squaredDistance(t){const e=ub.create(t),n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistance(t){const e=ub.create(t);return Math.abs(e.x-this.x)+Math.abs(e.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(t=new ub){const e=ub.create(t),n=-(e.y-this.y),i=e.x-this.x;let r=Math.atan2(n,i);return r<0&&(r=2*Math.PI+r),180*r/Math.PI}angleBetween(t,e){if(this.equals(t)||this.equals(e))return NaN;let n=this.theta(e)-this.theta(t);return n<0&&(n+=360),n}vectorAngle(t){const e=new ub(0,0);return e.angleBetween(this,t)}toPolar(t){return this.update(ub.toPolar(this,t)),this}changeInAngle(t,e,n=new ub){return this.clone().translate(-t,-e).theta(n)-this.theta(n)}adhereToRect(t){return lb(t,this)||(this.x=Math.min(Math.max(this.x,t.x),t.x+t.width),this.y=Math.min(Math.max(this.y,t.y),t.y+t.height)),this}bearing(t){const e=ub.create(t),n=ib.toRad(this.y),i=ib.toRad(e.y),r=this.x,s=e.x,o=ib.toRad(s-r),a=Math.sin(o)*Math.cos(i),l=Math.cos(n)*Math.sin(i)-Math.sin(n)*Math.cos(i)*Math.cos(o),c=ib.toDeg(Math.atan2(a,l)),h=["NE","E","SE","S","SW","W","NW","N"];let u=c-22.5;return u<0&&(u+=360),u=parseInt(u/45,10),h[u]}cross(t,e){if(null!=t&&null!=e){const n=ub.create(t),i=ub.create(e);return(i.x-this.x)*(n.y-this.y)-(i.y-this.y)*(n.x-this.x)}return NaN}dot(t){const e=ub.create(t);return this.x*e.x+this.y*e.y}diff(t,e){if("number"===typeof t)return new ub(this.x-t,this.y-e);const n=ub.create(t);return new ub(this.x-n.x,this.y-n.y)}lerp(t,e){const n=ub.create(t);return new ub((1-e)*this.x+e*n.x,(1-e)*this.y+e*n.y)}normalize(t=1){const e=t/this.magnitude();return this.scale(e,e)}move(t,e){const n=ub.create(t),i=ib.toRad(n.theta(this));return this.translate(Math.cos(i)*e,-Math.sin(i)*e)}reflection(t){return ub.create(t).move(this,this.distance(t))}snapToGrid(t,e){return this.x=ab(this.x,t),this.y=ab(this.y,null==e?t:e),this}equals(t){const e=ub.create(t);return null!=e&&e.x===this.x&&e.y===this.y}clone(){return ub.clone(this)}toJSON(){return ub.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"number"===typeof i.x&&"number"===typeof i.y&&"function"===typeof i.toPolar}t.toStringTag=`X6.Geometry.${t.name}`,t.isPoint=e})(ub||(ub={})),function(t){function e(t){return null!=t&&"object"===typeof t&&"number"===typeof t.x&&"number"===typeof t.y}function n(t){return null!=t&&Array.isArray(t)&&2===t.length&&"number"===typeof t[0]&&"number"===typeof t[1]}t.isPointLike=e,t.isPointData=n}(ub||(ub={})),function(t){function e(e,i){return null==e||"number"===typeof e?new t(e,i):n(e)}function n(e){return t.isPoint(e)?new t(e.x,e.y):Array.isArray(e)?new t(e[0],e[1]):new t(e.x,e.y)}function i(e){return t.isPoint(e)?{x:e.x,y:e.y}:Array.isArray(e)?{x:e[0],y:e[1]}:{x:e.x,y:e.y}}function r(e,i,r=new t){let s=Math.abs(e*Math.cos(i)),o=Math.abs(e*Math.sin(i));const a=n(r),l=ib.normalize(ib.toDeg(i));return l<90?o=-o:l<180?(s=-s,o=-o):l<270&&(s=-s),new t(a.x+s,a.y+o)}function s(e,i=new t){const r=n(e),s=n(i),o=r.x-s.x,a=r.y-s.y;return new t(Math.sqrt(o*o+a*a),ib.toRad(s.theta(r)))}function o(t,e){return t===e||null!=t&&null!=e&&(t.x===e.x&&t.y===e.y)}function a(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!==e.length)return!1;if(null!=t&&null!=e)for(let n=0,i=t.length;n<i;n+=1)if(!o(t[n],e[n]))return!1;return!0}function l(e,n,i,r){return new t(sb(e,n),sb(i,r))}function c(t,e,n){const i=ib.toRad(ib.normalize(-e)),r=Math.sin(i),s=Math.cos(i);return h(t,s,r,n)}function h(e,i,r,s=new t){const o=n(e),a=n(s),l=o.x-a.x,c=o.y-a.y,h=l*i-c*r,u=c*i+l*r;return new t(h+a.x,u+a.y)}t.create=e,t.clone=n,t.toJSON=i,t.fromPolar=r,t.toPolar=s,t.equals=o,t.equalPoints=a,t.random=l,t.rotate=c,t.rotateEx=h}(ub||(ub={}));class db extends hb{constructor(t,e,n,i){super(),this.x=null==t?0:t,this.y=null==e?0:e,this.width=null==n?0:n,this.height=null==i?0:i}get[Symbol.toStringTag](){return db.toStringTag}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new ub(this.x,this.y)}get topLeft(){return new ub(this.x,this.y)}get topCenter(){return new ub(this.x+this.width/2,this.y)}get topRight(){return new ub(this.x+this.width,this.y)}get center(){return new ub(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new ub(this.x,this.y+this.height)}get bottomCenter(){return new ub(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new ub(this.x+this.width,this.y+this.height)}get corner(){return new ub(this.x+this.width,this.y+this.height)}get rightMiddle(){return new ub(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new ub(this.x,this.y+this.height/2)}get topLine(){return new pb(this.topLeft,this.topRight)}get rightLine(){return new pb(this.topRight,this.bottomRight)}get bottomLine(){return new pb(this.bottomLeft,this.bottomRight)}get leftLine(){return new pb(this.topLeft,this.bottomLeft)}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(t){if(!t)return this.clone();const e=ib.toRad(t),n=Math.abs(Math.sin(e)),i=Math.abs(Math.cos(e)),r=this.width*i+this.height*n,s=this.width*n+this.height*i;return new db(this.x+(this.width-r)/2,this.y+(this.height-s)/2,r,s)}round(t=0){return this.x=rb(this.x,t),this.y=rb(this.y,t),this.width=rb(this.width,t),this.height=rb(this.height,t),this}add(t,e,n,i){const r=db.create(t,e,n,i),s=Math.min(this.x,r.x),o=Math.min(this.y,r.y),a=Math.max(this.x+this.width,r.x+r.width),l=Math.max(this.y+this.height,r.y+r.height);return this.x=s,this.y=o,this.width=a-s,this.height=l-o,this}update(t,e,n,i){const r=db.create(t,e,n,i);return this.x=r.x,this.y=r.y,this.width=r.width,this.height=r.height,this}inflate(t,e){const n=t,i=null!=e?e:t;return this.x-=n,this.y-=i,this.width+=2*n,this.height+=2*i,this}snapToGrid(t,e){const n=this.origin.snapToGrid(t,e),i=this.corner.snapToGrid(t,e);return this.x=n.x,this.y=n.y,this.width=i.x-n.x,this.height=i.y-n.y,this}translate(t,e){const n=ub.create(t,e);return this.x+=n.x,this.y+=n.y,this}scale(t,e,n=new ub){const i=this.origin.scale(t,e,n);return this.x=i.x,this.y=i.y,this.width*=t,this.height*=e,this}rotate(t,e=this.getCenter()){if(0!==t){const n=ib.toRad(t),i=Math.cos(n),r=Math.sin(n);let s=this.getOrigin(),o=this.getTopRight(),a=this.getBottomRight(),l=this.getBottomLeft();s=ub.rotateEx(s,i,r,e),o=ub.rotateEx(o,i,r,e),a=ub.rotateEx(a,i,r,e),l=ub.rotateEx(l,i,r,e);const c=new db(s.x,s.y,0,0);c.add(o.x,o.y,0,0),c.add(a.x,a.y,0,0),c.add(l.x,l.y,0,0),this.update(c)}return this}rotate90(){const t=(this.width-this.height)/2;this.x+=t,this.y-=t;const e=this.width;return this.width=this.height,this.height=e,this}moveAndExpand(t){const e=db.clone(t);return this.x+=e.x||0,this.y+=e.y||0,this.width+=e.width||0,this.height+=e.height||0,this}getMaxScaleToFit(t,e=this.center){const n=db.clone(t),i=e.x,r=e.y;let s=1/0,o=1/0,a=1/0,l=1/0,c=1/0,h=1/0,u=1/0,d=1/0;const p=n.topLeft;p.x<i&&(s=(this.x-i)/(p.x-i)),p.y<r&&(c=(this.y-r)/(p.y-r));const g=n.bottomRight;g.x>i&&(o=(this.x+this.width-i)/(g.x-i)),g.y>r&&(h=(this.y+this.height-r)/(g.y-r));const f=n.topRight;f.x>i&&(a=(this.x+this.width-i)/(f.x-i)),f.y<r&&(u=(this.y-r)/(f.y-r));const m=n.bottomLeft;return m.x<i&&(l=(this.x-i)/(m.x-i)),m.y>r&&(d=(this.y+this.height-r)/(m.y-r)),{sx:Math.min(s,o,a,l),sy:Math.min(c,h,u,d)}}getMaxUniformScaleToFit(t,e=this.center){const n=this.getMaxScaleToFit(t,e);return Math.min(n.sx,n.sy)}containsPoint(t,e){return lb(this,ub.create(t,e))}containsRect(t,e,n,i){const r=db.create(t,e,n,i),s=this.x,o=this.y,a=this.width,l=this.height,c=r.x,h=r.y,u=r.width,d=r.height;return 0!==a&&0!==l&&0!==u&&0!==d&&(c>=s&&h>=o&&c+u<=s+a&&h+d<=o+l)}intersectsWithLine(t){const e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],i=[];return e.forEach((e=>{const r=t.intersectsWithLine(e);null!==r&&i.indexOf(r.toString())<0&&(n.push(r),i.push(r.toString()))})),n.length>0?n:null}intersectsWithLineFromCenterToPoint(t,e){const n=ub.clone(t),i=this.center;let r=null;null!=e&&0!==e&&n.rotate(e,i);const s=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],o=new pb(i,n);for(let a=s.length-1;a>=0;a-=1){const t=s[a].intersectsWithLine(o);if(null!==t){r=t;break}}return r&&null!=e&&0!==e&&r.rotate(-e,i),r}intersectsWithRect(t,e,n,i){const r=db.create(t,e,n,i);if(!this.isIntersectWithRect(r))return null;const s=this.origin,o=this.corner,a=r.origin,l=r.corner,c=Math.max(s.x,a.x),h=Math.max(s.y,a.y);return new db(c,h,Math.min(o.x,l.x)-c,Math.min(o.y,l.y)-h)}isIntersectWithRect(t,e,n,i){const r=db.create(t,e,n,i),s=this.origin,o=this.corner,a=r.origin,l=r.corner;return!(l.x<=s.x||l.y<=s.y||a.x>=o.x||a.y>=o.y)}normalize(){let t=this.x,e=this.y,n=this.width,i=this.height;return this.width<0&&(t=this.x+this.width,n=-this.width),this.height<0&&(e=this.y+this.height,i=-this.height),this.x=t,this.y=e,this.width=n,this.height=i,this}union(t){const e=db.clone(t),n=this.origin,i=this.corner,r=e.origin,s=e.corner,o=Math.min(n.x,r.x),a=Math.min(n.y,r.y),l=Math.max(i.x,s.x),c=Math.max(i.y,s.y);return new db(o,a,l-o,c-a)}getNearestSideToPoint(t){const e=ub.clone(t),n=e.x-this.x,i=this.x+this.width-e.x,r=e.y-this.y,s=this.y+this.height-e.y;let o=n,a="left";return i<o&&(o=i,a="right"),r<o&&(o=r,a="top"),s<o&&(a="bottom"),a}getNearestPointToPoint(t){const e=ub.clone(t);if(this.containsPoint(e)){const t=this.getNearestSideToPoint(e);switch(t){case"right":return new ub(this.x+this.width,e.y);case"left":return new ub(this.x,e.y);case"bottom":return new ub(e.x,this.y+this.height);case"top":return new ub(e.x,this.y);default:break}}return e.adhereToRect(this)}equals(t){return null!=t&&t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height}clone(){return new db(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"number"===typeof i.x&&"number"===typeof i.y&&"number"===typeof i.width&&"number"===typeof i.height&&"function"===typeof i.inflate&&"function"===typeof i.moveAndExpand}t.toStringTag=`X6.Geometry.${t.name}`,t.isRectangle=e})(db||(db={})),function(t){function e(t){return null!=t&&"object"===typeof t&&"number"===typeof t.x&&"number"===typeof t.y&&"number"===typeof t.width&&"number"===typeof t.height}t.isRectangleLike=e}(db||(db={})),function(t){function e(e,i,r,s){return null==e||"number"===typeof e?new t(e,i,r,s):n(e)}function n(e){return t.isRectangle(e)?e.clone():Array.isArray(e)?new t(e[0],e[1],e[2],e[3]):new t(e.x,e.y,e.width,e.height)}function i(e){return new t(0,0,e.width,e.height)}function r(e,n){return new t(e.x,e.y,n.width,n.height)}function s(e){return new t(e.x-e.a,e.y-e.b,2*e.a,2*e.b)}t.create=e,t.clone=n,t.fromSize=i,t.fromPositionAndSize=r,t.fromEllipse=s}(db||(db={}));class pb extends hb{constructor(t,e,n,i){super(),"number"===typeof t&&"number"===typeof e?(this.start=new ub(t,e),this.end=new ub(n,i)):(this.start=ub.create(t),this.end=ub.create(e))}get[Symbol.toStringTag](){return pb.toStringTag}get center(){return new ub((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}getCenter(){return this.center}round(t=0){return this.start.round(t),this.end.round(t),this}translate(t,e){return"number"===typeof t?(this.start.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.end.translate(t)),this}rotate(t,e){return this.start.rotate(t,e),this.end.rotate(t,e),this}scale(t,e,n){return this.start.scale(t,e,n),this.end.scale(t,e,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const t=this.start.x-this.end.x,e=this.start.y-this.end.y;return t*t+e*e}setLength(t){const e=this.length();if(!e)return this;const n=t/e;return this.scale(n,n,this.start)}parallel(t){const e=this.clone();if(!e.isDifferentiable())return e;const{start:n,end:i}=e,r=n.clone().rotate(270,i),s=i.clone().rotate(90,n);return n.move(s,t),i.move(r,t),e}vector(){return new ub(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const t=new ub(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,t)}bbox(){const t=Math.min(this.start.x,this.end.x),e=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new db(t,e,n-t,i-e)}bearing(){return this.start.bearing(this.end)}closestPoint(t){return this.pointAt(this.closestPointNormalizedLength(t))}closestPointLength(t){return this.closestPointNormalizedLength(t)*this.length()}closestPointTangent(t){return this.tangentAt(this.closestPointNormalizedLength(t))}closestPointNormalizedLength(t){const e=this.vector().dot(new pb(this.start,t).vector()),n=Math.min(1,Math.max(0,e/this.squaredLength()));return Number.isNaN(n)?0:n}pointAt(t){const e=this.start,n=this.end;return t<=0?e.clone():t>=1?n.clone():e.lerp(n,t)}pointAtLength(t){const e=this.start,n=this.end;let i=!0;t<0&&(i=!1,t=-t);const r=this.length();if(t>=r)return i?n.clone():e.clone();const s=(i?t:r-t)/r;return this.pointAt(s)}divideAt(t){const e=this.pointAt(t);return[new pb(this.start,e),new pb(e,this.end)]}divideAtLength(t){const e=this.pointAtLength(t);return[new pb(this.start,e),new pb(e,this.end)]}containsPoint(t){const e=this.start,n=this.end;if(0!==e.cross(t,n))return!1;const i=this.length();return!(new pb(e,t).length()>i)&&!(new pb(t,n).length()>i)}intersect(t,e){const n=t.intersectsWithLine(this,e);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(t){const e=new ub(this.end.x-this.start.x,this.end.y-this.start.y),n=new ub(t.end.x-t.start.x,t.end.y-t.start.y),i=e.x*n.y-e.y*n.x,r=new ub(t.start.x-this.start.x,t.start.y-this.start.y),s=r.x*n.y-r.y*n.x,o=r.x*e.y-r.y*e.x;if(0===i||s*i<0||o*i<0)return null;if(i>0){if(s>i||o>i)return null}else if(s<i||o<i)return null;return new ub(this.start.x+s*e.x/i,this.start.y+s*e.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(t){const e=ub.clone(t),n=this.start,i=this.end,r=(i.x-n.x)*(e.y-n.y)-(i.y-n.y)*(e.x-n.x);return r/this.length()}pointSquaredDistance(t,e){const n=ub.create(t,e);return this.closestPoint(n).squaredDistance(n)}pointDistance(t,e){const n=ub.create(t,e);return this.closestPoint(n).distance(n)}tangentAt(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,i=this.pointAt(t),r=new pb(e,n);return r.translate(i.x-e.x,i.y-e.y),r}tangentAtLength(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,i=this.pointAtLength(t),r=new pb(e,n);return r.translate(i.x-e.x,i.y-e.y),r}relativeCcw(t,e){const n=ub.create(t,e);let i=n.x-this.start.x,r=n.y-this.start.y;const s=this.end.x-this.start.x,o=this.end.y-this.start.y;let a=i*o-r*s;return 0===a&&(a=i*s+r*o,a>0&&(i-=s,r-=o,a=i*s+r*o,a<0&&(a=0))),a<0?-1:a>0?1:0}equals(t){return null!=t&&this.start.x===t.start.x&&this.start.y===t.start.y&&this.end.x===t.end.x&&this.end.y===t.end.y}clone(){return new pb(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;try{if((null==n||n===t.toStringTag)&&ub.isPoint(i.start)&&ub.isPoint(i.end)&&"function"===typeof i.vector&&"function"===typeof i.bearing&&"function"===typeof i.parallel&&"function"===typeof i.intersect)return!0}catch(r){return!1}return!1}t.toStringTag=`X6.Geometry.${t.name}`,t.isLine=e})(pb||(pb={}));class gb extends hb{constructor(t,e,n,i){super(),this.x=null==t?0:t,this.y=null==e?0:e,this.a=null==n?0:n,this.b=null==i?0:i}get[Symbol.toStringTag](){return gb.toStringTag}get center(){return new ub(this.x,this.y)}bbox(){return db.fromEllipse(this)}getCenter(){return this.center}inflate(t,e){const n=t,i=null!=e?e:t;return this.a+=2*n,this.b+=2*i,this}normalizedDistance(t,e){const n=ub.create(t,e),i=n.x-this.x,r=n.y-this.y,s=this.a,o=this.b;return i*i/(s*s)+r*r/(o*o)}containsPoint(t,e){return this.normalizedDistance(t,e)<=1}intersectsWithLine(t){const e=[],n=this.a,i=this.b,r=t.start,s=t.end,o=t.vector(),a=r.diff(new ub(this.x,this.y)),l=new ub(o.x/(n*n),o.y/(i*i)),c=new ub(a.x/(n*n),a.y/(i*i)),h=o.dot(l),u=o.dot(c),d=a.dot(c)-1,p=u*u-h*d;if(p<0)return null;if(p>0){const t=Math.sqrt(p),n=(-u-t)/h,i=(-u+t)/h;if((n<0||n>1)&&(i<0||i>1))return null;n>=0&&n<=1&&e.push(r.lerp(s,n)),i>=0&&i<=1&&e.push(r.lerp(s,i))}else{const t=-u/h;if(!(t>=0&&t<=1))return null;e.push(r.lerp(s,t))}return e}intersectsWithLineFromCenterToPoint(t,e=0){const n=ub.clone(t);e&&n.rotate(e,this.getCenter());const i=n.x-this.x,r=n.y-this.y;let s;if(0===i)return s=this.bbox().getNearestPointToPoint(n),e?s.rotate(-e,this.getCenter()):s;const o=r/i,a=o*o,l=this.a*this.a,c=this.b*this.b;let h=Math.sqrt(1/(1/l+a/c));h=i<0?-h:h;const u=o*h;return s=new ub(this.x+h,this.y+u),e?s.rotate(-e,this.getCenter()):s}tangentTheta(t){const e=ub.clone(t),n=e.x,i=e.y,r=this.a,s=this.b,o=this.bbox().center,a=o.x,l=o.y,c=30,h=n>o.x+r/2,u=n<o.x-r/2;let d,p;return h||u?(p=n>o.x?i-c:i+c,d=r*r/(n-a)-r*r*(i-l)*(p-l)/(s*s*(n-a))+a):(d=i>o.y?n+c:n-c,p=s*s/(i-l)-s*s*(n-a)*(d-a)/(r*r*(i-l))+l),new ub(d,p).theta(e)}scale(t,e){return this.a*=t,this.b*=e,this}rotate(t,e){const n=db.fromEllipse(this);n.rotate(t,e);const i=gb.fromRect(n);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this}translate(t,e){const n=ub.create(t,e);return this.x+=n.x,this.y+=n.y,this}equals(t){return null!=t&&t.x===this.x&&t.y===this.y&&t.a===this.a&&t.b===this.b}clone(){return new gb(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"number"===typeof i.x&&"number"===typeof i.y&&"number"===typeof i.a&&"number"===typeof i.b&&"function"===typeof i.inflate&&"function"===typeof i.normalizedDistance}t.toStringTag=`X6.Geometry.${t.name}`,t.isEllipse=e})(gb||(gb={})),function(t){function e(e,i,r,s){return null==e||"number"===typeof e?new t(e,i,r,s):n(e)}function n(e){return t.isEllipse(e)?e.clone():Array.isArray(e)?new t(e[0],e[1],e[2],e[3]):new t(e.x,e.y,e.a,e.b)}function i(e){const n=e.center;return new t(n.x,n.y,e.width/2,e.height/2)}t.create=e,t.parse=n,t.fromRect=i}(gb||(gb={}));class fb extends hb{constructor(t){if(super(),null!=t){if("string"===typeof t)return fb.parse(t);this.points=t.map((t=>ub.create(t)))}else this.points=[]}get[Symbol.toStringTag](){return fb.toStringTag}get start(){return 0===this.points.length?null:this.points[0]}get end(){return 0===this.points.length?null:this.points[this.points.length-1]}scale(t,e,n=new ub){return this.points.forEach((i=>i.scale(t,e,n))),this}rotate(t,e){return this.points.forEach((n=>n.rotate(t,e))),this}translate(t,e){const n=ub.create(t,e);return this.points.forEach((t=>t.translate(n.x,n.y))),this}bbox(){if(0===this.points.length)return new db;let t=1/0,e=-1/0,n=1/0,i=-1/0;const r=this.points;for(let s=0,o=r.length;s<o;s+=1){const o=r[s],a=o.x,l=o.y;a<t&&(t=a),a>e&&(e=a),l<n&&(n=l),l>i&&(i=l)}return new db(t,n,e-t,i-n)}closestPoint(t){const e=this.closestPointLength(t);return this.pointAtLength(e)}closestPointLength(t){const e=this.points,n=e.length;if(0===n||1===n)return 0;let i=0,r=0,s=1/0;for(let o=0,a=n-1;o<a;o+=1){const n=new pb(e[o],e[o+1]),a=n.length(),l=n.closestPointNormalizedLength(t),c=n.pointAt(l),h=c.squaredDistance(t);h<s&&(s=h,r=i+l*a),i+=a}return r}closestPointNormalizedLength(t){const e=this.closestPointLength(t);if(0===e)return 0;const n=this.length();return 0===n?0:e/n}closestPointTangent(t){const e=this.closestPointLength(t);return this.tangentAtLength(e)}containsPoint(t){if(0===this.points.length)return!1;const e=ub.clone(t),n=e.x,i=e.y,r=this.points,s=r.length;let o=s-1,a=0;for(let l=0;l<s;l+=1){const s=r[o],c=r[l];if(e.equals(s))return!0;const h=new pb(s,c);if(h.containsPoint(t))return!0;if(i<=s.y&&i>c.y||i>s.y&&i<=c.y){const e=s.x-n>c.x-n?s.x-n:c.x-n;if(e>=0){const r=new ub(n+e,i),s=new pb(t,r);h.intersectsWithLine(s)&&(a+=1)}}o=l}return a%2===1}intersectsWithLine(t){const e=[];for(let n=0,i=this.points.length-1;n<i;n+=1){const i=this.points[n],r=this.points[n+1],s=t.intersectsWithLine(new pb(i,r));s&&e.push(s)}return e.length>0?e:null}isDifferentiable(){for(let t=0,e=this.points.length-1;t<e;t+=1){const e=this.points[t],n=this.points[t+1],i=new pb(e,n);if(i.isDifferentiable())return!0}return!1}length(){let t=0;for(let e=0,n=this.points.length-1;e<n;e+=1){const n=this.points[e],i=this.points[e+1];t+=n.distance(i)}return t}pointAt(t){const e=this.points,n=e.length;if(0===n)return null;if(1===n)return e[0].clone();if(t<=0)return e[0].clone();if(t>=1)return e[n-1].clone();const i=this.length(),r=i*t;return this.pointAtLength(r)}pointAtLength(t){const e=this.points,n=e.length;if(0===n)return null;if(1===n)return e[0].clone();let i=!0;t<0&&(i=!1,t=-t);let r=0;for(let o=0,a=n-1;o<a;o+=1){const n=i?o:a-1-o,s=e[n],l=e[n+1],c=new pb(s,l),h=s.distance(l);if(t<=r+h)return c.pointAtLength((i?1:-1)*(t-r));r+=h}const s=i?e[n-1]:e[0];return s.clone()}tangentAt(t){const e=this.points,n=e.length;if(0===n||1===n)return null;t<0&&(t=0),t>1&&(t=1);const i=this.length(),r=i*t;return this.tangentAtLength(r)}tangentAtLength(t){const e=this.points,n=e.length;if(0===n||1===n)return null;let i,r=!0;t<0&&(r=!1,t=-t);let s=0;for(let o=0,a=n-1;o<a;o+=1){const n=r?o:a-1-o,l=e[n],c=e[n+1],h=new pb(l,c),u=l.distance(c);if(h.isDifferentiable()){if(t<=s+u)return h.tangentAtLength((r?1:-1)*(t-s));i=h}s+=u}if(i){const t=r?1:0;return i.tangentAt(t)}return null}simplify(t={}){const e=this.points;if(e.length<3)return this;const n=t.threshold||0;let i=0;while(e[i+2]){const t=i,r=i+1,s=i+2,o=e[t],a=e[r],l=e[s],c=new pb(o,l),h=c.closestPoint(a),u=h.distance(a);u<=n?e.splice(r,1):i+=1}return this}toHull(){const t=this.points,e=t.length;if(0===e)return new fb;let n=t[0];for(let u=1;u<e;u+=1)(t[u].y<n.y||t[u].y===n.y&&t[u].x>n.x)&&(n=t[u]);const i=[];for(let u=0;u<e;u+=1){let e=n.theta(t[u]);0===e&&(e=360),i.push([t[u],u,e])}if(i.sort(((t,e)=>{let n=t[2]-e[2];return 0===n&&(n=e[1]-t[1]),n})),i.length>2){const t=i[i.length-1];i.unshift(t)}const r={},s=[],o=t=>`${t[0].toString()}@${t[1]}`;while(0!==i.length){const t=i.pop(),e=t[0];if(r[o(t)])continue;let n=!1;while(!n)if(s.length<2)s.push(t),n=!0;else{const a=s.pop(),l=a[0],c=s.pop(),h=c[0],u=h.cross(l,e);if(u<0)s.push(c),s.push(a),s.push(t),n=!0;else if(0===u){const t=1e-10,n=l.angleBetween(h,e);Math.abs(n-180)<t||l.equals(e)||h.equals(l)?(r[o(a)]=l,s.push(c)):Math.abs((n+1)%360-1)<t&&(s.push(c),i.push(a))}else r[o(a)]=l,s.push(c)}}let a;s.length>2&&s.pop();let l=-1;for(let u=0,d=s.length;u<d;u+=1){const t=s[u][1];(void 0===a||t<a)&&(a=t,l=u)}let c=[];if(l>0){const t=s.slice(l),e=s.slice(0,l);c=t.concat(e)}else c=s;const h=[];for(let u=0,d=c.length;u<d;u+=1)h.push(c[u][0]);return new fb(h)}equals(t){return null!=t&&(t.points.length===this.points.length&&t.points.every(((t,e)=>t.equals(this.points[e]))))}clone(){return new fb(this.points.map((t=>t.clone())))}toJSON(){return this.points.map((t=>t.toJSON()))}serialize(){return this.points.map((t=>`${t.x}, ${t.y}`)).join(" ")}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.toHull&&"function"===typeof i.simplify}t.toStringTag=`X6.Geometry.${t.name}`,t.isPolyline=e})(fb||(fb={})),function(t){function e(e){const n=e.trim();if(""===n)return new t;const i=[],r=n.split(/\s*,\s*|\s+/);for(let t=0,s=r.length;t<s;t+=2)i.push({x:+r[t],y:+r[t+1]});return new t(i)}t.parse=e}(fb||(fb={}));class mb extends hb{constructor(t,e,n,i){super(),this.PRECISION=3,this.start=ub.create(t),this.controlPoint1=ub.create(e),this.controlPoint2=ub.create(n),this.end=ub.create(i)}get[Symbol.toStringTag](){return mb.toStringTag}bbox(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end,r=t.x,s=t.y,o=e.x,a=e.y,l=n.x,c=n.y,h=i.x,u=i.y,d=[],p=[],g=[[],[]];let f,m,y,b,v,w,C,x,E,k,M;for(let N=0;N<2;N+=1)if(0===N?(m=6*r-12*o+6*l,f=-3*r+9*o-9*l+3*h,y=3*o-3*r):(m=6*s-12*a+6*c,f=-3*s+9*a-9*c+3*u,y=3*a-3*s),Math.abs(f)<1e-12){if(Math.abs(m)<1e-12)continue;b=-y/m,b>0&&b<1&&p.push(b)}else C=m*m-4*y*f,x=Math.sqrt(C),C<0||(v=(-m+x)/(2*f),v>0&&v<1&&p.push(v),w=(-m-x)/(2*f),w>0&&w<1&&p.push(w));let S=p.length;const A=S;while(S)S-=1,b=p[S],M=1-b,E=M*M*M*r+3*M*M*b*o+3*M*b*b*l+b*b*b*h,g[0][S]=E,k=M*M*M*s+3*M*M*b*a+3*M*b*b*c+b*b*b*u,g[1][S]=k,d[S]={X:E,Y:k};p[A]=0,p[A+1]=1,d[A]={X:r,Y:s},d[A+1]={X:h,Y:u},g[0][A]=r,g[1][A]=s,g[0][A+1]=h,g[1][A+1]=u,p.length=A+2,g[0].length=A+2,g[1].length=A+2,d.length=A+2;const D=Math.min.apply(null,g[0]),O=Math.min.apply(null,g[1]),P=Math.max.apply(null,g[0]),T=Math.max.apply(null,g[1]);return new db(D,O,P-D,T-O)}closestPoint(t,e={}){return this.pointAtT(this.closestPointT(t,e))}closestPointLength(t,e={}){const n=this.getOptions(e);return this.lengthAtT(this.closestPointT(t,n),n)}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),i=this.closestPointLength(t,n);if(!i)return 0;const r=this.length(n);return 0===r?0:i/r}closestPointT(t,e={}){const n=this.getPrecision(e),i=this.getDivisions(e),r=Math.pow(10,-n);let s=null,o=0,a=0,l=0,c=0,h=0,u=null;const d=i.length;let p=d>0?1/d:0;i.forEach(((e,n)=>{const i=e.start.distance(t),r=e.end.distance(t),d=i+r;(null==u||d<u)&&(s=e,o=n*p,a=(n+1)*p,l=i,c=r,u=d,h=e.endpointDistance())}));while(1){const e=l?Math.abs(l-c)/l:0,n=null!=c?Math.abs(l-c)/c:0,i=e<r||n<r,u=!l||l<h*r,d=!c||c<h*r,g=u||d;if(i||g)return l<=c?o:a;const f=s.divide(.5);p/=2;const m=f[0].start.distance(t),y=f[0].end.distance(t),b=m+y,v=f[1].start.distance(t),w=f[1].end.distance(t),C=v+w;b<=C?(s=f[0],a-=p,l=m,c=y):(s=f[1],o+=p,l=v,c=w)}}closestPointTangent(t,e={}){return this.tangentAtT(this.closestPointT(t,e))}containsPoint(t,e={}){const n=this.toPolyline(e);return n.containsPoint(t)}divideAt(t,e={}){if(t<=0)return this.divideAtT(0);if(t>=1)return this.divideAtT(1);const n=this.tAt(t,e);return this.divideAtT(n)}divideAtLength(t,e={}){const n=this.tAtLength(t,e);return this.divideAtT(n)}divide(t){return this.divideAtT(t)}divideAtT(t){const e=this.start,n=this.controlPoint1,i=this.controlPoint2,r=this.end;if(t<=0)return[new mb(e,e,e,e),new mb(e,n,i,r)];if(t>=1)return[new mb(e,n,i,r),new mb(r,r,r,r)];const s=this.getSkeletonPoints(t),o=s.startControlPoint1,a=s.startControlPoint2,l=s.divider,c=s.dividerControlPoint1,h=s.dividerControlPoint2;return[new mb(e,o,a,l),new mb(l,c,h,r)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(t){const e=this.start,n=this.controlPoint1,i=this.controlPoint2,r=this.end;if(t<=0)return{startControlPoint1:e.clone(),startControlPoint2:e.clone(),divider:e.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:i.clone()};if(t>=1)return{startControlPoint1:n.clone(),startControlPoint2:i.clone(),divider:r.clone(),dividerControlPoint1:r.clone(),dividerControlPoint2:r.clone()};const s=new pb(e,n).pointAt(t),o=new pb(n,i).pointAt(t),a=new pb(i,r).pointAt(t),l=new pb(s,o).pointAt(t),c=new pb(o,a).pointAt(t),h=new pb(l,c).pointAt(t);return{startControlPoint1:s,startControlPoint2:l,divider:h,dividerControlPoint1:c,dividerControlPoint2:a}}getSubdivisions(t={}){const e=this.getPrecision(t);let n=[new mb(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===e)return n;let i=this.endpointDistance();const r=Math.pow(10,-e);let s=0;while(1){s+=1;const t=[];n.forEach((e=>{const n=e.divide(.5);t.push(n[0],n[1])}));const e=t.reduce(((t,e)=>t+e.endpointDistance()),0),o=0!==e?(e-i)/e:0;if(s>1&&o<r)return t;n=t,i=e}}length(t={}){const e=this.getDivisions(t);return e.reduce(((t,e)=>t+e.endpointDistance()),0)}lengthAtT(t,e={}){if(t<=0)return 0;const n=void 0===e.precision?this.PRECISION:e.precision,i=this.divide(t)[0];return i.length({precision:n})}pointAt(t,e={}){if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.tAt(t,e);return this.pointAtT(n)}pointAtLength(t,e={}){const n=this.tAtLength(t,e);return this.pointAtT(n)}pointAtT(t){return t<=0?this.start.clone():t>=1?this.end.clone():this.getSkeletonPoints(t).divider}isDifferentiable(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(i))}tangentAt(t,e={}){if(!this.isDifferentiable())return null;t<0?t=0:t>1&&(t=1);const n=this.tAt(t,e);return this.tangentAtT(n)}tangentAtLength(t,e={}){if(!this.isDifferentiable())return null;const n=this.tAtLength(t,e);return this.tangentAtT(n)}tangentAtT(t){if(!this.isDifferentiable())return null;t<0&&(t=0),t>1&&(t=1);const e=this.getSkeletonPoints(t),n=e.startControlPoint2,i=e.dividerControlPoint1,r=e.divider,s=new pb(n,i);return s.translate(r.x-n.x,r.y-n.y),s}getPrecision(t={}){return null==t.precision?this.PRECISION:t.precision}getDivisions(t={}){if(null!=t.subdivisions)return t.subdivisions;const e=this.getPrecision(t);return this.getSubdivisions({precision:e})}getOptions(t={}){const e=this.getPrecision(t),n=this.getDivisions(t);return{precision:e,subdivisions:n}}tAt(t,e={}){if(t<=0)return 0;if(t>=1)return 1;const n=this.getOptions(e),i=this.length(n),r=i*t;return this.tAtLength(r,n)}tAtLength(t,e={}){let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),r=this.getDivisions(e),s={precision:i,subdivisions:r};let o,a,l=null,c=0,h=0,u=0;const d=r.length;let p=d>0?1/d:0;for(let m=0;m<d;m+=1){const e=n?m:d-1-m,i=r[m],s=i.endpointDistance();if(t<=u+s){l=i,o=e*p,a=(e+1)*p,c=n?t-u:s+u-t,h=n?s+u-t:t-u;break}u+=s}if(null==l)return n?1:0;const g=this.length(s),f=Math.pow(10,-i);while(1){let t,e,n;if(t=0!==g?c/g:0,t<f)return o;if(t=0!==g?h/g:0,t<f)return a;const i=l.divide(.5);p/=2;const r=i[0].endpointDistance(),s=i[1].endpointDistance();c<=r?(l=i[0],a-=p,e=c,n=r-e):(l=i[1],o+=p,e=c-r,n=s-e),c=e,h=n}}toPoints(t={}){const e=this.getDivisions(t),n=[e[0].start.clone()];return e.forEach((t=>n.push(t.end.clone()))),n}toPolyline(t={}){return new fb(this.toPoints(t))}scale(t,e,n){return this.start.scale(t,e,n),this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.start.rotate(t,e),this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?(this.start.translate(t,e),this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return null!=t&&this.start.equals(t.start)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)&&this.end.equals(t.end)}clone(){return new mb(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;try{if((null==n||n===t.toStringTag)&&ub.isPoint(i.start)&&ub.isPoint(i.controlPoint1)&&ub.isPoint(i.controlPoint2)&&ub.isPoint(i.end)&&"function"===typeof i.toPoints&&"function"===typeof i.toPolyline)return!0}catch(r){return!1}return!1}t.toStringTag=`X6.Geometry.${t.name}`,t.isCurve=e})(mb||(mb={})),function(t){function e(t){const e=t.length,n=[],i=[];let r=2;n[0]=t[0]/r;for(let s=1;s<e;s+=1)i[s]=1/r,r=(s<e-1?4:3.5)-i[s],n[s]=(t[s]-n[s-1])/r;for(let s=1;s<e;s+=1)n[e-s-1]-=i[e-s]*n[e-s];return n}function n(t){const n=t.map((t=>ub.clone(t))),i=[],r=[],s=n.length-1;if(1===s)return i[0]=new ub((2*n[0].x+n[1].x)/3,(2*n[0].y+n[1].y)/3),r[0]=new ub(2*i[0].x-n[0].x,2*i[0].y-n[0].y),[i,r];const o=[];for(let e=1;e<s-1;e+=1)o[e]=4*n[e].x+2*n[e+1].x;o[0]=n[0].x+2*n[1].x,o[s-1]=(8*n[s-1].x+n[s].x)/2;const a=e(o);for(let e=1;e<s-1;e+=1)o[e]=4*n[e].y+2*n[e+1].y;o[0]=n[0].y+2*n[1].y,o[s-1]=(8*n[s-1].y+n[s].y)/2;const l=e(o);for(let e=0;e<s;e+=1)i.push(new ub(a[e],l[e])),e<s-1?r.push(new ub(2*n[e+1].x-a[e+1],2*n[e+1].y-l[e+1])):r.push(new ub((n[s].x+a[s-1])/2,(n[s].y+l[s-1])/2));return[i,r]}function i(e){if(null==e||Array.isArray(e)&&e.length<2)throw new Error("At least 2 points are required");const i=n(e),r=[];for(let n=0,s=i[0].length;n<s;n+=1){const s=new ub(i[0][n].x,i[0][n].y),o=new ub(i[1][n].x,i[1][n].y);r.push(new t(e[n],s,o,e[n+1]))}return r}t.throughPoints=i}(mb||(mb={}));class yb extends hb{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(null==this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(t,e){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(t);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(t,e){if(t<=0)return 0;const n=this.length();return t>=1?n:n*t}divideAtT(t){if(this.divideAt)return this.divideAt(t);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(t){if(this.pointAt)return this.pointAt(t);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(t){if(this.tangentAt)return this.tangentAt(t);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class bb extends yb{constructor(t,e){super(),pb.isLine(t)?this.endPoint=t.end.clone().round(2):this.endPoint=ub.create(t,e).round(2)}get type(){return"L"}get line(){return new pb(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[new bb(e[0]),new bb(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[new bb(e[0]),new bb(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return null!=this.previousSegment&&!this.start.equals(this.end)}clone(){return new bb(this.end)}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?this.end.translate(t,e):this.end.translate(t),this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}(function(t){function e(...e){const n=e.length,i=e[0];if(pb.isLine(i))return new t(i);if(ub.isPointLike(i))return 1===n?new t(i):e.map((e=>new t(e)));if(2===n)return new t(+e[0],+e[1]);const r=[];for(let s=0;s<n;s+=2){const n=+e[s],i=+e[s+1];r.push(new t(n,i))}return r}t.create=e})(bb||(bb={}));class vb extends yb{get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new pb(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[e[1].isDifferentiable()?new bb(e[0]):this.clone(),new bb(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new bb(e[0]):this.clone(),new bb(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}clone(){return new vb}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(t){function e(){return new t}t.create=e})(vb||(vb={}));class wb extends yb{constructor(t,e){super(),this.isVisible=!1,this.isSubpathStart=!0,pb.isLine(t)||mb.isCurve(t)?this.endPoint=t.end.clone().round(2):this.endPoint=ub.create(t,e).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?this.end.translate(t,e):this.end.translate(t),this}clone(){return new wb(this.end)}equals(t){return this.type===t.type&&this.end.equals(t.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}(function(t){function e(...e){const n=e.length,i=e[0];if(pb.isLine(i))return new t(i);if(mb.isCurve(i))return new t(i);if(ub.isPointLike(i)){if(1===n)return new t(i);const r=[];for(let i=0;i<n;i+=1)0===i?r.push(new t(e[i])):r.push(new bb(e[i]));return r}if(2===n)return new t(+e[0],+e[1]);const r=[];for(let s=0;s<n;s+=2){const n=+e[s],i=+e[s+1];0===s?r.push(new t(n,i)):r.push(new bb(n,i))}return r}t.create=e})(wb||(wb={}));class Cb extends yb{constructor(t,e,n,i,r,s){super(),mb.isCurve(t)?(this.controlPoint1=t.controlPoint1.clone().round(2),this.controlPoint2=t.controlPoint2.clone().round(2),this.endPoint=t.end.clone().round(2)):"number"===typeof t?(this.controlPoint1=new ub(t,e).round(2),this.controlPoint2=new ub(n,i).round(2),this.endPoint=new ub(r,s).round(2)):(this.controlPoint1=ub.create(t).round(2),this.controlPoint2=ub.create(e).round(2),this.endPoint=ub.create(n).round(2))}get type(){return"C"}get curve(){return new mb(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(t){return this.curve.closestPoint(t)}closestPointLength(t){return this.curve.closestPointLength(t)}closestPointNormalizedLength(t){return this.curve.closestPointNormalizedLength(t)}closestPointTangent(t){return this.curve.closestPointTangent(t)}length(){return this.curve.length()}divideAt(t,e={}){const n=this.curve.divideAt(t,e);return[new Cb(n[0]),new Cb(n[1])]}divideAtLength(t,e={}){const n=this.curve.divideAtLength(t,e);return[new Cb(n[0]),new Cb(n[1])]}divideAtT(t){const e=this.curve.divideAtT(t);return[new Cb(e[0]),new Cb(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.curve.pointAt(t)}pointAtLength(t){return this.curve.pointAtLength(t)}tangentAt(t){return this.curve.tangentAt(t)}tangentAtLength(t){return this.curve.tangentAtLength(t)}isDifferentiable(){if(!this.previousSegment)return!1;const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(i))}scale(t,e,n){return this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?(this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return this.start.equals(t.start)&&this.end.equals(t.end)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)}clone(){return new Cb(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.controlPoint1,e=this.controlPoint2,n=this.end;return[this.type,t.x,t.y,e.x,e.y,n.x,n.y].join(" ")}}function xb(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Eb(t,e,n,i,r,s){const o=1/3,a=2/3;return[o*t+a*n,o*e+a*i,o*r+a*n,o*s+a*i,r,s]}function kb(t,e,n,i,r,s,o,a,l,c){const h=120*Math.PI/180,u=Math.PI/180*(+r||0);let d,p,g,f,m,y=[];if(c)p=c[0],g=c[1],f=c[2],m=c[3];else{d=xb(t,e,-u),t=d.x,e=d.y,d=xb(a,l,-u),a=d.x,l=d.y;const r=(t-a)/2,c=(e-l)/2;let h=r*r/(n*n)+c*c/(i*i);h>1&&(h=Math.sqrt(h),n*=h,i*=h);const y=n*n,b=i*i,v=(s===o?-1:1)*Math.sqrt(Math.abs((y*b-y*c*c-b*r*r)/(y*c*c+b*r*r)));f=v*n*c/i+(t+a)/2,m=v*-i*r/n+(e+l)/2,p=Math.asin((e-m)/i),g=Math.asin((l-m)/i),p=t<f?Math.PI-p:p,g=a<f?Math.PI-g:g,p<0&&(p=2*Math.PI+p),g<0&&(g=2*Math.PI+g),o&&p>g&&(p-=2*Math.PI),!o&&g>p&&(g-=2*Math.PI)}let b=g-p;if(Math.abs(b)>h){const t=g,e=a,s=l;g=p+h*(o&&g>p?1:-1),a=f+n*Math.cos(g),l=m+i*Math.sin(g),y=kb(a,l,n,i,r,0,o,e,s,[g,t,f,m])}b=g-p;const v=Math.cos(p),w=Math.sin(p),C=Math.cos(g),x=Math.sin(g),E=Math.tan(b/4),k=4/3*(n*E),M=4/3*(i*E),S=[t,e],A=[t+k*w,e-M*v],D=[a+k*x,l-M*C],O=[a,l];if(A[0]=2*S[0]-A[0],A[1]=2*S[1]-A[1],c)return[A,D,O].concat(y);{y=[A,D,O].concat(y).join().split(",");const t=[],e=y.length;for(let n=0;n<e;n+=1)t[n]=n%2?xb(+y[n-1],+y[n],u).y:xb(+y[n],+y[n+1],u).x;return t}}function Mb(t){if(!t)return null;const e="\t\n\v\f\r    \u2028\u2029",n=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),i=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"ig"),r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=[];return t.replace(n,((t,e,n)=>{const o=[];let a=e.toLowerCase();n.replace(i,((t,e)=>(e&&o.push(+e),t))),"m"===a&&o.length>2&&(s.push([e,...o.splice(0,2)]),a="l",e="m"===e?"l":"L");const l=r[a];while(o.length>=l)if(s.push([e,...o.splice(0,l)]),!l)break;return t})),s}function Sb(t){const e=Mb(t);if(!e||!e.length)return[["M",0,0]];let n=0,i=0,r=0,s=0;const o=[];for(let a=0,l=e.length;a<l;a+=1){const t=[];o.push(t);const l=e[a],c=l[0];if(c!==c.toUpperCase())switch(t[0]=c.toUpperCase(),t[0]){case"A":t[1]=l[1],t[2]=l[2],t[3]=l[3],t[4]=l[4],t[5]=l[5],t[6]=+l[6]+n,t[7]=+l[7]+i;break;case"V":t[1]=+l[1]+i;break;case"H":t[1]=+l[1]+n;break;case"M":r=+l[1]+n,s=+l[2]+i;for(let e=1,r=l.length;e<r;e+=1)t[e]=+l[e]+(e%2?n:i);break;default:for(let e=1,r=l.length;e<r;e+=1)t[e]=+l[e]+(e%2?n:i);break}else for(let e=0,n=l.length;e<n;e+=1)t[e]=l[e];switch(t[0]){case"Z":n=+r,i=+s;break;case"H":n=t[1];break;case"V":i=t[1];break;case"M":r=t[t.length-2],s=t[t.length-1],n=t[t.length-2],i=t[t.length-1];break;default:n=t[t.length-2],i=t[t.length-1];break}}return o}function Ab(t){const e=Sb(t),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function i(t,e,n){let i,r;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=null,e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":return 0===parseFloat(t[1])||0===parseFloat(t[2])?["L",t[6],t[7]]:["C"].concat(kb.apply(0,[e.x,e.y].concat(t.slice(1))));case"S":return"C"===n||"S"===n?(i=2*e.x-e.bx,r=2*e.y-e.by):(i=e.x,r=e.y),["C",i,r].concat(t.slice(1));case"T":return"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),["C"].concat(Eb(e.x,e.y,e.qx,e.qy,t[1],t[2]));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(Eb(e.x,e.y,t[1],t[2],t[3],t[4]));case"H":return["L"].concat(t[1],e.y);case"V":return["L"].concat(e.x,t[1]);case"L":break;case"Z":break;default:break}return t}function r(t,n){if(t[n].length>7){t[n].shift();const i=t[n];while(i.length)s[n]="A",n+=1,t.splice(n,0,["C"].concat(i.splice(0,6)));t.splice(n,1),a=e.length}}const s=[];let o="",a=e.length;for(let l=0;l<a;l+=1){let t="";e[l]&&(t=e[l][0]),"C"!==t&&(s[l]=t,l>0&&(o=s[l-1])),e[l]=i(e[l],n,o),"A"!==s[l]&&"C"===t&&(s[l]="C"),r(e,l);const a=e[l],c=a.length;n.x=a[c-2],n.y=a[c-1],n.bx=parseFloat(a[c-4])||n.x,n.by=parseFloat(a[c-3])||n.y}return e[0][0]&&"M"===e[0][0]||e.unshift(["M",0,0]),e}function Db(t){return Ab(t).map((t=>t.map((t=>"string"===typeof t?t:rb(t,2))))).join(",").split(",").join(" ")}(function(t){function e(...e){const n=e.length,i=e[0];if(mb.isCurve(i))return new t(i);if(ub.isPointLike(i)){if(3===n)return new t(e[0],e[1],e[2]);const i=[];for(let r=0;r<n;r+=3)i.push(new t(e[r],e[r+1],e[r+2]));return i}if(6===n)return new t(e[0],e[1],e[2],e[3],e[4],e[5]);const r=[];for(let s=0;s<n;s+=6)r.push(new t(e[s],e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]));return r}t.create=e})(Cb||(Cb={}));const Ob=new RegExp("^[\\s\\dLMCZz,.]*$");function Pb(t){return"string"===typeof t&&Ob.test(t)}function Tb(t,e){return(t%e+e)%e}function Nb(t,e,n,i,r){const s=[],o=t[t.length-1],a=null!=e&&e>0,l=e||0;if(i&&a){t=t.slice();const e=t[0],n=new ub(o.x+(e.x-o.x)/2,o.y+(e.y-o.y)/2);t.splice(0,0,n)}let c=t[0],h=1;n?s.push("M",c.x,c.y):s.push("L",c.x,c.y);while(h<(i?t.length:t.length-1)){let e=t[Tb(h,t.length)],n=c.x-e.x,i=c.y-e.y;if(a&&(0!==n||0!==i)&&(null==r||r.indexOf(h-1)<0)){let r=Math.sqrt(n*n+i*i);const o=n*Math.min(l,r/2)/r,a=i*Math.min(l,r/2)/r,c=e.x+o,u=e.y+a;s.push("L",c,u);let d=t[Tb(h+1,t.length)];while(h<t.length-2&&0===Math.round(d.x-e.x)&&0===Math.round(d.y-e.y))d=t[Tb(h+2,t.length)],h+=1;n=d.x-e.x,i=d.y-e.y,r=Math.max(1,Math.sqrt(n*n+i*i));const p=n*Math.min(l,r/2)/r,g=i*Math.min(l,r/2)/r,f=e.x+p,m=e.y+g;s.push("Q",e.x,e.y,f,m),e=new ub(f,m)}else s.push("L",e.x,e.y);c=e,h+=1}return i?s.push("Z"):s.push("L",o.x,o.y),s.map((t=>"string"===typeof t?t:+t.toFixed(3))).join(" ")}function jb(t,e={}){const n=[];return t&&t.length&&t.forEach((t=>{Array.isArray(t)?n.push({x:t[0],y:t[1]}):n.push({x:t.x,y:t.y})})),Nb(n,e.round,null==e.initialMove||e.initialMove,e.close,e.exclude)}function Lb(t,e,n,i,r=0,s=0,o=0,a,l){if(0===n||0===i)return[];a-=t,l-=e,n=Math.abs(n),i=Math.abs(i);const c=-a/2,h=-l/2,u=Math.cos(r*Math.PI/180),d=Math.sin(r*Math.PI/180),p=u*c+d*h,g=-1*d*c+u*h,f=p*p,m=g*g,y=n*n,b=i*i,v=f/y+m/b;let w;if(v>1)n=Math.sqrt(v)*n,i=Math.sqrt(v)*i,w=0;else{let t=1;s===o&&(t=-1),w=t*Math.sqrt((y*b-y*m-b*f)/(y*m+b*f))}const C=w*n*g/i,x=-1*w*i*p/n,E=u*C-d*x+a/2,k=d*C+u*x+l/2;let M=Math.atan2((g-x)/i,(p-C)/n)-Math.atan2(0,1),S=M>=0?M:2*Math.PI+M;M=Math.atan2((-g-x)/i,(-p-C)/n)-Math.atan2((g-x)/i,(p-C)/n);let A=M>=0?M:2*Math.PI+M;0===o&&A>0?A-=2*Math.PI:0!==o&&A<0&&(A+=2*Math.PI);const D=2*A/Math.PI,O=Math.ceil(D<0?-1*D:D),P=A/O,T=8/3*Math.sin(P/4)*Math.sin(P/4)/Math.sin(P/2),N=u*n,j=u*i,L=d*n,F=d*i;let z=Math.cos(S),R=Math.sin(S),B=-T*(N*R+F*z),I=-T*(L*R-j*z),$=0,V=0;const _=[];for(let G=0;G<O;G+=1){S+=P,z=Math.cos(S),R=Math.sin(S),$=N*z-F*R+E,V=L*z+j*R+k;const n=-T*(N*R+F*z),i=-T*(L*R-j*z),r=6*G;_[r]=Number(B+t),_[r+1]=Number(I+e),_[r+2]=Number($-n+t),_[r+3]=Number(V-i+e),_[r+4]=Number($+t),_[r+5]=Number(V+e),B=$+n,I=V+i}return _.map((t=>+t.toFixed(2)))}function Fb(t,e,n,i,r=0,s=0,o=0,a,l){const c=[],h=Lb(t,e,n,i,r,s,o,a,l);if(null!=h)for(let u=0,d=h.length;u<d;u+=6)c.push("C",h[u],h[u+1],h[u+2],h[u+3],h[u+4],h[u+5]);return c.join(" ")}class zb extends hb{constructor(t){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(t))if(pb.isLine(t[0])||mb.isCurve(t[0])){let e=null;const n=t;n.forEach(((t,n)=>{0===n&&this.appendSegment(zb.createSegment("M",t.start)),null==e||e.end.equals(t.start)||this.appendSegment(zb.createSegment("M",t.start)),pb.isLine(t)?this.appendSegment(zb.createSegment("L",t.end)):mb.isCurve(t)&&this.appendSegment(zb.createSegment("C",t.controlPoint1,t.controlPoint2,t.end)),e=t}))}else{const e=t;e.forEach((t=>{t.isSegment&&this.appendSegment(t)}))}else null!=t&&(pb.isLine(t)?(this.appendSegment(zb.createSegment("M",t.start)),this.appendSegment(zb.createSegment("L",t.end))):mb.isCurve(t)?(this.appendSegment(zb.createSegment("M",t.start)),this.appendSegment(zb.createSegment("C",t.controlPoint1,t.controlPoint2,t.end))):fb.isPolyline(t)?t.points&&t.points.length&&t.points.forEach(((t,e)=>{const n=0===e?zb.createSegment("M",t):zb.createSegment("L",t);this.appendSegment(n)})):t.isSegment&&this.appendSegment(t))}get[Symbol.toStringTag](){return zb.toStringTag}get start(){const t=this.segments,e=t.length;if(0===e)return null;for(let n=0;n<e;n+=1){const e=t[n];if(e.isVisible)return e.start}return t[e-1].end}get end(){const t=this.segments,e=t.length;if(0===e)return null;for(let n=e-1;n>=0;n-=1){const e=t[n];if(e.isVisible)return e.end}return t[e-1].end}moveTo(...t){return this.appendSegment(wb.create.call(null,...t))}lineTo(...t){return this.appendSegment(bb.create.call(null,...t))}curveTo(...t){return this.appendSegment(Cb.create.call(null,...t))}arcTo(t,e,n,i,r,s,o){const a=this.end||new ub,l="number"===typeof s?Lb(a.x,a.y,t,e,n,i,r,s,o):Lb(a.x,a.y,t,e,n,i,r,s.x,s.y);if(null!=l)for(let c=0,h=l.length;c<h;c+=6)this.curveTo(l[c],l[c+1],l[c+2],l[c+3],l[c+4],l[c+5]);return this}quadTo(t,e,n,i){const r=this.end||new ub,s=["M",r.x,r.y];if("number"===typeof t)s.push("Q",t,e,n,i);else{const n=e;s.push("Q",t.x,t.y,n.x,n.y)}const o=zb.parse(s.join(" "));return this.appendSegment(o.segments.slice(1)),this}close(){return this.appendSegment(vb.create())}drawPoints(t,e={}){const n=jb(t,e),i=zb.parse(n);i&&i.segments&&this.appendSegment(i.segments)}bbox(){const t=this.segments,e=t.length;if(0===e)return null;let n;for(let r=0;r<e;r+=1){const e=t[r];if(e.isVisible){const t=e.bbox();null!=t&&(n=n?n.union(t):t)}}if(null!=n)return n;const i=t[e-1];return new db(i.end.x,i.end.y,0,0)}appendSegment(t){const e=this.segments.length;let n,i=0!==e?this.segments[e-1]:null;const r=null;if(Array.isArray(t))for(let s=0,o=t.length;s<o;s+=1){const e=t[s];n=this.prepareSegment(e,i,r),this.segments.push(n),i=n}else null!=t&&t.isSegment&&(n=this.prepareSegment(t,i,r),this.segments.push(n));return this}insertSegment(t,e){const n=this.segments.length;if(t<0&&(t=n+t+1),t>n||t<0)throw new Error("Index out of range.");let i,r=null,s=null;if(0!==n&&(t>=1?(r=this.segments[t-1],s=r.nextSegment):(r=null,s=this.segments[0])),Array.isArray(e))for(let o=0,a=e.length;o<a;o+=1){const n=e[o];i=this.prepareSegment(n,r,s),this.segments.splice(t+o,0,i),r=i}else i=this.prepareSegment(e,r,s),this.segments.splice(t,0,i);return this}removeSegment(t){const e=this.fixIndex(t),n=this.segments.splice(e,1)[0],i=n.previousSegment,r=n.nextSegment;return i&&(i.nextSegment=r),r&&(r.previousSegment=i),n.isSubpathStart&&r&&this.updateSubpathStartSegment(r),n}replaceSegment(t,e){const n=this.fixIndex(t);let i;const r=this.segments[n];let s=r.previousSegment;const o=r.nextSegment;let a=r.isSubpathStart;if(Array.isArray(e)){this.segments.splice(t,1);for(let n=0,r=e.length;n<r;n+=1){const r=e[n];i=this.prepareSegment(r,s,o),this.segments.splice(t+n,0,i),s=i,a&&i.isSubpathStart&&(a=!1)}}else i=this.prepareSegment(e,s,o),this.segments.splice(n,1,i),a&&i.isSubpathStart&&(a=!1);a&&o&&this.updateSubpathStartSegment(o)}getSegment(t){const e=this.fixIndex(t);return this.segments[e]}fixIndex(t){const e=this.segments.length;if(0===e)throw new Error("Path has no segments.");let n=t;while(n<0)n=e+n;if(n>=e||n<0)throw new Error("Index out of range.");return n}segmentAt(t,e={}){const n=this.segmentIndexAt(t,e);return n?this.getSegment(n):null}segmentAtLength(t,e={}){const n=this.segmentIndexAtLength(t,e);return n?this.getSegment(n):null}segmentIndexAt(t,e={}){if(0===this.segments.length)return null;const n=ob(t,0,1),i=this.getOptions(e),r=this.length(i),s=r*n;return this.segmentIndexAtLength(s,i)}segmentIndexAtLength(t,e={}){const n=this.segments.length;if(0===n)return null;let i=!0;t<0&&(i=!1,t=-t);const r=this.getPrecision(e),s=this.getSubdivisions(e);let o=0,a=null;for(let l=0;l<n;l+=1){const e=i?l:n-1-l,c=this.segments[e],h=s[e],u=c.length({precision:r,subdivisions:h});if(c.isVisible){if(t<=o+u)return e;a=e}o+=u}return a}getSegmentSubdivisions(t={}){const e=this.getPrecision(t),n=[];for(let i=0,r=this.segments.length;i<r;i+=1){const t=this.segments[i],r=t.getSubdivisions({precision:e});n.push(r)}return n}updateSubpathStartSegment(t){let e=t.previousSegment,n=t;while(n&&!n.isSubpathStart)n.subpathStartSegment=null!=e?e.subpathStartSegment:null,e=n,n=n.nextSegment}prepareSegment(t,e,n){t.previousSegment=e,t.nextSegment=n,null!=e&&(e.nextSegment=t),null!=n&&(n.previousSegment=t);let i=t;return t.isSubpathStart&&(t.subpathStartSegment=t,i=n),null!=i&&this.updateSubpathStartSegment(i),t}closestPoint(t,e={}){const n=this.closestPointT(t,e);return n?this.pointAtT(n):null}closestPointLength(t,e={}){const n=this.getOptions(e),i=this.closestPointT(t,n);return i?this.lengthAtT(i,n):0}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),i=this.closestPointLength(t,n);if(0===i)return 0;const r=this.length(n);return 0===r?0:i/r}closestPointT(t,e={}){if(0===this.segments.length)return null;const n=this.getPrecision(e),i=this.getSubdivisions(e);let r,s=1/0;for(let o=0,a=this.segments.length;o<a;o+=1){const e=this.segments[o],a=i[o];if(e.isVisible){const i=e.closestPointT(t,{precision:n,subdivisions:a}),l=e.pointAtT(i),c=cb(l,t);c<s&&(r={segmentIndex:o,value:i},s=c)}}return r||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(t,e={}){if(0===this.segments.length)return null;const n=this.getPrecision(e),i=this.getSubdivisions(e);let r,s=1/0;for(let o=0,a=this.segments.length;o<a;o+=1){const e=this.segments[o],a=i[o];if(e.isDifferentiable()){const i=e.closestPointT(t,{precision:n,subdivisions:a}),o=e.pointAtT(i),l=cb(o,t);l<s&&(r=e.tangentAtT(i),s=l)}}return r||null}containsPoint(t,e={}){const n=this.toPolylines(e);if(!n)return!1;let i=0;for(let r=0,s=n.length;r<s;r+=1){const e=n[r];e.containsPoint(t)&&(i+=1)}return i%2===1}pointAt(t,e={}){if(0===this.segments.length)return null;if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.getOptions(e),i=this.length(n),r=i*t;return this.pointAtLength(r,n)}pointAtLength(t,e={}){if(0===this.segments.length)return null;if(0===t)return this.start.clone();let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),r=this.getSubdivisions(e);let s,o=0;for(let l=0,c=this.segments.length;l<c;l+=1){const e=n?l:c-1-l,a=this.segments[e],h=r[e],u=a.length({precision:i,subdivisions:h});if(a.isVisible){if(t<=o+u)return a.pointAtLength((n?1:-1)*(t-o),{precision:i,subdivisions:h});s=a}o+=u}if(s)return n?s.end:s.start;const a=this.segments[this.segments.length-1];return a.end.clone()}pointAtT(t){const e=this.segments,n=e.length;if(0===n)return null;const i=t.segmentIndex;if(i<0)return e[0].pointAtT(0);if(i>=n)return e[n-1].pointAtT(1);const r=ob(t.value,0,1);return e[i].pointAtT(r)}divideAt(t,e={}){if(0===this.segments.length)return null;const n=ob(t,0,1),i=this.getOptions(e),r=this.length(i),s=r*n;return this.divideAtLength(s,i)}divideAtLength(t,e={}){if(0===this.segments.length)return null;let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),r=this.getSubdivisions(e);let s,o,a,l,c,h=0;for(let w=0,C=this.segments.length;w<C;w+=1){const e=n?w:C-1-w,c=this.getSegment(e),u=r[e],d={precision:i,subdivisions:u},p=c.length(d);if(c.isDifferentiable()&&(a=c,l=e,t<=h+p)){o=e,s=c.divideAtLength((n?1:-1)*(t-h),d);break}h+=p}if(!a)return null;s||(o=l,c=n?1:0,s=a.divideAtT(c));const u=this.clone(),d=o;u.replaceSegment(d,s);const p=d;let g=d+1,f=d+2;s[0].isDifferentiable()||(u.removeSegment(p),g-=1,f-=1);const m=u.getSegment(g).start;u.insertSegment(g,zb.createSegment("M",m)),f+=1,s[1].isDifferentiable()||(u.removeSegment(f-1),f-=1);const y=f-p-1;for(let w=f,C=u.segments.length;w<C;w+=1){const t=this.getSegment(w-y),e=u.getSegment(w);if("Z"===e.type&&!t.subpathStartSegment.end.equals(e.subpathStartSegment.end)){const e=zb.createSegment("L",t.end);u.replaceSegment(w,e)}}const b=new zb(u.segments.slice(0,g)),v=new zb(u.segments.slice(g));return[b,v]}intersectsWithLine(t,e={}){const n=this.toPolylines(e);if(null==n)return null;let i=null;for(let r=0,s=n.length;r<s;r+=1){const e=n[r],s=t.intersect(e);s&&(null==i&&(i=[]),Array.isArray(s)?i.push(...s):i.push(s))}return i}isDifferentiable(){for(let t=0,e=this.segments.length;t<e;t+=1){const e=this.segments[t];if(e.isDifferentiable())return!0}return!1}isValid(){const t=this.segments,e=0===t.length||"M"===t[0].type;return e}length(t={}){if(0===this.segments.length)return 0;const e=this.getSubdivisions(t);let n=0;for(let i=0,r=this.segments.length;i<r;i+=1){const t=this.segments[i],r=e[i];n+=t.length({subdivisions:r})}return n}lengthAtT(t,e={}){const n=this.segments.length;if(0===n)return 0;let i=t.segmentIndex;if(i<0)return 0;let r=ob(t.value,0,1);i>=n&&(i=n-1,r=1);const s=this.getPrecision(e),o=this.getSubdivisions(e);let a=0;for(let h=0;h<i;h+=1){const t=this.segments[h],e=o[h];a+=t.length({precision:s,subdivisions:e})}const l=this.segments[i],c=o[i];return a+=l.lengthAtT(r,{precision:s,subdivisions:c}),a}tangentAt(t,e={}){if(0===this.segments.length)return null;const n=ob(t,0,1),i=this.getOptions(e),r=this.length(i),s=r*n;return this.tangentAtLength(s,i)}tangentAtLength(t,e={}){if(0===this.segments.length)return null;let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),r=this.getSubdivisions(e);let s,o=0;for(let a=0,l=this.segments.length;a<l;a+=1){const e=n?a:l-1-a,c=this.segments[e],h=r[e],u=c.length({precision:i,subdivisions:h});if(c.isDifferentiable()){if(t<=o+u)return c.tangentAtLength((n?1:-1)*(t-o),{precision:i,subdivisions:h});s=c}o+=u}if(s){const t=n?1:0;return s.tangentAtT(t)}return null}tangentAtT(t){const e=this.segments.length;if(0===e)return null;const n=t.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=e)return this.segments[e-1].tangentAtT(1);const i=ob(t.value,0,1);return this.segments[n].tangentAtT(i)}getPrecision(t={}){return null==t.precision?this.PRECISION:t.precision}getSubdivisions(t={}){if(null==t.segmentSubdivisions){const e=this.getPrecision(t);return this.getSegmentSubdivisions({precision:e})}return t.segmentSubdivisions}getOptions(t={}){const e=this.getPrecision(t),n=this.getSubdivisions(t);return{precision:e,segmentSubdivisions:n}}toPoints(t={}){const e=this.segments,n=e.length;if(0===n)return null;const i=this.getSubdivisions(t),r=[];let s=[];for(let o=0;o<n;o+=1){const t=e[o];if(t.isVisible){const e=i[o];e.length>0?e.forEach((t=>s.push(t.start))):s.push(t.start)}else s.length>0&&(s.push(e[o-1].end),r.push(s),s=[])}return s.length>0&&(s.push(this.end),r.push(s)),r}toPolylines(t={}){const e=this.toPoints(t);return e?e.map((t=>new fb(t))):null}scale(t,e,n){return this.segments.forEach((i=>i.scale(t,e,n))),this}rotate(t,e){return this.segments.forEach((n=>n.rotate(t,e))),this}translate(t,e){return"number"===typeof t?this.segments.forEach((n=>n.translate(t,e))):this.segments.forEach((e=>e.translate(t))),this}clone(){const t=new zb;return this.segments.forEach((e=>t.appendSegment(e.clone()))),t}equals(t){if(null==t)return!1;const e=this.segments,n=t.segments,i=e.length;if(n.length!==i)return!1;for(let r=0;r<i;r+=1){const t=e[r],i=n[r];if(t.type!==i.type||!t.equals(i))return!1}return!0}toJSON(){return this.segments.map((t=>t.toJSON()))}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map((t=>t.serialize())).join(" ")}toString(){return this.serialize()}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return!(null!=n&&n!==t.toStringTag||!Array.isArray(i.segments)||"function"!==typeof i.moveTo||"function"!==typeof i.lineTo||"function"!==typeof i.curveTo)}t.toStringTag=`X6.Geometry.${t.name}`,t.isPath=e})(zb||(zb={})),function(t){function e(e){if(!e)return new t;const i=new t,r=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,s=t.normalize(e).match(r);if(null!=s)for(let t=0,o=s.length;t<o;t+=1){const e=s[t],r=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,o=e.match(r);if(null!=o){const t=o[0],e=o.slice(1).map((t=>+t)),r=n.call(null,t,...e);i.appendSegment(r)}}return i}function n(t,...e){if("M"===t)return wb.create.call(null,...e);if("L"===t)return bb.create.call(null,...e);if("C"===t)return Cb.create.call(null,...e);if("z"===t||"Z"===t)return vb.create();throw new Error(`Invalid path segment type "${t}"`)}t.parse=e,t.createSegment=n}(zb||(zb={})),function(t){t.normalize=Db,t.isValid=Pb,t.drawArc=Fb,t.drawPoints=jb,t.arcToCurves=Lb}(zb||(zb={}));class Rb{constructor(t,e,n){if(!t)throw new TypeError("Invalid element to create vector");let i;if(Rb.isVector(t))i=t.node;else if("string"===typeof t)if("svg"===t.toLowerCase())i=Ey();else if("<"===t[0]){const e=Ey(t);i=document.importNode(e.firstChild,!0)}else i=document.createElementNS(by.svg,t);else i=t;this.node=i,e&&this.setAttributes(e),n&&this.append(n)}get[Symbol.toStringTag](){return Rb.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(t){this.node.id=t}transform(t,e){return null==t?Rv(this.node):(Rv(this.node,t,e),this)}translate(t,e=0,n={}){return null==t?Bv(this.node):(Bv(this.node,t,e,n),this)}rotate(t,e,n,i={}){return null==t?Iv(this.node):(Iv(this.node,t,e,n,i),this)}scale(t,e){return null==t?$v(this.node):($v(this.node,t,e),this)}getTransformToElement(t){const e=Rb.toNode(t);return Dv(this.node,e)}removeAttribute(t){return Iy(this.node,t),this}getAttribute(t){return By(this.node,t)}setAttribute(t,e){return $y(this.node,t,e),this}setAttributes(t){return Vy(this.node,t),this}attr(t,e){return null==t?_y(this.node):"string"===typeof t&&void 0===e?_y(this.node,t):("object"===typeof t?_y(this.node,t):_y(this.node,t,e),this)}svg(){return this.node instanceof SVGSVGElement?this:Rb.create(this.node.ownerSVGElement)}defs(){const t=this.svg()||this,e=t.node.getElementsByTagName("defs")[0];return e?Rb.create(e):Rb.create("defs").appendTo(t)}text(t,e={}){return Gb(this.node,t,e),this}tagName(){return My(this.node)}clone(){return Rb.create(this.node.cloneNode(!0))}remove(){return Ty(this.node),this}empty(){return Ny(this.node),this}append(t){return jy(this.node,Rb.toNodes(t)),this}appendTo(t){return zy(this.node,Rb.isVector(t)?t.node:t),this}prepend(t){return Ly(this.node,Rb.toNodes(t)),this}before(t){return Fy(this.node,Rb.toNodes(t)),this}replace(t){return this.node.parentNode&&this.node.parentNode.replaceChild(Rb.toNode(t),this.node),Rb.create(t)}first(){return this.node.firstChild?Rb.create(this.node.firstChild):null}last(){return this.node.lastChild?Rb.create(this.node.lastChild):null}get(t){const e=this.node.childNodes[t];return e?Rb.create(e):null}indexOf(t){const e=Array.prototype.slice.call(this.node.childNodes);return e.indexOf(Rb.toNode(t))}find(t){const e=[],n=Ay(this.node,t);if(n)for(let i=0,r=n.length;i<r;i+=1)e.push(Rb.create(n[i]));return e}findOne(t){const e=Dy(this.node,t);return e?Rb.create(e):null}findParentByClass(t,e){const n=Oy(this.node,t,e);return n?Rb.create(n):null}matches(t){const e=this.node,n=(this.node.matches,e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null);return n&&n.call(e,t)}contains(t){return Py(this.node,Rb.isVector(t)?t.node:t)}wrap(t){const e=Rb.create(t),n=this.node.parentNode;return null!=n&&n.insertBefore(e.node,this.node),e.append(this)}parent(t){let e=this;if(null==e.node.parentNode)return null;if(e=Rb.create(e.node.parentNode),null==t)return e;do{if("string"===typeof t?e.matches(t):e instanceof t)return e}while(e=Rb.create(e.node.parentNode));return e}children(){const t=this.node.childNodes,e=[];for(let n=0;n<t.length;n+=1){const i=t[n];1===i.nodeType&&e.push(Rb.create(t[n]))}return e}eachChild(t,e){const n=this.children();for(let i=0,r=n.length;i<r;i+=1)t.call(n[i],n[i],i,n),e&&n[i].eachChild(t,e);return this}index(){return Sy(this.node)}hasClass(t){return hy(this.node,t)}addClass(t){return uy(this.node,t),this}removeClass(t){return dy(this.node,t),this}toggleClass(t,e){return py(this.node,t,e),this}toLocalPoint(t,e){return Ov(this.node,t,e)}toGeometryShape(){return Pv(this.node)}translateCenterToPoint(t){const e=this.getBBox({target:this.svg()}),n=e.getCenter();return this.translate(t.x-n.x,t.y-n.y),this}translateAndAutoOrient(t,e,n){return Vv(this.node,t,e,n),this}animate(t){return Tv(this.node,t)}animateTransform(t){return Nv(this.node,t)}animateAlongPath(t,e){return Fv(this.node,t,e)}normalizePath(){const t=this.tagName();return"path"===t&&this.attr("d",zb.normalize(this.attr("d"))),this}bbox(t,e){return Sv(this.node,t,e)}getBBox(t={}){return Av(this.node,{recursive:t.recursive,target:t.target?Rb.toNode(t.target):null})}sample(t=1){return this.node instanceof SVGPathElement?Xb(this.node,t):[]}toPath(){return Rb.create(rv(this.node))}toPathData(){return sv(this.node)}}function Bb(t,e){const n=Rb.create(e),i=Rb.create("textPath"),r=t.d;if(r&&void 0===t["xlink:href"]){const t=Rb.create("path").attr("d",r).appendTo(n.defs());i.attr("xlink:href",`#${t.id}`)}return"object"===typeof t&&i.attr(t),i.node}function Ib(t,e,n){const i=n.eol,r=n.baseSize,s=n.lineHeight;let o,a=0;const l={},c=e.length-1;for(let h=0;h<=c;h+=1){let s=e[h],l=null;if("object"===typeof s){const t=s.attrs,e=Rb.create("tspan",t);o=e.node;let u=s.t;i&&h===c&&(u+=i),o.textContent=u;const d=t.class;d&&e.addClass(d),n.includeAnnotationIndices&&e.attr("annotations",s.annotations.join(",")),l=parseFloat(t["font-size"]),void 0===l&&(l=r),l&&l>a&&(a=l)}else i&&h===c&&(s+=i),o=document.createTextNode(s||" "),r&&r>a&&(a=r);t.appendChild(o)}return a&&(l.maxFontSize=a),s?l.lineHeight=s:a&&(l.lineHeight=1.2*a),l}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&i.node instanceof SVGElement&&"function"===typeof i.animate&&"function"===typeof i.sample&&"function"===typeof i.normalizePath&&"function"===typeof i.toPath}function n(e,n,i){return new t(e,n,i)}function i(t){if("<"===t[0]){const e=Ey(t),i=[];for(let t=0,r=e.childNodes.length;t<r;t+=1){const r=e.childNodes[t];i.push(n(document.importNode(r,!0)))}return i}return[n(t)]}function r(t){return e(t)?t.node:t}function s(t){return Array.isArray(t)?t.map((t=>r(t))):[r(t)]}t.toStringTag=`X6.${t.name}`,t.isVector=e,t.create=n,t.createVectors=i,t.toNode=r,t.toNodes=s})(Rb||(Rb={}));const $b=/em$/;function Vb(t,e){const n=parseFloat(t);return $b.test(t)?n*e:n}function _b(t,e,n,i){if(!Array.isArray(e))return 0;const r=e.length;if(!r)return 0;let s=e[0];const o=Vb(s.maxFontSize,n)||n;let a=0;const l=Vb(i,n);for(let u=1;u<r;u+=1){s=e[u];const t=Vb(s.lineHeight,n)||l;a+=t}const c=Vb(s.maxFontSize,n)||n;let h;switch(t){case"middle":h=o/2-.15*c-a/2;break;case"bottom":h=-.25*c-a;break;default:case"top":h=.8*o;break}return h}function Gb(t,e,n={}){e=Xy(e);const i=n.eol;let r=n.textPath;const s=n.textVerticalAnchor,o="middle"===s||"bottom"===s||"top"===s;let a=n.x;void 0===a&&(a=t.getAttribute("x")||0);const l=n.includeAnnotationIndices;let c=n.annotations;c&&!Array.isArray(c)&&(c=[c]);const h=n.lineHeight,u="auto"===h,d=u?"1.5em":h||"1em";Ny(t),_y(t,{"xml:space":"preserve",display:e||n.displayEmpty?null:"none"});const p=_y(t,"font-size");let g,f,m=parseFloat(p);m||(m=16,!o&&!c||p||_y(t,"font-size",`${m}`)),r?("string"===typeof r&&(r={d:r}),g=Bb(r,t)):g=document.createDocumentFragment();let y,b=0;const v=e.split("\n"),w=[],C=v.length-1;for(let E=0;E<=C;E+=1){f=d;let t="v-line";const e=xy("tspan");let n,s=v[E];if(s)if(c){const t=qy(s,c,{offset:-b,includeAnnotationIndices:l});n=Ib(e,t,{eol:E!==C&&i,baseSize:m,lineHeight:u?null:d,includeAnnotationIndices:l});const r=n.lineHeight;r&&u&&0!==E&&(f=r),0===E&&(y=.8*n.maxFontSize)}else i&&E!==C&&(s+=i),e.textContent=s;else{e.textContent="-",t+=" v-empty-line";const i=e.style;i.fillOpacity=0,i.strokeOpacity=0,c&&(n={})}n&&w.push(n),E>0&&e.setAttribute("dy",f),(E>0||r)&&e.setAttribute("x",a),e.className.baseVal=t,g.appendChild(e),b+=s.length+1}if(o)if(c)f=_b(s,w,m,d);else if("top"===s)f="0.8em";else{let t;switch(C>0?(t=parseFloat(d)||1,t*=C,$b.test(d)||(t/=m)):t=0,s){case"middle":f=.3-t/2+"em";break;case"bottom":f=-t-.3+"em";break;default:break}}else 0===s?f="0em":s?f=s:(f=0,null==t.getAttribute("y")&&t.setAttribute("y",`${y||"0.8em"}`));const x=g.firstChild;x.setAttribute("dy",f),t.appendChild(g)}function Hb(t,e,n,i){const r=[],s=[];if(null!=e){const n=t.split(e);if(r.push(...n),"string"===typeof e)for(let t=0,i=n.length-1;t<i;t+=1)s.push(e);else{const i=t.match(new RegExp(e,"g"));for(let t=0,e=n.length-1;t<e;t+=1)s.push(i?i[t]:"")}}else{let e="";for(let n=0,i=t.length;n<i;n+=1){const i=t[n];" "===i?(r.push(e),s.push(" "),e=""):i.match(/[^\x00-\xff]/)?(e.length&&(r.push(e),s.push("")),r.push(i),s.push(""),e=""):e+=i}e.length&&r.push(e)}for(let o=0;o<r.length;o+=1){const t=r[o];if(t.indexOf(n)>=0&&t.length>1){const e=t.split(n);for(let t=0,r=e.length-1;t<r;t+=1)e.splice(2*t+1,0,n);const i=e.filter((t=>""!==t));r.splice(o,1,...i);const a=i.map((()=>""));a.pop(),s.splice(o,0,...a)}}for(let o=0;o<r.length;o+=1){const t=r[o],e=t.search(i);e>0&&e<t.length-1&&(r.splice(o,1,t.substring(0,e+1),t.substring(e+1)),s.splice(o,0,""))}return{words:r,separators:s}}function Ub(t,e,n={},i={}){const r=e.width,s=e.height,o=i.svgDocument||xy("svg"),a=xy("text"),l=xy("tspan"),c=document.createTextNode("");_y(a,n),a.appendChild(l),a.style.opacity="0",a.style.display="block",l.style.display="block",l.appendChild(c),o.appendChild(a);const h=null==o.parentNode;h&&document.body.appendChild(o);const u=i.eol||"\n",d=i.separator||" ",p=i.hyphen?new RegExp(i.hyphen):/[^\w\d]/,g=!1!==i.breakWord,f=[],m={};let y,b,v,w=[];const{words:C,separators:x}=Hb(t,i.separator,u,p);for(let E=0,k=0,M=C.length;E<M;E+=1){const t=C[E];if(t)if(t!==u){if(null!=w[k]?(v=x[E-1]||"",c.data=`${w[k]}${v}${t}`):c.data=t,l.getComputedTextLength()<=r)w[k]=c.data,m[k]=x[E],y&&(f[k]=!0,k+=1,y=0);else{if(g){if(!w[k]||y){const e=!!y,n=1===t.length;if(y=t.length-1,e||n){if(n){if(!w[k]){w=[];break}C.splice(E,2,t+C[E+1]),x.splice(E+1,1),f[k]=!0,k+=1,M-=1,E-=1;continue}C[E]=t.substring(0,y),C[E+1]=t.substring(y)+C[E+1]}else C.splice(E,1,t.substring(0,y),t.substring(y)),x.splice(E,0,""),M+=1,k&&!f[k-1]&&(k-=1);E-=1;continue}}else if(!w[k]){w[k]=t,f[k]=!0,k+=1;continue}k+=1,E-=1}if(null!=s){if(null==b){let t;t="auto"===n.lineHeight?{value:1.5,unit:"em"}:$m(n.lineHeight,["em"])||{value:1,unit:"em"},b=t.value,"em"===t.unit&&(et.IS_FIREFOX?b*=l.getBBox().height:b*=a.getBBox().height)}if(b*w.length>s){const t=Math.floor(s/b)-1,e=w[t],n=w[t+1];if(w.splice(t+1),null==e)break;let o=i.ellipsis;if(!o)break;"string"!==typeof o&&(o="…");let a=e;n&&g&&(a+=v+n);let h,u,p=a.length;do{if(u=a[p],h=a.substring(0,p),u?u.match(d)&&(h+=u):h+=m[t],h+=o,c.data=h,l.getComputedTextLength()<=r){w[t]=h;break}p-=1}while(p>=0);break}}}else f[k]=!0,k+=1,w[k]=""}return Ty(h?o:a),w.join(u)}const Wb=.551784;function qb(t,e,n=NaN){const i=t.getAttribute(e);if(null==i)return n;const r=parseFloat(i);return Number.isNaN(r)?n:r}function Xb(t,e=1){const n=t.getTotalLength(),i=[];let r,s=0;while(s<n)r=t.getPointAtLength(s),i.push({distance:s,x:r.x,y:r.y}),s+=e;return i}function Yb(t){return["M",qb(t,"x1"),qb(t,"y1"),"L",qb(t,"x2"),qb(t,"y2")].join(" ")}function Jb(t){const e=Qb(t);return 0===e.length?null:`${Kb(e)} Z`}function Zb(t){const e=Qb(t);return 0===e.length?null:Kb(e)}function Kb(t){const e=t.map((t=>`${t.x} ${t.y}`));return`M ${e.join(" L")}`}function Qb(t){const e=[],n=t.points;if(n)for(let i=0,r=n.numberOfItems;i<r;i+=1)e.push(n.getItem(i));return e}function tv(t){const e=qb(t,"cx",0),n=qb(t,"cy",0),i=qb(t,"r"),r=i*Wb;return["M",e,n-i,"C",e+r,n-i,e+i,n-r,e+i,n,"C",e+i,n+r,e+r,n+i,e,n+i,"C",e-r,n+i,e-i,n+r,e-i,n,"C",e-i,n-r,e-r,n-i,e,n-i,"Z"].join(" ")}function ev(t){const e=qb(t,"cx",0),n=qb(t,"cy",0),i=qb(t,"rx"),r=qb(t,"ry")||i,s=i*Wb,o=r*Wb,a=["M",e,n-r,"C",e+s,n-r,e+i,n-o,e+i,n,"C",e+i,n+o,e+s,n+r,e,n+r,"C",e-s,n+r,e-i,n+o,e-i,n,"C",e-i,n-o,e-s,n-r,e,n-r,"Z"].join(" ");return a}function nv(t){return iv({x:qb(t,"x",0),y:qb(t,"y",0),width:qb(t,"width",0),height:qb(t,"height",0),rx:qb(t,"rx",0),ry:qb(t,"ry",0)})}function iv(t){let e;const n=t.x,i=t.y,r=t.width,s=t.height,o=Math.min(t.rx||t["top-rx"]||0,r/2),a=Math.min(t.rx||t["bottom-rx"]||0,r/2),l=Math.min(t.ry||t["top-ry"]||0,s/2),c=Math.min(t.ry||t["bottom-ry"]||0,s/2);return e=o||a||l||c?["M",n,i+l,"v",s-l-c,"a",a,c,0,0,0,a,c,"h",r-2*a,"a",a,c,0,0,0,a,-c,"v",-(s-c-l),"a",o,l,0,0,0,-o,-l,"h",-(r-2*o),"a",o,l,0,0,0,-o,l,"Z"]:["M",n,i,"H",n+r,"V",i+s,"H",n,"V",i,"Z"],e.join(" ")}function rv(t){const e=xy("path");_y(e,_y(t));const n=sv(t);return n&&e.setAttribute("d",n),e}function sv(t){const e=t.tagName.toLowerCase();switch(e){case"path":return t.getAttribute("d");case"line":return Yb(t);case"polygon":return Jb(t);case"polyline":return Zb(t);case"ellipse":return ev(t);case"circle":return tv(t);case"rect":return nv(t);default:break}throw new Error(`"${e}" cannot be converted to svg path element.`)}function ov(t,e,n,i){const r=2*Math.PI-1e-6,s=t,o=e;let a=n,l=i;if(l<a){const t=a;a=l,l=t}const c=l-a,h=c<Math.PI?"0":"1",u=Math.cos(a),d=Math.sin(a),p=Math.cos(l),g=Math.sin(l);return c>=r?s?`M0,${o}A${o},${o} 0 1,1 0,${-o}A${o},${o} 0 1,1 0,${o}M0,${s}A${s},${s} 0 1,0 0,${-s}A${s},${s} 0 1,0 0,${s}Z`:`M0,${o}A${o},${o} 0 1,1 0,${-o}A${o},${o} 0 1,1 0,${o}Z`:s?`M${o*u},${o*d}A${o},${o} 0 ${h},1 ${o*p},${o*g}L${s*p},${s*g}A${s},${s} 0 ${h},0 ${s*u},${s*d}Z`:`M${o*u},${o*d}A${o},${o} 0 ${h},1 ${o*p},${o*g}L0,0Z`}const av=xy("svg"),lv=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,cv=/[ ,]+/,hv=/^(\w+)\((.*)\)/;function uv(t,e){const n=av.createSVGPoint();return n.x=t,n.y=e,n}function dv(t){const e=av.createSVGMatrix();if(null!=t){const n=t,i=e;for(const t in n)i[t]=n[t]}return e}function pv(t){return null!=t?(t instanceof DOMMatrix||(t=dv(t)),av.createSVGTransformFromMatrix(t)):av.createSVGTransform()}function gv(t){let e=dv();const n=null!=t&&t.match(lv);if(!n)return e;for(let i=0,r=n.length;i<r;i+=1){const t=n[i],r=t.match(hv);if(r){let t,n,i,s,o,a=dv();const l=r[2].split(cv);switch(r[1].toLowerCase()){case"scale":t=parseFloat(l[0]),n=void 0===l[1]?t:parseFloat(l[1]),a=a.scaleNonUniform(t,n);break;case"translate":i=parseFloat(l[0]),s=parseFloat(l[1]),a=a.translate(i,s);break;case"rotate":o=parseFloat(l[0]),i=parseFloat(l[1])||0,s=parseFloat(l[2])||0,a=0!==i||0!==s?a.translate(i,s).rotate(o).translate(-i,-s):a.rotate(o);break;case"skewx":o=parseFloat(l[0]),a=a.skewX(o);break;case"skewy":o=parseFloat(l[0]),a=a.skewY(o);break;case"matrix":a.a=parseFloat(l[0]),a.b=parseFloat(l[1]),a.c=parseFloat(l[2]),a.d=parseFloat(l[3]),a.e=parseFloat(l[4]),a.f=parseFloat(l[5]);break;default:continue}e=e.multiply(a)}}return e}function fv(t){const e=t||{},n=null!=e.a?e.a:1,i=null!=e.b?e.b:0,r=null!=e.c?e.c:0,s=null!=e.d?e.d:1,o=null!=e.e?e.e:0,a=null!=e.f?e.f:0;return`matrix(${n},${i},${r},${s},${o},${a})`}function mv(t){let e,n,i;if(t){const r=cv;if(t.trim().indexOf("matrix")>=0){const r=gv(t),s=bv(r);e=[s.translateX,s.translateY],n=[s.rotation],i=[s.scaleX,s.scaleY];const o=[];0===e[0]&&0===e[1]||o.push(`translate(${e.join(",")})`),1===i[0]&&1===i[1]||o.push(`scale(${i.join(",")})`),0!==n[0]&&o.push(`rotate(${n[0]})`),t=o.join(" ")}else{const s=t.match(/translate\((.*?)\)/);s&&(e=s[1].split(r));const o=t.match(/rotate\((.*?)\)/);o&&(n=o[1].split(r));const a=t.match(/scale\((.*?)\)/);a&&(i=a[1].split(r))}}const r=i&&i[0]?parseFloat(i[0]):1;return{raw:t||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:n&&n[0]?parseInt(n[0],10):0,cx:n&&n[1]?parseInt(n[1],10):void 0,cy:n&&n[2]?parseInt(n[2],10):void 0},scale:{sx:r,sy:i&&i[1]?parseFloat(i[1]):r}}}function yv(t,e){const n=e.x*t.a+e.y*t.c+0,i=e.x*t.b+e.y*t.d+0;return{x:n,y:i}}function bv(t){const e=yv(t,{x:0,y:1}),n=yv(t,{x:1,y:0}),i=180/Math.PI*Math.atan2(e.y,e.x)-90,r=180/Math.PI*Math.atan2(n.y,n.x);return{skewX:i,skewY:r,translateX:t.e,translateY:t.f,scaleX:Math.sqrt(t.a*t.a+t.b*t.b),scaleY:Math.sqrt(t.c*t.c+t.d*t.d),rotation:i}}function vv(t){let e,n,i,r;return t?(e=null==t.a?1:t.a,r=null==t.d?1:t.d,n=t.b,i=t.c):e=r=1,{sx:n?Math.sqrt(e*e+n*n):e,sy:i?Math.sqrt(i*i+r*r):r}}function wv(t){let e={x:0,y:1};return t&&(e=yv(t,e)),{angle:ib.normalize(ib.toDeg(Math.atan2(e.y,e.x))-90)}}function Cv(t){return{tx:t&&t.e||0,ty:t&&t.f||0}}function xv(t,e){const n=uv(t.x,t.y).matrixTransform(e);return new ub(n.x,n.y)}function Ev(t,e){return new pb(xv(t.start,e),xv(t.end,e))}function kv(t,e){const n=av.createSVGPoint();n.x=t.x,n.y=t.y;const i=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y;const r=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y+t.height;const s=n.matrixTransform(e);n.x=t.x,n.y=t.y+t.height;const o=n.matrixTransform(e),a=Math.min(i.x,r.x,s.x,o.x),l=Math.max(i.x,r.x,s.x,o.x),c=Math.min(i.y,r.y,s.y,o.y),h=Math.max(i.y,r.y,s.y,o.y);return new db(a,c,l-a,h-c)}var Mv=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function Sv(t,e,n){let i;const r=t.ownerSVGElement;if(!r)return new db(0,0,0,0);try{i=t.getBBox()}catch(o){i={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}if(e)return db.create(i);const s=Dv(t,n||r);return kv(i,s)}function Av(t,e={}){let n;const i=t.ownerSVGElement;if(!i||!yy(t)){if(Ry(t)){const{left:e,top:n,width:i,height:r}=zv(t);return new db(e,n,i,r)}return new db(0,0,0,0)}let r=e.target;const s=e.recursive;if(!s){try{n=t.getBBox()}catch(o){n={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}if(!r)return db.create(n);const e=Dv(t,r);return kv(n,e)}{const e=t.childNodes,i=e.length;if(0===i)return Av(t,{target:r});r||(r=t);for(let t=0;t<i;t+=1){const i=e[t];let s;s=0===i.childNodes.length?Av(i,{target:r}):Av(i,{target:r,recursive:!0}),n=n?n.union(s):s}return n}}function Dv(t,e){if(yy(e)&&yy(t)){const n=e.getScreenCTM(),i=t.getScreenCTM();if(n&&i)return n.inverse().multiply(i)}return dv()}function Ov(t,e,n){const i=t instanceof SVGSVGElement?t:t.ownerSVGElement,r=i.createSVGPoint();r.x=e,r.y=n;try{const e=i.getScreenCTM(),n=r.matrixTransform(e.inverse()),s=Dv(t,i).inverse();return n.matrixTransform(s)}catch(s){return r}}function Pv(t){const e=e=>{const n=t.getAttribute(e),i=n?parseFloat(n):0;return Number.isNaN(i)?0:i};switch(t instanceof SVGElement&&t.nodeName.toLowerCase()){case"rect":return new db(e("x"),e("y"),e("width"),e("height"));case"circle":return new gb(e("cx"),e("cy"),e("r"),e("r"));case"ellipse":return new gb(e("cx"),e("cy"),e("rx"),e("ry"));case"polyline":{const e=Qb(t);return new fb(e)}case"polygon":{const e=Qb(t);return e.length>1&&e.push(e[0]),new fb(e)}case"path":{let e=t.getAttribute("d");return zb.isValid(e)||(e=zb.normalize(e)),zb.parse(e)}case"line":return new pb(e("x1"),e("y1"),e("x2"),e("y2"));default:break}return Av(t)}function Tv(t,e){return jv(t,e,"animate")}function Nv(t,e){return jv(t,e,"animateTransform")}function jv(t,e,n){const i=xy(n);t.appendChild(i);try{return Lv(i,e)}catch(r){}return()=>{}}function Lv(t,e){const{start:n,complete:i,repeat:r}=e,s=Mv(e,["start","complete","repeat"]);_y(t,s),n&&t.addEventListener("beginEvent",n),i&&t.addEventListener("endEvent",i),r&&t.addEventListener("repeatEvent",r);const o=t;return o.beginElement(),()=>o.endElement()}function Fv(t,e,n){const i=my(n),r=xy("animateMotion"),s=xy("mpath");_y(s,{"xlink:href":`#${i}`}),r.appendChild(s),t.appendChild(r);try{return Lv(r,e)}catch(o){if("fake"===document.documentElement.getAttribute("smiling")){const t=r;t.animators=[];const e=window,n=t.getAttribute("id");n&&(e.id2anim[n]=t);const i=e.getTargets(t);for(let r=0,s=i.length;r<s;r+=1){const n=i[r],s=new e.Animator(t,n,r);e.animators.push(s),t.animators[r]=s,s.register()}}}return()=>{}}function zv(t){let e=0,n=0,i=0,r=0;if(t){let s=t;while(s)e+=s.offsetLeft,n+=s.offsetTop,s=s.offsetParent,s&&(e+=parseInt(nb(s,"borderLeft"),10),n+=parseInt(nb(s,"borderTop"),10));i=t.offsetWidth,r=t.offsetHeight}return{left:e,top:n,width:i,height:r}}function Rv(t,e,n={}){if(null==e)return gv(_y(t,"transform"));if(n.absolute)return void t.setAttribute("transform",fv(e));const i=t.transform,r=pv(e);i.baseVal.appendItem(r)}function Bv(t,e,n=0,i={}){let r=_y(t,"transform");const s=mv(r);if(null==e)return s.translation;r=s.raw,r=r.replace(/translate\([^)]*\)/g,"").trim();const o=i.absolute?e:s.translation.tx+e,a=i.absolute?n:s.translation.ty+n,l=`translate(${o},${a})`;t.setAttribute("transform",`${l} ${r}`.trim())}function Iv(t,e,n,i,r={}){let s=_y(t,"transform");const o=mv(s);if(null==e)return o.rotation;s=o.raw,s=s.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const a=r.absolute?e:o.rotation.angle+e,l=null!=n&&null!=i?`,${n},${i}`:"",c=`rotate(${a}${l})`;t.setAttribute("transform",`${s} ${c}`.trim())}function $v(t,e,n){let i=_y(t,"transform");const r=mv(i);if(null==e)return r.scale;n=null==n?e:n,i=r.raw,i=i.replace(/scale\([^)]*\)/g,"").trim();const s=`scale(${e},${n})`;t.setAttribute("transform",`${i} ${s}`.trim())}function Vv(t,e,n,i){const r=ub.create(e),s=ub.create(n);if(!i){const e=t instanceof SVGSVGElement?t:t.ownerSVGElement;i=e}const o=$v(t);t.setAttribute("transform","");const a=Av(t,{target:i}).scale(o.sx,o.sy),l=pv();l.setTranslate(-a.x-a.width/2,-a.y-a.height/2);const c=pv(),h=r.angleBetween(s,r.clone().translate(1,0));h&&c.setRotate(h,0,0);const u=pv(),d=r.clone().move(s,a.width/2);u.setTranslate(2*r.x-d.x,2*r.y-d.y);const p=Dv(t,i),g=pv();g.setMatrix(u.matrix.multiply(c.matrix.multiply(l.matrix.multiply(p.scale(o.sx,o.sy))))),t.setAttribute("transform",fv(g.matrix))}class _v{constructor(t,e,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=et.isEventSupported("wheel")?"wheel":"mousewheel",this.target=t,this.onWheelCallback=e,this.onWheelGuard=n,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){et.SUPPORT_PASSIVE?this.target.addEventListener(this.eventName,this.onWheel,{passive:!1}):Q()(this.target).on("mousewheel",this.onWheel)}disable(){et.SUPPORT_PASSIVE?this.target.removeEventListener(this.eventName,this.onWheel):Q()(this.target).off("mousewheel")}onWheel(t){if(null!=this.onWheelGuard&&!this.onWheelGuard(t))return;let e;this.deltaX+=t.deltaX,this.deltaY+=t.deltaY,t.preventDefault(),0===this.deltaX&&0===this.deltaY||(t.stopPropagation(),e=!0),!0===e&&0===this.animationFrameId&&(this.animationFrameId=requestAnimationFrame((()=>{this.didWheel(t)})))}didWheel(t){this.animationFrameId=0,this.onWheelCallback(t,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}Rb.isVector,Rb.create,Rb.createVectors;function Gv(t,e=60){let n=null;return(...i)=>{n&&clearTimeout(n),n=window.setTimeout((()=>{t.apply(this,i)}),e)}}function Hv(t){let e=null,n=[];const i=()=>{if("static"===getComputedStyle(t).position){const e=t.style;e.position="relative"}const e=document.createElement("object");return e.onload=()=>{e.contentDocument.defaultView.addEventListener("resize",r),r()},e.style.display="block",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.height="100%",e.style.width="100%",e.style.overflow="hidden",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.opacity="0",e.setAttribute("tabindex","-1"),e.type="text/html",t.appendChild(e),e.data="about:blank",e},r=Gv((()=>{n.forEach((e=>e(t)))})),s=t=>{e||(e=i()),-1===n.indexOf(t)&&n.push(t)},o=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",r),e.parentNode.removeChild(e),e=null,n=[])},a=t=>{const i=n.indexOf(t);-1!==i&&n.splice(i,1),0===n.length&&e&&o()};return{element:t,bind:s,destroy:o,unbind:a}}function Uv(t){let e=null,n=[];const i=Gv((()=>{n.forEach((e=>{e(t)}))})),r=()=>{const e=new ResizeObserver(i);return e.observe(t),i(),e},s=t=>{e||(e=r()),-1===n.indexOf(t)&&n.push(t)},o=()=>{e&&(e.disconnect(),n=[],e=null)},a=t=>{const i=n.indexOf(t);-1!==i&&n.splice(i,1),0===n.length&&e&&o()};return{element:t,bind:s,destroy:o,unbind:a}}const Wv="undefined"!==typeof ResizeObserver?Uv:Hv;var qv,Xv;(function(t){const e=new WeakMap;function n(t){let n=e.get(t);return n||(n=Wv(t),e.set(t,n),n)}function i(t){t.destroy(),e.delete(t.element)}t.bind=(t,e)=>{const i=n(t);return i.bind(e),()=>i.unbind(e)},t.clear=t=>{const e=n(t);i(e)}})(qv||(qv={})),function(t){const e=[],n=1e3/60,i=[];let r=0;const s=()=>performance.now(),o=t=>t[0],a=t=>1===i.push(t)&&l(),l=(()=>{const t=()=>i.splice(0,i.length).forEach((t=>t()));if("undefined"!==typeof MessageChannel){const{port1:e,port2:n}=new MessageChannel;return e.onmessage=t,()=>n.postMessage(null)}return()=>setTimeout(t)})(),c=()=>{r=s()+n;let i=o(e);while(i&&!t.shouldYield()){const{callback:t,data:n}=i;i.callback=null;const r=t&&t(n);r?i.callback=r:e.shift(),i=o(e)}i&&a(c)};t.scheduleTask=(t,n)=>{const i={callback:t,data:n};e.push(i),a(c)},t.shouldYield=()=>{var t,e;return(null===(e=null===(t=navigator)||void 0===t?void 0:t.scheduling)||void 0===e?void 0:e.isInputPending())||s()>=r}}(Xv||(Xv={}));class Yv{constructor(t){this.options=Object.assign({},t),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(t,e,n=!1){if("object"===typeof t)return void Object.keys(t).forEach((n=>{this.register(n,t[n],e)}));!this.exist(t)||n||et.isApplyingHMR()||this.onDuplicated(t);const i=this.options.process,r=i?ey(i,this,t,e):e;return this.data[t]=r,r}unregister(t){const e=t?this.data[t]:null;return delete this.data[t],e}get(t){return t?this.data[t]:null}exist(t){return!!t&&null!=this.data[t]}onDuplicated(t){try{throw this.options.onConflict&&ey(this.options.onConflict,this,t),new Error(`${dm(this.options.type)} with name '${t}' already registered.`)}catch(e){throw e}}onNotFound(t,e){throw new Error(this.getSpellingSuggestion(t,e))}getSpellingSuggestion(t,e){const n=this.getSpellingSuggestionForName(t),i=e?`${e} ${km(this.options.type)}`:this.options.type;return`${dm(i)} with name '${t}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(t){return Tm(t,Object.keys(this.data),(t=>t))}}(function(t){function e(e){return new t(e)}t.create=e})(Yv||(Yv={}));const Jv={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},Zv={},Kv={position:Cw("x","width","origin")},Qv={position:Cw("y","height","origin")},tw={position:Cw("x","width","corner")},ew={position:Cw("y","height","corner")},nw={set:xw("width","width")},iw={set:xw("height","height")},rw={set:xw("rx","width")},sw={set:xw("ry","height")},ow={set:(t=>{const e=xw(t,"width"),n=xw(t,"height");return function(t,i){const r=i.refBBox,s=r.height>r.width?e:n;return ey(s,this,t,i)}})("r")},aw={set(t,{refBBox:e}){let n=parseFloat(t);const i=Bm(t);i&&(n/=100);const r=Math.sqrt(e.height*e.height+e.width*e.width);let s;return Number.isFinite(n)&&(s=i||n>=0&&n<=1?n*r:Math.max(n+r,0)),{r:s}}},lw={set:xw("cx","width")},cw={set:xw("cy","height")},hw={set:kw({resetOffset:!0})},uw={set:kw({resetOffset:!1})},dw={set:Mw({resetOffset:!0})},pw={set:Mw({resetOffset:!1})},gw=ow,fw=hw,mw=dw,yw=Kv,bw=Qv,vw=nw,ww=iw;function Cw(t,e,n){return(i,{refBBox:r})=>{if(null==i)return null;let s=parseFloat(i);const o=Bm(i);let a;if(o&&(s/=100),Number.isFinite(s)){const i=r[n];a=o||s>0&&s<1?i[t]+r[e]*s:i[t]+s}const l=new ub;return l[t]=a||0,l}}function xw(t,e){return function(n,{refBBox:i}){let r=parseFloat(n);const s=Bm(n);s&&(r/=100);const o={};if(Number.isFinite(r)){const n=s||r>=0&&r<=1?r*i[e]:Math.max(r+i[e],0);o[t]=n}return o}}function Ew(t,e){const n="x6-shape",i=e&&e.resetOffset;return function(e,{view:r,elem:s,refBBox:o}){const a=r.$(s);let l=a.data(n);if(!l||l.value!==e){const i=t(e);l={value:e,shape:i,shapeBBox:i.bbox()},a.data(n,l)}const c=l.shape.clone(),h=l.shapeBBox.clone(),u=h.getOrigin(),d=o.getOrigin();h.x=d.x,h.y=d.y;const p=o.getMaxScaleToFit(h,d),g=0===h.width||0===o.width?1:p.sx,f=0===h.height||0===o.height?1:p.sy;return c.scale(g,f,u),i&&c.translate(-u.x,-u.y),c}}function kw(t){function e(t){return zb.parse(t)}const n=Ew(e,t);return(t,e)=>{const i=n(t,e);return{d:i.serialize()}}}function Mw(t){const e=Ew((t=>new fb(t)),t);return(t,n)=>{const i=e(t,n);return{points:i.serialize()}}}const Sw={qualify:qc,set(t,{view:e}){return`url(#${e.graph.defineGradient(t)})`}},Aw={qualify:qc,set(t,{view:e}){const n=e.cell,i=Object.assign({},t);if(n.isEdge()&&"linearGradient"===i.type){const t=e,r=t.sourcePoint,s=t.targetPoint;i.id=`gradient-${i.type}-${n.id}`,i.attrs=Object.assign(Object.assign({},i.attrs),{x1:r.x,y1:r.y,x2:s.x,y2:s.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(i.id)}return`url(#${e.graph.defineGradient(i)})`}},Dw={qualify(t,{attrs:e}){return null==e.textWrap||!qc(e.textWrap)},set(t,{view:e,elem:n,attrs:i}){const r="x6-text",s=e.$(n),o=s.data(r),a=t=>{try{return JSON.parse(t)}catch(e){return t}},l={x:i.x,eol:i.eol,annotations:a(i.annotations),textPath:a(i["text-path"]||i.textPath),textVerticalAnchor:i["text-vertical-anchor"]||i.textVerticalAnchor,displayEmpty:"true"===(i["display-empty"]||i.displayEmpty),lineHeight:i["line-height"]||i.lineHeight},c=i["font-size"]||i.fontSize,h=JSON.stringify([t,l]);if(c&&n.setAttribute("font-size",c),null==o||o!==h){const i=l.textPath;if(null!=i&&"object"===typeof i){const t=i.selector;if("string"===typeof t){const n=e.find(t)[0];n instanceof SVGPathElement&&(my(n),l.textPath=Object.assign({"xlink:href":`#${n.id}`},i))}}Gb(n,`${t}`,l),s.data(r,h)}}},Ow={qualify:qc,set(t,{view:e,elem:n,attrs:i,refBBox:r}){const s=t,o=s.width||0;Bm(o)?r.width*=parseFloat(o)/100:o<=0?r.width+=o:r.width=o;const a=s.height||0;let l;Bm(a)?r.height*=parseFloat(a)/100:a<=0?r.height+=a:r.height=a;let c=s.text;null==c&&(c=i.text),l=null!=c?Ub(`${c}`,r,{"font-weight":i["font-weight"]||i.fontWeight,"font-size":i["font-size"]||i.fontSize,"font-family":i["font-family"]||i.fontFamily,lineHeight:i.lineHeight},{svgDocument:e.graph.view.svg,ellipsis:s.ellipsis,hyphen:s.hyphen,breakWord:s.breakWord}):"",ey(Dw.set,this,l,{view:e,elem:n,attrs:i,refBBox:r,cell:e.cell})}},Pw=(t,{attrs:e})=>void 0!==e.text,Tw={qualify:Pw},Nw={qualify:Pw},jw={qualify:Pw},Lw={qualify:Pw},Fw={qualify:Pw},zw={qualify:Pw},Rw={qualify(t,{elem:e}){return e instanceof SVGElement},set(t,{view:e,elem:n}){const i="x6-title",r=`${t}`,s=e.$(n),o=s.data(i);if(null==o||o!==r){s.data(i,r);const t=n.firstChild;if(t&&"TITLE"===t.tagName.toUpperCase()){const e=t;e.textContent=r}else{const e=document.createElementNS(n.namespaceURI,"title");e.textContent=r,n.insertBefore(e,t)}}}},Bw={offset:Vw("x","width","right")},Iw={offset:Vw("y","height","bottom")},$w={offset(t,{refBBox:e}){return t?{x:-e.x,y:-e.y}:{x:0,y:0}}};function Vw(t,e,n){return(i,{refBBox:r})=>{const s=new ub;let o;return o="middle"===i?r[e]/2:i===n?r[e]:"number"===typeof i&&Number.isFinite(i)?i>-1&&i<1?-r[e]*i:-i:Bm(i)?r[e]*parseFloat(i)/100:0,s[t]=-(r[t]+o),s}}const _w={qualify:qc,set(t,{view:e,elem:n}){e.$(n).css(t)}},Gw={set(t,{view:e,elem:n}){e.$(n).html(`${t}`)}},Hw={qualify:qc,set(t,{view:e}){return`url(#${e.graph.defineFilter(t)})`}},Uw={set(t){return null!=t&&"object"===typeof t&&t.id?t.id:t}};function Ww(t,e,n){let i,r;"object"===typeof e?(i=e.x,r=e.y):(i=e,r=n);const s=zb.parse(t),o=s.bbox();if(o){let t=-o.height/2-o.y,e=-o.width/2-o.x;"number"===typeof i&&(e-=i),"number"===typeof r&&(t-=r),s.translate(e,t)}return s.serialize()}var qw=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const Xw=t=>{var{size:e,width:n,height:i,offset:r,open:s}=t,o=qw(t,["size","width","height","offset","open"]);return Jw({size:e,width:n,height:i,offset:r},!0===s,!0,void 0,o)},Yw=t=>{var{size:e,width:n,height:i,offset:r,factor:s}=t,o=qw(t,["size","width","height","offset","factor"]);return Jw({size:e,width:n,height:i,offset:r},!1,!1,s,o)};function Jw(t,e,n,i=3/4,r={}){const s=t.size||10,o=t.width||s,a=t.height||s,l=new zb,c={};if(e)l.moveTo(o,0).lineTo(0,a/2).lineTo(o,a),c.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(o,0),!n){const t=Rm(i,0,1);l.lineTo(o*t,a/2)}l.lineTo(o,a),l.close()}return Object.assign(Object.assign(Object.assign({},c),r),{tagName:"path",d:Ww(l.serialize(),{x:null!=t.offset?t.offset:-o/2})})}var Zw=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const Kw=t=>{var{size:e,width:n,height:i,offset:r}=t,s=Zw(t,["size","width","height","offset"]);const o=e||10,a=n||o,l=i||o,c=new zb;return c.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},s),{tagName:"path",d:Ww(c.serialize(),null==r?-a/2:r)})};var Qw=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const tC=t=>{var{d:e,offsetX:n,offsetY:i}=t,r=Qw(t,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},r),{tagName:"path",d:Ww(e,n,i)})};var eC=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const nC=t=>{var{size:e,width:n,height:i,offset:r}=t,s=eC(t,["size","width","height","offset"]);const o=e||10,a=n||o,l=i||o,c=new zb;return c.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},s),{tagName:"path",fill:"none",d:Ww(c.serialize(),r||-a/2)})};var iC=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const rC=t=>{var{width:e,height:n,offset:i,open:r,flip:s}=t,o=iC(t,["width","height","offset","open","flip"]);let a=n||6;const l=e||10,c=!0===r,h=!0===s,u=Object.assign(Object.assign({},o),{tagName:"path"});h&&(a=-a);const d=new zb;return d.moveTo(0,a).lineTo(l,0),c?u.fill="none":(d.lineTo(l,a),d.close()),u.d=Ww(d.serialize(),{x:i||-l/2,y:a/2}),u};var sC=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const oC=t=>{var{r:e}=t,n=sC(t,["r"]);const i=e||5;return Object.assign(Object.assign({cx:i},n),{tagName:"circle",r:i})},aC=t=>{var{r:e}=t,n=sC(t,["r"]);const i=e||5,r=new zb;return r.moveTo(i,0).lineTo(i,2*i),r.moveTo(0,i).lineTo(2*i,i),{children:[Object.assign(Object.assign({},oC({r:i})),{fill:"none"}),Object.assign(Object.assign({},n),{tagName:"path",d:Ww(r.serialize(),-i)})]}};var lC=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const cC=t=>{var{rx:e,ry:n}=t,i=lC(t,["rx","ry"]);const r=e||5,s=n||5;return Object.assign(Object.assign({cx:r},i),{tagName:"ellipse",rx:r,ry:s})};var hC;(function(t){t.presets=i,t.registry=Yv.create({type:"marker"}),t.registry.register(t.presets,!0)})(hC||(hC={})),function(t){t.normalize=Ww}(hC||(hC={}));var uC=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function dC(t){return"string"===typeof t||qc(t)}const pC={qualify:dC,set(t,{view:e,attrs:n}){return mC("marker-start",t,e,n)}},gC={qualify:dC,set(t,{view:e,attrs:n}){return mC("marker-end",t,e,n,{transform:"rotate(180)"})}},fC={qualify:dC,set(t,{view:e,attrs:n}){return mC("marker-mid",t,e,n)}};function mC(t,e,n,i,r={}){const s="string"===typeof e?{name:e}:e,{name:o,args:a}=s,l=uC(s,["name","args"]);let c=l;if(o&&"string"===typeof o){const t=hC.registry.get(o);if(!t)return hC.registry.onNotFound(o);c=t(Object.assign(Object.assign({},l),a))}const h=Object.assign(Object.assign(Object.assign({},yC(i,t)),r),c);return{[t]:`url(#${n.graph.defineMarker(h)})`}}function yC(t,e){const n={},i=t.stroke;"string"===typeof i&&(n.stroke=i,n.fill=i);let r=t.strokeOpacity;if(null==r&&(r=t["stroke-opacity"]),null==r&&(r=t.opacity),null!=r&&(n["stroke-opacity"]=r,n["fill-opacity"]=r),"marker-mid"!==e){const i=parseFloat(t.strokeWidth||t["stroke-width"]);if(Number.isFinite(i)&&i>1){const t=Math.ceil(i/2);n.refX="marker-start"===e?t:-t}}return n}const bC=(t,{view:e})=>e.cell.isEdge(),vC={qualify:bC,set(t,e){const n=e.view,i=t.stubs||0;let r;if(Number.isFinite(i)&&0!==i){let t;if(i<0){const e=n.getConnectionLength()||0;t=(e+i)/2}else t=i;const e=n.getConnection();if(e){const n=e.divideAtLength(t),i=e.divideAtLength(-t);n&&i&&(r=`${n[0].serialize()} ${i[1].serialize()}`)}}return{d:r||n.getConnectionPathData()}}},wC={qualify:bC,set:SC("getTangentAtLength",{rotate:!0})},CC={qualify:bC,set:SC("getTangentAtLength",{rotate:!1})},xC={qualify:bC,set:SC("getTangentAtRatio",{rotate:!0})},EC={qualify:bC,set:SC("getTangentAtRatio",{rotate:!1})},kC=wC,MC=xC;function SC(t,e){const n={x:1,y:0};return(i,r)=>{let s,o;const a=r.view,l=a[t](Number(i));return l?(o=e.rotate?l.vector().vectorAngle(n):0,s=l.start):(s=a.path.start,o=0),0===o?{transform:`translate(${s.x},${s.y}')`}:{transform:`translate(${s.x},${s.y}') rotate(${o})`}}}var AC;(function(t){function e(t,e,n){if(null!=t){if("string"===typeof t)return!0;if("function"!==typeof t.qualify||ey(t.qualify,this,e,n))return!0}return!1}t.isValidDefinition=e})(AC||(AC={})),function(t){t.presets=Object.assign(Object.assign({},Jv),r),t.registry=Yv.create({type:"attribute definition"}),t.registry.register(t.presets,!0)}(AC||(AC={}));const DC={color:"#aaaaaa",thickness:1,markup:"rect",update(t,e){const n=e.thickness*e.sx,i=e.thickness*e.sy;_y(t,{width:n,height:i,rx:n,ry:i,fill:e.color})}},OC={color:"#aaaaaa",thickness:1,markup:"rect",update(t,e){const n=e.sx<=1?e.thickness*e.sx:e.thickness;_y(t,{width:n,height:n,rx:n,ry:n,fill:e.color})}},PC={color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(t,e){let n;const i=e.width,r=e.height,s=e.thickness;n=i-s>=0&&r-s>=0?["M",i,0,"H0 M0 0 V0",r].join(" "):"M 0 0 0 0",_y(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}},TC=[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(t,e){let n;const i=e.width,r=e.height,s=e.thickness;n=i-s>=0&&r-s>=0?["M",i,0,"H0 M0 0 V0",r].join(" "):"M 0 0 0 0",_y(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(t,e){let n;const i=e.factor||1,r=e.width*i,s=e.height*i,o=e.thickness;n=r-o>=0&&s-o>=0?["M",r,0,"H0 M0 0 V0",s].join(" "):"M 0 0 0 0",e.width=r,e.height=s,_y(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}}];class NC{constructor(){this.patterns={},this.root=Rb.create(Ey(),{width:"100%",height:"100%"},[xy("defs")]).node}add(t,e){const n=this.root.childNodes[0];n&&n.appendChild(e),this.patterns[t]=e,Rb.create("rect",{width:"100%",height:"100%",fill:`url(#${t})`}).appendTo(this.root)}get(t){return this.patterns[t]}has(t){return null!=this.patterns[t]}}function jC(t,e){return null!=t?t:e}function LC(t,e){return null!=t&&Number.isFinite(t)?t:e}function FC(t={}){const e=jC(t.color,"blue"),n=LC(t.width,1),i=LC(t.margin,2),r=LC(t.opacity,1),s=i,o=i+n;return`\n <filter>\n <feFlood flood-color="${e}" flood-opacity="${r}" result="colored"/>\n <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${o}" />\n <feMorphology in="SourceAlpha" result="morphedInner" operator="dilate" radius="${s}" />\n <feComposite result="morphedOuterColored" in="colored" in2="morphedOuter" operator="in"/>\n <feComposite operator="xor" in="morphedOuterColored" in2="morphedInner" result="outline"/>\n <feMerge>\n <feMergeNode in="outline"/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>\n `.trim()}function zC(t={}){const e=jC(t.color,"red"),n=LC(t.blur,0),i=LC(t.width,1),r=LC(t.opacity,1);return`\n <filter>\n <feFlood flood-color="${e}" flood-opacity="${r}" result="colored"/>\n <feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${i}"/>\n <feComposite result="composed" in="colored" in2="morphed" operator="in"/>\n <feGaussianBlur result="blured" in="composed" stdDeviation="${n}"/>\n <feBlend in="SourceGraphic" in2="blured" mode="normal"/>\n </filter>\n `.trim()}function RC(t={}){const e=LC(t.x,2),n=null!=t.y&&Number.isFinite(t.y)?[e,t.y]:e;return`\n <filter>\n <feGaussianBlur stdDeviation="${n}"/>\n </filter>\n `.trim()}function BC(t={}){const e=LC(t.dx,0),n=LC(t.dy,0),i=jC(t.color,"black"),r=LC(t.blur,4),s=LC(t.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>\n <feDropShadow stdDeviation="${r}" dx="${e}" dy="${n}" flood-color="${i}" flood-opacity="${s}" />\n </filter>`.trim():`<filter>\n <feGaussianBlur in="SourceAlpha" stdDeviation="${r}" />\n <feOffset dx="${e}" dy="${n}" result="offsetblur" />\n <feFlood flood-color="${i}" />\n <feComposite in2="offsetblur" operator="in" />\n <feComponentTransfer>\n <feFuncA type="linear" slope="${s}" />\n </feComponentTransfer>\n <feMerge>\n <feMergeNode/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>`.trim()}function IC(t={}){const e=LC(t.amount,1),n=.2126+.7874*(1-e),i=.7152-.7152*(1-e),r=.0722-.0722*(1-e),s=.2126-.2126*(1-e),o=.7152+.2848*(1-e),a=.0722-.0722*(1-e),l=.2126-.2126*(1-e),c=.0722+.9278*(1-e);return`\n <filter>\n <feColorMatrix type="matrix" values="${n} ${i} ${r} 0 0 ${s} ${o} ${a} 0 0 ${l} ${i} ${c} 0 0 0 0 0 1 0"/>\n </filter>\n `.trim()}function $C(t={}){const e=LC(t.amount,1),n=.393+.607*(1-e),i=.769-.769*(1-e),r=.189-.189*(1-e),s=.349-.349*(1-e),o=.686+.314*(1-e),a=.168-.168*(1-e),l=.272-.272*(1-e),c=.534-.534*(1-e),h=.131+.869*(1-e);return`\n <filter>\n <feColorMatrix type="matrix" values="${n} ${i} ${r} 0 0 ${s} ${o} ${a} 0 0 ${l} ${c} ${h} 0 0 0 0 0 1 0"/>\n </filter>\n `.trim()}function VC(t={}){const e=LC(t.amount,1);return`\n <filter>\n <feColorMatrix type="saturate" values="${1-e}"/>\n </filter>\n `.trim()}function _C(t={}){const e=LC(t.angle,0);return`\n <filter>\n <feColorMatrix type="hueRotate" values="${e}"/>\n </filter>\n `.trim()}function GC(t={}){const e=LC(t.amount,1),n=1-e;return`\n <filter>\n <feComponentTransfer>\n <feFuncR type="table" tableValues="${e} ${n}"/>\n <feFuncG type="table" tableValues="${e} ${n}"/>\n <feFuncB type="table" tableValues="${e} ${n}"/>\n </feComponentTransfer>\n </filter>\n `.trim()}function HC(t={}){const e=LC(t.amount,1);return`\n <filter>\n <feComponentTransfer>\n <feFuncR type="linear" slope="${e}"/>\n <feFuncG type="linear" slope="${e}"/>\n <feFuncB type="linear" slope="${e}"/>\n </feComponentTransfer>\n </filter>\n `.trim()}function UC(t={}){const e=LC(t.amount,1),n=.5-e/2;return`\n <filter>\n <feComponentTransfer>\n <feFuncR type="linear" slope="${e}" intercept="${n}"/>\n <feFuncG type="linear" slope="${e}" intercept="${n}"/>\n <feFuncB type="linear" slope="${e}" intercept="${n}"/>\n </feComponentTransfer>\n </filter>\n `.trim()}var WC;(function(t){t.presets=s,t.registry=Yv.create({type:"grid"}),t.registry.register(t.presets,!0)})(NC||(NC={})),function(t){t.presets=o,t.registry=Yv.create({type:"filter"}),t.registry.register(t.presets,!0)}(WC||(WC={}));const qC=function(t){const e=document.createElement("canvas"),n=t.width,i=t.height;e.width=2*n,e.height=i;const r=e.getContext("2d");return r.drawImage(t,0,0,n,i),r.translate(2*n,0),r.scale(-1,1),r.drawImage(t,0,0,n,i),e},XC=function(t){const e=document.createElement("canvas"),n=t.width,i=t.height;e.width=n,e.height=2*i;const r=e.getContext("2d");return r.drawImage(t,0,0,n,i),r.translate(0,2*i),r.scale(1,-1),r.drawImage(t,0,0,n,i),e},YC=function(t){const e=document.createElement("canvas"),n=t.width,i=t.height;e.width=2*n,e.height=2*i;const r=e.getContext("2d");return r.drawImage(t,0,0,n,i),r.setTransform(-1,0,0,-1,e.width,e.height),r.drawImage(t,0,0,n,i),r.setTransform(-1,0,0,1,e.width,0),r.drawImage(t,0,0,n,i),r.setTransform(1,0,0,-1,0,e.height),r.drawImage(t,0,0,n,i),e},JC=function(t,e){const n=t.width,i=t.height,r=document.createElement("canvas");r.width=3*n,r.height=3*i;const s=r.getContext("2d"),o=null!=e.angle?-e.angle:-20,a=ib.toRad(o),l=r.width/4,c=r.height/4;for(let h=0;h<4;h+=1)for(let e=0;e<4;e+=1)(h+e)%2>0&&(s.setTransform(1,0,0,1,(2*h-1)*l,(2*e-1)*c),s.rotate(a),s.drawImage(t,-n/2,-i/2,n,i));return r};var ZC;(function(t){t.presets=Object.assign({},a),t.presets["flip-x"]=qC,t.presets["flip-y"]=XC,t.presets["flip-xy"]=YC,t.registry=Yv.create({type:"background pattern"}),t.registry.register(t.presets,!0)})(ZC||(ZC={}));const KC={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,trackable:!1,trackInfo:{},track(t){KC.trackable=t}};var QC;(function(t){function e(t){return`${KC.prefixCls}-${t}`}t.snapToGrid=ab,t.normalizeMarker=Ww,t.prefix=e})(QC||(QC={})),function(t){function e(t,e,n,i=[]){const r="function"===typeof e.children?e.children(t):t[e.children||"children"];return n||(n=e.createNode(t),i.push(n)),Array.isArray(r)&&r.forEach((t=>{const r=e.createNode(t),s=e.createEdge(n,r);i.push(r,s),this.makeTree(t,e,r,i)})),i}t.makeTree=e}(QC||(QC={}));const tx=QC.prefix("highlighted"),ex={highlight(t,e,n){const i=n&&n.className||tx;uy(e,i)},unhighlight(t,e,n){const i=n&&n.className||tx;dy(e,i)}},nx=QC.prefix("highlight-opacity"),ix={highlight(t,e){uy(e,nx)},unhighlight(t,e){dy(e,nx)}},rx={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},sx={highlight(t,e,n){const i=ox.getHighlighterId(e,n);if(ox.hasCache(i))return;n=yd({},n,rx);const r=Rb.create(e);let s,o;try{s=r.toPathData()}catch(h){o=r.bbox(!0),s=iv(Object.assign(Object.assign({},n),o))}const a=xy("path");if(_y(a,Object.assign({d:s,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},n.attrs?Hy(n.attrs):null)),t.isEdgeElement(e))_y(a,"d",t.getConnectionPathData());else{let e=r.getTransformToElement(t.container);const i=n.padding;if(i){null==o&&(o=r.bbox(!0));const t=o.x+o.width/2,n=o.y+o.height/2;o=kv(o,e);const s=Math.max(o.width,1),a=Math.max(o.height,1),l=(s+i)/s,c=(a+i)/a,h=dv({a:l,b:0,c:0,d:c,e:t-l*t,f:n-c*n});e=e.multiply(h)}Rv(a,e)}uy(a,QC.prefix("highlight-stroke"));const l=t.cell,c=()=>ox.removeHighlighter(i);l.on("removed",c),l.model&&l.model.on("reseted",c),t.container.appendChild(a),ox.setCache(i,a)},unhighlight(t,e,n){ox.removeHighlighter(ox.getHighlighterId(e,n))}};var ox,ax;function lx(t,e={}){return new ub(Im(e.x,t.width),Im(e.y,t.height))}function cx(t,e,n){return Object.assign({angle:e,position:t.toJSON()},n)}(function(t){function e(t,e){return my(t),t.id+JSON.stringify(e)}t.getHighlighterId=e;const n={};function i(t,e){n[t]=e}function r(t){return null!=n[t]}function s(t){const e=n[t];e&&(Ty(e),delete n[t])}t.setCache=i,t.hasCache=r,t.removeHighlighter=s})(ox||(ox={})),function(t){function e(t,e){if("function"!==typeof e.highlight)throw new Error(`Highlighter '${t}' is missing required \`highlight()\` method`);if("function"!==typeof e.unhighlight)throw new Error(`Highlighter '${t}' is missing required \`unhighlight()\` method`)}t.check=e}(ax||(ax={})),function(t){t.presets=l,t.registry=Yv.create({type:"highlighter"}),t.registry.register(t.presets,!0)}(ax||(ax={}));const hx=(t,e)=>t.map((({x:t,y:n,angle:i})=>cx(lx(e,{x:t,y:n}),i||0))),ux=(t,e,n)=>{const i=n.start||0,r=n.step||20;return px(t,e,i,((t,e)=>(t+.5-e/2)*r))},dx=(t,e,n)=>{const i=n.start||0,r=n.step||360/t.length;return px(t,e,i,(t=>t*r))};function px(t,e,n,i){const r=e.getCenter(),s=e.getTopCenter(),o=e.width/e.height,a=gb.fromRect(e),l=t.length;return t.map(((t,e)=>{const c=n+i(e,l),h=s.clone().rotate(-c,r).scale(o,1,r),u=t.compensateRotate?-a.tangentTheta(h):0;return(t.dx||t.dy)&&h.translate(t.dx||0,t.dy||0),t.dr&&h.move(r,t.dr),cx(h.round(),u,t)}))}var gx=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const fx=(t,e,n)=>{const i=lx(e,n.start||e.getOrigin()),r=lx(e,n.end||e.getCorner());return wx(t,i,r,n)},mx=(t,e,n)=>wx(t,e.getTopLeft(),e.getBottomLeft(),n),yx=(t,e,n)=>wx(t,e.getTopRight(),e.getBottomRight(),n),bx=(t,e,n)=>wx(t,e.getTopLeft(),e.getTopRight(),n),vx=(t,e,n)=>wx(t,e.getBottomLeft(),e.getBottomRight(),n);function wx(t,e,n,i){const r=new pb(e,n),s=t.length;return t.map(((t,e)=>{var{strict:n}=t,o=gx(t,["strict"]);const a=n||i.strict?(e+1)/(s+1):(e+.5)/s,l=r.pointAt(a);return(o.dx||o.dy)&&l.translate(o.dx||0,o.dy||0),cx(l.round(),0,o)}))}var Cx;(function(t){t.presets=c,t.registry=Yv.create({type:"port layout"}),t.registry.register(t.presets,!0)})(Cx||(Cx={}));const xx={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function Ex(t,e){const{x:n,y:i,angle:r,attrs:s}=e||{};return yd({},{angle:r,attrs:s,position:{x:n,y:i}},t,xx)}const kx=(t,e,n)=>Ex({position:e.getTopLeft()},n),Mx=(t,e,n)=>Ex({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},n),Sx=(t,e,n)=>Ex({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},n),Ax=(t,e,n)=>Ex({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},n),Dx=(t,e,n)=>Ex({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},n),Ox=(t,e,n)=>jx(t,e,!1,n),Px=(t,e,n)=>jx(t,e,!0,n),Tx=(t,e,n)=>Lx(t,e,!1,n),Nx=(t,e,n)=>Lx(t,e,!0,n);function jx(t,e,n,i){const r=null!=i.offset?i.offset:15,s=e.getCenter().theta(t),o=Fx(e);let a,l,c,h,u=0;return s<o[1]||s>o[2]?(a=".3em",l=r,c=0,h="start"):s<o[0]?(a="0",l=0,c=-r,n?(u=-90,h="start"):h="middle"):s<o[3]?(a=".3em",l=-r,c=0,h="end"):(a=".6em",l=0,c=r,n?(u=90,h="start"):h="middle"),Ex({position:{x:Math.round(l),y:Math.round(c)},angle:u,attrs:{".":{y:a,"text-anchor":h}}},i)}function Lx(t,e,n,i){const r=null!=i.offset?i.offset:15,s=e.getCenter().theta(t),o=Fx(e);let a,l,c,h,u=0;return s<o[1]||s>o[2]?(a=".3em",l=-r,c=0,h="end"):s<o[0]?(a=".6em",l=0,c=r,n?(u=90,h="start"):h="middle"):s<o[3]?(a=".3em",l=r,c=0,h="start"):(a="0em",l=0,c=-r,n?(u=-90,h="start"):h="middle"),Ex({position:{x:Math.round(l),y:Math.round(c)},angle:u,attrs:{".":{y:a,"text-anchor":h}}},i)}function Fx(t){const e=t.getCenter(),n=e.theta(t.getTopLeft()),i=e.theta(t.getBottomLeft()),r=e.theta(t.getBottomRight()),s=e.theta(t.getTopRight());return[n,s,r,i]}const zx=(t,e,n)=>Bx(t.diff(e.getCenter()),!1,n),Rx=(t,e,n)=>Bx(t.diff(e.getCenter()),!0,n);function Bx(t,e,n){const i=null!=n.offset?n.offset:20,r=new ub(0,0),s=-t.theta(r),o=t.clone().move(r,i).diff(t).round();let a,l=".3em",c=s;return(s+90)%180===0?(a=e?"end":"middle",e||-270!==s||(l="0em")):s>-270&&s<-90?(a="start",c=s-180):a="end",Ex({position:o.round().toJSON(),angle:e?c:0,attrs:{".":{y:l,"text-anchor":a}}},n)}var Ix,$x;(function(t){t.presets=h,t.registry=Yv.create({type:"port label layout"}),t.registry.register(t.presets,!0)})(Ix||(Ix={}));class Vx{constructor(t,e,n,i){return null==t?this.set(255,255,255,1):"number"===typeof t?this.set(t,e,n,i):"string"===typeof t?Vx.fromString(t)||this:Array.isArray(t)?this.set(t):void this.set(t.r,t.g,t.b,null==t.a?1:t.a)}blend(t,e,n){this.set(t.r+(e.r-t.r)*n,t.g+(e.g-t.g)*n,t.b+(e.b-t.b)*n,t.a+(e.a-t.a)*n)}lighten(t){const e=Vx.lighten(this.toArray(),t);this.r=e[0],this.g=e[1],this.b=e[2],this.a=e[3]}darken(t){this.lighten(-t)}set(t,e,n,i){const r=Array.isArray(t)?t[0]:t,s=Array.isArray(t)?t[1]:e,o=Array.isArray(t)?t[2]:n,a=Array.isArray(t)?t[3]:i;return this.r=Math.round(Rm(r,0,255)),this.g=Math.round(Rm(s,0,255)),this.b=Math.round(Rm(o,0,255)),this.a=null==a?1:Rm(a,0,1),this}toHex(){const t=["r","g","b"].map((t=>{const e=this[t].toString(16);return e.length<2?`0${e}`:e}));return`#${t.join("")}`}toRGBA(){return this.toArray()}toHSLA(){return Vx.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(t){const e=`${this.r},${this.g},${this.b},`;return t?`rgb(${e})`:`rgba(${e},${this.a})`}toGrey(){return Vx.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}(function(t){function e(e){return new t(e)}function n(e){return new t([...g(e),1])}function i(e){const n=e.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(n){const e=n[1].split(/\s*,\s*/).map((t=>parseInt(t,10)));return new t(e)}return null}function r(t,e,n){n<0&&++n,n>1&&--n;const i=6*n;return i<1?t+(e-t)*i:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function s(e){const n=e.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(n){const e=n[2].split(/\s*,\s*/),i=(parseFloat(e[0])%360+360)%360/360,r=parseFloat(e[1])/100,s=parseFloat(e[2])/100,o=null==e[3]?1:parseInt(e[3],10);return new t(c(i,r,s,o))}return null}function o(e){if(e.startsWith("#"))return n(e);if(e.startsWith("rgb"))return i(e);const r=t.named[e];return r?n(r):s(e)}function a(e,n){return t.fromArray([e,e,e,n])}function l(t,e,n,i){const r=Array.isArray(t)?t[0]:t,s=Array.isArray(t)?t[1]:e,o=Array.isArray(t)?t[2]:n,a=Array.isArray(t)?t[3]:i,l=Math.max(r,s,o),c=Math.min(r,s,o),h=(l+c)/2;let u=0,d=0;if(c!==l){const t=l-c;switch(d=h>.5?t/(2-l-c):t/(l+c),l){case r:u=(s-o)/t+(s<o?6:0);break;case s:u=(o-r)/t+2;break;case o:u=(r-s)/t+4;break;default:break}u/=6}return[u,d,h,null==a?1:a]}function c(t,e,n,i){const s=Array.isArray(t)?t[0]:t,o=Array.isArray(t)?t[1]:e,a=Array.isArray(t)?t[2]:n,l=Array.isArray(t)?t[3]:i,c=a<=.5?a*(o+1):a+o-a*o,h=2*a-c;return[256*r(h,c,s+1/3),256*r(h,c,s),256*r(h,c,s-1/3),null==l?1:l]}function h(e){return new t(Math.round(256*Math.random()),Math.round(256*Math.random()),Math.round(256*Math.random()),e?void 0:parseFloat(Math.random().toFixed(2)))}function u(){const t="0123456789ABCDEF";let e="#";for(let n=0;n<6;n+=1)e+=t[Math.floor(16*Math.random())];return e}function d(t){return h(t).toString()}function p(t,e){if("string"===typeof t){const n="#"===t[0],[i,r,s]=g(t);return e?.299*i+.587*r+.114*s>186?"#000000":"#ffffff":`${n?"#":""}${f(255-i,255-r,255-s)}`}const n=t[0],i=t[1],r=t[2],s=t[3];return e?.299*n+.587*i+.114*r>186?[0,0,0,s]:[255,255,255,s]:[255-n,255-i,255-r,s]}function g(t){const e=0===t.indexOf("#")?t:`#${t}`;let n=Number(`0x${e.substr(1)}`);if(4!==e.length&&7!==e.length||Number.isNaN(n))throw new Error("Invalid hex color.");const i=4===e.length?4:8,r=(1<<i)-1,s=["b","g","r"].map((()=>{const t=n&r;return n>>=i,4===i?17*t:t}));return[s[2],s[1],s[0]]}function f(t,e,n){const i=t=>t.length<2?`0${t}`:t;return`${i(t.toString(16))}${i(e.toString(16))}${i(n.toString(16))}`}function m(t,e){return b(t,e)}function y(t,e){return b(t,-e)}function b(t,e){if("string"===typeof t){const n="#"===t[0],i=parseInt(n?t.substr(1):t,16),r=Rm((i>>16)+e,0,255),s=Rm((i>>8&255)+e,0,255),o=Rm((255&i)+e,0,255);return`${n?"#":""}${(o|s<<8|r<<16).toString(16)}`}const n=f(t[0],t[1],t[2]),i=g(b(n,e));return[i[0],i[1],i[2],t[3]]}t.fromArray=e,t.fromHex=n,t.fromRGBA=i,t.fromHSLA=s,t.fromString=o,t.makeGrey=a,t.rgba2hsla=l,t.hsla2rgba=c,t.random=h,t.randomHex=u,t.randomRGBA=d,t.invert=p,t.lighten=m,t.darken=y})(Vx||(Vx={})),function(t){t.named={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",burntsienna:"#ea7e5d",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",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",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"}}(Vx||(Vx={}));class _x{constructor(){this.listeners={}}on(t,e,n){if(null==e)return this;this.listeners[t]||(this.listeners[t]=[]);const i=this.listeners[t];return i.push(e,n),this}once(t,e,n){const i=(...r)=>(this.off(t,i),$x.call([e,n],r));return this.on(t,i,this)}off(t,e,n){if(!(t||e||n))return this.listeners={},this;const i=this.listeners,r=t?[t]:Object.keys(i);return r.forEach((t=>{const r=i[t];if(r)if(e||n)for(let i=r.length-2;i>=0;i-=2)e&&r[i]!==e||n&&r[i+1]!==n||r.splice(i,2);else delete i[t]})),this}trigger(t,...e){let n=!0;if("*"!==t){const i=this.listeners[t];null!=i&&(n=$x.call([...i],e))}const i=this.listeners["*"];return null!=i?ry([n,$x.call([...i],[t,...e])]):n}emit(t,...e){return this.trigger(t,...e)}}(function(t){function e(t,e){const n=[];for(let i=0;i<t.length;i+=2){const r=t[i],s=t[i+1],o=Array.isArray(e)?e:[e],a=ty(r,s,o);n.push(a)}return ry(n)}t.call=e})($x||($x={}));class Gx{get disposed(){return!0===this._disposed}dispose(){this._disposed=!0}}(function(t){function e(){return(t,e,n)=>{const i=n.value,r=t.__proto__;n.value=function(){this.disposed||(i.call(this),r.dispose.call(this))}}}t.dispose=e})(Gx||(Gx={}));class Hx{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach((t=>{t.dispose()})),this.items.clear())}contains(t){return this.items.has(t)}add(t){this.items.add(t)}remove(t){this.items.delete(t)}clear(){this.items.clear()}}(function(t){function e(e){const n=new t;return e.forEach((t=>{n.add(t)})),n}t.from=e})(Hx||(Hx={}));class Ux extends _x{}(function(t){t.dispose=Gx.dispose})(Ux||(Ux={})),bd(Ux,Gx);class Wx extends Ux{get disabled(){return!0===this._disabled}enable(){delete this._disabled}disable(){this._disabled=!0}}var qx,Xx,Yx,Jx,Zx,Kx=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class Qx extends Gx{constructor(){super(),this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(t){return this.map.has(t)}get(t){return this.map.get(t)}set(t,e){this.map.set(t,e),this.arr.push(t)}delete(t){const e=this.arr.indexOf(t);e>=0&&this.arr.splice(e,1);const n=this.map.get(t);return this.map.delete(t),n}each(t){this.arr.forEach((e=>{const n=this.map.get(e);t(n,e)}))}dispose(){this.clear()}}Kx([Gx.dispose()],Qx.prototype,"dispose",null);class tE{constructor(t={}){this.comparator=t.comparator||tE.defaultComparator,this.index={},this.data=t.data||[],this.heapify()}isEmpty(){return 0===this.data.length}insert(t,e,n){const i={priority:t,value:e},r=this.data.length-1;return n&&(i.id=n,this.index[n]=r),this.data.push(i),this.bubbleUp(r),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(t,e){const n=this.index[t];if("undefined"===typeof n)throw new Error(`Node with id '${t}' was not found in the heap.`);const i=this.data,r=i[n].priority,s=this.comparator(e,r);s<0?(i[n].priority=e,this.bubbleUp(n)):s>0&&(i[n].priority=e,this.bubbleDown(n))}remove(){const t=this.data,e=t[0],n=t.pop();return delete this.index[t.length],t.length>0&&(t[0]=n,n.id&&(this.index[n.id]=0),this.bubbleDown(0)),e?e.value:null}heapify(){for(let t=0;t<this.data.length;t+=1)this.bubbleUp(t)}bubbleUp(t){const e=this.data;let n,i,r=t;while(r>0){if(i=r-1>>>1,!(this.comparator(e[r].priority,e[i].priority)<0))break;{n=e[i],e[i]=e[r];let t=e[r].id;null!=t&&(this.index[t]=i),e[r]=n,t=e[r].id,null!=t&&(this.index[t]=r),r=i}}}bubbleDown(t){const e=this.data,n=e.length-1;let i=t;while(1){const t=1+(i<<1),r=t+1;let s=i;if(t<=n&&this.comparator(e[t].priority,e[s].priority)<0&&(s=t),r<=n&&this.comparator(e[r].priority,e[s].priority)<0&&(s=r),s===i)break;{const t=e[s];e[s]=e[i];let n=e[i].id;null!=n&&(this.index[n]=s),e[i]=t,n=e[i].id,null!=n&&(this.index[n]=i),i=s}}}}(function(t){t.defaultComparator=(t,e)=>t-e})(tE||(tE={})),function(t){function e(t,e,n=((t,e)=>1)){const i={},r={},s={},o=new tE;i[e]=0,Object.keys(t).forEach((t=>{t!==e&&(i[t]=1/0),o.insert(i[t],t,t)}));while(!o.isEmpty()){const e=o.remove();s[e]=!0;const a=t[e]||[];for(let t=0;t<a.length;t+=1){const l=a[t];if(!s[l]){const t=i[e]+n(e,l);t<i[l]&&(i[l]=t,r[l]=e,o.updatePriority(l,t))}}}return r}t.run=e}(qx||(qx={})),function(t){t.linear=t=>t,t.quad=t=>t*t,t.cubic=t=>t*t*t,t.inout=t=>{if(t<=0)return 0;if(t>=1)return 1;const e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)},t.exponential=t=>Math.pow(2,10*(t-1)),t.bounce=t=>{for(let e=0,n=1;1;e+=n,n/=2)if(t>=(7-4*e)/11){const i=(11-6*e-11*t)/4;return-i*i+n*n}}}(Xx||(Xx={})),function(t){t.decorators={reverse(t){return e=>1-t(1-e)},reflect(t){return e=>.5*(e<.5?t(2*e):2-t(2-2*e))},clamp(t,e=0,n=1){return i=>{const r=t(i);return r<e?e:r>n?n:r}},back(t=1.70158){return e=>e*e*((t+1)*e-t)},elastic(t=1.5){return e=>Math.pow(2,10*(e-1))*Math.cos(20*Math.PI*t/3*e)}}}(Xx||(Xx={})),function(t){function e(t){return-1*Math.cos(t*(Math.PI/2))+1}function n(t){return Math.sin(t*(Math.PI/2))}function i(t){return-.5*(Math.cos(Math.PI*t)-1)}function r(t){return t*t}function s(t){return t*(2-t)}function o(t){return t<.5?2*t*t:(4-2*t)*t-1}function a(t){return t*t*t}function l(t){const e=t-1;return e*e*e+1}function c(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}function h(t){return t*t*t*t}function u(t){const e=t-1;return 1-e*e*e*e}function d(t){const e=t-1;return t<.5?8*t*t*t*t:1-8*e*e*e*e}function p(t){return t*t*t*t*t}function g(t){const e=t-1;return 1+e*e*e*e*e}function f(t){const e=t-1;return t<.5?16*t*t*t*t*t:1+16*e*e*e*e*e}function m(t){return 0===t?0:Math.pow(2,10*(t-1))}function y(t){return 1===t?1:1-Math.pow(2,-10*t)}function b(t){if(0===t||1===t)return t;const e=2*t,n=e-1;return e<1?.5*Math.pow(2,10*n):.5*(2-Math.pow(2,-10*n))}function v(t){const e=t/1;return-1*(Math.sqrt(1-e*t)-1)}function w(t){const e=t-1;return Math.sqrt(1-e*e)}function C(t){const e=2*t,n=e-2;return e<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-n*n)+1)}function x(t,e=1.70158){return t*t*((e+1)*t-e)}function E(t,e=1.70158){const n=t/1-1;return n*n*((e+1)*n+e)+1}function k(t,e=1.70158){const n=2*t,i=n-2,r=1.525*e;return n<1?.5*n*n*((r+1)*n-r):.5*(i*i*((r+1)*i+r)+2)}function M(t,e=.7){if(0===t||1===t)return t;const n=t/1,i=n-1,r=1-e,s=r/(2*Math.PI)*Math.asin(1);return-Math.pow(2,10*i)*Math.sin((i-s)*(2*Math.PI)/r)}function S(t,e=.7){const n=1-e,i=2*t;if(0===t||1===t)return t;const r=n/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*i)*Math.sin((i-r)*(2*Math.PI)/n)+1}function A(t,e=.65){const n=1-e;if(0===t||1===t)return t;const i=2*t,r=i-1,s=n/(2*Math.PI)*Math.asin(1);return i<1?Math.pow(2,10*r)*Math.sin((r-s)*(2*Math.PI)/n)*-.5:Math.pow(2,-10*r)*Math.sin((r-s)*(2*Math.PI)/n)*.5+1}function D(t){const e=t/1;if(e<1/2.75)return 7.5625*e*e;if(e<2/2.75){const t=e-1.5/2.75;return 7.5625*t*t+.75}if(e<2.5/2.75){const t=e-2.25/2.75;return 7.5625*t*t+.9375}{const t=e-2.625/2.75;return 7.5625*t*t+.984375}}function O(t){return 1-D(1-t)}function P(t){return t<.5?.5*O(2*t):.5*D(2*t-1)+.5}t.easeInSine=e,t.easeOutSine=n,t.easeInOutSine=i,t.easeInQuad=r,t.easeOutQuad=s,t.easeInOutQuad=o,t.easeInCubic=a,t.easeOutCubic=l,t.easeInOutCubic=c,t.easeInQuart=h,t.easeOutQuart=u,t.easeInOutQuart=d,t.easeInQuint=p,t.easeOutQuint=g,t.easeInOutQuint=f,t.easeInExpo=m,t.easeOutExpo=y,t.easeInOutExpo=b,t.easeInCirc=v,t.easeOutCirc=w,t.easeInOutCirc=C,t.easeInBack=x,t.easeOutBack=E,t.easeInOutBack=k,t.easeInElastic=M,t.easeOutElastic=S,t.easeInOutElastic=A,t.easeOutBounce=D,t.easeInBounce=O,t.easeInOutBounce=P}(Xx||(Xx={})),function(t){t.number=(t,e)=>{const n=e-t;return e=>t+n*e},t.object=(t,e)=>{const n=Object.keys(t);return i=>{const r={};for(let s=n.length-1;-1!==s;s-=1){const o=n[s];r[o]=t[o]+(e[o]-t[o])*i}return r}},t.unit=(t,e)=>{const n=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,i=n.exec(t),r=n.exec(e),s=r?r[1]:"",o=i?+i[1]:0,a=r?+r[1]:0,l=s.indexOf("."),c=l>0?s[1].length-l-1:0,h=a-o,u=i?i[2]:"";return t=>(o+h*t).toFixed(c)+u},t.color=(t,e)=>{const n=parseInt(t.slice(1),16),i=parseInt(e.slice(1),16),r=255&n,s=(255&i)-r,o=65280&n,a=(65280&i)-o,l=16711680&n,c=(16711680&i)-l;return t=>{const e=r+s*t&255,n=o+a*t&65280,i=l+c*t&16711680;return`#${(1<<24|e|n|i).toString(16).slice(1)}`}}}(Yx||(Yx={})),function(t){const e=`${KC.prefixCls}.storage`;function n(t,e,n){const i=e.id||qg("doc-"),r=l(t);r.keys.push(i),o(c(t,i),e),o(h(t),r),s(n,null,Object.assign(Object.assign({},e),{id:i}))}function i(t,e,n){const i=l(t),r=[];if(null==e)i.keys.forEach((e=>{const i=a(c(t,e));i?r.push(i):s(n,new Error(`No document found for an ID '${e}' from index.`))})),s(n,null,r);else if(e.id){const i=a(c(t,e.id));s(n,null,i?[i]:[])}else s(n,null,[])}function r(t,e,n){const i=l(t);if(null==e)i.keys.forEach((e=>{localStorage.removeItem(c(t,e))})),localStorage.removeItem(h(t)),s(n,null);else if(e.id){const r=i.keys.indexOf(e.id);r>=0&&i.keys.splice(r,1),localStorage.removeItem(c(t,e.id)),o(h(t),i),s(n,null)}}function s(t,e,n){t&&Qm((()=>{t(e,n)}))}function o(t,e){localStorage.setItem(t,JSON.stringify(e))}function a(t){const e=localStorage.getItem(t);return e?JSON.parse(e):null}function l(t){const e=a(h(t));return e?(null==e.keys&&(e.keys=[]),e):{keys:[]}}function c(t,n){return`${e}.${t}.docs.${n}`}function h(t){return`${e}.${t}.index`}t.insert=n,t.find=i,t.remove=r}(Jx||(Jx={}));class eE extends Ux{constructor(){super(),this.cid=Zx.uniqueId(),eE.views[this.cid]=this}get priority(){return 2}confirmUpdate(t,e){return 0}$(t){return eE.$(t)}empty(t=this.container){return this.$(t).empty(),this}unmount(t=this.container){return this.$(t).remove(),this}remove(t=this.container){return t===this.container&&(this.removeEventListeners(document),this.onRemove(),delete eE.views[this.cid]),this.unmount(t),this}onRemove(){}setClass(t,e=this.container){e.classList.value=Array.isArray(t)?t.join(" "):t}addClass(t,e=this.container){return this.$(e).addClass(Array.isArray(t)?t.join(" "):t),this}removeClass(t,e=this.container){return this.$(e).removeClass(Array.isArray(t)?t.join(" "):t),this}setStyle(t,e=this.container){return this.$(e).css(t),this}setAttrs(t,e=this.container){return null!=t&&null!=e&&(e instanceof SVGElement?_y(e,t):this.$(e).attr(t)),this}findAttr(t,e=this.container){let n=e;while(n&&1===n.nodeType){const e=n.getAttribute(t);if(null!=e)return e;if(n===this.container)return null;n=n.parentNode}return null}find(t,e=this.container,n=this.selectors){return eE.find(t,e,n).elems}findOne(t,e=this.container,n=this.selectors){const i=this.find(t,e,n);return i.length>0?i[0]:null}findByAttr(t,e=this.container){let n=e;while(n&&n.getAttribute){const e=n.getAttribute(t);if((null!=e||n===this.container)&&"false"!==e)return n;n=n.parentNode}return null}getSelector(t,e){let n;if(t===this.container)return"string"===typeof e&&(n=`> ${e}`),n;if(t){const i=Sy(t)+1;n=`${t.tagName.toLowerCase()}:nth-child(${i})`,e&&(n+=` > ${e}`),n=this.getSelector(t.parentNode,n)}return n}prefixClassName(t){return QC.prefix(t)}delegateEvents(t,e){if(null==t)return this;e||this.undelegateEvents();const n=/^(\S+)\s*(.*)$/;return Object.keys(t).forEach((e=>{const i=e.match(n);if(null==i)return;const r=this.getEventHandler(t[e]);"function"===typeof r&&this.delegateEvent(i[1],i[2],r)})),this}undelegateEvents(){return this.$(this.container).off(this.getEventNamespace()),this}delegateDocumentEvents(t,e){return this.addEventListeners(document,t,e),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(t,e,n){return this.$(this.container).on(t+this.getEventNamespace(),e,n),this}undelegateEvent(t,e,n){const i=t+this.getEventNamespace();return null==e?this.$(this.container).off(i):"string"===typeof e?this.$(this.container).off(i,e,n):this.$(this.container).off(i,e),this}addEventListeners(t,e,n){if(null==e)return this;const i=this.getEventNamespace(),r=this.$(t);return Object.keys(e).forEach((t=>{const s=this.getEventHandler(e[t]);"function"===typeof s&&r.on(t+i,n,s)})),this}removeEventListeners(t){return null!=t&&this.$(t).off(this.getEventNamespace()),this}getEventNamespace(){return`.${KC.prefixCls}-event-${this.cid}`}getEventHandler(t){let e;if("string"===typeof t){const n=this[t];"function"===typeof n&&(e=(...t)=>n.call(this,...t))}else e=(...e)=>t.call(this,...e);return e}getEventTarget(t,e={}){const{target:n,type:i,clientX:r=0,clientY:s=0}=t;return e.fromPoint||"touchmove"===i||"touchend"===i?document.elementFromPoint(r,s):n}stopPropagation(t){return this.setEventData(t,{propagationStopped:!0}),this}isPropagationStopped(t){return!0===this.getEventData(t).propagationStopped}getEventData(t){return this.eventData(t)}setEventData(t,e){return this.eventData(t,e)}eventData(t,e){if(null==t)throw new TypeError("Event object required");let n=t.data;const i=`__${this.cid}__`;return null==e?null==n?{}:n[i]||{}:(null==n&&(n=t.data={}),null==n[i]?n[i]=Object.assign({},e):n[i]=Object.assign(Object.assign({},n[i]),e),n[i])}normalizeEvent(t){return eE.normalizeEvent(t)}}(function(t){function e(t){return Q()(t)}function n(t,e){return e?xy(t||"g"):Cy(t||"div")}function i(t,n,i){if(!t||"."===t)return{elems:[n]};if(i){const e=i[t];if(e)return{elems:Array.isArray(e)?e:[e]}}return KC.useCSSSelector?{isCSSSelector:!0,elems:e(n).find(t).toArray()}:{elems:[]}}function r(t){let e=t;const n=t.originalEvent,i=n&&n.changedTouches&&n.changedTouches[0];if(i){for(const e in t)void 0===i[e]&&(i[e]=t[e]);e=i}const r=e.target;if(r){const t=r.correspondingUseElement;t&&(e.target=t)}return e}t.$=e,t.createElement=n,t.find=i,t.normalizeEvent=r})(eE||(eE={})),function(t){function e(e){return t.views[e]||null}t.views={},t.getView=e}(eE||(eE={})),function(t){let e=0;function n(){const t=`v${e}`;return e+=1,t}t.uniqueId=n}(Zx||(Zx={}));const nE=t=>t;function iE(t,e){return 0===e?"0%":`${Math.round(t/e*100)}%`}function rE(t){const e=(e,n,i,r)=>n.isEdgeElement(i)?oE(t,e,n,i,r):sE(t,e,n,i,r);return e}function sE(t,e,n,i,r){const s=n.cell,o=s.getAngle(),a=n.getUnrotatedBBoxOfElement(i),l=s.getBBox().getCenter(),c=ub.create(r).rotate(o,l);let h=c.x-a.x,u=c.y-a.y;return t&&(h=iE(h,a.width),u=iE(u,a.height)),e.anchor={name:"topLeft",args:{dx:h,dy:u,rotate:!0}},e}function oE(t,e,n,i,r){const s=n.getConnection();if(!s)return e;const o=s.closestPointLength(r);if(t){const t=s.length();e.anchor={name:"ratio",args:{ratio:o/t}}}else e.anchor={name:"length",args:{length:o}};return e}const aE=rE(!0),lE=rE(!1);var cE,hE;(function(t){t.presets=u,t.registry=Yv.create({type:"connection strategy"}),t.registry.register(t.presets,!0)})(cE||(cE={}));class uE{constructor(t){this.view=t,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new Qx,this.pathCache={}}get(t){const e=this.elemCache;return e.has(t)||this.elemCache.set(t,{}),this.elemCache.get(t)}getData(t){const e=this.get(t);return e.data||(e.data={}),e.data}getMatrix(t){const e=this.get(t);if(null==e.matrix){const n=this.view.rotatableNode||this.view.container;e.matrix=Dv(t,n)}return dv(e.matrix)}getShape(t){const e=this.get(t);return null==e.shape&&(e.shape=Pv(t)),e.shape.clone()}getBoundingRect(t){const e=this.get(t);return null==e.boundingRect&&(e.boundingRect=Av(t)),e.boundingRect.clone()}}(function(t){function e(t){return null!=t&&!n(t)}function n(t){return null!=t&&"string"===typeof t}function i(t){return null==t||n(t)?t:ad(t)}function r(t){return`${t}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}function s(t){const e=document.createDocumentFragment(),n={},i={},s=r(t),o=Pm(s,{raw:!0});return o.forEach((t=>{e.appendChild(t)})),{fragment:e,selectors:i,groups:n}}function o(t,e={ns:by.svg}){const n=document.createDocumentFragment(),i={},r={},s=[{markup:Array.isArray(t)?t:[t],parent:n,ns:e.ns}];while(s.length>0){const t=s.pop();let e=t.ns||by.svg;const n=t.markup,o=t.parent;n.forEach((t=>{const n=t.tagName;if(!n)throw new TypeError("Invalid tagName");t.ns&&(e=t.ns);const a=e===by.svg,l=e?Cy(n,e):wy(n),c=t.attrs;c&&(a?_y(l,Hy(c)):Q()(l).attr(c));const h=t.style;h&&Q()(l).css(h);const u=t.className;null!=u&&l.setAttribute("class",Array.isArray(u)?u.join(" "):u),t.textContent&&(l.textContent=t.textContent);const d=t.selector;if(null!=d){if(r[d])throw new TypeError("Selector must be unique");r[d]=l}if(t.groupSelector){let e=t.groupSelector;Array.isArray(e)||(e=[e]),e.forEach((t=>{i[t]||(i[t]=[]),i[t].push(l)}))}o.appendChild(l);const p=t.children;Array.isArray(p)&&s.push({ns:e,markup:p,parent:l})}))}return Object.keys(i).forEach((t=>{if(r[t])throw new Error("Ambiguous group selector");r[t]=i[t]})),{fragment:n,selectors:r,groups:i}}function a(t){return t instanceof SVGElement?xy("g"):wy("div")}function l(t){if(n(t)){const e=Rb.createVectors(t),n=e.length;if(1===n)return{elem:e[0].node};if(n>1){const t=a(e[0].node);return e.forEach((e=>{t.appendChild(e.node)})),{elem:t}}return{}}const e=o(t),i=e.fragment;let r=null;return i.childNodes.length>1?(r=a(i.firstChild),r.appendChild(i)):r=i.firstChild,{elem:r,selectors:e.selectors}}function c(t){const e=Rb.createVectors(t),n=document.createDocumentFragment();for(let i=0,r=e.length;i<r;i+=1){const t=e[i].node;n.appendChild(t)}return{fragment:n,selectors:{}}}t.isJSONMarkup=e,t.isStringMarkup=n,t.clone=i,t.sanitize=r,t.parseStringMarkup=s,t.parseJSONMarkup=o,t.renderMarkup=l,t.parseLabelStringMarkup=c})(hE||(hE={})),function(t){function e(t,n,i){if(null!=t){let r;const s=t.tagName.toLowerCase();if(t===n)return r="string"===typeof i?`> ${s} > ${i}`:`> ${s}`,r;const o=t.parentNode;if(o&&o.childNodes.length>1){const e=Sy(t)+1;r=`${s}:nth-child(${e})`}else r=s;return i&&(r+=` > ${i}`),e(t.parentNode,n,r)}return i}function n(t,n,i){if("#text"===t.nodeName)return null;let r=null,s=null,o=null,a=!1;const l={tagName:t.tagName};if(t.attributes){o={};for(let e=0,n=t.attributes.length;e<n;e+=1){const n=t.attributes[e],i=n.nodeName,a=n.nodeValue;"selector"===i?r=a:"groupSelector"===i?s=a:"class"===i?l.attrs={class:a}:o[i]=a}}return null==r&&(a=!0,r=e(t,n)),t.namespaceURI&&(l.ns=t.namespaceURI),null==l.ns&&(["body","div","section","main","nav","footer","span","p","h1","h2","h3","h4","h5","h6","ul","ol","dl","center","strong","pre","form","select","textarea","fieldset","marquee","bgsound","iframe","frameset"].includes(t.tagName)?l.ns=by.xhtml:i&&(l.ns=i)),r&&(l.selector=r),null!=s&&(l.groupSelector=s),{markup:l,attrs:o,isCSSSelector:a}}function i(e){const i=t.sanitize(e),r=ky(i,{mimeType:"image/svg+xml"}),s=Array.prototype.slice.call(r.childNodes),o={},a=new WeakMap,l=(t,e,i)=>{const r=n(t,e,i);if(null!=r){const{markup:n,attrs:i,isCSSSelector:s}=r;if(a.set(t,n),n.selector&&null!=i&&(Object.keys(i).length&&(o[n.selector]=i),s&&delete n.selector),t.childNodes&&t.childNodes.length>0)for(let r=0,o=t.childNodes.length;r<o;r+=1){const i=t.childNodes[r],s=l(i,e,n.ns);s&&(null==n.children&&(n.children=[]),n.children.push(s))}return n}{const e=a.get(t.parentNode);e&&t.textContent&&(e.textContent=t.textContent)}},c=s.map((t=>l(t,t))).filter((t=>null!=t));return{markup:c,attrs:o}}t.getSelector=e,t.xml2json=i}(hE||(hE={})),function(t){function e(){return"g"}function n(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}function i(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}t.getPortContainerMarkup=e,t.getPortMarkup=n,t.getPortLabelMarkup=i}(hE||(hE={})),function(t){function e(){return t.sanitize('\n <path class="connection" stroke="black" d="M 0 0 0 0"/>\n <path class="source-marker" fill="black" stroke="black" d="M 0 0 0 0"/>\n <path class="target-marker" fill="black" stroke="black" d="M 0 0 0 0"/>\n <path class="connection-wrap" d="M 0 0 0 0"/>\n <g class="labels"/>\n <g class="vertices"/>\n <g class="arrowheads"/>\n <g class="tools"/>\n ')}function n(){return t.sanitize('\n <g class="edge-tool">\n <g class="tool-remove" event="edge:remove">\n <circle r="11" />\n <path transform="scale(.8) translate(-16, -16)" d="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z" />\n <title>Remove edge.</title>\n </g>\n <g class="tool-options" event="edge:options">\n <circle r="11" transform="translate(25)"/>\n <path fill="white" transform="scale(.55) translate(29, -16)" d="M31.229,17.736c0.064-0.571,0.104-1.148,0.104-1.736s-0.04-1.166-0.104-1.737l-4.377-1.557c-0.218-0.716-0.504-1.401-0.851-2.05l1.993-4.192c-0.725-0.91-1.549-1.734-2.458-2.459l-4.193,1.994c-0.647-0.347-1.334-0.632-2.049-0.849l-1.558-4.378C17.165,0.708,16.588,0.667,16,0.667s-1.166,0.041-1.737,0.105L12.707,5.15c-0.716,0.217-1.401,0.502-2.05,0.849L6.464,4.005C5.554,4.73,4.73,5.554,4.005,6.464l1.994,4.192c-0.347,0.648-0.632,1.334-0.849,2.05l-4.378,1.557C0.708,14.834,0.667,15.412,0.667,16s0.041,1.165,0.105,1.736l4.378,1.558c0.217,0.715,0.502,1.401,0.849,2.049l-1.994,4.193c0.725,0.909,1.549,1.733,2.459,2.458l4.192-1.993c0.648,0.347,1.334,0.633,2.05,0.851l1.557,4.377c0.571,0.064,1.148,0.104,1.737,0.104c0.588,0,1.165-0.04,1.736-0.104l1.558-4.377c0.715-0.218,1.399-0.504,2.049-0.851l4.193,1.993c0.909-0.725,1.733-1.549,2.458-2.458l-1.993-4.193c0.347-0.647,0.633-1.334,0.851-2.049L31.229,17.736zM16,20.871c-2.69,0-4.872-2.182-4.872-4.871c0-2.69,2.182-4.872,4.872-4.872c2.689,0,4.871,2.182,4.871,4.872C20.871,18.689,18.689,20.871,16,20.871z"/>\n <title>Edge options.</title>\n </g>\n </g>\n ')}function i(){return t.sanitize('\n <g class="vertex-group" transform="translate(<%= x %>, <%= y %>)">\n <circle class="vertex" data-index="<%= index %>" r="10" />\n <path class="vertex-remove-area" data-index="<%= index %>" d="M16,5.333c-7.732,0-14,4.701-14,10.5c0,1.982,0.741,3.833,2.016,5.414L2,25.667l5.613-1.441c2.339,1.317,5.237,2.107,8.387,2.107c7.732,0,14-4.701,14-10.5C30,10.034,23.732,5.333,16,5.333z" transform="translate(5, -33)"/>\n <path class="vertex-remove" data-index="<%= index %>" transform="scale(.8) translate(9.5, -37)" d="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z">\n <title>Remove vertex.</title>\n </path>\n </g>\n ')}function r(){return t.sanitize('\n <g class="arrowhead-group arrowhead-group-<%= end %>">\n <path class="arrowhead" data-terminal="<%= end %>" d="M 26 0 L 0 13 L 26 26 z" />\n </g>\n ')}t.getEdgeMarkup=e,t.getEdgeToolMarkup=n,t.getEdgeVertexMarkup=i,t.getEdgeArrowheadMarkup=r}(hE||(hE={})),function(t){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:by.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:by.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}t.getForeignObjectMarkup=e}(hE||(hE={}));class dE{constructor(t){this.view=t}get cell(){return this.view.cell}getDefinition(t){return this.cell.getAttrDefinition(t)}processAttrs(t,e){let n,i,r,s,o;const a=[];return Object.keys(e).forEach((i=>{const r=e[i],s=this.getDefinition(i),o=ey(AC.isValidDefinition,this.view,s,r,{elem:t,attrs:e,cell:this.cell,view:this.view});if(s&&o)"string"===typeof s?(null==n&&(n={}),n[s]=r):null!==r&&a.push({name:i,definition:s});else{null==n&&(n={});const t=dE.CASE_SENSITIVE_ATTR.includes(i)?i:Sm(i);n[t]=r}})),a.forEach((({name:n,definition:a})=>{const l=e[n],c=a;"function"===typeof c.set&&(!Ry(t)&&dE.DELAY_ATTRS.includes(n)?(null==o&&(o={}),o[n]=l):(null==i&&(i={}),i[n]=l));const h=a;"function"===typeof h.offset&&(null==r&&(r={}),r[n]=l);const u=a;"function"===typeof u.position&&(null==s&&(s={}),s[n]=l)})),{raw:e,normal:n,set:i,offset:r,position:s,delay:o}}mergeProcessedAttrs(t,e){t.set=Object.assign(Object.assign({},t.set),e.set),t.position=Object.assign(Object.assign({},t.position),e.position),t.offset=Object.assign(Object.assign({},t.offset),e.offset);const n=t.normal&&t.normal.transform;null!=n&&e.normal&&(e.normal.transform=n),t.normal=e.normal}findAttrs(t,e,n,i){const r=[],s=new Qx;return Object.keys(t).forEach((o=>{const a=t[o];if(!qc(a))return;const{isCSSSelector:l,elems:c}=eE.find(o,e,i);n[o]=c;for(let t=0,e=c.length;t<e;t+=1){const n=c[t],h=i&&i[o]===n,u=s.get(n);if(u){u.array||(r.push(n),u.array=!0,u.attrs=[u.attrs],u.priority=[u.priority]);const t=u.attrs,i=u.priority;if(h)t.unshift(a),i.unshift(-1);else{const n=Xi(i,l?-1:e);t.splice(n,0,a),i.splice(n,0,e)}}else s.set(n,{elem:n,attrs:a,priority:h?-1:e,array:!1})}})),r.forEach((t=>{const e=s.get(t),n=e.attrs;e.attrs=n.reduceRight(((t,e)=>ah(t,e)),{})})),s}updateRelativeAttrs(t,e,n,i){const r=e.raw||{};let s=e.normal||{};const o=e.set,a=e.position,l=e.offset,c=e.delay,h=()=>({elem:t,cell:this.cell,view:this.view,attrs:r,refBBox:n.clone()});if(null!=o&&Object.keys(o).forEach((t=>{const e=o[t],n=this.getDefinition(t);if(null!=n){const i=ey(n.set,this.view,e,h());"object"===typeof i?s=Object.assign(Object.assign({},s),i):null!=i&&(s[t]=i)}})),Ry(t))return void this.view.setAttrs(s,t);const u=s.transform,d=u?`${u}`:null,p=gv(d),g=new ub(p.e,p.f);u&&(delete s.transform,p.e=0,p.f=0);let f=1,m=1;if(a||l){const e=this.view.getScaleOfElement(t,i.scalableNode);f=e.sx,m=e.sy}let y=!1;null!=a&&Object.keys(a).forEach((t=>{const e=a[t],n=this.getDefinition(t);if(null!=n){const t=ey(n.position,this.view,e,h());null!=t&&(y=!0,g.translate(ub.create(t).scale(f,m)))}})),this.view.setAttrs(s,t);let b=!1;if(null!=l){const e=this.view.getBoundingRectOfElement(t);if(e.width>0&&e.height>0){const n=kv(e,p).scale(1/f,1/m);Object.keys(l).forEach((e=>{const i=l[e],s=this.getDefinition(e);if(null!=s){const e=ey(s.offset,this.view,i,{elem:t,cell:this.cell,view:this.view,attrs:r,refBBox:n});null!=e&&(b=!0,g.translate(ub.create(e).scale(f,m)))}}))}}(null!=u||y||b)&&(g.round(1),p.e=g.x,p.f=g.y,t.setAttribute("transform",fv(p)));const v=()=>{null!=c&&Object.keys(c).forEach((e=>{const n=c[e],i=this.getDefinition(e);if(null!=i){const r=ey(i.set,this.view,n,h());"object"===typeof r?this.view.setAttrs(r,t):null!=r&&this.view.setAttrs({[e]:r},t)}}))};i.forceSync?v():Xv.scheduleTask(v)}update(t,e,n){const i={},r=this.findAttrs(n.attrs||e,t,i,n.selectors),s=n.attrs?this.findAttrs(e,t,i,n.selectors):r,o=[];r.each((e=>{const r=e.elem,a=e.attrs,l=this.processAttrs(r,a);if(null==l.set&&null==l.position&&null==l.offset&&null==l.delay)this.view.setAttrs(l.normal,r);else{const e=s.get(r),c=e?e.attrs:null,h=c&&null==a.ref?c.ref:a.ref;let u;if(h){if(u=(i[h]||this.view.find(h,t,n.selectors))[0],!u)throw new Error(`"${h}" reference does not exist.`)}else u=null;const d={node:r,refNode:u,attributes:c,processedAttributes:l},p=o.findIndex((t=>t.refNode===r));p>-1?o.splice(p,0,d):o.push(d)}}));const a=new Qx;let l;o.forEach((e=>{const i=e.node,r=e.refNode;let s;const c=null!=r&&null!=n.rotatableNode&&Py(n.rotatableNode,r);if(r&&(s=a.get(r)),!s){const e=c?n.rotatableNode:t;s=r?Av(r,{target:e}):n.rootBBox,r&&a.set(r,s)}let h;n.attrs&&e.attributes?(h=this.processAttrs(i,e.attributes),this.mergeProcessedAttrs(h,e.processedAttributes)):h=e.processedAttributes;let u=s;c&&null!=n.rotatableNode&&!n.rotatableNode.contains(i)&&(l||(l=gv(_y(n.rotatableNode,"transform"))),u=kv(s,l));const d=o.find((t=>t.refNode===i));d&&(n.forceSync=!0),this.updateRelativeAttrs(i,h,u,n)}))}}(function(t){t.CASE_SENSITIVE_ATTR=["viewBox"],t.DELAY_ATTRS=["text","textWrap","sourceMarker","targetMarker"]})(dE||(dE={}));class pE{constructor(t,e,n=[]){this.view=t;const i={},r={};let s=0;Object.keys(e).forEach((t=>{let n=e[t];Array.isArray(n)||(n=[n]),n.forEach((e=>{let n=i[e];n||(s+=1,n=i[e]=1<<s),r[t]|=n}))}));let o=n;if(Array.isArray(o)||(o=[o]),o.forEach((t=>{i[t]||(s+=1,i[t]=1<<s)})),s>25)throw new Error("Maximum number of flags exceeded.");this.flags=i,this.attrs=r,this.bootstrap=n}get cell(){return this.view.cell}getFlag(t){const e=this.flags;return null==e?0:Array.isArray(t)?t.reduce(((t,n)=>t|e[n]),0):0|e[t]}hasAction(t,e){return t&this.getFlag(e)}removeAction(t,e){return t^t&this.getFlag(e)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let t=0;return this.attrs?(Object.keys(this.attrs).forEach((e=>{this.cell.hasChanged(e)&&(t|=this.attrs[e])})),t):t}}var gE=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class fE extends eE{constructor(t,e={}){super(),this.cell=t,this.options=this.ensureOptions(e),this.graph=this.options.graph,this.attr=new dE(this),this.flag=new pE(this,this.options.actions,this.options.bootstrap),this.cache=new uE(this),this.setContainer(this.ensureContainer()),this.setup(),this.$(this.container).data("view",this),this.init()}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){const e=(t,e)=>null!=e?Hn([...Array.isArray(t)?t:[t],...Array.isArray(e)?e:[e]]):Array.isArray(t)?[...t]:[t],n=ad(this.getDefaults()),{bootstrap:i,actions:r,events:s,documentEvents:o}=t,a=gE(t,["bootstrap","actions","events","documentEvents"]);return i&&(n.bootstrap=e(n.bootstrap,i)),r&&Object.keys(r).forEach((t=>{const i=r[t],s=n.actions[t];i&&s?n.actions[t]=e(s,i):i&&(n.actions[t]=e(i))})),s&&(n.events=Object.assign(Object.assign({},n.events),s)),t.documentEvents&&(n.documentEvents=Object.assign(Object.assign({},n.documentEvents),o)),ah(n,a)}get[Symbol.toStringTag](){return fE.toStringTag}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(t){return this.getConstructor().getOptions(t)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return eE.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(t){if(this.container!==t){this.undelegateEvents(),this.container=t,null!=this.options.events&&this.delegateEvents(this.options.events);const e=this.getContainerAttrs();null!=e&&this.setAttrs(e,t);const n=this.getContainerStyle();null!=n&&this.setStyle(n,t);const i=this.getContainerClassName();null!=i&&this.addClass(i,t)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(t,e={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(t){return this.flag.getFlag(t)}hasAction(t,e){return this.flag.hasAction(t,e)}removeAction(t,e){return this.flag.removeAction(t,e)}handleAction(t,e,n,i){if(this.hasAction(t,e)){n();const r=[e];return i&&("string"===typeof i?r.push(i):r.push(...i)),this.removeAction(t,r)}return t}setup(){this.cell.on("changed",(({options:t})=>this.onAttrsChange(t)))}onAttrsChange(t){let e=this.flag.getChangedFlag();!t.updated&&e&&(t.dirty&&this.hasAction(e,"update")&&(e|=this.getFlag("render")),t.toolId&&(t.async=!1),null!=this.graph&&this.graph.renderer.requestViewUpdate(this,e,this.priority,t))}parseJSONMarkup(t,e){const n=hE.parseJSONMarkup(t),i=n.selectors,r=this.rootSelector;if(e&&r){if(i[r])throw new Error("Invalid root selector");i[r]=e}return n}can(t){let e=this.graph.options.interacting;if("function"===typeof e&&(e=ey(e,this.graph,this)),"object"===typeof e){let n=e[t];return"function"===typeof n&&(n=ey(n,this.graph,this)),!1!==n}return"boolean"===typeof e&&e}cleanCache(){return this.cache.clean(),this}getCache(t){return this.cache.get(t)}getDataOfElement(t){return this.cache.getData(t)}getMatrixOfElement(t){return this.cache.getMatrix(t)}getShapeOfElement(t){return this.cache.getShape(t)}getScaleOfElement(t,e){let n,i;if(e&&e.contains(t)){const t=$v(e);n=1/t.sx,i=1/t.sy}else n=1,i=1;return{sx:n,sy:i}}getBoundingRectOfElement(t){return this.cache.getBoundingRect(t)}getBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),i=this.getRootRotatedMatrix(),r=this.getRootTranslatedMatrix();return kv(e,r.multiply(i).multiply(n))}getUnrotatedBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),i=this.getRootTranslatedMatrix();return kv(e,i.multiply(n))}getBBox(t={}){let e;if(t.useCellGeometry){const t=this.cell,n=t.isNode()?t.getAngle():0;e=t.getBBox().bbox(n)}else e=this.getBBoxOfElement(this.container);return this.graph.localToGraph(e)}getRootTranslatedMatrix(){const t=this.cell,e=t.isNode()?t.getPosition():{x:0,y:0};return dv().translate(e.x,e.y)}getRootRotatedMatrix(){let t=dv();const e=this.cell,n=e.isNode()?e.getAngle():0;if(n){const i=e.getBBox(),r=i.width/2,s=i.height/2;t=t.translate(r,s).rotate(n).translate(-r,-s)}return t}findMagnet(t=this.container){return this.findByAttr("magnet",t)}updateAttrs(t,e,n={}){null==n.rootBBox&&(n.rootBBox=new db),null==n.selectors&&(n.selectors=this.selectors),this.attr.update(t,e,n)}isEdgeElement(t){return this.cell.isEdge()&&(null==t||t===this.container)}prepareHighlight(t,e={}){const n=t&&this.$(t)[0]||this.container;return e.partial=n===this.container,n}highlight(t,e={}){const n=this.prepareHighlight(t,e);return this.notify("cell:highlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}),this}unhighlight(t,e={}){const n=this.prepareHighlight(t,e);return this.notify("cell:unhighlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(t,e){}getEdgeTerminal(t,e,n,i,r){const s=this.cell,o=this.findAttr("port",t),a=t.getAttribute("data-selector"),l={cell:s.id};return null!=a&&(l.magnet=a),null!=o?(l.port=o,s.isNode()&&(s.hasPort(o)||null!=a||(l.selector=this.getSelector(t)))):null==a&&this.container!==t&&(l.selector=this.getSelector(t)),this.customizeEdgeTerminal(l,t,e,n,i,r)}customizeEdgeTerminal(t,e,n,i,r,s){const o=r.getStrategy()||this.graph.options.connecting.strategy;if(o){const a="string"===typeof o?o:o.name,l="string"===typeof o?{}:o.args||{},c=cE.registry;if(a){const o=c.get(a);if(null==o)return c.onNotFound(a);const h=ey(o,this.graph,t,this,e,new ub(n,i),r,s,l);if(h)return h}}return t}getMagnetFromEdgeTerminal(t){const e=this.cell,n=this.container,i=t.port;let r,s=t.magnet;return null!=i&&e.isNode()&&e.hasPort(i)?r=this.findPortElem(i,s)||n:(s||(s=t.selector),s||null==i||(s=`[port="${i}"]`),r=this.findOne(s,n,this.selectors)),r}animate(t,e){const n="string"===typeof t?this.findOne(t):t;if(null==n)throw new Error("Invalid animation element.");const i=n.parentNode,r=()=>{i||Ty(n)},s=Rb.create(n);i||s.appendTo(this.graph.view.stage);const o=e.complete;return e.complete=t=>{r(),o&&o(t)},s.animate(e)}animateTransform(t,e){const n="string"===typeof t?this.findOne(t):t;if(null==n)throw new Error("Invalid animation element.");const i=n.parentNode,r=()=>{i||Ty(n)},s=Rb.create(n);i||s.appendTo(this.graph.view.stage);const o=e.complete;return e.complete=t=>{r(),o&&o(t)},s.animateTransform(e)}hasTools(t){const e=this.tools;return null!=e&&(null==t||e.name===t)}addTools(t){if(!this.can("toolsAddable"))return this;if(this.removeTools(),t){const e=mE.isToolsView(t)?t:new mE(t);this.tools=e,this.graph.on("tools:hide",this.hideTools,this),this.graph.on("tools:show",this.showTools,this),this.graph.on("tools:remove",this.removeTools,this),e.config({view:this}),e.mount()}return this}updateTools(t={}){return this.tools&&this.tools.update(t),this}removeTools(){return this.tools&&(this.tools.remove(),this.graph.off("tools:hide",this.hideTools,this),this.graph.off("tools:show",this.showTools,this),this.graph.off("tools:remove",this.removeTools,this),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}notify(t,e){return this.trigger(t,e),this.graph.trigger(t,e),this}getEventArgs(t,e,n){const i=this,r=i.cell;return null==e||null==n?{e:t,view:i,cell:r}:{e:t,x:e,y:n,view:i,cell:r}}onClick(t,e,n){this.notify("cell:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){this.notify("cell:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){this.notify("cell:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(t,e,n))}onMouseUp(t,e,n){this.notify("cell:mouseup",this.getEventArgs(t,e,n)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(t,e,n){this.notify("cell:mousemove",this.getEventArgs(t,e,n))}onMouseOver(t){this.notify("cell:mouseover",this.getEventArgs(t))}onMouseOut(t){this.notify("cell:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.notify("cell:mouseenter",this.getEventArgs(t))}onMouseLeave(t){this.notify("cell:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,i){this.notify("cell:mousewheel",Object.assign({delta:i},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,i){this.notify("cell:customevent",Object.assign({name:e},this.getEventArgs(t,n,i))),this.notify(e,Object.assign({},this.getEventArgs(t,n,i)))}onMagnetMouseDown(t,e,n,i){}onMagnetDblClick(t,e,n,i){}onMagnetContextMenu(t,e,n,i){}onLabelMouseDown(t,e,n){}checkMouseleave(t){const e=this.graph;e.renderer.isAsync()&&e.renderer.dumpView(this);const n=this.getEventTarget(t,{fromPoint:!0}),i=e.renderer.findViewByElem(n);i!==this&&(this.onMouseLeave(t),i&&i.onMouseEnter(t))}}fE.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},function(t){t.Flag=pE,t.Attr=dE}(fE||(fE={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNodeView&&"function"===typeof i.isEdgeView&&"function"===typeof i.confirmUpdate}t.toStringTag=`X6.${t.name}`,t.isCellView=e}(fE||(fE={})),function(t){function e(t){return function(e){e.config({priority:t})}}function n(t){return function(e){e.config({bootstrap:t})}}t.priority=e,t.bootstrap=n}(fE||(fE={})),function(t){t.registry=Yv.create({type:"view"})}(fE||(fE={}));class mE extends eE{constructor(t={}){super(),this.svgContainer=this.createContainer(!0,t),this.htmlContainer=this.createContainer(!1,t),this.config(t)}get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return mE.toStringTag}createContainer(t,e){const n=t?eE.createElement("g",!0):eE.createElement("div",!1);return uy(n,this.prefixClassName("cell-tools")),e.className&&uy(n,e.className),n}config(t){if(this.options=Object.assign(Object.assign({},this.options),t),!fE.isCellView(t.view)||t.view===this.cellView)return this;this.cellView=t.view,this.cell.isEdge()?(uy(this.svgContainer,this.prefixClassName("edge-tools")),uy(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(uy(this.svgContainer,this.prefixClassName("node-tools")),uy(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const e=this.options.items;if(!Array.isArray(e))return this;this.tools=[];const n=[];e.forEach((t=>{if(mE.ToolItem.isToolItem(t))"vertices"===t.name?n.unshift(t):n.push(t);else{const e="object"===typeof t?t.name:t;"vertices"===e?n.unshift(t):n.push(t)}}));for(let i=0;i<n.length;i+=1){const t=n[i];let e;if(mE.ToolItem.isToolItem(t))e=t;else{const n="object"===typeof t?t.name:t,i="object"===typeof t&&t.args||{};if(n)if(this.cell.isNode()){const t=NE.registry.get(n);if(!t)return NE.registry.onNotFound(n);e=new t(i)}else if(this.cell.isEdge()){const t=jE.registry.get(n);if(!t)return jE.registry.onNotFound(n);e=new t(i)}}if(e){e.config(this.cellView,this),e.render();const t=!1!==e.options.isSVGElement?this.svgContainer:this.htmlContainer;t.appendChild(e.container),this.tools.push(e)}}return this}update(t={}){const e=this.tools;return e&&e.forEach((e=>{t.toolId!==e.cid&&e.isVisible()&&e.update()})),this}focus(t){const e=this.tools;return e&&e.forEach((e=>{t===e?e.show():e.hide()})),this}blur(t){const e=this.tools;return e&&e.forEach((e=>{e===t||e.isVisible()||(e.show(),e.update())})),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const t=this.tools;return t&&(t.forEach((t=>t.remove())),this.tools=null),Ty(this.svgContainer),Ty(this.htmlContainer),super.remove()}mount(){const t=this.tools,e=this.cellView;if(e&&t){const n=t.some((t=>!1!==t.options.isSVGElement)),i=t.some((t=>!1===t.options.isSVGElement));if(n){const t=this.options.local?e.container:e.graph.view.decorator;t.appendChild(this.svgContainer)}i&&this.graph.container.appendChild(this.htmlContainer)}return this}}function yE(t,e,n,i){const r=ey(cE.presets.pinRelative,this.graph,{},e,n,t,this.cell,i,{});return r.anchor}function bE(t,e){return e?t.cell.getBBox():t.cell.isEdge()?t.getConnection().bbox():t.getUnrotatedBBoxOfElement(t.container)}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&null!=i.graph&&null!=i.cell&&"function"===typeof i.config&&"function"===typeof i.update&&"function"===typeof i.focus&&"function"===typeof i.blur&&"function"===typeof i.show&&"function"===typeof i.hide}t.toStringTag=`X6.${t.name}`,t.isToolsView=e})(mE||(mE={})),function(t){class e extends eE{constructor(t={}){super(),this.options=this.getOptions(t),this.container=eE.createElement(this.options.tagName||"g",!1!==this.options.isSVGElement),uy(this.container,this.prefixClassName("cell-tool")),"string"===typeof this.options.className&&uy(this.container,this.options.className),this.init()}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){return ah(ad(this.getDefaults()),t)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return e.toStringTag}init(){}getOptions(t){const e=this.constructor;return e.getOptions(t)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(t,e){return this.cellView=t,this.parent=e,this.stamp(this.container),this.cell.isEdge()?uy(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&uy(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const t=this.options.markup;if(t){const e=hE.isStringMarkup(t)?hE.parseStringMarkup(t):hE.parseJSONMarkup(t);this.container.appendChild(e.fragment),this.childNodes=e.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(t=this.container){t&&t.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return this.visible}focus(){const t=this.options.focusOpacity;return null!=t&&Number.isFinite(t)&&(this.container.style.opacity=`${t}`),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(t){return null==this.graph||null==this.cellView||this.graph.view.guard(t,this.cellView)}}e.defaults={isSVGElement:!0,tagName:"g"},t.ToolItem=e,function(t){let e=0;function n(t){return t?Am(t):(e+=1,`CustomTool${e}`)}function i(t){const e=Ed(n(t.name),this);return e.config(t),e}t.define=i}(e=t.ToolItem||(t.ToolItem={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&null!=i.graph&&null!=i.cell&&"function"===typeof i.config&&"function"===typeof i.update&&"function"===typeof i.focus&&"function"===typeof i.blur&&"function"===typeof i.show&&"function"===typeof i.hide&&"function"===typeof i.isVisible}t.toStringTag=`X6.${t.name}`,t.isToolItem=e}(e=t.ToolItem||(t.ToolItem={}))}(mE||(mE={}));class vE extends mE.ToolItem{onRender(){uy(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView,e=t.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();Rv(this.container,e,{absolute:!0})}getNodeMatrix(){const t=this.cellView,e=this.options;let{x:n=0,y:i=0}=e;const{offset:r,useCellGeometry:s,rotate:o}=e;let a=bE(t,s);const l=t.cell.getAngle();o||(a=a.bbox(l));let c=0,h=0;"number"===typeof r?(c=r,h=r):"object"===typeof r&&(c=r.x,h=r.y),n=Im(n,a.width),i=Im(i,a.height);let u=dv().translate(a.x+a.width/2,a.y+a.height/2);return o&&(u=u.rotate(l)),u=u.translate(n+c-a.width/2,i+h-a.height/2),u}getEdgeMatrix(){const t=this.cellView,e=this.options,{offset:n=0,distance:i=0,rotate:r}=e;let s,o,a;s=Bm(i)?t.getTangentAtRatio(parseFloat(i)/100):t.getTangentAtLength(i),s?(o=s.start,a=s.vector().vectorAngle(new ub(1,0))||0):(o=t.getConnection().start,a=0);let l=dv().translate(o.x,o.y).rotate(a);return l="object"===typeof n?l.translate(n.x||0,n.y||0):l.translate(0,n),r||(l=l.rotate(-a)),l}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.options.onClick;"function"===typeof e&&ey(e,this.cellView,{e:t,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(t){t.config({name:"button",events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(vE||(vE={})),function(t){t.Remove=t.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,onClick({view:t,btn:e}){e.parent.remove(),t.cell.remove({ui:!0,toolId:e.cid})}})}(vE||(vE={}));var wE=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class CE extends mE.ToolItem{onRender(){if(uy(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const t=this.options.attrs,{class:e}=t,n=wE(t,["class"]);_y(this.container,Hy(n)),e&&uy(this.container,e)}this.update()}update(){const t=this.cellView,e=this.options,{useCellGeometry:n,rotate:i}=e,r=Vm(e.padding);let s=bE(t,n).moveAndExpand({x:-r.left,y:-r.top,width:r.left+r.right,height:r.top+r.bottom});const o=t.cell;if(o.isNode()){const t=o.getAngle();if(t)if(i){const e=o.getBBox().getCenter();Iv(this.container,t,e.x,e.y,{absolute:!0})}else s=s.bbox(t)}return _y(this.container,s.toJSON()),this}}(function(t){t.config({name:"boundary",tagName:"rect",padding:10,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})})(CE||(CE={}));class xE extends mE.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){const t=this.vertices;return t.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach((t=>{this.stopHandleListening(t),t.remove()}))}renderHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const n=t[e],i=this.options.createHandle,r=this.options.processHandle,s=i({index:e,graph:this.graph,guard:t=>this.guard(t),attrs:this.options.attrs||{}});r&&r(s),this.graph.hook.onToolItemCreated({name:"vertices",cell:this.cell,view:this.cellView,tool:s}),s.updatePosition(n.x,n.y),this.stamp(s.container),this.container.appendChild(s.container),this.handles.push(s),this.startHandleListening(s)}}updateHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const n=t[e],i=this.handles[e];i&&i.updatePosition(n.x,n.y)}}updatePath(){const t=this.childNodes.connection;t&&t.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.on("remove",this.onHandleRemove,this)}stopHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.off("remove",this.onHandleRemove,this)}getNeighborPoints(t){const e=this.cellView,n=this.vertices,i=t>0?n[t-1]:e.sourceAnchor,r=t<n.length-1?n[t+1]:e.targetAnchor;return{prev:ub.create(i),next:ub.create(r)}}getMouseEventArgs(t){const e=this.normalizeEvent(t),{x:n,y:i}=this.graph.snapToGrid(e.clientX,e.clientY);return{e:e,x:n,y:i}}onHandleChange({e:t}){this.focus();const e=this.cellView;if(e.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:n,x:i,y:r}=this.getMouseEventArgs(t);e.notifyMouseDown(n,i,r)}}onHandleChanging({handle:t,e:e}){const n=this.cellView,i=t.options.index,{e:r,x:s,y:o}=this.getMouseEventArgs(e),a={x:s,y:o};this.snapVertex(a,i),n.cell.setVertexAt(i,a,{ui:!0,toolId:this.cid}),t.updatePosition(a.x,a.y),this.options.stopPropagation||n.notifyMouseMove(r,s,o)}onHandleChanged({e:t}){const e=this.options,n=this.cellView;if(e.addable&&this.updatePath(),!e.removeRedundancies)return;const i=n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});i&&this.render(),this.blur(),n.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),this.eventData(t).vertexAdded&&n.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid});const{e:r,x:s,y:o}=this.getMouseEventArgs(t);this.options.stopPropagation||n.notifyMouseUp(r,s,o),n.checkMouseleave(r),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}snapVertex(t,e){const n=this.options.snapRadius||0;if(n>0){const i=this.getNeighborPoints(e),r=i.prev,s=i.next;Math.abs(t.x-r.x)<n?t.x=r.x:Math.abs(t.x-s.x)<n&&(t.x=s.x),Math.abs(t.y-r.y)<n?t.y=i.prev.y:Math.abs(t.y-s.y)<n&&(t.y=s.y)}}onHandleRemove({handle:t,e:e}){if(this.options.removable){const n=t.options.index,i=this.cellView;i.cell.removeVertexAt(n,{ui:!0}),this.options.addable&&this.updatePath(),i.checkMouseleave(this.normalizeEvent(e))}}onPathMouseDown(t){const e=this.cellView;if(this.guard(t)||!this.options.addable||!e.can("vertexAddable"))return;t.stopPropagation(),t.preventDefault();const n=this.normalizeEvent(t),i=this.graph.snapToGrid(n.clientX,n.clientY).toJSON();e.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const r=e.getVertexIndex(i.x,i.y);this.snapVertex(i,r),e.cell.insertVertex(i,r,{ui:!0,toolId:this.cid}),this.render();const s=this.handles[r];this.eventData(n,{vertexAdded:!0}),s.onMouseDown(n)}onRemove(){this.resetHandles()}}(function(t){class e extends eE{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}get graph(){return this.options.graph}render(){this.container=eE.createElement("circle",!0);const e=this.options.attrs;if("function"===typeof e){const n=t.getDefaults();this.setAttrs(Object.assign(Object.assign({},n.attrs),e(this)))}else this.setAttrs(e);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(t,e){this.setAttrs({cx:t,cy:e})}onMouseDown(t){this.options.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data),this.emit("change",{e:t,handle:this}))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(t){this.emit("remove",{e:t,handle:this})}}t.Handle=e})(xE||(xE={})),function(t){const e=QC.prefix("edge-tool-vertex-path");t.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:e=>new t.Handle(e),markup:[{tagName:"path",selector:"connection",className:e,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{[`mousedown .${e}`]:"onPathMouseDown",[`touchstart .${e}`]:"onPathMouseDown"}})}(xE||(xE={}));class EE extends mE.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){uy(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const t=this.cellView,e=[...this.vertices];e.unshift(t.sourcePoint),e.push(t.targetPoint);for(let n=0,i=e.length;n<i-1;n+=1){const t=e[n],i=e[n+1],r=this.renderHandle(t,i,n);this.stamp(r.container),this.handles.push(r)}return this}renderHandle(t,e,n){const i=this.options.createHandle({index:n,graph:this.graph,guard:t=>this.guard(t),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(i),this.graph.hook.onToolItemCreated({name:"segments",cell:this.cell,view:this.cellView,tool:i}),this.updateHandle(i,t,e),this.container.appendChild(i.container),this.startHandleListening(i),i}startHandleListening(t){t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)}stopHandleListening(t){t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach((t=>{this.stopHandleListening(t),t.remove()}))}shiftHandleIndexes(t){const e=this.handles;for(let n=0,i=e.length;n<i;n+=1)e[n].options.index+=t}resetAnchor(t,e){const n=this.cellView.cell,i={ui:!0,toolId:this.cid};e?n.prop([t,"anchor"],e,i):n.removeProp([t,"anchor"],i)}snapHandle(t,e,n){const i=t.options.axis,r=t.options.index,s=this.cellView,o=s.cell,a=o.getVertices(),l=a[r-2]||n.sourceAnchor,c=a[r+1]||n.targetAnchor,h=this.options.snapRadius;return Math.abs(e[i]-l[i])<h?e[i]=l[i]:Math.abs(e[i]-c[i])<h&&(e[i]=c[i]),e}onHandleChanging({handle:t,e:e}){const n=this.graph,i=this.options,r=this.cellView,s=i.anchor,o=t.options.axis,a=t.options.index-1,l=this.getEventData(e),c=this.normalizeEvent(e),h=n.snapToGrid(c.clientX,c.clientY),u=this.snapHandle(t,h.clone(),l),d=ad(this.vertices);let p=d[a],g=d[a+1];const f=r.sourceView,m=r.sourceBBox;let y=!1,b=!1;if(p?0===a?m.containsPoint(p)?(d.shift(),this.shiftHandleIndexes(-1),y=!0):(p[o]=u[o],b=!0):p[o]=u[o]:(p=r.sourceAnchor.toJSON(),p[o]=u[o],m.containsPoint(p)?y=!0:(d.unshift(p),this.shiftHandleIndexes(1),b=!0)),"function"===typeof s&&f){if(y){const t=l.sourceAnchor.clone();t[o]=u[o];const e=ey(s,r,t,f,r.sourceMagnet||f.container,"source",r,this);this.resetAnchor("source",e)}b&&this.resetAnchor("source",l.sourceAnchorDef)}const v=r.targetView,w=r.targetBBox;let C=!1,x=!1;if(g?a===d.length-2?w.containsPoint(g)?(d.pop(),C=!0):(g[o]=u[o],x=!0):g[o]=u[o]:(g=r.targetAnchor.toJSON(),g[o]=u[o],w.containsPoint(g)?C=!0:(d.push(g),x=!0)),"function"===typeof s&&v){if(C){const t=l.targetAnchor.clone();t[o]=u[o];const e=ey(s,r,t,v,r.targetMagnet||v.container,"target",r,this);this.resetAnchor("target",e)}x&&this.resetAnchor("target",l.targetAnchorDef)}ub.equalPoints(d,this.vertices)||this.cellView.cell.setVertices(d,{ui:!0,toolId:this.cid}),this.updateHandle(t,p,g,0),i.stopPropagation||r.notifyMouseMove(c,h.x,h.y)}onHandleChange({handle:t,e:e}){const n=this.options,i=this.handles,r=this.cellView,s=t.options.index;if(Array.isArray(i)){for(let t=0,e=i.length;t<e;t+=1)t!==s&&i[t].hide();if(this.focus(),this.setEventData(e,{sourceAnchor:r.sourceAnchor.clone(),targetAnchor:r.targetAnchor.clone(),sourceAnchorDef:ad(this.cell.prop(["source","anchor"])),targetAnchorDef:ad(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!n.stopPropagation){const t=this.normalizeEvent(e),n=this.graph.snapToGrid(t.clientX,t.clientY);r.notifyMouseDown(t,n.x,n.y)}}}onHandleChanged({e:t}){const e=this.options,n=this.cellView;e.removeRedundancies&&n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const i=this.normalizeEvent(t),r=this.graph.snapToGrid(i.clientX,i.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),e.stopPropagation||n.notifyMouseUp(i,r.x,r.y),n.checkMouseleave(i),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}updateHandle(t,e,n,i=0){const r=this.options.precision||0,s=Math.abs(e.x-n.x)<r,o=Math.abs(e.y-n.y)<r;if(s||o){const r=new pb(e,n),o=r.length();if(o<this.options.threshold)t.hide();else{const e=r.getCenter(),n=s?"x":"y";e[n]+=i||0;const o=r.vector().vectorAngle(new ub(1,0));t.updatePosition(e.x,e.y,o,this.cellView),t.show(),t.options.axis=n}}else t.hide()}onRemove(){this.resetHandles()}}(function(t){class e extends eE{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=eE.createElement("rect",!0);const e=this.options.attrs;if("function"===typeof e){const n=t.getDefaults();this.setAttrs(Object.assign(Object.assign({},n.attrs),e(this)))}else this.setAttrs(e);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(t,e,n,i){const r=i.getClosestPoint(new ub(t,e))||new ub(t,e);let s=dv().translate(r.x,r.y);if(r.equals({x:t,y:e}))s=s.rotate(n);else{const n=new pb(t,e,r.x,r.y);let i=n.vector().vectorAngle(new ub(1,0));0!==i&&(i+=90),s=s.rotate(i)}this.setAttrs({transform:fv(s),cursor:n%180===0?"row-resize":"col-resize"})}onMouseDown(t){this.options.guard(t)||(this.trigger("change",{e:t,handle:this}),t.stopPropagation(),t.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}}t.Handle=e})(EE||(EE={})),function(t){t.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:e=>new t.Handle(e),anchor:yE})}(EE||(EE={}));class kE extends mE.ToolItem{get type(){return this.options.type}onRender(){uy(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const t=this.type,e=this.cellView,n=e.getTerminalView(t);return n?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const t=this.childNodes;if(!t)return;const e=t.anchor;if(!e)return;const n=this.type,i=this.cellView,r=this.options,s=i.getTerminalAnchor(n),o=i.cell.prop([n,"anchor"]);e.setAttribute("transform",`translate(${s.x}, ${s.y})`);const a=o?r.customAnchorAttrs:r.defaultAnchorAttrs;a&&Object.keys(a).forEach((t=>{e.setAttribute(t,a[t])}))}updateArea(){const t=this.childNodes;if(!t)return;const e=t.area;if(!e)return;const n=this.type,i=this.cellView,r=i.getTerminalView(n);if(r){const t=r.cell,s=i.getTerminalMagnet(n);let o,a,l,c=this.options.areaPadding||0;Number.isFinite(c)||(c=0),r.isEdgeElement(s)?(o=r.getBBox(),a=0,l=o.getCenter()):(o=r.getUnrotatedBBoxOfElement(s),a=t.getAngle(),l=o.getCenter(),a&&l.rotate(-a,t.getBBox().getCenter())),o.inflate(c),_y(e,{x:-o.width/2,y:-o.height/2,width:o.width,height:o.height,transform:`translate(${l.x}, ${l.y}) rotate(${a})`})}}toggleArea(t){if(this.childNodes){const e=this.childNodes.area;e&&(e.style.display=t?"":"none")}}onMouseDown(t){this.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(t){const e=this.type,n=this.cell;t?n.prop([e,"anchor"],t,{rewrite:!0,ui:!0,toolId:this.cid}):n.removeProp([e,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(t){const e=this.type,n=this.cellView,i=n.getTerminalView(e);if(null==i)return;const r=this.normalizeEvent(t),s=i.cell,o=n.getTerminalMagnet(e);let a=this.graph.clientToLocal(r.clientX,r.clientY);const l=this.options.snap;if("function"===typeof l){const t=ey(l,n,a,i,o,e,n,this);a=ub.create(t)}if(this.options.restrictArea)if(i.isEdgeElement(o)){const t=i.getClosestPoint(a);t&&(a=t)}else{const t=i.getUnrotatedBBoxOfElement(o),e=s.getAngle(),n=s.getBBox().getCenter(),r=a.clone().rotate(e,n);t.containsPoint(r)||(a=t.getNearestPointToPoint(r).rotate(-e,n))}let c;const h=this.options.anchor;"function"===typeof h&&(c=ey(h,n,a,i,o,e,n,this)),this.resetAnchor(c),this.update()}onMouseUp(t){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const e=this.cellView;this.options.removeRedundancies&&e.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const t=this.options.resetAnchor;t&&this.resetAnchor(!0===t?void 0:t),this.update()}}(function(t){t.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:yE,snap(t,e,n,i,r,s){const o=s.options.snapRadius||0,a="source"===i,l=a?0:-1,c=this.cell.getVertexAt(l)||this.getTerminalAnchor(a?"target":"source");return c&&(Math.abs(c.x-t.x)<o&&(t.x=c.x),Math.abs(c.y-t.y)<o&&(t.y=c.y)),t}})})(kE||(kE={}));const ME=kE.define({name:"source-anchor",type:"source"}),SE=kE.define({name:"target-anchor",type:"target"});var AE=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class DE extends mE.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const t=this.options.attrs,{class:e}=t,n=AE(t,["class"]);this.setAttrs(n,this.container),e&&uy(this.container,e)}}onRender(){uy(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const t=this.ratio,e=this.cellView,n=e.getTangentAtRatio(t),i=n?n.start:e.getPointAtRatio(t),r=n&&n.vector().vectorAngle(new ub(1,0))||0;if(!i)return this;const s=dv().translate(i.x,i.y).rotate(r);return Rv(this.container,s,{absolute:!0}),this}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.cellView;if(e.can("arrowheadMovable")){e.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const n=this.graph.snapToGrid(t.clientX,t.clientY),i=e.prepareArrowheadDragging(this.type,{x:n.x,y:n.y,options:{toolId:this.cid}});this.cellView.setEventData(t,i),this.delegateDocumentEvents(this.options.documentEvents,t.data),e.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(t){const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY);this.cellView.onMouseMove(e,n.x,n.y),this.update()}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.cellView,i=this.graph.snapToGrid(e.clientX,e.clientY);n.onMouseUp(e,i.x,i.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",n.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}(function(t){t.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})})(DE||(DE={}));const OE=DE.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),PE=DE.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class TE extends mE.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5}render(){return this.createElement(),this.update(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents),this}createElement(){const{cell:t}=this,e=[this.prefixClassName((t.isEdge()?"edge":"node")+"-tool-editor"),this.prefixClassName("cell-tool-editor")];this.editor=mE.createElement("div",!1),this.addClass(e,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}update(){const{graph:t,cell:e,editor:n}=this,i=n.style;let r=new ub,s=20;if(e.isNode())r=e.getBBox().center,s=e.size().width-4;else if(e.isEdge()){const e=this.options.event,n=e.target,i=n.parentElement,o=i&&hy(i,this.prefixClassName("edge-label"));if(o){const t=i.getAttribute("data-index")||"0";this.labelIndex=parseInt(t,10);const e=i.getAttribute("transform"),{translation:o}=mv(e);r=new ub(o.tx,o.ty),s=Av(n).width}else{r=t.clientToLocal(ub.create(e.clientX,e.clientY));const n=this.cellView,i=n.path.closestPointLength(r);this.distance=i}}r=t.localToGraph(r),i.left=`${r.x}px`,i.top=`${r.y}px`,i.minWidth=`${s}px`;const o=t.scale();i.transform=`scale(${o.sx}, ${o.sy}) translate(-50%, -50%)`;const a=this.options.attrs;i.fontSize=`${a.fontSize}px`,i.fontFamily=a.fontFamily,i.color=a.color,i.backgroundColor=a.backgroundColor;const l=this.options.getText;let c;return"function"===typeof l&&(c=ey(l,this.cellView,{cell:this.cell,index:this.labelIndex})),n.innerText=c||"",this}onDocumentMouseDown(t){if(t.target!==this.editor){const t=this.cell,e=this.editor.innerText.replace(/\n$/,"")||"",n=this.options.setText;""!==e&&"function"===typeof n&&ey(n,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance}),t.removeTool(t.isEdge()?"edge-editor":"node-editor"),this.undelegateDocumentEvents()}}onDblClick(t){t.stopPropagation()}onMouseDown(t){t.stopPropagation()}autoFocus(){setTimeout((()=>{this.editor.focus(),this.selectText()}))}selectText(){if(window.getSelection){const t=document.createRange(),e=window.getSelection();t.selectNodeContents(this.editor),e.removeAllRanges(),e.addRange(t)}}}(function(t){t.config({tagName:"div",isSVGElement:!1,events:{dblclick:"onDblClick",mousedown:"onMouseDown"},documentEvents:{mousedown:"onDocumentMouseDown"}})})(TE||(TE={})),function(t){t.NodeEditor=t.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText({cell:t}){return t.attr("text/text")},setText({cell:t,value:e}){t.attr("text/text",e)}}),t.EdgeEditor=t.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText({cell:t,index:e}){return-1===e?"":t.prop(`labels/${e}/attrs/label/text`)},setText({cell:t,value:e,index:n,distance:i}){const r=t;-1===n?r.appendLabel({position:{distance:i},attrs:{label:{text:e}}}):r.prop(`labels/${n}/attrs/label/text`,e)}})}(TE||(TE={}));var NE,jE,LE=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};(function(t){t.presets={boundary:CE,button:vE,"button-remove":vE.Remove,"node-editor":TE.NodeEditor},t.registry=Yv.create({type:"node tool",process(t,e){if("function"===typeof e)return e;let n=mE.ToolItem;const{inherit:i}=e,r=LE(e,["inherit"]);if(i){const t=this.get(i);null==t?this.onNotFound(i,"inherited"):n=t}return null==r.name&&(r.name=t),n.define.call(n,r)}}),t.registry.register(t.presets,!0)})(NE||(NE={})),function(t){t.presets={boundary:CE,vertices:xE,segments:EE,button:vE,"button-remove":vE.Remove,"source-anchor":ME,"target-anchor":SE,"source-arrowhead":OE,"target-arrowhead":PE,"edge-editor":TE.EdgeEditor},t.registry=Yv.create({type:"edge tool",process(t,e){if("function"===typeof e)return e;let n=mE.ToolItem;const{inherit:i}=e,r=LE(e,["inherit"]);if(i){const t=this.get(i);null==t?this.onNotFound(i,"inherited"):n=t}return null==r.name&&(r.name=t),n.define.call(n,r)}}),t.registry.register(t.presets,!0)}(jE||(jE={}));const FE=HE("center"),zE=HE("topCenter"),RE=HE("bottomCenter"),BE=HE("leftMiddle"),IE=HE("rightMiddle"),$E=HE("topLeft"),VE=HE("topRight"),_E=HE("bottomLeft"),GE=HE("bottomRight");function HE(t){return function(e,n,i,r={}){const s=r.rotate?e.getUnrotatedBBoxOfElement(n):e.getBBoxOfElement(n),o=s[t];o.x+=Im(r.dx,s.width),o.y+=Im(r.dy,s.height);const a=e.cell;return r.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function UE(t){return function(e,n,i,r){if(i instanceof Element){const s=this.graph.renderer.findViewByElem(i);let o;if(s)if(s.isEdgeElement(i)){const t=null!=r.fixedAt?r.fixedAt:"50%";o=WE(s,t)}else o=s.getBBoxOfElement(i).getCenter();else o=new ub;return t.call(this,e,n,o,r)}return t.apply(this,arguments)}}function WE(t,e){const n=Bm(e),i="string"===typeof e?parseFloat(e):e;return n?t.getPointAtRatio(i/100):t.getPointAtLength(i)}const qE=function(t,e,n,i){const r=t.cell.getAngle(),s=t.getBBoxOfElement(e),o=s.getCenter(),a=s.getTopLeft(),l=s.getBottomRight();let c=i.padding;if(Number.isFinite(c)||(c=0),a.y+c<=n.y&&n.y<=l.y-c){const t=n.y-o.y;o.x+=0===r||180===r?0:1*t/Math.tan(ib.toRad(r)),o.y+=t}else if(a.x+c<=n.x&&n.x<=l.x-c){const t=n.x-o.x;o.y+=90===r||270===r?0:t*Math.tan(ib.toRad(r)),o.x+=t}return o},XE=UE(qE),YE=function(t,e,n,i,r){const s=t.cell.getConnectionPoint(this.cell,r);return(i.dx||i.dy)&&s.translate(i.dx||0,i.dy||0),s},JE=function(t,e,n,i){let r,s,o=0;const a=t.cell;i.rotate?(r=t.getUnrotatedBBoxOfElement(e),s=a.getBBox().getCenter(),o=a.getAngle()):r=t.getBBoxOfElement(e);const l=i.padding;null!=l&&Number.isFinite(l)&&r.inflate(l),i.rotate&&n.rotate(o,s);const c=r.getNearestSideToPoint(n);let h;switch(c){case"left":h=r.getLeftMiddle();break;case"right":h=r.getRightMiddle();break;case"top":h=r.getTopCenter();break;case"bottom":h=r.getBottomCenter();break;default:break}const u=i.direction;return"H"===u?"top"!==c&&"bottom"!==c||(h=n.x<=r.x+r.width?r.getLeftMiddle():r.getRightMiddle()):"V"===u&&(h=n.y<=r.y+r.height?r.getTopCenter():r.getBottomCenter()),i.rotate?h.rotate(-o,s):h},ZE=UE(JE);var KE;(function(t){t.presets=d,t.registry=Yv.create({type:"node endpoint"}),t.registry.register(t.presets,!0)})(KE||(KE={}));const QE=function(t,e,n,i){let r=null!=i.ratio?i.ratio:.5;return r>1&&(r/=100),t.getPointAtRatio(r)},tk=function(t,e,n,i){const r=null!=i.length?i.length:20;return t.getPointAtLength(r)},ek=function(t,e,n,i){const r=t.getClosestPoint(n);return null!=r?r:new ub},nk=UE(ek),ik=function(t,e,n,i){const r=1e6,s=t.getConnection(),o=t.getConnectionSubdivisions(),a=new pb(n.clone().translate(0,r),n.clone().translate(0,-r)),l=new pb(n.clone().translate(r,0),n.clone().translate(-r,0)),c=a.intersect(s,{segmentSubdivisions:o}),h=l.intersect(s,{segmentSubdivisions:o}),u=[];return c&&u.push(...c),h&&u.push(...h),u.length>0?n.closest(u):null!=i.fallbackAt?WE(t,i.fallbackAt):ey(ek,this,t,e,n,i)},rk=UE(ik);var sk;function ok(t,e,n){let i;if("object"===typeof n){if(Number.isFinite(n.y)){const i=new pb(e,t),{start:r,end:s}=i.parallel(n.y);e=r,t=s}i=n.x}else i=n;if(null==i||!Number.isFinite(i))return t;const r=t.distance(e);return 0===i&&r>0?t:t.move(e,-Math.min(i,r-1))}function ak(t){const e=t.getAttribute("stroke-width");return null===e?0:parseFloat(e)||0}function lk(t){if(null==t)return null;let e=t;do{let t=e.tagName;if("string"!==typeof t)return null;if(t=t.toUpperCase(),"G"===t)e=e.firstElementChild;else{if("TITLE"!==t)break;e=e.nextElementSibling}}while(e);return e}(function(t){t.presets=p,t.registry=Yv.create({type:"edge endpoint"}),t.registry.register(t.presets,!0)})(sk||(sk={}));const ck=function(t,e,n,i){const r=e.getBBoxOfElement(n);i.stroked&&r.inflate(ak(n)/2);const s=t.intersect(r),o=s&&s.length?t.start.closest(s):t.end;return ok(o,t.start,i.offset)},hk=function(t,e,n,i,r){const s=e.cell,o=s.isNode()?s.getAngle():0;if(0===o)return ey(ck,this,t,e,n,i,r);const a=e.getUnrotatedBBoxOfElement(n);i.stroked&&a.inflate(ak(n)/2);const l=a.getCenter(),c=t.clone().rotate(o,l),h=c.setLength(1e6).intersect(a),u=h&&h.length?c.start.closest(h).rotate(-o,l):t.end;return ok(u,t.start,i.offset)},uk=function(t,e,n,i){let r,s;const o=t.end,a=i.selector;if(r="string"===typeof a?e.findOne(a):Array.isArray(a)?kd(n,a):lk(n),!yy(r)){if(r===n||!yy(n))return o;r=n}const l=e.getShapeOfElement(r),c=e.getMatrixOfElement(r),h=e.getRootTranslatedMatrix(),u=e.getRootRotatedMatrix(),d=h.multiply(u).multiply(c),p=d.inverse(),g=Ev(t,p),f=g.start.clone(),m=e.getDataOfElement(r);if(!1===i.insideout){null==m.shapeBBox&&(m.shapeBBox=l.bbox());const t=m.shapeBBox;if(null!=t&&t.containsPoint(f))return o}let y;if(!0===i.extrapolate&&g.setLength(1e6),zb.isPath(l)){const t=i.precision||2;null==m.segmentSubdivisions&&(m.segmentSubdivisions=l.getSegmentSubdivisions({precision:t})),y={precision:t,segmentSubdivisions:m.segmentSubdivisions},s=g.intersect(l,y)}else s=g.intersect(l);s?Array.isArray(s)&&(s=f.closest(s)):!0===i.sticky&&(s=db.isRectangle(l)?l.getNearestPointToPoint(f):gb.isEllipse(l)?l.intersectsWithLineFromCenterToPoint(f):l.closestPoint(f,y));const b=s?xv(s,d):o;let v=i.offset||0;return!1!==i.stroked&&("object"===typeof v?(v=Object.assign({},v),null==v.x&&(v.x=0),v.x+=ak(r)/2):v+=ak(r)/2),ok(b,t.start,v)};function dk(t,e,n=0){const{start:i,end:r}=t;let s,o,a,l;switch(e){case"left":l="x",s=r,o=i,a=-1;break;case"right":l="x",s=i,o=r,a=1;break;case"top":l="y",s=r,o=i,a=-1;break;case"bottom":l="y",s=i,o=r,a=1;break;default:return}i[l]<r[l]?s[l]=o[l]:o[l]=s[l],Number.isFinite(n)&&(s[l]+=a*n,o[l]+=a*n)}const pk=function(t,e,n,i){const{alignOffset:r,align:s}=i;return s&&dk(t,s,r),ok(t.end,t.start,i.offset)};var gk;(function(t){t.presets=g,t.registry=Yv.create({type:"connection point"}),t.registry.register(t.presets,!0)})(gk||(gk={}));const fk=function(t){return[...t]},mk=function(t,e,n){const i=e.side||"bottom",r=Vm(e.padding||40),s=n.sourceBBox,o=n.targetBBox,a=s.getCenter(),l=o.getCenter();let c,h,u;switch(i){case"top":u=-1,c="y",h="height";break;case"left":u=-1,c="x",h="width";break;case"right":u=1,c="x",h="width";break;case"bottom":default:u=1,c="y",h="height";break}return a[c]+=u*(s[h]/2+r[i]),l[c]+=u*(o[h]/2+r[i]),u*(a[c]-l[c])>0?l[c]=a[c]:a[c]=l[c],[a.toJSON(),...t,l.toJSON()]};function yk(t){return new db(t.x,t.y,0,0)}function bk(t={}){const e=Vm(t.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function vk(t,e={}){return t.sourceBBox.clone().moveAndExpand(bk(e))}function wk(t,e={}){return t.targetBBox.clone().moveAndExpand(bk(e))}function Ck(t,e={}){if(t.sourceAnchor)return t.sourceAnchor;const n=vk(t,e);return n.getCenter()}function xk(t,e={}){if(t.targetAnchor)return t.targetAnchor;const n=wk(t,e);return n.getCenter()}const Ek=function(t,e,n){let i=vk(n,e),r=wk(n,e);const s=Ck(n,e),o=xk(n,e);i=i.union(yk(s)),r=r.union(yk(o));const a=t.map((t=>ub.create(t)));a.unshift(s),a.push(o);let l=null;const c=[];for(let h=0,u=a.length-1;h<u;h+=1){let t=null;const n=a[h],s=a[h+1],o=null!=kk.getBearing(n,s);if(0===h)h+1===u?i.intersectsWithRect(r.clone().inflate(1))?t=kk.insideNode(n,s,i,r):o||(t=kk.nodeToNode(n,s,i,r)):i.containsPoint(s)?t=kk.insideNode(n,s,i,yk(s).moveAndExpand(bk(e))):o||(t=kk.nodeToVertex(n,s,i));else if(h+1===u){const i=o&&kk.getBearing(s,n)===l;r.containsPoint(n)||i?t=kk.insideNode(n,s,yk(n).moveAndExpand(bk(e)),r,l):o||(t=kk.vertexToNode(n,s,r,l))}else o||(t=kk.vertexToVertex(n,s,l));t?(c.push(...t.points),l=t.direction):l=kk.getBearing(n,s),h+1<u&&c.push(s)}return c};var kk;(function(t){const e={N:"S",S:"N",E:"W",W:"E"},n={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function i(t,e,n){let i=new ub(t.x,e.y);return n.containsPoint(i)&&(i=new ub(e.x,t.y)),i}function r(t,e){return t["W"===e||"E"===e?"width":"height"]}function s(t,e){return t.x===e.x?t.y>e.y?"N":"S":t.y===e.y?t.x>e.x?"W":"E":null}function o(t,n,i){const r=new ub(t.x,n.y),o=new ub(n.x,t.y),a=s(t,r),l=s(t,o),c=i?e[i]:null,h=a===i||a!==c&&(l===c||l!==i)?r:o;return{points:[h],direction:s(h,n)}}function a(t,e,n){const r=i(t,e,n);return{points:[r],direction:s(r,e)}}function l(t,e,n,o){const a=[new ub(t.x,e.y),new ub(e.x,t.y)],l=a.filter((t=>!n.containsPoint(t))),c=l.filter((e=>s(e,t)!==o));let h;if(c.length>0)return h=c.filter((e=>s(t,e)===o)).pop(),h=h||c[0],{points:[h],direction:s(h,e)};{h=Vl(a,l)[0];const c=ub.create(e).move(h,-r(n,o)/2),u=i(c,t,n);return{points:[u,c],direction:s(c,e)}}}function c(t,e,n,i){let l=a(e,t,i);const c=l.points[0];if(n.containsPoint(c)){l=a(t,e,n);const h=l.points[0];if(i.containsPoint(h)){const u=ub.create(t).move(h,-r(n,s(t,h))/2),d=ub.create(e).move(c,-r(i,s(e,c))/2),p=new pb(u,d).getCenter(),g=a(t,p,n),f=o(p,e,g.direction);l.points=[g.points[0],f.points[0]],l.direction=f.direction}}return l}function h(t,e,r,o,a){const l=r.union(o).inflate(1),c=l.getCenter(),h=c.distance(e)>c.distance(t),u=h?e:t,d=h?t:e;let p,g,f,m;a?(p=ub.fromPolar(l.width+l.height,n[a],u),p=l.getNearestPointToPoint(p).move(p,-1)):p=l.getNearestPointToPoint(u).move(u,1),g=i(p,d,l),p.round().equals(g.round())?(g=ub.fromPolar(l.width+l.height,ib.toRad(p.theta(u))+Math.PI/2,d),g=l.getNearestPointToPoint(g).move(d,1).round(),f=i(p,g,l),m=h?[g,f,p]:[p,f,g]):m=h?[g,p]:[p,g];const y=s(h?p:g,e);return{points:m,direction:y}}t.getBBoxSize=r,t.getBearing=s,t.vertexToVertex=o,t.nodeToVertex=a,t.vertexToNode=l,t.nodeToNode=c,t.insideNode=h})(kk||(kk={}));const Mk={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeShapes:[],excludeHiddenNodes:!1,startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){const t=Sk(this.step,this);return t},directions(){const t=Sk(this.step,this),e=Sk(this.cost,this);return[{cost:e,offsetX:t,offsetY:0},{cost:e,offsetX:-t,offsetY:0},{cost:e,offsetX:0,offsetY:t},{cost:e,offsetX:0,offsetY:-t}]},penalties(){const t=Sk(this.step,this);return{0:0,45:t/2,90:t/2}},paddingBox(){const t=Sk(this.step,this);return{x:-t,y:-t,width:2*t,height:2*t}},fallbackRouter:Ek,draggingRouter:null};function Sk(t,e){return"function"===typeof t?t.call(e):t}function Ak(t){const e=Object.keys(t).reduce(((e,n)=>{const i=e;return i[n]="fallbackRouter"===n||"draggingRouter"===n||"fallbackRoute"===n?t[n]:Sk(t[n],t),e}),{});if(e.padding){const n=Vm(e.padding);t.paddingBox={x:-n.left,y:-n.top,width:n.left+n.right,height:n.top+n.bottom}}return e.directions.forEach((t=>{const e=new ub(0,0),n=new ub(t.offsetX,t.offsetY);t.angle=ib.normalize(e.theta(n))})),e}const Dk=1,Ok=2;class Pk{constructor(){this.items=[],this.hash={},this.values={}}add(t,e){this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=Dk,this.values[t]=e;const n=tl(this.items,t,(t=>this.values[t]));this.items.splice(n,0,t)}pop(){const t=this.items.shift();return t&&(this.hash[t]=Ok),t}isOpen(t){return this.hash[t]===Dk}isClose(t){return this.hash[t]===Ok}isEmpty(){return 0===this.items.length}}class Tk{constructor(t){this.options=t,this.mapGridSize=100,this.map={}}build(t,e){const n=this.options,i=n.excludeTerminals.reduce(((n,i)=>{const r=e[i];if(r){const e=t.getCell(r.cell);e&&n.push(e)}return n}),[]);let r=[];const s=t.getCell(e.getSourceCellId());s&&(r=ji(r,s.getAncestors().map((t=>t.id))));const o=t.getCell(e.getTargetCellId());o&&(r=ji(r,o.getAncestors().map((t=>t.id))));const a=this.mapGridSize;return t.getNodes().reduce(((t,e)=>{const s=e.shape,o=n.excludeShapes,l=!!s&&o.includes(s),c=i.some((t=>t.id===e.id)),h=r.includes(e.id),u=n.excludeHiddenNodes&&!e.isVisible(),d=l||c||h||u;if(!d){const i=e.getBBox().moveAndExpand(n.paddingBox),r=i.getOrigin().snapToGrid(a),s=i.getCorner().snapToGrid(a);for(let e=r.x;e<=s.x;e+=a)for(let n=r.y;n<=s.y;n+=a){const r=new ub(e,n).toString();null==t[r]&&(t[r]=[]),t[r].push(i)}}return t}),this.map),this}isAccessible(t){const e=t.clone().snapToGrid(this.mapGridSize).toString(),n=this.map[e];return!n||n.every((e=>!e.containsPoint(t)))}}function Nk(t,e){const n=t.sourceBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function jk(t,e){const n=t.targetBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function Lk(t,e){if(t.sourceAnchor)return t.sourceAnchor;const n=Nk(t,e);return n.getCenter()}function Fk(t,e){if(t.targetAnchor)return t.targetAnchor;const n=jk(t,e);return n.getCenter()}function zk(t,e,n,i,r){const s=360/n,o=t.theta(Rk(t,e,i,r)),a=ib.normalize(o+s/2);return s*Math.floor(a/s)}function Rk(t,e,n,i){const r=i.step,s=e.x-t.x,o=e.y-t.y,a=s/n.x,l=o/n.y,c=a*r,h=l*r;return new ub(t.x+c,t.y+h)}function Bk(t,e){const n=Math.abs(t-e);return n>180?360-n:n}function Ik(t,e){const n=e.step;return e.directions.forEach((e=>{e.gridOffsetX=e.offsetX/n*t.x,e.gridOffsetY=e.offsetY/n*t.y})),e.directions}function $k(t,e,n){return{source:e.clone(),x:Vk(n.x-e.x,t),y:Vk(n.y-e.y,t)}}function Vk(t,e){if(!t)return e;const n=Math.abs(t),i=Math.round(n/e);if(!i)return n;const r=i*e,s=n-r,o=s/i;return e+o}function _k(t,e){const n=e.source,i=QC.snapToGrid(t.x-n.x,e.x)+n.x,r=QC.snapToGrid(t.y-n.y,e.y)+n.y;return new ub(i,r)}function Gk(t,e){return t.round(e)}function Hk(t,e,n){return Gk(_k(t.clone(),e),n)}function Uk(t){return t.toString()}function Wk(t){return new ub(0===t.x?0:Math.abs(t.x)/t.x,0===t.y?0:Math.abs(t.y)/t.y)}function qk(t,e){let n=1/0;for(let i=0,r=e.length;i<r;i+=1){const r=t.manhattanDistance(e[i]);r<n&&(n=r)}return n}function Xk(t,e,n,i,r){const s=r.precision,o=r.directionMap,a=t.diff(e.getCenter()),l=Object.keys(o).reduce(((r,l)=>{if(n.includes(l)){const n=o[l],c=new ub(t.x+n.x*(Math.abs(a.x)+e.width),t.y+n.y*(Math.abs(a.y)+e.height)),h=new pb(t,c),u=h.intersect(e)||[];let d,p=null;for(let e=0;e<u.length;e+=1){const n=u[e],i=t.squaredDistance(n);(null==d||i>d)&&(d=i,p=n)}if(p){let t=Hk(p,i,s);e.containsPoint(t)&&(t=Hk(t.translate(n.x*i.x,n.y*i.y),i,s)),r.push(t)}}return r}),[]);return e.containsPoint(t)||l.push(Hk(t,i,s)),l}function Yk(t,e,n,i,r){const s=[];let o,a=Wk(r.diff(n)),l=Uk(n),c=t[l];while(c){o=e[l];const n=Wk(o.diff(c));n.equals(a)||(s.unshift(o),a=n),l=Uk(c),c=t[l]}const h=e[l],u=Wk(h.diff(i));return u.equals(a)||s.unshift(h),s}function Jk(t,e,n,i,r){const s=r.precision;let o,a;o=db.isRectangle(e)?Gk(Lk(t,r).clone(),s):Gk(e.clone(),s),a=db.isRectangle(n)?Gk(Fk(t,r).clone(),s):Gk(n.clone(),s);const l=$k(r.step,o,a),c=o,h=a;let u,d;if(u=db.isRectangle(e)?Xk(c,e,r.startDirections,l,r):[c],d=db.isRectangle(n)?Xk(a,n,r.endDirections,l,r):[h],u=u.filter((t=>i.isAccessible(t))),d=d.filter((t=>i.isAccessible(t))),u.length>0&&d.length>0){const t=new Pk,e={},n={},o={};for(let i=0,r=u.length;i<r;i+=1){const n=u[i],r=Uk(n);t.add(r,qk(n,d)),e[r]=n,o[r]=0}const a=r.previousDirectionAngle,p=void 0===a;let g,f;const m=Ik(l,r),y=m.length,b=d.reduce(((t,e)=>{const n=Uk(e);return t.push(n),t}),[]),v=ub.equalPoints(u,d);let w=r.maxLoopCount;while(!t.isEmpty()&&w>0){const u=t.pop(),C=e[u],x=n[u],E=o[u],k=C.equals(c),M=null==x;let S;S=M?p?k?null:zk(c,C,y,l,r):a:zk(x,C,y,l,r);const A=M&&v;if(!A&&b.indexOf(u)>=0)return r.previousDirectionAngle=S,Yk(n,e,C,c,h);for(let a=0;a<y;a+=1){g=m[a];const c=g.angle;if(f=Bk(S,c),(!p||!k)&&f>r.maxDirectionChange)continue;const u=Hk(C.clone().translate(g.gridOffsetX||0,g.gridOffsetY||0),l,s),v=Uk(u);if(t.isClose(v)||!i.isAccessible(u))continue;if(b.indexOf(v)>=0){const t=u.equals(h);if(!t){const t=zk(u,h,y,l,r),e=Bk(c,t);if(e>r.maxDirectionChange)continue}}const w=g.cost,x=k?0:r.penalties[f],M=E+w+x;(!t.isOpen(v)||M<o[v])&&(e[v]=u,n[v]=C,o[v]=M,t.add(v,M+qk(u,d)))}w-=1}}return r.fallbackRoute?ey(r.fallbackRoute,this,c,h,r):null}const Zk=function(t,e,n){const i=Ak(e),r=Nk(n,i),s=jk(n,i),o=Lk(n,i),a=new Tk(i).build(n.graph.model,n.cell),l=t.map((t=>ub.create(t))),c=[];let h,u,d=o;for(let p=0,g=l.length;p<=g;p+=1){let e=null;if(h=u||r,u=l[p],null==u){u=s;const t=n.cell,a=null==t.getSourceCellId()||null==t.getTargetCellId();if(a&&"function"===typeof i.draggingRouter){const t=h===r?o:h,s=u.getOrigin();e=ey(i.draggingRouter,n,t,s,i)}}if(null==e&&(e=Jk(n,h,u,a,i)),null===e)return ey(i.fallbackRouter,this,t,i,n);const g=e[0];g&&g.equals(d)&&e.shift(),d=e[e.length-1]||d,c.push(...e)}return c},Kk=function(t,e,n){return ey(Zk,this,t,Object.assign(Object.assign({},Mk),e),n)},Qk={maxDirectionChange:45,directions(){const t=Sk(this.step,this),e=Sk(this.cost,this),n=Math.ceil(Math.sqrt(t*t<<1));return[{cost:e,offsetX:t,offsetY:0},{cost:n,offsetX:t,offsetY:t},{cost:e,offsetX:0,offsetY:t},{cost:n,offsetX:-t,offsetY:t},{cost:e,offsetX:-t,offsetY:0},{cost:n,offsetX:-t,offsetY:-t},{cost:e,offsetX:0,offsetY:-t},{cost:n,offsetX:t,offsetY:-t}]},fallbackRoute(t,e,n){const i=t.theta(e),r=[];let s={x:e.x,y:t.y},o={x:t.x,y:e.y};if(i%180>90){const t=s;s=o,o=t}const a=i%90<45?s:o,l=new pb(t,a),c=90*Math.ceil(i/90),h=ub.fromPolar(l.squaredLength(),ib.toRad(c+135),a),u=new pb(e,h),d=l.intersectsWithLine(u),p=d||e,g=d?p:t,f=360/n.directions.length,m=g.theta(e),y=ib.normalize(m+f/2),b=f*Math.floor(y/f);return n.previousDirectionAngle=b,p&&r.push(p.round()),r.push(e),r}},tM=function(t,e,n){return ey(Kk,this,t,Object.assign(Object.assign({},Qk),e),n)},eM=function(t,e,n){const i=e.offset||32,r=null==e.min?16:e.min;let s=0,o=e.direction;const a=n.sourceBBox,l=n.targetBBox,c=a.getCenter(),h=l.getCenter();if("number"===typeof i&&(s=i),null==o){let t=l.left-a.right,e=l.top-a.bottom;t>=0&&e>=0?o=t>=e?"L":"T":t<=0&&e>=0?(t=a.left-l.right,o=t>=0&&t>=e?"R":"T"):t>=0&&e<=0?(e=a.top-l.bottom,o=e>=0?t>=e?"L":"B":"L"):(t=a.left-l.right,e=a.top-l.bottom,o=t>=0&&e>=0?t>=e?"R":"B":t<=0&&e>=0?"B":t>=0&&e<=0||Math.abs(t)>Math.abs(e)?"R":"B")}let u,d,p;"H"===o?o=h.x-c.x>=0?"L":"R":"V"===o&&(o=h.y-c.y>=0?"T":"B"),"center"===i&&("L"===o?s=(l.left-a.right)/2:"R"===o?s=(a.left-l.right)/2:"T"===o?s=(l.top-a.bottom)/2:"B"===o&&(s=(a.top-l.bottom)/2));const g="L"===o||"R"===o;if(g){if(h.y===c.y)return[...t];p="L"===o?1:-1,u="x",d="width"}else{if(h.x===c.x)return[...t];p="T"===o?1:-1,u="y",d="height"}const f=c.clone(),m=h.clone();if(f[u]+=p*(a[d]/2+s),m[u]-=p*(l[d]/2+s),g){const t=f.x,e=m.x,n=a.width/2+r,i=l.width/2+r;h.x>c.x?e<=t&&(f.x=Math.max(e,c.x+n),m.x=Math.min(t,h.x-i)):e>=t&&(f.x=Math.min(e,c.x-n),m.x=Math.max(t,h.x+i))}else{const t=f.y,e=m.y,n=a.height/2+r,i=l.height/2+r;h.y>c.y?e<=t&&(f.y=Math.max(e,c.y+n),m.y=Math.min(t,h.y-i)):e>=t&&(f.y=Math.min(e,c.y-n),m.y=Math.max(t,h.y+i))}return[f.toJSON(),...t,m.toJSON()]};function nM(t,e){if(null!=e&&!1!==e){const n="boolean"===typeof e?0:e;if(n>0){const e=ub.create(t[1]).move(t[2],n),i=ub.create(t[1]).move(t[0],n);return[e.toJSON(),...t,i.toJSON()]}{const e=t[1];return[Object.assign({},e),...t,Object.assign({},e)]}}return t}const iM=function(t,e,n){const i=e.width||50,r=e.height||80,s=r/2,o=e.angle||"auto",a=n.sourceAnchor,l=n.targetAnchor,c=n.sourceBBox,h=n.targetBBox;if(a.equals(l)){const t=t=>{const e=ib.toRad(t),n=Math.sin(e),r=Math.cos(e),o=new ub(a.x+r*i,a.y+n*i),l=new ub(o.x-r*s,o.y-n*s),c=l.clone().rotate(-90,o),h=l.clone().rotate(90,o);return[c.toJSON(),o.toJSON(),h.toJSON()]},n=t=>{const e=a.clone().move(t,-1),n=new pb(e,t);return!c.containsPoint(t)&&!c.intersectsWithLine(n)},r=[0,90,180,270,45,135,225,315];if("number"===typeof o)return nM(t(o),e.merge);const l=c.getCenter();if(l.equals(a))return nM(t(0),e.merge);const h=l.angleBetween(a,l.clone().translate(1,0));let u=t(h);if(n(u[1]))return nM(u,e.merge);for(let i=1,s=r.length;i<s;i+=1)if(u=t(h+r[i]),n(u[1]))return nM(u,e.merge);return nM(u,e.merge)}{const t=new pb(a,l);let r=t.parallel(-i),o=r.getCenter(),u=r.start.clone().move(r.end,s),d=r.end.clone().move(r.start,s);const p=t.parallel(-1),g=new pb(p.start,o),f=new pb(p.end,o);if((c.containsPoint(o)||h.containsPoint(o)||c.intersectsWithLine(g)||c.intersectsWithLine(f)||h.intersectsWithLine(g)||h.intersectsWithLine(f))&&(r=t.parallel(i),o=r.getCenter(),u=r.start.clone().move(r.end,s),d=r.end.clone().move(r.start,s)),e.merge){const t=new pb(a,l),e=new pb(o,t.center).setLength(Number.MAX_SAFE_INTEGER),i=c.intersectsWithLine(e),r=h.intersectsWithLine(e),s=i?Array.isArray(i)?i:[i]:[];r&&(Array.isArray(r)?s.push(...r):s.push(r));const u=t.center.closest(s);u?(n.sourceAnchor=u.clone(),n.targetAnchor=u.clone()):(n.sourceAnchor=t.center.clone(),n.targetAnchor=t.center.clone())}return nM([u.toJSON(),o.toJSON(),d.toJSON()],e.merge)}};var rM;(function(t){t.presets=f,t.registry=Yv.create({type:"router"}),t.registry.register(t.presets,!0)})(rM||(rM={}));const sM=function(t,e,n,i={}){const r=[t,...n,e],s=new fb(r),o=new zb(s);return i.raw?o:o.serialize()},oM=function(t,e,n,i={}){const r=3===n.length?0:1,s=ub.create(n[0+r]),o=ub.create(n[2+r]),a=ub.create(n[1+r]);if(!ub.equals(t,e)){const n=new ub((t.x+e.x)/2,(t.y+e.y)/2),i=n.angleBetween(ub.create(t).rotate(90,n),a);i>1&&(s.rotate(180-i,n),o.rotate(180-i,n),a.rotate(180-i,n))}const l=`\n M ${t.x} ${t.y}\n Q ${s.x} ${s.y} ${a.x} ${a.y}\n Q ${o.x} ${o.y} ${e.x} ${e.y}\n `;return i.raw?zb.parse(l):l},aM=function(t,e,n,i={}){const r=new zb;r.appendSegment(zb.createSegment("M",t));const s=1/3,o=2/3,a=i.radius||10;let l,c;for(let h=0,u=n.length;h<u;h+=1){const i=ub.create(n[h]),u=n[h-1]||t,d=n[h+1]||e;l=c||i.distance(u)/2,c=i.distance(d)/2;const p=-Math.min(a,l),g=-Math.min(a,c),f=i.clone().move(u,p).round(),m=i.clone().move(d,g).round(),y=new ub(s*f.x+o*i.x,o*i.y+s*f.y),b=new ub(s*m.x+o*i.x,o*i.y+s*m.y);r.appendSegment(zb.createSegment("L",f)),r.appendSegment(zb.createSegment("C",y,b,m))}return r.appendSegment(zb.createSegment("L",e)),i.raw?r:r.serialize()},lM=function(t,e,n,i={}){let r,s=i.direction;if(n&&0!==n.length){const i=[t,...n,e],s=mb.throughPoints(i);r=new zb(s)}else if(r=new zb,r.appendSegment(zb.createSegment("M",t)),s||(s=Math.abs(t.x-e.x)>=Math.abs(t.y-e.y)?"H":"V"),"H"===s){const n=(t.x+e.x)/2;r.appendSegment(zb.createSegment("C",n,t.y,n,e.y,e.x,e.y))}else{const n=(t.y+e.y)/2;r.appendSegment(zb.createSegment("C",t.x,n,e.x,n,e.x,e.y))}return i.raw?r:r.serialize()},cM=1,hM=1/3,uM=2/3;function dM(t){let e=t.graph._jumpOverUpdateList;if(null==e&&(e=t.graph._jumpOverUpdateList=[],t.graph.on("cell:mouseup",(()=>{const e=t.graph._jumpOverUpdateList;for(let t=0;t<e.length;t+=1)e[t].update()})),t.graph.on("model:reseted",(()=>{e=t.graph._jumpOverUpdateList=[]}))),e.indexOf(t)<0){e.push(t);const n=()=>e.splice(e.indexOf(t),1);t.cell.once("change:connector",n),t.cell.once("removed",n)}}function pM(t,e,n=[]){const i=[t,...n,e],r=[];return i.forEach(((t,e)=>{const n=i[e+1];null!=n&&r.push(new pb(t,n))})),r}function gM(t,e){const n=[];return e.forEach((e=>{const i=t.intersectsWithLine(e);i&&n.push(i)})),n}function fM(t,e){return new pb(t,e).squaredLength()}function mM(t,e,n){return e.reduce(((i,r,s)=>{if(wM.includes(r))return i;const o=i.pop()||t,a=ub.create(r).move(o.start,-n);let l=ub.create(r).move(o.start,+n);const c=e[s+1];if(null!=c){const t=l.distance(c);t<=n&&(l=c.move(o.start,t),wM.push(c))}else{const t=a.distance(o.end);if(t<2*n+cM)return i.push(o),i}const h=l.distance(o.start);if(h<2*n+cM)return i.push(o),i;const u=new pb(a,l);return vM.push(u),i.push(new pb(o.start,a),u,new pb(l,o.end)),i}),[])}function yM(t,e,n,i){const r=new zb;let s;return s=zb.createSegment("M",t[0].start),r.appendSegment(s),t.forEach(((o,a)=>{if(vM.includes(o)){let t,i,a,l;if("arc"===n){t=-90,i=o.start.diff(o.end);const e=i.x<0||0===i.x&&i.y<0;e&&(t+=180);const n=o.getCenter(),c=new pb(n,o.end).rotate(t,n);let h;h=new pb(o.start,n),a=h.pointAt(2/3).rotate(t,o.start),l=c.pointAt(1/3).rotate(-t,c.end),s=zb.createSegment("C",a,l,c.end),r.appendSegment(s),h=new pb(n,o.end),a=c.pointAt(1/3).rotate(t,c.end),l=h.pointAt(1/3).rotate(-t,o.end),s=zb.createSegment("C",a,l,o.end),r.appendSegment(s)}else if("gap"===n)s=zb.createSegment("M",o.end),r.appendSegment(s);else if("cubic"===n){t=o.start.theta(o.end);const n=.6*e;let c=1.35*e;i=o.start.diff(o.end);const h=i.x<0||0===i.x&&i.y<0;h&&(c*=-1),a=new ub(o.start.x+n,o.start.y+c).rotate(t,o.start),l=new ub(o.end.x-n,o.end.y+c).rotate(t,o.end),s=zb.createSegment("C",a,l,o.end),r.appendSegment(s)}}else{const e=t[a+1];0===i||!e||vM.includes(e)?(s=zb.createSegment("L",o.end),r.appendSegment(s)):bM(i,r,o.end,o.start,e.end)}})),r}function bM(t,e,n,i,r){const s=n.distance(i)/2,o=n.distance(r)/2,a=-Math.min(t,s),l=-Math.min(t,o),c=n.clone().move(i,a).round(),h=n.clone().move(r,l).round(),u=new ub(hM*c.x+uM*n.x,uM*n.y+hM*c.y),d=new ub(hM*h.x+uM*n.x,uM*n.y+hM*h.y);let p;p=zb.createSegment("L",c),e.appendSegment(p),p=zb.createSegment("C",u,d,h),e.appendSegment(p)}let vM,wM;const CM=function(t,e,n,i={}){vM=[],wM=[],dM(this);const r=i.size||5,s=i.type||"arc",o=i.radius||0,a=i.ignoreConnectors||["smooth"],l=this.graph,c=l.model,h=c.getEdges();if(1===h.length)return yM(pM(t,e,n),r,s,o);const u=this.cell,d=h.indexOf(u),p=l.options.connecting.connector||{},g=h.filter(((t,e)=>{const n=t.getConnector()||p;return!a.includes(n.name)&&(!(e>d)||"jumpover"!==n.name)})),f=g.map((t=>l.renderer.findViewByCell(t))),m=pM(t,e,n),y=f.map((t=>null==t?[]:t===this?m:pM(t.sourcePoint,t.targetPoint,t.routePoints))),b=[];m.forEach((t=>{const e=g.reduce(((e,n,i)=>{if(n!==u){const n=gM(t,y[i]);e.push(...n)}return e}),[]).sort(((e,n)=>fM(t.start,e)-fM(t.start,n)));e.length>0?b.push(...mM(t,e,r)):b.push(t)}));const v=yM(b,r,s,o);return vM=[],wM=[],i.raw?v:v.serialize()};var xM;(function(t){t.presets=m,t.registry=Yv.create({type:"connector"}),t.registry.register(t.presets,!0)})(xM||(xM={}));Yv.create;class EM{constructor(t){this.cell=t,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(t,e,n={},i="/"){const r=this.cell.getPropByPath(t),s=ud(n,EM.defaultOptions),o=this.getTiming(s.timing),a=this.getInterp(s.interp,r,e);let l=0;const c=Array.isArray(t)?t.join(i):t,h=Array.isArray(t)?t:t.split(i),u=()=>{const t=(new Date).getTime();0===l&&(l=t);const e=t-l;let i=e/s.duration;i<1?this.ids[c]=tb(u):i=1;const r=a(o(i));this.cell.setPropByPath(h,r),n.progress&&n.progress(Object.assign({progress:i,currentValue:r},this.getArgs(c))),1===i&&(this.cell.notify("transition:end",this.getArgs(c)),this.cell.notify("transition:complete",this.getArgs(c)),n.complete&&n.complete(this.getArgs(c)),this.cell.notify("transition:finish",this.getArgs(c)),n.finish&&n.finish(this.getArgs(c)),this.clean(c))};return setTimeout((()=>{this.stop(t,void 0,i),this.cache[c]={startValue:r,targetValue:e,options:s},this.ids[c]=tb(u),this.cell.notify("transition:begin",this.getArgs(c)),this.cell.notify("transition:start",this.getArgs(c)),n.start&&n.start(this.getArgs(c))}),n.delay),this.stop.bind(this,t,i,n)}stop(t,e={},n="/"){const i=Array.isArray(t)?t:t.split(n);return Object.keys(this.ids).filter((t=>ch(i,t.split(n).slice(0,i.length)))).forEach((t=>{eb(this.ids[t]);const n=this.cache[t],i=this.getArgs(t),r=Object.assign(Object.assign({},n.options),e),s=r.jumpedToEnd;s&&null!=n.targetValue&&(this.cell.setPropByPath(t,n.targetValue),this.cell.notify("transition:end",Object.assign({},i)),this.cell.notify("transition:complete",Object.assign({},i)),r.complete&&r.complete(Object.assign({},i)));const o=Object.assign({jumpedToEnd:s},i);this.cell.notify("transition:stop",Object.assign({},o)),r.stop&&r.stop(Object.assign({},o)),this.cell.notify("transition:finish",Object.assign({},i)),r.finish&&r.finish(Object.assign({},i)),this.clean(t)})),this}clean(t){delete this.ids[t],delete this.cache[t]}getTiming(t){return"string"===typeof t?Xx[t]:t}getInterp(t,e,n){return t?t(e,n):"number"===typeof n?Yx.number(e,n):"string"===typeof n?"#"===n[0]?Yx.color(e,n):Yx.unit(e,n):Yx.object(e,n)}getArgs(t){const e=this.cache[t];return{path:t,startValue:e.startValue,targetValue:e.targetValue,cell:this.cell}}}(function(t){t.defaultOptions={delay:10,duration:100,timing:"linear"}})(EM||(EM={}));var kM=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class MM extends Ux{constructor(t={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(ad(t)),this.changed={}}mutate(t,e={}){const n=!0===e.unset,i=!0===e.silent,r=[],s=this.changing;this.changing=!0,s||(this.previous=ad(this.data),this.changed={});const o=this.data,a=this.previous,l=this.changed;if(Object.keys(t).forEach((e=>{const i=e,s=t[i];ch(o[i],s)||r.push(i),ch(a[i],s)?delete l[i]:l[i]=s,n?delete o[i]:o[i]=s})),!i&&r.length>0&&(this.pending=!0,this.pendingOptions=e,r.forEach((t=>{this.emit("change:*",{key:t,options:e,store:this,current:o[t],previous:a[t]})}))),s)return this;if(!i)while(this.pending)this.pending=!1,this.emit("changed",{current:o,previous:a,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(t,e){if(null==t)return this.data;const n=this.data[t];return null==n?e:n}getPrevious(t){if(this.previous){const e=this.previous[t];return null==e?void 0:e}}set(t,e,n){return null!=t&&("object"===typeof t?this.mutate(t,e):this.mutate({[t]:e},n)),this}remove(t,e){const n=void 0,i={};let r;if("string"===typeof t)i[t]=n,r=e;else if(Array.isArray(t))t.forEach((t=>i[t]=n)),r=e;else{for(const t in this.data)i[t]=n;r=t}return this.mutate(i,Object.assign(Object.assign({},r),{unset:!0})),this}getByPath(t){return kd(this.data,t,"/")}setByPath(t,e,n={}){const i="/",r=Array.isArray(t)?[...t]:t.split(i),s=Array.isArray(t)?t.join(i):t,o=r[0],a=r.length;if(n.propertyPath=s,n.propertyValue=e,n.propertyPathArray=r,1===a)this.set(o,e,n);else{const s={};let l=s,c=o;for(let t=1;t<a;t+=1){const e=r[t],n=Number.isFinite(Number(e));l=l[c]=n?[]:{},c=e}Md(s,r,e,i);const h=ad(this.data);n.rewrite&&Sd(h,t,i);const u=ah(h,s);this.set(o,u[o],n)}return this}removeByPath(t,e){const n=Array.isArray(t)?t:t.split("/"),i=n[0];if(1===n.length)this.remove(i,e);else{const t=n.slice(1),r=ad(this.get(i));r&&Sd(r,t),this.set(i,r,e)}return this}hasChanged(t){return null==t?Object.keys(this.changed).length>0:t in this.changed}getChanges(t){if(null==t)return this.hasChanged()?ad(this.changed):null;const e=this.changing?this.previous:this.data,n={};let i;for(const r in t){const s=t[r];ch(e[r],s)||(n[r]=s,i=!0)}return i?ad(n):null}toJSON(){return ad(this.data)}clone(){const t=this.constructor;return new t(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}kM([Ux.dispose()],MM.prototype,"dispose",null);var SM,AM=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},DM=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class OM extends Ux{constructor(t={}){super();const e=this.constructor,n=e.getDefaults(!0),i=ah({},this.preprocess(n),this.preprocess(t));this.id=i.id||Om(),this.store=new MM(i),this.animation=new EM(this),this.setup(),this.init(),this.postprocess(t)}static config(t){const{markup:e,propHooks:n,attrHooks:i}=t,r=DM(t,["markup","propHooks","attrHooks"]);null!=e&&(this.markup=e),n&&(this.propHooks=this.propHooks.slice(),Array.isArray(n)?this.propHooks.push(...n):"function"===typeof n?this.propHooks.push(n):Object.keys(n).forEach((t=>{const e=n[t];"function"===typeof e&&this.propHooks.push(e)}))),i&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),i)),this.defaults=ah({},this.defaults,r)}static getMarkup(){return this.markup}static getDefaults(t){return t?this.defaults:ad(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(t,e){return this.propHooks.reduce(((e,n)=>n?ey(n,t,e):e),e)}get[Symbol.toStringTag](){return OM.toStringTag}init(){}get model(){return this._model}set model(t){this._model!==t&&(this._model=t)}preprocess(t,e){const n=t.id,i=this.constructor,r=i.applyPropHooks(this,t);return null==n&&!0!==e&&(r.id=Om()),r}postprocess(t){}setup(){this.store.on("change:*",(t=>{const{key:e,current:n,previous:i,options:r}=t;this.notify("change:*",{key:e,options:r,current:n,previous:i,cell:this}),this.notify(`change:${e}`,{options:r,current:n,previous:i,cell:this});const s=e;"source"!==s&&"target"!==s||this.notify("change:terminal",{type:s,current:n,previous:i,options:r,cell:this})})),this.store.on("changed",(({options:t})=>this.notify("changed",{options:t,cell:this})))}notify(t,e){this.trigger(t,e);const n=this.model;return n&&(n.notify(`cell:${t}`,e),this.isNode()?n.notify(`node:${t}`,Object.assign(Object.assign({},e),{node:this})):this.isEdge()&&n.notify(`edge:${t}`,Object.assign(Object.assign({},e),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(t){return this.store===t.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(t,e){return null==t?this.store.get():this.store.get(t,e)}setProp(t,e,n){if("string"===typeof t)this.store.set(t,e,n);else{const n=this.preprocess(t,!0);this.store.set(ah({},this.getProp(),n),e),this.postprocess(t)}return this}removeProp(t,e){return"string"===typeof t||Array.isArray(t)?this.store.removeByPath(t,e):this.store.remove(e),this}hasChanged(t){return null==t?this.store.hasChanged():this.store.hasChanged(t)}getPropByPath(t){return this.store.getByPath(t)}setPropByPath(t,e,n={}){return this.model&&("children"===t?this._children=e?e.map((t=>this.model.getCell(t))).filter((t=>null!=t)):null:"parent"===t&&(this._parent=e?this.model.getCell(e):null)),this.store.setByPath(t,e,n),this}removePropByPath(t,e={}){const n=Array.isArray(t)?t:t.split("/");return"attrs"===n[0]&&(e.dirty=!0),this.store.removeByPath(n,e),this}prop(t,e,n){return null==t?this.getProp():"string"===typeof t||Array.isArray(t)?1===arguments.length?this.getPropByPath(t):null==e?this.removePropByPath(t,n||{}):this.setPropByPath(t,e,n||{}):this.setProp(t,e||{})}previous(t){return this.store.getPrevious(t)}get zIndex(){return this.getZIndex()}set zIndex(t){null==t?this.removeZIndex():this.setZIndex(t)}getZIndex(){return this.store.get("zIndex")}setZIndex(t,e={}){return this.store.set("zIndex",t,e),this}removeZIndex(t={}){return this.store.remove("zIndex",t),this}toFront(t={}){const e=this.model;if(e){let n,i=e.getMaxZIndex();t.deep?(n=this.getDescendants({deep:!0,breadthFirst:!0}),n.unshift(this)):n=[this],i=i-n.length+1;const r=e.total();let s=e.indexOf(this)!==r-n.length;s||(s=n.some(((t,e)=>t.getZIndex()!==i+e))),s&&this.batchUpdate("to-front",(()=>{i+=n.length,n.forEach(((e,n)=>{e.setZIndex(i+n,t)}))}))}return this}toBack(t={}){const e=this.model;if(e){let n,i=e.getMinZIndex();t.deep?(n=this.getDescendants({deep:!0,breadthFirst:!0}),n.unshift(this)):n=[this];let r=0!==e.indexOf(this);r||(r=n.some(((t,e)=>t.getZIndex()!==i+e))),r&&this.batchUpdate("to-back",(()=>{i-=n.length,n.forEach(((e,n)=>{e.setZIndex(i+n,t)}))}))}return this}get markup(){return this.getMarkup()}set markup(t){null==t?this.removeMarkup():this.setMarkup(t)}getMarkup(){let t=this.store.get("markup");if(null==t){const e=this.constructor;t=e.getMarkup()}return t}setMarkup(t,e={}){return this.store.set("markup",t,e),this}removeMarkup(t={}){return this.store.remove("markup",t),this}get attrs(){return this.getAttrs()}set attrs(t){null==t?this.removeAttrs():this.setAttrs(t)}getAttrs(){const t=this.store.get("attrs");return t?Object.assign({},t):{}}setAttrs(t,e={}){if(null==t)this.removeAttrs(e);else{const n=t=>this.store.set("attrs",t,e);if(!0===e.overwrite)n(t);else{const i=this.getAttrs();!1===e.deep?n(Object.assign(Object.assign({},i),t)):n(ah({},i,t))}}return this}replaceAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{deep:!1}))}removeAttrs(t={}){return this.store.remove("attrs",t),this}getAttrDefinition(t){if(!t)return null;const e=this.constructor,n=e.getAttrHooks()||{};let i=n[t]||AC.registry.get(t);if(!i){const e=bm(t);i=n[e]||AC.registry.get(e)}return i||null}getAttrByPath(t){return null==t||""===t?this.getAttrs():this.getPropByPath(this.prefixAttrPath(t))}setAttrByPath(t,e,n={}){return this.setPropByPath(this.prefixAttrPath(t),e,n),this}removeAttrByPath(t,e={}){return this.removePropByPath(this.prefixAttrPath(t),e),this}prefixAttrPath(t){return Array.isArray(t)?["attrs"].concat(t):`attrs/${t}`}attr(t,e,n){return null==t?this.getAttrByPath():"string"===typeof t||Array.isArray(t)?1===arguments.length?this.getAttrByPath(t):null==e?this.removeAttrByPath(t,n||{}):this.setAttrByPath(t,e,n||{}):this.setAttrs(t,e||{})}get visible(){return this.isVisible()}set visible(t){this.setVisible(t)}setVisible(t,e={}){return this.store.set("visible",t,e),this}isVisible(){return!1!==this.store.get("visible")}show(t={}){return this.isVisible()||this.setVisible(!0,t),this}hide(t={}){return this.isVisible()&&this.setVisible(!1,t),this}toggleVisible(t,e={}){const n="boolean"===typeof t?t:!this.isVisible(),i="boolean"===typeof t?e:t;return n?this.show(i):this.hide(i),this}get data(){return this.getData()}set data(t){this.setData(t)}getData(){return this.store.get("data")}setData(t,e={}){if(null==t)this.removeData(e);else{const n=t=>this.store.set("data",t,e);if(!0===e.overwrite)n(t);else{const i=this.getData();!1===e.deep?n("object"===typeof t?Object.assign(Object.assign({},i),t):t):n(ah({},i,t))}}return this}replaceData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{deep:!1}))}removeData(t={}){return this.store.remove("data",t),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const t=this.getParentId();if(t&&this.model){const e=this.model.getCell(t);return this._parent=e,e}return null}getChildren(){const t=this.store.get("children");if(t&&t.length&&this.model){const e=t.map((t=>{var e;return null===(e=this.model)||void 0===e?void 0:e.getCell(t)})).filter((t=>null!=t));return this._children=e,[...e]}return null}hasParent(){return null!=this.parent}isParentOf(t){return null!=t&&t.getParent()===this}isChildOf(t){return null!=t&&this.getParent()===t}eachChild(t,e){return this.children&&this.children.forEach(t,e),this}filterChild(t,e){return this.children?this.children.filter(t,e):[]}getChildCount(){return null==this.children?0:this.children.length}getChildIndex(t){return null==this.children?-1:this.children.indexOf(t)}getChildAt(t){return null!=this.children&&t>=0?this.children[t]:null}getAncestors(t={}){const e=[];let n=this.getParent();while(n)e.push(n),n=!1!==t.deep?n.getParent():null;return e}getDescendants(t={}){if(!1!==t.deep){if(t.breadthFirst){const t=[],e=this.getChildren()||[];while(e.length>0){const n=e.shift(),i=n.getChildren();t.push(n),i&&e.push(...i)}return t}{const e=this.getChildren()||[];return e.forEach((n=>{e.push(...n.getDescendants(t))})),e}}return this.getChildren()||[]}isDescendantOf(t,e={}){if(null==t)return!1;if(!1!==e.deep){let e=this.getParent();while(e){if(e===t)return!0;e=e.getParent()}return!1}return this.isChildOf(t)}isAncestorOf(t,e={}){return null!=t&&t.isDescendantOf(this,e)}contains(t){return this.isAncestorOf(t)}getCommonAncestor(...t){return OM.getCommonAncestor(this,...t)}setParent(t,e={}){return this._parent=t,t?this.store.set("parent",t.id,e):this.store.remove("parent",e),this}setChildren(t,e={}){return this._children=t,null!=t?this.store.set("children",t.map((t=>t.id)),e):this.store.remove("children",e),this}unembed(t,e={}){const n=this.children;if(null!=n&&null!=t){const i=this.getChildIndex(t);-1!==i&&(n.splice(i,1),t.setParent(null,e),this.setChildren(n,e))}return this}embed(t,e={}){return t.addTo(this,e),this}addTo(t,e={}){return OM.isCell(t)?t.addChild(this,e):t.addCell(this,e),this}insertTo(t,e,n={}){return t.insertChild(this,e,n),this}addChild(t,e={}){return this.insertChild(t,void 0,e)}insertChild(t,e,n={}){if(null!=t&&t!==this){const i=t.getParent(),r=this!==i;let s=e;if(null==s&&(s=this.getChildCount(),r||(s-=1)),i){const e=i.getChildren();if(e){const r=e.indexOf(t);r>=0&&(t.setParent(null,n),e.splice(r,1),i.setChildren(e,n))}}let o=this.children;if(null==o?(o=[],o.push(t)):o.splice(s,0,t),t.setParent(this,n),this.setChildren(o,n),r&&this.model){const t=this.model.getIncomingEdges(this),e=this.model.getOutgoingEdges(this);t&&t.forEach((t=>t.updateParent(n))),e&&e.forEach((t=>t.updateParent(n)))}this.model&&this.model.addCell(t,n)}return this}removeFromParent(t={}){const e=this.getParent();if(null!=e){const n=e.getChildIndex(this);e.removeChildAt(n,t)}return this}removeChild(t,e={}){const n=this.getChildIndex(t);return this.removeChildAt(n,e)}removeChildAt(t,e={}){const n=this.getChildAt(t),i=this.children;return null!=i&&null!=n&&(this.unembed(n,e),n.remove(e)),n}remove(t={}){return this.batchUpdate("remove",(()=>{const e=this.getParent();e&&e.removeChild(this,t),!1!==t.deep&&this.eachChild((e=>e.remove(t))),this.model&&this.model.removeCell(this,t)})),this}transition(t,e,n={},i="/"){return this.animation.start(t,e,n,i)}stopTransition(t,e,n="/"){return this.animation.stop(t,e,n),this}getTransitions(){return this.animation.get()}translate(t,e,n){return this}scale(t,e,n,i){return this}addTools(t,e,n){const i=Array.isArray(t)?t:[t],r="string"===typeof e?e:null,s="object"===typeof e?e:"object"===typeof n?n:{};if(s.reset)return this.setTools({name:r,items:i,local:s.local},s);let o=ad(this.getTools());return null==o||null==r||o.name===r?(null==o&&(o={}),o.items||(o.items=[]),o.name=r,o.items=[...o.items,...i],this.setTools(Object.assign({},o),s)):void 0}setTools(t,e={}){return null==t?this.removeTools():this.store.set("tools",OM.normalizeTools(t),e),this}getTools(){return this.store.get("tools")}removeTools(t={}){return this.store.remove("tools",t),this}hasTools(t){const e=this.getTools();return null!=e&&(null==t||e.name===t)}hasTool(t){const e=this.getTools();return null!=e&&e.items.some((e=>"string"===typeof e?e===t:e.name===t))}removeTool(t,e={}){const n=ad(this.getTools());if(n){let i=!1;const r=n.items.slice(),s=t=>{r.splice(t,1),i=!0};if("number"===typeof t)s(t);else for(let e=r.length-1;e>=0;e-=1){const n=r[e],i="string"===typeof n?n===t:n.name===t;i&&s(e)}i&&(n.items=r,this.setTools(n,e))}return this}getBBox(t){return new db}getConnectionPoint(t,e){return new ub}toJSON(t={}){const e=Object.assign({},this.store.get()),n=Object.prototype.toString,i=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!e.shape){const t=this.constructor;throw new Error(`Unable to serialize ${i} missing "shape" prop, check the ${i} "${t.name||n.call(t)}"`)}const r=this.constructor,s=!0===t.diff,o=e.attrs||{},a=r.getDefaults(!0),l=s?this.preprocess(a,!0):a,c=l.attrs||{},h={};Object.keys(e).forEach((t=>{const r=e[t];if(null!=r&&!Array.isArray(r)&&"object"===typeof r&&!qc(r))throw new Error(`Can only serialize ${i} with plain-object props, but got a "${n.call(r)}" type of key "${t}" on ${i} "${this.id}"`);if("attrs"!==t&&"shape"!==t&&s){const n=l[t];ch(r,n)&&delete e[t]}})),Object.keys(o).forEach((t=>{const e=o[t],n=c[t];Object.keys(e).forEach((i=>{const r=e[i],s=n?n[i]:null;null==r||"object"!==typeof r||Array.isArray(r)?null!=n&&ch(s,r)||(null==h[t]&&(h[t]={}),h[t][i]=r):Object.keys(r).forEach((e=>{const o=r[e];if(null==n||null==s||!At(s)||!ch(s[e],o)){null==h[t]&&(h[t]={}),null==h[t][i]&&(h[t][i]={});const n=h[t][i];n[e]=o}}))}))}));const u=Object.assign(Object.assign({},e),{attrs:fh(h)?void 0:h});null==u.attrs&&delete u.attrs;const d=u;return 0===d.angle&&delete d.angle,ad(d)}clone(t={}){if(!t.deep){const e=Object.assign({},this.store.get());t.keepId||delete e.id,delete e.parent,delete e.children;const n=this.constructor;return new n(e)}const e=OM.deepClone(this);return e[this.id]}findView(t){return t.renderer.findViewByCell(this)}startBatch(t,e={},n=this.model){return this.notify("batch:start",{name:t,data:e,cell:this}),n&&n.startBatch(t,Object.assign(Object.assign({},e),{cell:this})),this}stopBatch(t,e={},n=this.model){return n&&n.stopBatch(t,Object.assign(Object.assign({},e),{cell:this})),this.notify("batch:stop",{name:t,data:e,cell:this}),this}batchUpdate(t,e,n){const i=this.model;this.startBatch(t,n,i);const r=e();return this.stopBatch(t,n,i),r}dispose(){this.removeFromParent(),this.store.dispose()}}OM.defaults={},OM.attrHooks={},OM.propHooks=[],AM([Ux.dispose()],OM.prototype,"dispose",null),function(t){function e(t){return"string"===typeof t?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}t.normalizeTools=e}(OM||(OM={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNode&&"function"===typeof i.isEdge&&"function"===typeof i.prop&&"function"===typeof i.attr}t.toStringTag=`X6.${t.name}`,t.isCell=e}(OM||(OM={})),function(t){function e(...t){const e=t.filter((t=>null!=t)).map((t=>t.getAncestors())).sort(((t,e)=>t.length-e.length)),n=e.shift();return n.find((t=>e.every((e=>e.includes(t)))))||null}function n(t,e={}){let n=null;for(let i=0,r=t.length;i<r;i+=1){const r=t[i];let s=r.getBBox(e);if(s){if(r.isNode()){const t=r.getAngle();null!=t&&0!==t&&(s=s.bbox(t))}n=null==n?s:n.union(s)}}return n}function i(e){const n=[e,...e.getDescendants({deep:!0})];return t.cloneCells(n)}function r(t){const e=Hn(t),n=e.reduce(((t,e)=>(t[e.id]=e.clone(),t)),{});return e.forEach((t=>{const e=n[t.id];if(e.isEdge()){const t=e.getSourceCellId(),i=e.getTargetCellId();t&&n[t]&&e.setSource(Object.assign(Object.assign({},e.getSource()),{cell:n[t].id})),i&&n[i]&&e.setTarget(Object.assign(Object.assign({},e.getTarget()),{cell:n[i].id}))}const i=t.getParent();i&&n[i.id]&&e.setParent(n[i.id]);const r=t.getChildren();if(r&&r.length){const t=r.reduce(((t,e)=>(n[e.id]&&t.push(n[e.id]),t)),[]);t.length>0&&e.setChildren(t)}})),n}t.getCommonAncestor=e,t.getCellsBBox=n,t.deepClone=i,t.cloneCells=r}(OM||(OM={})),function(t){t.config({propHooks(e){var{tools:n}=e,i=DM(e,["tools"]);return n&&(i.tools=t.normalizeTools(n)),i}})}(OM||(OM={})),function(t){let e,n;function i(t,i){return i?null!=e&&e.exist(t):null!=n&&n.exist(t)}function r(t){e=t}function s(t){n=t}t.exist=i,t.setEdgeRegistry=r,t.setNodeRegistry=s}(SM||(SM={}));class PM{constructor(t){this.ports=[],this.groups={},this.init(ad(t))}getPorts(){return this.ports}getGroup(t){return null!=t?this.groups[t]:null}getPortsByGroup(t){return this.ports.filter((e=>e.group===t||null==e.group&&null==t))}getPortsLayoutByGroup(t,e){const n=this.getPortsByGroup(t),i=t?this.getGroup(t):null,r=i?i.position:null,s=r?r.name:null;let o;if(null!=s){const t=Cx.registry.get(s);if(null==t)return Cx.registry.onNotFound(s);o=t}else o=Cx.presets.left;const a=n.map((t=>t&&t.position&&t.position.args||{})),l=r&&r.args||{},c=o(a,e,l);return c.map(((t,i)=>{const r=n[i];return{portLayout:t,portId:r.id,portSize:r.size,portAttrs:r.attrs,labelSize:r.label.size,labelLayout:this.getPortLabelLayout(r,ub.create(t.position),e)}}))}init(t){const{groups:e,items:n}=t;null!=e&&Object.keys(e).forEach((t=>{this.groups[t]=this.parseGroup(e[t])})),Array.isArray(n)&&n.forEach((t=>{this.ports.push(this.parsePort(t))}))}parseGroup(t){return Object.assign(Object.assign({},t),{label:this.getLabel(t,!0),position:this.getPortPosition(t.position,!0)})}parsePort(t){const e=Object.assign({},t),n=this.getGroup(t.group)||{};return e.markup=e.markup||n.markup,e.attrs=ah({},n.attrs,e.attrs),e.position=this.createPosition(n,e),e.label=ah({},n.label,this.getLabel(e)),e.zIndex=this.getZIndex(n,e),e.size=Object.assign(Object.assign({},n.size),e.size),e}getZIndex(t,e){return"number"===typeof e.zIndex?e.zIndex:"number"===typeof t.zIndex||"auto"===t.zIndex?t.zIndex:"auto"}createPosition(t,e){return ah({name:"left",args:{}},t.position,{args:e.args})}getPortPosition(t,e=!1){if(null==t){if(e)return{name:"left",args:{}}}else{if("string"===typeof t)return{name:t,args:{}};if(Array.isArray(t))return{name:"absolute",args:{x:t[0],y:t[1]}};if("object"===typeof t)return t}return{args:{}}}getPortLabelPosition(t,e=!1){if(null==t){if(e)return{name:"left",args:{}}}else{if("string"===typeof t)return{name:t,args:{}};if("object"===typeof t)return t}return{args:{}}}getLabel(t,e=!1){const n=t.label||{};return n.position=this.getPortLabelPosition(n.position,e),n}getPortLabelLayout(t,e,n){const i=t.label.position.name||"left",r=t.label.position.args||{},s=Ix.registry.get(i)||Ix.presets.left;return s?s(e,n,r):null}}var TM=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class NM extends OM{constructor(t={}){super(t),this.initPorts()}get[Symbol.toStringTag](){return NM.toStringTag}preprocess(t,e){const{x:n,y:i,width:r,height:s}=t,o=TM(t,["x","y","width","height"]);if(null!=n||null!=i){const t=o.position;o.position=Object.assign(Object.assign({},t),{x:null!=n?n:t?t.x:0,y:null!=i?i:t?t.y:0})}if(null!=r||null!=s){const t=o.size;o.size=Object.assign(Object.assign({},t),{width:null!=r?r:t?t.width:0,height:null!=s?s:t?t.height:0})}return super.preprocess(o,e)}isNode(){return!0}size(t,e,n){return void 0===t?this.getSize():"number"===typeof t?this.setSize(t,e,n):this.setSize(t,e)}getSize(){const t=this.store.get("size");return t?Object.assign({},t):{width:1,height:1}}setSize(t,e,n){return"object"===typeof t?this.resize(t.width,t.height,e):this.resize(t,e,n),this}resize(t,e,n={}){this.startBatch("resize",n);const i=n.direction;if(i){const r=this.getSize();switch(i){case"left":case"right":e=r.height;break;case"top":case"bottom":t=r.width;break;default:break}const s={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3};let o=s[i];const a=ib.normalize(this.getAngle()||0);n.absolute&&(o+=Math.floor((a+45)/90),o%=4);const l=this.getBBox();let c;c=0===o?l.getBottomLeft():1===o?l.getCorner():2===o?l.getTopRight():l.getOrigin();const h=c.clone().rotate(-a,l.getCenter()),u=Math.sqrt(t*t+e*e)/2;let d=o*Math.PI/2;d+=Math.atan(o%2===0?e/t:t/e),d-=ib.toRad(a);const p=ub.fromPolar(u,d,h),g=p.clone().translate(t/-2,e/-2);this.store.set("size",{width:t,height:e},n),this.setPosition(g.x,g.y,n)}else this.store.set("size",{width:t,height:e},n);return this.stopBatch("resize",n),this}scale(t,e,n,i={}){const r=this.getBBox().scale(t,e,null==n?void 0:n);return this.startBatch("scale",i),this.setPosition(r.x,r.y,i),this.resize(r.width,r.height,i),this.stopBatch("scale"),this}position(t,e,n){return"number"===typeof t?this.setPosition(t,e,n):this.getPosition(t)}getPosition(t={}){if(t.relative){const t=this.getParent();if(null!=t&&t.isNode()){const e=this.getPosition(),n=t.getPosition();return{x:e.x-n.x,y:e.y-n.y}}}const e=this.store.get("position");return e?Object.assign({},e):{x:0,y:0}}setPosition(t,e,n={}){let i,r,s;if("object"===typeof t?(i=t.x,r=t.y,s=e||{}):(i=t,r=e,s=n||{}),s.relative){const t=this.getParent();if(null!=t&&t.isNode()){const e=t.getPosition();i+=e.x,r+=e.y}}if(s.deep){const t=this.getPosition();this.translate(i-t.x,r-t.y,s)}else this.store.set("position",{x:i,y:r},s);return this}translate(t=0,e=0,n={}){if(0===t&&0===e)return this;n.translateBy=n.translateBy||this.id;const i=this.getPosition();if(null!=n.restrict&&n.translateBy===this.id){const r=this.getBBox({deep:!0}),s=n.restrict,o=i.x-r.x,a=i.y-r.y,l=Math.max(s.x+o,Math.min(s.x+s.width+o-r.width,i.x+t)),c=Math.max(s.y+a,Math.min(s.y+s.height+a-r.height,i.y+e));t=l-i.x,e=c-i.y}const r={x:i.x+t,y:i.y+e};return n.tx=t,n.ty=e,n.transition?("object"!==typeof n.transition&&(n.transition={}),this.transition("position",r,Object.assign(Object.assign({},n.transition),{interp:Yx.object})),this.eachChild((i=>{var r;const s=null===(r=n.exclude)||void 0===r?void 0:r.includes(i);s||i.translate(t,e,n)}))):(this.startBatch("translate",n),this.store.set("position",r,n),this.eachChild((i=>{var r;const s=null===(r=n.exclude)||void 0===r?void 0:r.includes(i);s||i.translate(t,e,n)})),this.stopBatch("translate",n)),this}angle(t,e){return null==t?this.getAngle():this.rotate(t,e)}getAngle(){return this.store.get("angle",0)}rotate(t,e={}){const n=this.getAngle();if(e.center){const i=this.getSize(),r=this.getPosition(),s=this.getBBox().getCenter();s.rotate(n-t,e.center);const o=s.x-i.width/2-r.x,a=s.y-i.height/2-r.y;this.startBatch("rotate",{angle:t,options:e}),this.setPosition(r.x+o,r.y+a,e),this.rotate(t,Object.assign(Object.assign({},e),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",e.absolute?t:(n+t)%360,e);return this}getBBox(t={}){if(t.deep){const t=this.getDescendants({deep:!0,breadthFirst:!0});return t.push(this),OM.getCellsBBox(t)}return db.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(t,e){const n=this.getBBox(),i=n.getCenter(),r=t.getTerminal(e);if(null==r)return i;const s=r.port;if(!s||!this.hasPort(s))return i;const o=this.getPort(s);if(!o||!o.group)return i;const a=this.getPortsPosition(o.group),l=a[s].position,c=ub.create(l).translate(n.getOrigin()),h=this.getAngle();return h&&c.rotate(-h,i),c}fit(t={}){const e=this.getChildren()||[],n=e.filter((t=>t.isNode()));if(0===n.length)return this;this.startBatch("fit-embeds",t),t.deep&&n.forEach((e=>e.fit(t)));let{x:i,y:r,width:s,height:o}=OM.getCellsBBox(n);const a=Vm(t.padding);return i-=a.left,r-=a.top,s+=a.left+a.right,o+=a.bottom+a.top,this.store.set({position:{x:i,y:r},size:{width:s,height:o}},t),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(t){this.setPortContainerMarkup(t)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||hE.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(t,e={}){return this.store.set("portContainerMarkup",hE.clone(t),e),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(t){this.setPortMarkup(t)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||hE.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(t,e={}){return this.store.set("portMarkup",hE.clone(t),e),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(t){this.setPortLabelMarkup(t)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||hE.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(t,e={}){return this.store.set("portLabelMarkup",hE.clone(t),e),this}get ports(){const t=this.store.get("ports",{items:[]});return null==t.items&&(t.items=[]),t}getPorts(){return ad(this.ports.items)}getPortsByGroup(t){return this.getPorts().filter((e=>e.group===t))}getPort(t){return ad(this.ports.items.find((e=>e.id&&e.id===t)))}getPortAt(t){return this.ports.items[t]||null}hasPorts(){return this.ports.items.length>0}hasPort(t){return-1!==this.getPortIndex(t)}getPortIndex(t){const e="string"===typeof t?t:t.id;return null!=e?this.ports.items.findIndex((t=>t.id===e)):-1}getPortsPosition(t){const e=this.getSize(),n=this.port.getPortsLayoutByGroup(t,new db(0,0,e.width,e.height));return n.reduce(((t,e)=>{const n=e.portLayout;return t[e.portId]={position:Object.assign({},n.position),angle:n.angle||0},t}),{})}getPortProp(t,e){return this.getPropByPath(this.prefixPortPath(t,e))}setPortProp(t,e,n,i){if("string"===typeof e||Array.isArray(e)){const r=this.prefixPortPath(t,e),s=n;return this.setPropByPath(r,s,i)}const r=this.prefixPortPath(t),s=e;return this.setPropByPath(r,s,n)}removePortProp(t,e,n){return"string"===typeof e||Array.isArray(e)?this.removePropByPath(this.prefixPortPath(t,e),n):this.removePropByPath(this.prefixPortPath(t),e)}portProp(t,e,n,i){return null==e?this.getPortProp(t):"string"===typeof e||Array.isArray(e)?2===arguments.length?this.getPortProp(t,e):null==n?this.removePortProp(t,e,i):this.setPortProp(t,e,n,i):this.setPortProp(t,e,n)}prefixPortPath(t,e){const n=this.getPortIndex(t);if(-1===n)throw new Error(`Unable to find port with id: "${t}"`);return null==e||""===e?["ports","items",`${n}`]:Array.isArray(e)?["ports","items",`${n}`,...e]:`ports/items/${n}/${e}`}addPort(t,e){const n=[...this.ports.items];return n.push(t),this.setPropByPath("ports/items",n,e),this}addPorts(t,e){return this.setPropByPath("ports/items",[...this.ports.items,...t],e),this}insertPort(t,e,n){const i=[...this.ports.items];return i.splice(t,0,e),this.setPropByPath("ports/items",i,n),this}removePort(t,e={}){return this.removePortAt(this.getPortIndex(t),e)}removePortAt(t,e={}){if(t>=0){const n=[...this.ports.items];n.splice(t,1),e.rewrite=!0,this.setPropByPath("ports/items",n,e)}return this}removePorts(t,e){let n;if(Array.isArray(t)){if(n=e||{},t.length){n.rewrite=!0;const e=[...this.ports.items],i=e.filter((e=>!t.some((t=>{const n="string"===typeof t?t:t.id;return e.id===n}))));this.setPropByPath("ports/items",i,n)}}else n=t||{},n.rewrite=!0,this.setPropByPath("ports/items",[],n);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(t,e){return this.port.getPortsLayoutByGroup(t,e)}initPorts(){this.updatePortData(),this.on("change:ports",(()=>{this.processRemovedPort(),this.updatePortData()}))}processRemovedPort(){const t=this.ports,e={};t.items.forEach((t=>{t.id&&(e[t.id]=!0)}));const n={},i=this.store.getPrevious("ports")||{items:[]};i.items.forEach((t=>{t.id&&!e[t.id]&&(n[t.id]=!0)}));const r=this.model;if(r&&!fh(n)){const t=r.getConnectedEdges(this,{incoming:!0});t.forEach((t=>{const e=t.getTargetPortId();e&&n[e]&&t.remove()}));const e=r.getConnectedEdges(this,{outgoing:!0});e.forEach((t=>{const e=t.getSourcePortId();e&&n[e]&&t.remove()}))}}validatePorts(){const t={},e=[];return this.ports.items.forEach((n=>{"object"!==typeof n&&e.push(`Invalid port ${n}.`),null==n.id&&(n.id=this.generatePortId()),t[n.id]&&e.push("Duplicitied port id."),t[n.id]=!0})),e}generatePortId(){return Om()}updatePortData(){const t=this.validatePorts();if(t.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(t.join(" "));const e=this.port?this.port.getPorts():null;this.port=new PM(this.ports);const n=this.port.getPorts(),i=e?n.filter((t=>e.find((e=>e.id===t.id))?null:t)):[...n],r=e?e.filter((t=>n.find((e=>e.id===t.id))?null:t)):[];i.length>0&&this.notify("ports:added",{added:i,cell:this,node:this}),r.length>0&&this.notify("ports:removed",{removed:r,cell:this,node:this})}}NM.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNode&&"function"===typeof i.isEdge&&"function"===typeof i.prop&&"function"===typeof i.attr&&"function"===typeof i.size&&"function"===typeof i.position}t.toStringTag=`X6.${t.name}`,t.isNode=e}(NM||(NM={})),function(t){t.config({propHooks(t){var{ports:e}=t,n=TM(t,["ports"]);return e&&(n.ports=Array.isArray(e)?{items:e}:e),n}})}(NM||(NM={})),function(t){t.registry=Yv.create({type:"node",process(e,n){if(SM.exist(e,!0))throw new Error(`Node with name '${e}' was registered by anthor Edge`);if("function"===typeof n)return n.config({shape:e}),n;let i=t;const{inherit:r}=n,s=TM(n,["inherit"]);if(r)if("string"===typeof r){const t=this.get(r);null==t?this.onNotFound(r,"inherited"):i=t}else i=r;null==s.constructorName&&(s.constructorName=e);const o=i.define.call(i,s);return o.config({shape:e}),o}}),SM.setNodeRegistry(t.registry)}(NM||(NM={})),function(t){let e=0;function n(t){return t?Am(t):(e+=1,`CustomNode${e}`)}function i(e){const{constructorName:i,overwrite:r}=e,s=TM(e,["constructorName","overwrite"]),o=Ed(n(i||s.shape),this);return o.config(s),s.shape&&t.registry.register(s.shape,o,r),o}function r(e){const n=e.shape||"rect",i=t.registry.get(n);return i?new i(e):t.registry.onNotFound(n)}t.define=i,t.create=r}(NM||(NM={}));var jM=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class LM extends NM{get label(){return this.getLabel()}set label(t){this.setLabel(t)}getLabel(){return this.getAttrByPath("text/text")}setLabel(t,e){return null==t?this.removeLabel():this.setAttrByPath("text/text",t,e),this}removeLabel(){return this.removeAttrByPath("text/text"),this}}(function(t){t.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},t.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},t.config({attrs:{text:Object.assign({},t.labelAttr)},propHooks(t){const{label:e}=t,n=jM(t,["label"]);return e&&Md(n,"attrs/text/text",e),n}})})(LM||(LM={}));var FM=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function zM(t,e=!1){return`<g class="rotatable"><g class="scalable"><${t}/></g>${e?"":"<text/>"}</g>`}function RM(t){return`basic.${t}`}function BM(t="xlink:href"){const e=e=>{const{imageUrl:n,imageWidth:i,imageHeight:r}=e,s=FM(e,["imageUrl","imageWidth","imageHeight"]);if(null!=n||null!=i||null!=r){const e=()=>{if(s.attrs){const e=s.attrs.image;null!=n&&(e[t]=n),null!=i&&(e.width=i),null!=r&&(e.height=r),s.attrs.image=e}};s.attrs?(null==s.attrs.image&&(s.attrs.image={}),e()):(s.attrs={image:{}},e())}return s};return e}function IM(t,e,n={}){const i=RM(t),r={constructorName:i,attrs:{".":{fill:"#ffffff",stroke:"none"},[t]:{fill:"#ffffff",stroke:"#000000"}}};n.ignoreMarkup||(r.markup=zM(t,!0===n.noText));const s=n.parent||LM;return s.define(ah(r,e,{shape:i}))}IM("rect",{attrs:{rect:{width:100,height:60}}}),IM("circle",{width:60,height:60,attrs:{circle:{r:30,cx:30,cy:30}}}),IM("ellipse",{width:60,height:40,attrs:{ellipse:{rx:30,ry:20,cx:30,cy:20}}}),IM("polygon",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),IM("polyline",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),IM("image",{attrs:{text:{refY:null,refDy:16}},propHooks:BM()});var $M=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const VM=IM("path",{width:60,height:60,attrs:{text:{ref:"path",refY:null,refDy:16}},propHooks(t){const{d:e}=t,n=$M(t,["d"]);return null!=e&&Md(n,"attrs/path/d",e),n}});IM("rhombus",{d:"M 30 0 L 60 30 30 60 0 30 z",attrs:{text:{refY:.5,refDy:null}}},{parent:VM,ignoreMarkup:!0}),IM("cylinder",{width:40,height:40,attrs:{path:{fill:"#FFFFFF",stroke:"#cbd2d7",strokeWidth:3,d:["M 0 10 C 10 5, 30 5, 40 10 C 30 15, 10 15, 0 10","L 0 20","C 10 25, 30 25, 40 20","L 40 10"].join(" ")},text:{refY:.7,refDy:null,fill:"#435460"}}},{parent:VM,ignoreMarkup:!0});var _M=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class GM extends OM{constructor(t={}){super(t)}get[Symbol.toStringTag](){return GM.toStringTag}preprocess(t,e){const{source:n,sourceCell:i,sourcePort:r,sourcePoint:s,target:o,targetCell:a,targetPort:l,targetPoint:c}=t,h=_M(t,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),u=h,d=t=>"string"===typeof t||"number"===typeof t;if(null!=n)if(OM.isCell(n))u.source={cell:n.id};else if(d(n))u.source={cell:n};else if(ub.isPoint(n))u.source=n.toJSON();else if(Array.isArray(n))u.source={x:n[0],y:n[1]};else{const t=n.cell;OM.isCell(t)?u.source=Object.assign(Object.assign({},n),{cell:t.id}):u.source=n}if(null!=i||null!=r){let t=u.source;if(null!=i){const e=d(i)?i:i.id;t?t.cell=e:t=u.source={cell:e}}null!=r&&t&&(t.port=r)}else null!=s&&(u.source=ub.create(s).toJSON());if(null!=o)if(OM.isCell(o))u.target={cell:o.id};else if(d(o))u.target={cell:o};else if(ub.isPoint(o))u.target=o.toJSON();else if(Array.isArray(o))u.target={x:o[0],y:o[1]};else{const t=o.cell;OM.isCell(t)?u.target=Object.assign(Object.assign({},o),{cell:t.id}):u.target=o}if(null!=a||null!=l){let t=u.target;if(null!=a){const e=d(a)?a:a.id;t?t.cell=e:t=u.target={cell:e}}null!=l&&t&&(t.port=l)}else null!=c&&(u.target=ub.create(c).toJSON());return super.preprocess(u,e)}setup(){super.setup(),this.on("change:labels",(t=>this.onLabelsChanged(t))),this.on("change:vertices",(t=>this.onVertexsChanged(t)))}isEdge(){return!0}disconnect(t={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},t),this}get source(){return this.getSource()}set source(t){this.setSource(t)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(t,e,n={}){return this.setTerminal("source",t,e,n)}get target(){return this.getTarget()}set target(t){this.setTarget(t)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(t,e,n={}){return this.setTerminal("target",t,e,n)}getTerminal(t){return Object.assign({},this.store.get(t))}setTerminal(t,e,n,i={}){if(OM.isCell(e))return this.store.set(t,ah({},n,{cell:e.id}),i),this;const r=e;return ub.isPoint(e)||null!=r.x&&null!=r.y?(this.store.set(t,ah({},n,{x:r.x,y:r.y}),i),this):(this.store.set(t,ad(e),i),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(t){const e=this[t];if(ub.isPointLike(e))return ub.create(e);const n=this.getTerminalCell(t);return n?n.getConnectionPoint(this,t):new ub}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(t){if(this.model){const e="source"===t?this.getSourceCellId():this.getTargetCellId();if(e)return this.model.getCell(e)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(t){let e=this;const n={};while(e&&e.isEdge()){if(n[e.id])return null;n[e.id]=!0,e=e.getTerminalCell(t)}return e&&e.isNode()?e:null}get router(){return this.getRouter()}set router(t){null==t?this.removeRouter():this.setRouter(t)}getRouter(){return this.store.get("router")}setRouter(t,e,n){return"object"===typeof t?this.store.set("router",t,e):this.store.set("router",{name:t,args:e},n),this}removeRouter(t={}){return this.store.remove("router",t),this}get connector(){return this.getConnector()}set connector(t){null==t?this.removeConnector():this.setConnector(t)}getConnector(){return this.store.get("connector")}setConnector(t,e,n){return"object"===typeof t?this.store.set("connector",t,e):this.store.set("connector",{name:t,args:e},n),this}removeConnector(t={}){return this.store.remove("connector",t)}get strategy(){return this.getStrategy()}set strategy(t){null==t?this.removeStrategy():this.setStrategy(t)}getStrategy(){return this.store.get("strategy")}setStrategy(t,e,n){return"object"===typeof t?this.store.set("strategy",t,e):this.store.set("strategy",{name:t,args:e},n),this}removeStrategy(t={}){return this.store.remove("strategy",t)}getDefaultLabel(){const t=this.constructor,e=this.store.get("defaultLabel")||t.defaultLabel||{};return ad(e)}get labels(){return this.getLabels()}set labels(t){this.setLabels(t)}getLabels(){return[...this.store.get("labels",[])].map((t=>this.parseLabel(t)))}setLabels(t,e={}){return this.store.set("labels",Array.isArray(t)?t:[t],e),this}insertLabel(t,e,n={}){const i=this.getLabels(),r=i.length;let s=null!=e&&Number.isFinite(e)?e:r;return s<0&&(s=r+s+1),i.splice(s,0,this.parseLabel(t)),this.setLabels(i,n)}appendLabel(t,e={}){return this.insertLabel(t,-1,e)}getLabelAt(t){const e=this.getLabels();return null!=t&&Number.isFinite(t)?this.parseLabel(e[t]):null}setLabelAt(t,e,n={}){if(null!=t&&Number.isFinite(t)){const i=this.getLabels();i[t]=this.parseLabel(e),this.setLabels(i,n)}return this}removeLabelAt(t,e={}){const n=this.getLabels(),i=null!=t&&Number.isFinite(t)?t:-1,r=n.splice(i,1);return this.setLabels(n,e),r.length?r[0]:null}parseLabel(t){if("string"===typeof t){const e=this.constructor;return e.parseStringLabel(t)}return t}onLabelsChanged({previous:t,current:e}){const n=t&&e?e.filter((e=>t.find((t=>e===t||ch(e,t)))?null:e)):e?[...e]:[],i=t&&e?t.filter((t=>e.find((e=>t===e||ch(t,e)))?null:t)):t?[...t]:[];n.length>0&&this.notify("labels:added",{added:n,cell:this,edge:this}),i.length>0&&this.notify("labels:removed",{removed:i,cell:this,edge:this})}get vertexMarkup(){return this.getVertexMarkup()}set vertexMarkup(t){this.setVertexMarkup(t)}getDefaultVertexMarkup(){return this.store.get("defaultVertexMarkup")||hE.getEdgeVertexMarkup()}getVertexMarkup(){return this.store.get("vertexMarkup")||this.getDefaultVertexMarkup()}setVertexMarkup(t,e={}){return this.store.set("vertexMarkup",hE.clone(t),e),this}get vertices(){return this.getVertices()}set vertices(t){this.setVertices(t)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(t,e={}){const n=Array.isArray(t)?t:[t];return this.store.set("vertices",n.map((t=>ub.toJSON(t))),e),this}insertVertex(t,e,n={}){const i=this.getVertices(),r=i.length;let s=null!=e&&Number.isFinite(e)?e:r;return s<0&&(s=r+s+1),i.splice(s,0,ub.toJSON(t)),this.setVertices(i,n)}appendVertex(t,e={}){return this.insertVertex(t,-1,e)}getVertexAt(t){if(null!=t&&Number.isFinite(t)){const e=this.getVertices();return e[t]}return null}setVertexAt(t,e,n={}){if(null!=t&&Number.isFinite(t)){const i=this.getVertices();i[t]=e,this.setVertices(i,n)}return this}removeVertexAt(t,e={}){const n=this.getVertices(),i=null!=t&&Number.isFinite(t)?t:-1;return n.splice(i,1),this.setVertices(n,e)}onVertexsChanged({previous:t,current:e}){const n=t&&e?e.filter((e=>t.find((t=>ub.equals(e,t)))?null:e)):e?[...e]:[],i=t&&e?t.filter((t=>e.find((e=>ub.equals(t,e)))?null:t)):t?[...t]:[];n.length>0&&this.notify("vertexs:added",{added:n,cell:this,edge:this}),i.length>0&&this.notify("vertexs:removed",{removed:i,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||hE.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}get toolMarkup(){return this.getToolMarkup()}set toolMarkup(t){this.setToolMarkup(t)}getDefaultToolMarkup(){return this.store.get("defaultToolMarkup")||hE.getEdgeToolMarkup()}getToolMarkup(){return this.store.get("toolMarkup")||this.getDefaultToolMarkup()}setToolMarkup(t,e={}){return this.store.set("toolMarkup",t,e),this}get doubleToolMarkup(){return this.getDoubleToolMarkup()}set doubleToolMarkup(t){this.setDoubleToolMarkup(t)}getDefaultDoubleToolMarkup(){return this.store.get("defaultDoubleToolMarkup")}getDoubleToolMarkup(){return this.store.get("doubleToolMarkup")||this.getDefaultDoubleToolMarkup()}setDoubleToolMarkup(t,e={}){return this.store.set("doubleToolMarkup",t,e),this}get arrowheadMarkup(){return this.getArrowheadMarkup()}set arrowheadMarkup(t){this.setArrowheadMarkup(t)}getDefaultArrowheadMarkup(){return this.store.get("defaultArrowheadMarkup")||hE.getEdgeArrowheadMarkup()}getArrowheadMarkup(){return this.store.get("arrowheadMarkup")||this.getDefaultArrowheadMarkup()}setArrowheadMarkup(t,e={}){return this.store.set("arrowheadMarkup",t,e),this}translate(t,e,n={}){return n.translateBy=n.translateBy||this.id,n.tx=t,n.ty=e,this.applyToPoints((n=>({x:(n.x||0)+t,y:(n.y||0)+e})),n)}scale(t,e,n,i={}){return this.applyToPoints((i=>ub.create(i).scale(t,e,n).toJSON()),i)}applyToPoints(t,e={}){const n={},i=this.getSource(),r=this.getTarget();ub.isPointLike(i)&&(n.source=t(i)),ub.isPointLike(r)&&(n.target=t(r));const s=this.getVertices();return s.length>0&&(n.vertices=s.map(t)),this.store.set(n,e),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const t=[this.getSourcePoint(),...this.getVertices().map((t=>ub.create(t))),this.getTargetPoint()];return new fb(t)}updateParent(t){let e=null;const n=this.getSourceCell(),i=this.getTargetCell(),r=this.getParent();return n&&i&&(e=n===i||n.isDescendantOf(i)?i:i.isDescendantOf(n)?n:OM.getCommonAncestor(n,i)),!r||e&&e.id===r.id||r.unembed(this,t),e&&e.embed(this,t),e}hasLoop(t={}){const e=this.getSource(),n=this.getTarget(),i=e.cell,r=n.cell;if(!i||!r)return!1;let s=i===r;if(!s&&t.deep&&this._model){const e=this.getSourceCell(),n=this.getTargetCell();e&&n&&(s=e.isAncestorOf(n,t)||n.isAncestorOf(e,t))}return s}getFragmentAncestor(){const t=[this,this.getSourceNode(),this.getTargetNode()].filter((t=>null!=t));return this.getCommonAncestor(...t)}isFragmentDescendantOf(t){const e=this.getFragmentAncestor();return!!e&&(e.id===t.id||e.isDescendantOf(t))}}GM.defaults={},function(t){function e(t,e){const n=t,i=e;return n.cell===i.cell&&(n.port===i.port||null==n.port&&null==i.port)}t.equalTerminals=e}(GM||(GM={})),function(t){function e(t){return{attrs:{label:{text:t}}}}t.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}},t.parseStringLabel=e}(GM||(GM={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNode&&"function"===typeof i.isEdge&&"function"===typeof i.prop&&"function"===typeof i.attr&&"function"===typeof i.disconnect&&"function"===typeof i.getSource&&"function"===typeof i.getTarget}t.toStringTag=`X6.${t.name}`,t.isEdge=e}(GM||(GM={})),function(t){t.registry=Yv.create({type:"edge",process(e,n){if(SM.exist(e,!1))throw new Error(`Edge with name '${e}' was registered by anthor Node`);if("function"===typeof n)return n.config({shape:e}),n;let i=t;const{inherit:r="edge"}=n,s=_M(n,["inherit"]);if("string"===typeof r){const t=this.get(r||"edge");null==t&&r?this.onNotFound(r,"inherited"):i=t}else i=r;null==s.constructorName&&(s.constructorName=e);const o=i.define.call(i,s);return o.config({shape:e}),o}}),SM.setEdgeRegistry(t.registry)}(GM||(GM={})),function(t){let e=0;function n(t){return t?Am(t):(e+=1,`CustomEdge${e}`)}function i(e){const{constructorName:i,overwrite:r}=e,s=_M(e,["constructorName","overwrite"]),o=Ed(n(i||s.shape),this);return o.config(s),s.shape&&t.registry.register(s.shape,o,r),o}function r(e){const n=e.shape||"edge",i=t.registry.get(n);return i?new i(e):t.registry.onNotFound(n)}t.define=i,t.create=r}(GM||(GM={})),function(t){const e="basic.edge";t.config({shape:e,propHooks(e){const{label:n,vertices:i}=e,r=_M(e,["label","vertices"]);if(n){null==r.labels&&(r.labels=[]);const e="string"===typeof n?t.parseStringLabel(n):n;r.labels.push(e)}return i&&Array.isArray(i)&&(r.vertices=i.map((t=>ub.create(t).toJSON()))),r}}),t.registry.register(e,t)}(GM||(GM={}));var HM=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class UM extends fE{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.markerCache={}}get[Symbol.toStringTag](){return UM.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const t=this.sourceView;if(!t){const t=this.cell.getSource();return new db(t.x,t.y)}const e=this.sourceMagnet;return t.isEdgeElement(e)?new db(this.sourceAnchor.x,this.sourceAnchor.y):t.getBBoxOfElement(e||t.container)}get targetBBox(){const t=this.targetView;if(!t){const t=this.cell.getTarget();return new db(t.x,t.y)}const e=this.targetMagnet;return t.isEdgeElement(e)?new db(this.targetAnchor.x,this.targetAnchor.y):t.getBBoxOfElement(e||t.container)}isEdgeView(){return!0}confirmUpdate(t,e={}){let n=t;if(this.hasAction(n,"source")){if(!this.updateTerminalProperties("source"))return n;n=this.removeAction(n,"source")}if(this.hasAction(n,"target")){if(!this.updateTerminalProperties("target"))return n;n=this.removeAction(n,"target")}const i=this.graph,r=this.sourceView,s=this.targetView;return i&&(r&&!i.renderer.isViewMounted(r)||s&&!i.renderer.isViewMounted(s))?n:this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","vertices","labels","tools","widget"]),n):(n=this.handleAction(n,"vertices",(()=>this.renderVertexMarkers())),n=this.handleAction(n,"update",(()=>this.update(null,e))),n=this.handleAction(n,"labels",(()=>this.onLabelsChange(e))),n=this.handleAction(n,"tools",(()=>{this.renderTools(),this.updateToolsPosition()})),n=this.handleAction(n,"widget",(()=>this.renderExternalTools())),n)}onLabelsChange(t={}){this.shouldRerenderLabels(t)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(t={}){const e=this.cell.previous("labels");if(null==e)return!0;if("propertyPathArray"in t&&"propertyValue"in t){const n=t.propertyPathArray||[],i=n.length;if(i>1){const r=n[1];if(e[r]){if(2===i)return"object"===typeof t.propertyValue&&ql(t.propertyValue,"markup");if("markup"!==n[2])return!1}}}return!0}render(){return this.empty(),this.containers={},this.renderMarkup(),this.renderLabels(),this.update(),this}renderMarkup(){const t=this.cell.markup;if(t)return"string"===typeof t?this.renderStringMarkup(t):this.renderJSONMarkup(t);throw new TypeError("Invalid edge markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.append(e.fragment)}renderStringMarkup(t){const e=this.containers,n=Rb.createVectors(t);n.forEach((t=>{const n=t.attr("class");n&&(e[bm(n)]=t.node)})),this.renderTools(),this.renderVertexMarkers(),this.renderArrowheadMarkers(),jy(this.container,n.map((t=>t.node)))}renderLabels(){const t=this.cell,e=t.getLabels(),n=e.length;let i=this.containers.labels;if(this.labelCache={},this.labelSelectors={},n<=0)return i&&i.parentNode&&i.parentNode.removeChild(i),this;i?this.empty(i):(i=xy("g"),this.addClass(this.prefixClassName("edge-labels"),i),this.containers.labels=i);for(let r=0,s=e.length;r<s;r+=1){const n=e[r],s=this.normalizeLabelMarkup(this.parseLabelMarkup(n.markup));let o,a;if(s)o=s.node,a=s.selectors;else{const e=t.getDefaultLabel(),n=this.normalizeLabelMarkup(this.parseLabelMarkup(e.markup));o=n.node,a=n.selectors}o.setAttribute("data-index",`${r}`),i.appendChild(o);const l=this.rootSelector;if(a[l])throw new Error("Ambiguous label root selector.");a[l]=o,this.labelCache[r]=o,this.labelSelectors[r]=a}return null==i.parentNode&&this.container.appendChild(i),this.updateLabels(),this.customizeLabels(),this}parseLabelMarkup(t){return t?"string"===typeof t?this.parseLabelStringMarkup(t):this.parseJSONMarkup(t):null}parseLabelStringMarkup(t){const e=Rb.createVectors(t),n=document.createDocumentFragment();for(let i=0,r=e.length;i<r;i+=1){const t=e[i].node;n.appendChild(t)}return{fragment:n,selectors:{}}}normalizeLabelMarkup(t){if(null==t)return;const e=t.fragment;if(!(e instanceof DocumentFragment)||!e.hasChildNodes())throw new Error("Invalid label markup.");let n;const i=e.childNodes;return n=i.length>1||"G"!==i[0].nodeName.toUpperCase()?Rb.create("g").append(e):Rb.create(i[0]),n.addClass(this.prefixClassName("edge-label")),{node:n.node,selectors:t.selectors}}updateLabels(){if(this.containers.labels){const t=this.cell,e=t.labels,n=this.can("edgeLabelMovable"),i=t.getDefaultLabel();for(let r=0,s=e.length;r<s;r+=1){const t=this.labelCache[r],s=this.labelSelectors[r];t.setAttribute("cursor",n?"move":"default");const o=e[r],a=ah({},i.attrs,o.attrs);this.updateAttrs(t,a,{selectors:s,rootBBox:o.size?db.fromSize(o.size):void 0})}}}mergeLabelAttrs(t,e,n){if(null===e)return null;if(void 0===e){if(null===n)return null;if(void 0===n)return;return t?n:ah({},n)}return t?ah({},n,e):void 0}customizeLabels(){if(this.containers.labels){const t=this.cell,e=t.labels;for(let n=0,i=e.length;n<i;n+=1){const i=e[n],r=this.labelCache[n],s=this.labelSelectors[n];this.graph.hook.onEdgeLabelRendered({edge:t,label:i,container:r,selectors:s})}}}renderTools(){const t=this.containers.tools;if(null==t)return this;const e=this.cell.toolMarkup,n=this.$(t).empty();if(hE.isStringMarkup(e)){let t=Hg(e);const i=Rb.create(t());if(n.append(i.node),this.toolCache=i.node,this.options.doubleTools){let e;const r=this.cell.doubleToolMarkup;hE.isStringMarkup(r)?(t=Hg(r),e=Rb.create(t())):e=i.clone(),n.append(e.node),this.tool2Cache=e.node}}return this}renderExternalTools(){const t=this.cell.getTools();return this.addTools(t),this}renderVertexMarkers(){const t=this.containers.vertices;if(null==t)return this;const e=this.cell.vertexMarkup,n=this.$(t).empty();if(hE.isStringMarkup(e)){const t=Hg(e);this.cell.getVertices().forEach(((e,i)=>{n.append(Rb.create(t(Object.assign({index:i},e))).node)}))}return this}renderArrowheadMarkers(){const t=this.containers.arrowheads;if(null==t)return this;const e=this.cell.arrowheadMarkup,n=this.$(t).empty();if(hE.isStringMarkup(e)){const t=Hg(e),i=Rb.create(t({end:"source"})).node,r=Rb.create(t({end:"target"})).node;this.containers.sourceArrowhead=i,this.containers.targetArrowhead=r,n.append(i,r)}return this}update(t,e={}){this.cleanCache(),this.updateConnection(e);const n=this.cell.getAttrs();return null!=n&&this.updateAttrs(this.container,n,{attrs:t===n?null:t,selectors:this.selectors}),this.updateConnectionPath(),this.updateLabelPositions(),this.updateToolsPosition(),this.updateArrowheadMarkers(),null==e.toolId?this.renderExternalTools():this.updateTools(e),this}removeRedundantLinearVertices(t={}){const e=this.cell,n=e.getVertices(),i=[this.sourceAnchor,...n,this.targetAnchor],r=i.length,s=new fb(i);s.simplify({threshold:.01});const o=s.points.map((t=>t.toJSON())),a=o.length;return r===a?0:(e.setVertices(o.slice(1,a-1),t),r-a)}updateConnectionPath(){const t=this.containers;if(t.connection){const e=this.getConnectionPathData();t.connection.setAttribute("d",e)}if(t.connectionWrap){const e=this.getConnectionPathData();t.connectionWrap.setAttribute("d",e)}t.sourceMarker&&t.targetMarker&&this.translateAndAutoOrientArrows(t.sourceMarker,t.targetMarker)}getTerminalView(t){switch(t){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalAnchor(t){switch(t){case"source":return ub.create(this.sourceAnchor);case"target":return ub.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalConnectionPoint(t){switch(t){case"source":return ub.create(this.sourcePoint);case"target":return ub.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalMagnet(t,e={}){switch(t){case"source":{if(e.raw)return this.sourceMagnet;const t=this.sourceView;return t?this.sourceMagnet||t.container:null}case"target":{if(e.raw)return this.targetMagnet;const t=this.targetView;return t?this.targetMagnet||t.container:null}default:throw new Error(`Unknown terminal type '${t}'`)}}updateConnection(t={}){const e=this.cell;if(t.translateBy&&e.isFragmentDescendantOf(t.translateBy)){const e=t.tx||0,n=t.ty||0;this.routePoints=new fb(this.routePoints).translate(e,n).points,this.translateConnectionPoints(e,n),this.path.translate(e,n)}else{const t=e.getVertices(),n=this.findAnchors(t);this.sourceAnchor=n.source,this.targetAnchor=n.target,this.routePoints=this.findRoutePoints(t);const i=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=i.source,this.targetPoint=i.target;const r=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,r.source||this.sourcePoint,r.target||this.targetPoint)}this.cleanCache()}findAnchors(t){const e=this.cell,n=e.source,i=e.target,r=t[0],s=t[t.length-1];return i.priority&&!n.priority?this.findAnchorsOrdered("target",s,"source",r):this.findAnchorsOrdered("source",r,"target",s)}findAnchorsOrdered(t,e,n,i){let r,s;const o=this.cell,a=o[t],l=o[n],c=this.getTerminalView(t),h=this.getTerminalView(n),u=this.getTerminalMagnet(t),d=this.getTerminalMagnet(n);if(c){let n;n=e?ub.create(e):h?d:ub.create(l),r=this.getAnchor(a.anchor,c,u,n,t)}else r=ub.create(a);if(h){const t=ub.create(i||r);s=this.getAnchor(l.anchor,h,d,t,n)}else s=ub.isPointLike(l)?ub.create(l):new ub;return{[t]:r,[n]:s}}getAnchor(t,e,n,i,r){const s=e.isEdgeElement(n),o=this.graph.options.connecting;let a,l="string"===typeof t?{name:t}:t;if(!l){const t=s?("source"===r?o.sourceEdgeAnchor:o.targetEdgeAnchor)||o.edgeAnchor:("source"===r?o.sourceAnchor:o.targetAnchor)||o.anchor;l="string"===typeof t?{name:t}:t}if(!l)throw new Error("Anchor should be specified.");const c=l.name;if(s){const t=sk.registry.get(c);if("function"!==typeof t)return sk.registry.onNotFound(c);a=ey(t,this,e,n,i,l.args||{},r)}else{const t=KE.registry.get(c);if("function"!==typeof t)return KE.registry.onNotFound(c);a=ey(t,this,e,n,i,l.args||{},r)}return a?a.round(this.POINT_ROUNDING):new ub}findRoutePoints(t=[]){const e=this.graph.options.connecting.router||rM.presets.normal,n=this.cell.getRouter()||e;let i;if("function"===typeof n)i=ey(n,this,t,{},this);else{const e="string"===typeof n?n:n.name,r="string"===typeof n?{}:n.args||{},s=e?rM.registry.get(e):rM.presets.normal;if("function"!==typeof s)return rM.registry.onNotFound(e);i=ey(s,this,t,r,this)}return null==i?t.map((t=>ub.create(t))):i.map((t=>ub.create(t)))}findConnectionPoints(t,e,n){const i=this.cell,r=this.graph.options.connecting,s=i.getSource(),o=i.getTarget(),a=this.sourceView,l=this.targetView,c=t[0],h=t[t.length-1];let u,d;if(a&&!a.isEdgeElement(this.sourceMagnet)){const t=this.sourceMagnet||a.container,i=c||n,o=new pb(i,e),l=s.connectionPoint||r.sourceConnectionPoint||r.connectionPoint;u=this.getConnectionPoint(l,a,t,o,"source")}else u=e;if(l&&!l.isEdgeElement(this.targetMagnet)){const t=this.targetMagnet||l.container,i=o.connectionPoint||r.targetConnectionPoint||r.connectionPoint,s=h||e,a=new pb(s,n);d=this.getConnectionPoint(i,l,t,a,"target")}else d=n;return{source:u,target:d}}getConnectionPoint(t,e,n,i,r){const s=i.end;if(null==t)return s;const o="string"===typeof t?t:t.name,a="string"===typeof t?{}:t.args,l=gk.registry.get(o);if("function"!==typeof l)return gk.registry.onNotFound(o);const c=ey(l,this,i,e,n,a||{},r);return c?c.round(this.POINT_ROUNDING):s}updateMarkerAttr(t){const e=this.cell.getAttrs(),n=`.${t}-marker`,i=e&&e[n];i&&this.updateAttrs(this.container,{},{attrs:{[n]:i},selectors:this.selectors})}findMarkerPoints(t,e,n){const i=t=>{const e=this.cell.getAttrs(),n=Object.keys(e);for(let i=0,r=n.length;i<r;i+=1){const r=e[n[i]];if(r[`${t}Marker`]||r[`${t}-marker`]){const t=r.strokeWidth||r["stroke-width"];if(t)return parseFloat(t);break}}return null},r=t[0],s=t[t.length-1],o=this.containers.sourceMarker,a=this.containers.targetMarker,l=this.markerCache;let c,h;if(o){if(this.updateMarkerAttr("source"),l.sourceBBox=l.sourceBBox||Av(o),l.sourceBBox.width>0){const t=$v(o);c=e.clone().move(r||n,l.sourceBBox.width*t.sx*-1)}}else{const t=i("source");t&&(c=e.clone().move(r||n,-t))}if(a){if(this.updateMarkerAttr("target"),l.targetBBox=l.targetBBox||Av(a),l.targetBBox.width>0){const t=$v(a);h=n.clone().move(s||e,l.targetBBox.width*t.sx*-1)}}else{const t=i("target");t&&(h=n.clone().move(s||e,-t))}return l.sourcePoint=c||e.clone(),l.targetPoint=h||n.clone(),{source:c,target:h}}findPath(t,e,n){const i=this.cell.getConnector()||this.graph.options.connecting.connector;let r,s,o;if("string"===typeof i?r=i:(r=i.name,s=i.args),r){const t=xM.registry.get(r);if("function"!==typeof t)return xM.registry.onNotFound(r);o=t}else o=xM.presets.normal;const a=ey(o,this,e,n,t,Object.assign(Object.assign({},s),{raw:!0}),this);return"string"===typeof a?zb.parse(a):a}translateConnectionPoints(t,e){const n=this.markerCache;n.sourcePoint&&n.sourcePoint.translate(t,e),n.targetPoint&&n.targetPoint.translate(t,e),this.sourcePoint.translate(t,e),this.targetPoint.translate(t,e),this.sourceAnchor.translate(t,e),this.targetAnchor.translate(t,e)}updateLabelPositions(){if(null==this.containers.labels)return this;const t=this.path;if(!t)return this;const e=this.cell,n=e.getLabels();if(0===n.length)return this;const i=e.getDefaultLabel(),r=this.normalizeLabelPosition(i.position);for(let s=0,o=n.length;s<o;s+=1){const t=n[s],e=this.normalizeLabelPosition(t.position),i=ah({},r,e),o=this.getLabelTransformationMatrix(i);this.labelCache[s].setAttribute("transform",fv(o))}return this}updateToolsPosition(){if(null==this.containers.tools)return this;let t="",e=this.options.toolsOffset;const n=this.getConnectionLength();if(null!=n){n<this.options.shortLength&&(t="scale(.5)",e/=2);let i=this.getPointAtLength(e);if(null!=i&&_y(this.toolCache,"transform",`translate(${i.x},${i.y}) ${t}`),this.options.doubleTools&&n>=this.options.longLength){const r=this.options.doubleToolsOffset||e;i=this.getPointAtLength(n-r),null!=i&&_y(this.tool2Cache,"transform",`translate(${i.x},${i.y}) ${t}`),_y(this.tool2Cache,"visibility","visible")}else this.options.doubleTools&&_y(this.tool2Cache,"visibility","hidden")}return this}updateArrowheadMarkers(){const t=this.containers.arrowheads;if(null==t)return this;if("none"===t.style.display)return this;const e=this.containers.sourceArrowhead,n=this.containers.targetArrowhead;if(e&&n){const t=this.getConnectionLength()||0,i=t<this.options.shortLength?.5:1;$v(e,i),$v(n,i),this.translateAndAutoOrientArrows(e,n)}return this}updateTerminalProperties(t){const e=this.cell,n=this.graph,i=e[t],r=i&&i.cell,s=`${t}View`;if(!r)return this[s]=null,this.updateTerminalMagnet(t),!0;const o=n.getCellById(r);if(!o)throw new Error(`Edge's ${t} node with id "${r}" not exists`);const a=o.findView(n);return!!a&&(this[s]=a,this.updateTerminalMagnet(t),!0)}updateTerminalMagnet(t){const e=`${t}Magnet`,n=this.getTerminalView(t);if(n){let i=n.getMagnetFromEdgeTerminal(this.cell[t]);i===n.container&&(i=null),this[e]=i}else this[e]=null}translateAndAutoOrientArrows(t,e){const n=this.routePoints;t&&Vv(t,this.sourcePoint,n[0]||this.targetPoint,this.graph.view.stage),e&&Vv(e,this.targetPoint,n[n.length-1]||this.sourcePoint,this.graph.view.stage)}getLabelPositionAngle(t){const e=this.cell.getLabelAt(t);return e&&e.position&&"object"===typeof e.position&&e.position.angle||0}getLabelPositionArgs(t){const e=this.cell.getLabelAt(t);if(e&&e.position&&"object"===typeof e.position)return e.position.options}getDefaultLabelPositionArgs(){const t=this.cell.getDefaultLabel();if(t&&t.position&&"object"===typeof t.position)return t.position.options}mergeLabelPositionArgs(t,e){return null===t?null:void 0===t?null===e?null:e:ah({},e,t)}addLabel(t,e,n,i){let r,s,o,a=0;"number"!==typeof t?(r=t.x,s=t.y,"number"===typeof e?(a=e,o=n):o=e):(r=t,s=e,"number"===typeof n?(a=n,o=i):o=n);const l=this.getDefaultLabelPositionArgs(),c=o,h=this.mergeLabelPositionArgs(c,l),u={position:this.getLabelPosition(r,s,a,h)},d=-1;return this.cell.insertLabel(u,d,o),d}addVertex(t,e,n){const i="number"!==typeof t,r=i?t.x:t,s=i?t.y:e,o=i?e:n,a={x:r,y:s},l=this.getVertexIndex(r,s);return this.cell.insertVertex(a,l,o),l}sendToken(t,e,n){let i,r,s,o,a="linear";"object"===typeof e?(i=e.duration,r=!0===e.reversed,s=e.selector,!1===e.rotate?o="":!0===e.rotate?o="auto":null!=e.rotate&&(o=`${e.rotate}`),e.timing&&(a=e.timing)):(i=e,r=!1,s=null),i=i||1e3;const l={dur:`${i}ms`,repeatCount:"1",calcMode:a,fill:"freeze"};if(o&&(l.rotate=o),r&&(l.keyPoints="1;0",l.keyTimes="0;1"),"object"===typeof e){const{duration:t,reversed:n,selector:i,rotate:r,timing:s}=e,o=HM(e,["duration","reversed","selector","rotate","timing"]);Object.keys(o).forEach((t=>{l[t]=o[t]}))}let c;if(c="string"===typeof s?this.findOne(s,this.container,this.selectors):this.containers.connection?this.containers.connection:this.container.querySelector("path"),!(c instanceof SVGPathElement))throw new Error("Token animation requires a valid connection path.");const h="string"===typeof t?this.findOne(t):t;if(null==h)throw new Error("Token animation requires a valid token element.");const u=h.parentNode,d=()=>{u||Ty(h)},p=Rb.create(h);u||p.appendTo(this.graph.view.stage);const g=l.complete;l.complete=t=>{d(),n&&n(),g&&g(t)};const f=p.animateAlongPath(l,c);return()=>{d(),f()}}getConnection(){return null!=this.path?this.path.clone():null}getConnectionPathData(){if(null==this.path)return"";const t=this.cache.pathCache;return ql(t,"data")||(t.data=this.path.serialize()),t.data||""}getConnectionSubdivisions(){if(null==this.path)return null;const t=this.cache.pathCache;return ql(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions}getConnectionLength(){if(null==this.path)return 0;const t=this.cache.pathCache;return ql(t,"length")||(t.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),t.length}getPointAtLength(t){return null==this.path?null:this.path.pointAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(t){return null==this.path?null:(Bm(t)&&(t=parseFloat(t)/100),this.path.pointAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(t){return null==this.path?null:this.path.tangentAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(t){return null==this.path?null:this.path.tangentAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(t){return null==this.path?null:this.path.closestPoint(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(t){return null==this.path?null:this.path.closestPointLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(t){return null==this.path?null:this.path.closestPointNormalizedLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(t,e,n,i){const r={distance:0};let s,o=0;"number"===typeof n?(o=n,s=i):s=n,null!=s&&(r.options=s);const a=s&&s.absoluteOffset,l=!(s&&s.absoluteDistance),c=s&&s.absoluteDistance&&s.reverseDistance,h=this.path,u={segmentSubdivisions:this.getConnectionSubdivisions()},d=new ub(t,e),p=h.closestPointT(d,u),g=this.getConnectionLength()||0;let f,m,y=h.lengthAtT(p,u);if(l&&(y=g>0?y/g:0),c&&(y=-1*(g-y)||1),r.distance=y,a||(f=h.tangentAtT(p)),f)m=f.pointOffset(d);else{const t=h.pointAtT(p),e=d.diff(t);m={x:e.x,y:e.y}}return r.offset=m,r.angle=o,r}normalizeLabelPosition(t){return"number"===typeof t?{distance:t}:t}getLabelTransformationMatrix(t){const e=this.normalizeLabelPosition(t),n=e.options||{},i=e.angle||0,r=e.distance,s=r>0&&r<=1;let o=0;const a={x:0,y:0},l=e.offset;l&&("number"===typeof l?o=l:(null!=l.x&&(a.x=l.x),null!=l.y&&(a.y=l.y)));const c=0!==a.x||0!==a.y||0===o,h=n.keepGradient,u=n.ensureLegibility,d=this.path,p={segmentSubdivisions:this.getConnectionSubdivisions()},g=s?r*this.getConnectionLength():r,f=d.tangentAtLength(g,p);let m,y=i;if(f){if(c)m=f.start,m.translate(a);else{const t=f.clone();t.rotate(-90,f.start),t.setLength(o),m=t.end}h&&(y=f.angle()+i,u&&(y=ib.normalize((y+90)%180-90)))}else m=d.start,c&&m.translate(a);return dv().translate(m.x,m.y).rotate(y)}getLabelCoordinates(t){const e=this.getLabelTransformationMatrix(t);return new ub(e.e,e.f)}getVertexIndex(t,e){const n=this.cell,i=n.getVertices(),r=this.getClosestPointLength(new ub(t,e));let s=0;if(null!=r)for(const o=i.length;s<o;s+=1){const t=i[s],e=this.getClosestPointLength(t);if(null!=e&&r<e)break}return s}getEventArgs(t,e,n){const i=this,r=i.cell,s=r;return null==e||null==n?{e:t,view:i,edge:r,cell:s}:{e:t,x:e,y:n,view:i,edge:r,cell:s}}notifyUnhandledMouseDown(t,e,n){this.notify("edge:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("edge:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("edge:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("edge:mouseup",this.getEventArgs(t,e,n))}onClick(t,e,n){super.onClick(t,e,n),this.notify("edge:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("edge:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("edge:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.notifyMouseDown(t,e,n);const i=t.target.getAttribute("class");switch(i){case"vertex":return void this.startVertexDragging(t,e,n);case"vertex-remove":case"vertex-remove-area":return void this.handleVertexRemoving(t,e,n);case"connection":case"connection-wrap":return void this.handleVertexAdding(t,e,n);case"arrowhead":return void this.startArrowheadDragging(t,e,n);case"source-marker":case"target-marker":return void this.notifyUnhandledMouseDown(t,e,n);default:break}this.startEdgeDragging(t,e,n)}onMouseMove(t,e,n){const i=this.getEventData(t);switch(i.action){case"drag-vertex":this.dragVertex(t,e,n);break;case"drag-label":this.dragLabel(t,e,n);break;case"drag-arrowhead":this.dragArrowhead(t,e,n);break;case"drag-edge":this.dragEdge(t,e,n);break;default:break}return this.notifyMouseMove(t,e,n),i}onMouseUp(t,e,n){const i=this.getEventData(t);switch(i.action){case"drag-vertex":this.stopVertexDragging(t,e,n);break;case"drag-label":this.stopLabelDragging(t,e,n);break;case"drag-arrowhead":this.stopArrowheadDragging(t,e,n);break;case"drag-edge":this.stopEdgeDragging(t,e,n);break;default:break}return this.notifyMouseUp(t,e,n),this.checkMouseleave(t),i}onMouseOver(t){super.onMouseOver(t),this.notify("edge:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("edge:mouseout",this.getEventArgs(t))}onMouseEnter(t){super.onMouseEnter(t),this.notify("edge:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("edge:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,i){super.onMouseWheel(t,e,n,i),this.notify("edge:mousewheel",Object.assign({delta:i},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,i){const r=Oy(t.target,"edge-tool",this.container);if(r){if(t.stopPropagation(),this.can("useEdgeTools")){if("edge:remove"===e)return void this.cell.remove({ui:!0});this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,i)))}this.notifyMouseDown(t,n,i)}else this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,i))),super.onCustomEvent(t,e,n,i)}onLabelMouseDown(t,e,n){this.notifyMouseDown(t,e,n),this.startLabelDragging(t,e,n);const i=this.getEventData(t).stopPropagation;i&&t.stopPropagation()}startEdgeDragging(t,e,n){this.can("edgeMovable")?this.setEventData(t,{x:e,y:n,moving:!1,action:"drag-edge"}):this.notifyUnhandledMouseDown(t,e,n)}dragEdge(t,e,n){const i=this.getEventData(t);i.moving||(i.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(e-i.x,n-i.y,{ui:!0}),this.setEventData(t,{x:e,y:n}),this.notify("edge:moving",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(t,e,n){const i=this.getEventData(t);i.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),i.moving=!1}prepareArrowheadDragging(t,e){const n=this.getTerminalMagnet(t),i={action:"drag-arrowhead",x:e.x,y:e.y,isNewEdge:!0===e.isNewEdge,terminalType:t,initialMagnet:n,initialTerminal:id(this.cell[t]),fallbackAction:e.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(t),options:e.options};return this.beforeArrowheadDragging(i),i}createValidateConnectionArgs(t){const e=[];let n;e[4]=t,e[5]=this;let i=0,r=0;"source"===t?(i=2,n="target"):(r=2,n="source");const s=this.cell[n],o=s.cell;if(o){let t;const n=e[i]=this.graph.renderer.findViewByCell(o);n&&(t=n.getMagnetFromEdgeTerminal(s),t===n.container&&(t=void 0)),e[i+1]=t}return(t,n)=>(e[r]=t,e[r+1]=t.container===n?void 0:n,e)}beforeArrowheadDragging(t){t.zIndex=this.cell.zIndex,this.cell.toFront();const e=this.container.style;t.pointerEvents=e.pointerEvents,e.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(t)}afterArrowheadDragging(t){null!=t.zIndex&&(this.cell.setZIndex(t.zIndex,{ui:!0}),t.zIndex=null);const e=this.container;e.style.pointerEvents=t.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(t)}arrowheadDragging(t,e,n,i){i.x=e,i.y=n,i.currentTarget!==t&&(i.currentMagnet&&i.currentView&&i.currentView.unhighlight(i.currentMagnet,{type:"magnetAdsorbed"}),i.currentView=this.graph.renderer.findViewByElem(t),i.currentView?(i.currentMagnet=i.currentView.findMagnet(t),i.currentMagnet&&this.graph.hook.validateConnection(...i.getValidateConnectionArgs(i.currentView,i.currentMagnet),i.currentView.getEdgeTerminal(i.currentMagnet,e,n,this.cell,i.terminalType))?i.currentView.highlight(i.currentMagnet,{type:"magnetAdsorbed"}):i.currentMagnet=null):i.currentMagnet=null),i.currentTarget=t,this.cell.prop(i.terminalType,{x:e,y:n},Object.assign(Object.assign({},i.options),{ui:!0}))}arrowheadDragged(t,e,n){const i=t.currentView,r=t.currentMagnet;if(!r||!i)return;i.unhighlight(r,{type:"magnetAdsorbed"});const s=t.terminalType,o=i.getEdgeTerminal(r,e,n,this.cell,s);this.cell.setTerminal(s,o,{ui:!0})}snapArrowhead(t,e,n){const i=this.graph,r=i.options.connecting.snap,s="object"===typeof r&&r.radius||50,o=i.renderer.findViewsInArea({x:t-s,y:e-s,width:2*s,height:2*s}),a=n.closestView||null,l=n.closestMagnet||null;let c;n.closestView=null,n.closestMagnet=null;let h=Number.MAX_SAFE_INTEGER;const u=new ub(t,e);let d;o.forEach((r=>{"false"!==r.container.getAttribute("magnet")&&(c=r.cell.getBBox().getCenter().distance(u),c<s&&c<h&&(l===r.container||i.hook.validateConnection(...n.getValidateConnectionArgs(r,null),r.getEdgeTerminal(r.container,t,e,this.cell,n.terminalType)))&&(h=c,n.closestView=r,n.closestMagnet=r.container)),r.container.querySelectorAll("[magnet]").forEach((o=>{if("false"!==o.getAttribute("magnet")){const a=r.getBBoxOfElement(o);c=u.distance(a.getCenter()),c<s&&c<h&&(l===o||i.hook.validateConnection(...n.getValidateConnectionArgs(r,o),r.getEdgeTerminal(o,t,e,this.cell,n.terminalType)))&&(h=c,n.closestView=r,n.closestMagnet=o)}}))}));const p=n.terminalType,g=n.closestView,f=n.closestMagnet,m=l!==f;if(a&&m&&a.unhighlight(l,{type:"magnetAdsorbed"}),g){if(!m)return;g.highlight(f,{type:"magnetAdsorbed"}),d=g.getEdgeTerminal(f,t,e,this.cell,p)}else d={x:t,y:e};this.cell.setTerminal(p,d,{},Object.assign(Object.assign({},n.options),{ui:!0}))}snapArrowheadEnd(t){const e=t.closestView,n=t.closestMagnet;e&&n&&(e.unhighlight(n,{type:"magnetAdsorbed"}),t.currentMagnet=e.findMagnet(n)),t.closestView=null,t.closestMagnet=null}finishEmbedding(t){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(t.zIndex=null)}fallbackConnection(t){switch(t.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(t.terminalType,t.initialTerminal,{ui:!0});break}}notifyConnectionEvent(t,e){const n=t.terminalType,i=t.initialTerminal,r=this.cell[n],s=r&&!GM.equalTerminals(i,r);if(s){const s=this.graph,o=i,a=o.cell?s.getCellById(o.cell):null,l=o.port,c=a?s.findViewByCell(a):null,h=a||t.isNewEdge?null:ub.create(i).toJSON(),u=r,d=u.cell?s.getCellById(u.cell):null,p=u.port,g=d?s.findViewByCell(d):null,f=d?null:ub.create(r).toJSON();this.notify("edge:connected",{e:e,previousCell:a,previousPort:l,previousView:c,previousPoint:h,currentCell:d,currentView:g,currentPort:p,currentPoint:f,previousMagnet:t.initialMagnet,currentMagnet:t.currentMagnet,edge:this.cell,view:this,type:n,isNew:t.isNewEdge})}}highlightAvailableMagnets(t){const e=this.graph,n=e.model.getCells();t.marked={};for(let i=0,r=n.length;i<r;i+=1){const r=e.renderer.findViewByCell(n[i]);if(!r)continue;const s=Array.prototype.slice.call(r.container.querySelectorAll("[magnet]"));"false"!==r.container.getAttribute("magnet")&&s.push(r.container);const o=s.filter((n=>e.hook.validateConnection(...t.getValidateConnectionArgs(r,n),r.getEdgeTerminal(n,t.x,t.y,this.cell,t.terminalType))));if(o.length>0){for(let t=0,e=o.length;t<e;t+=1)r.highlight(o[t],{type:"magnetAvailable"});r.highlight(null,{type:"nodeAvailable"}),t.marked[r.cell.id]=o}}}unhighlightAvailableMagnets(t){const e=t.marked||{};Object.keys(e).forEach((t=>{const n=this.graph.renderer.findViewByCell(t);if(n){const i=e[t];i.forEach((t=>{n.unhighlight(t,{type:"magnetAvailable"})})),n.unhighlight(null,{type:"nodeAvailable"})}})),t.marked=null}startArrowheadDragging(t,e,n){if(!this.can("arrowheadMovable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=t.target,r=i.getAttribute("data-terminal"),s=this.prepareArrowheadDragging(r,{x:e,y:n});this.setEventData(t,s)}dragArrowhead(t,e,n){const i=this.getEventData(t);this.graph.options.connecting.snap?this.snapArrowhead(e,n,i):this.arrowheadDragging(this.getEventTarget(t),e,n,i)}stopArrowheadDragging(t,e,n){const i=this.graph,r=this.getEventData(t);i.options.connecting.snap?this.snapArrowheadEnd(r):this.arrowheadDragged(r,e,n);const s=i.hook.validateEdge(this.cell,r.terminalType,r.initialTerminal);s?(this.finishEmbedding(r),this.notifyConnectionEvent(r,t)):this.fallbackConnection(r),this.afterArrowheadDragging(r)}startLabelDragging(t,e,n){if(this.can("edgeLabelMovable")){const e=t.currentTarget,n=parseInt(e.getAttribute("data-index"),10),i=this.getLabelPositionAngle(n),r=this.getLabelPositionArgs(n),s=this.getDefaultLabelPositionArgs(),o=this.mergeLabelPositionArgs(r,s);this.setEventData(t,{index:n,positionAngle:i,positionArgs:o,stopPropagation:!0,action:"drag-label"})}else this.setEventData(t,{stopPropagation:!0});this.graph.view.delegateDragEvents(t,this)}dragLabel(t,e,n){const i=this.getEventData(t),r=this.cell.getLabelAt(i.index),s=ah({},r,{position:this.getLabelPosition(e,n,i.positionAngle,i.positionArgs)});this.cell.setLabelAt(i.index,s)}stopLabelDragging(t,e,n){}handleVertexAdding(t,e,n){if(!this.can("vertexAddable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=this.addVertex({x:e,y:n},{ui:!0});this.setEventData(t,{index:i,action:"drag-vertex"})}handleVertexRemoving(t,e,n){if(!this.can("vertexDeletable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=t.target,r=parseInt(i.getAttribute("idx"),10);this.cell.removeVertexAt(r)}startVertexDragging(t,e,n){if(!this.can("vertexMovable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=t.target,r=parseInt(i.getAttribute("idx"),10);this.setEventData(t,{index:r,action:"drag-vertex"})}dragVertex(t,e,n){const i=this.getEventData(t);this.cell.setVertexAt(i.index,{x:e,y:n},{ui:!0})}stopVertexDragging(t,e,n){}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNodeView&&"function"===typeof i.isEdgeView&&"function"===typeof i.confirmUpdate&&"function"===typeof i.update&&"function"===typeof i.getConnection}t.toStringTag=`X6.${t.name}`,t.isEdgeView=e})(UM||(UM={})),UM.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],vertices:["vertices","update"],vertexMarkup:["vertices"],toolMarkup:["tools"],tools:["widget"]},shortLength:105,longLength:155,toolsOffset:40,doubleTools:!1,doubleToolsOffset:65,sampleInterval:50}),UM.registry.register("edge",UM,!0);class WM extends fE{constructor(){super(...arguments),this.scalableNode=null,this.rotatableNode=null,this.scalableSelector="scalable",this.rotatableSelector="rotatable",this.defaultPortMarkup=hE.getPortMarkup(),this.defaultPortLabelMarkup=hE.getPortLabelMarkup(),this.defaultPortContainerMarkup=hE.getPortContainerMarkup(),this.portsCache={}}get[Symbol.toStringTag](){return WM.toStringTag}getContainerClassName(){const t=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||t.push(this.prefixClassName("node-immovable")),t.join(" ")}updateClassName(t){const e=t.target;if(e.hasAttribute("magnet")){const t=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?dy(e,t):uy(e,t)}else{const t=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(t):this.addClass(t)}}isNodeView(){return!0}confirmUpdate(t,e={}){let n=t;return this.hasAction(n,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","resize","translate","rotate","ports","tools"])):(n=this.handleAction(n,"resize",(()=>this.resize(e)),"update"),n=this.handleAction(n,"update",(()=>this.update()),KC.useCSSSelector?"ports":null),n=this.handleAction(n,"translate",(()=>this.translate())),n=this.handleAction(n,"rotate",(()=>this.rotate())),n=this.handleAction(n,"ports",(()=>this.renderPorts())),n=this.handleAction(n,"tools",(()=>this.renderTools()))),n}update(t){this.cleanCache(),KC.useCSSSelector&&this.removePorts();const e=this.cell,n=e.getSize(),i=e.getAttrs();this.updateAttrs(this.container,i,{attrs:t===i?null:t,rootBBox:new db(0,0,n.width,n.height),selectors:this.selectors,scalableNode:this.scalableNode,rotatableNode:this.rotatableNode}),KC.useCSSSelector&&this.renderPorts()}renderMarkup(){const t=this.cell.markup;if(t)return"string"===typeof t?this.renderStringMarkup(t):this.renderJSONMarkup(t);throw new TypeError("Invalid node markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container),n=t=>Array.isArray(t)?t[0]:t;this.selectors=e.selectors,this.rotatableNode=n(this.selectors[this.rotatableSelector]),this.scalableNode=n(this.selectors[this.scalableSelector]),this.container.appendChild(e.fragment)}renderStringMarkup(t){jy(this.container,Rb.toNodes(Rb.createVectors(t))),this.rotatableNode=Dy(this.container,`.${this.rotatableSelector}`),this.scalableNode=Dy(this.container,`.${this.scalableSelector}`),this.selectors={},this.rootSelector&&(this.selectors[this.rootSelector]=this.container)}render(){return this.empty(),this.renderMarkup(),this.scalableNode&&this.update(),this.resize(),this.rotatableNode?(this.rotate(),this.translate()):this.updateTransform(),KC.useCSSSelector||this.renderPorts(),this.renderTools(),this}resize(t={}){if(this.scalableNode)return this.updateSize(t);this.cell.getAngle()&&this.rotate(),this.update()}translate(){if(this.rotatableNode)return this.updateTranslation();this.updateTransform()}rotate(){if(this.rotatableNode)return this.updateRotation(),void this.update();this.updateTransform()}getTranslationString(){const t=this.cell.getPosition();return`translate(${t.x},${t.y})`}getRotationString(){const t=this.cell.getAngle();if(t){const e=this.cell.getSize();return`rotate(${t},${e.width/2},${e.height/2})`}}updateTransform(){let t=this.getTranslationString();const e=this.getRotationString();e&&(t+=` ${e}`),this.container.setAttribute("transform",t)}updateRotation(){if(null!=this.rotatableNode){const t=this.getRotationString();null!=t?this.rotatableNode.setAttribute("transform",t):this.rotatableNode.removeAttribute("transform")}}updateTranslation(){this.container.setAttribute("transform",this.getTranslationString())}updateSize(t={}){const e=this.cell,n=e.getSize(),i=e.getAngle(),r=this.scalableNode;let s=!1;r.getElementsByTagName("path").length>0&&(s=!0);const o=Av(r,{recursive:s}),a=n.width/(o.width||1),l=n.height/(o.height||1);r.setAttribute("transform",`scale(${a},${l})`);const c=this.rotatableNode;if(null!=c){const s=c.getAttribute("transform");if(s){c.setAttribute("transform",`${s} rotate(${-i},${n.width/2},${n.height/2})`);const o=Av(r,{target:this.graph.view.stage});e.prop("position",{x:o.x,y:o.y},Object.assign({updated:!0},t)),this.translate(),this.rotate()}}this.update()}findPortElem(t,e){const n=t?this.portsCache[t]:null;if(!n)return null;const i=n.portContentElement,r=n.portContentSelectors||{};return this.findOne(e,i,r)}initializePorts(){this.cleanPortsCache()}refreshPorts(){this.removePorts(),this.cleanPortsCache(),this.renderPorts()}cleanPortsCache(){this.portsCache={}}removePorts(){Object.keys(this.portsCache).forEach((t=>{const e=this.portsCache[t];Ty(e.portElement)}))}renderPorts(){const t=this.getPortsContainer(),e=[];t.childNodes.forEach((t=>{e.push(t)}));const n=zl(this.cell.getParsedPorts(),"zIndex"),i="auto";n[i]&&n[i].forEach((n=>{const i=this.getPortElement(n);t.append(i),e.push(i)})),Object.keys(n).forEach((t=>{if(t!==i){const i=parseInt(t,10);this.appendPorts(n[t],i,e)}})),this.updatePorts()}getPortsContainer(){return this.rotatableNode||this.container}appendPorts(t,e,n){const i=t.map((t=>this.getPortElement(t)));n[e]||e<0?Fy(n[Math.max(e,0)],i):jy(this.getPortsContainer(),i)}getPortElement(t){const e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)}createPortElement(t){let e=hE.renderMarkup(this.getPortContainerMarkup());const n=e.elem;if(null==n)throw new Error("Invalid port container markup.");e=hE.renderMarkup(this.getPortMarkup(t));const i=e.elem,r=e.selectors;if(null==i)throw new Error("Invalid port markup.");this.setAttrs({port:t.id,"port-group":t.group},i),e=hE.renderMarkup(this.getPortLabelMarkup(t.label));const s=e.elem,o=e.selectors;if(null==s)throw new Error("Invalid port label markup.");let a;if(r&&o){for(const t in o)if(r[t]&&t!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},r),o)}else a=r||o;return uy(n,"x6-port"),uy(i,"x6-port-body"),uy(s,"x6-port-label"),n.appendChild(i),n.appendChild(s),this.portsCache[t.id]={portElement:n,portSelectors:a,portLabelElement:s,portLabelSelectors:o,portContentElement:i,portContentSelectors:r},this.graph.hook.onPortRendered({port:t,node:this.cell,container:n,selectors:a,labelContainer:s,labelSelectors:o,contentContainer:i,contentSelectors:r}),n}updatePorts(){this.updatePortGroup();const t=this.cell.getParsedGroups();Object.keys(t).forEach((t=>this.updatePortGroup(t)))}updatePortGroup(t){const e=db.fromSize(this.cell.getSize()),n=this.cell.getPortsLayoutByGroup(t,e);for(let i=0,r=n.length;i<r;i+=1){const t=n[i],e=t.portId,r=this.portsCache[e]||{},s=t.portLayout;if(this.applyPortTransform(r.portElement,s),null!=t.portAttrs){const e={selectors:r.portSelectors||{}};t.portSize&&(e.rootBBox=db.fromSize(t.portSize)),this.updateAttrs(r.portElement,t.portAttrs,e)}const o=t.labelLayout;if(o&&(this.applyPortTransform(r.portLabelElement,o,-(s.angle||0)),o.attrs)){const e={selectors:r.portLabelSelectors||{}};t.labelSize&&(e.rootBBox=db.fromSize(t.labelSize)),this.updateAttrs(r.portLabelElement,o.attrs,e)}}}applyPortTransform(t,e,n=0){const i=e.angle,r=e.position,s=dv().rotate(n).translate(r.x||0,r.y||0).rotate(i||0);Rv(t,s,{absolute:!0})}getPortContainerMarkup(){return this.cell.getPortContainerMarkup()||this.defaultPortContainerMarkup}getPortMarkup(t){return t.markup||this.cell.portMarkup||this.defaultPortMarkup}getPortLabelMarkup(t){return t.markup||this.cell.portLabelMarkup||this.defaultPortLabelMarkup}getEventArgs(t,e,n){const i=this,r=i.cell,s=r;return null==e||null==n?{e:t,view:i,node:r,cell:s}:{e:t,x:e,y:n,view:i,node:r,cell:s}}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("node:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("node:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("node:mouseup",this.getEventArgs(t,e,n))}onClick(t,e,n){super.onClick(t,e,n),this.notify("node:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("node:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("node:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.isPropagationStopped(t)||(this.notifyMouseDown(t,e,n),this.startNodeDragging(t,e,n))}onMouseMove(t,e,n){const i=this.getEventData(t),r=i.action;if("magnet"===r)this.dragMagnet(t,e,n);else{if("move"===r){const r=i,s=r.targetView||this;s.dragNode(t,e,n),s.notify("node:moving",{e:t,x:e,y:n,view:s,cell:s.cell,node:s.cell})}this.notifyMouseMove(t,e,n)}this.setEventData(t,i)}onMouseUp(t,e,n){const i=this.getEventData(t),r=i.action;if("magnet"===r)this.stopMagnetDragging(t,e,n);else if(this.notifyMouseUp(t,e,n),"move"===r){const r=i,s=r.targetView||this;s.stopNodeDragging(t,e,n)}const s=i.targetMagnet;s&&this.onMagnetClick(t,s,e,n),this.checkMouseleave(t)}onMouseOver(t){super.onMouseOver(t),this.notify("node:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("node:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.updateClassName(t),super.onMouseEnter(t),this.notify("node:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("node:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,i){super.onMouseWheel(t,e,n,i),this.notify("node:mousewheel",Object.assign({delta:i},this.getEventArgs(t,e,n)))}onMagnetClick(t,e,n,i){const r=this.graph.view.getMouseMovedCount(t);r>this.graph.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:e},this.getEventArgs(t,n,i)))}onMagnetDblClick(t,e,n,i){this.notify("node:magnet:dblclick",Object.assign({magnet:e},this.getEventArgs(t,n,i)))}onMagnetContextMenu(t,e,n,i){this.notify("node:magnet:contextmenu",Object.assign({magnet:e},this.getEventArgs(t,n,i)))}onMagnetMouseDown(t,e,n,i){this.startMagnetDragging(t,n,i)}onCustomEvent(t,e,n,i){this.notify("node:customevent",Object.assign({name:e},this.getEventArgs(t,n,i))),super.onCustomEvent(t,e,n,i)}prepareEmbedding(t){const e=this.getEventData(t),n=e.cell||this.cell,i=this.graph.findViewByCell(n),r=this.graph.snapToGrid(t.clientX,t.clientY);this.notify("node:embed",{e:t,node:n,view:i,cell:n,x:r.x,y:r.y,currentParent:n.getParent()})}processEmbedding(t,e){const n=e.cell||this.cell,i=e.graph||this.graph,r=i.options.embedding,s=r.findParent;let o="function"===typeof s?ey(s,i,{view:this,node:this.cell}).filter((t=>OM.isCell(t)&&this.cell.id!==t.id&&!t.isDescendantOf(this.cell))):i.model.getNodesUnderNode(n,{by:s});r.frontOnly&&(o=o.slice(-1));let a=null;const l=e.candidateEmbedView,c=r.validate;for(let u=o.length-1;u>=0;u-=1){const t=o[u];if(l&&l.cell.id===t.id){a=l;break}{const e=t.findView(i);if(ey(c,i,{child:this.cell,parent:e.cell,childView:this,parentView:e})){a=e;break}}}this.clearEmbedding(e),a&&a.highlight(null,{type:"embedding"}),e.candidateEmbedView=a;const h=i.snapToGrid(t.clientX,t.clientY);this.notify("node:embedding",{e:t,cell:n,node:n,view:i.findViewByCell(n),x:h.x,y:h.y,currentParent:n.getParent(),candidateParent:a?a.cell:null})}clearEmbedding(t){const e=t.candidateEmbedView;e&&(e.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null)}finalizeEmbedding(t,e){const n=e.cell||this.cell,i=e.graph||this.graph,r=i.findViewByCell(n),s=n.getParent(),o=e.candidateEmbedView;o?(o.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null,null!=s&&s.id===o.cell.id||o.cell.insertChild(n,void 0,{ui:!0})):s&&s.unembed(n,{ui:!0}),i.model.getConnectedEdges(n,{deep:!0}).forEach((t=>{t.updateParent({ui:!0})}));const a=i.snapToGrid(t.clientX,t.clientY);r&&r.notify("node:embedded",{e:t,cell:n,x:a.x,y:a.y,node:n,view:i.findViewByCell(n),previousParent:s,currentParent:n.getParent()})}getDelegatedView(){let t=this.cell,e=this;while(e){if(t.isEdge())break;if(!t.hasParent()||e.can("stopDelegateOnDragging"))return e;t=t.getParent(),e=this.graph.renderer.findViewByCell(t)}return null}startMagnetDragging(t,e,n){if(!this.can("magnetConnectable"))return;t.stopPropagation();const i=t.currentTarget,r=this.graph;this.setEventData(t,{targetMagnet:i}),r.hook.validateMagnet(this,i,t)?(r.options.magnetThreshold<=0&&this.startConnectting(t,i,e,n),this.setEventData(t,{action:"magnet"}),this.stopPropagation(t)):this.onMouseDown(t,e,n),r.view.delegateDragEvents(t,this)}startConnectting(t,e,n,i){this.graph.model.startBatch("add-edge");const r=this.createEdgeFromMagnet(e,n,i);r.notifyMouseDown(t,n,i),r.setEventData(t,r.prepareArrowheadDragging("target",{x:n,y:i,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(t,{edgeView:r})}createEdgeFromMagnet(t,e,n){const i=this.graph,r=i.model,s=i.hook.getDefaultEdge(this,t);return s.setSource(Object.assign(Object.assign({},s.getSource()),this.getEdgeTerminal(t,e,n,s,"source"))),s.setTarget(Object.assign(Object.assign({},s.getTarget()),{x:e,y:n})),s.addTo(r,{async:!1,ui:!0}),s.findView(i)}dragMagnet(t,e,n){const i=this.getEventData(t),r=i.edgeView;if(r)r.onMouseMove(t,e,n),this.autoScrollGraph(t.clientX,t.clientY);else{const r=this.graph,s=r.options.magnetThreshold,o=this.getEventTarget(t),a=i.targetMagnet;if("onleave"===s){if(a===o||a.contains(o))return}else if(r.view.getMouseMovedCount(t)<=s)return;this.startConnectting(t,a,e,n)}}stopMagnetDragging(t,e,n){const i=this.eventData(t),r=i.edgeView;r&&(r.onMouseUp(t,e,n),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(t,e,n){this.notify("node:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(t,e,n,i,r){let s=[r];const o=this.graph.selection.widget;if(o&&o.options.movable){const t=this.graph.getSelectedCells();t.includes(r)&&(s=t.filter((t=>t.isNode())))}s.forEach((r=>{this.notify(t,{e:e,x:n,y:i,cell:r,node:r,view:r.findView(this.graph)})}))}startNodeDragging(t,e,n){const i=this.getDelegatedView();if(null==i||!i.can("nodeMovable"))return this.notifyUnhandledMouseDown(t,e,n);this.setEventData(t,{targetView:i,action:"move"});const r=ub.create(i.cell.getPosition());i.setEventData(t,{moving:!1,offset:r.diff(e,n),restrict:this.graph.hook.getRestrictArea(i)})}dragNode(t,e,n){const i=this.cell,r=this.graph,s=r.getGridSize(),o=this.getEventData(t),a=o.offset,l=o.restrict;o.moving||(o.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",t,e,n,this.cell)),this.autoScrollGraph(t.clientX,t.clientY);const c=QC.snapToGrid(e+a.x,s),h=QC.snapToGrid(n+a.y,s);i.setPosition(c,h,{restrict:l,deep:!0,ui:!0}),r.options.embedding.enabled&&(o.embedding||(this.prepareEmbedding(t),o.embedding=!0),this.processEmbedding(t,o))}stopNodeDragging(t,e,n){const i=this.getEventData(t);i.embedding&&this.finalizeEmbedding(t,i),i.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",t,e,n,this.cell)),i.moving=!1,i.embedding=!1}autoScrollGraph(t,e){const n=this.graph.scroller.widget;n&&n.autoScroll(t,e)}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNodeView&&"function"===typeof i.isEdgeView&&"function"===typeof i.confirmUpdate&&"function"===typeof i.update&&"function"===typeof i.findPortElem&&"function"===typeof i.resize&&"function"===typeof i.rotate&&"function"===typeof i.translate}t.toStringTag=`X6.${t.name}`,t.isNodeView=e})(WM||(WM={})),WM.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),WM.registry.register("node",WM,!0);const qM=RM("text");class XM extends(IM("text",{view:qM,attrs:{text:{fontSize:18,fill:"#000000",stroke:null,refX:.5,refY:.5}}},{noText:!0})){}(function(t){class e extends WM{confirmUpdate(t,e={}){let n=super.confirmUpdate(t,e);return this.hasAction(n,"scale")&&(this.resize(),n=this.removeAction(n,"scale")),n}}t.View=e,e.config({actions:{attrs:["scale"]}}),WM.registry.register(qM,e)})(XM||(XM={}));class YM extends Ux{constructor(t,e={}){super(),this.length=0,this.comparator=e.comparator||"zIndex",this.clean(),t&&this.reset(t,{silent:!0})}toJSON(){return this.cells.map((t=>t.toJSON()))}add(t,e,n){let i,r;"number"===typeof e?(i=e,r=Object.assign({merge:!1},n)):(i=this.length,r=Object.assign({merge:!1},e)),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);const s=Array.isArray(t)?t:[t],o=this.comparator&&"number"!==typeof e&&!1!==r.sort,a=this.comparator||null;let l=!1;const c=[],h=[];return s.forEach((t=>{const e=this.get(t);e?r.merge&&!t.isSameStore(e)&&(e.setProp(t.getProp(),n),h.push(e),o&&!l&&(l=null==a||"function"===typeof a?e.hasChanged():"string"===typeof a?e.hasChanged(a):a.some((t=>e.hasChanged(t))))):(c.push(t),this.reference(t))})),c.length&&(o&&(l=!0),this.cells.splice(i,0,...c),this.length=this.cells.length),l&&this.sort({silent:!0}),r.silent||(c.forEach(((t,e)=>{const n={cell:t,index:i+e,options:r};this.trigger("added",n),r.dryrun||t.notify("added",Object.assign({},n))})),l&&this.trigger("sorted"),(c.length||h.length)&&this.trigger("updated",{added:c,merged:h,removed:[],options:r})),this}remove(t,e={}){const n=Array.isArray(t)?t:[t],i=this.removeCells(n,e);return!e.silent&&i.length>0&&this.trigger("updated",{options:e,removed:i,added:[],merged:[]}),Array.isArray(t)?i:i[0]}removeCells(t,e){const n=[];for(let i=0;i<t.length;i+=1){const r=this.get(t[i]);if(null==r)continue;const s=this.cells.indexOf(r);this.cells.splice(s,1),this.length-=1,delete this.map[r.id],n.push(r),this.unreference(r),e.dryrun||r.remove(),e.silent||(this.trigger("removed",{cell:r,index:s,options:e}),e.dryrun||r.notify("removed",{cell:r,index:s,options:e}))}return n}reset(t,e={}){const n=this.cells.slice();if(n.forEach((t=>this.unreference(t))),this.clean(),this.add(t,Object.assign({silent:!0},e)),!e.silent){const t=this.cells.slice();this.trigger("reseted",{options:e,previous:n,current:t});const i=[],r=[];t.forEach((t=>{const e=n.some((e=>e.id===t.id));e||i.push(t)})),n.forEach((e=>{const n=t.some((t=>t.id===e.id));n||r.push(e)})),this.trigger("updated",{options:e,added:i,removed:r,merged:[]})}return this}push(t,e){return this.add(t,this.length,e)}pop(t){const e=this.at(this.length-1);return this.remove(e,t)}unshift(t,e){return this.add(t,0,e)}shift(t){const e=this.at(0);return this.remove(e,t)}get(t){if(null==t)return null;const e="string"===typeof t||"number"===typeof t?t:t.id;return this.map[e]||null}has(t){return null!=this.get(t)}at(t){return t<0&&(t+=this.length),this.cells[t]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(t){return this.cells.indexOf(t)}toArray(){return this.cells.slice()}sort(t={}){return null!=this.comparator&&(this.cells=kl(this.cells,this.comparator),t.silent||this.trigger("sorted")),this}clone(){const t=this.constructor;return new t(this.cells.slice(),{comparator:this.comparator})}reference(t){this.map[t.id]=t,t.on("*",this.notifyCellEvent,this)}unreference(t){t.off("*",this.notifyCellEvent,this),delete this.map[t.id]}notifyCellEvent(t,e){const n=e.cell;this.trigger(`cell:${t}`,e),n&&(n.isNode()?this.trigger(`node:${t}`,Object.assign(Object.assign({},e),{node:n})):n.isEdge()&&this.trigger(`edge:${t}`,Object.assign(Object.assign({},e),{edge:n})))}clean(){this.length=0,this.cells=[],this.map={}}}class JM extends Ux{constructor(t=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new YM(t),this.setup()}get[Symbol.toStringTag](){return JM.toStringTag}notify(t,e){this.trigger(t,e);const n=this.graph;return n&&("sorted"===t||"reseted"===t||"updated"===t?n.trigger(`model:${t}`,e):n.trigger(t,e)),this}setup(){const t=this.collection;t.on("sorted",(()=>this.notify("sorted",null))),t.on("updated",(t=>this.notify("updated",t))),t.on("cell:change:zIndex",(()=>this.sortOnChangeZ())),t.on("added",(({cell:t})=>{this.onCellAdded(t)})),t.on("removed",(t=>{const e=t.cell;this.onCellRemoved(e,t.options),this.notify("cell:removed",t),e.isNode()?this.notify("node:removed",Object.assign(Object.assign({},t),{node:e})):e.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},t),{edge:e}))})),t.on("reseted",(t=>{this.onReset(t.current),this.notify("reseted",t)})),t.on("edge:change:source",(({edge:t})=>this.onEdgeTerminalChanged(t,"source"))),t.on("edge:change:target",(({edge:t})=>{this.onEdgeTerminalChanged(t,"target")}))}sortOnChangeZ(){this.collection.sort()}onCellAdded(t){const e=t.id;t.isEdge()?(t.updateParent(),this.edges[e]=!0,this.onEdgeTerminalChanged(t,"source"),this.onEdgeTerminalChanged(t,"target")):this.nodes[e]=!0}onCellRemoved(t,e){const n=t.id;if(t.isEdge()){delete this.edges[n];const e=t.getSource(),i=t.getTarget();if(e&&e.cell){const t=this.outgoings[e.cell],i=t?t.indexOf(n):-1;i>=0&&(t.splice(i,1),0===t.length&&delete this.outgoings[e.cell])}if(i&&i.cell){const t=this.incomings[i.cell],e=t?t.indexOf(n):-1;e>=0&&(t.splice(e,1),0===t.length&&delete this.incomings[i.cell])}}else delete this.nodes[n];e.clear||(e.disconnectEdges?this.disconnectConnectedEdges(t,e):this.removeConnectedEdges(t,e)),t.model===this&&(t.model=null)}onReset(t){this.nodes={},this.edges={},this.outgoings={},this.incomings={},t.forEach((t=>this.onCellAdded(t)))}onEdgeTerminalChanged(t,e){const n="source"===e?this.outgoings:this.incomings,i=t.previous(e);if(i&&i.cell){const e=n[i.cell],r=e?e.indexOf(t.id):-1;r>=0&&(e.splice(r,1),0===e.length&&delete n[i.cell])}const r=t.getTerminal(e);if(r&&r.cell){const e=n[r.cell]||[],i=e.indexOf(t.id);-1===i&&e.push(t.id),n[r.cell]=e}}prepareCell(t,e){return t.model||e&&e.dryrun||(t.model=this),null==t.zIndex&&t.setZIndex(this.getMaxZIndex()+1,{silent:!0}),t}resetCells(t,e={}){return t.map((t=>this.prepareCell(t,Object.assign(Object.assign({},e),{dryrun:!0})))),this.collection.reset(t,e),t.map((t=>this.prepareCell(t,{options:e}))),this}clear(t={}){const e=this.getCells();if(0===e.length)return this;const n=Object.assign(Object.assign({},t),{clear:!0});return this.batchUpdate("clear",(()=>{const t=e.sort(((t,e)=>{const n=t.isEdge()?1:2,i=e.isEdge()?1:2;return n-i}));while(t.length>0){const e=t.shift();e&&e.remove(n)}}),n),this}addNode(t,e={}){const n=NM.isNode(t)?t:this.createNode(t);return this.addCell(n,e),n}createNode(t){return NM.create(t)}addEdge(t,e={}){const n=GM.isEdge(t)?t:this.createEdge(t);return this.addCell(n,e),n}createEdge(t){return GM.create(t)}addCell(t,e={}){return Array.isArray(t)?this.addCells(t,e):(this.collection.has(t)||this.addings.has(t)||(this.addings.set(t,!0),this.collection.add(this.prepareCell(t,e),e),t.eachChild((t=>this.addCell(t,e))),this.addings.delete(t)),this)}addCells(t,e={}){const n=t.length;if(0===n)return this;const i=Object.assign(Object.assign({},e),{position:n-1,maxPosition:n-1});return this.startBatch("add",Object.assign(Object.assign({},i),{cells:t})),t.forEach((t=>{this.addCell(t,i),i.position-=1})),this.stopBatch("add",Object.assign(Object.assign({},i),{cells:t})),this}removeCell(t,e={}){const n="string"===typeof t?this.getCell(t):t;return n&&this.has(n)?this.collection.remove(n,e):null}updateCellId(t,e){this.startBatch("update",{id:e}),t.prop("id",e);const n=t.clone({keepId:!0});this.addCell(n);const i=this.getConnectedEdges(t);return i.forEach((n=>{const i=n.getSourceCell(),r=n.getTargetCell();i===t&&n.setSource(Object.assign(Object.assign({},n.getSource()),{cell:e})),r===t&&n.setTarget(Object.assign(Object.assign({},n.getTarget()),{cell:e}))})),this.removeCell(t),this.stopBatch("update",{id:e}),n}removeCells(t,e={}){return t.length?this.batchUpdate("remove",(()=>t.map((t=>this.removeCell(t,e))))):[]}removeConnectedEdges(t,e={}){const n=this.getConnectedEdges(t);return n.forEach((t=>{t.remove(e)})),n}disconnectConnectedEdges(t,e={}){const n="string"===typeof t?t:t.id;this.getConnectedEdges(t).forEach((t=>{const i=t.getSourceCell(),r=t.getTargetCell();i&&i.id===n&&t.setSource({x:0,y:0},e),r&&r.id===n&&t.setTarget({x:0,y:0},e)}))}has(t){return this.collection.has(t)}total(){return this.collection.length}indexOf(t){return this.collection.indexOf(t)}getCell(t){return this.collection.get(t)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const t=this.collection.first();return t&&t.getZIndex()||0}getMaxZIndex(){const t=this.collection.last();return t&&t.getZIndex()||0}getCellsFromCache(t){return t?Object.keys(t).map((t=>this.getCell(t))).filter((t=>null!=t)):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(t){const e="string"===typeof t?t:t.id,n=this.outgoings[e];return n?n.map((t=>this.getCell(t))).filter((t=>t&&t.isEdge())):null}getIncomingEdges(t){const e="string"===typeof t?t:t.id,n=this.incomings[e];return n?n.map((t=>this.getCell(t))).filter((t=>t&&t.isEdge())):null}getConnectedEdges(t,e={}){const n=[],i="string"===typeof t?this.getCell(t):t;if(null==i)return n;const r={},s=e.indirect;let o=e.incoming,a=e.outgoing;null==o&&null==a&&(o=a=!0);const l=(t,e)=>{const i=e?this.getOutgoingEdges(t):this.getIncomingEdges(t);if(null!=i&&i.forEach((t=>{r[t.id]||(n.push(t),r[t.id]=!0,s&&(o&&l(t,!1),a&&l(t,!0)))})),s&&t.isEdge()){const i=e?t.getTargetCell():t.getSourceCell();i&&i.isEdge()&&(r[i.id]||(n.push(i),l(i,e)))}};if(a&&l(i,!0),o&&l(i,!1),e.deep){const t=i.getDescendants({deep:!0}),s={};t.forEach((t=>{t.isNode()&&(s[t.id]=!0)}));const l=(t,i)=>{const o=i?this.getOutgoingEdges(t.id):this.getIncomingEdges(t.id);null!=o&&o.forEach((t=>{if(!r[t.id]){const i=t.getSourceCell(),o=t.getTargetCell();if(!e.enclosed&&i&&s[i.id]&&o&&s[o.id])return;n.push(t),r[t.id]=!0}}))};t.forEach((t=>{t.isEdge()||(a&&l(t,!0),o&&l(t,!1))}))}return n}isBoundary(t,e){const n="string"===typeof t?this.getCell(t):t,i=e?this.getIncomingEdges(n):this.getOutgoingEdges(n);return null==i||0===i.length}getBoundaryNodes(t){const e=[];return Object.keys(this.nodes).forEach((n=>{if(this.isBoundary(n,t)){const t=this.getCell(n);t&&e.push(t)}})),e}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(t){return this.isBoundary(t,!0)}isLeaf(t){return this.isBoundary(t,!1)}getNeighbors(t,e={}){let n=e.incoming,i=e.outgoing;null==n&&null==i&&(n=i=!0);const r=this.getConnectedEdges(t,e),s=r.reduce(((r,s)=>{const o=s.hasLoop(e),a=s.getSourceCell(),l=s.getTargetCell();return n&&a&&a.isNode()&&!r[a.id]&&(!o&&(a===t||e.deep&&a.isDescendantOf(t))||(r[a.id]=a)),i&&l&&l.isNode()&&!r[l.id]&&(!o&&(l===t||e.deep&&l.isDescendantOf(t))||(r[l.id]=l)),r}),{});if(t.isEdge()){if(n){const e=t.getSourceCell();e&&e.isNode()&&!s[e.id]&&(s[e.id]=e)}if(i){const e=t.getTargetCell();e&&e.isNode()&&!s[e.id]&&(s[e.id]=e)}}return Object.keys(s).map((t=>s[t]))}isNeighbor(t,e,n={}){let i=n.incoming,r=n.outgoing;return null==i&&null==r&&(i=r=!0),this.getConnectedEdges(t,n).some((t=>{const n=t.getSourceCell(),s=t.getTargetCell();return!(!i||!n||n.id!==e.id)||!(!r||!s||s.id!==e.id)}))}getSuccessors(t,e={}){const n=[];return this.search(t,((i,r)=>{i!==t&&this.matchDistance(r,e.distance)&&n.push(i)}),Object.assign(Object.assign({},e),{outgoing:!0})),n}isSuccessor(t,e,n={}){let i=!1;return this.search(t,((r,s)=>{if(r===e&&r!==t&&this.matchDistance(s,n.distance))return i=!0,!1}),Object.assign(Object.assign({},n),{outgoing:!0})),i}getPredecessors(t,e={}){const n=[];return this.search(t,((i,r)=>{i!==t&&this.matchDistance(r,e.distance)&&n.push(i)}),Object.assign(Object.assign({},e),{incoming:!0})),n}isPredecessor(t,e,n={}){let i=!1;return this.search(t,((r,s)=>{if(r===e&&r!==t&&this.matchDistance(s,n.distance))return i=!0,!1}),Object.assign(Object.assign({},n),{incoming:!0})),i}matchDistance(t,e){return null==e||("function"===typeof e?e(t):!(!Array.isArray(e)||!e.includes(t))||t===e)}getCommonAncestor(...t){const e=[];return t.forEach((t=>{t&&(Array.isArray(t)?e.push(...t):e.push(t))})),OM.getCommonAncestor(...e)}getSubGraph(t,e={}){const n=[],i={},r=[],s=[],o=t=>{i[t.id]||(n.push(t),i[t.id]=t,t.isEdge()&&s.push(t),t.isNode()&&r.push(t))};return t.forEach((t=>{if(o(t),e.deep){const e=t.getDescendants({deep:!0});e.forEach((t=>o(t)))}})),s.forEach((t=>{const e=t.getSourceCell(),s=t.getTargetCell();e&&!i[e.id]&&(n.push(e),i[e.id]=e,e.isNode()&&r.push(e)),s&&!i[s.id]&&(n.push(s),i[s.id]=s,s.isNode()&&r.push(s))})),r.forEach((t=>{const r=this.getConnectedEdges(t,e);r.forEach((t=>{const e=t.getSourceCell(),r=t.getTargetCell();!i[t.id]&&e&&i[e.id]&&r&&i[r.id]&&(n.push(t),i[t.id]=t)}))})),n}cloneSubGraph(t,e={}){const n=this.getSubGraph(t,e);return this.cloneCells(n)}cloneCells(t){return OM.cloneCells(t)}getNodesFromPoint(t,e){const n="number"===typeof t?{x:t,y:e||0}:t;return this.getNodes().filter((t=>t.getBBox().containsPoint(n)))}getNodesInArea(t,e,n,i,r){const s="number"===typeof t?new db(t,e,n,i):db.create(t),o="number"===typeof t?r:e,a=o&&o.strict;return this.getNodes().filter((t=>{const e=t.getBBox();return a?s.containsRect(e):s.isIntersectWithRect(e)}))}getEdgesInArea(t,e,n,i,r){const s="number"===typeof t?new db(t,e,n,i):db.create(t),o="number"===typeof t?r:e,a=o&&o.strict;return this.getEdges().filter((t=>{const e=t.getBBox();return 0===e.width?e.inflate(1,0):0===e.height&&e.inflate(0,1),a?s.containsRect(e):s.isIntersectWithRect(e)}))}getNodesUnderNode(t,e={}){const n=t.getBBox(),i=null==e.by||"bbox"===e.by?this.getNodesInArea(n):this.getNodesFromPoint(n[e.by]);return i.filter((e=>t.id!==e.id&&!e.isDescendantOf(t)))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(t,e={}){return OM.getCellsBBox(t,e)}search(t,e,n={}){n.breadthFirst?this.breadthFirstSearch(t,e,n):this.depthFirstSearch(t,e,n)}breadthFirstSearch(t,e,n={}){const i=[],r={},s={};i.push(t),s[t.id]=0;while(i.length>0){const t=i.shift();if(null==t||r[t.id])continue;if(r[t.id]=!0,!1===ey(e,this,t,s[t.id]))continue;const o=this.getNeighbors(t,n);o.forEach((e=>{s[e.id]=s[t.id]+1,i.push(e)}))}}depthFirstSearch(t,e,n={}){const i=[],r={},s={};i.push(t),s[t.id]=0;while(i.length>0){const t=i.pop();if(null==t||r[t.id])continue;if(r[t.id]=!0,!1===ey(e,this,t,s[t.id]))continue;const o=this.getNeighbors(t,n),a=i.length;o.forEach((e=>{s[e.id]=s[t.id]+1,i.splice(a,0,e)}))}}getShortestPath(t,e,n={}){const i={};this.getEdges().forEach((t=>{const e=t.getSourceCellId(),r=t.getTargetCellId();e&&r&&(i[e]||(i[e]=[]),i[r]||(i[r]=[]),i[e].push(r),n.directed||i[r].push(e))}));const r="string"===typeof t?t:t.id,s=qx.run(i,r,n.weight),o=[];let a="string"===typeof e?e:e.id;s[a]&&o.push(a);while(a=s[a])o.unshift(a);return o}translate(t,e,n){return this.getCells().filter((t=>!t.hasParent())).forEach((i=>i.translate(t,e,n))),this}resize(t,e,n){return this.resizeCells(t,e,this.getCells(),n)}resizeCells(t,e,n,i={}){const r=this.getCellsBBox(n);if(r){const s=Math.max(t/r.width,0),o=Math.max(e/r.height,0),a=r.getOrigin();n.forEach((t=>t.scale(s,o,a,i)))}return this}toJSON(t={}){return JM.toJSON(this.getCells(),t)}parseJSON(t){return JM.fromJSON(t)}fromJSON(t,e={}){const n=this.parseJSON(t);return this.resetCells(n,e),this}startBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)+1,this.notify("batch:start",{name:t,data:e}),this}stopBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)-1,this.notify("batch:stop",{name:t,data:e}),this}batchUpdate(t,e,n={}){this.startBatch(t,n);const i=e();return this.stopBatch(t,n),i}hasActiveBatch(t=Object.keys(this.batches)){const e=Array.isArray(t)?t:[t];return e.some((t=>this.batches[t]>0))}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.addNode&&"function"===typeof i.addEdge&&null!=i.collection}t.toStringTag=`X6.${t.name}`,t.isModel=e})(JM||(JM={})),function(t){function e(t,e={}){return{cells:t.map((t=>t.toJSON(e)))}}function n(t){const e=[];return Array.isArray(t)?e.push(...t):(t.cells&&e.push(...t.cells),t.nodes&&t.nodes.forEach((t=>{null==t.shape&&(t.shape="rect"),e.push(t)})),t.edges&&t.edges.forEach((t=>{null==t.shape&&(t.shape="edge"),e.push(t)}))),e.map((t=>{const e=t.shape;if(e){if(NM.registry.exist(e))return NM.create(t);if(GM.registry.exist(e))return GM.create(t)}throw new Error("The `shape` should be specified when creating a node/edge instance")}))}t.toJSON=e,t.fromJSON=n}(JM||(JM={}));const ZM=".text-block-content",KM=RM("text-block");class QM extends NM{get content(){return this.getContent()}set content(t){this.setContent(t)}getContent(){return this.store.get("content","")}setContent(t,e={}){this.store.set("content",t,e)}setup(){super.setup(),this.store.on("change:*",(t=>{const e=t.key;"content"===e?this.updateContent(this.getContent()):"size"===e&&this.updateSize(this.getSize())})),this.updateSize(this.getSize()),this.updateContent(this.getContent())}updateSize(t){et.SUPPORT_FOREIGNOBJECT&&this.setAttrs({foreignObject:Object.assign({},t),[ZM]:{style:Object.assign({},t)}})}updateContent(t){et.SUPPORT_FOREIGNOBJECT?this.setAttrs({[ZM]:{html:t?Pm(t):""}}):this.setAttrs({[ZM]:{text:t}})}}(function(t){t.config({type:KM,view:KM,markup:['<g class="rotatable">','<g class="scalable"><rect/></g>',et.SUPPORT_FOREIGNOBJECT?["<foreignObject>",'<body xmlns="http://www.w3.org/1999/xhtml">',`<div class="${ZM.substr(1)}" />`,"</body>","</foreignObject>"].join(""):`<text class="${ZM.substr(1)}"/>`,"</g>"].join(""),attrs:{".":{fill:"#ffffff",stroke:"none"},rect:{fill:"#ffffff",stroke:"#000000",width:80,height:100},text:{fill:"#000000",fontSize:14,fontFamily:"Arial, helvetica, sans-serif"},body:{style:{background:"transparent",position:"static",margin:0,padding:0}},foreignObject:{style:{overflow:"hidden"}},[ZM]:{refX:.5,refY:.5,yAlign:"middle",xAlign:"middle",style:{textAlign:"center",verticalAlign:"middle",display:"table-cell",padding:"0 5px",margin:0}}}}),NM.registry.register(KM,t)})(QM||(QM={})),function(t){const e="content";class n extends WM{confirmUpdate(t,n={}){let i=super.confirmUpdate(t,n);return this.hasAction(i,e)&&(this.updateContent(),i=this.removeAction(i,e)),i}update(t){if(et.SUPPORT_FOREIGNOBJECT)super.update(t);else{const e=this.cell,n=Object.assign({},t||e.getAttrs());delete n[ZM],super.update(n),t&&!ql(t,ZM)||this.updateContent(t)}}updateContent(t){if(et.SUPPORT_FOREIGNOBJECT)super.update(t);else{const e=this.cell,n=(t||e.getAttrs())[ZM],i=Ub(e.getContent(),e.getSize(),n,{svgDocument:this.graph.view.svg}),r={[ZM]:ah({},n,{text:i})};super.update(r)}}}t.View=n,function(t){t.config({bootstrap:["render",e],actions:et.SUPPORT_FOREIGNOBJECT?{}:{size:e,content:e}}),WM.registry.register(KM,t)}(n=t.View||(t.View={}))}(QM||(QM={}));LM.define({shape:"empty"});function tS(t,e="body"){return[{tagName:t,selector:e},{tagName:"text",selector:"label"}]}function eS(t,e,n={}){const i={constructorName:t,markup:tS(t,n.selector),attrs:{[t]:Object.assign({},LM.bodyAttr)}},r=n.parent||LM;return r.define(ah(i,e,{shape:t}))}eS("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}}),NM.define({shape:"rect-headered",markup:[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"header"},{tagName:"text",selector:"headerText"},{tagName:"text",selector:"bodyText"}],attrs:{body:Object.assign(Object.assign({},LM.bodyAttr),{refWidth:"100%",refHeight:"100%"}),header:Object.assign(Object.assign({},LM.bodyAttr),{refWidth:"100%",height:30,stroke:"#000000"}),headerText:Object.assign(Object.assign({},LM.labelAttr),{refX:"50%",refY:15,fontSize:16}),bodyText:Object.assign(Object.assign({},LM.labelAttr),{refY2:15})}}),eS("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});const nS=10;LM.define({shape:"cylinder",overwrite:!0,markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],attrs:{body:Object.assign(Object.assign({},LM.bodyAttr),{lateral:nS}),top:Object.assign(Object.assign({},LM.bodyAttr),{refCx:"50%",refRx:"50%",cy:nS,ry:nS})},attrHooks:{lateral:{set(t,{refBBox:e}){const n=Bm(t);n&&(t=parseFloat(t)/100);const i=e.x,r=e.y,s=e.width,o=e.height,a=s/2,l=n?o*t:t,c=.551784,h=c*a,u=c*l,d=i,p=i+s/2,g=i+s,f=r+l,m=f-l,y=r+o-l,b=r+o,v=["M",d,f,"L",d,y,"C",i,y+u,p-h,b,p,b,"C",p+h,b,g,y+u,g,y,"L",g,f,"C",g,f-u,p+h,m,p,m,"C",p-h,m,d,f-u,d,f,"Z"];return{d:v.join(" ")}}}},knob:{enabled:!0,position({node:t}){const e=t.attr("body/lateral");return{x:0,y:e}},onMouseMove({node:t,data:e,deltaY:n}){if(0!==n){const i=t.getBBox(),r=t.attr("body/lateral");null==e.round&&(e.round=r);const s=0,o=i.height/2,a=Rm(e.round+n,s,o);a!==r&&t.attr({body:{lateral:a},top:{cy:a,ry:a}})}}}}),eS("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var iS=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class rS extends LM{get points(){return this.getPoints()}set points(t){this.setPoints(t)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(t,e){return null==t?this.removePoints():this.setAttrByPath("body/refPoints",rS.pointsToString(t),e),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(t){function e(t){return"string"===typeof t?t:t.map((t=>Array.isArray(t)?t.join(","):ub.isPointLike(t)?`${t.x}, ${t.y}`:"")).join(" ")}t.pointsToString=e,t.config({propHooks(t){const{points:n}=t,i=iS(t,["points"]);if(n){const t=e(n);t&&Md(i,"attrs/body/refPoints",t)}return i}})})(rS||(rS={}));eS("polygon",{},{parent:rS}),eS("polyline",{},{parent:rS});var sS=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};LM.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(t){const{path:e}=t,n=sS(t,["path"]);return e&&Md(n,"attrs/body/refD",e),n}});var oS=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};LM.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},et.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:by.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},LM.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(t){const{text:e}=t,n=oS(t,["text"]);return e&&Md(n,"attrs/label/text",e),n},attrHooks:{text:{set(t,{cell:e,view:n,refBBox:i,elem:r,attrs:s}){if(!(r instanceof HTMLElement)){const o=s.style||{},a={text:t,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},o),c=AC.presets.textWrap;return ey(c.set,this,a,{cell:e,view:n,elem:r,refBBox:i,attrs:l}),{fill:o.color||null}}r.textContent=t},position(t,{refBBox:e,elem:n}){if(n instanceof SVGElement)return e.getCenter()}}}}),eS("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:BM()},{selector:"image"}),eS("image-bordered",{markup:[{tagName:"rect",selector:"background",attrs:{stroke:"none"}},{tagName:"image",selector:"image"},{tagName:"rect",selector:"border",attrs:{fill:"none"}},{tagName:"text",selector:"label"}],attrs:{background:{refWidth:-1,refHeight:-1,x:.5,y:.5,fill:"#ffffff"},border:{refWidth:"100%",refHeight:"100%",stroke:"#333333",strokeWidth:2},image:{refWidth:-1,refHeight:-1,x:.5,y:.5}},propHooks:BM()}),eS("image-embedded",{markup:[{tagName:"rect",selector:"body"},{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}],attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#FFFFFF",strokeWidth:2},image:{refWidth:"30%",refHeight:-20,x:10,y:10,preserveAspectRatio:"xMidYMin"}},propHooks:BM()}),eS("image-inscribed",{propHooks:BM(),markup:[{tagName:"ellipse",selector:"background"},{tagName:"image",selector:"image"},{tagName:"ellipse",selector:"border",attrs:{fill:"none"}},{tagName:"text",selector:"label"}],attrs:{border:{refRx:"50%",refRy:"50%",refCx:"50%",refCy:"50%",stroke:"#333333",strokeWidth:2},background:{refRx:"50%",refRy:"50%",refCx:"50%",refCy:"50%",fill:"#ffffff"},image:{refWidth:"68%",refHeight:"68%",refX:"16%",refY:"16%",preserveAspectRatio:"xMidYMid"}}});const aS=GM.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}});GM.define({shape:"shadow-edge",markup:[{tagName:"path",selector:"shadow",attrs:{fill:"none"}},{tagName:"path",selector:"line",attrs:{fill:"none",cursor:"pointer"}}],attrs:{line:{connection:!0,stroke:"#FF0000",strokeWidth:20,strokeLinejoin:"round",targetMarker:{name:"path",stroke:"none",d:"M 0 -10 -10 0 0 10 z",offsetX:-5},sourceMarker:{name:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z",offsetX:-5}},shadow:{connection:!0,refX:3,refY:6,stroke:"#000000",strokeOpacity:.2,strokeWidth:20,strokeLinejoin:"round",targetMarker:{name:"path",d:"M 0 -10 -10 0 0 10 z",stroke:"none",offsetX:-5},sourceMarker:{name:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z",offsetX:-5}}}}),GM.define({shape:"double-edge",markup:[{tagName:"path",selector:"outline",attrs:{fill:"none"}},{tagName:"path",selector:"line",attrs:{fill:"none",cursor:"pointer"}}],attrs:{line:{connection:!0,stroke:"#dddddd",strokeWidth:4,strokeLinejoin:"round",targetMarker:{tagName:"path",stroke:"#000000",d:"M 10 -3 10 -10 -2 0 10 10 10 3"}},outline:{connection:!0,stroke:"#000000",strokeWidth:6,strokeLinejoin:"round"}}});class lS extends LM{get html(){return this.getHTML()}set html(t){this.setHTML(t)}getHTML(){return this.store.get("html")}setHTML(t,e={}){return null==t?this.removeHTML(e):this.store.set("html",t,e),this}removeHTML(t={}){return this.store.remove("html",t)}}(function(t){class e extends WM{init(){super.init(),this.cell.on("change:*",(()=>{const t=this.graph.hook.shouldUpdateHTMLComponent(this.cell);t&&this.renderHTMLComponent()}))}confirmUpdate(t){const n=super.confirmUpdate(t);return this.handleAction(n,e.action,(()=>this.renderHTMLComponent()))}renderHTMLComponent(){const t=this.selectors.foContent;if(t){const e=this.$(t).empty(),n=this.graph.hook.getHTMLComponent(this.cell);n&&("string"===typeof n?e.html(n):e.append(n))}}}t.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),WM.registry.register("html-view",t)}(e=t.View||(t.View={}))})(lS||(lS={})),function(t){t.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},hE.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),NM.registry.register("html",t)}(lS||(lS={})),function(t){t.componentRegistry=Yv.create({type:"html componnet"})}(lS||(lS={}));var cS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class hS extends Wx{constructor(t){super(),this.delay=10,this.throttle=2,this.threshold=5,this.changeCount=0,this.timestamp=0,this.options=Object.assign(Object.assign({},hS.defaultOptions),t),this.graph.model.on("cell:change:*",this.onModelChanged,this)}get graph(){return this.options.graph}onModelChanged(){if(this.disabled)return;const t=(new Date).getTime(),e=(t-this.timestamp)/1e3;e>this.delay||this.changeCount>=this.threshold&&e>this.throttle?(this.save(),this.reset()):this.changeCount+=1}save(){this.trigger("save")}reset(){this.changeCount=0,this.timestamp=(new Date).getTime()}dispose(){this.graph.model.off("cell:change:*",this.onModelChanged,this)}}cS([Wx.dispose()],hS.prototype,"dispose",null),function(t){t.defaultOptions={delay:10,throttle:2,threshold:5}}(hS||(hS={}));class uS extends Gx{constructor(t){super(),this.graph=t,this.init()}get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}init(){}}var dS,pS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class gS extends eE{constructor(t){super(),this.graph=t;const{selectors:e,fragment:n}=hE.parseJSONMarkup(gS.markup);this.background=e.background,this.grid=e.grid,this.svg=e.svg,this.defs=e.defs,this.viewport=e.viewport,this.primer=e.primer,this.stage=e.stage,this.decorator=e.decorator,this.overlay=e.overlay,this.container=this.options.container,this.restore=gS.snapshoot(this.container),this.$(this.container).addClass(this.prefixClassName("graph")).append(n),this.delegateEvents()}get model(){return this.graph.model}get options(){return this.graph.options}delegateEvents(){const t=this.constructor;return super.delegateEvents(t.events),this}guard(t,e){return"mousedown"===t.type&&2===t.button||(!(!this.options.guard||!this.options.guard(t,e))||(t.data&&void 0!==t.data.guarded?t.data.guarded:!(e&&e.cell&&OM.isCell(e.cell))&&(this.svg!==t.target&&this.container!==t.target&&!Q().contains(this.svg,t.target))))}findView(t){return this.graph.renderer.findViewByElem(t)}onDblClick(t){this.options.preventDefaultDblClick&&t.preventDefault();const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onDblClick(e,i.x,i.y):this.graph.trigger("blank:dblclick",{e:e,x:i.x,y:i.y})}onClick(t){if(this.getMouseMovedCount(t)<=this.options.clickThreshold){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onClick(e,i.x,i.y):this.graph.trigger("blank:click",{e:e,x:i.x,y:i.y})}}onContextMenu(t){this.options.preventDefaultContextMenu&&t.preventDefault();const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onContextMenu(e,i.x,i.y):this.graph.trigger("blank:contextmenu",{e:e,x:i.x,y:i.y})}delegateDragEvents(t,e){null==t.data&&(t.data={}),this.setEventData(t,{currentView:e||null,mouseMovedCount:0,startPosition:{x:t.clientX,y:t.clientY}});const n=this.constructor;this.delegateDocumentEvents(n.documentEvents,t.data),this.undelegateEvents()}getMouseMovedCount(t){const e=this.getEventData(t);return e.mouseMovedCount||0}onMouseDown(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;this.options.preventDefaultMouseDown&&e.preventDefault();const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onMouseDown(e,i.x,i.y):(this.options.preventDefaultBlankAction&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:e,x:i.x,y:i.y})),this.delegateDragEvents(e,n)}onMouseMove(t){const e=this.getEventData(t),n=e.startPosition;if(n&&n.x===t.clientX&&n.y===t.clientY)return;null==e.mouseMovedCount&&(e.mouseMovedCount=0),e.mouseMovedCount+=1;const i=e.mouseMovedCount;if(i<=this.options.moveThreshold)return;const r=this.normalizeEvent(t),s=this.graph.snapToGrid(r.clientX,r.clientY),o=e.currentView;o?o.onMouseMove(r,s.x,s.y):this.graph.trigger("blank:mousemove",{e:r,x:s.x,y:s.y}),this.setEventData(r,e)}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY),i=this.getEventData(t),r=i.currentView;r?r.onMouseUp(e,n.x,n.y):this.graph.trigger("blank:mouseup",{e:e,x:n.x,y:n.y}),t.isPropagationStopped()||this.onClick(Q().Event(t,{type:"click",data:t.data})),t.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOver(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseover",{e:e})}}onMouseOut(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOut(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseout",{e:e})}}onMouseEnter(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.renderer.findViewByElem(e.relatedTarget);if(n){if(i===n)return;n.onMouseEnter(e)}else{if(i)return;this.graph.trigger("graph:mouseenter",{e:e})}}onMouseLeave(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.renderer.findViewByElem(e.relatedTarget);if(n){if(i===n)return;n.onMouseLeave(e)}else{if(i)return;this.graph.trigger("graph:mouseleave",{e:e})}}onMouseWheel(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=e.originalEvent,r=this.graph.snapToGrid(i.clientX,i.clientY),s=Math.max(-1,Math.min(1,i.wheelDelta||-i.detail));n?n.onMouseWheel(e,r.x,r.y,s):this.graph.trigger("blank:mousewheel",{e:e,delta:s,x:r.x,y:r.y})}onCustomEvent(t){const e=t.currentTarget,n=e.getAttribute("event")||e.getAttribute("data-event");if(n){const i=this.findView(e);if(i){const e=this.normalizeEvent(t);if(this.guard(e,i))return;const r=this.graph.snapToGrid(e.clientX,e.clientY);i.onCustomEvent(e,n,r.x,r.y)}}}handleMagnetEvent(t,e){const n=t.currentTarget,i=n.getAttribute("magnet");if(i&&"false"!==i.toLowerCase()){const i=this.findView(n);if(i){const r=this.normalizeEvent(t);if(this.guard(r,i))return;const s=this.graph.snapToGrid(r.clientX,r.clientY);ey(e,this.graph,i,r,n,s.x,s.y)}}}onMagnetMouseDown(t){this.handleMagnetEvent(t,((t,e,n,i,r)=>{t.onMagnetMouseDown(e,n,i,r)}))}onMagnetDblClick(t){this.handleMagnetEvent(t,((t,e,n,i,r)=>{t.onMagnetDblClick(e,n,i,r)}))}onMagnetContextMenu(t){this.options.preventDefaultContextMenu&&t.preventDefault(),this.handleMagnetEvent(t,((t,e,n,i,r)=>{t.onMagnetContextMenu(e,n,i,r)}))}onLabelMouseDown(t){const e=t.currentTarget,n=this.findView(e);if(n){const e=this.normalizeEvent(t);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n.onLabelMouseDown(e,i.x,i.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}pS([eE.dispose()],gS.prototype,"dispose",null),function(t){const e=`${KC.prefixCls}-graph`;function n(t){const e=t.cloneNode();return t.childNodes.forEach((t=>e.appendChild(t))),()=>{Ny(t);while(t.attributes.length>0)t.removeAttribute(t.attributes[0].name);for(let n=0,i=e.attributes.length;n<i;n+=1){const i=e.attributes[n];t.setAttribute(i.name,i.value)}e.childNodes.forEach((e=>t.appendChild(e)))}}t.markup=[{ns:by.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:by.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:by.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":by.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:`${e}-svg-viewport`,children:[{tagName:"g",selector:"primer",className:`${e}-svg-primer`},{tagName:"g",selector:"stage",className:`${e}-svg-stage`},{tagName:"g",selector:"decorator",className:`${e}-svg-decorator`},{tagName:"g",selector:"overlay",className:`${e}-svg-overlay`}]}]}],t.snapshoot=n}(gS||(gS={})),function(t){const e=KC.prefixCls;t.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${e}-cell`]:"onMouseEnter",[`mouseleave .${e}-cell`]:"onMouseLeave",[`mouseenter .${e}-cell-tools`]:"onMouseEnter",[`mouseleave .${e}-cell-tools`]:"onMouseLeave",[`mousedown .${e}-cell [event]`]:"onCustomEvent",[`touchstart .${e}-cell [event]`]:"onCustomEvent",[`mousedown .${e}-cell [data-event]`]:"onCustomEvent",[`touchstart .${e}-cell [data-event]`]:"onCustomEvent",[`dblclick .${e}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${e}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${e}-cell image`]:"onImageDragStart",[`mousedown .${e}-edge .${e}-edge-label`]:"onLabelMouseDown",[`touchstart .${e}-edge .${e}-edge-label`]:"onLabelMouseDown"},t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(gS||(gS={})),function(t){function e(t,e){return(n,i,r)=>{const s=r.value;r.value=function(...n){const r=this.scroller.widget;if(null==r){const n=`Shoule enable scroller to use method '${i}'`;if(!1!==t)throw console.error(n),new Error(n);return!1!==e&&console.warn(n),this}return s.call(this,...n)}}}t.checkScroller=e}(dS||(dS={}));const fS=".x6-graph {\n position: relative;\n outline: none;\n}\n.x6-graph-background,\n.x6-graph-grid,\n.x6-graph-svg {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-background-stage,\n.x6-graph-grid-stage,\n.x6-graph-svg-stage {\n user-select: none;\n}\n.x6-graph.x6-graph-pannable {\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n.x6-graph.x6-graph-panning {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n}\n.x6-node {\n cursor: move;\n /* stylelint-disable-next-line */\n}\n.x6-node.x6-node-immovable {\n cursor: default;\n}\n.x6-node * {\n -webkit-user-drag: none;\n}\n.x6-node .scalable * {\n vector-effect: non-scaling-stroke;\n}\n.x6-node [magnet='true'] {\n cursor: crosshair;\n transition: opacity 0.3s;\n}\n.x6-node [magnet='true']:hover {\n opacity: 0.7;\n}\n.x6-node foreignObject {\n display: block;\n overflow: visible;\n background-color: transparent;\n}\n.x6-node foreignObject > body {\n position: static;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: visible;\n background-color: transparent;\n}\n.x6-edge .source-marker,\n.x6-edge .target-marker {\n vector-effect: non-scaling-stroke;\n}\n.x6-edge .connection {\n stroke-linejoin: round;\n fill: none;\n}\n.x6-edge .connection-wrap {\n cursor: move;\n opacity: 0;\n fill: none;\n stroke: #000;\n stroke-width: 15;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n.x6-edge .connection-wrap:hover {\n opacity: 0.4;\n stroke-opacity: 0.4;\n}\n.x6-edge .vertices {\n cursor: move;\n opacity: 0;\n}\n.x6-edge .vertices .vertex {\n fill: #1abc9c;\n}\n.x6-edge .vertices .vertex :hover {\n fill: #34495e;\n stroke: none;\n}\n.x6-edge .vertices .vertex-remove {\n cursor: pointer;\n fill: #fff;\n}\n.x6-edge .vertices .vertex-remove-area {\n cursor: pointer;\n opacity: 0.1;\n}\n.x6-edge .vertices .vertex-group:hover .vertex-remove-area {\n opacity: 1;\n}\n.x6-edge .arrowheads {\n cursor: move;\n opacity: 0;\n}\n.x6-edge .arrowheads .arrowhead {\n fill: #1abc9c;\n}\n.x6-edge .arrowheads .arrowhead :hover {\n fill: #f39c12;\n stroke: none;\n}\n.x6-edge .tools {\n cursor: pointer;\n opacity: 0;\n}\n.x6-edge .tools .tool-options {\n display: none;\n}\n.x6-edge .tools .tool-remove circle {\n fill: #f00;\n}\n.x6-edge .tools .tool-remove path {\n fill: #fff;\n}\n.x6-edge:hover .vertices,\n.x6-edge:hover .arrowheads,\n.x6-edge:hover .tools {\n opacity: 1;\n}\n.x6-highlight-opacity {\n opacity: 0.3;\n}\n@keyframes halo-pie-visibility {\n 0% {\n visibility: hidden;\n }\n 100% {\n visibility: visible;\n }\n}\n@keyframes halo-pie-opening {\n 0% {\n transform: scale(0.4) rotate(-20deg);\n }\n 100% {\n transform: scale(1) rotate(0);\n }\n}\n.x6-widget-handle {\n position: absolute;\n width: 20px;\n height: 20px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: 0 0;\n background-size: 20px 20px;\n cursor: pointer;\n user-select: none;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-handle.hidden {\n display: none;\n}\n.x6-widget-handle-selected {\n background-color: rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n}\n.x6-widget-handle-remove {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15.386%2C3.365c-3.315-3.314-8.707-3.313-12.021%2C0c-3.314%2C3.315-3.314%2C8.706%2C0%2C12.02%20c3.314%2C3.314%2C8.707%2C3.314%2C12.021%2C0S18.699%2C6.68%2C15.386%2C3.365L15.386%2C3.365z%20M4.152%2C14.598C1.273%2C11.719%2C1.273%2C7.035%2C4.153%2C4.154%20c2.88-2.88%2C7.563-2.88%2C10.443%2C0c2.881%2C2.88%2C2.881%2C7.562%2C0%2C10.443C11.716%2C17.477%2C7.032%2C17.477%2C4.152%2C14.598L4.152%2C14.598z%22%2F%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.157%2C11.371L7.38%2C6.593C7.162%2C6.375%2C6.809%2C6.375%2C6.592%2C6.592c-0.218%2C0.219-0.218%2C0.572%2C0%2C0.79%20l4.776%2C4.776c0.218%2C0.219%2C0.571%2C0.219%2C0.79%2C0C12.375%2C11.941%2C12.375%2C11.588%2C12.157%2C11.371L12.157%2C11.371z%22%2F%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M11.369%2C6.593l-4.777%2C4.778c-0.217%2C0.217-0.217%2C0.568%2C0%2C0.787c0.219%2C0.219%2C0.571%2C0.217%2C0.788%2C0l4.777-4.777%20c0.218-0.218%2C0.218-0.571%2C0.001-0.789C11.939%2C6.375%2C11.587%2C6.375%2C11.369%2C6.593L11.369%2C6.593z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: pointer;\n}\n.x6-widget-handle-remove:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15.386%2C3.365c-3.315-3.314-8.707-3.313-12.021%2C0c-3.314%2C3.315-3.314%2C8.706%2C0%2C12.02%20c3.314%2C3.314%2C8.707%2C3.314%2C12.021%2C0S18.699%2C6.68%2C15.386%2C3.365L15.386%2C3.365z%22%2F%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M12.157%2C11.371L7.38%2C6.593C7.162%2C6.375%2C6.809%2C6.375%2C6.592%2C6.592c-0.218%2C0.219-0.218%2C0.572%2C0%2C0.79%20l4.776%2C4.776c0.218%2C0.219%2C0.571%2C0.219%2C0.79%2C0C12.375%2C11.941%2C12.375%2C11.588%2C12.157%2C11.371L12.157%2C11.371z%22%2F%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M11.369%2C6.593l-4.777%2C4.778c-0.217%2C0.217-0.217%2C0.568%2C0%2C0.787c0.219%2C0.219%2C0.571%2C0.217%2C0.788%2C0l4.777-4.777%20c0.218-0.218%2C0.218-0.571%2C0.001-0.789C11.939%2C6.375%2C11.587%2C6.375%2C11.369%2C6.593L11.369%2C6.593z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-rotate {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M9.374%2C17.592c-4.176%2C0-7.57-3.401-7.57-7.575c0-4.175%2C3.395-7.574%2C7.57-7.574c0.28%2C0%2C0.56%2C0.018%2C0.837%2C0.05%20V1.268c0-0.158%2C0.099-0.3%2C0.239-0.36c0.151-0.058%2C0.315-0.026%2C0.428%2C0.086l2.683%2C2.688c0.152%2C0.154%2C0.152%2C0.399%2C0%2C0.553l-2.68%2C2.693%20c-0.115%2C0.112-0.279%2C0.147-0.431%2C0.087c-0.141-0.063-0.239-0.205-0.239-0.361V5.296C9.934%2C5.243%2C9.654%2C5.22%2C9.374%2C5.22%20c-2.646%2C0-4.796%2C2.152-4.796%2C4.797s2.154%2C4.798%2C4.796%2C4.798c2.645%2C0%2C4.798-2.153%2C4.798-4.798c0-0.214%2C0.174-0.391%2C0.391-0.391h1.991%20c0.217%2C0%2C0.394%2C0.177%2C0.394%2C0.391C16.947%2C14.19%2C13.549%2C17.592%2C9.374%2C17.592L9.374%2C17.592z%20M9.374%2C17.592%22%2F%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-rotate:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M9.374%2C17.592c-4.176%2C0-7.57-3.401-7.57-7.575c0-4.175%2C3.395-7.574%2C7.57-7.574c0.28%2C0%2C0.56%2C0.018%2C0.837%2C0.05%20V1.268c0-0.158%2C0.099-0.3%2C0.239-0.36c0.151-0.058%2C0.315-0.026%2C0.428%2C0.086l2.683%2C2.688c0.152%2C0.154%2C0.152%2C0.399%2C0%2C0.553l-2.68%2C2.693%20c-0.115%2C0.112-0.279%2C0.147-0.431%2C0.087c-0.141-0.063-0.239-0.205-0.239-0.361V5.296C9.934%2C5.243%2C9.654%2C5.22%2C9.374%2C5.22%20c-2.646%2C0-4.796%2C2.152-4.796%2C4.797s2.154%2C4.798%2C4.796%2C4.798c2.645%2C0%2C4.798-2.153%2C4.798-4.798c0-0.214%2C0.174-0.391%2C0.391-0.391h1.991%20c0.217%2C0%2C0.394%2C0.177%2C0.394%2C0.391C16.947%2C14.19%2C13.549%2C17.592%2C9.374%2C17.592L9.374%2C17.592z%20M9.374%2C17.592%22%2F%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-resize {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20height%3D%2224px%22%20version%3D%221.1%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asketch%3D%22http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%2Fns%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Ctitle%2F%3E%3Cdesc%2F%3E%3Cdefs%2F%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20id%3D%22miu%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%3E%3Cg%20id%3D%22Artboard-1%22%20transform%3D%22translate(-251.000000%2C%20-443.000000)%22%3E%3Cg%20id%3D%22slice%22%20transform%3D%22translate(215.000000%2C%20119.000000)%22%2F%3E%3Cpath%20d%3D%22M252%2C448%20L256%2C448%20L256%2C444%20L252%2C444%20L252%2C448%20Z%20M257%2C448%20L269%2C448%20L269%2C446%20L257%2C446%20L257%2C448%20Z%20M257%2C464%20L269%2C464%20L269%2C462%20L257%2C462%20L257%2C464%20Z%20M270%2C444%20L270%2C448%20L274%2C448%20L274%2C444%20L270%2C444%20Z%20M252%2C462%20L252%2C466%20L256%2C466%20L256%2C462%20L252%2C462%20Z%20M270%2C462%20L270%2C466%20L274%2C466%20L274%2C462%20L270%2C462%20Z%20M254%2C461%20L256%2C461%20L256%2C449%20L254%2C449%20L254%2C461%20Z%20M270%2C461%20L272%2C461%20L272%2C449%20L270%2C449%20L270%2C461%20Z%22%20fill%3D%22%236A6C8A%22%20id%3D%22editor-crop-glyph%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E');\n cursor: se-resize;\n}\n.x6-widget-handle-resize:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20height%3D%2224px%22%20version%3D%221.1%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asketch%3D%22http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%2Fns%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Ctitle%2F%3E%3Cdesc%2F%3E%3Cdefs%2F%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20id%3D%22miu%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%3E%3Cg%20id%3D%22Artboard-1%22%20transform%3D%22translate(-251.000000%2C%20-443.000000)%22%3E%3Cg%20id%3D%22slice%22%20transform%3D%22translate(215.000000%2C%20119.000000)%22%2F%3E%3Cpath%20d%3D%22M252%2C448%20L256%2C448%20L256%2C444%20L252%2C444%20L252%2C448%20Z%20M257%2C448%20L269%2C448%20L269%2C446%20L257%2C446%20L257%2C448%20Z%20M257%2C464%20L269%2C464%20L269%2C462%20L257%2C462%20L257%2C464%20Z%20M270%2C444%20L270%2C448%20L274%2C448%20L274%2C444%20L270%2C444%20Z%20M252%2C462%20L252%2C466%20L256%2C466%20L256%2C462%20L252%2C462%20Z%20M270%2C462%20L270%2C466%20L274%2C466%20L274%2C462%20L270%2C462%20Z%20M254%2C461%20L256%2C461%20L256%2C449%20L254%2C449%20L254%2C461%20Z%20M270%2C461%20L272%2C461%20L272%2C449%20L270%2C449%20L270%2C461%20Z%22%20fill%3D%22%23FD6EB6%22%20id%3D%22editor-crop-glyph%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E');\n}\n.x6-widget-handle-clone {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.852%2C0.875h-9.27c-0.853%2C0-1.547%2C0.694-1.547%2C1.547v10.816h1.547V2.422h9.27V0.875z%20M15.172%2C3.965h-8.5%20c-0.849%2C0-1.547%2C0.698-1.547%2C1.547v10.816c0%2C0.849%2C0.698%2C1.547%2C1.547%2C1.547h8.5c0.85%2C0%2C1.543-0.698%2C1.543-1.547V5.512%20C16.715%2C4.663%2C16.021%2C3.965%2C15.172%2C3.965L15.172%2C3.965z%20M15.172%2C16.328h-8.5V5.512h8.5V16.328z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-clone:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M12.852%2C0.875h-9.27c-0.853%2C0-1.547%2C0.694-1.547%2C1.547v10.816h1.547V2.422h9.27V0.875z%20M15.172%2C3.965h-8.5%20c-0.849%2C0-1.547%2C0.698-1.547%2C1.547v10.816c0%2C0.849%2C0.698%2C1.547%2C1.547%2C1.547h8.5c0.849%2C0%2C1.543-0.698%2C1.543-1.547V5.512%20C16.715%2C4.663%2C16.021%2C3.965%2C15.172%2C3.965L15.172%2C3.965z%20M15.172%2C16.328h-8.5V5.512h8.5V16.328z%20M15.172%2C16.328%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-link {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M9.884%2C9.838c0.54-0.551%2C1.005-0.955%2C1.384-1.201c0.463-0.308%2C0.749-0.352%2C0.887-0.352h1.34v1.367%20c0%2C0.104%2C0.061%2C0.2%2C0.154%2C0.242s0.204%2C0.027%2C0.284-0.038l3.168-2.669c0.06-0.051%2C0.096-0.125%2C0.096-0.203S17.16%2C6.83%2C17.101%2C6.781%20l-3.168-2.677c-0.08-0.067-0.19-0.081-0.284-0.038c-0.094%2C0.045-0.154%2C0.139-0.154%2C0.242v1.414h-1.343%20c-1.24%2C0.014-2.215%2C0.67-2.927%2C1.242c-0.797%2C0.65-1.533%2C1.447-2.245%2C2.217c-0.361%2C0.391-0.7%2C0.759-1.044%2C1.1%20c-0.541%2C0.549-1.011%2C0.951-1.395%2C1.199c-0.354%2C0.231-0.678%2C0.357-0.921%2C0.357h-1.8c-0.146%2C0-0.266%2C0.12-0.266%2C0.265v2.029%20c0%2C0.148%2C0.12%2C0.268%2C0.266%2C0.268h1.8l0%2C0c1.255-0.014%2C2.239-0.667%2C2.958-1.24c0.82-0.661%2C1.572-1.475%2C2.297-2.256%20C9.225%2C10.524%2C9.555%2C10.169%2C9.884%2C9.838z%22%2F%3E%3C%2Fsvg%3E%20');\n cursor: move;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n}\n.x6-widget-handle-link:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M9.884%2C9.838c0.54-0.551%2C1.005-0.955%2C1.384-1.201c0.463-0.308%2C0.749-0.352%2C0.887-0.352h1.34v1.367%20c0%2C0.104%2C0.061%2C0.2%2C0.154%2C0.242s0.204%2C0.027%2C0.284-0.038l3.168-2.669c0.06-0.051%2C0.096-0.125%2C0.096-0.203S17.16%2C6.83%2C17.101%2C6.781%20l-3.168-2.677c-0.08-0.067-0.19-0.081-0.284-0.038c-0.094%2C0.045-0.154%2C0.139-0.154%2C0.242v1.414h-1.343%20c-1.24%2C0.014-2.215%2C0.67-2.927%2C1.242c-0.797%2C0.65-1.533%2C1.447-2.245%2C2.217c-0.361%2C0.391-0.7%2C0.759-1.044%2C1.1%20c-0.541%2C0.549-1.011%2C0.951-1.395%2C1.199c-0.354%2C0.231-0.678%2C0.357-0.921%2C0.357h-1.8c-0.146%2C0-0.266%2C0.12-0.266%2C0.265v2.029%20c0%2C0.148%2C0.12%2C0.268%2C0.266%2C0.268h1.8l0%2C0c1.255-0.014%2C2.239-0.667%2C2.958-1.24c0.82-0.661%2C1.572-1.475%2C2.297-2.256%20C9.225%2C10.524%2C9.555%2C10.169%2C9.884%2C9.838z%22%2F%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-fork {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%236A6C8A%22%20d%3D%22M13.307%2C11.593c-0.69%2C0-1.299%2C0.33-1.693%2C0.835l-4.136-2.387%20C7.552%2C9.82%2C7.602%2C9.589%2C7.602%2C9.344c0-0.25-0.051-0.487-0.129-0.71l4.097-2.364c0.393%2C0.536%2C1.022%2C0.888%2C1.737%2C0.888%20c1.193%2C0%2C2.16-0.967%2C2.16-2.159s-0.967-2.159-2.16-2.159c-1.191%2C0-2.158%2C0.967-2.158%2C2.159c0%2C0.076%2C0.014%2C0.149%2C0.021%2C0.223%20L6.848%2C7.716C6.469%2C7.39%2C5.982%2C7.185%2C5.442%2C7.185c-1.191%2C0-2.158%2C0.967-2.158%2C2.159s0.967%2C2.159%2C2.158%2C2.159%20c0.545%2C0%2C1.037-0.208%2C1.417-0.541l4.319%2C2.493c-0.014%2C0.098-0.029%2C0.194-0.029%2C0.296c0%2C1.193%2C0.967%2C2.159%2C2.158%2C2.159%20c1.193%2C0%2C2.16-0.966%2C2.16-2.159C15.467%2C12.559%2C14.5%2C11.593%2C13.307%2C11.593z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-fork:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23FD6EB6%22%20d%3D%22M13.307%2C11.593c-0.69%2C0-1.299%2C0.33-1.693%2C0.835l-4.136-2.387%20c0.075-0.22%2C0.125-0.452%2C0.125-0.697c0-0.25-0.051-0.487-0.129-0.71l4.097-2.365c0.394%2C0.536%2C1.022%2C0.888%2C1.737%2C0.888%20c1.193%2C0%2C2.16-0.967%2C2.16-2.159s-0.967-2.159-2.16-2.159c-1.191%2C0-2.158%2C0.967-2.158%2C2.159c0%2C0.076%2C0.015%2C0.148%2C0.022%2C0.223%20L6.848%2C7.716C6.469%2C7.39%2C5.981%2C7.185%2C5.442%2C7.185c-1.191%2C0-2.158%2C0.967-2.158%2C2.159s0.967%2C2.159%2C2.158%2C2.159%20c0.545%2C0%2C1.037-0.208%2C1.417-0.541l4.319%2C2.493c-0.013%2C0.098-0.029%2C0.194-0.029%2C0.296c0%2C1.193%2C0.967%2C2.159%2C2.158%2C2.159%20c1.193%2C0%2C2.16-0.966%2C2.16-2.159C15.467%2C12.559%2C14.5%2C11.593%2C13.307%2C11.593z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-unlink {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.285%2C9.711l-2.104-0.302L9.243%2C8.568L6.669%2C7.095C6.948%2C6.6%2C6.995%2C6.026%2C6.845%2C5.474%20c-0.191-0.698-0.695-1.36-1.438-1.786C4.068%2C2.922%2C2.464%2C3.214%2C1.82%2C4.338C1.536%2C4.836%2C1.489%2C5.414%2C1.64%2C5.97%20c0.189%2C0.698%2C0.694%2C1.36%2C1.438%2C1.787c0.328%2C0.187%2C0.67%2C0.31%2C1.01%2C0.372c0.002%2C0%2C0.006%2C0.002%2C0.008%2C0.004%20c0.027%2C0.004%2C0.057%2C0.009%2C0.088%2C0.011c2.12%2C0.316%2C3.203%2C0.915%2C3.73%2C1.337c-0.527%2C0.424-1.61%2C1.021-3.731%2C1.339%20c-0.029%2C0.003-0.058%2C0.007-0.087%2C0.012c-0.002%2C0.002-0.004%2C0.002-0.007%2C0.003c-0.341%2C0.062-0.684%2C0.187-1.013%2C0.374%20c-0.74%2C0.425-1.246%2C1.089-1.437%2C1.787c-0.149%2C0.555-0.105%2C1.133%2C0.181%2C1.632c0.011%2C0.018%2C0.021%2C0.033%2C0.033%2C0.049l0.883%2C0.783%20c0.765%2C0.366%2C1.775%2C0.328%2C2.67-0.184c0.744-0.425%2C1.248-1.088%2C1.439-1.786c0.148-0.552%2C0.104-1.126-0.176-1.62l2.573-1.473%20c0.573%2C0.287%2C2.299%2C1.292%2C2.299%2C1.292s3.602%2C1.445%2C4.241%2C1.812c0.773%2C0.191%2C0.566-0.151%2C0.566-0.151L12.285%2C9.711z%20M5.571%2C6.482%20C5.279%2C6.993%2C4.425%2C7.076%2C3.705%2C6.664C3.282%2C6.424%2C2.966%2C6.039%2C2.856%2C5.64C2.81%2C5.464%2C2.778%2C5.203%2C2.917%2C4.963%20c0.291-0.51%2C1.146-0.593%2C1.866-0.182C5.21%2C5.027%2C5.521%2C5.4%2C5.632%2C5.807C5.679%2C5.98%2C5.708%2C6.242%2C5.571%2C6.482z%20M5.632%2C13.159%20c-0.111%2C0.406-0.422%2C0.778-0.848%2C1.025c-0.719%2C0.409-1.576%2C0.327-1.867-0.184c-0.137-0.239-0.106-0.499-0.06-0.676%20c0.108-0.398%2C0.426-0.781%2C0.847-1.022c0.72-0.412%2C1.574-0.329%2C1.866%2C0.181C5.708%2C12.723%2C5.679%2C12.983%2C5.632%2C13.159z%20M16.181%2C5.139%20c-0.448%2C0.258-4.435%2C1.9-4.435%2C1.9s-1.556%2C0.855-2.104%2C1.13l0.937%2C0.843l2.057-0.229l4.11-3.638%20C16.745%2C5.146%2C17.013%2C4.664%2C16.181%2C5.139z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-unlink:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M12.285%2C9.711l-2.104-0.302L9.243%2C8.568L6.669%2C7.095C6.948%2C6.6%2C6.995%2C6.026%2C6.845%2C5.474%20c-0.191-0.698-0.695-1.36-1.438-1.786C4.068%2C2.922%2C2.464%2C3.214%2C1.82%2C4.338C1.536%2C4.836%2C1.489%2C5.414%2C1.64%2C5.97%20c0.189%2C0.698%2C0.694%2C1.36%2C1.438%2C1.787c0.328%2C0.187%2C0.67%2C0.31%2C1.01%2C0.372c0.002%2C0%2C0.006%2C0.002%2C0.008%2C0.004%20c0.027%2C0.004%2C0.057%2C0.009%2C0.088%2C0.011c2.12%2C0.316%2C3.203%2C0.915%2C3.73%2C1.337c-0.527%2C0.424-1.61%2C1.021-3.731%2C1.339%20c-0.029%2C0.003-0.058%2C0.007-0.087%2C0.012c-0.002%2C0.002-0.004%2C0.002-0.007%2C0.003c-0.341%2C0.062-0.684%2C0.187-1.013%2C0.374%20c-0.74%2C0.425-1.246%2C1.089-1.437%2C1.787c-0.149%2C0.555-0.105%2C1.133%2C0.181%2C1.632c0.011%2C0.018%2C0.021%2C0.033%2C0.033%2C0.049l0.883%2C0.783%20c0.765%2C0.366%2C1.775%2C0.328%2C2.67-0.184c0.744-0.425%2C1.248-1.088%2C1.439-1.786c0.148-0.552%2C0.104-1.126-0.176-1.62l2.573-1.473%20c0.573%2C0.287%2C2.299%2C1.292%2C2.299%2C1.292s3.602%2C1.445%2C4.241%2C1.812c0.773%2C0.191%2C0.566-0.151%2C0.566-0.151L12.285%2C9.711z%20M5.571%2C6.482%20C5.279%2C6.993%2C4.425%2C7.076%2C3.705%2C6.664C3.282%2C6.424%2C2.966%2C6.039%2C2.856%2C5.64C2.81%2C5.464%2C2.778%2C5.203%2C2.917%2C4.963%20c0.291-0.51%2C1.146-0.593%2C1.866-0.182C5.21%2C5.027%2C5.521%2C5.4%2C5.632%2C5.807C5.679%2C5.98%2C5.708%2C6.242%2C5.571%2C6.482z%20M5.632%2C13.159%20c-0.111%2C0.406-0.422%2C0.778-0.848%2C1.025c-0.719%2C0.409-1.576%2C0.327-1.867-0.184c-0.137-0.239-0.106-0.499-0.06-0.676%20c0.108-0.398%2C0.426-0.781%2C0.847-1.022c0.72-0.412%2C1.574-0.329%2C1.866%2C0.181C5.708%2C12.723%2C5.679%2C12.983%2C5.632%2C13.159z%20M16.181%2C5.139%20c-0.448%2C0.258-4.435%2C1.9-4.435%2C1.9s-1.556%2C0.855-2.104%2C1.13l0.937%2C0.843l2.057-0.229l4.11-3.638%20C16.745%2C5.146%2C17.013%2C4.664%2C16.181%2C5.139z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-direction {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20%20PUBLIC%20'-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN'%20%20'http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd'%3E%3Csvg%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%20512%20512%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%20512%20512%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%236A6C8A%3Bstroke%3A%236A6C8A%3Bstroke-width%3A30%7D%0A%09.dot%7Bfill%3A%236A6C8A%3B%7D%0A%3C%2Fstyle%3E%3Cg%3E%3Cg%20id%3D%22XMLID_475_%22%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M133.1%2C277.1c1.8%2C0%2C3.7-0.6%2C5.4-1.7c4.1-3%2C5-8.7%2C2-12.8c-3-4.1-8.7-5-12.8-2c0%2C0%2C0%2C0%2C0%2C0%20%20%20%20%20c-4.1%2C3-5%2C8.7-2%2C12.8C127.5%2C275.8%2C130.3%2C277.1%2C133.1%2C277.1z%22%20id%3D%22XMLID_489_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M138.5%2C359.6c-4.1-3-9.8-2.1-12.8%2C2c-3%2C4.1-2.1%2C9.8%2C2%2C12.8c1.6%2C1.2%2C3.5%2C1.7%2C5.4%2C1.7%20%20%20%20%20c2.8%2C0%2C5.6-1.3%2C7.4-3.7C143.5%2C368.3%2C142.6%2C362.6%2C138.5%2C359.6z%22%20id%3D%22XMLID_726_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C327.7c-4.8%2C1.6-7.4%2C6.7-5.9%2C11.5c1.3%2C3.9%2C4.8%2C6.3%2C8.7%2C6.3c0.9%2C0%2C1.9-0.1%2C2.8-0.4%20%20%20%20%20c4.8-1.6%2C7.4-6.7%2C5.9-11.5C118%2C328.8%2C112.9%2C326.2%2C108.1%2C327.7z%22%20id%3D%22XMLID_776_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C307.3c0.9%2C0.3%2C1.9%2C0.4%2C2.8%2C0.4c3.8%2C0%2C7.4-2.4%2C8.7-6.3c1.6-4.8-1.1-9.9-5.9-11.5%20%20%20%20%20c-4.8-1.6-9.9%2C1.1-11.5%2C5.9C100.7%2C300.6%2C103.3%2C305.7%2C108.1%2C307.3z%22%20id%3D%22XMLID_777_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M169.2%2C265.4c2.4%2C0%2C4.7-1%2C6.5-2.6c1.7-1.7%2C2.7-4.1%2C2.7-6.5c0-2.4-1-4.8-2.7-6.5%20%20%20%20%20c-1.7-1.7-4.1-2.7-6.5-2.7s-4.7%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.5C164.4%2C264.4%2C166.8%2C265.4%2C169.2%2C265.4z%22%20id%3D%22XMLID_797_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M247.7%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C243.7%2C265.4%2C247.7%2C261.3%2C247.7%2C256.3z%22%20id%3D%22XMLID_798_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M213%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C208.9%2C265.4%2C213%2C261.3%2C213%2C256.3z%22%20id%3D%22XMLID_799_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M317.2%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C313.1%2C265.4%2C317.2%2C261.3%2C317.2%2C256.3z%22%20id%3D%22XMLID_800_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M282.5%2C256.3c0-5-4.1-9.1-9.1-9.1s-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20S282.5%2C261.3%2C282.5%2C256.3z%22%20id%3D%22XMLID_801_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M401.1%2C185.2c0.9%2C0%2C1.9-0.1%2C2.8-0.5c4.8-1.6%2C7.4-6.7%2C5.9-11.5c-1.6-4.8-6.7-7.4-11.5-5.8%20%20%20%20%20c-4.8%2C1.6-7.4%2C6.7-5.8%2C11.5C393.6%2C182.8%2C397.2%2C185.2%2C401.1%2C185.2z%22%20id%3D%22XMLID_802_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M403.9%2C205.2c-4.8-1.6-9.9%2C1-11.5%2C5.9l0%2C0c-1.6%2C4.8%2C1.1%2C9.9%2C5.9%2C11.5%20%20%20%20%20c0.9%2C0.3%2C1.9%2C0.5%2C2.8%2C0.5c3.9%2C0%2C7.4-2.5%2C8.7-6.3c0%2C0%2C0%2C0%2C0%2C0C411.3%2C211.9%2C408.7%2C206.8%2C403.9%2C205.2z%22%20id%3D%22XMLID_803_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C237.2L373.5%2C237.2c-4.1%2C3-5%2C8.7-2%2C12.8c1.8%2C2.4%2C4.6%2C3.7%2C7.4%2C3.7%20%20%20%20%20c1.8%2C0%2C3.7-0.6%2C5.4-1.8c4.1-3%2C4.9-8.7%2C2-12.8C383.3%2C235.1%2C377.6%2C234.2%2C373.5%2C237.2z%22%20id%3D%22XMLID_804_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C152.9c1.6%2C1.2%2C3.5%2C1.8%2C5.4%2C1.8c2.8%2C0%2C5.6-1.3%2C7.4-3.8c3-4.1%2C2.1-9.8-2-12.7%20%20%20%20%20c-4.1-3-9.8-2.1-12.7%2C2C368.5%2C144.2%2C369.4%2C149.9%2C373.5%2C152.9z%22%20id%3D%22XMLID_805_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M342.8%2C247.1c-2.4%2C0-4.8%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.4%20%20%20%20%20c1.7%2C1.7%2C4%2C2.7%2C6.5%2C2.7c2.4%2C0%2C4.7-1%2C6.5-2.7c1.7-1.7%2C2.7-4%2C2.7-6.4c0-2.4-1-4.8-2.7-6.5C347.6%2C248.1%2C345.2%2C247.1%2C342.8%2C247.1z%22%20id%3D%22XMLID_806_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M342.8%2C124.7H206.6l36.4-36.4c3.6-3.6%2C3.6-9.3%2C0-12.9c-3.6-3.6-9.3-3.6-12.9%2C0l-51.5%2C51.5%20%20%20%20%20c-1.9%2C1.9-2.8%2C4.4-2.7%2C6.9c-0.1%2C2.5%2C0.7%2C5%2C2.7%2C6.9l51.5%2C51.5c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7%20%20%20%20%20c3.6-3.6%2C3.6-9.3%2C0-12.9l-36.4-36.4h136.1c0%2C0%2C0.1%2C0%2C0.1%2C0c0.6%2C0%2C1.2-0.1%2C1.8-0.2c0.2%2C0%2C0.4-0.1%2C0.6-0.1c0.1%2C0%2C0.2%2C0%2C0.3-0.1%20%20%20%20%20c3.2-1%2C5.6-3.6%2C6.3-6.9c0.1-0.6%2C0.2-1.2%2C0.2-1.8c0-0.6-0.1-1.2-0.2-1.8C351%2C127.8%2C347.3%2C124.7%2C342.8%2C124.7z%22%20id%3D%22XMLID_807_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M322.1%2C371.3l-51.5-51.5c-3.6-3.6-9.3-3.6-12.9%2C0c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9l36.9%2C36.9H169.2%20%20%20%20%20c-2.8%2C0-5.4%2C1.3-7%2C3.3c-0.1%2C0.1-0.2%2C0.2-0.3%2C0.4c-0.1%2C0.1-0.2%2C0.2-0.2%2C0.3c-0.1%2C0.1-0.1%2C0.2-0.2%2C0.4c-0.1%2C0.1-0.2%2C0.3-0.2%2C0.4%20%20%20%20%20c0%2C0.1-0.1%2C0.2-0.1%2C0.2c-0.1%2C0.2-0.2%2C0.4-0.3%2C0.6c0%2C0%2C0%2C0%2C0%2C0.1c-0.4%2C1.1-0.7%2C2.2-0.7%2C3.4c0%2C1.5%2C0.4%2C2.9%2C1%2C4.2c0%2C0%2C0%2C0.1%2C0.1%2C0.1%20%20%20%20%20c0.1%2C0.1%2C0.1%2C0.2%2C0.2%2C0.3c0.4%2C0.7%2C0.9%2C1.3%2C1.4%2C1.8c0.4%2C0.4%2C0.7%2C0.7%2C1.2%2C1c0.1%2C0.1%2C0.1%2C0.1%2C0.2%2C0.2c0%2C0%2C0.1%2C0%2C0.1%2C0.1%20%20%20%20%20c1.4%2C0.9%2C3.1%2C1.5%2C5%2C1.5h124.4l-36%2C36c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7l51.5-51.5%20%20%20%20%20c1.9-1.9%2C2.8-4.4%2C2.7-6.9C324.8%2C375.7%2C324%2C373.2%2C322.1%2C371.3z%22%20id%3D%22XMLID_808_%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n}\n.x6-widget-handle-direction:hover {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20%20PUBLIC%20'-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN'%20%20'http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd'%3E%3Csvg%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%20512%20512%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%20512%20512%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%23FD6EB6%3Bstroke%3A%23FD6EB6%3Bstroke-width%3A30%7D%0A%09.dot%7Bfill%3A%23FD6EB6%3B%7D%0A%3C%2Fstyle%3E%3Cg%3E%3Cg%20id%3D%22XMLID_475_%22%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M133.1%2C277.1c1.8%2C0%2C3.7-0.6%2C5.4-1.7c4.1-3%2C5-8.7%2C2-12.8c-3-4.1-8.7-5-12.8-2c0%2C0%2C0%2C0%2C0%2C0%20%20%20%20%20c-4.1%2C3-5%2C8.7-2%2C12.8C127.5%2C275.8%2C130.3%2C277.1%2C133.1%2C277.1z%22%20id%3D%22XMLID_489_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M138.5%2C359.6c-4.1-3-9.8-2.1-12.8%2C2c-3%2C4.1-2.1%2C9.8%2C2%2C12.8c1.6%2C1.2%2C3.5%2C1.7%2C5.4%2C1.7%20%20%20%20%20c2.8%2C0%2C5.6-1.3%2C7.4-3.7C143.5%2C368.3%2C142.6%2C362.6%2C138.5%2C359.6z%22%20id%3D%22XMLID_726_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C327.7c-4.8%2C1.6-7.4%2C6.7-5.9%2C11.5c1.3%2C3.9%2C4.8%2C6.3%2C8.7%2C6.3c0.9%2C0%2C1.9-0.1%2C2.8-0.4%20%20%20%20%20c4.8-1.6%2C7.4-6.7%2C5.9-11.5C118%2C328.8%2C112.9%2C326.2%2C108.1%2C327.7z%22%20id%3D%22XMLID_776_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C307.3c0.9%2C0.3%2C1.9%2C0.4%2C2.8%2C0.4c3.8%2C0%2C7.4-2.4%2C8.7-6.3c1.6-4.8-1.1-9.9-5.9-11.5%20%20%20%20%20c-4.8-1.6-9.9%2C1.1-11.5%2C5.9C100.7%2C300.6%2C103.3%2C305.7%2C108.1%2C307.3z%22%20id%3D%22XMLID_777_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M169.2%2C265.4c2.4%2C0%2C4.7-1%2C6.5-2.6c1.7-1.7%2C2.7-4.1%2C2.7-6.5c0-2.4-1-4.8-2.7-6.5%20%20%20%20%20c-1.7-1.7-4.1-2.7-6.5-2.7s-4.7%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.5C164.4%2C264.4%2C166.8%2C265.4%2C169.2%2C265.4z%22%20id%3D%22XMLID_797_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M247.7%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C243.7%2C265.4%2C247.7%2C261.3%2C247.7%2C256.3z%22%20id%3D%22XMLID_798_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M213%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C208.9%2C265.4%2C213%2C261.3%2C213%2C256.3z%22%20id%3D%22XMLID_799_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M317.2%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C313.1%2C265.4%2C317.2%2C261.3%2C317.2%2C256.3z%22%20id%3D%22XMLID_800_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M282.5%2C256.3c0-5-4.1-9.1-9.1-9.1s-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20S282.5%2C261.3%2C282.5%2C256.3z%22%20id%3D%22XMLID_801_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M401.1%2C185.2c0.9%2C0%2C1.9-0.1%2C2.8-0.5c4.8-1.6%2C7.4-6.7%2C5.9-11.5c-1.6-4.8-6.7-7.4-11.5-5.8%20%20%20%20%20c-4.8%2C1.6-7.4%2C6.7-5.8%2C11.5C393.6%2C182.8%2C397.2%2C185.2%2C401.1%2C185.2z%22%20id%3D%22XMLID_802_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M403.9%2C205.2c-4.8-1.6-9.9%2C1-11.5%2C5.9l0%2C0c-1.6%2C4.8%2C1.1%2C9.9%2C5.9%2C11.5%20%20%20%20%20c0.9%2C0.3%2C1.9%2C0.5%2C2.8%2C0.5c3.9%2C0%2C7.4-2.5%2C8.7-6.3c0%2C0%2C0%2C0%2C0%2C0C411.3%2C211.9%2C408.7%2C206.8%2C403.9%2C205.2z%22%20id%3D%22XMLID_803_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C237.2L373.5%2C237.2c-4.1%2C3-5%2C8.7-2%2C12.8c1.8%2C2.4%2C4.6%2C3.7%2C7.4%2C3.7%20%20%20%20%20c1.8%2C0%2C3.7-0.6%2C5.4-1.8c4.1-3%2C4.9-8.7%2C2-12.8C383.3%2C235.1%2C377.6%2C234.2%2C373.5%2C237.2z%22%20id%3D%22XMLID_804_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C152.9c1.6%2C1.2%2C3.5%2C1.8%2C5.4%2C1.8c2.8%2C0%2C5.6-1.3%2C7.4-3.8c3-4.1%2C2.1-9.8-2-12.7%20%20%20%20%20c-4.1-3-9.8-2.1-12.7%2C2C368.5%2C144.2%2C369.4%2C149.9%2C373.5%2C152.9z%22%20id%3D%22XMLID_805_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M342.8%2C247.1c-2.4%2C0-4.8%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.4%20%20%20%20%20c1.7%2C1.7%2C4%2C2.7%2C6.5%2C2.7c2.4%2C0%2C4.7-1%2C6.5-2.7c1.7-1.7%2C2.7-4%2C2.7-6.4c0-2.4-1-4.8-2.7-6.5C347.6%2C248.1%2C345.2%2C247.1%2C342.8%2C247.1z%22%20id%3D%22XMLID_806_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M342.8%2C124.7H206.6l36.4-36.4c3.6-3.6%2C3.6-9.3%2C0-12.9c-3.6-3.6-9.3-3.6-12.9%2C0l-51.5%2C51.5%20%20%20%20%20c-1.9%2C1.9-2.8%2C4.4-2.7%2C6.9c-0.1%2C2.5%2C0.7%2C5%2C2.7%2C6.9l51.5%2C51.5c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7%20%20%20%20%20c3.6-3.6%2C3.6-9.3%2C0-12.9l-36.4-36.4h136.1c0%2C0%2C0.1%2C0%2C0.1%2C0c0.6%2C0%2C1.2-0.1%2C1.8-0.2c0.2%2C0%2C0.4-0.1%2C0.6-0.1c0.1%2C0%2C0.2%2C0%2C0.3-0.1%20%20%20%20%20c3.2-1%2C5.6-3.6%2C6.3-6.9c0.1-0.6%2C0.2-1.2%2C0.2-1.8c0-0.6-0.1-1.2-0.2-1.8C351%2C127.8%2C347.3%2C124.7%2C342.8%2C124.7z%22%20id%3D%22XMLID_807_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M322.1%2C371.3l-51.5-51.5c-3.6-3.6-9.3-3.6-12.9%2C0c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9l36.9%2C36.9H169.2%20%20%20%20%20c-2.8%2C0-5.4%2C1.3-7%2C3.3c-0.1%2C0.1-0.2%2C0.2-0.3%2C0.4c-0.1%2C0.1-0.2%2C0.2-0.2%2C0.3c-0.1%2C0.1-0.1%2C0.2-0.2%2C0.4c-0.1%2C0.1-0.2%2C0.3-0.2%2C0.4%20%20%20%20%20c0%2C0.1-0.1%2C0.2-0.1%2C0.2c-0.1%2C0.2-0.2%2C0.4-0.3%2C0.6c0%2C0%2C0%2C0%2C0%2C0.1c-0.4%2C1.1-0.7%2C2.2-0.7%2C3.4c0%2C1.5%2C0.4%2C2.9%2C1%2C4.2c0%2C0%2C0%2C0.1%2C0.1%2C0.1%20%20%20%20%20c0.1%2C0.1%2C0.1%2C0.2%2C0.2%2C0.3c0.4%2C0.7%2C0.9%2C1.3%2C1.4%2C1.8c0.4%2C0.4%2C0.7%2C0.7%2C1.2%2C1c0.1%2C0.1%2C0.1%2C0.1%2C0.2%2C0.2c0%2C0%2C0.1%2C0%2C0.1%2C0.1%20%20%20%20%20c1.4%2C0.9%2C3.1%2C1.5%2C5%2C1.5h124.4l-36%2C36c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7l51.5-51.5%20%20%20%20%20c1.9-1.9%2C2.8-4.4%2C2.7-6.9C324.8%2C375.7%2C324%2C373.2%2C322.1%2C371.3z%22%20id%3D%22XMLID_808_%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n}\n.x6-widget-handle-surround .x6-widget-handle-animate .x6-widget-handle {\n transition: background-size 80ms, width 80ms, height 80ms, top 150ms, left 150ms, bottom 150ms, right 150ms;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-se {\n right: -25px;\n bottom: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-nw {\n top: -21px;\n left: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-n {\n top: -22px;\n left: 50%;\n margin-left: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-e {\n top: -webkit-calc(40%);\n top: calc(50% - 10px);\n right: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-ne {\n top: -21px;\n right: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-w {\n top: 50%;\n left: -25px;\n margin-top: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-sw {\n bottom: -25px;\n left: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-s {\n bottom: -24px;\n left: 50%;\n margin-left: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle {\n width: 15px;\n height: 15px;\n font-size: 15px;\n background-size: 15px 15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-se {\n right: -19px;\n bottom: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-nw {\n top: -19px;\n left: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-n {\n top: -19px;\n margin-left: -7.5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-e {\n top: -webkit-calc(42%);\n top: calc(50% - 8px);\n right: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-ne {\n top: -19px;\n right: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-w {\n left: -19px;\n margin-top: -8px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-sw {\n bottom: -19px;\n left: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-s {\n bottom: -19px;\n margin-left: -7.5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle {\n width: 10px;\n height: 10px;\n font-size: 10px;\n background-size: 10px 10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-se {\n right: -15px;\n bottom: -13px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-nw {\n top: -13px;\n left: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-n {\n top: -13px;\n margin-left: -5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-e {\n top: -webkit-calc(45%);\n top: calc(50% - 5px);\n right: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-ne {\n top: -13px;\n right: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-w {\n left: -15px;\n margin-top: -5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-sw {\n bottom: -13px;\n left: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-s {\n bottom: -13px;\n margin-left: -5px;\n}\n.x6-widget-handle-toolbar {\n position: absolute;\n top: -50px;\n display: table-row;\n padding: 7px 5px;\n}\n.x6-widget-handle-toolbar::after {\n position: absolute;\n top: 100%;\n left: 10px;\n width: 0;\n height: 0;\n margin-top: 4px;\n border-right: 10px solid transparent;\n border-left: 10px solid transparent;\n content: '';\n}\n.x6-widget-handle-toolbar .x6-widget-handle {\n position: relative;\n display: table-cell;\n min-width: 20px;\n margin: 0 2px;\n background-position: 3px 3px;\n background-size: 16px 16px;\n}\n.x6-widget-handle-toolbar .x6-widget-handle::after {\n position: absolute;\n bottom: -11px;\n width: 100%;\n content: '';\n}\n.x6-widget-handle-pie {\n position: absolute;\n top: -webkit-calc(0%);\n top: calc(50% - 50px);\n right: -50px;\n z-index: 1;\n display: none;\n width: 100px;\n height: 100px;\n margin: -2px -2px 0 0;\n border-radius: 50%;\n cursor: default;\n pointer-events: visiblePainted;\n}\n.x6-widget-handle-pie .x6-widget-handle {\n width: 1px;\n height: auto;\n pointer-events: visiblePainted;\n}\n.x6-widget-handle-pie-slice-svg {\n width: 100%;\n height: 100%;\n overflow: visible !important;\n}\n.x6-widget-handle-pie-slice-img,\n.x6-widget-handle-pie-slice-txt {\n display: none;\n pointer-events: none;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='e'] {\n top: calc(50% - 50px);\n right: -50px;\n left: auto;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='w'] {\n top: calc(50% - 50px);\n right: auto;\n left: -52px;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='n'] {\n top: -50px;\n right: auto;\n bottom: auto;\n left: calc(50% - 52px);\n}\n.x6-widget-handle-pie[data-pie-toggle-position='s'] {\n top: auto;\n right: auto;\n bottom: -52px;\n left: calc(50% - 52px);\n}\n.x6-widget-handle-pie-opened {\n display: block;\n animation: halo-pie-visibility 0.1s, halo-pie-opening 0.1s;\n animation-timing-function: step-end, ease;\n animation-delay: 0s, 0.1s;\n}\n.x6-widget-handle-pie-toggle {\n position: absolute;\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: -15px;\n z-index: 2;\n display: block;\n box-sizing: border-box;\n width: 30px;\n height: 30px;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 20px 20px;\n border-radius: 50%;\n cursor: pointer;\n user-select: none;\n pointer-events: visiblePainted;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-handle-pie-toggle-pos-e {\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: -15px;\n bottom: auto;\n left: auto;\n}\n.x6-widget-handle-pie-toggle-pos-w {\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: auto;\n bottom: auto;\n left: -15px;\n}\n.x6-widget-handle-pie-toggle-pos-n {\n top: -15px;\n right: auto;\n bottom: auto;\n left: -webkit-calc(35%);\n left: calc(50% - 15px);\n}\n.x6-widget-handle-pie-toggle-pos-s {\n top: auto;\n right: auto;\n bottom: -15px;\n left: -webkit-calc(35%);\n left: calc(50% - 15px);\n}\n.x6-widget-handle-pie-toggle-opened {\n transition: 0.1s background-image;\n}\n.x6-widget-handle-toolbar {\n position: static;\n display: inline-block;\n margin-top: -50px;\n margin-left: 45px;\n white-space: nowrap;\n vertical-align: top;\n background-color: #f5f5f5;\n border-bottom: 3px solid #333;\n border-radius: 5px;\n box-shadow: 0 1px 2px #222;\n}\n.x6-widget-handle-toolbar::after {\n top: -12px;\n left: 55px;\n margin-top: 0;\n border-top: 6px solid #333;\n border-right: 10px solid transparent;\n border-left: 10px solid transparent;\n}\n.x6-widget-handle-toolbar .x6-widget-handle {\n display: inline-block;\n vertical-align: top;\n}\n.x6-widget-handle-toolbar .x6-widget-handle:hover::after {\n border-bottom: 4px solid #fc6cb8;\n}\n.x6-widget-handle-toolbar .x6-widget-handle-rotate {\n position: absolute;\n top: 100%;\n right: 100%;\n margin-top: 3px;\n margin-right: 6px;\n}\n.x6-widget-handle-toolbar .x6-widget-handle-remove:hover::after,\n.x6-widget-handle-toolbar .x6-widget-handle-rotate:hover::after {\n border-bottom: none;\n}\n.x6-widget-handle-toolbar .x6-widget-handle + .x6-widget-handle {\n margin-left: 4px;\n}\n.x6-widget-handle-pie {\n box-sizing: content-box;\n background-color: #f5f5f5;\n border: 2px solid #404040;\n}\n.x6-widget-handle-pie-slice {\n fill: transparent;\n stroke: #e9e9e9;\n stroke-width: 1;\n}\n.x6-widget-handle-pie-slice:hover {\n fill: #fff;\n}\n.x6-widget-handle-pie-slice-img {\n display: block;\n}\n.x6-widget-handle-selected .x6-widget-handle-pie-slice {\n fill: #fff;\n}\n.x6-widget-handle-pie-toggle {\n background-color: #f6f6f6;\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20height%3D%2216px%22%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%2016%2016%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%2016%2016%22%20width%3D%2216px%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15%2C6h-5V1c0-0.55-0.45-1-1-1H7C6.45%2C0%2C6%2C0.45%2C6%2C1v5H1C0.45%2C6%2C0%2C6.45%2C0%2C7v2c0%2C0.55%2C0.45%2C1%2C1%2C1h5v5c0%2C0.55%2C0.45%2C1%2C1%2C1h2%20c0.55%2C0%2C1-0.45%2C1-1v-5h5c0.55%2C0%2C1-0.45%2C1-1V7C16%2C6.45%2C15.55%2C6%2C15%2C6z%22%2F%3E%3C%2Fsvg%3E');\n background-size: 16px 16px;\n border: 2px solid #3b425f;\n}\n.x6-widget-handle-pie-toggle:hover {\n background-color: #fff;\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20height%3D%2216px%22%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%2016%2016%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%2016%2016%22%20width%3D%2216px%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M15%2C6h-5V1c0-0.55-0.45-1-1-1H7C6.45%2C0%2C6%2C0.45%2C6%2C1v5H1C0.45%2C6%2C0%2C6.45%2C0%2C7v2c0%2C0.55%2C0.45%2C1%2C1%2C1h5v5c0%2C0.55%2C0.45%2C1%2C1%2C1h2%20c0.55%2C0%2C1-0.45%2C1-1v-5h5c0.55%2C0%2C1-0.45%2C1-1V7C16%2C6.45%2C15.55%2C6%2C15%2C6z%22%2F%3E%3C%2Fsvg%3E');\n border-color: #fd6eb6;\n}\n.x6-widget-handle-pie-toggle-opened {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%20xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20id%3D%22Layer_1%22%20xml%3Aspace%3D%22preserve%22%3E%3Cmetadata%20id%3D%22metadata9%22%3E%3Crdf%3ARDF%3E%3Ccc%3AWork%20rdf%3Aabout%3D%22%22%3E%3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E%3Cdc%3Atype%20rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22%20%2F%3E%3Cdc%3Atitle%3E%3C%2Fdc%3Atitle%3E%3C%2Fcc%3AWork%3E%3C%2Frdf%3ARDF%3E%3C%2Fmetadata%3E%3Cdefs%20id%3D%22defs7%22%20%2F%3E%3Cpath%20d%3D%22M%2015%2C6%2010%2C6%20C%201.0301983%2C6.00505%2015.002631%2C6.011353%206%2C6%20L%201%2C6%20C%200.45%2C6%200%2C6.45%200%2C7%20l%200%2C2%20c%200%2C0.55%200.45%2C1%201%2C1%20l%205%2C0%20c%208.988585%2C-0.019732%20-5.02893401%2C-0.018728%204%2C0%20l%205%2C0%20c%200.55%2C0%201%2C-0.45%201%2C-1%20L%2016%2C7%20C%2016%2C6.45%2015.55%2C6%2015%2C6%20z%22%20id%3D%22path3%22%20style%3D%22fill%3A%236a6c8a%22%20%2F%3E%3C%2Fsvg%3E');\n}\n.x6-widget-handle-pie-toggle-opened:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%20xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20id%3D%22Layer_1%22%20xml%3Aspace%3D%22preserve%22%3E%3Cmetadata%20id%3D%22metadata9%22%3E%3Crdf%3ARDF%3E%3Ccc%3AWork%20rdf%3Aabout%3D%22%22%3E%3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E%3Cdc%3Atype%20rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22%20%2F%3E%3Cdc%3Atitle%3E%3C%2Fdc%3Atitle%3E%3C%2Fcc%3AWork%3E%3C%2Frdf%3ARDF%3E%3C%2Fmetadata%3E%3Cdefs%20id%3D%22defs7%22%20%2F%3E%3Cpath%20d%3D%22M%2015%2C6%2010%2C6%20C%201.0301983%2C6.00505%2015.002631%2C6.011353%206%2C6%20L%201%2C6%20C%200.45%2C6%200%2C6.45%200%2C7%20l%200%2C2%20c%200%2C0.55%200.45%2C1%201%2C1%20l%205%2C0%20c%208.988585%2C-0.019732%20-5.02893401%2C-0.018728%204%2C0%20l%205%2C0%20c%200.55%2C0%201%2C-0.45%201%2C-1%20L%2016%2C7%20C%2016%2C6.45%2015.55%2C6%2015%2C6%20z%22%20id%3D%22path3%22%20style%3D%22fill%3A%23FD6EB6%22%20%2F%3E%3C%2Fsvg%3E');\n}\n.x6-widget-dnd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n}\n.x6-widget-dnd.dragging {\n display: inline-block;\n}\n.x6-widget-dnd.dragging * {\n pointer-events: none !important;\n}\n.x6-widget-dnd .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n.x6-widget-halo {\n position: absolute;\n pointer-events: none;\n}\n.x6-widget-halo-content {\n position: absolute;\n top: 100%;\n padding: 6px;\n font-size: 10px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-halo-handles + .x6-widget-halo-content {\n right: -20px;\n left: -20px;\n margin-top: 30px;\n}\n.x6-widget-halo-handles.x6-widget-handle-small + .x6-widget-halo-content {\n margin-top: 25px;\n}\n.x6-widget-halo-handles.x6-widget-handle-small + .x6-widget-halo-content {\n margin-top: 20px;\n}\n.x6-widget-halo-handles.x6-widget-handle-pie + .x6-widget-halo-content {\n right: 0;\n left: 0;\n margin-top: 10px;\n}\n.x6-widget-halo-content {\n color: #fff;\n background-color: #6a6b8a;\n}\n.x6-widget-halo.type-node .x6-widget-handle-toolbar .x6-widget-handle-remove {\n position: absolute;\n right: 100%;\n bottom: 100%;\n margin-right: 6px;\n margin-bottom: 3px;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-surround .x6-widget-handle-remove {\n background-color: #fff;\n border-radius: 50%;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-toolbar {\n margin-top: -60px;\n margin-left: -18px;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-toolbar::after {\n top: -22px;\n left: -9px;\n}\n.x6-widget-minimap {\n position: relative;\n display: table-cell;\n box-sizing: border-box;\n overflow: hidden;\n text-align: center;\n vertical-align: middle;\n background-color: #fff;\n user-select: none;\n}\n.x6-widget-minimap .x6-graph {\n display: inline-block;\n box-shadow: 0 0 4px 0 #eee;\n cursor: pointer;\n}\n.x6-widget-minimap .x6-graph > svg {\n pointer-events: none;\n shape-rendering: optimizeSpeed;\n}\n.x6-widget-minimap .x6-graph .x6-node * {\n /* stylelint-disable-next-line */\n vector-effect: initial;\n}\n.x6-widget-minimap-viewport {\n position: absolute;\n box-sizing: content-box !important;\n margin: -2px 0 0 -2px;\n border: 2px solid #31d0c6;\n cursor: move;\n}\n.x6-widget-minimap-viewport-zoom {\n position: absolute;\n right: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 12px;\n height: 12px;\n margin: 0 -6px -6px 0;\n background-color: #fff;\n border: 2px solid #31d0c6;\n border-radius: 50%;\n cursor: nwse-resize;\n}\n.x6-graph-scroller {\n position: relative;\n box-sizing: border-box;\n overflow: scroll;\n outline: none;\n}\n.x6-graph-scroller-content {\n position: relative;\n}\n.x6-graph-scroller-background {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-scroller .x6-graph {\n position: absolute;\n display: inline-block;\n margin: 0;\n box-shadow: none;\n}\n.x6-graph-scroller .x6-graph > svg {\n display: block;\n}\n.x6-graph-scroller.x6-graph-scroller-paged .x6-graph {\n box-shadow: 0 0 4px 0 #eee;\n}\n.x6-graph-scroller.x6-graph-scroller-pannable[data-panning='false'] {\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n.x6-graph-scroller.x6-graph-scroller-pannable[data-panning='true'] {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n}\n.x6-graph-pagebreak {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-pagebreak-vertical {\n position: absolute;\n top: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 1px;\n border-left: 1px dashed #bdbdbd;\n}\n.x6-graph-pagebreak-horizontal {\n position: absolute;\n right: 0;\n left: 0;\n box-sizing: border-box;\n height: 1px;\n border-top: 1px dashed #bdbdbd;\n}\n.x6-widget-selection {\n position: absolute;\n display: none;\n width: 0;\n height: 0;\n touch-action: none;\n}\n.x6-widget-selection-rubberband {\n display: block;\n overflow: visible;\n opacity: 0.3;\n}\n.x6-widget-selection-selected {\n display: block;\n}\n.x6-widget-selection-box {\n cursor: move;\n}\n.x6-widget-selection-inner[data-selection-length='0'],\n.x6-widget-selection-inner[data-selection-length='1'] {\n display: none;\n}\n.x6-widget-selection-content {\n position: absolute;\n top: 100%;\n right: -20px;\n left: -20px;\n margin-top: 30px;\n padding: 6px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-selection-content:empty {\n display: none;\n}\n.x6-widget-selection-rubberband {\n background-color: #3498db;\n border: 2px solid #2980b9;\n}\n.x6-widget-selection-box {\n box-sizing: content-box !important;\n margin-top: -4px;\n margin-left: -4px;\n padding-right: 4px;\n padding-bottom: 4px;\n border: 2px dashed #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-inner {\n box-sizing: content-box !important;\n margin-top: -8px;\n margin-left: -8px;\n padding-right: 12px;\n padding-bottom: 12px;\n border: 2px solid #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-content {\n color: #fff;\n font-size: 10px;\n background-color: #6a6b8a;\n}\n.x6-widget-snapline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n.x6-widget-snapline-vertical,\n.x6-widget-snapline-horizontal {\n position: absolute;\n opacity: 1;\n pointer-events: none;\n}\n.x6-widget-snapline-horizontal {\n border-bottom: 1px solid #2ecc71;\n}\n.x6-widget-snapline-vertical {\n border-right: 1px solid #2ecc71;\n}\n.x6-widget-stencil {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-widget-stencil::after {\n position: absolute;\n top: 0;\n display: block;\n width: 100%;\n height: 20px;\n padding: 8px 0;\n line-height: 20px;\n text-align: center;\n opacity: 0;\n transition: top 0.1s linear, opacity 0.1s linear;\n content: ' ';\n pointer-events: none;\n}\n.x6-widget-stencil-content {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: auto;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.x6-widget-stencil .x6-node [magnet]:not([magnet='passive']) {\n pointer-events: none;\n}\n.x6-widget-stencil-group {\n padding: 0;\n padding-bottom: 8px;\n overflow: hidden;\n user-select: none;\n}\n.x6-widget-stencil-group.collapsed {\n height: auto;\n padding-bottom: 0;\n}\n.x6-widget-stencil-group-title {\n position: relative;\n margin-top: 0;\n margin-bottom: 0;\n padding: 4px;\n cursor: pointer;\n}\n.x6-widget-stencil-title,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n user-select: none;\n}\n.x6-widget-stencil .unmatched {\n opacity: 0.3;\n}\n.x6-widget-stencil .x6-node.unmatched {\n display: none;\n}\n.x6-widget-stencil-group.unmatched {\n display: none;\n}\n.x6-widget-stencil-search-text {\n position: relative;\n z-index: 1;\n box-sizing: border-box;\n width: 100%;\n height: 30px;\n max-height: 30px;\n line-height: 30px;\n outline: 0;\n}\n.x6-widget-stencil.not-found::after {\n opacity: 1;\n content: attr(data-not-found-text);\n}\n.x6-widget-stencil.not-found.searchable::after {\n top: 30px;\n}\n.x6-widget-stencil.not-found.searchable.collapsable::after {\n top: 50px;\n}\n.x6-widget-stencil {\n color: #333;\n background: #f5f5f5;\n}\n.x6-widget-stencil-content {\n position: absolute;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-content {\n top: 32px;\n}\n.x6-widget-stencil.searchable > .x6-widget-stencil-content {\n top: 80px;\n}\n.x6-widget-stencil.not-found::after {\n position: absolute;\n}\n.x6-widget-stencil.not-found.searchable.collapsable::after {\n top: 80px;\n}\n.x6-widget-stencil.not-found.searchable::after {\n top: 60px;\n}\n.x6-widget-stencil-group {\n height: auto;\n margin-bottom: 1px;\n padding: 0;\n transition: none;\n}\n.x6-widget-stencil-group .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n.x6-widget-stencil-group.collapsed {\n height: auto;\n max-height: 31px;\n}\n.x6-widget-stencil-title,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n position: relative;\n left: 0;\n box-sizing: border-box;\n width: 100%;\n height: 32px;\n padding: 0 5px 0 8px;\n color: #666;\n font-weight: 700;\n font-size: 12px;\n line-height: 32px;\n cursor: default;\n transition: all 0.3;\n}\n.x6-widget-stencil-title:hover,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title:hover {\n color: #444;\n}\n.x6-widget-stencil-title {\n background: #e9e9e9;\n}\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n background: #ededed;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title {\n padding-left: 32px;\n cursor: pointer;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title::before {\n position: absolute;\n top: 6px;\n left: 8px;\n display: block;\n width: 18px;\n height: 18px;\n margin: 0;\n padding: 0;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: 0 0;\n border: none;\n content: ' ';\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNOS4zNzUuNUM0LjY4Ny41Ljg3NSA0LjMxMy44NzUgOWMwIDQuNjg4IDMuODEyIDguNSA4LjUgOC41IDQuNjg3IDAgOC41LTMuODEyIDguNS04LjUgMC00LjY4Ny0zLjgxMy04LjUtOC41LTguNXptMCAxNS44ODZDNS4zMDMgMTYuMzg2IDEuOTkgMTMuMDcyIDEuOTkgOXMzLjMxMi03LjM4NSA3LjM4NS03LjM4NVMxNi43NiA0LjkyOCAxNi43NiA5YzAgNC4wNzItMy4zMTMgNy4zODYtNy4zODUgNy4zODZ6Ii8+PHBhdGggZD0iTTEyLjc1MyA4LjQ0M0g1Ljk5N2EuNTU4LjU1OCAwIDAwMCAxLjExNmg2Ljc1NmEuNTU4LjU1OCAwIDAwMC0xLjExNnoiLz48L2c+PC9zdmc+');\n opacity: 0.4;\n transition: all 0.3s;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title:hover::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title:hover::before {\n opacity: 0.6;\n}\n.x6-widget-stencil.collapsable.collapsed > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable.collapsed > .x6-widget-stencil-group-title::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNOS4zNzUuNUM0LjY4Ny41Ljg3NSA0LjMxMy44NzUgOWMwIDQuNjg4IDMuODEyIDguNSA4LjUgOC41IDQuNjg3IDAgOC41LTMuODEyIDguNS04LjUgMC00LjY4Ny0zLjgxMy04LjUtOC41LTguNXptMCAxNS44ODZDNS4zMDMgMTYuMzg2IDEuOTkgMTMuMDcyIDEuOTkgOXMzLjMxMi03LjM4NSA3LjM4NS03LjM4NVMxNi43NiA0LjkyOCAxNi43NiA5YzAgNC4wNzItMy4zMTMgNy4zODYtNy4zODUgNy4zODZ6Ii8+PHBhdGggZD0iTTEyLjc1MyA4LjQ0M0g1Ljk5N2EuNTU4LjU1OCAwIDAwMCAxLjExNmg2Ljc1NmEuNTU4LjU1OCAwIDAwMC0xLjExNnoiLz48cGF0aCBkPSJNOC44MTcgNS42MjN2Ni43NTZhLjU1OC41NTggMCAwMDEuMTE2IDBWNS42MjNhLjU1OC41NTggMCAxMC0xLjExNiAweiIvPjwvZz48L3N2Zz4=');\n opacity: 0.4;\n}\n.x6-widget-stencil.collapsable.collapsed > .x6-widget-stencil-title:hover::before,\n.x6-widget-stencil-group.collapsable.collapsed > .x6-widget-stencil-group-title:hover::before {\n opacity: 0.6;\n}\n.x6-widget-stencil input[type='search'] {\n -webkit-appearance: textfield;\n}\n.x6-widget-stencil input[type='search']::-webkit-search-cancel-button,\n.x6-widget-stencil input[type='search']::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n.x6-widget-stencil-search-text {\n display: block;\n width: 90%;\n margin: 8px 5%;\n padding-left: 8px;\n color: #333;\n background: #fff;\n border: 1px solid #e9e9e9;\n border-radius: 12px;\n outline: 0;\n}\n.x6-widget-stencil-search-text:focus {\n outline: 0;\n}\n.x6-widget-stencil::after {\n color: #808080;\n font-weight: 600;\n font-size: 12px;\n background: 0 0;\n}\n.x6-widget-transform {\n position: absolute;\n box-sizing: content-box !important;\n margin: -5px 0 0 -5px;\n padding: 4px;\n border: 1px dashed #000;\n border-radius: 5px;\n user-select: none;\n pointer-events: none;\n}\n.x6-widget-transform > div {\n position: absolute;\n box-sizing: border-box;\n background-color: #fff;\n border: 1px solid #000;\n transition: background-color 0.2s;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-transform > div:hover {\n background-color: #d3d3d3;\n}\n.x6-widget-transform-cursor-n {\n cursor: n-resize;\n}\n.x6-widget-transform-cursor-s {\n cursor: s-resize;\n}\n.x6-widget-transform-cursor-e {\n cursor: e-resize;\n}\n.x6-widget-transform-cursor-w {\n cursor: w-resize;\n}\n.x6-widget-transform-cursor-ne {\n cursor: ne-resize;\n}\n.x6-widget-transform-cursor-nw {\n cursor: nw-resize;\n}\n.x6-widget-transform-cursor-se {\n cursor: se-resize;\n}\n.x6-widget-transform-cursor-sw {\n cursor: sw-resize;\n}\n.x6-widget-transform-resize {\n width: 10px;\n height: 10px;\n border-radius: 6px;\n}\n.x6-widget-transform-resize[data-position='top-left'] {\n top: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='top-right'] {\n top: -5px;\n right: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-left'] {\n bottom: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-right'] {\n right: -5px;\n bottom: -5px;\n}\n.x6-widget-transform-resize[data-position='top'] {\n top: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom'] {\n bottom: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='left'] {\n top: 50%;\n left: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform-resize[data-position='right'] {\n top: 50%;\n right: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='top'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='right'] {\n display: none;\n}\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='right'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='top'] {\n display: none;\n}\n.x6-widget-transform.no-resize .x6-widget-transform-resize {\n display: none;\n}\n.x6-widget-transform-rotate {\n top: -20px;\n left: -20px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n cursor: crosshair;\n}\n.x6-widget-transform.no-rotate .x6-widget-transform-rotate {\n display: none;\n}\n.x6-widget-transform-active {\n border-color: transparent;\n pointer-events: all;\n}\n.x6-widget-transform-active > div {\n display: none;\n}\n.x6-widget-transform-active > .x6-widget-transform-active-handle {\n display: block;\n background-color: #808080;\n}\n.x6-widget-knob {\n position: absolute;\n box-sizing: border-box;\n width: 16px;\n height: 16px;\n margin-top: -8px;\n margin-left: -8px;\n cursor: pointer;\n user-select: none;\n}\n.x6-widget-knob::before,\n.x6-widget-knob::after {\n position: absolute;\n transform: rotate(45deg);\n content: '';\n}\n.x6-widget-knob::before {\n top: 4px;\n left: 4px;\n box-sizing: border-box;\n width: 8px;\n height: 8px;\n background-color: #fff;\n}\n.x6-widget-knob::after {\n top: 5px;\n left: 5px;\n box-sizing: border-box;\n width: 6px;\n height: 6px;\n background-color: #fca000;\n}\n.x6-graph-print {\n position: relative;\n}\n.x6-graph-print .x6-graph-print-ready {\n display: none;\n}\n.x6-graph-print .x6-graph-print-preview {\n overflow: hidden !important;\n background: #fff !important;\n}\n@media print {\n html,\n html > body.x6-graph-printing {\n position: relative !important;\n width: 100% !important;\n height: 100% !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n html > body.x6-graph-printing > * {\n display: none !important;\n }\n html > body.x6-graph-printing > .x6-graph-print {\n display: block !important;\n }\n .x6-graph-print {\n top: 0 !important;\n left: 0 !important;\n margin: 0 !important;\n padding: 0 !important;\n overflow: hidden !important;\n page-break-after: always;\n background: #fff !important;\n }\n .x6-graph-print .x6-graph-print-ready {\n display: none;\n }\n}\n.x6-cell-tool-editor {\n position: relative;\n display: inline-block;\n min-height: 1em;\n margin: 0;\n padding: 0;\n line-height: 1;\n white-space: normal;\n text-align: center;\n vertical-align: top;\n overflow-wrap: normal;\n outline: none;\n transform-origin: 0 0;\n -webkit-user-drag: none;\n}\n.x6-edge-tool-editor {\n border: 1px solid #275fc5;\n border-radius: 2px;\n}\n";var mS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class yS extends uS{init(){KC.autoInsertCSS&&yS.ensure()}dispose(){yS.clean()}}mS([yS.dispose()],yS.prototype,"dispose",null),function(t){let e,n=0;function i(){if(n+=1,!(n>1)&&!et.isApplyingHMR()){e=document.createElement("style"),e.setAttribute("type","text/css"),e.textContent=fS;const t=document.querySelector("head");t&&t.insertBefore(e,t.firstChild)}}function r(){n-=1,n>0||(e&&e.parentNode&&e.parentNode.removeChild(e),e=null)}t.ensure=i,t.clean=r}(yS||(yS={}));var bS,vS=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class wS{get handleClassName(){return bS.handle}get pie(){return Object.assign(Object.assign({},wS.defaultPieOptions),this.handleOptions.pie)}initHandles(){if(this.handles=[],this.handleOptions.handles&&this.handleOptions.handles.forEach((t=>this.addHandle(t))),"pie"===this.handleOptions.type){if(this.pie.toggles){const t=bS.pieToggle;this.$pieToggles={},this.pie.toggles.forEach((e=>{const n=this.$("<div/>");this.applyAttrs(n,e.attrs),n.addClass(t).addClass(`${t}-pos-${e.position||"e"}`).attr("data-name",e.name).appendTo(this.container),this.$pieToggles[e.name]=n}))}this.setPieIcons()}if(this.$handleContainer){const t=this.handleOptions.type||"surround";this.$handleContainer.addClass(bS.wrap).addClass(bS.animate).addClass(`${bS.handle}-${t}`)}this.delegateEvents({[`mousedown .${bS.handle}`]:"onHandleMouseDown",[`touchstart .${bS.handle}`]:"onHandleMouseDown",[`mousedown .${bS.pieToggle}`]:"onPieToggleMouseDown",[`touchstart .${bS.pieToggle}`]:"onPieToggleMouseDown"})}onHandleMouseDown(t){const e=this.$(t.currentTarget).closest(`.${bS.handle}`).attr("data-action");e&&(t.preventDefault(),t.stopPropagation(),this.setEventData(t,{action:e,clientX:t.clientX,clientY:t.clientY,startX:t.clientX,startY:t.clientY}),"mousedown"===t.type&&2===t.button?this.triggerHandleAction(e,"contextmenu",t):(this.triggerHandleAction(e,"mousedown",t),this.delegateDocumentEvents({mousemove:"onHandleMouseMove",touchmove:"onHandleMouseMove",mouseup:"onHandleMouseUp",touchend:"onHandleMouseUp",touchcancel:"onHandleMouseUp"},t.data)))}onHandleMouseMove(t){const e=this.getEventData(t),n=e.action;n&&this.triggerHandleAction(n,"mousemove",t)}onHandleMouseUp(t){const e=this.getEventData(t),n=e.action;n&&(this.triggerHandleAction(n,"mouseup",t),this.undelegateDocumentEvents())}triggerHandleAction(t,e,n,i){n.preventDefault(),n.stopPropagation();const r=this.normalizeEvent(n),s=this.getEventData(r),o=this.graph.snapToGrid(r.clientX,r.clientY),a=this.graph.snapToGrid(s.clientX,s.clientY),l=o.x-a.x,c=o.y-a.y;this.trigger(`action:${t}:${e}`,Object.assign({e:r,dx:l,dy:c,x:o.x,y:o.y,offsetX:n.clientX-s.startX,offsetY:n.clientY-s.startY},i)),s.clientX=n.clientX,s.clientY=n.clientY}onPieToggleMouseDown(t){t.stopPropagation();const e=this.$(t.target).closest(`.${bS.pieToggle}`).attr("data-name");this.isOpen(e)||this.isOpen()&&this.toggleState(),this.toggleState(e)}setPieIcons(){"pie"===this.handleOptions.type&&this.$handleContainer.find(`.${bS.handle}`).each(((t,e)=>{const n=this.$(e),i=n.attr("data-action"),r=bS.pieSlice,s=this.getHandle(i);if(!s||!s.icon){const t=window.getComputedStyle(e,":before").getPropertyValue("content");if(t&&"none"!==t){const e=n.find(`.${r}-txt`);e.length&&Rb.create(e[0]).text(t.replace(/['"]/g,""))}const i=n.css("background-image");if(i){const t=i.match(/url\(['"]?([^'"]+)['"]?\)/);if(t){const e=t[1],i=n.find(`.${r}-img`);i.length>0&&Rb.create(i[0]).attr("xlink:href",e)}}}}))}getHandleIdx(t){return this.handles.findIndex((e=>e.name===t))}hasHandle(t){return this.getHandleIdx(t)>=0}getHandle(t){return this.handles.find((e=>e.name===t))}renderHandle(t){const e=this.$("<div/>").addClass(`${bS.handle} ${bS.handle}-${t.name}`).attr("data-action",t.name).prop("draggable",!1);if("pie"===this.handleOptions.type){const n=this.getHandleIdx(t.name),i=this.pie,r=i.outerRadius,s=i.innerRadius,o=(r+s)/2,a=new ub(r,r),l=ib.toRad(i.sliceAngle),c=n*l+ib.toRad(i.startAngle),h=c+l,u=ov(s,r,c,h),d=Rb.create("svg").addClass(`${bS.pieSlice}-svg`),p=Rb.create("path").addClass(bS.pieSlice).attr("d",u).translate(r,r),g=ub.fromPolar(o,-c-l/2,a).toJSON(),f=i.iconSize,m=Rb.create("image").attr(g).addClass(`${bS.pieSlice}-img`);g.y=g.y+f-2;const y=Rb.create("text",{"font-size":f}).attr(g).addClass(`${bS.pieSlice}-txt`);m.attr({width:f,height:f}),m.translate(-f/2,-f/2),y.translate(-f/2,-f/2),d.append([p,m,y]),e.append(d.node)}else e.addClass(`${bS.handle}-pos-${t.position}`),t.content&&("string"===typeof t.content?e.html(t.content):e.append(t.content));return this.updateHandleIcon(e,t.icon),this.applyAttrs(e,t.attrs),e}addHandle(t){if(!this.hasHandle(t.name)){this.handles.push(t);const e=t.events;e&&Object.keys(e).forEach((n=>{const i=e[n],r=`action:${t.name}:${n}`;"string"===typeof i?this.on(r,this[i],this):this.on(r,i)})),this.$handleContainer&&this.$handleContainer.append(this.renderHandle(t))}return this}addHandles(t){return t.forEach((t=>this.addHandle(t))),this}removeHandles(){while(this.handles.length)this.removeHandle(this.handles[0].name);return this}removeHandle(t){const e=this.getHandleIdx(t),n=this.handles[e];return n&&(n.events&&Object.keys(n.events).forEach((e=>{this.off(`action:${t}:${e}`)})),this.getHandleElem(t).remove(),this.handles.splice(e,1)),this}changeHandle(t,e){const n=this.getHandle(t);return n&&(this.removeHandle(t),this.addHandle(Object.assign(Object.assign({},n),e))),this}toggleHandle(t,e){const n=this.getHandle(t);if(n){const i=this.getHandleElem(t),r=`${bS.handle}-selected`;void 0===e&&(e=!i.hasClass(r)),i.toggleClass(r,e);const s=e?n.iconSelected:n.icon;s&&this.updateHandleIcon(i,s)}return this}selectHandle(t){return this.toggleHandle(t,!0)}deselectHandle(t){return this.toggleHandle(t,!1)}deselectAllHandles(){return this.handles.forEach((t=>this.deselectHandle(t.name))),this}getHandleElem(t){return this.$handleContainer.find(`.${bS.handle}-${t}`)}updateHandleIcon(t,e){if("pie"===this.handleOptions.type){const n=t.find(`.${bS.pieSliceImg}`);this.$(n[0]).attr("xlink:href",e||"")}else t.css("background-image",e?`url(${e})`:"")}isRendered(){return null!=this.$handleContainer}isOpen(t){return!!this.isRendered()&&(t?this.$pieToggles[t].hasClass(bS.pieToggleOpened):this.$handleContainer.hasClass(`${bS.pieOpended}`))}toggleState(t){if(this.isRendered()){const e=this.$handleContainer;if(Object.keys(this.$pieToggles).forEach((t=>{const e=this.$pieToggles[t];e.removeClass(bS.pieToggleOpened)})),this.isOpen())this.trigger("pie:close",{name:t}),e.removeClass(bS.pieOpended);else{if(this.trigger("pie:open",{name:t}),t){const n=this.pie.toggles,i=n&&n.find((e=>e.name===t));i&&e.attr({"data-pie-toggle-name":i.name,"data-pie-toggle-position":i.position}),this.$pieToggles[t].addClass(bS.pieToggleOpened)}e.addClass(bS.pieOpended)}}}applyAttrs(t,e){if(e){const n=eE.$(t);Object.keys(e).forEach((t=>{const i=n.find(t).addBack().filter(t),r=e[t],{class:s}=r,o=vS(r,["class"]);s&&i.addClass(s),i.attr(o)}))}}}(function(t){t.defaultPieOptions={innerRadius:20,outerRadius:50,sliceAngle:45,startAngle:0,iconSize:14,toggles:[{name:"default",position:"e"}]}})(wS||(wS={})),function(t){t.handle=eE.prototype.prefixClassName("widget-handle"),t.wrap=`${t.handle}-wrap`,t.animate=`${t.handle}-animate`,t.pieOpended=`${t.handle}-pie-opened`,t.pieToggle=`${t.handle}-pie-toggle`,t.pieToggleOpened=`${t.handle}-pie-toggle-opened`,t.pieSlice=`${t.handle}-pie-slice`,t.pieSliceImg=`${t.handle}-pie-slice-img`}(bS||(bS={}));var CS,xS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ES=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class kS extends eE{constructor(t){super();const e=t,{view:n,cell:i,node:r,edge:s,graph:o}=e,a=ES(e,["view","cell","node","edge","graph"]);n?(this.view=n,this.cell=n.cell,this.graph=n.graph,this.model=this.graph.model):(i||s||r)&&o&&(this.cell=r||s||i,this.view=o.renderer.findViewByCell(this.cell),this.graph=o,this.model=this.graph.model);const l=this.constructor;!1!==t.clearAll&&l.removeInstances(this.graph),l.register(this),this.init(a)}static ensureCache(){return this.instanceCache.has(this)||this.instanceCache.set(this,{}),this.instanceCache.get(this)}static register(t,e){null==e&&(e=t.graph);const n=this.ensureCache();let i=n[e.view.cid];null==i&&(i=n[e.view.cid]={}),i[t.cid]=t}static unregister(t,e){null==e&&(e=t.graph);const n=this.ensureCache();n[e.view.cid]&&delete n[e.view.cid][t.cid]}static removeInstances(t){const e=this.ensureCache(),n=e[t.view.cid];n&&Object.keys(n).forEach((t=>{const e=n[t];e&&e.remove()}))}static getInstances(t){const e=this.ensureCache();return e[t.view.cid]||{}}init(t){}render(){return this}startListening(){!1!==this.options.clearOnBlankMouseDown&&this.graph.on("blank:mousedown",this.remove,this)}stopListening(){!1!==this.options.clearOnBlankMouseDown&&this.graph.off("blank:mousedown",this.remove,this)}remove(){this.stopListening();const t=this.constructor;return t.unregister(this),super.remove()}dispose(){this.remove()}}kS.instanceCache=new WeakMap,xS([eE.dispose()],kS.prototype,"dispose",null);class MS extends kS{get node(){return this.cell}get metadata(){const t=this.cell.prop("knob");return Array.isArray(t)?null!=this.options.index?t[this.options.index]:null:t}init(t){this.options=Object.assign({},t),this.render(),this.startListening()}startListening(){this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.model.on("reseted",this.remove,this),this.node.on("removed",this.remove,this),this.view.on("node:resize:mousedown",this.onTransform,this),this.view.on("node:rotate:mousedown",this.onTransform,this),this.view.on("node:resize:mouseup",this.onTransformed,this),this.view.on("node:rotate:mouseup",this.onTransformed,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this),super.startListening()}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.model.off("reseted",this.remove,this),this.node.off("removed",this.remove,this),this.view.off("node:resize:mousedown",this.onTransform,this),this.view.off("node:rotate:mousedown",this.onTransform,this),this.view.off("node:resize:mouseup",this.onTransformed,this),this.view.off("node:rotate:mouseup",this.onTransformed,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this),super.stopListening()}render(){return this.container=document.createElement("div"),uy(this.container,this.prefixClassName("widget-knob")),this.options.className&&uy(this.container,this.options.className),this.view.addClass(CS.KNOB),this.graph.container.appendChild(this.container),this.update(),this}remove(){return this.view.removeClass(CS.KNOB),super.remove()}update(){if(this.metadata){const{update:t,position:e}=this.metadata,n={knob:this,cell:this.cell,node:this.node};if(e){const t=e.call(this.graph,Object.assign({},n));if(t){const e=this.graph.matrix(),n=this.node.getBBox(),i=ib.normalize(this.node.getAngle()),r=ub.create(t);0!==i&&r.rotate(-i,{x:n.width/2,y:n.height/2}),r.translate(n).scale(e.a,e.d).translate(e.e,e.f),this.container.style.left=`${r.x}px`,this.container.style.top=`${r.y}px`}}t&&t.call(this.graph,Object.assign({},n))}}hide(){this.container.style.display="none"}show(){this.container.style.display=""}onTransform(){this.hide()}onTransformed(){this.show()}onKnobMouseDown({knob:t}){this.cid!==t.cid&&this.hide()}onKnobMouseUp(){this.show()}notify(t,e){if(this.view){const n=this.view.normalizeEvent(e),i=this.graph.snapToGrid(n.clientX,n.clientY);this.view.notify(`cell:${t}`,{e:n,view:this.view,node:this.node,cell:this.cell,x:i.x,y:i.y,knob:this}),this.cell.isNode()?this.view.notify(`node:${t}`,{e:n,view:this.view,node:this.node,cell:this.cell,x:i.x,y:i.y,knob:this}):this.cell.isEdge()&&this.view.notify(`edge:${t}`,{e:n,view:this.view,edge:this.cell,cell:this.cell,x:i.x,y:i.y,knob:this})}}onMouseDown(t){t.stopPropagation(),this.setEventData(t,{knobbing:!1,originX:t.clientX,originY:t.clientY,clientX:t.clientX,clientY:t.clientY}),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(CS.documentEvents,t.data),this.metadata&&this.metadata.onMouseDown&&this.metadata.onMouseDown.call(this.graph,{e:t,data:this.getEventData(t),knob:this,cell:this.cell,node:this.node}),this.notify("knob:mousedown",t)}onMouseMove(t){const e=this.getEventData(t),n=this.graph.findViewByCell(this.node);if(e.knobbing||(e.knobbing=!0,n&&(n.addClass(CS.KNOBBING),this.notify("knob",t)),this.model.startBatch("knob",{cid:this.cid})),e.clientX=t.clientX,e.clientY=t.clientY,this.metadata&&this.metadata.onMouseMove){const n=this.graph.matrix(),i=(t.clientX-e.originX)/n.a,r=(t.clientY-e.originY)/n.d,s=this.node.getAngle(),o=new ub(i,r).rotate(s);this.metadata.onMouseMove.call(this.graph,{e:t,data:e,deltaX:o.x,deltaY:o.y,knob:this,cell:this.cell,node:this.node})}this.notify("knobbing",t),this.notify("knob:mousemove",t)}onMouseUp(t){this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.getEventData(t),n=this.graph.findViewByCell(this.node);e.knobbing&&(n&&n.removeClass(CS.KNOBBING),this.metadata&&this.metadata.onMouseUp&&this.metadata.onMouseUp.call(this.graph,{e:t,data:e,knob:this,cell:this.cell,node:this.node}),this.model.stopBatch("knob",{cid:this.cid}),this.notify("knobbed",t)),this.notify("knob:mouseup",t)}}(function(t){t.KNOB="has-widget-knob",t.KNOBBING="node-knobbing",t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"}})(CS||(CS={}));var SS,AS,DS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};(function(t){t.root="widget-minimap",t.viewport=`${t.root}-viewport`,t.zoom=`${t.viewport}-zoom`})(SS||(SS={}));class OS extends eE{constructor(t){super(),this.options=Object.assign(Object.assign({},AS.defaultOptions),t),this.updateViewport=Xm(this.updateViewport.bind(this),0),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(SS.root));const e=document.createElement("div");this.container.appendChild(e),this.$viewport=this.$("<div>").addClass(this.prefixClassName(SS.viewport)),this.options.scalable&&(this.zoomHandle=this.$("<div>").addClass(this.prefixClassName(SS.zoom)).appendTo(this.$viewport).get(0)),this.$container.append(this.$viewport).css({width:this.options.width,height:this.options.height,padding:this.options.padding}),this.options.container&&this.options.container.appendChild(this.container),this.sourceGraph=this.graph;const n=Object.assign(Object.assign({},this.options.graphOptions),{container:e,model:this.sourceGraph.model,frozen:!0,async:this.sourceGraph.isAsync(),interacting:!1,grid:!1,background:!1,rotating:!1,resizing:!1,embedding:!1,selecting:!1,snapline:!1,clipboard:!1,history:!1,scroller:!1});this.targetGraph=this.options.createGraph?this.options.createGraph(n):new _A(n),this.targetGraph.renderer.unfreeze(),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}get graph(){return this.options.graph}get scroller(){return this.graph.scroller.widget}get graphContainer(){return this.scroller?this.scroller.container:this.graph.container}get $graphContainer(){return this.scroller?this.scroller.$container:this.$(this.graph.container)}startListening(){this.scroller?this.$graphContainer.on(`scroll${this.getEventNamespace()}`,this.updateViewport):(this.sourceGraph.on("translate",this.onSourceGraphTransform,this),this.sourceGraph.on("scale",this.onSourceGraphTransform,this)),this.sourceGraph.on("resize",this.updatePaper,this),this.delegateEvents({mousedown:"startAction",touchstart:"startAction",[`mousedown .${this.prefixClassName("graph")}`]:"scrollTo",[`touchstart .${this.prefixClassName("graph")}`]:"scrollTo"})}stopListening(){this.scroller?this.$graphContainer.off(this.getEventNamespace()):(this.sourceGraph.off("translate",this.onSourceGraphTransform,this),this.sourceGraph.off("scale",this.onSourceGraphTransform,this)),this.sourceGraph.off("resize",this.updatePaper,this),this.undelegateEvents()}onRemove(){this.targetGraph.view.remove(),this.stopListening(),this.targetGraph.dispose()}onSourceGraphTransform(){this.targetGraphTransforming?this.updateViewport():this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height)}updatePaper(t,e){let n,i;"object"===typeof t?(n=t.width,i=t.height):(n=t,i=e);const r=this.sourceGraph.options,s=this.sourceGraph.transform.getScale(),o=this.options.width-2*this.options.padding,a=this.options.height-2*this.options.padding;n/=s.sx,i/=s.sy,this.ratio=Math.min(o/n,a/i);const l=this.ratio,c=r.x*l/s.sx,h=r.y*l/s.sy;return n*=l,i*=l,this.targetGraph.resizeGraph(n,i),this.targetGraph.translate(c,h),this.targetGraph.scale(l,l),this.updateViewport(),this}updateViewport(){const t=this.ratio,e=this.sourceGraph.transform.getScale();let n=null;if(this.scroller)n=this.scroller.clientToLocalPoint(0,0);else{const t=this.sourceGraph.matrix();n=new ub(-t.e/t.a,-t.f/t.d)}const i=this.$(this.targetGraph.container).position(),r=this.targetGraph.translate();r.ty=r.ty||0,this.geometry={top:i.top+n.y*t+r.ty,left:i.left+n.x*t+r.tx,width:this.$graphContainer.innerWidth()*t/e.sx,height:this.$graphContainer.innerHeight()*t/e.sy},this.$viewport.css(this.geometry)}startAction(t){const e=this.normalizeEvent(t),n=e.target===this.zoomHandle?"zooming":"panning",{tx:i,ty:r}=this.sourceGraph.translate(),s={action:n,clientX:e.clientX,clientY:e.clientY,scrollLeft:this.graphContainer.scrollLeft,scrollTop:this.graphContainer.scrollTop,zoom:this.sourceGraph.zoom(),scale:this.sourceGraph.transform.getScale(),geometry:this.geometry,translateX:i,translateY:r};this.targetGraphTransforming=!0,this.delegateDocumentEvents(AS.documentEvents,s)}doAction(t){const e=this.normalizeEvent(t),n=e.clientX,i=e.clientY,r=e.data;switch(r.action){case"panning":{const t=this.sourceGraph.transform.getScale(),e=(n-r.clientX)*t.sx,s=(i-r.clientY)*t.sy;this.scroller?(this.graphContainer.scrollLeft=r.scrollLeft+e/this.ratio,this.graphContainer.scrollTop=r.scrollTop+s/this.ratio):this.sourceGraph.translate(r.translateX-e/this.ratio,r.translateY-s/this.ratio);break}case"zooming":{const t=r.scale,e=r.geometry,i=1+(r.clientX-n)/e.width/t.sx;r.frameId&&cancelAnimationFrame(r.frameId),r.frameId=requestAnimationFrame((()=>{this.sourceGraph.zoom(i*r.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})}));break}default:break}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(t){const e=this.normalizeEvent(t);let n,i;const r=this.targetGraph.translate();if(r.ty=r.ty||0,null==e.offsetX){const t=this.$(this.targetGraph.container).offset();n=e.pageX-t.left,i=e.pageY-t.top}else n=e.offsetX,i=e.offsetY;const s=(n-r.tx)/this.ratio,o=(i-r.ty)/this.ratio;this.sourceGraph.centerPoint(s,o)}dispose(){this.remove()}}DS([eE.dispose()],OS.prototype,"dispose",null),function(t){t.defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:t=>new _A(t)},t.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}}(AS||(AS={}));var PS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},TS=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class NS extends eE{constructor(t){super();const{graph:e}=t,n=TS(t,["graph"]);this.graph=e,this.options=Object.assign({tolerance:10},n),this.render(),this.parseFilter(),this.disabled||this.startListening()}get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}get disabled(){return!0!==this.options.enabled||!0!==this.graph.options.snapline.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.graph.options.snapline.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.graph.options.snapline.enabled=!1,this.stopListening())}setFilter(t){this.options.filter=t,this.parseFilter()}render(){this.container=document.createElement("div"),this.$container=this.$(this.container),this.$horizontal=this.$(document.createElement("div")).addClass(this.horizontalClassName),this.$vertical=this.$(document.createElement("div")).addClass(this.verticalClassName),this.$container.hide().addClass(this.containerClassName).append([this.$horizontal,this.$vertical]),this.options.className&&this.$container.addClass(this.options.className)}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}parseFilter(){this.filterShapes={},this.filterCells={},this.filterFunction=null;const t=this.options.filter;Array.isArray(t)?t.forEach((t=>{"string"===typeof t?this.filterShapes[t]=!0:this.filterCells[t.id]=!0})):"function"===typeof t&&(this.filterFunction=t)}onBatchStop({name:t,data:e}){"resize"===t&&this.snapOnResizing(e.cell,e)}captureCursorOffset({view:t,x:e,y:n}){const i=t.getDelegatedView();if(i&&this.isNodeMovable(i)){const i=t.cell.getPosition();this.offset={x:e-i.x,y:n-i.y}}}isNodeMovable(t){return t&&t.cell.isNode()&&t.can("nodeMovable")}snapOnResizing(t,e){if(this.options.resizing&&!e.snapped&&e.ui&&e.direction&&e.trueDirection){const n=this.graph.renderer.findViewByCell(t);if(n&&n.cell.isNode()){const i=t.getBBox(),r=i.bbox(t.getAngle()),s=r.getTopLeft(),o=r.getBottomRight(),a=ib.normalize(t.getAngle()),l=this.options.tolerance||0;let c,h,u,d,p,g;const f={vertical:0,horizontal:0},m=e.direction,y=e.trueDirection,b=e.relativeDirection;-1!==y.indexOf("right")?f.vertical=o.x:f.vertical=s.x,-1!==y.indexOf("bottom")?f.horizontal=o.y:f.horizontal=s.y,this.model.getNodes().some((e=>{if(this.isIgnored(t,e))return!1;const n=e.getBBox().bbox(e.getAngle()),i=n.getTopLeft(),s=n.getBottomRight(),a={vertical:[i.x,s.x],horizontal:[i.y,s.y]},m={};return Object.keys(a).forEach((t=>{const e=t,n=a[e].map((t=>({position:t,distance:Math.abs(t-f[e])}))).filter((t=>t.distance<=l));m[e]=kl(n,(t=>t.distance))})),null==c&&m.vertical.length>0&&(c=m.vertical[0].position,h=Math.min(r.y,n.y),u=Math.max(o.y,s.y)-h),null==d&&m.horizontal.length>0&&(d=m.horizontal[0].position,p=Math.min(r.x,n.x),g=Math.max(o.x,s.x)-p),null!=c&&null!=d})),this.hide();let v=0,w=0;null==d&&null==c||(null!=c&&(v=-1!==y.indexOf("right")?c-o.x:s.x-c),null!=d&&(w=-1!==y.indexOf("bottom")?d-o.y:s.y-d));let C=0,x=0;if(a%90===0)90===a||270===a?(C=w,x=v):(C=v,x=w);else{const t=a>=0&&a<90?1:a>=90&&a<180?4:a>=180&&a<270?3:2;null!=d&&null!=c&&(v<w?(w=0,d=void 0):(v=0,c=void 0));const e=ib.toRad(a%90);v&&(C=3===t?v/Math.cos(e):v/Math.sin(e)),w&&(x=3===t?w/Math.cos(e):w/Math.sin(e));const n=1===t||3===t;switch(b){case"top":case"bottom":x=w?w/(n?Math.cos(e):Math.sin(e)):v/(n?Math.sin(e):Math.cos(e));break;case"left":case"right":C=v?v/(n?Math.cos(e):Math.sin(e)):w/(n?Math.sin(e):Math.cos(e));break;default:break}}switch(b){case"top":case"bottom":C=0;break;case"left":case"right":x=0;break;default:break}const E=this.graph.getGridSize();let k=Math.max(i.width+C,E),M=Math.max(i.height+x,E);e.minWidth&&e.minWidth>E&&(k=Math.max(k,e.minWidth)),e.minHeight&&e.minHeight>E&&(M=Math.max(M,e.minHeight)),e.maxWidth&&(k=Math.min(k,e.maxWidth)),e.maxHeight&&(M=Math.min(M,e.maxHeight)),e.preserveAspectRatio&&(x<C?M=k*(i.height/i.width):k=M*(i.width/i.height)),k===i.width&&M===i.height||(t.resize(k,M,{direction:m,relativeDirection:b,trueDirection:y,snapped:!0,snaplines:this.cid,restrict:this.graph.hook.getRestrictArea(n)}),u&&(u+=M-i.height),g&&(g+=k-i.width));const S=t.getBBox().bbox(a);c&&Math.abs(S.x-c)>1&&Math.abs(S.width+S.x-c)>1&&(c=void 0),d&&Math.abs(S.y-d)>1&&Math.abs(S.height+S.y-d)>1&&(d=void 0),this.update({verticalLeft:c,verticalTop:h,verticalHeight:u,horizontalTop:d,horizontalLeft:p,horizontalWidth:g})}}}snapOnMoving({view:t,e:e,x:n,y:i}){const r=t.getEventData(e).delegatedView||t;if(!this.isNodeMovable(r))return;const s=r.cell,o=s.getSize(),a=s.getPosition(),l=new db(n-this.offset.x,i-this.offset.y,o.width,o.height),c=s.getAngle(),h=l.getCenter(),u=l.bbox(c),d=u.getTopLeft(),p=u.getBottomRight(),g=this.options.tolerance||0;let f,m,y,b,v,w,C=0,x=0;if(this.model.getNodes().some((t=>{if(this.isIgnored(s,t))return!1;const e=t.getBBox().bbox(t.getAngle()),n=e.getCenter(),i=e.getTopLeft(),r=e.getBottomRight();return null==f&&(Math.abs(n.x-h.x)<g?(f=n.x,C=.5):Math.abs(i.x-d.x)<g?(f=i.x,C=0):Math.abs(i.x-p.x)<g?(f=i.x,C=1):Math.abs(r.x-p.x)<g?(f=r.x,C=1):Math.abs(r.x-d.x)<g&&(f=r.x),null!=f&&(m=Math.min(u.y,e.y),y=Math.max(p.y,r.y)-m)),null==b&&(Math.abs(n.y-h.y)<g?(b=n.y,x=.5):Math.abs(i.y-d.y)<g?b=i.y:Math.abs(i.y-p.y)<g?(b=i.y,x=1):Math.abs(r.y-p.y)<g?(b=r.y,x=1):Math.abs(r.y-d.y)<g&&(b=r.y),null!=b&&(v=Math.min(u.x,e.x),w=Math.max(p.x,r.x)-v)),null!=f&&null!=b})),this.hide(),null!=b||null!=f){null!=b&&(u.y=b-x*u.height),null!=f&&(u.x=f-C*u.width);const t=u.getCenter(),e=t.x-l.width/2,n=t.y-l.height/2,i=e-a.x,o=n-a.y;0===i&&0===o||(s.translate(i,o,{snapped:!0,restrict:this.graph.hook.getRestrictArea(r)}),w&&(w+=i),y&&(y+=o)),this.update({verticalLeft:f,verticalTop:m,verticalHeight:y,horizontalTop:b,horizontalLeft:v,horizontalWidth:w})}}isIgnored(t,e){return e.id===t.id||e.isDescendantOf(t)||this.filterShapes[e.shape]||this.filterCells[e.id]||this.filterFunction&&ey(this.filterFunction,this.graph,e)}update(t){const e=this.graph.matrix(),n=e.a,i=e.d,r=e.e,s=e.f,o=this.options.sharp,a=null!=this.graph.scroller.widget;t.horizontalTop?this.$horizontal.css({top:t.horizontalTop*i+s,left:o?t.horizontalLeft*n+r:a?"-300%":0,width:o?t.horizontalWidth*n:a?"700%":"100%"}).show():this.$horizontal.hide(),t.verticalLeft?this.$vertical.css({left:t.verticalLeft*n+r,top:o?t.verticalTop*i+s:a?"-300%":0,height:o?t.verticalHeight*i:a?"700%":"100%"}).show():this.$vertical.hide(),this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.$container.show(),this.resetTimer(),null==this.container.parentNode&&this.graph.container.appendChild(this.container),this}hide(){this.$container.hide(),this.resetTimer();const t=this.options.clean,e="number"===typeof t?t:!1!==t?3e3:0;return e>0&&(this.timer=window.setTimeout((()=>{this.unmount()}),e)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}PS([eE.dispose()],NS.prototype,"dispose",null);var jS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class LS extends uS{init(){this.resetUpdates(),this.startListening(),this.resetViews(this.model.getCells()),!this.isFrozen()&&this.isAsync()&&this.updateViewsAsync()}startListening(){this.model.on("sorted",this.onSortModel,this),this.model.on("reseted",this.onModelReseted,this),this.model.on("batch:stop",this.onBatchStop,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("sorted",this.onSortModel,this),this.model.off("reseted",this.onModelReseted,this),this.model.off("batch:stop",this.onBatchStop,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}resetUpdates(){this.updates={priorities:[{},{},{}],mounted:{},mountedCids:[],unmounted:{},unmountedCids:[],count:0,sort:!1,frozen:!1,freezeKey:null,animationId:null}}onSortModel(){this.model.hasActiveBatch(LS.SORT_DELAYING_BATCHES)||this.sortViews()}onModelReseted({options:t}){this.removeZPivots(),this.resetViews(this.model.getCells(),t)}onBatchStop({name:t,data:e}){if(this.isFrozen())return;const n=this.model;if(!this.isAsync()){const i=LS.UPDATE_DELAYING_BATCHES;i.includes(t)&&!n.hasActiveBatch(i)&&this.updateViews(e)}const i=LS.SORT_DELAYING_BATCHES;i.includes(t)&&!n.hasActiveBatch(i)&&this.sortViews()}onCellAdded({cell:t,options:e}){const n=e.position;this.isAsync()||"number"!==typeof n?this.renderView(t,e):(e.maxPosition===n&&this.freeze({key:"addCells"}),this.renderView(t,e),0===n&&this.unfreeze({key:"addCells"}))}onCellRemoved({cell:t,options:e}){const n=this.findViewByCell(t);n&&this.requestViewUpdate(n,LS.FLAG_REMOVE,n.priority,e)}onCellZIndexChanged({cell:t,options:e}){if("approx"===this.options.sorting){const n=this.findViewByCell(t);n&&this.requestViewUpdate(n,LS.FLAG_INSERT,n.priority,e)}}onCellVisibleChanged({cell:t,current:e,options:n}){e||this.processEdgeOnTerminalVisibleChanged(t,!1);const i=this.findViewByCell(t);!e&&i?this.removeView(t):e&&null==i&&this.renderView(t,n),e&&this.processEdgeOnTerminalVisibleChanged(t,!0)}processEdgeOnTerminalVisibleChanged(t,e){const n=(t,e)=>{const n=t.getSourceCellId();if(n!==e.id)return t.getSourceCell();const i=t.getTargetCellId();return i!==e.id?t.getTargetCell():null};this.model.getConnectedEdges(t).forEach((i=>{const r=n(i,t);(null==r||r.isVisible())&&(e?i.show():i.hide())}))}isEdgeTerminalVisible(t,e){const n="source"===e?t.getSourceCellId():t.getTargetCellId(),i=n?this.model.getCell(n):null;return!(i&&!i.isVisible())}requestConnectedEdgesUpdate(t,e={}){if(fE.isCellView(t)){const n=t.cell,i=this.model.getConnectedEdges(n);for(let t=0,r=i.length;t<r;t+=1){const r=i[t],s=this.findViewByCell(r);if(!s)continue;const o=["update"];r.getTargetCell()===n&&o.push("target"),r.getSourceCell()===n&&o.push("source"),this.scheduleViewUpdate(s,s.getFlag(o),s.priority,e)}}}forcePostponedViewUpdate(t,e){if(!t||!fE.isCellView(t))return!1;const n=t.cell;if(n.isNode())return!1;const i=t;if(n.isEdge()&&0===(e&t.getFlag(["source","target"]))){let t=0;const e=this.findViewByCell(n.getSourceCell());e&&!this.isViewMounted(e)&&(t=this.dumpView(e),i.updateTerminalMagnet("source"));let r=0;const s=this.findViewByCell(n.getTargetCell());if(s&&!this.isViewMounted(s)&&(r=this.dumpView(s),i.updateTerminalMagnet("target")),0===t&&0===r)return!this.dumpView(i)}return!1}scheduleViewUpdate(t,e,n,i={}){const r=t.cid,s=this.updates;let o=s.priorities[n];o||(o=s.priorities[n]={});const a=o[r]||0;(a&e)!==e&&(a||(s.count+=1),e&LS.FLAG_REMOVE&&a&LS.FLAG_INSERT?o[r]^=LS.FLAG_INSERT:e&LS.FLAG_INSERT&&a&LS.FLAG_REMOVE&&(o[r]^=LS.FLAG_REMOVE),o[r]|=e,this.graph.hook.onViewUpdated(t,e,i))}requestViewUpdate(t,e,n,i={}){this.scheduleViewUpdate(t,e,n,i);const r=this.isAsync();if(this.isFrozen()||r&&!1!==i.async||this.model.hasActiveBatch(LS.UPDATE_DELAYING_BATCHES))return;const s=this.updateViews(i);r&&this.graph.trigger("render:done",{stats:s,options:i})}dumpView(t,e={}){if(null==t)return 0;const n=t.cid,i=this.updates,r=i.priorities[t.priority],s=this.registerMountedView(t)|r[n];return delete r[n],s?this.updateView(t,s,e):0}dumpViews(t={}){this.checkView(t),this.updateViews(t)}requireView(t,e={}){const n=this.findViewByCell(t);return null==n?null:(this.dumpView(n,e),n)}updateView(t,e,n={}){if(null==t)return 0;if(fE.isCellView(t)){if(e&LS.FLAG_REMOVE)return this.removeView(t.cell),0;e&LS.FLAG_INSERT&&(this.insertView(t),e^=LS.FLAG_INSERT)}return e?t.confirmUpdate(e,n):0}updateViews(t={}){let e,n=0,i=0,r=LS.MIN_PRIORITY;do{e=this.updateViewsBatch(t),n+=1,i+=e.updatedCount,r=Math.min(e.priority,r)}while(!e.empty);return{priority:r,batchCount:n,updatedCount:i}}updateViewsBatch(t={}){const e=this.updates,n=e.priorities,i=t.batchSize||LS.UPDATE_BATCH_SIZE;let r=!0,s=LS.MIN_PRIORITY,o=0,a=0,l=0,c=0,h=t.checkView||this.options.checkView;"function"!==typeof h&&(h=null);t:for(let u=0,d=n.length;u<d;u+=1){const d=n[u];for(const n in d){if(l>=i){r=!1;break t}const p=eE.views[n];if(!p){delete d[n];continue}let g=d[n];if(0===(g&LS.FLAG_REMOVE)){const t=n in e.unmounted;if(h&&!ey(h,this.graph,{view:p,unmounted:t})){t||(this.registerUnmountedView(p),p.unmount()),e.unmounted[n]|=g,delete d[n],a+=1;continue}t&&(g|=LS.FLAG_INSERT,o+=1),g|=this.registerMountedView(p)}const f=p;let m=this.updateView(p,g,t);if(m>0){const t=f.cell;t&&t.isEdge()&&(f.hasAction(m,"source")&&!this.isEdgeTerminalVisible(t,"source")&&(m=f.removeAction(m,"source"),m|=LS.FLAG_REMOVE),f.hasAction(m,"target")&&!this.isEdgeTerminalVisible(t,"target")&&(m=f.removeAction(m,"target"),m|=LS.FLAG_REMOVE))}m>0&&(d[n]=m,!this.graph.hook.onViewPostponed(f,m,t)||d[n])?(c+=1,r=!1):(s>u&&(s=u),l+=1,delete d[n])}}return{empty:r,priority:s,mountedCount:o,unmountedCount:a,updatedCount:l,postponedCount:c}}updateViewsAsync(t={},e={processed:0,priority:LS.MIN_PRIORITY}){const n=this.updates,i=n.animationId;if(i){if(eb(i),0===e.processed){const e=t.before;"function"===typeof e&&ey(e,this.graph,this.graph)}const r=this.updateViewsBatch(t),s=this.checkViewImpl({checkView:t.checkView,mountedBatchSize:LS.MOUNT_BATCH_SIZE-r.mountedCount,unmountedBatchSize:LS.MOUNT_BATCH_SIZE-r.unmountedCount});let o=e.processed;const a=n.count,l=s.mountedCount,c=s.unmountedCount;r.updatedCount>0&&(o+=r.updatedCount+r.unmountedCount,e.priority=Math.min(r.priority,e.priority),r.empty&&0===l?(r.priority=e.priority,r.mountedCount+=l,r.unmountedCount+=c,this.graph.trigger("render:done",{stats:r,options:t}),e.processed=0,n.count=0):e.processed=o);const h=t.progress;if(a&&"function"===typeof h&&ey(h,this.graph,{total:a,done:r.empty,current:o}),n.animationId!==i)return}n.animationId=tb((()=>{this.updateViewsAsync(t,e)}))}registerMountedView(t){const e=t.cid,n=this.updates;if(e in n.mounted)return 0;n.mounted[e]=!0,n.mountedCids.push(e);const i=n.unmounted[e]||0;return delete n.unmounted[e],i}registerUnmountedView(t){const e=t.cid,n=this.updates;if(e in n.unmounted)return 0;n.unmounted[e]|=LS.FLAG_INSERT;const i=n.unmounted[e];return n.unmountedCids.push(e),delete n.mounted[e],i}isViewMounted(t){if(null==t)return!1;const e=t.cid;return e in this.updates.mounted}getMountedViews(){return Object.keys(this.updates.mounted).map((t=>fE.views[t]))}getUnmountedViews(){return Object.keys(this.updates.unmounted).map((t=>fE.views[t]))}checkMountedViews(t,e){let n=0;if("function"!==typeof t)return n;const i=this.updates,r=i.mounted,s=i.mountedCids,o=null==e?s.length:Math.min(s.length,e);for(let a=0;a<o;a+=1){const e=s[a];if(!(e in r))continue;const i=fE.views[e];if(null==i)continue;const o=ey(t,this.graph,{view:i,unmounted:!0});if(o){s.push(e);continue}n+=1;const l=this.registerUnmountedView(i);l&&i.unmount()}return s.splice(0,o),n}checkUnmountedViews(t,e){let n=0;"function"!==typeof t&&(t=null);const i=this.updates,r=i.unmounted,s=i.unmountedCids,o=null==e?s.length:Math.min(s.length,e);for(let a=0;a<o;a+=1){const e=s[a];if(!(e in r))continue;const i=fE.views[e];if(null==i)continue;if(t&&!ey(t,this.graph,{view:i,unmounted:!1})){s.push(e);continue}n+=1;const o=this.registerMountedView(i);o&&this.scheduleViewUpdate(i,o,i.priority,{mounting:!0})}return s.splice(0,o),n}checkViewImpl(t={mountedBatchSize:Number.MAX_SAFE_INTEGER,unmountedBatchSize:Number.MAX_SAFE_INTEGER}){const e=t.checkView||this.options.checkView,n=this.checkMountedViews(e,t.unmountedBatchSize),i=this.checkUnmountedViews(e,n>0?Math.min(this.updates.unmountedCids.length-n,t.mountedBatchSize):t.mountedBatchSize);return{mountedCount:i,unmountedCount:n}}checkView(t={}){return this.checkViewImpl(t)}isFrozen(){return!!this.options.frozen}freeze(t={}){const e=t.key,n=this.updates,i=this.options.frozen,r=n.freezeKey;if(e&&e!==r){if(i&&r)return;n.frozen=i,n.freezeKey=e}this.options.frozen=!0;const s=n.animationId;n.animationId=null,this.isAsync()&&null!=s&&eb(s),this.graph.trigger("freeze",{key:e})}unfreeze(t={}){const e=t.key,n=this.updates,i=n.freezeKey;if(e&&i&&e!==i)return;if(n.freezeKey=null,e&&e===i&&n.frozen)return;const r=()=>{this.options.frozen=n.frozen=!1,n.sort&&(this.sortViews(),n.sort=!1);const i=t.after;i&&ey(i,this.graph,this.graph),this.graph.trigger("unfreeze",{key:e})};if(this.isAsync()){this.freeze();const e=t.progress;this.updateViewsAsync(Object.assign(Object.assign({},t),{progress:({done:t,current:n,total:i})=>{e&&ey(e,this.graph,{done:t,current:n,total:i}),t&&r()}}))}else this.updateViews(t),r()}isAsync(){return!!this.options.async}setAsync(t){this.options.async=t}onRemove(){this.freeze(),this.removeViews()}resetViews(t=[],e={}){this.resetUpdates(),this.removeViews(),this.freeze({key:"reset"});for(let n=0,i=t.length;n<i;n+=1)this.renderView(t[n],e);this.unfreeze({key:"reset"}),this.sortViews()}removeView(t){const e=this.views[t.id];if(e){const n=e.cid,i=this.updates,r=i.mounted,s=i.unmounted;e.remove(),delete this.views[t.id],delete r[n],delete s[n]}return e}removeViews(){this.views&&Object.keys(this.views).forEach((t=>{const e=this.views[t];e&&this.removeView(e.cell)})),this.views={}}renderView(t,e={}){const n=t.id,i=this.views;let r=0,s=i[n];if(t.isVisible()&&(!t.isEdge()||this.isEdgeTerminalVisible(t,"source")&&this.isEdgeTerminalVisible(t,"target"))){if(s)r=LS.FLAG_INSERT;else{const e=this.graph.hook.createCellView(t);e&&(s=i[t.id]=e,s.graph=this.graph,r=this.registerUnmountedView(s)|s.getBootstrapFlag())}s&&this.requestViewUpdate(s,r,s.priority,e)}}isExactSorting(){return"exact"===this.options.sorting}sortViews(){this.isExactSorting()&&(this.isFrozen()?this.updates.sort=!0:this.sortViewsExact())}sortElements(t,e){const n=t.map((t=>{const e=t.parentNode,n=e.insertBefore(document.createTextNode(""),t.nextSibling);return t=>{if(e===t)throw new Error("You can't sort elements if any one is a descendant of another.");e.insertBefore(t,n),e.removeChild(n)}}));t.sort(e).forEach(((t,e)=>n[e](t)))}sortViewsExact(){const t=this.view.$(this.view.stage).children("[data-cell-id]").toArray(),e=this.model;this.sortElements(t,((t,n)=>{const i=e.getCell(t.getAttribute("data-cell-id")||""),r=e.getCell(n.getAttribute("data-cell-id")||""),s=i.getZIndex()||0,o=r.getZIndex()||0;return s===o?0:s<o?-1:1}))}addZPivot(t=0){null==this.zPivots&&(this.zPivots={});const e=this.zPivots;let n=e[t];if(n)return n;n=e[t]=document.createComment(`z-index:${t+1}`);let i=-1/0;for(const s in e){const e=+s;e<t&&e>i&&(i=e)}const r=this.view.stage;if(i!==-1/0){const t=e[i];r.insertBefore(n,t.nextSibling)}else r.insertBefore(n,r.firstChild);return n}removeZPivots(){this.zPivots&&Object.keys(this.zPivots).forEach((t=>{const e=this.zPivots[t];e&&e.parentNode&&e.parentNode.removeChild(e)})),this.zPivots={}}insertView(t){const e=this.view.stage;switch(this.options.sorting){case"approx":{const n=t.cell.getZIndex(),i=this.addZPivot(n);e.insertBefore(t.container,i);break}case"exact":default:e.appendChild(t.container);break}}findViewByCell(t){if(null==t)return null;const e=OM.isCell(t)?t.id:t;return this.views[e]}findViewByElem(t){if(null==t)return null;const e="string"===typeof t?this.view.stage.querySelector(t):t instanceof Element?t:t[0];if(e){const t=this.view.findAttr("data-cell-id",e);if(t)return this.views[t]}return null}findViewsFromPoint(t){const e={x:t.x,y:t.y};return this.model.getCells().map((t=>this.findViewByCell(t))).filter((t=>null!=t&&Av(t.container,{target:this.view.stage}).containsPoint(e)))}findEdgeViewsInArea(t,e={}){const n=db.create(t);return this.model.getEdges().map((t=>this.findViewByCell(t))).filter((t=>{if(t){const i=Av(t.container,{target:this.view.stage});return 0===i.width?i.inflate(1,0):0===i.height&&i.inflate(0,1),e.strict?n.containsRect(i):n.isIntersectWithRect(i)}return!1}))}findViewsInArea(t,e={}){const n=db.create(t);return this.model.getNodes().map((t=>this.findViewByCell(t))).filter((t=>{if(t){const i=Av(t.container,{target:this.view.stage});return e.strict?n.containsRect(i):n.isIntersectWithRect(i)}return!1}))}dispose(){this.resetUpdates(),this.stopListening()}}jS([uS.dispose()],LS.prototype,"dispose",null),function(t){t.FLAG_INSERT=1<<30,t.FLAG_REMOVE=1<<29,t.MOUNT_BATCH_SIZE=1e3,t.UPDATE_BATCH_SIZE=1e3,t.MIN_PRIORITY=2,t.SORT_DELAYING_BATCHES=["add","to-front","to-back"],t.UPDATE_DELAYING_BATCHES=["translate"]}(LS||(LS={}));var FS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class zS extends uS{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(t={}){let e=t.size||"auto auto",n=t.position||"center";const i=this.graph.transform.getScale(),r=this.graph.translate();if("object"===typeof n){const t=r.tx+i.sx*(n.x||0),e=r.ty+i.sy*(n.y||0);n=`${t}px ${e}px`}"object"===typeof e&&(e=db.fromSize(e).scale(i.sx,i.sy),e=`${e.width}px ${e.height}px`),this.elem.style.backgroundSize=e,this.elem.style.backgroundPosition=n}drawBackgroundImage(t,e={}){if(!(t instanceof HTMLImageElement))return void(this.elem.style.backgroundImage="");const n=this.optionsCache;if(n&&n.image!==e.image)return;let i;const r=e.opacity,s=e.size;let o=e.repeat||"no-repeat";const a=ZC.registry.get(o);if("function"===typeof a){const n=e.quality||1;t.width*=n,t.height*=n;const r=a(t,e);if(!(r instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");i=r.toDataURL("image/png"),o=e.repeat&&o!==e.repeat?e.repeat:"repeat","object"===typeof s?(s.width*=r.width/t.width,s.height*=r.height/t.height):void 0===s&&(e.size={width:r.width/n,height:r.height/n})}else i=t.src,void 0===s&&(e.size={width:t.width,height:t.height});null!=n&&"object"===typeof e.size&&e.image===n.image&&e.repeat===n.repeat&&e.quality===n.quality&&(n.size=id(e.size));const l=this.elem.style;l.backgroundImage=`url(${i})`,l.backgroundRepeat=o,l.opacity=null==r||r>=1?"":`${r}`,this.updateBackgroundImage(e)}updateBackgroundColor(t){this.elem.style.backgroundColor=t||""}updateBackgroundOptions(t){this.graph.options.background=t}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(t){const e=t||{};if(this.updateBackgroundOptions(t),this.updateBackgroundColor(e.color),e.image){this.optionsCache=id(e);const n=document.createElement("img");n.onload=()=>this.drawBackgroundImage(n,t),n.setAttribute("crossorigin","anonymous"),n.src=e.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}FS([uS.dispose()],zS.prototype,"dispose",null);var RS,BS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},IS=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class $S extends eE{constructor(t){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=RS.getOptions(t);const e=this.graph.transform.getScale();this.sx=e.sx,this.sy=e.sy;const n=this.options.width||this.graph.options.width,i=this.options.height||this.graph.options.height;this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(RS.containerClass)).css({width:n,height:i}),this.options.pageVisible&&this.$container.addClass(this.prefixClassName(RS.pagedClass)),this.options.className&&this.$container.addClass(this.options.className);const r=this.graph.container;r.parentNode&&this.$container.insertBefore(r);const s=r.getAttribute("style");if(s){const t={},e=s.split(";");e.forEach((e=>{const n=e.trim();if(n){const e=n.split(":");e.length&&(t[e[0].trim()]=e[1]?e[1].trim():"")}})),Object.keys(t).forEach((e=>{"width"!==e&&"height"!==e&&(r.style[e]="",this.container.style[e]=t[e])}))}this.content=document.createElement("div"),this.$content=this.$(this.content).addClass(this.prefixClassName(RS.contentClass)).css({width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),this.$background=this.$(this.background).addClass(this.prefixClassName(RS.backgroundClass)),this.$content.append(this.background),this.options.pageVisible||this.$content.append(this.graph.view.grid),this.$content.append(r),this.$content.appendTo(this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new $S.Background(this),this.options.autoResize||this.update()}get graph(){return this.options.graph}get model(){return this.graph.model}startListening(){const t=this.graph,e=this.model;t.on("scale",this.onScale,this),t.on("resize",this.onResize,this),t.on("before:print",this.storeScrollPosition,this),t.on("before:export",this.storeScrollPosition,this),t.on("after:print",this.restoreScrollPosition,this),t.on("after:export",this.restoreScrollPosition,this),t.on("render:done",this.onRenderDone,this),t.on("unfreeze",this.onUpdate,this),e.on("reseted",this.onUpdate,this),e.on("cell:added",this.onUpdate,this),e.on("cell:removed",this.onUpdate,this),e.on("cell:changed",this.onUpdate,this),e.on("batch:stop",this.onBatchStop,this),this.delegateBackgroundEvents()}stopListening(){const t=this.graph,e=this.model;t.off("scale",this.onScale,this),t.off("resize",this.onResize,this),t.off("beforeprint",this.storeScrollPosition,this),t.off("beforeexport",this.storeScrollPosition,this),t.off("afterprint",this.restoreScrollPosition,this),t.off("afterexport",this.restoreScrollPosition,this),t.off("render:done",this.onRenderDone,this),t.off("unfreeze",this.onUpdate,this),e.off("reseted",this.onUpdate,this),e.off("cell:added",this.onUpdate,this),e.off("cell:removed",this.onUpdate,this),e.off("cell:changed",this.onUpdate,this),e.off("batch:stop",this.onBatchStop,this),this.undelegateBackgroundEvents()}enableAutoResize(){this.options.autoResize=!0}disableAutoResize(){this.options.autoResize=!1}onUpdate(){!this.graph.isAsync()&&this.options.autoResize&&this.update()}onBatchStop(t){!this.graph.isAsync()&&this.options.autoResize&&LS.UPDATE_DELAYING_BATCHES.includes(t.name)&&this.update()}delegateBackgroundEvents(t){const e=t||gS.events;this.delegatedHandlers=Object.keys(e).reduce(((t,n)=>{const i=e[n];if(-1===n.indexOf(" "))if("function"===typeof i)t[n]=i;else{let e=this.graph.view[i];"function"===typeof e&&(e=e.bind(this.graph.view),t[n]=e)}return t}),{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach((t=>{this.delegateEvent(t,{guarded:!1},this.onBackgroundEvent)}))}undelegateBackgroundEvents(){Object.keys(this.delegatedHandlers).forEach((t=>{this.undelegateEvent(t,this.onBackgroundEvent)}))}onBackgroundEvent(t){let e=!1;const n=t.target;if(this.options.pageVisible)e=this.options.background?this.background===n:this.content===n;else{const t=this.graph.view;e=t.background===n||t.grid===n}if(e){const e=this.delegatedHandlers[t.type];"function"===typeof e&&e.apply(this.graph,arguments)}}onRenderDone({stats:t}){this.options.autoResize&&t.priority<2&&this.update()}onResize(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())}onScale({sx:t,sy:e,ox:n,oy:i}){this.updateScale(t,e),(n||i)&&(this.centerPoint(n,i),this.updatePageBreak());const r=this.options.autoResizeOptions||this.options.fitTocontentOptions;"function"===typeof r&&this.update()}storeScrollPosition(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop}restoreScrollPosition(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null}storeClientSize(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}}restoreClientSize(){this.cachedClientSize=null}beforeManipulation(){(et.IS_IE||et.IS_EDGE)&&this.$container.css("visibility","hidden")}afterManipulation(){(et.IS_IE||et.IS_EDGE)&&this.$container.css("visibility","visible")}updatePageSize(t,e){null!=t&&(this.options.pageWidth=t),null!=e&&(this.options.pageHeight=e),this.updatePageBreak()}updatePageBreak(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){const t=this.graph.options.width,e=this.graph.options.height,n=this.options.pageWidth*this.sx,i=this.options.pageHeight*this.sy;if(t>n||e>i){let r=!1;const s=document.createElement("div");for(let e=1,i=Math.floor(t/n);e<i;e+=1)this.$("<div/>").addClass(this.prefixClassName("graph-pagebreak-vertical")).css({left:e*n}).appendTo(s),r=!0;for(let t=1,n=Math.floor(e/i);t<n;t+=1)this.$("<div/>").addClass(this.prefixClassName("graph-pagebreak-horizontal")).css({top:t*i}).appendTo(s),r=!0;r&&(uy(s,this.prefixClassName("graph-pagebreak")),this.$(this.graph.view.grid).after(s),this.pageBreak=s)}}}update(){const t=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(t.width/2,t.height/2);let e=this.options.autoResizeOptions||this.options.fitTocontentOptions;"function"===typeof e&&(e=ey(e,this,this));const n=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative"},e);this.graph.fitToContent(this.getFitToContentOptions(n))}getFitToContentOptions(t){const e=this.sx,n=this.sy;return t.gridWidth&&(t.gridWidth*=e),t.gridHeight&&(t.gridHeight*=n),t.minWidth&&(t.minWidth*=e),t.minHeight&&(t.minHeight*=n),"object"===typeof t.padding?t.padding={left:(t.padding.left||0)*e,right:(t.padding.right||0)*e,top:(t.padding.top||0)*n,bottom:(t.padding.bottom||0)*n}:"number"===typeof t.padding&&(t.padding*=e),this.options.autoResize||(t.contentArea=db.create()),t}updateScale(t,e){const n=this.graph.options,i=t/this.sx,r=e/this.sy;this.sx=t,this.sy=e,this.graph.translate(n.x*i,n.y*r),this.graph.resizeGraph(n.width*i,n.height*r)}scrollbarPosition(t,e,n){if(null==t&&null==e)return{left:this.container.scrollLeft,top:this.container.scrollTop};const i={};return"number"===typeof t&&(i.scrollLeft=t),"number"===typeof e&&(i.scrollTop=e),n&&n.animation?this.$container.animate(i,n.animation):this.$container.prop(i),this}scrollToPoint(t,e,n){const i=this.getClientSize(),r=this.graph.matrix(),s={};return"number"===typeof t&&(s.scrollLeft=t-i.width/2+r.e+(this.padding.left||0)),"number"===typeof e&&(s.scrollTop=e-i.height/2+r.f+(this.padding.top||0)),n&&n.animation?this.$container.animate(s,n.animation):this.$container.prop(s),this}scrollToContent(t){const e=this.sx,n=this.sy,i=this.graph.getContentArea().getCenter();return this.scrollToPoint(i.x*e,i.y*n,t)}scrollToCell(t,e){const n=this.sx,i=this.sy,r=t.getBBox().getCenter();return this.scrollToPoint(r.x*n,r.y*i,e)}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const i=this.graph.matrix(),r=i.a,s=i.d,o=-i.e,a=-i.f,l=o+this.graph.options.width,c=a+this.graph.options.height;let h;if(this.storeClientSize(),"number"===typeof t||"number"===typeof e){h=n;const i=this.getVisibleArea().getCenter();"number"===typeof t?t*=r:t=i.x,"number"===typeof e?e*=s:e=i.y}else h=t,t=(o+l)/2,e=(a+c)/2;if(h&&h.padding)return this.positionPoint({x:t,y:e},"50%","50%",h);const u=this.getPadding(),d=this.getClientSize(),p=d.width/2,g=d.height/2,f=p-u.left-t+o,m=p-u.right+t-l,y=g-u.top-e+a,b=g-u.bottom+e-c;this.addPadding(Math.max(f,0),Math.max(m,0),Math.max(y,0),Math.max(b,0));const v=this.scrollToPoint(t,e,h||void 0);return this.restoreClientSize(),v}centerContent(t){return this.positionContent("center",t)}centerCell(t,e){return this.positionCell(t,"center",e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t,e)}positionCell(t,e,n){const i=t.getBBox();return this.positionRect(i,e,n)}positionRect(t,e,n){const i=db.create(t);switch(e){case"center":return this.positionPoint(i.getCenter(),"50%","50%",n);case"top":return this.positionPoint(i.getTopCenter(),"50%",0,n);case"top-right":return this.positionPoint(i.getTopRight(),"100%",0,n);case"right":return this.positionPoint(i.getRightMiddle(),"100%","50%",n);case"bottom-right":return this.positionPoint(i.getBottomRight(),"100%","100%",n);case"bottom":return this.positionPoint(i.getBottomCenter(),"50%","100%",n);case"bottom-left":return this.positionPoint(i.getBottomLeft(),0,"100%",n);case"left":return this.positionPoint(i.getLeftMiddle(),0,"50%",n);case"top-left":return this.positionPoint(i.getTopLeft(),0,0,n);default:return this}}positionPoint(t,e,n,i={}){const{padding:r}=i,s=IS(i,["padding"]),o=Vm(r),a=db.fromSize(this.getClientSize()),l=a.clone().moveAndExpand({x:o.left,y:o.top,width:-o.right-o.left,height:-o.top-o.bottom});e=Im(e,Math.max(0,l.width)),e<0&&(e=l.width+e),n=Im(n,Math.max(0,l.height)),n<0&&(n=l.height+n);const c=l.getTopLeft().translate(e,n),h=a.getCenter().diff(c),u=this.zoom(),d=h.scale(1/u,1/u),p=ub.create(t).translate(d);return this.centerPoint(p.x,p.y,s)}zoom(t,e){if(null==t)return this.sx;let n,i;e=e||{};const r=this.getClientSize(),s=this.clientToLocalPoint(r.width/2,r.height/2);let o=t,a=t;if(e.absolute||(o+=this.sx,a+=this.sy),e.scaleGrid&&(o=Math.round(o/e.scaleGrid)*e.scaleGrid,a=Math.round(a/e.scaleGrid)*e.scaleGrid),e.maxScale&&(o=Math.min(e.maxScale,o),a=Math.min(e.maxScale,a)),e.minScale&&(o=Math.max(e.minScale,o),a=Math.max(e.minScale,a)),o=this.graph.transform.clampScale(o),a=this.graph.transform.clampScale(a),e.center){const t=o/this.sx,r=a/this.sy;n=e.center.x-(e.center.x-s.x)/t,i=e.center.y-(e.center.y-s.y)/r}else n=s.x,i=s.y;return this.beforeManipulation(),this.graph.transform.scale(o,a),this.centerPoint(n,i),this.afterManipulation(),this}zoomToRect(t,e={}){const n=db.create(t),i=this.graph;e.contentArea=n,null==e.viewportArea&&(e.viewportArea={x:i.options.x,y:i.options.y,width:this.$container.width(),height:this.$container.height()}),this.beforeManipulation(),i.transform.scaleContentToFitImpl(e,!1);const r=n.getCenter();return this.centerPoint(r.x,r.y),this.afterManipulation(),this}zoomToFit(t={}){return this.zoomToRect(this.graph.getContentArea(t),t)}transitionToPoint(t,e,n){let i,r;"object"===typeof t?(n=e,e=t.y,t=t.x):e=e,null==n&&(n={});const s=this.sx,o=Math.max(n.scale||s,1e-6),a=this.getClientSize(),l=new ub(t,e),c=this.clientToLocalPoint(a.width/2,a.height/2);if(s===o){const t=c.diff(l).scale(s,s).round();i=`translate(${t.x}px,${t.y}px)`}else{const t=o/(s-o)*l.distance(c),e=c.clone().move(l,t),n=this.localToBackgroundPoint(e).round();i=`scale(${o/s})`,r=`${n.x}px ${n.y}px`}const h=n.onTransitionEnd;return this.$container.addClass(RS.transitionClassName),this.$content.off(RS.transitionEventName).on(RS.transitionEventName,(n=>{this.syncTransition(o,{x:t,y:e}),"function"===typeof h&&ey(h,this,n.originalEvent)})).css({transform:i,transformOrigin:r,transition:"transform",transitionDuration:n.duration||"1s",transitionDelay:n.delay,transitionTimingFunction:n.timing}),this}syncTransition(t,e){return this.beforeManipulation(),this.graph.scale(t),this.removeTransition(),this.centerPoint(e.x,e.y),this.afterManipulation(),this}removeTransition(){return this.$container.removeClass(RS.transitionClassName),this.$content.off(RS.transitionEventName).css({transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(t,e={}){const n=db.create(t),i=e.maxScale||1/0,r=e.minScale||Number.MIN_VALUE,s=e.scaleGrid||null,o=e.visibility||1,a=e.center?ub.create(e.center):n.getCenter(),l=this.getClientSize(),c=l.width*o,h=l.height*o;let u=new db(a.x-c/2,a.y-h/2,c,h).getMaxUniformScaleToFit(n,a);return u=Math.min(u,i),s&&(u=Math.floor(u/s)*s),u=Math.max(r,u),this.transitionToPoint(a,Object.assign({scale:u},e))}startPanning(t){const e=this.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("pan:start",{e:e}),this.$(document.body).on({"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),this.$(window).on("mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.normalizeEvent(t),n=e.clientX-this.clientX,i=e.clientY-this.clientY;this.container.scrollTop-=i,this.container.scrollLeft-=n,this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("panning",{e:e})}stopPanning(t){this.$(document.body).off(".panning"),this.$(window).off(".panning"),this.trigger("pan:stop",{e:t})}clientToLocalPoint(t,e){let n="object"===typeof t?t.x:t,i="object"===typeof t?t.y:e;const r=this.graph.matrix();return n+=this.container.scrollLeft-this.padding.left-r.e,i+=this.container.scrollTop-this.padding.top-r.f,new ub(n/r.a,i/r.d)}localToBackgroundPoint(t,e){const n="object"===typeof t?ub.create(t):new ub(t,e),i=this.graph.matrix(),r=this.padding;return xv(n,i).translate(r.left,r.top)}resize(t,e){let n=null!=t?t:this.container.clientWidth,i=null!=e?e:this.container.clientHeight;"number"===typeof n&&(n=Math.round(n)),"number"===typeof i&&(i=Math.round(i)),this.options.width=n,this.options.height=i,this.$container.css({width:n,height:i}),this.update()}getClientSize(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}}autoScroll(t,e){const n=10,i=this.container,r=i.getBoundingClientRect();let s=0,o=0;return t<=r.left+n&&(s=-n),e<=r.top+n&&(o=-n),t>=r.right-n&&(s=n),e>=r.bottom-n&&(o=n),0!==s&&(i.scrollLeft+=s),0!==o&&(i.scrollTop+=o),{scrollerX:s,scrollerY:o}}addPadding(t,e,n,i){let r=this.getPadding();this.padding={left:Math.round(r.left+(t||0)),top:Math.round(r.top+(n||0)),bottom:Math.round(r.bottom+(i||0)),right:Math.round(r.right+(e||0))},r=this.padding,this.$content.css({width:r.left+this.graph.options.width+r.right,height:r.top+this.graph.options.height+r.bottom});const s=this.graph.container;return s.style.left=`${this.padding.left}px`,s.style.top=`${this.padding.top}px`,this}getPadding(){const t=this.options.padding;return Vm("function"===typeof t?ey(t,this,this):t)}getVisibleArea(){const t=this.graph.matrix(),e=this.getClientSize(),n={x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:e.width,height:e.height},i=kv(n,t.inverse());return i.x-=(this.padding.left||0)/this.sx,i.y-=(this.padding.top||0)/this.sy,i}isCellVisible(t,e={}){const n=t.getBBox(),i=this.getVisibleArea();return e.strict?i.containsRect(n):i.isIntersectWithRect(n)}isPointVisible(t){return this.getVisibleArea().containsPoint(t)}lock(){return this.$container.css("overflow","hidden"),this}unlock(){return this.$container.css("overflow","scroll"),this}onRemove(){this.stopListening()}dispose(){this.$(this.graph.container).insertBefore(this.$container),this.remove()}}function VS(t,e,n,i={}){if(n){const r=n.graph,s=r.view.normalizeEvent(e),o=r.snapToGrid(s.clientX,s.clientY);n.notify(t,Object.assign({e:s,view:n,node:n.cell,cell:n.cell,x:o.x,y:o.y},i))}}BS([eE.dispose()],$S.prototype,"dispose",null),function(t){class e extends zS{constructor(t){super(t.graph),this.scroller=t,t.options.background&&this.draw(t.options.background)}get elem(){return this.scroller.background}init(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}updateBackgroundOptions(t){this.scroller.options.background=t}}t.Background=e}($S||($S={})),function(t){function e(e){const n=ah({},t.defaultOptions,e);return null==n.pageWidth&&(n.pageWidth=e.graph.options.width),null==n.pageHeight&&(n.pageHeight=e.graph.options.height),n}t.containerClass="graph-scroller",t.panningClass=`${t.containerClass}-panning`,t.pannableClass=`${t.containerClass}-pannable`,t.pagedClass=`${t.containerClass}-paged`,t.contentClass=`${t.containerClass}-content`,t.backgroundClass=`${t.containerClass}-background`,t.transitionClassName="transition-in-progress",t.transitionEventName="transitionend.graph-scroller-transition",t.defaultOptions={padding(){const t=this.getClientSize(),e=Math.max(this.options.minVisibleWidth||0,1)||1,n=Math.max(this.options.minVisibleHeight||0,1)||1,i=Math.max(t.width-e,0),r=Math.max(t.height-n,0);return{left:i,top:r,right:i,bottom:r}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0},t.getOptions=e}(RS||(RS={}));var _S,GS,HS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class US extends eE{constructor(t){super(),this.options=ah({},_S.defaultOptions,t),this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new YM([],{comparator:_S.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.initHandles(),this.startListening()}get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(_S.classNames.box)}get $boxes(){return this.$container.children(`.${this.boxClassName}`)}get handleOptions(){return this.options}startListening(){const t=this.graph,e=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),t.on("scale",this.onGraphTransformed,this),t.on("translate",this.onGraphTransformed,this),t.model.on("updated",this.onModelUpdated,this),e.on("added",this.onCellAdded,this),e.on("removed",this.onCellRemoved,this),e.on("reseted",this.onReseted,this),e.on("updated",this.onCollectionUpdated,this),e.on("node:change:position",this.onNodePositionChanged,this),e.on("cell:changed",this.onCellChanged,this)}stopListening(){const t=this.graph,e=this.collection;this.undelegateEvents(),t.off("scale",this.onGraphTransformed,this),t.off("translate",this.onGraphTransformed,this),t.model.off("updated",this.onModelUpdated,this),e.off("added",this.onCellAdded,this),e.off("removed",this.onCellRemoved,this),e.off("reseted",this.onReseted,this),e.off("updated",this.onCollectionUpdated,this),e.off("node:change:position",this.onNodePositionChanged,this),e.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes({async:!1})}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:t,options:e}){const{showNodeSelectionBox:n,pointerEvents:i}=this.options,{ui:r,selection:s}=e;let o=!this.translating;if(o=o&&(!0!==n||"none"===i),o=o&&r&&!s,o){this.translating=!0;const n=t.position(),i=t.previous("position"),r=n.x-i.x,s=n.y-i.y;0===r&&0===s||this.translateSelectedNodes(r,s,t,e),this.translating=!1}}onModelUpdated({removed:t}){t&&t.length&&this.unselect(t)}isEmpty(){return this.length<=0}isSelected(t){return this.collection.has(t)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(t,e={}){e.dryrun=!0;const n=this.filter(Array.isArray(t)?t:[t]);return this.collection.add(n,e),this}unselect(t,e={}){return e.dryrun=!0,this.collection.remove(Array.isArray(t)?t:[t],e),this}reset(t,e={}){if(t){if(e.batch){const n=this.filter(Array.isArray(t)?t:[t]);return this.collection.reset(n,Object.assign(Object.assign({},e),{ui:!0})),this}const n=this.cells,i=this.filter(Array.isArray(t)?t:[t]),r={},s={};n.forEach((t=>r[t.id]=t)),i.forEach((t=>s[t.id]=t));const o=[],a=[];return i.forEach((t=>{r[t.id]||o.push(t)})),n.forEach((t=>{s[t.id]||a.push(t)})),a.length&&this.unselect(a,Object.assign(Object.assign({},e),{ui:!0})),o.length&&this.select(o,Object.assign(Object.assign({},e),{ui:!0})),0===a.length&&0===o.length&&this.updateContainer(),this}return this.clean(e)}clean(t={}){return this.length&&(!1===t.batch?this.unselect(this.cells,t):this.collection.reset([],Object.assign(Object.assign({},t),{ui:!0}))),this}setFilter(t){this.options.filter=t}setContent(t){this.options.content=t}startSelecting(t){let e,n;t=this.normalizeEvent(t),this.clean();const i=this.graph.container;if(null!=t.offsetX&&null!=t.offsetY&&i.contains(t.target))e=t.offsetX,n=t.offsetY;else{const r=this.$(i).offset(),s=i.scrollLeft,o=i.scrollTop;e=t.clientX-r.left+window.pageXOffset+s,n=t.clientY-r.top+window.pageYOffset+o}this.$container.css({top:n,left:e,width:1,height:1}),this.setEventData(t,{action:"selecting",clientX:t.clientX,clientY:t.clientY,offsetX:e,offsetY:n,scrollerX:0,scrollerY:0}),this.delegateDocumentEvents(_S.documentEvents,t.data)}filter(t){const e=this.options.filter;return Array.isArray(e)?t.filter((t=>!e.includes(t)&&!e.includes(t.shape))):"function"===typeof e?t.filter((t=>ey(e,this.graph,t))):t}stopSelecting(t){const e=this.graph,n=this.getEventData(t),i=n.action;switch(i){case"selecting":{let t=this.$container.width(),n=this.$container.height();const i=this.$container.offset(),r=e.pageToLocal(i.left,i.top),s=e.transform.getScale();t/=s.sx,n/=s.sy;const o=new db(r.x,r.y,t,n),a=this.getCellViewsInArea(o).map((t=>t.cell));this.reset(a,{batch:!0}),this.hideRubberband();break}case"translating":{const i=e.snapToGrid(t.clientX,t.clientY);if(!this.options.following){const t=n;this.updateSelectedNodesPosition({dx:t.clientX-t.originX,dy:t.clientY-t.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",t,i.x,i.y);break}default:this.clean();break}}onMouseUp(t){const e=this.getEventData(t).action;e&&(this.stopSelecting(t),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(t){this.options.following||t.stopPropagation();const e=this.normalizeEvent(t);this.options.movable&&this.startTranslating(e);const n=this.getCellViewFromElem(e.target);this.setEventData(e,{activeView:n});const i=this.graph.snapToGrid(e.clientX,e.clientY);this.notifyBoxEvent("box:mousedown",e,i.x,i.y),this.delegateDocumentEvents(_S.documentEvents,e.data)}startTranslating(t){this.graph.model.startBatch("move-selection");const e=this.graph.snapToGrid(t.clientX,t.clientY);this.setEventData(t,{action:"translating",clientX:e.x,clientY:e.y,originX:e.x,originY:e.y})}getSelectionOffset(t,e){let n=t.x-e.clientX,i=t.y-e.clientY;const r=this.graph.hook.getRestrictArea();if(r){const s=this.collection.toArray(),o=OM.getCellsBBox(s,{deep:!0})||db.create(),a=r.x-o.x,l=r.y-o.y,c=r.x+r.width-(o.x+o.width),h=r.y+r.height-(o.y+o.height);if(n<a&&(n=a),i<l&&(i=l),c<n&&(n=c),h<i&&(i=h),!this.options.following){const r=t.x-e.originX,s=t.y-e.originY;n=r<=a||r>=c?0:n,i=s<=l||s>=h?0:i}}return{dx:n,dy:i}}updateSelectedNodesPosition(t){const{dx:e,dy:n}=t;if(e||n)if(this.translateSelectedNodes(e,n),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const t=this.graph.transform.getScale();this.$boxes.add(this.$selectionContainer).css({left:"+="+e*t.sx,top:"+="+n*t.sy})}}autoScrollGraph(t,e){const n=this.graph.scroller.widget;return n?n.autoScroll(t,e):{scrollerX:0,scrollerY:0}}adjustSelection(t){const e=this.normalizeEvent(t),n=this.getEventData(e),i=n.action;switch(i){case"selecting":{const t=n;!0!==t.moving&&(this.$container.appendTo(this.graph.container),this.showRubberband(),t.moving=!0);const{scrollerX:i,scrollerY:r}=this.autoScrollGraph(e.clientX,e.clientY);t.scrollerX+=i,t.scrollerY+=r;const s=e.clientX-t.clientX+t.scrollerX,o=e.clientY-t.clientY+t.scrollerY,a=parseInt(this.$container.css("left"),10),l=parseInt(this.$container.css("top"),10);this.$container.css({left:s<0?t.offsetX+s:a,top:o<0?t.offsetY+o:l,width:Math.abs(s),height:Math.abs(o)});break}case"translating":{const i=this.graph.snapToGrid(e.clientX,e.clientY),r=n,s=this.getSelectionOffset(i,r);this.options.following?this.updateSelectedNodesPosition(s):this.updateContainerPosition(s),s.dx&&(r.clientX=i.x),s.dy&&(r.clientY=i.y),this.notifyBoxEvent("box:mousemove",t,i.x,i.y);break}default:break}this.boxesUpdated=!1}translateSelectedNodes(t,e,n,i){const r={},s=[];if(n&&(r[n.id]=!0),this.collection.toArray().forEach((t=>{t.getDescendants({deep:!0}).forEach((t=>{r[t.id]=!0}))})),i&&i.translateBy){const t=this.graph.getCellById(i.translateBy);t&&(r[t.id]=!0,t.getDescendants({deep:!0}).forEach((t=>{r[t.id]=!0})),s.push(t))}this.collection.toArray().forEach((n=>{if(!r[n.id]){const o=Object.assign(Object.assign({},i),{selection:this.cid,exclude:s});n.translate(t,e,o),this.graph.model.getConnectedEdges(n).forEach((n=>{r[n.id]||(n.translate(t,e,o),r[n.id]=!0)}))}}))}getCellViewsInArea(t){const e=this.graph,n={strict:this.options.strict};let i=[];return this.options.rubberNode&&(i=this.options.useCellGeometry?i.concat(e.model.getNodesInArea(t,n).map((t=>e.renderer.findViewByCell(t))).filter((t=>null!=t))):i.concat(e.renderer.findViewsInArea(t,n))),this.options.rubberEdge&&(i=this.options.useCellGeometry?i.concat(e.model.getEdgesInArea(t,n).map((t=>e.renderer.findViewByCell(t))).filter((t=>null!=t))):i.concat(e.renderer.findEdgeViewsInArea(t,n))),i}notifyBoxEvent(t,e,n,i){const r=this.getEventData(e),s=r.activeView;this.trigger(t,{e:e,view:s,x:n,y:i,cell:s.cell})}getSelectedClassName(t){return this.prefixClassName((t.isNode()?"node":"edge")+"-selected")}addCellSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.addClass(this.getSelectedClassName(t))}removeCellUnSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.removeClass(this.getSelectedClassName(t))}destroySelectionBox(t){this.removeCellUnSelectedClassName(t),this.canShowSelectionBox(t)&&(this.$container.find(`[data-cell-id="${t.id}"]`).remove(),0===this.$boxes.length&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(t){t.forEach((t=>this.removeCellUnSelectedClassName(t))),this.hide(),this.$boxes.remove(),this.boxCount=0}hide(){this.$container.removeClass(this.prefixClassName(_S.classNames.rubberband)).removeClass(this.prefixClassName(_S.classNames.selected))}showRubberband(){this.$container.addClass(this.prefixClassName(_S.classNames.rubberband))}hideRubberband(){this.$container.removeClass(this.prefixClassName(_S.classNames.rubberband))}showSelected(){this.$container.removeAttr("style").addClass(this.prefixClassName(_S.classNames.selected))}createContainer(){this.container=document.createElement("div"),this.$container=this.$(this.container),this.$container.addClass(this.prefixClassName(_S.classNames.root)),this.options.className&&this.$container.addClass(this.options.className),this.$selectionContainer=this.$("<div/>").addClass(this.prefixClassName(_S.classNames.inner)),this.$selectionContent=this.$("<div/>").addClass(this.prefixClassName(_S.classNames.content)),this.$selectionContainer.append(this.$selectionContent),this.$selectionContainer.attr("data-selection-length",this.collection.length),this.$container.prepend(this.$selectionContainer),this.$handleContainer=this.$selectionContainer}updateContainerPosition(t){(t.dx||t.dy)&&this.$selectionContainer.css({left:`+=${t.dx}`,top:`+=${t.dy}`})}updateContainer(){const t={x:1/0,y:1/0},e={x:0,y:0},n=this.collection.toArray().filter((t=>this.canShowSelectionBox(t)));n.forEach((n=>{const i=this.graph.renderer.findViewByCell(n);if(i){const n=i.getBBox({useCellGeometry:this.options.useCellGeometry});t.x=Math.min(t.x,n.x),t.y=Math.min(t.y,n.y),e.x=Math.max(e.x,n.x+n.width),e.y=Math.max(e.y,n.y+n.height)}})),this.$selectionContainer.css({position:"absolute",pointerEvents:"none",left:t.x,top:t.y,width:e.x-t.x,height:e.y-t.y}).attr("data-selection-length",this.collection.length);const i=this.options.content;if(i)if("function"===typeof i){const t=ey(i,this.graph,this,this.$selectionContent[0]);t&&this.$selectionContent.html(t)}else this.$selectionContent.html(i);this.collection.length>0&&!this.container.parentNode?this.$container.appendTo(this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(t){return t.isNode()&&!0===this.options.showNodeSelectionBox||t.isEdge()&&!0===this.options.showEdgeSelectionBox}createSelectionBox(t){if(this.addCellSelectedClassName(t),this.canShowSelectionBox(t)){const e=this.graph.renderer.findViewByCell(t);if(e){const n=e.getBBox({useCellGeometry:this.options.useCellGeometry}),i=this.boxClassName;this.$("<div/>").addClass(i).addClass(`${i}-${t.isNode()?"node":"edge"}`).attr("data-cell-id",t.id).css({position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:this.options.pointerEvents||"auto"}).appendTo(this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(t={}){this.collection.length>0&&(this.boxesUpdated=!0,this.graph.renderer.requestViewUpdate(this,1,2,t))}confirmUpdate(){return this.boxCount&&(this.hide(),this.$boxes.each(((t,e)=>{const n=this.$(e).remove().attr("data-cell-id"),i=this.collection.get(n);i&&this.createSelectionBox(i)})),this.updateContainer()),0}getCellViewFromElem(t){const e=t.getAttribute("data-cell-id");if(e){const t=this.collection.get(e);if(t)return this.graph.renderer.findViewByCell(t)}return null}onCellRemoved({cell:t}){this.destroySelectionBox(t),this.updateContainer()}onReseted({previous:t,current:e}){this.destroyAllSelectionBoxes(t),e.forEach((t=>{this.listenCellRemoveEvent(t),this.createSelectionBox(t)})),this.updateContainer()}onCellAdded({cell:t}){this.listenCellRemoveEvent(t),this.createSelectionBox(t),this.updateContainer()}listenCellRemoveEvent(t){t.off("removed",this.onCellRemoved,this),t.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:t,removed:e,options:n}){t.forEach((t=>{this.trigger("cell:selected",{cell:t,options:n}),this.graph.trigger("cell:selected",{cell:t,options:n}),t.isNode()?(this.trigger("node:selected",{cell:t,options:n,node:t}),this.graph.trigger("node:selected",{cell:t,options:n,node:t})):t.isEdge()&&(this.trigger("edge:selected",{cell:t,options:n,edge:t}),this.graph.trigger("edge:selected",{cell:t,options:n,edge:t}))})),e.forEach((t=>{this.trigger("cell:unselected",{cell:t,options:n}),this.graph.trigger("cell:unselected",{cell:t,options:n}),t.isNode()?(this.trigger("node:unselected",{cell:t,options:n,node:t}),this.graph.trigger("node:unselected",{cell:t,options:n,node:t})):t.isEdge()&&(this.trigger("edge:unselected",{cell:t,options:n,edge:t}),this.graph.trigger("edge:unselected",{cell:t,options:n,edge:t}))}));const i={added:t,removed:e,options:n,selected:this.cells};this.trigger("selection:changed",i),this.graph.trigger("selection:changed",i)}deleteSelectedCells(){const t=this.collection.toArray();this.clean(),this.graph.model.removeCells(t,{selection:this.cid})}startRotate({e:t}){const e=this.collection.toArray(),n=OM.getCellsBBox(e).getCenter(),i=this.graph.snapToGrid(t.clientX,t.clientY),r=e.reduce(((t,e)=>(t[e.id]=ib.normalize(e.getAngle()),t)),{});this.setEventData(t,{center:n,angles:r,start:i.theta(n)})}doRotate({e:t}){const e=this.getEventData(t),n=this.graph.options.rotating.grid,i="function"===typeof n?ey(n,this.graph,null):n,r=this.graph.snapToGrid(t.clientX,t.clientY),s=e.start-r.theta(e.center);e.rotated||(e.rotated=!0),Math.abs(s)>.001&&(this.collection.toArray().forEach((t=>{const n=QC.snapToGrid(e.angles[t.id]+s,i||15);t.rotate(n,{absolute:!0,center:e.center,selection:this.cid})})),this.updateSelectionBoxes())}stopRotate({e:t}){const e=this.getEventData(t);e.rotated&&(e.rotated=!1,this.collection.toArray().forEach((e=>{VS("node:rotated",t,this.graph.findViewByCell(e))})))}startResize({e:t}){const e=this.graph.getGridSize(),n=this.collection.toArray(),i=OM.getCellsBBox(n),r=n.map((t=>t.getBBox())),s=r.reduce(((t,e)=>e.width<t?e.width:t),1/0),o=r.reduce(((t,e)=>e.height<t?e.height:t),1/0);this.setEventData(t,{bbox:i,cells:this.graph.model.getSubGraph(n),minWidth:e*i.width/s,minHeight:e*i.height/o})}doResize({e:t,dx:e,dy:n}){const i=this.eventData(t),r=i.bbox,s=r.width,o=r.height,a=Math.max(s+e,i.minWidth),l=Math.max(o+n,i.minHeight);i.resized||(i.resized=!0),(Math.abs(s-a)>.001||Math.abs(o-l)>.001)&&(this.graph.model.resizeCells(a,l,i.cells,{selection:this.cid}),r.width=a,r.height=l,this.updateSelectionBoxes())}stopResize({e:t}){const e=this.eventData(t);e.resized&&(e.resized=!1,this.collection.toArray().forEach((e=>{VS("node:resized",t,this.graph.findViewByCell(e))})))}dispose(){this.clean(),this.remove()}}HS([eE.dispose()],US.prototype,"dispose",null),bd(US,wS),function(t){const e="widget-selection";function n(t){return t.getAncestors().length}t.classNames={root:e,inner:`${e}-inner`,box:`${e}-box`,content:`${e}-content`,rubberband:`${e}-rubberband`,selected:`${e}-selected`},t.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.defaultOptions={movable:!0,following:!0,strict:!1,useCellGeometry:!1,content(t){return Hg('<%= length %> node<%= length > 1 ? "s":"" %> selected.')({length:t.length})},handles:[{name:"remove",position:"nw",events:{mousedown:"deleteSelectedCells"}},{name:"rotate",position:"sw",events:{mousedown:"startRotate",mousemove:"doRotate",mouseup:"stopRotate"}},{name:"resize",position:"se",events:{mousedown:"startResize",mousemove:"doResize",mouseup:"stopResize"}}]},t.depthComparator=n}(_S||(_S={}));class WS extends kS{get node(){return this.cell}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}init(t){this.options=Object.assign(Object.assign({},GS.defaultOptions),t),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this),super.startListening()}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this),super.stopListening()}renderHandles(){this.container=document.createElement("div"),this.$container=this.$(this.container);const t=this.$("<div/>").prop("draggable",!1),e=t.clone().addClass(this.rotateClassName),n=GS.POSITIONS.map((e=>t.clone().addClass(this.resizeClassName).attr("data-position",e)));this.empty(),this.$container.append(n,e)}render(){return this.renderHandles(),this.view.addClass(GS.NODE_CLS),this.$container.addClass(this.containerClassName).toggleClass("no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing).toggleClass("no-resize",!this.options.resizable).toggleClass("no-rotate",!this.options.rotatable),this.options.className&&this.$container.addClass(this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const t=this.graph.matrix(),e=this.node.getBBox();e.x*=t.a,e.x+=t.e,e.y*=t.d,e.y+=t.f,e.width*=t.a,e.height*=t.d;const n=ib.normalize(this.node.getAngle()),i=0!==n?`rotate(${n}deg)`:"";return this.$container.css({transform:i,width:e.width,height:e.height,left:e.x,top:e.y}),this.updateResizerDirections(),this}remove(){return this.view.removeClass(GS.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const t=ib.normalize(this.node.getAngle()),e=Math.floor(t*(GS.DIRECTIONS.length/360));if(e!==this.prevShift){const t=GS.DIRECTIONS.slice(e).concat(GS.DIRECTIONS.slice(0,e)),n=t=>`${this.containerClassName}-cursor-${t}`;this.$container.find(`.${this.resizeClassName}`).removeClass(GS.DIRECTIONS.map((t=>n(t))).join(" ")).each(((e,i)=>{this.$(i).addClass(n(t[e]))})),this.prevShift=e}}getTrueDirection(t){const e=ib.normalize(this.node.getAngle());let n=GS.POSITIONS.indexOf(t);return n+=Math.floor(e*(GS.POSITIONS.length/360)),n%=GS.POSITIONS.length,GS.POSITIONS[n]}toValidResizeDirection(t){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[t]||t}startResizing(t){t.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const e=this.$(t.target).attr("data-position"),n=this.graph.findViewByCell(this.node);this.prepareResizing(t,e),this.startAction(t),VS("node:resize:mousedown",t,n)}prepareResizing(t,e){const n=this.getTrueDirection(e);let i=0,r=0;e.split("-").forEach((t=>{i={left:-1,right:1}[t]||i,r={top:-1,bottom:1}[t]||r}));const s=this.toValidResizeDirection(e),o={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[s],a=ib.normalize(this.node.getAngle());this.setEventData(t,{selector:o,direction:s,trueDirection:n,relativeDirection:e,angle:a,resizeX:i,resizeY:r,action:"resizing"})}startRotating(t){t.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const e=this.graph.findViewByCell(this.node),n=this.node.getBBox().getCenter(),i=this.normalizeEvent(t),r=this.graph.snapToGrid(i.clientX,i.clientY);this.setEventData(t,{center:n,action:"rotating",angle:ib.normalize(this.node.getAngle()),start:ub.create(r).theta(n)}),this.startAction(t),VS("node:rotate:mousedown",t,e)}onMouseMove(t){const e=this.graph.findViewByCell(this.node);let n=this.getEventData(t);if(n.action){const i=this.normalizeEvent(t);let r=i.clientX,s=i.clientY;const o=this.graph.scroller.widget,a=this.options.restrictedResizing;if(!0===a||"number"===typeof a){const t=!0===a?0:a,e=o?Math.max(t,8):t,n=this.graph.container.getBoundingClientRect();r=Rm(r,n.left+e,n.right-e),s=Rm(s,n.top+e,n.bottom-e)}else this.options.autoScrollOnResizing&&o&&o.autoScroll(r,s);const l=this.graph.snapToGrid(r,s),c=this.graph.getGridSize(),h=this.node,u=this.options;if("resizing"===n.action){n=n,n.resized||(e&&(e.addClass("node-resizing"),VS("node:resize",t,e)),n.resized=!0);const i=h.getBBox(),r=ub.create(l).rotate(n.angle,i.getCenter()).diff(i[n.selector]);let s=n.resizeX?r.x*n.resizeX:i.width,o=n.resizeY?r.y*n.resizeY:i.height;const a=s,d=o;if(s=QC.snapToGrid(s,c),o=QC.snapToGrid(o,c),s=Math.max(s,u.minWidth||c),o=Math.max(o,u.minHeight||c),s=Math.min(s,u.maxWidth||1/0),o=Math.min(o,u.maxHeight||1/0),u.preserveAspectRatio){const t=i.width*o/i.height,e=i.height*s/i.width;s<t?o=e:s=t}const p=n.relativeDirection;if(u.allowReverse&&(a<=-s||d<=-o)){let e;"left"===p?a<=-s&&(e="right"):"right"===p?a<=-s&&(e="left"):"top"===p?d<=-o&&(e="bottom"):"bottom"===p?d<=-o&&(e="top"):"top-left"===p?a<=-s&&d<=-o?e="bottom-right":a<=-s?e="top-right":d<=-o&&(e="bottom-left"):"top-right"===p?a<=-s&&d<=-o?e="bottom-left":a<=-s?e="top-left":d<=-o&&(e="bottom-right"):"bottom-left"===p?a<=-s&&d<=-o?e="top-right":a<=-s?e="bottom-right":d<=-o&&(e="top-left"):"bottom-right"===p&&(a<=-s&&d<=-o?e="top-left":a<=-s?e="bottom-left":d<=-o&&(e="top-right"));const n=e;this.stopHandle();const i=this.$container.find(`.${this.resizeClassName}[data-position="${n}"]`);this.startHandle(i[0]),this.prepareResizing(t,n),this.onMouseMove(t)}if(i.width!==s||i.height!==o){const i={ui:!0,direction:n.direction,relativeDirection:n.relativeDirection,trueDirection:n.trueDirection,minWidth:u.minWidth,minHeight:u.minHeight,maxWidth:u.maxWidth,maxHeight:u.maxHeight,preserveAspectRatio:!0===u.preserveAspectRatio};h.resize(s,o,i),VS("node:resizing",t,e)}VS("node:resize:mousemove",t,e)}else if("rotating"===n.action){n=n,n.rotated||(e&&(e.addClass("node-rotating"),VS("node:rotate",t,e)),n.rotated=!0);const i=h.getAngle(),r=n.start-ub.create(l).theta(n.center);let s=n.angle+r;u.rotateGrid&&(s=QC.snapToGrid(s,u.rotateGrid)),i!==s&&(h.rotate(s,{absolute:!0}),VS("node:rotating",t,e)),VS("node:rotate:mousemove",t,e)}}}onMouseUp(t){const e=this.graph.findViewByCell(this.node),n=this.getEventData(t);n.action&&(this.stopAction(t),this.model.stopBatch("resizing"===n.action?"resize":"rotate",{cid:this.cid}),"resizing"===n.action?VS("node:resize:mouseup",t,e):"rotating"===n.action&&VS("node:rotate:mouseup",t,e))}startHandle(t){if(this.handle=t||null,this.$container.addClass(`${this.containerClassName}-active`),t){this.$(t).addClass(`${this.containerClassName}-active-handle`);const e=t.getAttribute("data-position");if(e){const t=GS.DIRECTIONS[GS.POSITIONS.indexOf(e)];this.$container.addClass(`${this.containerClassName}-cursor-${t}`)}}}stopHandle(){if(this.$container.removeClass(`${this.containerClassName}-active`),this.handle){this.$(this.handle).removeClass(`${this.containerClassName}-active-handle`);const t=this.handle.getAttribute("data-position");if(t){const e=GS.DIRECTIONS[GS.POSITIONS.indexOf(t)];this.$container.removeClass(`${this.containerClassName}-cursor-${e}`)}this.handle=null}}startAction(t){this.startHandle(t.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(GS.documentEvents,t.data)}stopAction(t){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.graph.findViewByCell(this.node),n=this.getEventData(t);e&&(e.removeClass(`node-${n.action}`),"resizing"===n.action&&n.resized?VS("node:resized",t,e):"rotating"===n.action&&n.rotated&&VS("node:rotated",t,e))}}(function(t){t.NODE_CLS="has-widget-transform",t.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],t.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},t.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}})(GS||(GS={}));var qS,XS=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};(function(t){function e(t,e,n){const i={};return Object.keys(n||{}).forEach((r=>{const s=n[r];i[r]="function"===typeof s?s.call(t,e):s})),i}t.parseOptionGroup=e})(qS||(qS={})),function(t){function e(e){const{grid:n,panning:i,selecting:r,embedding:s,snapline:o,resizing:a,rotating:l,knob:c,clipboard:h,history:u,scroller:d,minimap:p,keyboard:g,mousewheel:f}=e,m=XS(e,["grid","panning","selecting","embedding","snapline","resizing","rotating","knob","clipboard","history","scroller","minimap","keyboard","mousewheel"]),y=e.container;if(null==y)throw new Error("Ensure the container of the graph is specified and valid");null==m.width&&(m.width=y.clientWidth),null==m.height&&(m.height=y.clientHeight);const b=ah({},t.defaults,m),v={size:10,visible:!1};b.grid="number"===typeof n?{size:n,visible:!1}:"boolean"===typeof n?Object.assign(Object.assign({},v),{visible:n}):Object.assign(Object.assign({},v),n);const w=["panning","selecting","embedding","snapline","resizing","rotating","knob","clipboard","history","scroller","minimap","keyboard","mousewheel"];return w.forEach((t=>{const n=e[t];"boolean"===typeof n?b[t].enabled=n:b[t]=Object.assign(Object.assign({},b[t]),n)})),b.background&&b.scroller.enabled&&null==b.scroller.background&&(b.scroller.background=b.background,delete b.background),b}t.get=e}(qS||(qS={})),function(t){t.defaults={x:0,y:0,grid:{size:10,visible:!1},scaling:{min:.01,max:16},background:!1,highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:QC.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:QC.prefix("available-magnet")}}},connecting:{snap:!1,multi:!0,dangling:!0,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",strategy:null,router:"normal",connector:"normal",validateConnection({type:t,sourceView:e,targetView:n}){const i="target"===t?n:e;return null!=i},createEdge(){return new aS}},transforming:{clearAll:!0,clearOnBlankMouseDown:!0},resizing:{enabled:!1,minWidth:0,minHeight:0,maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,orthogonal:!0,restricted:!1,autoScroll:!0,preserveAspectRatio:!1,allowReverse:!0},rotating:{enabled:!1,grid:15},translating:{restrict:!1},knob:{enabled:!1,clearAll:!0,clearOnBlankMouseDown:!0},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},selecting:{enabled:!1,rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,movable:!0,strict:!1,useCellGeometry:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,content:null,handles:null},panning:{enabled:!1,eventTypes:["leftMouseDown"]},snapline:{enabled:!1},clipboard:{enabled:!1},history:{enabled:!1},scroller:{enabled:!1},keyboard:{enabled:!1},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},async:!1,frozen:!1,sorting:"exact",moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},guard:()=>!1}}(qS||(qS={}));var YS=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class JS extends uS{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(t){return null!=this.svg.getElementById(t)}filter(t){let e=t.id;const n=t.name;if(e||(e=`filter-${n}-${this.cid}-${Dm(JSON.stringify(t))}`),!this.isDefined(e)){const i=WC.registry.get(n);if(null==i)return WC.registry.onNotFound(n);const r=i(t.args||{}),s=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},t.attrs),{id:e});Rb.create(hE.sanitize(r),s).appendTo(this.defs)}return e}gradient(t){let e=t.id;const n=t.type;if(e||(e=`gradient-${n}-${this.cid}-${Dm(JSON.stringify(t))}`),!this.isDefined(e)){const i=t.stops,r=i.map((t=>{const e=null!=t.opacity&&Number.isFinite(t.opacity)?t.opacity:1;return`<stop offset="${t.offset}" stop-color="${t.color}" stop-opacity="${e}"/>`})),s=`<${n}>${r.join("")}</${n}>`,o=Object.assign({id:e},t.attrs);Rb.create(s,o).appendTo(this.defs)}return e}marker(t){const{id:e,refX:n,refY:i,markerUnits:r,markerOrient:s,tagName:o,children:a}=t,l=YS(t,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let c=e;if(c||(c=`marker-${this.cid}-${Dm(JSON.stringify(t))}`),!this.isDefined(c)){"path"!==o&&delete l.d;const t=Rb.create("marker",{refX:n,refY:i,id:c,overflow:"visible",orient:null!=s?s:"auto",markerUnits:r||"userSpaceOnUse"},a?a.map((t=>{var{tagName:e}=t,n=YS(t,["tagName"]);return Rb.create(`${e}`||"path",Hy(Object.assign(Object.assign({},l),n)))})):[Rb.create(o||"path",Hy(l))]);this.defs.appendChild(t.node)}return c}remove(t){const e=this.svg.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}}var ZS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},KS=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class QS extends uS{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(t){this.grid.visible!==t&&(this.grid.visible=t,this.update())}getGridSize(){return this.grid.size}setGridSize(t){this.grid.size=Math.max(t,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(t){this.clear(),this.instance=null,Object.assign(this.grid,t),this.patterns=this.resolveGrid(t),this.update()}update(t={}){const e=this.grid.size;if(e<=1||!this.grid.visible)return this.clear();const n=this.graph.matrix(),i=this.getInstance(),r=Array.isArray(t)?t:[t];this.patterns.forEach(((t,s)=>{const o=`pattern_${s}`,a=n.a||1,l=n.d||1,{update:c,markup:h}=t,u=KS(t,["update","markup"]),d=Object.assign(Object.assign(Object.assign({},u),r[s]),{sx:a,sy:l,ox:n.e||0,oy:n.f||0,width:e*a,height:e*l});i.has(o)||i.add(o,Rb.create("pattern",{id:o,patternUnits:"userSpaceOnUse"},Rb.createVectors(h)).node);const p=i.get(o);"function"===typeof c&&c(p.childNodes[0],d);let g=d.ox%d.width;g<0&&(g+=d.width);let f=d.oy%d.height;f<0&&(f+=d.height),_y(p,{x:g,y:f,width:d.width,height:d.height})}));const s=(new XMLSerializer).serializeToString(i.root),o=`url(data:image/svg+xml;base64,${btoa(s)})`;this.elem.style.backgroundImage=o}getInstance(){return this.instance||(this.instance=new NC),this.instance}resolveGrid(t){if(!t)return[];const e=t.type;if(null==e)return[Object.assign(Object.assign({},NC.presets.dot),t.args)];const n=NC.registry.get(e);if(n){let e=t.args||[];return Array.isArray(e)||(e=[e]),Array.isArray(n)?n.map(((t,n)=>Object.assign(Object.assign({},t),e[n]))):[Object.assign(Object.assign({},n),e[0])]}return NC.registry.onNotFound(e)}dispose(){this.stopListening(),this.clear()}}ZS([uS.dispose()],QS.prototype,"dispose",null);class tA extends uS{getClientMatrix(){return dv(this.view.stage.getScreenCTM())}getClientOffset(){const t=this.view.svg.getBoundingClientRect();return new ub(t.left,t.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(t,e){const n="number"===typeof t?this.clientToLocalPoint(t,e):this.clientToLocalPoint(t.x,t.y);return n.snapToGrid(this.graph.getGridSize())}localToGraphPoint(t,e){const n=ub.create(t,e);return xv(n,this.graph.matrix())}localToClientPoint(t,e){const n=ub.create(t,e);return xv(n,this.getClientMatrix())}localToPagePoint(t,e){const n="number"===typeof t?this.localToGraphPoint(t,e):this.localToGraphPoint(t);return n.translate(this.getPageOffset())}localToGraphRect(t,e,n,i){const r=db.create(t,e,n,i);return kv(r,this.graph.matrix())}localToClientRect(t,e,n,i){const r=db.create(t,e,n,i);return kv(r,this.getClientMatrix())}localToPageRect(t,e,n,i){const r="number"===typeof t?this.localToGraphRect(t,e,n,i):this.localToGraphRect(t);return r.translate(this.getPageOffset())}graphToLocalPoint(t,e){const n=ub.create(t,e);return xv(n,this.graph.matrix().inverse())}clientToLocalPoint(t,e){const n=ub.create(t,e);return xv(n,this.getClientMatrix().inverse())}clientToGraphPoint(t,e){const n=ub.create(t,e);return xv(n,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(t,e){const n=ub.create(t,e),i=n.diff(this.getPageOffset());return this.graphToLocalPoint(i)}graphToLocalRect(t,e,n,i){const r=db.create(t,e,n,i);return kv(r,this.graph.matrix().inverse())}clientToLocalRect(t,e,n,i){const r=db.create(t,e,n,i);return kv(r,this.getClientMatrix().inverse())}clientToGraphRect(t,e,n,i){const r=db.create(t,e,n,i);return kv(r,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(t,e,n,i){const r=db.create(t,e,n,i),s=this.getPageOffset();return r.x-=s.x,r.y-=s.y,this.graphToLocalRect(r)}}var eA,nA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class iA extends uS{constructor(){super(...arguments),this.widget=this.graph.hook.createSnapline()}dispose(){this.widget.dispose()}}nA([uS.dispose()],iA.prototype,"dispose",null),function(t){function e(t){const e=[],n=[];return Array.isArray(t)?e.push(...t):t.split("|").forEach((t=>{-1===t.indexOf("&")?e.push(t):n.push(...t.split("&"))})),{or:e,and:n}}function n(t,n){if(null!=t&&null!=n){const i=e(t),r=e(n),s=i.or.sort(),o=r.or.sort(),a=i.and.sort(),l=r.and.sort(),c=(t,e)=>t.length===e.length&&(0===t.length||t.every(((t,n)=>t===e[n])));return c(s,o)&&c(a,l)}return null==t&&null==n}function i(t,n,i){if(null==n||Array.isArray(n)&&0===n.length)return!i||!0!==t.altKey&&!0!==t.ctrlKey&&!0!==t.metaKey&&!0!==t.shiftKey;const{or:r,and:s}=e(n),o=e=>{const n=`${e.toLowerCase()}Key`;return!0===t[n]};return r.some((t=>o(t)))&&s.every((t=>o(t)))}t.parse=e,t.equals=n,t.isMatch=i}(eA||(eA={}));var rA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class sA extends uS{get widgetOptions(){return this.options.scroller}get pannable(){return!!this.widgetOptions&&("object"===typeof this.widgetOptions.pannable?this.widgetOptions.pannable.enabled:!!this.widgetOptions.pannable)}init(){this.widget=this.graph.hook.createScroller(),this.startListening(),this.updateClassName(),this.widget&&this.widget.center()}startListening(){let t=[];const e=this.widgetOptions.pannable;t="object"===typeof e?e.eventTypes||[]:["leftMouseDown"],t.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),this.view.$(this.widget.container).on("mousedown",this.onRightMouseDown))}stopListening(){let t=[];const e=this.widgetOptions.pannable;t="object"===typeof e?e.eventTypes||[]:["leftMouseDown"],t.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&this.view.$(this.widget.container).off("mousedown",this.onRightMouseDown)}onRightMouseDown(t){2===t.button&&this.allowPanning(t,!0)&&this.widget&&(this.updateClassName(!0),this.widget.startPanning(t),this.widget.once("pan:stop",(()=>this.updateClassName(!1))))}preparePanning({e:t}){this.widget&&(this.allowPanning(t,!0)||this.allowPanning(t)&&!this.graph.selection.allowRubberband(t,!0))&&(this.updateClassName(!0),this.widget.startPanning(t),this.widget.once("pan:stop",(()=>this.updateClassName(!1))))}allowPanning(t,e){return this.widget&&this.pannable&&eA.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowPanning(t)}updateClassName(t){if(null==this.widget)return;const e=this.widget.container,n=this.view.prefixClassName("graph-scroller-pannable");this.pannable?(uy(e,n),e.dataset.panning=(!!t).toString()):dy(e,n)}enablePanning(){this.pannable||(this.widgetOptions.pannable=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.pannable=!1,this.updateClassName())}lock(){this.widget&&this.widget.lock()}unlock(){this.widget&&this.widget.unlock()}update(){this.widget&&this.widget.update()}enableAutoResize(){this.widget&&this.widget.enableAutoResize()}disableAutoResize(){this.widget&&this.widget.disableAutoResize()}resize(t,e){this.widget&&this.widget.resize(t,e)}dispose(){this.widget&&this.widget.dispose(),this.stopListening()}}rA([uS.dispose()],sA.prototype,"dispose",null);var oA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},aA=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class lA extends uS{get commonOptions(){const t=this.instanceOptions,{enabled:e}=t,n=aA(t,["enabled"]);return n}get instanceOptions(){return this.options.clipboard}get cells(){return this.widget.cells}get disabled(){return!0!==this.instanceOptions.enabled}init(){this.widget=this.graph.hook.createClipboard(),this.widget.deserialize(this.instanceOptions)}enable(){this.disabled&&(this.instanceOptions.enabled=!0)}disable(){this.disabled||(this.instanceOptions.enabled=!1)}copy(t,e={}){this.disabled||this.widget.copy(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e))}cut(t,e={}){this.disabled||this.widget.cut(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e))}paste(t={},e=this.graph){return this.disabled?[]:this.widget.paste(e,Object.assign(Object.assign({},this.commonOptions),t))}clean(t){this.disabled&&!t||this.widget.clean()}isEmpty(){return this.widget.isEmpty()}dispose(){this.clean(!0)}}oA([uS.dispose()],lA.prototype,"dispose",null);var cA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class hA extends uS{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:t,magnet:e,options:n={}}){const i=this.resolveHighlighter(n);if(!i)return;const r=this.getHighlighterId(e,i);if(!this.highlights[r]){const n=i.highlighter;n.highlight(t,e,Object.assign({},i.args)),this.highlights[r]={cellView:t,magnet:e,highlighter:n,args:i.args}}}onCellUnhighlight({magnet:t,options:e={}}){const n=this.resolveHighlighter(e);if(!n)return;const i=this.getHighlighterId(t,n);this.unhighlight(i)}resolveHighlighter(t){const e=this.options;let n=t.highlighter;if(null==n){const i=t.type;n=i&&e.highlighting[i]||e.highlighting.default}if(null==n)return null;const i="string"===typeof n?{name:n}:n,r=i.name,s=ax.registry.get(r);return null==s?ax.registry.onNotFound(r):(ax.check(r,s),{name:r,highlighter:s,args:i.args||{}})}getHighlighterId(t,e){return my(t),e.name+t.id+JSON.stringify(e.args)}unhighlight(t){const e=this.highlights[t];e&&(e.highlighter.unhighlight(e.cellView,e.magnet,e.args),delete this.highlights[t])}dispose(){Object.keys(this.highlights).forEach((t=>this.unhighlight(t))),this.stopListening()}}cA([hA.dispose()],hA.prototype,"dispose",null);var uA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class dA extends uS{constructor(){super(...arguments),this.widgets=new Map}get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get isSelectionEnabled(){return!0===this.options.selecting.enabled}init(){this.startListening(),this.resize()}startListening(){this.graph.on("node:mouseup",this.onNodeMouseUp,this),this.graph.on("node:selected",this.onNodeSelected,this),this.graph.on("node:unselected",this.onNodeUnSelected,this)}stopListening(){this.graph.off("node:mouseup",this.onNodeMouseUp,this),this.graph.off("node:selected",this.onNodeSelected,this),this.graph.off("node:unselected",this.onNodeUnSelected,this)}onNodeMouseUp({node:t}){if(!this.isSelectionEnabled){const e=this.graph.hook.createTransform(t,{clearAll:!0});e&&this.widgets.set(t,e)}}onNodeSelected({node:t}){if(this.isSelectionEnabled){const e=this.graph.hook.createTransform(t,{clearAll:!1});e&&this.widgets.set(t,e)}}onNodeUnSelected({node:t}){if(this.isSelectionEnabled){const e=this.widgets.get(t);e&&e.dispose(),this.widgets.delete(t)}}getMatrix(){const t=this.viewport.getAttribute("transform");return t!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=t),dv(this.viewportMatrix)}setMatrix(t){const e=dv(t),n=fv(e);this.viewport.setAttribute("transform",n),this.viewportMatrix=e,this.viewportTransformString=n}resize(t,e){let n=void 0===t?this.options.width:t,i=void 0===e?this.options.height:e;this.options.width=n,this.options.height=i,"number"===typeof n&&(n=Math.round(n)),"number"===typeof i&&(i=Math.round(i)),this.container.style.width=null==n?"":`${n}px`,this.container.style.height=null==i?"":`${i}px`;const r=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},r)),this}getComputedSize(){let t=this.options.width,e=this.options.height;return Fm(t)||(t=this.container.clientWidth),Fm(e)||(e=this.container.clientHeight),{width:t,height:e}}getScale(){return vv(this.getMatrix())}scale(t,e=t,n=0,i=0){if(t=this.clampScale(t),e=this.clampScale(e),n||i){const r=this.getTranslation(),s=r.tx-n*(t-1),o=r.ty-i*(e-1);s===r.tx&&o===r.ty||this.translate(s,o)}const r=this.getMatrix();return r.a=t,r.d=e,this.setMatrix(r),this.graph.trigger("scale",{sx:t,sy:e,ox:n,oy:i}),this}clampScale(t){const e=this.graph.options.scaling;return Rm(t,e.min||.01,e.max||16)}getZoom(){return this.getScale().sx}zoom(t,e){e=e||{};let n=t,i=t;const r=this.getScale(),s=this.getComputedSize();let o=s.width/2,a=s.height/2;if(e.absolute||(n+=r.sx,i+=r.sy),e.scaleGrid&&(n=Math.round(n/e.scaleGrid)*e.scaleGrid,i=Math.round(i/e.scaleGrid)*e.scaleGrid),e.maxScale&&(n=Math.min(e.maxScale,n),i=Math.min(e.maxScale,i)),e.minScale&&(n=Math.max(e.minScale,n),i=Math.max(e.minScale,i)),e.center&&(o=e.center.x,a=e.center.y),n=this.clampScale(n),i=this.clampScale(i),o||a){const t=this.getTranslation(),e=o-(o-t.tx)*(n/r.sx),s=a-(a-t.ty)*(i/r.sy);e===t.tx&&s===t.ty||this.translate(e,s)}return this.scale(n,i),this}getRotation(){return wv(this.getMatrix())}rotate(t,e,n){if(null==e||null==n){const t=Av(this.graph.view.stage);e=t.width/2,n=t.height/2}const i=this.getMatrix().translate(e,n).rotate(t).translate(-e,-n);return this.setMatrix(i),this}getTranslation(){return Cv(this.getMatrix())}translate(t,e){const n=this.getMatrix();n.e=t||0,n.f=e||0,this.setMatrix(n);const i=this.getTranslation();return this.options.x=i.tx,this.options.y=i.ty,this.graph.trigger("translate",Object.assign({},i)),this}setOrigin(t,e){return this.translate(t||0,e||0)}fitToContent(t,e,n,i){if("object"===typeof t){const r=t;t=r.gridWidth||1,e=r.gridHeight||1,n=r.padding||0,i=r}else t=t||1,e=e||1,n=n||0,null==i&&(i={});const r=Vm(n),s=i.border||0,o=i.contentArea?db.create(i.contentArea):this.getContentArea(i);s>0&&o.inflate(s);const a=this.getScale(),l=this.getTranslation(),c=a.sx,h=a.sy;o.x*=c,o.y*=h,o.width*=c,o.height*=h;let u=Math.max(Math.ceil((o.width+o.x)/t),1)*t,d=Math.max(Math.ceil((o.height+o.y)/e),1)*e,p=0,g=0;("negative"===i.allowNewOrigin&&o.x<0||"positive"===i.allowNewOrigin&&o.x>=0||"any"===i.allowNewOrigin)&&(p=Math.ceil(-o.x/t)*t,p+=r.left,u+=p),("negative"===i.allowNewOrigin&&o.y<0||"positive"===i.allowNewOrigin&&o.y>=0||"any"===i.allowNewOrigin)&&(g=Math.ceil(-o.y/e)*e,g+=r.top,d+=g),u+=r.right,d+=r.bottom,u=Math.max(u,i.minWidth||0),d=Math.max(d,i.minHeight||0),u=Math.min(u,i.maxWidth||Number.MAX_SAFE_INTEGER),d=Math.min(d,i.maxHeight||Number.MAX_SAFE_INTEGER);const f=this.getComputedSize(),m=u!==f.width||d!==f.height,y=p!==l.tx||g!==l.ty;return y&&this.translate(p,g),m&&this.resize(u,d),new db(-p/c,-g/h,u/c,d/h)}scaleContentToFit(t={}){this.scaleContentToFitImpl(t)}scaleContentToFitImpl(t={},e=!0){let n,i;if(t.contentArea){const e=t.contentArea;n=this.graph.localToGraph(e),i=ub.create(e)}else n=this.getContentBBox(t),i=this.graph.graphToLocal(n);if(!n.width||!n.height)return;const r=Vm(t.padding),s=t.minScale||0,o=t.maxScale||Number.MAX_SAFE_INTEGER,a=t.minScaleX||s,l=t.maxScaleX||o,c=t.minScaleY||s,h=t.maxScaleY||o;let u;if(t.viewportArea)u=t.viewportArea;else{const t=this.getComputedSize(),e=this.getTranslation();u={x:e.tx,y:e.ty,width:t.width,height:t.height}}u=db.create(u).moveAndExpand({x:r.left,y:r.top,width:-r.left-r.right,height:-r.top-r.bottom});const d=this.getScale();let p=u.width/n.width*d.sx,g=u.height/n.height*d.sy;!1!==t.preserveAspectRatio&&(p=g=Math.min(p,g));const f=t.scaleGrid;if(f&&(p=f*Math.floor(p/f),g=f*Math.floor(g/f)),p=Rm(p,a,l),g=Rm(g,c,h),this.scale(p,g),e){const t=this.options,e=u.x-i.x*p-t.x,n=u.y-i.y*g-t.y;this.translate(e,n)}}getContentArea(t={}){return t.useCellGeometry?this.model.getAllCellsBBox()||new db:Av(this.graph.view.stage)}getContentBBox(t={}){return this.graph.localToGraph(this.getContentArea(t))}getGraphArea(){const t=db.fromSize(this.getComputedSize());return this.graph.graphToLocal(t)}zoomToRect(t,e={}){const n=db.create(t),i=this.graph;e.contentArea=n,null==e.viewportArea&&(e.viewportArea={x:i.options.x,y:i.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(e,!1);const r=n.getCenter();return this.centerPoint(r.x,r.y),this}zoomToFit(t={}){return this.zoomToRect(this.getContentArea(t),t)}centerPoint(t,e){const n=this.getComputedSize(),i=this.getScale(),r=this.getTranslation(),s=n.width/2,o=n.height/2;t="number"===typeof t?t:s,e="number"===typeof e?e:o,t=s-t*i.sx,e=o-e*i.sy,r.tx===t&&r.ty===e||this.translate(t,e)}centerContent(t){const e=this.graph.getContentArea(t),n=e.getCenter();this.centerPoint(n.x,n.y)}centerCell(t){return this.positionCell(t,"center")}positionPoint(t,e,n){const i=this.getComputedSize();e=Im(e,Math.max(0,i.width)),e<0&&(e=i.width+e),n=Im(n,Math.max(0,i.height)),n<0&&(n=i.height+n);const r=this.getTranslation(),s=this.getScale(),o=e-t.x*s.sx,a=n-t.y*s.sy;r.tx===o&&r.ty===a||this.translate(o,a)}positionRect(t,e){const n=db.create(t);switch(e){case"center":return this.positionPoint(n.getCenter(),"50%","50%");case"top":return this.positionPoint(n.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(n.getTopRight(),"100%",0);case"right":return this.positionPoint(n.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(n.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(n.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(n.getBottomLeft(),0,"100%");case"left":return this.positionPoint(n.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(n.getTopLeft(),0,0);default:return this}}positionCell(t,e){const n=t.getBBox();return this.positionRect(n,e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t)}dispose(){this.widgets.forEach((t=>t.dispose())),this.widgets.clear(),this.stopListening()}}uA([dA.dispose()],dA.prototype,"dispose",null);var pA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class gA extends uS{constructor(){super(...arguments),this.movedMap=new WeakMap,this.unselectMap=new WeakMap}get widgetOptions(){return this.options.selecting}get rubberbandDisabled(){return!0!==this.widgetOptions.enabled||!0!==this.widgetOptions.rubberband}get disabled(){return!0!==this.widgetOptions.enabled}get length(){return this.widget.length}get cells(){return this.widget.cells}init(){this.widget=this.graph.hook.createSelection(),this.startListening()}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.widget.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.widget.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:t}){(this.allowRubberband(t,!0)||this.allowRubberband(t)&&!this.graph.scroller.allowPanning(t,!0)&&!this.graph.panning.allowPanning(t,!0))&&this.startRubberband(t)}onBlankClick(){this.clean()}allowRubberband(t,e){return!this.rubberbandDisabled&&eA.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowRubberband(t)}onCellMouseMove({cell:t}){this.movedMap.set(t,!0)}onCellMouseUp({e:t,cell:e}){const n=this.widgetOptions;let i=this.disabled;!i&&this.movedMap.has(e)&&(i=!1===n.selectCellOnMoved,i||(i=!1===n.selectNodeOnMoved&&e.isNode()),i||(i=!1===n.selectEdgeOnMoved&&e.isEdge())),i||(!1===n.multiple||!t.ctrlKey&&!t.metaKey?this.reset(e):this.unselectMap.has(e)?this.unselectMap.delete(e):this.isSelected(e)?this.unselect(e):this.select(e)),this.movedMap.delete(e)}onBoxMouseDown({e:t,cell:e}){this.disabled||!1!==this.widgetOptions.multiple&&(t.ctrlKey||t.metaKey)&&(this.unselect(e),this.unselectMap.set(e,!0))}isEmpty(){return this.length<=0}isSelected(t){return this.widget.isSelected(t)}getCells(t){return(Array.isArray(t)?t:[t]).map((t=>"string"===typeof t?this.graph.getCellById(t):t)).filter((t=>null!=t))}select(t,e={}){const n=this.getCells(t);return n.length&&(this.isMultiple()?this.widget.select(n,e):this.reset(n.slice(0,1),e)),this}unselect(t,e={}){return this.widget.unselect(this.getCells(t),e),this}reset(t,e={}){return this.widget.reset(t?this.getCells(t):[],e),this}clean(t={}){return this.widget.clean(t),this}enable(){return this.disabled&&(this.widgetOptions.enabled=!0),this}disable(){return this.disabled||(this.widgetOptions.enabled=!1),this}startRubberband(t){return this.rubberbandDisabled||this.widget.startSelecting(t),this}enableRubberband(){return this.rubberbandDisabled&&(this.widgetOptions.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.widgetOptions.rubberband=!1),this}isMultiple(){return!1!==this.widgetOptions.multiple}enableMultiple(){return this.widgetOptions.multiple=!0,this}disableMultiple(){return this.widgetOptions.multiple=!1,this}setModifiers(t){return this.widgetOptions.modifiers=t,this}setContent(t){return this.widget.setContent(t),this}setFilter(t){return this.widget.setFilter(t),this}dispose(){this.stopListening(),this.widget.dispose()}}pA([uS.dispose()],gA.prototype,"dispose",null);var fA,mA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},yA=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class bA extends Ux{constructor(t){super(),this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.handlers=[],this.graph=t.graph,this.model=t.graph.model,this.options=fA.getOptions(t),this.validator=new bA.Validator({history:this,cancelInvalid:this.options.cancelInvalid}),this.clean(),this.startListening()}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}undo(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack.push(e),this.notify("undo",e,t))}return this}redo(t={}){if(!this.disabled){const e=this.redoStack.pop();e&&(this.applyCommand(e,t),this.undoStack.push(e),this.notify("redo",e,t))}return this}cancel(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack=[],this.notify("cancel",e,t))}return this}clean(t={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,t),this}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}validate(t,...e){return this.validator.validate(t,...e),this}dispose(){this.validator.dispose(),this.clean(),this.stopListening()}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach(((t,e)=>{this.handlers[e]=this.addCommand.bind(this,t),this.model.on(t,this.handlers[e])})),this.validator.on("invalid",(t=>this.trigger("invalid",t)))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach(((t,e)=>{this.model.off(t,this.handlers[e])})),this.handlers.length=0),this.validator.off("invalid")}createCommand(t){return{batch:!!t&&t.batch,data:{}}}revertCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?fA.sortBatchCommands(t):[t];for(let i=n.length-1;i>=0;i-=1){const t=n[i],r=Object.assign(Object.assign({},e),cc(t.options,this.options.revertOptionsList||[]));this.executeCommand(t,!0,r)}this.freezed=!1}applyCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?fA.sortBatchCommands(t):[t];for(let i=0;i<n.length;i+=1){const t=n[i],r=Object.assign(Object.assign({},e),cc(t.options,this.options.applyOptionsList||[]));this.executeCommand(t,!1,r)}this.freezed=!1}executeCommand(t,e,n){const i=this.model,r=i.getCell(t.data.id),s=t.event;if(fA.isAddEvent(s)&&e||fA.isRemoveEvent(s)&&!e)r.remove(n);else if(fA.isAddEvent(s)&&!e||fA.isRemoveEvent(s)&&e){const e=t.data;e.node?i.addNode(e.props,n):e.edge&&i.addEdge(e.props,n)}else if(fA.isChangeEvent(s)){const i=t.data,s=i.key;if(s){const t=e?i.prev[s]:i.next[s];r.prop(s,t,n)}}else{const i=this.options.executeCommand;i&&ey(i,this,t,e,n)}}addCommand(t,e){if(this.freezed||this.disabled)return;const n=e,i=n.options||{};if(i.dryrun)return;if(fA.isAddEvent(t)&&this.options.ignoreAdd||fA.isRemoveEvent(t)&&this.options.ignoreRemove||fA.isChangeEvent(t)&&this.options.ignoreChange)return;const r=this.options.beforeAddCommand;if(null!=r&&!1===ey(r,this,t,e))return;"cell:change:*"===t&&(t=`cell:change:${n.key}`);const s=n.cell,o=JM.isModel(s);let a;if(this.batchCommands){a=this.batchCommands[Math.max(this.lastBatchIndex,0)];const e=o&&!a.modelChange||a.data.id!==s.id,n=a.event!==t;if(this.lastBatchIndex>=0&&(e||n)){const e=this.batchCommands.findIndex((e=>(o&&e.modelChange||e.data.id===s.id)&&e.event===t));e<0||fA.isAddEvent(t)||fA.isRemoveEvent(t)?a=this.createCommand({batch:!0}):(a=this.batchCommands[e],this.batchCommands.splice(e,1)),this.batchCommands.push(a),this.lastBatchIndex=this.batchCommands.length-1}}else a=this.createCommand({batch:!1});if(fA.isAddEvent(t)||fA.isRemoveEvent(t)){const e=a.data;return a.event=t,a.options=i,e.id=s.id,e.props=ad(s.toJSON()),s.isEdge()?e.edge=!0:s.isNode()&&(e.node=!0),this.push(a,i)}if(fA.isChangeEvent(t)){const n=e.key,r=a.data;return a.batch&&a.event||(a.event=t,a.options=i,r.key=n,null==r.prev&&(r.prev={}),r.prev[n]=id(s.previous(n)),o?a.modelChange=!0:r.id=s.id),null==r.next&&(r.next={}),r.next[n]=id(s.prop(n)),this.push(a,i)}const l=this.options.afterAddCommand;l&&ey(l,this,t,e,a),this.push(a,i)}initBatchCommand(t){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(t){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const e=this.filterBatchCommand(this.batchCommands);e.length>0&&(this.redoStack=[],this.undoStack.push(e),this.notify("add",e,t)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(t){let e=t.slice();const n=[];while(e.length>0){const t=e.shift(),i=t.event,r=t.data.id;if(null!=i&&(null!=r||t.modelChange)){if(fA.isAddEvent(i)){const t=e.findIndex((t=>fA.isRemoveEvent(t.event)&&t.data.id===r));if(t>=0){e=e.filter(((e,n)=>t<n||e.data.id!==r));continue}}else if(fA.isRemoveEvent(i)){const t=e.findIndex((t=>fA.isAddEvent(t.event)&&t.data.id===r));if(t>=0){e.splice(t,1);continue}}else if(fA.isChangeEvent(i)){const e=t.data;if(ch(e.prev,e.next))continue}n.push(t)}}return n}notify(t,e,n){const i=null==e?null:Array.isArray(e)?e:[e];this.emit(t,{cmds:i,options:n}),this.emit("change",{cmds:i,options:n})}push(t,e){this.redoStack=[],t.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:t,options:e})):(this.undoStack.push(t),this.notify("add",t,e))}}mA([Ux.dispose()],bA.prototype,"dispose",null),function(t){class e extends Ux{constructor(t){super(),this.map={},this.command=t.history,this.cancelInvalid=!1!==t.cancelInvalid,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:t}){return Array.isArray(t)?t.every((t=>this.isValidCommand(t))):this.isValidCommand(t)}isValidCommand(t){if(t.options&&!1===t.options.validation)return!0;const e=t.event&&this.map[t.event]||[];let n=null;return e.forEach((e=>{let i=0;const r=s=>{const o=e[i];i+=1;try{if(!o)return void(n=s);o(s,t,r)}catch(s){r(s)}};r(n)})),!n||(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:n}),!1)}validate(t,...e){const n=Array.isArray(t)?t:t.split(/\s+/);return e.forEach((t=>{if("function"!==typeof t)throw new Error(`${n.join(" ")} requires callback functions.`)})),n.forEach((t=>{null==this.map[t]&&(this.map[t]=[]),this.map[t].push(e)})),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}mA([Ux.dispose()],e.prototype,"dispose",null),t.Validator=e}(bA||(bA={})),function(t){function e(t){return"cell:added"===t}function n(t){return"cell:removed"===t}function i(t){return null!=t&&t.startsWith("cell:change:")}function r(e){const{graph:n}=e,i=yA(e,["graph"]),r=["cell:added","cell:removed","cell:change:*"],s=["batch:start","batch:stop"],o=e.eventNames?e.eventNames.filter((e=>!(t.isChangeEvent(e)||r.includes(e)||s.includes(e)))):r;return Object.assign(Object.assign({},i),{eventNames:o,applyOptionsList:e.applyOptionsList||["propertyPath"],revertOptionsList:e.revertOptionsList||["propertyPath"]})}function s(e){const n=[];for(let i=0,r=e.length;i<r;i+=1){const r=e[i];let s=null;if(t.isAddEvent(r.event)){const t=r.data.id;for(let n=0;n<i;n+=1)if(e[n].data.id===t){s=n;break}}null!==s?n.splice(s,0,r):n.push(r)}return n}t.isAddEvent=e,t.isRemoveEvent=n,t.isChangeEvent=i,t.getOptions=r,t.sortBatchCommands=s}(fA||(fA={}));var vA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class wA extends uS{get widgetOptions(){return this.options.minimap}init(){this.widget=this.graph.hook.createMiniMap()}dispose(){this.widget&&this.widget.dispose()}}vA([uS.dispose()],wA.prototype,"dispose",null);var CA=n(2441),xA=n.n(CA),EA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class kA extends Gx{constructor(t){super(),this.options=t;const e=this.graph.scroller.widget;this.container=e?e.container:this.graph.container,t.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus,this),this.graph.on("blank:mouseup",this.focus,this)),this.mousetrap=kA.createMousetrap(this)}get graph(){return this.options.graph}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.graph.options.keyboard.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.graph.options.keyboard.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)}off(t,e){this.mousetrap.unbind(this.getKeys(t),e)}focus(t){const e=this.isInputEvent(t.e);if(e)return;const n=this.target;n.focus({preventScroll:!0})}getKeys(t){return(Array.isArray(t)?t:[t]).map((t=>this.formatkey(t)))}formatkey(t){const e=t.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command"),n=this.options.format;return n?ey(n,this.graph,e):e}isGraphEvent(t){const e=t.srcElement||t.target;return!!e&&(e===this.target||e===document.body||Py(this.container,e))}isInputEvent(t){const e=t.target,n=e&&e.tagName.toLowerCase();return"input"===n}isEnabledForEvent(t){const e=!this.disabled&&this.isGraphEvent(t),n=this.isInputEvent(t);if(e){const e=t.keyCode||t.which;if(n&&(8===e||46===e))return!1;if(this.options.guard)return ey(this.options.guard,this.graph,t)}return e}dispose(){this.mousetrap.reset()}}EA([Gx.dispose()],kA.prototype,"dispose",null),function(t){function e(t){const e=new(xA())(t.target),n=e.stopCallback;return e.stopCallback=(i,r,s)=>!t.isEnabledForEvent(i)||!!n&&n.call(e,i,r,s),e}t.createMousetrap=e}(kA||(kA={}));var MA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class SA extends Gx{constructor(t){super(),this.options=t,this.cumulatedFactor=1;const e=this.graph.scroller.widget;this.container=e?e.container:this.graph.container,this.target=this.options.global?document:this.container,this.mousewheelHandle=new _v(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.options.enabled&&this.enable(!0)}get graph(){return this.options.graph}get disabled(){return!0!==this.options.enabled}enable(t){(this.disabled||t)&&(this.options.enabled=!0,this.graph.options.mousewheel.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.options.enabled=!1,this.graph.options.mousewheel.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(t){const e=t.originalEvent||t,n=this.options.guard;return(null==n||n.call(this.graph,e))&&eA.isMatch(e,this.options.modifiers)}onMouseWheel(t){const e=t.originalEvent||t,n=this.options.guard;if((null==n||n.call(this.graph,e))&&eA.isMatch(e,this.options.modifiers)){const e=this.options.factor||1.2;null==this.currentScale&&(this.startPos={x:t.clientX,y:t.clientY},this.currentScale=this.graph.scroller.widget?this.graph.scroller.widget.zoom():this.graph.transform.getScale().sx);const n=t.deltaY;n<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*e*20)/20/this.currentScale:this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*(1/e)*20)/20/this.currentScale,this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const i=this.graph.scroller.widget,r=this.currentScale;let s=this.graph.transform.clampScale(r*this.cumulatedFactor);const o=this.options.minScale||Number.MIN_SAFE_INTEGER,a=this.options.maxScale||Number.MAX_SAFE_INTEGER;if(s=Rm(s,o,a),s!==r)if(i)if(this.options.zoomAtMousePosition){const t=this.graph.coord.clientToLocalPoint(this.startPos);i.zoom(s,{absolute:!0,center:t.clone()})}else i.zoom(s,{absolute:!0});else if(this.options.zoomAtMousePosition){const t=this.graph.coord.clientToGraphPoint(this.startPos);this.graph.zoom(s,{absolute:!0,center:t.clone()})}else this.graph.zoom(s,{absolute:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}MA([Gx.dispose()],SA.prototype,"dispose",null);var AA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class DA extends uS{show(t={}){const e=Object.assign(Object.assign({},DA.defaultOptions),t),n=this.createPrintPages(e);e.ready(n,(t=>this.showPrintWindow(t,e)),{sheetSize:this.getSheetSize(e)})}get className(){return this.view.prefixClassName("graph-print")}showPrintWindow(t,e){if(t){const n=Q()(document.body),i=Q()(this.view.container),r=this.view.prefixClassName("graph-printing");n.addClass(r);const s=i.children().detach();t.forEach((t=>{t.removeClass(`${this.className}-preview`).addClass(`${this.className}-ready`).appendTo(n)}));let o=!1;const a=()=>{o||(o=!0,n.removeClass(r),t.forEach((t=>t.remove())),i.append(s),Q()(`#${this.styleSheetId}`).remove(),this.graph.trigger("after:print",e),Q()(window).off("afterprint",a))};Q()(window).one("afterprint",a),setTimeout(a,200),window.print()}}createPrintPage(t,e){this.graph.trigger("before:print",e);const n=Q()("<div/>").addClass(this.className),i=Q()("<div/>").addClass(this.view.prefixClassName("graph-print-inner")).css("position","relative");e.size&&n.addClass(`${this.className}-size-${e.size}`);const r=Rb.create(this.view.svg).clone(),s=r.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`);i.append(r.node);const o=this.getSheetSize(e),a=this.graph.transform.getGraphArea(),l=this.graph.transform.getScale(),c=this.graph.translate(),h=dv().translate(c.tx/l.sx,c.ty/l.sy),u=this.getPageInfo(a,t,o),d=u.scale,p=u.bbox;return i.css({left:0,top:0}),r.attr({width:p.width*d,height:p.height*d,style:"position:relative",viewBox:[p.x,p.y,p.width,p.height].join(" ")}),s.attr("transform",fv(h)),n.append(i),n.addClass(`${this.className}-preview`),{$page:n,sheetSize:o}}createPrintPages(t){let e;const n=this.getPrintArea(t),i=[];if(t.page){const r=this.getPageSize(n,t.page),s=this.getPageAreas(n,r);s.forEach((n=>{e=this.createPrintPage(n,t),i.push(e.$page)}))}else e=this.createPrintPage(n,t),i.push(e.$page);if(e){const n={width:e.sheetSize.cssWidth,height:e.sheetSize.cssHeight};this.updatePrintStyle(n,t)}return i}get styleSheetId(){return this.view.prefixClassName("graph-print-style")}updatePrintStyle(t,e){const n=Object.keys(t).reduce(((e,n)=>`${e} ${n}:${t[n]};`),""),i=Vm(e.margin),r=e.marginUnit||"",s=e.sheetUnit||"",o=`\n @media print {\n .${this.className}.${this.className}-ready {\n ${n}\n }\n\n @page {\n margin:\n ${[i.top+r,i.right+r,i.bottom+r,i.left+r].join(" ")};\n size: ${e.sheet.width+s} ${e.sheet.height+s};\n\n .${this.className}.${this.className}-preview {\n ${n}\n }\n }`,a=this.styleSheetId,l=Q()(`#${a}`);l.length?l.html(o):Q()("head").append(`'<style type="text/css" id="${a}">${o}</style>'`)}getPrintArea(t){let e=t.area;if(!e){const n=Vm(t.padding);e=this.graph.getContentArea().moveAndExpand({x:-n.left,y:-n.top,width:n.left+n.right,height:n.top+n.bottom})}return e}getPageSize(t,e){if("object"===typeof e){const n=e,i={width:n.width,height:n.height};return null==i.width&&(i.width=Math.ceil(t.width/(n.columns||1))),null==i.height&&(i.height=Math.ceil(t.height/(n.rows||1))),i}return{width:t.width,height:t.height}}getPageAreas(t,e){const n=[],i=e.width,r=e.height;for(let s=0,o=0;s<t.height&&o<200;s+=r,o+=1)for(let e=0,a=0;e<t.width&&a<200;e+=i,a+=1)n.push(new db(t.x+e,t.y+s,i,r));return n}getSheetSize(t){const e=t.sheet,n=Vm(t.margin),i=t.marginUnit||"",r=t.sheetUnit||"",s=`calc(${e.width}${r} - ${n.left+n.right}${i})`,o=`calc(${e.height}${r} - ${n.top+n.bottom}${i})`,a=Qy.measure(s,o);return{cssWidth:s,cssHeight:o,width:a.width,height:a.height}}getPageInfo(t,e,n){const i=new db(e.x-t.x,e.y-t.y,e.width,e.height),r=i.width/i.height,s=n.width/n.height;return{bbox:i,scale:s<r?n.width/i.width:n.height/i.height,fitHorizontal:s<r}}dispose(){}}AA([uS.dispose()],DA.prototype,"dispose",null),function(t){t.defaultOptions={page:!1,sheet:{width:210,height:297},sheetUnit:"mm",margin:.4,marginUnit:"in",padding:5,ready:(t,e)=>e(t)}}(DA||(DA={}));class OA extends uS{toSVG(t,e={}){this.graph.trigger("before:export",e);const n=this.view.svg,i=Rb.create(n).clone();let r=i.node;const s=i.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),o=e.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),a=e.preserveDimensions;if(a){const t="boolean"===typeof a?o:a;i.attr({width:t.width,height:t.height})}if(i.removeAttribute("style").attr("viewBox",[o.x,o.y,o.width,o.height].join(" ")),s.removeAttribute("transform"),!1!==e.copyStyles){const t=n.ownerDocument,e=Array.from(n.querySelectorAll("*")),i=Array.from(r.querySelectorAll("*")),s=t.styleSheets.length,o=[];for(let n=s-1;n>=0;n-=1)o[n]=t.styleSheets[n],t.styleSheets[n].disabled=!0;const a={};e.forEach(((t,e)=>{const n=window.getComputedStyle(t,null),i={};Object.keys(n).forEach((t=>{i[t]=n.getPropertyValue(t)})),a[e]=i})),s!==t.styleSheets.length&&o.forEach(((e,n)=>{t.styleSheets[n]=e}));for(let n=0;n<s;n+=1)t.styleSheets[n].disabled=!1;const l={};e.forEach(((t,e)=>{const n=window.getComputedStyle(t,null),i=a[e],r={};Object.keys(n).forEach((t=>{n.getPropertyValue(t)!==i[t]&&(r[t]=n.getPropertyValue(t))})),l[e]=r})),i.forEach(((t,e)=>{Q()(t).css(l[e])}))}const l=e.stylesheet;if("string"===typeof l){const t=n.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(l);i.prepend(Rb.create("style",{type:"text/css"},[t]))}const c=()=>{const n=e.beforeSerialize;if("function"===typeof n){const t=ey(n,this.graph,r);t instanceof SVGSVGElement&&(r=t)}const i=(new XMLSerializer).serializeToString(r).replace(/&nbsp;/g," ");this.graph.trigger("after:export",e),t(i)};if(e.serializeImages){const t=i.find("image").map((t=>new Promise((e=>{const n=t.attr("xlink:href")||t.attr("href");Jy.imageToDataUri(n,((n,i)=>{!n&&i&&t.attr("xlink:href",i),e()}))}))));Promise.all(t).then(c)}else c()}toDataURL(t,e){let n=e.viewBox||this.graph.getContentBBox();const i=Vm(e.padding);e.width&&e.height&&(i.left+i.right>=e.width&&(i.left=i.right=0),i.top+i.bottom>=e.height&&(i.top=i.bottom=0));const r=new db(-i.left,-i.top,i.left+i.right,i.top+i.bottom);if(e.width&&e.height){const t=n.width+i.left+i.right,s=n.height+i.top+i.bottom;r.scale(t/e.width,s/e.height)}n=db.create(n).moveAndExpand(r);const s="number"===typeof e.width&&"number"===typeof e.height?{width:e.width,height:e.height}:n;let o=e.ratio?parseFloat(e.ratio):1;Number.isFinite(o)&&0!==o||(o=1);const a={width:Math.max(Math.round(s.width*o),1),height:Math.max(Math.round(s.height*o),1)};{const t=document.createElement("canvas"),e=t.getContext("2d");t.width=a.width,t.height=a.height;const n=a.width-1,i=a.height-1;e.fillStyle="rgb(1,1,1)",e.fillRect(n,i,1,1);const r=e.getImageData(n,i,1,1).data;if(1!==r[0]||1!==r[1]||1!==r[2])throw new Error("size exceeded")}const l=new Image;l.onload=()=>{const n=document.createElement("canvas");n.width=a.width,n.height=a.height;const i=n.getContext("2d");i.fillStyle=e.backgroundColor||"white",i.fillRect(0,0,a.width,a.height);try{i.drawImage(l,0,0,a.width,a.height);const r=n.toDataURL(e.type,e.quality);t(r)}catch(r){}},this.toSVG((t=>{l.src=`data:image/svg+xml,${encodeURIComponent(t)}`}),Object.assign(Object.assign({},e),{viewBox:n,serializeImages:!0,preserveDimensions:Object.assign({},a)}))}toPNG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/png"}))}toJPEG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/jpeg"}))}}class PA extends uS{constructor(){super(...arguments),this.widgets=new Map}get isSelectionEnabled(){return!0===this.options.selecting.enabled}init(){this.startListening()}startListening(){this.graph.on("node:mouseup",this.onNodeMouseUp,this),this.graph.on("node:selected",this.onNodeSelected,this),this.graph.on("node:unselected",this.onNodeUnSelected,this)}stopListening(){this.graph.off("node:mouseup",this.onNodeMouseUp,this),this.graph.off("node:selected",this.onNodeSelected,this),this.graph.off("node:unselected",this.onNodeUnSelected,this)}onNodeMouseUp({node:t}){if(!this.isSelectionEnabled){const e=this.graph.hook.createKnob(t,{clearAll:!0});e&&this.widgets.set(t,e)}}onNodeSelected({node:t}){if(this.isSelectionEnabled){const e=this.graph.hook.createKnob(t,{clearAll:!1});e&&this.widgets.set(t,e)}}onNodeUnSelected({node:t}){if(this.isSelectionEnabled){const e=this.widgets.get(t);e&&e.forEach((t=>t.dispose())),this.widgets.delete(t)}}}var TA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class NA extends uS{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&!0===this.widgetOptions.enabled}init(){this.startListening(),this.updateClassName()}startListening(){const t=this.widgetOptions.eventTypes;t&&(t.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),this.view.$(this.graph.container).on("mousedown",this.onRightMouseDown)),t.includes("mouseWheel")&&(this.mousewheelHandle=new _v(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()))}stopListening(){const t=this.widgetOptions.eventTypes;t&&(t.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&this.view.$(this.graph.container).off("mousedown",this.onRightMouseDown),t.includes("mouseWheel")&&this.mousewheelHandle&&this.mousewheelHandle.disable())}preparePanning({e:t}){(this.allowPanning(t,!0)||this.allowPanning(t)&&!this.graph.selection.allowRubberband(t,!0))&&this.startPanning(t)}allowPanning(t,e){return this.pannable&&eA.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowPanning(t)}startPanning(t){const e=this.view.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.panning=!0,this.updateClassName(),this.view.$(document.body).on({"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),this.view.$(window).on("mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.view.normalizeEvent(t),n=e.clientX-this.clientX,i=e.clientY-this.clientY;this.clientX=e.clientX,this.clientY=e.clientY,this.graph.translateBy(n,i)}stopPanning(t){this.panning=!1,this.updateClassName(),this.view.$(document.body).off(".panning"),this.view.$(window).off(".panning")}updateClassName(){const t=this.view.container,e=this.view.prefixClassName("graph-panning"),n=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(uy(t,e),dy(t,n)):(dy(t,e),uy(t,n)):(dy(t,e),dy(t,n))}onRightMouseDown(t){2===t.button&&this.allowPanning(t,!0)&&this.startPanning(t)}allowMouseWheel(t){return this.pannable&&!t.ctrlKey}onMouseWheel(t,e,n){t.ctrlKey||this.graph.translateBy(-e,-n)}autoPanning(t,e){const n=10,i=this.graph.getGraphArea();let r=0,s=0;t<=i.left+n&&(r=-n),e<=i.top+n&&(s=-n),t>=i.right-n&&(r=n),e>=i.bottom-n&&(s=n),0===r&&0===s||this.graph.translateBy(-r,-s)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}TA([uS.dispose()],NA.prototype,"dispose",null);var jA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class LA extends uS{hasScroller(){return null!=this.graph.scroller.widget}getContainer(){return this.hasScroller()?this.graph.scroller.widget.container:this.graph.container}init(){const t=this.options.autoResize;if(t){const e="boolean"===typeof t?this.getContainer():t;qv.bind(e,(()=>{const t=this.getContainer(),e=t.offsetWidth,n=t.offsetHeight;this.resize(e,n)}))}}resize(t,e){this.hasScroller()?this.resizeScroller(t,e):this.resizeGraph(t,e)}resizeGraph(t,e){this.graph.transform.resize(t,e)}resizeScroller(t,e){this.graph.scroller.resize(t,e)}resizePage(t,e){const n=this.graph.scroller.widget;n&&n.updatePageSize(t,e)}dispose(){qv.clear(this.getContainer())}}jA([uS.dispose()],LA.prototype,"dispose",null);var FA,zA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},RA=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};(function(t){function e(t,e){return(n,i,r)=>{const s=r.value,o=e||i;r.value=function(...e){const n=this.options[o];if(null!=n){this.getNativeValue=s.bind(this,...e);const i=ey(n,this.graph,...e);if(this.getNativeValue=null,null!=i||!0===t&&null===i)return i}return s.call(this,...e)}}}function n(t){return(e,n,i)=>{const r=i.value,s=t||n;i.value=function(...t){let e=r.call(this,...t);const n=this.options[s];return null!=n&&(e=ey(n,this.graph,...t)&&e),e}}}t.hook=e,t.after=n})(FA||(FA={}));class BA extends uS{createModel(){if(this.options.model)return this.options.model;const t=new JM;return t.graph=this.graph,t}createView(){return new gS(this.graph)}createRenderer(){return new LS(this.graph)}createDefsManager(){return new JS(this.graph)}createGridManager(){return new QS(this.graph)}createCoordManager(){return new tA(this.graph)}createKnobManager(){return new PA(this.graph)}createTransform(t,e){const n=this.getTransformOptions(t);return n.resizable||n.rotatable?new WS(Object.assign(Object.assign({node:t,graph:this.graph},n),e)):(n.clearAll&&WS.removeInstances(this.graph),null)}createKnob(t,e){const n=qS.parseOptionGroup(this.graph,t,this.options.knob),i=Object.assign(Object.assign({},n),e);i.clearAll&&MS.removeInstances(this.graph),i.clearAll=!1;const r=t.prop("knob"),s=[],o=Array.isArray(r)?r:[r];return o.forEach(((e,r)=>{e&&!1!==e.enabled&&("function"===typeof e.enabled&&!1===e.enabled.call(this.graph,t)||n.enabled&&s.push(new MS(Object.assign({node:t,index:r,graph:this.graph},i))))})),s}getTransformOptions(t){const e=qS.parseOptionGroup(this.graph,t,this.options.resizing),n=qS.parseOptionGroup(this.graph,t,this.options.rotating),i=qS.parseOptionGroup(this.graph,t,this.options.transforming),r=Object.assign(Object.assign({},i),{resizable:e.enabled,minWidth:e.minWidth,maxWidth:e.maxWidth,minHeight:e.minHeight,maxHeight:e.maxHeight,orthogonalResizing:e.orthogonal,restrictedResizing:null!=e.restrict?e.restrict:e.restricted,autoScrollOnResizing:e.autoScroll,preserveAspectRatio:e.preserveAspectRatio,allowReverse:e.allowReverse,rotatable:n.enabled,rotateGrid:n.grid});return r}createTransformManager(){return new dA(this.graph)}createHighlightManager(){return new hA(this.graph)}createBackgroundManager(){return new zS(this.graph)}createClipboard(){return new GA}createClipboardManager(){return new lA(this.graph)}createSnapline(){return new NS(Object.assign({graph:this.graph},this.options.snapline))}createSnaplineManager(){return new iA(this.graph)}createSelection(){return new US(Object.assign({graph:this.graph},this.options.selecting))}createSelectionManager(){return new gA(this.graph)}allowRubberband(t){return!0}createHistoryManager(){return new bA(Object.assign({graph:this.graph},this.options.history))}createScroller(){return this.options.scroller.enabled?new $S(Object.assign({graph:this.graph},this.options.scroller)):null}createScrollerManager(){return new sA(this.graph)}allowPanning(t){return!0}createMiniMap(){const t=this.options.minimap,{enabled:e}=t,n=RA(t,["enabled"]);return e?new OS(Object.assign({graph:this.graph},n)):null}createMiniMapManager(){return new wA(this.graph)}createKeyboard(){return new kA(Object.assign({graph:this.graph},this.options.keyboard))}createMouseWheel(){return new SA(Object.assign({graph:this.graph},this.options.mousewheel))}createPrintManager(){return new DA(this.graph)}createFormatManager(){return new OA(this.graph)}createPanningManager(){return new NA(this.graph)}createSizeManager(){return new LA(this.graph)}allowConnectToBlank(t){const e=this.options.connecting,n=null!=e.allowBlank?e.allowBlank:e.dangling;if("function"!==typeof n)return!!n;const i=this.graph.findViewByCell(t),r=t.getSourceCell(),s=t.getTargetCell(),o=this.graph.findViewByCell(r),a=this.graph.findViewByCell(s);return ey(n,this.graph,{edge:t,edgeView:i,sourceCell:r,targetCell:s,sourceView:o,targetView:a,sourcePort:t.getSourcePortId(),targetPort:t.getTargetPortId(),sourceMagnet:i.sourceMagnet,targetMagnet:i.targetMagnet})}validateEdge(t,e,n){if(!this.allowConnectToBlank(t)){const e=t.getSourceCellId(),n=t.getTargetCellId();if(!e||!n)return!1}const i=this.options.connecting.validateEdge;return!i||ey(i,this.graph,{edge:t,type:e,previous:n})}validateMagnet(t,e,n){if("passive"!==e.getAttribute("magnet")){const i=this.options.connecting.validateMagnet;return!i||ey(i,this.graph,{e:n,magnet:e,view:t,cell:t.cell})}return!1}getDefaultEdge(t,e){let n;const i=this.options.connecting.createEdge;return i&&(n=ey(i,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),null==n&&(n=new aS),n}validateConnection(t,e,n,i,r,s,o){const a=this.options.connecting,l=a.allowLoop,c=a.allowNode,h=a.allowEdge,u=a.allowPort,d=null!=a.allowMulti?a.allowMulti:a.multi,p=a.validateConnection,g=s?s.cell:null,f="target"===r?n:t,m="target"===r?i:e;let y=!0;const b=a=>{const l="source"===r?o?o.port:null:g?g.getSourcePortId():null,c="target"===r?o?o.port:null:g?g.getTargetPortId():null;return ey(a,this.graph,{edge:g,edgeView:s,sourceView:t,targetView:n,sourcePort:l,targetPort:c,sourceMagnet:e,targetMagnet:i,sourceCell:t?t.cell:null,targetCell:n?n.cell:null,type:r})};if(null!=l&&("boolean"===typeof l?l||t!==n||(y=!1):y=b(l)),y&&null!=u&&("boolean"===typeof u?!u&&m&&(y=!1):y=b(u)),y&&null!=h&&("boolean"===typeof h?!h&&UM.isEdgeView(f)&&(y=!1):y=b(h)),y&&null!=c&&("boolean"===typeof c?c||null==f||WM.isNodeView(f)&&null==m&&(y=!1):y=b(c)),y&&null!=d&&s){const t=s.cell,e="source"===r?o:t.getSource(),n="target"===r?o:t.getTarget(),i=o?this.graph.getCellById(o.cell):null;if(e&&n&&e.cell&&n.cell&&i)if("function"===typeof d)y=b(d);else{const t=this.model.getConnectedEdges(i,{outgoing:"source"===r,incoming:"target"===r});if(t.length)if("withPort"===d){const i=t.some((t=>{const i=t.getSource(),r=t.getTarget();return i&&r&&i.cell===e.cell&&r.cell===n.cell&&null!=i.port&&i.port===e.port&&null!=r.port&&r.port===n.port}));i&&(y=!1)}else if(!d){const i=t.some((t=>{const i=t.getSource(),r=t.getTarget();return i&&r&&i.cell===e.cell&&r.cell===n.cell}));i&&(y=!1)}}}return y&&null!=p&&(y=b(p)),y}getRestrictArea(t){const e=this.options.translating.restrict,n="function"===typeof e?ey(e,this.graph,t):e;return"number"===typeof n?this.graph.transform.getGraphArea().inflate(n):!0===n?this.graph.transform.getGraphArea():n||null}onViewUpdated(t,e,n){e&LS.FLAG_INSERT||n.mounting||this.graph.renderer.requestConnectedEdgesUpdate(t,n)}onViewPostponed(t,e,n){return this.graph.renderer.forcePostponedViewUpdate(t,e)}getCellView(t){return null}createCellView(t){const e={graph:this.graph},n=this.getCellView(t);if(n)return new n(t,e);const i=t.view;if(null!=i&&"string"===typeof i){const n=fE.registry.get(i);return n?new n(t,e):fE.registry.onNotFound(i)}return t.isNode()?new WM(t,e):t.isEdge()?new UM(t,e):null}getHTMLComponent(t){let e=t.getHTML();return"string"===typeof e&&(e=lS.componentRegistry.get(e)||e),qc(e)&&(e=e.render),"function"===typeof e?ey(e,this.graph,t):e}shouldUpdateHTMLComponent(t){let e=t.getHTML();if("string"===typeof e&&(e=lS.componentRegistry.get(e)||e),qc(e)){const n=e.shouldComponentUpdate;return"function"===typeof n?ey(n,this.graph,t):!!n}return!1}onEdgeLabelRendered(t){}onPortRendered(t){}onToolItemCreated(t){}}zA([FA.hook()],BA.prototype,"createModel",null),zA([FA.hook()],BA.prototype,"createView",null),zA([FA.hook()],BA.prototype,"createRenderer",null),zA([FA.hook()],BA.prototype,"createDefsManager",null),zA([FA.hook()],BA.prototype,"createGridManager",null),zA([FA.hook()],BA.prototype,"createCoordManager",null),zA([FA.hook()],BA.prototype,"createKnobManager",null),zA([FA.hook()],BA.prototype,"createTransform",null),zA([FA.hook()],BA.prototype,"createKnob",null),zA([FA.hook()],BA.prototype,"createTransformManager",null),zA([FA.hook()],BA.prototype,"createHighlightManager",null),zA([FA.hook()],BA.prototype,"createBackgroundManager",null),zA([FA.hook()],BA.prototype,"createClipboard",null),zA([FA.hook()],BA.prototype,"createClipboardManager",null),zA([FA.hook()],BA.prototype,"createSnapline",null),zA([FA.hook()],BA.prototype,"createSnaplineManager",null),zA([FA.hook()],BA.prototype,"createSelection",null),zA([FA.hook()],BA.prototype,"createSelectionManager",null),zA([FA.hook()],BA.prototype,"allowRubberband",null),zA([FA.hook()],BA.prototype,"createHistoryManager",null),zA([FA.hook()],BA.prototype,"createScroller",null),zA([FA.hook()],BA.prototype,"createScrollerManager",null),zA([FA.hook()],BA.prototype,"allowPanning",null),zA([FA.hook()],BA.prototype,"createMiniMap",null),zA([FA.hook()],BA.prototype,"createMiniMapManager",null),zA([FA.hook()],BA.prototype,"createKeyboard",null),zA([FA.hook()],BA.prototype,"createMouseWheel",null),zA([FA.hook()],BA.prototype,"createPrintManager",null),zA([FA.hook()],BA.prototype,"createFormatManager",null),zA([FA.hook()],BA.prototype,"createPanningManager",null),zA([FA.hook()],BA.prototype,"createSizeManager",null),zA([FA.after()],BA.prototype,"onViewUpdated",null),zA([FA.after()],BA.prototype,"onViewPostponed",null),zA([FA.hook()],BA.prototype,"getCellView",null),zA([FA.hook(!0)],BA.prototype,"createCellView",null),zA([FA.hook()],BA.prototype,"getHTMLComponent",null),zA([FA.hook()],BA.prototype,"shouldUpdateHTMLComponent",null),zA([FA.hook()],BA.prototype,"onEdgeLabelRendered",null),zA([FA.hook()],BA.prototype,"onPortRendered",null),zA([FA.hook()],BA.prototype,"onToolItemCreated",null);var IA,$A,VA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class _A extends Ux{constructor(t){super(),this.options=qS.get(t),this.css=new yS(this),this.hook=new BA(this),this.view=this.hook.createView(),this.defs=this.hook.createDefsManager(),this.coord=this.hook.createCoordManager(),this.transform=this.hook.createTransformManager(),this.knob=this.hook.createKnobManager(),this.highlight=this.hook.createHighlightManager(),this.grid=this.hook.createGridManager(),this.background=this.hook.createBackgroundManager(),this.model=this.hook.createModel(),this.renderer=this.hook.createRenderer(),this.clipboard=this.hook.createClipboardManager(),this.snapline=this.hook.createSnaplineManager(),this.selection=this.hook.createSelectionManager(),this.history=this.hook.createHistoryManager(),this.scroller=this.hook.createScrollerManager(),this.minimap=this.hook.createMiniMapManager(),this.keyboard=this.hook.createKeyboard(),this.mousewheel=this.hook.createMouseWheel(),this.print=this.hook.createPrintManager(),this.format=this.hook.createFormatManager(),this.panning=this.hook.createPanningManager(),this.size=this.hook.createSizeManager()}get container(){return this.view.container}get[Symbol.toStringTag](){return _A.toStringTag}isNode(t){return t.isNode()}isEdge(t){return t.isEdge()}resetCells(t,e={}){return this.model.resetCells(t,e),this}clearCells(t={}){return this.model.clear(t),this}toJSON(t={}){return this.model.toJSON(t)}parseJSON(t){return this.model.parseJSON(t)}fromJSON(t,e={}){return this.model.fromJSON(t,e),this}getCellById(t){return this.model.getCell(t)}addNode(t,e={}){return this.model.addNode(t,e)}addNodes(t,e={}){return this.addCell(t.map((t=>NM.isNode(t)?t:this.createNode(t))),e)}createNode(t){return this.model.createNode(t)}removeNode(t,e={}){return this.model.removeCell(t,e)}addEdge(t,e={}){return this.model.addEdge(t,e)}addEdges(t,e={}){return this.addCell(t.map((t=>GM.isEdge(t)?t:this.createEdge(t))),e)}removeEdge(t,e={}){return this.model.removeCell(t,e)}createEdge(t){return this.model.createEdge(t)}addCell(t,e={}){return this.model.addCell(t,e),this}removeCell(t,e={}){return this.model.removeCell(t,e)}removeCells(t,e={}){return this.model.removeCells(t,e)}removeConnectedEdges(t,e={}){return this.model.removeConnectedEdges(t,e)}disconnectConnectedEdges(t,e={}){return this.model.disconnectConnectedEdges(t,e),this}hasCell(t){return this.model.has(t)}getCell(t){return this.model.getCell(t)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(t){return this.model.getOutgoingEdges(t)}getIncomingEdges(t){return this.model.getIncomingEdges(t)}getConnectedEdges(t,e={}){return this.model.getConnectedEdges(t,e)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(t){return this.model.isRoot(t)}isLeafNode(t){return this.model.isLeaf(t)}getNeighbors(t,e={}){return this.model.getNeighbors(t,e)}isNeighbor(t,e,n={}){return this.model.isNeighbor(t,e,n)}getSuccessors(t,e={}){return this.model.getSuccessors(t,e)}isSuccessor(t,e,n={}){return this.model.isSuccessor(t,e,n)}getPredecessors(t,e={}){return this.model.getPredecessors(t,e)}isPredecessor(t,e,n={}){return this.model.isPredecessor(t,e,n)}getCommonAncestor(...t){return this.model.getCommonAncestor(...t)}getSubGraph(t,e={}){return this.model.getSubGraph(t,e)}cloneSubGraph(t,e={}){return this.model.cloneSubGraph(t,e)}cloneCells(t){return this.model.cloneCells(t)}getNodesFromPoint(t,e){return this.model.getNodesFromPoint(t,e)}getNodesInArea(t,e,n,i,r){return this.model.getNodesInArea(t,e,n,i,r)}getNodesUnderNode(t,e={}){return this.model.getNodesUnderNode(t,e)}searchCell(t,e,n={}){return this.model.search(t,e,n),this}getShortestPath(t,e,n={}){return this.model.getShortestPath(t,e,n)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(t,e={}){return this.model.getCellsBBox(t,e)}startBatch(t,e={}){this.model.startBatch(t,e)}stopBatch(t,e={}){this.model.stopBatch(t,e)}batchUpdate(t,e,n){const i="string"===typeof t?t:"update",r="string"===typeof t?e:t,s="function"===typeof e?n:e;this.startBatch(i,s);const o=r();return this.stopBatch(i,s),o}updateCellId(t,e){return this.model.updateCellId(t,e)}isFrozen(){return this.renderer.isFrozen()}freeze(t={}){return this.renderer.freeze(t),this}unfreeze(t={}){return this.renderer.unfreeze(t),this}isAsync(){return this.renderer.isAsync()}setAsync(t){return this.renderer.setAsync(t),this}findView(t){return OM.isCell(t)?this.findViewByCell(t):this.findViewByElem(t)}findViews(t){return db.isRectangleLike(t)?this.findViewsInArea(t):ub.isPointLike(t)?this.findViewsFromPoint(t):[]}findViewByCell(t){return this.renderer.findViewByCell(t)}findViewByElem(t){return this.renderer.findViewByElem(t)}findViewsFromPoint(t,e){const n="number"===typeof t?{x:t,y:e}:t;return this.renderer.findViewsFromPoint(n)}findViewsInArea(t,e,n,i,r){const s="number"===typeof t?{x:t,y:e,width:n,height:i}:t,o="number"===typeof t?r:e;return this.renderer.findViewsInArea(s,o)}isViewMounted(t){return this.renderer.isViewMounted(t)}getMountedViews(){return this.renderer.getMountedViews()}getUnmountedViews(){return this.renderer.getUnmountedViews()}matrix(t){return"undefined"===typeof t?this.transform.getMatrix():(this.transform.setMatrix(t),this)}resize(t,e){return this.size.resize(t,e),this}resizeGraph(t,e){return this.size.resizeGraph(t,e),this}resizeScroller(t,e){return this.size.resizeScroller(t,e),this}resizePage(t,e){return this.size.resizePage(t,e),this}scale(t,e=t,n=0,i=0){return"undefined"===typeof t?this.transform.getScale():(this.transform.scale(t,e,n,i),this)}zoom(t,e){const n=this.scroller.widget;if(n){if("undefined"===typeof t)return n.zoom();n.zoom(t,e)}else{if("undefined"===typeof t)return this.transform.getZoom();this.transform.zoom(t,e)}return this}zoomTo(t,e={}){const n=this.scroller.widget;n?n.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})):this.transform.zoom(t,Object.assign(Object.assign({},e),{absolute:!0}))}zoomToRect(t,e={}){const n=this.scroller.widget;return n?n.zoomToRect(t,e):this.transform.zoomToRect(t,e),this}zoomToFit(t={}){const e=this.scroller.widget;return e?e.zoomToFit(t):this.transform.zoomToFit(t),this}rotate(t,e,n){return"undefined"===typeof t?this.transform.getRotation():(this.transform.rotate(t,e,n),this)}translate(t,e){return"undefined"===typeof t?this.transform.getTranslation():(this.transform.translate(t,e),this)}translateBy(t,e){const n=this.translate(),i=n.tx+t,r=n.ty+e;return this.translate(i,r)}getArea(){return this.transform.getGraphArea()}getGraphArea(){return this.transform.getGraphArea()}getContentArea(t={}){return this.transform.getContentArea(t)}getContentBBox(t={}){return this.transform.getContentBBox(t)}fitToContent(t,e,n,i){return this.transform.fitToContent(t,e,n,i)}scaleContentToFit(t={}){return this.transform.scaleContentToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const i=this.scroller.widget;return i?i.centerPoint(t,e,n):this.transform.centerPoint(t,e),this}centerContent(t){const e=this.scroller.widget;return e?e.centerContent(t):this.transform.centerContent(t),this}centerCell(t,e){const n=this.scroller.widget;return n?n.centerCell(t,e):this.transform.centerCell(t),this}positionPoint(t,e,n,i={}){const r=this.scroller.widget;return r?r.positionPoint(t,e,n,i):this.transform.positionPoint(t,e,n),this}positionRect(t,e,n){const i=this.scroller.widget;return i?i.positionRect(t,e,n):this.transform.positionRect(t,e),this}positionCell(t,e,n){const i=this.scroller.widget;return i?i.positionCell(t,e,n):this.transform.positionCell(t,e),this}positionContent(t,e){const n=this.scroller.widget;return n?n.positionContent(t,e):this.transform.positionContent(t,e),this}getClientMatrix(){return this.coord.getClientMatrix()}getClientOffset(){return this.coord.getClientOffset()}getPageOffset(){return this.coord.getPageOffset()}snapToGrid(t,e){return this.coord.snapToGrid(t,e)}pageToLocal(t,e,n,i){return db.isRectangleLike(t)?this.coord.pageToLocalRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.pageToLocalRect(t,e,n,i):this.coord.pageToLocalPoint(t,e)}localToPage(t,e,n,i){return db.isRectangleLike(t)?this.coord.localToPageRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.localToPageRect(t,e,n,i):this.coord.localToPagePoint(t,e)}clientToLocal(t,e,n,i){return db.isRectangleLike(t)?this.coord.clientToLocalRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.clientToLocalRect(t,e,n,i):this.coord.clientToLocalPoint(t,e)}localToClient(t,e,n,i){return db.isRectangleLike(t)?this.coord.localToClientRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.localToClientRect(t,e,n,i):this.coord.localToClientPoint(t,e)}localToGraph(t,e,n,i){return db.isRectangleLike(t)?this.coord.localToGraphRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.localToGraphRect(t,e,n,i):this.coord.localToGraphPoint(t,e)}graphToLocal(t,e,n,i){return db.isRectangleLike(t)?this.coord.graphToLocalRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.graphToLocalRect(t,e,n,i):this.coord.graphToLocalPoint(t,e)}clientToGraph(t,e,n,i){return db.isRectangleLike(t)?this.coord.clientToGraphRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.clientToGraphRect(t,e,n,i):this.coord.clientToGraphPoint(t,e)}defineFilter(t){return this.defs.filter(t)}defineGradient(t){return this.defs.gradient(t)}defineMarker(t){return this.defs.marker(t)}getGridSize(){return this.grid.getGridSize()}setGridSize(t){return this.grid.setGridSize(t),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(t){return this.grid.draw(t),this}updateBackground(){return this.background.update(),this}drawBackground(t,e){const n=this.scroller.widget;return null==n||null!=this.options.background&&e?this.background.draw(t):n.backgroundManager.draw(t),this}clearBackground(t){const e=this.scroller.widget;return null==e||null!=this.options.background&&t?this.background.clear():e.backgroundManager.clear(),this}isClipboardEnabled(){return!this.clipboard.disabled}enableClipboard(){return this.clipboard.enable(),this}disableClipboard(){return this.clipboard.disable(),this}toggleClipboard(t){return null!=t?t!==this.isClipboardEnabled()&&(t?this.enableClipboard():this.disableClipboard()):this.isClipboardEnabled()?this.disableClipboard():this.enableClipboard(),this}isClipboardEmpty(){return this.clipboard.isEmpty()}getCellsInClipboard(){return this.clipboard.cells}cleanClipboard(){return this.clipboard.clean(),this}copy(t,e={}){return this.clipboard.copy(t,e),this}cut(t,e={}){return this.clipboard.cut(t,e),this}paste(t={},e=this){return this.clipboard.paste(t,e)}isHistoryEnabled(){return!this.history.disabled}enableHistory(){return this.history.enable(),this}disableHistory(){return this.history.disable(),this}toggleHistory(t){return null!=t?t!==this.isHistoryEnabled()&&(t?this.enableHistory():this.disableHistory()):this.isHistoryEnabled()?this.disableHistory():this.enableHistory(),this}undo(t={}){return this.history.undo(t),this}undoAndCancel(t={}){return this.history.cancel(t),this}redo(t={}){return this.history.redo(t),this}canUndo(){return this.history.canUndo()}canRedo(){return this.history.canRedo()}cleanHistory(t={}){this.history.clean(t)}isKeyboardEnabled(){return!this.keyboard.disabled}enableKeyboard(){return this.keyboard.enable(),this}disableKeyboard(){return this.keyboard.disable(),this}toggleKeyboard(t){return null!=t?t!==this.isKeyboardEnabled()&&(t?this.enableKeyboard():this.disableKeyboard()):this.isKeyboardEnabled()?this.disableKeyboard():this.enableKeyboard(),this}bindKey(t,e,n){return this.keyboard.on(t,e,n),this}unbindKey(t,e){return this.keyboard.off(t,e),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(t){return null==t?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():t?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const t=this.scroller.widget;return t?this.scroller.pannable:this.panning.pannable}enablePanning(){const t=this.scroller.widget;return t?this.scroller.enablePanning():this.panning.enablePanning(),this}disablePanning(){const t=this.scroller.widget;return t?this.scroller.disablePanning():this.panning.disablePanning(),this}togglePanning(t){return null==t?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}lockScroller(){var t;null===(t=this.scroller.widget)||void 0===t||t.lock()}unlockScroller(){var t;null===(t=this.scroller.widget)||void 0===t||t.unlock()}updateScroller(){var t;null===(t=this.scroller.widget)||void 0===t||t.update()}getScrollbarPosition(){const t=this.scroller.widget;return t.scrollbarPosition()}setScrollbarPosition(t,e,n){const i=this.scroller.widget;return i.scrollbarPosition(t,e,n),this}scrollToPoint(t,e,n){const i=this.scroller.widget;return i.scrollToPoint(t,e,n),this}scrollToContent(t){const e=this.scroller.widget;return e.scrollToContent(t),this}scrollToCell(t,e){const n=this.scroller.widget;return n.scrollToCell(t,e),this}transitionToPoint(t,e,n){const i=this.scroller.widget;return i.transitionToPoint(t,e,n),this}transitionToRect(t,e={}){const n=this.scroller.widget;return n.transitionToRect(t,e),this}isSelectionEnabled(){return!this.selection.disabled}enableSelection(){return this.selection.enable(),this}disableSelection(){return this.selection.disable(),this}toggleSelection(t){return null!=t?t!==this.isSelectionEnabled()&&(t?this.enableSelection():this.disableSelection()):this.isSelectionEnabled()?this.disableSelection():this.enableSelection(),this}isMultipleSelection(){return this.selection.isMultiple()}enableMultipleSelection(){return this.selection.enableMultiple(),this}disableMultipleSelection(){return this.selection.disableMultiple(),this}toggleMultipleSelection(t){return null!=t?t!==this.isMultipleSelection()&&(t?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return!1!==this.selection.widget.options.movable}enableSelectionMovable(){return this.selection.widget.options.movable=!0,this}disableSelectionMovable(){return this.selection.widget.options.movable=!1,this}toggleSelectionMovable(t){return null!=t?t!==this.isSelectionMovable()&&(t?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.selection.rubberbandDisabled}enableRubberband(){return this.selection.enableRubberband(),this}disableRubberband(){return this.selection.disableRubberband(),this}toggleRubberband(t){return null!=t?t!==this.isRubberbandEnabled()&&(t?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return!0===this.selection.widget.options.strict}enableStrictRubberband(){return this.selection.widget.options.strict=!0,this}disableStrictRubberband(){return this.selection.widget.options.strict=!1,this}toggleStrictRubberband(t){return null!=t?t!==this.isStrictRubberband()&&(t?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(t){this.selection.setModifiers(t)}setSelectionFilter(t){return this.selection.setFilter(t),this}setSelectionDisplayContent(t){return this.selection.setContent(t),this}isSelectionEmpty(){return this.selection.isEmpty()}cleanSelection(t){return this.selection.clean(t),this}resetSelection(t,e){return this.selection.reset(t,e),this}getSelectedCells(){return this.selection.cells}getSelectedCellCount(){return this.selection.length}isSelected(t){return this.selection.isSelected(t)}select(t,e){return this.selection.select(t,e),this}unselect(t,e){return this.selection.unselect(t,e),this}isSnaplineEnabled(){return!this.snapline.widget.disabled}enableSnapline(){return this.snapline.widget.enable(),this}disableSnapline(){return this.snapline.widget.disable(),this}toggleSnapline(t){if(null==t)return this.isSnaplineEnabled()?this.disableSnapline():this.enableSnapline(),this;t!==this.isSnaplineEnabled()&&(t?this.enableSnapline():this.disableSnapline())}hideSnapline(){return this.snapline.widget.hide(),this}setSnaplineFilter(t){return this.snapline.widget.setFilter(t),this}isSnaplineOnResizingEnabled(){return!0===this.snapline.widget.options.resizing}enableSnaplineOnResizing(){return this.snapline.widget.options.resizing=!0,this}disableSnaplineOnResizing(){return this.snapline.widget.options.resizing=!1,this}toggleSnaplineOnResizing(t){return null!=t?t!==this.isSnaplineOnResizingEnabled()&&(t?this.enableSnaplineOnResizing():this.disableSnaplineOnResizing()):this.isSnaplineOnResizingEnabled()?this.disableSnaplineOnResizing():this.enableSnaplineOnResizing(),this}isSharpSnapline(){return!0===this.snapline.widget.options.sharp}enableSharpSnapline(){return this.snapline.widget.options.sharp=!0,this}disableSharpSnapline(){return this.snapline.widget.options.sharp=!1,this}toggleSharpSnapline(t){return null!=t?t!==this.isSharpSnapline()&&(t?this.enableSharpSnapline():this.disableSharpSnapline()):this.isSharpSnapline()?this.disableSharpSnapline():this.enableSharpSnapline(),this}getSnaplineTolerance(){return this.snapline.widget.options.tolerance}setSnaplineTolerance(t){return this.snapline.widget.options.tolerance=t,this}removeTools(){return this.emit("tools:remove"),this}hideTools(){return this.emit("tools:hide"),this}showTools(){return this.emit("tools:show"),this}toSVG(t,e={}){this.format.toSVG(t,e)}toDataURL(t,e){this.format.toDataURL(t,e)}toPNG(t,e={}){this.format.toPNG(t,e)}toJPEG(t,e={}){this.format.toJPEG(t,e)}printPreview(t){this.print.show(t)}dispose(){this.clearCells(),this.off(),this.css.dispose(),this.hook.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.knob.dispose(),this.highlight.dispose(),this.background.dispose(),this.clipboard.dispose(),this.snapline.dispose(),this.selection.dispose(),this.history.dispose(),this.keyboard.dispose(),this.mousewheel.dispose(),this.print.dispose(),this.format.dispose(),this.minimap.dispose(),this.panning.dispose(),this.scroller.dispose(),this.view.dispose(),this.renderer.dispose(),this.size.dispose()}}VA([dS.checkScroller()],_A.prototype,"lockScroller",null),VA([dS.checkScroller()],_A.prototype,"unlockScroller",null),VA([dS.checkScroller()],_A.prototype,"updateScroller",null),VA([dS.checkScroller()],_A.prototype,"getScrollbarPosition",null),VA([dS.checkScroller()],_A.prototype,"setScrollbarPosition",null),VA([dS.checkScroller()],_A.prototype,"scrollToPoint",null),VA([dS.checkScroller()],_A.prototype,"scrollToContent",null),VA([dS.checkScroller()],_A.prototype,"scrollToCell",null),VA([dS.checkScroller()],_A.prototype,"transitionToPoint",null),VA([dS.checkScroller()],_A.prototype,"transitionToRect",null),VA([Ux.dispose()],_A.prototype,"dispose",null),function(t){t.View=gS,t.Hook=BA,t.Renderer=LS,t.Keyboard=kA,t.MouseWheel=SA,t.BaseManager=uS,t.DefsManager=JS,t.GridManager=QS,t.CoordManager=tA,t.PrintManager=DA,t.FormatManager=OA,t.MiniMapManager=wA,t.HistoryManager=bA,t.SnaplineManager=iA,t.ScrollerManager=sA,t.ClipboardManager=lA,t.TransformManager=dA,t.HighlightManager=hA,t.BackgroundManager=zS,t.SelectionManager=gA}(_A||(_A={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&null!=i.hook&&null!=i.view&&null!=i.model}t.toStringTag=`X6.${t.name}`,t.isGraph=e}(_A||(_A={})),function(t){function e(e,n){const i=e instanceof HTMLElement?new t({container:e}):new t(e);return null!=n&&i.fromJSON(n),i}t.render=e}(_A||(_A={})),function(t){t.registerNode=NM.registry.register,t.registerEdge=GM.registry.register,t.registerView=fE.registry.register,t.registerAttr=AC.registry.register,t.registerGrid=NC.registry.register,t.registerFilter=WC.registry.register,t.registerNodeTool=NE.registry.register,t.registerEdgeTool=jE.registry.register,t.registerBackground=ZC.registry.register,t.registerHighlighter=ax.registry.register,t.registerPortLayout=Cx.registry.register,t.registerPortLabelLayout=Ix.registry.register,t.registerMarker=hC.registry.register,t.registerRouter=rM.registry.register,t.registerConnector=xM.registry.register,t.registerAnchor=KE.registry.register,t.registerEdgeAnchor=sk.registry.register,t.registerConnectionPoint=gk.registry.register,t.registerConnectionStrategy=cE.registry.register,t.registerHTMLComponent=lS.componentRegistry.register}(_A||(_A={})),function(t){t.unregisterNode=NM.registry.unregister,t.unregisterEdge=GM.registry.unregister,t.unregisterView=fE.registry.unregister,t.unregisterAttr=AC.registry.unregister,t.unregisterGrid=NC.registry.unregister,t.unregisterFilter=WC.registry.unregister,t.unregisterNodeTool=NE.registry.unregister,t.unregisterEdgeTool=jE.registry.unregister,t.unregisterBackground=ZC.registry.unregister,t.unregisterHighlighter=ax.registry.unregister,t.unregisterPortLayout=Cx.registry.unregister,t.unregisterPortLabelLayout=Ix.registry.unregister,t.unregisterMarker=hC.registry.unregister,t.unregisterRouter=rM.registry.unregister,t.unregisterConnector=xM.registry.unregister,t.unregisterAnchor=KE.registry.unregister,t.unregisterEdgeAnchor=sk.registry.unregister,t.unregisterConnectionPoint=gk.registry.unregister,t.unregisterConnectionStrategy=cE.registry.unregister,t.unregisterHTMLComponent=lS.componentRegistry.unregister}(_A||(_A={}));class GA{constructor(){this.cells=[]}copy(t,e,n={}){this.options=Object.assign({},n);const i=JM.isModel(e)?e:e.model,r=i.cloneSubGraph(t,n);this.cells=kl(Object.keys(r).map((t=>r[t])),(t=>t.isEdge()?2:1)),this.serialize(n)}cut(t,e,n={}){this.copy(t,e,n);const i=_A.isGraph(e)?e.model:e;i.batchUpdate("cut",(()=>{t.forEach((t=>t.remove()))}))}paste(t,e={}){const n=Object.assign(Object.assign({},this.options),e),{offset:i,edgeProps:r,nodeProps:s}=n;let o=20,a=20;i&&(o="number"===typeof i?i:i.dx,a="number"===typeof i?i:i.dy),this.deserialize(n);const l=this.cells;l.forEach((t=>{t.model=null,t.removeProp("zIndex"),(o||a)&&t.translate(o,a),s&&t.isNode()&&t.prop(s),r&&t.isEdge()&&t.prop(r)}));const c=_A.isGraph(t)?t.model:t;return c.batchUpdate("paste",(()=>{c.addCells(this.cells)})),this.copy(l,t,e),l}serialize(t){!1!==t.useLocalStorage&&IA.save(this.cells)}deserialize(t){if(t.useLocalStorage){const t=IA.fetch();t&&(this.cells=t)}}isEmpty(){return this.cells.length<=0}clean(){this.options={},this.cells=[],IA.clean()}}(function(t){const e=`${KC.prefixCls}.clipboard.cells`;function n(t){if(window.localStorage){const n=t.map((t=>t.toJSON()));localStorage.setItem(e,JSON.stringify(n))}}function i(){if(window.localStorage){const t=localStorage.getItem(e),n=t?JSON.parse(t):[];if(n)return JM.fromJSON(n)}}function r(){window.localStorage&&localStorage.removeItem(e)}t.save=n,t.fetch=i,t.clean=r})(IA||(IA={}));class HA{constructor(t){this.halo=t}get options(){return this.halo.options}get graph(){return this.halo.graph}get model(){return this.halo.model}get view(){return this.halo.view}get cell(){return this.halo.cell}get node(){return this.cell}getPresets(){return{className:"type-node",handles:[{name:"remove",position:"nw",events:{mousedown:this.removeCell.bind(this)},icon:null},{name:"resize",position:"se",events:{mousedown:this.startResize.bind(this),mousemove:this.doResize.bind(this),mouseup:this.stopResize.bind(this)},icon:null},{name:"clone",position:"n",events:{mousedown:this.startClone.bind(this),mousemove:this.doClone.bind(this),mouseup:this.stopClone.bind(this)},icon:null},{name:"link",position:"e",events:{mousedown:this.startLink.bind(this),mousemove:this.doLink.bind(this),mouseup:this.stopLink.bind(this)},icon:null},{name:"fork",position:"ne",events:{mousedown:this.startFork.bind(this),mousemove:this.doFork.bind(this),mouseup:this.stopFork.bind(this)},icon:null},{name:"unlink",position:"w",events:{mousedown:this.unlink.bind(this)},icon:null},{name:"rotate",position:"sw",events:{mousedown:this.startRotate.bind(this),mousemove:this.doRotate.bind(this),mouseup:this.stopRotate.bind(this)},icon:null}],bbox(t){if(this.options.useCellGeometry){const e=t.cell;return e.getBBox()}return t.getBBox()},content(t){const e=Hg("x: <%= x %>, y: <%= y %>, width: <%= width %>, height: <%= height %>, angle: <%= angle %>"),n=t.cell,i=n.getBBox();return e({x:Math.floor(i.x),y:Math.floor(i.y),width:Math.floor(i.width),height:Math.floor(i.height),angle:Math.floor(n.getAngle())})},magnet(t){return t.container},tinyThreshold:40,smallThreshold:80,loopEdgePreferredSide:"top",loopEdgeWidth:40,rotateGrid:15,rotateEmbeds:!1}}removeCell(){this.model.removeConnectedEdges(this.cell),this.cell.remove()}startLink({x:t,y:e}){this.halo.startBatch();const n=this.graph,i=this.createEdgeConnectedToSource();i.setTarget({x:t,y:e}),this.model.addEdge(i,{validation:!1,halo:this.halo.cid,async:!1}),n.view.undelegateEvents(),this.edgeView=n.renderer.findViewByCell(i),this.edgeView.prepareArrowheadDragging("target",{x:t,y:e,fallbackAction:"remove"})}createEdgeConnectedToSource(){const t=this.getMagnet(this.view,"source"),e=this.getEdgeTerminal(this.view,t),n=this.graph.hook.getDefaultEdge(this.view,t);return n.setSource(e),n}getMagnet(t,e){const n=this.options.magnet;if("function"===typeof n){const i=ey(n,this.halo,t,e);if(i instanceof SVGElement)return i}throw new Error("`magnet()` has to return an SVGElement")}getEdgeTerminal(t,e){const n={cell:t.cell.id};if(e!==t.container){const i=e.getAttribute("port");i?n.port=i:n.selector=t.getSelector(e)}return n}doLink({e:t,x:e,y:n}){this.edgeView&&this.edgeView.onMouseMove(t,e,n)}stopLink({e:t,x:e,y:n}){const i=this.edgeView;if(i){i.onMouseUp(t,e,n);const r=i.cell;r.hasLoop()&&this.makeLoopEdge(r),this.halo.stopBatch(),this.halo.trigger("action:edge:addde",{edge:r}),this.edgeView=null}this.graph.view.delegateEvents()}makeLoopEdge(t){let e=null,n=null;const i=this.options.loopEdgeWidth,r=this.graph.options,s=new db(0,0,r.width,r.height),o=this.graph.graphToLocal(this.view.getBBox()),a=[this.options.loopEdgePreferredSide,"top","bottom","left","right"].some((t=>{let r=null,a=0,l=0;switch(t){case"top":r=new ub(o.x+o.width/2,o.y-i),a=i/2;break;case"bottom":r=new ub(o.x+o.width/2,o.y+o.height+i),a=i/2;break;case"left":r=new ub(o.x-i,o.y+o.height/2),l=i/2;break;case"right":r=new ub(o.x+o.width+i,o.y+o.height/2),l=i/2;break;default:break}return!!r&&(e=r.translate(-a,-l),n=r.translate(a,l),s.containsPoint(e)&&s.containsPoint(n))}));a&&e&&n&&t.setVertices([e,n])}startResize({e:t}){this.halo.startBatch(),this.flip=[1,0,0,1,1,0,0,1][Math.floor(ib.normalize(this.node.getAngle())/45)],this.view.addClass("node-resizing"),VS("node:resize",t,this.view)}doResize({e:t,dx:e,dy:n}){const i=this.node.getSize(),r=Math.max(i.width+(this.flip?e:n),1),s=Math.max(i.height+(this.flip?n:e),1);this.node.resize(r,s,{absolute:!0}),VS("node:resizing",t,this.view)}stopResize({e:t}){this.view.removeClass("node-resizing"),VS("node:resized",t,this.view),this.halo.stopBatch()}startClone({e:t,x:e,y:n}){this.halo.startBatch();const i=this.options,r=i.clone(this.cell,{clone:!0});if(!OM.isCell(r))throw new Error("option 'clone()' has to return a cell");this.centerNodeAtCursor(r,e,n),this.model.addCell(r,{halo:this.halo.cid,async:!1});const s=this.graph.renderer.findViewByCell(r);s.onMouseDown(t,e,n),this.halo.setEventData(t,{cloneView:s})}centerNodeAtCursor(t,e,n){const i=t.getBBox().getCenter(),r=e-i.x,s=n-i.y;t.translate(r,s)}doClone({e:t,x:e,y:n}){const i=this.halo.getEventData(t).cloneView;i&&i.onMouseMove(t,e,n)}stopClone({e:t,x:e,y:n}){const i=this.halo.getEventData(t).cloneView;i&&i.onMouseUp(t,e,n),this.halo.stopBatch()}startFork({e:t,x:e,y:n}){this.halo.startBatch();const i=this.options.clone(this.cell,{fork:!0});if(!OM.isCell(i))throw new Error("option 'clone()' has to return a cell");this.centerNodeAtCursor(i,e,n),this.model.addCell(i,{halo:this.halo.cid,async:!1});const r=this.createEdgeConnectedToSource(),s=this.graph.renderer.findViewByCell(i),o=this.getMagnet(s,"target"),a=this.getEdgeTerminal(s,o);r.setTarget(a),this.model.addEdge(r,{halo:this.halo.cid,async:!1}),s.onMouseDown(t,e,n),this.halo.setEventData(t,{cloneView:s})}doFork({e:t,x:e,y:n}){const i=this.halo.getEventData(t).cloneView;i&&i.onMouseMove(t,e,n)}stopFork({e:t,x:e,y:n}){const i=this.halo.getEventData(t).cloneView;i&&i.onMouseUp(t,e,n),this.halo.stopBatch()}startRotate({e:t,x:e,y:n}){this.halo.startBatch();const i=this.node.getBBox().getCenter(),r=[this.node];this.options.rotateEmbeds&&this.node.getDescendants({deep:!0}).reduce(((t,e)=>(e.isNode()&&t.push(e),t)),r),this.halo.setEventData(t,{center:i,nodes:r,rotateStartAngles:r.map((t=>t.getAngle())),clientStartAngle:new ub(e,n).theta(i)}),r.forEach((e=>{const n=this.graph.findViewByCell(e);n&&(n.addClass("node-rotating"),VS("node:rotate",t,n))}))}doRotate({e:t,x:e,y:n}){const i=this.halo.getEventData(t),r=i.clientStartAngle-new ub(e,n).theta(i.center);i.nodes.forEach(((e,n)=>{const s=i.rotateStartAngles[n],o=QC.snapToGrid(s+r,this.options.rotateGrid);e.rotate(o,{absolute:!0,center:i.center,halo:this.halo.cid}),VS("node:rotating",t,this.graph.findViewByCell(e))}))}stopRotate({e:t}){const e=this.halo.getEventData(t);e.nodes.forEach((e=>{const n=this.graph.findViewByCell(e);n.removeClass("node-rotating"),VS("node:rotated",t,n)})),this.halo.stopBatch()}unlink(){this.halo.startBatch(),this.model.removeConnectedEdges(this.cell),this.halo.stopBatch()}}class UA{constructor(t){this.halo=t}get options(){return this.halo.options}get graph(){return this.halo.graph}get model(){return this.halo.model}get view(){return this.halo.view}get cell(){return this.halo.cell}get edge(){return this.cell}getPresets(){return{className:"type-edge",handles:[{name:"remove",position:"nw",icon:null,events:{mousedown:this.removeEdge.bind(this)}},{name:"direction",position:"se",icon:null,events:{mousedown:this.directionSwap.bind(this)}}],content:!1,bbox(t){return t.graph.localToGraph(t.getPointAtRatio(.5))},tinyThreshold:-1,smallThreshold:-1}}removeEdge(){this.cell.remove()}directionSwap(){const t=this.edge.getSource(),e=this.edge.getTarget();this.edge.prop({source:e,target:t})}}class WA extends kS{get type(){return this.options.type||"surround"}get handleOptions(){return this.options}init(t){this.options=ah(WA.defaultOptions,this.cell.isNode()?new HA(this).getPresets():this.cell.isEdge()?new UA(this).getPresets():null,t),this.render(),this.initHandles(),this.update(),this.startListening()}startListening(){const t=this.model,e=this.graph,n=this.view.cell;n.on("removed",this.remove,this),t.on("reseted",this.remove,this),e.on("halo:destroy",this.remove,this),t.on("*",this.update,this),e.on("scale",this.update,this),e.on("translate",this.update,this),super.startListening()}stopListening(){const t=this.model,e=this.graph,n=this.view.cell;this.undelegateEvents(),n.off("removed",this.remove,this),t.off("reseted",this.remove,this),e.off("halo:destroy",this.remove,this),t.off("*",this.update,this),e.off("scale",this.update,this),e.off("translate",this.update,this),super.stopListening()}render(){const t=this.options,e=this.prefixClassName("widget-halo");return this.view.addClass($A.NODE_CLS),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(e).attr("data-shape",this.view.cell.shape),t.className&&this.$container.addClass(t.className),this.$handleContainer=this.$("<div/>").addClass(`${e}-handles`).appendTo(this.container),this.$content=this.$("<div/>").addClass(`${e}-content`).appendTo(this.container),this.$container.appendTo(this.graph.container),this}remove(){return this.stopBatch(),this.view.removeClass($A.NODE_CLS),super.remove()}update(){if(this.isRendered()){this.updateContent();const t=this.getBBox(),e=this.options.tinyThreshold||0,n=this.options.smallThreshold||0;this.$handleContainer.toggleClass(`${this.handleClassName}-tiny`,t.width<e&&t.height<e);const i=`${this.handleClassName}-small`;this.$handleContainer.toggleClass(i,!this.$handleContainer.hasClass(i)&&t.width<n&&t.height<n),this.$container.css({width:t.width,height:t.height,left:t.x,top:t.y}),this.hasHandle("unlink")&&this.toggleUnlink(),"surround"!==this.type&&"toolbar"!==this.type||this.hasHandle("fork")&&this.toggleFork()}}updateContent(){const t=this.options.content;if("function"===typeof t){const e=ey(t,this,this.view,this.$content[0]);e&&this.$content.html(e)}else t?this.$content.html(t):this.$content.remove()}getBBox(){const t=this.view,e=this.options.bbox,n="function"===typeof e?ey(e,this,t):e;return db.create(Object.assign({x:0,y:0,width:1,height:1},n))}removeCell(){this.cell.remove()}toggleFork(){const t=this.view.cell.clone(),e=this.graph.hook.createCellView(t),n=this.graph.hook.validateConnection(this.view,null,e,null,"target");this.$handleContainer.children(".fork").toggleClass("hidden",!n),e.remove()}toggleUnlink(){const t=this.model.getConnectedEdges(this.view.cell).length>0;this.$handleContainer.children(".unlink").toggleClass("hidden",!t)}startBatch(){this.model.startBatch("halo",{halo:this.cid})}stopBatch(){this.model.hasActiveBatch("halo")&&this.model.stopBatch("halo",{halo:this.cid})}}(function(t){t.defaultOptions={type:"surround",clearAll:!0,clearOnBlankMouseDown:!0,useCellGeometry:!1,clone:t=>t.clone().removeZIndex()}})(WA||(WA={})),Object.getOwnPropertyNames(wS.prototype).forEach((t=>{"constructor"!==t&&Object.defineProperty(WA.prototype,t,Object.getOwnPropertyDescriptor(wS.prototype,t))})),function(t){t.NODE_CLS="has-widget-halo"}($A||($A={}));var qA,XA,YA,JA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class ZA extends eE{constructor(t){super(),this.options=Object.assign(Object.assign({},ZA.defaults),t),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName("widget-dnd")),this.draggingGraph=new _A(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1})),this.$container.append(this.draggingGraph.container)}get targetScroller(){const t=this.options.target;return _A.isGraph(t)?t.scroller.widget:t}get targetGraph(){const t=this.options.target;return _A.isGraph(t)?t:t.graph}get targetModel(){return this.targetGraph.model}get snapline(){return this.targetGraph.snapline.widget}start(t,e){const n=e;n.preventDefault(),this.targetModel.startBatch("dnd"),this.$container.addClass("dragging").appendTo(this.options.containerParent||document.body),this.sourceNode=t,this.prepareDragging(t,n.clientX,n.clientY);const i=this.updateNodePosition(n.clientX,n.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:n,node:t,cell:t,view:this.draggingView,x:i.x,y:i.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(ZA.documentEvents,n.data)}isSnaplineEnabled(){return this.snapline&&!this.snapline.disabled}prepareDragging(t,e,n){const i=this.draggingGraph,r=i.model,s=this.options.getDragNode(t,{sourceNode:t,draggingGraph:i,targetGraph:this.targetGraph});s.position(0,0);let o=5;if(this.isSnaplineEnabled()&&(o+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const t=this.targetGraph.transform.getScale();i.scale(t.sx,t.sy),o*=Math.max(t.sx,t.sy)}else i.scale(1,1);this.clearDragging(),this.options.animation&&this.$container.stop(!0,!0),r.resetCells([s]);const a=i.findViewByCell(s);a.undelegateEvents(),a.cell.off("changed"),i.fitToContent({padding:o,allowNewOrigin:"any"});const l=a.getBBox();this.geometryBBox=a.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(l.getTopLeft()),this.draggingNode=s,this.draggingView=a,this.draggingBBox=s.getBBox(),this.padding=o,this.originOffset=this.updateGraphPosition(e,n)}updateGraphPosition(t,e){const n=document.body.scrollTop||document.documentElement.scrollTop,i=this.delta,r=this.geometryBBox,s=this.padding||5,o={left:t-i.x-r.width/2-s,top:e-i.y-r.height/2-s+n};return this.draggingGraph&&this.$container.offset(o),o}updateNodePosition(t,e){const n=this.targetGraph.clientToLocal(t,e),i=this.draggingBBox;return n.x-=i.width/2,n.y-=i.height/2,this.draggingNode.position(n.x,n.y),n}snap({cell:t,current:e,options:n}){const i=t;if(n.snapped){const t=this.draggingBBox;i.position(t.x+n.tx,t.y+n.ty,{silent:!0}),this.draggingView.translate(),i.position(e.x,e.y,{silent:!0}),this.snapOffset={x:n.tx,y:n.ty}}else this.snapOffset=null}onDragging(t){const e=this.draggingView;if(e){t.preventDefault();const n=this.normalizeEvent(t),i=n.clientX,r=n.clientY;this.updateGraphPosition(i,r);const s=this.updateNodePosition(i,r),o=this.targetGraph.options.embedding.enabled,a=(o||this.isSnaplineEnabled())&&this.isInsideValidArea({x:i,y:r});if(o){e.setEventData(n,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const t=e.getEventData(n);a?e.processEmbedding(n,t):e.clearEmbedding(t),this.candidateEmbedView=t.candidateEmbedView}this.isSnaplineEnabled()&&(a?this.snapline.snapOnMoving({e:n,view:e,x:s.x,y:s.y}):this.snapline.hide())}}onDragEnd(t){const e=this.draggingNode;if(e){const n=this.normalizeEvent(t),i=this.draggingView,r=this.draggingBBox,s=this.snapOffset;let o=r.x,a=r.y;s&&(o+=s.x,a+=s.y),e.position(o,a,{silent:!0});const l=this.drop(e,{x:n.clientX,y:n.clientY}),c=t=>{t?(this.onDropped(e),this.targetGraph.options.embedding.enabled&&i&&(i.setEventData(n,{cell:t,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),i.finalizeEmbedding(n,i.getEventData(n)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};iy(l)?(this.undelegateDocumentEvents(),l.then(c)):c(l)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}onDropped(t){this.draggingNode===t&&(this.clearDragging(),this.$container.removeClass("dragging").remove())}onDropInvalid(){const t=this.draggingNode;if(t){const e=this.options.animation;if(e){const n="object"===typeof e&&e.duration||150,i="object"===typeof e&&e.easing||"swing";this.draggingView=null,this.$container.animate(this.originOffset,n,i,(()=>this.onDropped(t)))}else this.onDropped(t)}}isInsideValidArea(t){let e;const n=this.targetGraph,i=this.targetScroller;if(i)if(i.options.autoResize)e=this.getDropArea(i.container);else{const t=this.getDropArea(i.container);e=this.getDropArea(n.container).intersectsWithRect(t)}else e=this.getDropArea(n.container);return e&&e.containsPoint(t)}getDropArea(t){const e=this.$(t),n=e.offset(),i=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return db.create({x:n.left+parseInt(e.css("border-left-width"),10)-r,y:n.top+parseInt(e.css("border-top-width"),10)-i,width:e.innerWidth(),height:e.innerHeight()})}drop(t,e){if(this.isInsideValidArea(e)){const n=this.targetGraph,i=n.model,r=n.clientToLocal(e),s=this.sourceNode,o=this.options.getDropNode(t,{sourceNode:s,draggingNode:t,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),a=o.getBBox();r.x+=a.x-a.width/2,r.y+=a.y-a.height/2;const l=this.snapOffset?1:n.getGridSize();o.position(QC.snapToGrid(r.x,l),QC.snapToGrid(r.y,l)),o.removeZIndex();const c=this.options.validateNode,h=!c||c(o,{sourceNode:s,draggingNode:t,droppingNode:o,targetGraph:n,draggingGraph:this.draggingGraph});return"boolean"===typeof h?h?(i.addCell(o,{stencil:this.cid}),o):null:sy(h).then((t=>t?(i.addCell(o,{stencil:this.cid}),o):null))}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove()}}function KA(t,e={}){const n=JM.isModel(t)?t:(new JM).resetCells(t,{sort:!1,dryrun:!0}),i=n.getNodes(),r=e.columns||1,s=Math.ceil(i.length/r),o=e.dx||0,a=e.dy||0,l=!1!==e.center,c=!0===e.resizeToFit,h=e.marginX||0,u=e.marginY||0,d=[];let p=e.columnWidth;if("compact"===p)for(let b=0;b<r;b+=1){const t=qA.getNodesInColumn(i,b,r);d.push(qA.getMaxDim(t,"width")+o)}else{null!=p&&"auto"!==p||(p=qA.getMaxDim(i,"width")+o);for(let t=0;t<r;t+=1)d.push(p)}const g=qA.accumulate(d,h),f=[];let m=e.rowHeight;if("compact"===m)for(let b=0;b<s;b+=1){const t=qA.getNodesInRow(i,b,r);f.push(qA.getMaxDim(t,"height")+a)}else{null!=m&&"auto"!==m||(m=qA.getMaxDim(i,"height")+a);for(let t=0;t<s;t+=1)f.push(m)}const y=qA.accumulate(f,u);n.startBatch("layout"),i.forEach(((t,n)=>{const i=n%r,s=Math.floor(n/r),h=d[i],u=f[s];let p=0,m=0,b=t.getSize();if(c){let n=h-2*o,i=u-2*a;const r=b.height*(b.width?n/b.width:1),s=b.width*(b.height?i/b.height:1);u<r?n=s:i=r,b={width:n,height:i},t.setSize(b,e)}l&&(p=(h-b.width)/2,m=(u-b.height)/2),t.position(g[i]+o+p,y[s]+a+m,e)})),n.stopBatch("layout")}JA([eE.dispose()],ZA.prototype,"dispose",null),function(t){t.defaults={animation:!1,getDragNode:t=>t.clone(),getDropNode:t=>t.clone()},t.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"}}(ZA||(ZA={})),function(t){function e(t,e){return t.reduce(((t,n)=>Math.max(n.getSize()[e],t)),0)}function n(t,e,n){const i=[];for(let r=n*e,s=r+n;r<s;r+=1)i.push(t[r]);return i}function i(t,e,n){const i=[];for(let r=e,s=t.length;r<s;r+=n)i.push(t[r]);return i}function r(t,e){return t.reduce(((t,e,n)=>(t.push(t[n]+e),t)),[e||0])}t.getMaxDim=e,t.getNodesInRow=n,t.getNodesInColumn=i,t.accumulate=r}(qA||(qA={}));class QA extends eE{constructor(t){if(super(),this.graphs={},this.$groups={},this.options=Object.assign(Object.assign({},QA.defaultOptions),t),this.dnd=new ZA(this.options),this.onSearch=Xm(this.onSearch,200),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(XA.base)).attr("data-not-found-text",this.options.notFoundText||"No matches found"),this.options.collapsable=t.collapsable&&t.groups&&t.groups.some((t=>!1!==t.collapsable)),this.options.collapsable){this.$container.addClass("collapsable");const e=t.groups&&t.groups.every((t=>t.collapsed||!1===t.collapsable));e&&this.$container.addClass("collapsed")}this.$("<div/>").addClass(this.prefixClassName(XA.title)).html(this.options.title).appendTo(this.$container),t.search&&this.$container.addClass("searchable").append(this.renderSearch()),this.$content=this.$("<div/>").addClass(this.prefixClassName(XA.content)).appendTo(this.$container);const e=t.stencilGraphOptions||{};if(t.groups&&t.groups.length)t.groups.forEach((n=>{const i=this.$("<div/>").addClass(this.prefixClassName(XA.group)).attr("data-name",n.name);(null==n.collapsable&&t.collapsable||!1!==n.collapsable)&&i.addClass("collapsable"),i.toggleClass("collapsed",!0===n.collapsed);const r=this.$("<h3/>").addClass(this.prefixClassName(XA.groupTitle)).html(n.title||n.name),s=this.$("<div/>").addClass(this.prefixClassName(XA.groupContent)),o=n.graphOptions,a=new _A(Object.assign(Object.assign(Object.assign({},e),o),{container:document.createElement("div"),model:e.model||new JM,width:n.graphWidth||t.stencilGraphWidth,height:n.graphHeight||t.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));s.append(a.container),i.append(r,s).appendTo(this.$content),this.$groups[n.name]=i,this.graphs[n.name]=a}));else{const n=new _A(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new JM,width:t.stencilGraphWidth,height:t.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.$content.append(n.container),this.graphs[YA.defaultGroupName]=n}return this.startListening(),this}get targetScroller(){const t=this.options.target;return _A.isGraph(t)?t.scroller.widget:t}get targetGraph(){const t=this.options.target;return _A.isGraph(t)?t:t.graph}get targetModel(){return this.targetGraph.model}renderSearch(){return this.$("<div/>").addClass(this.prefixClassName(XA.search)).append(this.$("<input/>").attr({type:"search",placeholder:this.options.placeholder||"Search"}).addClass(this.prefixClassName(XA.searchText)))}startListening(){const t=this.prefixClassName(XA.title),e=this.prefixClassName(XA.searchText),n=this.prefixClassName(XA.groupTitle);this.delegateEvents({[`click .${t}`]:"onTitleClick",[`touchstart .${t}`]:"onTitleClick",[`click .${n}`]:"onGroupTitleClick",[`touchstart .${n}`]:"onGroupTitleClick",[`input .${e}`]:"onSearch",[`focusin .${e}`]:"onSearchFocusIn",[`focusout .${e}`]:"onSearchFocusOut"}),Object.keys(this.graphs).forEach((t=>{const e=this.graphs[t];e.on("cell:mousedown",this.onDragStart,this)}))}stopListening(){this.undelegateEvents(),Object.keys(this.graphs).forEach((t=>{const e=this.graphs[t];e.off("cell:mousedown",this.onDragStart,this)}))}load(t,e){return Array.isArray(t)?this.loadGroup(t,e):this.options.groups&&Object.keys(this.options.groups).forEach((e=>{t[e]&&this.loadGroup(t[e],e)})),this}loadGroup(t,e){const n=this.getModel(e);if(n){const e=t.map((t=>NM.isNode(t)?t:NM.create(t)));n.resetCells(e)}const i=this.getGroup(e);let r=this.options.stencilGraphHeight;i&&null!=i.graphHeight&&(r=i.graphHeight);const s=i&&i.layout||this.options.layout;if(s&&n&&ey(s,this,n,i),!r){const t=this.getGraph(e);t.fitToContent({minWidth:t.options.width,gridHeight:1,padding:i&&i.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(t){const{e:e,node:n}=t;this.dnd.start(n,e)}filter(t,e){const n=Object.keys(this.graphs).reduce(((n,i)=>{const r=this.graphs[i],s=i===YA.defaultGroupName?null:i,o=r.model.getNodes().filter((n=>{let i=!1;i="function"===typeof e?ey(e,this,n,t,s,this):"boolean"===typeof e?e:this.isCellMatched(n,t,e,t.toLowerCase()!==t);const o=r.renderer.findViewByCell(n);return o&&o.$(o.container).toggleClass("unmatched",!i),i})),a=o.length>0,l=this.options,c=new JM;return c.resetCells(o),l.layout&&ey(l.layout,this,c,this.getGroup(i)),this.$groups[i]&&this.$groups[i].toggleClass("unmatched",!a),r.fitToContent({gridWidth:1,gridHeight:1,padding:l.stencilGraphPadding||10}),n||a}),!1);this.$container.toggleClass("not-found",!n)}isCellMatched(t,e,n,i){return!e||!n||Object.keys(n).some((r=>{if("*"===r||t.shape===r){const s=n[r];if("boolean"===typeof s)return s;const o=Array.isArray(s)?s:[s];return o.some((n=>{let r=t.getPropByPath(n);return null!=r&&(r=`${r}`,i||(r=r.toLowerCase()),r.indexOf(e)>=0)}))}return!1}))}onSearch(t){this.filter(t.target.value,this.options.search)}onSearchFocusIn(){this.$container.addClass("is-focused")}onSearchFocusOut(){this.$container.removeClass("is-focused")}onTitleClick(){this.options.collapsable&&(this.$container.toggleClass("collapsed"),this.$container.hasClass("collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(t){const e=this.$(t.target).closest(`.${this.prefixClassName(XA.group)}`);this.toggleGroup(e.attr("data-name")||"");const n=Object.keys(this.$groups).every((t=>{const e=this.getGroup(t),n=this.$groups[t];return e&&!1===e.collapsable||n.hasClass("collapsed")}));this.$container.toggleClass("collapsed",n)}getModel(t){const e=this.getGraph(t);return e?e.model:null}getGraph(t){return this.graphs[t||YA.defaultGroupName]}getGroup(t){const e=this.options.groups;return null!=t&&e&&e.length?e.find((e=>e.name===t)):null}toggleGroup(t){return this.isGroupCollapsed(t)?this.expandGroup(t):this.collapseGroup(t),this}collapseGroup(t){if(this.isGroupCollapsable(t)){const e=this.$groups[t];e&&!this.isGroupCollapsed(t)&&(this.trigger("group:collapse",{name:t}),e.addClass("collapsed"))}return this}expandGroup(t){if(this.isGroupCollapsable(t)){const e=this.$groups[t];e&&this.isGroupCollapsed(t)&&(this.trigger("group:expand",{name:t}),e.removeClass("collapsed"))}return this}isGroupCollapsable(t){const e=this.$groups[t];return e.hasClass("collapsable")}isGroupCollapsed(t){const e=this.$groups[t];return e&&e.hasClass("collapsed")}collapseGroups(){return Object.keys(this.$groups).forEach((t=>this.collapseGroup(t))),this}expandGroups(){return Object.keys(this.$groups).forEach((t=>this.expandGroup(t))),this}resizeGroup(t,e){const n=this.graphs[t];return n&&n.resize(e.width,e.height),this}onRemove(){Object.keys(this.graphs).forEach((t=>{const e=this.graphs[t];e.view.remove(),delete this.graphs[t]})),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}}(function(t){t.defaultOptions=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(t,e){const n={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};KA(t,Object.assign(Object.assign(Object.assign({},n),this.options.layoutOptions),e?e.layoutOptions:{}))}},ZA.defaults)})(QA||(QA={})),function(t){t.base="widget-stencil",t.title=`${t.base}-title`,t.search=`${t.base}-search`,t.searchText=`${t.search}-text`,t.content=`${t.base}-content`,t.group=`${t.base}-group`,t.groupTitle=`${t.group}-title`,t.groupContent=`${t.group}-content`}(XA||(XA={})),function(t){t.defaultGroupName="__default__"}(YA||(YA={}));const tD="1.30.1";function eD(){if(KC.trackable){const t="https://kcart.alipay.com/web/bi.do",e=new Image,n=Object.assign(Object.assign({},KC.trackInfo),{version:tD,pg:document.URL,r:(new Date).getTime(),x6:!0,page_type:"syslog"}),i=encodeURIComponent(JSON.stringify([n]));e.src=`${t}?BIProfile=merge&d=${i}`}}KC.trackable&&setTimeout(eD,3e3);var nD={formatColumnType:function(t){var e=["timestamp","json","bool"];return null==t.decimalDigits||0==t.decimalDigits||e.some((function(e){return e==t.type.toLowerCase()}))?t.type+"("+t.size+")":t.type+"("+t.size+", "+t.decimalDigits+")"},formatColumnName:function(t,e){return e&&t.comment&&""!=t.comment?t.name+" /* "+t.comment+" */":t.name}};String.prototype.byteLength=function(){var t=0;return Array.from(this).map((function(e){e.charCodeAt(0)>255?t+=2:t++})),t},String.prototype.pxWidth=function(){var t=String.prototype.pxWidth.canvas||(String.prototype.pxWidth.canvas=document.createElement("canvas")),e=t.getContext("2d");e.font="normal 12px ms";var n=e.measureText(this);return n.width};var iD={props:{modelData:Array,showComment:{default:!0}},data:function(){return{graph:null}},watch:{showComment:{deep:!0,handler:function(){this.graph.clearCells(),this.redendarUml(this.graph)}},modelData:{handler:function(){this.graph.clearCells(),this.redendarUml(this.graph)}}},mounted:function(){this.init()},methods:{init:function(){this.registerUmlNode();var t=this.createGraphInstance();this.redendarUml(t)},exportUml:function(t){"svg"==t?this.graph.toSVG((function(t){Jy.downloadDataUri(Jy.svgToDataUrl(t),"uml.svg")})):this.graph.toPNG((function(t){Jy.downloadDataUri(t,"uml.png")}),{padding:{top:20,right:30,bottom:40,left:50}})},redendarUml:function(t){var e=this,n=this.modelData.map((function(t){return{id:t.id,tableName:t.name,columns:t.columns,foreignKeys:t.foreignKeys}})),i=20,r=20,s=60,o=60,a=5,l=20;n.forEach((function(n,c){var h=e.calculateMaxHeightInGraphRow(20,n);l=h>l?h:l;var u=e.calculateMaxWidthInNode(n),d=n.columns.map((function(t){var i=nD.formatColumnType(t),r=nD.formatColumnName(t,e.showComment),s="YES"==t.nullable?"normal":"bold";return{id:n.tableName+"."+t.name,group:"columnGroup",attrs:{portBody:{width:u,height:30,refY:11},portNameLabel:{height:30,text:r,fontWeight:s,refY:11},portTypeLabel:{text:i,height:30,refY:11,refX:u-i.pxWidth()-22}}}}));t.addNode({id:n.tableName,x:i,y:r,shape:"er-rect",width:u,height:40,label:n.tableName,ports:d}),i+=u+s,(c+1)%a==0&&(r+=l+o,i=20)}));var c=n.map((function(t){return t.tableName}));n.filter((function(t){return t.foreignKeys&&t.foreignKeys.length>0})).flatMap((function(t){return t.foreignKeys.filter((function(t){return-1!=c.indexOf(t.pkTableName)})).map((function(e){return{shape:"er-edge",source:{cell:t.tableName,port:t.tableName+"."+e.fkColumnName},target:{cell:e.pkTableName,port:e.pkTableName+"."+e.pkColumnName}}}))})).forEach((function(e){return t.addEdge(e)}))},calculateMaxHeightInGraphRow:function(t,e){var n=30*e.columns.length+40;return t>n?t:n},calculateMaxWidthInNode:function(t){var e=this,n=t.tableName.pxWidth();return t.columns.forEach((function(t){var i=nD.formatColumnType(t),r=nD.formatColumnName(t,e.showComment),s=80,o=s+r.pxWidth()+i.pxWidth();o>n&&(n=o)})),n},createGraphInstance:function(){var t=this,e=new _A({container:document.getElementById("diagram-container"),grid:!0,panning:!0,snapline:!0,resizing:!1,keyboard:!0,mousewheel:{enabled:!0,modifiers:["ctrl","meta"]},selecting:{enabled:!0,showNodeSelectionBox:!0},connecting:{snap:!0,allowBlank:!1,allowEdge:!1,highlight:!0,interacting:function(){return{edgeMovable:!0}},createEdge:function(){return e.createEdge({shape:"er-edge",strokeDasharray:5,attrs:{line:{style:{animation:"ant-line 30s infinite linear"}}}})}}});return e.bindKey(["meta+z","ctrl+z"],(function(){return e.history.canUndo()&&e.history.undo(),!1})),e.bindKey(["meta+shift+z","ctrl+shift+z"],(function(){return e.history.canRedo()&&e.history.redo(),!1})),e.bindKey(["Backspace","Delete"],(function(){var t=e.getSelectedCells();t.length&&e.removeCells(t)})),e.on("edge:mouseenter",(function(n){var i=n.edge;i.attr("line/style/animation","running-line 30s infinite linear"),i.attr("line/strokeDasharray",5),t.changeUmlElementStyle(e,i)})),e.on("edge:mouseleave",(function(n){var i=n.edge;i.attr("line/strokeDasharray",0),i.attr("line/style/animation",null),t.resetUmlElementStyle(e,i)})),e.on("edge:dblclick",(function(t){var e=t.cell,n=t.e;e.addTools({name:"edge-editor",args:{event:n}})})),e.isHistoryEnabled()?e.disableHistory():e.enableHistory(),this.graph=e,e},changeUmlElementStyle:function(t,e){var n=t.getCellById(e.source.cell);n.setPortProp(e.source.port,"attrs/portNameLabel",{fill:"#409EFF"}),n.setPortProp(e.source.port,"attrs/portTypeLabel",{fill:"#409EFF"});var i=t.getCellById(e.target.cell);i&&(i.setPortProp(e.target.port,"attrs/portNameLabel",{fill:"#409EFF"}),i.setPortProp(e.target.port,"attrs/portTypeLabel",{fill:"#409EFF"}))},resetUmlElementStyle:function(t,e){var n=t.getCellById(e.source.cell);n.setPortProp(e.source.port,"attrs/portBody",{fill:"#FFF"}),n.setPortProp(e.source.port,"attrs/portNameLabel",{fill:"#303133"}),n.setPortProp(e.source.port,"attrs/portTypeLabel",{fill:"#303133"});var i=t.getCellById(e.target.cell);i&&(i.setPortProp(e.target.port,"attrs/portBody",{fill:"#FFF"}),i.setPortProp(e.target.port,"attrs/portNameLabel",{fill:"#303133"}),i.setPortProp(e.target.port,"attrs/portTypeLabel",{fill:"#303133"}))},registerUmlNode:function(){var t=30;_A.registerPortLayout("erPortPosition",(function(e){return e.map((function(e,n){return{position:{x:0,y:(n+1)*t},angle:0}}))}),!0),_A.registerEdge("er-edge",{inherit:"edge",strokeDasharray:5,connector:{name:"rounded"},router:{name:"manhattan",args:{step:10,maxDirectionChange:90}},attrs:{line:{targetMarker:{name:"classic",args:{size:7,offset:-2}}}},tools:{name:"segments",args:{stopPropagation:!1,precision:500,threshold:20,attrs:{fill:"#444"}}}},!0),_A.registerNode("er-rect",{inherit:"rect",markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{rect:{strokeWidth:1,stroke:"#ddd",fill:"#f5f7fa"},label:{fontWeight:"bold",fill:"#000",fontSize:12}},ports:{groups:{columnGroup:{markup:[{tagName:"rect",selector:"portBody"},{tagName:"text",selector:"portNameLabel"},{tagName:"text",selector:"portTypeLabel"}],attrs:{portBody:{width:100,height:30,refY:20,strokeWidth:1,stroke:"#ddd",fill:"#FFF",magnet:!0},portNameLabel:{ref:"portBody",refX:6,refY:22,fontSize:12},portTypeLabel:{ref:"portBody",refX:95,refY:22,fontSize:12}},position:"erPortPosition"}}}},!0)}}},rD=n(3744);const sD=(0,rD.Z)(iD,[["render",Z]]);var oD=sD,aD={class:"remark-header"},lD={class:"remark-user"},cD={class:"remark-time"},hD={class:"item text remark-content"},uD=(0,y.Uk)("提交");function dD(t,e,n,i,r,s){var o=this,a=(0,y.up)("el-button"),l=(0,y.up)("el-popconfirm"),c=(0,y.up)("el-card"),h=(0,y.up)("el-col"),u=(0,y.up)("el-row"),d=(0,y.up)("el-empty"),p=(0,y.up)("el-pagination"),g=(0,y.up)("el-divider"),f=(0,y.up)("el-input"),m=(0,y.up)("el-drawer"),b=(0,y.Q2)("require-roles");return(0,y.wg)(),(0,y.j4)(m,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=function(t){return r.show=t}),size:"50%"},{title:(0,y.w5)((function(){return[(0,y._)("h2",null,(0,v.zw)(s.title),1)]})),default:(0,y.w5)((function(){return[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(r.pageData.content,(function(t,e){return(0,y.wg)(),(0,y.j4)(u,{key:e},{default:(0,y.w5)((function(){return[(0,y.Wm)(h,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(c,{shadow:"never",class:"remark-card"},{header:(0,y.w5)((function(){return[(0,y._)("div",aD,[(0,y._)("span",null,[(0,y._)("span",lD,(0,v.zw)(t.discussBy.nickname),1),(0,y._)("span",cD,(0,v.zw)(t.createAt),1)]),(0,y.wy)(((0,y.wg)(),(0,y.iD)("span",null,[(0,y.Wm)(l,{"confirm-button-text":"确定","cancel-button-text":"取消",icon:"InfoFilled","icon-color":"red",title:"确定要删除该记录吗?",onConfirm:function(e){return s.onDeleteDiscussion(t.id)}},{reference:(0,y.w5)((function(){return[(0,y.Wm)(a,{type:"danger",icon:"Delete",circle:"",plain:"",size:"small"})]})),_:2},1032,["onConfirm"])])),[[b,["SYS_OWNER","GROUP_OWNER?groupId="+n.groupId,"GROUP_MEMBER?groupId="+n.groupId]]])])]})),default:(0,y.w5)((function(){return[(0,y._)("div",hD,(0,v.zw)(t.content),1)]})),_:2},1024)]})),_:2},1024)]})),_:2},1024)})),128)),0==r.pageData.content.length?((0,y.wg)(),(0,y.j4)(u,{key:0},{default:(0,y.w5)((function(){return[(0,y.Wm)(h,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(d)]})),_:1})]})),_:1})):(0,y.kq)("",!0),(0,y.Wm)(u,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(h,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(p,{layout:"prev, pager, next","hide-on-single-page":!1,currentPage:r.pageData.page,"page-size":r.pageData.size,"page-count":r.pageData.totalPages,onCurrentChange:s.onPageChange},null,8,["currentPage","page-size","page-count","onCurrentChange"])]})),_:1})]})),_:1}),(0,y.Wm)(g),(0,y.wy)(((0,y.wg)(),(0,y.j4)(u,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(h,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(f,{modelValue:r.formData.content,"onUpdate:modelValue":e[0]||(e[0]=function(t){return r.formData.content=t}),rows:5,type:"textarea",placeholder:"请输入内容"},null,8,["modelValue"])]})),_:1})]})),_:1})),[[b,["SYS_OWNER","GROUP_OWNER?groupId="+o.groupId,"GROUP_MEMBER?groupId="+o.groupId]]]),(0,y.Wm)(g),(0,y.wy)(((0,y.wg)(),(0,y.j4)(u,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(h,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(a,{onClick:s.onCreateDiscussion},{default:(0,y.w5)((function(){return[uD]})),_:1},8,["onClick"])]})),_:1})]})),_:1})),[[b,["SYS_OWNER","GROUP_OWNER?groupId="+o.groupId,"GROUP_MEMBER?groupId="+o.groupId]]])]})),_:1},8,["modelValue"])}var pD="/api/v1.0",gD=function(t,e,n){return R.Z["delete"](pD+"/groups/"+t+"/projects/"+e+"/discussions/"+n)},fD=function(t,e,n){return R.Z.post(pD+"/groups/"+t+"/projects/"+e+"/discussions",n)},mD=function(t,e,n){return R.Z.get(pD+"/groups/"+t+"/projects/"+e+"/discussions",{params:n})},yD={props:["groupId","projectId","tableName","columnName","isShowDrawer"],emits:["onClose"],data:function(){return{formData:{content:null},pageFilter:{page:0,size:5,tableName:null,columnName:null},pageData:{content:[],page:0,size:10,totalPages:0},show:this.isShowDrawer}},computed:{title:function(){var t=this.columnName?"."+this.columnName:"";return"["+this.tableName+t+"]"}},watch:{isShowDrawer:{deep:!1,handler:function(t){t&&this.showDiscussionDrawer()}},show:{deep:!1,handler:function(t){t?this.showDiscussionDrawer():this.closeDiscussionDrawer(t)}}},methods:{onCreateDiscussion:function(){var t=this;if(this.formData.content&&""!=this.formData.content){var e={tableName:this.pageFilter.tableName,columnName:this.pageFilter.columnName,content:this.formData.content};fD(this.groupId,this.projectId,e).then((function(e){e.errCode||(t.formData.content=null,t.$message.success("提交成功"),t.onPageChange(1))}))}else this.$message.error("内容不能为空")},onDeleteDiscussion:function(t){var e=this;gD(this.groupId,this.projectId,t).then((function(t){t.errCode||(e.$message.success("删除成功"),e.onPageChange(1))}))},onPageChange:function(t){var e=this;this.pageFilter.page=t-1,mD(this.groupId,this.projectId,this.pageFilter).then((function(t){e.pageData=t.data,e.pageData.page=t.data.number+1}))},showDiscussionDrawer:function(){var t=this;this.tableName?this.pageFilter.tableName=this.tableName:this.pageFilter.tableName=null,this.columnName?this.pageFilter.columnName=this.columnName:this.pageFilter.columnName=null,mD(this.groupId,this.projectId,this.pageFilter).then((function(e){t.pageData=e.data,t.pageData.page=e.data.number+1,t.show=!0}))},closeDiscussionDrawer:function(){this.$emit("onClose",this.show)}}};const bD=(0,rD.Z)(yD,[["render",dD]]);var vD=bD,wD=(0,y.Uk)("新增"),CD=(0,y.Uk)("删除"),xD=(0,y.Uk)("修改"),ED=(0,y.Uk)("无变化"),kD=(0,y._)("div",{id:"overview[-1]",class:"h2"},"Overview",-1),MD={key:1,id:"overview[-1]",class:"h2"},SD=(0,y._)("div",{class:"h3"},"Tables",-1),AD={key:0},DD=["id"],OD=["id"],PD=(0,y.Uk)("Insert"),TD={key:0,class:"table-quote"},ND=(0,y._)("svg",{t:"1649948233819",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7285",width:"16",height:"16"},[(0,y._)("path",{d:"M195.2 458.24a259.84 259.84 0 0 1 177.92-160c92.16-29.44 47.04-128-34.56-102.72C146.56 249.28 32 395.52 32 586.56 32 736 117.12 832 249.28 832s215.04-79.68 215.04-203.52c0-177.28-168-219.52-269.12-170.24z m527.68 0a259.84 259.84 0 0 1 177.92-160c91.2-29.12 48-128-34.56-102.72-192 54.08-306.56 200-306.56 391.36 0 149.12 85.44 245.12 217.28 245.12S992 752.32 992 628.48c0-176.64-167.04-219.84-269.12-170.24z",fill:"#909399","p-id":"7286"})],-1),jD={key:1,class:"table-quote"},LD=(0,y._)("svg",{t:"1649948233819",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7285",width:"16",height:"16"},[(0,y._)("path",{d:"M195.2 458.24a259.84 259.84 0 0 1 177.92-160c92.16-29.44 47.04-128-34.56-102.72C146.56 249.28 32 395.52 32 586.56 32 736 117.12 832 249.28 832s215.04-79.68 215.04-203.52c0-177.28-168-219.52-269.12-170.24z m527.68 0a259.84 259.84 0 0 1 177.92-160c91.2-29.12 48-128-34.56-102.72-192 54.08-306.56 200-306.56 391.36 0 149.12 85.44 245.12 217.28 245.12S992 752.32 992 628.48c0-176.64-167.04-219.84-269.12-170.24z",fill:"#909399","p-id":"7286"})],-1),FD={key:0,class:"h3"},zD=(0,y.Uk)(" PK "),RD=(0,y._)("del",null,[(0,y._)("em",null,"null")],-1),BD=(0,y._)("em",null,"null",-1),ID=(0,y.Uk)(" YES "),$D={key:0},VD={key:1},_D=(0,y._)("div",{class:"h3"},"Indexes",-1),GD=(0,y.Uk)(" UK "),HD={key:2},UD=(0,y._)("div",{class:"h3"},"Foreign Keys",-1),WD={key:3},qD=(0,y._)("div",{class:"h3"},"Triggers",-1),XD={style:{"min-height":"120px"}},YD=(0,y.Uk)("保存");function JD(t,e,n,i,r,s){var o=(0,y.up)("el-tag"),a=(0,y.up)("el-space"),l=(0,y.up)("el-col"),c=(0,y.up)("el-row"),h=(0,y.up)("el-badge"),u=(0,y.up)("el-descriptions-item"),d=(0,y.up)("el-descriptions"),p=(0,y.up)("el-table-column"),g=(0,y.up)("el-input"),f=(0,y.up)("el-button"),m=(0,y.up)("el-table"),b=(0,y.up)("el-tooltip"),w=(0,y.up)("el-link"),C=(0,y.up)("highlightjs"),x=(0,y.up)("el-tab-pane"),E=(0,y.up)("el-option"),k=(0,y.up)("el-select"),M=(0,y.up)("el-tabs"),S=(0,y.up)("el-dialog"),A=(0,y.Q2)("clipboard");return(0,y.wg)(),(0,y.iD)(y.HY,null,[n.diffEnabled?((0,y.wg)(),(0,y.j4)(c,{key:0,style:{"margin-bottom":"12px"}},{default:(0,y.w5)((function(){return[(0,y.Wm)(l,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(a,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(o,{type:"success"},{default:(0,y.w5)((function(){return[wD]})),_:1}),(0,y.Wm)(o,{type:"danger"},{default:(0,y.w5)((function(){return[CD]})),_:1}),(0,y.Wm)(o,{type:"warning"},{default:(0,y.w5)((function(){return[xD]})),_:1}),(0,y.Wm)(o,{type:"info"},{default:(0,y.w5)((function(){return[ED]})),_:1})]})),_:1})]})),_:1})]})),_:1})):(0,y.kq)("",!0),n.overviewData?((0,y.wg)(),(0,y.j4)(c,{key:1,style:{"margin-top":"0px !important"}},{default:(0,y.w5)((function(){return[(0,y.Wm)(l,{span:24},{default:(0,y.w5)((function(){return[n.diffEnabled?((0,y.wg)(),(0,y.j4)(h,{key:0,value:n.overviewDiff.diffType,type:s.diffTagType(n.overviewDiff.diffType),class:"badge-item"},{default:(0,y.w5)((function(){return[kD]})),_:1},8,["value","type"])):((0,y.wg)(),(0,y.iD)("div",MD,"Overview")),(0,y.Wm)(d,{column:1,size:"large",border:""},{default:(0,y.w5)((function(){return[(0,y.Wm)(u,{label:"Database Name","label-align":"left",width:"200px"},{default:(0,y.w5)((function(){return[(0,y.Uk)((0,v.zw)(n.overviewData.databaseName),1)]})),_:1}),(0,y.Wm)(u,{label:"Schema Name","label-align":"left",width:"200px"},{default:(0,y.w5)((function(){return[(0,y.Uk)((0,v.zw)(n.overviewData.schemaName),1)]})),_:1}),(0,y.Wm)(u,{label:"Product Name","label-align":"left"},{default:(0,y.w5)((function(){return[(0,y.Uk)((0,v.zw)(n.overviewData.productName),1)]})),_:1}),(0,y.Wm)(u,{label:"Product Version","label-align":"left"},{default:(0,y.w5)((function(){return[(0,y.Uk)((0,v.zw)(n.overviewData.productVersion),1)]})),_:1}),(0,y.Wm)(u,{label:"Document Version","label-align":"left"},{default:(0,y.w5)((function(){return[(0,y.Uk)((0,v.zw)(n.overviewData.documentVersion),1)]})),_:1}),(0,y.Wm)(u,{label:"Create At","label-align":"left"},{default:(0,y.w5)((function(){return[(0,y.Uk)((0,v.zw)(n.overviewData.createAt),1)]})),_:1})]})),_:1}),SD,(0,y.Wm)(m,{data:s.simpleTables,border:"",width:"80%",onCellDblclick:s.onCellClick,"row-class-name":s.predicateRowClass,"highlight-current-row":""},{default:(0,y.w5)((function(){return[(0,y.Wm)(p,{type:"index"}),(0,y.Wm)(p,{label:"Name","min-width":"160",resizable:""},{default:(0,y.w5)((function(t){return[(0,y._)("span",null,(0,v.zw)(t.row.name),1)]})),_:1}),(0,y.Wm)(p,{prop:"type",label:"Type",width:"200",resizable:""}),(0,y.Wm)(p,{prop:"comment",label:"comment","min-width":"160",resizable:""}),(0,y.Wm)(p,{label:"description","min-width":"160",resizable:""},{default:(0,y.w5)((function(t){return[t.row.toEditDescription?((0,y.wg)(),(0,y.j4)(a,{key:1,direction:"vertical",alignment:"left",style:{width:"100%"}},{default:(0,y.w5)((function(){return[(0,y.Wm)(g,{modelValue:t.row.description,"onUpdate:modelValue":function(e){return t.row.description=e},type:"textarea",style:{width:"100%"},autosize:"","input-style":r.style.noBorderInput,onChange:function(e){return s.onUpdateDescription(t.row.name,null,t.row)}},null,8,["modelValue","onUpdate:modelValue","input-style","onChange"])]})),_:2},1024)):((0,y.wg)(),(0,y.iD)("span",AD,(0,v.zw)(t.row.description),1))]})),_:1}),(0,y.Wm)(p,{prop:"remark",label:"discussion","min-width":"120",resizable:""},{default:(0,y.w5)((function(t){return[t.row.discussionCount?((0,y.wg)(),(0,y.j4)(h,{key:0,value:t.row.discussionCount,max:99,class:"item",type:"info"},{default:(0,y.w5)((function(){return[(0,y.Wm)(f,{onClick:function(e){return s.onRemark(t.row.name)},size:"small",icon:"chat-line-round"},null,8,["onClick"])]})),_:2},1032,["value"])):((0,y.wg)(),(0,y.j4)(f,{key:1,onClick:function(e){return s.onRemark(t.row.name)},size:"small",icon:"chat-line-round"},null,8,["onClick"]))]})),_:1})]})),_:1},8,["data","onCellDblclick","row-class-name"])]})),_:1})]})),_:1})):(0,y.kq)("",!0),((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(s.tables,(function(e){return(0,y.wg)(),(0,y.j4)(c,{key:e.id,style:{"margin-top":"0px !important"}},{default:(0,y.w5)((function(){return[(0,y.Wm)(l,{span:24},{default:(0,y.w5)((function(){return[(0,y._)("div",null,[n.diffEnabled?((0,y.wg)(),(0,y.j4)(h,{key:0,value:e.diffType,type:s.diffTagType(e.diffType),class:"badge-item"},{default:(0,y.w5)((function(){return[(0,y._)("div",{id:e.name+"["+e.id+"]",class:"h2"},(0,v.zw)(e.name),9,DD)]})),_:2},1032,["value","type"])):((0,y.wg)(),(0,y.iD)("div",{key:1,id:e.name+"["+e.id+"]",class:"h2"},[(0,y.Uk)((0,v.zw)(e.name)+" ",1),(0,y.Wm)(b,{content:"SQL 测试数据生成"},{default:(0,y.w5)((function(){return[(0,y.Wm)(f,{onClick:function(t){return s.showMockDataRules(e)},round:"",size:"small"},{default:(0,y.w5)((function(){return[PD]})),_:2},1032,["onClick"])]})),_:2},1024),e.comment&&""!=e.comment?((0,y.wg)(),(0,y.iD)("div",TD,[ND,(0,y.Uk)(" "+(0,v.zw)(e.comment),1)])):e.description&&""!=e.description?((0,y.wg)(),(0,y.iD)("div",jD,[LD,(0,y.Uk)(" "+(0,v.zw)(e.description),1)])):(0,y.kq)("",!0)],8,OD))]),e.columns.length>0?((0,y.wg)(),(0,y.iD)("div",FD," Columns ")):(0,y.kq)("",!0),(0,y.Wm)(m,{data:e.columns,border:"",fit:"",width:"80%",onCellDblclick:s.onCellClick,"row-class-name":s.predicateRowClass,"default-expand-all":"","row-key":"id","highlight-current-row":""},{default:(0,y.w5)((function(){return[(0,y.Wm)(p,{type:"index"}),(0,y.Wm)(p,{prop:"name",label:s.columnFieldNameMapping("name"),"min-width":"120"},{default:(0,y.w5)((function(t){return[(0,y._)("span",null,(0,v.zw)(t.row.name),1)]})),_:1},8,["label"]),(0,y.Wm)(p,{prop:"type",formatter:s.columnTypeFormat,label:s.columnFieldNameMapping("type"),width:"140"},null,8,["formatter","label"]),(0,y.Wm)(p,{width:"120",label:s.columnFieldNameMapping("isPrimaryKey")},{default:(0,y.w5)((function(t){return[t.row.isPrimaryKey?((0,y.wg)(),(0,y.j4)(b,{key:0,content:"YES"},{default:(0,y.w5)((function(){return[(0,y.Wm)(o,null,{default:(0,y.w5)((function(){return[zD]})),_:1})]})),_:1})):(0,y.kq)("",!0)]})),_:1},8,["label"]),(0,y.Wm)(p,{prop:"nullable",label:s.columnFieldNameMapping("nullable"),width:"120"},{default:(0,y.w5)((function(t){return["YES"!=t.row.nullable?((0,y.wg)(),(0,y.j4)(b,{key:0,content:"NO"},{default:(0,y.w5)((function(){return[(0,y.Wm)(o,{type:"info"},{default:(0,y.w5)((function(){return[RD]})),_:1})]})),_:1})):((0,y.wg)(),(0,y.j4)(b,{key:1,content:"YES"},{default:(0,y.w5)((function(){return[(0,y.Wm)(o,{type:"danger"},{default:(0,y.w5)((function(){return[BD]})),_:1})]})),_:1}))]})),_:1},8,["label"]),(0,y.Wm)(p,{prop:"autoIncrement",label:s.columnFieldNameMapping("autoIncrement"),width:"140"},{default:(0,y.w5)((function(t){return["YES"==t.row.autoIncrement?((0,y.wg)(),(0,y.j4)(o,{key:0},{default:(0,y.w5)((function(){return[ID]})),_:1})):(0,y.kq)("",!0)]})),_:1},8,["label"]),(0,y.Wm)(p,{prop:"defaultValue",label:s.columnFieldNameMapping("defaultValue"),"min-width":"120"},null,8,["label"]),(0,y.Wm)(p,{prop:"comment",label:s.columnFieldNameMapping("comment")},null,8,["label"]),(0,y.Wm)(p,{label:s.columnFieldNameMapping("description"),"min-width":"160",resizable:"","show-overflow-tooltip":""},{default:(0,y.w5)((function(t){return[t.row.toEditDescription?((0,y.wg)(),(0,y.j4)(a,{key:1,direction:"vertical",alignment:"left",style:{width:"100%"}},{default:(0,y.w5)((function(){return[(0,y.Wm)(g,{modelValue:t.row.description,"onUpdate:modelValue":function(e){return t.row.description=e},type:"textarea",style:{width:"100%"},autosize:"","input-style":r.style.noBorderInput,onChange:function(n){return s.onUpdateDescription(e.name,t.row.name,t.row)}},null,8,["modelValue","onUpdate:modelValue","input-style","onChange"])]})),_:2},1024)):((0,y.wg)(),(0,y.iD)("span",$D,[(0,y._)("pre",null,(0,v.zw)(t.row.description),1)]))]})),_:2},1032,["label"]),(0,y.Wm)(p,{prop:"remark",label:"discussion","min-width":"60",resizable:""},{default:(0,y.w5)((function(t){return[t.row.discussionCount?((0,y.wg)(),(0,y.j4)(h,{key:0,value:t.row.discussionCount,max:99,class:"item",type:"info"},{default:(0,y.w5)((function(){return[(0,y.Wm)(f,{onClick:function(n){return s.onRemark(e.name,t.row.name)},size:"small",icon:"chat-line-round"},null,8,["onClick"])]})),_:2},1032,["value"])):((0,y.wg)(),(0,y.j4)(f,{key:1,onClick:function(n){return s.onRemark(e.name,t.row.name)},size:"small",icon:"chat-line-round"},null,8,["onClick"]))]})),_:2},1024)]})),_:2},1032,["data","onCellDblclick","row-class-name"]),e.indexes.length>0?((0,y.wg)(),(0,y.iD)("div",VD,[_D,(0,y.Wm)(m,{data:e.indexes,border:"",fit:"",width:"80%","row-class-name":s.predicateRowClass,"default-expand-all":"","row-key":"id","highlight-current-row":""},{default:(0,y.w5)((function(){return[(0,y.Wm)(p,{type:"index"}),(0,y.Wm)(p,{prop:"name",label:s.indexFieldNameMapping("name"),"min-width":"120"},{default:(0,y.w5)((function(t){return[(0,y._)("span",null,(0,v.zw)(t.row.name),1)]})),_:1},8,["label"]),(0,y.Wm)(p,{prop:"isUnique",label:s.indexFieldNameMapping("isUnique"),width:"120"},{default:(0,y.w5)((function(t){return[t.row.isUnique?((0,y.wg)(),(0,y.j4)(b,{key:0,content:"YES"},{default:(0,y.w5)((function(){return[(0,y.Wm)(o,null,{default:(0,y.w5)((function(){return[GD]})),_:1})]})),_:1})):(0,y.kq)("",!0)]})),_:1},8,["label"]),(0,y.Wm)(p,{label:s.indexFieldNameMapping("columnNames"),"min-width":"150"},{default:(0,y.w5)((function(t){return[(0,y.Wm)(a,null,{default:(0,y.w5)((function(){return[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(t.row.columnNames,(function(t,e){return(0,y.wg)(),(0,y.j4)(o,{key:e,type:"info"},{default:(0,y.w5)((function(){return[(0,y.Uk)((0,v.zw)(t),1)]})),_:2},1024)})),128))]})),_:2},1024)]})),_:1},8,["label"])]})),_:2},1032,["data","row-class-name"])])):(0,y.kq)("",!0),e.foreignKeys.length>0?((0,y.wg)(),(0,y.iD)("div",HD,[UD,(0,y.Wm)(m,{data:e.foreignKeys,border:"",fit:"",width:"80%","row-class-name":s.predicateRowClass,"default-expand-all":"","row-key":"id","highlight-current-row":""},{default:(0,y.w5)((function(){return[(0,y.Wm)(p,{type:"index"}),(0,y.Wm)(p,{prop:"fkName",label:s.foreignKeyFieldNameMapping("fkName"),"min-width":"120"},{default:(0,y.w5)((function(t){return[(0,y._)("span",null,(0,v.zw)(t.row.fkName),1)]})),_:1},8,["label"]),(0,y.Wm)(p,{prop:"fkColumnName",label:s.foreignKeyFieldNameMapping("fkColumnName"),"min-width":"120"},{default:(0,y.w5)((function(t){return[(0,y.Wm)(o,{type:"info"},{default:(0,y.w5)((function(){return[(0,y.Uk)((0,v.zw)(t.row.fkColumnName),1)]})),_:2},1024)]})),_:1},8,["label"]),(0,y.Wm)(p,{prop:"pkName",label:s.foreignKeyFieldNameMapping("pkName"),"min-width":"120"},null,8,["label"]),(0,y.Wm)(p,{prop:"pkTableName",label:s.foreignKeyFieldNameMapping("pkTableName")},{default:(0,y.w5)((function(t){return[(0,y.Wm)(w,null,{default:(0,y.w5)((function(){return[(0,y.Uk)((0,v.zw)(t.row.pkTableName),1)]})),_:2},1024)]})),_:1},8,["label"]),(0,y.Wm)(p,{prop:"pkColumnName",label:s.foreignKeyFieldNameMapping("pkColumnName"),"min-width":"120"},{default:(0,y.w5)((function(t){return[(0,y.Wm)(o,{type:"info"},{default:(0,y.w5)((function(){return[(0,y.Uk)((0,v.zw)(t.row.pkColumnName),1)]})),_:2},1024)]})),_:1},8,["label"]),(0,y.Wm)(p,{prop:"updateRule",label:s.foreignKeyFieldNameMapping("updateRule")},null,8,["label"]),(0,y.Wm)(p,{prop:"deleteRule",label:s.foreignKeyFieldNameMapping("deleteRule")},null,8,["label"])]})),_:2},1032,["data","row-class-name"])])):(0,y.kq)("",!0),e.triggers.length>0?((0,y.wg)(),(0,y.iD)("div",WD,[qD,(0,y.Wm)(m,{data:e.triggers,fit:"",border:"",width:"80%","row-class-name":s.predicateRowClass,"default-expand-all":"","row-key":"id","highlight-current-row":""},{default:(0,y.w5)((function(){return[(0,y.Wm)(p,{type:"index"}),(0,y.Wm)(p,{prop:"name",label:t.triggerFieldNameMapping("name"),"min-width":"120"},{default:(0,y.w5)((function(t){return[(0,y._)("span",null,(0,v.zw)(t.row.name),1)]})),_:1},8,["label"]),(0,y.Wm)(p,{prop:"timing",label:t.triggerFieldNameMapping("timing")},null,8,["label"]),(0,y.Wm)(p,{prop:"manipulation",label:t.triggerFieldNameMapping("manipulation"),width:"120"},null,8,["label"]),(0,y.Wm)(p,{prop:"statement",label:t.triggerFieldNameMapping("statement")},null,8,["label"]),(0,y.Wm)(p,{prop:"creatAt",label:t.triggerFieldNameMapping("creatAt"),width:"150"},null,8,["label"])]})),_:2},1032,["data","row-class-name"])])):(0,y.kq)("",!0)]})),_:2},1024)]})),_:2},1024)})),128)),(0,y.Wm)(S,{title:r.mockTableName,modelValue:r.showMockDataDialog,"onUpdate:modelValue":e[2]||(e[2]=function(t){return r.showMockDataDialog=t}),width:"60%"},{footer:(0,y.w5)((function(){return[]})),default:(0,y.w5)((function(){return[(0,y.Wm)(M,{"model-value":"mockDataPane"},{default:(0,y.w5)((function(){return[(0,y.Wm)(x,{label:"SQL 测试数据",name:"mockDataPane"},{default:(0,y.w5)((function(){return[(0,y._)("div",XD,[(0,y.Wm)(C,{language:"sql",code:r.mockDataSql},null,8,["code"]),(0,y.Wm)(b,{content:"点击复制"},{default:(0,y.w5)((function(){return[(0,y.wy)((0,y.Wm)(f,{icon:"copy-document",type:"text",class:"copy-button",onClick:e[0]||(e[0]=function(t){return s.copyMockSql()})},null,512),[[A,r.mockDataSql,"copy"],[A,s.handleCopySuccess,"success"],[A,s.handleCopyFail,"error"]])]})),_:1})])]})),_:1}),(0,y.Wm)(x,{label:"生成规则",name:"mockRulePane"},{default:(0,y.w5)((function(){return[(0,y.Wm)(m,{data:r.mockDataRules},{default:(0,y.w5)((function(){return[(0,y.Wm)(p,{prop:"columnName",label:"名称"}),(0,y.Wm)(p,{prop:"columnType",label:"类型"},{default:(0,y.w5)((function(t){return[(0,y.Wm)(o,null,{default:(0,y.w5)((function(){return[(0,y.Uk)((0,v.zw)(t.row.columnType),1)]})),_:2},1024)]})),_:1}),(0,y.Wm)(p,{prop:"mockDataType",label:"Mock 类型"},{default:(0,y.w5)((function(t){return[(0,y.Wm)(k,{modelValue:t.row.mockDataType,"onUpdate:modelValue":function(e){return t.row.mockDataType=e},placeholder:"请选择 Mock 类型"},{default:(0,y.w5)((function(){return[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(r.mockDataTypes,(function(t){return(0,y.wg)(),(0,y.j4)(E,{key:t.value,label:t.name,value:t.value},null,8,["label","value"])})),128))]})),_:2},1032,["modelValue","onUpdate:modelValue"])]})),_:1}),(0,y.Wm)(p,{prop:"dependentTableName",label:"依赖表"},{default:(0,y.w5)((function(t){return["REF"==t.row.mockDataType?((0,y.wg)(),(0,y.j4)(k,{key:0,modelValue:t.row.dependentTableName,"onUpdate:modelValue":function(e){return t.row.dependentTableName=e},placeholder:"选择关联表",onChange:function(e){return t.row.dependentColumnName=null}},{default:(0,y.w5)((function(){return[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(r.mockRefTables,(function(t){return(0,y.wg)(),(0,y.j4)(E,{key:t.name,label:t.name,value:t.name},null,8,["label","value"])})),128))]})),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):(0,y.kq)("",!0)]})),_:1}),(0,y.Wm)(p,{prop:"dependentColumnName",label:"依赖列"},{default:(0,y.w5)((function(t){return["REF"==t.row.mockDataType?((0,y.wg)(),(0,y.j4)(k,{key:0,modelValue:t.row.dependentColumnName,"onUpdate:modelValue":function(e){return t.row.dependentColumnName=e},placeholder:"选择关联列"},{default:(0,y.w5)((function(){return[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(s.mockRefColumns(t.row.dependentTableName),(function(t){return(0,y.wg)(),(0,y.j4)(E,{key:t.name,label:t.name,value:t.name},null,8,["label","value"])})),128))]})),_:2},1032,["modelValue","onUpdate:modelValue"])):(0,y.kq)("",!0)]})),_:1}),(0,y.Wm)(p,{prop:"mockDataScript",label:"脚本"},{default:(0,y.w5)((function(t){return["SCRIPT"==t.row.mockDataType?((0,y.wg)(),(0,y.j4)(g,{key:0,modelValue:t.row.mockDataScript,"onUpdate:modelValue":function(e){return t.row.mockDataScript=e},autosize:{minRows:2,maxRows:4},type:"textarea",placeholder:"表达式"},null,8,["modelValue","onUpdate:modelValue"])):(0,y.kq)("",!0)]})),_:1})]})),_:1},8,["data"]),(0,y.Wm)(f,{style:{"margin-top":"33px"},onClick:e[1]||(e[1]=function(t){return s.saveTableMockRules()})},{default:(0,y.w5)((function(){return[YD]})),_:1})]})),_:1})]})),_:1})]})),_:1},8,["title","modelValue"])],64)}n(8862),n(3123);var ZD="/api/v1.0",KD=function(t,e,n){return R.Z.post(ZD+"/groups/"+t+"/projects/"+e+"/descriptions",n)},QD=n(4339),tO=n(6631),eO="/api/v1.0",nO=function(t,e,n){return R.Z.get(eO+"/groups/"+t+"/projects/"+e+"/mock_rules",{params:n})},iO=function(t,e,n,i){return R.Z.post(eO+"/groups/"+t+"/projects/"+e+"/tables/"+n+"/mock_rules",i)},rO=function(t,e,n){return R.Z.get(eO+"/groups/"+t+"/projects/"+e+"/mock_data/sql",{params:n})},sO={props:["overviewData","tablesData","overviewDiff","tablesDiff","diffEnabled","docVersion"],emits:["onRemark"],data:function(){return{templateProperties:{columnFieldNameMap:new Map,indexFieldNameMap:new Map,triggerFieldNameMap:new Map,foreignKeyFieldNameMap:new Map},showMockDataDialog:!1,mockDataRules:[],mockRefTables:[],mockDataTypes:[{name:"自动",value:"AUTO",icon:"Sunny"},{name:"关联",value:"REF"},{name:"脚本",value:"SCRIPT"},{name:"手机号",value:"PHONE",icon:"cellphone"},{name:"头像",value:"AVATAR_URL",icon:"avatar"},{name:"UUID",value:"UUID"},{name:"邮箱",value:"EMAIL",icon:"box"},{name:"姓名",value:"FULL_NAME",icon:"credit-card"},{name:"地址",value:"FULL_ADDRESS"}],mockTableId:null,mockTableName:"",mockDataSql:"",style:{noBorderInput:{border:"none"}}}},created:function(){var t=this,e=sessionStorage.getItem(QD.b);if(e){var n=JSON.parse(sessionStorage.getItem(QD.b)),i=new Map(n.columnFieldNameProperties.map((function(t){return[t.key,t]}))),r=new Map(n.indexFieldNameProperties.map((function(t){return[t.key,t]}))),s=new Map(n.triggerFieldNameProperties.map((function(t){return[t.key,t]}))),o=new Map(n.foreignKeyFieldNameProperties.map((function(t){return[t.key,t]}))),a={columnFieldNameMap:i,indexFieldNameMap:r,triggerFieldNameMap:s,foreignKeyFieldNameMap:o};this.templateProperties=a}else(0,tO.D)().then((function(e){if(!e.errCode){sessionStorage.setItem(QD.b,JSON.stringify(e.data));var n=new Map(e.data.columnFieldNameProperties.map((function(t){return[t.key,t]}))),i=new Map(e.data.indexFieldNameProperties.map((function(t){return[t.key,t]}))),r=new Map(e.data.triggerFieldNameProperties.map((function(t){return[t.key,t]}))),s=new Map(e.data.foreignKeyFieldNameProperties.map((function(t){return[t.key,t]}))),o={columnFieldNameMap:n,indexFieldNameMap:i,triggerFieldNameMap:r,foreignKeyFieldNameMap:s};t.templateProperties=o}}))},computed:{simpleTables:function(){var t=this,e=this.overviewData.tables.filter((function(t){return-1!=t.id})).map((function(e){return t.diffEnabled&&t.overviewDiff.tableDiffMap&&t.overviewDiff.tableDiffMap.get(e.name)?e.diffType=t.overviewDiff.tableDiffMap.get(e.name).diffType:e.diffType=null,e}));return this.diffEnabled&&this.overviewDiff.tableDiffMap.forEach((function(t){if("REMOVED"==t.diffType){var n=t.original;n.diffType="REMOVED",e.push(n)}})),e},tables:function(){if(this.diffEnabled){var t=this.tablesDiff.tableDiffMap,e=function(t,e){e.forEach((function(e){if("REMOVED"==e.diffType){var n=e.original;n.diffType="REMOVED",t.push(n)}}))},n=function(t,e){if("MODIFIED"==e.diffType){var n=Object.assign({},e.original);n.isOriginal=!0,t.children=[n]}},i=function(t,e){return t.map((function(t){var i=Object.assign({},t);if(e.get(t.name)){var r=e.get(t.name);i.diffType=r.diffType,n(i,r)}return i}))};return this.tablesData.map((function(n){var r=Object.assign({},n);if(t.get(n.name)){var s=t.get(n.name),o=i(n.columns,s.columnDiffMap);e(o,s.columnDiffMap);var a=i(n.indexes,s.indexDiffMap);e(a,s.indexDiffMap);var l=i(n.triggers,s.triggerDiffMap);e(l,s.triggerDiffMap);var c=i(n.foreignKeys,s.foreignKeyDiffMap);e(c,s.foreignKeyDiffMap),r.diffType=s.diffType,r.columns=o,r.indexes=a,r.triggers=l,r.foreignKeys=c}return r}))}return this.tablesData}},methods:{onRemark:function(t,e){this.$emit("onRemark",t,e)},columnNameArray:function(t){return t?t.split(","):[]},columnTypeFormat:function(t){return null==t.decimalDigits?t.type+"("+t.size+")":t.type+"("+t.size+", "+t.decimalDigits+")"},onCellClick:function(t){"REMOVED"==t.diffType||t.isOriginal||(1==t.toEditDescription?t.toEditDescription=!1:t.toEditDescription=!0)},onUpdateDescription:function(t,e,n){var i=this,r="";r=n.description?n.description:"";var s=this.$route.params.projectId,o=this.$route.params.groupId,a={tableName:t,columnName:e,content:r};KD(o,s,a).then((function(t){t.errCode||(i.$message.success("修改成功"),n.toEditDescription=!1)}))},diffTagType:function(t){return"REMOVED"==t?"danger":"MODIFIED"==t?"warning":"ADDED"==t?"success":"info"},predicateRowClass:function(t){var e=t.row,n=e.diffType;return"REMOVED"==n?"removed-item":"MODIFIED"==n||e.isOriginal?e.isOriginal?"modified-original-item":"modified-item":"ADDED"==n?"added-item":""},columnFieldNameMapping:function(t){var e=this.templateProperties.columnFieldNameMap.get(t);return e.value?e.value:e.defaultValue},indexFieldNameMapping:function(t){var e=this.templateProperties.indexFieldNameMap.get(t);return e.value?e.value:e.defaultValue},triggerdNameMapping:function(t){var e=this.templateProperties.triggerFieldNameMap.get(t);return e.value?e.value:e.defaultValue},foreignKeyFieldNameMapping:function(t){var e=this.templateProperties.foreignKeyFieldNameMap.get(t);return e.value?e.value:e.defaultValue},showMockDataRules:function(t){var e=this,n=t.id;this.showMockDataDialog=!0,this.mockTableId=t.id,this.mockTableName=t.name;var i=this.$route.params.projectId,r=this.$route.params.groupId,s={tableId:n,version:this.docVersion};nO(r,i,s).then((function(t){t.errCode||(e.mockDataRules=t.data)})),this.generateMockSql(n)},generateMockSql:function(t){var e=this;this.mockDataSql="";var n=this.$route.params.projectId,i=this.$route.params.groupId,r={tableId:t,version:this.docVersion};rO(i,n,r).then((function(t){t.errCode||(e.mockDataSql=t.data)})),U(n,{version:this.docVersion}).then((function(t){t.errCode||(e.mockRefTables=t.data)}))},mockRefColumns:function(t){return t&&this.mockRefTables.find((function(e){return e.name==t}))?this.mockRefTables.find((function(e){return e.name==t})).columns:[]},saveTableMockRules:function(){var t=this,e=this.$route.params.projectId,n=this.$route.params.groupId;iO(n,e,this.mockTableId,this.mockDataRules).then((function(e){e.errCode||(t.$message.success("保存成功"),t.generateMockSql(t.mockTableId))}))},copyMockSql:function(){},handleCopySuccess:function(){this.$message.success("复制成功")},handleCopyFail:function(){this.$message.success("复制失败,请手动复制")}}};const oO=(0,rD.Z)(sO,[["render",JD]]);var aO=oO,lO=(0,y.Uk)(" 同步");function cO(t,e,n,i,r,s){var o=(0,y.up)("arrow-down"),a=(0,y.up)("el-icon"),l=(0,y.up)("el-button"),c=(0,y.up)("circle-check"),h=(0,y.up)("el-tooltip"),u=(0,y.up)("el-progress"),d=(0,y.up)("warning"),p=(0,y.up)("loading"),g=(0,y.up)("el-dropdown-item"),f=(0,y.up)("el-dropdown-menu"),m=(0,y.up)("el-dropdown"),b=(0,y.Q2)("require-roles");return(0,y.wy)(((0,y.wg)(),(0,y.j4)(m,null,{dropdown:(0,y.w5)((function(){return[n.projectTaskData.tasks.length>0?((0,y.wg)(),(0,y.j4)(f,{key:0},{default:(0,y.w5)((function(){return[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(n.projectTaskData.tasks,(function(t){return(0,y.wg)(),(0,y.j4)(g,{key:t.taskId,onClick:function(e){return s.onProgressBarClick(t)}},{default:(0,y.w5)((function(){return["FINISHED"==t.status?((0,y.wg)(),(0,y.j4)(u,{key:0,percentage:100,status:s.taskStatusToProgressStatus(t),style:{width:"150px"}},{default:(0,y.w5)((function(){return[(0,y.Wm)(h,{content:"点击刷新文档"},{default:(0,y.w5)((function(){return[(0,y.Wm)(a,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(c)]})),_:1})]})),_:1})]})),_:2},1032,["status"])):"FAILED"==t.status?((0,y.wg)(),(0,y.j4)(u,{key:1,percentage:100,status:s.taskStatusToProgressStatus(t),style:{width:"150px"}},{default:(0,y.w5)((function(){return[(0,y.Wm)(h,{content:t.result},{default:(0,y.w5)((function(){return[(0,y.Wm)(a,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(d)]})),_:1})]})),_:2},1032,["content"])]})),_:2},1032,["status"])):((0,y.wg)(),(0,y.j4)(u,{key:2,percentage:100,indeterminate:!0,duration:5,style:{width:"150px"}},{default:(0,y.w5)((function(){return[(0,y.Wm)(a,null,{default:(0,y.w5)((function(){return[(0,y.Wm)(p)]})),_:1})]})),_:1}))]})),_:2},1032,["onClick"])})),128))]})),_:1})):(0,y.kq)("",!0)]})),default:(0,y.w5)((function(){return[(0,y.wy)(((0,y.wg)(),(0,y.j4)(l,{type:"success",style:{width:"100%"},icon:"Refresh",onClick:e[0]||(e[0]=function(t){return s.onSync()}),loading:n.loading},{default:(0,y.w5)((function(){return[lO,(0,y.Wm)(a,{style:{"margin-left":"8px"}},{default:(0,y.w5)((function(){return[(0,y.Wm)(o)]})),_:1})]})),_:1},8,["loading"])),[[b,["SYS_OWNER","GROUP_OWNER?groupId="+n.projectData.groupId,"GROUP_MEMBER?groupId="+n.projectData.groupId]]])]})),_:1})),[[b,["SYS_OWNER","GROUP_OWNER?groupId="+n.projectData.groupId,"GROUP_MEMBER?groupId="+n.projectData.groupId]]])}var hO={props:["projectTaskData","projectData","loading"],emits:["onSync","onProgressBarClick"],methods:{taskStatusToProgressStatus:function(t){return"NEW"==t.status||"RUNNING"==t.status?"":"FAILED"==t.status?"exception":"FINISHED"==t.status?"success":void 0},onProgressBarClick:function(t){this.$emit("onProgressBarClick",t)},onSync:function(){this.$emit("onSync")}}};const uO=(0,rD.Z)(hO,[["render",cO]]);var dO=uO,pO={components:{Diagram:oD,DocumentDiscussion:vD,DocumentList:aO,DocumentSyncTaskDropdown:dO},setup:function(){var t=(0,z.yj)(),e=(0,F.qj)({handleSync:!1,loadingVersions:!1,export:!1,init:!1,multiSelectionModeChanging:!1}),n=(0,F.qj)({simpleDocumentData:null,documentFilter:{version:null},projectId:t.params.projectId,groupId:t.params.groupId}),i=(0,F.qj)({pageFilter:{page:0,size:10},totalPage:0,versions:[]}),r=(0,F.qj)({value:[{id:-1,name:"概览"}],checkedValue:[{id:-1,name:"概览"}],treeProps:{children:"children",label:"name"},isMultiSelectionMode:!1}),s=(0,F.iH)(),o=(0,F.iH)("");(0,y.YP)(o,(function(t){s.value.filter(t)}));var a=function(t,e){return!t||(!!e.name.includes(t)||(!(!e.comment||!e.comment.includes(t))||!(!e.description||!e.description.includes(t))))},l=(0,F.Fl)((function(){return r.checkedValue.map((function(t){return t.id}))})),c=(0,F.qj)({tables:[],overview:{}}),h=(0,F.qj)({showComment:!1,tables:[]}),u=(0,F.iH)("tableDocument"),d=function(e,i){var r=n.simpleDocumentData.id;I(t.params.projectId,r,e).then((function(t){t.errCode?C("warn","加载数据异常,请稍后再试"):i(t.data)}))},p=function(t){r.isMultiSelectionMode?-1==t.id?g("overview[-1]"):g(t.name+"["+t.id+"]"):-1==t.id?(c.overview=n.simpleDocumentData,c.tables=[],h.tables=[]):d([t.id],(function(t){c.overview=null,c.tables=t,h.tables=t}))},g=function(t){var e=document.getElementById(t);if(e){var n=-100,i=e.offsetTop,r=e.offsetParent;while(null!==r)i+=r.offsetTop,r=r.offsetParent;window.scrollTo({top:i+n,behavior:"smooth"})}},f=function(){d(s.value.getCheckedKeys(),(function(t){s.value.getCheckedKeys().some((function(t){return-1==t}))?c.overview=n.simpleDocumentData:c.overview=null,c.tables=t,h.tables=t}))},m=function(t){if(e.multiSelectionModeChanging=!0,t)f();else{var n=s.value.getCurrentNode();r.checkedValue=r.value.map((function(t){return{id:t.id,name:t.name}})),p(null==n?{id:-1}:n)}e.multiSelectionModeChanging=!1},b=function(){var o=(0,L.Z)(regeneratorRuntime.mark((function o(){var a,l,u,p;return regeneratorRuntime.wrap((function(o){while(1)switch(o.prev=o.next){case 0:return o.next=2,_(t.params.projectId);case 2:return a=o.sent,i.versions=a.data.content,i.totalPage=a.data.totalPages,o.next=7,$(t.params.projectId,n.documentFilter);case 7:l=o.sent,l.errCode?C("error","同步失败:"+l.errMessage):l.data?(n.simpleDocumentData=l.data,n.groupId=t.params.groupId,n.projectId=t.params.projectId,r.value=l.data.tables,r.value.unshift({id:-1,name:"概览"}),r.isMultiSelectionMode?(u=new Set(s.value.getCheckedNodes().map((function(t){return t.name}))),p=r.value.filter((function(t){return u.has(t.name)})).map((function(t){return{id:t.id,name:t.name}})),r.checkedValue=p,d(p.map((function(t){return t.id})),(function(t){p.some((function(t){return-1==t.id}))?c.overview=n.simpleDocumentData:c.overview=null,c.tables=t,h.tables=t}))):(r.checkedValue=r.value.map((function(t){return{id:t.id,name:t.name}})),c.overview=l.data,c.tables=[])):C("warn","无可用数据"),e.init=!0;case 10:case"end":return o.stop()}}),o)})));return function(){return o.apply(this,arguments)}}();b();var v=(0,F.Fl)((function(){return!n.simpleDocumentData&&e.init})),w=(0,F.Fl)((function(){return!n.simpleDocumentData&&!e.init})),C=function(t,e){(0,X.z8)({showClose:!0,message:e,type:t,duration:3e3})},x=function(){var t=(0,L.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.loadingVersions=!0,b(),C("success","切换成功"),e.loadingVersions=!1;case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),E=function(){var i=t.params.projectId;e.export=!0,H(i,{version:n.documentFilter.version,fileType:"MARKDOWN"},n.simpleDocumentData.databaseName,(function(){return e.export=!1}))},k=(0,F.iH)(),M=function(t){k.value?k.value.exportUml(t):(0,X.z8)({message:"请先切换到 UML 标签页面",type:"warning",group:!0})},S=A((0,L.Z)(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e.loadingVersions=!0,!(i.pageFilter.page+1<i.totalPage)){n.next=8;break}return i.pageFilter.page++,n.next=5,_(t.params.projectId,i.pageFilter);case 5:r=n.sent,i.totalPage=r.data.totalPages,r.data.content.length>0&&r.data.content.forEach((function(t){return i.versions.push(t)}));case 8:e.loadingVersions=!1;case 9:case"end":return n.stop()}}),n)}))),800);function A(t,e){var n=null;return function(){var i=this,r=arguments;n&&clearTimeout(n),n=setTimeout((function(){t.apply(i,r)}),e)}}var D=(0,F.iH)({tableName:null,columnName:null,groupId:null,projectId:null,isShowDrawer:!1}),O=function(t,e){D.value={tableName:t,columnName:e,isShowDrawer:!0,groupId:n.groupId,projectId:n.projectId}},P=function(t){t&&(u.value=t.props.name)},T=(0,F.qj)({diffModeEnabled:!1,originalVersion:null,overviewDiff:{diffType:"NONE",tableDiffMap:new Map},tablesDiff:{diffType:"NONE",tableDiffMap:new Map}}),N=function(){T.tablesDiff={diffType:"NONE",tableDiffMap:new Map},T.overviewDiff={diffType:"NONE",tableDiffMap:new Map}},R=function(){return new Promise((function(t){T.diffModeEnabled?(N(),T.originalVersion=null,T.diffModeEnabled=!1):T.diffModeEnabled=!0,t()}))},B=function(){if(T.originalVersion){var t=T.originalVersion,e=n.documentFilter.version;G(n.projectId,{originalVersion:t,currentVersion:e}).then((function(t){if(!t.errCode){var e=t.data,n=e.fields.find((function(t){return"tables"==t.fieldName})),i={};i.diffType=e.diffType,e.fields.filter((function(t){return"tables"!=t.fieldName})).forEach((function(t){Object.defineProperty(i,t.fieldName,{value:{diffType:t.diffType}})}));var r=new Map(n.fields.map((function(t){return[t.fieldName,{diffType:t.diffType,original:t.original,current:t.current}]})));i.tableDiffMap=r,T.overviewDiff=i;var s=function(t){var e=new Map(t.fields.find((function(t){return"columns"==t.fieldName})).fields.map((function(t){return[t.fieldName,{diffType:t.diffType,original:t.original,current:t.current}]}))),n=new Map(t.fields.find((function(t){return"indexes"==t.fieldName})).fields.map((function(t){return[t.fieldName,{diffType:t.diffType,original:t.original,current:t.current}]}))),i=new Map(t.fields.find((function(t){return"triggers"==t.fieldName})).fields.map((function(t){return[t.fieldName,{diffType:t.diffType,original:t.original,current:t.current}]}))),r=new Map(t.fields.find((function(t){return"foreignKeys"==t.fieldName})).fields.map((function(t){return[t.fieldName,{diffType:t.diffType,original:t.original,current:t.current}]})));return{diffType:t.diffType,name:t.fieldName,columnDiffMap:e,indexDiffMap:n,triggerDiffMap:i,foreignKeyDiffMap:r}},o=new Map(n.fields.map((function(t){return[t.fieldName,s(t)]})));T.tablesDiff.diffType=n.diffType,T.tablesDiff.tableDiffMap=o}}))}else N()},U=(0,F.qj)({tasks:[]}),W=function(){var n=t.params.projectId;e.handleSync=!0,V(n).then((function(t){!t.errCode&&t.data&&(U.tasks.push({taskId:t.data,status:"NEW"}),C("success","后台同步任务创建成功")),e.handleSync=!1})).catch((function(){return e.handleSync=!1}))},J=function(t){return"NEW"==t.status||"RUNNING"==t.status?"":"FAILED"==t.status?"exception":"FINISHED"==t.status?"success":void 0},Z=function(t){if("NEW"!=t.status&&"RUNNING"!=t.status){if("FAILED"!=t.status)return"FINISHED"==t.status?(K(),void(U.tasks=U.tasks.filter((function(e){return e.taskId!=t.taskId})))):void 0;U.tasks=U.tasks.filter((function(e){return e.taskId!=t.taskId}))}},K=function(){b(),(0,Y.bM)({grouping:!0,type:"success",title:"刷新成功",message:"文档已更新为最新内容"})},Q=setInterval((function(){var t=U.tasks.find((function(t){return"NEW"==t.status||"RUNNING"==t.status}));if(U.tasks.length>0&&t){var e={taskIdIn:U.tasks.map((function(t){return t.taskId}))};(0,q.Dg)(n.projectId,e).then((function(t){if(!t.errCode){var e=new Map(t.data.map((function(t){return[t.taskId,t]})));U.tasks.forEach((function(t){if(e.has(t.taskId)){var n=e.get(t.taskId);"FINISHED"!=t.status&&"FINISHED"==n.status&&(0,Y.bM)({grouping:!0,type:"success",title:"文档同步成功",message:"同步任务已执行完成,点击即可刷新文档内容",onClick:K}),"FAILED"!=t.status&&"FAILED"==n.status&&(0,Y.bM)({grouping:!0,type:"error",title:"文档同步失败",message:"错误:"+n.result}),t.status=n.status,t.result=n.result}}))}}))}}),3e3),tt=setInterval((function(){var t={taskStatusIn:["NEW","RUNNING"]};(0,q.Dg)(n.projectId,t).then((function(t){if(!t.errCode){var e,n=new Set(U.tasks.map((function(t){return t.taskId}))),i=t.data.filter((function(t){return!n.has(t.taskId)}));(e=U.tasks).push.apply(e,j(i))}}))}),3e3);return(0,y.Jd)((function(){clearInterval(Q),clearInterval(tt)})),{tocData:r,defaultCheckedKeys:l,documentData:c,projectData:n,versionData:i,umlData:h,loadings:e,isShowNoDataPage:v,isShowLoadingPage:w,treeRef:s,umlDiagramComponentRef:k,onTocNodeClick:p,onTocNodeCheckChange:f,onMultiSelectionModeChange:m,loadMoreDocumentVersions:S,onProjectDocumentVersionChange:x,onSyncProjectDocument:W,onMarkdownExport:E,onUmlExport:M,documentDiscussionData:D,showDiscussionDrawer:O,activeTab:u,onTabClick:P,documentDiffData:T,onDiffModeChange:R,onProjectDocumentCompareVersionChange:B,searchTables:a,searchTableText:o,projectTaskData:U,taskStatusToProgressStatus:J,onClickTaskProgress:Z}}};const gO=(0,rD.Z)(pO,[["render",A]]);var fO=gO}}]);
//# sourceMappingURL=83-legacy.baa0174c.js.map