You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
797 KiB

(self["webpackChunkdatabasir_frontend"]=self["webpackChunkdatabasir_frontend"]||[]).push([[898],{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,g=0,p=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(g=Math.max(Math.abs(d),Math.abs(u)),(!n||g<n)&&(n=g,c(r,g)&&(n/=40)),c(r,g)&&(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();p=i.clientX-b.left,f=i.clientY-b.top}return i.deltaX=u,i.deltaY=d,i.deltaFactor=n,i.offsetX=p,i.offsetY=f,i.deltaMode=0,o.unshift(i,l,u,d),e&&clearTimeout(e),e=setTimeout(h,200),(t.event.dispatch||t.event.handle).apply(this,o)}}function h(){n=null}function c(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,h=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},c=o.push,u=o.indexOf,d={},g=d.toString,p=d.hasOwnProperty,f=p.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},C=r.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function x(t,e,n){n=n||C;var i,r,s=n.createElement("script");if(s.text=t,e)for(i in w)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[g.call(t)]||"object":typeof t}var M="3.6.0",A=function(t,e){return new A.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)}A.fn=A.prototype={jquery:M,constructor:A,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=A.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return A.each(this,t)},map:function(t){return this.pushStack(A.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(A.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(A.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:c,sort:o.sort,splice:o.splice},A.extend=A.fn.extend=function(){var t,e,n,i,r,s,o=arguments[0]||{},a=1,l=arguments.length,h=!1;for("boolean"===typeof o&&(h=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&&(h&&i&&(A.isPlainObject(i)||(r=Array.isArray(i)))?(n=o[e],s=r&&!Array.isArray(n)?[]:r||A.isPlainObject(n)?n:{},r=!1,o[e]=A.extend(h,s,i)):void 0!==i&&(o[e]=i));return o},A.extend({expando:"jQuery"+(M+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]"!==g.call(t))&&(e=a(t),!e||(n=p.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))?A.merge(n,"string"===typeof t?[t]:t):c.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 h(o)},guid:1,support:y}),"function"===typeof Symbol&&(A.fn[Symbol.iterator]=o[Symbol.iterator]),A.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){d["[object "+e+"]"]=e.toLowerCase()}));var k=
/*!
* 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,h,c,u,d,g,p,f,m,y,b,v,C="sizzle"+1*new Date,w=t.document,x=0,E=0,M=lt(),A=lt(),S=lt(),k=lt(),O=function(t,e){return t===e&&(u=!0),0},P={}.hasOwnProperty,D=[],T=D.pop,N=D.push,j=D.push,L=D.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",B="[\\x20\\t\\r\\n\\f]",R="(?:\\\\[\\da-fA-F]{1,6}"+B+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",$="\\["+B+"*("+R+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+B+"*\\]",I=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+$+")*)|.*)\\)|)",V=new RegExp(B+"+","g"),_=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),G=new RegExp("^"+B+"*,"+B+"*"),H=new RegExp("^"+B+"*([>+~]|"+B+")"+B+"*"),U=new RegExp(B+"|>"),W=new RegExp(I),q=new RegExp("^"+R+"$"),X={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+$),PSEUDO:new RegExp("^"+I),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+z+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","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}"+B+"?|\\\\([^\\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?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},st=function(){d()},ot=Ct((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{j.apply(D=L.call(w.childNodes),w.childNodes),D[w.childNodes.length].nodeType}catch(kt){j={apply:D.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,h,c,u,p,y,b=e&&e.ownerDocument,w=e?e.nodeType:9;if(i=i||[],"string"!==typeof t||!t||1!==w&&9!==w&&11!==w)return i;if(!r&&(d(e),e=e||g,f)){if(11!==w&&(u=Q.exec(t)))if(s=u[1]){if(9===w){if(!(h=e.getElementById(s)))return i;if(h.id===s)return i.push(h),i}else if(b&&(h=b.getElementById(s))&&v(e,h)&&h.id===s)return i.push(h),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&&!k[t+" "]&&(!m||!m.test(t))&&(1!==w||"object"!==e.nodeName.toLowerCase())){if(y=t,b=e,1===w&&(U.test(t)||H.test(t))){b=tt.test(t)&&yt(e.parentNode)||e,b===e&&n.scope||((c=e.getAttribute("id"))?c=c.replace(it,rt):e.setAttribute("id",c=C)),p=o(t),a=p.length;while(a--)p[a]=(c?"#"+c:":scope")+" "+vt(p[a]);y=p.join(",")}try{return j.apply(i,b.querySelectorAll(y)),i}catch(x){k(t,!0)}finally{c===C&&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 ht(t){return t[C]=!0,t}function ct(t){var e=g.createElement("fieldset");try{return!!t(e)}catch(kt){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 gt(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function pt(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 ht((function(e){return e=+e,ht((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:w;return o!=g&&9===o.nodeType&&o.documentElement?(g=o,p=g.documentElement,f=!s(g),w!=g&&(r=g.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",st,!1):r.attachEvent&&r.attachEvent("onunload",st)),n.scope=ct((function(t){return p.appendChild(t).appendChild(g.createElement("div")),"undefined"!==typeof t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ct((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ct((function(t){return t.appendChild(g.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(g.getElementsByClassName),n.getById=ct((function(t){return p.appendChild(t).id=C,!g.getElementsByName||!g.getElementsByName(C).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(g.querySelectorAll))&&(ct((function(t){var e;p.appendChild(t).innerHTML="<a id='"+C+"'></a><select id='"+C+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+B+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\["+B+"*(?:value|"+z+")"),t.querySelectorAll("[id~="+C+"-]").length||m.push("~="),e=g.createElement("input"),e.setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||m.push("\\["+B+"*name"+B+"*="+B+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+C+"+*").length||m.push(".#.+[+~]"),t.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]")})),ct((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=g.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&m.push("name"+B+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),p.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),m.push(",.*:")}))),(n.matchesSelector=K.test(b=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ct((function(t){n.disconnectedMatch=b.call(t,"*"),b.call(t,"[s!='']:x"),y.push("!=",I)})),m=m.length&&new RegExp(m.join("|")),y=y.length&&new RegExp(y.join("|")),e=K.test(p.compareDocumentPosition),v=e||K.test(p.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},O=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==g||t.ownerDocument==w&&v(w,t)?-1:e==g||e.ownerDocument==w&&v(w,e)?1:c?F(c,t)-F(c,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==g?-1:e==g?1:r?-1:s?1:c?F(c,t)-F(c,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]==w?-1:a[i]==w?1:0},g):g},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&f&&!k[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(kt){k(e,!0)}return at(e,g,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=g&&d(t),v(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=g&&d(t);var r=i.attrHandle[e.toLowerCase()],s=r&&P.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,c=!n.sortStable&&t.slice(0),t.sort(O),u){while(e=t[s++])e===t[s]&&(r=i.push(s));while(r--)t.splice(i[r],1)}return c=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:ht,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=M[t+" "];return e||(e=new RegExp("(^|"+B+")"+t+"("+B+"|$)"))&&M(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 h,c,u,d,g,p,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;p=f="only"===t&&!p&&"nextSibling"}return!0}if(p=[o?m.firstChild:m.lastChild],o&&b){d=m,u=d[C]||(d[C]={}),c=u[d.uniqueID]||(u[d.uniqueID]={}),h=c[t]||[],g=h[0]===x&&h[1],v=g&&h[2],d=g&&m.childNodes[g];while(d=++g&&d&&d[f]||(v=g=0)||p.pop())if(1===d.nodeType&&++v&&d===e){c[t]=[x,g,v];break}}else if(b&&(d=e,u=d[C]||(d[C]={}),c=u[d.uniqueID]||(u[d.uniqueID]={}),h=c[t]||[],g=h[0]===x&&h[1],v=g),!1===v)while(d=++g&&d&&d[f]||(v=g=0)||p.pop())if((a?d.nodeName.toLowerCase()===y:1===d.nodeType)&&++v&&(b&&(u=d[C]||(d[C]={}),c=u[d.uniqueID]||(u[d.uniqueID]={}),c[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[C]?r(e):r.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?ht((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:ht((function(t){var e=[],n=[],i=a(t.replace(_,"$1"));return i[C]?ht((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:ht((function(t){return function(e){return at(t,e).length>0}})),contains:ht((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||r(e)).indexOf(t)>-1}})),lang:ht((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===p},focus:function(t){return t===g.activeElement&&(!g.hasFocus||g.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]=gt(e);for(e in{submit:!0,reset:!0})i.pseudos[e]=pt(e);function bt(){}function vt(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function Ct(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 h,c,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[C]||(e[C]={}),c=u[e.uniqueID]||(u[e.uniqueID]={}),r&&r===e.nodeName.toLowerCase())e=e[i]||e;else{if((h=c[s])&&h[0]===x&&h[1]===a)return d[2]=h[2];if(c[s]=d,d[2]=t(e,n,l))return!0}return!1}}function wt(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,h=null!=e;a<l;a++)(s=t[a])&&(n&&!n(s,i,r)||(o.push(s),h&&e.push(a)));return o}function Mt(t,e,n,i,r,s){return i&&!i[C]&&(i=Mt(i)),r&&!r[C]&&(r=Mt(r,s)),ht((function(s,o,a,l){var h,c,u,d=[],g=[],p=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:p||i)?[]:o:m;if(n&&n(m,y,a,l),i){h=Et(y,g),i(h,[],a,l),c=h.length;while(c--)(u=h[c])&&(y[g[c]]=!(m[g[c]]=u))}if(s){if(r||t){if(r){h=[],c=y.length;while(c--)(u=y[c])&&h.push(m[c]=u);r(null,y=[],h,l)}c=y.length;while(c--)(u=y[c])&&(h=r?F(s,u):d[c])>-1&&(s[h]=!(o[h]=u))}}else y=Et(y===o?y.splice(p,y.length):y),r?r(null,o,y,l):j.apply(o,y)}))}function At(t){for(var e,n,r,s=t.length,o=i.relative[t[0].type],a=o||i.relative[" "],l=o?1:0,c=Ct((function(t){return t===e}),a,!0),u=Ct((function(t){return F(e,t)>-1}),a,!0),d=[function(t,n,i){var r=!o&&(i||n!==h)||((e=n).nodeType?c(t,n,i):u(t,n,i));return e=null,r}];l<s;l++)if(n=i.relative[t[l].type])d=[Ct(wt(d),n)];else{if(n=i.filter[t[l].type].apply(null,t[l].matches),n[C]){for(r=++l;r<s;r++)if(i.relative[t[r].type])break;return Mt(l>1&&wt(d),l>1&&vt(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(_,"$1"),n,l<r&&At(t.slice(l,r)),r<s&&At(t=t.slice(r)),r<s&&vt(t))}d.push(n)}return wt(d)}function St(t,e){var n=e.length>0,r=t.length>0,s=function(s,o,a,l,c){var u,p,m,y=0,b="0",v=s&&[],C=[],w=h,E=s||r&&i.find["TAG"]("*",c),M=x+=null==w?1:Math.random()||.1,A=E.length;for(c&&(h=o==g||o||c);b!==A&&null!=(u=E[b]);b++){if(r&&u){p=0,o||u.ownerDocument==g||(d(u),a=!f);while(m=t[p++])if(m(u,o||g,a)){l.push(u);break}c&&(x=M)}n&&((u=!m&&u)&&y--,s&&v.push(u))}if(y+=b,n&&b!==y){p=0;while(m=e[p++])m(v,C,o,a);if(s){if(y>0)while(b--)v[b]||C[b]||(C[b]=T.call(l));C=Et(C)}j.apply(l,C),c&&!s&&C.length>0&&y+e.length>1&&at.uniqueSort(l)}return c&&(x=M,h=w),v};return n?ht(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,h,c=A[t+" "];if(c)return e?0:c.slice(0);a=t,l=[],h=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))||h[o]&&!(r=h[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):A(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=At(e[n]),s[C]?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,h,c,u,d="function"===typeof t&&t,g=!r&&o(t=d.selector||t);if(n=n||[],1===g.length){if(l=g[0]=g[0].slice(0),l.length>2&&"ID"===(h=l[0]).type&&9===e.nodeType&&f&&i.relative[l[1].type]){if(e=(i.find["ID"](h.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(h=l[s],i.relative[c=h.type])break;if((u=i.find[c])&&(r=u(h.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,g))(r,e,!f,n,!e||tt.test(t)&&yt(e.parentNode)||e),n},n.sortStable=C.split("").sort(O).join("")===C,n.detectDuplicates=!!u,d(),n.sortDetached=ct((function(t){return 1&t.compareDocumentPosition(g.createElement("fieldset"))})),ct((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&&ct((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})),ct((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);A.find=k,A.expr=k.selectors,A.expr[":"]=A.expr.pseudos,A.uniqueSort=A.unique=k.uniqueSort,A.text=k.getText,A.isXMLDoc=k.isXML,A.contains=k.contains,A.escapeSelector=k.escape;var O=function(t,e,n){var i=[],r=void 0!==n;while((t=t[e])&&9!==t.nodeType)if(1===t.nodeType){if(r&&A(t).is(n))break;i.push(t)}return i},P=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},D=A.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)?A.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?A.grep(t,(function(t){return t===e!==n})):"string"!==typeof e?A.grep(t,(function(t){return u.call(e,t)>-1!==n})):A.filter(e,t,n)}A.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?A.find.matchesSelector(i,t)?[i]:[]:A.find.matches(t,A.grep(e,(function(t){return 1===t.nodeType})))},A.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!==typeof t)return this.pushStack(A(t).filter((function(){for(e=0;e<i;e++)if(A.contains(r[e],this))return!0})));for(n=this.pushStack([]),e=0;e<i;e++)A.find(t,r[e],n);return i>1?A.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&&D.test(t)?A(t):t||[],!1).length}});var L,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,z=A.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 A?e[0]:e,A.merge(this,A.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:C,!0)),N.test(i[1])&&A.isPlainObject(e))for(i in e)b(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return r=C.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(A):A.makeArray(t,this)};z.prototype=A.fn,L=A(C);var B=/^(?:parents|prev(?:Until|All))/,R={children:!0,contents:!0,next:!0,prev:!0};function $(t,e){while((t=t[e])&&1!==t.nodeType);return t}A.fn.extend({has:function(t){var e=A(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(A.contains(this,e[t]))return!0}))},closest:function(t,e){var n,i=0,r=this.length,s=[],o="string"!==typeof t&&A(t);if(!D.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&&A.find.matchesSelector(n,t))){s.push(n);break}return this.pushStack(s.length>1?A.uniqueSort(s):s)},index:function(t){return t?"string"===typeof t?u.call(A(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(A.uniqueSort(A.merge(this.get(),A(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),A.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return O(t,"parentNode")},parentsUntil:function(t,e,n){return O(t,"parentNode",n)},next:function(t){return $(t,"nextSibling")},prev:function(t){return $(t,"previousSibling")},nextAll:function(t){return O(t,"nextSibling")},prevAll:function(t){return O(t,"previousSibling")},nextUntil:function(t,e,n){return O(t,"nextSibling",n)},prevUntil:function(t,e,n){return O(t,"previousSibling",n)},siblings:function(t){return P((t.parentNode||{}).firstChild,t)},children:function(t){return P(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(T(t,"template")&&(t=t.content||t),A.merge([],t.childNodes))}},(function(t,e){A.fn[t]=function(n,i){var r=A.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"===typeof i&&(r=A.filter(i,r)),this.length>1&&(R[t]||A.uniqueSort(r),B.test(t)&&r.reverse()),this.pushStack(r)}}));var I=/[^\x20\t\r\n\f]+/g;function V(t){var e={};return A.each(t.match(I)||[],(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])}}A.Callbacks=function(t){t="string"===typeof t?V(t):A.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?[]:"")},h={add:function(){return s&&(n&&!e&&(a=s.length-1,o.push(n)),function e(n){A.each(n,(function(n,i){b(i)?t.unique&&h.has(i)||s.push(i):i&&i.length&&"string"!==E(i)&&e(i)}))}(arguments),n&&!e&&l()),this},remove:function(){return A.each(arguments,(function(t,e){var n;while((n=A.inArray(e,s,n))>-1)s.splice(n,1),n<=a&&a--})),this},has:function(t){return t?A.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 h.fireWith(this,arguments),this},fired:function(){return!!i}};return h},A.extend({Deferred:function(t){var e=[["notify","progress",A.Callbacks("memory"),A.Callbacks("memory"),2],["resolve","done",A.Callbacks("once memory"),A.Callbacks("once memory"),0,"resolved"],["reject","fail",A.Callbacks("once memory"),A.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 A.Deferred((function(n){A.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,h=function(){var r,h;if(!(t<s)){if(r=n.apply(a,l),r===e.promise())throw new TypeError("Thenable self-resolution");h=r&&("object"===typeof r||"function"===typeof r)&&r.then,b(h)?i?h.call(r,o(s,e,_,i),o(s,e,G,i)):(s++,h.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))}},c=i?h:function(){try{h()}catch(i){A.Deferred.exceptionHook&&A.Deferred.exceptionHook(i,c.stackTrace),t+1>=s&&(n!==G&&(a=void 0,l=[i]),e.rejectWith(a,l))}};t?c():(A.Deferred.getStackHook&&(c.stackTrace=A.Deferred.getStackHook()),r.setTimeout(c))}}return A.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?A.extend(t,i):i}},s={};return A.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=A.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$/;A.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)},A.readyException=function(t){r.setTimeout((function(){throw t}))};var W=A.Deferred();function q(){C.removeEventListener("DOMContentLoaded",q),r.removeEventListener("load",q),A.ready()}A.fn.ready=function(t){return W.then(t).catch((function(t){A.readyException(t)})),this},A.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--A.readyWait:A.isReady)||(A.isReady=!0,!0!==t&&--A.readyWait>0||W.resolveWith(C,[A]))}}),A.ready.then=W.then,"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?r.setTimeout(A.ready):(C.addEventListener("DOMContentLoaded",q),r.addEventListener("load",q));var X=function(t,e,n,i,r,s,o){var a=0,l=t.length,h=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),h&&(o?(e.call(t,i),e=null):(h=e,e=function(t,e,n){return h.call(A(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:h?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=A.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(I)||[]),n=e.length;while(n--)delete i[e[n]]}(void 0===e||A.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&&!A.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}A.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)}}),A.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)}))}}),A.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,A.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=A.queue(t,e),i=n.length,r=n.shift(),s=A._queueHooks(t,e),o=function(){A.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:A.Callbacks("once memory").add((function(){et.remove(t,[e+"queue",n])}))})}}),A.fn.extend({queue:function(t,e){var n=2;return"string"!==typeof t&&(e=t,t="fx",n--),arguments.length<n?A.queue(this[0],t):void 0===e?this:this.each((function(){var n=A.queue(this,t,e);A._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&A.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){A.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,r=A.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"),ht=["Top","Right","Bottom","Left"],ct=C.documentElement,ut=function(t){return A.contains(t.ownerDocument,t)},dt={composed:!0};ct.getRootNode&&(ut=function(t){return A.contains(t.ownerDocument,t)||t.getRootNode(dt)===t.ownerDocument});var gt=function(t,e){return t=e||t,"none"===t.style.display||""===t.style.display&&ut(t)&&"none"===A.css(t,"display")};function pt(t,e,n,i){var r,s,o=20,a=i?function(){return i.cur()}:function(){return A.css(t,e,"")},l=a(),h=n&&n[3]||(A.cssNumber[e]?"":"px"),c=t.nodeType&&(A.cssNumber[e]||"px"!==h&&+l)&&lt.exec(A.css(t,e));if(c&&c[3]!==h){l/=2,h=h||c[3],c=+l||1;while(o--)A.style(t,e,c+h),(1-s)*(1-(s=a()/l||.5))<=0&&(o=0),c/=s;c*=2,A.style(t,e,c+h),n=n||[]}return n&&(c=+c||+l||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=h,i.start=c,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=A.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&&gt(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}A.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(){gt(this)?A(this).show():A(this).hide()}))}});var bt=/^(?:checkbox|radio)$/i,vt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ct=/^$|^module$|\/(?:java|ecma)script/i;(function(){var t=C.createDocumentFragment(),e=t.appendChild(C.createElement("div")),n=C.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 wt={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)?A.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"))}wt.tbody=wt.tfoot=wt.colgroup=wt.caption=wt.thead,wt.th=wt.td,y.option||(wt.optgroup=wt.option=[1,"<select multiple='multiple'>","</select>"]);var Mt=/<|&#?\w+;/;function At(t,e,n,i,r){for(var s,o,a,l,h,c,u=e.createDocumentFragment(),d=[],g=0,p=t.length;g<p;g++)if(s=t[g],s||0===s)if("object"===E(s))A.merge(d,s.nodeType?[s]:s);else if(Mt.test(s)){o=o||u.appendChild(e.createElement("div")),a=(vt.exec(s)||["",""])[1].toLowerCase(),l=wt[a]||wt._default,o.innerHTML=l[1]+A.htmlPrefilter(s)+l[2],c=l[0];while(c--)o=o.lastChild;A.merge(d,o.childNodes),o=u.firstChild,o.textContent=""}else d.push(e.createTextNode(s));u.textContent="",g=0;while(s=d[g++])if(i&&A.inArray(s,i)>-1)r&&r.push(s);else if(h=ut(s),o=xt(u.appendChild(s),"script"),h&&Et(o),n){c=0;while(s=o[c++])Ct.test(s.type||"")&&n.push(s)}return u}var St=/^([^.]*)(?:\.(.+)|)/;function kt(){return!0}function Ot(){return!1}function Pt(t,e){return t===Dt()===("focus"===e)}function Dt(){try{return C.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=Ot;else if(!r)return t;return 1===s&&(o=r,r=function(t){return A().off(t),o.apply(this,arguments)},r.guid=o.guid||(o.guid=A.guid++)),t.each((function(){A.event.add(this,e,r,i,n)}))}function Nt(t,e,n){n?(et.set(t,e,!1),A.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)(A.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:A.event.trigger(A.extend(s[0],A.Event.prototype),s.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===et.get(t,e)&&A.event.add(t,e,kt)}A.event={global:{},add:function(t,e,n,i,r){var s,o,a,l,h,c,u,d,g,p,f,m=et.get(t);if(Q(t)){n.handler&&(s=n,n=s.handler,r=s.selector),r&&A.find.matchesSelector(ct,r),n.guid||(n.guid=A.guid++),(l=m.events)||(l=m.events=Object.create(null)),(o=m.handle)||(o=m.handle=function(e){return"undefined"!==typeof A&&A.event.triggered!==e.type?A.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(I)||[""],h=e.length;while(h--)a=St.exec(e[h])||[],g=f=a[1],p=(a[2]||"").split(".").sort(),g&&(u=A.event.special[g]||{},g=(r?u.delegateType:u.bindType)||g,u=A.event.special[g]||{},c=A.extend({type:g,origType:f,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&A.expr.match.needsContext.test(r),namespace:p.join(".")},s),(d=l[g])||(d=l[g]=[],d.delegateCount=0,u.setup&&!1!==u.setup.call(t,i,p,o)||t.addEventListener&&t.addEventListener(g,o)),u.add&&(u.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,c):d.push(c),A.event.global[g]=!0)}},remove:function(t,e,n,i,r){var s,o,a,l,h,c,u,d,g,p,f,m=et.hasData(t)&&et.get(t);if(m&&(l=m.events)){e=(e||"").match(I)||[""],h=e.length;while(h--)if(a=St.exec(e[h])||[],g=f=a[1],p=(a[2]||"").split(".").sort(),g){u=A.event.special[g]||{},g=(i?u.delegateType:u.bindType)||g,d=l[g]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=d.length;while(s--)c=d[s],!r&&f!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(d.splice(s,1),c.selector&&d.delegateCount--,u.remove&&u.remove.call(t,c));o&&!d.length&&(u.teardown&&!1!==u.teardown.call(t,p,m.handle)||A.removeEvent(t,g,m.handle),delete l[g])}else for(g in l)A.event.remove(t,g+e[h],n,i,!0);A.isEmptyObject(l)&&et.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,s,o,a=new Array(arguments.length),l=A.event.fix(t),h=(et.get(this,"events")||Object.create(null))[l.type]||[],c=A.event.special[l.type]||{};for(a[0]=l,e=1;e<arguments.length;e++)a[e]=arguments[e];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){o=A.event.handlers.call(this,l,h),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=((A.event.special[s.origType]||{}).handle||s.handler).apply(r.elem,a),void 0!==i&&!1===(l.result=i)&&(l.preventDefault(),l.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(t,e){var n,i,r,s,o,a=[],l=e.delegateCount,h=t.target;if(l&&h.nodeType&&!("click"===t.type&&t.button>=1))for(;h!==this;h=h.parentNode||this)if(1===h.nodeType&&("click"!==t.type||!0!==h.disabled)){for(s=[],o={},n=0;n<l;n++)i=e[n],r=i.selector+" ",void 0===o[r]&&(o[r]=i.needsContext?A(r,this).index(h)>-1:A.find(r,this,null,[h]).length),o[r]&&s.push(i);s.length&&a.push({elem:h,handlers:s})}return h=this,l<e.length&&a.push({elem:h,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(A.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[A.expando]?t:new A.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",kt),!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)}}}},A.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},A.Event=function(t,e){if(!(this instanceof A.Event))return new A.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?kt:Ot,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&&A.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[A.expando]=!0},A.Event.prototype={constructor:A.Event,isDefaultPrevented:Ot,isPropagationStopped:Ot,isImmediatePropagationStopped:Ot,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=kt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=kt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=kt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},A.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},A.event.addProp),A.each({focus:"focusin",blur:"focusout"},(function(t,e){A.event.special[t]={setup:function(){return Nt(this,t,Pt),!1},trigger:function(){return Nt(this,t),!0},_default:function(){return!0},delegateType:e}})),A.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){A.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=this,r=t.relatedTarget,s=t.handleObj;return r&&(r===i||A.contains(i,r))||(t.type=s.origType,n=s.handler.apply(this,arguments),t.type=e),n}}})),A.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,A(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=Ot),this.each((function(){A.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")&&A(t).children("tbody")[0]||t}function Bt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Rt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function $t(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++)A.event.add(e,r,l[r][n]);nt.hasData(t)&&(o=nt.access(t),a=A.extend({},o),nt.set(e,a))}}function It(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=h(e);var r,s,o,a,l,c,u=0,d=t.length,g=d-1,p=e[0],f=b(p);if(f||d>1&&"string"===typeof p&&!y.checkClone&&Lt.test(p))return t.each((function(r){var s=t.eq(r);f&&(e[0]=p.call(this,r,s.html())),Vt(s,e,n,i)}));if(d&&(r=At(e,t[0].ownerDocument,!1,t,i),s=r.firstChild,1===r.childNodes.length&&(r=s),s||i)){for(o=A.map(xt(r,"script"),Bt),a=o.length;u<d;u++)l=r,u!==g&&(l=A.clone(l,!0,!0),a&&A.merge(o,xt(l,"script"))),n.call(t[u],l,u);if(a)for(c=o[o.length-1].ownerDocument,A.map(o,Rt),u=0;u<a;u++)l=o[u],Ct.test(l.type||"")&&!et.access(l,"globalEval")&&A.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?A._evalUrl&&!l.noModule&&A._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},c):x(l.textContent.replace(Ft,""),l,c))}return t}function _t(t,e,n){for(var i,r=e?A.filter(e,t):t,s=0;null!=(i=r[s]);s++)n||1!==i.nodeType||A.cleanData(xt(i)),i.parentNode&&(n&&ut(i)&&Et(xt(i,"script")),i.parentNode.removeChild(i));return t}A.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)&&!A.isXMLDoc(t))for(o=xt(a),s=xt(t),i=0,r=s.length;i<r;i++)It(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++)$t(s[i],o[i]);else $t(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=A.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]?A.event.remove(n,i):A.removeEvent(n,i,e.handle);n[et.expando]=void 0}n[nt.expando]&&(n[nt.expando]=void 0)}}}),A.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?A.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&&(A.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 A.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)&&!wt[(vt.exec(t)||["",""])[1].toLowerCase()]){t=A.htmlPrefilter(t);try{for(;n<i;n++)e=this[n]||{},1===e.nodeType&&(A.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;A.inArray(this,t)<0&&(A.cleanData(xt(this)),n&&n.replaceChild(e,this))}),t)}}),A.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){A.fn[t]=function(t){for(var n,i=[],r=A(t),s=r.length-1,o=0;o<=s;o++)n=o===s?this:this.clone(!0),A(r[o])[e](n),c.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(ht.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=A.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(c){h.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ct.appendChild(h).appendChild(c);var t=r.getComputedStyle(c);n="1%"!==t.top,l=12===e(t.marginLeft),c.style.right="60%",o=36===e(t.right),i=36===e(t.width),c.style.position="absolute",s=12===e(c.offsetWidth/3),ct.removeChild(h),c=null}}function e(t){return Math.round(parseFloat(t))}var n,i,s,o,a,l,h=C.createElement("div"),c=C.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===c.style.backgroundClip,A.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=C.createElement("table"),e=C.createElement("tr"),n=C.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",ct.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,ct.removeChild(t)),a}}))})();var Yt=["Webkit","Moz","ms"],Jt=C.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=A.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+=A.css(t,n+ht[o],!0,r)),i?("content"===n&&(l-=A.css(t,"padding"+ht[o],!0,r)),"margin"!==n&&(l-=A.css(t,"border"+ht[o]+"Width",!0,r))):(l+=A.css(t,"padding"+ht[o],!0,r),"padding"!==n?l+=A.css(t,"border"+ht[o]+"Width",!0,r):a+=A.css(t,"border"+ht[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"===A.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"===A.css(t,"display",!1,i))&&t.getClientRects().length&&(s="border-box"===A.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)}A.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),h=t.style;if(l||(e=Qt(a)),o=A.cssHooks[e]||A.cssHooks[a],void 0===n)return o&&"get"in o&&void 0!==(r=o.get(t,!1,i))?r:h[e];s=typeof n,"string"===s&&(r=lt.exec(n))&&r[1]&&(n=pt(t,e,r),s="number"),null!=n&&n===n&&("number"!==s||l||(n+=r&&r[3]||(A.cssNumber[a]?"":"px")),y.clearCloneStyle||""!==n||0!==e.indexOf("background")||(h[e]="inherit"),o&&"set"in o&&void 0===(n=o.set(t,n,i))||(l?h.setProperty(e,n):h[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=A.cssHooks[e]||A.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}}),A.each(["height","width"],(function(t,e){A.cssHooks[e]={get:function(t,n,i){if(n)return!te.test(A.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"===A.css(t,"boxSizing",!1,s),h=i?se(t,e,i,l,s):0;return l&&o&&(h-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(s[e])-se(t,e,"border",!1,s)-.5)),h&&(r=lt.exec(n))&&"px"!==(r[3]||"px")&&(t.style[e]=n,n=A.css(t,e)),re(t,n,h)}}})),A.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"})),A.each({margin:"",padding:"",border:"Width"},(function(t,e){A.cssHooks[t+e]={expand:function(n){for(var i=0,r={},s="string"===typeof n?n.split(" "):[n];i<4;i++)r[t+ht[i]+e]=s[i]||s[i-2]||s[0];return r}},"margin"!==t&&(A.cssHooks[t+e].set=re)})),A.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]]=A.css(t,e[o],!1,i);return s}return void 0!==n?A.style(t,e,n):A.css(t,e)}),t,e,arguments.length>1)}}),A.Tween=ae,ae.prototype={constructor:ae,init:function(t,e,n,i,r,s){this.elem=t,this.prop=n,this.easing=r||A.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=s||(A.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=A.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=A.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){A.fx.step[t.prop]?A.fx.step[t.prop](t):1!==t.elem.nodeType||!A.cssHooks[t.prop]&&null==t.elem.style[Qt(t.prop)]?t.elem[t.prop]=t.now:A.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)}},A.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},A.fx=ae.prototype.init,A.fx.step={};var le,he,ce=/^(?:toggle|show|hide)$/,ue=/queueHooks$/;function de(){he&&(!1===C.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(de):r.setTimeout(de,A.fx.interval),A.fx.tick())}function ge(){return r.setTimeout((function(){le=void 0})),le=Date.now()}function pe(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)n=ht[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,h,c,u="width"in e||"height"in e,d=this,g={},p=t.style,f=t.nodeType&&gt(t),m=et.get(t,"fxshow");for(i in n.queue||(o=A._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--,A.queue(t,"fx").length||o.empty.fire()}))}))),e)if(r=e[i],ce.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}g[i]=m&&m[i]||A.style(t,i)}if(l=!A.isEmptyObject(e),l||!A.isEmptyObject(g))for(i in u&&1===t.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],h=m&&m.display,null==h&&(h=et.get(t,"display")),c=A.css(t,"display"),"none"===c&&(h?c=h:(yt([t],!0),h=t.style.display||h,c=A.css(t,"display"),yt([t]))),("inline"===c||"inline-block"===c&&null!=h)&&"none"===A.css(t,"float")&&(l||(d.done((function(){p.display=h})),null==h&&(c=p.display,h="none"===c?"":c)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",d.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),l=!1,g)l||(m?"hidden"in m&&(f=m.hidden):m=et.access(t,"fxshow",{display:h}),s&&(m.hidden=!f),f&&yt([t],!0),d.done((function(){for(i in f||yt([t]),et.remove(t,"fxshow"),g)A.style(t,i,g[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=A.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=A.Deferred().always((function(){delete l.elem})),l=function(){if(r)return!1;for(var e=le||ge(),n=Math.max(0,h.startTime+h.duration-e),i=n/h.duration||0,s=1-i,o=0,l=h.tweens.length;o<l;o++)h.tweens[o].run(s);return a.notifyWith(t,[h,s,n]),s<1&&l?n:(l||a.notifyWith(t,[h,1,0]),a.resolveWith(t,[h]),!1)},h=a.promise({elem:t,props:A.extend({},e),opts:A.extend(!0,{specialEasing:{},easing:A.easing._default},n),originalProperties:e,originalOptions:n,startTime:le||ge(),duration:n.duration,tweens:[],createTween:function(e,n){var i=A.Tween(t,h.opts,e,n,h.opts.specialEasing[e]||h.opts.easing);return h.tweens.push(i),i},stop:function(e){var n=0,i=e?h.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)h.tweens[n].run(1);return e?(a.notifyWith(t,[h,1,0]),a.resolveWith(t,[h,e])):a.rejectWith(t,[h,e]),this}}),c=h.props;for(ye(c,h.opts.specialEasing);s<o;s++)if(i=be.prefilters[s].call(h,t,c,h.opts),i)return b(i.stop)&&(A._queueHooks(h.elem,h.opts.queue).stop=i.stop.bind(i)),i;return A.map(c,fe,h),b(h.opts.start)&&h.opts.start.call(t,h),h.progress(h.opts.progress).done(h.opts.done,h.opts.complete).fail(h.opts.fail).always(h.opts.always),A.fx.timer(A.extend(l,{elem:t,anim:h,queue:h.opts.queue})),h}A.Animation=A.extend(be,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return pt(n.elem,t,lt.exec(e),n),n}]},tweener:function(t,e){b(t)?(e=t,t=["*"]):t=t.match(I);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)}}),A.speed=function(t,e,n){var i=t&&"object"===typeof t?A.extend({},t):{complete:n||!n&&e||b(t)&&t,duration:t,easing:n&&e||e&&!b(e)&&e};return A.fx.off?i.duration=0:"number"!==typeof i.duration&&(i.duration in A.fx.speeds?i.duration=A.fx.speeds[i.duration]:i.duration=A.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&&A.dequeue(this,i.queue)},i},A.fn.extend({fadeTo:function(t,e,n,i){return this.filter(gt).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var r=A.isEmptyObject(t),s=A.speed(e,n,i),o=function(){var e=be(this,A.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=A.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||A.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=A.timers,o=i?i.length:0;for(n.finish=!0,A.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}))}}),A.each(["toggle","show","hide"],(function(t,e){var n=A.fn[e];A.fn[e]=function(t,i,r){return null==t||"boolean"===typeof t?n.apply(this,arguments):this.animate(pe(e,!0),t,i,r)}})),A.each({slideDown:pe("show"),slideUp:pe("hide"),slideToggle:pe("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){A.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),A.timers=[],A.fx.tick=function(){var t,e=0,n=A.timers;for(le=Date.now();e<n.length;e++)t=n[e],t()||n[e]!==t||n.splice(e--,1);n.length||A.fx.stop(),le=void 0},A.fx.timer=function(t){A.timers.push(t),A.fx.start()},A.fx.interval=13,A.fx.start=function(){he||(he=!0,de())},A.fx.stop=function(){he=null},A.fx.speeds={slow:600,fast:200,_default:400},A.fn.delay=function(t,e){return t=A.fx&&A.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=C.createElement("input"),e=C.createElement("select"),n=e.appendChild(C.createElement("option"));t.type="checkbox",y.checkOn=""!==t.value,y.optSelected=n.selected,t=C.createElement("input"),t.value="t",t.type="radio",y.radioValue="t"===t.value}();var ve,Ce=A.expr.attrHandle;A.fn.extend({attr:function(t,e){return X(this,A.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){A.removeAttr(this,t)}))}}),A.extend({attr:function(t,e,n){var i,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return"undefined"===typeof t.getAttribute?A.prop(t,e,n):(1===s&&A.isXMLDoc(t)||(r=A.attrHooks[e.toLowerCase()]||(A.expr.match.bool.test(e)?ve:void 0)),void 0!==n?null===n?void A.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=A.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(I);if(r&&1===t.nodeType)while(n=r[i++])t.removeAttribute(n)}}),ve={set:function(t,e,n){return!1===e?A.removeAttr(t,n):t.setAttribute(n,n),n}},A.each(A.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=Ce[e]||A.find.attr;Ce[e]=function(t,e,i){var r,s,o=e.toLowerCase();return i||(s=Ce[o],Ce[o]=r,r=null!=n(t,e,i)?o:null,Ce[o]=s),r}}));var we=/^(?:input|select|textarea|button)$/i,xe=/^(?:a|area)$/i;function Ee(t){var e=t.match(I)||[];return e.join(" ")}function Me(t){return t.getAttribute&&t.getAttribute("class")||""}function Ae(t){return Array.isArray(t)?t:"string"===typeof t&&t.match(I)||[]}A.fn.extend({prop:function(t,e){return X(this,A.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[A.propFix[t]||t]}))}}),A.extend({prop:function(t,e,n){var i,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&A.isXMLDoc(t)||(e=A.propFix[e]||e,r=A.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=A.find.attr(t,"tabindex");return e?parseInt(e,10):we.test(t.nodeName)||xe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),y.optSelected||(A.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)}}),A.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){A.propFix[this.toLowerCase()]=this})),A.fn.extend({addClass:function(t){var e,n,i,r,s,o,a,l=0;if(b(t))return this.each((function(e){A(this).addClass(t.call(this,e,Me(this)))}));if(e=Ae(t),e.length)while(n=this[l++])if(r=Me(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){A(this).removeClass(t.call(this,e,Me(this)))}));if(!arguments.length)return this.attr("class","");if(e=Ae(t),e.length)while(n=this[l++])if(r=Me(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){A(this).toggleClass(t.call(this,n,Me(this),e),e)})):this.each((function(){var e,r,s,o;if(i){r=0,s=A(this),o=Ae(t);while(e=o[r++])s.hasClass(e)?s.removeClass(e):s.addClass(e)}else void 0!==t&&"boolean"!==n||(e=Me(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(Me(n))+" ").indexOf(e)>-1)return!0;return!1}});var Se=/\r/g;A.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,A(this).val()):t,null==r?r="":"number"===typeof r?r+="":Array.isArray(r)&&(r=A.map(r,(function(t){return null==t?"":t+""}))),e=A.valHooks[this.type]||A.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=A.valHooks[r.type]||A.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}}),A.extend({valHooks:{option:{get:function(t){var e=A.find.attr(t,"value");return null!=e?e:Ee(A.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=A(n).val(),o)return e;a.push(e)}return a},set:function(t,e){var n,i,r=t.options,s=A.makeArray(e),o=r.length;while(o--)i=r[o],(i.selected=A.inArray(A.valHooks.option.get(i),s)>-1)&&(n=!0);return n||(t.selectedIndex=-1),s}}}}),A.each(["radio","checkbox"],(function(){A.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=A.inArray(A(t).val(),e)>-1}},y.checkOn||(A.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),y.focusin="onfocusin"in r;var ke=/^(?:focusinfocus|focusoutblur)$/,Oe=function(t){t.stopPropagation()};A.extend(A.event,{trigger:function(t,e,n,i){var s,o,a,l,h,c,u,d,g=[n||C],f=p.call(t,"type")?t.type:t,m=p.call(t,"namespace")?t.namespace.split("."):[];if(o=d=a=n=n||C,3!==n.nodeType&&8!==n.nodeType&&!ke.test(f+A.event.triggered)&&(f.indexOf(".")>-1&&(m=f.split("."),f=m.shift(),m.sort()),h=f.indexOf(":")<0&&"on"+f,t=t[A.expando]?t:new A.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]:A.makeArray(e,[t]),u=A.event.special[f]||{},i||!u.trigger||!1!==u.trigger.apply(n,e))){if(!i&&!u.noBubble&&!v(n)){for(l=u.delegateType||f,ke.test(l+f)||(o=o.parentNode);o;o=o.parentNode)g.push(o),a=o;a===(n.ownerDocument||C)&&g.push(a.defaultView||a.parentWindow||r)}s=0;while((o=g[s++])&&!t.isPropagationStopped())d=o,t.type=s>1?l:u.bindType||f,c=(et.get(o,"events")||Object.create(null))[t.type]&&et.get(o,"handle"),c&&c.apply(o,e),c=h&&o[h],c&&c.apply&&Q(o)&&(t.result=c.apply(o,e),!1===t.result&&t.preventDefault());return t.type=f,i||t.isDefaultPrevented()||u._default&&!1!==u._default.apply(g.pop(),e)||!Q(n)||h&&b(n[f])&&!v(n)&&(a=n[h],a&&(n[h]=null),A.event.triggered=f,t.isPropagationStopped()&&d.addEventListener(f,Oe),n[f](),t.isPropagationStopped()&&d.removeEventListener(f,Oe),A.event.triggered=void 0,a&&(n[h]=a)),t.result}},simulate:function(t,e,n){var i=A.extend(new A.Event,n,{type:t,isSimulated:!0});A.event.trigger(i,null,e)}}),A.fn.extend({trigger:function(t,e){return this.each((function(){A.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return A.event.trigger(t,e,n,!0)}}),y.focusin||A.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){A.event.simulate(e,t.target,A.event.fix(t))};A.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 Pe=r.location,De={guid:Date.now()},Te=/\?/;A.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||A.error("Invalid XML: "+(n?A.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))A.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)}A.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&&!A.isPlainObject(t))A.each(t,(function(){r(this.name,this.value)}));else for(n in t)ze(n,t[n],e,r);return i.join("&")},A.fn.extend({serialize:function(){return A.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=A.prop(this,"elements");return t?A.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!A(this).is(":disabled")&&Fe.test(this.nodeName)&&!Le.test(t)&&(this.checked||!bt.test(t))})).map((function(t,e){var n=A(this).val();return null==n?null:Array.isArray(n)?A.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 Be=/%20/g,Re=/#.*$/,$e=/([?&])_=[^&]*/,Ie=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ve=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,_e=/^(?:GET|HEAD)$/,Ge=/^\/\//,He={},Ue={},We="*/".concat("*"),qe=C.createElement("a");function Xe(t){return function(e,n){"string"!==typeof e&&(n=e,e="*");var i,r=0,s=e.toLowerCase().match(I)||[];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,A.each(t[a]||[],(function(t,a){var h=a(e,n,i);return"string"!==typeof h||s||r[h]?s?!(l=h):void 0:(e.dataTypes.unshift(h),o(h),!1)})),l}return o(e.dataTypes[0])||!r["*"]&&o("*")}function Je(t,e){var n,i,r=A.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&A.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,h={},c=t.dataTypes.slice();if(c[1])for(o in t.converters)h[o.toLowerCase()]=t.converters[o];s=c.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=c.shift(),s)if("*"===s)s=l;else if("*"!==l&&l!==s){if(o=h[l+" "+s]||h["* "+s],!o)for(r in h)if(a=r.split(" "),a[1]===s&&(o=h[l+" "+a[0]]||h["* "+a[0]],o)){!0===o?o=h[r]:!0!==h[r]&&(s=a[0],c.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=Pe.href,A.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Pe.href,type:"GET",isLocal:Ve.test(Pe.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":A.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Je(Je(t,A.ajaxSettings),e):Je(A.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,h,c,u,d,g=A.ajaxSetup({},e),p=g.context||g,f=g.context&&(p.nodeType||p.jquery)?A(p):A.event,m=A.Deferred(),y=A.Callbacks("once memory"),b=g.statusCode||{},v={},w={},x="canceled",E={readyState:0,getResponseHeader:function(t){var e;if(h){if(!o){o={};while(e=Ie.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 h?s:null},setRequestHeader:function(t,e){return null==h&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,v[t]=e),this},overrideMimeType:function(t){return null==h&&(g.mimeType=t),this},statusCode:function(t){var e;if(t)if(h)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),M(0,e),this}};if(m.promise(E),g.url=((t||g.url||Pe.href)+"").replace(Ge,Pe.protocol+"//"),g.type=e.method||e.type||g.method||g.type,g.dataTypes=(g.dataType||"*").toLowerCase().match(I)||[""],null==g.crossDomain){l=C.createElement("a");try{l.href=g.url,l.href=l.href,g.crossDomain=qe.protocol+"//"+qe.host!==l.protocol+"//"+l.host}catch(S){g.crossDomain=!0}}if(g.data&&g.processData&&"string"!==typeof g.data&&(g.data=A.param(g.data,g.traditional)),Ye(He,g,e,E),h)return E;for(u in c=A.event&&g.global,c&&0===A.active++&&A.event.trigger("ajaxStart"),g.type=g.type.toUpperCase(),g.hasContent=!_e.test(g.type),i=g.url.replace(Re,""),g.hasContent?g.data&&g.processData&&0===(g.contentType||"").indexOf("application/x-www-form-urlencoded")&&(g.data=g.data.replace(Be,"+")):(d=g.url.slice(i.length),g.data&&(g.processData||"string"===typeof g.data)&&(i+=(Te.test(i)?"&":"?")+g.data,delete g.data),!1===g.cache&&(i=i.replace($e,"$1"),d=(Te.test(i)?"&":"?")+"_="+De.guid+++d),g.url=i+d),g.ifModified&&(A.lastModified[i]&&E.setRequestHeader("If-Modified-Since",A.lastModified[i]),A.etag[i]&&E.setRequestHeader("If-None-Match",A.etag[i])),(g.data&&g.hasContent&&!1!==g.contentType||e.contentType)&&E.setRequestHeader("Content-Type",g.contentType),E.setRequestHeader("Accept",g.dataTypes[0]&&g.accepts[g.dataTypes[0]]?g.accepts[g.dataTypes[0]]+("*"!==g.dataTypes[0]?", "+We+"; q=0.01":""):g.accepts["*"]),g.headers)E.setRequestHeader(u,g.headers[u]);if(g.beforeSend&&(!1===g.beforeSend.call(p,E,g)||h))return E.abort();if(x="abort",y.add(g.complete),E.done(g.success),E.fail(g.error),n=Ye(Ue,g,e,E),n){if(E.readyState=1,c&&f.trigger("ajaxSend",[E,g]),h)return E;g.async&&g.timeout>0&&(a=r.setTimeout((function(){E.abort("timeout")}),g.timeout));try{h=!1,n.send(v,M)}catch(S){if(h)throw S;M(-1,S)}}else M(-1,"No Transport");function M(t,e,o,l){var u,d,v,C,w,x=e;h||(h=!0,a&&r.clearTimeout(a),n=void 0,s=l||"",E.readyState=t>0?4:0,u=t>=200&&t<300||304===t,o&&(C=Ze(g,E,o)),!u&&A.inArray("script",g.dataTypes)>-1&&A.inArray("json",g.dataTypes)<0&&(g.converters["text script"]=function(){}),C=Ke(g,C,E,u),u?(g.ifModified&&(w=E.getResponseHeader("Last-Modified"),w&&(A.lastModified[i]=w),w=E.getResponseHeader("etag"),w&&(A.etag[i]=w)),204===t||"HEAD"===g.type?x="nocontent":304===t?x="notmodified":(x=C.state,d=C.data,v=C.error,u=!v)):(v=x,!t&&x||(x="error",t<0&&(t=0))),E.status=t,E.statusText=(e||x)+"",u?m.resolveWith(p,[d,x,E]):m.rejectWith(p,[E,x,v]),E.statusCode(b),b=void 0,c&&f.trigger(u?"ajaxSuccess":"ajaxError",[E,g,u?d:v]),y.fireWith(p,[E,x]),c&&(f.trigger("ajaxComplete",[E,g]),--A.active||A.event.trigger("ajaxStop")))}return E},getJSON:function(t,e,n){return A.get(t,e,n,"json")},getScript:function(t,e){return A.get(t,void 0,e,"script")}}),A.each(["get","post"],(function(t,e){A[e]=function(t,n,i,r){return b(n)&&(r=r||i,i=n,n=void 0),A.ajax(A.extend({url:t,type:e,dataType:r,data:n,success:i},A.isPlainObject(t)&&t))}})),A.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),A._evalUrl=function(t,e,n){return A.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){A.globalEval(t,e,n)}})},A.fn.extend({wrapAll:function(t){var e;return this[0]&&(b(t)&&(t=t.call(this[0])),e=A(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){A(this).wrapInner(t.call(this,e))})):this.each((function(){var e=A(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=b(t);return this.each((function(n){A(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){A(this).replaceWith(this.childNodes)})),this}}),A.expr.pseudos.hidden=function(t){return!A.expr.pseudos.visible(t)},A.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},A.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(t){}};var Qe={0:200,1223:204},tn=A.ajaxSettings.xhr();y.cors=!!tn&&"withCredentials"in tn,y.ajax=tn=!!tn,A.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()}}})),A.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),A.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 A.globalEval(t),t}}}),A.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),A.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,r){e=A("<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)}),C.head.appendChild(e[0])},abort:function(){n&&n()}}}));var en=[],nn=/(=)\?(?=&|$)|\?\?/;A.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=en.pop()||A.expando+"_"+De.guid++;return this[t]=!0,t}}),A.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||A.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?A(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=C.implementation.createHTMLDocument("").body;return t.innerHTML="<form></form><form></form>",2===t.childNodes.length}(),A.parseHTML=function(t,e,n){return"string"!==typeof t?[]:("boolean"===typeof e&&(n=e,e=!1),e||(y.createHTMLDocument?(e=C.implementation.createHTMLDocument(""),i=e.createElement("base"),i.href=C.location.href,e.head.appendChild(i)):e=C),r=N.exec(t),s=!n&&[],r?[e.createElement(r[1])]:(r=At([t],e,s),s&&s.length&&A(s).remove(),A.merge([],r.childNodes)));var i,r,s},A.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&&A.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done((function(t){s=arguments,o.html(i?A("<div>").append(A.parseHTML(t)).find(i):t)})).always(n&&function(t,e){o.each((function(){n.apply(this,s||[t.responseText,e,t])}))}),this},A.expr.pseudos.animated=function(t){return A.grep(A.timers,(function(e){return t===e.elem})).length},A.offset={setOffset:function(t,e,n){var i,r,s,o,a,l,h,c=A.css(t,"position"),u=A(t),d={};"static"===c&&(t.style.position="relative"),a=u.offset(),s=A.css(t,"top"),l=A.css(t,"left"),h=("absolute"===c||"fixed"===c)&&(s+l).indexOf("auto")>-1,h?(i=u.position(),o=i.top,r=i.left):(o=parseFloat(s)||0,r=parseFloat(l)||0),b(e)&&(e=e.call(t,n,A.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)}},A.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){A.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"===A.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"===A.css(t,"position"))t=t.parentNode;t&&t!==i&&1===t.nodeType&&(r=A(t).offset(),r.top+=A.css(t,"borderTopWidth",!0),r.left+=A.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-A.css(i,"marginTop",!0),left:e.left-r.left-A.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){var t=this.offsetParent;while(t&&"static"===A.css(t,"position"))t=t.offsetParent;return t||ct}))}}),A.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;A.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)}})),A.each(["top","left"],(function(t,e){A.cssHooks[e]=Xt(y.pixelPosition,(function(t,n){if(n)return n=qt(t,e),Gt.test(n)?A(t).position()[e]+"px":n}))})),A.each({Height:"height",Width:"width"},(function(t,e){A.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){A.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?A.css(e,n,a):A.style(e,n,r,a)}),e,o?r:void 0,o)}}))})),A.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){A.fn[e]=function(t){return this.on(e,t)}})),A.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)}}),A.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){A.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;A.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||A.guid++,r},A.holdReady=function(t){t?A.readyWait++:A.ready(!0)},A.isArray=Array.isArray,A.parseJSON=JSON.parse,A.nodeName=T,A.isFunction=b,A.isWindow=v,A.camelCase=K,A.type=E,A.now=Date.now,A.isNumeric=function(t){var e=A.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},A.trim=function(t){return null==t?"":(t+"").replace(rn,"")},n=[],i=function(){return A}.apply(e,n),void 0===i||(t.exports=i);var sn=r.jQuery,on=r.$;return A.noConflict=function(t){return r.$===A&&(r.$=on),t&&r.jQuery===A&&(r.jQuery=sn),A},"undefined"===typeof s&&(r.jQuery=r.$=A),A}))},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"},h={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},c={"~":"`","!":"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();A.prototype.bind=function(t,e,n){var i=this;return t=t instanceof Array?t:[t],i._bindMultiple.call(i,t,e,n),i},A.prototype.unbind=function(t,e){var n=this;return n.bind.call(n,t,(function(){}),e)},A.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},A.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},A.prototype.stopCallback=function(t,e){var n=this;if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(M(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},A.prototype.handleKey=function(){var t=this;return t._handleKey.apply(t,arguments)},A.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(l[e]=t[e]);a=null},A.init=function(){var t=A(s);for(var e in t)"_"!==e.charAt(0)&&(A[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},A.init(),r.Mousetrap=A,t.exports&&(t.exports=A),i=function(){return A}.call(e,n,e,t),i===o||(t.exports=i)}function g(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function p(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]:h[t.which]?h[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 C(){if(!a)for(var t in a={},l)t>95&&t<112||l.hasOwnProperty(t)&&(a[l[t]]=t);return a}function w(t,e,n){return n||(n=C()[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&&c[i]&&(i=c[i],s.push("shift")),v(i)&&s.push(i);return e=w(i,s,e),{key:i,modifiers:s,action:e}}function M(t,e){return null!==t&&t!==s&&(t===e||M(t.parentNode,e))}function A(t){var e=this;if(t=t||s,!(e instanceof A))return new A(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 h(t,n,r,s,o,a){var l,h,c=[],u=r.type;if(!e._callbacks[t])return[];for("keyup"==u&&v(t)&&(n=[t]),l=0;l<e._callbacks[t].length;++l)if(h=e._callbacks[t][l],(s||!h.seq||i[h.seq]==h.level)&&u==h.action&&("keypress"==u&&!r.metaKey&&!r.ctrlKey||f(n,h.modifiers))){var d=!s&&h.combo==o,g=s&&h.seq==s&&h.level==a;(d||g)&&e._callbacks[t].splice(l,1),c.push(h)}return c}function c(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=p(t);n&&("keyup"!=t.type||r!==n?e.handleKey(n,m(t),t):r=!1)}function d(){clearTimeout(n),n=setTimeout(l,1e3)}function C(t,e,n,s){function o(e){return function(){a=e,++i[t],d()}}function h(e){c(n,e,t),"keyup"!==s&&(r=p(e)),setTimeout(l,10)}i[t]=0;for(var u=0;u<e.length;++u){var g=u+1===e.length,f=g?h:o(s||E(e[u+1]).action);w(e[u],f,s,t,u)}}function w(t,n,i,r,s){e._directMap[t+":"+i]=n,t=t.replace(/\s+/g," ");var o,a=t.split(" ");a.length>1?C(t,a,n,i):(o=E(t,i),e._callbacks[o.key]=e._callbacks[o.key]||[],h(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=h(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,c(r[i].callback,n,r[i].combo,r[i].seq)}else d||c(r[i].callback,n,r[i].combo);var g="keypress"==n.type&&o;n.type!=a||v(t)||g||l(s),o=d&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var i=0;i<t.length;++i)w(t[i],e,n)},g(t,"keypress",u),g(t,"keydown",u),g(t,"keyup",u)}})("undefined"!==typeof window?window:null,"undefined"!==typeof window?document:null)},7898:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return MO}});var i={};n.r(i),n.d(i,{async:function(){return GC},block:function(){return jC},circle:function(){return UC},circlePlus:function(){return WC},classic:function(){return LC},cross:function(){return VC},diamond:function(){return BC},ellipse:function(){return XC},path:function(){return $C}});var r={};n.r(r),n.d(r,{annotations:function(){return vC},atConnectionLength:function(){return hw},atConnectionLengthIgnoreGradient:function(){return ow},atConnectionLengthKeepGradient:function(){return sw},atConnectionRatio:function(){return cw},atConnectionRatioIgnoreGradient:function(){return lw},atConnectionRatioKeepGradient:function(){return aw},connection:function(){return rw},displayEmpty:function(){return wC},eol:function(){return CC},fill:function(){return uC},filter:function(){return PC},html:function(){return OC},lineHeight:function(){return mC},port:function(){return DC},ref:function(){return zv},refCx:function(){return qv},refCy:function(){return Xv},refD:function(){return tC},refDKeepOffset:function(){return Jv},refDResetOffset:function(){return Yv},refDx:function(){return $v},refDy:function(){return Iv},refHeight:function(){return _v},refHeight2:function(){return sC},refPoints:function(){return eC},refPointsKeepOffset:function(){return Kv},refPointsResetOffset:function(){return Zv},refR:function(){return Qv},refRCircumscribed:function(){return Wv},refRInscribed:function(){return Uv},refRx:function(){return Gv},refRy:function(){return Hv},refWidth:function(){return Vv},refWidth2:function(){return rC},refX:function(){return Bv},refX2:function(){return nC},refY:function(){return Rv},refY2:function(){return iC},resetOffset:function(){return AC},sourceMarker:function(){return KC},stroke:function(){return dC},style:function(){return kC},targetMarker:function(){return QC},text:function(){return gC},textPath:function(){return bC},textVerticalAnchor:function(){return yC},textWrap:function(){return pC},title:function(){return xC},vertexMarker:function(){return tw},xAlign:function(){return EC},yAlign:function(){return MC}});var s={};n.r(s),n.d(s,{dot:function(){return gw},doubleMesh:function(){return mw},fixedDot:function(){return pw},mesh:function(){return fw}});var o={};n.r(o),n.d(o,{blur:function(){return xw},brightness:function(){return Pw},contrast:function(){return Dw},dropShadow:function(){return Ew},grayScale:function(){return Mw},highlight:function(){return ww},hueRotate:function(){return kw},invert:function(){return Ow},outline:function(){return Cw},saturate:function(){return Sw},sepia:function(){return Aw}});var a={};n.r(a),n.d(a,{flipX:function(){return Nw},flipXY:function(){return Lw},flipY:function(){return jw},watermark:function(){return Fw}});var l={};n.r(l),n.d(l,{className:function(){return Iw},opacity:function(){return _w},stroke:function(){return Hw}});var h={};n.r(h),n.d(h,{absolute:function(){return Yw},bottom:function(){return rx},ellipse:function(){return Jw},ellipseSpread:function(){return Zw},left:function(){return ex},line:function(){return tx},right:function(){return nx},top:function(){return ix}});var c={};n.r(c),n.d(c,{bottom:function(){return gx},inside:function(){return mx},insideOriented:function(){return yx},left:function(){return cx},manual:function(){return hx},outside:function(){return px},outsideOriented:function(){return fx},radial:function(){return wx},radialOriented:function(){return xx},right:function(){return ux},top:function(){return dx}});var u={};n.r(u),n.d(u,{noop:function(){return Vx},pinAbsolute:function(){return qx},pinRelative:function(){return Wx}});var d={};n.r(d),n.d(d,{bottom:function(){return xE},bottomLeft:function(){return kE},bottomRight:function(){return OE},center:function(){return CE},left:function(){return EE},midSide:function(){return zE},nodeCenter:function(){return LE},orth:function(){return jE},right:function(){return ME},top:function(){return wE},topLeft:function(){return AE},topRight:function(){return SE}});var g={};n.r(g),n.d(g,{closest:function(){return VE},length:function(){return $E},orth:function(){return GE},ratio:function(){return RE}});var p={};n.r(p),n.d(p,{anchor:function(){return KE},bbox:function(){return XE},boundary:function(){return JE},rect:function(){return YE}});var f={};n.r(f),n.d(f,{er:function(){return IM},loop:function(){return _M},manhattan:function(){return BM},metro:function(){return $M},normal:function(){return tM},oneSide:function(){return eM},orth:function(){return lM}});var m={};n.r(m),n.d(m,{jumpover:function(){return oA},loop:function(){return UM},normal:function(){return HM},rounded:function(){return WM},smooth:function(){return qM}});var y=n(6252),b=n(3577);const v=(0,y.Uk)("同步"),C={class:"span-ellipsis"},w=(0,y.Uk)(" 同步 "),x=(0,y.Uk)(" 导出 ");function E(t,e,n,i,r,s){const o=(0,y.up)("el-button"),a=(0,y.up)("el-empty"),l=(0,y.up)("el-skeleton"),h=(0,y.up)("el-switch"),c=(0,y.up)("el-tooltip"),u=(0,y.up)("el-tree"),d=(0,y.up)("el-space"),g=(0,y.up)("el-aside"),p=(0,y.up)("el-option"),f=(0,y.up)("el-select"),m=(0,y.up)("el-header"),E=(0,y.up)("DocumentList"),M=(0,y.up)("el-tab-pane"),A=(0,y.up)("el-col"),S=(0,y.up)("el-row"),k=(0,y.up)("diagram"),O=(0,y.up)("el-tabs"),P=(0,y.up)("document-remark"),D=(0,y.up)("el-main"),T=(0,y.up)("el-container"),N=(0,y.Q2)("loading"),j=(0,y.Q2)("require-roles"),L=(0,y.Q2)("select-more");return i.isShowNoDataPage?((0,y.wg)(),(0,y.j4)(a,{key:0,description:"似乎还没有同步过文档"},{default:(0,y.w5)((()=>[(0,y.Wm)(o,{type:"primary",icon:"refresh",round:"",size:"large",onClick:i.onSyncProjectDocument,loading:i.loadings.handleSync},{default:(0,y.w5)((()=>[v])),_:1},8,["onClick","loading"])])),_:1})):i.isShowLoadingPage?(0,y.wy)(((0,y.wg)(),(0,y.j4)(l,{key:1,rows:12},null,512)),[[N,!i.loadings.init]]):((0,y.wg)(),(0,y.j4)(T,{key:2},{default:(0,y.w5)((()=>[(0,y.Wm)(g,null,{default:(0,y.w5)((()=>[(0,y.Wm)(d,{direction:"vertical",size:26,alignment:"left",class:"doc-toc-aside"},{default:(0,y.w5)((()=>[(0,y.Wm)(h,{modelValue:i.tocData.isMultiSelectionMode,"onUpdate:modelValue":e[0]||(e[0]=t=>i.tocData.isMultiSelectionMode=t),"active-text":"多选模式","inactive-text":"单选模式",onChange:i.onMultiSelectionModeChange,loading:i.loadings.multiSelectionModeChanging},null,8,["modelValue","onChange","loading"]),(0,y.Wm)(u,{ref:"treeRef",data:i.tocData.value,"default-checked-keys":i.tocData.checkedNodes,"show-checkbox":i.tocData.isMultiSelectionMode,"node-key":"id","highlight-current":"",props:i.tocData.treeProps,onNodeClick:i.onTocNodeClick,onCheckChange:i.onTocNodeCheckChange},{default:(0,y.w5)((({node:t})=>[(0,y._)("span",C,[(0,y.Wm)(c,{content:t.comment?t.label+"("+t.comment+")":t.label,effect:"light"},{default:(0,y.w5)((()=>[(0,y._)("span",null,(0,b.zw)(t.label),1)])),_:2},1032,["content"])])])),_:1},8,["data","default-checked-keys","show-checkbox","props","onNodeClick","onCheckChange"])])),_:1})])),_:1}),(0,y.Wm)(T,null,{default:(0,y.w5)((()=>[(0,y.Wm)(m,null,{default:(0,y.w5)((()=>[(0,y._)("div",null,[(0,y.Wm)(d,{size:28,style:{"margin-bottom":"33px"}},{default:(0,y.w5)((()=>[(0,y.wy)(((0,y.wg)(),(0,y.j4)(o,{type:"success",style:{width:"100%"},icon:"Refresh",onClick:i.onSyncProjectDocument,loading:i.loadings.handleSync},{default:(0,y.w5)((()=>[w])),_:1},8,["onClick","loading"])),[[j,["SYS_OWNER","GROUP_OWNER?groupId="+i.projectData.groupId,"GROUP_MEMBER?groupId="+i.projectData.groupId]]]),(0,y.wy)(((0,y.wg)(),(0,y.j4)(o,{type:"primary",style:{width:"100%"},icon:"Download",onClick:e[1]||(e[1]=t=>i.onDocumentExport()),loading:i.loadings.export},{default:(0,y.w5)((()=>[x])),_:1},8,["loading"])),[[j,["SYS_OWNER","GROUP_OWNER?groupId="+i.projectData.groupId,"GROUP_MEMBER?groupId="+i.projectData.groupId]]]),(0,y.wy)(((0,y.wg)(),(0,y.j4)(f,{onChange:i.onProjectDocumentVersionChange,modelValue:i.projectData.documentFilter.version,"onUpdate:modelValue":e[2]||(e[2]=t=>i.projectData.documentFilter.version=t),placeholder:"历史版本",clearable:""},{default:(0,y.w5)((()=>[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(i.versionData.versions,(t=>((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"])),[[L,i.loadMoreDocumentVersions],[N,i.loadings.loadingVersions]])])),_:1})])])),_:1}),(0,y.Wm)(D,null,{default:(0,y.w5)((()=>[(0,y.Wm)(O,{"model-value":"tableDocument"},{default:(0,y.w5)((()=>[(0,y.Wm)(M,{label:"列表",name:"tableDocument"},{default:(0,y.w5)((()=>[(0,y.Wm)(E,{tablesData:i.documentData.tables,overviewData:i.documentData.overview,onOnRemark:i.showRemarkDrawer},null,8,["tablesData","overviewData","onOnRemark"])])),_:1}),(0,y.Wm)(M,{label:"UML",name:"umlPanel",style:{width:"100%"},lazy:!0},{default:(0,y.w5)((()=>[(0,y.Wm)(S,null,{default:(0,y.w5)((()=>[(0,y.Wm)(A,{span:5},{default:(0,y.w5)((()=>[(0,y.Wm)(h,{modelValue:i.umlData.showComment,"onUpdate:modelValue":e[3]||(e[3]=t=>i.umlData.showComment=t),"active-text":"显示注释","inactive-text":"隐藏注释"},null,8,["modelValue"])])),_:1})])),_:1}),(0,y.Wm)(k,{"model-data":i.umlData.tables,"show-comment":i.umlData.showComment},null,8,["model-data","show-comment"])])),_:1})])),_:1}),(0,y.Wm)(P,{groupId:i.documentRemarkData.groupId,projectId:i.documentRemarkData.projectId,tableName:i.documentRemarkData.tableName,columnName:i.documentRemarkData.columnName,isShowDrawer:i.documentRemarkData.isShowDrawer,onOnClose:e[4]||(e[4]=t=>i.documentRemarkData.isShowDrawer=!1)},null,8,["groupId","projectId","tableName","columnName","isShowDrawer"])])),_:1})])),_:1})])),_:1}))}var M=n(2262),A=n(2119),S=n(3872);const k="/api/v1.0",O=(t,e,n)=>S.Z.post(k+"/projects/"+t+"/documents/"+e+"/table_documents",n),P=(t,e)=>S.Z.get(k+"/projects/"+t+"/documents/simple",{params:e}),D=t=>S.Z.post(k+"/projects/"+t+"/documents"),T=(t,e)=>S.Z.get(k+"/projects/"+t+"/document_versions",{params:e}),N=(t,e,n,i)=>j(k+"/projects/"+t+"/document_files",e,n,i);function j(t,e,n,i){S.Z.get(t,{responseType:"blob",params:e}).then((t=>{let e=window.URL||window.webkitURL||window;const r=document.createElement("a");r.href=e.createObjectURL(new Blob([t])),r.download=n+".md",document.body.appendChild(r),r.click(),i()})).catch((()=>i()))}var L=n(7234);const F={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",F)}var B=n(9755),R=n.n(B);n(450);const $=navigator.userAgent;var I;if(function(t){t.IS_MAC=navigator.appVersion.indexOf("Mac")>0,t.IS_IOS=!!$.match(/(iPad|iPhone|iPod)/g),t.IS_WINDOWS=navigator.appVersion.indexOf("Win")>0,t.IS_IE=$.indexOf("MSIE")>=0,t.IS_IE11=!!$.match(/Trident\/7\./),t.IS_EDGE=!!$.match(/Edge\//),t.IS_NETSCAPE=$.indexOf("Mozilla/")>=0&&$.indexOf("MSIE")<0&&$.indexOf("Edge/")<0,t.IS_CHROME_APP=null!=window.chrome&&null!=window.chrome.app&&null!=window.chrome.app.runtime,t.IS_CHROME=$.indexOf("Chrome/")>=0&&$.indexOf("Edge/")<0,t.IS_OPERA=$.indexOf("Opera/")>=0||$.indexOf("OPR/")>=0,t.IS_FIREFOX=$.indexOf("Firefox/")>=0,t.IS_SAFARI=$.indexOf("AppleWebKit/")>=0&&$.indexOf("Chrome/")<0&&$.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")}`||$.indexOf("Opera/")>=0,t.SUPPORT_FOREIGNOBJECT=!t.NO_FOREIGNOBJECT}(I||(I={})),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}(I||(I={})),I.SUPPORT_PASSIVE){R().event.special.touchstart={setup(t,e,n){if(!this.addEventListener)return!1;this.addEventListener("touchstart",n,{passive:!0})}};const t=R().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 V=Array.isArray,_=V,G="object"==typeof global&&global&&global.Object===Object&&global,H=G,U="object"==typeof self&&self&&self.Object===Object&&self,W=H||U||Function("return this")(),q=W,X=q.Symbol,Y=X,J=Object.prototype,Z=J.hasOwnProperty,K=J.toString,Q=Y?Y.toStringTag:void 0;function tt(t){var e=Z.call(t,Q),n=t[Q];try{t[Q]=void 0;var i=!0}catch(s){}var r=K.call(t);return i&&(e?t[Q]=n:delete t[Q]),r}var et=tt,nt=Object.prototype,it=nt.toString;function rt(t){return it.call(t)}var st=rt,ot="[object Null]",at="[object Undefined]",lt=Y?Y.toStringTag:void 0;function ht(t){return null==t?void 0===t?at:ot:lt&&lt in Object(t)?et(t):st(t)}var ct=ht;function ut(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var dt=ut,gt="[object AsyncFunction]",pt="[object Function]",ft="[object GeneratorFunction]",mt="[object Proxy]";function yt(t){if(!dt(t))return!1;var e=ct(t);return e==pt||e==ft||e==gt||e==mt}var bt=yt,vt=9007199254740991;function Ct(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=vt}var wt=Ct;function xt(t){return null!=t&&wt(t.length)&&!bt(t)}var Et=xt,Mt=q["__core-js_shared__"],At=Mt,St=function(){var t=/[^.]+$/.exec(At&&At.keys&&At.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function kt(t){return!!St&&St in t}var Ot=kt,Pt=Function.prototype,Dt=Pt.toString;function Tt(t){if(null!=t){try{return Dt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var Nt=Tt,jt=/[\\^$.*+?()[\]{}|]/g,Lt=/^\[object .+?Constructor\]$/,Ft=Function.prototype,zt=Object.prototype,Bt=Ft.toString,Rt=zt.hasOwnProperty,$t=RegExp("^"+Bt.call(Rt).replace(jt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function It(t){if(!dt(t)||Ot(t))return!1;var e=bt(t)?$t:Lt;return e.test(Nt(t))}var Vt=It;function _t(t,e){return null==t?void 0:t[e]}var Gt=_t;function Ht(t,e){var n=Gt(t,e);return Vt(n)?n:void 0}var Ut=Ht,Wt=Ut(Object,"create"),qt=Wt;function Xt(){this.__data__=qt?qt(null):{},this.size=0}var Yt=Xt;function Jt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Zt=Jt,Kt="__lodash_hash_undefined__",Qt=Object.prototype,te=Qt.hasOwnProperty;function ee(t){var e=this.__data__;if(qt){var n=e[t];return n===Kt?void 0:n}return te.call(e,t)?e[t]:void 0}var ne=ee,ie=Object.prototype,re=ie.hasOwnProperty;function se(t){var e=this.__data__;return qt?void 0!==e[t]:re.call(e,t)}var oe=se,ae="__lodash_hash_undefined__";function le(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=qt&&void 0===e?ae:e,this}var he=le;function ce(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])}}ce.prototype.clear=Yt,ce.prototype["delete"]=Zt,ce.prototype.get=ne,ce.prototype.has=oe,ce.prototype.set=he;var ue=ce;function de(){this.__data__=[],this.size=0}var ge=de;function pe(t,e){return t===e||t!==t&&e!==e}var fe=pe;function me(t,e){var n=t.length;while(n--)if(fe(t[n][0],e))return n;return-1}var ye=me,be=Array.prototype,ve=be.splice;function Ce(t){var e=this.__data__,n=ye(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():ve.call(e,n,1),--this.size,!0}var we=Ce;function xe(t){var e=this.__data__,n=ye(e,t);return n<0?void 0:e[n][1]}var Ee=xe;function Me(t){return ye(this.__data__,t)>-1}var Ae=Me;function Se(t,e){var n=this.__data__,i=ye(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}var ke=Se;function Oe(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])}}Oe.prototype.clear=ge,Oe.prototype["delete"]=we,Oe.prototype.get=Ee,Oe.prototype.has=Ae,Oe.prototype.set=ke;var Pe=Oe,De=Ut(q,"Map"),Te=De;function Ne(){this.size=0,this.__data__={hash:new ue,map:new(Te||Pe),string:new ue}}var je=Ne;function Le(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}var Fe=Le;function ze(t,e){var n=t.__data__;return Fe(e)?n["string"==typeof e?"string":"hash"]:n.map}var Be=ze;function Re(t){var e=Be(this,t)["delete"](t);return this.size-=e?1:0,e}var $e=Re;function Ie(t){return Be(this,t).get(t)}var Ve=Ie;function _e(t){return Be(this,t).has(t)}var Ge=_e;function He(t,e){var n=Be(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}var Ue=He;function We(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])}}We.prototype.clear=je,We.prototype["delete"]=$e,We.prototype.get=Ve,We.prototype.has=Ge,We.prototype.set=Ue;var qe=We,Xe="__lodash_hash_undefined__";function Ye(t){return this.__data__.set(t,Xe),this}var Je=Ye;function Ze(t){return this.__data__.has(t)}var Ke=Ze;function Qe(t){var e=-1,n=null==t?0:t.length;this.__data__=new qe;while(++e<n)this.add(t[e])}Qe.prototype.add=Qe.prototype.push=Je,Qe.prototype.has=Ke;var tn=Qe;function en(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 nn=en;function rn(t){return t!==t}var sn=rn;function on(t,e,n){var i=n-1,r=t.length;while(++i<r)if(t[i]===e)return i;return-1}var an=on;function ln(t,e,n){return e===e?an(t,e,n):nn(t,sn,n)}var hn=ln;function cn(t,e){var n=null==t?0:t.length;return!!n&&hn(t,e,0)>-1}var un=cn;function dn(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 gn=dn;function pn(t,e){return t.has(e)}var fn=pn,mn=Ut(q,"Set"),yn=mn;function bn(){}var vn=bn;function Cn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var wn=Cn,xn=1/0,En=yn&&1/wn(new yn([,-0]))[1]==xn?function(t){return new yn(t)}:vn,Mn=En,An=200;function Sn(t,e,n){var i=-1,r=un,s=t.length,o=!0,a=[],l=a;if(n)o=!1,r=gn;else if(s>=An){var h=e?null:Mn(t);if(h)return wn(h);o=!1,r=fn,l=new tn}else l=e?[]:a;t:while(++i<s){var c=t[i],u=e?e(c):c;if(c=n||0!==c?c:0,o&&u===u){var d=l.length;while(d--)if(l[d]===u)continue t;e&&l.push(u),a.push(c)}else r(l,u,n)||(l!==a&&l.push(u),a.push(c))}return a}var kn=Sn;function On(t){return t&&t.length?kn(t):[]}var Pn=On;function Dn(t,e){var n=-1,i=e.length,r=t.length;while(++n<i)t[r+n]=e[n];return t}var Tn=Dn;function Nn(t){return null!=t&&"object"==typeof t}var jn=Nn,Ln="[object Arguments]";function Fn(t){return jn(t)&&ct(t)==Ln}var zn=Fn,Bn=Object.prototype,Rn=Bn.hasOwnProperty,$n=Bn.propertyIsEnumerable,In=zn(function(){return arguments}())?zn:function(t){return jn(t)&&Rn.call(t,"callee")&&!$n.call(t,"callee")},Vn=In,_n=Y?Y.isConcatSpreadable:void 0;function Gn(t){return _(t)||Vn(t)||!!(_n&&t&&t[_n])}var Hn=Gn;function Un(t,e,n,i,r){var s=-1,o=t.length;n||(n=Hn),r||(r=[]);while(++s<o){var a=t[s];e>0&&n(a)?e>1?Un(a,e-1,n,i,r):Tn(r,a):i||(r[r.length]=a)}return r}var Wn=Un;function qn(t){return t}var Xn=qn;function Yn(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 Jn=Yn,Zn=Math.max;function Kn(t,e,n){return e=Zn(void 0===e?t.length-1:e,0),function(){var i=arguments,r=-1,s=Zn(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),Jn(t,this,a)}}var Qn=Kn;function ti(t){return function(){return t}}var ei=ti,ni=function(){try{var t=Ut(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),ii=ni,ri=ii?function(t,e){return ii(t,"toString",{configurable:!0,enumerable:!1,value:ei(e),writable:!0})}:Xn,si=ri,oi=800,ai=16,li=Date.now;function hi(t){var e=0,n=0;return function(){var i=li(),r=ai-(i-n);if(n=i,r>0){if(++e>=oi)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var ci=hi,ui=ci(si),di=ui;function gi(t,e){return di(Qn(t,e,Xn),t+"")}var pi=gi;function fi(t){return jn(t)&&Et(t)}var mi=fi,yi=pi((function(t){return kn(Wn(t,1,mi,!0))})),bi=yi,vi="[object Symbol]";function Ci(t){return"symbol"==typeof t||jn(t)&&ct(t)==vi}var wi=Ci,xi=4294967295,Ei=xi-1,Mi=Math.floor,Ai=Math.min;function Si(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=wi(e),h=void 0===e;while(r<s){var c=Mi((r+s)/2),u=n(t[c]),d=void 0!==u,g=null===u,p=u===u,f=wi(u);if(o)var m=i||p;else m=h?p&&(i||d):a?p&&d&&(i||!g):l?p&&d&&!g&&(i||!f):!g&&!f&&(i?u<=e:u<e);m?r=c+1:s=c}return Ai(s,Ei)}var ki=Si,Oi=4294967295,Pi=Oi>>>1;function Di(t,e,n){var i=0,r=null==t?i:t.length;if("number"==typeof e&&e===e&&r<=Pi){while(i<r){var s=i+r>>>1,o=t[s];null!==o&&!wi(o)&&(n?o<=e:o<e)?i=s+1:r=s}return r}return ki(t,e,Xn,n)}var Ti=Di;function Ni(t,e){return Ti(t,e)}var ji=Ni;function Li(){this.__data__=new Pe,this.size=0}var Fi=Li;function zi(t){var e=this.__data__,n=e["delete"](t);return this.size=e.size,n}var Bi=zi;function Ri(t){return this.__data__.get(t)}var $i=Ri;function Ii(t){return this.__data__.has(t)}var Vi=Ii,_i=200;function Gi(t,e){var n=this.__data__;if(n instanceof Pe){var i=n.__data__;if(!Te||i.length<_i-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new qe(i)}return n.set(t,e),this.size=n.size,this}var Hi=Gi;function Ui(t){var e=this.__data__=new Pe(t);this.size=e.size}Ui.prototype.clear=Fi,Ui.prototype["delete"]=Bi,Ui.prototype.get=$i,Ui.prototype.has=Vi,Ui.prototype.set=Hi;var Wi=Ui;function qi(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 Xi=qi,Yi=1,Ji=2;function Zi(t,e,n,i,r,s){var o=n&Yi,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var h=s.get(t),c=s.get(e);if(h&&c)return h==e&&c==t;var u=-1,d=!0,g=n&Ji?new tn:void 0;s.set(t,e),s.set(e,t);while(++u<a){var p=t[u],f=e[u];if(i)var m=o?i(f,p,u,e,t,s):i(p,f,u,t,e,s);if(void 0!==m){if(m)continue;d=!1;break}if(g){if(!Xi(e,(function(t,e){if(!fn(g,e)&&(p===t||r(p,t,n,i,s)))return g.push(e)}))){d=!1;break}}else if(p!==f&&!r(p,f,n,i,s)){d=!1;break}}return s["delete"](t),s["delete"](e),d}var Ki=Zi,Qi=q.Uint8Array,tr=Qi;function er(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n}var nr=er,ir=1,rr=2,sr="[object Boolean]",or="[object Date]",ar="[object Error]",lr="[object Map]",hr="[object Number]",cr="[object RegExp]",ur="[object Set]",dr="[object String]",gr="[object Symbol]",pr="[object ArrayBuffer]",fr="[object DataView]",mr=Y?Y.prototype:void 0,yr=mr?mr.valueOf:void 0;function br(t,e,n,i,r,s,o){switch(n){case fr:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case pr:return!(t.byteLength!=e.byteLength||!s(new tr(t),new tr(e)));case sr:case or:case hr:return fe(+t,+e);case ar:return t.name==e.name&&t.message==e.message;case cr:case dr:return t==e+"";case lr:var a=nr;case ur:var l=i&ir;if(a||(a=wn),t.size!=e.size&&!l)return!1;var h=o.get(t);if(h)return h==e;i|=rr,o.set(t,e);var c=Ki(a(t),a(e),i,r,s,o);return o["delete"](t),c;case gr:if(yr)return yr.call(t)==yr.call(e)}return!1}var vr=br;function Cr(t,e,n){var i=e(t);return _(t)?i:Tn(i,n(t))}var wr=Cr;function xr(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 Er=xr;function Mr(){return[]}var Ar=Mr,Sr=Object.prototype,kr=Sr.propertyIsEnumerable,Or=Object.getOwnPropertySymbols,Pr=Or?function(t){return null==t?[]:(t=Object(t),Er(Or(t),(function(e){return kr.call(t,e)})))}:Ar,Dr=Pr;function Tr(t,e){var n=-1,i=Array(t);while(++n<t)i[n]=e(n);return i}var Nr=Tr;function jr(){return!1}var Lr=jr,Fr="object"==typeof exports&&exports&&!exports.nodeType&&exports,zr=Fr&&"object"==typeof module&&module&&!module.nodeType&&module,Br=zr&&zr.exports===Fr,Rr=Br?q.Buffer:void 0,$r=Rr?Rr.isBuffer:void 0,Ir=$r||Lr,Vr=Ir,_r=9007199254740991,Gr=/^(?:0|[1-9]\d*)$/;function Hr(t,e){var n=typeof t;return e=null==e?_r:e,!!e&&("number"==n||"symbol"!=n&&Gr.test(t))&&t>-1&&t%1==0&&t<e}var Ur=Hr,Wr="[object Arguments]",qr="[object Array]",Xr="[object Boolean]",Yr="[object Date]",Jr="[object Error]",Zr="[object Function]",Kr="[object Map]",Qr="[object Number]",ts="[object Object]",es="[object RegExp]",ns="[object Set]",is="[object String]",rs="[object WeakMap]",ss="[object ArrayBuffer]",os="[object DataView]",as="[object Float32Array]",ls="[object Float64Array]",hs="[object Int8Array]",cs="[object Int16Array]",us="[object Int32Array]",ds="[object Uint8Array]",gs="[object Uint8ClampedArray]",ps="[object Uint16Array]",fs="[object Uint32Array]",ms={};function ys(t){return jn(t)&&wt(t.length)&&!!ms[ct(t)]}ms[as]=ms[ls]=ms[hs]=ms[cs]=ms[us]=ms[ds]=ms[gs]=ms[ps]=ms[fs]=!0,ms[Wr]=ms[qr]=ms[ss]=ms[Xr]=ms[os]=ms[Yr]=ms[Jr]=ms[Zr]=ms[Kr]=ms[Qr]=ms[ts]=ms[es]=ms[ns]=ms[is]=ms[rs]=!1;var bs=ys;function vs(t){return function(e){return t(e)}}var Cs=vs,ws="object"==typeof exports&&exports&&!exports.nodeType&&exports,xs=ws&&"object"==typeof module&&module&&!module.nodeType&&module,Es=xs&&xs.exports===ws,Ms=Es&&H.process,As=function(){try{var t=xs&&xs.require&&xs.require("util").types;return t||Ms&&Ms.binding&&Ms.binding("util")}catch(e){}}(),Ss=As,ks=Ss&&Ss.isTypedArray,Os=ks?Cs(ks):bs,Ps=Os,Ds=Object.prototype,Ts=Ds.hasOwnProperty;function Ns(t,e){var n=_(t),i=!n&&Vn(t),r=!n&&!i&&Vr(t),s=!n&&!i&&!r&&Ps(t),o=n||i||r||s,a=o?Nr(t.length,String):[],l=a.length;for(var h in t)!e&&!Ts.call(t,h)||o&&("length"==h||r&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||Ur(h,l))||a.push(h);return a}var js=Ns,Ls=Object.prototype;function Fs(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||Ls;return t===n}var zs=Fs;function Bs(t,e){return function(n){return t(e(n))}}var Rs=Bs,$s=Rs(Object.keys,Object),Is=$s,Vs=Object.prototype,_s=Vs.hasOwnProperty;function Gs(t){if(!zs(t))return Is(t);var e=[];for(var n in Object(t))_s.call(t,n)&&"constructor"!=n&&e.push(n);return e}var Hs=Gs;function Us(t){return Et(t)?js(t):Hs(t)}var Ws=Us;function qs(t){return wr(t,Ws,Dr)}var Xs=qs,Ys=1,Js=Object.prototype,Zs=Js.hasOwnProperty;function Ks(t,e,n,i,r,s){var o=n&Ys,a=Xs(t),l=a.length,h=Xs(e),c=h.length;if(l!=c&&!o)return!1;var u=l;while(u--){var d=a[u];if(!(o?d in e:Zs.call(e,d)))return!1}var g=s.get(t),p=s.get(e);if(g&&p)return g==e&&p==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 C=t.constructor,w=e.constructor;C==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof C&&C instanceof C&&"function"==typeof w&&w instanceof w||(f=!1)}return s["delete"](t),s["delete"](e),f}var Qs=Ks,to=Ut(q,"DataView"),eo=to,no=Ut(q,"Promise"),io=no,ro=Ut(q,"WeakMap"),so=ro,oo="[object Map]",ao="[object Object]",lo="[object Promise]",ho="[object Set]",co="[object WeakMap]",uo="[object DataView]",go=Nt(eo),po=Nt(Te),fo=Nt(io),mo=Nt(yn),yo=Nt(so),bo=ct;(eo&&bo(new eo(new ArrayBuffer(1)))!=uo||Te&&bo(new Te)!=oo||io&&bo(io.resolve())!=lo||yn&&bo(new yn)!=ho||so&&bo(new so)!=co)&&(bo=function(t){var e=ct(t),n=e==ao?t.constructor:void 0,i=n?Nt(n):"";if(i)switch(i){case go:return uo;case po:return oo;case fo:return lo;case mo:return ho;case yo:return co}return e});var vo=bo,Co=1,wo="[object Arguments]",xo="[object Array]",Eo="[object Object]",Mo=Object.prototype,Ao=Mo.hasOwnProperty;function So(t,e,n,i,r,s){var o=_(t),a=_(e),l=o?xo:vo(t),h=a?xo:vo(e);l=l==wo?Eo:l,h=h==wo?Eo:h;var c=l==Eo,u=h==Eo,d=l==h;if(d&&Vr(t)){if(!Vr(e))return!1;o=!0,c=!1}if(d&&!c)return s||(s=new Wi),o||Ps(t)?Ki(t,e,n,i,r,s):vr(t,e,l,n,i,r,s);if(!(n&Co)){var g=c&&Ao.call(t,"__wrapped__"),p=u&&Ao.call(e,"__wrapped__");if(g||p){var f=g?t.value():t,m=p?e.value():e;return s||(s=new Wi),r(f,m,n,i,s)}}return!!d&&(s||(s=new Wi),Qs(t,e,n,i,r,s))}var ko=So;function Oo(t,e,n,i,r){return t===e||(null==t||null==e||!jn(t)&&!jn(e)?t!==t&&e!==e:ko(t,e,n,i,Oo,r))}var Po=Oo,Do=1,To=2;function No(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],h=t[l],c=a[1];if(o&&a[2]){if(void 0===h&&!(l in t))return!1}else{var u=new Wi;if(i)var d=i(h,c,l,t,e,u);if(!(void 0===d?Po(c,h,Do|To,i,u):d))return!1}}return!0}var jo=No;function Lo(t){return t===t&&!dt(t)}var Fo=Lo;function zo(t){var e=Ws(t),n=e.length;while(n--){var i=e[n],r=t[i];e[n]=[i,r,Fo(r)]}return e}var Bo=zo;function Ro(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}var $o=Ro;function Io(t){var e=Bo(t);return 1==e.length&&e[0][2]?$o(e[0][0],e[0][1]):function(n){return n===t||jo(n,t,e)}}var Vo=Io,_o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Go=/^\w*$/;function Ho(t,e){if(_(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!wi(t))||(Go.test(t)||!_o.test(t)||null!=e&&t in Object(e))}var Uo=Ho,Wo="Expected a function";function qo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Wo);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(qo.Cache||qe),n}qo.Cache=qe;var Xo=qo,Yo=500;function Jo(t){var e=Xo(t,(function(t){return n.size===Yo&&n.clear(),t})),n=e.cache;return e}var Zo=Jo,Ko=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qo=/\\(\\)?/g,ta=Zo((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ko,(function(t,n,i,r){e.push(i?r.replace(Qo,"$1"):n||t)})),e})),ea=ta;function na(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 ia=na,ra=1/0,sa=Y?Y.prototype:void 0,oa=sa?sa.toString:void 0;function aa(t){if("string"==typeof t)return t;if(_(t))return ia(t,aa)+"";if(wi(t))return oa?oa.call(t):"";var e=t+"";return"0"==e&&1/t==-ra?"-0":e}var la=aa;function ha(t){return null==t?"":la(t)}var ca=ha;function ua(t,e){return _(t)?t:Uo(t,e)?[t]:ea(ca(t))}var da=ua,ga=1/0;function pa(t){if("string"==typeof t||wi(t))return t;var e=t+"";return"0"==e&&1/t==-ga?"-0":e}var fa=pa;function ma(t,e){e=da(e,t);var n=0,i=e.length;while(null!=t&&n<i)t=t[fa(e[n++])];return n&&n==i?t:void 0}var ya=ma;function ba(t,e,n){var i=null==t?void 0:ya(t,e);return void 0===i?n:i}var va=ba;function Ca(t,e){return null!=t&&e in Object(t)}var wa=Ca;function xa(t,e,n){e=da(e,t);var i=-1,r=e.length,s=!1;while(++i<r){var o=fa(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&&wt(r)&&Ur(o,r)&&(_(t)||Vn(t)))}var Ea=xa;function Ma(t,e){return null!=t&&Ea(t,e,wa)}var Aa=Ma,Sa=1,ka=2;function Oa(t,e){return Uo(t)&&Fo(e)?$o(fa(t),e):function(n){var i=va(n,t);return void 0===i&&i===e?Aa(n,t):Po(e,i,Sa|ka)}}var Pa=Oa;function Da(t){return function(e){return null==e?void 0:e[t]}}var Ta=Da;function Na(t){return function(e){return ya(e,t)}}var ja=Na;function La(t){return Uo(t)?Ta(fa(t)):ja(t)}var Fa=La;function za(t){return"function"==typeof t?t:null==t?Xn:"object"==typeof t?_(t)?Pa(t[0],t[1]):Vo(t):Fa(t)}var Ba=za;function Ra(t,e,n){return ki(t,e,Ba(n,2))}var $a=Ra;function Ia(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 Va=Ia,_a=Va(),Ga=_a;function Ha(t,e){return t&&Ga(t,e,Ws)}var Ua=Ha;function Wa(t,e){return function(n,i){if(null==n)return n;if(!Et(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 qa=Wa,Xa=qa(Ua),Ya=Xa;function Ja(t,e){var n=-1,i=Et(t)?Array(t.length):[];return Ya(t,(function(t,r,s){i[++n]=e(t,r,s)})),i}var Za=Ja;function Ka(t,e){var n=t.length;t.sort(e);while(n--)t[n]=t[n].value;return t}var Qa=Ka;function tl(t,e){if(t!==e){var n=void 0!==t,i=null===t,r=t===t,s=wi(t),o=void 0!==e,a=null===e,l=e===e,h=wi(e);if(!a&&!h&&!s&&t>e||s&&o&&l&&!a&&!h||i&&o&&l||!n&&l||!r)return 1;if(!i&&!s&&!h&&t<e||h&&n&&r&&!i&&!s||a&&n&&r||!o&&r||!l)return-1}return 0}var el=tl;function nl(t,e,n){var i=-1,r=t.criteria,s=e.criteria,o=r.length,a=n.length;while(++i<o){var l=el(r[i],s[i]);if(l){if(i>=a)return l;var h=n[i];return l*("desc"==h?-1:1)}}return t.index-e.index}var il=nl;function rl(t,e,n){e=e.length?ia(e,(function(t){return _(t)?function(e){return ya(e,1===t.length?t[0]:t)}:t})):[Xn];var i=-1;e=ia(e,Cs(Ba));var r=Za(t,(function(t,n,r){var s=ia(e,(function(e){return e(t)}));return{criteria:s,index:++i,value:t}}));return Qa(r,(function(t,e){return il(t,e,n)}))}var sl=rl;function ol(t,e,n){if(!dt(n))return!1;var i=typeof e;return!!("number"==i?Et(n)&&Ur(e,n.length):"string"==i&&e in n)&&fe(n[e],t)}var al=ol,ll=pi((function(t,e){if(null==t)return[];var n=e.length;return n>1&&al(t,e[0],e[1])?e=[]:n>2&&al(e[0],e[1],e[2])&&(e=[e[0]]),sl(t,Wn(e,1),[])})),hl=ll;function cl(t,e,n){"__proto__"==e&&ii?ii(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var ul=cl;function dl(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 gl=dl;function pl(t,e,n,i){return Ya(t,(function(t,r,s){e(i,t,n(t),s)})),i}var fl=pl;function ml(t,e){return function(n,i){var r=_(n)?gl:fl,s=e?e():{};return r(n,t,Ba(i,2),s)}}var yl=ml,bl=Object.prototype,vl=bl.hasOwnProperty,Cl=yl((function(t,e,n){vl.call(t,n)?t[n].push(e):ul(t,n,[e])})),wl=Cl,xl=200;function El(t,e,n,i){var r=-1,s=un,o=!0,a=t.length,l=[],h=e.length;if(!a)return l;n&&(e=ia(e,Cs(n))),i?(s=gn,o=!1):e.length>=xl&&(s=fn,o=!1,e=new tn(e));t:while(++r<a){var c=t[r],u=null==n?c:n(c);if(c=i||0!==c?c:0,o&&u===u){var d=h;while(d--)if(e[d]===u)continue t;l.push(c)}else s(e,u,i)||l.push(c)}return l}var Ml=El,Al=pi((function(t,e){return mi(t)?Ml(t,Wn(e,1,mi,!0)):[]})),Sl=Al;var kl=Object.prototype,Ol=kl.hasOwnProperty;function Pl(t,e){return null!=t&&Ol.call(t,e)}var Dl=Pl;function Tl(t,e){return null!=t&&Ea(t,e,Dl)}var Nl=Tl,jl=Object.prototype,Ll=jl.hasOwnProperty;function Fl(t,e,n){var i=t[e];Ll.call(t,e)&&fe(i,n)&&(void 0!==n||e in t)||ul(t,e,n)}var zl=Fl;function Bl(t,e,n,i){if(!dt(t))return t;e=da(e,t);var r=-1,s=e.length,o=s-1,a=t;while(null!=a&&++r<s){var l=fa(e[r]),h=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(r!=o){var c=a[l];h=i?i(c,l,a):void 0,void 0===h&&(h=dt(c)?c:Ur(e[r+1])?[]:{})}zl(a,l,h),a=a[l]}return t}var Rl=Bl;function $l(t,e,n){var i=-1,r=e.length,s={};while(++i<r){var o=e[i],a=ya(t,o);n(a,o)&&Rl(s,da(o,t),a)}return s}var Il=$l;function Vl(t,e){return Il(t,e,(function(e,n){return Aa(t,n)}))}var _l=Vl;function Gl(t){var e=null==t?0:t.length;return e?Wn(t,1):[]}var Hl=Gl;function Ul(t){return di(Qn(t,void 0,Hl),t+"")}var Wl=Ul,ql=Wl((function(t,e){return null==t?{}:_l(t,e)})),Xl=ql;function Yl(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}var Jl=Yl,Zl=Object.prototype,Kl=Zl.hasOwnProperty;function Ql(t){if(!dt(t))return Jl(t);var e=zs(t),n=[];for(var i in t)("constructor"!=i||!e&&Kl.call(t,i))&&n.push(i);return n}var th=Ql;function eh(t){return Et(t)?js(t,!0):th(t)}var nh=eh;function ih(t,e,n){(void 0!==n&&!fe(t[e],n)||void 0===n&&!(e in t))&&ul(t,e,n)}var rh=ih,sh="object"==typeof exports&&exports&&!exports.nodeType&&exports,oh=sh&&"object"==typeof module&&module&&!module.nodeType&&module,ah=oh&&oh.exports===sh,lh=ah?q.Buffer:void 0,hh=lh?lh.allocUnsafe:void 0;function ch(t,e){if(e)return t.slice();var n=t.length,i=hh?hh(n):new t.constructor(n);return t.copy(i),i}var uh=ch;function dh(t){var e=new t.constructor(t.byteLength);return new tr(e).set(new tr(t)),e}var gh=dh;function ph(t,e){var n=e?gh(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var fh=ph;function mh(t,e){var n=-1,i=t.length;e||(e=Array(i));while(++n<i)e[n]=t[n];return e}var yh=mh,bh=Object.create,vh=function(){function t(){}return function(e){if(!dt(e))return{};if(bh)return bh(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),Ch=vh,wh=Rs(Object.getPrototypeOf,Object),xh=wh;function Eh(t){return"function"!=typeof t.constructor||zs(t)?{}:Ch(xh(t))}var Mh=Eh,Ah="[object Object]",Sh=Function.prototype,kh=Object.prototype,Oh=Sh.toString,Ph=kh.hasOwnProperty,Dh=Oh.call(Object);function Th(t){if(!jn(t)||ct(t)!=Ah)return!1;var e=xh(t);if(null===e)return!0;var n=Ph.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Oh.call(n)==Dh}var Nh=Th;function jh(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}var Lh=jh;function Fh(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?ul(n,a,l):zl(n,a,l)}return n}var zh=Fh;function Bh(t){return zh(t,nh(t))}var Rh=Bh;function $h(t,e,n,i,r,s,o){var a=Lh(t,n),l=Lh(e,n),h=o.get(l);if(h)rh(t,n,h);else{var c=s?s(a,l,n+"",t,e,o):void 0,u=void 0===c;if(u){var d=_(l),g=!d&&Vr(l),p=!d&&!g&&Ps(l);c=l,d||g||p?_(a)?c=a:mi(a)?c=yh(a):g?(u=!1,c=uh(l,!0)):p?(u=!1,c=fh(l,!0)):c=[]:Nh(l)||Vn(l)?(c=a,Vn(a)?c=Rh(a):dt(a)&&!bt(a)||(c=Mh(l))):u=!1}u&&(o.set(l,c),r(c,l,i,s,o),o["delete"](l)),rh(t,n,c)}}var Ih=$h;function Vh(t,e,n,i,r){t!==e&&Ga(e,(function(s,o){if(r||(r=new Wi),dt(s))Ih(t,e,o,n,Vh,i,r);else{var a=i?i(Lh(t,o),s,o+"",t,e,r):void 0;void 0===a&&(a=s),rh(t,o,a)}}),nh)}var _h=Vh;function Gh(t){return pi((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&&al(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 Hh=Gh,Uh=Hh((function(t,e,n){_h(t,e,n)})),Wh=Uh;Hh((function(t,e){zh(e,nh(e),t)}));function qh(t,e){return Po(t,e)}var Xh=qh,Yh="[object Map]",Jh="[object Set]",Zh=Object.prototype,Kh=Zh.hasOwnProperty;function Qh(t){if(null==t)return!0;if(Et(t)&&(_(t)||"string"==typeof t||"function"==typeof t.splice||Vr(t)||Ps(t)||Vn(t)))return!t.length;var e=vo(t);if(e==Yh||e==Jh)return!t.size;if(zs(t))return!Hs(t).length;for(var n in t)if(Kh.call(t,n))return!1;return!0}var tc=Qh;function ec(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 nc=ec;function ic(t,e){return t&&zh(e,Ws(e),t)}var rc=ic;function sc(t,e){return t&&zh(e,nh(e),t)}var oc=sc;function ac(t,e){return zh(t,Dr(t),e)}var lc=ac,hc=Object.getOwnPropertySymbols,cc=hc?function(t){var e=[];while(t)Tn(e,Dr(t)),t=xh(t);return e}:Ar,uc=cc;function dc(t,e){return zh(t,uc(t),e)}var gc=dc;function pc(t){return wr(t,nh,uc)}var fc=pc,mc=Object.prototype,yc=mc.hasOwnProperty;function bc(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&yc.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var vc=bc;function Cc(t,e){var n=e?gh(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var wc=Cc,xc=/\w*$/;function Ec(t){var e=new t.constructor(t.source,xc.exec(t));return e.lastIndex=t.lastIndex,e}var Mc=Ec,Ac=Y?Y.prototype:void 0,Sc=Ac?Ac.valueOf:void 0;function kc(t){return Sc?Object(Sc.call(t)):{}}var Oc=kc,Pc="[object Boolean]",Dc="[object Date]",Tc="[object Map]",Nc="[object Number]",jc="[object RegExp]",Lc="[object Set]",Fc="[object String]",zc="[object Symbol]",Bc="[object ArrayBuffer]",Rc="[object DataView]",$c="[object Float32Array]",Ic="[object Float64Array]",Vc="[object Int8Array]",_c="[object Int16Array]",Gc="[object Int32Array]",Hc="[object Uint8Array]",Uc="[object Uint8ClampedArray]",Wc="[object Uint16Array]",qc="[object Uint32Array]";function Xc(t,e,n){var i=t.constructor;switch(e){case Bc:return gh(t);case Pc:case Dc:return new i(+t);case Rc:return wc(t,n);case $c:case Ic:case Vc:case _c:case Gc:case Hc:case Uc:case Wc:case qc:return fh(t,n);case Tc:return new i;case Nc:case Fc:return new i(t);case jc:return Mc(t);case Lc:return new i;case zc:return Oc(t)}}var Yc=Xc,Jc="[object Map]";function Zc(t){return jn(t)&&vo(t)==Jc}var Kc=Zc,Qc=Ss&&Ss.isMap,tu=Qc?Cs(Qc):Kc,eu=tu,nu="[object Set]";function iu(t){return jn(t)&&vo(t)==nu}var ru=iu,su=Ss&&Ss.isSet,ou=su?Cs(su):ru,au=ou,lu=1,hu=2,cu=4,uu="[object Arguments]",du="[object Array]",gu="[object Boolean]",pu="[object Date]",fu="[object Error]",mu="[object Function]",yu="[object GeneratorFunction]",bu="[object Map]",vu="[object Number]",Cu="[object Object]",wu="[object RegExp]",xu="[object Set]",Eu="[object String]",Mu="[object Symbol]",Au="[object WeakMap]",Su="[object ArrayBuffer]",ku="[object DataView]",Ou="[object Float32Array]",Pu="[object Float64Array]",Du="[object Int8Array]",Tu="[object Int16Array]",Nu="[object Int32Array]",ju="[object Uint8Array]",Lu="[object Uint8ClampedArray]",Fu="[object Uint16Array]",zu="[object Uint32Array]",Bu={};function Ru(t,e,n,i,r,s){var o,a=e&lu,l=e&hu,h=e&cu;if(n&&(o=r?n(t,i,r,s):n(t)),void 0!==o)return o;if(!dt(t))return t;var c=_(t);if(c){if(o=vc(t),!a)return yh(t,o)}else{var u=vo(t),d=u==mu||u==yu;if(Vr(t))return uh(t,a);if(u==Cu||u==uu||d&&!r){if(o=l||d?{}:Mh(t),!a)return l?gc(t,oc(o,t)):lc(t,rc(o,t))}else{if(!Bu[u])return r?t:{};o=Yc(t,u,a)}}s||(s=new Wi);var g=s.get(t);if(g)return g;s.set(t,o),au(t)?t.forEach((function(i){o.add(Ru(i,e,n,i,t,s))})):eu(t)&&t.forEach((function(i,r){o.set(r,Ru(i,e,n,r,t,s))}));var p=h?l?fc:Xs:l?nh:Ws,f=c?void 0:p(t);return nc(f||t,(function(i,r){f&&(r=i,i=t[r]),zl(o,r,Ru(i,e,n,r,t,s))})),o}Bu[uu]=Bu[du]=Bu[Su]=Bu[ku]=Bu[gu]=Bu[pu]=Bu[Ou]=Bu[Pu]=Bu[Du]=Bu[Tu]=Bu[Nu]=Bu[bu]=Bu[vu]=Bu[Cu]=Bu[wu]=Bu[xu]=Bu[Eu]=Bu[Mu]=Bu[ju]=Bu[Lu]=Bu[Fu]=Bu[zu]=!0,Bu[fu]=Bu[mu]=Bu[Au]=!1;var $u=Ru,Iu=4;function Vu(t){return $u(t,Iu)}var _u=Vu,Gu=1,Hu=4;function Uu(t){return $u(t,Gu|Hu)}var Wu=Uu,qu=Object.prototype,Xu=qu.hasOwnProperty,Yu=pi((function(t,e){t=Object(t);var n=-1,i=e.length,r=i>2?e[2]:void 0;r&&al(e[0],e[1],r)&&(i=1);while(++n<i){var s=e[n],o=nh(s),a=-1,l=o.length;while(++a<l){var h=o[a],c=t[h];(void 0===c||fe(c,qu[h])&&!Xu.call(t,h))&&(t[h]=s[h])}}return t})),Ju=Yu;function Zu(t,e,n,i,r,s){return dt(t)&&dt(e)&&(s.set(e,t),_h(t,e,void 0,Zu,s),s["delete"](e)),t}var Ku=Zu,Qu=Hh((function(t,e,n,i){_h(t,e,n,i)})),td=Qu,ed=pi((function(t){return t.push(void 0,Ku),Jn(td,void 0,t)})),nd=ed;function id(t,...e){e.forEach((e=>{Object.getOwnPropertyNames(e.prototype).forEach((n=>{"constructor"!==n&&Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n))}))}))}const rd=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 sd(t,e){function n(){this.constructor=t}rd(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}class od{}const ad=/^\s*class\s+/.test(`${od}`)||/^\s*class\s*\{/.test(`${class{}}`);function ld(t,e){let n;return ad?n=new Function("base",`return class ${t} extends base { }`)(e):(n=new Function("base",`return function ${t}() { return base.apply(this, arguments) }`)(e),sd(n,e)),n}function hd(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 cd(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 ud(t,e,n="/"){const i=Array.isArray(e)?e.slice():e.split(n),r=i.pop();if(r)if(i.length>0){const e=hd(t,i);e&&delete e[r]}else delete t[r];return t}function dd(t){return function(e){return null==t?void 0:t[e]}}var gd=dd,pd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fd=gd(pd),md=fd,yd=/[&<>"']/g,bd=RegExp(yd.source);function vd(t){return t=ca(t),t&&bd.test(t)?t.replace(yd,md):t}var Cd=vd,wd={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},xd=(gd(wd),/&(?:amp|lt|gt|quot|#39);/g);RegExp(xd.source);function Ed(t,e,n){return t===t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}var Md=Ed,Ad=/\s/;function Sd(t){var e=t.length;while(e--&&Ad.test(t.charAt(e)));return e}var kd=Sd,Od=/^\s+/;function Pd(t){return t?t.slice(0,kd(t)+1).replace(Od,""):t}var Dd=Pd,Td=NaN,Nd=/^[-+]0x[0-9a-f]+$/i,jd=/^0b[01]+$/i,Ld=/^0o[0-7]+$/i,Fd=parseInt;function zd(t){if("number"==typeof t)return t;if(wi(t))return Td;if(dt(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=dt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Dd(t);var n=jd.test(t);return n||Ld.test(t)?Fd(t.slice(2),n?2:8):Nd.test(t)?Td:+t}var Bd=zd;function Rd(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 $d=Rd;function Id(t,e,n){var i=t.length;return n=void 0===n?i:n,!e&&n>=i?t:$d(t,e,n)}var Vd=Id,_d="\\ud800-\\udfff",Gd="\\u0300-\\u036f",Hd="\\ufe20-\\ufe2f",Ud="\\u20d0-\\u20ff",Wd=Gd+Hd+Ud,qd="\\ufe0e\\ufe0f",Xd="\\u200d",Yd=RegExp("["+Xd+_d+Wd+qd+"]");function Jd(t){return Yd.test(t)}var Zd=Jd,Kd="[object RegExp]";function Qd(t){return jn(t)&&ct(t)==Kd}var tg=Qd,eg=Ss&&Ss.isRegExp;eg&&Cs(eg);function ng(t){return t.split("")}var ig=ng,rg="\\ud800-\\udfff",sg="\\u0300-\\u036f",og="\\ufe20-\\ufe2f",ag="\\u20d0-\\u20ff",lg=sg+og+ag,hg="\\ufe0e\\ufe0f",cg="["+rg+"]",ug="["+lg+"]",dg="\\ud83c[\\udffb-\\udfff]",gg="(?:"+ug+"|"+dg+")",pg="[^"+rg+"]",fg="(?:\\ud83c[\\udde6-\\uddff]){2}",mg="[\\ud800-\\udbff][\\udc00-\\udfff]",yg="\\u200d",bg=gg+"?",vg="["+hg+"]?",Cg="(?:"+yg+"(?:"+[pg,fg,mg].join("|")+")"+vg+bg+")*",wg=vg+bg+Cg,xg="(?:"+[pg+ug+"?",ug,fg,mg,cg].join("|")+")",Eg=RegExp(dg+"(?="+dg+")|"+xg+wg,"g");function Mg(t){return t.match(Eg)||[]}var Ag=Mg;function Sg(t){return Zd(t)?Ag(t):ig(t)}var kg=Sg;Math.floor;Ta("length");var Og="\\ud800-\\udfff",Pg="\\u0300-\\u036f",Dg="\\ufe20-\\ufe2f",Tg="\\u20d0-\\u20ff",Ng=Pg+Dg+Tg,jg="\\ufe0e\\ufe0f",Lg="["+Og+"]",Fg="["+Ng+"]",zg="\\ud83c[\\udffb-\\udfff]",Bg="(?:"+Fg+"|"+zg+")",Rg="[^"+Og+"]",$g="(?:\\ud83c[\\udde6-\\uddff]){2}",Ig="[\\ud800-\\udbff][\\udc00-\\udfff]",Vg="\\u200d",_g=Bg+"?",Gg="["+jg+"]?",Hg="(?:"+Vg+"(?:"+[Rg,$g,Ig].join("|")+")"+Gg+_g+")*",Ug=Gg+_g+Hg,Wg="(?:"+[Rg+Fg+"?",Fg,$g,Ig,Lg].join("|")+")";RegExp(zg+"(?="+zg+")|"+Wg+Ug,"g");Math.ceil;Math.ceil,Math.floor;var qg=Hh((function(t,e,n,i){zh(e,nh(e),t,i)})),Xg=qg,Yg="[object DOMException]",Jg="[object Error]";function Zg(t){if(!jn(t))return!1;var e=ct(t);return e==Jg||e==Yg||"string"==typeof t.message&&"string"==typeof t.name&&!Nh(t)}var Kg=Zg,Qg=pi((function(t,e){try{return Jn(t,void 0,e)}catch(n){return Kg(n)?n:new Error(n)}})),tp=Qg;function ep(t,e){return ia(e,(function(e){return t[e]}))}var np=ep,ip=Object.prototype,rp=ip.hasOwnProperty;function sp(t,e,n,i){return void 0===t||fe(t,ip[n])&&!rp.call(i,n)?e:t}var op=sp,ap={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function lp(t){return"\\"+ap[t]}var hp=lp,cp=/<%=([\s\S]+?)%>/g,up=cp,dp=/<%-([\s\S]+?)%>/g,gp=dp,pp=/<%([\s\S]+?)%>/g,fp=pp,mp={escape:gp,evaluate:fp,interpolate:up,variable:"",imports:{_:{escape:Cd}}},yp=mp,bp="Invalid `variable` option passed into `_.template`",vp=/\b__p \+= '';/g,Cp=/\b(__p \+=) '' \+/g,wp=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xp=/[()=,{}\[\]\/\s]/,Ep=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Mp=/($^)/,Ap=/['\n\r\u2028\u2029\\]/g,Sp=Object.prototype,kp=Sp.hasOwnProperty;function Op(t,e,n){var i=yp.imports._.templateSettings||yp;n&&al(t,e,n)&&(e=void 0),t=ca(t),e=Xg({},e,i,op);var r,s,o=Xg({},e.imports,i.imports,op),a=Ws(o),l=np(o,a),h=0,c=e.interpolate||Mp,u="__p += '",d=RegExp((e.escape||Mp).source+"|"+c.source+"|"+(c===up?Ep:Mp).source+"|"+(e.evaluate||Mp).source+"|$","g"),g=kp.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(h,l).replace(Ap,hp),n&&(r=!0,u+="' +\n__e("+n+") +\n'"),a&&(s=!0,u+="';\n"+a+";\n__p += '"),i&&(u+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),h=l+e.length,e})),u+="';\n";var p=kp.call(e,"variable")&&e.variable;if(p){if(xp.test(p))throw new Error(bp)}else u="with (obj) {\n"+u+"\n}\n";u=(s?u.replace(vp,""):u).replace(Cp,"$1").replace(wp,"$1;"),u="function("+(p||"obj")+") {\n"+(p?"":"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=tp((function(){return Function(a,g+"return "+u).apply(void 0,l)}));if(f.source=u,Kg(f))throw f;return f}var Pp=Op,Dp=0;function Tp(t){var e=++Dp;return ca(t)+e}var Np=Tp;function jp(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 Lp=jp,Fp={"À":"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"},zp=gd(Fp),Bp=zp,Rp=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,$p="\\u0300-\\u036f",Ip="\\ufe20-\\ufe2f",Vp="\\u20d0-\\u20ff",_p=$p+Ip+Vp,Gp="["+_p+"]",Hp=RegExp(Gp,"g");function Up(t){return t=ca(t),t&&t.replace(Rp,Bp).replace(Hp,"")}var Wp=Up,qp=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Xp(t){return t.match(qp)||[]}var Yp=Xp,Jp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Zp(t){return Jp.test(t)}var Kp=Zp,Qp="\\ud800-\\udfff",tf="\\u0300-\\u036f",ef="\\ufe20-\\ufe2f",nf="\\u20d0-\\u20ff",rf=tf+ef+nf,sf="\\u2700-\\u27bf",of="a-z\\xdf-\\xf6\\xf8-\\xff",af="\\xac\\xb1\\xd7\\xf7",lf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",hf="\\u2000-\\u206f",cf=" \\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",uf="A-Z\\xc0-\\xd6\\xd8-\\xde",df="\\ufe0e\\ufe0f",gf=af+lf+hf+cf,pf="['’]",ff="["+gf+"]",mf="["+rf+"]",yf="\\d+",bf="["+sf+"]",vf="["+of+"]",Cf="[^"+Qp+gf+yf+sf+of+uf+"]",wf="\\ud83c[\\udffb-\\udfff]",xf="(?:"+mf+"|"+wf+")",Ef="[^"+Qp+"]",Mf="(?:\\ud83c[\\udde6-\\uddff]){2}",Af="[\\ud800-\\udbff][\\udc00-\\udfff]",Sf="["+uf+"]",kf="\\u200d",Of="(?:"+vf+"|"+Cf+")",Pf="(?:"+Sf+"|"+Cf+")",Df="(?:"+pf+"(?:d|ll|m|re|s|t|ve))?",Tf="(?:"+pf+"(?:D|LL|M|RE|S|T|VE))?",Nf=xf+"?",jf="["+df+"]?",Lf="(?:"+kf+"(?:"+[Ef,Mf,Af].join("|")+")"+jf+Nf+")*",Ff="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",zf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Bf=jf+Nf+Lf,Rf="(?:"+[bf,Mf,Af].join("|")+")"+Bf,$f=RegExp([Sf+"?"+vf+"+"+Df+"(?="+[ff,Sf,"$"].join("|")+")",Pf+"+"+Tf+"(?="+[ff,Sf+Of,"$"].join("|")+")",Sf+"?"+Of+"+"+Df,Sf+"+"+Tf,zf,Ff,yf,Rf].join("|"),"g");function If(t){return t.match($f)||[]}var Vf=If;function _f(t,e,n){return t=ca(t),e=n?void 0:e,void 0===e?Kp(t)?Vf(t):Yp(t):t.match(e)||[]}var Gf=_f,Hf="['’]",Uf=RegExp(Hf,"g");function Wf(t){return function(e){return Lp(Gf(Wp(e).replace(Uf,"")),t,"")}}var qf=Wf;function Xf(t){return function(e){e=ca(e);var n=Zd(e)?kg(e):void 0,i=n?n[0]:e.charAt(0),r=n?Vd(n,1).join(""):e.slice(1);return i[t]()+r}}var Yf=Xf,Jf=Yf("toUpperCase"),Zf=Jf,Kf=qf((function(t,e,n){return t+(n?" ":"")+Zf(e)})),Qf=Kf;function tm(t){return Zf(ca(t).toLowerCase())}var em=tm,nm=qf((function(t,e,n){return e=e.toLowerCase(),t+(n?em(e):e)})),im=nm,rm=qf((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),sm=rm,om=qf((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),am=om,lm=Yf("toLowerCase"),hm=lm;const cm=t=>{const e=Object.create(null);return n=>{const i=e[n];return i||(e[n]=t(n))}},um=cm((t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase())),dm=cm((t=>Qf(im(t)).replace(/ /g,"")));cm((t=>sm(t).replace(/ /g,"_"))),cm((t=>am(t).replace(/ /g,"."))),cm((t=>am(t).replace(/ /g,"/"))),cm((t=>Zf(am(t)))),cm((t=>Qf(im(t))));function gm(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 pm(){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 fm(t,e={}){const n=R().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:R()("<div/>").append(n).html()}function mm(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=ym(a,n,s-1);if(void 0===i)continue;i<3?(o=!0,r=l):(s=i,r=l)}}return r}function ym(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,h=e.length>n+a?n+a:e.length;r[0]=a;let c=a;for(let t=1;t<l;t+=1)r[t]=s;for(let t=l;t<=h;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,c=Math.min(c,n)}for(let t=h+1;t<=e.length;t+=1)r[t]=s;if(c>n)return;const u=i;i=r,r=u}const o=i[e.length];return o>n?void 0:o}var bm="[object Number]";function vm(t){return"number"==typeof t||jn(t)&&ct(t)==bm}var Cm=vm;q.isFinite;function wm(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=Bd(n),n=n===n?n:0),void 0!==e&&(e=Bd(e),e=e===e?e:0),Md(Bd(t),e,n)}var xm=wm;Math.max,Math.min;q.parseInt;function Em(t){return"string"===typeof t&&"%"===t.slice(-1)}function Mm(t,e){if(null==t)return 0;let n;if("string"===typeof t){if(n=parseFloat(t),Em(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 Am(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 Sm(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 km=function(){return q.Date.now()},Om=km,Pm="Expected a function",Dm=Math.max,Tm=Math.min;function Nm(t,e,n){var i,r,s,o,a,l,h=0,c=!1,u=!1,d=!0;if("function"!=typeof t)throw new TypeError(Pm);function g(e){var n=i,s=r;return i=r=void 0,h=e,o=t.apply(s,n),o}function p(t){return h=t,a=setTimeout(y,e),c?g(t):o}function f(t){var n=t-l,i=t-h,r=e-n;return u?Tm(r,s-i):r}function m(t){var n=t-l,i=t-h;return void 0===l||n>=e||n<0||u&&i>=s}function y(){var t=Om();if(m(t))return b(t);a=setTimeout(y,f(t))}function b(t){return a=void 0,d&&i?g(t):(i=r=void 0,o)}function v(){void 0!==a&&clearTimeout(a),h=0,i=l=r=a=void 0}function C(){return void 0===a?o:b(Om())}function w(){var t=Om(),n=m(t);if(i=arguments,r=this,l=t,n){if(void 0===a)return p(l);if(u)return clearTimeout(a),a=setTimeout(y,e),g(l)}return void 0===a&&(a=setTimeout(y,e)),o}return e=Bd(e)||0,dt(n)&&(c=!!n.leading,u="maxWait"in n,s=u?Dm(Bd(n.maxWait)||0,e):s,d="trailing"in n?!!n.trailing:d),w.cancel=v,w.flush=C,w}var jm=Nm,Lm="Expected a function";function Fm(t,e,n){if("function"!=typeof t)throw new TypeError(Lm);return setTimeout((function(){t.apply(void 0,n)}),e)}var zm=Fm,Bm=pi((function(t,e){return zm(t,1,e)})),Rm=Bm;function $m(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 Im(t,e,...n){return $m(t,e,n)}function Vm(t){return"object"===typeof t&&t.then&&"function"===typeof t.then}function _m(t){return null!=t&&(t instanceof Promise||Vm(t))}function Gm(...t){const e=[];t.forEach((t=>{Array.isArray(t)?e.push(...t):e.push(t)}));const n=e.some((t=>_m(t)));if(n){const t=e.map((t=>_m(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 Hm(...t){const e=Gm(t);return"boolean"===typeof e?Promise.resolve(e):e}const Um=/[\t\r\n\f]/g,Wm=/\S+/g,qm=t=>` ${t} `;function Xm(t){return t&&t.getAttribute&&t.getAttribute("class")||""}function Ym(t,e){if(null==t||null==e)return!1;const n=qm(Xm(t)),i=qm(e);return 1===t.nodeType&&n.replace(Um," ").includes(i)}function Jm(t,e){if(null!=t&&null!=e){if("function"===typeof e)return Jm(t,e(Xm(t)));if("string"===typeof e&&1===t.nodeType){const n=e.match(Wm)||[],i=qm(Xm(t)).replace(Um," ");let r=n.reduce(((t,e)=>t.indexOf(qm(e))<0?`${t}${e} `:t),i);r=r.trim(),i!==r&&t.setAttribute("class",r)}}}function Zm(t,e){if(null!=t){if("function"===typeof e)return Zm(t,e(Xm(t)));if((!e||"string"===typeof e)&&1===t.nodeType){const n=(e||"").match(Wm)||[],i=qm(Xm(t)).replace(Um," ");let r=n.reduce(((t,e)=>{const n=qm(e);return t.indexOf(n)>-1?t.replace(n," "):t}),i);r=e?r.trim():"",i!==r&&t.setAttribute("class",r)}}}function Km(t,e,n){if(null!=t&&null!=e)if(null==n||"string"!==typeof e){if("function"===typeof e)return Km(t,e(Xm(t),n),n);if("string"===typeof e){const n=e.match(Wm)||[];n.forEach((e=>{Ym(t,e)?Zm(t,e):Jm(t,e)}))}}else n?Jm(t,e):Zm(t,e)}let Qm=0;function ty(){return Qm+=1,`v${Qm}`}function ey(t){return null!=t.id&&""!==t.id||(t.id=ty()),t.id}function ny(t){return null!=t&&("function"===typeof t.getScreenCTM&&t instanceof SVGElement)}const iy={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"},ry="1.1";function sy(t,e=document){return e.createElement(t)}function oy(t,e=iy.xhtml,n=document){return n.createElementNS(e,t)}function ay(t,e=document){return oy(t,iy.svg,e)}function ly(t){if(t){const e=`<svg xmlns="${iy.svg}" xmlns:xlink="${iy.xlink}" version="${ry}">${t}</svg>`,{documentElement:n}=hy(e,{async:!1});return n}const e=document.createElementNS(iy.svg,"svg");return e.setAttributeNS(iy.xmlns,"xmlns:xlink",iy.xlink),e.setAttribute("version",ry),e}function hy(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 cy(t,e=!0){const n=t.nodeName;return e?n.toLowerCase():n.toUpperCase()}function uy(t){let e=0,n=t.previousSibling;while(n)1===n.nodeType&&(e+=1),n=n.previousSibling;return e}function dy(t,e){return t.querySelectorAll(e)}function gy(t,e){return t.querySelector(e)}function py(t,e,n){const i=t.ownerSVGElement;let r=t.parentNode;while(r&&r!==n&&r!==i){if(Ym(r,e))return r;r=r.parentNode}return null}function fy(t,e){const n=e&&e.parentNode;return t===n||!!(n&&1===n.nodeType&&16&t.compareDocumentPosition(n))}function my(t){t.parentNode&&t.parentNode.removeChild(t)}function yy(t){while(t.firstChild)t.removeChild(t.firstChild)}function by(t,e){const n=Array.isArray(e)?e:[e];n.forEach((e=>{null!=e&&t.appendChild(e)}))}function vy(t,e){const n=t.firstChild;return n?Cy(n,e):by(t,e)}function Cy(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 wy(t,e){null!=e&&e.appendChild(t)}function xy(t){try{return t instanceof HTMLElement}catch(e){return"object"===typeof t&&1===t.nodeType&&"object"===typeof t.style&&"object"===typeof t.ownerDocument}}function Ey(t,e){return t.getAttribute(e)}function My(t,e){const n=Oy(e);n.ns?t.hasAttributeNS(n.ns,n.local)&&t.removeAttributeNS(n.ns,n.local):t.hasAttribute(e)&&t.removeAttribute(e)}function Ay(t,e,n){if(null==n)return My(t,e);const i=Oy(e);i.ns&&"string"===typeof n?t.setAttributeNS(i.ns,e,n):"id"===e?t.id=`${n}`:t.setAttribute(e,`${n}`)}function Sy(t,e){Object.keys(e).forEach((n=>{Ay(t,n,e[n])}))}function ky(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?Sy(t,e):Ay(t,e,n)}function Oy(t){if(-1!==t.indexOf(":")){const e=t.split(":");return{ns:iy[e[0]],local:e[1]}}return{ns:null,local:t}}function Py(t){const e={};return Object.keys(t).forEach((n=>{const i=um(n);e[i]=t[n]})),e}function Dy(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 Ty(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=Dy(e[n])):r?(s=Dy(t[n]),o=e[n]):(s=Dy(t[n]),o=Dy(e[n])),t[n]=Ty(s,o)}else t[n]=e[n]})),t}function Ny(t,e,n={}){const i=n.offset||0,r=[],s=[];let o,a,l=null;for(let h=0;h<t.length;h+=1){o=s[h]=t[h];for(let r=0,a=e.length;r<a;r+=1){const a=e[r],l=a.start+i,c=a.end+i;h>=l&&h<c&&("string"===typeof o?o=s[h]={t:t[h],attrs:a.attrs}:o.attrs=Ty(Ty({},o.attrs),a.attrs),n.includeAnnotationIndices&&(null==o.annotations&&(o.annotations=[]),o.annotations.push(r)))}a=s[h-1],a?dt(o)&&dt(a)?(l=l,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?l.t+=o.t:(r.push(l),l=o)):dt(o)||dt(a)?(l=l,r.push(l),l=o):l=(l||"")+o:l=o}return null!=l&&r.push(l),r}function jy(t){return t.replace(/ /g," ")}var Ly,Fy;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):h(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 h(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})(Ly||(Ly={})),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 h=encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22"),c="data:image/svg+xml",u=`${c},${h}`;return u}t.isDataUrl=e,t.imageToDataUri=n,t.dataUriToBlob=i,t.downloadBlob=r,t.downloadDataUri=s,t.svgToDataUrl=l}(Fy||(Fy={}));const By={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 Ry;(function(t){function e(t,e,n){const i=R()("<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?By[n]:null;return i?i(t):t}t.measure=e,t.toPx=n})(Ry||(Ry={}));const $y=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}(),Iy=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 Vy(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 _y;function Gy(t,e=0){return Number.isInteger(t)?t:+t.toFixed(e)}function Hy(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 Uy(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 Wy(t,e){return e*Math.round(t/e)}function qy(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 Xy(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})(_y||(_y={}));class Yy{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class Jy extends Yy{constructor(t,e){super(),this.x=null==t?0:t,this.y=null==e?0:e}get[Symbol.toStringTag](){return Jy.toStringTag}round(t=0){return this.x=Gy(this.x,t),this.y=Gy(this.y,t),this}add(t,e){const n=Jy.create(t,e);return this.x+=n.x,this.y+=n.y,this}update(t,e){const n=Jy.create(t,e);return this.x=n.x,this.y=n.y,this}translate(t,e){const n=Jy.create(t,e);return this.x+=n.x,this.y+=n.y,this}rotate(t,e){const n=Jy.rotate(this,t,e);return this.x=n.x,this.y=n.y,this}scale(t,e,n=new Jy){const i=Jy.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 Jy.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?Jy.create(e):null}distance(t){return Math.sqrt(this.squaredDistance(t))}squaredDistance(t){const e=Jy.create(t),n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistance(t){const e=Jy.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 Jy){const e=Jy.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 Jy(0,0);return e.angleBetween(this,t)}toPolar(t){return this.update(Jy.toPolar(this,t)),this}changeInAngle(t,e,n=new Jy){return this.clone().translate(-t,-e).theta(n)-this.theta(n)}adhereToRect(t){return qy(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=Jy.create(t),n=_y.toRad(this.y),i=_y.toRad(e.y),r=this.x,s=e.x,o=_y.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),h=_y.toDeg(Math.atan2(a,l)),c=["NE","E","SE","S","SW","W","NW","N"];let u=h-22.5;return u<0&&(u+=360),u=parseInt(u/45,10),c[u]}cross(t,e){if(null!=t&&null!=e){const n=Jy.create(t),i=Jy.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=Jy.create(t);return this.x*e.x+this.y*e.y}diff(t,e){if("number"===typeof t)return new Jy(this.x-t,this.y-e);const n=Jy.create(t);return new Jy(this.x-n.x,this.y-n.y)}lerp(t,e){const n=Jy.create(t);return new Jy((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=Jy.create(t),i=_y.toRad(n.theta(this));return this.translate(Math.cos(i)*e,-Math.sin(i)*e)}reflection(t){return Jy.create(t).move(this,this.distance(t))}snapToGrid(t,e){return this.x=Wy(this.x,t),this.y=Wy(this.y,null==e?t:e),this}equals(t){const e=Jy.create(t);return null!=e&&e.x===this.x&&e.y===this.y}clone(){return Jy.clone(this)}toJSON(){return Jy.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})(Jy||(Jy={})),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}(Jy||(Jy={})),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=_y.normalize(_y.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),_y.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(Hy(e,n),Hy(i,r))}function h(t,e,n){const i=_y.toRad(_y.normalize(-e)),r=Math.sin(i),s=Math.cos(i);return c(t,s,r,n)}function c(e,i,r,s=new t){const o=n(e),a=n(s),l=o.x-a.x,h=o.y-a.y,c=l*i-h*r,u=h*i+l*r;return new t(c+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=h,t.rotateEx=c}(Jy||(Jy={}));class Zy extends Yy{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 Zy.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 Jy(this.x,this.y)}get topLeft(){return new Jy(this.x,this.y)}get topCenter(){return new Jy(this.x+this.width/2,this.y)}get topRight(){return new Jy(this.x+this.width,this.y)}get center(){return new Jy(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new Jy(this.x,this.y+this.height)}get bottomCenter(){return new Jy(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new Jy(this.x+this.width,this.y+this.height)}get corner(){return new Jy(this.x+this.width,this.y+this.height)}get rightMiddle(){return new Jy(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new Jy(this.x,this.y+this.height/2)}get topLine(){return new Ky(this.topLeft,this.topRight)}get rightLine(){return new Ky(this.topRight,this.bottomRight)}get bottomLine(){return new Ky(this.bottomLeft,this.bottomRight)}get leftLine(){return new Ky(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=_y.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 Zy(this.x+(this.width-r)/2,this.y+(this.height-s)/2,r,s)}round(t=0){return this.x=Gy(this.x,t),this.y=Gy(this.y,t),this.width=Gy(this.width,t),this.height=Gy(this.height,t),this}add(t,e,n,i){const r=Zy.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=Zy.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=Jy.create(t,e);return this.x+=n.x,this.y+=n.y,this}scale(t,e,n=new Jy){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=_y.toRad(t),i=Math.cos(n),r=Math.sin(n);let s=this.getOrigin(),o=this.getTopRight(),a=this.getBottomRight(),l=this.getBottomLeft();s=Jy.rotateEx(s,i,r,e),o=Jy.rotateEx(o,i,r,e),a=Jy.rotateEx(a,i,r,e),l=Jy.rotateEx(l,i,r,e);const h=new Zy(s.x,s.y,0,0);h.add(o.x,o.y,0,0),h.add(a.x,a.y,0,0),h.add(l.x,l.y,0,0),this.update(h)}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=Zy.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=Zy.clone(t),i=e.x,r=e.y;let s=1/0,o=1/0,a=1/0,l=1/0,h=1/0,c=1/0,u=1/0,d=1/0;const g=n.topLeft;g.x<i&&(s=(this.x-i)/(g.x-i)),g.y<r&&(h=(this.y-r)/(g.y-r));const p=n.bottomRight;p.x>i&&(o=(this.x+this.width-i)/(p.x-i)),p.y>r&&(c=(this.y+this.height-r)/(p.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(h,c,u,d)}}getMaxUniformScaleToFit(t,e=this.center){const n=this.getMaxScaleToFit(t,e);return Math.min(n.sx,n.sy)}containsPoint(t,e){return qy(this,Jy.create(t,e))}containsRect(t,e,n,i){const r=Zy.create(t,e,n,i),s=this.x,o=this.y,a=this.width,l=this.height,h=r.x,c=r.y,u=r.width,d=r.height;return 0!==a&&0!==l&&0!==u&&0!==d&&(h>=s&&c>=o&&h+u<=s+a&&c+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=Jy.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 Ky(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=Zy.create(t,e,n,i);if(!this.isIntersectWithRect(r))return null;const s=this.origin,o=this.corner,a=r.origin,l=r.corner,h=Math.max(s.x,a.x),c=Math.max(s.y,a.y);return new Zy(h,c,Math.min(o.x,l.x)-h,Math.min(o.y,l.y)-c)}isIntersectWithRect(t,e,n,i){const r=Zy.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=Zy.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),h=Math.max(i.y,s.y);return new Zy(o,a,l-o,h-a)}getNearestSideToPoint(t){const e=Jy.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=Jy.clone(t);if(this.containsPoint(e)){const t=this.getNearestSideToPoint(e);switch(t){case"right":return new Jy(this.x+this.width,e.y);case"left":return new Jy(this.x,e.y);case"bottom":return new Jy(e.x,this.y+this.height);case"top":return new Jy(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 Zy(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})(Zy||(Zy={})),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}(Zy||(Zy={})),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}(Zy||(Zy={}));class Ky extends Yy{constructor(t,e,n,i){super(),"number"===typeof t&&"number"===typeof e?(this.start=new Jy(t,e),this.end=new Jy(n,i)):(this.start=Jy.create(t),this.end=Jy.create(e))}get[Symbol.toStringTag](){return Ky.toStringTag}get center(){return new Jy((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 Jy(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const t=new Jy(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 Zy(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 Ky(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 Ky(this.start,e),new Ky(e,this.end)]}divideAtLength(t){const e=this.pointAtLength(t);return[new Ky(this.start,e),new Ky(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 Ky(e,t).length()>i)&&!(new Ky(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 Jy(this.end.x-this.start.x,this.end.y-this.start.y),n=new Jy(t.end.x-t.start.x,t.end.y-t.start.y),i=e.x*n.y-e.y*n.x,r=new Jy(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 Jy(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=Jy.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=Jy.create(t,e);return this.closestPoint(n).squaredDistance(n)}pointDistance(t,e){const n=Jy.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 Ky(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 Ky(e,n);return r.translate(i.x-e.x,i.y-e.y),r}relativeCcw(t,e){const n=Jy.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 Ky(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)&&Jy.isPoint(i.start)&&Jy.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})(Ky||(Ky={}));class Qy extends Yy{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 Qy.toStringTag}get center(){return new Jy(this.x,this.y)}bbox(){return Zy.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=Jy.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 Jy(this.x,this.y)),l=new Jy(o.x/(n*n),o.y/(i*i)),h=new Jy(a.x/(n*n),a.y/(i*i)),c=o.dot(l),u=o.dot(h),d=a.dot(h)-1,g=u*u-c*d;if(g<0)return null;if(g>0){const t=Math.sqrt(g),n=(-u-t)/c,i=(-u+t)/c;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/c;if(!(t>=0&&t<=1))return null;e.push(r.lerp(s,t))}return e}intersectsWithLineFromCenterToPoint(t,e=0){const n=Jy.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,h=this.b*this.b;let c=Math.sqrt(1/(1/l+a/h));c=i<0?-c:c;const u=o*c;return s=new Jy(this.x+c,this.y+u),e?s.rotate(-e,this.getCenter()):s}tangentTheta(t){const e=Jy.clone(t),n=e.x,i=e.y,r=this.a,s=this.b,o=this.bbox().center,a=o.x,l=o.y,h=30,c=n>o.x+r/2,u=n<o.x-r/2;let d,g;return c||u?(g=n>o.x?i-h:i+h,d=r*r/(n-a)-r*r*(i-l)*(g-l)/(s*s*(n-a))+a):(d=i>o.y?n+h:n-h,g=s*s/(i-l)-s*s*(n-a)*(d-a)/(r*r*(i-l))+l),new Jy(d,g).theta(e)}scale(t,e){return this.a*=t,this.b*=e,this}rotate(t,e){const n=Zy.fromEllipse(this);n.rotate(t,e);const i=Qy.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=Jy.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 Qy(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})(Qy||(Qy={})),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}(Qy||(Qy={}));class tb extends Yy{constructor(t){if(super(),null!=t){if("string"===typeof t)return tb.parse(t);this.points=t.map((t=>Jy.create(t)))}else this.points=[]}get[Symbol.toStringTag](){return tb.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 Jy){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=Jy.create(t,e);return this.points.forEach((t=>t.translate(n.x,n.y))),this}bbox(){if(0===this.points.length)return new Zy;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 Zy(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 Ky(e[o],e[o+1]),a=n.length(),l=n.closestPointNormalizedLength(t),h=n.pointAt(l),c=h.squaredDistance(t);c<s&&(s=c,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=Jy.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],h=r[l];if(e.equals(s))return!0;const c=new Ky(s,h);if(c.containsPoint(t))return!0;if(i<=s.y&&i>h.y||i>s.y&&i<=h.y){const e=s.x-n>h.x-n?s.x-n:h.x-n;if(e>=0){const r=new Jy(n+e,i),s=new Ky(t,r);c.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 Ky(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 Ky(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],h=new Ky(s,l),c=s.distance(l);if(t<=r+c)return h.pointAtLength((i?1:-1)*(t-r));r+=c}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],h=e[n+1],c=new Ky(l,h),u=l.distance(h);if(c.isDifferentiable()){if(t<=s+u)return c.tangentAtLength((r?1:-1)*(t-s));i=c}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],h=new Ky(o,l),c=h.closestPoint(a),u=c.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 tb;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],h=s.pop(),c=h[0],u=c.cross(l,e);if(u<0)s.push(h),s.push(a),s.push(t),n=!0;else if(0===u){const t=1e-10,n=l.angleBetween(c,e);Math.abs(n-180)<t||l.equals(e)||c.equals(l)?(r[o(a)]=l,s.push(h)):Math.abs((n+1)%360-1)<t&&(s.push(h),i.push(a))}else r[o(a)]=l,s.push(h)}}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 h=[];if(l>0){const t=s.slice(l),e=s.slice(0,l);h=t.concat(e)}else h=s;const c=[];for(let u=0,d=h.length;u<d;u+=1)c.push(h[u][0]);return new tb(c)}equals(t){return null!=t&&(t.points.length===this.points.length&&t.points.every(((t,e)=>t.equals(this.points[e]))))}clone(){return new tb(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})(tb||(tb={})),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}(tb||(tb={}));class eb extends Yy{constructor(t,e,n,i){super(),this.PRECISION=3,this.start=Jy.create(t),this.controlPoint1=Jy.create(e),this.controlPoint2=Jy.create(n),this.end=Jy.create(i)}get[Symbol.toStringTag](){return eb.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,h=n.y,c=i.x,u=i.y,d=[],g=[],p=[[],[]];let f,m,y,b,v,C,w,x,E,M,A;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*c,y=3*o-3*r):(m=6*s-12*a+6*h,f=-3*s+9*a-9*h+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&&g.push(b)}else w=m*m-4*y*f,x=Math.sqrt(w),w<0||(v=(-m+x)/(2*f),v>0&&v<1&&g.push(v),C=(-m-x)/(2*f),C>0&&C<1&&g.push(C));let S=g.length;const k=S;while(S)S-=1,b=g[S],A=1-b,E=A*A*A*r+3*A*A*b*o+3*A*b*b*l+b*b*b*c,p[0][S]=E,M=A*A*A*s+3*A*A*b*a+3*A*b*b*h+b*b*b*u,p[1][S]=M,d[S]={X:E,Y:M};g[k]=0,g[k+1]=1,d[k]={X:r,Y:s},d[k+1]={X:c,Y:u},p[0][k]=r,p[1][k]=s,p[0][k+1]=c,p[1][k+1]=u,g.length=k+2,p[0].length=k+2,p[1].length=k+2,d.length=k+2;const O=Math.min.apply(null,p[0]),P=Math.min.apply(null,p[1]),D=Math.max.apply(null,p[0]),T=Math.max.apply(null,p[1]);return new Zy(O,P,D-O,T-P)}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,h=0,c=0,u=null;const d=i.length;let g=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*g,a=(n+1)*g,l=i,h=r,u=d,c=e.endpointDistance())}));while(1){const e=l?Math.abs(l-h)/l:0,n=null!=h?Math.abs(l-h)/h:0,i=e<r||n<r,u=!l||l<c*r,d=!h||h<c*r,p=u||d;if(i||p)return l<=h?o:a;const f=s.divide(.5);g/=2;const m=f[0].start.distance(t),y=f[0].end.distance(t),b=m+y,v=f[1].start.distance(t),C=f[1].end.distance(t),w=v+C;b<=w?(s=f[0],a-=g,l=m,h=y):(s=f[1],o+=g,l=v,h=C)}}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 eb(e,e,e,e),new eb(e,n,i,r)];if(t>=1)return[new eb(e,n,i,r),new eb(r,r,r,r)];const s=this.getSkeletonPoints(t),o=s.startControlPoint1,a=s.startControlPoint2,l=s.divider,h=s.dividerControlPoint1,c=s.dividerControlPoint2;return[new eb(e,o,a,l),new eb(l,h,c,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 Ky(e,n).pointAt(t),o=new Ky(n,i).pointAt(t),a=new Ky(i,r).pointAt(t),l=new Ky(s,o).pointAt(t),h=new Ky(o,a).pointAt(t),c=new Ky(l,h).pointAt(t);return{startControlPoint1:s,startControlPoint2:l,divider:c,dividerControlPoint1:h,dividerControlPoint2:a}}getSubdivisions(t={}){const e=this.getPrecision(t);let n=[new eb(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 Ky(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,h=0,c=0,u=0;const d=r.length;let g=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*g,a=(e+1)*g,h=n?t-u:s+u-t,c=n?s+u-t:t-u;break}u+=s}if(null==l)return n?1:0;const p=this.length(s),f=Math.pow(10,-i);while(1){let t,e,n;if(t=0!==p?h/p:0,t<f)return o;if(t=0!==p?c/p:0,t<f)return a;const i=l.divide(.5);g/=2;const r=i[0].endpointDistance(),s=i[1].endpointDistance();h<=r?(l=i[0],a-=g,e=h,n=r-e):(l=i[1],o+=g,e=h-r,n=s-e),h=e,c=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 tb(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 eb(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)&&Jy.isPoint(i.start)&&Jy.isPoint(i.controlPoint1)&&Jy.isPoint(i.controlPoint2)&&Jy.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})(eb||(eb={})),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=>Jy.clone(t))),i=[],r=[],s=n.length-1;if(1===s)return i[0]=new Jy((2*n[0].x+n[1].x)/3,(2*n[0].y+n[1].y)/3),r[0]=new Jy(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 Jy(a[e],l[e])),e<s-1?r.push(new Jy(2*n[e+1].x-a[e+1],2*n[e+1].y-l[e+1])):r.push(new Jy((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 Jy(i[0][n].x,i[0][n].y),o=new Jy(i[1][n].x,i[1][n].y);r.push(new t(e[n],s,o,e[n+1]))}return r}t.throughPoints=i}(eb||(eb={}));class nb extends Yy{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 ib extends nb{constructor(t,e){super(),Ky.isLine(t)?this.endPoint=t.end.clone().round(2):this.endPoint=Jy.create(t,e).round(2)}get type(){return"L"}get line(){return new Ky(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 ib(e[0]),new ib(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[new ib(e[0]),new ib(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 ib(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(Ky.isLine(i))return new t(i);if(Jy.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})(ib||(ib={}));class rb extends nb{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 Ky(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 ib(e[0]):this.clone(),new ib(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new ib(e[0]):this.clone(),new ib(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 rb}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})(rb||(rb={}));class sb extends nb{constructor(t,e){super(),this.isVisible=!1,this.isSubpathStart=!0,Ky.isLine(t)||eb.isCurve(t)?this.endPoint=t.end.clone().round(2):this.endPoint=Jy.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 sb(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(Ky.isLine(i))return new t(i);if(eb.isCurve(i))return new t(i);if(Jy.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 ib(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 ib(n,i))}return r}t.create=e})(sb||(sb={}));class ob extends nb{constructor(t,e,n,i,r,s){super(),eb.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 Jy(t,e).round(2),this.controlPoint2=new Jy(n,i).round(2),this.endPoint=new Jy(r,s).round(2)):(this.controlPoint1=Jy.create(t).round(2),this.controlPoint2=Jy.create(e).round(2),this.endPoint=Jy.create(n).round(2))}get type(){return"C"}get curve(){return new eb(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 ob(n[0]),new ob(n[1])]}divideAtLength(t,e={}){const n=this.curve.divideAtLength(t,e);return[new ob(n[0]),new ob(n[1])]}divideAtT(t){const e=this.curve.divideAtT(t);return[new ob(e[0]),new ob(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 ob(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 ab(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function lb(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 hb(t,e,n,i,r,s,o,a,l,h){const c=120*Math.PI/180,u=Math.PI/180*(+r||0);let d,g,p,f,m,y=[];if(h)g=h[0],p=h[1],f=h[2],m=h[3];else{d=ab(t,e,-u),t=d.x,e=d.y,d=ab(a,l,-u),a=d.x,l=d.y;const r=(t-a)/2,h=(e-l)/2;let c=r*r/(n*n)+h*h/(i*i);c>1&&(c=Math.sqrt(c),n*=c,i*=c);const y=n*n,b=i*i,v=(s===o?-1:1)*Math.sqrt(Math.abs((y*b-y*h*h-b*r*r)/(y*h*h+b*r*r)));f=v*n*h/i+(t+a)/2,m=v*-i*r/n+(e+l)/2,g=Math.asin((e-m)/i),p=Math.asin((l-m)/i),g=t<f?Math.PI-g:g,p=a<f?Math.PI-p:p,g<0&&(g=2*Math.PI+g),p<0&&(p=2*Math.PI+p),o&&g>p&&(g-=2*Math.PI),!o&&p>g&&(p-=2*Math.PI)}let b=p-g;if(Math.abs(b)>c){const t=p,e=a,s=l;p=g+c*(o&&p>g?1:-1),a=f+n*Math.cos(p),l=m+i*Math.sin(p),y=hb(a,l,n,i,r,0,o,e,s,[p,t,f,m])}b=p-g;const v=Math.cos(g),C=Math.sin(g),w=Math.cos(p),x=Math.sin(p),E=Math.tan(b/4),M=4/3*(n*E),A=4/3*(i*E),S=[t,e],k=[t+M*C,e-A*v],O=[a+M*x,l-A*w],P=[a,l];if(k[0]=2*S[0]-k[0],k[1]=2*S[1]-k[1],h)return[k,O,P].concat(y);{y=[k,O,P].concat(y).join().split(",");const t=[],e=y.length;for(let n=0;n<e;n+=1)t[n]=n%2?ab(+y[n-1],+y[n],u).y:ab(+y[n],+y[n+1],u).x;return t}}function cb(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 ub(t){const e=cb(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],h=l[0];if(h!==h.toUpperCase())switch(t[0]=h.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 db(t){const e=ub(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(hb.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(lb(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(lb(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],h=a.length;n.x=a[h-2],n.y=a[h-1],n.bx=parseFloat(a[h-4])||n.x,n.by=parseFloat(a[h-3])||n.y}return e[0][0]&&"M"===e[0][0]||e.unshift(["M",0,0]),e}function gb(t){return db(t).map((t=>t.map((t=>"string"===typeof t?t:Gy(t,2))))).join(",").split(",").join(" ")}(function(t){function e(...e){const n=e.length,i=e[0];if(eb.isCurve(i))return new t(i);if(Jy.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})(ob||(ob={}));const pb=new RegExp("^[\\s\\dLMCZz,.]*$");function fb(t){return"string"===typeof t&&pb.test(t)}function mb(t,e){return(t%e+e)%e}function yb(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 Jy(o.x+(e.x-o.x)/2,o.y+(e.y-o.y)/2);t.splice(0,0,n)}let h=t[0],c=1;n?s.push("M",h.x,h.y):s.push("L",h.x,h.y);while(c<(i?t.length:t.length-1)){let e=t[mb(c,t.length)],n=h.x-e.x,i=h.y-e.y;if(a&&(0!==n||0!==i)&&(null==r||r.indexOf(c-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,h=e.x+o,u=e.y+a;s.push("L",h,u);let d=t[mb(c+1,t.length)];while(c<t.length-2&&0===Math.round(d.x-e.x)&&0===Math.round(d.y-e.y))d=t[mb(c+2,t.length)],c+=1;n=d.x-e.x,i=d.y-e.y,r=Math.max(1,Math.sqrt(n*n+i*i));const g=n*Math.min(l,r/2)/r,p=i*Math.min(l,r/2)/r,f=e.x+g,m=e.y+p;s.push("Q",e.x,e.y,f,m),e=new Jy(f,m)}else s.push("L",e.x,e.y);h=e,c+=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 bb(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})})),yb(n,e.round,null==e.initialMove||e.initialMove,e.close,e.exclude)}function vb(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 h=-a/2,c=-l/2,u=Math.cos(r*Math.PI/180),d=Math.sin(r*Math.PI/180),g=u*h+d*c,p=-1*d*h+u*c,f=g*g,m=p*p,y=n*n,b=i*i,v=f/y+m/b;let C;if(v>1)n=Math.sqrt(v)*n,i=Math.sqrt(v)*i,C=0;else{let t=1;s===o&&(t=-1),C=t*Math.sqrt((y*b-y*m-b*f)/(y*m+b*f))}const w=C*n*p/i,x=-1*C*i*g/n,E=u*w-d*x+a/2,M=d*w+u*x+l/2;let A=Math.atan2((p-x)/i,(g-w)/n)-Math.atan2(0,1),S=A>=0?A:2*Math.PI+A;A=Math.atan2((-p-x)/i,(-g-w)/n)-Math.atan2((p-x)/i,(g-w)/n);let k=A>=0?A:2*Math.PI+A;0===o&&k>0?k-=2*Math.PI:0!==o&&k<0&&(k+=2*Math.PI);const O=2*k/Math.PI,P=Math.ceil(O<0?-1*O:O),D=k/P,T=8/3*Math.sin(D/4)*Math.sin(D/4)/Math.sin(D/2),N=u*n,j=u*i,L=d*n,F=d*i;let z=Math.cos(S),B=Math.sin(S),R=-T*(N*B+F*z),$=-T*(L*B-j*z),I=0,V=0;const _=[];for(let G=0;G<P;G+=1){S+=D,z=Math.cos(S),B=Math.sin(S),I=N*z-F*B+E,V=L*z+j*B+M;const n=-T*(N*B+F*z),i=-T*(L*B-j*z),r=6*G;_[r]=Number(R+t),_[r+1]=Number($+e),_[r+2]=Number(I-n+t),_[r+3]=Number(V-i+e),_[r+4]=Number(I+t),_[r+5]=Number(V+e),R=I+n,$=V+i}return _.map((t=>+t.toFixed(2)))}function Cb(t,e,n,i,r=0,s=0,o=0,a,l){const h=[],c=vb(t,e,n,i,r,s,o,a,l);if(null!=c)for(let u=0,d=c.length;u<d;u+=6)h.push("C",c[u],c[u+1],c[u+2],c[u+3],c[u+4],c[u+5]);return h.join(" ")}class wb extends Yy{constructor(t){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(t))if(Ky.isLine(t[0])||eb.isCurve(t[0])){let e=null;const n=t;n.forEach(((t,n)=>{0===n&&this.appendSegment(wb.createSegment("M",t.start)),null==e||e.end.equals(t.start)||this.appendSegment(wb.createSegment("M",t.start)),Ky.isLine(t)?this.appendSegment(wb.createSegment("L",t.end)):eb.isCurve(t)&&this.appendSegment(wb.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&&(Ky.isLine(t)?(this.appendSegment(wb.createSegment("M",t.start)),this.appendSegment(wb.createSegment("L",t.end))):eb.isCurve(t)?(this.appendSegment(wb.createSegment("M",t.start)),this.appendSegment(wb.createSegment("C",t.controlPoint1,t.controlPoint2,t.end))):tb.isPolyline(t)?t.points&&t.points.length&&t.points.forEach(((t,e)=>{const n=0===e?wb.createSegment("M",t):wb.createSegment("L",t);this.appendSegment(n)})):t.isSegment&&this.appendSegment(t))}get[Symbol.toStringTag](){return wb.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(sb.create.call(null,...t))}lineTo(...t){return this.appendSegment(ib.create.call(null,...t))}curveTo(...t){return this.appendSegment(ob.create.call(null,...t))}arcTo(t,e,n,i,r,s,o){const a=this.end||new Jy,l="number"===typeof s?vb(a.x,a.y,t,e,n,i,r,s,o):vb(a.x,a.y,t,e,n,i,r,s.x,s.y);if(null!=l)for(let h=0,c=l.length;h<c;h+=6)this.curveTo(l[h],l[h+1],l[h+2],l[h+3],l[h+4],l[h+5]);return this}quadTo(t,e,n,i){const r=this.end||new Jy,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=wb.parse(s.join(" "));return this.appendSegment(o.segments.slice(1)),this}close(){return this.appendSegment(rb.create())}drawPoints(t,e={}){const n=bb(t,e),i=wb.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 Zy(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=Uy(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,h=this.segments[e],c=s[e],u=h.length({precision:r,subdivisions:c});if(h.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),h=Xy(l,t);h<s&&(r={segmentIndex:o,value:i},s=h)}}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=Xy(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,h=this.segments.length;l<h;l+=1){const e=n?l:h-1-l,a=this.segments[e],c=r[e],u=a.length({precision:i,subdivisions:c});if(a.isVisible){if(t<=o+u)return a.pointAtLength((n?1:-1)*(t-o),{precision:i,subdivisions:c});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=Uy(t.value,0,1);return e[i].pointAtT(r)}divideAt(t,e={}){if(0===this.segments.length)return null;const n=Uy(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,h,c=0;for(let C=0,w=this.segments.length;C<w;C+=1){const e=n?C:w-1-C,h=this.getSegment(e),u=r[e],d={precision:i,subdivisions:u},g=h.length(d);if(h.isDifferentiable()&&(a=h,l=e,t<=c+g)){o=e,s=h.divideAtLength((n?1:-1)*(t-c),d);break}c+=g}if(!a)return null;s||(o=l,h=n?1:0,s=a.divideAtT(h));const u=this.clone(),d=o;u.replaceSegment(d,s);const g=d;let p=d+1,f=d+2;s[0].isDifferentiable()||(u.removeSegment(g),p-=1,f-=1);const m=u.getSegment(p).start;u.insertSegment(p,wb.createSegment("M",m)),f+=1,s[1].isDifferentiable()||(u.removeSegment(f-1),f-=1);const y=f-g-1;for(let C=f,w=u.segments.length;C<w;C+=1){const t=this.getSegment(C-y),e=u.getSegment(C);if("Z"===e.type&&!t.subpathStartSegment.end.equals(e.subpathStartSegment.end)){const e=wb.createSegment("L",t.end);u.replaceSegment(C,e)}}const b=new wb(u.segments.slice(0,p)),v=new wb(u.segments.slice(p));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=Uy(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 c=0;c<i;c+=1){const t=this.segments[c],e=o[c];a+=t.length({precision:s,subdivisions:e})}const l=this.segments[i],h=o[i];return a+=l.lengthAtT(r,{precision:s,subdivisions:h}),a}tangentAt(t,e={}){if(0===this.segments.length)return null;const n=Uy(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,h=this.segments[e],c=r[e],u=h.length({precision:i,subdivisions:c});if(h.isDifferentiable()){if(t<=o+u)return h.tangentAtLength((n?1:-1)*(t-o),{precision:i,subdivisions:c});s=h}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=Uy(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 tb(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 wb;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})(wb||(wb={})),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 sb.create.call(null,...e);if("L"===t)return ib.create.call(null,...e);if("C"===t)return ob.create.call(null,...e);if("z"===t||"Z"===t)return rb.create();throw new Error(`Invalid path segment type "${t}"`)}t.parse=e,t.createSegment=n}(wb||(wb={})),function(t){t.normalize=gb,t.isValid=fb,t.drawArc=Cb,t.drawPoints=bb,t.arcToCurves=vb}(wb||(wb={}));class xb{constructor(t,e,n){if(!t)throw new TypeError("Invalid element to create vector");let i;if(xb.isVector(t))i=t.node;else if("string"===typeof t)if("svg"===t.toLowerCase())i=ly();else if("<"===t[0]){const e=ly(t);i=document.importNode(e.firstChild,!0)}else i=document.createElementNS(iy.svg,t);else i=t;this.node=i,e&&this.setAttributes(e),n&&this.append(n)}get[Symbol.toStringTag](){return xb.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?xv(this.node):(xv(this.node,t,e),this)}translate(t,e=0,n={}){return null==t?Ev(this.node):(Ev(this.node,t,e,n),this)}rotate(t,e,n,i={}){return null==t?Mv(this.node):(Mv(this.node,t,e,n,i),this)}scale(t,e){return null==t?Av(this.node):(Av(this.node,t,e),this)}getTransformToElement(t){const e=xb.toNode(t);return gv(this.node,e)}removeAttribute(t){return My(this.node,t),this}getAttribute(t){return Ey(this.node,t)}setAttribute(t,e){return Ay(this.node,t,e),this}setAttributes(t){return Sy(this.node,t),this}attr(t,e){return null==t?ky(this.node):"string"===typeof t&&void 0===e?ky(this.node,t):("object"===typeof t?ky(this.node,t):ky(this.node,t,e),this)}svg(){return this.node instanceof SVGSVGElement?this:xb.create(this.node.ownerSVGElement)}defs(){const t=this.svg()||this,e=t.node.getElementsByTagName("defs")[0];return e?xb.create(e):xb.create("defs").appendTo(t)}text(t,e={}){return Ob(this.node,t,e),this}tagName(){return cy(this.node)}clone(){return xb.create(this.node.cloneNode(!0))}remove(){return my(this.node),this}empty(){return yy(this.node),this}append(t){return by(this.node,xb.toNodes(t)),this}appendTo(t){return wy(this.node,xb.isVector(t)?t.node:t),this}prepend(t){return vy(this.node,xb.toNodes(t)),this}before(t){return Cy(this.node,xb.toNodes(t)),this}replace(t){return this.node.parentNode&&this.node.parentNode.replaceChild(xb.toNode(t),this.node),xb.create(t)}first(){return this.node.firstChild?xb.create(this.node.firstChild):null}last(){return this.node.lastChild?xb.create(this.node.lastChild):null}get(t){const e=this.node.childNodes[t];return e?xb.create(e):null}indexOf(t){const e=Array.prototype.slice.call(this.node.childNodes);return e.indexOf(xb.toNode(t))}find(t){const e=[],n=dy(this.node,t);if(n)for(let i=0,r=n.length;i<r;i+=1)e.push(xb.create(n[i]));return e}findOne(t){const e=gy(this.node,t);return e?xb.create(e):null}findParentByClass(t,e){const n=py(this.node,t,e);return n?xb.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 fy(this.node,xb.isVector(t)?t.node:t)}wrap(t){const e=xb.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=xb.create(e.node.parentNode),null==t)return e;do{if("string"===typeof t?e.matches(t):e instanceof t)return e}while(e=xb.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(xb.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 uy(this.node)}hasClass(t){return Ym(this.node,t)}addClass(t){return Jm(this.node,t),this}removeClass(t){return Zm(this.node,t),this}toggleClass(t,e){return Km(this.node,t,e),this}toLocalPoint(t,e){return pv(this.node,t,e)}toGeometryShape(){return fv(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 Sv(this.node,t,e,n),this}animate(t){return mv(this.node,t)}animateTransform(t){return yv(this.node,t)}animateAlongPath(t,e){return Cv(this.node,t,e)}normalizePath(){const t=this.tagName();return"path"===t&&this.attr("d",wb.normalize(this.attr("d"))),this}bbox(t,e){return uv(this.node,t,e)}getBBox(t={}){return dv(this.node,{recursive:t.recursive,target:t.target?xb.toNode(t.target):null})}sample(t=1){return this.node instanceof SVGPathElement?jb(this.node,t):[]}toPath(){return xb.create(Gb(this.node))}toPathData(){return Hb(this.node)}}function Eb(t,e){const n=xb.create(e),i=xb.create("textPath"),r=t.d;if(r&&void 0===t["xlink:href"]){const t=xb.create("path").attr("d",r).appendTo(n.defs());i.attr("xlink:href",`#${t.id}`)}return"object"===typeof t&&i.attr(t),i.node}function Mb(t,e,n){const i=n.eol,r=n.baseSize,s=n.lineHeight;let o,a=0;const l={},h=e.length-1;for(let c=0;c<=h;c+=1){let s=e[c],l=null;if("object"===typeof s){const t=s.attrs,e=xb.create("tspan",t);o=e.node;let u=s.t;i&&c===h&&(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&&c===h&&(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=ly(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})(xb||(xb={}));const Ab=/em$/;function Sb(t,e){const n=parseFloat(t);return Ab.test(t)?n*e:n}function kb(t,e,n,i){if(!Array.isArray(e))return 0;const r=e.length;if(!r)return 0;let s=e[0];const o=Sb(s.maxFontSize,n)||n;let a=0;const l=Sb(i,n);for(let u=1;u<r;u+=1){s=e[u];const t=Sb(s.lineHeight,n)||l;a+=t}const h=Sb(s.maxFontSize,n)||n;let c;switch(t){case"middle":c=o/2-.15*h-a/2;break;case"bottom":c=-.25*h-a;break;default:case"top":c=.8*o;break}return c}function Ob(t,e,n={}){e=jy(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 h=n.annotations;h&&!Array.isArray(h)&&(h=[h]);const c=n.lineHeight,u="auto"===c,d=u?"1.5em":c||"1em";yy(t),ky(t,{"xml:space":"preserve",display:e||n.displayEmpty?null:"none"});const g=ky(t,"font-size");let p,f,m=parseFloat(g);m||(m=16,!o&&!h||g||ky(t,"font-size",`${m}`)),r?("string"===typeof r&&(r={d:r}),p=Eb(r,t)):p=document.createDocumentFragment();let y,b=0;const v=e.split("\n"),C=[],w=v.length-1;for(let E=0;E<=w;E+=1){f=d;let t="v-line";const e=ay("tspan");let n,s=v[E];if(s)if(h){const t=Ny(s,h,{offset:-b,includeAnnotationIndices:l});n=Mb(e,t,{eol:E!==w&&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!==w&&(s+=i),e.textContent=s;else{e.textContent="-",t+=" v-empty-line";const i=e.style;i.fillOpacity=0,i.strokeOpacity=0,h&&(n={})}n&&C.push(n),E>0&&e.setAttribute("dy",f),(E>0||r)&&e.setAttribute("x",a),e.className.baseVal=t,p.appendChild(e),b+=s.length+1}if(o)if(h)f=kb(s,C,m,d);else if("top"===s)f="0.8em";else{let t;switch(w>0?(t=parseFloat(d)||1,t*=w,Ab.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=p.firstChild;x.setAttribute("dy",f),t.appendChild(p)}function Pb(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 Db(t,e,n={},i={}){const r=e.width,s=e.height,o=i.svgDocument||ay("svg"),a=ay("text"),l=ay("tspan"),h=document.createTextNode("");ky(a,n),a.appendChild(l),a.style.opacity="0",a.style.display="block",l.style.display="block",l.appendChild(h),o.appendChild(a);const c=null==o.parentNode;c&&document.body.appendChild(o);const u=i.eol||"\n",d=i.separator||" ",g=i.hyphen?new RegExp(i.hyphen):/[^\w\d]/,p=!1!==i.breakWord,f=[],m={};let y,b,v,C=[];const{words:w,separators:x}=Pb(t,i.separator,u,g);for(let E=0,M=0,A=w.length;E<A;E+=1){const t=w[E];if(t)if(t!==u){if(null!=C[M]?(v=x[E-1]||"",h.data=`${C[M]}${v}${t}`):h.data=t,l.getComputedTextLength()<=r)C[M]=h.data,m[M]=x[E],y&&(f[M]=!0,M+=1,y=0);else{if(p){if(!C[M]||y){const e=!!y,n=1===t.length;if(y=t.length-1,e||n){if(n){if(!C[M]){C=[];break}w.splice(E,2,t+w[E+1]),x.splice(E+1,1),f[M]=!0,M+=1,A-=1,E-=1;continue}w[E]=t.substring(0,y),w[E+1]=t.substring(y)+w[E+1]}else w.splice(E,1,t.substring(0,y),t.substring(y)),x.splice(E,0,""),A+=1,M&&!f[M-1]&&(M-=1);E-=1;continue}}else if(!C[M]){C[M]=t,f[M]=!0,M+=1;continue}M+=1,E-=1}if(null!=s){if(null==b){let t;t="auto"===n.lineHeight?{value:1.5,unit:"em"}:Am(n.lineHeight,["em"])||{value:1,unit:"em"},b=t.value,"em"===t.unit&&(I.IS_FIREFOX?b*=l.getBBox().height:b*=a.getBBox().height)}if(b*C.length>s){const t=Math.floor(s/b)-1,e=C[t],n=C[t+1];if(C.splice(t+1),null==e)break;let o=i.ellipsis;if(!o)break;"string"!==typeof o&&(o="…");let a=e;n&&p&&(a+=v+n);let c,u,g=a.length;do{if(u=a[g],c=a.substring(0,g),u?u.match(d)&&(c+=u):c+=m[t],c+=o,h.data=c,l.getComputedTextLength()<=r){C[t]=c;break}g-=1}while(g>=0);break}}}else f[M]=!0,M+=1,C[M]=""}return my(c?o:a),C.join(u)}const Tb=.551784;function Nb(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 jb(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 Lb(t){return["M",Nb(t,"x1"),Nb(t,"y1"),"L",Nb(t,"x2"),Nb(t,"y2")].join(" ")}function Fb(t){const e=Rb(t);return 0===e.length?null:`${Bb(e)} Z`}function zb(t){const e=Rb(t);return 0===e.length?null:Bb(e)}function Bb(t){const e=t.map((t=>`${t.x} ${t.y}`));return`M ${e.join(" L")}`}function Rb(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 $b(t){const e=Nb(t,"cx",0),n=Nb(t,"cy",0),i=Nb(t,"r"),r=i*Tb;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 Ib(t){const e=Nb(t,"cx",0),n=Nb(t,"cy",0),i=Nb(t,"rx"),r=Nb(t,"ry")||i,s=i*Tb,o=r*Tb,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 Vb(t){return _b({x:Nb(t,"x",0),y:Nb(t,"y",0),width:Nb(t,"width",0),height:Nb(t,"height",0),rx:Nb(t,"rx",0),ry:Nb(t,"ry",0)})}function _b(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),h=Math.min(t.ry||t["bottom-ry"]||0,s/2);return e=o||a||l||h?["M",n,i+l,"v",s-l-h,"a",a,h,0,0,0,a,h,"h",r-2*a,"a",a,h,0,0,0,a,-h,"v",-(s-h-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 Gb(t){const e=ay("path");ky(e,ky(t));const n=Hb(t);return n&&e.setAttribute("d",n),e}function Hb(t){const e=t.tagName.toLowerCase();switch(e){case"path":return t.getAttribute("d");case"line":return Lb(t);case"polygon":return Fb(t);case"polyline":return zb(t);case"ellipse":return Ib(t);case"circle":return $b(t);case"rect":return Vb(t);default:break}throw new Error(`"${e}" cannot be converted to svg path element.`)}function Ub(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 h=l-a,c=h<Math.PI?"0":"1",u=Math.cos(a),d=Math.sin(a),g=Math.cos(l),p=Math.sin(l);return h>=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 ${c},1 ${o*g},${o*p}L${s*g},${s*p}A${s},${s} 0 ${c},0 ${s*u},${s*d}Z`:`M${o*u},${o*d}A${o},${o} 0 ${c},1 ${o*g},${o*p}L0,0Z`}const Wb=ay("svg"),qb=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,Xb=/[ ,]+/,Yb=/^(\w+)\((.*)\)/;function Jb(t,e){const n=Wb.createSVGPoint();return n.x=t,n.y=e,n}function Zb(t){const e=Wb.createSVGMatrix();if(null!=t){const n=t,i=e;for(const t in n)i[t]=n[t]}return e}function Kb(t){return null!=t?(t instanceof DOMMatrix||(t=Zb(t)),Wb.createSVGTransformFromMatrix(t)):Wb.createSVGTransform()}function Qb(t){let e=Zb();const n=null!=t&&t.match(qb);if(!n)return e;for(let i=0,r=n.length;i<r;i+=1){const t=n[i],r=t.match(Yb);if(r){let t,n,i,s,o,a=Zb();const l=r[2].split(Xb);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 tv(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 ev(t){let e,n,i;if(t){const r=Xb;if(t.trim().indexOf("matrix")>=0){const r=Qb(t),s=iv(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 nv(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 iv(t){const e=nv(t,{x:0,y:1}),n=nv(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 rv(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 sv(t){let e={x:0,y:1};return t&&(e=nv(t,e)),{angle:_y.normalize(_y.toDeg(Math.atan2(e.y,e.x))-90)}}function ov(t){return{tx:t&&t.e||0,ty:t&&t.f||0}}function av(t,e){const n=Jb(t.x,t.y).matrixTransform(e);return new Jy(n.x,n.y)}function lv(t,e){return new Ky(av(t.start,e),av(t.end,e))}function hv(t,e){const n=Wb.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),h=Math.min(i.y,r.y,s.y,o.y),c=Math.max(i.y,r.y,s.y,o.y);return new Zy(a,h,l-a,c-h)}var cv=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 uv(t,e,n){let i;const r=t.ownerSVGElement;if(!r)return new Zy(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 Zy.create(i);const s=gv(t,n||r);return hv(i,s)}function dv(t,e={}){let n;const i=t.ownerSVGElement;if(!i||!ny(t)){if(xy(t)){const{left:e,top:n,width:i,height:r}=wv(t);return new Zy(e,n,i,r)}return new Zy(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 Zy.create(n);const e=gv(t,r);return hv(n,e)}{const e=t.childNodes,i=e.length;if(0===i)return dv(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?dv(i,{target:r}):dv(i,{target:r,recursive:!0}),n=n?n.union(s):s}return n}}function gv(t,e){if(ny(e)&&ny(t)){const n=e.getScreenCTM(),i=t.getScreenCTM();if(n&&i)return n.inverse().multiply(i)}return Zb()}function pv(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=gv(t,i).inverse();return n.matrixTransform(s)}catch(s){return r}}function fv(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 Zy(e("x"),e("y"),e("width"),e("height"));case"circle":return new Qy(e("cx"),e("cy"),e("r"),e("r"));case"ellipse":return new Qy(e("cx"),e("cy"),e("rx"),e("ry"));case"polyline":{const e=Rb(t);return new tb(e)}case"polygon":{const e=Rb(t);return e.length>1&&e.push(e[0]),new tb(e)}case"path":{let e=t.getAttribute("d");return wb.isValid(e)||(e=wb.normalize(e)),wb.parse(e)}case"line":return new Ky(e("x1"),e("y1"),e("x2"),e("y2"));default:break}return dv(t)}function mv(t,e){return bv(t,e,"animate")}function yv(t,e){return bv(t,e,"animateTransform")}function bv(t,e,n){const i=ay(n);t.appendChild(i);try{return vv(i,e)}catch(r){}return()=>{}}function vv(t,e){const{start:n,complete:i,repeat:r}=e,s=cv(e,["start","complete","repeat"]);ky(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 Cv(t,e,n){const i=ey(n),r=ay("animateMotion"),s=ay("mpath");ky(s,{"xlink:href":`#${i}`}),r.appendChild(s),t.appendChild(r);try{return vv(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 wv(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(Vy(s,"borderLeft"),10),n+=parseInt(Vy(s,"borderTop"),10));i=t.offsetWidth,r=t.offsetHeight}return{left:e,top:n,width:i,height:r}}function xv(t,e,n={}){if(null==e)return Qb(ky(t,"transform"));if(n.absolute)return void t.setAttribute("transform",tv(e));const i=t.transform,r=Kb(e);i.baseVal.appendItem(r)}function Ev(t,e,n=0,i={}){let r=ky(t,"transform");const s=ev(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 Mv(t,e,n,i,r={}){let s=ky(t,"transform");const o=ev(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}`:"",h=`rotate(${a}${l})`;t.setAttribute("transform",`${s} ${h}`.trim())}function Av(t,e,n){let i=ky(t,"transform");const r=ev(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 Sv(t,e,n,i){const r=Jy.create(e),s=Jy.create(n);if(!i){const e=t instanceof SVGSVGElement?t:t.ownerSVGElement;i=e}const o=Av(t);t.setAttribute("transform","");const a=dv(t,{target:i}).scale(o.sx,o.sy),l=Kb();l.setTranslate(-a.x-a.width/2,-a.y-a.height/2);const h=Kb(),c=r.angleBetween(s,r.clone().translate(1,0));c&&h.setRotate(c,0,0);const u=Kb(),d=r.clone().move(s,a.width/2);u.setTranslate(2*r.x-d.x,2*r.y-d.y);const g=gv(t,i),p=Kb();p.setMatrix(u.matrix.multiply(h.matrix.multiply(l.matrix.multiply(g.scale(o.sx,o.sy))))),t.setAttribute("transform",tv(p.matrix))}class kv{constructor(t,e,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=I.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(){I.SUPPORT_PASSIVE?this.target.addEventListener(this.eventName,this.onWheel,{passive:!1}):R()(this.target).on("mousewheel",this.onWheel)}disable(){I.SUPPORT_PASSIVE?this.target.removeEventListener(this.eventName,this.onWheel):R()(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}}xb.isVector,xb.create,xb.createVectors;function Ov(t,e=60){let n=null;return(...i)=>{n&&clearTimeout(n),n=window.setTimeout((()=>{t.apply(this,i)}),e)}}function Pv(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=Ov((()=>{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 Dv(t){let e=null,n=[];const i=Ov((()=>{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 Tv="undefined"!==typeof ResizeObserver?Dv:Pv;var Nv,jv;(function(t){const e=new WeakMap;function n(t){let n=e.get(t);return n||(n=Tv(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)}})(Nv||(Nv={})),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)})(),h=()=>{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(h)};t.scheduleTask=(t,n)=>{const i={callback:t,data:n};e.push(i),a(h)},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}}(jv||(jv={}));class Lv{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||I.isApplyingHMR()||this.onDuplicated(t);const i=this.options.process,r=i?Im(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&&Im(this.options.onConflict,this,t),new Error(`${Zf(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} ${hm(this.options.type)}`:this.options.type;return`${Zf(i)} with name '${t}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(t){return mm(t,Object.keys(this.data),(t=>t))}}(function(t){function e(e){return new t(e)}t.create=e})(Lv||(Lv={}));const Fv={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={},Bv={position:oC("x","width","origin")},Rv={position:oC("y","height","origin")},$v={position:oC("x","width","corner")},Iv={position:oC("y","height","corner")},Vv={set:aC("width","width")},_v={set:aC("height","height")},Gv={set:aC("rx","width")},Hv={set:aC("ry","height")},Uv={set:(t=>{const e=aC(t,"width"),n=aC(t,"height");return function(t,i){const r=i.refBBox,s=r.height>r.width?e:n;return Im(s,this,t,i)}})("r")},Wv={set(t,{refBBox:e}){let n=parseFloat(t);const i=Em(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}}},qv={set:aC("cx","width")},Xv={set:aC("cy","height")},Yv={set:hC({resetOffset:!0})},Jv={set:hC({resetOffset:!1})},Zv={set:cC({resetOffset:!0})},Kv={set:cC({resetOffset:!1})},Qv=Uv,tC=Yv,eC=Zv,nC=Bv,iC=Rv,rC=Vv,sC=_v;function oC(t,e,n){return(i,{refBBox:r})=>{if(null==i)return null;let s=parseFloat(i);const o=Em(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 Jy;return l[t]=a||0,l}}function aC(t,e){return function(n,{refBBox:i}){let r=parseFloat(n);const s=Em(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 lC(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 h=l.shape.clone(),c=l.shapeBBox.clone(),u=c.getOrigin(),d=o.getOrigin();c.x=d.x,c.y=d.y;const g=o.getMaxScaleToFit(c,d),p=0===c.width||0===o.width?1:g.sx,f=0===c.height||0===o.height?1:g.sy;return h.scale(p,f,u),i&&h.translate(-u.x,-u.y),h}}function hC(t){function e(t){return wb.parse(t)}const n=lC(e,t);return(t,e)=>{const i=n(t,e);return{d:i.serialize()}}}function cC(t){const e=lC((t=>new tb(t)),t);return(t,n)=>{const i=e(t,n);return{points:i.serialize()}}}const uC={qualify:Nh,set(t,{view:e}){return`url(#${e.graph.defineGradient(t)})`}},dC={qualify:Nh,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)})`}},gC={qualify(t,{attrs:e}){return null==e.textWrap||!Nh(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},h=i["font-size"]||i.fontSize,c=JSON.stringify([t,l]);if(h&&n.setAttribute("font-size",h),null==o||o!==c){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&&(ey(n),l.textPath=Object.assign({"xlink:href":`#${n.id}`},i))}}Ob(n,`${t}`,l),s.data(r,c)}}},pC={qualify:Nh,set(t,{view:e,elem:n,attrs:i,refBBox:r}){const s=t,o=s.width||0;Em(o)?r.width*=parseFloat(o)/100:o<=0?r.width+=o:r.width=o;const a=s.height||0;let l;Em(a)?r.height*=parseFloat(a)/100:a<=0?r.height+=a:r.height=a;let h=s.text;null==h&&(h=i.text),l=null!=h?Db(`${h}`,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}):"",Im(gC.set,this,l,{view:e,elem:n,attrs:i,refBBox:r,cell:e.cell})}},fC=(t,{attrs:e})=>void 0!==e.text,mC={qualify:fC},yC={qualify:fC},bC={qualify:fC},vC={qualify:fC},CC={qualify:fC},wC={qualify:fC},xC={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)}}}},EC={offset:SC("x","width","right")},MC={offset:SC("y","height","bottom")},AC={offset(t,{refBBox:e}){return t?{x:-e.x,y:-e.y}:{x:0,y:0}}};function SC(t,e,n){return(i,{refBBox:r})=>{const s=new Jy;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:Em(i)?r[e]*parseFloat(i)/100:0,s[t]=-(r[t]+o),s}}const kC={qualify:Nh,set(t,{view:e,elem:n}){e.$(n).css(t)}},OC={set(t,{view:e,elem:n}){e.$(n).html(`${t}`)}},PC={qualify:Nh,set(t,{view:e}){return`url(#${e.graph.defineFilter(t)})`}},DC={set(t){return null!=t&&"object"===typeof t&&t.id?t.id:t}};function TC(t,e,n){let i,r;"object"===typeof e?(i=e.x,r=e.y):(i=e,r=n);const s=wb.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 NC=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 jC=t=>{var{size:e,width:n,height:i,offset:r,open:s}=t,o=NC(t,["size","width","height","offset","open"]);return FC({size:e,width:n,height:i,offset:r},!0===s,!0,void 0,o)},LC=t=>{var{size:e,width:n,height:i,offset:r,factor:s}=t,o=NC(t,["size","width","height","offset","factor"]);return FC({size:e,width:n,height:i,offset:r},!1,!1,s,o)};function FC(t,e,n,i=3/4,r={}){const s=t.size||10,o=t.width||s,a=t.height||s,l=new wb,h={};if(e)l.moveTo(o,0).lineTo(0,a/2).lineTo(o,a),h.fill="none";else{if(l.moveTo(0,a/2),l.lineTo(o,0),!n){const t=xm(i,0,1);l.lineTo(o*t,a/2)}l.lineTo(o,a),l.close()}return Object.assign(Object.assign(Object.assign({},h),r),{tagName:"path",d:TC(l.serialize(),{x:null!=t.offset?t.offset:-o/2})})}var zC=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 BC=t=>{var{size:e,width:n,height:i,offset:r}=t,s=zC(t,["size","width","height","offset"]);const o=e||10,a=n||o,l=i||o,h=new wb;return h.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:TC(h.serialize(),null==r?-a/2:r)})};var RC=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 $C=t=>{var{d:e,offsetX:n,offsetY:i}=t,r=RC(t,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},r),{tagName:"path",d:TC(e,n,i)})};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 VC=t=>{var{size:e,width:n,height:i,offset:r}=t,s=IC(t,["size","width","height","offset"]);const o=e||10,a=n||o,l=i||o,h=new wb;return h.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},s),{tagName:"path",fill:"none",d:TC(h.serialize(),r||-a/2)})};var _C=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 GC=t=>{var{width:e,height:n,offset:i,open:r,flip:s}=t,o=_C(t,["width","height","offset","open","flip"]);let a=n||6;const l=e||10,h=!0===r,c=!0===s,u=Object.assign(Object.assign({},o),{tagName:"path"});c&&(a=-a);const d=new wb;return d.moveTo(0,a).lineTo(l,0),h?u.fill="none":(d.lineTo(l,a),d.close()),u.d=TC(d.serialize(),{x:i||-l/2,y:a/2}),u};var HC=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 UC=t=>{var{r:e}=t,n=HC(t,["r"]);const i=e||5;return Object.assign(Object.assign({cx:i},n),{tagName:"circle",r:i})},WC=t=>{var{r:e}=t,n=HC(t,["r"]);const i=e||5,r=new wb;return r.moveTo(i,0).lineTo(i,2*i),r.moveTo(0,i).lineTo(2*i,i),{children:[Object.assign(Object.assign({},UC({r:i})),{fill:"none"}),Object.assign(Object.assign({},n),{tagName:"path",d:TC(r.serialize(),-i)})]}};var qC=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 XC=t=>{var{rx:e,ry:n}=t,i=qC(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 YC;(function(t){t.presets=i,t.registry=Lv.create({type:"marker"}),t.registry.register(t.presets,!0)})(YC||(YC={})),function(t){t.normalize=TC}(YC||(YC={}));var JC=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 ZC(t){return"string"===typeof t||Nh(t)}const KC={qualify:ZC,set(t,{view:e,attrs:n}){return ew("marker-start",t,e,n)}},QC={qualify:ZC,set(t,{view:e,attrs:n}){return ew("marker-end",t,e,n,{transform:"rotate(180)"})}},tw={qualify:ZC,set(t,{view:e,attrs:n}){return ew("marker-mid",t,e,n)}};function ew(t,e,n,i,r={}){const s="string"===typeof e?{name:e}:e,{name:o,args:a}=s,l=JC(s,["name","args"]);let h=l;if(o&&"string"===typeof o){const t=YC.registry.get(o);if(!t)return YC.registry.onNotFound(o);h=t(Object.assign(Object.assign({},l),a))}const c=Object.assign(Object.assign(Object.assign({},nw(i,t)),r),h);return{[t]:`url(#${n.graph.defineMarker(c)})`}}function nw(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 iw=(t,{view:e})=>e.cell.isEdge(),rw={qualify:iw,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()}}},sw={qualify:iw,set:uw("getTangentAtLength",{rotate:!0})},ow={qualify:iw,set:uw("getTangentAtLength",{rotate:!1})},aw={qualify:iw,set:uw("getTangentAtRatio",{rotate:!0})},lw={qualify:iw,set:uw("getTangentAtRatio",{rotate:!1})},hw=sw,cw=aw;function uw(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 dw;(function(t){function e(t,e,n){if(null!=t){if("string"===typeof t)return!0;if("function"!==typeof t.qualify||Im(t.qualify,this,e,n))return!0}return!1}t.isValidDefinition=e})(dw||(dw={})),function(t){t.presets=Object.assign(Object.assign({},Fv),r),t.registry=Lv.create({type:"attribute definition"}),t.registry.register(t.presets,!0)}(dw||(dw={}));const gw={color:"#aaaaaa",thickness:1,markup:"rect",update(t,e){const n=e.thickness*e.sx,i=e.thickness*e.sy;ky(t,{width:n,height:i,rx:n,ry:i,fill:e.color})}},pw={color:"#aaaaaa",thickness:1,markup:"rect",update(t,e){const n=e.sx<=1?e.thickness*e.sx:e.thickness;ky(t,{width:n,height:n,rx:n,ry:n,fill:e.color})}},fw={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",ky(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}},mw=[{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",ky(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,ky(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}}];class yw{constructor(){this.patterns={},this.root=xb.create(ly(),{width:"100%",height:"100%"},[ay("defs")]).node}add(t,e){const n=this.root.childNodes[0];n&&n.appendChild(e),this.patterns[t]=e,xb.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 bw(t,e){return null!=t?t:e}function vw(t,e){return null!=t&&Number.isFinite(t)?t:e}function Cw(t={}){const e=bw(t.color,"blue"),n=vw(t.width,1),i=vw(t.margin,2),r=vw(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 ww(t={}){const e=bw(t.color,"red"),n=vw(t.blur,0),i=vw(t.width,1),r=vw(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 xw(t={}){const e=vw(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 Ew(t={}){const e=vw(t.dx,0),n=vw(t.dy,0),i=bw(t.color,"black"),r=vw(t.blur,4),s=vw(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 Mw(t={}){const e=vw(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),h=.0722+.9278*(1-e);return`\n <filter>\n <feColorMatrix type="matrix" values="${n} ${i} ${r} 0 0 ${s} ${o} ${a} 0 0 ${l} ${i} ${h} 0 0 0 0 0 1 0"/>\n </filter>\n `.trim()}function Aw(t={}){const e=vw(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),h=.534-.534*(1-e),c=.131+.869*(1-e);return`\n <filter>\n <feColorMatrix type="matrix" values="${n} ${i} ${r} 0 0 ${s} ${o} ${a} 0 0 ${l} ${h} ${c} 0 0 0 0 0 1 0"/>\n </filter>\n `.trim()}function Sw(t={}){const e=vw(t.amount,1);return`\n <filter>\n <feColorMatrix type="saturate" values="${1-e}"/>\n </filter>\n `.trim()}function kw(t={}){const e=vw(t.angle,0);return`\n <filter>\n <feColorMatrix type="hueRotate" values="${e}"/>\n </filter>\n `.trim()}function Ow(t={}){const e=vw(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 Pw(t={}){const e=vw(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 Dw(t={}){const e=vw(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 Tw;(function(t){t.presets=s,t.registry=Lv.create({type:"grid"}),t.registry.register(t.presets,!0)})(yw||(yw={})),function(t){t.presets=o,t.registry=Lv.create({type:"filter"}),t.registry.register(t.presets,!0)}(Tw||(Tw={}));const Nw=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},jw=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},Lw=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},Fw=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=_y.toRad(o),l=r.width/4,h=r.height/4;for(let c=0;c<4;c+=1)for(let e=0;e<4;e+=1)(c+e)%2>0&&(s.setTransform(1,0,0,1,(2*c-1)*l,(2*e-1)*h),s.rotate(a),s.drawImage(t,-n/2,-i/2,n,i));return r};var zw;(function(t){t.presets=Object.assign({},a),t.presets["flip-x"]=Nw,t.presets["flip-y"]=jw,t.presets["flip-xy"]=Lw,t.registry=Lv.create({type:"background pattern"}),t.registry.register(t.presets,!0)})(zw||(zw={}));const Bw={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,trackable:!1,trackInfo:{},track(t){Bw.trackable=t}};var Rw;(function(t){function e(t){return`${Bw.prefixCls}-${t}`}t.snapToGrid=Wy,t.normalizeMarker=TC,t.prefix=e})(Rw||(Rw={})),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}(Rw||(Rw={}));const $w=Rw.prefix("highlighted"),Iw={highlight(t,e,n){const i=n&&n.className||$w;Jm(e,i)},unhighlight(t,e,n){const i=n&&n.className||$w;Zm(e,i)}},Vw=Rw.prefix("highlight-opacity"),_w={highlight(t,e){Jm(e,Vw)},unhighlight(t,e){Zm(e,Vw)}},Gw={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},Hw={highlight(t,e,n){const i=Uw.getHighlighterId(e,n);if(Uw.hasCache(i))return;n=nd({},n,Gw);const r=xb.create(e);let s,o;try{s=r.toPathData()}catch(c){o=r.bbox(!0),s=_b(Object.assign(Object.assign({},n),o))}const a=ay("path");if(ky(a,Object.assign({d:s,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},n.attrs?Py(n.attrs):null)),t.isEdgeElement(e))ky(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=hv(o,e);const s=Math.max(o.width,1),a=Math.max(o.height,1),l=(s+i)/s,h=(a+i)/a,c=Zb({a:l,b:0,c:0,d:h,e:t-l*t,f:n-h*n});e=e.multiply(c)}xv(a,e)}Jm(a,Rw.prefix("highlight-stroke"));const l=t.cell,h=()=>Uw.removeHighlighter(i);l.on("removed",h),l.model&&l.model.on("reseted",h),t.container.appendChild(a),Uw.setCache(i,a)},unhighlight(t,e,n){Uw.removeHighlighter(Uw.getHighlighterId(e,n))}};var Uw,Ww;function qw(t,e={}){return new Jy(Mm(e.x,t.width),Mm(e.y,t.height))}function Xw(t,e,n){return Object.assign({angle:e,position:t.toJSON()},n)}(function(t){function e(t,e){return ey(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&&(my(e),delete n[t])}t.setCache=i,t.hasCache=r,t.removeHighlighter=s})(Uw||(Uw={})),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}(Ww||(Ww={})),function(t){t.presets=l,t.registry=Lv.create({type:"highlighter"}),t.registry.register(t.presets,!0)}(Ww||(Ww={}));const Yw=(t,e)=>t.map((({x:t,y:n,angle:i})=>Xw(qw(e,{x:t,y:n}),i||0))),Jw=(t,e,n)=>{const i=n.start||0,r=n.step||20;return Kw(t,e,i,((t,e)=>(t+.5-e/2)*r))},Zw=(t,e,n)=>{const i=n.start||0,r=n.step||360/t.length;return Kw(t,e,i,(t=>t*r))};function Kw(t,e,n,i){const r=e.getCenter(),s=e.getTopCenter(),o=e.width/e.height,a=Qy.fromRect(e),l=t.length;return t.map(((t,e)=>{const h=n+i(e,l),c=s.clone().rotate(-h,r).scale(o,1,r),u=t.compensateRotate?-a.tangentTheta(c):0;return(t.dx||t.dy)&&c.translate(t.dx||0,t.dy||0),t.dr&&c.move(r,t.dr),Xw(c.round(),u,t)}))}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 tx=(t,e,n)=>{const i=qw(e,n.start||e.getOrigin()),r=qw(e,n.end||e.getCorner());return sx(t,i,r,n)},ex=(t,e,n)=>sx(t,e.getTopLeft(),e.getBottomLeft(),n),nx=(t,e,n)=>sx(t,e.getTopRight(),e.getBottomRight(),n),ix=(t,e,n)=>sx(t,e.getTopLeft(),e.getTopRight(),n),rx=(t,e,n)=>sx(t,e.getBottomLeft(),e.getBottomRight(),n);function sx(t,e,n,i){const r=new Ky(e,n),s=t.length;return t.map(((t,e)=>{var{strict:n}=t,o=Qw(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),Xw(l.round(),0,o)}))}var ox;(function(t){t.presets=h,t.registry=Lv.create({type:"port layout"}),t.registry.register(t.presets,!0)})(ox||(ox={}));const ax={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function lx(t,e){const{x:n,y:i,angle:r,attrs:s}=e||{};return nd({},{angle:r,attrs:s,position:{x:n,y:i}},t,ax)}const hx=(t,e,n)=>lx({position:e.getTopLeft()},n),cx=(t,e,n)=>lx({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},n),ux=(t,e,n)=>lx({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},n),dx=(t,e,n)=>lx({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},n),gx=(t,e,n)=>lx({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},n),px=(t,e,n)=>bx(t,e,!1,n),fx=(t,e,n)=>bx(t,e,!0,n),mx=(t,e,n)=>vx(t,e,!1,n),yx=(t,e,n)=>vx(t,e,!0,n);function bx(t,e,n,i){const r=null!=i.offset?i.offset:15,s=e.getCenter().theta(t),o=Cx(e);let a,l,h,c,u=0;return s<o[1]||s>o[2]?(a=".3em",l=r,h=0,c="start"):s<o[0]?(a="0",l=0,h=-r,n?(u=-90,c="start"):c="middle"):s<o[3]?(a=".3em",l=-r,h=0,c="end"):(a=".6em",l=0,h=r,n?(u=90,c="start"):c="middle"),lx({position:{x:Math.round(l),y:Math.round(h)},angle:u,attrs:{".":{y:a,"text-anchor":c}}},i)}function vx(t,e,n,i){const r=null!=i.offset?i.offset:15,s=e.getCenter().theta(t),o=Cx(e);let a,l,h,c,u=0;return s<o[1]||s>o[2]?(a=".3em",l=-r,h=0,c="end"):s<o[0]?(a=".6em",l=0,h=r,n?(u=90,c="start"):c="middle"):s<o[3]?(a=".3em",l=r,h=0,c="start"):(a="0em",l=0,h=-r,n?(u=-90,c="start"):c="middle"),lx({position:{x:Math.round(l),y:Math.round(h)},angle:u,attrs:{".":{y:a,"text-anchor":c}}},i)}function Cx(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 wx=(t,e,n)=>Ex(t.diff(e.getCenter()),!1,n),xx=(t,e,n)=>Ex(t.diff(e.getCenter()),!0,n);function Ex(t,e,n){const i=null!=n.offset?n.offset:20,r=new Jy(0,0),s=-t.theta(r),o=t.clone().move(r,i).diff(t).round();let a,l=".3em",h=s;return(s+90)%180===0?(a=e?"end":"middle",e||-270!==s||(l="0em")):s>-270&&s<-90?(a="start",h=s-180):a="end",lx({position:o.round().toJSON(),angle:e?h:0,attrs:{".":{y:l,"text-anchor":a}}},n)}var Mx,Ax;(function(t){t.presets=c,t.registry=Lv.create({type:"port label layout"}),t.registry.register(t.presets,!0)})(Mx||(Mx={}));class Sx{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?Sx.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=Sx.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(xm(r,0,255)),this.g=Math.round(xm(s,0,255)),this.b=Math.round(xm(o,0,255)),this.a=null==a?1:xm(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 Sx.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 Sx.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([...p(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(h(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),h=Math.min(r,s,o),c=(l+h)/2;let u=0,d=0;if(h!==l){const t=l-h;switch(d=c>.5?t/(2-l-h):t/(l+h),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,c,null==a?1:a]}function h(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,h=a<=.5?a*(o+1):a+o-a*o,c=2*a-h;return[256*r(c,h,s+1/3),256*r(c,h,s),256*r(c,h,s-1/3),null==l?1:l]}function c(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 c(t).toString()}function g(t,e){if("string"===typeof t){const n="#"===t[0],[i,r,s]=p(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 p(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=xm((i>>16)+e,0,255),s=xm((i>>8&255)+e,0,255),o=xm((255&i)+e,0,255);return`${n?"#":""}${(o|s<<8|r<<16).toString(16)}`}const n=f(t[0],t[1],t[2]),i=p(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=h,t.random=c,t.randomHex=u,t.randomRGBA=d,t.invert=g,t.lighten=m,t.darken=y})(Sx||(Sx={})),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"}}(Sx||(Sx={}));class kx{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),Ax.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=Ax.call([...i],e))}const i=this.listeners["*"];return null!=i?Gm([n,Ax.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=$m(r,s,o);n.push(a)}return Gm(n)}t.call=e})(Ax||(Ax={}));class Ox{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})(Ox||(Ox={}));class Px{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})(Px||(Px={}));class Dx extends kx{}(function(t){t.dispose=Ox.dispose})(Dx||(Dx={})),id(Dx,Ox);class Tx extends Dx{get disabled(){return!0===this._disabled}enable(){delete this._disabled}disable(){this._disabled=!0}}var Nx,jx,Lx,Fx,zx,Bx=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 Rx extends Ox{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()}}Bx([Ox.dispose()],Rx.prototype,"dispose",null);class $x{constructor(t={}){this.comparator=t.comparator||$x.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})($x||($x={})),function(t){function e(t,e,n=((t,e)=>1)){const i={},r={},s={},o=new $x;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}(Nx||(Nx={})),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}}}(jx||(jx={})),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)}}}(jx||(jx={})),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 h(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}function c(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 g(t){return t*t*t*t*t}function p(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 C(t){const e=t-1;return Math.sqrt(1-e*e)}function w(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 M(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 A(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 k(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 O(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 P(t){return 1-O(1-t)}function D(t){return t<.5?.5*P(2*t):.5*O(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=h,t.easeInQuart=c,t.easeOutQuart=u,t.easeInOutQuart=d,t.easeInQuint=g,t.easeOutQuint=p,t.easeInOutQuint=f,t.easeInExpo=m,t.easeOutExpo=y,t.easeInOutExpo=b,t.easeInCirc=v,t.easeOutCirc=C,t.easeInOutCirc=w,t.easeInBack=x,t.easeOutBack=E,t.easeInOutBack=M,t.easeInElastic=A,t.easeOutElastic=S,t.easeInOutElastic=k,t.easeOutBounce=O,t.easeInBounce=P,t.easeInOutBounce=D}(jx||(jx={})),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("."),h=l>0?s[1].length-l-1:0,c=a-o,u=i?i[2]:"";return t=>(o+c*t).toFixed(h)+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,h=(16711680&i)-l;return t=>{const e=r+s*t&255,n=o+a*t&65280,i=l+h*t&16711680;return`#${(1<<24|e|n|i).toString(16).slice(1)}`}}}(Lx||(Lx={})),function(t){const e=`${Bw.prefixCls}.storage`;function n(t,e,n){const i=e.id||Np("doc-"),r=l(t);r.keys.push(i),o(h(t,i),e),o(c(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(h(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(h(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(h(t,e))})),localStorage.removeItem(c(t)),s(n,null);else if(e.id){const r=i.keys.indexOf(e.id);r>=0&&i.keys.splice(r,1),localStorage.removeItem(h(t,e.id)),o(c(t),i),s(n,null)}}function s(t,e,n){t&&Rm((()=>{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(c(t));return e?(null==e.keys&&(e.keys=[]),e):{keys:[]}}function h(t,n){return`${e}.${t}.docs.${n}`}function c(t){return`${e}.${t}.index`}t.insert=n,t.find=i,t.remove=r}(Fx||(Fx={}));class Ix extends Dx{constructor(){super(),this.cid=zx.uniqueId(),Ix.views[this.cid]=this}get priority(){return 2}confirmUpdate(t,e){return 0}$(t){return Ix.$(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 Ix.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?ky(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 Ix.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=uy(t)+1;n=`${t.tagName.toLowerCase()}:nth-child(${i})`,e&&(n+=` > ${e}`),n=this.getSelector(t.parentNode,n)}return n}prefixClassName(t){return Rw.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`.${Bw.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 Ix.normalizeEvent(t)}}(function(t){function e(t){return R()(t)}function n(t,e){return e?ay(t||"g"):oy(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 Bw.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})(Ix||(Ix={})),function(t){function e(e){return t.views[e]||null}t.views={},t.getView=e}(Ix||(Ix={})),function(t){let e=0;function n(){const t=`v${e}`;return e+=1,t}t.uniqueId=n}(zx||(zx={}));const Vx=t=>t;function _x(t,e){return 0===e?"0%":`${Math.round(t/e*100)}%`}function Gx(t){const e=(e,n,i,r)=>n.isEdgeElement(i)?Ux(t,e,n,i,r):Hx(t,e,n,i,r);return e}function Hx(t,e,n,i,r){const s=n.cell,o=s.getAngle(),a=n.getUnrotatedBBoxOfElement(i),l=s.getBBox().getCenter(),h=Jy.create(r).rotate(o,l);let c=h.x-a.x,u=h.y-a.y;return t&&(c=_x(c,a.width),u=_x(u,a.height)),e.anchor={name:"topLeft",args:{dx:c,dy:u,rotate:!0}},e}function Ux(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 Wx=Gx(!0),qx=Gx(!1);var Xx,Yx;(function(t){t.presets=u,t.registry=Lv.create({type:"connection strategy"}),t.registry.register(t.presets,!0)})(Xx||(Xx={}));class Jx{constructor(t){this.view=t,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new Rx,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=gv(t,n)}return Zb(e.matrix)}getShape(t){const e=this.get(t);return null==e.shape&&(e.shape=fv(t)),e.shape.clone()}getBoundingRect(t){const e=this.get(t);return null==e.boundingRect&&(e.boundingRect=dv(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:Wu(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=fm(s,{raw:!0});return o.forEach((t=>{e.appendChild(t)})),{fragment:e,selectors:i,groups:n}}function o(t,e={ns:iy.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||iy.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===iy.svg,l=e?oy(n,e):sy(n),h=t.attrs;h&&(a?ky(l,Py(h)):R()(l).attr(h));const c=t.style;c&&R()(l).css(c);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 g=t.children;Array.isArray(g)&&s.push({ns:e,markup:g,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?ay("g"):sy("div")}function l(t){if(n(t)){const e=xb.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 h(t){const e=xb.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=h})(Yx||(Yx={})),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=uy(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=iy.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=hy(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)}},h=s.map((t=>l(t,t))).filter((t=>null!=t));return{markup:h,attrs:o}}t.getSelector=e,t.xml2json=i}(Yx||(Yx={})),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}(Yx||(Yx={})),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}(Yx||(Yx={})),function(t){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:iy.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:iy.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}t.getForeignObjectMarkup=e}(Yx||(Yx={}));class Zx{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=Im(dw.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=Zx.CASE_SENSITIVE_ATTR.includes(i)?i:um(i);n[t]=r}})),a.forEach((({name:n,definition:a})=>{const l=e[n],h=a;"function"===typeof h.set&&(!xy(t)&&Zx.DELAY_ATTRS.includes(n)?(null==o&&(o={}),o[n]=l):(null==i&&(i={}),i[n]=l));const c=a;"function"===typeof c.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 Rx;return Object.keys(t).forEach((o=>{const a=t[o];if(!Nh(a))return;const{isCSSSelector:l,elems:h}=Ix.find(o,e,i);n[o]=h;for(let t=0,e=h.length;t<e;t+=1){const n=h[t],c=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(c)t.unshift(a),i.unshift(-1);else{const n=ji(i,l?-1:e);t.splice(n,0,a),i.splice(n,0,e)}}else s.set(n,{elem:n,attrs:a,priority:c?-1:e,array:!1})}})),r.forEach((t=>{const e=s.get(t),n=e.attrs;e.attrs=n.reduceRight(((t,e)=>Wh(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,h=e.delay,c=()=>({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=Im(n.set,this.view,e,c());"object"===typeof i?s=Object.assign(Object.assign({},s),i):null!=i&&(s[t]=i)}})),xy(t))return void this.view.setAttrs(s,t);const u=s.transform,d=u?`${u}`:null,g=Qb(d),p=new Jy(g.e,g.f);u&&(delete s.transform,g.e=0,g.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=Im(n.position,this.view,e,c());null!=t&&(y=!0,p.translate(Jy.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=hv(e,g).scale(1/f,1/m);Object.keys(l).forEach((e=>{const i=l[e],s=this.getDefinition(e);if(null!=s){const e=Im(s.offset,this.view,i,{elem:t,cell:this.cell,view:this.view,attrs:r,refBBox:n});null!=e&&(b=!0,p.translate(Jy.create(e).scale(f,m)))}}))}}(null!=u||y||b)&&(p.round(1),g.e=p.x,g.f=p.y,t.setAttribute("transform",tv(g)));const v=()=>{null!=h&&Object.keys(h).forEach((e=>{const n=h[e],i=this.getDefinition(e);if(null!=i){const r=Im(i.set,this.view,n,c());"object"===typeof r?this.view.setAttrs(r,t):null!=r&&this.view.setAttrs({[e]:r},t)}}))};i.forceSync?v():jv.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),h=e?e.attrs:null,c=h&&null==a.ref?h.ref:a.ref;let u;if(c){if(u=(i[c]||this.view.find(c,t,n.selectors))[0],!u)throw new Error(`"${c}" reference does not exist.`)}else u=null;const d={node:r,refNode:u,attributes:h,processedAttributes:l},g=o.findIndex((t=>t.refNode===r));g>-1?o.splice(g,0,d):o.push(d)}}));const a=new Rx;let l;o.forEach((e=>{const i=e.node,r=e.refNode;let s;const h=null!=r&&null!=n.rotatableNode&&fy(n.rotatableNode,r);if(r&&(s=a.get(r)),!s){const e=h?n.rotatableNode:t;s=r?dv(r,{target:e}):n.rootBBox,r&&a.set(r,s)}let c;n.attrs&&e.attributes?(c=this.processAttrs(i,e.attributes),this.mergeProcessedAttrs(c,e.processedAttributes)):c=e.processedAttributes;let u=s;h&&null!=n.rotatableNode&&!n.rotatableNode.contains(i)&&(l||(l=Qb(ky(n.rotatableNode,"transform"))),u=hv(s,l));const d=o.find((t=>t.refNode===i));d&&(n.forceSync=!0),this.updateRelativeAttrs(i,c,u,n)}))}}(function(t){t.CASE_SENSITIVE_ATTR=["viewBox"],t.DELAY_ATTRS=["text","textWrap","sourceMarker","targetMarker"]})(Zx||(Zx={}));class Kx{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 Qx=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 tE extends Ix{constructor(t,e={}){super(),this.cell=t,this.options=this.ensureOptions(e),this.graph=this.options.graph,this.attr=new Zx(this),this.flag=new Kx(this,this.options.actions,this.options.bootstrap),this.cache=new Jx(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?Pn([...Array.isArray(t)?t:[t],...Array.isArray(e)?e:[e]]):Array.isArray(t)?[...t]:[t],n=Wu(this.getDefaults()),{bootstrap:i,actions:r,events:s,documentEvents:o}=t,a=Qx(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)),Wh(n,a)}get[Symbol.toStringTag](){return tE.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 Ix.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=Yx.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=Im(e,this.graph,this)),"object"===typeof e){let n=e[t];return"function"===typeof n&&(n=Im(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=Av(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 hv(e,r.multiply(i).multiply(n))}getUnrotatedBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),i=this.getRootTranslatedMatrix();return hv(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 Zb().translate(e.x,e.y)}getRootRotatedMatrix(){let t=Zb();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 Zy),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||{},h=Xx.registry;if(a){const o=h.get(a);if(null==o)return h.onNotFound(a);const c=Im(o,this.graph,t,this,e,new Jy(n,i),r,s,l);if(c)return c}}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||my(n)},s=xb.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||my(n)},s=xb.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=eE.isToolsView(t)?t:new eE(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))}}tE.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},function(t){t.Flag=Kx,t.Attr=Zx}(tE||(tE={})),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}(tE||(tE={})),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}(tE||(tE={})),function(t){t.registry=Lv.create({type:"view"})}(tE||(tE={}));class eE extends Ix{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 eE.toStringTag}createContainer(t,e){const n=t?Ix.createElement("g",!0):Ix.createElement("div",!1);return Jm(n,this.prefixClassName("cell-tools")),e.className&&Jm(n,e.className),n}config(t){if(this.options=Object.assign(Object.assign({},this.options),t),!tE.isCellView(t.view)||t.view===this.cellView)return this;this.cellView=t.view,this.cell.isEdge()?(Jm(this.svgContainer,this.prefixClassName("edge-tools")),Jm(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(Jm(this.svgContainer,this.prefixClassName("node-tools")),Jm(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(eE.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(eE.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=yE.registry.get(n);if(!t)return yE.registry.onNotFound(n);e=new t(i)}else if(this.cell.isEdge()){const t=bE.registry.get(n);if(!t)return bE.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),my(this.svgContainer),my(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 nE(t,e,n,i){const r=Im(Xx.presets.pinRelative,this.graph,{},e,n,t,this.cell,i,{});return r.anchor}function iE(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})(eE||(eE={})),function(t){class e extends Ix{constructor(t={}){super(),this.options=this.getOptions(t),this.container=Ix.createElement(this.options.tagName||"g",!1!==this.options.isSVGElement),Jm(this.container,this.prefixClassName("cell-tool")),"string"===typeof this.options.className&&Jm(this.container,this.options.className),this.init()}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){return Wh(Wu(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()?Jm(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&Jm(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=Yx.isStringMarkup(t)?Yx.parseStringMarkup(t):Yx.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?dm(t):(e+=1,`CustomTool${e}`)}function i(t){const e=ld(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={}))}(eE||(eE={}));class rE extends eE.ToolItem{onRender(){Jm(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();xv(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=iE(t,s);const l=t.cell.getAngle();o||(a=a.bbox(l));let h=0,c=0;"number"===typeof r?(h=r,c=r):"object"===typeof r&&(h=r.x,c=r.y),n=Mm(n,a.width),i=Mm(i,a.height);let u=Zb().translate(a.x+a.width/2,a.y+a.height/2);return o&&(u=u.rotate(l)),u=u.translate(n+h-a.width/2,i+c-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=Em(i)?t.getTangentAtRatio(parseFloat(i)/100):t.getTangentAtLength(i),s?(o=s.start,a=s.vector().vectorAngle(new Jy(1,0))||0):(o=t.getConnection().start,a=0);let l=Zb().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&&Im(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"}})})(rE||(rE={})),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})}})}(rE||(rE={}));var sE=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 oE extends eE.ToolItem{onRender(){if(Jm(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const t=this.options.attrs,{class:e}=t,n=sE(t,["class"]);ky(this.container,Py(n)),e&&Jm(this.container,e)}this.update()}update(){const t=this.cellView,e=this.options,{useCellGeometry:n,rotate:i}=e,r=Sm(e.padding);let s=iE(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();Mv(this.container,t,e.x,e.y,{absolute:!0})}else s=s.bbox(t)}return ky(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"}})})(oE||(oE={}));class aE extends eE.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:Jy.create(i),next:Jy.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 Ix{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=Ix.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})(aE||(aE={})),function(t){const e=Rw.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"}})}(aE||(aE={}));class lE extends eE.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){Jm(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,h=a[r+1]||n.targetAnchor,c=this.options.snapRadius;return Math.abs(e[i]-l[i])<c?e[i]=l[i]:Math.abs(e[i]-h[i])<c&&(e[i]=h[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),h=this.normalizeEvent(e),c=n.snapToGrid(h.clientX,h.clientY),u=this.snapHandle(t,c.clone(),l),d=Wu(this.vertices);let g=d[a],p=d[a+1];const f=r.sourceView,m=r.sourceBBox;let y=!1,b=!1;if(g?0===a?m.containsPoint(g)?(d.shift(),this.shiftHandleIndexes(-1),y=!0):(g[o]=u[o],b=!0):g[o]=u[o]:(g=r.sourceAnchor.toJSON(),g[o]=u[o],m.containsPoint(g)?y=!0:(d.unshift(g),this.shiftHandleIndexes(1),b=!0)),"function"===typeof s&&f){if(y){const t=l.sourceAnchor.clone();t[o]=u[o];const e=Im(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,C=r.targetBBox;let w=!1,x=!1;if(p?a===d.length-2?C.containsPoint(p)?(d.pop(),w=!0):(p[o]=u[o],x=!0):p[o]=u[o]:(p=r.targetAnchor.toJSON(),p[o]=u[o],C.containsPoint(p)?w=!0:(d.push(p),x=!0)),"function"===typeof s&&v){if(w){const t=l.targetAnchor.clone();t[o]=u[o];const e=Im(s,r,t,v,r.targetMagnet||v.container,"target",r,this);this.resetAnchor("target",e)}x&&this.resetAnchor("target",l.targetAnchorDef)}Jy.equalPoints(d,this.vertices)||this.cellView.cell.setVertices(d,{ui:!0,toolId:this.cid}),this.updateHandle(t,g,p,0),i.stopPropagation||r.notifyMouseMove(h,c.x,c.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:Wu(this.cell.prop(["source","anchor"])),targetAnchorDef:Wu(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 Ky(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 Jy(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 Ix{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=Ix.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 Jy(t,e))||new Jy(t,e);let s=Zb().translate(r.x,r.y);if(r.equals({x:t,y:e}))s=s.rotate(n);else{const n=new Ky(t,e,r.x,r.y);let i=n.vector().vectorAngle(new Jy(1,0));0!==i&&(i+=90),s=s.rotate(i)}this.setAttrs({transform:tv(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})(lE||(lE={})),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:nE})}(lE||(lE={}));class hE extends eE.ToolItem{get type(){return this.options.type}onRender(){Jm(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,h=this.options.areaPadding||0;Number.isFinite(h)||(h=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(h),ky(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=Im(l,n,a,i,o,e,n,this);a=Jy.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 h;const c=this.options.anchor;"function"===typeof c&&(h=Im(c,n,a,i,o,e,n,this)),this.resetAnchor(h),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:nE,snap(t,e,n,i,r,s){const o=s.options.snapRadius||0,a="source"===i,l=a?0:-1,h=this.cell.getVertexAt(l)||this.getTerminalAnchor(a?"target":"source");return h&&(Math.abs(h.x-t.x)<o&&(t.x=h.x),Math.abs(h.y-t.y)<o&&(t.y=h.y)),t}})})(hE||(hE={}));const cE=hE.define({name:"source-anchor",type:"source"}),uE=hE.define({name:"target-anchor",type:"target"});var dE=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 gE extends eE.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=dE(t,["class"]);this.setAttrs(n,this.container),e&&Jm(this.container,e)}}onRender(){Jm(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 Jy(1,0))||0;if(!i)return this;const s=Zb().translate(i.x,i.y).rotate(r);return xv(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"}})})(gE||(gE={}));const pE=gE.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"}}),fE=gE.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 mE extends eE.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=eE.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 Jy,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&&Ym(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}=ev(e);r=new Jy(o.tx,o.ty),s=dv(n).width}else{r=t.clientToLocal(Jy.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 h;return"function"===typeof l&&(h=Im(l,this.cellView,{cell:this.cell,index:this.labelIndex})),n.innerText=h||"",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&&Im(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"}})})(mE||(mE={})),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)}})}(mE||(mE={}));var yE,bE,vE=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:oE,button:rE,"button-remove":rE.Remove,"node-editor":mE.NodeEditor},t.registry=Lv.create({type:"node tool",process(t,e){if("function"===typeof e)return e;let n=eE.ToolItem;const{inherit:i}=e,r=vE(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)})(yE||(yE={})),function(t){t.presets={boundary:oE,vertices:aE,segments:lE,button:rE,"button-remove":rE.Remove,"source-anchor":cE,"target-anchor":uE,"source-arrowhead":pE,"target-arrowhead":fE,"edge-editor":mE.EdgeEditor},t.registry=Lv.create({type:"edge tool",process(t,e){if("function"===typeof e)return e;let n=eE.ToolItem;const{inherit:i}=e,r=vE(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)}(bE||(bE={}));const CE=PE("center"),wE=PE("topCenter"),xE=PE("bottomCenter"),EE=PE("leftMiddle"),ME=PE("rightMiddle"),AE=PE("topLeft"),SE=PE("topRight"),kE=PE("bottomLeft"),OE=PE("bottomRight");function PE(t){return function(e,n,i,r={}){const s=r.rotate?e.getUnrotatedBBoxOfElement(n):e.getBBoxOfElement(n),o=s[t];o.x+=Mm(r.dx,s.width),o.y+=Mm(r.dy,s.height);const a=e.cell;return r.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function DE(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=TE(s,t)}else o=s.getBBoxOfElement(i).getCenter();else o=new Jy;return t.call(this,e,n,o,r)}return t.apply(this,arguments)}}function TE(t,e){const n=Em(e),i="string"===typeof e?parseFloat(e):e;return n?t.getPointAtRatio(i/100):t.getPointAtLength(i)}const NE=function(t,e,n,i){const r=t.cell.getAngle(),s=t.getBBoxOfElement(e),o=s.getCenter(),a=s.getTopLeft(),l=s.getBottomRight();let h=i.padding;if(Number.isFinite(h)||(h=0),a.y+h<=n.y&&n.y<=l.y-h){const t=n.y-o.y;o.x+=0===r||180===r?0:1*t/Math.tan(_y.toRad(r)),o.y+=t}else if(a.x+h<=n.x&&n.x<=l.x-h){const t=n.x-o.x;o.y+=90===r||270===r?0:t*Math.tan(_y.toRad(r)),o.x+=t}return o},jE=DE(NE),LE=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},FE=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 h=r.getNearestSideToPoint(n);let c;switch(h){case"left":c=r.getLeftMiddle();break;case"right":c=r.getRightMiddle();break;case"top":c=r.getTopCenter();break;case"bottom":c=r.getBottomCenter();break;default:break}const u=i.direction;return"H"===u?"top"!==h&&"bottom"!==h||(c=n.x<=r.x+r.width?r.getLeftMiddle():r.getRightMiddle()):"V"===u&&(c=n.y<=r.y+r.height?r.getTopCenter():r.getBottomCenter()),i.rotate?c.rotate(-o,s):c},zE=DE(FE);var BE;(function(t){t.presets=d,t.registry=Lv.create({type:"node endpoint"}),t.registry.register(t.presets,!0)})(BE||(BE={}));const RE=function(t,e,n,i){let r=null!=i.ratio?i.ratio:.5;return r>1&&(r/=100),t.getPointAtRatio(r)},$E=function(t,e,n,i){const r=null!=i.length?i.length:20;return t.getPointAtLength(r)},IE=function(t,e,n,i){const r=t.getClosestPoint(n);return null!=r?r:new Jy},VE=DE(IE),_E=function(t,e,n,i){const r=1e6,s=t.getConnection(),o=t.getConnectionSubdivisions(),a=new Ky(n.clone().translate(0,r),n.clone().translate(0,-r)),l=new Ky(n.clone().translate(r,0),n.clone().translate(-r,0)),h=a.intersect(s,{segmentSubdivisions:o}),c=l.intersect(s,{segmentSubdivisions:o}),u=[];return h&&u.push(...h),c&&u.push(...c),u.length>0?n.closest(u):null!=i.fallbackAt?TE(t,i.fallbackAt):Im(IE,this,t,e,n,i)},GE=DE(_E);var HE;function UE(t,e,n){let i;if("object"===typeof n){if(Number.isFinite(n.y)){const i=new Ky(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 WE(t){const e=t.getAttribute("stroke-width");return null===e?0:parseFloat(e)||0}function qE(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=g,t.registry=Lv.create({type:"edge endpoint"}),t.registry.register(t.presets,!0)})(HE||(HE={}));const XE=function(t,e,n,i){const r=e.getBBoxOfElement(n);i.stroked&&r.inflate(WE(n)/2);const s=t.intersect(r),o=s&&s.length?t.start.closest(s):t.end;return UE(o,t.start,i.offset)},YE=function(t,e,n,i,r){const s=e.cell,o=s.isNode()?s.getAngle():0;if(0===o)return Im(XE,this,t,e,n,i,r);const a=e.getUnrotatedBBoxOfElement(n);i.stroked&&a.inflate(WE(n)/2);const l=a.getCenter(),h=t.clone().rotate(o,l),c=h.setLength(1e6).intersect(a),u=c&&c.length?h.start.closest(c).rotate(-o,l):t.end;return UE(u,t.start,i.offset)},JE=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)?hd(n,a):qE(n),!ny(r)){if(r===n||!ny(n))return o;r=n}const l=e.getShapeOfElement(r),h=e.getMatrixOfElement(r),c=e.getRootTranslatedMatrix(),u=e.getRootRotatedMatrix(),d=c.multiply(u).multiply(h),g=d.inverse(),p=lv(t,g),f=p.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&&p.setLength(1e6),wb.isPath(l)){const t=i.precision||2;null==m.segmentSubdivisions&&(m.segmentSubdivisions=l.getSegmentSubdivisions({precision:t})),y={precision:t,segmentSubdivisions:m.segmentSubdivisions},s=p.intersect(l,y)}else s=p.intersect(l);s?Array.isArray(s)&&(s=f.closest(s)):!0===i.sticky&&(s=Zy.isRectangle(l)?l.getNearestPointToPoint(f):Qy.isEllipse(l)?l.intersectsWithLineFromCenterToPoint(f):l.closestPoint(f,y));const b=s?av(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+=WE(r)/2):v+=WE(r)/2),UE(b,t.start,v)};function ZE(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 KE=function(t,e,n,i){const{alignOffset:r,align:s}=i;return s&&ZE(t,s,r),UE(t.end,t.start,i.offset)};var QE;(function(t){t.presets=p,t.registry=Lv.create({type:"connection point"}),t.registry.register(t.presets,!0)})(QE||(QE={}));const tM=function(t){return[...t]},eM=function(t,e,n){const i=e.side||"bottom",r=Sm(e.padding||40),s=n.sourceBBox,o=n.targetBBox,a=s.getCenter(),l=o.getCenter();let h,c,u;switch(i){case"top":u=-1,h="y",c="height";break;case"left":u=-1,h="x",c="width";break;case"right":u=1,h="x",c="width";break;case"bottom":default:u=1,h="y",c="height";break}return a[h]+=u*(s[c]/2+r[i]),l[h]+=u*(o[c]/2+r[i]),u*(a[h]-l[h])>0?l[h]=a[h]:a[h]=l[h],[a.toJSON(),...t,l.toJSON()]};function nM(t){return new Zy(t.x,t.y,0,0)}function iM(t={}){const e=Sm(t.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function rM(t,e={}){return t.sourceBBox.clone().moveAndExpand(iM(e))}function sM(t,e={}){return t.targetBBox.clone().moveAndExpand(iM(e))}function oM(t,e={}){if(t.sourceAnchor)return t.sourceAnchor;const n=rM(t,e);return n.getCenter()}function aM(t,e={}){if(t.targetAnchor)return t.targetAnchor;const n=sM(t,e);return n.getCenter()}const lM=function(t,e,n){let i=rM(n,e),r=sM(n,e);const s=oM(n,e),o=aM(n,e);i=i.union(nM(s)),r=r.union(nM(o));const a=t.map((t=>Jy.create(t)));a.unshift(s),a.push(o);let l=null;const h=[];for(let c=0,u=a.length-1;c<u;c+=1){let t=null;const n=a[c],s=a[c+1],o=null!=hM.getBearing(n,s);if(0===c)c+1===u?i.intersectsWithRect(r.clone().inflate(1))?t=hM.insideNode(n,s,i,r):o||(t=hM.nodeToNode(n,s,i,r)):i.containsPoint(s)?t=hM.insideNode(n,s,i,nM(s).moveAndExpand(iM(e))):o||(t=hM.nodeToVertex(n,s,i));else if(c+1===u){const i=o&&hM.getBearing(s,n)===l;r.containsPoint(n)||i?t=hM.insideNode(n,s,nM(n).moveAndExpand(iM(e)),r,l):o||(t=hM.vertexToNode(n,s,r,l))}else o||(t=hM.vertexToVertex(n,s,l));t?(h.push(...t.points),l=t.direction):l=hM.getBearing(n,s),c+1<u&&h.push(s)}return h};var hM;(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 Jy(t.x,e.y);return n.containsPoint(i)&&(i=new Jy(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 Jy(t.x,n.y),o=new Jy(n.x,t.y),a=s(t,r),l=s(t,o),h=i?e[i]:null,c=a===i||a!==h&&(l===h||l!==i)?r:o;return{points:[c],direction:s(c,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 Jy(t.x,e.y),new Jy(e.x,t.y)],l=a.filter((t=>!n.containsPoint(t))),h=l.filter((e=>s(e,t)!==o));let c;if(h.length>0)return c=h.filter((e=>s(t,e)===o)).pop(),c=c||h[0],{points:[c],direction:s(c,e)};{c=Sl(a,l)[0];const h=Jy.create(e).move(c,-r(n,o)/2),u=i(h,t,n);return{points:[u,h],direction:s(h,e)}}}function h(t,e,n,i){let l=a(e,t,i);const h=l.points[0];if(n.containsPoint(h)){l=a(t,e,n);const c=l.points[0];if(i.containsPoint(c)){const u=Jy.create(t).move(c,-r(n,s(t,c))/2),d=Jy.create(e).move(h,-r(i,s(e,h))/2),g=new Ky(u,d).getCenter(),p=a(t,g,n),f=o(g,e,p.direction);l.points=[p.points[0],f.points[0]],l.direction=f.direction}}return l}function c(t,e,r,o,a){const l=r.union(o).inflate(1),h=l.getCenter(),c=h.distance(e)>h.distance(t),u=c?e:t,d=c?t:e;let g,p,f,m;a?(g=Jy.fromPolar(l.width+l.height,n[a],u),g=l.getNearestPointToPoint(g).move(g,-1)):g=l.getNearestPointToPoint(u).move(u,1),p=i(g,d,l),g.round().equals(p.round())?(p=Jy.fromPolar(l.width+l.height,_y.toRad(g.theta(u))+Math.PI/2,d),p=l.getNearestPointToPoint(p).move(d,1).round(),f=i(g,p,l),m=c?[p,f,g]:[g,f,p]):m=c?[p,g]:[g,p];const y=s(c?g:p,e);return{points:m,direction:y}}t.getBBoxSize=r,t.getBearing=s,t.vertexToVertex=o,t.nodeToVertex=a,t.vertexToNode=l,t.nodeToNode=h,t.insideNode=c})(hM||(hM={}));const cM={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=uM(this.step,this);return t},directions(){const t=uM(this.step,this),e=uM(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=uM(this.step,this);return{0:0,45:t/2,90:t/2}},paddingBox(){const t=uM(this.step,this);return{x:-t,y:-t,width:2*t,height:2*t}},fallbackRouter:lM,draggingRouter:null};function uM(t,e){return"function"===typeof t?t.call(e):t}function dM(t){const e=Object.keys(t).reduce(((e,n)=>{const i=e;return i[n]="fallbackRouter"===n||"draggingRouter"===n||"fallbackRoute"===n?t[n]:uM(t[n],t),e}),{});if(e.padding){const n=Sm(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 Jy(0,0),n=new Jy(t.offsetX,t.offsetY);t.angle=_y.normalize(e.theta(n))})),e}const gM=1,pM=2;class fM{constructor(){this.items=[],this.hash={},this.values={}}add(t,e){this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=gM,this.values[t]=e;const n=$a(this.items,t,(t=>this.values[t]));this.items.splice(n,0,t)}pop(){const t=this.items.shift();return t&&(this.hash[t]=pM),t}isOpen(t){return this.hash[t]===gM}isClose(t){return this.hash[t]===pM}isEmpty(){return 0===this.items.length}}class mM{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=bi(r,s.getAncestors().map((t=>t.id))));const o=t.getCell(e.getTargetCellId());o&&(r=bi(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),h=i.some((t=>t.id===e.id)),c=r.includes(e.id),u=n.excludeHiddenNodes&&!e.isVisible(),d=l||h||c||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 Jy(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 yM(t,e){const n=t.sourceBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function bM(t,e){const n=t.targetBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function vM(t,e){if(t.sourceAnchor)return t.sourceAnchor;const n=yM(t,e);return n.getCenter()}function CM(t,e){if(t.targetAnchor)return t.targetAnchor;const n=bM(t,e);return n.getCenter()}function wM(t,e,n,i,r){const s=360/n,o=t.theta(xM(t,e,i,r)),a=_y.normalize(o+s/2);return s*Math.floor(a/s)}function xM(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,h=a*r,c=l*r;return new Jy(t.x+h,t.y+c)}function EM(t,e){const n=Math.abs(t-e);return n>180?360-n:n}function MM(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 AM(t,e,n){return{source:e.clone(),x:SM(n.x-e.x,t),y:SM(n.y-e.y,t)}}function SM(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 kM(t,e){const n=e.source,i=Rw.snapToGrid(t.x-n.x,e.x)+n.x,r=Rw.snapToGrid(t.y-n.y,e.y)+n.y;return new Jy(i,r)}function OM(t,e){return t.round(e)}function PM(t,e,n){return OM(kM(t.clone(),e),n)}function DM(t){return t.toString()}function TM(t){return new Jy(0===t.x?0:Math.abs(t.x)/t.x,0===t.y?0:Math.abs(t.y)/t.y)}function NM(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 jM(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],h=new Jy(t.x+n.x*(Math.abs(a.x)+e.width),t.y+n.y*(Math.abs(a.y)+e.height)),c=new Ky(t,h),u=c.intersect(e)||[];let d,g=null;for(let e=0;e<u.length;e+=1){const n=u[e],i=t.squaredDistance(n);(null==d||i>d)&&(d=i,g=n)}if(g){let t=PM(g,i,s);e.containsPoint(t)&&(t=PM(t.translate(n.x*i.x,n.y*i.y),i,s)),r.push(t)}}return r}),[]);return e.containsPoint(t)||l.push(PM(t,i,s)),l}function LM(t,e,n,i,r){const s=[];let o,a=TM(r.diff(n)),l=DM(n),h=t[l];while(h){o=e[l];const n=TM(o.diff(h));n.equals(a)||(s.unshift(o),a=n),l=DM(h),h=t[l]}const c=e[l],u=TM(c.diff(i));return u.equals(a)||s.unshift(c),s}function FM(t,e,n,i,r){const s=r.precision;let o,a;o=Zy.isRectangle(e)?OM(vM(t,r).clone(),s):OM(e.clone(),s),a=Zy.isRectangle(n)?OM(CM(t,r).clone(),s):OM(n.clone(),s);const l=AM(r.step,o,a),h=o,c=a;let u,d;if(u=Zy.isRectangle(e)?jM(h,e,r.startDirections,l,r):[h],d=Zy.isRectangle(n)?jM(a,n,r.endDirections,l,r):[c],u=u.filter((t=>i.isAccessible(t))),d=d.filter((t=>i.isAccessible(t))),u.length>0&&d.length>0){const t=new fM,e={},n={},o={};for(let i=0,r=u.length;i<r;i+=1){const n=u[i],r=DM(n);t.add(r,NM(n,d)),e[r]=n,o[r]=0}const a=r.previousDirectionAngle,g=void 0===a;let p,f;const m=MM(l,r),y=m.length,b=d.reduce(((t,e)=>{const n=DM(e);return t.push(n),t}),[]),v=Jy.equalPoints(u,d);let C=r.maxLoopCount;while(!t.isEmpty()&&C>0){const u=t.pop(),w=e[u],x=n[u],E=o[u],M=w.equals(h),A=null==x;let S;S=A?g?M?null:wM(h,w,y,l,r):a:wM(x,w,y,l,r);const k=A&&v;if(!k&&b.indexOf(u)>=0)return r.previousDirectionAngle=S,LM(n,e,w,h,c);for(let a=0;a<y;a+=1){p=m[a];const h=p.angle;if(f=EM(S,h),(!g||!M)&&f>r.maxDirectionChange)continue;const u=PM(w.clone().translate(p.gridOffsetX||0,p.gridOffsetY||0),l,s),v=DM(u);if(t.isClose(v)||!i.isAccessible(u))continue;if(b.indexOf(v)>=0){const t=u.equals(c);if(!t){const t=wM(u,c,y,l,r),e=EM(h,t);if(e>r.maxDirectionChange)continue}}const C=p.cost,x=M?0:r.penalties[f],A=E+C+x;(!t.isOpen(v)||A<o[v])&&(e[v]=u,n[v]=w,o[v]=A,t.add(v,A+NM(u,d)))}C-=1}}return r.fallbackRoute?Im(r.fallbackRoute,this,h,c,r):null}const zM=function(t,e,n){const i=dM(e),r=yM(n,i),s=bM(n,i),o=vM(n,i),a=new mM(i).build(n.graph.model,n.cell),l=t.map((t=>Jy.create(t))),h=[];let c,u,d=o;for(let g=0,p=l.length;g<=p;g+=1){let e=null;if(c=u||r,u=l[g],null==u){u=s;const t=n.cell,a=null==t.getSourceCellId()||null==t.getTargetCellId();if(a&&"function"===typeof i.draggingRouter){const t=c===r?o:c,s=u.getOrigin();e=Im(i.draggingRouter,n,t,s,i)}}if(null==e&&(e=FM(n,c,u,a,i)),null===e)return Im(i.fallbackRouter,this,t,i,n);const p=e[0];p&&p.equals(d)&&e.shift(),d=e[e.length-1]||d,h.push(...e)}return h},BM=function(t,e,n){return Im(zM,this,t,Object.assign(Object.assign({},cM),e),n)},RM={maxDirectionChange:45,directions(){const t=uM(this.step,this),e=uM(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 Ky(t,a),h=90*Math.ceil(i/90),c=Jy.fromPolar(l.squaredLength(),_y.toRad(h+135),a),u=new Ky(e,c),d=l.intersectsWithLine(u),g=d||e,p=d?g:t,f=360/n.directions.length,m=p.theta(e),y=_y.normalize(m+f/2),b=f*Math.floor(y/f);return n.previousDirectionAngle=b,g&&r.push(g.round()),r.push(e),r}},$M=function(t,e,n){return Im(BM,this,t,Object.assign(Object.assign({},RM),e),n)},IM=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,h=a.getCenter(),c=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,g;"H"===o?o=c.x-h.x>=0?"L":"R":"V"===o&&(o=c.y-h.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 p="L"===o||"R"===o;if(p){if(c.y===h.y)return[...t];g="L"===o?1:-1,u="x",d="width"}else{if(c.x===h.x)return[...t];g="T"===o?1:-1,u="y",d="height"}const f=h.clone(),m=c.clone();if(f[u]+=g*(a[d]/2+s),m[u]-=g*(l[d]/2+s),p){const t=f.x,e=m.x,n=a.width/2+r,i=l.width/2+r;c.x>h.x?e<=t&&(f.x=Math.max(e,h.x+n),m.x=Math.min(t,c.x-i)):e>=t&&(f.x=Math.min(e,h.x-n),m.x=Math.max(t,c.x+i))}else{const t=f.y,e=m.y,n=a.height/2+r,i=l.height/2+r;c.y>h.y?e<=t&&(f.y=Math.max(e,h.y+n),m.y=Math.min(t,c.y-i)):e>=t&&(f.y=Math.min(e,h.y-n),m.y=Math.max(t,c.y+i))}return[f.toJSON(),...t,m.toJSON()]};function VM(t,e){if(null!=e&&!1!==e){const n="boolean"===typeof e?0:e;if(n>0){const e=Jy.create(t[1]).move(t[2],n),i=Jy.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 _M=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,h=n.sourceBBox,c=n.targetBBox;if(a.equals(l)){const t=t=>{const e=_y.toRad(t),n=Math.sin(e),r=Math.cos(e),o=new Jy(a.x+r*i,a.y+n*i),l=new Jy(o.x-r*s,o.y-n*s),h=l.clone().rotate(-90,o),c=l.clone().rotate(90,o);return[h.toJSON(),o.toJSON(),c.toJSON()]},n=t=>{const e=a.clone().move(t,-1),n=new Ky(e,t);return!h.containsPoint(t)&&!h.intersectsWithLine(n)},r=[0,90,180,270,45,135,225,315];if("number"===typeof o)return VM(t(o),e.merge);const l=h.getCenter();if(l.equals(a))return VM(t(0),e.merge);const c=l.angleBetween(a,l.clone().translate(1,0));let u=t(c);if(n(u[1]))return VM(u,e.merge);for(let i=1,s=r.length;i<s;i+=1)if(u=t(c+r[i]),n(u[1]))return VM(u,e.merge);return VM(u,e.merge)}{const t=new Ky(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 g=t.parallel(-1),p=new Ky(g.start,o),f=new Ky(g.end,o);if((h.containsPoint(o)||c.containsPoint(o)||h.intersectsWithLine(p)||h.intersectsWithLine(f)||c.intersectsWithLine(p)||c.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 Ky(a,l),e=new Ky(o,t.center).setLength(Number.MAX_SAFE_INTEGER),i=h.intersectsWithLine(e),r=c.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 VM([u.toJSON(),o.toJSON(),d.toJSON()],e.merge)}};var GM;(function(t){t.presets=f,t.registry=Lv.create({type:"router"}),t.registry.register(t.presets,!0)})(GM||(GM={}));const HM=function(t,e,n,i={}){const r=[t,...n,e],s=new tb(r),o=new wb(s);return i.raw?o:o.serialize()},UM=function(t,e,n,i={}){const r=3===n.length?0:1,s=Jy.create(n[0+r]),o=Jy.create(n[2+r]),a=Jy.create(n[1+r]);if(!Jy.equals(t,e)){const n=new Jy((t.x+e.x)/2,(t.y+e.y)/2),i=n.angleBetween(Jy.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?wb.parse(l):l},WM=function(t,e,n,i={}){const r=new wb;r.appendSegment(wb.createSegment("M",t));const s=1/3,o=2/3,a=i.radius||10;let l,h;for(let c=0,u=n.length;c<u;c+=1){const i=Jy.create(n[c]),u=n[c-1]||t,d=n[c+1]||e;l=h||i.distance(u)/2,h=i.distance(d)/2;const g=-Math.min(a,l),p=-Math.min(a,h),f=i.clone().move(u,g).round(),m=i.clone().move(d,p).round(),y=new Jy(s*f.x+o*i.x,o*i.y+s*f.y),b=new Jy(s*m.x+o*i.x,o*i.y+s*m.y);r.appendSegment(wb.createSegment("L",f)),r.appendSegment(wb.createSegment("C",y,b,m))}return r.appendSegment(wb.createSegment("L",e)),i.raw?r:r.serialize()},qM=function(t,e,n,i={}){let r,s=i.direction;if(n&&0!==n.length){const i=[t,...n,e],s=eb.throughPoints(i);r=new wb(s)}else if(r=new wb,r.appendSegment(wb.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(wb.createSegment("C",n,t.y,n,e.y,e.x,e.y))}else{const n=(t.y+e.y)/2;r.appendSegment(wb.createSegment("C",t.x,n,e.x,n,e.x,e.y))}return i.raw?r:r.serialize()},XM=1,YM=1/3,JM=2/3;function ZM(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 KM(t,e,n=[]){const i=[t,...n,e],r=[];return i.forEach(((t,e)=>{const n=i[e+1];null!=n&&r.push(new Ky(t,n))})),r}function QM(t,e){const n=[];return e.forEach((e=>{const i=t.intersectsWithLine(e);i&&n.push(i)})),n}function tA(t,e){return new Ky(t,e).squaredLength()}function eA(t,e,n){return e.reduce(((i,r,s)=>{if(sA.includes(r))return i;const o=i.pop()||t,a=Jy.create(r).move(o.start,-n);let l=Jy.create(r).move(o.start,+n);const h=e[s+1];if(null!=h){const t=l.distance(h);t<=n&&(l=h.move(o.start,t),sA.push(h))}else{const t=a.distance(o.end);if(t<2*n+XM)return i.push(o),i}const c=l.distance(o.start);if(c<2*n+XM)return i.push(o),i;const u=new Ky(a,l);return rA.push(u),i.push(new Ky(o.start,a),u,new Ky(l,o.end)),i}),[])}function nA(t,e,n,i){const r=new wb;let s;return s=wb.createSegment("M",t[0].start),r.appendSegment(s),t.forEach(((o,a)=>{if(rA.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(),h=new Ky(n,o.end).rotate(t,n);let c;c=new Ky(o.start,n),a=c.pointAt(2/3).rotate(t,o.start),l=h.pointAt(1/3).rotate(-t,h.end),s=wb.createSegment("C",a,l,h.end),r.appendSegment(s),c=new Ky(n,o.end),a=h.pointAt(1/3).rotate(t,h.end),l=c.pointAt(1/3).rotate(-t,o.end),s=wb.createSegment("C",a,l,o.end),r.appendSegment(s)}else if("gap"===n)s=wb.createSegment("M",o.end),r.appendSegment(s);else if("cubic"===n){t=o.start.theta(o.end);const n=.6*e;let h=1.35*e;i=o.start.diff(o.end);const c=i.x<0||0===i.x&&i.y<0;c&&(h*=-1),a=new Jy(o.start.x+n,o.start.y+h).rotate(t,o.start),l=new Jy(o.end.x-n,o.end.y+h).rotate(t,o.end),s=wb.createSegment("C",a,l,o.end),r.appendSegment(s)}}else{const e=t[a+1];0===i||!e||rA.includes(e)?(s=wb.createSegment("L",o.end),r.appendSegment(s)):iA(i,r,o.end,o.start,e.end)}})),r}function iA(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),h=n.clone().move(i,a).round(),c=n.clone().move(r,l).round(),u=new Jy(YM*h.x+JM*n.x,JM*n.y+YM*h.y),d=new Jy(YM*c.x+JM*n.x,JM*n.y+YM*c.y);let g;g=wb.createSegment("L",h),e.appendSegment(g),g=wb.createSegment("C",u,d,c),e.appendSegment(g)}let rA,sA;const oA=function(t,e,n,i={}){rA=[],sA=[],ZM(this);const r=i.size||5,s=i.type||"arc",o=i.radius||0,a=i.ignoreConnectors||["smooth"],l=this.graph,h=l.model,c=h.getEdges();if(1===c.length)return nA(KM(t,e,n),r,s,o);const u=this.cell,d=c.indexOf(u),g=l.options.connecting.connector||{},p=c.filter(((t,e)=>{const n=t.getConnector()||g;return!a.includes(n.name)&&(!(e>d)||"jumpover"!==n.name)})),f=p.map((t=>l.renderer.findViewByCell(t))),m=KM(t,e,n),y=f.map((t=>null==t?[]:t===this?m:KM(t.sourcePoint,t.targetPoint,t.routePoints))),b=[];m.forEach((t=>{const e=p.reduce(((e,n,i)=>{if(n!==u){const n=QM(t,y[i]);e.push(...n)}return e}),[]).sort(((e,n)=>tA(t.start,e)-tA(t.start,n)));e.length>0?b.push(...eA(t,e,r)):b.push(t)}));const v=nA(b,r,s,o);return rA=[],sA=[],i.raw?v:v.serialize()};var aA;(function(t){t.presets=m,t.registry=Lv.create({type:"connector"}),t.registry.register(t.presets,!0)})(aA||(aA={}));Lv.create;class lA{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=Ju(n,lA.defaultOptions),o=this.getTiming(s.timing),a=this.getInterp(s.interp,r,e);let l=0;const h=Array.isArray(t)?t.join(i):t,c=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[h]=$y(u):i=1;const r=a(o(i));this.cell.setPropByPath(c,r),n.progress&&n.progress(Object.assign({progress:i,currentValue:r},this.getArgs(h))),1===i&&(this.cell.notify("transition:end",this.getArgs(h)),this.cell.notify("transition:complete",this.getArgs(h)),n.complete&&n.complete(this.getArgs(h)),this.cell.notify("transition:finish",this.getArgs(h)),n.finish&&n.finish(this.getArgs(h)),this.clean(h))};return setTimeout((()=>{this.stop(t,void 0,i),this.cache[h]={startValue:r,targetValue:e,options:s},this.ids[h]=$y(u),this.cell.notify("transition:begin",this.getArgs(h)),this.cell.notify("transition:start",this.getArgs(h)),n.start&&n.start(this.getArgs(h))}),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=>Xh(i,t.split(n).slice(0,i.length)))).forEach((t=>{Iy(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?jx[t]:t}getInterp(t,e,n){return t?t(e,n):"number"===typeof n?Lx.number(e,n):"string"===typeof n?"#"===n[0]?Lx.color(e,n):Lx.unit(e,n):Lx.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"}})(lA||(lA={}));var hA=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 cA extends Dx{constructor(t={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(Wu(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=Wu(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];Xh(o[i],s)||r.push(i),Xh(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 hd(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,h=o;for(let t=1;t<a;t+=1){const e=r[t],n=Number.isFinite(Number(e));l=l[h]=n?[]:{},h=e}cd(s,r,e,i);const c=Wu(this.data);n.rewrite&&ud(c,t,i);const u=Wh(c,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=Wu(this.get(i));r&&ud(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()?Wu(this.changed):null;const e=this.changing?this.previous:this.data,n={};let i;for(const r in t){const s=t[r];Xh(e[r],s)||(n[r]=s,i=!0)}return i?Wu(n):null}toJSON(){return Wu(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})}}hA([Dx.dispose()],cA.prototype,"dispose",null);var uA,dA=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},gA=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 pA extends Dx{constructor(t={}){super();const e=this.constructor,n=e.getDefaults(!0),i=Wh({},this.preprocess(n),this.preprocess(t));this.id=i.id||pm(),this.store=new cA(i),this.animation=new lA(this),this.setup(),this.init(),this.postprocess(t)}static config(t){const{markup:e,propHooks:n,attrHooks:i}=t,r=gA(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=Wh({},this.defaults,r)}static getMarkup(){return this.markup}static getDefaults(t){return t?this.defaults:Wu(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(t,e){return this.propHooks.reduce(((e,n)=>n?Im(n,t,e):e),e)}get[Symbol.toStringTag](){return pA.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=pm()),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(Wh({},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(Wh({},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]||dw.registry.get(t);if(!i){const e=im(t);i=n[e]||dw.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(Wh({},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 pA.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 pA.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=Wu(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",pA.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=Wu(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 Zy}getConnectionPoint(t,e){return new Jy}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,h=l.attrs||{},c={};Object.keys(e).forEach((t=>{const r=e[t];if(null!=r&&!Array.isArray(r)&&"object"===typeof r&&!Nh(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];Xh(r,n)&&delete e[t]}})),Object.keys(o).forEach((t=>{const e=o[t],n=h[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&&Xh(s,r)||(null==c[t]&&(c[t]={}),c[t][i]=r):Object.keys(r).forEach((e=>{const o=r[e];if(null==n||null==s||!dt(s)||!Xh(s[e],o)){null==c[t]&&(c[t]={}),null==c[t][i]&&(c[t][i]={});const n=c[t][i];n[e]=o}}))}))}));const u=Object.assign(Object.assign({},e),{attrs:tc(c)?void 0:c});null==u.attrs&&delete u.attrs;const d=u;return 0===d.angle&&delete d.angle,Wu(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=pA.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()}}pA.defaults={},pA.attrHooks={},pA.propHooks=[],dA([Dx.dispose()],pA.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}(pA||(pA={})),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}(pA||(pA={})),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=Pn(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}(pA||(pA={})),function(t){t.config({propHooks(e){var{tools:n}=e,i=gA(e,["tools"]);return n&&(i.tools=t.normalizeTools(n)),i}})}(pA||(pA={})),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}(uA||(uA={}));class fA{constructor(t){this.ports=[],this.groups={},this.init(Wu(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=ox.registry.get(s);if(null==t)return ox.registry.onNotFound(s);o=t}else o=ox.presets.left;const a=n.map((t=>t&&t.position&&t.position.args||{})),l=r&&r.args||{},h=o(a,e,l);return h.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,Jy.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=Wh({},n.attrs,e.attrs),e.position=this.createPosition(n,e),e.label=Wh({},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 Wh({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=Mx.registry.get(i)||Mx.presets.left;return s?s(e,n,r):null}}var mA=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 yA extends pA{constructor(t={}){super(t),this.initPorts()}get[Symbol.toStringTag](){return yA.toStringTag}preprocess(t,e){const{x:n,y:i,width:r,height:s}=t,o=mA(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=_y.normalize(this.getAngle()||0);n.absolute&&(o+=Math.floor((a+45)/90),o%=4);const l=this.getBBox();let h;h=0===o?l.getBottomLeft():1===o?l.getCorner():2===o?l.getTopRight():l.getOrigin();const c=h.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-=_y.toRad(a);const g=Jy.fromPolar(u,d,c),p=g.clone().translate(t/-2,e/-2);this.store.set("size",{width:t,height:e},n),this.setPosition(p.x,p.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)),h=Math.max(s.y+a,Math.min(s.y+s.height+a-r.height,i.y+e));t=l-i.x,e=h-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:Lx.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),pA.getCellsBBox(t)}return Zy.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,h=Jy.create(l).translate(n.getOrigin()),c=this.getAngle();return c&&h.rotate(-c,i),h}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}=pA.getCellsBBox(n);const a=Sm(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")||Yx.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(t,e={}){return this.store.set("portContainerMarkup",Yx.clone(t),e),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(t){this.setPortMarkup(t)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||Yx.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(t,e={}){return this.store.set("portMarkup",Yx.clone(t),e),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(t){this.setPortLabelMarkup(t)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||Yx.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(t,e={}){return this.store.set("portLabelMarkup",Yx.clone(t),e),this}get ports(){const t=this.store.get("ports",{items:[]});return null==t.items&&(t.items=[]),t}getPorts(){return Wu(this.ports.items)}getPortsByGroup(t){return this.getPorts().filter((e=>e.group===t))}getPort(t){return Wu(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 Zy(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&&!tc(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 pm()}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 fA(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})}}yA.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}(yA||(yA={})),function(t){t.config({propHooks(t){var{ports:e}=t,n=mA(t,["ports"]);return e&&(n.ports=Array.isArray(e)?{items:e}:e),n}})}(yA||(yA={})),function(t){t.registry=Lv.create({type:"node",process(e,n){if(uA.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=mA(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}}),uA.setNodeRegistry(t.registry)}(yA||(yA={})),function(t){let e=0;function n(t){return t?dm(t):(e+=1,`CustomNode${e}`)}function i(e){const{constructorName:i,overwrite:r}=e,s=mA(e,["constructorName","overwrite"]),o=ld(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}(yA||(yA={}));var bA=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 vA extends yA{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=bA(t,["label"]);return e&&cd(n,"attrs/text/text",e),n}})})(vA||(vA={}));var CA=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 wA(t,e=!1){return`<g class="rotatable"><g class="scalable"><${t}/></g>${e?"":"<text/>"}</g>`}function xA(t){return`basic.${t}`}function EA(t="xlink:href"){const e=e=>{const{imageUrl:n,imageWidth:i,imageHeight:r}=e,s=CA(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 MA(t,e,n={}){const i=xA(t),r={constructorName:i,attrs:{".":{fill:"#ffffff",stroke:"none"},[t]:{fill:"#ffffff",stroke:"#000000"}}};n.ignoreMarkup||(r.markup=wA(t,!0===n.noText));const s=n.parent||vA;return s.define(Wh(r,e,{shape:i}))}MA("rect",{attrs:{rect:{width:100,height:60}}}),MA("circle",{width:60,height:60,attrs:{circle:{r:30,cx:30,cy:30}}}),MA("ellipse",{width:60,height:40,attrs:{ellipse:{rx:30,ry:20,cx:30,cy:20}}}),MA("polygon",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),MA("polyline",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),MA("image",{attrs:{text:{refY:null,refDy:16}},propHooks:EA()});var 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};const SA=MA("path",{width:60,height:60,attrs:{text:{ref:"path",refY:null,refDy:16}},propHooks(t){const{d:e}=t,n=AA(t,["d"]);return null!=e&&cd(n,"attrs/path/d",e),n}});MA("rhombus",{d:"M 30 0 L 60 30 30 60 0 30 z",attrs:{text:{refY:.5,refDy:null}}},{parent:SA,ignoreMarkup:!0}),MA("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:SA,ignoreMarkup:!0});var kA=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 OA extends pA{constructor(t={}){super(t)}get[Symbol.toStringTag](){return OA.toStringTag}preprocess(t,e){const{source:n,sourceCell:i,sourcePort:r,sourcePoint:s,target:o,targetCell:a,targetPort:l,targetPoint:h}=t,c=kA(t,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),u=c,d=t=>"string"===typeof t||"number"===typeof t;if(null!=n)if(pA.isCell(n))u.source={cell:n.id};else if(d(n))u.source={cell:n};else if(Jy.isPoint(n))u.source=n.toJSON();else if(Array.isArray(n))u.source={x:n[0],y:n[1]};else{const t=n.cell;pA.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=Jy.create(s).toJSON());if(null!=o)if(pA.isCell(o))u.target={cell:o.id};else if(d(o))u.target={cell:o};else if(Jy.isPoint(o))u.target=o.toJSON();else if(Array.isArray(o))u.target={x:o[0],y:o[1]};else{const t=o.cell;pA.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!=h&&(u.target=Jy.create(h).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(pA.isCell(e))return this.store.set(t,Wh({},n,{cell:e.id}),i),this;const r=e;return Jy.isPoint(e)||null!=r.x&&null!=r.y?(this.store.set(t,Wh({},n,{x:r.x,y:r.y}),i),this):(this.store.set(t,Wu(e),i),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(t){const e=this[t];if(Jy.isPointLike(e))return Jy.create(e);const n=this.getTerminalCell(t);return n?n.getConnectionPoint(this,t):new Jy}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 Wu(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||Xh(e,t)))?null:e)):e?[...e]:[],i=t&&e?t.filter((t=>e.find((e=>t===e||Xh(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")||Yx.getEdgeVertexMarkup()}getVertexMarkup(){return this.store.get("vertexMarkup")||this.getDefaultVertexMarkup()}setVertexMarkup(t,e={}){return this.store.set("vertexMarkup",Yx.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=>Jy.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,Jy.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=>Jy.equals(e,t)))?null:e)):e?[...e]:[],i=t&&e?t.filter((t=>e.find((e=>Jy.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")||Yx.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}get toolMarkup(){return this.getToolMarkup()}set toolMarkup(t){this.setToolMarkup(t)}getDefaultToolMarkup(){return this.store.get("defaultToolMarkup")||Yx.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")||Yx.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=>Jy.create(i).scale(t,e,n).toJSON()),i)}applyToPoints(t,e={}){const n={},i=this.getSource(),r=this.getTarget();Jy.isPointLike(i)&&(n.source=t(i)),Jy.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=>Jy.create(t))),this.getTargetPoint()];return new tb(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:pA.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))}}OA.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}(OA||(OA={})),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}(OA||(OA={})),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}(OA||(OA={})),function(t){t.registry=Lv.create({type:"edge",process(e,n){if(uA.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=kA(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}}),uA.setEdgeRegistry(t.registry)}(OA||(OA={})),function(t){let e=0;function n(t){return t?dm(t):(e+=1,`CustomEdge${e}`)}function i(e){const{constructorName:i,overwrite:r}=e,s=kA(e,["constructorName","overwrite"]),o=ld(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}(OA||(OA={})),function(t){const e="basic.edge";t.config({shape:e,propHooks(e){const{label:n,vertices:i}=e,r=kA(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=>Jy.create(t).toJSON()))),r}}),t.registry.register(e,t)}(OA||(OA={}));var PA=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 DA extends tE{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.markerCache={}}get[Symbol.toStringTag](){return DA.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const t=this.sourceView;if(!t){const t=this.cell.getSource();return new Zy(t.x,t.y)}const e=this.sourceMagnet;return t.isEdgeElement(e)?new Zy(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 Zy(t.x,t.y)}const e=this.targetMagnet;return t.isEdgeElement(e)?new Zy(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&&Nl(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=xb.createVectors(t);n.forEach((t=>{const n=t.attr("class");n&&(e[im(n)]=t.node)})),this.renderTools(),this.renderVertexMarkers(),this.renderArrowheadMarkers(),by(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=ay("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=xb.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()?xb.create("g").append(e):xb.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=Wh({},i.attrs,o.attrs);this.updateAttrs(t,a,{selectors:s,rootBBox:o.size?Zy.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:Wh({},n)}return t?Wh({},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(Yx.isStringMarkup(e)){let t=Pp(e);const i=xb.create(t());if(n.append(i.node),this.toolCache=i.node,this.options.doubleTools){let e;const r=this.cell.doubleToolMarkup;Yx.isStringMarkup(r)?(t=Pp(r),e=xb.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(Yx.isStringMarkup(e)){const t=Pp(e);this.cell.getVertices().forEach(((e,i)=>{n.append(xb.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(Yx.isStringMarkup(e)){const t=Pp(e),i=xb.create(t({end:"source"})).node,r=xb.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 tb(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 Jy.create(this.sourceAnchor);case"target":return Jy.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalConnectionPoint(t){switch(t){case"source":return Jy.create(this.sourcePoint);case"target":return Jy.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 tb(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],h=this.getTerminalView(t),c=this.getTerminalView(n),u=this.getTerminalMagnet(t),d=this.getTerminalMagnet(n);if(h){let n;n=e?Jy.create(e):c?d:Jy.create(l),r=this.getAnchor(a.anchor,h,u,n,t)}else r=Jy.create(a);if(c){const t=Jy.create(i||r);s=this.getAnchor(l.anchor,c,d,t,n)}else s=Jy.isPointLike(l)?Jy.create(l):new Jy;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 h=l.name;if(s){const t=HE.registry.get(h);if("function"!==typeof t)return HE.registry.onNotFound(h);a=Im(t,this,e,n,i,l.args||{},r)}else{const t=BE.registry.get(h);if("function"!==typeof t)return BE.registry.onNotFound(h);a=Im(t,this,e,n,i,l.args||{},r)}return a?a.round(this.POINT_ROUNDING):new Jy}findRoutePoints(t=[]){const e=this.graph.options.connecting.router||GM.presets.normal,n=this.cell.getRouter()||e;let i;if("function"===typeof n)i=Im(n,this,t,{},this);else{const e="string"===typeof n?n:n.name,r="string"===typeof n?{}:n.args||{},s=e?GM.registry.get(e):GM.presets.normal;if("function"!==typeof s)return GM.registry.onNotFound(e);i=Im(s,this,t,r,this)}return null==i?t.map((t=>Jy.create(t))):i.map((t=>Jy.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,h=t[0],c=t[t.length-1];let u,d;if(a&&!a.isEdgeElement(this.sourceMagnet)){const t=this.sourceMagnet||a.container,i=h||n,o=new Ky(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=c||e,a=new Ky(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=QE.registry.get(o);if("function"!==typeof l)return QE.registry.onNotFound(o);const h=Im(l,this,i,e,n,a||{},r);return h?h.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 h,c;if(o){if(this.updateMarkerAttr("source"),l.sourceBBox=l.sourceBBox||dv(o),l.sourceBBox.width>0){const t=Av(o);h=e.clone().move(r||n,l.sourceBBox.width*t.sx*-1)}}else{const t=i("source");t&&(h=e.clone().move(r||n,-t))}if(a){if(this.updateMarkerAttr("target"),l.targetBBox=l.targetBBox||dv(a),l.targetBBox.width>0){const t=Av(a);c=n.clone().move(s||e,l.targetBBox.width*t.sx*-1)}}else{const t=i("target");t&&(c=n.clone().move(s||e,-t))}return l.sourcePoint=h||e.clone(),l.targetPoint=c||n.clone(),{source:h,target:c}}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=aA.registry.get(r);if("function"!==typeof t)return aA.registry.onNotFound(r);o=t}else o=aA.presets.normal;const a=Im(o,this,e,n,t,Object.assign(Object.assign({},s),{raw:!0}),this);return"string"===typeof a?wb.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=Wh({},r,e),o=this.getLabelTransformationMatrix(i);this.labelCache[s].setAttribute("transform",tv(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&&ky(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&&ky(this.tool2Cache,"transform",`translate(${i.x},${i.y}) ${t}`),ky(this.tool2Cache,"visibility","visible")}else this.options.doubleTools&&ky(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;Av(e,i),Av(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&&Sv(t,this.sourcePoint,n[0]||this.targetPoint,this.graph.view.stage),e&&Sv(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:Wh({},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(),h=o,c=this.mergeLabelPositionArgs(h,l),u={position:this.getLabelPosition(r,s,a,c)},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=PA(e,["duration","reversed","selector","rotate","timing"]);Object.keys(o).forEach((t=>{l[t]=o[t]}))}let h;if(h="string"===typeof s?this.findOne(s,this.container,this.selectors):this.containers.connection?this.containers.connection:this.container.querySelector("path"),!(h instanceof SVGPathElement))throw new Error("Token animation requires a valid connection path.");const c="string"===typeof t?this.findOne(t):t;if(null==c)throw new Error("Token animation requires a valid token element.");const u=c.parentNode,d=()=>{u||my(c)},g=xb.create(c);u||g.appendTo(this.graph.view.stage);const p=l.complete;l.complete=t=>{d(),n&&n(),p&&p(t)};const f=g.animateAlongPath(l,h);return()=>{d(),f()}}getConnection(){return null!=this.path?this.path.clone():null}getConnectionPathData(){if(null==this.path)return"";const t=this.cache.pathCache;return Nl(t,"data")||(t.data=this.path.serialize()),t.data||""}getConnectionSubdivisions(){if(null==this.path)return null;const t=this.cache.pathCache;return Nl(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions}getConnectionLength(){if(null==this.path)return 0;const t=this.cache.pathCache;return Nl(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:(Em(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),h=s&&s.absoluteDistance&&s.reverseDistance,c=this.path,u={segmentSubdivisions:this.getConnectionSubdivisions()},d=new Jy(t,e),g=c.closestPointT(d,u),p=this.getConnectionLength()||0;let f,m,y=c.lengthAtT(g,u);if(l&&(y=p>0?y/p:0),h&&(y=-1*(p-y)||1),r.distance=y,a||(f=c.tangentAtT(g)),f)m=f.pointOffset(d);else{const t=c.pointAtT(g),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 h=0!==a.x||0!==a.y||0===o,c=n.keepGradient,u=n.ensureLegibility,d=this.path,g={segmentSubdivisions:this.getConnectionSubdivisions()},p=s?r*this.getConnectionLength():r,f=d.tangentAtLength(p,g);let m,y=i;if(f){if(h)m=f.start,m.translate(a);else{const t=f.clone();t.rotate(-90,f.start),t.setLength(o),m=t.end}c&&(y=f.angle()+i,u&&(y=_y.normalize((y+90)%180-90)))}else m=d.start,h&&m.translate(a);return Zb().translate(m.x,m.y).rotate(y)}getLabelCoordinates(t){const e=this.getLabelTransformationMatrix(t);return new Jy(e.e,e.f)}getVertexIndex(t,e){const n=this.cell,i=n.getVertices(),r=this.getClosestPointLength(new Jy(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=py(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:_u(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 h;n.closestView=null,n.closestMagnet=null;let c=Number.MAX_SAFE_INTEGER;const u=new Jy(t,e);let d;o.forEach((r=>{"false"!==r.container.getAttribute("magnet")&&(h=r.cell.getBBox().getCenter().distance(u),h<s&&h<c&&(l===r.container||i.hook.validateConnection(...n.getValidateConnectionArgs(r,null),r.getEdgeTerminal(r.container,t,e,this.cell,n.terminalType)))&&(c=h,n.closestView=r,n.closestMagnet=r.container)),r.container.querySelectorAll("[magnet]").forEach((o=>{if("false"!==o.getAttribute("magnet")){const a=r.getBBoxOfElement(o);h=u.distance(a.getCenter()),h<s&&h<c&&(l===o||i.hook.validateConnection(...n.getValidateConnectionArgs(r,o),r.getEdgeTerminal(o,t,e,this.cell,n.terminalType)))&&(c=h,n.closestView=r,n.closestMagnet=o)}}))}));const g=n.terminalType,p=n.closestView,f=n.closestMagnet,m=l!==f;if(a&&m&&a.unhighlight(l,{type:"magnetAdsorbed"}),p){if(!m)return;p.highlight(f,{type:"magnetAdsorbed"}),d=p.getEdgeTerminal(f,t,e,this.cell,g)}else d={x:t,y:e};this.cell.setTerminal(g,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&&!OA.equalTerminals(i,r);if(s){const s=this.graph,o=i,a=o.cell?s.getCellById(o.cell):null,l=o.port,h=a?s.findViewByCell(a):null,c=a||t.isNewEdge?null:Jy.create(i).toJSON(),u=r,d=u.cell?s.getCellById(u.cell):null,g=u.port,p=d?s.findViewByCell(d):null,f=d?null:Jy.create(r).toJSON();this.notify("edge:connected",{e:e,previousCell:a,previousPort:l,previousView:h,previousPoint:c,currentCell:d,currentView:p,currentPort:g,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=Wh({},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})(DA||(DA={})),DA.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}),DA.registry.register("edge",DA,!0);class TA extends tE{constructor(){super(...arguments),this.scalableNode=null,this.rotatableNode=null,this.scalableSelector="scalable",this.rotatableSelector="rotatable",this.defaultPortMarkup=Yx.getPortMarkup(),this.defaultPortLabelMarkup=Yx.getPortLabelMarkup(),this.defaultPortContainerMarkup=Yx.getPortContainerMarkup(),this.portsCache={}}get[Symbol.toStringTag](){return TA.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")?Zm(e,t):Jm(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()),Bw.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(),Bw.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 Zy(0,0,n.width,n.height),selectors:this.selectors,scalableNode:this.scalableNode,rotatableNode:this.rotatableNode}),Bw.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){by(this.container,xb.toNodes(xb.createVectors(t))),this.rotatableNode=gy(this.container,`.${this.rotatableSelector}`),this.scalableNode=gy(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(),Bw.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=dv(r,{recursive:s}),a=n.width/(o.width||1),l=n.height/(o.height||1);r.setAttribute("transform",`scale(${a},${l})`);const h=this.rotatableNode;if(null!=h){const s=h.getAttribute("transform");if(s){h.setAttribute("transform",`${s} rotate(${-i},${n.width/2},${n.height/2})`);const o=dv(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];my(e.portElement)}))}renderPorts(){const t=this.getPortsContainer(),e=[];t.childNodes.forEach((t=>{e.push(t)}));const n=wl(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?Cy(n[Math.max(e,0)],i):by(this.getPortsContainer(),i)}getPortElement(t){const e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)}createPortElement(t){let e=Yx.renderMarkup(this.getPortContainerMarkup());const n=e.elem;if(null==n)throw new Error("Invalid port container markup.");e=Yx.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=Yx.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 Jm(n,"x6-port"),Jm(i,"x6-port-body"),Jm(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=Zy.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=Zy.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=Zy.fromSize(t.labelSize)),this.updateAttrs(r.portLabelElement,o.attrs,e)}}}applyPortTransform(t,e,n=0){const i=e.angle,r=e.position,s=Zb().rotate(n).translate(r.x||0,r.y||0).rotate(i||0);xv(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?Im(s,i,{view:this,node:this.cell}).filter((t=>pA.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,h=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(Im(h,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 c=i.snapToGrid(t.clientX,t.clientY);this.notify("node:embedding",{e:t,cell:n,node:n,view:i.findViewByCell(n),x:c.x,y:c.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=Jy.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 h=Rw.snapToGrid(e+a.x,s),c=Rw.snapToGrid(n+a.y,s);i.setPosition(h,c,{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})(TA||(TA={})),TA.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"]}}),TA.registry.register("node",TA,!0);const NA=xA("text");class jA extends(MA("text",{view:NA,attrs:{text:{fontSize:18,fill:"#000000",stroke:null,refX:.5,refY:.5}}},{noText:!0})){}(function(t){class e extends TA{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"]}}),TA.registry.register(NA,e)})(jA||(jA={}));class LA extends Dx{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 h=[],c=[];return s.forEach((t=>{const e=this.get(t);e?r.merge&&!t.isSameStore(e)&&(e.setProp(t.getProp(),n),c.push(e),o&&!l&&(l=null==a||"function"===typeof a?e.hasChanged():"string"===typeof a?e.hasChanged(a):a.some((t=>e.hasChanged(t))))):(h.push(t),this.reference(t))})),h.length&&(o&&(l=!0),this.cells.splice(i,0,...h),this.length=this.cells.length),l&&this.sort({silent:!0}),r.silent||(h.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"),(h.length||c.length)&&this.trigger("updated",{added:h,merged:c,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=hl(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 FA extends Dx{constructor(t=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new LA(t),this.setup()}get[Symbol.toStringTag](){return FA.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=yA.isNode(t)?t:this.createNode(t);return this.addCell(n,e),n}createNode(t){return yA.create(t)}addEdge(t,e={}){const n=OA.isEdge(t)?t:this.createEdge(t);return this.addCell(n,e),n}createEdge(t){return OA.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))})),pA.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 pA.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 Zy(t,e,n,i):Zy.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 Zy(t,e,n,i):Zy.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 pA.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===Im(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===Im(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=Nx.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 FA.toJSON(this.getCells(),t)}parseJSON(t){return FA.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})(FA||(FA={})),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(yA.registry.exist(e))return yA.create(t);if(OA.registry.exist(e))return OA.create(t)}throw new Error("The `shape` should be specified when creating a node/edge instance")}))}t.toJSON=e,t.fromJSON=n}(FA||(FA={}));const zA=".text-block-content",BA=xA("text-block");class RA extends yA{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){I.SUPPORT_FOREIGNOBJECT&&this.setAttrs({foreignObject:Object.assign({},t),[zA]:{style:Object.assign({},t)}})}updateContent(t){I.SUPPORT_FOREIGNOBJECT?this.setAttrs({[zA]:{html:t?fm(t):""}}):this.setAttrs({[zA]:{text:t}})}}(function(t){t.config({type:BA,view:BA,markup:['<g class="rotatable">','<g class="scalable"><rect/></g>',I.SUPPORT_FOREIGNOBJECT?["<foreignObject>",'<body xmlns="http://www.w3.org/1999/xhtml">',`<div class="${zA.substr(1)}" />`,"</body>","</foreignObject>"].join(""):`<text class="${zA.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"}},[zA]:{refX:.5,refY:.5,yAlign:"middle",xAlign:"middle",style:{textAlign:"center",verticalAlign:"middle",display:"table-cell",padding:"0 5px",margin:0}}}}),yA.registry.register(BA,t)})(RA||(RA={})),function(t){const e="content";class n extends TA{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(I.SUPPORT_FOREIGNOBJECT)super.update(t);else{const e=this.cell,n=Object.assign({},t||e.getAttrs());delete n[zA],super.update(n),t&&!Nl(t,zA)||this.updateContent(t)}}updateContent(t){if(I.SUPPORT_FOREIGNOBJECT)super.update(t);else{const e=this.cell,n=(t||e.getAttrs())[zA],i=Db(e.getContent(),e.getSize(),n,{svgDocument:this.graph.view.svg}),r={[zA]:Wh({},n,{text:i})};super.update(r)}}}t.View=n,function(t){t.config({bootstrap:["render",e],actions:I.SUPPORT_FOREIGNOBJECT?{}:{size:e,content:e}}),TA.registry.register(BA,t)}(n=t.View||(t.View={}))}(RA||(RA={}));vA.define({shape:"empty"});function $A(t,e="body"){return[{tagName:t,selector:e},{tagName:"text",selector:"label"}]}function IA(t,e,n={}){const i={constructorName:t,markup:$A(t,n.selector),attrs:{[t]:Object.assign({},vA.bodyAttr)}},r=n.parent||vA;return r.define(Wh(i,e,{shape:t}))}IA("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}}),yA.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({},vA.bodyAttr),{refWidth:"100%",refHeight:"100%"}),header:Object.assign(Object.assign({},vA.bodyAttr),{refWidth:"100%",height:30,stroke:"#000000"}),headerText:Object.assign(Object.assign({},vA.labelAttr),{refX:"50%",refY:15,fontSize:16}),bodyText:Object.assign(Object.assign({},vA.labelAttr),{refY2:15})}}),IA("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});const VA=10;vA.define({shape:"cylinder",overwrite:!0,markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],attrs:{body:Object.assign(Object.assign({},vA.bodyAttr),{lateral:VA}),top:Object.assign(Object.assign({},vA.bodyAttr),{refCx:"50%",refRx:"50%",cy:VA,ry:VA})},attrHooks:{lateral:{set(t,{refBBox:e}){const n=Em(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,h=.551784,c=h*a,u=h*l,d=i,g=i+s/2,p=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,g-c,b,g,b,"C",g+c,b,p,y+u,p,y,"L",p,f,"C",p,f-u,g+c,m,g,m,"C",g-c,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=xm(e.round+n,s,o);a!==r&&t.attr({body:{lateral:a},top:{cy:a,ry:a}})}}}}),IA("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var _A=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 GA extends vA{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",GA.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(","):Jy.isPointLike(t)?`${t.x}, ${t.y}`:"")).join(" ")}t.pointsToString=e,t.config({propHooks(t){const{points:n}=t,i=_A(t,["points"]);if(n){const t=e(n);t&&cd(i,"attrs/body/refPoints",t)}return i}})})(GA||(GA={}));IA("polygon",{},{parent:GA}),IA("polyline",{},{parent:GA});var HA=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};vA.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=HA(t,["path"]);return e&&cd(n,"attrs/body/refD",e),n}});var UA=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};vA.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},I.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:iy.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({},vA.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(t){const{text:e}=t,n=UA(t,["text"]);return e&&cd(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),h=dw.presets.textWrap;return Im(h.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()}}}}),IA("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:EA()},{selector:"image"}),IA("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:EA()}),IA("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:EA()}),IA("image-inscribed",{propHooks:EA(),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 WA=OA.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"}}});OA.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}}}}),OA.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 qA extends vA{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 TA{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}}),TA.registry.register("html-view",t)}(e=t.View||(t.View={}))})(qA||(qA={})),function(t){t.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Yx.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),yA.registry.register("html",t)}(qA||(qA={})),function(t){t.componentRegistry=Lv.create({type:"html componnet"})}(qA||(qA={}));var XA=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 YA extends Tx{constructor(t){super(),this.delay=10,this.throttle=2,this.threshold=5,this.changeCount=0,this.timestamp=0,this.options=Object.assign(Object.assign({},YA.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)}}XA([Tx.dispose()],YA.prototype,"dispose",null),function(t){t.defaultOptions={delay:10,throttle:2,threshold:5}}(YA||(YA={}));class JA extends Ox{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 ZA,KA=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 QA extends Ix{constructor(t){super(),this.graph=t;const{selectors:e,fragment:n}=Yx.parseJSONMarkup(QA.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=QA.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&&pA.isCell(e.cell))&&(this.svg!==t.target&&this.container!==t.target&&!R().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(R().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);Im(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=()=>{}}}KA([Ix.dispose()],QA.prototype,"dispose",null),function(t){const e=`${Bw.prefixCls}-graph`;function n(t){const e=t.cloneNode();return t.childNodes.forEach((t=>e.appendChild(t))),()=>{yy(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:iy.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:iy.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:iy.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":iy.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}(QA||(QA={})),function(t){const e=Bw.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"}}(QA||(QA={})),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}(ZA||(ZA={}));const tS=".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 eS=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 nS extends JA{init(){Bw.autoInsertCSS&&nS.ensure()}dispose(){nS.clean()}}eS([nS.dispose()],nS.prototype,"dispose",null),function(t){let e,n=0;function i(){if(n+=1,!(n>1)&&!I.isApplyingHMR()){e=document.createElement("style"),e.setAttribute("type","text/css"),e.textContent=tS;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}(nS||(nS={}));var iS,rS=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 sS{get handleClassName(){return iS.handle}get pie(){return Object.assign(Object.assign({},sS.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=iS.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(iS.wrap).addClass(iS.animate).addClass(`${iS.handle}-${t}`)}this.delegateEvents({[`mousedown .${iS.handle}`]:"onHandleMouseDown",[`touchstart .${iS.handle}`]:"onHandleMouseDown",[`mousedown .${iS.pieToggle}`]:"onPieToggleMouseDown",[`touchstart .${iS.pieToggle}`]:"onPieToggleMouseDown"})}onHandleMouseDown(t){const e=this.$(t.currentTarget).closest(`.${iS.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,h=o.y-a.y;this.trigger(`action:${t}:${e}`,Object.assign({e:r,dx:l,dy:h,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(`.${iS.pieToggle}`).attr("data-name");this.isOpen(e)||this.isOpen()&&this.toggleState(),this.toggleState(e)}setPieIcons(){"pie"===this.handleOptions.type&&this.$handleContainer.find(`.${iS.handle}`).each(((t,e)=>{const n=this.$(e),i=n.attr("data-action"),r=iS.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&&xb.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&&xb.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(`${iS.handle} ${iS.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 Jy(r,r),l=_y.toRad(i.sliceAngle),h=n*l+_y.toRad(i.startAngle),c=h+l,u=Ub(s,r,h,c),d=xb.create("svg").addClass(`${iS.pieSlice}-svg`),g=xb.create("path").addClass(iS.pieSlice).attr("d",u).translate(r,r),p=Jy.fromPolar(o,-h-l/2,a).toJSON(),f=i.iconSize,m=xb.create("image").attr(p).addClass(`${iS.pieSlice}-img`);p.y=p.y+f-2;const y=xb.create("text",{"font-size":f}).attr(p).addClass(`${iS.pieSlice}-txt`);m.attr({width:f,height:f}),m.translate(-f/2,-f/2),y.translate(-f/2,-f/2),d.append([g,m,y]),e.append(d.node)}else e.addClass(`${iS.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=`${iS.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(`.${iS.handle}-${t}`)}updateHandleIcon(t,e){if("pie"===this.handleOptions.type){const n=t.find(`.${iS.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(iS.pieToggleOpened):this.$handleContainer.hasClass(`${iS.pieOpended}`))}toggleState(t){if(this.isRendered()){const e=this.$handleContainer;if(Object.keys(this.$pieToggles).forEach((t=>{const e=this.$pieToggles[t];e.removeClass(iS.pieToggleOpened)})),this.isOpen())this.trigger("pie:close",{name:t}),e.removeClass(iS.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(iS.pieToggleOpened)}e.addClass(iS.pieOpended)}}}applyAttrs(t,e){if(e){const n=Ix.$(t);Object.keys(e).forEach((t=>{const i=n.find(t).addBack().filter(t),r=e[t],{class:s}=r,o=rS(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"}]}})(sS||(sS={})),function(t){t.handle=Ix.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`}(iS||(iS={}));var oS,aS=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},lS=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 hS extends Ix{constructor(t){super();const e=t,{view:n,cell:i,node:r,edge:s,graph:o}=e,a=lS(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()}}hS.instanceCache=new WeakMap,aS([Ix.dispose()],hS.prototype,"dispose",null);class cS extends hS{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"),Jm(this.container,this.prefixClassName("widget-knob")),this.options.className&&Jm(this.container,this.options.className),this.view.addClass(oS.KNOB),this.graph.container.appendChild(this.container),this.update(),this}remove(){return this.view.removeClass(oS.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=_y.normalize(this.node.getAngle()),r=Jy.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(oS.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(oS.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 Jy(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(oS.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"}})(oS||(oS={}));var uS,dS,gS=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`})(uS||(uS={}));class pS extends Ix{constructor(t){super(),this.options=Object.assign(Object.assign({},dS.defaultOptions),t),this.updateViewport=jm(this.updateViewport.bind(this),0),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(uS.root));const e=document.createElement("div");this.container.appendChild(e),this.$viewport=this.$("<div>").addClass(this.prefixClassName(uS.viewport)),this.options.scalable&&(this.zoomHandle=this.$("<div>").addClass(this.prefixClassName(uS.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 kk(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,h=r.x*l/s.sx,c=r.y*l/s.sy;return n*=l,i*=l,this.targetGraph.resizeGraph(n,i),this.targetGraph.translate(h,c),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 Jy(-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(dS.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()}}gS([Ix.dispose()],pS.prototype,"dispose",null),function(t){t.defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:t=>new kk(t)},t.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}}(dS||(dS={}));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},mS=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 yS extends Ix{constructor(t){super();const{graph:e}=t,n=mS(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=_y.normalize(t.getAngle()),l=this.options.tolerance||0;let h,c,u,d,g,p;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]=hl(n,(t=>t.distance))})),null==h&&m.vertical.length>0&&(h=m.vertical[0].position,c=Math.min(r.y,n.y),u=Math.max(o.y,s.y)-c),null==d&&m.horizontal.length>0&&(d=m.horizontal[0].position,g=Math.min(r.x,n.x),p=Math.max(o.x,s.x)-g),null!=h&&null!=d})),this.hide();let v=0,C=0;null==d&&null==h||(null!=h&&(v=-1!==y.indexOf("right")?h-o.x:s.x-h),null!=d&&(C=-1!==y.indexOf("bottom")?d-o.y:s.y-d));let w=0,x=0;if(a%90===0)90===a||270===a?(w=C,x=v):(w=v,x=C);else{const t=a>=0&&a<90?1:a>=90&&a<180?4:a>=180&&a<270?3:2;null!=d&&null!=h&&(v<C?(C=0,d=void 0):(v=0,h=void 0));const e=_y.toRad(a%90);v&&(w=3===t?v/Math.cos(e):v/Math.sin(e)),C&&(x=3===t?C/Math.cos(e):C/Math.sin(e));const n=1===t||3===t;switch(b){case"top":case"bottom":x=C?C/(n?Math.cos(e):Math.sin(e)):v/(n?Math.sin(e):Math.cos(e));break;case"left":case"right":w=v?v/(n?Math.cos(e):Math.sin(e)):C/(n?Math.sin(e):Math.cos(e));break;default:break}}switch(b){case"top":case"bottom":w=0;break;case"left":case"right":x=0;break;default:break}const E=this.graph.getGridSize();let M=Math.max(i.width+w,E),A=Math.max(i.height+x,E);e.minWidth&&e.minWidth>E&&(M=Math.max(M,e.minWidth)),e.minHeight&&e.minHeight>E&&(A=Math.max(A,e.minHeight)),e.maxWidth&&(M=Math.min(M,e.maxWidth)),e.maxHeight&&(A=Math.min(A,e.maxHeight)),e.preserveAspectRatio&&(x<w?A=M*(i.height/i.width):M=A*(i.width/i.height)),M===i.width&&A===i.height||(t.resize(M,A,{direction:m,relativeDirection:b,trueDirection:y,snapped:!0,snaplines:this.cid,restrict:this.graph.hook.getRestrictArea(n)}),u&&(u+=A-i.height),p&&(p+=M-i.width));const S=t.getBBox().bbox(a);h&&Math.abs(S.x-h)>1&&Math.abs(S.width+S.x-h)>1&&(h=void 0),d&&Math.abs(S.y-d)>1&&Math.abs(S.height+S.y-d)>1&&(d=void 0),this.update({verticalLeft:h,verticalTop:c,verticalHeight:u,horizontalTop:d,horizontalLeft:g,horizontalWidth:p})}}}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 Zy(n-this.offset.x,i-this.offset.y,o.width,o.height),h=s.getAngle(),c=l.getCenter(),u=l.bbox(h),d=u.getTopLeft(),g=u.getBottomRight(),p=this.options.tolerance||0;let f,m,y,b,v,C,w=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-c.x)<p?(f=n.x,w=.5):Math.abs(i.x-d.x)<p?(f=i.x,w=0):Math.abs(i.x-g.x)<p?(f=i.x,w=1):Math.abs(r.x-g.x)<p?(f=r.x,w=1):Math.abs(r.x-d.x)<p&&(f=r.x),null!=f&&(m=Math.min(u.y,e.y),y=Math.max(g.y,r.y)-m)),null==b&&(Math.abs(n.y-c.y)<p?(b=n.y,x=.5):Math.abs(i.y-d.y)<p?b=i.y:Math.abs(i.y-g.y)<p?(b=i.y,x=1):Math.abs(r.y-g.y)<p?(b=r.y,x=1):Math.abs(r.y-d.y)<p&&(b=r.y),null!=b&&(v=Math.min(u.x,e.x),C=Math.max(g.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-w*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)}),C&&(C+=i),y&&(y+=o)),this.update({verticalLeft:f,verticalTop:m,verticalHeight:y,horizontalTop:b,horizontalLeft:v,horizontalWidth:C})}}isIgnored(t,e){return e.id===t.id||e.isDescendantOf(t)||this.filterShapes[e.shape]||this.filterCells[e.id]||this.filterFunction&&Im(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()}}fS([Ix.dispose()],yS.prototype,"dispose",null);var 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};class vS extends JA{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(vS.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=vS.UPDATE_DELAYING_BATCHES;i.includes(t)&&!n.hasActiveBatch(i)&&this.updateViews(e)}const i=vS.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,vS.FLAG_REMOVE,n.priority,e)}onCellZIndexChanged({cell:t,options:e}){if("approx"===this.options.sorting){const n=this.findViewByCell(t);n&&this.requestViewUpdate(n,vS.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(tE.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||!tE.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&vS.FLAG_REMOVE&&a&vS.FLAG_INSERT?o[r]^=vS.FLAG_INSERT:e&vS.FLAG_INSERT&&a&vS.FLAG_REMOVE&&(o[r]^=vS.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(vS.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(tE.isCellView(t)){if(e&vS.FLAG_REMOVE)return this.removeView(t.cell),0;e&vS.FLAG_INSERT&&(this.insertView(t),e^=vS.FLAG_INSERT)}return e?t.confirmUpdate(e,n):0}updateViews(t={}){let e,n=0,i=0,r=vS.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||vS.UPDATE_BATCH_SIZE;let r=!0,s=vS.MIN_PRIORITY,o=0,a=0,l=0,h=0,c=t.checkView||this.options.checkView;"function"!==typeof c&&(c=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 g=Ix.views[n];if(!g){delete d[n];continue}let p=d[n];if(0===(p&vS.FLAG_REMOVE)){const t=n in e.unmounted;if(c&&!Im(c,this.graph,{view:g,unmounted:t})){t||(this.registerUnmountedView(g),g.unmount()),e.unmounted[n]|=p,delete d[n],a+=1;continue}t&&(p|=vS.FLAG_INSERT,o+=1),p|=this.registerMountedView(g)}const f=g;let m=this.updateView(g,p,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|=vS.FLAG_REMOVE),f.hasAction(m,"target")&&!this.isEdgeTerminalVisible(t,"target")&&(m=f.removeAction(m,"target"),m|=vS.FLAG_REMOVE))}m>0&&(d[n]=m,!this.graph.hook.onViewPostponed(f,m,t)||d[n])?(h+=1,r=!1):(s>u&&(s=u),l+=1,delete d[n])}}return{empty:r,priority:s,mountedCount:o,unmountedCount:a,updatedCount:l,postponedCount:h}}updateViewsAsync(t={},e={processed:0,priority:vS.MIN_PRIORITY}){const n=this.updates,i=n.animationId;if(i){if(Iy(i),0===e.processed){const e=t.before;"function"===typeof e&&Im(e,this.graph,this.graph)}const r=this.updateViewsBatch(t),s=this.checkViewImpl({checkView:t.checkView,mountedBatchSize:vS.MOUNT_BATCH_SIZE-r.mountedCount,unmountedBatchSize:vS.MOUNT_BATCH_SIZE-r.unmountedCount});let o=e.processed;const a=n.count,l=s.mountedCount,h=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+=h,this.graph.trigger("render:done",{stats:r,options:t}),e.processed=0,n.count=0):e.processed=o);const c=t.progress;if(a&&"function"===typeof c&&Im(c,this.graph,{total:a,done:r.empty,current:o}),n.animationId!==i)return}n.animationId=$y((()=>{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]|=vS.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=>tE.views[t]))}getUnmountedViews(){return Object.keys(this.updates.unmounted).map((t=>tE.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=tE.views[e];if(null==i)continue;const o=Im(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=tE.views[e];if(null==i)continue;if(t&&!Im(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&&Iy(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&&Im(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&&Im(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=vS.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=pA.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&&dv(t.container,{target:this.view.stage}).containsPoint(e)))}findEdgeViewsInArea(t,e={}){const n=Zy.create(t);return this.model.getEdges().map((t=>this.findViewByCell(t))).filter((t=>{if(t){const i=dv(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=Zy.create(t);return this.model.getNodes().map((t=>this.findViewByCell(t))).filter((t=>{if(t){const i=dv(t.container,{target:this.view.stage});return e.strict?n.containsRect(i):n.isIntersectWithRect(i)}return!1}))}dispose(){this.resetUpdates(),this.stopListening()}}bS([JA.dispose()],vS.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"]}(vS||(vS={}));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 wS extends JA{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=Zy.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=zw.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=_u(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=_u(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()}}CS([JA.dispose()],wS.prototype,"dispose",null);var xS,ES=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},MS=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 AS extends Ix{constructor(t){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=xS.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(xS.containerClass)).css({width:n,height:i}),this.options.pageVisible&&this.$container.addClass(this.prefixClassName(xS.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(xS.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(xS.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 AS.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&&vS.UPDATE_DELAYING_BATCHES.includes(t.name)&&this.update()}delegateBackgroundEvents(t){const e=t||QA.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(){(I.IS_IE||I.IS_EDGE)&&this.$container.css("visibility","hidden")}afterManipulation(){(I.IS_IE||I.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&&(Jm(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=Im(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=Zy.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,h=a+this.graph.options.height;let c;if(this.storeClientSize(),"number"===typeof t||"number"===typeof e){c=n;const i=this.getVisibleArea().getCenter();"number"===typeof t?t*=r:t=i.x,"number"===typeof e?e*=s:e=i.y}else c=t,t=(o+l)/2,e=(a+h)/2;if(c&&c.padding)return this.positionPoint({x:t,y:e},"50%","50%",c);const u=this.getPadding(),d=this.getClientSize(),g=d.width/2,p=d.height/2,f=g-u.left-t+o,m=g-u.right+t-l,y=p-u.top-e+a,b=p-u.bottom+e-h;this.addPadding(Math.max(f,0),Math.max(m,0),Math.max(y,0),Math.max(b,0));const v=this.scrollToPoint(t,e,c||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=Zy.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=MS(i,["padding"]),o=Sm(r),a=Zy.fromSize(this.getClientSize()),l=a.clone().moveAndExpand({x:o.left,y:o.top,width:-o.right-o.left,height:-o.top-o.bottom});e=Mm(e,Math.max(0,l.width)),e<0&&(e=l.width+e),n=Mm(n,Math.max(0,l.height)),n<0&&(n=l.height+n);const h=l.getTopLeft().translate(e,n),c=a.getCenter().diff(h),u=this.zoom(),d=c.scale(1/u,1/u),g=Jy.create(t).translate(d);return this.centerPoint(g.x,g.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=Zy.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 Jy(t,e),h=this.clientToLocalPoint(a.width/2,a.height/2);if(s===o){const t=h.diff(l).scale(s,s).round();i=`translate(${t.x}px,${t.y}px)`}else{const t=o/(s-o)*l.distance(h),e=h.clone().move(l,t),n=this.localToBackgroundPoint(e).round();i=`scale(${o/s})`,r=`${n.x}px ${n.y}px`}const c=n.onTransitionEnd;return this.$container.addClass(xS.transitionClassName),this.$content.off(xS.transitionEventName).on(xS.transitionEventName,(n=>{this.syncTransition(o,{x:t,y:e}),"function"===typeof c&&Im(c,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(xS.transitionClassName),this.$content.off(xS.transitionEventName).css({transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(t,e={}){const n=Zy.create(t),i=e.maxScale||1/0,r=e.minScale||Number.MIN_VALUE,s=e.scaleGrid||null,o=e.visibility||1,a=e.center?Jy.create(e.center):n.getCenter(),l=this.getClientSize(),h=l.width*o,c=l.height*o;let u=new Zy(a.x-h/2,a.y-c/2,h,c).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 Jy(n/r.a,i/r.d)}localToBackgroundPoint(t,e){const n="object"===typeof t?Jy.create(t):new Jy(t,e),i=this.graph.matrix(),r=this.padding;return av(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 Sm("function"===typeof t?Im(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=hv(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 SS(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))}}ES([Ix.dispose()],AS.prototype,"dispose",null),function(t){class e extends wS{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}(AS||(AS={})),function(t){function e(e){const n=Wh({},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}(xS||(xS={}));var kS,OS,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 DS extends Ix{constructor(t){super(),this.options=Wh({},kS.defaultOptions,t),this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new LA([],{comparator:kS.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(kS.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(kS.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=>Im(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 Zy(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(kS.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=pA.getCellsBBox(s,{deep:!0})||Zy.create(),a=r.x-o.x,l=r.y-o.y,h=r.x+r.width-(o.x+o.width),c=r.y+r.height-(o.y+o.height);if(n<a&&(n=a),i<l&&(i=l),h<n&&(n=h),c<i&&(i=c),!this.options.following){const r=t.x-e.originX,s=t.y-e.originY;n=r<=a||r>=h?0:n,i=s<=l||s>=c?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(kS.classNames.rubberband)).removeClass(this.prefixClassName(kS.classNames.selected))}showRubberband(){this.$container.addClass(this.prefixClassName(kS.classNames.rubberband))}hideRubberband(){this.$container.removeClass(this.prefixClassName(kS.classNames.rubberband))}showSelected(){this.$container.removeAttr("style").addClass(this.prefixClassName(kS.classNames.selected))}createContainer(){this.container=document.createElement("div"),this.$container=this.$(this.container),this.$container.addClass(this.prefixClassName(kS.classNames.root)),this.options.className&&this.$container.addClass(this.options.className),this.$selectionContainer=this.$("<div/>").addClass(this.prefixClassName(kS.classNames.inner)),this.$selectionContent=this.$("<div/>").addClass(this.prefixClassName(kS.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=Im(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=pA.getCellsBBox(e).getCenter(),i=this.graph.snapToGrid(t.clientX,t.clientY),r=e.reduce(((t,e)=>(t[e.id]=_y.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?Im(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=Rw.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=>{SS("node:rotated",t,this.graph.findViewByCell(e))})))}startResize({e:t}){const e=this.graph.getGridSize(),n=this.collection.toArray(),i=pA.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=>{SS("node:resized",t,this.graph.findViewByCell(e))})))}dispose(){this.clean(),this.remove()}}PS([Ix.dispose()],DS.prototype,"dispose",null),id(DS,sS),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 Pp('<%= 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}(kS||(kS={}));class TS extends hS{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({},OS.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=OS.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(OS.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=_y.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(OS.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const t=_y.normalize(this.node.getAngle()),e=Math.floor(t*(OS.DIRECTIONS.length/360));if(e!==this.prevShift){const t=OS.DIRECTIONS.slice(e).concat(OS.DIRECTIONS.slice(0,e)),n=t=>`${this.containerClassName}-cursor-${t}`;this.$container.find(`.${this.resizeClassName}`).removeClass(OS.DIRECTIONS.map((t=>n(t))).join(" ")).each(((e,i)=>{this.$(i).addClass(n(t[e]))})),this.prevShift=e}}getTrueDirection(t){const e=_y.normalize(this.node.getAngle());let n=OS.POSITIONS.indexOf(t);return n+=Math.floor(e*(OS.POSITIONS.length/360)),n%=OS.POSITIONS.length,OS.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),SS("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=_y.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:_y.normalize(this.node.getAngle()),start:Jy.create(r).theta(n)}),this.startAction(t),SS("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=xm(r,n.left+e,n.right-e),s=xm(s,n.top+e,n.bottom-e)}else this.options.autoScrollOnResizing&&o&&o.autoScroll(r,s);const l=this.graph.snapToGrid(r,s),h=this.graph.getGridSize(),c=this.node,u=this.options;if("resizing"===n.action){n=n,n.resized||(e&&(e.addClass("node-resizing"),SS("node:resize",t,e)),n.resized=!0);const i=c.getBBox(),r=Jy.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=Rw.snapToGrid(s,h),o=Rw.snapToGrid(o,h),s=Math.max(s,u.minWidth||h),o=Math.max(o,u.minHeight||h),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 g=n.relativeDirection;if(u.allowReverse&&(a<=-s||d<=-o)){let e;"left"===g?a<=-s&&(e="right"):"right"===g?a<=-s&&(e="left"):"top"===g?d<=-o&&(e="bottom"):"bottom"===g?d<=-o&&(e="top"):"top-left"===g?a<=-s&&d<=-o?e="bottom-right":a<=-s?e="top-right":d<=-o&&(e="bottom-left"):"top-right"===g?a<=-s&&d<=-o?e="bottom-left":a<=-s?e="top-left":d<=-o&&(e="bottom-right"):"bottom-left"===g?a<=-s&&d<=-o?e="top-right":a<=-s?e="bottom-right":d<=-o&&(e="top-left"):"bottom-right"===g&&(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};c.resize(s,o,i),SS("node:resizing",t,e)}SS("node:resize:mousemove",t,e)}else if("rotating"===n.action){n=n,n.rotated||(e&&(e.addClass("node-rotating"),SS("node:rotate",t,e)),n.rotated=!0);const i=c.getAngle(),r=n.start-Jy.create(l).theta(n.center);let s=n.angle+r;u.rotateGrid&&(s=Rw.snapToGrid(s,u.rotateGrid)),i!==s&&(c.rotate(s,{absolute:!0}),SS("node:rotating",t,e)),SS("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?SS("node:resize:mouseup",t,e):"rotating"===n.action&&SS("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=OS.DIRECTIONS[OS.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=OS.DIRECTIONS[OS.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(OS.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?SS("node:resized",t,e):"rotating"===n.action&&n.rotated&&SS("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}})(OS||(OS={}));var NS,jS=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})(NS||(NS={})),function(t){function e(e){const{grid:n,panning:i,selecting:r,embedding:s,snapline:o,resizing:a,rotating:l,knob:h,clipboard:c,history:u,scroller:d,minimap:g,keyboard:p,mousewheel:f}=e,m=jS(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=Wh({},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 C=["panning","selecting","embedding","snapline","resizing","rotating","knob","clipboard","history","scroller","minimap","keyboard","mousewheel"];return C.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}(NS||(NS={})),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:Rw.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:Rw.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 WA}},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}}(NS||(NS={}));var LS=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 FS extends JA{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}-${gm(JSON.stringify(t))}`),!this.isDefined(e)){const i=Tw.registry.get(n);if(null==i)return Tw.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});xb.create(Yx.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}-${gm(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);xb.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=LS(t,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let h=e;if(h||(h=`marker-${this.cid}-${gm(JSON.stringify(t))}`),!this.isDefined(h)){"path"!==o&&delete l.d;const t=xb.create("marker",{refX:n,refY:i,id:h,overflow:"visible",orient:null!=s?s:"auto",markerUnits:r||"userSpaceOnUse"},a?a.map((t=>{var{tagName:e}=t,n=LS(t,["tagName"]);return xb.create(`${e}`||"path",Py(Object.assign(Object.assign({},l),n)))})):[xb.create(o||"path",Py(l))]);this.defs.appendChild(t.node)}return h}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},BS=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 JA{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:h,markup:c}=t,u=BS(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,xb.create("pattern",{id:o,patternUnits:"userSpaceOnUse"},xb.createVectors(c)).node);const g=i.get(o);"function"===typeof h&&h(g.childNodes[0],d);let p=d.ox%d.width;p<0&&(p+=d.width);let f=d.oy%d.height;f<0&&(f+=d.height),ky(g,{x:p,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 yw),this.instance}resolveGrid(t){if(!t)return[];const e=t.type;if(null==e)return[Object.assign(Object.assign({},yw.presets.dot),t.args)];const n=yw.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 yw.registry.onNotFound(e)}dispose(){this.stopListening(),this.clear()}}zS([JA.dispose()],RS.prototype,"dispose",null);class $S extends JA{getClientMatrix(){return Zb(this.view.stage.getScreenCTM())}getClientOffset(){const t=this.view.svg.getBoundingClientRect();return new Jy(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=Jy.create(t,e);return av(n,this.graph.matrix())}localToClientPoint(t,e){const n=Jy.create(t,e);return av(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=Zy.create(t,e,n,i);return hv(r,this.graph.matrix())}localToClientRect(t,e,n,i){const r=Zy.create(t,e,n,i);return hv(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=Jy.create(t,e);return av(n,this.graph.matrix().inverse())}clientToLocalPoint(t,e){const n=Jy.create(t,e);return av(n,this.getClientMatrix().inverse())}clientToGraphPoint(t,e){const n=Jy.create(t,e);return av(n,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(t,e){const n=Jy.create(t,e),i=n.diff(this.getPageOffset());return this.graphToLocalPoint(i)}graphToLocalRect(t,e,n,i){const r=Zy.create(t,e,n,i);return hv(r,this.graph.matrix().inverse())}clientToLocalRect(t,e,n,i){const r=Zy.create(t,e,n,i);return hv(r,this.getClientMatrix().inverse())}clientToGraphRect(t,e,n,i){const r=Zy.create(t,e,n,i);return hv(r,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(t,e,n,i){const r=Zy.create(t,e,n,i),s=this.getPageOffset();return r.x-=s.x,r.y-=s.y,this.graphToLocalRect(r)}}var IS,VS=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 _S extends JA{constructor(){super(...arguments),this.widget=this.graph.hook.createSnapline()}dispose(){this.widget.dispose()}}VS([JA.dispose()],_S.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(),h=(t,e)=>t.length===e.length&&(0===t.length||t.every(((t,n)=>t===e[n])));return h(s,o)&&h(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}(IS||(IS={}));var GS=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 JA{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&&IS.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?(Jm(e,n),e.dataset.panning=(!!t).toString()):Zm(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()}}GS([JA.dispose()],HS.prototype,"dispose",null);var US=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},WS=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 JA{get commonOptions(){const t=this.instanceOptions,{enabled:e}=t,n=WS(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)}}US([JA.dispose()],qS.prototype,"dispose",null);var 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};class YS extends JA{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=Ww.registry.get(r);return null==s?Ww.registry.onNotFound(r):(Ww.check(r,s),{name:r,highlighter:s,args:i.args||{}})}getHighlighterId(t,e){return ey(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()}}XS([YS.dispose()],YS.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 ZS extends JA{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),Zb(this.viewportMatrix)}setMatrix(t){const e=Zb(t),n=tv(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 Cm(t)||(t=this.container.clientWidth),Cm(e)||(e=this.container.clientHeight),{width:t,height:e}}getScale(){return rv(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 xm(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 sv(this.getMatrix())}rotate(t,e,n){if(null==e||null==n){const t=dv(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 ov(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=Sm(n),s=i.border||0,o=i.contentArea?Zy.create(i.contentArea):this.getContentArea(i);s>0&&o.inflate(s);const a=this.getScale(),l=this.getTranslation(),h=a.sx,c=a.sy;o.x*=h,o.y*=c,o.width*=h,o.height*=c;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,g=0,p=0;("negative"===i.allowNewOrigin&&o.x<0||"positive"===i.allowNewOrigin&&o.x>=0||"any"===i.allowNewOrigin)&&(g=Math.ceil(-o.x/t)*t,g+=r.left,u+=g),("negative"===i.allowNewOrigin&&o.y<0||"positive"===i.allowNewOrigin&&o.y>=0||"any"===i.allowNewOrigin)&&(p=Math.ceil(-o.y/e)*e,p+=r.top,d+=p),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=g!==l.tx||p!==l.ty;return y&&this.translate(g,p),m&&this.resize(u,d),new Zy(-g/h,-p/c,u/h,d/c)}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=Jy.create(e)}else n=this.getContentBBox(t),i=this.graph.graphToLocal(n);if(!n.width||!n.height)return;const r=Sm(t.padding),s=t.minScale||0,o=t.maxScale||Number.MAX_SAFE_INTEGER,a=t.minScaleX||s,l=t.maxScaleX||o,h=t.minScaleY||s,c=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=Zy.create(u).moveAndExpand({x:r.left,y:r.top,width:-r.left-r.right,height:-r.top-r.bottom});const d=this.getScale();let g=u.width/n.width*d.sx,p=u.height/n.height*d.sy;!1!==t.preserveAspectRatio&&(g=p=Math.min(g,p));const f=t.scaleGrid;if(f&&(g=f*Math.floor(g/f),p=f*Math.floor(p/f)),g=xm(g,a,l),p=xm(p,h,c),this.scale(g,p),e){const t=this.options,e=u.x-i.x*g-t.x,n=u.y-i.y*p-t.y;this.translate(e,n)}}getContentArea(t={}){return t.useCellGeometry?this.model.getAllCellsBBox()||new Zy:dv(this.graph.view.stage)}getContentBBox(t={}){return this.graph.localToGraph(this.getContentArea(t))}getGraphArea(){const t=Zy.fromSize(this.getComputedSize());return this.graph.graphToLocal(t)}zoomToRect(t,e={}){const n=Zy.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=Mm(e,Math.max(0,i.width)),e<0&&(e=i.width+e),n=Mm(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=Zy.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()}}JS([ZS.dispose()],ZS.prototype,"dispose",null);var KS=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 QS extends JA{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&&IS.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()}}KS([JA.dispose()],QS.prototype,"dispose",null);var tk,ek=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},nk=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 ik extends Dx{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=tk.getOptions(t),this.validator=new ik.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)?tk.sortBatchCommands(t):[t];for(let i=n.length-1;i>=0;i-=1){const t=n[i],r=Object.assign(Object.assign({},e),Xl(t.options,this.options.revertOptionsList||[]));this.executeCommand(t,!0,r)}this.freezed=!1}applyCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?tk.sortBatchCommands(t):[t];for(let i=0;i<n.length;i+=1){const t=n[i],r=Object.assign(Object.assign({},e),Xl(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(tk.isAddEvent(s)&&e||tk.isRemoveEvent(s)&&!e)r.remove(n);else if(tk.isAddEvent(s)&&!e||tk.isRemoveEvent(s)&&e){const e=t.data;e.node?i.addNode(e.props,n):e.edge&&i.addEdge(e.props,n)}else if(tk.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&&Im(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(tk.isAddEvent(t)&&this.options.ignoreAdd||tk.isRemoveEvent(t)&&this.options.ignoreRemove||tk.isChangeEvent(t)&&this.options.ignoreChange)return;const r=this.options.beforeAddCommand;if(null!=r&&!1===Im(r,this,t,e))return;"cell:change:*"===t&&(t=`cell:change:${n.key}`);const s=n.cell,o=FA.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||tk.isAddEvent(t)||tk.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(tk.isAddEvent(t)||tk.isRemoveEvent(t)){const e=a.data;return a.event=t,a.options=i,e.id=s.id,e.props=Wu(s.toJSON()),s.isEdge()?e.edge=!0:s.isNode()&&(e.node=!0),this.push(a,i)}if(tk.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]=_u(s.previous(n)),o?a.modelChange=!0:r.id=s.id),null==r.next&&(r.next={}),r.next[n]=_u(s.prop(n)),this.push(a,i)}const l=this.options.afterAddCommand;l&&Im(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(tk.isAddEvent(i)){const t=e.findIndex((t=>tk.isRemoveEvent(t.event)&&t.data.id===r));if(t>=0){e=e.filter(((e,n)=>t<n||e.data.id!==r));continue}}else if(tk.isRemoveEvent(i)){const t=e.findIndex((t=>tk.isAddEvent(t.event)&&t.data.id===r));if(t>=0){e.splice(t,1);continue}}else if(tk.isChangeEvent(i)){const e=t.data;if(Xh(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))}}ek([Dx.dispose()],ik.prototype,"dispose",null),function(t){class e extends Dx{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)}}ek([Dx.dispose()],e.prototype,"dispose",null),t.Validator=e}(ik||(ik={})),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=nk(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}(tk||(tk={}));var rk=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 sk extends JA{get widgetOptions(){return this.options.minimap}init(){this.widget=this.graph.hook.createMiniMap()}dispose(){this.widget&&this.widget.dispose()}}rk([JA.dispose()],sk.prototype,"dispose",null);var ok=n(2441),ak=n.n(ok),lk=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 hk extends Ox{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=hk.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?Im(n,this.graph,e):e}isGraphEvent(t){const e=t.srcElement||t.target;return!!e&&(e===this.target||e===document.body||fy(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 Im(this.options.guard,this.graph,t)}return e}dispose(){this.mousetrap.reset()}}lk([Ox.dispose()],hk.prototype,"dispose",null),function(t){function e(t){const e=new(ak())(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}(hk||(hk={}));var ck=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 uk extends Ox{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 kv(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))&&IS.isMatch(e,this.options.modifiers)}onMouseWheel(t){const e=t.originalEvent||t,n=this.options.guard;if((null==n||n.call(this.graph,e))&&IS.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=xm(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()}}ck([Ox.dispose()],uk.prototype,"dispose",null);var dk=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 gk extends JA{show(t={}){const e=Object.assign(Object.assign({},gk.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=R()(document.body),i=R()(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),R()(`#${this.styleSheetId}`).remove(),this.graph.trigger("after:print",e),R()(window).off("afterprint",a))};R()(window).one("afterprint",a),setTimeout(a,200),window.print()}}createPrintPage(t,e){this.graph.trigger("before:print",e);const n=R()("<div/>").addClass(this.className),i=R()("<div/>").addClass(this.view.prefixClassName("graph-print-inner")).css("position","relative");e.size&&n.addClass(`${this.className}-size-${e.size}`);const r=xb.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(),h=this.graph.translate(),c=Zb().translate(h.tx/l.sx,h.ty/l.sy),u=this.getPageInfo(a,t,o),d=u.scale,g=u.bbox;return i.css({left:0,top:0}),r.attr({width:g.width*d,height:g.height*d,style:"position:relative",viewBox:[g.x,g.y,g.width,g.height].join(" ")}),s.attr("transform",tv(c)),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=Sm(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=R()(`#${a}`);l.length?l.html(o):R()("head").append(`'<style type="text/css" id="${a}">${o}</style>'`)}getPrintArea(t){let e=t.area;if(!e){const n=Sm(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 Zy(t.x+e,t.y+s,i,r));return n}getSheetSize(t){const e=t.sheet,n=Sm(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=Ry.measure(s,o);return{cssWidth:s,cssHeight:o,width:a.width,height:a.height}}getPageInfo(t,e,n){const i=new Zy(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(){}}dk([JA.dispose()],gk.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)}}(gk||(gk={}));class pk extends JA{toSVG(t,e={}){this.graph.trigger("before:export",e);const n=this.view.svg,i=xb.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)=>{R()(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(xb.create("style",{type:"text/css"},[t]))}const h=()=>{const n=e.beforeSerialize;if("function"===typeof n){const t=Im(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");Fy.imageToDataUri(n,((n,i)=>{!n&&i&&t.attr("xlink:href",i),e()}))}))));Promise.all(t).then(h)}else h()}toDataURL(t,e){let n=e.viewBox||this.graph.getContentBBox();const i=Sm(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 Zy(-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=Zy.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 fk extends JA{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 mk=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 yk extends JA{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 kv(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&&IS.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?(Jm(t,e),Zm(t,n)):(Zm(t,e),Jm(t,n)):(Zm(t,e),Zm(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()}}mk([JA.dispose()],yk.prototype,"dispose",null);var bk=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 vk extends JA{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;Nv.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(){Nv.clear(this.getContainer())}}bk([JA.dispose()],vk.prototype,"dispose",null);var Ck,wk=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},xk=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=Im(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=Im(n,this.graph,...t)&&e),e}}}t.hook=e,t.after=n})(Ck||(Ck={}));class Ek extends JA{createModel(){if(this.options.model)return this.options.model;const t=new FA;return t.graph=this.graph,t}createView(){return new QA(this.graph)}createRenderer(){return new vS(this.graph)}createDefsManager(){return new FS(this.graph)}createGridManager(){return new RS(this.graph)}createCoordManager(){return new $S(this.graph)}createKnobManager(){return new fk(this.graph)}createTransform(t,e){const n=this.getTransformOptions(t);return n.resizable||n.rotatable?new TS(Object.assign(Object.assign({node:t,graph:this.graph},n),e)):(n.clearAll&&TS.removeInstances(this.graph),null)}createKnob(t,e){const n=NS.parseOptionGroup(this.graph,t,this.options.knob),i=Object.assign(Object.assign({},n),e);i.clearAll&&cS.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 cS(Object.assign({node:t,index:r,graph:this.graph},i))))})),s}getTransformOptions(t){const e=NS.parseOptionGroup(this.graph,t,this.options.resizing),n=NS.parseOptionGroup(this.graph,t,this.options.rotating),i=NS.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 ZS(this.graph)}createHighlightManager(){return new YS(this.graph)}createBackgroundManager(){return new wS(this.graph)}createClipboard(){return new Ok}createClipboardManager(){return new qS(this.graph)}createSnapline(){return new yS(Object.assign({graph:this.graph},this.options.snapline))}createSnaplineManager(){return new _S(this.graph)}createSelection(){return new DS(Object.assign({graph:this.graph},this.options.selecting))}createSelectionManager(){return new QS(this.graph)}allowRubberband(t){return!0}createHistoryManager(){return new ik(Object.assign({graph:this.graph},this.options.history))}createScroller(){return this.options.scroller.enabled?new AS(Object.assign({graph:this.graph},this.options.scroller)):null}createScrollerManager(){return new HS(this.graph)}allowPanning(t){return!0}createMiniMap(){const t=this.options.minimap,{enabled:e}=t,n=xk(t,["enabled"]);return e?new pS(Object.assign({graph:this.graph},n)):null}createMiniMapManager(){return new sk(this.graph)}createKeyboard(){return new hk(Object.assign({graph:this.graph},this.options.keyboard))}createMouseWheel(){return new uk(Object.assign({graph:this.graph},this.options.mousewheel))}createPrintManager(){return new gk(this.graph)}createFormatManager(){return new pk(this.graph)}createPanningManager(){return new yk(this.graph)}createSizeManager(){return new vk(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 Im(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||Im(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||Im(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=Im(i,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),null==n&&(n=new WA),n}validateConnection(t,e,n,i,r,s,o){const a=this.options.connecting,l=a.allowLoop,h=a.allowNode,c=a.allowEdge,u=a.allowPort,d=null!=a.allowMulti?a.allowMulti:a.multi,g=a.validateConnection,p=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:p?p.getSourcePortId():null,h="target"===r?o?o.port:null:p?p.getTargetPortId():null;return Im(a,this.graph,{edge:p,edgeView:s,sourceView:t,targetView:n,sourcePort:l,targetPort:h,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!=c&&("boolean"===typeof c?!c&&DA.isEdgeView(f)&&(y=!1):y=b(c)),y&&null!=h&&("boolean"===typeof h?h||null==f||TA.isNodeView(f)&&null==m&&(y=!1):y=b(h)),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!=g&&(y=b(g)),y}getRestrictArea(t){const e=this.options.translating.restrict,n="function"===typeof e?Im(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&vS.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=tE.registry.get(i);return n?new n(t,e):tE.registry.onNotFound(i)}return t.isNode()?new TA(t,e):t.isEdge()?new DA(t,e):null}getHTMLComponent(t){let e=t.getHTML();return"string"===typeof e&&(e=qA.componentRegistry.get(e)||e),Nh(e)&&(e=e.render),"function"===typeof e?Im(e,this.graph,t):e}shouldUpdateHTMLComponent(t){let e=t.getHTML();if("string"===typeof e&&(e=qA.componentRegistry.get(e)||e),Nh(e)){const n=e.shouldComponentUpdate;return"function"===typeof n?Im(n,this.graph,t):!!n}return!1}onEdgeLabelRendered(t){}onPortRendered(t){}onToolItemCreated(t){}}wk([Ck.hook()],Ek.prototype,"createModel",null),wk([Ck.hook()],Ek.prototype,"createView",null),wk([Ck.hook()],Ek.prototype,"createRenderer",null),wk([Ck.hook()],Ek.prototype,"createDefsManager",null),wk([Ck.hook()],Ek.prototype,"createGridManager",null),wk([Ck.hook()],Ek.prototype,"createCoordManager",null),wk([Ck.hook()],Ek.prototype,"createKnobManager",null),wk([Ck.hook()],Ek.prototype,"createTransform",null),wk([Ck.hook()],Ek.prototype,"createKnob",null),wk([Ck.hook()],Ek.prototype,"createTransformManager",null),wk([Ck.hook()],Ek.prototype,"createHighlightManager",null),wk([Ck.hook()],Ek.prototype,"createBackgroundManager",null),wk([Ck.hook()],Ek.prototype,"createClipboard",null),wk([Ck.hook()],Ek.prototype,"createClipboardManager",null),wk([Ck.hook()],Ek.prototype,"createSnapline",null),wk([Ck.hook()],Ek.prototype,"createSnaplineManager",null),wk([Ck.hook()],Ek.prototype,"createSelection",null),wk([Ck.hook()],Ek.prototype,"createSelectionManager",null),wk([Ck.hook()],Ek.prototype,"allowRubberband",null),wk([Ck.hook()],Ek.prototype,"createHistoryManager",null),wk([Ck.hook()],Ek.prototype,"createScroller",null),wk([Ck.hook()],Ek.prototype,"createScrollerManager",null),wk([Ck.hook()],Ek.prototype,"allowPanning",null),wk([Ck.hook()],Ek.prototype,"createMiniMap",null),wk([Ck.hook()],Ek.prototype,"createMiniMapManager",null),wk([Ck.hook()],Ek.prototype,"createKeyboard",null),wk([Ck.hook()],Ek.prototype,"createMouseWheel",null),wk([Ck.hook()],Ek.prototype,"createPrintManager",null),wk([Ck.hook()],Ek.prototype,"createFormatManager",null),wk([Ck.hook()],Ek.prototype,"createPanningManager",null),wk([Ck.hook()],Ek.prototype,"createSizeManager",null),wk([Ck.after()],Ek.prototype,"onViewUpdated",null),wk([Ck.after()],Ek.prototype,"onViewPostponed",null),wk([Ck.hook()],Ek.prototype,"getCellView",null),wk([Ck.hook(!0)],Ek.prototype,"createCellView",null),wk([Ck.hook()],Ek.prototype,"getHTMLComponent",null),wk([Ck.hook()],Ek.prototype,"shouldUpdateHTMLComponent",null),wk([Ck.hook()],Ek.prototype,"onEdgeLabelRendered",null),wk([Ck.hook()],Ek.prototype,"onPortRendered",null),wk([Ck.hook()],Ek.prototype,"onToolItemCreated",null);var Mk,Ak,Sk=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 kk extends Dx{constructor(t){super(),this.options=NS.get(t),this.css=new nS(this),this.hook=new Ek(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 kk.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=>yA.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=>OA.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 pA.isCell(t)?this.findViewByCell(t):this.findViewByElem(t)}findViews(t){return Zy.isRectangleLike(t)?this.findViewsInArea(t):Jy.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 Zy.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 Zy.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 Zy.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 Zy.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 Zy.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 Zy.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 Zy.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()}}Sk([ZA.checkScroller()],kk.prototype,"lockScroller",null),Sk([ZA.checkScroller()],kk.prototype,"unlockScroller",null),Sk([ZA.checkScroller()],kk.prototype,"updateScroller",null),Sk([ZA.checkScroller()],kk.prototype,"getScrollbarPosition",null),Sk([ZA.checkScroller()],kk.prototype,"setScrollbarPosition",null),Sk([ZA.checkScroller()],kk.prototype,"scrollToPoint",null),Sk([ZA.checkScroller()],kk.prototype,"scrollToContent",null),Sk([ZA.checkScroller()],kk.prototype,"scrollToCell",null),Sk([ZA.checkScroller()],kk.prototype,"transitionToPoint",null),Sk([ZA.checkScroller()],kk.prototype,"transitionToRect",null),Sk([Dx.dispose()],kk.prototype,"dispose",null),function(t){t.View=QA,t.Hook=Ek,t.Renderer=vS,t.Keyboard=hk,t.MouseWheel=uk,t.BaseManager=JA,t.DefsManager=FS,t.GridManager=RS,t.CoordManager=$S,t.PrintManager=gk,t.FormatManager=pk,t.MiniMapManager=sk,t.HistoryManager=ik,t.SnaplineManager=_S,t.ScrollerManager=HS,t.ClipboardManager=qS,t.TransformManager=ZS,t.HighlightManager=YS,t.BackgroundManager=wS,t.SelectionManager=QS}(kk||(kk={})),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}(kk||(kk={})),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}(kk||(kk={})),function(t){t.registerNode=yA.registry.register,t.registerEdge=OA.registry.register,t.registerView=tE.registry.register,t.registerAttr=dw.registry.register,t.registerGrid=yw.registry.register,t.registerFilter=Tw.registry.register,t.registerNodeTool=yE.registry.register,t.registerEdgeTool=bE.registry.register,t.registerBackground=zw.registry.register,t.registerHighlighter=Ww.registry.register,t.registerPortLayout=ox.registry.register,t.registerPortLabelLayout=Mx.registry.register,t.registerMarker=YC.registry.register,t.registerRouter=GM.registry.register,t.registerConnector=aA.registry.register,t.registerAnchor=BE.registry.register,t.registerEdgeAnchor=HE.registry.register,t.registerConnectionPoint=QE.registry.register,t.registerConnectionStrategy=Xx.registry.register,t.registerHTMLComponent=qA.componentRegistry.register}(kk||(kk={})),function(t){t.unregisterNode=yA.registry.unregister,t.unregisterEdge=OA.registry.unregister,t.unregisterView=tE.registry.unregister,t.unregisterAttr=dw.registry.unregister,t.unregisterGrid=yw.registry.unregister,t.unregisterFilter=Tw.registry.unregister,t.unregisterNodeTool=yE.registry.unregister,t.unregisterEdgeTool=bE.registry.unregister,t.unregisterBackground=zw.registry.unregister,t.unregisterHighlighter=Ww.registry.unregister,t.unregisterPortLayout=ox.registry.unregister,t.unregisterPortLabelLayout=Mx.registry.unregister,t.unregisterMarker=YC.registry.unregister,t.unregisterRouter=GM.registry.unregister,t.unregisterConnector=aA.registry.unregister,t.unregisterAnchor=BE.registry.unregister,t.unregisterEdgeAnchor=HE.registry.unregister,t.unregisterConnectionPoint=QE.registry.unregister,t.unregisterConnectionStrategy=Xx.registry.unregister,t.unregisterHTMLComponent=qA.componentRegistry.unregister}(kk||(kk={}));class Ok{constructor(){this.cells=[]}copy(t,e,n={}){this.options=Object.assign({},n);const i=FA.isModel(e)?e:e.model,r=i.cloneSubGraph(t,n);this.cells=hl(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=kk.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 h=kk.isGraph(t)?t.model:t;return h.batchUpdate("paste",(()=>{h.addCells(this.cells)})),this.copy(l,t,e),l}serialize(t){!1!==t.useLocalStorage&&Mk.save(this.cells)}deserialize(t){if(t.useLocalStorage){const t=Mk.fetch();t&&(this.cells=t)}}isEmpty(){return this.cells.length<=0}clean(){this.options={},this.cells=[],Mk.clean()}}(function(t){const e=`${Bw.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 FA.fromJSON(n)}}function r(){window.localStorage&&localStorage.removeItem(e)}t.save=n,t.fetch=i,t.clean=r})(Mk||(Mk={}));class Pk{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=Pp("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=Im(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 Zy(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 Jy(o.x+o.width/2,o.y-i),a=i/2;break;case"bottom":r=new Jy(o.x+o.width/2,o.y+o.height+i),a=i/2;break;case"left":r=new Jy(o.x-i,o.y+o.height/2),l=i/2;break;case"right":r=new Jy(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(_y.normalize(this.node.getAngle())/45)],this.view.addClass("node-resizing"),SS("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}),SS("node:resizing",t,this.view)}stopResize({e:t}){this.view.removeClass("node-resizing"),SS("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(!pA.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(!pA.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 Jy(e,n).theta(i)}),r.forEach((e=>{const n=this.graph.findViewByCell(e);n&&(n.addClass("node-rotating"),SS("node:rotate",t,n))}))}doRotate({e:t,x:e,y:n}){const i=this.halo.getEventData(t),r=i.clientStartAngle-new Jy(e,n).theta(i.center);i.nodes.forEach(((e,n)=>{const s=i.rotateStartAngles[n],o=Rw.snapToGrid(s+r,this.options.rotateGrid);e.rotate(o,{absolute:!0,center:i.center,halo:this.halo.cid}),SS("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"),SS("node:rotated",t,n)})),this.halo.stopBatch()}unlink(){this.halo.startBatch(),this.model.removeConnectedEdges(this.cell),this.halo.stopBatch()}}class Dk{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 Tk extends hS{get type(){return this.options.type||"surround"}get handleOptions(){return this.options}init(t){this.options=Wh(Tk.defaultOptions,this.cell.isNode()?new Pk(this).getPresets():this.cell.isEdge()?new Dk(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(Ak.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(Ak.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=Im(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?Im(e,this,t):e;return Zy.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()}})(Tk||(Tk={})),Object.getOwnPropertyNames(sS.prototype).forEach((t=>{"constructor"!==t&&Object.defineProperty(Tk.prototype,t,Object.getOwnPropertyDescriptor(sS.prototype,t))})),function(t){t.NODE_CLS="has-widget-halo"}(Ak||(Ak={}));var Nk,jk,Lk,Fk=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 zk extends Ix{constructor(t){super(),this.options=Object.assign(Object.assign({},zk.defaults),t),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName("widget-dnd")),this.draggingGraph=new kk(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 kk.isGraph(t)?t.scroller.widget:t}get targetGraph(){const t=this.options.target;return kk.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(zk.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}),h=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")};_m(l)?(this.undelegateDocumentEvents(),l.then(h)):h(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 Zy.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(Rw.snapToGrid(r.x,l),Rw.snapToGrid(r.y,l)),o.removeZIndex();const h=this.options.validateNode,c=!h||h(o,{sourceNode:s,draggingNode:t,droppingNode:o,targetGraph:n,draggingGraph:this.draggingGraph});return"boolean"===typeof c?c?(i.addCell(o,{stencil:this.cid}),o):null:Hm(c).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 Bk(t,e={}){const n=FA.isModel(t)?t:(new FA).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,h=!0===e.resizeToFit,c=e.marginX||0,u=e.marginY||0,d=[];let g=e.columnWidth;if("compact"===g)for(let b=0;b<r;b+=1){const t=Nk.getNodesInColumn(i,b,r);d.push(Nk.getMaxDim(t,"width")+o)}else{null!=g&&"auto"!==g||(g=Nk.getMaxDim(i,"width")+o);for(let t=0;t<r;t+=1)d.push(g)}const p=Nk.accumulate(d,c),f=[];let m=e.rowHeight;if("compact"===m)for(let b=0;b<s;b+=1){const t=Nk.getNodesInRow(i,b,r);f.push(Nk.getMaxDim(t,"height")+a)}else{null!=m&&"auto"!==m||(m=Nk.getMaxDim(i,"height")+a);for(let t=0;t<s;t+=1)f.push(m)}const y=Nk.accumulate(f,u);n.startBatch("layout"),i.forEach(((t,n)=>{const i=n%r,s=Math.floor(n/r),c=d[i],u=f[s];let g=0,m=0,b=t.getSize();if(h){let n=c-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&&(g=(c-b.width)/2,m=(u-b.height)/2),t.position(p[i]+o+g,y[s]+a+m,e)})),n.stopBatch("layout")}Fk([Ix.dispose()],zk.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"}}(zk||(zk={})),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}(Nk||(Nk={}));class Rk extends Ix{constructor(t){if(super(),this.graphs={},this.$groups={},this.options=Object.assign(Object.assign({},Rk.defaultOptions),t),this.dnd=new zk(this.options),this.onSearch=jm(this.onSearch,200),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(jk.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(jk.title)).html(this.options.title).appendTo(this.$container),t.search&&this.$container.addClass("searchable").append(this.renderSearch()),this.$content=this.$("<div/>").addClass(this.prefixClassName(jk.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(jk.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(jk.groupTitle)).html(n.title||n.name),s=this.$("<div/>").addClass(this.prefixClassName(jk.groupContent)),o=n.graphOptions,a=new kk(Object.assign(Object.assign(Object.assign({},e),o),{container:document.createElement("div"),model:e.model||new FA,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 kk(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new FA,width:t.stencilGraphWidth,height:t.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.$content.append(n.container),this.graphs[Lk.defaultGroupName]=n}return this.startListening(),this}get targetScroller(){const t=this.options.target;return kk.isGraph(t)?t.scroller.widget:t}get targetGraph(){const t=this.options.target;return kk.isGraph(t)?t:t.graph}get targetModel(){return this.targetGraph.model}renderSearch(){return this.$("<div/>").addClass(this.prefixClassName(jk.search)).append(this.$("<input/>").attr({type:"search",placeholder:this.options.placeholder||"Search"}).addClass(this.prefixClassName(jk.searchText)))}startListening(){const t=this.prefixClassName(jk.title),e=this.prefixClassName(jk.searchText),n=this.prefixClassName(jk.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=>yA.isNode(t)?t:yA.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&&Im(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===Lk.defaultGroupName?null:i,o=r.model.getNodes().filter((n=>{let i=!1;i="function"===typeof e?Im(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,h=new FA;return h.resetCells(o),l.layout&&Im(l.layout,this,h,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(jk.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||Lk.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};Bk(t,Object.assign(Object.assign(Object.assign({},n),this.options.layoutOptions),e?e.layoutOptions:{}))}},zk.defaults)})(Rk||(Rk={})),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`}(jk||(jk={})),function(t){t.defaultGroupName="__default__"}(Lk||(Lk={}));const $k="1.30.1";function Ik(){if(Bw.trackable){const t="https://kcart.alipay.com/web/bi.do",e=new Image,n=Object.assign(Object.assign({},Bw.trackInfo),{version:$k,pg:document.URL,r:(new Date).getTime(),x6:!0,page_type:"syslog"}),i=encodeURIComponent(JSON.stringify([n]));e.src=`${t}?BIProfile=merge&d=${i}`}}Bw.trackable&&setTimeout(Ik,3e3);const Vk={formatColumnType(t){const e=["timestamp","json","bool"];return null==t.decimalDigits||0==t.decimalDigits||e.some((e=>e==t.type.toLowerCase()))?t.type+"("+t.size+")":t.type+"("+t.size+", "+t.decimalDigits+")"},formatColumnName(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 _k={props:{modelData:Array,showComment:{default:!0}},data(){return{graph:null}},watch:{showComment:{deep:!0,handler(){this.graph.clearCells(),this.redendarUml(this.graph)}},modelData:{handler(){this.graph.clearCells(),this.redendarUml(this.graph)}}},mounted(){this.init()},methods:{init(){this.registerNewNode();const t=this.createGraphInstance();this.redendarUml(t)},exportUml(){this.graph.toPNG((t=>{Fy.downloadDataUri(t,"uml.png")}))},redendarUml(t){const e=this.modelData.map((t=>({id:t.id,tableName:t.name,columns:t.columns})));let n=20,i=20,r=20;e.forEach(((e,s)=>{let o=e.tableName.pxWidth(),a=30*e.columns.length+40;r=r>a?r:a,e.columns.forEach((t=>{const e=Vk.formatColumnType(t),n=Vk.formatColumnName(t,this.showComment);let i=80,r=i+n.pxWidth()+e.pxWidth();r>o&&(o=r)}));const l=e.columns.map((t=>{const n=Vk.formatColumnType(t),i=Vk.formatColumnName(t,this.showComment);let r="YES"==t.nullable?"normal":"bold";return{id:e.id+"-"+t.id,group:"columnGroup",attrs:{portBody:{width:o,height:30,refY:11},portNameLabel:{height:30,text:i,fontWeight:r,refY:11},portTypeLabel:{text:n,height:30,refY:11,refX:o-n.pxWidth()-22}}}}));t.addNode({id:e.id,x:n,y:i,shape:"er-rect",width:o,height:40,label:e.tableName,ports:l}),n+=o+60,(s+1)%5==0&&(i+=r+60,n=20)}))},createGraphInstance(){const t=new kk({container:document.getElementById("diagram-container"),grid:!0,panning:!0,keyboard:!0,mousewheel:{enabled:!0,modifiers:["ctrl","meta"]},connecting:{router:{name:"er",args:{padding:1,offset:25,direction:"H"}}}});return t.bindKey(["meta+z","ctrl+z"],(()=>(t.history.canUndo()&&t.history.undo(),!1))),t.bindKey(["meta+shift+z","ctrl+shift+z"],(()=>(t.history.canRedo()&&t.history.redo(),!1))),t.bindKey("backspace",(()=>{const e=t.getSelectedCells();e.length&&t.removeCells(e)})),t.isHistoryEnabled()?t.disableHistory():t.enableHistory(),this.graph=t,t},registerNewNode(){const t=30;kk.registerPortLayout("erPortPosition",(e=>e.map(((e,n)=>({position:{x:0,y:(n+1)*t},angle:0})))),!0),kk.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)}}},Gk=n(3744);const Hk=(0,Gk.Z)(_k,[["render",z]]);var Uk=Hk;const Wk={class:"remark-header"},qk={class:"remark-user"},Xk={class:"remark-time"},Yk={class:"item text remark-content"},Jk=(0,y.Uk)("提交");function Zk(t,e,n,i,r,s){const o=(0,y.up)("el-button"),a=(0,y.up)("el-popconfirm"),l=(0,y.up)("el-card"),h=(0,y.up)("el-col"),c=(0,y.up)("el-row"),u=(0,y.up)("el-empty"),d=(0,y.up)("el-pagination"),g=(0,y.up)("el-divider"),p=(0,y.up)("el-input"),f=(0,y.up)("el-drawer"),m=(0,y.Q2)("require-roles");return(0,y.wg)(),(0,y.j4)(f,{modelValue:r.show,"onUpdate:modelValue":e[1]||(e[1]=t=>r.show=t),size:"50%"},{title:(0,y.w5)((()=>[(0,y._)("h2",null,(0,b.zw)(s.title),1)])),default:(0,y.w5)((()=>[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(r.pageData.content,((t,e)=>((0,y.wg)(),(0,y.j4)(c,{key:e},{default:(0,y.w5)((()=>[(0,y.Wm)(h,null,{default:(0,y.w5)((()=>[(0,y.Wm)(l,{shadow:"never",class:"remark-card"},{header:(0,y.w5)((()=>[(0,y._)("div",Wk,[(0,y._)("span",null,[(0,y._)("span",qk,(0,b.zw)(t.remarkBy.nickname),1),(0,y._)("span",Xk,(0,b.zw)(t.createAt),1)]),(0,y.wy)(((0,y.wg)(),(0,y.iD)("span",null,[(0,y.Wm)(a,{"confirm-button-text":"确定","cancel-button-text":"取消",icon:"InfoFilled","icon-color":"red",title:"确定要删除该记录吗?",onConfirm:e=>s.onDeleteRemark(t.id)},{reference:(0,y.w5)((()=>[(0,y.Wm)(o,{type:"danger",icon:"Delete",circle:"",plain:"",size:"small"})])),_:2},1032,["onConfirm"])])),[[m,["SYS_OWNER","GROUP_OWNER?groupId="+n.groupId,"GROUP_MEMBER?groupId="+n.groupId]]])])])),default:(0,y.w5)((()=>[(0,y._)("div",Yk,(0,b.zw)(t.remark),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128)),0==r.pageData.content.length?((0,y.wg)(),(0,y.j4)(c,{key:0},{default:(0,y.w5)((()=>[(0,y.Wm)(h,null,{default:(0,y.w5)((()=>[(0,y.Wm)(u)])),_:1})])),_:1})):(0,y.kq)("",!0),(0,y.Wm)(c,null,{default:(0,y.w5)((()=>[(0,y.Wm)(h,null,{default:(0,y.w5)((()=>[(0,y.Wm)(d,{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.onRemarkPageChange},null,8,["currentPage","page-size","page-count","onCurrentChange"])])),_:1})])),_:1}),(0,y.Wm)(g),(0,y.wy)(((0,y.wg)(),(0,y.j4)(c,null,{default:(0,y.w5)((()=>[(0,y.Wm)(h,null,{default:(0,y.w5)((()=>[(0,y.Wm)(p,{modelValue:r.formData.remark,"onUpdate:modelValue":e[0]||(e[0]=t=>r.formData.remark=t),rows:5,type:"textarea",placeholder:"请输入内容"},null,8,["modelValue"])])),_:1})])),_:1})),[[m,["SYS_OWNER","GROUP_OWNER?groupId="+this.groupId,"GROUP_MEMBER?groupId="+this.groupId]]]),(0,y.Wm)(g),(0,y.wy)(((0,y.wg)(),(0,y.j4)(c,null,{default:(0,y.w5)((()=>[(0,y.Wm)(h,null,{default:(0,y.w5)((()=>[(0,y.Wm)(o,{onClick:s.onCreateRemark},{default:(0,y.w5)((()=>[Jk])),_:1},8,["onClick"])])),_:1})])),_:1})),[[m,["SYS_OWNER","GROUP_OWNER?groupId="+this.groupId,"GROUP_MEMBER?groupId="+this.groupId]]])])),_:1},8,["modelValue"])}const Kk="/api/v1.0",Qk=(t,e,n)=>S.Z["delete"](Kk+"/groups/"+t+"/projects/"+e+"/remarks/"+n),tO=(t,e,n)=>S.Z.post(Kk+"/groups/"+t+"/projects/"+e+"/remarks",n),eO=(t,e,n)=>S.Z.get(Kk+"/groups/"+t+"/projects/"+e+"/remarks",{params:n});var nO={props:["groupId","projectId","tableName","columnName","isShowDrawer"],emits:["onClose"],data(){return{formData:{remark:null},pageFilter:{page:0,size:5,tableName:null,columnName:null},pageData:{content:[],page:0,size:10,totalPages:0},show:this.isShowDrawer}},computed:{title(){const t=this.columnName?"."+this.columnName:"";return"["+this.tableName+t+"]"}},watch:{isShowDrawer:{deep:!1,handler(t){t&&this.showRemarkDrawer()}},show:{deep:!1,handler(t){t?this.showRemarkDrawer():this.closeRemarkDrawer(t)}}},methods:{onCreateRemark(){if(!this.formData.remark||""==this.formData.remark)return void this.$message.error("内容不能为空");const t={tableName:this.pageFilter.tableName,columnName:this.pageFilter.columnName,remark:this.formData.remark};tO(this.groupId,this.projectId,t).then((t=>{t.errCode||(this.formData.remark=null,this.$message.success("提交成功"),this.onRemarkPageChange(1))}))},onDeleteRemark(t){Qk(this.groupId,this.projectId,t).then((t=>{t.errCode||(this.$message.success("删除成功"),this.onRemarkPageChange(1))}))},onRemarkPageChange(t){this.pageFilter.page=t-1,eO(this.groupId,this.projectId,this.pageFilter).then((t=>{this.pageData=t.data,this.pageData.page=t.data.number+1}))},showRemarkDrawer(){this.tableName?this.pageFilter.tableName=this.tableName:this.pageFilter.tableName=null,this.columnName?this.pageFilter.columnName=this.columnName:this.pageFilter.columnName=null,eO(this.groupId,this.projectId,this.pageFilter).then((t=>{this.pageData=t.data,this.pageData.page=t.data.number+1,this.show=!0}))},closeRemarkDrawer(){this.$emit("onClose",this.show)}}};const iO=(0,Gk.Z)(nO,[["render",Zk]]);var rO=iO;const sO=(0,y._)("h2",{id:"overview[-1]"},"Overview",-1),oO=(0,y._)("h3",null,"Tables",-1),aO=["id"],lO={key:0},hO=(0,y.Uk)(" PK "),cO=(0,y._)("del",null,[(0,y._)("em",null,"null")],-1),uO=(0,y._)("em",null,"null",-1),dO=(0,y.Uk)(" YES "),gO={key:1},pO=(0,y._)("h3",null,"Indexes",-1),fO=(0,y.Uk)(" UK "),mO={key:2},yO=(0,y._)("h3",null,"Triggers",-1);function bO(t,e,n,i,r,s){const o=(0,y.up)("el-descriptions-item"),a=(0,y.up)("el-descriptions"),l=(0,y.up)("el-table-column"),h=(0,y.up)("el-button"),c=(0,y.up)("el-table"),u=(0,y.up)("el-col"),d=(0,y.up)("el-row"),g=(0,y.up)("el-tag"),p=(0,y.up)("el-tooltip"),f=(0,y.up)("el-space");return(0,y.wg)(),(0,y.iD)(y.HY,null,[n.overviewData?((0,y.wg)(),(0,y.j4)(d,{key:0,style:{"margin-top":"0px !important"}},{default:(0,y.w5)((()=>[(0,y.Wm)(u,{span:24},{default:(0,y.w5)((()=>[sO,(0,y.Wm)(a,{column:1,size:"large",border:""},{default:(0,y.w5)((()=>[(0,y.Wm)(o,{label:"Database Name","label-align":"left",width:"200px"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(n.overviewData.databaseName),1)])),_:1}),(0,y.Wm)(o,{label:"Product Name","label-align":"left"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(n.overviewData.productName),1)])),_:1}),(0,y.Wm)(o,{label:"Product Version","label-align":"left"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(n.overviewData.productVersion),1)])),_:1}),(0,y.Wm)(o,{label:"Document Version","label-align":"left"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(n.overviewData.documentVersion),1)])),_:1}),(0,y.Wm)(o,{label:"Create At","label-align":"left"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(n.overviewData.createAt),1)])),_:1})])),_:1}),oO,(0,y.Wm)(c,{data:s.tableList,border:"",stripe:"",width:"80%"},{default:(0,y.w5)((()=>[(0,y.Wm)(l,{type:"index"}),(0,y.Wm)(l,{prop:"name",label:"Name","min-width":"160",resizable:""}),(0,y.Wm)(l,{prop:"type",label:"Type",width:"200",resizable:""}),(0,y.Wm)(l,{prop:"comment",label:"comment","min-width":"160",resizable:""}),(0,y.Wm)(l,{prop:"remark",label:"discussion","min-width":"120",resizable:""},{default:(0,y.w5)((t=>[(0,y.Wm)(h,{onClick:e=>s.onRemark(t.row.name),size:"small",icon:"chat-line-round"},null,8,["onClick"])])),_:1})])),_:1},8,["data"])])),_:1})])),_:1})):(0,y.kq)("",!0),((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(n.tablesData,(t=>((0,y.wg)(),(0,y.j4)(d,{key:t.id,style:{"margin-top":"0px !important"}},{default:(0,y.w5)((()=>[(0,y.Wm)(u,{span:24},{default:(0,y.w5)((()=>[(0,y._)("h2",{id:t.name+"["+t.id+"]"},(0,b.zw)(t.name),9,aO),t.columns.length>0?((0,y.wg)(),(0,y.iD)("h3",lO,"Columns")):(0,y.kq)("",!0),(0,y.Wm)(c,{data:t.columns,border:"",stripe:"",fit:"",width:"80%"},{default:(0,y.w5)((()=>[(0,y.Wm)(l,{type:"index"}),(0,y.Wm)(l,{prop:"name",label:"Name","min-width":"120"}),(0,y.Wm)(l,{prop:"type",formatter:s.columnTypeFormat,label:"Type",width:"140"},null,8,["formatter"]),(0,y.Wm)(l,{label:"Primary Key",width:"120"},{default:(0,y.w5)((t=>[t.row.isPrimaryKey?((0,y.wg)(),(0,y.j4)(p,{key:0,content:"YES"},{default:(0,y.w5)((()=>[(0,y.Wm)(g,null,{default:(0,y.w5)((()=>[hO])),_:1})])),_:1})):(0,y.kq)("",!0)])),_:1}),(0,y.Wm)(l,{prop:"nullable",label:"Is Nullable",width:"120"},{default:(0,y.w5)((t=>["YES"!=t.row.nullable?((0,y.wg)(),(0,y.j4)(p,{key:0,content:"NO"},{default:(0,y.w5)((()=>[(0,y.Wm)(g,{type:"info"},{default:(0,y.w5)((()=>[cO])),_:1})])),_:1})):((0,y.wg)(),(0,y.j4)(p,{key:1,content:"YES"},{default:(0,y.w5)((()=>[(0,y.Wm)(g,{type:"danger"},{default:(0,y.w5)((()=>[uO])),_:1})])),_:1}))])),_:1}),(0,y.Wm)(l,{prop:"autoIncrement",label:"Auto Increment",width:"140"},{default:(0,y.w5)((t=>["YES"==t.row.autoIncrement?((0,y.wg)(),(0,y.j4)(g,{key:0},{default:(0,y.w5)((()=>[dO])),_:1})):(0,y.kq)("",!0)])),_:1}),(0,y.Wm)(l,{prop:"defaultValue",label:"default","min-width":"120"}),(0,y.Wm)(l,{prop:"comment",label:"comment"}),(0,y.Wm)(l,{prop:"remark",label:"discussion","min-width":"60",resizable:""},{default:(0,y.w5)((e=>[(0,y.Wm)(h,{onClick:n=>s.onRemark(t.name,e.row.name),size:"small",icon:"chat-line-round"},null,8,["onClick"])])),_:2},1024)])),_:2},1032,["data"]),t.indexes.length>0?((0,y.wg)(),(0,y.iD)("div",gO,[pO,(0,y.Wm)(c,{data:t.indexes,border:"",stripe:"",fit:"",width:"80%"},{default:(0,y.w5)((()=>[(0,y.Wm)(l,{type:"index"}),(0,y.Wm)(l,{prop:"name",label:"Name","min-width":"120"}),(0,y.Wm)(l,{prop:"isUnique",label:"Is Unique",width:"120"},{default:(0,y.w5)((t=>[t.row.isUnique?((0,y.wg)(),(0,y.j4)(p,{key:0,content:"YES"},{default:(0,y.w5)((()=>[(0,y.Wm)(g,null,{default:(0,y.w5)((()=>[fO])),_:1})])),_:1})):(0,y.kq)("",!0)])),_:1}),(0,y.Wm)(l,{label:"Columns","min-width":"150"},{default:(0,y.w5)((t=>[(0,y.Wm)(f,null,{default:(0,y.w5)((()=>[((0,y.wg)(!0),(0,y.iD)(y.HY,null,(0,y.Ko)(t.row.columnNames,((t,e)=>((0,y.wg)(),(0,y.j4)(g,{key:e,type:"info"},{default:(0,y.w5)((()=>[(0,y.Uk)((0,b.zw)(t),1)])),_:2},1024)))),128))])),_:2},1024)])),_:1})])),_:2},1032,["data"])])):(0,y.kq)("",!0),t.triggers.length>0?((0,y.wg)(),(0,y.iD)("div",mO,[yO,(0,y.Wm)(c,{data:t.triggers,stripe:"",fit:"",border:"",width:"80%"},{default:(0,y.w5)((()=>[(0,y.Wm)(l,{type:"index"}),(0,y.Wm)(l,{prop:"name",label:"Name","min-width":"120"}),(0,y.Wm)(l,{prop:"timing",label:"timing"}),(0,y.Wm)(l,{prop:"manipulation",label:"manipulation",width:"120"}),(0,y.Wm)(l,{prop:"statement",label:"statement"}),(0,y.Wm)(l,{prop:"creatAt",label:"creatAt",width:"150"})])),_:2},1032,["data"])])):(0,y.kq)("",!0)])),_:2},1024)])),_:2},1024)))),128))],64)}var vO={props:["overviewData","tablesData"],emits:["onRemark"],computed:{tableList(){return this.overviewData.tables.filter((t=>-1!=t.id))}},methods:{onRemark(t,e){this.$emit("onRemark",t,e)},columnNameArray(t){return t?t.split(","):[]},columnTypeFormat(t){return null==t.decimalDigits?t.type+"("+t.size+")":t.type+"("+t.size+", "+t.decimalDigits+")"}}};const CO=(0,Gk.Z)(vO,[["render",bO]]);var wO=CO,xO={components:{Diagram:Uk,DocumentRemark:rO,DocumentList:wO},setup(){const t=(0,A.yj)(),e=(0,M.qj)({handleSync:!1,loadingVersions:!1,export:!1,init:!1,multiSelectionModeChanging:!1}),n=(0,M.qj)({simpleDocumentData:null,documentFilter:{version:null},projectId:t.params.projectId,groupId:t.params.groupId}),i=(0,M.qj)({pageFilter:{page:0,size:10},totalPage:0,versions:[]}),r=(0,M.qj)({value:[{id:-1,name:"概览"}],treeProps:{children:"children",label:"name"},checkedNodes:[],isMultiSelectionMode:!1}),s=(0,M.qj)({tables:[],overview:{}}),o=(0,M.qj)({showComment:!1,tables:[]}),a=(0,M.iH)(),l=(e,i)=>{let r=n.simpleDocumentData.id;O(t.params.projectId,r,e).then((t=>{t.errCode?m("warn","加载数据异常,请稍后再试"):i(t.data)}))},h=t=>{r.isMultiSelectionMode?-1==t.id?c("overview[-1]"):c(t.name+"["+t.id+"]"):-1==t.id?(s.overview=n.simpleDocumentData,s.tables=[],o.tables=[]):l([t.id],(t=>{s.overview=null,s.tables=t,o.tables=t}))},c=t=>{const 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"})}},u=()=>{l(a.value.getCheckedKeys(),(t=>{a.value.getCheckedKeys().some((t=>-1==t))?s.overview=n.simpleDocumentData:s.overview=null,s.tables=t,o.tables=t}))},d=t=>{if(e.multiSelectionModeChanging=!0,t)u();else{const t=a.value.getCurrentNode();h(null==t?{id:-1}:t)}e.multiSelectionModeChanging=!1},g=async()=>{const o=await T(t.params.projectId);i.versions=o.data.content,i.totalPage=o.data.totalPages;const a=await P(t.params.projectId,n.documentFilter);a.errCode?m("error","同步失败:"+a.errMessage):a.data?(n.simpleDocumentData=a.data,n.groupId=t.params.groupId,n.projectId=t.params.projectId,r.value=a.data.tables,r.value.unshift({id:-1,name:"概览"}),r.checkedNodes=r.value.map((t=>t.id)),s.overview=a.data,s.tables=[]):m("warn","无可用数据"),e.init=!0};g();const p=(0,M.Fl)((()=>!n.simpleDocumentData&&e.init)),f=(0,M.Fl)((()=>!n.simpleDocumentData&&!e.init)),m=(t,e)=>{(0,L.z8)({showClose:!0,message:e,type:t,duration:3e3})},y=async()=>{e.loadingVersions=!0,g(),m("success","切换成功"),e.loadingVersions=!1},b=()=>{const n=t.params.projectId;e.handleSync=!0,D(n).then((t=>{t.errCode||(g(),m("success","同步成功")),e.handleSync=!1})).catch((()=>e.handleSync=!1))},v=()=>{const i=t.params.projectId;e.export=!0,N(i,{version:n.documentFilter.version},n.simpleDocumentData.databaseName,(()=>e.export=!1))},C=w((async()=>{if(e.loadingVersions=!0,i.pageFilter.page+1<i.totalPage){i.pageFilter.page++;const e=await T(t.params.projectId,i.pageFilter);i.totalPage=e.data.totalPages,e.data.content.length>0&&e.data.content.forEach((t=>i.versions.push(t)))}e.loadingVersions=!1}),800);function w(t,e){let n=null;return function(){let i=this,r=arguments;n&&clearTimeout(n),n=setTimeout((function(){t.apply(i,r)}),e)}}const x=(0,M.iH)({tableName:null,columnName:null,groupId:null,projectId:null,isShowDrawer:!1}),E=(t,e)=>{x.value={tableName:t,columnName:e,isShowDrawer:!0,groupId:n.groupId,projectId:n.projectId}};return{tocData:r,documentData:s,projectData:n,versionData:i,umlData:o,loadings:e,isShowNoDataPage:p,isShowLoadingPage:f,treeRef:a,onTocNodeClick:h,onTocNodeCheckChange:u,onMultiSelectionModeChange:d,loadMoreDocumentVersions:C,onProjectDocumentVersionChange:y,onSyncProjectDocument:b,onDocumentExport:v,documentRemarkData:x,showRemarkDrawer:E}}};const EO=(0,Gk.Z)(xO,[["render",E]]);var MO=EO}}]);
//# sourceMappingURL=898.a81fbbe7.js.map