/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/kincloud-fork-x6-vue-shape@1.5.3/dist/x6-vue-shape.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue"),require("@vue/composition-api/dist/vue-composition-api.mjs")):"function"==typeof define&&define.amd?define(["exports","vue","@vue/composition-api/dist/vue-composition-api.mjs"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).X6VueShape={},t.Vue,t.VueCompositionAPI)}(this,(function(t,e,n){"use strict";function i(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=i(e),r=i(n),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a={exports:{}};
/*!
	 * 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(t){!function(e,n){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)}}("undefined"!=typeof window?window:o,(function(t,e){var n=[],i=Object.getPrototypeOf,s=n.slice,r=function(t){return n.concat.apply([],t)},o=n.push,a=n.indexOf,l={},h=l.toString,c=l.hasOwnProperty,u=c.toString,d=u.call(Object),g={},p=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},f=function(t){return null!=t&&t===t.window},m=t.document,y={type:!0,src:!0,nonce:!0,noModule:!0};function b(t,e,n){var i,s,r=(n=n||m).createElement("script");if(r.text=t,e)for(i in y)(s=e[i]||e.getAttribute&&e.getAttribute(i))&&r.setAttribute(i,s);n.head.appendChild(r).parentNode.removeChild(r)}function C(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?l[h.call(t)]||"object":typeof t}var v="3.6.0",x=function(t,e){return new x.fn.init(t,e)};function w(t){var e=!!t&&"length"in t&&t.length,n=C(t);return!p(t)&&!f(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}x.fn=x.prototype={jquery:v,constructor:x,length:0,toArray:function(){return s.call(this)},get:function(t){return null==t?s.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=x.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return x.each(this,t)},map:function(t){return this.pushStack(x.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(x.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(x.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:o,sort:n.sort,splice:n.splice},x.extend=x.fn.extend=function(){var t,e,n,i,s,r,o=arguments[0]||{},a=1,l=arguments.length,h=!1;for("boolean"==typeof o&&(h=o,o=arguments[a]||{},a++),"object"==typeof o||p(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&&(x.isPlainObject(i)||(s=Array.isArray(i)))?(n=o[e],r=s&&!Array.isArray(n)?[]:s||x.isPlainObject(n)?n:{},s=!1,o[e]=x.extend(h,r,i)):void 0!==i&&(o[e]=i));return o},x.extend({expando:"jQuery"+(v+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]"!==h.call(t))&&(!(e=i(t))||"function"==typeof(n=c.call(e,"constructor")&&e.constructor)&&u.call(n)===d)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){b(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,i=0;if(w(t))for(n=t.length;i<n&&!1!==e.call(t[i],i,t[i]);i++);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&&(w(Object(t))?x.merge(n,"string"==typeof t?[t]:t):o.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:a.call(e,t,n)},merge:function(t,e){for(var n=+e.length,i=0,s=t.length;i<n;i++)t[s++]=e[i];return t.length=s,t},grep:function(t,e,n){for(var i=[],s=0,r=t.length,o=!n;s<r;s++)!e(t[s],s)!==o&&i.push(t[s]);return i},map:function(t,e,n){var i,s,o=0,a=[];if(w(t))for(i=t.length;o<i;o++)null!=(s=e(t[o],o,n))&&a.push(s);else for(o in t)null!=(s=e(t[o],o,n))&&a.push(s);return r(a)},guid:1,support:g}),"function"==typeof Symbol&&(x.fn[Symbol.iterator]=n[Symbol.iterator]),x.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){l["[object "+e+"]"]=e.toLowerCase()}));var E=
/*!
	 * 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,s,r,o,a,l,h,c,u,d,g,p,f,m,y,b,C,v="sizzle"+1*new Date,x=t.document,w=0,E=0,A=lt(),M=lt(),S=lt(),O=lt(),k=function(t,e){return t===e&&(u=!0),0},P={}.hasOwnProperty,T=[],D=T.pop,N=T.push,j=T.push,L=T.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]",$="(?:\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",R="\\[[\\x20\\t\\r\\n\\f]*("+$+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+$+"))|)"+B+"*\\]",I=":("+$+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+R+")*)|.*)\\)|)",V=new RegExp(B+"+","g"),_=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),G=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),H=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),U=new RegExp(B+"|>"),q=new RegExp(I),W=new RegExp("^"+$+"$"),X={ID:new RegExp("^#("+$+")"),CLASS:new RegExp("^\\.("+$+")"),TAG:new RegExp("^("+$+"|[*])"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+I),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+z+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","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}[\\x20\\t\\r\\n\\f]?|\\\\([^\\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,st=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},rt=function(){d()},ot=vt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{j.apply(T=L.call(x.childNodes),x.childNodes),T[x.childNodes.length].nodeType}catch(t){j={apply:T.length?function(t,e){N.apply(t,L.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function at(t,e,i,s){var r,a,h,c,u,p,y,b=e&&e.ownerDocument,x=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==x&&9!==x&&11!==x)return i;if(!s&&(d(e),e=e||g,f)){if(11!==x&&(u=Q.exec(t)))if(r=u[1]){if(9===x){if(!(h=e.getElementById(r)))return i;if(h.id===r)return i.push(h),i}else if(b&&(h=b.getElementById(r))&&C(e,h)&&h.id===r)return i.push(h),i}else{if(u[2])return j.apply(i,e.getElementsByTagName(t)),i;if((r=u[3])&&n.getElementsByClassName&&e.getElementsByClassName)return j.apply(i,e.getElementsByClassName(r)),i}if(n.qsa&&!O[t+" "]&&(!m||!m.test(t))&&(1!==x||"object"!==e.nodeName.toLowerCase())){if(y=t,b=e,1===x&&(U.test(t)||H.test(t))){for((b=tt.test(t)&&yt(e.parentNode)||e)===e&&n.scope||((c=e.getAttribute("id"))?c=c.replace(it,st):e.setAttribute("id",c=v)),a=(p=o(t)).length;a--;)p[a]=(c?"#"+c:":scope")+" "+Ct(p[a]);y=p.join(",")}try{return j.apply(i,b.querySelectorAll(y)),i}catch(e){O(t,!0)}finally{c===v&&e.removeAttribute("id")}}}return l(t.replace(_,"$1"),e,i,s)}function lt(){var t=[];return function e(n,s){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=s}}function ht(t){return t[v]=!0,t}function ct(t){var e=g.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ut(t,e){for(var n=t.split("|"),s=n.length;s--;)i.attrHandle[n[s]]=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)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function gt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&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){for(var s,r=t([],n.length,e),o=r.length;o--;)n[s=r[o]]&&(n[s]=!(i[s]=n[s]))}))}))}function yt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=at.support={},r=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,s,o=t?t.ownerDocument||t:x;return o!=g&&9===o.nodeType&&o.documentElement?(p=(g=o).documentElement,f=!r(g),x!=g&&(s=g.defaultView)&&s.top!==s&&(s.addEventListener?s.addEventListener("unload",rt,!1):s.attachEvent&&s.attachEvent("onunload",rt)),n.scope=ct((function(t){return p.appendChild(t).appendChild(g.createElement("div")),void 0!==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=v,!g.getElementsByName||!g.getElementsByName(v).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(void 0!==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=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&f){var n,i,s,r=e.getElementById(t);if(r){if((n=r.getAttributeNode("id"))&&n.value===t)return[r];for(s=e.getElementsByName(t),i=0;r=s[i++];)if((n=r.getAttributeNode("id"))&&n.value===t)return[r]}return[]}}),i.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],s=0,r=e.getElementsByTagName(t);if("*"===t){for(;n=r[s++];)1===n.nodeType&&i.push(n);return i}return r},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==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='"+v+"'></a><select id='"+v+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll("[selected]").length||m.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+z+")"),t.querySelectorAll("[id~="+v+"-]").length||m.push("~="),(e=g.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||m.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll(":checked").length||m.push(":checked"),t.querySelectorAll("a#"+v+"+*").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[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),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),C=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)for(;e=e.parentNode;)if(e===t)return!0;return!1},k=e?function(t,e){if(t===e)return u=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t==g||t.ownerDocument==x&&C(x,t)?-1:e==g||e.ownerDocument==x&&C(x,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,s=t.parentNode,r=e.parentNode,o=[t],a=[e];if(!s||!r)return t==g?-1:e==g?1:s?-1:r?1:c?F(c,t)-F(c,e):0;if(s===r)return dt(t,e);for(n=t;n=n.parentNode;)o.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;o[i]===a[i];)i++;return i?dt(o[i],a[i]):o[i]==x?-1:a[i]==x?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&&!O[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(t){O(e,!0)}return at(e,g,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=g&&d(t),C(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=g&&d(t);var s=i.attrHandle[e.toLowerCase()],r=s&&P.call(i.attrHandle,e.toLowerCase())?s(t,e,!f):void 0;return void 0!==r?r:n.attributes||!f?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},at.escape=function(t){return(t+"").replace(it,st)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,i=[],s=0,r=0;if(u=!n.detectDuplicates,c=!n.sortStable&&t.slice(0),t.sort(k),u){for(;e=t[r++];)e===t[r]&&(s=i.push(r));for(;s--;)t.splice(i[s],1)}return c=null,t},s=at.getText=function(t){var e,n="",i=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=s(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[i++];)n+=s(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&&q.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=A[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+B+"|$)"))&&A(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var s=at.attr(i,t);return null==s?"!="===e:!e||(s+="","="===e?s===n:"!="===e?s!==n:"^="===e?n&&0===s.indexOf(n):"*="===e?n&&s.indexOf(n)>-1:"$="===e?n&&s.slice(-n.length)===n:"~="===e?(" "+s.replace(V," ")+" ").indexOf(n)>-1:"|="===e&&(s===n||s.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,s){var r="nth"!==t.slice(0,3),o="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===s?function(t){return!!t.parentNode}:function(e,n,l){var h,c,u,d,g,p,f=r!==o?"nextSibling":"previousSibling",m=e.parentNode,y=a&&e.nodeName.toLowerCase(),b=!l&&!a,C=!1;if(m){if(r){for(;f;){for(d=e;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){for(C=(g=(h=(c=(u=(d=m)[v]||(d[v]={}))[d.uniqueID]||(u[d.uniqueID]={}))[t]||[])[0]===w&&h[1])&&h[2],d=g&&m.childNodes[g];d=++g&&d&&d[f]||(C=g=0)||p.pop();)if(1===d.nodeType&&++C&&d===e){c[t]=[w,g,C];break}}else if(b&&(C=g=(h=(c=(u=(d=e)[v]||(d[v]={}))[d.uniqueID]||(u[d.uniqueID]={}))[t]||[])[0]===w&&h[1]),!1===C)for(;(d=++g&&d&&d[f]||(C=g=0)||p.pop())&&((a?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++C||(b&&((c=(u=d[v]||(d[v]={}))[d.uniqueID]||(u[d.uniqueID]={}))[t]=[w,C]),d!==e)););return(C-=s)===i||C%i==0&&C/i>=0}}},PSEUDO:function(t,e){var n,s=i.pseudos[t]||i.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return s[v]?s(e):s.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?ht((function(t,n){for(var i,r=s(t,e),o=r.length;o--;)t[i=F(t,r[o])]=!(n[i]=r[o])})):function(t){return s(t,0,n)}):s}},pseudos:{not:ht((function(t){var e=[],n=[],i=a(t.replace(_,"$1"));return i[v]?ht((function(t,e,n,s){for(var r,o=i(t,null,s,[]),a=t.length;a--;)(r=o[a])&&(t[a]=!(e[a]=r))})):function(t,s,r){return e[0]=t,i(e,null,r,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||s(e)).indexOf(t)>-1}})),lang:ht((function(t){return W.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())===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}))}}).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 Ct(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function vt(t,e,n){var i=e.dir,s=e.next,r=s||i,o=n&&"parentNode"===r,a=E++;return e.first?function(e,n,s){for(;e=e[i];)if(1===e.nodeType||o)return t(e,n,s);return!1}:function(e,n,l){var h,c,u,d=[w,a];if(l){for(;e=e[i];)if((1===e.nodeType||o)&&t(e,n,l))return!0}else for(;e=e[i];)if(1===e.nodeType||o)if(c=(u=e[v]||(e[v]={}))[e.uniqueID]||(u[e.uniqueID]={}),s&&s===e.nodeName.toLowerCase())e=e[i]||e;else{if((h=c[r])&&h[0]===w&&h[1]===a)return d[2]=h[2];if(c[r]=d,d[2]=t(e,n,l))return!0}return!1}}function xt(t){return t.length>1?function(e,n,i){for(var s=t.length;s--;)if(!t[s](e,n,i))return!1;return!0}:t[0]}function wt(t,e,n,i,s){for(var r,o=[],a=0,l=t.length,h=null!=e;a<l;a++)(r=t[a])&&(n&&!n(r,i,s)||(o.push(r),h&&e.push(a)));return o}function Et(t,e,n,i,s,r){return i&&!i[v]&&(i=Et(i)),s&&!s[v]&&(s=Et(s,r)),ht((function(r,o,a,l){var h,c,u,d=[],g=[],p=o.length,f=r||function(t,e,n){for(var i=0,s=e.length;i<s;i++)at(t,e[i],n);return n}(e||"*",a.nodeType?[a]:a,[]),m=!t||!r&&e?f:wt(f,d,t,a,l),y=n?s||(r?t:p||i)?[]:o:m;if(n&&n(m,y,a,l),i)for(h=wt(y,g),i(h,[],a,l),c=h.length;c--;)(u=h[c])&&(y[g[c]]=!(m[g[c]]=u));if(r){if(s||t){if(s){for(h=[],c=y.length;c--;)(u=y[c])&&h.push(m[c]=u);s(null,y=[],h,l)}for(c=y.length;c--;)(u=y[c])&&(h=s?F(r,u):d[c])>-1&&(r[h]=!(o[h]=u))}}else y=wt(y===o?y.splice(p,y.length):y),s?s(null,o,y,l):j.apply(o,y)}))}function At(t){for(var e,n,s,r=t.length,o=i.relative[t[0].type],a=o||i.relative[" "],l=o?1:0,c=vt((function(t){return t===e}),a,!0),u=vt((function(t){return F(e,t)>-1}),a,!0),d=[function(t,n,i){var s=!o&&(i||n!==h)||((e=n).nodeType?c(t,n,i):u(t,n,i));return e=null,s}];l<r;l++)if(n=i.relative[t[l].type])d=[vt(xt(d),n)];else{if((n=i.filter[t[l].type].apply(null,t[l].matches))[v]){for(s=++l;s<r&&!i.relative[t[s].type];s++);return Et(l>1&&xt(d),l>1&&Ct(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(_,"$1"),n,l<s&&At(t.slice(l,s)),s<r&&At(t=t.slice(s)),s<r&&Ct(t))}d.push(n)}return xt(d)}return bt.prototype=i.filters=i.pseudos,i.setFilters=new bt,o=at.tokenize=function(t,e){var n,s,r,o,a,l,h,c=M[t+" "];if(c)return e?0:c.slice(0);for(a=t,l=[],h=i.preFilter;a;){for(o in n&&!(s=G.exec(a))||(s&&(a=a.slice(s[0].length)||a),l.push(r=[])),n=!1,(s=H.exec(a))&&(n=s.shift(),r.push({value:n,type:s[0].replace(_," ")}),a=a.slice(n.length)),i.filter)!(s=X[o].exec(a))||h[o]&&!(s=h[o](s))||(n=s.shift(),r.push({value:n,type:o,matches:s}),a=a.slice(n.length));if(!n)break}return e?a.length:a?at.error(t):M(t,l).slice(0)},a=at.compile=function(t,e){var n,s=[],r=[],a=S[t+" "];if(!a){for(e||(e=o(t)),n=e.length;n--;)(a=At(e[n]))[v]?s.push(a):r.push(a);(a=S(t,function(t,e){var n=e.length>0,s=t.length>0,r=function(r,o,a,l,c){var u,p,m,y=0,b="0",C=r&&[],v=[],x=h,E=r||s&&i.find.TAG("*",c),A=w+=null==x?1:Math.random()||.1,M=E.length;for(c&&(h=o==g||o||c);b!==M&&null!=(u=E[b]);b++){if(s&&u){for(p=0,o||u.ownerDocument==g||(d(u),a=!f);m=t[p++];)if(m(u,o||g,a)){l.push(u);break}c&&(w=A)}n&&((u=!m&&u)&&y--,r&&C.push(u))}if(y+=b,n&&b!==y){for(p=0;m=e[p++];)m(C,v,o,a);if(r){if(y>0)for(;b--;)C[b]||v[b]||(v[b]=D.call(l));v=wt(v)}j.apply(l,v),c&&!r&&v.length>0&&y+e.length>1&&at.uniqueSort(l)}return c&&(w=A,h=x),C};return n?ht(r):r}(r,s))).selector=t}return a},l=at.select=function(t,e,n,s){var r,l,h,c,u,d="function"==typeof t&&t,g=!s&&o(t=d.selector||t);if(n=n||[],1===g.length){if((l=g[0]=g[0].slice(0)).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]))return n;d&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(r=X.needsContext.test(t)?0:l.length;r--&&(h=l[r],!i.relative[c=h.type]);)if((u=i.find[c])&&(s=u(h.matches[0].replace(et,nt),tt.test(l[0].type)&&yt(e.parentNode)||e))){if(l.splice(r,1),!(t=s.length&&Ct(l)))return j.apply(n,s),n;break}}return(d||a(t,g))(s,e,!f,n,!e||tt.test(t)&&yt(e.parentNode)||e),n},n.sortStable=v.split("").sort(k).join("")===v,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}(t);x.find=E,x.expr=E.selectors,x.expr[":"]=x.expr.pseudos,x.uniqueSort=x.unique=E.uniqueSort,x.text=E.getText,x.isXMLDoc=E.isXML,x.contains=E.contains,x.escapeSelector=E.escape;var A=function(t,e,n){for(var i=[],s=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(s&&x(t).is(n))break;i.push(t)}return i},M=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},S=x.expr.match.needsContext;function O(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var k=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function P(t,e,n){return p(e)?x.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?x.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?x.grep(t,(function(t){return a.call(e,t)>-1!==n})):x.filter(e,t,n)}x.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?x.find.matchesSelector(i,t)?[i]:[]:x.find.matches(t,x.grep(e,(function(t){return 1===t.nodeType})))},x.fn.extend({find:function(t){var e,n,i=this.length,s=this;if("string"!=typeof t)return this.pushStack(x(t).filter((function(){for(e=0;e<i;e++)if(x.contains(s[e],this))return!0})));for(n=this.pushStack([]),e=0;e<i;e++)x.find(t,s[e],n);return i>1?x.uniqueSort(n):n},filter:function(t){return this.pushStack(P(this,t||[],!1))},not:function(t){return this.pushStack(P(this,t||[],!0))},is:function(t){return!!P(this,"string"==typeof t&&S.test(t)?x(t):t||[],!1).length}});var T,D=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(x.fn.init=function(t,e,n){var i,s;if(!t)return this;if(n=n||T,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:D.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof x?e[0]:e,x.merge(this,x.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:m,!0)),k.test(i[1])&&x.isPlainObject(e))for(i in e)p(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(s=m.getElementById(i[2]))&&(this[0]=s,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):p(t)?void 0!==n.ready?n.ready(t):t(x):x.makeArray(t,this)}).prototype=x.fn,T=x(m);var N=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function L(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}x.fn.extend({has:function(t){var e=x(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(x.contains(this,e[t]))return!0}))},closest:function(t,e){var n,i=0,s=this.length,r=[],o="string"!=typeof t&&x(t);if(!S.test(t))for(;i<s;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,t))){r.push(n);break}return this.pushStack(r.length>1?x.uniqueSort(r):r)},index:function(t){return t?"string"==typeof t?a.call(x(t),this[0]):a.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(x.uniqueSort(x.merge(this.get(),x(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),x.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return A(t,"parentNode")},parentsUntil:function(t,e,n){return A(t,"parentNode",n)},next:function(t){return L(t,"nextSibling")},prev:function(t){return L(t,"previousSibling")},nextAll:function(t){return A(t,"nextSibling")},prevAll:function(t){return A(t,"previousSibling")},nextUntil:function(t,e,n){return A(t,"nextSibling",n)},prevUntil:function(t,e,n){return A(t,"previousSibling",n)},siblings:function(t){return M((t.parentNode||{}).firstChild,t)},children:function(t){return M(t.firstChild)},contents:function(t){return null!=t.contentDocument&&i(t.contentDocument)?t.contentDocument:(O(t,"template")&&(t=t.content||t),x.merge([],t.childNodes))}},(function(t,e){x.fn[t]=function(n,i){var s=x.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(s=x.filter(i,s)),this.length>1&&(j[t]||x.uniqueSort(s),N.test(t)&&s.reverse()),this.pushStack(s)}}));var F=/[^\x20\t\r\n\f]+/g;function z(t){return t}function B(t){throw t}function $(t,e,n,i){var s;try{t&&p(s=t.promise)?s.call(t).done(e).fail(n):t&&p(s=t.then)?s.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}x.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return x.each(t.match(F)||[],(function(t,n){e[n]=!0})),e}(t):x.extend({},t);var e,n,i,s,r=[],o=[],a=-1,l=function(){for(s=s||t.once,i=e=!0;o.length;a=-1)for(n=o.shift();++a<r.length;)!1===r[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=r.length,n=!1);t.memory||(n=!1),e=!1,s&&(r=n?[]:"")},h={add:function(){return r&&(n&&!e&&(a=r.length-1,o.push(n)),function e(n){x.each(n,(function(n,i){p(i)?t.unique&&h.has(i)||r.push(i):i&&i.length&&"string"!==C(i)&&e(i)}))}(arguments),n&&!e&&l()),this},remove:function(){return x.each(arguments,(function(t,e){for(var n;(n=x.inArray(e,r,n))>-1;)r.splice(n,1),n<=a&&a--})),this},has:function(t){return t?x.inArray(t,r)>-1:r.length>0},empty:function(){return r&&(r=[]),this},disable:function(){return s=o=[],r=n="",this},disabled:function(){return!r},lock:function(){return s=o=[],n||e||(r=n=""),this},locked:function(){return!!s},fireWith:function(t,n){return s||(n=[t,(n=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},x.extend({Deferred:function(e){var n=[["notify","progress",x.Callbacks("memory"),x.Callbacks("memory"),2],["resolve","done",x.Callbacks("once memory"),x.Callbacks("once memory"),0,"resolved"],["reject","fail",x.Callbacks("once memory"),x.Callbacks("once memory"),1,"rejected"]],i="pending",s={state:function(){return i},always:function(){return r.done(arguments).fail(arguments),this},catch:function(t){return s.then(null,t)},pipe:function(){var t=arguments;return x.Deferred((function(e){x.each(n,(function(n,i){var s=p(t[i[4]])&&t[i[4]];r[i[1]]((function(){var t=s&&s.apply(this,arguments);t&&p(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[i[0]+"With"](this,s?[t]:arguments)}))})),t=null})).promise()},then:function(e,i,s){var r=0;function o(e,n,i,s){return function(){var a=this,l=arguments,h=function(){var t,h;if(!(e<r)){if((t=i.apply(a,l))===n.promise())throw new TypeError("Thenable self-resolution");h=t&&("object"==typeof t||"function"==typeof t)&&t.then,p(h)?s?h.call(t,o(r,n,z,s),o(r,n,B,s)):(r++,h.call(t,o(r,n,z,s),o(r,n,B,s),o(r,n,z,n.notifyWith))):(i!==z&&(a=void 0,l=[t]),(s||n.resolveWith)(a,l))}},c=s?h:function(){try{h()}catch(t){x.Deferred.exceptionHook&&x.Deferred.exceptionHook(t,c.stackTrace),e+1>=r&&(i!==B&&(a=void 0,l=[t]),n.rejectWith(a,l))}};e?c():(x.Deferred.getStackHook&&(c.stackTrace=x.Deferred.getStackHook()),t.setTimeout(c))}}return x.Deferred((function(t){n[0][3].add(o(0,t,p(s)?s:z,t.notifyWith)),n[1][3].add(o(0,t,p(e)?e:z)),n[2][3].add(o(0,t,p(i)?i:B))})).promise()},promise:function(t){return null!=t?x.extend(t,s):s}},r={};return x.each(n,(function(t,e){var o=e[2],a=e[5];s[e[1]]=o.add,a&&o.add((function(){i=a}),n[3-t][2].disable,n[3-t][3].disable,n[0][2].lock,n[0][3].lock),o.add(e[3].fire),r[e[0]]=function(){return r[e[0]+"With"](this===r?void 0:this,arguments),this},r[e[0]+"With"]=o.fireWith})),s.promise(r),e&&e.call(r,r),r},when:function(t){var e=arguments.length,n=e,i=Array(n),r=s.call(arguments),o=x.Deferred(),a=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?s.call(arguments):n,--e||o.resolveWith(i,r)}};if(e<=1&&($(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||p(r[n]&&r[n].then)))return o.then();for(;n--;)$(r[n],a(n),o.reject);return o.promise()}});var R=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;x.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&R.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},x.readyException=function(e){t.setTimeout((function(){throw e}))};var I=x.Deferred();function V(){m.removeEventListener("DOMContentLoaded",V),t.removeEventListener("load",V),x.ready()}x.fn.ready=function(t){return I.then(t).catch((function(t){x.readyException(t)})),this},x.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--x.readyWait:x.isReady)||(x.isReady=!0,!0!==t&&--x.readyWait>0||I.resolveWith(m,[x]))}}),x.ready.then=I.then,"complete"===m.readyState||"loading"!==m.readyState&&!m.documentElement.doScroll?t.setTimeout(x.ready):(m.addEventListener("DOMContentLoaded",V),t.addEventListener("load",V));var _=function(t,e,n,i,s,r,o){var a=0,l=t.length,h=null==n;if("object"===C(n))for(a in s=!0,n)_(t,e,a,n[a],!0,r,o);else if(void 0!==i&&(s=!0,p(i)||(o=!0),h&&(o?(e.call(t,i),e=null):(h=e,e=function(t,e,n){return h.call(x(t),n)})),e))for(;a<l;a++)e(t[a],n,o?i:i.call(t[a],a,e(t[a],n)));return s?t:h?e.call(t):l?e(t[0],n):r},G=/^-ms-/,H=/-([a-z])/g;function U(t,e){return e.toUpperCase()}function q(t){return t.replace(G,"ms-").replace(H,U)}var W=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function X(){this.expando=x.expando+X.uid++}X.uid=1,X.prototype={cache:function(t){var e=t[this.expando];return e||(e={},W(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var i,s=this.cache(t);if("string"==typeof e)s[q(e)]=n;else for(i in e)s[q(i)]=e[i];return s},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][q(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){n=(e=Array.isArray(e)?e.map(q):(e=q(e))in i?[e]:e.match(F)||[]).length;for(;n--;)delete i[e[n]]}(void 0===e||x.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&&!x.isEmptyObject(e)}};var Y=new X,J=new X,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Q(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(K,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(i))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:Z.test(t)?JSON.parse(t):t)}(n)}catch(t){}J.set(t,e,n)}else n=void 0;return n}x.extend({hasData:function(t){return J.hasData(t)||Y.hasData(t)},data:function(t,e,n){return J.access(t,e,n)},removeData:function(t,e){J.remove(t,e)},_data:function(t,e,n){return Y.access(t,e,n)},_removeData:function(t,e){Y.remove(t,e)}}),x.fn.extend({data:function(t,e){var n,i,s,r=this[0],o=r&&r.attributes;if(void 0===t){if(this.length&&(s=J.get(r),1===r.nodeType&&!Y.get(r,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&0===(i=o[n].name).indexOf("data-")&&(i=q(i.slice(5)),Q(r,i,s[i]));Y.set(r,"hasDataAttrs",!0)}return s}return"object"==typeof t?this.each((function(){J.set(this,t)})):_(this,(function(e){var n;if(r&&void 0===e)return void 0!==(n=J.get(r,t))||void 0!==(n=Q(r,t))?n:void 0;this.each((function(){J.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){J.remove(this,t)}))}}),x.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=Y.get(t,e),n&&(!i||Array.isArray(n)?i=Y.access(t,e,x.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=x.queue(t,e),i=n.length,s=n.shift(),r=x._queueHooks(t,e);"inprogress"===s&&(s=n.shift(),i--),s&&("fx"===e&&n.unshift("inprogress"),delete r.stop,s.call(t,(function(){x.dequeue(t,e)}),r)),!i&&r&&r.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Y.get(t,n)||Y.access(t,n,{empty:x.Callbacks("once memory").add((function(){Y.remove(t,[e+"queue",n])}))})}}),x.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?x.queue(this[0],t):void 0===e?this:this.each((function(){var n=x.queue(this,t,e);x._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&x.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){x.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,s=x.Deferred(),r=this,o=this.length,a=function(){--i||s.resolveWith(r,[r])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";o--;)(n=Y.get(r[o],t+"queueHooks"))&&n.empty&&(i++,n.empty.add(a));return a(),s.promise(e)}});var tt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,et=new RegExp("^(?:([+-])=|)("+tt+")([a-z%]*)$","i"),nt=["Top","Right","Bottom","Left"],it=m.documentElement,st=function(t){return x.contains(t.ownerDocument,t)},rt={composed:!0};it.getRootNode&&(st=function(t){return x.contains(t.ownerDocument,t)||t.getRootNode(rt)===t.ownerDocument});var ot=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&st(t)&&"none"===x.css(t,"display")};function at(t,e,n,i){var s,r,o=20,a=i?function(){return i.cur()}:function(){return x.css(t,e,"")},l=a(),h=n&&n[3]||(x.cssNumber[e]?"":"px"),c=t.nodeType&&(x.cssNumber[e]||"px"!==h&&+l)&&et.exec(x.css(t,e));if(c&&c[3]!==h){for(l/=2,h=h||c[3],c=+l||1;o--;)x.style(t,e,c+h),(1-r)*(1-(r=a()/l||.5))<=0&&(o=0),c/=r;c*=2,x.style(t,e,c+h),n=n||[]}return n&&(c=+c||+l||0,s=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=h,i.start=c,i.end=s)),s}var lt={};function ht(t){var e,n=t.ownerDocument,i=t.nodeName,s=lt[i];return s||(e=n.body.appendChild(n.createElement(i)),s=x.css(e,"display"),e.parentNode.removeChild(e),"none"===s&&(s="block"),lt[i]=s,s)}function ct(t,e){for(var n,i,s=[],r=0,o=t.length;r<o;r++)(i=t[r]).style&&(n=i.style.display,e?("none"===n&&(s[r]=Y.get(i,"display")||null,s[r]||(i.style.display="")),""===i.style.display&&ot(i)&&(s[r]=ht(i))):"none"!==n&&(s[r]="none",Y.set(i,"display",n)));for(r=0;r<o;r++)null!=s[r]&&(t[r].style.display=s[r]);return t}x.fn.extend({show:function(){return ct(this,!0)},hide:function(){return ct(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){ot(this)?x(this).show():x(this).hide()}))}});var ut,dt,gt=/^(?:checkbox|radio)$/i,pt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ft=/^$|^module$|\/(?:java|ecma)script/i;ut=m.createDocumentFragment().appendChild(m.createElement("div")),(dt=m.createElement("input")).setAttribute("type","radio"),dt.setAttribute("checked","checked"),dt.setAttribute("name","t"),ut.appendChild(dt),g.checkClone=ut.cloneNode(!0).cloneNode(!0).lastChild.checked,ut.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!ut.cloneNode(!0).lastChild.defaultValue,ut.innerHTML="<option></option>",g.option=!!ut.lastChild;var mt={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 yt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&O(t,e)?x.merge([t],n):n}function bt(t,e){for(var n=0,i=t.length;n<i;n++)Y.set(t[n],"globalEval",!e||Y.get(e[n],"globalEval"))}mt.tbody=mt.tfoot=mt.colgroup=mt.caption=mt.thead,mt.th=mt.td,g.option||(mt.optgroup=mt.option=[1,"<select multiple='multiple'>","</select>"]);var Ct=/<|&#?\w+;/;function vt(t,e,n,i,s){for(var r,o,a,l,h,c,u=e.createDocumentFragment(),d=[],g=0,p=t.length;g<p;g++)if((r=t[g])||0===r)if("object"===C(r))x.merge(d,r.nodeType?[r]:r);else if(Ct.test(r)){for(o=o||u.appendChild(e.createElement("div")),a=(pt.exec(r)||["",""])[1].toLowerCase(),l=mt[a]||mt._default,o.innerHTML=l[1]+x.htmlPrefilter(r)+l[2],c=l[0];c--;)o=o.lastChild;x.merge(d,o.childNodes),(o=u.firstChild).textContent=""}else d.push(e.createTextNode(r));for(u.textContent="",g=0;r=d[g++];)if(i&&x.inArray(r,i)>-1)s&&s.push(r);else if(h=st(r),o=yt(u.appendChild(r),"script"),h&&bt(o),n)for(c=0;r=o[c++];)ft.test(r.type||"")&&n.push(r);return u}var xt=/^([^.]*)(?:\.(.+)|)/;function wt(){return!0}function Et(){return!1}function At(t,e){return t===function(){try{return m.activeElement}catch(t){}}()==("focus"===e)}function Mt(t,e,n,i,s,r){var o,a;if("object"==typeof e){for(a in"string"!=typeof n&&(i=i||n,n=void 0),e)Mt(t,a,n,i,e[a],r);return t}if(null==i&&null==s?(s=n,i=n=void 0):null==s&&("string"==typeof n?(s=i,i=void 0):(s=i,i=n,n=void 0)),!1===s)s=Et;else if(!s)return t;return 1===r&&(o=s,(s=function(t){return x().off(t),o.apply(this,arguments)}).guid=o.guid||(o.guid=x.guid++)),t.each((function(){x.event.add(this,e,s,i,n)}))}function St(t,e,n){n?(Y.set(t,e,!1),x.event.add(t,e,{namespace:!1,handler:function(t){var i,r,o=Y.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(x.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=s.call(arguments),Y.set(this,e,o),i=n(this,e),this[e](),o!==(r=Y.get(this,e))||i?Y.set(this,e,!1):r={},o!==r)return t.stopImmediatePropagation(),t.preventDefault(),r&&r.value}else o.length&&(Y.set(this,e,{value:x.event.trigger(x.extend(o[0],x.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Y.get(t,e)&&x.event.add(t,e,wt)}x.event={global:{},add:function(t,e,n,i,s){var r,o,a,l,h,c,u,d,g,p,f,m=Y.get(t);if(W(t))for(n.handler&&(n=(r=n).handler,s=r.selector),s&&x.find.matchesSelector(it,s),n.guid||(n.guid=x.guid++),(l=m.events)||(l=m.events=Object.create(null)),(o=m.handle)||(o=m.handle=function(e){return void 0!==x&&x.event.triggered!==e.type?x.event.dispatch.apply(t,arguments):void 0}),h=(e=(e||"").match(F)||[""]).length;h--;)g=f=(a=xt.exec(e[h])||[])[1],p=(a[2]||"").split(".").sort(),g&&(u=x.event.special[g]||{},g=(s?u.delegateType:u.bindType)||g,u=x.event.special[g]||{},c=x.extend({type:g,origType:f,data:i,handler:n,guid:n.guid,selector:s,needsContext:s&&x.expr.match.needsContext.test(s),namespace:p.join(".")},r),(d=l[g])||((d=l[g]=[]).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)),s?d.splice(d.delegateCount++,0,c):d.push(c),x.event.global[g]=!0)},remove:function(t,e,n,i,s){var r,o,a,l,h,c,u,d,g,p,f,m=Y.hasData(t)&&Y.get(t);if(m&&(l=m.events)){for(h=(e=(e||"").match(F)||[""]).length;h--;)if(g=f=(a=xt.exec(e[h])||[])[1],p=(a[2]||"").split(".").sort(),g){for(u=x.event.special[g]||{},d=l[g=(i?u.delegateType:u.bindType)||g]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=r=d.length;r--;)c=d[r],!s&&f!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(d.splice(r,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)||x.removeEvent(t,g,m.handle),delete l[g])}else for(g in l)x.event.remove(t,g+e[h],n,i,!0);x.isEmptyObject(l)&&Y.remove(t,"handle events")}},dispatch:function(t){var e,n,i,s,r,o,a=new Array(arguments.length),l=x.event.fix(t),h=(Y.get(this,"events")||Object.create(null))[l.type]||[],c=x.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)){for(o=x.event.handlers.call(this,l,h),e=0;(s=o[e++])&&!l.isPropagationStopped();)for(l.currentTarget=s.elem,n=0;(r=s.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==r.namespace&&!l.rnamespace.test(r.namespace)||(l.handleObj=r,l.data=r.data,void 0!==(i=((x.event.special[r.origType]||{}).handle||r.handler).apply(s.elem,a))&&!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,s,r,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(r=[],o={},n=0;n<l;n++)void 0===o[s=(i=e[n]).selector+" "]&&(o[s]=i.needsContext?x(s,this).index(h)>-1:x.find(s,this,null,[h]).length),o[s]&&r.push(i);r.length&&a.push({elem:h,handlers:r})}return h=this,l<e.length&&a.push({elem:h,handlers:e.slice(l)}),a},addProp:function(t,e){Object.defineProperty(x.Event.prototype,t,{enumerable:!0,configurable:!0,get:p(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[x.expando]?t:new x.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return gt.test(e.type)&&e.click&&O(e,"input")&&St(e,"click",wt),!1},trigger:function(t){var e=this||t;return gt.test(e.type)&&e.click&&O(e,"input")&&St(e,"click"),!0},_default:function(t){var e=t.target;return gt.test(e.type)&&e.click&&O(e,"input")&&Y.get(e,"click")||O(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},x.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},x.Event=function(t,e){if(!(this instanceof x.Event))return new x.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?wt:Et,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&&x.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[x.expando]=!0},x.Event.prototype={constructor:x.Event,isDefaultPrevented:Et,isPropagationStopped:Et,isImmediatePropagationStopped:Et,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=wt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=wt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=wt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},x.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},x.event.addProp),x.each({focus:"focusin",blur:"focusout"},(function(t,e){x.event.special[t]={setup:function(){return St(this,t,At),!1},trigger:function(){return St(this,t),!0},_default:function(){return!0},delegateType:e}})),x.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){x.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=this,s=t.relatedTarget,r=t.handleObj;return s&&(s===i||x.contains(i,s))||(t.type=r.origType,n=r.handler.apply(this,arguments),t.type=e),n}}})),x.fn.extend({on:function(t,e,n,i){return Mt(this,t,e,n,i)},one:function(t,e,n,i){return Mt(this,t,e,n,i,1)},off:function(t,e,n){var i,s;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,x(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(s in t)this.off(s,e,t[s]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=Et),this.each((function(){x.event.remove(this,t,n,e)}))}});var Ot=/<script|<style|<link/i,kt=/checked\s*(?:[^=]|=\s*.checked.)/i,Pt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Tt(t,e){return O(t,"table")&&O(11!==e.nodeType?e:e.firstChild,"tr")&&x(t).children("tbody")[0]||t}function Dt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Nt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function jt(t,e){var n,i,s,r,o,a;if(1===e.nodeType){if(Y.hasData(t)&&(a=Y.get(t).events))for(s in Y.remove(e,"handle events"),a)for(n=0,i=a[s].length;n<i;n++)x.event.add(e,s,a[s][n]);J.hasData(t)&&(r=J.access(t),o=x.extend({},r),J.set(e,o))}}function Lt(t,e){var n=e.nodeName.toLowerCase();"input"===n&&gt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function Ft(t,e,n,i){e=r(e);var s,o,a,l,h,c,u=0,d=t.length,f=d-1,m=e[0],y=p(m);if(y||d>1&&"string"==typeof m&&!g.checkClone&&kt.test(m))return t.each((function(s){var r=t.eq(s);y&&(e[0]=m.call(this,s,r.html())),Ft(r,e,n,i)}));if(d&&(o=(s=vt(e,t[0].ownerDocument,!1,t,i)).firstChild,1===s.childNodes.length&&(s=o),o||i)){for(l=(a=x.map(yt(s,"script"),Dt)).length;u<d;u++)h=s,u!==f&&(h=x.clone(h,!0,!0),l&&x.merge(a,yt(h,"script"))),n.call(t[u],h,u);if(l)for(c=a[a.length-1].ownerDocument,x.map(a,Nt),u=0;u<l;u++)h=a[u],ft.test(h.type||"")&&!Y.access(h,"globalEval")&&x.contains(c,h)&&(h.src&&"module"!==(h.type||"").toLowerCase()?x._evalUrl&&!h.noModule&&x._evalUrl(h.src,{nonce:h.nonce||h.getAttribute("nonce")},c):b(h.textContent.replace(Pt,""),h,c))}return t}function zt(t,e,n){for(var i,s=e?x.filter(e,t):t,r=0;null!=(i=s[r]);r++)n||1!==i.nodeType||x.cleanData(yt(i)),i.parentNode&&(n&&st(i)&&bt(yt(i,"script")),i.parentNode.removeChild(i));return t}x.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var i,s,r,o,a=t.cloneNode(!0),l=st(t);if(!(g.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||x.isXMLDoc(t)))for(o=yt(a),i=0,s=(r=yt(t)).length;i<s;i++)Lt(r[i],o[i]);if(e)if(n)for(r=r||yt(t),o=o||yt(a),i=0,s=r.length;i<s;i++)jt(r[i],o[i]);else jt(t,a);return(o=yt(a,"script")).length>0&&bt(o,!l&&yt(t,"script")),a},cleanData:function(t){for(var e,n,i,s=x.event.special,r=0;void 0!==(n=t[r]);r++)if(W(n)){if(e=n[Y.expando]){if(e.events)for(i in e.events)s[i]?x.event.remove(n,i):x.removeEvent(n,i,e.handle);n[Y.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),x.fn.extend({detach:function(t){return zt(this,t,!0)},remove:function(t){return zt(this,t)},text:function(t){return _(this,(function(t){return void 0===t?x.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 Ft(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Tt(this,t).appendChild(t)}))},prepend:function(){return Ft(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Tt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Ft(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Ft(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&&(x.cleanData(yt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return x.clone(this,t,e)}))},html:function(t){return _(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&&!Ot.test(t)&&!mt[(pt.exec(t)||["",""])[1].toLowerCase()]){t=x.htmlPrefilter(t);try{for(;n<i;n++)1===(e=this[n]||{}).nodeType&&(x.cleanData(yt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Ft(this,arguments,(function(e){var n=this.parentNode;x.inArray(this,t)<0&&(x.cleanData(yt(this)),n&&n.replaceChild(e,this))}),t)}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){x.fn[t]=function(t){for(var n,i=[],s=x(t),r=s.length-1,a=0;a<=r;a++)n=a===r?this:this.clone(!0),x(s[a])[e](n),o.apply(i,n.get());return this.pushStack(i)}}));var Bt=new RegExp("^("+tt+")(?!px)[a-z%]+$","i"),$t=function(e){var n=e.ownerDocument.defaultView;return n&&n.opener||(n=t),n.getComputedStyle(e)},Rt=function(t,e,n){var i,s,r={};for(s in e)r[s]=t.style[s],t.style[s]=e[s];for(s in i=n.call(t),e)t.style[s]=r[s];return i},It=new RegExp(nt.join("|"),"i");function Vt(t,e,n){var i,s,r,o,a=t.style;return(n=n||$t(t))&&(""!==(o=n.getPropertyValue(e)||n[e])||st(t)||(o=x.style(t,e)),!g.pixelBoxStyles()&&Bt.test(o)&&It.test(e)&&(i=a.width,s=a.minWidth,r=a.maxWidth,a.minWidth=a.maxWidth=a.width=o,o=n.width,a.width=i,a.minWidth=s,a.maxWidth=r)),void 0!==o?o+"":o}function _t(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function e(){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%",it.appendChild(h).appendChild(c);var e=t.getComputedStyle(c);i="1%"!==e.top,l=12===n(e.marginLeft),c.style.right="60%",o=36===n(e.right),s=36===n(e.width),c.style.position="absolute",r=12===n(c.offsetWidth/3),it.removeChild(h),c=null}}function n(t){return Math.round(parseFloat(t))}var i,s,r,o,a,l,h=m.createElement("div"),c=m.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===c.style.backgroundClip,x.extend(g,{boxSizingReliable:function(){return e(),s},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),i},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),r},reliableTrDimensions:function(){var e,n,i,s;return null==a&&(e=m.createElement("table"),n=m.createElement("tr"),i=m.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",i.style.height="9px",i.style.display="block",it.appendChild(e).appendChild(n).appendChild(i),s=t.getComputedStyle(n),a=parseInt(s.height,10)+parseInt(s.borderTopWidth,10)+parseInt(s.borderBottomWidth,10)===n.offsetHeight,it.removeChild(e)),a}}))}();var Gt=["Webkit","Moz","ms"],Ht=m.createElement("div").style,Ut={};function qt(t){var e=x.cssProps[t]||Ut[t];return e||(t in Ht?t:Ut[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Gt.length;n--;)if((t=Gt[n]+e)in Ht)return t}(t)||t)}var Wt=/^(none|table(?!-c[ea]).+)/,Xt=/^--/,Yt={position:"absolute",visibility:"hidden",display:"block"},Jt={letterSpacing:"0",fontWeight:"400"};function Zt(t,e,n){var i=et.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function Kt(t,e,n,i,s,r){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+=x.css(t,n+nt[o],!0,s)),i?("content"===n&&(l-=x.css(t,"padding"+nt[o],!0,s)),"margin"!==n&&(l-=x.css(t,"border"+nt[o]+"Width",!0,s))):(l+=x.css(t,"padding"+nt[o],!0,s),"padding"!==n?l+=x.css(t,"border"+nt[o]+"Width",!0,s):a+=x.css(t,"border"+nt[o]+"Width",!0,s));return!i&&r>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-r-l-a-.5))||0),l}function Qt(t,e,n){var i=$t(t),s=(!g.boxSizingReliable()||n)&&"border-box"===x.css(t,"boxSizing",!1,i),r=s,o=Vt(t,e,i),a="offset"+e[0].toUpperCase()+e.slice(1);if(Bt.test(o)){if(!n)return o;o="auto"}return(!g.boxSizingReliable()&&s||!g.reliableTrDimensions()&&O(t,"tr")||"auto"===o||!parseFloat(o)&&"inline"===x.css(t,"display",!1,i))&&t.getClientRects().length&&(s="border-box"===x.css(t,"boxSizing",!1,i),(r=a in t)&&(o=t[a])),(o=parseFloat(o)||0)+Kt(t,e,n||(s?"border":"content"),r,i,o)+"px"}function te(t,e,n,i,s){return new te.prototype.init(t,e,n,i,s)}x.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Vt(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 s,r,o,a=q(e),l=Xt.test(e),h=t.style;if(l||(e=qt(a)),o=x.cssHooks[e]||x.cssHooks[a],void 0===n)return o&&"get"in o&&void 0!==(s=o.get(t,!1,i))?s:h[e];"string"===(r=typeof n)&&(s=et.exec(n))&&s[1]&&(n=at(t,e,s),r="number"),null!=n&&n==n&&("number"!==r||l||(n+=s&&s[3]||(x.cssNumber[a]?"":"px")),g.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 s,r,o,a=q(e);return Xt.test(e)||(e=qt(a)),(o=x.cssHooks[e]||x.cssHooks[a])&&"get"in o&&(s=o.get(t,!0,n)),void 0===s&&(s=Vt(t,e,i)),"normal"===s&&e in Jt&&(s=Jt[e]),""===n||n?(r=parseFloat(s),!0===n||isFinite(r)?r||0:s):s}}),x.each(["height","width"],(function(t,e){x.cssHooks[e]={get:function(t,n,i){if(n)return!Wt.test(x.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?Qt(t,e,i):Rt(t,Yt,(function(){return Qt(t,e,i)}))},set:function(t,n,i){var s,r=$t(t),o=!g.scrollboxSize()&&"absolute"===r.position,a=(o||i)&&"border-box"===x.css(t,"boxSizing",!1,r),l=i?Kt(t,e,i,a,r):0;return a&&o&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(r[e])-Kt(t,e,"border",!1,r)-.5)),l&&(s=et.exec(n))&&"px"!==(s[3]||"px")&&(t.style[e]=n,n=x.css(t,e)),Zt(0,n,l)}}})),x.cssHooks.marginLeft=_t(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Vt(t,"marginLeft"))||t.getBoundingClientRect().left-Rt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),x.each({margin:"",padding:"",border:"Width"},(function(t,e){x.cssHooks[t+e]={expand:function(n){for(var i=0,s={},r="string"==typeof n?n.split(" "):[n];i<4;i++)s[t+nt[i]+e]=r[i]||r[i-2]||r[0];return s}},"margin"!==t&&(x.cssHooks[t+e].set=Zt)})),x.fn.extend({css:function(t,e){return _(this,(function(t,e,n){var i,s,r={},o=0;if(Array.isArray(e)){for(i=$t(t),s=e.length;o<s;o++)r[e[o]]=x.css(t,e[o],!1,i);return r}return void 0!==n?x.style(t,e,n):x.css(t,e)}),t,e,arguments.length>1)}}),x.Tween=te,te.prototype={constructor:te,init:function(t,e,n,i,s,r){this.elem=t,this.prop=n,this.easing=s||x.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=r||(x.cssNumber[n]?"":"px")},cur:function(){var t=te.propHooks[this.prop];return t&&t.get?t.get(this):te.propHooks._default.get(this)},run:function(t){var e,n=te.propHooks[this.prop];return this.options.duration?this.pos=e=x.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):te.propHooks._default.set(this),this}},te.prototype.init.prototype=te.prototype,te.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=x.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){x.fx.step[t.prop]?x.fx.step[t.prop](t):1!==t.elem.nodeType||!x.cssHooks[t.prop]&&null==t.elem.style[qt(t.prop)]?t.elem[t.prop]=t.now:x.style(t.elem,t.prop,t.now+t.unit)}}},te.propHooks.scrollTop=te.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},x.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},x.fx=te.prototype.init,x.fx.step={};var ee,ne,ie=/^(?:toggle|show|hide)$/,se=/queueHooks$/;function re(){ne&&(!1===m.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(re):t.setTimeout(re,x.fx.interval),x.fx.tick())}function oe(){return t.setTimeout((function(){ee=void 0})),ee=Date.now()}function ae(t,e){var n,i=0,s={height:t};for(e=e?1:0;i<4;i+=2-e)s["margin"+(n=nt[i])]=s["padding"+n]=t;return e&&(s.opacity=s.width=t),s}function le(t,e,n){for(var i,s=(he.tweeners[e]||[]).concat(he.tweeners["*"]),r=0,o=s.length;r<o;r++)if(i=s[r].call(n,e,t))return i}function he(t,e,n){var i,s,r=0,o=he.prefilters.length,a=x.Deferred().always((function(){delete l.elem})),l=function(){if(s)return!1;for(var e=ee||oe(),n=Math.max(0,h.startTime+h.duration-e),i=1-(n/h.duration||0),r=0,o=h.tweens.length;r<o;r++)h.tweens[r].run(i);return a.notifyWith(t,[h,i,n]),i<1&&o?n:(o||a.notifyWith(t,[h,1,0]),a.resolveWith(t,[h]),!1)},h=a.promise({elem:t,props:x.extend({},e),opts:x.extend(!0,{specialEasing:{},easing:x.easing._default},n),originalProperties:e,originalOptions:n,startTime:ee||oe(),duration:n.duration,tweens:[],createTween:function(e,n){var i=x.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(s)return this;for(s=!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(!function(t,e){var n,i,s,r,o;for(n in t)if(s=e[i=q(n)],r=t[n],Array.isArray(r)&&(s=r[1],r=t[n]=r[0]),n!==i&&(t[i]=r,delete t[n]),(o=x.cssHooks[i])&&"expand"in o)for(n in r=o.expand(r),delete t[i],r)n in t||(t[n]=r[n],e[n]=s);else e[i]=s}(c,h.opts.specialEasing);r<o;r++)if(i=he.prefilters[r].call(h,t,c,h.opts))return p(i.stop)&&(x._queueHooks(h.elem,h.opts.queue).stop=i.stop.bind(i)),i;return x.map(c,le,h),p(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),x.fx.timer(x.extend(l,{elem:t,anim:h,queue:h.opts.queue})),h}x.Animation=x.extend(he,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return at(n.elem,t,et.exec(e),n),n}]},tweener:function(t,e){p(t)?(e=t,t=["*"]):t=t.match(F);for(var n,i=0,s=t.length;i<s;i++)n=t[i],he.tweeners[n]=he.tweeners[n]||[],he.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var i,s,r,o,a,l,h,c,u="width"in e||"height"in e,d=this,g={},p=t.style,f=t.nodeType&&ot(t),m=Y.get(t,"fxshow");for(i in n.queue||(null==(o=x._queueHooks(t,"fx")).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--,x.queue(t,"fx").length||o.empty.fire()}))}))),e)if(s=e[i],ie.test(s)){if(delete e[i],r=r||"toggle"===s,s===(f?"hide":"show")){if("show"!==s||!m||void 0===m[i])continue;f=!0}g[i]=m&&m[i]||x.style(t,i)}if((l=!x.isEmptyObject(e))||!x.isEmptyObject(g))for(i in u&&1===t.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(h=m&&m.display)&&(h=Y.get(t,"display")),"none"===(c=x.css(t,"display"))&&(h?c=h:(ct([t],!0),h=t.style.display||h,c=x.css(t,"display"),ct([t]))),("inline"===c||"inline-block"===c&&null!=h)&&"none"===x.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=Y.access(t,"fxshow",{display:h}),r&&(m.hidden=!f),f&&ct([t],!0),d.done((function(){for(i in f||ct([t]),Y.remove(t,"fxshow"),g)x.style(t,i,g[i])}))),l=le(f?m[i]:0,i,d),i in m||(m[i]=l.start,f&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?he.prefilters.unshift(t):he.prefilters.push(t)}}),x.speed=function(t,e,n){var i=t&&"object"==typeof t?x.extend({},t):{complete:n||!n&&e||p(t)&&t,duration:t,easing:n&&e||e&&!p(e)&&e};return x.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in x.fx.speeds?i.duration=x.fx.speeds[i.duration]:i.duration=x.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){p(i.old)&&i.old.call(this),i.queue&&x.dequeue(this,i.queue)},i},x.fn.extend({fadeTo:function(t,e,n,i){return this.filter(ot).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var s=x.isEmptyObject(t),r=x.speed(e,n,i),o=function(){var e=he(this,x.extend({},t),r);(s||Y.get(this,"finish"))&&e.stop(!0)};return o.finish=o,s||!1===r.queue?this.each(o):this.queue(r.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,s=null!=t&&t+"queueHooks",r=x.timers,o=Y.get(this);if(s)o[s]&&o[s].stop&&i(o[s]);else for(s in o)o[s]&&o[s].stop&&se.test(s)&&i(o[s]);for(s=r.length;s--;)r[s].elem!==this||null!=t&&r[s].queue!==t||(r[s].anim.stop(n),e=!1,r.splice(s,1));!e&&n||x.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=Y.get(this),i=n[t+"queue"],s=n[t+"queueHooks"],r=x.timers,o=i?i.length:0;for(n.finish=!0,x.queue(this,t,[]),s&&s.stop&&s.stop.call(this,!0),e=r.length;e--;)r[e].elem===this&&r[e].queue===t&&(r[e].anim.stop(!0),r.splice(e,1));for(e=0;e<o;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish}))}}),x.each(["toggle","show","hide"],(function(t,e){var n=x.fn[e];x.fn[e]=function(t,i,s){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(ae(e,!0),t,i,s)}})),x.each({slideDown:ae("show"),slideUp:ae("hide"),slideToggle:ae("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){x.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),x.timers=[],x.fx.tick=function(){var t,e=0,n=x.timers;for(ee=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||x.fx.stop(),ee=void 0},x.fx.timer=function(t){x.timers.push(t),x.fx.start()},x.fx.interval=13,x.fx.start=function(){ne||(ne=!0,re())},x.fx.stop=function(){ne=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fn.delay=function(e,n){return e=x.fx&&x.fx.speeds[e]||e,n=n||"fx",this.queue(n,(function(n,i){var s=t.setTimeout(n,e);i.stop=function(){t.clearTimeout(s)}}))},function(){var t=m.createElement("input"),e=m.createElement("select").appendChild(m.createElement("option"));t.type="checkbox",g.checkOn=""!==t.value,g.optSelected=e.selected,(t=m.createElement("input")).value="t",t.type="radio",g.radioValue="t"===t.value}();var ce,ue=x.expr.attrHandle;x.fn.extend({attr:function(t,e){return _(this,x.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){x.removeAttr(this,t)}))}}),x.extend({attr:function(t,e,n){var i,s,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return void 0===t.getAttribute?x.prop(t,e,n):(1===r&&x.isXMLDoc(t)||(s=x.attrHooks[e.toLowerCase()]||(x.expr.match.bool.test(e)?ce:void 0)),void 0!==n?null===n?void x.removeAttr(t,e):s&&"set"in s&&void 0!==(i=s.set(t,n,e))?i:(t.setAttribute(e,n+""),n):s&&"get"in s&&null!==(i=s.get(t,e))?i:null==(i=x.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&O(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,s=e&&e.match(F);if(s&&1===t.nodeType)for(;n=s[i++];)t.removeAttribute(n)}}),ce={set:function(t,e,n){return!1===e?x.removeAttr(t,n):t.setAttribute(n,n),n}},x.each(x.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=ue[e]||x.find.attr;ue[e]=function(t,e,i){var s,r,o=e.toLowerCase();return i||(r=ue[o],ue[o]=s,s=null!=n(t,e,i)?o:null,ue[o]=r),s}}));var de=/^(?:input|select|textarea|button)$/i,ge=/^(?:a|area)$/i;function pe(t){return(t.match(F)||[]).join(" ")}function fe(t){return t.getAttribute&&t.getAttribute("class")||""}function me(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(F)||[]}x.fn.extend({prop:function(t,e){return _(this,x.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[x.propFix[t]||t]}))}}),x.extend({prop:function(t,e,n){var i,s,r=t.nodeType;if(3!==r&&8!==r&&2!==r)return 1===r&&x.isXMLDoc(t)||(e=x.propFix[e]||e,s=x.propHooks[e]),void 0!==n?s&&"set"in s&&void 0!==(i=s.set(t,n,e))?i:t[e]=n:s&&"get"in s&&null!==(i=s.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=x.find.attr(t,"tabindex");return e?parseInt(e,10):de.test(t.nodeName)||ge.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(x.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)}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){x.propFix[this.toLowerCase()]=this})),x.fn.extend({addClass:function(t){var e,n,i,s,r,o,a,l=0;if(p(t))return this.each((function(e){x(this).addClass(t.call(this,e,fe(this)))}));if((e=me(t)).length)for(;n=this[l++];)if(s=fe(n),i=1===n.nodeType&&" "+pe(s)+" "){for(o=0;r=e[o++];)i.indexOf(" "+r+" ")<0&&(i+=r+" ");s!==(a=pe(i))&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,s,r,o,a,l=0;if(p(t))return this.each((function(e){x(this).removeClass(t.call(this,e,fe(this)))}));if(!arguments.length)return this.attr("class","");if((e=me(t)).length)for(;n=this[l++];)if(s=fe(n),i=1===n.nodeType&&" "+pe(s)+" "){for(o=0;r=e[o++];)for(;i.indexOf(" "+r+" ")>-1;)i=i.replace(" "+r+" "," ");s!==(a=pe(i))&&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):p(t)?this.each((function(n){x(this).toggleClass(t.call(this,n,fe(this),e),e)})):this.each((function(){var e,s,r,o;if(i)for(s=0,r=x(this),o=me(t);e=o[s++];)r.hasClass(e)?r.removeClass(e):r.addClass(e);else void 0!==t&&"boolean"!==n||((e=fe(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Y.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+pe(fe(n))+" ").indexOf(e)>-1)return!0;return!1}});var ye=/\r/g;x.fn.extend({val:function(t){var e,n,i,s=this[0];return arguments.length?(i=p(t),this.each((function(n){var s;1===this.nodeType&&(null==(s=i?t.call(this,n,x(this).val()):t)?s="":"number"==typeof s?s+="":Array.isArray(s)&&(s=x.map(s,(function(t){return null==t?"":t+""}))),(e=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,s,"value")||(this.value=s))}))):s?(e=x.valHooks[s.type]||x.valHooks[s.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(s,"value"))?n:"string"==typeof(n=s.value)?n.replace(ye,""):null==n?"":n:void 0}}),x.extend({valHooks:{option:{get:function(t){var e=x.find.attr(t,"value");return null!=e?e:pe(x.text(t))}},select:{get:function(t){var e,n,i,s=t.options,r=t.selectedIndex,o="select-one"===t.type,a=o?null:[],l=o?r+1:s.length;for(i=r<0?l:o?r:0;i<l;i++)if(((n=s[i]).selected||i===r)&&!n.disabled&&(!n.parentNode.disabled||!O(n.parentNode,"optgroup"))){if(e=x(n).val(),o)return e;a.push(e)}return a},set:function(t,e){for(var n,i,s=t.options,r=x.makeArray(e),o=s.length;o--;)((i=s[o]).selected=x.inArray(x.valHooks.option.get(i),r)>-1)&&(n=!0);return n||(t.selectedIndex=-1),r}}}}),x.each(["radio","checkbox"],(function(){x.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=x.inArray(x(t).val(),e)>-1}},g.checkOn||(x.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),g.focusin="onfocusin"in t;var be=/^(?:focusinfocus|focusoutblur)$/,Ce=function(t){t.stopPropagation()};x.extend(x.event,{trigger:function(e,n,i,s){var r,o,a,l,h,u,d,g,y=[i||m],b=c.call(e,"type")?e.type:e,C=c.call(e,"namespace")?e.namespace.split("."):[];if(o=g=a=i=i||m,3!==i.nodeType&&8!==i.nodeType&&!be.test(b+x.event.triggered)&&(b.indexOf(".")>-1&&(C=b.split("."),b=C.shift(),C.sort()),h=b.indexOf(":")<0&&"on"+b,(e=e[x.expando]?e:new x.Event(b,"object"==typeof e&&e)).isTrigger=s?2:3,e.namespace=C.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+C.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),n=null==n?[e]:x.makeArray(n,[e]),d=x.event.special[b]||{},s||!d.trigger||!1!==d.trigger.apply(i,n))){if(!s&&!d.noBubble&&!f(i)){for(l=d.delegateType||b,be.test(l+b)||(o=o.parentNode);o;o=o.parentNode)y.push(o),a=o;a===(i.ownerDocument||m)&&y.push(a.defaultView||a.parentWindow||t)}for(r=0;(o=y[r++])&&!e.isPropagationStopped();)g=o,e.type=r>1?l:d.bindType||b,(u=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&u.apply(o,n),(u=h&&o[h])&&u.apply&&W(o)&&(e.result=u.apply(o,n),!1===e.result&&e.preventDefault());return e.type=b,s||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(y.pop(),n)||!W(i)||h&&p(i[b])&&!f(i)&&((a=i[h])&&(i[h]=null),x.event.triggered=b,e.isPropagationStopped()&&g.addEventListener(b,Ce),i[b](),e.isPropagationStopped()&&g.removeEventListener(b,Ce),x.event.triggered=void 0,a&&(i[h]=a)),e.result}},simulate:function(t,e,n){var i=x.extend(new x.Event,n,{type:t,isSimulated:!0});x.event.trigger(i,null,e)}}),x.fn.extend({trigger:function(t,e){return this.each((function(){x.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return x.event.trigger(t,e,n,!0)}}),g.focusin||x.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){x.event.simulate(e,t.target,x.event.fix(t))};x.event.special[e]={setup:function(){var i=this.ownerDocument||this.document||this,s=Y.access(i,e);s||i.addEventListener(t,n,!0),Y.access(i,e,(s||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,s=Y.access(i,e)-1;s?Y.access(i,e,s):(i.removeEventListener(t,n,!0),Y.remove(i,e))}}}));var ve=t.location,xe={guid:Date.now()},we=/\?/;x.parseXML=function(e){var n,i;if(!e||"string"!=typeof e)return null;try{n=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){}return i=n&&n.getElementsByTagName("parsererror")[0],n&&!i||x.error("Invalid XML: "+(i?x.map(i.childNodes,(function(t){return t.textContent})).join("\n"):e)),n};var Ee=/\[\]$/,Ae=/\r?\n/g,Me=/^(?:submit|button|image|reset|file)$/i,Se=/^(?:input|select|textarea|keygen)/i;function Oe(t,e,n,i){var s;if(Array.isArray(e))x.each(e,(function(e,s){n||Ee.test(t)?i(t,s):Oe(t+"["+("object"==typeof s&&null!=s?e:"")+"]",s,n,i)}));else if(n||"object"!==C(e))i(t,e);else for(s in e)Oe(t+"["+s+"]",e[s],n,i)}x.param=function(t,e){var n,i=[],s=function(t,e){var n=p(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!x.isPlainObject(t))x.each(t,(function(){s(this.name,this.value)}));else for(n in t)Oe(n,t[n],e,s);return i.join("&")},x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=x.prop(this,"elements");return t?x.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!x(this).is(":disabled")&&Se.test(this.nodeName)&&!Me.test(t)&&(this.checked||!gt.test(t))})).map((function(t,e){var n=x(this).val();return null==n?null:Array.isArray(n)?x.map(n,(function(t){return{name:e.name,value:t.replace(Ae,"\r\n")}})):{name:e.name,value:n.replace(Ae,"\r\n")}})).get()}});var ke=/%20/g,Pe=/#.*$/,Te=/([?&])_=[^&]*/,De=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ne=/^(?:GET|HEAD)$/,je=/^\/\//,Le={},Fe={},ze="*/".concat("*"),Be=m.createElement("a");function $e(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,s=0,r=e.toLowerCase().match(F)||[];if(p(n))for(;i=r[s++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Re(t,e,n,i){var s={},r=t===Fe;function o(a){var l;return s[a]=!0,x.each(t[a]||[],(function(t,a){var h=a(e,n,i);return"string"!=typeof h||r||s[h]?r?!(l=h):void 0:(e.dataTypes.unshift(h),o(h),!1)})),l}return o(e.dataTypes[0])||!s["*"]&&o("*")}function Ie(t,e){var n,i,s=x.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((s[n]?t:i||(i={}))[n]=e[n]);return i&&x.extend(!0,t,i),t}Be.href=ve.href,x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ve.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ve.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ze,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":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ie(Ie(t,x.ajaxSettings),e):Ie(x.ajaxSettings,t)},ajaxPrefilter:$e(Le),ajaxTransport:$e(Fe),ajax:function(e,n){"object"==typeof e&&(n=e,e=void 0),n=n||{};var i,s,r,o,a,l,h,c,u,d,g=x.ajaxSetup({},n),p=g.context||g,f=g.context&&(p.nodeType||p.jquery)?x(p):x.event,y=x.Deferred(),b=x.Callbacks("once memory"),C=g.statusCode||{},v={},w={},E="canceled",A={readyState:0,getResponseHeader:function(t){var e;if(h){if(!o)for(o={};e=De.exec(r);)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?r: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)A.always(t[A.status]);else for(e in t)C[e]=[C[e],t[e]];return this},abort:function(t){var e=t||E;return i&&i.abort(e),M(0,e),this}};if(y.promise(A),g.url=((e||g.url||ve.href)+"").replace(je,ve.protocol+"//"),g.type=n.method||n.type||g.method||g.type,g.dataTypes=(g.dataType||"*").toLowerCase().match(F)||[""],null==g.crossDomain){l=m.createElement("a");try{l.href=g.url,l.href=l.href,g.crossDomain=Be.protocol+"//"+Be.host!=l.protocol+"//"+l.host}catch(t){g.crossDomain=!0}}if(g.data&&g.processData&&"string"!=typeof g.data&&(g.data=x.param(g.data,g.traditional)),Re(Le,g,n,A),h)return A;for(u in(c=x.event&&g.global)&&0==x.active++&&x.event.trigger("ajaxStart"),g.type=g.type.toUpperCase(),g.hasContent=!Ne.test(g.type),s=g.url.replace(Pe,""),g.hasContent?g.data&&g.processData&&0===(g.contentType||"").indexOf("application/x-www-form-urlencoded")&&(g.data=g.data.replace(ke,"+")):(d=g.url.slice(s.length),g.data&&(g.processData||"string"==typeof g.data)&&(s+=(we.test(s)?"&":"?")+g.data,delete g.data),!1===g.cache&&(s=s.replace(Te,"$1"),d=(we.test(s)?"&":"?")+"_="+xe.guid+++d),g.url=s+d),g.ifModified&&(x.lastModified[s]&&A.setRequestHeader("If-Modified-Since",x.lastModified[s]),x.etag[s]&&A.setRequestHeader("If-None-Match",x.etag[s])),(g.data&&g.hasContent&&!1!==g.contentType||n.contentType)&&A.setRequestHeader("Content-Type",g.contentType),A.setRequestHeader("Accept",g.dataTypes[0]&&g.accepts[g.dataTypes[0]]?g.accepts[g.dataTypes[0]]+("*"!==g.dataTypes[0]?", "+ze+"; q=0.01":""):g.accepts["*"]),g.headers)A.setRequestHeader(u,g.headers[u]);if(g.beforeSend&&(!1===g.beforeSend.call(p,A,g)||h))return A.abort();if(E="abort",b.add(g.complete),A.done(g.success),A.fail(g.error),i=Re(Fe,g,n,A)){if(A.readyState=1,c&&f.trigger("ajaxSend",[A,g]),h)return A;g.async&&g.timeout>0&&(a=t.setTimeout((function(){A.abort("timeout")}),g.timeout));try{h=!1,i.send(v,M)}catch(t){if(h)throw t;M(-1,t)}}else M(-1,"No Transport");function M(e,n,o,l){var u,d,m,v,w,E=n;h||(h=!0,a&&t.clearTimeout(a),i=void 0,r=l||"",A.readyState=e>0?4:0,u=e>=200&&e<300||304===e,o&&(v=function(t,e,n){for(var i,s,r,o,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){l.unshift(s);break}if(l[0]in n)r=l[0];else{for(s in n){if(!l[0]||t.converters[s+" "+l[0]]){r=s;break}o||(o=s)}r=r||o}if(r)return r!==l[0]&&l.unshift(r),n[r]}(g,A,o)),!u&&x.inArray("script",g.dataTypes)>-1&&x.inArray("json",g.dataTypes)<0&&(g.converters["text script"]=function(){}),v=function(t,e,n,i){var s,r,o,a,l,h={},c=t.dataTypes.slice();if(c[1])for(o in t.converters)h[o.toLowerCase()]=t.converters[o];for(r=c.shift();r;)if(t.responseFields[r]&&(n[t.responseFields[r]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=r,r=c.shift())if("*"===r)r=l;else if("*"!==l&&l!==r){if(!(o=h[l+" "+r]||h["* "+r]))for(s in h)if((a=s.split(" "))[1]===r&&(o=h[l+" "+a[0]]||h["* "+a[0]])){!0===o?o=h[s]:!0!==h[s]&&(r=a[0],c.unshift(a[1]));break}if(!0!==o)if(o&&t.throws)e=o(e);else try{e=o(e)}catch(t){return{state:"parsererror",error:o?t:"No conversion from "+l+" to "+r}}}return{state:"success",data:e}}(g,v,A,u),u?(g.ifModified&&((w=A.getResponseHeader("Last-Modified"))&&(x.lastModified[s]=w),(w=A.getResponseHeader("etag"))&&(x.etag[s]=w)),204===e||"HEAD"===g.type?E="nocontent":304===e?E="notmodified":(E=v.state,d=v.data,u=!(m=v.error))):(m=E,!e&&E||(E="error",e<0&&(e=0))),A.status=e,A.statusText=(n||E)+"",u?y.resolveWith(p,[d,E,A]):y.rejectWith(p,[A,E,m]),A.statusCode(C),C=void 0,c&&f.trigger(u?"ajaxSuccess":"ajaxError",[A,g,u?d:m]),b.fireWith(p,[A,E]),c&&(f.trigger("ajaxComplete",[A,g]),--x.active||x.event.trigger("ajaxStop")))}return A},getJSON:function(t,e,n){return x.get(t,e,n,"json")},getScript:function(t,e){return x.get(t,void 0,e,"script")}}),x.each(["get","post"],(function(t,e){x[e]=function(t,n,i,s){return p(n)&&(s=s||i,i=n,n=void 0),x.ajax(x.extend({url:t,type:e,dataType:s,data:n,success:i},x.isPlainObject(t)&&t))}})),x.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),x._evalUrl=function(t,e,n){return x.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){x.globalEval(t,e,n)}})},x.fn.extend({wrapAll:function(t){var e;return this[0]&&(p(t)&&(t=t.call(this[0])),e=x(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return p(t)?this.each((function(e){x(this).wrapInner(t.call(this,e))})):this.each((function(){var e=x(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=p(t);return this.each((function(n){x(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){x(this).replaceWith(this.childNodes)})),this}}),x.expr.pseudos.hidden=function(t){return!x.expr.pseudos.visible(t)},x.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},x.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Ve={0:200,1223:204},_e=x.ajaxSettings.xhr();g.cors=!!_e&&"withCredentials"in _e,g.ajax=_e=!!_e,x.ajaxTransport((function(e){var n,i;if(g.cors||_e&&!e.crossDomain)return{send:function(s,r){var o,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)a[o]=e.xhrFields[o];for(o in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest"),s)a.setRequestHeader(o,s[o]);n=function(t){return function(){n&&(n=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?r(0,"error"):r(a.status,a.statusText):r(Ve[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),i=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&t.setTimeout((function(){n&&i()}))},n=n("abort");try{a.send(e.hasContent&&e.data||null)}catch(t){if(n)throw t}},abort:function(){n&&n()}}})),x.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),x.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 x.globalEval(t),t}}}),x.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),x.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,s){e=x("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&s("error"===t.type?404:200,t.type)}),m.head.appendChild(e[0])},abort:function(){n&&n()}}}));var Ge,He=[],Ue=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=He.pop()||x.expando+"_"+xe.guid++;return this[t]=!0,t}}),x.ajaxPrefilter("json jsonp",(function(e,n,i){var s,r,o,a=!1!==e.jsonp&&(Ue.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ue.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return s=e.jsonpCallback=p(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ue,"$1"+s):!1!==e.jsonp&&(e.url+=(we.test(e.url)?"&":"?")+e.jsonp+"="+s),e.converters["script json"]=function(){return o||x.error(s+" was not called"),o[0]},e.dataTypes[0]="json",r=t[s],t[s]=function(){o=arguments},i.always((function(){void 0===r?x(t).removeProp(s):t[s]=r,e[s]&&(e.jsonpCallback=n.jsonpCallback,He.push(s)),o&&p(r)&&r(o[0]),o=r=void 0})),"script"})),g.createHTMLDocument=((Ge=m.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ge.childNodes.length),x.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(g.createHTMLDocument?((i=(e=m.implementation.createHTMLDocument("")).createElement("base")).href=m.location.href,e.head.appendChild(i)):e=m),r=!n&&[],(s=k.exec(t))?[e.createElement(s[1])]:(s=vt([t],e,r),r&&r.length&&x(r).remove(),x.merge([],s.childNodes)));var i,s,r},x.fn.load=function(t,e,n){var i,s,r,o=this,a=t.indexOf(" ");return a>-1&&(i=pe(t.slice(a)),t=t.slice(0,a)),p(e)?(n=e,e=void 0):e&&"object"==typeof e&&(s="POST"),o.length>0&&x.ajax({url:t,type:s||"GET",dataType:"html",data:e}).done((function(t){r=arguments,o.html(i?x("<div>").append(x.parseHTML(t)).find(i):t)})).always(n&&function(t,e){o.each((function(){n.apply(this,r||[t.responseText,e,t])}))}),this},x.expr.pseudos.animated=function(t){return x.grep(x.timers,(function(e){return t===e.elem})).length},x.offset={setOffset:function(t,e,n){var i,s,r,o,a,l,h=x.css(t,"position"),c=x(t),u={};"static"===h&&(t.style.position="relative"),a=c.offset(),r=x.css(t,"top"),l=x.css(t,"left"),("absolute"===h||"fixed"===h)&&(r+l).indexOf("auto")>-1?(o=(i=c.position()).top,s=i.left):(o=parseFloat(r)||0,s=parseFloat(l)||0),p(e)&&(e=e.call(t,n,x.extend({},a))),null!=e.top&&(u.top=e.top-a.top+o),null!=e.left&&(u.left=e.left-a.left+s),"using"in e?e.using.call(t,u):c.css(u)}},x.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){x.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],s={top:0,left:0};if("fixed"===x.css(i,"position"))e=i.getBoundingClientRect();else{for(e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===x.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((s=x(t).offset()).top+=x.css(t,"borderTopWidth",!0),s.left+=x.css(t,"borderLeftWidth",!0))}return{top:e.top-s.top-x.css(i,"marginTop",!0),left:e.left-s.left-x.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===x.css(t,"position");)t=t.offsetParent;return t||it}))}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;x.fn[t]=function(i){return _(this,(function(t,i,s){var r;if(f(t)?r=t:9===t.nodeType&&(r=t.defaultView),void 0===s)return r?r[e]:t[i];r?r.scrollTo(n?r.pageXOffset:s,n?s:r.pageYOffset):t[i]=s}),t,i,arguments.length)}})),x.each(["top","left"],(function(t,e){x.cssHooks[e]=_t(g.pixelPosition,(function(t,n){if(n)return n=Vt(t,e),Bt.test(n)?x(t).position()[e]+"px":n}))})),x.each({Height:"height",Width:"width"},(function(t,e){x.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){x.fn[i]=function(s,r){var o=arguments.length&&(n||"boolean"!=typeof s),a=n||(!0===s||!0===r?"margin":"border");return _(this,(function(e,n,s){var r;return f(e)?0===i.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+t],r["scroll"+t],e.body["offset"+t],r["offset"+t],r["client"+t])):void 0===s?x.css(e,n,a):x.style(e,n,s,a)}),e,o?s:void 0,o)}}))})),x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){x.fn[e]=function(t){return this.on(e,t)}})),x.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)}}),x.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){x.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var qe=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;x.proxy=function(t,e){var n,i,r;if("string"==typeof e&&(n=t[e],e=t,t=n),p(t))return i=s.call(arguments,2),(r=function(){return t.apply(e||this,i.concat(s.call(arguments)))}).guid=t.guid=t.guid||x.guid++,r},x.holdReady=function(t){t?x.readyWait++:x.ready(!0)},x.isArray=Array.isArray,x.parseJSON=JSON.parse,x.nodeName=O,x.isFunction=p,x.isWindow=f,x.camelCase=q,x.type=C,x.now=Date.now,x.isNumeric=function(t){var e=x.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},x.trim=function(t){return null==t?"":(t+"").replace(qe,"")};var We=t.jQuery,Xe=t.$;return x.noConflict=function(e){return t.$===x&&(t.$=Xe),e&&t.jQuery===x&&(t.jQuery=We),x},void 0===e&&(t.jQuery=t.$=x),x}))}(a);var l=a.exports;
/*!
	 * jQuery Mousewheel 3.1.13
	 *
	 * Copyright jQuery Foundation and other contributors
	 * Released under the MIT license
	 * http://jquery.org/license
	 */
!function(t,e){t.exports=function(t){var e,n,i=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],s="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],r=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=s.length;e;)this.addEventListener(s[--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=s.length;e;)this.removeEventListener(s[--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 s=i||window.event,o=r.call(arguments,1),l=0,u=0,d=0,g=0,p=0,f=0;if((i=t.event.fix(s)).type="mousewheel","detail"in s&&(d=-1*s.detail),"wheelDelta"in s&&(d=s.wheelDelta),"wheelDeltaY"in s&&(d=s.wheelDeltaY),"wheelDeltaX"in s&&(u=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(u=-1*d,d=0),l=0===d?u:d,"deltaY"in s&&(l=d=-1*s.deltaY),"deltaX"in s&&(u=s.deltaX,0===d&&(l=-1*u)),0!==d||0!==u){if(1===s.deltaMode){var m=t.data(this,"mousewheel-line-height");l*=m,d*=m,u*=m}else if(2===s.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(s,g)&&(n/=40)),c(s,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)}})}}({exports:{}});let h=!1,c=!1,u=!1,d=!1,g=!1,p=!1,f=!1,m=!1,y=!1,b=!1,C=!1,v=!1,x=!1,w=!1,E=!1,A=!1;if("object"==typeof navigator){const t=navigator.userAgent;h=t.indexOf("Macintosh")>=0,c=!!t.match(/(iPad|iPhone|iPod)/g),u=t.indexOf("Windows")>=0,d=t.indexOf("MSIE")>=0,g=!!t.match(/Trident\/7\./),p=!!t.match(/Edge\//),f=t.indexOf("Mozilla/")>=0&&t.indexOf("MSIE")<0&&t.indexOf("Edge/")<0,y=t.indexOf("Chrome/")>=0&&t.indexOf("Edge/")<0,b=t.indexOf("Opera/")>=0||t.indexOf("OPR/")>=0,C=t.indexOf("Firefox/")>=0,v=t.indexOf("AppleWebKit/")>=0&&t.indexOf("Chrome/")<0&&t.indexOf("Edge/")<0,"object"==typeof document&&(A=!document.createElementNS||"[object SVGForeignObjectElement]"!=`${document.createElementNS("http://www.w3.org/2000/svg","foreignObject")}`||t.indexOf("Opera/")>=0)}if("object"==typeof window&&(m=null!=window.chrome&&null!=window.chrome.app&&null!=window.chrome.app.runtime,w=null!=window.PointerEvent&&!h),"object"==typeof document){x="ontouchstart"in document.documentElement;try{const t=Object.defineProperty({},"passive",{get(){E=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",(()=>{}),t)}catch(t){}}var M;if(function(t){t.IS_MAC=h,t.IS_IOS=c,t.IS_WINDOWS=u,t.IS_IE=d,t.IS_IE11=g,t.IS_EDGE=p,t.IS_NETSCAPE=f,t.IS_CHROME_APP=m,t.IS_CHROME=y,t.IS_OPERA=b,t.IS_FIREFOX=C,t.IS_SAFARI=v,t.SUPPORT_TOUCH=x,t.SUPPORT_POINTER=w,t.SUPPORT_PASSIVE=E,t.NO_FOREIGNOBJECT=A,t.SUPPORT_FOREIGNOBJECT=!t.NO_FOREIGNOBJECT}(M||(M={})),function(t){function e(){const t=window.module;return null!=t&&null!=t.hot&&null!=t.hot.status?t.hot.status():"unkonwn"}t.getHMRStatus=e,t.isApplyingHMR=function(){return"apply"===e()};const n={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};t.isEventSupported=function(t){const e=document.createElement(n[t]||"div"),i=`on${t}`;let s=i in e;return s||(e.setAttribute(i,"return;"),s="function"==typeof e[i]),s}}(M||(M={})),M.SUPPORT_PASSIVE){l.event.special.touchstart={setup(t,e,n){if(!this.addEventListener)return!1;this.addEventListener("touchstart",n,{passive:!0})}};const t=l.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),[Element.prototype,Document.prototype,DocumentFragment.prototype].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)}})}));var S="object"==typeof global&&global&&global.Object===Object&&global,O="object"==typeof self&&self&&self.Object===Object&&self,k=S||O||Function("return this")(),P=k.Symbol,T=Object.prototype,D=T.hasOwnProperty,N=T.toString,j=P?P.toStringTag:void 0;var L=Object.prototype.toString;var F=P?P.toStringTag:void 0;function z(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":F&&F in Object(t)?function(t){var e=D.call(t,j),n=t[j];try{t[j]=void 0;var i=!0}catch(t){}var s=N.call(t);return i&&(e?t[j]=n:delete t[j]),s}(t):function(t){return L.call(t)}(t)}function B(t){return null!=t&&"object"==typeof t}function $(t){return"symbol"==typeof t||B(t)&&"[object Symbol]"==z(t)}function R(t,e){for(var n=-1,i=null==t?0:t.length,s=Array(i);++n<i;)s[n]=e(t[n],n,t);return s}var I=Array.isArray,V=P?P.prototype:void 0,_=V?V.toString:void 0;function G(t){if("string"==typeof t)return t;if(I(t))return R(t,G)+"";if($(t))return _?_.call(t):"";var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}var H=/\s/;var U=/^\s+/;function q(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&H.test(t.charAt(e)););return e}(t)+1).replace(U,""):t}function W(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var X=/^[-+]0x[0-9a-f]+$/i,Y=/^0b[01]+$/i,J=/^0o[0-7]+$/i,Z=parseInt;function K(t){if("number"==typeof t)return t;if($(t))return NaN;if(W(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=W(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=q(t);var n=Y.test(t);return n||J.test(t)?Z(t.slice(2),n?2:8):X.test(t)?NaN:+t}function Q(t){return t}function tt(t){if(!W(t))return!1;var e=z(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}var et,nt=k["__core-js_shared__"],it=(et=/[^.]+$/.exec(nt&&nt.keys&&nt.keys.IE_PROTO||""))?"Symbol(src)_1."+et:"";var st=Function.prototype.toString;function rt(t){if(null!=t){try{return st.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var ot=/^\[object .+?Constructor\]$/,at=Function.prototype,lt=Object.prototype,ht=at.toString,ct=lt.hasOwnProperty,ut=RegExp("^"+ht.call(ct).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dt(t){return!(!W(t)||(e=t,it&&it in e))&&(tt(t)?ut:ot).test(rt(t));var e}function gt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return dt(n)?n:void 0}var pt=gt(k,"WeakMap"),ft=Object.create,mt=function(){function t(){}return function(e){if(!W(e))return{};if(ft)return ft(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function yt(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)}function bt(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}var Ct=Date.now;var vt,xt,wt,Et=function(){try{var t=gt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),At=(vt=Et?function(t,e){return Et(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Q,xt=0,wt=0,function(){var t=Ct(),e=16-(t-wt);if(wt=t,e>0){if(++xt>=800)return arguments[0]}else xt=0;return vt.apply(void 0,arguments)});function Mt(t){return t!=t}function St(t,e){return!!(null==t?0:t.length)&&function(t,e,n){return e==e?function(t,e,n){for(var i=n-1,s=t.length;++i<s;)if(t[i]===e)return i;return-1}(t,e,n):function(t,e,n,i){for(var s=t.length,r=n+(i?1:-1);i?r--:++r<s;)if(e(t[r],r,t))return r;return-1}(t,Mt,n)}(t,e,0)>-1}var Ot=/^(?:0|[1-9]\d*)$/;function kt(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Ot.test(t))&&t>-1&&t%1==0&&t<e}function Pt(t,e,n){"__proto__"==e&&Et?Et(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Tt(t,e){return t===e||t!=t&&e!=e}var Dt=Object.prototype.hasOwnProperty;function Nt(t,e,n){var i=t[e];Dt.call(t,e)&&Tt(i,n)&&(void 0!==n||e in t)||Pt(t,e,n)}function jt(t,e,n,i){var s=!n;n||(n={});for(var r=-1,o=e.length;++r<o;){var a=e[r],l=i?i(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),s?Pt(n,a,l):Nt(n,a,l)}return n}var Lt=Math.max;function Ft(t,e,n){return e=Lt(void 0===e?t.length-1:e,0),function(){for(var i=arguments,s=-1,r=Lt(i.length-e,0),o=Array(r);++s<r;)o[s]=i[e+s];s=-1;for(var a=Array(e+1);++s<e;)a[s]=i[s];return a[e]=n(o),yt(t,this,a)}}function zt(t,e){return At(Ft(t,e,Q),t+"")}function Bt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function $t(t){return null!=t&&Bt(t.length)&&!tt(t)}function Rt(t,e,n){if(!W(n))return!1;var i=typeof e;return!!("number"==i?$t(n)&&kt(e,n.length):"string"==i&&e in n)&&Tt(n[e],t)}function It(t){return zt((function(e,n){var i=-1,s=n.length,r=s>1?n[s-1]:void 0,o=s>2?n[2]:void 0;for(r=t.length>3&&"function"==typeof r?(s--,r):void 0,o&&Rt(n[0],n[1],o)&&(r=s<3?void 0:r,s=1),e=Object(e);++i<s;){var a=n[i];a&&t(e,a,i,r)}return e}))}var Vt=Object.prototype;function _t(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Vt)}function Gt(t){return B(t)&&"[object Arguments]"==z(t)}var Ht=Object.prototype,Ut=Ht.hasOwnProperty,qt=Ht.propertyIsEnumerable,Wt=Gt(function(){return arguments}())?Gt:function(t){return B(t)&&Ut.call(t,"callee")&&!qt.call(t,"callee")};var Xt="object"==typeof t&&t&&!t.nodeType&&t,Yt=Xt&&"object"==typeof module&&module&&!module.nodeType&&module,Jt=Yt&&Yt.exports===Xt?k.Buffer:void 0,Zt=(Jt?Jt.isBuffer:void 0)||function(){return!1},Kt={};function Qt(t){return function(e){return t(e)}}Kt["[object Float32Array]"]=Kt["[object Float64Array]"]=Kt["[object Int8Array]"]=Kt["[object Int16Array]"]=Kt["[object Int32Array]"]=Kt["[object Uint8Array]"]=Kt["[object Uint8ClampedArray]"]=Kt["[object Uint16Array]"]=Kt["[object Uint32Array]"]=!0,Kt["[object Arguments]"]=Kt["[object Array]"]=Kt["[object ArrayBuffer]"]=Kt["[object Boolean]"]=Kt["[object DataView]"]=Kt["[object Date]"]=Kt["[object Error]"]=Kt["[object Function]"]=Kt["[object Map]"]=Kt["[object Number]"]=Kt["[object Object]"]=Kt["[object RegExp]"]=Kt["[object Set]"]=Kt["[object String]"]=Kt["[object WeakMap]"]=!1;var te="object"==typeof t&&t&&!t.nodeType&&t,ee=te&&"object"==typeof module&&module&&!module.nodeType&&module,ne=ee&&ee.exports===te&&S.process,ie=function(){try{var t=ee&&ee.require&&ee.require("util").types;return t||ne&&ne.binding&&ne.binding("util")}catch(t){}}(),se=ie&&ie.isTypedArray,re=se?Qt(se):function(t){return B(t)&&Bt(t.length)&&!!Kt[z(t)]},oe=Object.prototype.hasOwnProperty;function ae(t,e){var n=I(t),i=!n&&Wt(t),s=!n&&!i&&Zt(t),r=!n&&!i&&!s&&re(t),o=n||i||s||r,a=o?function(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}(t.length,String):[],l=a.length;for(var h in t)!e&&!oe.call(t,h)||o&&("length"==h||s&&("offset"==h||"parent"==h)||r&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||kt(h,l))||a.push(h);return a}function le(t,e){return function(n){return t(e(n))}}var he=le(Object.keys,Object),ce=Object.prototype.hasOwnProperty;function ue(t){if(!_t(t))return he(t);var e=[];for(var n in Object(t))ce.call(t,n)&&"constructor"!=n&&e.push(n);return e}function de(t){return $t(t)?ae(t):ue(t)}var ge=Object.prototype.hasOwnProperty;function pe(t){if(!W(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=_t(t),n=[];for(var i in t)("constructor"!=i||!e&&ge.call(t,i))&&n.push(i);return n}function fe(t){return $t(t)?ae(t,!0):pe(t)}var me=It((function(t,e,n,i){jt(e,fe(e),t,i)})),ye=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,be=/^\w*$/;function Ce(t,e){if(I(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!$(t))||(be.test(t)||!ye.test(t)||null!=e&&t in Object(e))}var ve=gt(Object,"create");var xe=Object.prototype.hasOwnProperty;var we=Object.prototype.hasOwnProperty;function Ee(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Ae(t,e){for(var n=t.length;n--;)if(Tt(t[n][0],e))return n;return-1}Ee.prototype.clear=function(){this.__data__=ve?ve(null):{},this.size=0},Ee.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Ee.prototype.get=function(t){var e=this.__data__;if(ve){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return xe.call(e,t)?e[t]:void 0},Ee.prototype.has=function(t){var e=this.__data__;return ve?void 0!==e[t]:we.call(e,t)},Ee.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ve&&void 0===e?"__lodash_hash_undefined__":e,this};var Me=Array.prototype.splice;function Se(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Se.prototype.clear=function(){this.__data__=[],this.size=0},Se.prototype.delete=function(t){var e=this.__data__,n=Ae(e,t);return!(n<0)&&(n==e.length-1?e.pop():Me.call(e,n,1),--this.size,!0)},Se.prototype.get=function(t){var e=this.__data__,n=Ae(e,t);return n<0?void 0:e[n][1]},Se.prototype.has=function(t){return Ae(this.__data__,t)>-1},Se.prototype.set=function(t,e){var n=this.__data__,i=Ae(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this};var Oe=gt(k,"Map");function ke(t,e){var n,i,s=t.__data__;return("string"==(i=typeof(n=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?s["string"==typeof e?"string":"hash"]:s.map}function Pe(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Pe.prototype.clear=function(){this.size=0,this.__data__={hash:new Ee,map:new(Oe||Se),string:new Ee}},Pe.prototype.delete=function(t){var e=ke(this,t).delete(t);return this.size-=e?1:0,e},Pe.prototype.get=function(t){return ke(this,t).get(t)},Pe.prototype.has=function(t){return ke(this,t).has(t)},Pe.prototype.set=function(t,e){var n=ke(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this};function Te(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var i=arguments,s=e?e.apply(this,i):i[0],r=n.cache;if(r.has(s))return r.get(s);var o=t.apply(this,i);return n.cache=r.set(s,o)||r,o};return n.cache=new(Te.Cache||Pe),n}Te.Cache=Pe;var De=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ne=/\\(\\)?/g,je=function(t){var e=Te(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(De,(function(t,n,i,s){e.push(i?s.replace(Ne,"$1"):n||t)})),e}));function Le(t){return null==t?"":G(t)}function Fe(t,e){return I(t)?t:Ce(t,e)?[t]:je(Le(t))}function ze(t){if("string"==typeof t||$(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}function Be(t,e){for(var n=0,i=(e=Fe(e,t)).length;null!=t&&n<i;)t=t[ze(e[n++])];return n&&n==i?t:void 0}function $e(t,e){for(var n=-1,i=e.length,s=t.length;++n<i;)t[s+n]=e[n];return t}var Re=P?P.isConcatSpreadable:void 0;function Ie(t){return I(t)||Wt(t)||!!(Re&&t&&t[Re])}function Ve(t,e,n,i,s){var r=-1,o=t.length;for(n||(n=Ie),s||(s=[]);++r<o;){var a=t[r];e>0&&n(a)?e>1?Ve(a,e-1,n,i,s):$e(s,a):i||(s[s.length]=a)}return s}function _e(t){return(null==t?0:t.length)?Ve(t,1):[]}var Ge=le(Object.getPrototypeOf,Object),He=Function.prototype,Ue=Object.prototype,qe=He.toString,We=Ue.hasOwnProperty,Xe=qe.call(Object);function Ye(t){if(!B(t)||"[object Object]"!=z(t))return!1;var e=Ge(t);if(null===e)return!0;var n=We.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&qe.call(n)==Xe}function Je(t){if(!B(t))return!1;var e=z(t);return"[object Error]"==e||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Ye(t)}var Ze=zt((function(t,e){try{return yt(t,void 0,e)}catch(t){return Je(t)?t:new Error(t)}}));function Ke(t,e,n){var i=t.length;return n=void 0===n?i:n,!e&&n>=i?t:function(t,e,n){var i=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(n=n>s?s:n)<0&&(n+=s),s=e>n?0:n-e>>>0,e>>>=0;for(var r=Array(s);++i<s;)r[i]=t[i+e];return r}(t,e,n)}var Qe=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function tn(t){return Qe.test(t)}var en="[\\ud800-\\udfff]",nn="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",sn="\\ud83c[\\udffb-\\udfff]",rn="[^\\ud800-\\udfff]",on="(?:\\ud83c[\\udde6-\\uddff]){2}",an="[\\ud800-\\udbff][\\udc00-\\udfff]",ln="(?:"+nn+"|"+sn+")"+"?",hn="[\\ufe0e\\ufe0f]?",cn=hn+ln+("(?:\\u200d(?:"+[rn,on,an].join("|")+")"+hn+ln+")*"),un="(?:"+[rn+nn+"?",nn,on,an,en].join("|")+")",dn=RegExp(sn+"(?="+sn+")|"+un+cn,"g");function gn(t){return tn(t)?function(t){return t.match(dn)||[]}(t):function(t){return t.split("")}(t)}function pn(t){return function(e){var n=tn(e=Le(e))?gn(e):void 0,i=n?n[0]:e.charAt(0),s=n?Ke(n,1).join(""):e.slice(1);return i[t]()+s}}var fn=pn("toUpperCase");function mn(t){return function(e){return null==t?void 0:t[e]}}var yn=mn({"À":"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","Œ":"Oe","œ":"oe","ŉ":"'n","ſ":"s"}),bn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Cn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var vn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var xn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var wn="\\u2700-\\u27bf",En="a-z\\xdf-\\xf6\\xf8-\\xff",An="A-Z\\xc0-\\xd6\\xd8-\\xde",Mn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\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",Sn="["+Mn+"]",On="\\d+",kn="[\\u2700-\\u27bf]",Pn="["+En+"]",Tn="[^\\ud800-\\udfff"+Mn+On+wn+En+An+"]",Dn="(?:\\ud83c[\\udde6-\\uddff]){2}",Nn="[\\ud800-\\udbff][\\udc00-\\udfff]",jn="["+An+"]",Ln="(?:"+Pn+"|"+Tn+")",Fn="(?:"+jn+"|"+Tn+")",zn="(?:['’](?:d|ll|m|re|s|t|ve))?",Bn="(?:['’](?:D|LL|M|RE|S|T|VE))?",$n="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Rn="[\\ufe0e\\ufe0f]?",In=Rn+$n+("(?:\\u200d(?:"+["[^\\ud800-\\udfff]",Dn,Nn].join("|")+")"+Rn+$n+")*"),Vn="(?:"+[kn,Dn,Nn].join("|")+")"+In,_n=RegExp([jn+"?"+Pn+"+"+zn+"(?="+[Sn,jn,"$"].join("|")+")",Fn+"+"+Bn+"(?="+[Sn,jn+Ln,"$"].join("|")+")",jn+"?"+Ln+"+"+zn,jn+"+"+Bn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",On,Vn].join("|"),"g");function Gn(t,e,n){return t=Le(t),void 0===(e=n?void 0:e)?function(t){return xn.test(t)}(t)?function(t){return t.match(_n)||[]}(t):function(t){return t.match(vn)||[]}(t):t.match(e)||[]}var Hn=RegExp("['’]","g");function Un(t){return function(e){return function(t,e,n,i){var s=-1,r=null==t?0:t.length;for(i&&r&&(n=t[++s]);++s<r;)n=e(n,t[s],s,t);return n}(Gn(function(t){return(t=Le(t))&&t.replace(bn,yn).replace(Cn,"")}(e).replace(Hn,"")),t,"")}}var qn=Un((function(t,e,n){return e=e.toLowerCase(),t+(n?fn(Le(e).toLowerCase()):e)}));function Wn(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=K(n))==n?n:0),void 0!==e&&(e=(e=K(e))==e?e:0),function(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}(K(t),e,n)}function Xn(t){var e=this.__data__=new Se(t);this.size=e.size}Xn.prototype.clear=function(){this.__data__=new Se,this.size=0},Xn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Xn.prototype.get=function(t){return this.__data__.get(t)},Xn.prototype.has=function(t){return this.__data__.has(t)},Xn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Se){var i=n.__data__;if(!Oe||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Pe(i)}return n.set(t,e),this.size=n.size,this};var Yn="object"==typeof t&&t&&!t.nodeType&&t,Jn=Yn&&"object"==typeof module&&module&&!module.nodeType&&module,Zn=Jn&&Jn.exports===Yn?k.Buffer:void 0,Kn=Zn?Zn.allocUnsafe:void 0;function Qn(t,e){if(e)return t.slice();var n=t.length,i=Kn?Kn(n):new t.constructor(n);return t.copy(i),i}function ti(){return[]}var ei=Object.prototype.propertyIsEnumerable,ni=Object.getOwnPropertySymbols,ii=ni?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,i=null==t?0:t.length,s=0,r=[];++n<i;){var o=t[n];e(o,n,t)&&(r[s++]=o)}return r}(ni(t),(function(e){return ei.call(t,e)})))}:ti;var si=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)$e(e,ii(t)),t=Ge(t);return e}:ti;function ri(t,e,n){var i=e(t);return I(t)?i:$e(i,n(t))}function oi(t){return ri(t,de,ii)}function ai(t){return ri(t,fe,si)}var li=gt(k,"DataView"),hi=gt(k,"Promise"),ci=gt(k,"Set"),ui="[object Map]",di="[object Promise]",gi="[object Set]",pi="[object WeakMap]",fi="[object DataView]",mi=rt(li),yi=rt(Oe),bi=rt(hi),Ci=rt(ci),vi=rt(pt),xi=z;(li&&xi(new li(new ArrayBuffer(1)))!=fi||Oe&&xi(new Oe)!=ui||hi&&xi(hi.resolve())!=di||ci&&xi(new ci)!=gi||pt&&xi(new pt)!=pi)&&(xi=function(t){var e=z(t),n="[object Object]"==e?t.constructor:void 0,i=n?rt(n):"";if(i)switch(i){case mi:return fi;case yi:return ui;case bi:return di;case Ci:return gi;case vi:return pi}return e});var wi=xi,Ei=Object.prototype.hasOwnProperty;var Ai=k.Uint8Array;function Mi(t){var e=new t.constructor(t.byteLength);return new Ai(e).set(new Ai(t)),e}var Si=/\w*$/;var Oi=P?P.prototype:void 0,ki=Oi?Oi.valueOf:void 0;function Pi(t,e){var n=e?Mi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ti(t,e,n){var i,s,r,o=t.constructor;switch(e){case"[object ArrayBuffer]":return Mi(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return function(t,e){var n=e?Mi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Pi(t,n);case"[object Map]":return new o;case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return(r=new(s=t).constructor(s.source,Si.exec(s))).lastIndex=s.lastIndex,r;case"[object Set]":return new o;case"[object Symbol]":return i=t,ki?Object(ki.call(i)):{}}}function Di(t){return"function"!=typeof t.constructor||_t(t)?{}:mt(Ge(t))}var Ni=ie&&ie.isMap,ji=Ni?Qt(Ni):function(t){return B(t)&&"[object Map]"==wi(t)};var Li=ie&&ie.isSet,Fi=Li?Qt(Li):function(t){return B(t)&&"[object Set]"==wi(t)},zi="[object Arguments]",Bi="[object Function]",$i="[object Object]",Ri={};function Ii(t,e,n,i,s,r){var o,a=1&e,l=2&e,h=4&e;if(n&&(o=s?n(t,i,s,r):n(t)),void 0!==o)return o;if(!W(t))return t;var c=I(t);if(c){if(o=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ei.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!a)return bt(t,o)}else{var u=wi(t),d=u==Bi||"[object GeneratorFunction]"==u;if(Zt(t))return Qn(t,a);if(u==$i||u==zi||d&&!s){if(o=l||d?{}:Di(t),!a)return l?function(t,e){return jt(t,si(t),e)}(t,function(t,e){return t&&jt(e,fe(e),t)}(o,t)):function(t,e){return jt(t,ii(t),e)}(t,function(t,e){return t&&jt(e,de(e),t)}(o,t))}else{if(!Ri[u])return s?t:{};o=Ti(t,u,a)}}r||(r=new Xn);var g=r.get(t);if(g)return g;r.set(t,o),Fi(t)?t.forEach((function(i){o.add(Ii(i,e,n,i,t,r))})):ji(t)&&t.forEach((function(i,s){o.set(s,Ii(i,e,n,s,t,r))}));var p=c?void 0:(h?l?ai:oi:l?fe:de)(t);return function(t,e){for(var n=-1,i=null==t?0:t.length;++n<i&&!1!==e(t[n],n,t););}(p||t,(function(i,s){p&&(i=t[s=i]),Nt(o,s,Ii(i,e,n,s,t,r))})),o}Ri[zi]=Ri["[object Array]"]=Ri["[object ArrayBuffer]"]=Ri["[object DataView]"]=Ri["[object Boolean]"]=Ri["[object Date]"]=Ri["[object Float32Array]"]=Ri["[object Float64Array]"]=Ri["[object Int8Array]"]=Ri["[object Int16Array]"]=Ri["[object Int32Array]"]=Ri["[object Map]"]=Ri["[object Number]"]=Ri[$i]=Ri["[object RegExp]"]=Ri["[object Set]"]=Ri["[object String]"]=Ri["[object Symbol]"]=Ri["[object Uint8Array]"]=Ri["[object Uint8ClampedArray]"]=Ri["[object Uint16Array]"]=Ri["[object Uint32Array]"]=!0,Ri["[object Error]"]=Ri[Bi]=Ri["[object WeakMap]"]=!1;function Vi(t){return Ii(t,4)}function _i(t){return Ii(t,5)}function Gi(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Pe;++e<n;)this.add(t[e])}function Hi(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}function Ui(t,e){return t.has(e)}Gi.prototype.add=Gi.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Gi.prototype.has=function(t){return this.__data__.has(t)};function qi(t,e,n,i,s,r){var o=1&n,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var h=r.get(t),c=r.get(e);if(h&&c)return h==e&&c==t;var u=-1,d=!0,g=2&n?new Gi:void 0;for(r.set(t,e),r.set(e,t);++u<a;){var p=t[u],f=e[u];if(i)var m=o?i(f,p,u,e,t,r):i(p,f,u,t,e,r);if(void 0!==m){if(m)continue;d=!1;break}if(g){if(!Hi(e,(function(t,e){if(!Ui(g,e)&&(p===t||s(p,t,n,i,r)))return g.push(e)}))){d=!1;break}}else if(p!==f&&!s(p,f,n,i,r)){d=!1;break}}return r.delete(t),r.delete(e),d}function Wi(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n}function Xi(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Yi=P?P.prototype:void 0,Ji=Yi?Yi.valueOf:void 0;var Zi=Object.prototype.hasOwnProperty;var Ki="[object Arguments]",Qi="[object Array]",ts="[object Object]",es=Object.prototype.hasOwnProperty;function ns(t,e,n,i,s,r){var o=I(t),a=I(e),l=o?Qi:wi(t),h=a?Qi:wi(e),c=(l=l==Ki?ts:l)==ts,u=(h=h==Ki?ts:h)==ts,d=l==h;if(d&&Zt(t)){if(!Zt(e))return!1;o=!0,c=!1}if(d&&!c)return r||(r=new Xn),o||re(t)?qi(t,e,n,i,s,r):function(t,e,n,i,s,r,o){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!r(new Ai(t),new Ai(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Tt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=Wi;case"[object Set]":var l=1&i;if(a||(a=Xi),t.size!=e.size&&!l)return!1;var h=o.get(t);if(h)return h==e;i|=2,o.set(t,e);var c=qi(a(t),a(e),i,s,r,o);return o.delete(t),c;case"[object Symbol]":if(Ji)return Ji.call(t)==Ji.call(e)}return!1}(t,e,l,n,i,s,r);if(!(1&n)){var g=c&&es.call(t,"__wrapped__"),p=u&&es.call(e,"__wrapped__");if(g||p){var f=g?t.value():t,m=p?e.value():e;return r||(r=new Xn),s(f,m,n,i,r)}}return!!d&&(r||(r=new Xn),function(t,e,n,i,s,r){var o=1&n,a=oi(t),l=a.length;if(l!=oi(e).length&&!o)return!1;for(var h=l;h--;){var c=a[h];if(!(o?c in e:Zi.call(e,c)))return!1}var u=r.get(t),d=r.get(e);if(u&&d)return u==e&&d==t;var g=!0;r.set(t,e),r.set(e,t);for(var p=o;++h<l;){var f=t[c=a[h]],m=e[c];if(i)var y=o?i(m,f,c,e,t,r):i(f,m,c,t,e,r);if(!(void 0===y?f===m||s(f,m,n,i,r):y)){g=!1;break}p||(p="constructor"==c)}if(g&&!p){var b=t.constructor,C=e.constructor;b==C||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof C&&C instanceof C||(g=!1)}return r.delete(t),r.delete(e),g}(t,e,n,i,s,r))}function is(t,e,n,i,s){return t===e||(null==t||null==e||!B(t)&&!B(e)?t!=t&&e!=e:ns(t,e,n,i,is,s))}function ss(t){return t==t&&!W(t)}function rs(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function os(t){var e=function(t){for(var e=de(t),n=e.length;n--;){var i=e[n],s=t[i];e[n]=[i,s,ss(s)]}return e}(t);return 1==e.length&&e[0][2]?rs(e[0][0],e[0][1]):function(n){return n===t||function(t,e,n,i){var s=n.length,r=s,o=!i;if(null==t)return!r;for(t=Object(t);s--;){var a=n[s];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++s<r;){var l=(a=n[s])[0],h=t[l],c=a[1];if(o&&a[2]){if(void 0===h&&!(l in t))return!1}else{var u=new Xn;if(i)var d=i(h,c,l,t,e,u);if(!(void 0===d?is(c,h,3,i,u):d))return!1}}return!0}(n,t,e)}}function as(t,e){return null!=t&&e in Object(t)}function ls(t,e,n){for(var i=-1,s=(e=Fe(e,t)).length,r=!1;++i<s;){var o=ze(e[i]);if(!(r=null!=t&&n(t,o)))break;t=t[o]}return r||++i!=s?r:!!(s=null==t?0:t.length)&&Bt(s)&&kt(o,s)&&(I(t)||Wt(t))}function hs(t,e){return null!=t&&ls(t,e,as)}function cs(t,e){return Ce(t)&&ss(e)?rs(ze(t),e):function(n){var i=function(t,e,n){var i=null==t?void 0:Be(t,e);return void 0===i?n:i}(n,t);return void 0===i&&i===e?hs(n,t):is(e,i,3)}}function us(t){return Ce(t)?(e=ze(t),function(t){return null==t?void 0:t[e]}):function(t){return function(e){return Be(e,t)}}(t);var e}function ds(t){return"function"==typeof t?t:null==t?Q:"object"==typeof t?I(t)?cs(t[0],t[1]):os(t):us(t)}function gs(t,e,n,i){for(var s=-1,r=null==t?0:t.length;++s<r;){var o=t[s];e(i,o,n(o),t)}return i}var ps,fs=function(t,e,n){for(var i=-1,s=Object(t),r=n(t),o=r.length;o--;){var a=r[ps?o:++i];if(!1===e(s[a],a,s))break}return t};var ms=function(t,e){return function(n,i){if(null==n)return n;if(!$t(n))return t(n,i);for(var s=n.length,r=e?s:-1,o=Object(n);(e?r--:++r<s)&&!1!==i(o[r],r,o););return n}}((function(t,e){return t&&fs(t,e,de)}));function ys(t,e,n,i){return ms(t,(function(t,s,r){e(i,t,n(t),r)})),i}var bs=function(){return k.Date.now()},Cs=Math.max,vs=Math.min;function xs(t,e,n){var i,s,r,o,a,l,h=0,c=!1,u=!1,d=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var n=i,r=s;return i=s=void 0,h=e,o=t.apply(r,n)}function p(t){return h=t,a=setTimeout(m,e),c?g(t):o}function f(t){var n=t-l;return void 0===l||n>=e||n<0||u&&t-h>=r}function m(){var t=bs();if(f(t))return y(t);a=setTimeout(m,function(t){var n=e-(t-l);return u?vs(n,r-(t-h)):n}(t))}function y(t){return a=void 0,d&&i?g(t):(i=s=void 0,o)}function b(){var t=bs(),n=f(t);if(i=arguments,s=this,l=t,n){if(void 0===a)return p(l);if(u)return clearTimeout(a),a=setTimeout(m,e),g(l)}return void 0===a&&(a=setTimeout(m,e)),o}return e=K(e)||0,W(n)&&(c=!!n.leading,r=(u="maxWait"in n)?Cs(K(n.maxWait)||0,e):r,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==a&&clearTimeout(a),h=0,i=l=s=a=void 0},b.flush=function(){return void 0===a?o:y(bs())},b}var ws=Object.prototype,Es=ws.hasOwnProperty,As=zt((function(t,e){t=Object(t);var n=-1,i=e.length,s=i>2?e[2]:void 0;for(s&&Rt(e[0],e[1],s)&&(i=1);++n<i;)for(var r=e[n],o=fe(r),a=-1,l=o.length;++a<l;){var h=o[a],c=t[h];(void 0===c||Tt(c,ws[h])&&!Es.call(t,h))&&(t[h]=r[h])}return t}));function Ms(t,e,n){(void 0!==n&&!Tt(t[e],n)||void 0===n&&!(e in t))&&Pt(t,e,n)}function Ss(t){return B(t)&&$t(t)}function Os(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function ks(t,e,n,i,s,r,o){var a=Os(t,n),l=Os(e,n),h=o.get(l);if(h)Ms(t,n,h);else{var c,u=r?r(a,l,n+"",t,e,o):void 0,d=void 0===u;if(d){var g=I(l),p=!g&&Zt(l),f=!g&&!p&&re(l);u=l,g||p||f?I(a)?u=a:Ss(a)?u=bt(a):p?(d=!1,u=Qn(l,!0)):f?(d=!1,u=Pi(l,!0)):u=[]:Ye(l)||Wt(l)?(u=a,Wt(a)?u=jt(c=a,fe(c)):W(a)&&!tt(a)||(u=Di(l))):d=!1}d&&(o.set(l,u),s(u,l,i,r,o),o.delete(l)),Ms(t,n,u)}}function Ps(t,e,n,i,s){t!==e&&fs(e,(function(r,o){if(s||(s=new Xn),W(r))ks(t,e,o,n,Ps,i,s);else{var a=i?i(Os(t,o),r,o+"",t,e,s):void 0;void 0===a&&(a=r),Ms(t,o,a)}}),fe)}function Ts(t,e,n,i,s,r){return W(t)&&W(e)&&(r.set(e,t),Ps(t,e,void 0,Ts,r),r.delete(e)),t}var Ds=It((function(t,e,n,i){Ps(t,e,n,i)})),Ns=zt((function(t){return t.push(void 0,Ts),yt(Ds,void 0,t)}));var js=zt((function(t,e){return function(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}(t,1,e)}));function Ls(t,e,n){for(var i=-1,s=null==t?0:t.length;++i<s;)if(n(e,t[i]))return!0;return!1}var Fs=zt((function(t,e){return Ss(t)?function(t,e,n,i){var s=-1,r=St,o=!0,a=t.length,l=[],h=e.length;if(!a)return l;n&&(e=R(e,Qt(n))),i?(r=Ls,o=!1):e.length>=200&&(r=Ui,o=!1,e=new Gi(e));t:for(;++s<a;){var c=t[s],u=null==n?c:n(c);if(c=i||0!==c?c:0,o&&u==u){for(var d=h;d--;)if(e[d]===u)continue t;l.push(c)}else r(e,u,i)||l.push(c)}return l}(t,Ve(e,1,Ss,!0)):[]})),zs=mn({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),Bs=/[&<>"']/g,$s=RegExp(Bs.source);var Rs,Is,Vs=Object.prototype.hasOwnProperty,_s=(Rs=function(t,e,n){Vs.call(t,n)?t[n].push(e):Pt(t,n,[e])},function(t,e){var n=I(t)?gs:ys,i=Is?Is():{};return n(t,Rs,ds(e),i)});function Gs(t,e){return t>e}var Hs=Object.prototype.hasOwnProperty;function Us(t,e){return null!=t&&Hs.call(t,e)}function qs(t,e){return null!=t&&ls(t,e,Us)}var Ws=Object.prototype.hasOwnProperty;function Xs(t){if(null==t)return!0;if($t(t)&&(I(t)||"string"==typeof t||"function"==typeof t.splice||Zt(t)||re(t)||Wt(t)))return!t.length;var e=wi(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(_t(t))return!ue(t).length;for(var n in t)if(Ws.call(t,n))return!1;return!0}function Ys(t,e){return is(t,e)}function Js(t){return"number"==typeof t||B(t)&&"[object Number]"==z(t)}var Zs=pn("toLowerCase");function Ks(t){return t&&t.length?function(t,e,n){for(var i=-1,s=t.length;++i<s;){var r=t[i],o=e(r);if(null!=o&&(void 0===a?o==o&&!$(o):n(o,a)))var a=o,l=r}return l}(t,Q,Gs):void 0}var Qs=It((function(t,e,n){Ps(t,e,n)}));function tr(t,e,n,i){if(!W(t))return t;for(var s=-1,r=(e=Fe(e,t)).length,o=r-1,a=t;null!=a&&++s<r;){var l=ze(e[s]),h=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(s!=o){var c=a[l];void 0===(h=i?i(c,l,a):void 0)&&(h=W(c)?c:kt(e[s+1])?[]:{})}Nt(a,l,h),a=a[l]}return t}function er(t,e){if(t!==e){var n=void 0!==t,i=null===t,s=t==t,r=$(t),o=void 0!==e,a=null===e,l=e==e,h=$(e);if(!a&&!h&&!r&&t>e||r&&o&&l&&!a&&!h||i&&o&&l||!n&&l||!s)return 1;if(!i&&!r&&!h&&t<e||h&&n&&s&&!i&&!r||a&&n&&s||!o&&s||!l)return-1}return 0}function nr(t,e,n){e=e.length?R(e,(function(t){return I(t)?function(e){return Be(e,1===t.length?t[0]:t)}:t})):[Q];var i=-1;return e=R(e,Qt(ds)),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(function(t,e){var n=-1,i=$t(t)?Array(t.length):[];return ms(t,(function(t,s,r){i[++n]=e(t,s,r)})),i}(t,(function(t,n,s){return{criteria:R(e,(function(e){return e(t)})),index:++i,value:t}})),(function(t,e){return function(t,e,n){for(var i=-1,s=t.criteria,r=e.criteria,o=s.length,a=n.length;++i<o;){var l=er(s[i],r[i]);if(l)return i>=a?l:l*("desc"==n[i]?-1:1)}return t.index-e.index}(t,e,n)}))}function ir(t,e){return function(t,e,n){for(var i=-1,s=e.length,r={};++i<s;){var o=e[i],a=Be(t,o);n(a,o)&&tr(r,Fe(o,t),a)}return r}(t,e,(function(e,n){return hs(t,n)}))}var sr=function(t){return At(Ft(t,void 0,_e),t+"")}((function(t,e){return null==t?{}:ir(t,e)})),rr=zt((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Rt(t,e[0],e[1])?e=[]:n>2&&Rt(e[0],e[1],e[2])&&(e=[e[0]]),nr(t,Ve(e,1),[])})),or=Math.floor,ar=Math.min;function lr(t,e,n,i){var s=0,r=null==t?0:t.length;if(0===r)return 0;for(var o=(e=n(e))!=e,a=null===e,l=$(e),h=void 0===e;s<r;){var c=or((s+r)/2),u=n(t[c]),d=void 0!==u,g=null===u,p=u==u,f=$(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?s=c+1:r=c}return ar(r,4294967294)}function hr(t,e){return function(t,e,n){var i=0,s=null==t?i:t.length;if("number"==typeof e&&e==e&&s<=2147483647){for(;i<s;){var r=i+s>>>1,o=t[r];null!==o&&!$(o)&&(n?o<=e:o<e)?i=r+1:s=r}return s}return lr(t,e,Q,n)}(t,e)}var cr=Un((function(t,e,n){return t+(n?" ":"")+fn(e)})),ur=Object.prototype,dr=ur.hasOwnProperty;function gr(t,e,n,i){return void 0===t||Tt(t,ur[n])&&!dr.call(i,n)?e:t}var pr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function fr(t){return"\\"+pr[t]}var mr=/<%=([\s\S]+?)%>/g,yr={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:mr,variable:"",imports:{_:{escape:function(t){return(t=Le(t))&&$s.test(t)?t.replace(Bs,zs):t}}}},br=/\b__p \+= '';/g,Cr=/\b(__p \+=) '' \+/g,vr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xr=/[()=,{}\[\]\/\s]/,wr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Er=/($^)/,Ar=/['\n\r\u2028\u2029\\]/g,Mr=Object.prototype.hasOwnProperty;function Sr(t,e,n){var i=yr.imports._.templateSettings||yr;n&&Rt(t,e,n)&&(e=void 0),t=Le(t),e=me({},e,i,gr);var s,r,o,a=me({},e.imports,i.imports,gr),l=de(a),h=(s=a,R(l,(function(t){return s[t]}))),c=0,u=e.interpolate||Er,d="__p += '",g=RegExp((e.escape||Er).source+"|"+u.source+"|"+(u===mr?wr:Er).source+"|"+(e.evaluate||Er).source+"|$","g"),p=Mr.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(g,(function(e,n,i,s,a,l){return i||(i=s),d+=t.slice(c,l).replace(Ar,fr),n&&(r=!0,d+="' +\n__e("+n+") +\n'"),a&&(o=!0,d+="';\n"+a+";\n__p += '"),i&&(d+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),c=l+e.length,e})),d+="';\n";var f=Mr.call(e,"variable")&&e.variable;if(f){if(xr.test(f))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(br,""):d).replace(Cr,"$1").replace(vr,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Ze((function(){return Function(l,p+"return "+d).apply(void 0,h)}));if(m.source=d,Je(m))throw m;return m}var Or=ci&&1/Xi(new ci([,-0]))[1]==1/0?function(t){return new ci(t)}:function(){};function kr(t,e,n){var i=-1,s=St,r=t.length,o=!0,a=[],l=a;if(n)o=!1,s=Ls;else if(r>=200){var h=e?null:Or(t);if(h)return Xi(h);o=!1,s=Ui,l=new Gi}else l=e?[]:a;t:for(;++i<r;){var c=t[i],u=e?e(c):c;if(c=n||0!==c?c:0,o&&u==u){for(var d=l.length;d--;)if(l[d]===u)continue t;e&&l.push(u),a.push(c)}else s(l,u,n)||(l!==a&&l.push(u),a.push(c))}return a}var Pr=zt((function(t){return kr(Ve(t,1,Ss,!0))}));function Tr(t){return t&&t.length?kr(t):[]}var Dr=0;function Nr(t,...e){e.forEach((e=>{Object.getOwnPropertyNames(e.prototype).forEach((n=>{"constructor"!==n&&Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n))}))}))}const jr=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])};const Lr=/^\s*class\s+/.test(`${class{}}`)||/^\s*class\s*\{/.test(`${class{}}`);function Fr(t,e){let n;return Lr?n=class extends e{}:(n=function(){return e.apply(this,arguments)},function(t,e){function n(){this.constructor=t}jr(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(n,e)),Object.defineProperty(n,"name",{value:t}),n}function zr(t){return"__proto__"===t}function Br(t,e,n="/"){let i;const s=Array.isArray(e)?e:e.split(n);if(s.length)for(i=t;s.length;){const t=s.shift();if(Object(i)!==i||!t||!(t in i))return;i=i[t]}return i}function $r(t,e,n,i="/"){const s=Array.isArray(e)?e:e.split(i),r=s.pop();if(r&&!zr(r)){let e=t;s.forEach((t=>{zr(t)||(null==e[t]&&(e[t]={}),e=e[t])})),e[r]=n}return t}function Rr(t,e,n="/"){const i=Array.isArray(e)?e.slice():e.split(n),s=i.pop();if(s)if(i.length>0){const e=Br(t,i);e&&delete e[s]}else delete t[s];return t}const Ir=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Vr=Ir((t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase())),_r=Ir((t=>cr(qn(t)).replace(/ /g,"")));function Gr(t){let e=2166136261,n=!1,i=t;for(let t=0,s=i.length;t<s;t+=1){let s=i.charCodeAt(t);s>127&&!n&&(i=unescape(encodeURIComponent(i)),s=i.charCodeAt(t),n=!0),e^=s,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function Hr(){let t="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let n=0,i=e.length;n<i;n+=1){const i=e[n],s=16*Math.random()|0;t+=("x"===i?s:"y"===i?3&s|8:i).toString(16)}return t}function Ur(t,e={}){const n=l.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:l("<div/>").append(n).html()}function qr(t,e,n){let i=new Array(e.length+1),s=new Array(e.length+1);const r=n+1;for(let t=0;t<=e.length;t+=1)i[t]=t;for(let o=1;o<=t.length;o+=1){const a=t.charCodeAt(o-1),l=o>n?o-n:1,h=e.length>n+o?n+o:e.length;s[0]=o;let c=o;for(let t=1;t<l;t+=1)s[t]=r;for(let t=l;t<=h;t+=1){const n=a===e.charCodeAt(t-1)?i[t-1]:Math.min(i[t]+1,s[t-1]+1,i[t-1]+2);s[t]=n,c=Math.min(c,n)}for(let t=h+1;t<=e.length;t+=1)s[t]=r;if(c>n)return;const u=i;i=s,s=u}const o=i[e.length];return o>n?void 0:o}function Wr(t){return"string"==typeof t&&"%"===t.slice(-1)}function Xr(t,e){if(null==t)return 0;let n;if("string"==typeof t){if(n=parseFloat(t),Wr(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 Yr(t,e){const n=parseFloat(t);if(Number.isNaN(n))return null;let i;if(null==e)i="[A-Za-z]*";else if(Array.isArray(e)){if(0===e.length)return null;i=e.join("|")}else"string"==typeof e&&(i=e);const s=function(e){const n=new RegExp(`(?:\\d+(?:\\.\\d+)*)(${e})$`).exec(t);return n?n[1]:null}(i);return null===s?null:{unit:s,value:n}}function Jr(t){if("object"==typeof t){let e=0,n=0,i=0,s=0;return null!=t.vertical&&Number.isFinite(t.vertical)&&(n=s=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)&&(s=t.bottom),{top:n,right:i,bottom:s,left:e}}let e=0;return null!=t&&Number.isFinite(t)&&(e=t),{top:e,right:e,bottom:e,left:e}}function Zr(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 Kr(t,e,...n){return Zr(t,e,n)}function Qr(t){return null!=t&&(t instanceof Promise||function(t){return"object"==typeof t&&t.then&&"function"==typeof t.then}(t))}function to(...t){const e=[];t.forEach((t=>{Array.isArray(t)?e.push(...t):e.push(t)}));if(e.some((t=>Qr(t)))){const t=e.map((t=>Qr(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))}const eo=/[\t\r\n\f]/g,no=/\S+/g,io=t=>` ${t} `;function so(t){return t&&t.getAttribute&&t.getAttribute("class")||""}function ro(t,e){if(null==t||null==e)return!1;const n=io(so(t)),i=io(e);return 1===t.nodeType&&n.replace(eo," ").includes(i)}function oo(t,e){if(null!=t&&null!=e){if("function"==typeof e)return oo(t,e(so(t)));if("string"==typeof e&&1===t.nodeType){const n=e.match(no)||[],i=io(so(t)).replace(eo," ");let s=n.reduce(((t,e)=>t.indexOf(io(e))<0?`${t}${e} `:t),i);s=s.trim(),i!==s&&t.setAttribute("class",s)}}}function ao(t,e){if(null!=t){if("function"==typeof e)return ao(t,e(so(t)));if((!e||"string"==typeof e)&&1===t.nodeType){const n=(e||"").match(no)||[],i=io(so(t)).replace(eo," ");let s=n.reduce(((t,e)=>{const n=io(e);return t.indexOf(n)>-1?t.replace(n," "):t}),i);s=e?s.trim():"",i!==s&&t.setAttribute("class",s)}}}function lo(t,e,n){if(null!=t&&null!=e)if(null==n||"string"!=typeof e){if("function"==typeof e)return lo(t,e(so(t),n),n);if("string"==typeof e){(e.match(no)||[]).forEach((e=>{ro(t,e)?ao(t,e):oo(t,e)}))}}else n?oo(t,e):ao(t,e)}let ho=0;function co(t){return null!=t.id&&""!==t.id||(t.id=(ho+=1,`v${ho}`)),t.id}function uo(t){return null!=t&&("function"==typeof t.getScreenCTM&&t instanceof SVGElement)}const go={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"};function po(t,e=document){return e.createElement(t)}function fo(t,e=go.xhtml,n=document){return n.createElementNS(e,t)}function mo(t,e=document){return fo(t,go.svg,e)}function yo(t){if(t){const e=`<svg xmlns="${go.svg}" xmlns:xlink="${go.xlink}" version="1.1">${t}</svg>`,{documentElement:n}=bo(e,{async:!1});return n}const e=document.createElementNS(go.svg,"svg");return e.setAttributeNS(go.xmlns,"xmlns:xlink",go.xlink),e.setAttribute("version","1.1"),e}function bo(t,e={}){let n;try{const i=new DOMParser;if(null!=e.async){i.async=e.async}n=i.parseFromString(t,e.mimeType||"text/xml")}catch(t){n=void 0}if(!n||n.getElementsByTagName("parsererror").length)throw new Error(`Invalid XML: ${t}`);return n}function Co(t,e=!0){const n=t.nodeName;return e?n.toLowerCase():n.toUpperCase()}function vo(t){let e=0,n=t.previousSibling;for(;n;)1===n.nodeType&&(e+=1),n=n.previousSibling;return e}function xo(t,e){return t.querySelector(e)}function wo(t,e,n){const i=t.ownerSVGElement;let s=t.parentNode;for(;s&&s!==n&&s!==i;){if(ro(s,e))return s;s=s.parentNode}return null}function Eo(t,e){const n=e&&e.parentNode;return t===n||!!(n&&1===n.nodeType&&16&t.compareDocumentPosition(n))}function Ao(t){t.parentNode&&t.parentNode.removeChild(t)}function Mo(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function So(t,e){(Array.isArray(e)?e:[e]).forEach((e=>{null!=e&&t.appendChild(e)}))}function Oo(t,e){const n=t.parentNode;if(n){(Array.isArray(e)?e:[e]).forEach((e=>{null!=e&&n.insertBefore(e,t)}))}}function ko(t){try{return t instanceof HTMLElement}catch(e){return"object"==typeof t&&1===t.nodeType&&"object"==typeof t.style&&"object"==typeof t.ownerDocument}}function Po(t){return!(!t||!ko(t))&&(!!["a","button"].includes(Co(t))||("button"===t.getAttribute("role")||"button"===t.getAttribute("type")||Po(t.parentNode)))}function To(t){if("input"===Co(t)){const e=t.getAttribute("type");if(null==e||["text","password","number","email","search","tel","url"].includes(e))return!0}return!1}const Do=["viewBox","attributeName","attributeType","repeatCount"];function No(t,e){const n=zo(e);n.ns?t.hasAttributeNS(n.ns,n.local)&&t.removeAttributeNS(n.ns,n.local):t.hasAttribute(e)&&t.removeAttribute(e)}function jo(t,e,n){if(null==n)return No(t,e);const i=zo(e);i.ns&&"string"==typeof n?t.setAttributeNS(i.ns,e,n):"id"===e?t.id=`${n}`:t.setAttribute(e,`${n}`)}function Lo(t,e){Object.keys(e).forEach((n=>{jo(t,n,e[n])}))}function Fo(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?Lo(t,e):jo(t,e,n)}function zo(t){if(-1!==t.indexOf(":")){const e=t.split(":");return{ns:go[e[0]],local:e[1]}}return{ns:null,local:t}}function Bo(t){const e={};return Object.keys(t).forEach((n=>{const i=Do.includes(n)?n:Vr(n);e[i]=t[n]})),e}function $o(t){const e={};return t.split(";").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 Ro(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],s="object"==typeof e[n];let r,o;i&&s?(r=t[n],o=e[n]):i?(r=t[n],o=$o(e[n])):s?(r=$o(t[n]),o=e[n]):(r=$o(t[n]),o=$o(e[n])),t[n]=Ro(r,o)}else t[n]=e[n]})),t}function Io(t,e,n={}){const i=n.offset||0,s=[],r=[];let o,a,l=null;for(let h=0;h<t.length;h+=1){o=r[h]=t[h];for(let s=0,a=e.length;s<a;s+=1){const a=e[s],l=a.start+i,c=a.end+i;h>=l&&h<c&&("string"==typeof o?o=r[h]={t:t[h],attrs:a.attrs}:o.attrs=Ro(Ro({},o.attrs),a.attrs),n.includeAnnotationIndices&&(null==o.annotations&&(o.annotations=[]),o.annotations.push(s)))}a=r[h-1],a?W(o)&&W(a)?(l=l,JSON.stringify(o.attrs)===JSON.stringify(a.attrs)?l.t+=o.t:(s.push(l),l=o)):W(o)||W(a)?(l=l,s.push(l),l=o):l=(l||"")+o:l=o}return null!=l&&s.push(l),s}var Vo,_o;let Go;!function(t){function e(t){return null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t}function n(t){return Array.isArray(t)}function i(t,s){if(t===s)return!0;if(e(t)||e(s))return!1;const r=n(t),o=n(s);return r===o&&(r&&o?function(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0,s=t.length;n<s;n+=1)if(!i(t[n],e[n]))return!1;return!0}(t,s):function(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(!i(t[n],e[n]))return!1;return!0}(t,s))}function s(t){return e(t)?t:n(t)?function(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}(t):function(t){const e={};return Object.keys(t).forEach((n=>{e[n]=s(t[n])})),e}(t)}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=n,t.isObject=function(t){return!e(t)&&!n(t)},t.deepEqual=i,t.deepCopy=s}(Vo||(Vo={})),function(t){function e(t){const e="data:";return t.substr(0,e.length)===e}function n(t){let e=t.replace(/\s/g,"");e=decodeURIComponent(e);const n=e.indexOf(","),i=e.slice(0,n),s=i.split(":")[1].split(";")[0],r=e.slice(n+1);let o;o=i.indexOf("base64")>=0?atob(r):unescape(encodeURIComponent(r));const a=new Uint8Array(o.length);for(let t=0;t<o.length;t+=1)a[t]=o.charCodeAt(t);return new Blob([a],{type:s})}function i(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){const e=parseFloat(t);return Number.isNaN(e)?null:e}t.isDataUrl=e,t.imageToDataUri=function(t,n){if(!t||e(t))return void setTimeout((()=>n(null,t)));const i=()=>{n(new Error(`Failed to load image: ${t}`))},s=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=>{if(200===e.status){let i=t.split(".").pop()||"png";"svg"===i&&(i="svg+xml");const s=`data:image/${i};base64,`,r=new Uint8Array(e.response),o=s+btoa((t=>{const e=[];for(let n=0;n<t.length;n+=32768)e.push(String.fromCharCode.apply(null,t.subarray(n,n+32768)));return e.join("")})(r));n(null,o)}else i()},r=new XMLHttpRequest;r.responseType=window.FileReader?"blob":"arraybuffer",r.open("GET",t,!0),r.addEventListener("error",i),r.addEventListener("load",(()=>s(r))),r.send()},t.dataUriToBlob=n,t.downloadBlob=i,t.downloadDataUri=function(t,e){i(n(t),e)},t.svgToDataUrl=function(t,e={}){let n=null;const i=e=>(null==n&&(n=function(t){const e=t.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return e&&e[2]?e[2].replace(/\s+/," ").split(" "):null}(t)),null!=n?s(n[e]):null),r=e=>{const n=t.match(e);return n&&n[2]?s(n[2]):null};let o=e.width;if(null==o&&(o=r(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==o&&(o=i(2)),null==o)throw new Error("Can not parse width from svg string");let a=e.height;if(null==a&&(a=r(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==a&&(a=i(3)),null==a)throw new Error("Can not parse height from svg string");return`data:image/svg+xml,${encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22")}`}}(_o||(_o={}));const Ho={px:t=>t,mm:t=>Go*t,cm:t=>Go*t*10,in:t=>Go*t*25.4,pt:t=>Go*(25.4*t/72),pc:t=>Go*(25.4*t/6)};var Uo;!function(t){function e(t,e,n){const i=l("<div/>").css({display:"inline-block",position:"absolute",left:-15e3,top:-15e3,width:t+(n||""),height:e+(n||"")}).appendTo(document.body),s={width:i.width()||0,height:i.height()||0};return i.remove(),s}t.measure=e,t.toPx=function(t,n){null==Go&&(Go=e("1","1","mm").width);const i=n?Ho[n]:null;return i?i(t):t}}(Uo||(Uo={}));const qo=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)),s=setTimeout((()=>{t(n+i)}),i);return e=n+i,s}}return t}(),Wo=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}();function Xo(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}var Yo;function Jo(t,e=0){return Number.isInteger(t)?t:+t.toFixed(e)}function Zo(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 Ko(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 Qo(t,e){return e*Math.round(t/e)}function ta(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 ea(t,e){const n=t.x-e.x,i=t.y-e.y;return n*n+i*i}!document||document.createElement("div").style,function(t){t.toDeg=function(t){return 180*t/Math.PI%360},t.toRad=function(t,e=!1){return(e?t:t%360)*Math.PI/180},t.normalize=function(t){return t%360+(t<0?360:0)}}(Yo||(Yo={}));class na{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class ia extends na{constructor(t,e){super(),this.x=null==t?0:t,this.y=null==e?0:e}get[Symbol.toStringTag](){return ia.toStringTag}round(t=0){return this.x=Jo(this.x,t),this.y=Jo(this.y,t),this}add(t,e){const n=ia.create(t,e);return this.x+=n.x,this.y+=n.y,this}update(t,e){const n=ia.create(t,e);return this.x=n.x,this.y=n.y,this}translate(t,e){const n=ia.create(t,e);return this.x+=n.x,this.y+=n.y,this}rotate(t,e){const n=ia.rotate(this,t,e);return this.x=n.x,this.y=n.y,this}scale(t,e,n=new ia){const i=ia.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 ia.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?ia.create(e):null}distance(t){return Math.sqrt(this.squaredDistance(t))}squaredDistance(t){const e=ia.create(t),n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistance(t){const e=ia.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 ia){const e=ia.create(t),n=-(e.y-this.y),i=e.x-this.x;let s=Math.atan2(n,i);return s<0&&(s=2*Math.PI+s),180*s/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){return new ia(0,0).angleBetween(this,t)}toPolar(t){return this.update(ia.toPolar(this,t)),this}changeInAngle(t,e,n=new ia){return this.clone().translate(-t,-e).theta(n)-this.theta(n)}adhereToRect(t){return ta(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=ia.create(t),n=Yo.toRad(this.y),i=Yo.toRad(e.y),s=this.x,r=e.x,o=Yo.toRad(r-s),a=Math.sin(o)*Math.cos(i),l=Math.cos(n)*Math.sin(i)-Math.sin(n)*Math.cos(i)*Math.cos(o);let h=Yo.toDeg(Math.atan2(a,l))-22.5;return h<0&&(h+=360),h=parseInt(h/45,10),["NE","E","SE","S","SW","W","NW","N"][h]}cross(t,e){if(null!=t&&null!=e){const n=ia.create(t),i=ia.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=ia.create(t);return this.x*e.x+this.y*e.y}diff(t,e){if("number"==typeof t)return new ia(this.x-t,this.y-e);const n=ia.create(t);return new ia(this.x-n.x,this.y-n.y)}lerp(t,e){const n=ia.create(t);return new ia((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=ia.create(t),i=Yo.toRad(n.theta(this));return this.translate(Math.cos(i)*e,-Math.sin(i)*e)}reflection(t){return ia.create(t).move(this,this.distance(t))}snapToGrid(t,e){return this.x=Qo(this.x,t),this.y=Qo(this.y,null==e?t:e),this}equals(t){const e=ia.create(t);return null!=e&&e.x===this.x&&e.y===this.y}clone(){return ia.clone(this)}toJSON(){return ia.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}!function(t){t.toStringTag=`X6.Geometry.${t.name}`,t.isPoint=function(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}}(ia||(ia={})),function(t){t.isPointLike=function(t){return null!=t&&"object"==typeof t&&"number"==typeof t.x&&"number"==typeof t.y},t.isPointData=function(t){return null!=t&&Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}}(ia||(ia={})),function(t){function e(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 n(t,e){return t===e||null!=t&&null!=e&&(t.x===e.x&&t.y===e.y)}function i(n,i,s,r=new t){const o=e(n),a=e(r),l=o.x-a.x,h=o.y-a.y,c=h*i+l*s;return new t(l*i-h*s+a.x,c+a.y)}t.create=function(n,i){return null==n||"number"==typeof n?new t(n,i):e(n)},t.clone=e,t.toJSON=function(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}},t.fromPolar=function(n,i,s=new t){let r=Math.abs(n*Math.cos(i)),o=Math.abs(n*Math.sin(i));const a=e(s),l=Yo.normalize(Yo.toDeg(i));return l<90?o=-o:l<180?(r=-r,o=-o):l<270&&(r=-r),new t(a.x+r,a.y+o)},t.toPolar=function(n,i=new t){const s=e(n),r=e(i),o=s.x-r.x,a=s.y-r.y;return new t(Math.sqrt(o*o+a*a),Yo.toRad(r.theta(s)))},t.equals=n,t.equalPoints=function(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 i=0,s=t.length;i<s;i+=1)if(!n(t[i],e[i]))return!1;return!0},t.random=function(e,n,i,s){return new t(Zo(e,n),Zo(i,s))},t.rotate=function(t,e,n){const s=Yo.toRad(Yo.normalize(-e)),r=Math.sin(s);return i(t,Math.cos(s),r,n)},t.rotateEx=i}(ia||(ia={}));class sa extends na{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 sa.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 ia(this.x,this.y)}get topLeft(){return new ia(this.x,this.y)}get topCenter(){return new ia(this.x+this.width/2,this.y)}get topRight(){return new ia(this.x+this.width,this.y)}get center(){return new ia(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new ia(this.x,this.y+this.height)}get bottomCenter(){return new ia(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new ia(this.x+this.width,this.y+this.height)}get corner(){return new ia(this.x+this.width,this.y+this.height)}get rightMiddle(){return new ia(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new ia(this.x,this.y+this.height/2)}get topLine(){return new ra(this.topLeft,this.topRight)}get rightLine(){return new ra(this.topRight,this.bottomRight)}get bottomLine(){return new ra(this.bottomLeft,this.bottomRight)}get leftLine(){return new ra(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=Yo.toRad(t),n=Math.abs(Math.sin(e)),i=Math.abs(Math.cos(e)),s=this.width*i+this.height*n,r=this.width*n+this.height*i;return new sa(this.x+(this.width-s)/2,this.y+(this.height-r)/2,s,r)}round(t=0){return this.x=Jo(this.x,t),this.y=Jo(this.y,t),this.width=Jo(this.width,t),this.height=Jo(this.height,t),this}add(t,e,n,i){const s=sa.create(t,e,n,i),r=Math.min(this.x,s.x),o=Math.min(this.y,s.y),a=Math.max(this.x+this.width,s.x+s.width),l=Math.max(this.y+this.height,s.y+s.height);return this.x=r,this.y=o,this.width=a-r,this.height=l-o,this}update(t,e,n,i){const s=sa.create(t,e,n,i);return this.x=s.x,this.y=s.y,this.width=s.width,this.height=s.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=ia.create(t,e);return this.x+=n.x,this.y+=n.y,this}scale(t,e,n=new ia){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=Yo.toRad(t),i=Math.cos(n),s=Math.sin(n);let r=this.getOrigin(),o=this.getTopRight(),a=this.getBottomRight(),l=this.getBottomLeft();r=ia.rotateEx(r,i,s,e),o=ia.rotateEx(o,i,s,e),a=ia.rotateEx(a,i,s,e),l=ia.rotateEx(l,i,s,e);const h=new sa(r.x,r.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=sa.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=sa.clone(t),i=e.x,s=e.y;let r=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&&(r=(this.x-i)/(g.x-i)),g.y<s&&(h=(this.y-s)/(g.y-s));const p=n.bottomRight;p.x>i&&(o=(this.x+this.width-i)/(p.x-i)),p.y>s&&(c=(this.y+this.height-s)/(p.y-s));const f=n.topRight;f.x>i&&(a=(this.x+this.width-i)/(f.x-i)),f.y<s&&(u=(this.y-s)/(f.y-s));const m=n.bottomLeft;return m.x<i&&(l=(this.x-i)/(m.x-i)),m.y>s&&(d=(this.y+this.height-s)/(m.y-s)),{sx:Math.min(r,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 ta(this,ia.create(t,e))}containsRect(t,e,n,i){const s=sa.create(t,e,n,i),r=this.x,o=this.y,a=this.width,l=this.height,h=s.x,c=s.y,u=s.width,d=s.height;return 0!==a&&0!==l&&0!==u&&0!==d&&(h>=r&&c>=o&&h+u<=r+a&&c+d<=o+l)}intersectsWithLine(t){const e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],i=[];return e.forEach((e=>{const s=t.intersectsWithLine(e);null!==s&&i.indexOf(s.toString())<0&&(n.push(s),i.push(s.toString()))})),n.length>0?n:null}intersectsWithLineFromCenterToPoint(t,e){const n=ia.clone(t),i=this.center;let s=null;null!=e&&0!==e&&n.rotate(e,i);const r=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],o=new ra(i,n);for(let t=r.length-1;t>=0;t-=1){const e=r[t].intersectsWithLine(o);if(null!==e){s=e;break}}return s&&null!=e&&0!==e&&s.rotate(-e,i),s}intersectsWithRect(t,e,n,i){const s=sa.create(t,e,n,i);if(!this.isIntersectWithRect(s))return null;const r=this.origin,o=this.corner,a=s.origin,l=s.corner,h=Math.max(r.x,a.x),c=Math.max(r.y,a.y);return new sa(h,c,Math.min(o.x,l.x)-h,Math.min(o.y,l.y)-c)}isIntersectWithRect(t,e,n,i){const s=sa.create(t,e,n,i),r=this.origin,o=this.corner,a=s.origin,l=s.corner;return!(l.x<=r.x||l.y<=r.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=sa.clone(t),n=this.origin,i=this.corner,s=e.origin,r=e.corner,o=Math.min(n.x,s.x),a=Math.min(n.y,s.y),l=Math.max(i.x,r.x),h=Math.max(i.y,r.y);return new sa(o,a,l-o,h-a)}getNearestSideToPoint(t){const e=ia.clone(t),n=e.x-this.x,i=this.x+this.width-e.x,s=e.y-this.y;let r=n,o="left";return i<r&&(r=i,o="right"),s<r&&(r=s,o="top"),this.y+this.height-e.y<r&&(o="bottom"),o}getNearestPointToPoint(t){const e=ia.clone(t);if(this.containsPoint(e)){switch(this.getNearestSideToPoint(e)){case"right":return new ia(this.x+this.width,e.y);case"left":return new ia(this.x,e.y);case"bottom":return new ia(e.x,this.y+this.height);case"top":return new ia(e.x,this.y)}}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 sa(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){t.toStringTag=`X6.Geometry.${t.name}`,t.isRectangle=function(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}}(sa||(sa={})),function(t){t.isRectangleLike=function(t){return null!=t&&"object"==typeof t&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.width&&"number"==typeof t.height}}(sa||(sa={})),function(t){function e(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)}t.create=function(n,i,s,r){return null==n||"number"==typeof n?new t(n,i,s,r):e(n)},t.clone=e,t.fromSize=function(e){return new t(0,0,e.width,e.height)},t.fromPositionAndSize=function(e,n){return new t(e.x,e.y,n.width,n.height)},t.fromEllipse=function(e){return new t(e.x-e.a,e.y-e.b,2*e.a,2*e.b)}}(sa||(sa={}));class ra extends na{constructor(t,e,n,i){super(),"number"==typeof t&&"number"==typeof e?(this.start=new ia(t,e),this.end=new ia(n,i)):(this.start=ia.create(t),this.end=ia.create(e))}get[Symbol.toStringTag](){return ra.toStringTag}get center(){return new ia((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,s=n.clone().rotate(270,i),r=i.clone().rotate(90,n);return n.move(r,t),i.move(s,t),e}vector(){return new ia(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const t=new ia(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 sa(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 ra(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 s=this.length();if(t>=s)return i?n.clone():e.clone();const r=(i?t:s-t)/s;return this.pointAt(r)}divideAt(t){const e=this.pointAt(t);return[new ra(this.start,e),new ra(e,this.end)]}divideAtLength(t){const e=this.pointAtLength(t);return[new ra(this.start,e),new ra(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 ra(e,t).length()>i)&&!(new ra(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 ia(this.end.x-this.start.x,this.end.y-this.start.y),n=new ia(t.end.x-t.start.x,t.end.y-t.start.y),i=e.x*n.y-e.y*n.x,s=new ia(t.start.x-this.start.x,t.start.y-this.start.y),r=s.x*n.y-s.y*n.x,o=s.x*e.y-s.y*e.x;if(0===i||r*i<0||o*i<0)return null;if(i>0){if(r>i||o>i)return null}else if(r<i||o<i)return null;return new ia(this.start.x+r*e.x/i,this.start.y+r*e.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(t){const e=ia.clone(t),n=this.start,i=this.end;return((i.x-n.x)*(e.y-n.y)-(i.y-n.y)*(e.x-n.x))/this.length()}pointSquaredDistance(t,e){const n=ia.create(t,e);return this.closestPoint(n).squaredDistance(n)}pointDistance(t,e){const n=ia.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),s=new ra(e,n);return s.translate(i.x-e.x,i.y-e.y),s}tangentAtLength(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,i=this.pointAtLength(t),s=new ra(e,n);return s.translate(i.x-e.x,i.y-e.y),s}relativeCcw(t,e){const n=ia.create(t,e);let i=n.x-this.start.x,s=n.y-this.start.y;const r=this.end.x-this.start.x,o=this.end.y-this.start.y;let a=i*o-s*r;return 0===a&&(a=i*r+s*o,a>0&&(i-=r,s-=o,a=i*r+s*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 ra(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){t.toStringTag=`X6.Geometry.${t.name}`,t.isLine=function(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)&&ia.isPoint(i.start)&&ia.isPoint(i.end)&&"function"==typeof i.vector&&"function"==typeof i.bearing&&"function"==typeof i.parallel&&"function"==typeof i.intersect)return!0}catch(t){return!1}return!1}}(ra||(ra={}));class oa extends na{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 oa.toStringTag}get center(){return new ia(this.x,this.y)}bbox(){return sa.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=ia.create(t,e),i=n.x-this.x,s=n.y-this.y,r=this.a,o=this.b;return i*i/(r*r)+s*s/(o*o)}containsPoint(t,e){return this.normalizedDistance(t,e)<=1}intersectsWithLine(t){const e=[],n=this.a,i=this.b,s=t.start,r=t.end,o=t.vector(),a=s.diff(new ia(this.x,this.y)),l=new ia(o.x/(n*n),o.y/(i*i)),h=new ia(a.x/(n*n),a.y/(i*i)),c=o.dot(l),u=o.dot(h),d=u*u-c*(a.dot(h)-1);if(d<0)return null;if(d>0){const t=Math.sqrt(d),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(s.lerp(r,n)),i>=0&&i<=1&&e.push(s.lerp(r,i))}else{const t=-u/c;if(!(t>=0&&t<=1))return null;e.push(s.lerp(r,t))}return e}intersectsWithLineFromCenterToPoint(t,e=0){const n=ia.clone(t);e&&n.rotate(e,this.getCenter());const i=n.x-this.x,s=n.y-this.y;let r;if(0===i)return r=this.bbox().getNearestPointToPoint(n),e?r.rotate(-e,this.getCenter()):r;const o=s/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 r=new ia(this.x+c,this.y+u),e?r.rotate(-e,this.getCenter()):r}tangentTheta(t){const e=ia.clone(t),n=e.x,i=e.y,s=this.a,r=this.b,o=this.bbox().center,a=o.x,l=o.y,h=n>o.x+s/2,c=n<o.x-s/2;let u,d;return h||c?(d=n>o.x?i-30:i+30,u=s*s/(n-a)-s*s*(i-l)*(d-l)/(r*r*(n-a))+a):(u=i>o.y?n+30:n-30,d=r*r/(i-l)-r*r*(n-a)*(u-a)/(s*s*(i-l))+l),new ia(u,d).theta(e)}scale(t,e){return this.a*=t,this.b*=e,this}rotate(t,e){const n=sa.fromEllipse(this);n.rotate(t,e);const i=oa.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=ia.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 oa(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){t.toStringTag=`X6.Geometry.${t.name}`,t.isEllipse=function(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}}(oa||(oa={})),function(t){function e(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)}t.create=function(n,i,s,r){return null==n||"number"==typeof n?new t(n,i,s,r):e(n)},t.parse=e,t.fromRect=function(e){const n=e.center;return new t(n.x,n.y,e.width/2,e.height/2)}}(oa||(oa={}));class aa extends na{constructor(t){if(super(),null!=t){if("string"==typeof t)return aa.parse(t);this.points=t.map((t=>ia.create(t)))}else this.points=[]}get[Symbol.toStringTag](){return aa.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 ia){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=ia.create(t,e);return this.points.forEach((t=>t.translate(n.x,n.y))),this}bbox(){if(0===this.points.length)return new sa;let t=1/0,e=-1/0,n=1/0,i=-1/0;const s=this.points;for(let r=0,o=s.length;r<o;r+=1){const o=s[r],a=o.x,l=o.y;a<t&&(t=a),a>e&&(e=a),l<n&&(n=l),l>i&&(i=l)}return new sa(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,s=0,r=1/0;for(let o=0,a=n-1;o<a;o+=1){const n=new ra(e[o],e[o+1]),a=n.length(),l=n.closestPointNormalizedLength(t),h=n.pointAt(l).squaredDistance(t);h<r&&(r=h,s=i+l*a),i+=a}return s}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=ia.clone(t),n=e.x,i=e.y,s=this.points,r=s.length;let o=r-1,a=0;for(let l=0;l<r;l+=1){const r=s[o],h=s[l];if(e.equals(r))return!0;const c=new ra(r,h);if(c.containsPoint(t))return!0;if(i<=r.y&&i>h.y||i>r.y&&i<=h.y){const e=r.x-n>h.x-n?r.x-n:h.x-n;if(e>=0){const s=new ia(n+e,i),r=new ra(t,s);c.intersectsWithLine(r)&&(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],s=this.points[n+1],r=t.intersectsWithLine(new ra(i,s));r&&e.push(r)}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];if(new ra(e,n).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()*t;return this.pointAtLength(i)}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 s=0;for(let r=0,o=n-1;r<o;r+=1){const n=i?r:o-1-r,a=e[n],l=e[n+1],h=new ra(a,l),c=a.distance(l);if(t<=s+c)return h.pointAtLength((i?1:-1)*(t-s));s+=c}return(i?e[n-1]:e[0]).clone()}tangentAt(t){const e=this.points.length;if(0===e||1===e)return null;t<0&&(t=0),t>1&&(t=1);const n=this.length()*t;return this.tangentAtLength(n)}tangentAtLength(t){const e=this.points,n=e.length;if(0===n||1===n)return null;let i,s=!0;t<0&&(s=!1,t=-t);let r=0;for(let o=0,a=n-1;o<a;o+=1){const n=s?o:a-1-o,l=e[n],h=e[n+1],c=new ra(l,h),u=l.distance(h);if(c.isDifferentiable()){if(t<=r+u)return c.tangentAtLength((s?1:-1)*(t-r));i=c}r+=u}if(i){const t=s?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;for(;e[i+2];){const t=i+1,s=i+2,r=e[i],o=e[t],a=e[s];new ra(r,a).closestPoint(o).distance(o)<=n?e.splice(t,1):i+=1}return this}toHull(){const t=this.points,e=t.length;if(0===e)return new aa;let n=t[0];for(let i=1;i<e;i+=1)(t[i].y<n.y||t[i].y===n.y&&t[i].x>n.x)&&(n=t[i]);const i=[];for(let s=0;s<e;s+=1){let e=n.theta(t[s]);0===e&&(e=360),i.push([t[s],s,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 s={},r=[],o=t=>`${t[0].toString()}@${t[1]}`;for(;0!==i.length;){const t=i.pop(),e=t[0];if(s[o(t)])continue;let n=!1;for(;!n;)if(r.length<2)r.push(t),n=!0;else{const a=r.pop(),l=a[0],h=r.pop(),c=h[0],u=c.cross(l,e);if(u<0)r.push(h),r.push(a),r.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)?(s[o(a)]=l,r.push(h)):Math.abs((n+1)%360-1)<t&&(r.push(h),i.push(a))}else s[o(a)]=l,r.push(h)}}let a;r.length>2&&r.pop();let l=-1;for(let t=0,e=r.length;t<e;t+=1){const e=r[t][1];(void 0===a||e<a)&&(a=e,l=t)}let h=[];if(l>0){const t=r.slice(l),e=r.slice(0,l);h=t.concat(e)}else h=r;const c=[];for(let t=0,e=h.length;t<e;t+=1)c.push(h[t][0]);return new aa(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 aa(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){t.toStringTag=`X6.Geometry.${t.name}`,t.isPolyline=function(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}}(aa||(aa={})),function(t){t.parse=function(e){const n=e.trim();if(""===n)return new t;const i=[],s=n.split(/\s*,\s*|\s+/);for(let t=0,e=s.length;t<e;t+=2)i.push({x:+s[t],y:+s[t+1]});return new t(i)}}(aa||(aa={}));class la extends na{constructor(t,e,n,i){super(),this.PRECISION=3,this.start=ia.create(t),this.controlPoint1=ia.create(e),this.controlPoint2=ia.create(n),this.end=ia.create(i)}get[Symbol.toStringTag](){return la.toStringTag}bbox(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end,s=t.x,r=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,C,v,x,w,E,A,M;for(let t=0;t<2;t+=1)if(0===t?(m=6*s-12*o+6*l,f=-3*s+9*o-9*l+3*c,y=3*o-3*s):(m=6*r-12*a+6*h,f=-3*r+9*a-9*h+3*u,y=3*a-3*r),Math.abs(f)<1e-12){if(Math.abs(m)<1e-12)continue;b=-y/m,b>0&&b<1&&g.push(b)}else x=m*m-4*y*f,w=Math.sqrt(x),x<0||(C=(-m+w)/(2*f),C>0&&C<1&&g.push(C),v=(-m-w)/(2*f),v>0&&v<1&&g.push(v));let S=g.length;const O=S;for(;S;)S-=1,b=g[S],M=1-b,E=M*M*M*s+3*M*M*b*o+3*M*b*b*l+b*b*b*c,p[0][S]=E,A=M*M*M*r+3*M*M*b*a+3*M*b*b*h+b*b*b*u,p[1][S]=A,d[S]={X:E,Y:A};g[O]=0,g[O+1]=1,d[O]={X:s,Y:r},d[O+1]={X:c,Y:u},p[0][O]=s,p[1][O]=r,p[0][O+1]=c,p[1][O+1]=u,g.length=O+2,p[0].length=O+2,p[1].length=O+2,d.length=O+2;const k=Math.min.apply(null,p[0]),P=Math.min.apply(null,p[1]),T=Math.max.apply(null,p[0]),D=Math.max.apply(null,p[1]);return new sa(k,P,T-k,D-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 s=this.length(n);return 0===s?0:i/s}closestPointT(t,e={}){const n=this.getPrecision(e),i=this.getDivisions(e),s=Math.pow(10,-n);let r=null,o=0,a=0,l=0,h=0,c=0,u=null;const d=i.length;let g=d>0?1/d:0;for(i.forEach(((e,n)=>{const i=e.start.distance(t),s=e.end.distance(t),d=i+s;(null==u||d<u)&&(r=e,o=n*g,a=(n+1)*g,l=i,h=s,u=d,c=e.endpointDistance())}));;){const e=l?Math.abs(l-h)/l:0,n=null!=h?Math.abs(l-h)/h:0,i=!h||h<c*s,u=!l||l<c*s||i;if(e<s||n<s||u)return l<=h?o:a;const d=r.divide(.5);g/=2;const p=d[0].start.distance(t),f=d[0].end.distance(t),m=p+f,y=d[1].start.distance(t),b=d[1].end.distance(t);m<=y+b?(r=d[0],a-=g,l=p,h=f):(r=d[1],o+=g,l=y,h=b)}}closestPointTangent(t,e={}){return this.tangentAtT(this.closestPointT(t,e))}containsPoint(t,e={}){return this.toPolyline(e).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,s=this.end;if(t<=0)return[new la(e,e,e,e),new la(e,n,i,s)];if(t>=1)return[new la(e,n,i,s),new la(s,s,s,s)];const r=this.getSkeletonPoints(t),o=r.startControlPoint1,a=r.startControlPoint2,l=r.divider,h=r.dividerControlPoint1,c=r.dividerControlPoint2;return[new la(e,o,a,l),new la(l,h,c,s)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(t){const e=this.start,n=this.controlPoint1,i=this.controlPoint2,s=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:s.clone(),dividerControlPoint1:s.clone(),dividerControlPoint2:s.clone()};const r=new ra(e,n).pointAt(t),o=new ra(n,i).pointAt(t),a=new ra(i,s).pointAt(t),l=new ra(r,o).pointAt(t),h=new ra(o,a).pointAt(t);return{startControlPoint1:r,startControlPoint2:l,divider:new ra(l,h).pointAt(t),dividerControlPoint1:h,dividerControlPoint2:a}}getSubdivisions(t={}){const e=this.getPrecision(t);let n=[new la(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===e)return n;let i=this.endpointDistance();const s=Math.pow(10,-e);let r=0;for(;;){r+=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(r>1&&o<s)return t;n=t,i=e}}length(t={}){return this.getDivisions(t).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;return this.divide(t)[0].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,s=e.divider,r=new ra(n,i);return r.translate(s.x-n.x,s.y-n.y),r}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={}){return{precision:this.getPrecision(t),subdivisions:this.getDivisions(t)}}tAt(t,e={}){if(t<=0)return 0;if(t>=1)return 1;const n=this.getOptions(e),i=this.length(n)*t;return this.tAtLength(i,n)}tAtLength(t,e={}){let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),s=this.getDivisions(e),r={precision:i,subdivisions:s};let o,a,l=null,h=0,c=0,u=0;const d=s.length;let g=d>0?1/d:0;for(let e=0;e<d;e+=1){const i=n?e:d-1-e,r=s[e],p=r.endpointDistance();if(t<=u+p){l=r,o=i*g,a=(i+1)*g,h=n?t-u:p+u-t,c=n?p+u-t:t-u;break}u+=p}if(null==l)return n?1:0;const p=this.length(r),f=Math.pow(10,-i);for(;;){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 s=i[0].endpointDistance(),r=i[1].endpointDistance();h<=s?(l=i[0],a-=g,e=h,n=s-e):(l=i[1],o+=g,e=h-s,n=r-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 aa(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 la(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){t.toStringTag=`X6.Geometry.${t.name}`,t.isCurve=function(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)&&ia.isPoint(i.start)&&ia.isPoint(i.controlPoint1)&&ia.isPoint(i.controlPoint2)&&ia.isPoint(i.end)&&"function"==typeof i.toPoints&&"function"==typeof i.toPolyline)return!0}catch(t){return!1}return!1}}(la||(la={})),function(t){function e(t){const e=t.length,n=[],i=[];let s=2;n[0]=t[0]/s;for(let r=1;r<e;r+=1)i[r]=1/s,s=(r<e-1?4:3.5)-i[r],n[r]=(t[r]-n[r-1])/s;for(let t=1;t<e;t+=1)n[e-t-1]-=i[e-t]*n[e-t];return n}t.throughPoints=function(n){if(null==n||Array.isArray(n)&&n.length<2)throw new Error("At least 2 points are required");const i=function(t){const n=t.map((t=>ia.clone(t))),i=[],s=[],r=n.length-1;if(1===r)return i[0]=new ia((2*n[0].x+n[1].x)/3,(2*n[0].y+n[1].y)/3),s[0]=new ia(2*i[0].x-n[0].x,2*i[0].y-n[0].y),[i,s];const o=[];for(let t=1;t<r-1;t+=1)o[t]=4*n[t].x+2*n[t+1].x;o[0]=n[0].x+2*n[1].x,o[r-1]=(8*n[r-1].x+n[r].x)/2;const a=e(o);for(let t=1;t<r-1;t+=1)o[t]=4*n[t].y+2*n[t+1].y;o[0]=n[0].y+2*n[1].y,o[r-1]=(8*n[r-1].y+n[r].y)/2;const l=e(o);for(let t=0;t<r;t+=1)i.push(new ia(a[t],l[t])),t<r-1?s.push(new ia(2*n[t+1].x-a[t+1],2*n[t+1].y-l[t+1])):s.push(new ia((n[r].x+a[r-1])/2,(n[r].y+l[r-1])/2));return[i,s]}(n),s=[];for(let e=0,r=i[0].length;e<r;e+=1){const r=new ia(i[0][e].x,i[0][e].y),o=new ia(i[1][e].x,i[1][e].y);s.push(new t(n[e],r,o,n[e+1]))}return s}}(la||(la={}));class ha extends na{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 ca extends ha{constructor(t,e){super(),ra.isLine(t)?this.endPoint=t.end.clone().round(2):this.endPoint=ia.create(t,e).round(2)}get type(){return"L"}get line(){return new ra(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 ca(e[0]),new ca(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[new ca(e[0]),new ca(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 ca(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){t.create=function(...e){const n=e.length,i=e[0];if(ra.isLine(i))return new t(i);if(ia.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 s=[];for(let i=0;i<n;i+=2){const n=+e[i],r=+e[i+1];s.push(new t(n,r))}return s}}(ca||(ca={}));class ua extends ha{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 ra(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 ca(e[0]):this.clone(),new ca(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new ca(e[0]):this.clone(),new ca(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 ua}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}!function(t){t.create=function(){return new t}}(ua||(ua={}));class da extends ha{constructor(t,e){super(),this.isVisible=!1,this.isSubpathStart=!0,ra.isLine(t)||la.isCurve(t)?this.endPoint=t.end.clone().round(2):this.endPoint=ia.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 da(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){t.create=function(...e){const n=e.length,i=e[0];if(ra.isLine(i))return new t(i);if(la.isCurve(i))return new t(i);if(ia.isPointLike(i)){if(1===n)return new t(i);const s=[];for(let i=0;i<n;i+=1)0===i?s.push(new t(e[i])):s.push(new ca(e[i]));return s}if(2===n)return new t(+e[0],+e[1]);const s=[];for(let i=0;i<n;i+=2){const n=+e[i],r=+e[i+1];0===i?s.push(new t(n,r)):s.push(new ca(n,r))}return s}}(da||(da={}));class ga extends ha{constructor(t,e,n,i,s,r){super(),la.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 ia(t,e).round(2),this.controlPoint2=new ia(n,i).round(2),this.endPoint=new ia(s,r).round(2)):(this.controlPoint1=ia.create(t).round(2),this.controlPoint2=ia.create(e).round(2),this.endPoint=ia.create(n).round(2))}get type(){return"C"}get curve(){return new la(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 ga(n[0]),new ga(n[1])]}divideAtLength(t,e={}){const n=this.curve.divideAtLength(t,e);return[new ga(n[0]),new ga(n[1])]}divideAtT(t){const e=this.curve.divideAtT(t);return[new ga(e[0]),new ga(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 ga(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 pa(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function fa(t,e,n,i,s,r){const o=1/3,a=2/3;return[o*t+a*n,o*e+a*i,o*s+a*n,o*r+a*i,s,r]}function ma(t,e,n,i,s,r,o,a,l,h){const c=120*Math.PI/180,u=Math.PI/180*(+s||0);let d,g,p,f,m,y=[];if(h)g=h[0],p=h[1],f=h[2],m=h[3];else{d=pa(t,e,-u),t=d.x,e=d.y,d=pa(a,l,-u);const s=(t-(a=d.x))/2,h=(e-(l=d.y))/2;let c=s*s/(n*n)+h*h/(i*i);c>1&&(c=Math.sqrt(c),n*=c,i*=c);const y=n*n,b=i*i,C=(r===o?-1:1)*Math.sqrt(Math.abs((y*b-y*h*h-b*s*s)/(y*h*h+b*s*s)));f=C*n*h/i+(t+a)/2,m=C*-i*s/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,r=l;p=g+c*(o&&p>g?1:-1),y=ma(a=f+n*Math.cos(p),l=m+i*Math.sin(p),n,i,s,0,o,e,r,[p,t,f,m])}b=p-g;const C=Math.cos(g),v=Math.sin(g),x=Math.cos(p),w=Math.sin(p),E=Math.tan(b/4),A=4/3*(n*E),M=4/3*(i*E),S=[t,e],O=[t+A*v,e-M*C],k=[a+A*w,l-M*x],P=[a,l];if(O[0]=2*S[0]-O[0],O[1]=2*S[1]-O[1],h)return[O,k,P].concat(y);{y=[O,k,P].concat(y).join().split(",");const t=[],e=y.length;for(let n=0;n<e;n+=1)t[n]=n%2?pa(+y[n-1],+y[n],u).y:pa(+y[n],+y[n+1],u).x;return t}}function ya(t){const e=function(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"),s={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=[];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&&(r.push([e,...o.splice(0,2)]),a="l",e="m"===e?"l":"L");const l=s[a];for(;o.length>=l&&(r.push([e,...o.splice(0,l)]),l););return t})),r}(t);if(!e||!e.length)return[["M",0,0]];let n=0,i=0,s=0,r=0;const o=[];for(let t=0,a=e.length;t<a;t+=1){const a=[];o.push(a);const l=e[t],h=l[0];if(h!==h.toUpperCase())switch(a[0]=h.toUpperCase(),a[0]){case"A":a[1]=l[1],a[2]=l[2],a[3]=l[3],a[4]=l[4],a[5]=l[5],a[6]=+l[6]+n,a[7]=+l[7]+i;break;case"V":a[1]=+l[1]+i;break;case"H":a[1]=+l[1]+n;break;case"M":s=+l[1]+n,r=+l[2]+i;for(let t=1,e=l.length;t<e;t+=1)a[t]=+l[t]+(t%2?n:i);break;default:for(let t=1,e=l.length;t<e;t+=1)a[t]=+l[t]+(t%2?n:i)}else for(let t=0,e=l.length;t<e;t+=1)a[t]=l[t];switch(a[0]){case"Z":n=+s,i=+r;break;case"H":n=a[1];break;case"V":i=a[1];break;case"M":s=a[a.length-2],r=a[a.length-1],n=a[a.length-2],i=a[a.length-1];break;default:n=a[a.length-2],i=a[a.length-1]}}return o}function ba(t){const e=ya(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,s;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(ma.apply(0,[e.x,e.y].concat(t.slice(1))));case"S":return"C"===n||"S"===n?(i=2*e.x-e.bx,s=2*e.y-e.by):(i=e.x,s=e.y),["C",i,s].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(fa(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(fa(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])}return t}function s(t,n){if(t[n].length>7){t[n].shift();const i=t[n];for(;i.length;)r[n]="A",n+=1,t.splice(n,0,["C"].concat(i.splice(0,6)));t.splice(n,1),a=e.length}}const r=[];let o="",a=e.length;for(let t=0;t<a;t+=1){let a="";e[t]&&(a=e[t][0]),"C"!==a&&(r[t]=a,t>0&&(o=r[t-1])),e[t]=i(e[t],n,o),"A"!==r[t]&&"C"===a&&(r[t]="C"),s(e,t);const l=e[t],h=l.length;n.x=l[h-2],n.y=l[h-1],n.bx=parseFloat(l[h-4])||n.x,n.by=parseFloat(l[h-3])||n.y}return e[0][0]&&"M"===e[0][0]||e.unshift(["M",0,0]),e}function Ca(t){return ba(t).map((t=>t.map((t=>"string"==typeof t?t:Jo(t,2))))).join(",").split(",").join(" ")}!function(t){t.create=function(...e){const n=e.length,i=e[0];if(la.isCurve(i))return new t(i);if(ia.isPointLike(i)){if(3===n)return new t(e[0],e[1],e[2]);const i=[];for(let s=0;s<n;s+=3)i.push(new t(e[s],e[s+1],e[s+2]));return i}if(6===n)return new t(e[0],e[1],e[2],e[3],e[4],e[5]);const s=[];for(let i=0;i<n;i+=6)s.push(new t(e[i],e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]));return s}}(ga||(ga={}));const va=new RegExp("^[\\s\\dLMCZz,.]*$");function xa(t){return"string"==typeof t&&va.test(t)}function wa(t,e){return(t%e+e)%e}function Ea(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})})),function(t,e,n,i,s){const r=[],o=t[t.length-1],a=null!=e&&e>0,l=e||0;if(i&&a){const e=(t=t.slice())[0],n=new ia(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;for(n?r.push("M",h.x,h.y):r.push("L",h.x,h.y);c<(i?t.length:t.length-1);){let e=t[wa(c,t.length)],n=h.x-e.x,i=h.y-e.y;if(a&&(0!==n||0!==i)&&(null==s||s.indexOf(c-1)<0)){let s=Math.sqrt(n*n+i*i);const o=n*Math.min(l,s/2)/s,a=i*Math.min(l,s/2)/s,h=e.x+o,u=e.y+a;r.push("L",h,u);let d=t[wa(c+1,t.length)];for(;c<t.length-2&&0===Math.round(d.x-e.x)&&0===Math.round(d.y-e.y);)d=t[wa(c+2,t.length)],c+=1;n=d.x-e.x,i=d.y-e.y,s=Math.max(1,Math.sqrt(n*n+i*i));const g=n*Math.min(l,s/2)/s,p=i*Math.min(l,s/2)/s,f=e.x+g,m=e.y+p;r.push("Q",e.x,e.y,f,m),e=new ia(f,m)}else r.push("L",e.x,e.y);h=e,c+=1}return i?r.push("Z"):r.push("L",o.x,o.y),r.map((t=>"string"==typeof t?t:+t.toFixed(3))).join(" ")}(n,e.round,null==e.initialMove||e.initialMove,e.close,e.exclude)}function Aa(t,e,n,i,s=0,r=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(s*Math.PI/180),d=Math.sin(s*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,C=f/y+m/b;let v;if(C>1)n=Math.sqrt(C)*n,i=Math.sqrt(C)*i,v=0;else{let t=1;r===o&&(t=-1),v=t*Math.sqrt((y*b-y*m-b*f)/(y*m+b*f))}const x=v*n*p/i,w=-1*v*i*g/n,E=u*x-d*w+a/2,A=d*x+u*w+l/2;let M=Math.atan2((p-w)/i,(g-x)/n)-Math.atan2(0,1),S=M>=0?M:2*Math.PI+M;M=Math.atan2((-p-w)/i,(-g-x)/n)-Math.atan2((p-w)/i,(g-x)/n);let O=M>=0?M:2*Math.PI+M;0===o&&O>0?O-=2*Math.PI:0!==o&&O<0&&(O+=2*Math.PI);const k=2*O/Math.PI,P=Math.ceil(k<0?-1*k:k),T=O/P,D=8/3*Math.sin(T/4)*Math.sin(T/4)/Math.sin(T/2),N=u*n,j=u*i,L=d*n,F=d*i;let z=Math.cos(S),B=Math.sin(S),$=-D*(N*B+F*z),R=-D*(L*B-j*z),I=0,V=0;const _=[];for(let n=0;n<P;n+=1){S+=T,z=Math.cos(S),B=Math.sin(S),I=N*z-F*B+E,V=L*z+j*B+A;const i=-D*(N*B+F*z),s=-D*(L*B-j*z),r=6*n;_[r]=Number($+t),_[r+1]=Number(R+e),_[r+2]=Number(I-i+t),_[r+3]=Number(V-s+e),_[r+4]=Number(I+t),_[r+5]=Number(V+e),$=I+i,R=V+s}return _.map((t=>+t.toFixed(2)))}function Ma(t,e,n,i,s=0,r=0,o=0,a,l){const h=[],c=Aa(t,e,n,i,s,r,o,a,l);if(null!=c)for(let t=0,e=c.length;t<e;t+=6)h.push("C",c[t],c[t+1],c[t+2],c[t+3],c[t+4],c[t+5]);return h.join(" ")}class Sa extends na{constructor(t){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(t))if(ra.isLine(t[0])||la.isCurve(t[0])){let e=null;t.forEach(((t,n)=>{0===n&&this.appendSegment(Sa.createSegment("M",t.start)),null==e||e.end.equals(t.start)||this.appendSegment(Sa.createSegment("M",t.start)),ra.isLine(t)?this.appendSegment(Sa.createSegment("L",t.end)):la.isCurve(t)&&this.appendSegment(Sa.createSegment("C",t.controlPoint1,t.controlPoint2,t.end)),e=t}))}else{t.forEach((t=>{t.isSegment&&this.appendSegment(t)}))}else null!=t&&(ra.isLine(t)?(this.appendSegment(Sa.createSegment("M",t.start)),this.appendSegment(Sa.createSegment("L",t.end))):la.isCurve(t)?(this.appendSegment(Sa.createSegment("M",t.start)),this.appendSegment(Sa.createSegment("C",t.controlPoint1,t.controlPoint2,t.end))):aa.isPolyline(t)?t.points&&t.points.length&&t.points.forEach(((t,e)=>{const n=0===e?Sa.createSegment("M",t):Sa.createSegment("L",t);this.appendSegment(n)})):t.isSegment&&this.appendSegment(t))}get[Symbol.toStringTag](){return Sa.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(da.create.call(null,...t))}lineTo(...t){return this.appendSegment(ca.create.call(null,...t))}curveTo(...t){return this.appendSegment(ga.create.call(null,...t))}arcTo(t,e,n,i,s,r,o){const a=this.end||new ia,l="number"==typeof r?Aa(a.x,a.y,t,e,n,i,s,r,o):Aa(a.x,a.y,t,e,n,i,s,r.x,r.y);if(null!=l)for(let t=0,e=l.length;t<e;t+=6)this.curveTo(l[t],l[t+1],l[t+2],l[t+3],l[t+4],l[t+5]);return this}quadTo(t,e,n,i){const s=this.end||new ia,r=["M",s.x,s.y];if("number"==typeof t)r.push("Q",t,e,n,i);else{const n=e;r.push("Q",t.x,t.y,n.x,n.y)}const o=Sa.parse(r.join(" "));return this.appendSegment(o.segments.slice(1)),this}close(){return this.appendSegment(ua.create())}drawPoints(t,e={}){const n=Ea(t,e),i=Sa.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 i=0;i<e;i+=1){const e=t[i];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 sa(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;if(Array.isArray(t))for(let e=0,s=t.length;e<s;e+=1){const s=t[e];n=this.prepareSegment(s,i,null),this.segments.push(n),i=n}else null!=t&&t.isSegment&&(n=this.prepareSegment(t,i,null),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,s=null,r=null;if(0!==n&&(t>=1?(s=this.segments[t-1],r=s.nextSegment):(s=null,r=this.segments[0])),Array.isArray(e))for(let n=0,o=e.length;n<o;n+=1){const o=e[n];i=this.prepareSegment(o,s,r),this.segments.splice(t+n,0,i),s=i}else i=this.prepareSegment(e,s,r),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,s=n.nextSegment;return i&&(i.nextSegment=s),s&&(s.previousSegment=i),n.isSubpathStart&&s&&this.updateSubpathStartSegment(s),n}replaceSegment(t,e){const n=this.fixIndex(t);let i;const s=this.segments[n];let r=s.previousSegment;const o=s.nextSegment;let a=s.isSubpathStart;if(Array.isArray(e)){this.segments.splice(t,1);for(let n=0,s=e.length;n<s;n+=1){const s=e[n];i=this.prepareSegment(s,r,o),this.segments.splice(t+n,0,i),r=i,a&&i.isSubpathStart&&(a=!1)}}else i=this.prepareSegment(e,r,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;for(;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=Ko(t,0,1),i=this.getOptions(e),s=this.length(i)*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 s=this.getPrecision(e),r=this.getSubdivisions(e);let o=0,a=null;for(let e=0;e<n;e+=1){const l=i?e:n-1-e,h=this.segments[l],c=r[l],u=h.length({precision:s,subdivisions:c});if(h.isVisible){if(t<=o+u)return l;a=l}o+=u}return a}getSegmentSubdivisions(t={}){const e=this.getPrecision(t),n=[];for(let t=0,i=this.segments.length;t<i;t+=1){const i=this.segments[t].getSubdivisions({precision:e});n.push(i)}return n}updateSubpathStartSegment(t){let e=t.previousSegment,n=t;for(;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 s=this.length(n);return 0===s?0:i/s}closestPointT(t,e={}){if(0===this.segments.length)return null;const n=this.getPrecision(e),i=this.getSubdivisions(e);let s,r=1/0;for(let e=0,o=this.segments.length;e<o;e+=1){const o=this.segments[e],a=i[e];if(o.isVisible){const i=o.closestPointT(t,{precision:n,subdivisions:a}),l=ea(o.pointAtT(i),t);l<r&&(s={segmentIndex:e,value:i},r=l)}}return s||{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 s,r=1/0;for(let e=0,o=this.segments.length;e<o;e+=1){const o=this.segments[e],a=i[e];if(o.isDifferentiable()){const e=o.closestPointT(t,{precision:n,subdivisions:a}),i=ea(o.pointAtT(e),t);i<r&&(s=o.tangentAtT(e),r=i)}}return s||null}containsPoint(t,e={}){const n=this.toPolylines(e);if(!n)return!1;let i=0;for(let e=0,s=n.length;e<s;e+=1){n[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)*t;return this.pointAtLength(i,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),s=this.getSubdivisions(e);let r,o=0;for(let e=0,a=this.segments.length;e<a;e+=1){const l=n?e:a-1-e,h=this.segments[l],c=s[l],u=h.length({precision:i,subdivisions:c});if(h.isVisible){if(t<=o+u)return h.pointAtLength((n?1:-1)*(t-o),{precision:i,subdivisions:c});r=h}o+=u}if(r)return n?r.end:r.start;return this.segments[this.segments.length-1].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 s=Ko(t.value,0,1);return e[i].pointAtT(s)}divideAt(t,e={}){if(0===this.segments.length)return null;const n=Ko(t,0,1),i=this.getOptions(e),s=this.length(i)*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),s=this.getSubdivisions(e);let r,o,a,l,h,c=0;for(let e=0,h=this.segments.length;e<h;e+=1){const u=n?e:h-1-e,d=this.getSegment(u),g={precision:i,subdivisions:s[u]},p=d.length(g);if(d.isDifferentiable()&&(a=d,l=u,t<=c+p)){o=u,r=d.divideAtLength((n?1:-1)*(t-c),g);break}c+=p}if(!a)return null;r||(o=l,h=n?1:0,r=a.divideAtT(h));const u=this.clone(),d=o;u.replaceSegment(d,r);const g=d;let p=d+1,f=d+2;r[0].isDifferentiable()||(u.removeSegment(g),p-=1,f-=1);const m=u.getSegment(p).start;u.insertSegment(p,Sa.createSegment("M",m)),f+=1,r[1].isDifferentiable()||(u.removeSegment(f-1),f-=1);const y=f-g-1;for(let t=f,e=u.segments.length;t<e;t+=1){const e=this.getSegment(t-y),n=u.getSegment(t);if("Z"===n.type&&!e.subpathStartSegment.end.equals(n.subpathStartSegment.end)){const n=Sa.createSegment("L",e.end);u.replaceSegment(t,n)}}return[new Sa(u.segments.slice(0,p)),new Sa(u.segments.slice(p))]}intersectsWithLine(t,e={}){const n=this.toPolylines(e);if(null==n)return null;let i=null;for(let e=0,s=n.length;e<s;e+=1){const s=n[e],r=t.intersect(s);r&&(null==i&&(i=[]),Array.isArray(r)?i.push(...r):i.push(r))}return i}isDifferentiable(){for(let t=0,e=this.segments.length;t<e;t+=1){if(this.segments[t].isDifferentiable())return!0}return!1}isValid(){const t=this.segments;return 0===t.length||"M"===t[0].type}length(t={}){if(0===this.segments.length)return 0;const e=this.getSubdivisions(t);let n=0;for(let t=0,i=this.segments.length;t<i;t+=1){const i=this.segments[t],s=e[t];n+=i.length({subdivisions:s})}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 s=Ko(t.value,0,1);i>=n&&(i=n-1,s=1);const r=this.getPrecision(e),o=this.getSubdivisions(e);let a=0;for(let t=0;t<i;t+=1){const e=this.segments[t],n=o[t];a+=e.length({precision:r,subdivisions:n})}const l=this.segments[i],h=o[i];return a+=l.lengthAtT(s,{precision:r,subdivisions:h}),a}tangentAt(t,e={}){if(0===this.segments.length)return null;const n=Ko(t,0,1),i=this.getOptions(e),s=this.length(i)*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),s=this.getSubdivisions(e);let r,o=0;for(let e=0,a=this.segments.length;e<a;e+=1){const l=n?e:a-1-e,h=this.segments[l],c=s[l],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});r=h}o+=u}if(r){const t=n?1:0;return r.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=Ko(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={}){return{precision:this.getPrecision(t),segmentSubdivisions:this.getSubdivisions(t)}}toPoints(t={}){const e=this.segments,n=e.length;if(0===n)return null;const i=this.getSubdivisions(t),s=[];let r=[];for(let t=0;t<n;t+=1){const n=e[t];if(n.isVisible){const e=i[t];e.length>0?e.forEach((t=>r.push(t.start))):r.push(n.start)}else r.length>0&&(r.push(e[t-1].end),s.push(r),r=[])}return r.length>0&&(r.push(this.end),s.push(r)),s}toPolylines(t={}){const e=this.toPoints(t);return e?e.map((t=>new aa(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 Sa;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 t=0;t<i;t+=1){const i=e[t],s=n[t];if(i.type!==s.type||!i.equals(s))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){t.toStringTag=`X6.Geometry.${t.name}`,t.isPath=function(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)}}(Sa||(Sa={})),function(t){function e(t,...e){if("M"===t)return da.create.call(null,...e);if("L"===t)return ca.create.call(null,...e);if("C"===t)return ga.create.call(null,...e);if("z"===t||"Z"===t)return ua.create();throw new Error(`Invalid path segment type "${t}"`)}t.parse=function(n){if(!n)return new t;const i=new t,s=t.normalize(n).match(/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g);if(null!=s)for(let t=0,n=s.length;t<n;t+=1){const n=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,r=s[t].match(n);if(null!=r){const t=r[0],n=r.slice(1).map((t=>+t)),s=e.call(null,t,...n);i.appendSegment(s)}}return i},t.createSegment=e}(Sa||(Sa={})),function(t){t.normalize=Ca,t.isValid=xa,t.drawArc=Ma,t.drawPoints=Ea,t.arcToCurves=Aa}(Sa||(Sa={}));class Oa{constructor(t,e,n){if(!t)throw new TypeError("Invalid element to create vector");let i;if(Oa.isVector(t))i=t.node;else if("string"==typeof t)if("svg"===t.toLowerCase())i=yo();else if("<"===t[0]){const e=yo(t);i=document.importNode(e.firstChild,!0)}else i=document.createElementNS(go.svg,t);else i=t;this.node=i,e&&this.setAttributes(e),n&&this.append(n)}get[Symbol.toStringTag](){return Oa.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?il(this.node):(il(this.node,t,e),this)}translate(t,e=0,n={}){return null==t?sl(this.node):(sl(this.node,t,e,n),this)}rotate(t,e,n,i={}){return null==t?rl(this.node):(rl(this.node,t,e,n,i),this)}scale(t,e){return null==t?ol(this.node):(ol(this.node,t,e),this)}getTransformToElement(t){const e=Oa.toNode(t);return Qa(this.node,e)}removeAttribute(t){return No(this.node,t),this}getAttribute(t){return function(t,e){return t.getAttribute(e)}(this.node,t)}setAttribute(t,e){return jo(this.node,t,e),this}setAttributes(t){return Lo(this.node,t),this}attr(t,e){return null==t?Fo(this.node):"string"==typeof t&&void 0===e?Fo(this.node,t):("object"==typeof t?Fo(this.node,t):Fo(this.node,t,e),this)}svg(){return this.node instanceof SVGSVGElement?this:Oa.create(this.node.ownerSVGElement)}defs(){const t=this.svg()||this,e=t.node.getElementsByTagName("defs")[0];return e?Oa.create(e):Oa.create("defs").appendTo(t)}text(t,e={}){return Da(this.node,t,e),this}tagName(){return Co(this.node)}clone(){return Oa.create(this.node.cloneNode(!0))}remove(){return Ao(this.node),this}empty(){return Mo(this.node),this}append(t){return So(this.node,Oa.toNodes(t)),this}appendTo(t){return function(t,e){null!=e&&e.appendChild(t)}(this.node,Oa.isVector(t)?t.node:t),this}prepend(t){return function(t,e){const n=t.firstChild;n?Oo(n,e):So(t,e)}(this.node,Oa.toNodes(t)),this}before(t){return Oo(this.node,Oa.toNodes(t)),this}replace(t){return this.node.parentNode&&this.node.parentNode.replaceChild(Oa.toNode(t),this.node),Oa.create(t)}first(){return this.node.firstChild?Oa.create(this.node.firstChild):null}last(){return this.node.lastChild?Oa.create(this.node.lastChild):null}get(t){const e=this.node.childNodes[t];return e?Oa.create(e):null}indexOf(t){return Array.prototype.slice.call(this.node.childNodes).indexOf(Oa.toNode(t))}find(t){const e=[],n=function(t,e){return t.querySelectorAll(e)}(this.node,t);if(n)for(let t=0,i=n.length;t<i;t+=1)e.push(Oa.create(n[t]));return e}findOne(t){const e=xo(this.node,t);return e?Oa.create(e):null}findParentByClass(t,e){const n=wo(this.node,t,e);return n?Oa.create(n):null}matches(t){const e=this.node;this.node.matches;const n=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null;return n&&n.call(e,t)}contains(t){return Eo(this.node,Oa.isVector(t)?t.node:t)}wrap(t){const e=Oa.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=Oa.create(e.node.parentNode),null==t)return e;do{if("string"==typeof t?e.matches(t):e instanceof t)return e}while(e=Oa.create(e.node.parentNode));return e}children(){const t=this.node.childNodes,e=[];for(let n=0;n<t.length;n+=1){1===t[n].nodeType&&e.push(Oa.create(t[n]))}return e}eachChild(t,e){const n=this.children();for(let i=0,s=n.length;i<s;i+=1)t.call(n[i],n[i],i,n),e&&n[i].eachChild(t,e);return this}index(){return vo(this.node)}hasClass(t){return ro(this.node,t)}addClass(t){return oo(this.node,t),this}removeClass(t){return ao(this.node,t),this}toggleClass(t,e){return lo(this.node,t,e),this}toLocalPoint(t,e){return function(t,e,n){const i=t instanceof SVGSVGElement?t:t.ownerSVGElement,s=i.createSVGPoint();s.x=e,s.y=n;try{const e=i.getScreenCTM(),n=s.matrixTransform(e.inverse()),r=Qa(t,i).inverse();return n.matrixTransform(r)}catch(t){return s}}(this.node,t,e)}toGeometryShape(){return tl(this.node)}translateCenterToPoint(t){const e=this.getBBox({target:this.svg()}).getCenter();return this.translate(t.x-e.x,t.y-e.y),this}translateAndAutoOrient(t,e,n){return al(this.node,t,e,n),this}animate(t){return function(t,e){return el(t,e,"animate")}(this.node,t)}animateTransform(t){return function(t,e){return el(t,e,"animateTransform")}(this.node,t)}animateAlongPath(t,e){return function(t,e,n){const i=co(n),s=mo("animateMotion"),r=mo("mpath");Fo(r,{"xlink:href":`#${i}`}),s.appendChild(r),t.appendChild(s);try{return nl(s,e)}catch(t){if("fake"===document.documentElement.getAttribute("smiling")){const t=s;t.animators=[];const e=window,n=t.getAttribute("id");n&&(e.id2anim[n]=t);const i=e.getTargets(t);for(let n=0,s=i.length;n<s;n+=1){const s=i[n],r=new e.Animator(t,s,n);e.animators.push(r),t.animators[n]=r,r.register()}}}return()=>{}}(this.node,t,e)}normalizePath(){return"path"===this.tagName()&&this.attr("d",Sa.normalize(this.attr("d"))),this}bbox(t,e){return function(t,e,n){let i;const s=t.ownerSVGElement;if(!s)return new sa(0,0,0,0);try{i=t.getBBox()}catch(e){i={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}if(e)return sa.create(i);const r=Qa(t,n||s);return Ja(i,r)}(this.node,t,e)}getBBox(t={}){return Ka(this.node,{recursive:t.recursive,target:t.target?Oa.toNode(t.target):null})}sample(t=1){return this.node instanceof SVGPathElement?function(t,e=1){const n=t.getTotalLength(),i=[];let s,r=0;for(;r<n;)s=t.getPointAtLength(r),i.push({distance:r,x:s.x,y:s.y}),r+=e;return i}(this.node,t):[]}toPath(){return Oa.create(function(t){const e=mo("path");Fo(e,Fo(t));const n=$a(t);n&&e.setAttribute("d",n);return e}(this.node))}toPathData(){return $a(this.node)}}function ka(t,e,n){const i=n.eol,s=n.baseSize,r=n.lineHeight;let o,a=0;const l={},h=e.length-1;for(let r=0;r<=h;r+=1){let l=e[r],c=null;if("object"==typeof l){const t=l.attrs,e=Oa.create("tspan",t);o=e.node;let u=l.t;i&&r===h&&(u+=i),o.textContent=u;const d=t.class;d&&e.addClass(d),n.includeAnnotationIndices&&e.attr("annotations",l.annotations.join(",")),c=parseFloat(t["font-size"]),void 0===c&&(c=s),c&&c>a&&(a=c)}else i&&r===h&&(l+=i),o=document.createTextNode(l||" "),s&&s>a&&(a=s);t.appendChild(o)}return a&&(l.maxFontSize=a),r?l.lineHeight=r: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){return e(t)?t.node:t}t.toStringTag=`X6.${t.name}`,t.isVector=e,t.create=n,t.createVectors=function(t){if("<"===t[0]){const e=yo(t),i=[];for(let t=0,s=e.childNodes.length;t<s;t+=1){const s=e.childNodes[t];i.push(n(document.importNode(s,!0)))}return i}return[n(t)]},t.toNode=i,t.toNodes=function(t){return Array.isArray(t)?t.map((t=>i(t))):[i(t)]}}(Oa||(Oa={}));const Pa=/em$/;function Ta(t,e){const n=parseFloat(t);return Pa.test(t)?n*e:n}function Da(t,e,n={}){e=function(t){return t.replace(/ /g," ")}(e);const i=n.eol;let s=n.textPath;const r=n.textVerticalAnchor,o="middle"===r||"bottom"===r||"top"===r;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";Mo(t),Fo(t,{"xml:space":"preserve",display:e||n.displayEmpty?null:"none"});const g=Fo(t,"font-size");let p,f,m=parseFloat(g);m||(m=16,!o&&!h||g||Fo(t,"font-size",`${m}`)),s?("string"==typeof s&&(s={d:s}),p=function(t,e){const n=Oa.create(e),i=Oa.create("textPath"),s=t.d;if(s&&void 0===t["xlink:href"]){const t=Oa.create("path").attr("d",s).appendTo(n.defs());i.attr("xlink:href",`#${t.id}`)}return"object"==typeof t&&i.attr(t),i.node}(s,t)):p=document.createDocumentFragment();let y,b=0;const C=e.split("\n"),v=[],x=C.length-1;for(let t=0;t<=x;t+=1){f=d;let e="v-line";const n=mo("tspan");let r,o=C[t];if(o)if(h){r=ka(n,Io(o,h,{offset:-b,includeAnnotationIndices:l}),{eol:t!==x&&i,baseSize:m,lineHeight:u?null:d,includeAnnotationIndices:l});const e=r.lineHeight;e&&u&&0!==t&&(f=e),0===t&&(y=.8*r.maxFontSize)}else i&&t!==x&&(o+=i),n.textContent=o;else{n.textContent="-",e+=" v-empty-line";const t=n.style;t.fillOpacity=0,t.strokeOpacity=0,h&&(r={})}r&&v.push(r),t>0&&n.setAttribute("dy",f),(t>0||s)&&n.setAttribute("x",a),n.className.baseVal=e,p.appendChild(n),b+=o.length+1}if(o)if(h)f=function(t,e,n,i){if(!Array.isArray(e))return 0;const s=e.length;if(!s)return 0;let r=e[0];const o=Ta(r.maxFontSize,n)||n;let a=0;const l=Ta(i,n);for(let t=1;t<s;t+=1)r=e[t],a+=Ta(r.lineHeight,n)||l;const h=Ta(r.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}return c}(r,v,m,d);else if("top"===r)f="0.8em";else{let t;switch(x>0?(t=parseFloat(d)||1,t*=x,Pa.test(d)||(t/=m)):t=0,r){case"middle":f=.3-t/2+"em";break;case"bottom":f=-t-.3+"em"}}else 0===r?f="0em":r?f=r:(f=0,null==t.getAttribute("y")&&t.setAttribute("y",`${y||"0.8em"}`));p.firstChild.setAttribute("dy",f),t.appendChild(p)}function Na(t,e,n={},i={}){const s=e.width,r=e.height,o=i.svgDocument||mo("svg"),a=mo("text"),l=mo("tspan"),h=document.createTextNode("");Fo(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,C,v=[];const{words:x,separators:w}=function(t,e,n,i){const s=[],r=[];if(null!=e){const n=t.split(e);if(s.push(...n),"string"==typeof e)for(let t=0,i=n.length-1;t<i;t+=1)r.push(e);else{const i=t.match(new RegExp(e,"g"));for(let t=0,e=n.length-1;t<e;t+=1)r.push(i?i[t]:"")}}else{let e="";for(let n=0,i=t.length;n<i;n+=1){const i=t[n];" "===i?(s.push(e),r.push(" "),e=""):i.match(/[^\x00-\xff]/)?(e.length&&(s.push(e),r.push("")),s.push(i),r.push(""),e=""):e+=i}e.length&&s.push(e)}for(let t=0;t<s.length;t+=1){const e=s[t];if(e.indexOf(n)>=0&&e.length>1){const i=e.split(n);for(let t=0,e=i.length-1;t<e;t+=1)i.splice(2*t+1,0,n);const o=i.filter((t=>""!==t));s.splice(t,1,...o);const a=o.map((()=>""));a.pop(),r.splice(t,0,...a)}}for(let t=0;t<s.length;t+=1){const e=s[t],n=e.search(i);n>0&&n<e.length-1&&(s.splice(t,1,e.substring(0,n+1),e.substring(n+1)),r.splice(t,0,""))}return{words:s,separators:r}}(t,i.separator,u,g);for(let t=0,e=0,o=x.length;t<o;t+=1){const c=x[t];if(c)if(c!==u){if(null!=v[e]?(C=w[t-1]||"",h.data=`${v[e]}${C}${c}`):h.data=c,l.getComputedTextLength()<=s)v[e]=h.data,m[e]=w[t],y&&(f[e]=!0,e+=1,y=0);else{if(p){if(!v[e]||y){const n=!!y,i=1===c.length;if(y=c.length-1,n||i){if(i){if(!v[e]){v=[];break}x.splice(t,2,c+x[t+1]),w.splice(t+1,1),f[e]=!0,e+=1,o-=1,t-=1;continue}x[t]=c.substring(0,y),x[t+1]=c.substring(y)+x[t+1]}else x.splice(t,1,c.substring(0,y),c.substring(y)),w.splice(t,0,""),o+=1,e&&!f[e-1]&&(e-=1);t-=1;continue}}else if(!v[e]){v[e]=c,f[e]=!0,e+=1;continue}e+=1,t-=1}if(null!=r){if(null==b){let t;t="auto"===n.lineHeight?{value:1.5,unit:"em"}:Yr(n.lineHeight,["em"])||{value:1,unit:"em"},b=t.value,"em"===t.unit&&(M.IS_FIREFOX?b*=l.getBBox().height:b*=a.getBBox().height)}if(b*v.length>r){const t=Math.floor(r/b)-1,e=v[t],n=v[t+1];if(v.splice(t+1),null==e)break;let o=i.ellipsis;if(!o)break;"string"!=typeof o&&(o="…");let a=e;n&&p&&(a+=C+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()<=s){v[t]=c;break}g-=1}while(g>=0);break}}}else f[e]=!0,e+=1,v[e]=""}return Ao(c?o:a),v.join(u)}const ja=.551784;function La(t,e,n=NaN){const i=t.getAttribute(e);if(null==i)return n;const s=parseFloat(i);return Number.isNaN(s)?n:s}function Fa(t){return`M ${t.map((t=>`${t.x} ${t.y}`)).join(" L")}`}function za(t){const e=[],n=t.points;if(n)for(let t=0,i=n.numberOfItems;t<i;t+=1)e.push(n.getItem(t));return e}function Ba(t){let e;const n=t.x,i=t.y,s=t.width,r=t.height,o=Math.min(t.rx||t["top-rx"]||0,s/2),a=Math.min(t.rx||t["bottom-rx"]||0,s/2),l=Math.min(t.ry||t["top-ry"]||0,r/2),h=Math.min(t.ry||t["bottom-ry"]||0,r/2);return e=o||a||l||h?["M",n,i+l,"v",r-l-h,"a",a,h,0,0,0,a,h,"h",s-2*a,"a",a,h,0,0,0,a,-h,"v",-(r-h-l),"a",o,l,0,0,0,-o,-l,"h",-(s-2*o),"a",o,l,0,0,0,-o,l,"Z"]:["M",n,i,"H",n+s,"V",i+r,"H",n,"V",i,"Z"],e.join(" ")}function $a(t){const e=t.tagName.toLowerCase();switch(e){case"path":return t.getAttribute("d");case"line":return function(t){return["M",La(t,"x1"),La(t,"y1"),"L",La(t,"x2"),La(t,"y2")].join(" ")}(t);case"polygon":return function(t){const e=za(t);return 0===e.length?null:`${Fa(e)} Z`}(t);case"polyline":return function(t){const e=za(t);return 0===e.length?null:Fa(e)}(t);case"ellipse":return function(t){const e=La(t,"cx",0),n=La(t,"cy",0),i=La(t,"rx"),s=La(t,"ry")||i,r=i*ja,o=s*ja;return["M",e,n-s,"C",e+r,n-s,e+i,n-o,e+i,n,"C",e+i,n+o,e+r,n+s,e,n+s,"C",e-r,n+s,e-i,n+o,e-i,n,"C",e-i,n-o,e-r,n-s,e,n-s,"Z"].join(" ")}(t);case"circle":return function(t){const e=La(t,"cx",0),n=La(t,"cy",0),i=La(t,"r"),s=i*ja;return["M",e,n-i,"C",e+s,n-i,e+i,n-s,e+i,n,"C",e+i,n+s,e+s,n+i,e,n+i,"C",e-s,n+i,e-i,n+s,e-i,n,"C",e-i,n-s,e-s,n-i,e,n-i,"Z"].join(" ")}(t);case"rect":return function(t){return Ba({x:La(t,"x",0),y:La(t,"y",0),width:La(t,"width",0),height:La(t,"height",0),rx:La(t,"rx",0),ry:La(t,"ry",0)})}(t)}throw new Error(`"${e}" cannot be converted to svg path element.`)}const Ra=mo("svg"),Ia=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,Va=/[ ,]+/,_a=/^(\w+)\((.*)\)/;function Ga(t){const e=Ra.createSVGMatrix();if(null!=t){const n=t,i=e;for(const t in n)i[t]=n[t]}return e}function Ha(t){return null!=t?(t instanceof DOMMatrix||(t=Ga(t)),Ra.createSVGTransformFromMatrix(t)):Ra.createSVGTransform()}function Ua(t){let e=Ga();const n=null!=t&&t.match(Ia);if(!n)return e;for(let t=0,i=n.length;t<i;t+=1){const i=n[t].match(_a);if(i){let t,n,s,r,o,a=Ga();const l=i[2].split(Va);switch(i[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":s=parseFloat(l[0]),r=parseFloat(l[1]),a=a.translate(s,r);break;case"rotate":o=parseFloat(l[0]),s=parseFloat(l[1])||0,r=parseFloat(l[2])||0,a=0!==s||0!==r?a.translate(s,r).rotate(o).translate(-s,-r):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 qa(t){const e=t||{};return`matrix(${null!=e.a?e.a:1},${null!=e.b?e.b:0},${null!=e.c?e.c:0},${null!=e.d?e.d:1},${null!=e.e?e.e:0},${null!=e.f?e.f:0})`}function Wa(t){let e,n,i;if(t){const s=Va;if(t.trim().indexOf("matrix")>=0){const s=function(t){const e=Xa(t,{x:0,y:1}),n=Xa(t,{x:1,y:0}),i=180/Math.PI*Math.atan2(e.y,e.x)-90,s=180/Math.PI*Math.atan2(n.y,n.x);return{skewX:i,skewY:s,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}}(Ua(t));e=[s.translateX,s.translateY],n=[s.rotation],i=[s.scaleX,s.scaleY];const r=[];0===e[0]&&0===e[1]||r.push(`translate(${e.join(",")})`),1===i[0]&&1===i[1]||r.push(`scale(${i.join(",")})`),0!==n[0]&&r.push(`rotate(${n[0]})`),t=r.join(" ")}else{const r=t.match(/translate\((.*?)\)/);r&&(e=r[1].split(s));const o=t.match(/rotate\((.*?)\)/);o&&(n=o[1].split(s));const a=t.match(/scale\((.*?)\)/);a&&(i=a[1].split(s))}}const s=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:s,sy:i&&i[1]?parseFloat(i[1]):s}}}function Xa(t,e){return{x:e.x*t.a+e.y*t.c+0,y:e.x*t.b+e.y*t.d+0}}function Ya(t,e){const n=function(t,e){const n=Ra.createSVGPoint();return n.x=t,n.y=e,n}(t.x,t.y).matrixTransform(e);return new ia(n.x,n.y)}function Ja(t,e){const n=Ra.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 s=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y+t.height;const r=n.matrixTransform(e);n.x=t.x,n.y=t.y+t.height;const o=n.matrixTransform(e),a=Math.min(i.x,s.x,r.x,o.x),l=Math.max(i.x,s.x,r.x,o.x),h=Math.min(i.y,s.y,r.y,o.y),c=Math.max(i.y,s.y,r.y,o.y);return new sa(a,h,l-a,c-h)}var Za=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};function Ka(t,e={}){let n;if(!t.ownerSVGElement||!uo(t)){if(ko(t)){const{left:e,top:n,width:i,height:s}=function(t){let e=0,n=0,i=0,s=0;if(t){let r=t;for(;r;)e+=r.offsetLeft,n+=r.offsetTop,r=r.offsetParent,r&&(e+=parseInt(Xo(r,"borderLeft"),10),n+=parseInt(Xo(r,"borderTop"),10));i=t.offsetWidth,s=t.offsetHeight}return{left:e,top:n,width:i,height:s}}(t);return new sa(e,n,i,s)}return new sa(0,0,0,0)}let i=e.target;if(!e.recursive){try{n=t.getBBox()}catch(e){n={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}if(!i)return sa.create(n);return Ja(n,Qa(t,i))}{const e=t.childNodes,s=e.length;if(0===s)return Ka(t,{target:i});i||(i=t);for(let t=0;t<s;t+=1){const s=e[t];let r;r=0===s.childNodes.length?Ka(s,{target:i}):Ka(s,{target:i,recursive:!0}),n=n?n.union(r):r}return n}}function Qa(t,e){if(uo(e)&&uo(t)){const n=e.getScreenCTM(),i=t.getScreenCTM();if(n&&i)return n.inverse().multiply(i)}return Ga()}function tl(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 sa(e("x"),e("y"),e("width"),e("height"));case"circle":return new oa(e("cx"),e("cy"),e("r"),e("r"));case"ellipse":return new oa(e("cx"),e("cy"),e("rx"),e("ry"));case"polyline":{const e=za(t);return new aa(e)}case"polygon":{const e=za(t);return e.length>1&&e.push(e[0]),new aa(e)}case"path":{let e=t.getAttribute("d");return Sa.isValid(e)||(e=Sa.normalize(e)),Sa.parse(e)}case"line":return new ra(e("x1"),e("y1"),e("x2"),e("y2"))}return Ka(t)}function el(t,e,n){const i=mo(n);t.appendChild(i);try{return nl(i,e)}catch(t){}return()=>{}}function nl(t,e){const{start:n,complete:i,repeat:s}=e;Fo(t,Za(e,["start","complete","repeat"])),n&&t.addEventListener("beginEvent",n),i&&t.addEventListener("endEvent",i),s&&t.addEventListener("repeatEvent",s);const r=t;return r.beginElement(),()=>r.endElement()}function il(t,e,n={}){if(null==e)return Ua(Fo(t,"transform"));if(n.absolute)return void t.setAttribute("transform",qa(e));const i=t.transform,s=Ha(e);i.baseVal.appendItem(s)}function sl(t,e,n=0,i={}){let s=Fo(t,"transform");const r=Wa(s);if(null==e)return r.translation;s=r.raw,s=s.replace(/translate\([^)]*\)/g,"").trim();const o=`translate(${i.absolute?e:r.translation.tx+e},${i.absolute?n:r.translation.ty+n})`;t.setAttribute("transform",`${o} ${s}`.trim())}function rl(t,e,n,i,s={}){let r=Fo(t,"transform");const o=Wa(r);if(null==e)return o.rotation;r=o.raw,r=r.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const a=`rotate(${s.absolute?e:o.rotation.angle+e}${null!=n&&null!=i?`,${n},${i}`:""})`;t.setAttribute("transform",`${r} ${a}`.trim())}function ol(t,e,n){let i=Fo(t,"transform");const s=Wa(i);if(null==e)return s.scale;n=null==n?e:n,i=s.raw,i=i.replace(/scale\([^)]*\)/g,"").trim();const r=`scale(${e},${n})`;t.setAttribute("transform",`${i} ${r}`.trim())}function al(t,e,n,i){const s=ia.create(e),r=ia.create(n);if(!i){i=t instanceof SVGSVGElement?t:t.ownerSVGElement}const o=ol(t);t.setAttribute("transform","");const a=Ka(t,{target:i}).scale(o.sx,o.sy),l=Ha();l.setTranslate(-a.x-a.width/2,-a.y-a.height/2);const h=Ha(),c=s.angleBetween(r,s.clone().translate(1,0));c&&h.setRotate(c,0,0);const u=Ha(),d=s.clone().move(r,a.width/2);u.setTranslate(2*s.x-d.x,2*s.y-d.y);const g=Qa(t,i),p=Ha();p.setMatrix(u.matrix.multiply(h.matrix.multiply(l.matrix.multiply(g.scale(o.sx,o.sy))))),t.setAttribute("transform",qa(p.matrix))}class ll{constructor(t,e,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=M.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(){M.SUPPORT_PASSIVE?this.target.addEventListener(this.eventName,this.onWheel,{passive:!1}):l(this.target).on("mousewheel",this.onWheel)}disable(){M.SUPPORT_PASSIVE?this.target.removeEventListener(this.eventName,this.onWheel):l(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}}function hl(t,e=60){let n=null;return(...i)=>{n&&clearTimeout(n),n=window.setTimeout((()=>{t.apply(this,i)}),e)}}Oa.isVector,Oa.create,Oa.createVectors;const cl="undefined"!=typeof ResizeObserver?function(t){let e=null,n=[];const i=hl((()=>{n.forEach((e=>{e(t)}))})),s=()=>{e&&(e.disconnect(),n=[],e=null)};return{element:t,bind:s=>{e||(e=(()=>{const e=new ResizeObserver(i);return e.observe(t),i(),e})()),-1===n.indexOf(s)&&n.push(s)},destroy:s,unbind:t=>{const i=n.indexOf(t);-1!==i&&n.splice(i,1),0===n.length&&e&&s()}}}:function(t){let e=null,n=[];const i=hl((()=>{n.forEach((e=>e(t)))})),s=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",i),e.parentNode.removeChild(e),e=null,n=[])};return{element:t,bind:s=>{e||(e=(()=>{"static"===getComputedStyle(t).position&&(t.style.position="relative");const e=document.createElement("object");return e.onload=()=>{e.contentDocument.defaultView.addEventListener("resize",i),i()},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})()),-1===n.indexOf(s)&&n.push(s)},destroy:s,unbind:t=>{const i=n.indexOf(t);-1!==i&&n.splice(i,1),0===n.length&&e&&s()}}};var ul,dl;!function(t){const e=new WeakMap;function n(t){let n=e.get(t);return n||(n=cl(t),e.set(t,n),n)}t.bind=(t,e)=>{const i=n(t);return i.bind(e),()=>i.unbind(e)},t.clear=t=>{!function(t){t.destroy(),e.delete(t.element)}(n(t))}}(ul||(ul={})),function(t){const e=[],n=[];let i=0;const s=()=>performance.now(),r=t=>t[0],o=t=>1===n.push(t)&&a(),a=(()=>{const t=()=>{var t,e;return null===(e=(t=n.splice(0,n.length))[0])||void 0===e?void 0:e.call(t)};if("undefined"!=typeof MessageChannel){const{port1:e,port2:n}=new MessageChannel;return e.onmessage=t,()=>n.postMessage(null)}return()=>setTimeout(t)})(),l=()=>{i=s()+16.666666666666668;let n=r(e);for(;n&&!t.shouldYield();){const{callback:t,data:i}=n;n.callback=null;const s=t&&t(i);s?n.callback=s:e.shift(),n=r(e)}n&&o(l)};t.scheduleTask=(t,n)=>{const i={callback:t,data:n};e.push(i),o(l)},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()>=i}}(dl||(dl={}));class gl{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||M.isApplyingHMR()||this.onDuplicated(t);const i=this.options.process,s=i?Kr(i,this,t,e):e;return this.data[t]=s,s}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&&Kr(this.options.onConflict,this,t),new Error(`${fn(this.options.type)} with name '${t}' already registered.`)}catch(t){throw t}}onNotFound(t,e){throw new Error(this.getSpellingSuggestion(t,e))}getSpellingSuggestion(t,e){const n=this.getSpellingSuggestionForName(t),i=e?`${e} ${Zs(this.options.type)}`:this.options.type;return`${fn(i)} with name '${t}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(t){return function(t,e,n){const i=Math.min(2,Math.floor(.34*t.length));let s,r=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=qr(a,n,r-1);if(void 0===i)continue;i<3?(o=!0,s=l):(r=i,s=l)}}return s}(t,Object.keys(this.data),(t=>t))}}!function(t){t.create=function(e){return new t(e)}}(gl||(gl={}));const pl={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"},fl={position:$l("x","width","origin")},ml={position:$l("y","height","origin")},yl={position:$l("x","width","corner")},bl={position:$l("y","height","corner")},Cl={set:Rl("width","width")},vl={set:Rl("height","height")},xl={set:Rl("rx","width")},wl={set:Rl("ry","height")},El={set:(t=>{const e=Rl("r","width"),n=Rl("r","height");return function(t,i){const s=i.refBBox;return Kr(s.height>s.width?e:n,this,t,i)}})()},Al={set(t,{refBBox:e}){let n=parseFloat(t);const i=Wr(t);i&&(n/=100);const s=Math.sqrt(e.height*e.height+e.width*e.width);let r;return Number.isFinite(n)&&(r=i||n>=0&&n<=1?n*s:Math.max(n+s,0)),{r:r}}},Ml={set:Rl("cx","width")},Sl={set:Rl("cy","height")},Ol={set:Vl({resetOffset:!0})},kl={set:Vl({resetOffset:!1})},Pl={set:_l({resetOffset:!0})},Tl={set:_l({resetOffset:!1})},Dl=El,Nl=Ol,jl=Pl,Ll=fl,Fl=ml,zl=Cl,Bl=vl;function $l(t,e,n){return(i,{refBBox:s})=>{if(null==i)return null;let r=parseFloat(i);const o=Wr(i);let a;if(o&&(r/=100),Number.isFinite(r)){const i=s[n];a=o||r>0&&r<1?i[t]+s[e]*r:i[t]+r}const l=new ia;return l[t]=a||0,l}}function Rl(t,e){return function(n,{refBBox:i}){let s=parseFloat(n);const r=Wr(n);r&&(s/=100);const o={};if(Number.isFinite(s)){const n=r||s>=0&&s<=1?s*i[e]:Math.max(s+i[e],0);o[t]=n}return o}}function Il(t,e){const n="x6-shape",i=e&&e.resetOffset;return function(e,{view:s,elem:r,refBBox:o}){const a=s.$(r);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 Vl(t){const e=Il((function(t){return Sa.parse(t)}),t);return(t,n)=>({d:e(t,n).serialize()})}function _l(t){const e=Il((t=>new aa(t)),t);return(t,n)=>({points:e(t,n).serialize()})}const Gl={qualify:Ye,set:(t,{view:e})=>`url(#${e.graph.defineGradient(t)})`},Hl={qualify:Ye,set(t,{view:e}){const n=e.cell,i=Object.assign({},t);if(n.isEdge()&&"linearGradient"===i.type){const t=e,s=t.sourcePoint,r=t.targetPoint;i.id=`gradient-${i.type}-${n.id}`,i.attrs=Object.assign(Object.assign({},i.attrs),{x1:s.x,y1:s.y,x2:r.x,y2:r.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(i.id)}return`url(#${e.graph.defineGradient(i)})`}},Ul={qualify:(t,{attrs:e})=>null==e.textWrap||!Ye(e.textWrap),set(t,{view:e,elem:n,attrs:i}){const s="x6-text",r=e.$(n),o=r.data(s),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&&(co(n),l.textPath=Object.assign({"xlink:href":`#${n.id}`},i))}}Da(n,`${t}`,l),r.data(s,c)}}},ql={qualify:Ye,set(t,{view:e,elem:n,attrs:i,refBBox:s}){const r=t,o=r.width||0;Wr(o)?s.width*=parseFloat(o)/100:o<=0?s.width+=o:s.width=o;const a=r.height||0;let l;Wr(a)?s.height*=parseFloat(a)/100:a<=0?s.height+=a:s.height=a;let h=r.text;null==h&&(h=i.text),l=null!=h?Na(`${h}`,s,{"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:r.ellipsis,hyphen:r.hyphen,breakWord:r.breakWord}):"",Kr(Ul.set,this,l,{view:e,elem:n,attrs:i,refBBox:s,cell:e.cell})}},Wl=(t,{attrs:e})=>void 0!==e.text,Xl={qualify:Wl},Yl={qualify:Wl},Jl={qualify:Wl},Zl={qualify:Wl},Kl={qualify:Wl},Ql={qualify:Wl},th={qualify:(t,{elem:e})=>e instanceof SVGElement,set(t,{view:e,elem:n}){const i="x6-title",s=`${t}`,r=e.$(n),o=r.data(i);if(null==o||o!==s){r.data(i,s);const t=n.firstChild;if(t&&"TITLE"===t.tagName.toUpperCase()){t.textContent=s}else{const e=document.createElementNS(n.namespaceURI,"title");e.textContent=s,n.insertBefore(e,t)}}}},eh={offset:sh("x","width","right")},nh={offset:sh("y","height","bottom")},ih={offset:(t,{refBBox:e})=>t?{x:-e.x,y:-e.y}:{x:0,y:0}};function sh(t,e,n){return(i,{refBBox:s})=>{const r=new ia;let o;return o="middle"===i?s[e]/2:i===n?s[e]:"number"==typeof i&&Number.isFinite(i)?i>-1&&i<1?-s[e]*i:-i:Wr(i)?s[e]*parseFloat(i)/100:0,r[t]=-(s[t]+o),r}}const rh={qualify:Ye,set(t,{view:e,elem:n}){e.$(n).css(t)}},oh={set(t,{view:e,elem:n}){e.$(n).html(`${t}`)}},ah={qualify:Ye,set:(t,{view:e})=>`url(#${e.graph.defineFilter(t)})`},lh={set:t=>null!=t&&"object"==typeof t&&t.id?t.id:t};function hh(t,e,n){let i,s;"object"==typeof e?(i=e.x,s=e.y):(i=e,s=n);const r=Sa.parse(t),o=r.bbox();if(o){let t=-o.height/2-o.y,e=-o.width/2-o.x;"number"==typeof i&&(e-=i),"number"==typeof s&&(t-=s),r.translate(e,t)}return r.serialize()}var ch=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};function uh(t,e,n,i=3/4,s={}){const r=t.size||10,o=t.width||r,a=t.height||r,l=new Sa,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=Wn(i,0,1);l.lineTo(o*t,a/2)}l.lineTo(o,a),l.close()}return Object.assign(Object.assign(Object.assign({},h),s),{tagName:"path",d:hh(l.serialize(),{x:null!=t.offset?t.offset:-o/2})})}var dh=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};var gh=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};var ph=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};var fh=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};var mh=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const yh=t=>{var{r:e}=t,n=mh(t,["r"]);const i=e||5;return Object.assign(Object.assign({cx:i},n),{tagName:"circle",r:i})};var bh=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};var Ch,vh=Object.freeze({__proto__:null,block:t=>{var{size:e,width:n,height:i,offset:s,open:r}=t;return uh({size:e,width:n,height:i,offset:s},!0===r,!0,void 0,ch(t,["size","width","height","offset","open"]))},classic:t=>{var{size:e,width:n,height:i,offset:s,factor:r}=t;return uh({size:e,width:n,height:i,offset:s},!1,!1,r,ch(t,["size","width","height","offset","factor"]))},diamond:t=>{var{size:e,width:n,height:i,offset:s}=t,r=dh(t,["size","width","height","offset"]);const o=e||10,a=n||o,l=i||o,h=new Sa;return h.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},r),{tagName:"path",d:hh(h.serialize(),null==s?-a/2:s)})},path:t=>{var{d:e,offsetX:n,offsetY:i}=t,s=gh(t,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},s),{tagName:"path",d:hh(e,n,i)})},cross:t=>{var{size:e,width:n,height:i,offset:s}=t,r=ph(t,["size","width","height","offset"]);const o=e||10,a=n||o,l=i||o,h=new Sa;return h.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},r),{tagName:"path",fill:"none",d:hh(h.serialize(),s||-a/2)})},async:t=>{var{width:e,height:n,offset:i,open:s,flip:r}=t,o=fh(t,["width","height","offset","open","flip"]);let a=n||6;const l=e||10,h=!0===s,c=!0===r,u=Object.assign(Object.assign({},o),{tagName:"path"});c&&(a=-a);const d=new Sa;return d.moveTo(0,a).lineTo(l,0),h?u.fill="none":(d.lineTo(l,a),d.close()),u.d=hh(d.serialize(),{x:i||-l/2,y:a/2}),u},circle:yh,circlePlus:t=>{var{r:e}=t,n=mh(t,["r"]);const i=e||5,s=new Sa;return s.moveTo(i,0).lineTo(i,2*i),s.moveTo(0,i).lineTo(2*i,i),{children:[Object.assign(Object.assign({},yh({r:i})),{fill:"none"}),Object.assign(Object.assign({},n),{tagName:"path",d:hh(s.serialize(),-i)})]}},ellipse:t=>{var{rx:e,ry:n}=t,i=bh(t,["rx","ry"]);const s=e||5,r=n||5;return Object.assign(Object.assign({cx:s},i),{tagName:"ellipse",rx:s,ry:r})}});!function(t){t.presets=vh,t.registry=gl.create({type:"marker"}),t.registry.register(t.presets,!0)}(Ch||(Ch={})),function(t){t.normalize=hh}(Ch||(Ch={}));var xh=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};function wh(t){return"string"==typeof t||Ye(t)}const Eh={qualify:wh,set:(t,{view:e,attrs:n})=>Sh("marker-start",t,e,n)},Ah={qualify:wh,set:(t,{view:e,attrs:n})=>Sh("marker-end",t,e,n,{transform:"rotate(180)"})},Mh={qualify:wh,set:(t,{view:e,attrs:n})=>Sh("marker-mid",t,e,n)};function Sh(t,e,n,i,s={}){const r="string"==typeof e?{name:e}:e,{name:o,args:a}=r,l=xh(r,["name","args"]);let h=l;if(o&&"string"==typeof o){const t=Ch.registry.get(o);if(!t)return Ch.registry.onNotFound(o);h=t(Object.assign(Object.assign({},l),a))}const c=Object.assign(Object.assign(Object.assign({},function(t,e){const n={},i=t.stroke;"string"==typeof i&&(n.stroke=i,n.fill=i);let s=t.strokeOpacity;null==s&&(s=t["stroke-opacity"]);null==s&&(s=t.opacity);null!=s&&(n["stroke-opacity"]=s,n["fill-opacity"]=s);if("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}(i,t)),s),h);return{[t]:`url(#${n.graph.defineMarker(c)})`}}const Oh=(t,{view:e})=>e.cell.isEdge(),kh={qualify:Oh,set(t,e){var n,i,s,r;const o=e.view,a=t.reverse||!1,l=t.stubs||0;let h;if(Number.isFinite(l)&&0!==l)if(a){let t,e;const a=o.getConnectionLength()||0;l<0?(t=(a+l)/2,e=-l):(t=l,e=a-2*l);const c=o.getConnection();h=null===(r=null===(s=null===(i=null===(n=null==c?void 0:c.divideAtLength(t))||void 0===n?void 0:n[1])||void 0===i?void 0:i.divideAtLength(e))||void 0===s?void 0:s[0])||void 0===r?void 0:r.serialize()}else{let t;if(l<0){t=((o.getConnectionLength()||0)+l)/2}else t=l;const e=o.getConnection();if(e){const n=e.divideAtLength(t),i=e.divideAtLength(-t);n&&i&&(h=`${n[0].serialize()} ${i[1].serialize()}`)}}return{d:h||o.getConnectionPathData()}}},Ph={qualify:Oh,set:Fh("getTangentAtLength",{rotate:!0})},Th={qualify:Oh,set:Fh("getTangentAtLength",{rotate:!1})},Dh={qualify:Oh,set:Fh("getTangentAtRatio",{rotate:!0})},Nh={qualify:Oh,set:Fh("getTangentAtRatio",{rotate:!1})},jh=Ph,Lh=Dh;function Fh(t,e){const n={x:1,y:0};return(i,s)=>{let r,o;const a=s.view,l=a[t](Number(i));return l?(o=e.rotate?l.vector().vectorAngle(n):0,r=l.start):(r=a.path.start,o=0),0===o?{transform:`translate(${r.x},${r.y}')`}:{transform:`translate(${r.x},${r.y}') rotate(${o})`}}}var zh,Bh=Object.freeze({__proto__:null,ref:{},refX:fl,refY:ml,refDx:yl,refDy:bl,refWidth:Cl,refHeight:vl,refRx:xl,refRy:wl,refRInscribed:El,refRCircumscribed:Al,refCx:Ml,refCy:Sl,refDResetOffset:Ol,refDKeepOffset:kl,refPointsResetOffset:Pl,refPointsKeepOffset:Tl,refR:Dl,refD:Nl,refPoints:jl,refX2:Ll,refY2:Fl,refWidth2:zl,refHeight2:Bl,fill:Gl,stroke:Hl,text:Ul,textWrap:ql,lineHeight:Xl,textVerticalAnchor:Yl,textPath:Jl,annotations:Zl,eol:Kl,displayEmpty:Ql,title:th,xAlign:eh,yAlign:nh,resetOffset:ih,style:rh,html:oh,filter:ah,port:lh,sourceMarker:Eh,targetMarker:Ah,vertexMarker:Mh,connection:kh,atConnectionLengthKeepGradient:Ph,atConnectionLengthIgnoreGradient:Th,atConnectionRatioKeepGradient:Dh,atConnectionRatioIgnoreGradient:Nh,atConnectionLength:jh,atConnectionRatio:Lh});!function(t){t.isValidDefinition=function(t,e,n){if(null!=t){if("string"==typeof t)return!0;if("function"!=typeof t.qualify||Kr(t.qualify,this,e,n))return!0}return!1}}(zh||(zh={})),function(t){t.presets=Object.assign(Object.assign({},pl),Bh),t.registry=gl.create({type:"attribute definition"}),t.registry.register(t.presets,!0)}(zh||(zh={}));const $h={color:"#aaaaaa",thickness:1,markup:"rect",update(t,e){const n=e.thickness*e.sx,i=e.thickness*e.sy;Fo(t,{width:n,height:i,rx:n,ry:i,fill:e.color})}},Rh={color:"#aaaaaa",thickness:1,markup:"rect",update(t,e){const n=e.sx<=1?e.thickness*e.sx:e.thickness;Fo(t,{width:n,height:n,rx:n,ry:n,fill:e.color})}},Ih={color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(t,e){let n;const i=e.width,s=e.height,r=e.thickness;n=i-r>=0&&s-r>=0?["M",i,0,"H0 M0 0 V0",s].join(" "):"M 0 0 0 0",Fo(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}},Vh=[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(t,e){let n;const i=e.width,s=e.height,r=e.thickness;n=i-r>=0&&s-r>=0?["M",i,0,"H0 M0 0 V0",s].join(" "):"M 0 0 0 0",Fo(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,s=e.width*i,r=e.height*i,o=e.thickness;n=s-o>=0&&r-o>=0?["M",s,0,"H0 M0 0 V0",r].join(" "):"M 0 0 0 0",e.width=s,e.height=r,Fo(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}}];var _h=Object.freeze({__proto__:null,dot:$h,fixedDot:Rh,mesh:Ih,doubleMesh:Vh});class Gh{constructor(){this.patterns={},this.root=Oa.create(yo(),{width:"100%",height:"100%"},[mo("defs")]).node}add(t,e){const n=this.root.childNodes[0];n&&n.appendChild(e),this.patterns[t]=e,Oa.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 Hh(t,e){return null!=t?t:e}function Uh(t,e){return null!=t&&Number.isFinite(t)?t:e}!function(t){t.presets=_h,t.registry=gl.create({type:"grid"}),t.registry.register(t.presets,!0)}(Gh||(Gh={}));var qh,Wh=Object.freeze({__proto__:null,outline:function(t={}){const e=Hh(t.color,"blue"),n=Uh(t.width,1),i=Uh(t.margin,2);return`\n    <filter>\n      <feFlood flood-color="${e}" flood-opacity="${Uh(t.opacity,1)}" result="colored"/>\n      <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${i+n}" />\n      <feMorphology in="SourceAlpha" result="morphedInner" operator="dilate" radius="${i}" />\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()},highlight:function(t={}){const e=Hh(t.color,"red"),n=Uh(t.blur,0),i=Uh(t.width,1);return`\n      <filter>\n        <feFlood flood-color="${e}" flood-opacity="${Uh(t.opacity,1)}" 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()},blur:function(t={}){const e=Uh(t.x,2);return`\n    <filter>\n      <feGaussianBlur stdDeviation="${null!=t.y&&Number.isFinite(t.y)?[e,t.y]:e}"/>\n    </filter>\n  `.trim()},dropShadow:function(t={}){const e=Uh(t.dx,0),n=Uh(t.dy,0),i=Hh(t.color,"black"),s=Uh(t.blur,4),r=Uh(t.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>\n         <feDropShadow stdDeviation="${s}" dx="${e}" dy="${n}" flood-color="${i}" flood-opacity="${r}" />\n       </filter>`.trim():`<filter>\n         <feGaussianBlur in="SourceAlpha" stdDeviation="${s}" />\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="${r}" />\n         </feComponentTransfer>\n         <feMerge>\n           <feMergeNode/>\n           <feMergeNode in="SourceGraphic"/>\n         </feMerge>\n       </filter>`.trim()},grayScale:function(t={}){const e=Uh(t.amount,1),n=.7152-.7152*(1-e);return`\n    <filter>\n      <feColorMatrix type="matrix" values="${.2126+.7874*(1-e)} ${n} ${.0722-.0722*(1-e)} 0 0 ${.2126-.2126*(1-e)} ${.7152+.2848*(1-e)} ${.0722-.0722*(1-e)} 0 0 ${.2126-.2126*(1-e)} ${n} ${.0722+.9278*(1-e)} 0 0 0 0 0 1 0"/>\n    </filter>\n  `.trim()},sepia:function(t={}){const e=Uh(t.amount,1);return`\n      <filter>\n        <feColorMatrix type="matrix" values="${.393+.607*(1-e)} ${.769-.769*(1-e)} ${.189-.189*(1-e)} 0 0 ${.349-.349*(1-e)} ${.686+.314*(1-e)} ${.168-.168*(1-e)} 0 0 ${.272-.272*(1-e)} ${.534-.534*(1-e)} ${.131+.869*(1-e)} 0 0 0 0 0 1 0"/>\n      </filter>\n    `.trim()},saturate:function(t={}){return`\n      <filter>\n        <feColorMatrix type="saturate" values="${1-Uh(t.amount,1)}"/>\n      </filter>\n    `.trim()},hueRotate:function(t={}){return`\n      <filter>\n        <feColorMatrix type="hueRotate" values="${Uh(t.angle,0)}"/>\n      </filter>\n    `.trim()},invert:function(t={}){const e=Uh(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()},brightness:function(t={}){const e=Uh(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()},contrast:function(t={}){const e=Uh(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()}});!function(t){t.presets=Wh,t.registry=gl.create({type:"filter"}),t.registry.register(t.presets,!0)}(qh||(qh={}));const Xh=function(t){const e=document.createElement("canvas"),n=t.width,i=t.height;e.width=2*n,e.height=i;const s=e.getContext("2d");return s.drawImage(t,0,0,n,i),s.translate(2*n,0),s.scale(-1,1),s.drawImage(t,0,0,n,i),e},Yh=function(t){const e=document.createElement("canvas"),n=t.width,i=t.height;e.width=n,e.height=2*i;const s=e.getContext("2d");return s.drawImage(t,0,0,n,i),s.translate(0,2*i),s.scale(1,-1),s.drawImage(t,0,0,n,i),e},Jh=function(t){const e=document.createElement("canvas"),n=t.width,i=t.height;e.width=2*n,e.height=2*i;const s=e.getContext("2d");return s.drawImage(t,0,0,n,i),s.setTransform(-1,0,0,-1,e.width,e.height),s.drawImage(t,0,0,n,i),s.setTransform(-1,0,0,1,e.width,0),s.drawImage(t,0,0,n,i),s.setTransform(1,0,0,-1,0,e.height),s.drawImage(t,0,0,n,i),e};var Zh,Kh=Object.freeze({__proto__:null,flipX:Xh,flipY:Yh,flipXY:Jh,watermark:function(t,e){const n=t.width,i=t.height,s=document.createElement("canvas");s.width=3*n,s.height=3*i;const r=s.getContext("2d"),o=null!=e.angle?-e.angle:-20,a=Yo.toRad(o),l=s.width/4,h=s.height/4;for(let e=0;e<4;e+=1)for(let s=0;s<4;s+=1)(e+s)%2>0&&(r.setTransform(1,0,0,1,(2*e-1)*l,(2*s-1)*h),r.rotate(a),r.drawImage(t,-n/2,-i/2,n,i));return s}});!function(t){t.presets=Object.assign({},Kh),t.presets["flip-x"]=Xh,t.presets["flip-y"]=Yh,t.presets["flip-xy"]=Jh,t.registry=gl.create({type:"background pattern"}),t.registry.register(t.presets,!0)}(Zh||(Zh={}));const Qh={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,trackable:!1,trackInfo:{},track(t){Qh.trackable=t}};var tc;!function(t){t.snapToGrid=Qo,t.normalizeMarker=hh,t.prefix=function(t){return`${Qh.prefixCls}-${t}`}}(tc||(tc={})),function(t){t.makeTree=function(t,e,n,i=[]){const s="function"==typeof e.children?e.children(t):t[e.children||"children"];return n||(n=e.createNode(t),i.push(n)),Array.isArray(s)&&s.forEach((t=>{const s=e.createNode(t),r=e.createEdge(n,s);i.push(s,r),this.makeTree(t,e,s,i)})),i}}(tc||(tc={}));const ec=tc.prefix("highlighted"),nc={highlight(t,e,n){oo(e,n&&n.className||ec)},unhighlight(t,e,n){ao(e,n&&n.className||ec)}},ic=tc.prefix("highlight-opacity"),sc={highlight(t,e){oo(e,ic)},unhighlight(t,e){ao(e,ic)}},rc={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},oc={highlight(t,e,n){const i=ac.getHighlighterId(e,n);if(ac.hasCache(i))return;n=Ns({},n,rc);const s=Oa.create(e);let r,o;try{r=s.toPathData()}catch(t){o=s.bbox(!0),r=Ba(Object.assign(Object.assign({},n),o))}const a=mo("path");if(Fo(a,Object.assign({d:r,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},n.attrs?Bo(n.attrs):null)),t.isEdgeElement(e))Fo(a,"d",t.getConnectionPathData());else{let e=s.getTransformToElement(t.container);const i=n.padding;if(i){null==o&&(o=s.bbox(!0));const t=o.x+o.width/2,n=o.y+o.height/2;o=Ja(o,e);const r=Math.max(o.width,1),a=Math.max(o.height,1),l=(r+i)/r,h=(a+i)/a,c=Ga({a:l,b:0,c:0,d:h,e:t-l*t,f:n-h*n});e=e.multiply(c)}il(a,e)}oo(a,tc.prefix("highlight-stroke"));const l=t.cell,h=()=>ac.removeHighlighter(i);l.on("removed",h),l.model&&l.model.on("reseted",h),t.container.appendChild(a),ac.setCache(i,a)},unhighlight(t,e,n){ac.removeHighlighter(ac.getHighlighterId(e,n))}};var ac;!function(t){t.getHighlighterId=function(t,e){return co(t),t.id+JSON.stringify(e)};const e={};t.setCache=function(t,n){e[t]=n},t.hasCache=function(t){return null!=e[t]},t.removeHighlighter=function(t){const n=e[t];n&&(Ao(n),delete e[t])}}(ac||(ac={}));var lc,hc=Object.freeze({__proto__:null,className:nc,opacity:sc,stroke:oc});function cc(t,e={}){return new ia(Xr(e.x,t.width),Xr(e.y,t.height))}function uc(t,e,n){return Object.assign({angle:e,position:t.toJSON()},n)}!function(t){t.check=function(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`)}}(lc||(lc={})),function(t){t.presets=hc,t.registry=gl.create({type:"highlighter"}),t.registry.register(t.presets,!0)}(lc||(lc={}));function dc(t,e,n,i){const s=e.getCenter(),r=e.getTopCenter(),o=e.width/e.height,a=oa.fromRect(e),l=t.length;return t.map(((t,e)=>{const h=n+i(e,l),c=r.clone().rotate(-h,s).scale(o,1,s),u=t.compensateRotate?-a.tangentTheta(c):0;return(t.dx||t.dy)&&c.translate(t.dx||0,t.dy||0),t.dr&&c.move(s,t.dr),uc(c.round(),u,t)}))}var gc=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};function pc(t,e,n,i){const s=new ra(e,n),r=t.length;return t.map(((t,e)=>{var{strict:n}=t,o=gc(t,["strict"]);const a=n||i.strict?(e+1)/(r+1):(e+.5)/r,l=s.pointAt(a);return(o.dx||o.dy)&&l.translate(o.dx||0,o.dy||0),uc(l.round(),0,o)}))}var fc,mc=Object.freeze({__proto__:null,absolute:(t,e)=>t.map((({x:t,y:n,angle:i})=>uc(cc(e,{x:t,y:n}),i||0))),ellipse:(t,e,n)=>{const i=n.start||0,s=n.step||20;return dc(t,e,i,((t,e)=>(t+.5-e/2)*s))},ellipseSpread:(t,e,n)=>{const i=n.start||0,s=n.step||360/t.length;return dc(t,e,i,(t=>t*s))},line:(t,e,n)=>pc(t,cc(e,n.start||e.getOrigin()),cc(e,n.end||e.getCorner()),n),left:(t,e,n)=>pc(t,e.getTopLeft(),e.getBottomLeft(),n),right:(t,e,n)=>pc(t,e.getTopRight(),e.getBottomRight(),n),top:(t,e,n)=>pc(t,e.getTopLeft(),e.getTopRight(),n),bottom:(t,e,n)=>pc(t,e.getBottomLeft(),e.getBottomRight(),n)});!function(t){t.presets=mc,t.registry=gl.create({type:"port layout"}),t.registry.register(t.presets,!0)}(fc||(fc={}));const yc={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function bc(t,e){const{x:n,y:i,angle:s,attrs:r}=e||{};return Ns({},{angle:s,attrs:r,position:{x:n,y:i}},t,yc)}function Cc(t,e,n,i){const s=null!=i.offset?i.offset:15,r=e.getCenter().theta(t),o=xc(e);let a,l,h,c,u=0;return r<o[1]||r>o[2]?(a=".3em",l=s,h=0,c="start"):r<o[0]?(a="0",l=0,h=-s,n?(u=-90,c="start"):c="middle"):r<o[3]?(a=".3em",l=-s,h=0,c="end"):(a=".6em",l=0,h=s,n?(u=90,c="start"):c="middle"),bc({position:{x:Math.round(l),y:Math.round(h)},angle:u,attrs:{".":{y:a,"text-anchor":c}}},i)}function vc(t,e,n,i){const s=null!=i.offset?i.offset:15,r=e.getCenter().theta(t),o=xc(e);let a,l,h,c,u=0;return r<o[1]||r>o[2]?(a=".3em",l=-s,h=0,c="end"):r<o[0]?(a=".6em",l=0,h=s,n?(u=90,c="start"):c="middle"):r<o[3]?(a=".3em",l=s,h=0,c="start"):(a="0em",l=0,h=-s,n?(u=-90,c="start"):c="middle"),bc({position:{x:Math.round(l),y:Math.round(h)},angle:u,attrs:{".":{y:a,"text-anchor":c}}},i)}function xc(t){const e=t.getCenter(),n=e.theta(t.getTopLeft()),i=e.theta(t.getBottomLeft()),s=e.theta(t.getBottomRight());return[n,e.theta(t.getTopRight()),s,i]}function wc(t,e,n){const i=null!=n.offset?n.offset:20,s=new ia(0,0),r=-t.theta(s);let o,a=".3em",l=r;return(r+90)%180==0?(o=e?"end":"middle",e||-270!==r||(a="0em")):r>-270&&r<-90?(o="start",l=r-180):o="end",bc({position:t.clone().move(s,i).diff(t).round().round().toJSON(),angle:e?l:0,attrs:{".":{y:a,"text-anchor":o}}},n)}var Ec,Ac,Mc=Object.freeze({__proto__:null,manual:(t,e,n)=>bc({position:e.getTopLeft()},n),left:(t,e,n)=>bc({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},n),right:(t,e,n)=>bc({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},n),top:(t,e,n)=>bc({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},n),bottom:(t,e,n)=>bc({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},n),outside:(t,e,n)=>Cc(t,e,!1,n),outsideOriented:(t,e,n)=>Cc(t,e,!0,n),inside:(t,e,n)=>vc(t,e,!1,n),insideOriented:(t,e,n)=>vc(t,e,!0,n),radial:(t,e,n)=>wc(t.diff(e.getCenter()),!1,n),radialOriented:(t,e,n)=>wc(t.diff(e.getCenter()),!0,n)});!function(t){t.presets=Mc,t.registry=gl.create({type:"port label layout"}),t.registry.register(t.presets,!0)}(Ec||(Ec={}));class Sc{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?Sc.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=Sc.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 s=Array.isArray(t)?t[0]:t,r=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(Wn(s,0,255)),this.g=Math.round(Wn(r,0,255)),this.b=Math.round(Wn(o,0,255)),this.a=null==a?1:Wn(a,0,1),this}toHex(){return`#${["r","g","b"].map((t=>{const e=this[t].toString(16);return e.length<2?`0${e}`:e})).join("")}`}toRGBA(){return this.toArray()}toHSLA(){return Sc.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 Sc.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([...a(e),1])}function n(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 i(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,s=parseFloat(e[1])/100,o=parseFloat(e[2])/100,a=null==e[3]?1:parseInt(e[3],10);return new t(r(i,s,o,a))}return null}function r(t,e,n,s){const r=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]:s,h=a<=.5?a*(o+1):a+o-a*o,c=2*a-h;return[256*i(c,h,r+1/3),256*i(c,h,r),256*i(c,h,r-1/3),null==l?1:l]}function o(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 a(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,s=(1<<i)-1,r=["b","g","r"].map((()=>{const t=n&s;return n>>=i,4===i?17*t:t}));return[r[2],r[1],r[0]]}function l(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 h(t,e){if("string"==typeof t){const n="#"===t[0],i=parseInt(n?t.substr(1):t,16),s=Wn((i>>16)+e,0,255),r=Wn((i>>8&255)+e,0,255);return`${n?"#":""}${(Wn((255&i)+e,0,255)|r<<8|s<<16).toString(16)}`}const n=a(h(l(t[0],t[1],t[2]),e));return[n[0],n[1],n[2],t[3]]}t.fromArray=function(e){return new t(e)},t.fromHex=e,t.fromRGBA=n,t.fromHSLA=s,t.fromString=function(i){if(i.startsWith("#"))return e(i);if(i.startsWith("rgb"))return n(i);const r=t.named[i];return r?e(r):s(i)},t.makeGrey=function(e,n){return t.fromArray([e,e,e,n])},t.rgba2hsla=function(t,e,n,i){const s=Array.isArray(t)?t[0]:t,r=Array.isArray(t)?t[1]:e,o=Array.isArray(t)?t[2]:n,a=Array.isArray(t)?t[3]:i,l=Math.max(s,r,o),h=Math.min(s,r,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 s:u=(r-o)/t+(r<o?6:0);break;case r:u=(o-s)/t+2;break;case o:u=(s-r)/t+4}u/=6}return[u,d,c,null==a?1:a]},t.hsla2rgba=r,t.random=o,t.randomHex=function(){let t="#";for(let e=0;e<6;e+=1)t+="0123456789ABCDEF"[Math.floor(16*Math.random())];return t},t.randomRGBA=function(t){return o(t).toString()},t.invert=function(t,e){if("string"==typeof t){const n="#"===t[0],[i,s,r]=a(t);return e?.299*i+.587*s+.114*r>186?"#000000":"#ffffff":`${n?"#":""}${l(255-i,255-s,255-r)}`}const n=t[0],i=t[1],s=t[2],r=t[3];return e?.299*n+.587*i+.114*s>186?[0,0,0,r]:[255,255,255,r]:[255-n,255-i,255-s,r]},t.lighten=function(t,e){return h(t,e)},t.darken=function(t,e){return h(t,-e)}}(Sc||(Sc={})),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"}}(Sc||(Sc={}));!function(t){t.call=function(t,e){const n=[];for(let i=0;i<t.length;i+=2){const s=Zr(t[i],t[i+1],Array.isArray(e)?e:[e]);n.push(s)}return to(n)}}(Ac||(Ac={}));class Oc{get disposed(){return!0===this._disposed}dispose(){this._disposed=!0}}!function(t){t.dispose=function(){return(t,e,n)=>{const i=n.value,s=t.__proto__;n.value=function(){this.disposed||(i.call(this),s.dispose.call(this))}}}}(Oc||(Oc={}));class kc{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){t.from=function(e){const n=new t;return e.forEach((t=>{n.add(t)})),n}}(kc||(kc={}));class Pc extends class{constructor(){this.listeners={}}on(t,e,n){if(null==e)return this;this.listeners[t]||(this.listeners[t]=[]);return this.listeners[t].push(e,n),this}once(t,e,n){const i=(...s)=>(this.off(t,i),Ac.call([e,n],s));return this.on(t,i,this)}off(t,e,n){if(!(t||e||n))return this.listeners={},this;const i=this.listeners;return(t?[t]:Object.keys(i)).forEach((t=>{const s=i[t];if(s)if(e||n)for(let t=s.length-2;t>=0;t-=2)e&&s[t]!==e||n&&s[t+1]!==n||s.splice(t,2);else delete i[t]})),this}trigger(t,...e){let n=!0;if("*"!==t){const i=this.listeners[t];null!=i&&(n=Ac.call([...i],e))}const i=this.listeners["*"];return null!=i?to([n,Ac.call([...i],[t,...e])]):n}emit(t,...e){return this.trigger(t,...e)}}{}!function(t){t.dispose=Oc.dispose}(Pc||(Pc={})),Nr(Pc,Oc);class Tc extends Pc{get disabled(){return!0===this._disabled}enable(){delete this._disabled}disable(){this._disabled=!0}}var Dc,Nc,jc,Lc,Fc,zc=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class Bc extends Oc{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()}}zc([Oc.dispose()],Bc.prototype,"dispose",null);class $c{constructor(t={}){this.comparator=t.comparator||$c.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},s=this.data.length-1;return n&&(i.id=n,this.index[n]=s),this.data.push(i),this.bubbleUp(s),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(void 0===n)throw new Error(`Node with id '${t}' was not found in the heap.`);const i=this.data,s=i[n].priority,r=this.comparator(e,s);r<0?(i[n].priority=e,this.bubbleUp(n)):r>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,s=t;for(;s>0&&(i=s-1>>>1,this.comparator(e[s].priority,e[i].priority)<0);){n=e[i],e[i]=e[s];let t=e[s].id;null!=t&&(this.index[t]=i),e[s]=n,t=e[s].id,null!=t&&(this.index[t]=s),s=i}}bubbleDown(t){const e=this.data,n=e.length-1;let i=t;for(;;){const t=1+(i<<1),s=t+1;let r=i;if(t<=n&&this.comparator(e[t].priority,e[r].priority)<0&&(r=t),s<=n&&this.comparator(e[s].priority,e[r].priority)<0&&(r=s),r===i)break;{const t=e[r];e[r]=e[i];let n=e[i].id;null!=n&&(this.index[n]=r),e[i]=t,n=e[i].id,null!=n&&(this.index[n]=i),i=r}}}}!function(t){t.defaultComparator=(t,e)=>t-e}($c||($c={})),function(t){t.run=function(t,e,n=((t,e)=>1)){const i={},s={},r={},o=new $c;for(i[e]=0,Object.keys(t).forEach((t=>{t!==e&&(i[t]=1/0),o.insert(i[t],t,t)}));!o.isEmpty();){const e=o.remove();r[e]=!0;const a=t[e]||[];for(let t=0;t<a.length;t+=1){const l=a[t];if(!r[l]){const t=i[e]+n(e,l);t<i[l]&&(i[l]=t,s[l]=e,o.updatePriority(l,t))}}}return s}}(Dc||(Dc={})),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;;e+=n,n/=2)if(t>=(7-4*e)/11){const i=(11-6*e-11*t)/4;return-i*i+n*n}}}(Nc||(Nc={})),function(t){t.decorators={reverse:t=>e=>1-t(1-e),reflect:t=>e=>.5*(e<.5?t(2*e):2-t(2-2*e)),clamp:(t,e=0,n=1)=>i=>{const s=t(i);return s<e?e:s>n?n:s},back:(t=1.70158)=>e=>e*e*((t+1)*e-t),elastic:(t=1.5)=>e=>Math.pow(2,10*(e-1))*Math.cos(20*Math.PI*t/3*e)}}(Nc||(Nc={})),function(t){function e(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 n(t){return 1-e(1-t)}t.easeInSine=function(t){return-1*Math.cos(t*(Math.PI/2))+1},t.easeOutSine=function(t){return Math.sin(t*(Math.PI/2))},t.easeInOutSine=function(t){return-.5*(Math.cos(Math.PI*t)-1)},t.easeInQuad=function(t){return t*t},t.easeOutQuad=function(t){return t*(2-t)},t.easeInOutQuad=function(t){return t<.5?2*t*t:(4-2*t)*t-1},t.easeInCubic=function(t){return t*t*t},t.easeOutCubic=function(t){const e=t-1;return e*e*e+1},t.easeInOutCubic=function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},t.easeInQuart=function(t){return t*t*t*t},t.easeOutQuart=function(t){const e=t-1;return 1-e*e*e*e},t.easeInOutQuart=function(t){const e=t-1;return t<.5?8*t*t*t*t:1-8*e*e*e*e},t.easeInQuint=function(t){return t*t*t*t*t},t.easeOutQuint=function(t){const e=t-1;return 1+e*e*e*e*e},t.easeInOutQuint=function(t){const e=t-1;return t<.5?16*t*t*t*t*t:1+16*e*e*e*e*e},t.easeInExpo=function(t){return 0===t?0:Math.pow(2,10*(t-1))},t.easeOutExpo=function(t){return 1===t?1:1-Math.pow(2,-10*t)},t.easeInOutExpo=function(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))},t.easeInCirc=function(t){const e=t/1;return-1*(Math.sqrt(1-e*t)-1)},t.easeOutCirc=function(t){const e=t-1;return Math.sqrt(1-e*e)},t.easeInOutCirc=function(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)},t.easeInBack=function(t,e=1.70158){return t*t*((e+1)*t-e)},t.easeOutBack=function(t,e=1.70158){const n=t/1-1;return n*n*((e+1)*n+e)+1},t.easeInOutBack=function(t,e=1.70158){const n=2*t,i=n-2,s=1.525*e;return n<1?.5*n*n*((s+1)*n-s):.5*(i*i*((s+1)*i+s)+2)},t.easeInElastic=function(t,e=.7){if(0===t||1===t)return t;const n=t/1-1,i=1-e,s=i/(2*Math.PI)*Math.asin(1);return-Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/i)},t.easeOutElastic=function(t,e=.7){const n=1-e,i=2*t;if(0===t||1===t)return t;const s=n/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/n)+1},t.easeInOutElastic=function(t,e=.65){const n=1-e;if(0===t||1===t)return t;const i=2*t,s=i-1,r=n/(2*Math.PI)*Math.asin(1);return i<1?Math.pow(2,10*s)*Math.sin((s-r)*(2*Math.PI)/n)*-.5:Math.pow(2,-10*s)*Math.sin((s-r)*(2*Math.PI)/n)*.5+1},t.easeOutBounce=e,t.easeInBounce=n,t.easeInOutBounce=function(t){return t<.5?.5*n(2*t):.5*e(2*t-1)+.5}}(Nc||(Nc={})),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 s={};for(let r=n.length-1;-1!==r;r-=1){const o=n[r];s[o]=t[o]+(e[o]-t[o])*i}return s}},t.unit=(t,e)=>{const n=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,i=n.exec(t),s=n.exec(e),r=s?s[1]:"",o=i?+i[1]:0,a=s?+s[1]:0,l=r.indexOf("."),h=l>0?r[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),s=255&n,r=(255&i)-s,o=65280&n,a=(65280&i)-o,l=16711680&n,h=(16711680&i)-l;return t=>`#${(1<<24|s+r*t&255|o+a*t&65280|l+h*t&16711680).toString(16).slice(1)}`}}(jc||(jc={})),function(t){const e=`${Qh.prefixCls}.storage`;function n(t,e,n){t&&js((()=>{t(e,n)}))}function i(t,e){localStorage.setItem(t,JSON.stringify(e))}function s(t){const e=localStorage.getItem(t);return e?JSON.parse(e):null}function r(t){const e=s(a(t));return e?(null==e.keys&&(e.keys=[]),e):{keys:[]}}function o(t,n){return`${e}.${t}.docs.${n}`}function a(t){return`${e}.${t}.index`}t.insert=function(t,e,s){const l=e.id||function(t){var e=++Dr;return Le(t)+e}("doc-"),h=r(t);h.keys.push(l),i(o(t,l),e),i(a(t),h),n(s,null,Object.assign(Object.assign({},e),{id:l}))},t.find=function(t,e,i){const a=r(t),l=[];if(null==e)a.keys.forEach((e=>{const r=s(o(t,e));r?l.push(r):n(i,new Error(`No document found for an ID '${e}' from index.`))})),n(i,null,l);else if(e.id){const r=s(o(t,e.id));n(i,null,r?[r]:[])}else n(i,null,[])},t.remove=function(t,e,s){const l=r(t);if(null==e)l.keys.forEach((e=>{localStorage.removeItem(o(t,e))})),localStorage.removeItem(a(t)),n(s,null);else if(e.id){const r=l.keys.indexOf(e.id);r>=0&&l.keys.splice(r,1),localStorage.removeItem(o(t,e.id)),i(a(t),l),n(s,null)}}}(Lc||(Lc={}));class Rc extends Pc{constructor(){super(),this.cid=Fc.uniqueId(),Rc.views[this.cid]=this}get priority(){return 2}confirmUpdate(t,e){return 0}$(t){return Rc.$(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 Rc.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?Fo(e,t):this.$(e).attr(t)),this}findAttr(t,e=this.container){let n=e;for(;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 Rc.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;for(;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=vo(t)+1;n=`${t.tagName.toLowerCase()}:nth-child(${i})`,e&&(n+=` > ${e}`),n=this.getSelector(t.parentNode,n)}return n}prefixClassName(t){return tc.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 s=this.getEventHandler(t[e]);"function"==typeof s&&this.delegateEvent(i[1],i[2],s)})),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(),s=this.$(t);return Object.keys(e).forEach((t=>{const r=this.getEventHandler(e[t]);"function"==typeof r&&s.on(t+i,n,r)})),this}removeEventListeners(t){return null!=t&&this.$(t).off(this.getEventNamespace()),this}getEventNamespace(){return`.${Qh.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:s=0,clientY:r=0}=t;return e.fromPoint||"touchmove"===i||"touchend"===i?document.elementFromPoint(s,r):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 Rc.normalizeEvent(t)}}!function(t){function e(t){return l(t)}t.$=e,t.createElement=function(t,e){return e?mo(t||"g"):fo(t||"div")},t.find=function(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{isCSSSelector:!0,elems:e(n).find(t).toArray()}},t.normalizeEvent=function(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 s=e.target;if(s){const t=s.correspondingUseElement;t&&(e.target=t)}return e}}(Rc||(Rc={})),function(t){t.views={},t.getView=function(e){return t.views[e]||null}}(Rc||(Rc={})),function(t){let e=0;t.uniqueId=function(){const t=`v${e}`;return e+=1,t}}(Fc||(Fc={}));function Ic(t,e){return 0===e?"0%":`${Math.round(t/e*100)}%`}function Vc(t){return(e,n,i,s)=>n.isEdgeElement(i)?function(t,e,n,i,s){const r=n.getConnection();if(!r)return e;const o=r.closestPointLength(s);if(t){const t=r.length();e.anchor={name:"ratio",args:{ratio:o/t}}}else e.anchor={name:"length",args:{length:o}};return e}(t,e,n,0,s):function(t,e,n,i,s){const r=n.cell,o=r.getAngle(),a=n.getUnrotatedBBoxOfElement(i),l=r.getBBox().getCenter(),h=ia.create(s).rotate(o,l);let c=h.x-a.x,u=h.y-a.y;t&&(c=Ic(c,a.width),u=Ic(u,a.height));return e.anchor={name:"topLeft",args:{dx:c,dy:u,rotate:!0}},e}(t,e,n,i,s)}const _c=Vc(!0),Gc=Vc(!1);var Hc,Uc,qc=Object.freeze({__proto__:null,noop:t=>t,pinRelative:_c,pinAbsolute:Gc});!function(t){t.presets=qc,t.registry=gl.create({type:"connection strategy"}),t.registry.register(t.presets,!0)}(Hc||(Hc={}));class Wc{constructor(t){this.view=t,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new Bc,this.pathCache={}}get(t){return this.elemCache.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=Qa(t,n)}return Ga(e.matrix)}getShape(t){const e=this.get(t);return null==e.shape&&(e.shape=tl(t)),e.shape.clone()}getBoundingRect(t){const e=this.get(t);return null==e.boundingRect&&(e.boundingRect=Ka(t)),e.boundingRect.clone()}}!function(t){function e(t){return null!=t&&"string"==typeof t}function n(t){return`${t}`.trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}function i(t,e={ns:go.svg}){const n=document.createDocumentFragment(),i={},s={},r=[{markup:Array.isArray(t)?t:[t],parent:n,ns:e.ns}];for(;r.length>0;){const t=r.pop();let e=t.ns||go.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===go.svg,h=e?fo(n,e):po(n),c=t.attrs;c&&(a?Fo(h,Bo(c)):l(h).attr(c));const u=t.style;u&&l(h).css(u);const d=t.className;null!=d&&h.setAttribute("class",Array.isArray(d)?d.join(" "):d),t.textContent&&(h.textContent=t.textContent);const g=t.selector;if(null!=g){if(s[g])throw new TypeError("Selector must be unique");s[g]=h}if(t.groupSelector){let e=t.groupSelector;Array.isArray(e)||(e=[e]),e.forEach((t=>{i[t]||(i[t]=[]),i[t].push(h)}))}o.appendChild(h);const p=t.children;Array.isArray(p)&&r.push({ns:e,markup:p,parent:h})}))}return Object.keys(i).forEach((t=>{if(s[t])throw new Error("Ambiguous group selector");s[t]=i[t]})),{fragment:n,selectors:s,groups:i}}function s(t){return t instanceof SVGElement?mo("g"):po("div")}t.isJSONMarkup=function(t){return null!=t&&!e(t)},t.isStringMarkup=e,t.clone=function(t){return null==t||e(t)?t:_i(t)},t.sanitize=n,t.parseStringMarkup=function(t){const e=document.createDocumentFragment();return Ur(n(t),{raw:!0}).forEach((t=>{e.appendChild(t)})),{fragment:e,selectors:{},groups:{}}},t.parseJSONMarkup=i,t.renderMarkup=function(t){if(e(t)){const e=Oa.createVectors(t),n=e.length;if(1===n)return{elem:e[0].node};if(n>1){const t=s(e[0].node);return e.forEach((e=>{t.appendChild(e.node)})),{elem:t}}return{}}const n=i(t),r=n.fragment;let o=null;return r.childNodes.length>1?(o=s(r.firstChild),o.appendChild(r)):o=r.firstChild,{elem:o,selectors:n.selectors}},t.parseLabelStringMarkup=function(t){const e=Oa.createVectors(t),n=document.createDocumentFragment();for(let t=0,i=e.length;t<i;t+=1){const i=e[t].node;n.appendChild(i)}return{fragment:n,selectors:{}}}}(Uc||(Uc={})),function(t){function e(t,n,i){if(null!=t){let s;const r=t.tagName.toLowerCase();if(t===n)return s="string"==typeof i?`> ${r} > ${i}`:`> ${r}`,s;const o=t.parentNode;if(o&&o.childNodes.length>1){s=`${r}:nth-child(${vo(t)+1})`}else s=r;return i&&(s+=` > ${i}`),e(t.parentNode,n,s)}return i}function n(t,n,i){if("#text"===t.nodeName)return null;let s=null,r=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?s=a:"groupSelector"===i?r=a:"class"===i?l.attrs={class:a}:o[i]=a}}return null==s&&(a=!0,s=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=go.xhtml:i&&(l.ns=i)),s&&(l.selector=s),null!=r&&(l.groupSelector=r),{markup:l,attrs:o,isCSSSelector:a}}t.getSelector=e,t.xml2json=function(e){const i=bo(t.sanitize(e),{mimeType:"image/svg+xml"}),s=Array.prototype.slice.call(i.childNodes),r={},o=new WeakMap,a=(t,e,i)=>{const s=n(t,e,i);if(null!=s){const{markup:n,attrs:i,isCSSSelector:l}=s;if(o.set(t,n),n.selector&&null!=i&&(Object.keys(i).length&&(r[n.selector]=i),l&&delete n.selector),t.childNodes&&t.childNodes.length>0)for(let i=0,s=t.childNodes.length;i<s;i+=1){const s=t.childNodes[i],r=a(s,e,n.ns);r&&(null==n.children&&(n.children=[]),n.children.push(r))}return n}{const e=o.get(t.parentNode);e&&t.textContent&&(e.textContent=t.textContent)}};return{markup:s.map((t=>a(t,t))).filter((t=>null!=t)),attrs:r}}}(Uc||(Uc={})),function(t){t.getPortContainerMarkup=function(){return"g"},t.getPortMarkup=function(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}},t.getPortLabelMarkup=function(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}}(Uc||(Uc={})),function(t){t.getEdgeMarkup=function(){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  ')},t.getEdgeToolMarkup=function(){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  ')},t.getEdgeVertexMarkup=function(){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  ')},t.getEdgeArrowheadMarkup=function(){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  ')}}(Uc||(Uc={})),function(t){t.getForeignObjectMarkup=function(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:go.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:go.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}}(Uc||(Uc={}));class Xc{constructor(t){this.view=t}get cell(){return this.view.cell}getDefinition(t){return this.cell.getAttrDefinition(t)}processAttrs(t,e){let n,i,s,r,o;const a=[];return Object.keys(e).forEach((i=>{const s=e[i],r=this.getDefinition(i),o=Kr(zh.isValidDefinition,this.view,r,s,{elem:t,attrs:e,cell:this.cell,view:this.view});if(r&&o)"string"==typeof r?(null==n&&(n={}),n[r]=s):null!==s&&a.push({name:i,definition:r});else{null==n&&(n={});const t=Do.includes(i)?i:Vr(i);n[t]=s}})),a.forEach((({name:n,definition:a})=>{const l=e[n];"function"==typeof a.set&&(!ko(t)&&Xc.DELAY_ATTRS.includes(n)?(null==o&&(o={}),o[n]=l):(null==i&&(i={}),i[n]=l));"function"==typeof a.offset&&(null==s&&(s={}),s[n]=l);"function"==typeof a.position&&(null==r&&(r={}),r[n]=l)})),{raw:e,normal:n,set:i,offset:s,position:r,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 s=[],r=new Bc;return Object.keys(t).forEach((o=>{const a=t[o];if(!Ye(a))return;const{isCSSSelector:l,elems:h}=Rc.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=r.get(n);if(u){u.array||(s.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=hr(i,l?-1:e);t.splice(n,0,a),i.splice(n,0,e)}}else r.set(n,{elem:n,attrs:a,priority:c?-1:e,array:!1})}})),s.forEach((t=>{const e=r.get(t),n=e.attrs;e.attrs=n.reduceRight(((t,e)=>Qs(t,e)),{})})),r}updateRelativeAttrs(t,e,n,i){const s=e.raw||{};let r=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:s,refBBox:n.clone()});if(null!=o&&Object.keys(o).forEach((t=>{const e=o[t],n=this.getDefinition(t);if(null!=n){const i=Kr(n.set,this.view,e,c());"object"==typeof i?r=Object.assign(Object.assign({},r),i):null!=i&&(r[t]=i)}})),ko(t))return void this.view.setAttrs(r,t);const u=r.transform,d=Ua(u?`${u}`:null),g=new ia(d.e,d.f);u&&(delete r.transform,d.e=0,d.f=0);let p=1,f=1;if(a||l){const e=this.view.getScaleOfElement(t,i.scalableNode);p=e.sx,f=e.sy}let m=!1;null!=a&&Object.keys(a).forEach((t=>{const e=a[t],n=this.getDefinition(t);if(null!=n){const t=Kr(n.position,this.view,e,c());null!=t&&(m=!0,g.translate(ia.create(t).scale(p,f)))}})),this.view.setAttrs(r,t);let y=!1;if(null!=l){const e=this.view.getBoundingRectOfElement(t);if(e.width>0&&e.height>0){const n=Ja(e,d).scale(1/p,1/f);Object.keys(l).forEach((e=>{const i=l[e],r=this.getDefinition(e);if(null!=r){const e=Kr(r.offset,this.view,i,{elem:t,cell:this.cell,view:this.view,attrs:s,refBBox:n});null!=e&&(y=!0,g.translate(ia.create(e).scale(p,f)))}}))}}(null!=u||m||y)&&(g.round(1),d.e=g.x,d.f=g.y,t.setAttribute("transform",qa(d)));const b=()=>{null!=h&&Object.keys(h).forEach((e=>{const n=h[e],i=this.getDefinition(e);if(null!=i){const s=Kr(i.set,this.view,n,c());"object"==typeof s?this.view.setAttrs(s,t):null!=s&&this.view.setAttrs({[e]:s},t)}}))};i.forceSync?b():dl.scheduleTask(b)}update(t,e,n){const i={},s=this.findAttrs(n.attrs||e,t,i,n.selectors),r=n.attrs?this.findAttrs(e,t,i,n.selectors):s,o=[];s.each((e=>{const s=e.elem,a=e.attrs,l=this.processAttrs(s,a);if(null==l.set&&null==l.position&&null==l.offset&&null==l.delay)this.view.setAttrs(l.normal,s);else{const e=r.get(s),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:s,refNode:u,attributes:h,processedAttributes:l},g=o.findIndex((t=>t.refNode===s));g>-1?o.splice(g,0,d):o.push(d)}}));const a=new Bc;let l;o.forEach((e=>{const i=e.node,s=e.refNode;let r;const h=null!=s&&null!=n.rotatableNode&&Eo(n.rotatableNode,s);if(s&&(r=a.get(s)),!r){const e=h?n.rotatableNode:t;r=s?Ka(s,{target:e}):n.rootBBox,s&&a.set(s,r)}let c;n.attrs&&e.attributes?(c=this.processAttrs(i,e.attributes),this.mergeProcessedAttrs(c,e.processedAttributes)):c=e.processedAttributes;let u=r;h&&null!=n.rotatableNode&&!n.rotatableNode.contains(i)&&(l||(l=Ua(Fo(n.rotatableNode,"transform"))),u=Ja(r,l));o.find((t=>t.refNode===i))&&(n.forceSync=!0),this.updateRelativeAttrs(i,c,u,n)}))}}!function(t){t.DELAY_ATTRS=["text","textWrap","sourceMarker","targetMarker"]}(Xc||(Xc={}));class Yc{constructor(t,e,n=[]){this.view=t;const i={},s={};let r=0;Object.keys(e).forEach((t=>{let n=e[t];Array.isArray(n)||(n=[n]),n.forEach((e=>{let n=i[e];n||(r+=1,n=i[e]=1<<r),s[t]|=n}))}));let o=n;if(Array.isArray(o)||(o=[o]),o.forEach((t=>{i[t]||(r+=1,i[t]=1<<r)})),r>25)throw new Error("Maximum number of flags exceeded.");this.flags=i,this.attrs=s,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 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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Zc extends Rc{constructor(t,e={}){super(),this.cell=t,this.options=this.ensureOptions(e),this.graph=this.options.graph,this.attr=new Xc(this),this.flag=new Yc(this,this.options.actions,this.options.bootstrap),this.cache=new Wc(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?Tr([...Array.isArray(t)?t:[t],...Array.isArray(e)?e:[e]]):Array.isArray(t)?[...t]:[t],n=_i(this.getDefaults()),{bootstrap:i,actions:s,events:r,documentEvents:o}=t,a=Jc(t,["bootstrap","actions","events","documentEvents"]);return i&&(n.bootstrap=e(n.bootstrap,i)),s&&Object.keys(s).forEach((t=>{const i=s[t],r=n.actions[t];i&&r?n.actions[t]=e(r,i):i&&(n.actions[t]=e(i))})),r&&(n.events=Object.assign(Object.assign({},n.events),r)),t.documentEvents&&(n.documentEvents=Object.assign(Object.assign({},n.documentEvents),o)),Qs(n,a)}get[Symbol.toStringTag](){return Zc.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 Rc.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 s=[e];return i&&("string"==typeof i?s.push(i):s.push(...i)),this.removeAction(t,s)}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=Uc.parseJSONMarkup(t),i=n.selectors,s=this.rootSelector;if(e&&s){if(i[s])throw new Error("Invalid root selector");i[s]=e}return n}can(t){let e=this.graph.options.interacting;if("function"==typeof e&&(e=Kr(e,this.graph,this)),"object"==typeof e){let n=e[t];return"function"==typeof n&&(n=Kr(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=ol(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();return Ja(e,this.getRootTranslatedMatrix().multiply(i).multiply(n))}getUnrotatedBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t);return Ja(e,this.getRootTranslatedMatrix().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 Ga().translate(e.x,e.y)}getRootRotatedMatrix(){let t=Ga();const e=this.cell,n=e.isNode()?e.getAngle():0;if(n){const i=e.getBBox(),s=i.width/2,r=i.height/2;t=t.translate(s,r).rotate(n).translate(-s,-r)}return t}findMagnet(t=this.container){return this.findByAttr("magnet",t)}updateAttrs(t,e,n={}){null==n.rootBBox&&(n.rootBBox=new sa),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,s){const r=this.cell,o=this.findAttr("port",t),a=t.getAttribute("data-selector"),l={cell:r.id};return null!=a&&(l.magnet=a),null!=o?(l.port=o,r.isNode()&&(r.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,s)}customizeEdgeTerminal(t,e,n,i,s,r){const o=s.getStrategy()||this.graph.options.connecting.strategy;if(o){const a="string"==typeof o?o:o.name,l="string"==typeof o?{}:o.args||{},h=Hc.registry;if(a){const o=h.get(a);if(null==o)return h.onNotFound(a);const c=Kr(o,this.graph,t,this,e,new ia(n,i),s,r,l);if(c)return c}}return t}getMagnetFromEdgeTerminal(t){const e=this.cell,n=this.container,i=t.port;let s,r=t.magnet;return null!=i&&e.isNode()&&e.hasPort(i)?s=this.findPortElem(i,r)||n:(r||(r=t.selector),r||null==i||(r=`[port="${i}"]`),s=this.findOne(r,n,this.selectors)),s}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,s=Oa.create(n);i||s.appendTo(this.graph.view.stage);const r=e.complete;return e.complete=t=>{i||Ao(n),r&&r(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,s=Oa.create(n);i||s.appendTo(this.graph.view.stage);const r=e.complete;return e.complete=t=>{i||Ao(n),r&&r(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=Kc.isToolsView(t)?t:new Kc(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,s=i.cell;return null==e||null==n?{e:t,view:i,cell:s}:{e:t,x:e,y:n,view:i,cell:s}}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))}}Zc.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},function(t){t.Flag=Yc,t.Attr=Xc}(Zc||(Zc={})),function(t){t.toStringTag=`X6.${t.name}`,t.isCellView=function(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}}(Zc||(Zc={})),function(t){t.priority=function(t){return function(e){e.config({priority:t})}},t.bootstrap=function(t){return function(e){e.config({bootstrap:t})}}}(Zc||(Zc={})),function(t){t.registry=gl.create({type:"view"})}(Zc||(Zc={}));class Kc extends Rc{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 Kc.toStringTag}createContainer(t,e){const n=t?Rc.createElement("g",!0):Rc.createElement("div",!1);return oo(n,this.prefixClassName("cell-tools")),e.className&&oo(n,e.className),n}config(t){if(this.options=Object.assign(Object.assign({},this.options),t),!Zc.isCellView(t.view)||t.view===this.cellView)return this;this.cellView=t.view,this.cell.isEdge()?(oo(this.svgContainer,this.prefixClassName("edge-tools")),oo(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(oo(this.svgContainer,this.prefixClassName("node-tools")),oo(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(Kc.ToolItem.isToolItem(t))"vertices"===t.name?n.unshift(t):n.push(t);else{"vertices"===("object"==typeof t?t.name:t)?n.unshift(t):n.push(t)}}));for(let t=0;t<n.length;t+=1){const e=n[t];let i;if(Kc.ToolItem.isToolItem(e))i=e;else{const t="object"==typeof e?e.name:e,n="object"==typeof e&&e.args||{};if(t)if(this.cell.isNode()){const e=pu.registry.get(t);if(!e)return pu.registry.onNotFound(t);i=new e(n)}else if(this.cell.isEdge()){const e=fu.registry.get(t);if(!e)return fu.registry.onNotFound(t);i=new e(n)}}if(i){i.config(this.cellView,this),i.render();(!1!==i.options.isSVGElement?this.svgContainer:this.htmlContainer).appendChild(i.container),this.tools.push(i)}}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),Ao(this.svgContainer),Ao(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){(this.options.local?e.container:e.graph.view.decorator).appendChild(this.svgContainer)}i&&this.graph.container.appendChild(this.htmlContainer)}return this}}function Qc(t,e,n,i){return Kr(Hc.presets.pinRelative,this.graph,{},e,n,t,this.cell,i,{}).anchor}function tu(t,e){return e?t.cell.getBBox():t.cell.isEdge()?t.getConnection().bbox():t.getUnrotatedBBoxOfElement(t.container)}!function(t){t.toStringTag=`X6.${t.name}`,t.isToolsView=function(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}}(Kc||(Kc={})),function(t){class e extends Rc{constructor(t={}){super(),this.visible=!0,this.options=this.getOptions(t),this.container=Rc.createElement(this.options.tagName||"g",!1!==this.options.isSVGElement),oo(this.container,this.prefixClassName("cell-tool")),"string"==typeof this.options.className&&oo(this.container,this.options.className),this.init()}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){return Qs(_i(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){return this.constructor.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()?oo(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&oo(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=Uc.isStringMarkup(t)?Uc.parseStringMarkup(t):Uc.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;t.define=function(t){const n=Fr((i=t.name)?_r(i):(e+=1,`CustomTool${e}`),this);var i;return n.config(t),n}}(e=t.ToolItem||(t.ToolItem={})),function(t){t.toStringTag=`X6.${t.name}`,t.isToolItem=function(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}}(e=t.ToolItem||(t.ToolItem={}))}(Kc||(Kc={}));class eu extends Kc.ToolItem{onRender(){oo(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();il(this.container,t,{absolute:!0})}getNodeMatrix(){const t=this.cellView,e=this.options;let{x:n=0,y:i=0}=e;const{offset:s,useCellGeometry:r,rotate:o}=e;let a=tu(t,r);const l=t.cell.getAngle();o||(a=a.bbox(l));let h=0,c=0;"number"==typeof s?(h=s,c=s):"object"==typeof s&&(h=s.x,c=s.y),n=Xr(n,a.width),i=Xr(i,a.height);let u=Ga().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:s}=e;let r,o,a;const l=Xr(i,1);r=l>=0&&l<=1?t.getTangentAtRatio(l):t.getTangentAtLength(l),r?(o=r.start,a=r.vector().vectorAngle(new ia(1,0))||0):(o=t.getConnection().start,a=0);let h=Ga().translate(o.x,o.y).rotate(a);return h="object"==typeof n?h.translate(n.x||0,n.y||0):h.translate(0,n),s||(h=h.rotate(-a)),h}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.options.onClick;"function"==typeof e&&Kr(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"}})}(eu||(eu={})),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})}})}(eu||(eu={}));var nu=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class iu extends Kc.ToolItem{onRender(){if(oo(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const t=this.options.attrs,{class:e}=t,n=nu(t,["class"]);Fo(this.container,Bo(n)),e&&oo(this.container,e)}this.update()}update(){const t=this.cellView,e=this.options,{useCellGeometry:n,rotate:i}=e,s=Jr(e.padding);let r=tu(t,n).moveAndExpand({x:-s.left,y:-s.top,width:s.left+s.right,height:s.top+s.bottom});const o=t.cell;if(o.isNode()){const t=o.getAngle();if(t)if(i){const e=o.getBBox().getCenter();rl(this.container,t,e.x,e.y,{absolute:!0})}else r=r.bbox(t)}return Fo(this.container,r.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"}})}(iu||(iu={}));class su extends Kc.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(){return this.vertices.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,s=this.options.processHandle,r=i({index:e,graph:this.graph,guard:t=>this.guard(t),attrs:this.options.attrs||{}});s&&s(r),this.graph.hook.onToolItemCreated({name:"vertices",cell:this.cell,view:this.cellView,tool:r}),r.updatePosition(n.x,n.y),this.stamp(r.container),this.container.appendChild(r.container),this.handles.push(r),this.startHandleListening(r)}}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,s=t<n.length-1?n[t+1]:e.targetAnchor;return{prev:ia.create(i),next:ia.create(s)}}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:s}=this.getMouseEventArgs(t);e.notifyMouseDown(n,i,s)}}onHandleChanging({handle:t,e:e}){const n=this.cellView,i=t.options.index,{e:s,x:r,y:o}=this.getMouseEventArgs(e),a={x:r,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(s,r,o)}onHandleChanged({e:t}){const e=this.options,n=this.cellView;if(e.addable&&this.updatePath(),!e.removeRedundancies)return;n.removeRedundantLinearVertices({ui:!0,toolId:this.cid})&&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:i,x:s,y:r}=this.getMouseEventArgs(t);this.options.stopPropagation||n.notifyMouseUp(i,s,r),n.checkMouseleave(i),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),s=i.prev,r=i.next;Math.abs(t.x-s.x)<n?t.x=s.x:Math.abs(t.x-r.x)<n&&(t.x=r.x),Math.abs(t.y-s.y)<n?t.y=i.prev.y:Math.abs(t.y-r.y)<n&&(t.y=r.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 s=e.getVertexIndex(i.x,i.y);this.snapVertex(i,s),e.cell.insertVertex(i,s,{ui:!0,toolId:this.cid}),this.render();const r=this.handles[s];this.eventData(n,{vertexAdded:!0}),r.onMouseDown(n)}onRemove(){this.resetHandles()}}!function(t){t.Handle=class extends Rc{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=Rc.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})}}}(su||(su={})),function(t){const e=tc.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"}})}(su||(su={}));class ru extends Kc.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){oo(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 t=0,n=e.length;t<n-1;t+=1){const n=e[t],i=e[t+1],s=this.renderHandle(n,i,t);this.stamp(s.container),this.handles.push(s)}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,s=t.options.index,r=this.cellView.cell.getVertices(),o=r[s-2]||n.sourceAnchor,a=r[s+1]||n.targetAnchor,l=this.options.snapRadius;return Math.abs(e[i]-o[i])<l?e[i]=o[i]:Math.abs(e[i]-a[i])<l&&(e[i]=a[i]),e}onHandleChanging({handle:t,e:e}){const n=this.graph,i=this.options,s=this.cellView,r=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=_i(this.vertices);let g=d[a],p=d[a+1];const f=s.sourceView,m=s.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=s.sourceAnchor.toJSON(),g[o]=u[o],m.containsPoint(g)?y=!0:(d.unshift(g),this.shiftHandleIndexes(1),b=!0)),"function"==typeof r&&f){if(y){const t=l.sourceAnchor.clone();t[o]=u[o];const e=Kr(r,s,t,f,s.sourceMagnet||f.container,"source",s,this);this.resetAnchor("source",e)}b&&this.resetAnchor("source",l.sourceAnchorDef)}const C=s.targetView,v=s.targetBBox;let x=!1,w=!1;if(p?a===d.length-2?v.containsPoint(p)?(d.pop(),x=!0):(p[o]=u[o],w=!0):p[o]=u[o]:(p=s.targetAnchor.toJSON(),p[o]=u[o],v.containsPoint(p)?x=!0:(d.push(p),w=!0)),"function"==typeof r&&C){if(x){const t=l.targetAnchor.clone();t[o]=u[o];const e=Kr(r,s,t,C,s.targetMagnet||C.container,"target",s,this);this.resetAnchor("target",e)}w&&this.resetAnchor("target",l.targetAnchorDef)}ia.equalPoints(d,this.vertices)||this.cellView.cell.setVertices(d,{ui:!0,toolId:this.cid}),this.updateHandle(t,g,p,0),i.stopPropagation||s.notifyMouseMove(h,c.x,c.y)}onHandleChange({handle:t,e:e}){const n=this.options,i=this.handles,s=this.cellView,r=t.options.index;if(Array.isArray(i)){for(let t=0,e=i.length;t<e;t+=1)t!==r&&i[t].hide();if(this.focus(),this.setEventData(e,{sourceAnchor:s.sourceAnchor.clone(),targetAnchor:s.targetAnchor.clone(),sourceAnchorDef:_i(this.cell.prop(["source","anchor"])),targetAnchorDef:_i(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);s.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),s=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,s.x,s.y),n.checkMouseleave(i),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}updateHandle(t,e,n,i=0){const s=this.options.precision||0,r=Math.abs(e.x-n.x)<s,o=Math.abs(e.y-n.y)<s;if(r||o){const s=new ra(e,n);if(s.length()<this.options.threshold)t.hide();else{const e=s.getCenter(),n=r?"x":"y";e[n]+=i||0;const o=s.vector().vectorAngle(new ia(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){t.Handle=class extends Rc{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=Rc.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 s=i.getClosestPoint(new ia(t,e))||new ia(t,e);let r=Ga().translate(s.x,s.y);if(s.equals({x:t,y:e}))r=r.rotate(n);else{let n=new ra(t,e,s.x,s.y).vector().vectorAngle(new ia(1,0));0!==n&&(n+=90),r=r.rotate(n)}this.setAttrs({transform:qa(r),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"}}}(ru||(ru={})),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:Qc})}(ru||(ru={}));class ou extends Kc.ToolItem{get type(){return this.options.type}onRender(){oo(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const t=this.type;return this.cellView.getTerminalView(t)?(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,s=this.options,r=i.getTerminalAnchor(n),o=i.cell.prop([n,"anchor"]);e.setAttribute("transform",`translate(${r.x}, ${r.y})`);const a=o?s.customAnchorAttrs:s.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,s=i.getTerminalView(n);if(s){const t=s.cell,r=i.getTerminalMagnet(n);let o,a,l,h=this.options.areaPadding||0;Number.isFinite(h)||(h=0),s.isEdgeElement(r)?(o=s.getBBox(),a=0,l=o.getCenter()):(o=s.getUnrotatedBBoxOfElement(r),a=t.getAngle(),l=o.getCenter(),a&&l.rotate(-a,t.getBBox().getCenter())),o.inflate(h),Fo(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 s=this.normalizeEvent(t),r=i.cell,o=n.getTerminalMagnet(e);let a=this.graph.clientToLocal(s.clientX,s.clientY);const l=this.options.snap;if("function"==typeof l){const t=Kr(l,n,a,i,o,e,n,this);a=ia.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=r.getAngle(),n=r.getBBox().getCenter(),s=a.clone().rotate(e,n);t.containsPoint(s)||(a=t.getNearestPointToPoint(s).rotate(-e,n))}let h;const c=this.options.anchor;"function"==typeof c&&(h=Kr(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:Qc,snap(t,e,n,i,s,r){const o=r.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}})}(ou||(ou={}));const au=ou.define({name:"source-anchor",type:"source"}),lu=ou.define({name:"target-anchor",type:"target"});var hu=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class cu extends Kc.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=hu(t,["class"]);this.setAttrs(n,this.container),e&&oo(this.container,e)}}onRender(){oo(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),s=n&&n.vector().vectorAngle(new ia(1,0))||0;if(!i)return this;const r=Ga().translate(i.x,i.y).rotate(s);return il(this.container,r,{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"}})}(cu||(cu={}));const uu=cu.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"}}),du=cu.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 gu extends Kc.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5}render(){return this.createElement(),this.updateEditor(),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=Kc.createElement("div",!1),this.addClass(e,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}updateEditor(){const{graph:t,cell:e,editor:n}=this,i=n.style;let s=new ia,r=20;if(e.isNode())s=e.getBBox().center,r=e.size().width-4;else if(e.isEdge()){const e=this.options.event,n=e.target,i=n.parentElement;if(i&&ro(i,this.prefixClassName("edge-label"))){const t=i.getAttribute("data-index")||"0";this.labelIndex=parseInt(t,10);const e=i.getAttribute("transform"),{translation:o}=Wa(e);s=new ia(o.tx,o.ty),r=Ka(n).width}else{if(!this.options.labelAddable)return this;s=t.clientToLocal(ia.create(e.clientX,e.clientY));const n=this.cellView.path.closestPointLength(s);this.distance=n}}s=t.localToGraph(s),i.left=`${s.x}px`,i.top=`${s.y}px`,i.minWidth=`${r}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=Kr(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;"function"==typeof n&&Kr(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"}})}(gu||(gu={})),function(t){t.NodeEditor=t.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText:({cell:t})=>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"},labelAddable:!0,getText:({cell:t,index:e})=>-1===e?"":t.prop(`labels/${e}/attrs/label/text`),setText({cell:t,value:e,index:n,distance:i}){const s=t;-1===n?s.appendLabel({position:{distance:i},attrs:{label:{text:e}}}):e?s.prop(`labels/${n}/attrs/label/text`,e):"number"==typeof n&&s.removeLabelAt(n)}})}(gu||(gu={}));var pu,fu,mu=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};!function(t){t.presets={boundary:iu,button:eu,"button-remove":eu.Remove,"node-editor":gu.NodeEditor},t.registry=gl.create({type:"node tool",process(t,e){if("function"==typeof e)return e;let n=Kc.ToolItem;const{inherit:i}=e,s=mu(e,["inherit"]);if(i){const t=this.get(i);null==t?this.onNotFound(i,"inherited"):n=t}return null==s.name&&(s.name=t),n.define.call(n,s)}}),t.registry.register(t.presets,!0)}(pu||(pu={})),function(t){t.presets={boundary:iu,vertices:su,segments:ru,button:eu,"button-remove":eu.Remove,"source-anchor":au,"target-anchor":lu,"source-arrowhead":uu,"target-arrowhead":du,"edge-editor":gu.EdgeEditor},t.registry=gl.create({type:"edge tool",process(t,e){if("function"==typeof e)return e;let n=Kc.ToolItem;const{inherit:i}=e,s=mu(e,["inherit"]);if(i){const t=this.get(i);null==t?this.onNotFound(i,"inherited"):n=t}return null==s.name&&(s.name=t),n.define.call(n,s)}}),t.registry.register(t.presets,!0)}(fu||(fu={}));const yu=Su("center"),bu=Su("topCenter"),Cu=Su("bottomCenter"),vu=Su("leftMiddle"),xu=Su("rightMiddle"),wu=Su("topLeft"),Eu=Su("topRight"),Au=Su("bottomLeft"),Mu=Su("bottomRight");function Su(t){return function(e,n,i,s={}){const r=s.rotate?e.getUnrotatedBBoxOfElement(n):e.getBBoxOfElement(n),o=r[t];o.x+=Xr(s.dx,r.width),o.y+=Xr(s.dy,r.height);const a=e.cell;return s.rotate?o.rotate(-a.getAngle(),a.getBBox().getCenter()):o}}function Ou(t){return function(e,n,i,s){if(i instanceof Element){const r=this.graph.renderer.findViewByElem(i);let o;if(r)if(r.isEdgeElement(i)){o=ku(r,null!=s.fixedAt?s.fixedAt:"50%")}else o=r.getBBoxOfElement(i).getCenter();else o=new ia;return t.call(this,e,n,o,s)}return t.apply(this,arguments)}}function ku(t,e){const n=Wr(e),i="string"==typeof e?parseFloat(e):e;return n?t.getPointAtRatio(i/100):t.getPointAtLength(i)}const Pu=Ou((function(t,e,n,i){const s=t.cell.getAngle(),r=t.getBBoxOfElement(e),o=r.getCenter(),a=r.getTopLeft(),l=r.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===s||180===s?0:1*t/Math.tan(Yo.toRad(s)),o.y+=t}else if(a.x+h<=n.x&&n.x<=l.x-h){const t=n.x-o.x;o.y+=90===s||270===s?0:t*Math.tan(Yo.toRad(s)),o.x+=t}return o})),Tu=Ou((function(t,e,n,i){let s,r,o=0;const a=t.cell;i.rotate?(s=t.getUnrotatedBBoxOfElement(e),r=a.getBBox().getCenter(),o=a.getAngle()):s=t.getBBoxOfElement(e);const l=i.padding;null!=l&&Number.isFinite(l)&&s.inflate(l),i.rotate&&n.rotate(o,r);const h=s.getNearestSideToPoint(n);let c;switch(h){case"left":c=s.getLeftMiddle();break;case"right":c=s.getRightMiddle();break;case"top":c=s.getTopCenter();break;case"bottom":c=s.getBottomCenter()}const u=i.direction;return"H"===u?"top"!==h&&"bottom"!==h||(c=n.x<=s.x+s.width?s.getLeftMiddle():s.getRightMiddle()):"V"===u&&(c=n.y<=s.y+s.height?s.getTopCenter():s.getBottomCenter()),i.rotate?c.rotate(-o,r):c}));var Du,Nu=Object.freeze({__proto__:null,center:yu,top:bu,bottom:Cu,left:vu,right:xu,topLeft:wu,topRight:Eu,bottomLeft:Au,bottomRight:Mu,orth:Pu,nodeCenter:function(t,e,n,i,s){const r=t.cell.getConnectionPoint(this.cell,s);return(i.dx||i.dy)&&r.translate(i.dx||0,i.dy||0),r},midSide:Tu});!function(t){t.presets=Nu,t.registry=gl.create({type:"node endpoint"}),t.registry.register(t.presets,!0)}(Du||(Du={}));const ju=function(t,e,n,i){const s=t.getClosestPoint(n);return null!=s?s:new ia},Lu=Ou(ju),Fu=Ou((function(t,e,n,i){const s=1e6,r=t.getConnection(),o=t.getConnectionSubdivisions(),a=new ra(n.clone().translate(0,s),n.clone().translate(0,-s)),l=new ra(n.clone().translate(s,0),n.clone().translate(-s,0)),h=a.intersect(r,{segmentSubdivisions:o}),c=l.intersect(r,{segmentSubdivisions:o}),u=[];return h&&u.push(...h),c&&u.push(...c),u.length>0?n.closest(u):null!=i.fallbackAt?ku(t,i.fallbackAt):Kr(ju,this,t,e,n,i)}));var zu,Bu=Object.freeze({__proto__:null,closest:Lu,ratio:function(t,e,n,i){let s=null!=i.ratio?i.ratio:.5;return s>1&&(s/=100),t.getPointAtRatio(s)},length:function(t,e,n,i){const s=null!=i.length?i.length:20;return t.getPointAtLength(s)},orth:Fu});function $u(t,e,n){let i;if("object"==typeof n){if(Number.isFinite(n.y)){const i=new ra(e,t),{start:s,end:r}=i.parallel(n.y);e=s,t=r}i=n.x}else i=n;if(null==i||!Number.isFinite(i))return t;const s=t.distance(e);return 0===i&&s>0?t:t.move(e,-Math.min(i,s-1))}function Ru(t){const e=t.getAttribute("stroke-width");return null===e?0:parseFloat(e)||0}!function(t){t.presets=Bu,t.registry=gl.create({type:"edge endpoint"}),t.registry.register(t.presets,!0)}(zu||(zu={}));const Iu=function(t,e,n,i){const s=e.getBBoxOfElement(n);i.stroked&&s.inflate(Ru(n)/2);const r=t.intersect(s);return $u(r&&r.length?t.start.closest(r):t.end,t.start,i.offset)};var Vu,_u=Object.freeze({__proto__:null,bbox:Iu,rect:function(t,e,n,i,s){const r=e.cell,o=r.isNode()?r.getAngle():0;if(0===o)return Kr(Iu,this,t,e,n,i,s);const a=e.getUnrotatedBBoxOfElement(n);i.stroked&&a.inflate(Ru(n)/2);const l=a.getCenter(),h=t.clone().rotate(o,l),c=h.setLength(1e6).intersect(a);return $u(c&&c.length?h.start.closest(c).rotate(-o,l):t.end,t.start,i.offset)},boundary:function(t,e,n,i){let s,r;const o=t.end,a=i.selector;if(s="string"==typeof a?e.findOne(a):Array.isArray(a)?Br(n,a):function(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}(n),!uo(s)){if(s===n||!uo(n))return o;s=n}const l=e.getShapeOfElement(s),h=e.getMatrixOfElement(s),c=e.getRootTranslatedMatrix(),u=e.getRootRotatedMatrix(),d=c.multiply(u).multiply(h),g=function(t,e){return new ra(Ya(t.start,e),Ya(t.end,e))}(t,d.inverse()),p=g.start.clone(),f=e.getDataOfElement(s);if(!1===i.insideout){null==f.shapeBBox&&(f.shapeBBox=l.bbox());const t=f.shapeBBox;if(null!=t&&t.containsPoint(p))return o}let m;if(!0===i.extrapolate&&g.setLength(1e6),Sa.isPath(l)){const t=i.precision||2;null==f.segmentSubdivisions&&(f.segmentSubdivisions=l.getSegmentSubdivisions({precision:t})),m={precision:t,segmentSubdivisions:f.segmentSubdivisions},r=g.intersect(l,m)}else r=g.intersect(l);r?Array.isArray(r)&&(r=p.closest(r)):!0===i.sticky&&(r=sa.isRectangle(l)?l.getNearestPointToPoint(p):oa.isEllipse(l)?l.intersectsWithLineFromCenterToPoint(p):l.closestPoint(p,m));const y=r?Ya(r,d):o;let b=i.offset||0;return!1!==i.stroked&&("object"==typeof b?(b=Object.assign({},b),null==b.x&&(b.x=0),b.x+=Ru(s)/2):b+=Ru(s)/2),$u(y,t.start,b)},anchor:function(t,e,n,i){const{alignOffset:s,align:r}=i;return r&&function(t,e,n=0){const{start:i,end:s}=t;let r,o,a,l;switch(e){case"left":l="x",r=s,o=i,a=-1;break;case"right":l="x",r=i,o=s,a=1;break;case"top":l="y",r=s,o=i,a=-1;break;case"bottom":l="y",r=i,o=s,a=1;break;default:return}i[l]<s[l]?r[l]=o[l]:o[l]=r[l],Number.isFinite(n)&&(r[l]+=a*n,o[l]+=a*n)}(t,r,s),$u(t.end,t.start,i.offset)}});!function(t){t.presets=_u,t.registry=gl.create({type:"connection point"}),t.registry.register(t.presets,!0)}(Vu||(Vu={}));function Gu(t){return new sa(t.x,t.y,0,0)}function Hu(t={}){const e=Jr(t.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function Uu(t,e={}){return t.sourceBBox.clone().moveAndExpand(Hu(e))}function qu(t,e={}){return t.targetBBox.clone().moveAndExpand(Hu(e))}const Wu=function(t,e,n){let i=Uu(n,e),s=qu(n,e);const r=function(t,e={}){return t.sourceAnchor?t.sourceAnchor:Uu(t,e).getCenter()}(n,e),o=function(t,e={}){return t.targetAnchor?t.targetAnchor:qu(t,e).getCenter()}(n,e);i=i.union(Gu(r)),s=s.union(Gu(o));const a=t.map((t=>ia.create(t)));a.unshift(r),a.push(o);let l=null;const h=[];for(let t=0,n=a.length-1;t<n;t+=1){let r=null;const o=a[t],c=a[t+1],u=null!=Xu.getBearing(o,c);if(0===t)t+1===n?i.intersectsWithRect(s.clone().inflate(1))?r=Xu.insideNode(o,c,i,s):u||(r=Xu.nodeToNode(o,c,i,s)):i.containsPoint(c)?r=Xu.insideNode(o,c,i,Gu(c).moveAndExpand(Hu(e))):u||(r=Xu.nodeToVertex(o,c,i));else if(t+1===n){const t=u&&Xu.getBearing(c,o)===l;s.containsPoint(o)||t?r=Xu.insideNode(o,c,Gu(o).moveAndExpand(Hu(e)),s,l):u||(r=Xu.vertexToNode(o,c,s,l))}else u||(r=Xu.vertexToVertex(o,c,l));r?(h.push(...r.points),l=r.direction):l=Xu.getBearing(o,c),t+1<n&&h.push(c)}return h};var Xu;!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 ia(t.x,e.y);return n.containsPoint(i)&&(i=new ia(e.x,t.y)),i}function s(t,e){return t["W"===e||"E"===e?"width":"height"]}function r(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 s=new ia(t.x,n.y),o=new ia(n.x,t.y),a=r(t,s),l=r(t,o),h=i?e[i]:null,c=a===i||a!==h&&(l===h||l!==i)?s:o;return{points:[c],direction:r(c,n)}}function a(t,e,n){const s=i(t,e,n);return{points:[s],direction:r(s,e)}}t.getBBoxSize=s,t.getBearing=r,t.vertexToVertex=o,t.nodeToVertex=a,t.vertexToNode=function(t,e,n,o){const a=[new ia(t.x,e.y),new ia(e.x,t.y)],l=a.filter((t=>!n.containsPoint(t))),h=l.filter((e=>r(e,t)!==o));let c;if(h.length>0)return c=h.filter((e=>r(t,e)===o)).pop(),c=c||h[0],{points:[c],direction:r(c,e)};{c=Fs(a,l)[0];const h=ia.create(e).move(c,-s(n,o)/2);return{points:[i(h,t,n),h],direction:r(h,e)}}},t.nodeToNode=function(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=ia.create(t).move(c,-s(n,r(t,c))/2),d=ia.create(e).move(h,-s(i,r(e,h))/2),g=new ra(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},t.insideNode=function(t,e,s,o,a){const l=s.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;return a?(g=ia.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=ia.fromPolar(l.width+l.height,Yo.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],{points:m,direction:r(c?g:p,e)}}}(Xu||(Xu={}));const Yu={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeShapes:[],excludeNodes:[],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(){return Ju(this.step,this)},directions(){const t=Ju(this.step,this),e=Ju(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=Ju(this.step,this);return{0:0,45:t/2,90:t/2}},paddingBox(){const t=Ju(this.step,this);return{x:-t,y:-t,width:2*t,height:2*t}},fallbackRouter:Wu,draggingRouter:null};function Ju(t,e){return"function"==typeof t?t.call(e):t}class Zu{constructor(){this.items=[],this.hash={},this.values={}}add(t,e){this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=1,this.values[t]=e;const n=function(t,e,n){return lr(t,e,ds(n))}(this.items,t,(t=>this.values[t]));this.items.splice(n,0,t)}pop(){const t=this.items.shift();return t&&(this.hash[t]=2),t}isOpen(t){return 1===this.hash[t]}isClose(t){return 2===this.hash[t]}isEmpty(){return 0===this.items.length}}class Ku{constructor(t){this.options=t,this.mapGridSize=100,this.map={}}build(t,e){const n=this.options,i=n.excludeTerminals.reduce(((n,i)=>{const s=e[i];if(s){const e=t.getCell(s.cell);e&&n.push(e)}return n}),[]);let s=[];const r=t.getCell(e.getSourceCellId());r&&(s=Pr(s,r.getAncestors().map((t=>t.id))));const o=t.getCell(e.getTargetCellId());o&&(s=Pr(s,o.getAncestors().map((t=>t.id))));const a=this.mapGridSize;return t.getNodes().reduce(((t,e)=>{const r=e.shape,o=n.excludeShapes,l=!!r&&o.includes(r),h=i.some((t=>t.id===e.id)),c=n.excludeNodes.includes(e),u=s.includes(e.id),d=n.excludeHiddenNodes&&!e.isVisible();if(!(l||h||c||u||d)){const i=e.getBBox().moveAndExpand(n.paddingBox),s=i.getOrigin().snapToGrid(a),r=i.getCorner().snapToGrid(a);for(let e=s.x;e<=r.x;e+=a)for(let n=s.y;n<=r.y;n+=a){const s=new ia(e,n).toString();null==t[s]&&(t[s]=[]),t[s].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 Qu(t,e){const n=t.sourceBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function td(t,e){const n=t.targetBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function ed(t,e){if(t.sourceAnchor)return t.sourceAnchor;return Qu(t,e).getCenter()}function nd(t,e,n,i,s){const r=360/n,o=t.theta(function(t,e,n,i){const s=i.step,r=e.x-t.x,o=e.y-t.y,a=r/n.x,l=o/n.y,h=a*s,c=l*s;return new ia(t.x+h,t.y+c)}(t,e,i,s)),a=Yo.normalize(o+r/2);return r*Math.floor(a/r)}function id(t,e){const n=Math.abs(t-e);return n>180?360-n:n}function sd(t,e){if(!t)return e;const n=Math.abs(t),i=Math.round(n/e);if(!i)return n;return e+(n-i*e)/i}function rd(t,e){return t.round(e)}function od(t,e,n){return rd(function(t,e){const n=e.source,i=tc.snapToGrid(t.x-n.x,e.x)+n.x,s=tc.snapToGrid(t.y-n.y,e.y)+n.y;return new ia(i,s)}(t.clone(),e),n)}function ad(t){return t.toString()}function ld(t){return new ia(0===t.x?0:Math.abs(t.x)/t.x,0===t.y?0:Math.abs(t.y)/t.y)}function hd(t,e){let n=1/0;for(let i=0,s=e.length;i<s;i+=1){const s=t.manhattanDistance(e[i]);s<n&&(n=s)}return n}function cd(t,e,n,i,s){const r=s.precision,o=s.directionMap,a=t.diff(e.getCenter()),l=Object.keys(o).reduce(((s,l)=>{if(n.includes(l)){const n=o[l],h=new ia(t.x+n.x*(Math.abs(a.x)+e.width),t.y+n.y*(Math.abs(a.y)+e.height)),c=new ra(t,h).intersect(e)||[];let u,d=null;for(let e=0;e<c.length;e+=1){const n=c[e],i=t.squaredDistance(n);(null==u||i>u)&&(u=i,d=n)}if(d){let t=od(d,i,r);e.containsPoint(t)&&(t=od(t.translate(n.x*i.x,n.y*i.y),i,r)),s.push(t)}}return s}),[]);return e.containsPoint(t)||l.push(od(t,i,r)),l}function ud(t,e,n,i,s){const r=[];let o,a=ld(s.diff(n)),l=ad(n),h=t[l];for(;h;){o=e[l];const n=ld(o.diff(h));n.equals(a)||(r.unshift(o),a=n),l=ad(h),h=t[l]}const c=e[l];return ld(c.diff(i)).equals(a)||r.unshift(c),r}function dd(t,e,n,i,s){const r=s.precision;let o,a;o=sa.isRectangle(e)?rd(ed(t,s).clone(),r):rd(e.clone(),r),a=sa.isRectangle(n)?rd(function(t,e){return t.targetAnchor?t.targetAnchor:td(t,e).getCenter()}(t,s).clone(),r):rd(n.clone(),r);const l=(h=s.step,u=a,{source:(c=o).clone(),x:sd(u.x-c.x,h),y:sd(u.y-c.y,h)});var h,c,u;const d=o,g=a;let p,f;if(p=sa.isRectangle(e)?cd(d,e,s.startDirections,l,s):[d],f=sa.isRectangle(n)?cd(a,n,s.endDirections,l,s):[g],p=p.filter((t=>i.isAccessible(t))),f=f.filter((t=>i.isAccessible(t))),p.length>0&&f.length>0){const t=new Zu,e={},n={},o={};for(let n=0,i=p.length;n<i;n+=1){const i=p[n],s=ad(i);t.add(s,hd(i,f)),e[s]=i,o[s]=0}const a=s.previousDirectionAngle,h=void 0===a;let c,u;const m=function(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}(l,s),y=m.length,b=f.reduce(((t,e)=>{const n=ad(e);return t.push(n),t}),[]),C=ia.equalPoints(p,f);let v=s.maxLoopCount;for(;!t.isEmpty()&&v>0;){const p=t.pop(),x=e[p],w=n[p],E=o[p],A=x.equals(d),M=null==w;let S;S=M?h?A?null:nd(d,x,y,l,s):a:nd(w,x,y,l,s);if(!(M&&C)&&b.indexOf(p)>=0)return s.previousDirectionAngle=S,ud(n,e,x,d,g);for(let a=0;a<y;a+=1){c=m[a];const d=c.angle;if(u=id(S,d),(!h||!A)&&u>s.maxDirectionChange)continue;const p=od(x.clone().translate(c.gridOffsetX||0,c.gridOffsetY||0),l,r),C=ad(p);if(t.isClose(C)||!i.isAccessible(p))continue;if(b.indexOf(C)>=0){if(!p.equals(g)){if(id(d,nd(p,g,y,l,s))>s.maxDirectionChange)continue}}const v=E+c.cost+(A?0:s.penalties[u]);(!t.isOpen(C)||v<o[C])&&(e[C]=p,n[C]=x,o[C]=v,t.add(C,v+hd(p,f)))}v-=1}}return s.fallbackRoute?Kr(s.fallbackRoute,this,d,g,s):null}const gd=function(t,e,n){const i=function(t){const e=Object.keys(t).reduce(((e,n)=>(e[n]="fallbackRouter"===n||"draggingRouter"===n||"fallbackRoute"===n?t[n]:Ju(t[n],t),e)),{});if(e.padding){const t=Jr(e.padding);e.paddingBox={x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}return e.directions.forEach((t=>{const e=new ia(0,0),n=new ia(t.offsetX,t.offsetY);t.angle=Yo.normalize(e.theta(n))})),e}(e),s=Qu(n,i),r=td(n,i),o=ed(n,i),a=new Ku(i).build(n.graph.model,n.cell),l=t.map((t=>ia.create(t))),h=[];let c,u,d=o;for(let e=0,g=l.length;e<=g;e+=1){let g=null;if(c=u||s,u=l[e],null==u){u=r;const t=n.cell;if((null==t.getSourceCellId()||null==t.getTargetCellId())&&"function"==typeof i.draggingRouter){const t=c===s?o:c,e=u.getOrigin();g=Kr(i.draggingRouter,n,t,e,i)}}if(null==g&&(g=dd(n,c,u,a,i)),null===g)return Kr(i.fallbackRouter,this,t,i,n);const p=g[0];p&&p.equals(d)&&g.shift(),d=g[g.length-1]||d,h.push(...g)}return h},pd=function(t,e,n){return Kr(gd,this,t,Object.assign(Object.assign({},Yu),e),n)},fd={maxDirectionChange:45,directions(){const t=Ju(this.step,this),e=Ju(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),s=[];let r={x:e.x,y:t.y},o={x:t.x,y:e.y};if(i%180>90){const t=r;r=o,o=t}const a=i%90<45?r:o,l=new ra(t,a),h=90*Math.ceil(i/90),c=ia.fromPolar(l.squaredLength(),Yo.toRad(h+135),a),u=new ra(e,c),d=l.intersectsWithLine(u),g=d||e,p=d?g:t,f=360/n.directions.length,m=p.theta(e),y=Yo.normalize(m+f/2),b=f*Math.floor(y/f);return n.previousDirectionAngle=b,g&&s.push(g.round()),s.push(e),s}};function md(t,e){if(null!=e&&!1!==e){const n="boolean"==typeof e?0:e;if(n>0){const e=ia.create(t[1]).move(t[2],n),i=ia.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}var yd,bd=Object.freeze({__proto__:null,normal:function(t){return[...t]},oneSide:function(t,e,n){const i=e.side||"bottom",s=Jr(e.padding||40),r=n.sourceBBox,o=n.targetBBox,a=r.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"}return a[h]+=u*(r[c]/2+s[i]),l[h]+=u*(o[c]/2+s[i]),u*(a[h]-l[h])>0?l[h]=a[h]:a[h]=l[h],[a.toJSON(),...t,l.toJSON()]},orth:Wu,metro:function(t,e,n){return Kr(pd,this,t,Object.assign(Object.assign({},fd),e),n)},manhattan:pd,er:function(t,e,n){const i=e.offset||32,s=null==e.min?16:e.min;let r=0,o=e.direction;const a=n.sourceBBox,l=n.targetBBox,h=a.getCenter(),c=l.getCenter();if("number"==typeof i&&(r=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?r=(l.left-a.right)/2:"R"===o?r=(a.left-l.right)/2:"T"===o?r=(l.top-a.bottom)/2:"B"===o&&(r=(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+r),m[u]-=g*(l[d]/2+r),p){const t=f.x,e=m.x,n=a.width/2+s,i=l.width/2+s;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+s,i=l.height/2+s;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()]},loop:function(t,e,n){const i=e.width||50,s=(e.height||80)/2,r=e.angle||"auto",o=n.sourceAnchor,a=n.targetAnchor,l=n.sourceBBox,h=n.targetBBox;if(o.equals(a)){const t=t=>{const e=Yo.toRad(t),n=Math.sin(e),r=Math.cos(e),a=new ia(o.x+r*i,o.y+n*i),l=new ia(a.x-r*s,a.y-n*s),h=l.clone().rotate(-90,a),c=l.clone().rotate(90,a);return[h.toJSON(),a.toJSON(),c.toJSON()]},n=t=>{const e=o.clone().move(t,-1),n=new ra(e,t);return!l.containsPoint(t)&&!l.intersectsWithLine(n)},a=[0,90,180,270,45,135,225,315];if("number"==typeof r)return md(t(r),e.merge);const h=l.getCenter();if(h.equals(o))return md(t(0),e.merge);const c=h.angleBetween(o,h.clone().translate(1,0));let u=t(c);if(n(u[1]))return md(u,e.merge);for(let i=1,s=a.length;i<s;i+=1)if(u=t(c+a[i]),n(u[1]))return md(u,e.merge);return md(u,e.merge)}{const t=new ra(o,a);let r=t.parallel(-i),c=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 ra(g.start,c),f=new ra(g.end,c);if((l.containsPoint(c)||h.containsPoint(c)||l.intersectsWithLine(p)||l.intersectsWithLine(f)||h.intersectsWithLine(p)||h.intersectsWithLine(f))&&(r=t.parallel(i),c=r.getCenter(),u=r.start.clone().move(r.end,s),d=r.end.clone().move(r.start,s)),e.merge){const t=new ra(o,a),e=new ra(c,t.center).setLength(Number.MAX_SAFE_INTEGER),i=l.intersectsWithLine(e),s=h.intersectsWithLine(e),r=i?Array.isArray(i)?i:[i]:[];s&&(Array.isArray(s)?r.push(...s):r.push(s));const u=t.center.closest(r);u?(n.sourceAnchor=u.clone(),n.targetAnchor=u.clone()):(n.sourceAnchor=t.center.clone(),n.targetAnchor=t.center.clone())}return md([u.toJSON(),c.toJSON(),d.toJSON()],e.merge)}}});!function(t){t.presets=bd,t.registry=gl.create({type:"router"}),t.registry.register(t.presets,!0)}(yd||(yd={}));const Cd=1/3,vd=2/3;function xd(t,e,n=[]){const i=[t,...n,e],s=[];return i.forEach(((t,e)=>{const n=i[e+1];null!=n&&s.push(new ra(t,n))})),s}function wd(t,e){return new ra(t,e).squaredLength()}function Ed(t,e,n,i){const s=new Sa;let r;return r=Sa.createSegment("M",t[0].start),s.appendSegment(r),t.forEach(((o,a)=>{if(Ad.includes(o)){let t,i,a,l;if("arc"===n){t=-90,i=o.start.diff(o.end);(i.x<0||0===i.x&&i.y<0)&&(t+=180);const e=o.getCenter(),n=new ra(e,o.end).rotate(t,e);let h;h=new ra(o.start,e),a=h.pointAt(2/3).rotate(t,o.start),l=n.pointAt(1/3).rotate(-t,n.end),r=Sa.createSegment("C",a,l,n.end),s.appendSegment(r),h=new ra(e,o.end),a=n.pointAt(1/3).rotate(t,n.end),l=h.pointAt(1/3).rotate(-t,o.end),r=Sa.createSegment("C",a,l,o.end),s.appendSegment(r)}else if("gap"===n)r=Sa.createSegment("M",o.end),s.appendSegment(r);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);(i.x<0||0===i.x&&i.y<0)&&(h*=-1),a=new ia(o.start.x+n,o.start.y+h).rotate(t,o.start),l=new ia(o.end.x-n,o.end.y+h).rotate(t,o.end),r=Sa.createSegment("C",a,l,o.end),s.appendSegment(r)}}else{const e=t[a+1];0===i||!e||Ad.includes(e)?(r=Sa.createSegment("L",o.end),s.appendSegment(r)):function(t,e,n,i,s){const r=n.distance(i)/2,o=n.distance(s)/2,a=-Math.min(t,r),l=-Math.min(t,o),h=n.clone().move(i,a).round(),c=n.clone().move(s,l).round(),u=new ia(Cd*h.x+vd*n.x,vd*n.y+Cd*h.y),d=new ia(Cd*c.x+vd*n.x,vd*n.y+Cd*c.y);let g;g=Sa.createSegment("L",h),e.appendSegment(g),g=Sa.createSegment("C",u,d,c),e.appendSegment(g)}(i,s,o.end,o.start,e.end)}})),s}let Ad,Md;var Sd,Od=Object.freeze({__proto__:null,normal:function(t,e,n,i={}){const s=[t,...n,e],r=new aa(s),o=new Sa(r);return i.raw?o:o.serialize()},loop:function(t,e,n,i={}){const s=3===n.length?0:1,r=ia.create(n[0+s]),o=ia.create(n[2+s]),a=ia.create(n[1+s]);if(!ia.equals(t,e)){const n=new ia((t.x+e.x)/2,(t.y+e.y)/2),i=n.angleBetween(ia.create(t).rotate(90,n),a);i>1&&(r.rotate(180-i,n),o.rotate(180-i,n),a.rotate(180-i,n))}const l=`\n     M ${t.x} ${t.y}\n     Q ${r.x} ${r.y} ${a.x} ${a.y}\n     Q ${o.x} ${o.y} ${e.x} ${e.y}\n  `;return i.raw?Sa.parse(l):l},rounded:function(t,e,n,i={}){const s=new Sa;s.appendSegment(Sa.createSegment("M",t));const r=1/3,o=2/3,a=i.radius||10;let l,h;for(let i=0,c=n.length;i<c;i+=1){const c=ia.create(n[i]),u=n[i-1]||t,d=n[i+1]||e;l=h||c.distance(u)/2,h=c.distance(d)/2;const g=-Math.min(a,l),p=-Math.min(a,h),f=c.clone().move(u,g).round(),m=c.clone().move(d,p).round(),y=new ia(r*f.x+o*c.x,o*c.y+r*f.y),b=new ia(r*m.x+o*c.x,o*c.y+r*m.y);s.appendSegment(Sa.createSegment("L",f)),s.appendSegment(Sa.createSegment("C",y,b,m))}return s.appendSegment(Sa.createSegment("L",e)),i.raw?s:s.serialize()},smooth:function(t,e,n,i={}){let s,r=i.direction;if(n&&0!==n.length){const i=[t,...n,e],r=la.throughPoints(i);s=new Sa(r)}else if(s=new Sa,s.appendSegment(Sa.createSegment("M",t)),r||(r=Math.abs(t.x-e.x)>=Math.abs(t.y-e.y)?"H":"V"),"H"===r){const n=(t.x+e.x)/2;s.appendSegment(Sa.createSegment("C",n,t.y,n,e.y,e.x,e.y))}else{const n=(t.y+e.y)/2;s.appendSegment(Sa.createSegment("C",t.x,n,e.x,n,e.x,e.y))}return i.raw?s:s.serialize()},jumpover:function(t,e,n,i={}){Ad=[],Md=[],function(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)}}(this);const s=i.size||5,r=i.type||"arc",o=i.radius||0,a=i.ignoreConnectors||["smooth"],l=this.graph,h=l.model.getEdges();if(1===h.length)return Ed(xd(t,e,n),s,r,o);const c=this.cell,u=h.indexOf(c),d=l.options.connecting.connector||{},g=h.filter(((t,e)=>{const n=t.getConnector()||d;return!a.includes(n.name)&&(!(e>u)||"jumpover"!==n.name)})),p=g.map((t=>l.renderer.findViewByCell(t))),f=xd(t,e,n),m=p.map((t=>null==t?[]:t===this?f:xd(t.sourcePoint,t.targetPoint,t.routePoints))),y=[];f.forEach((t=>{const e=g.reduce(((e,n,i)=>{if(n!==c){const n=function(t,e){const n=[];return e.forEach((e=>{const i=t.intersectsWithLine(e);i&&n.push(i)})),n}(t,m[i]);e.push(...n)}return e}),[]).sort(((e,n)=>wd(t.start,e)-wd(t.start,n)));e.length>0?y.push(...function(t,e,n){return e.reduce(((i,s,r)=>{if(Md.includes(s))return i;const o=i.pop()||t,a=ia.create(s).move(o.start,-n);let l=ia.create(s).move(o.start,+n);const h=e[r+1];if(null!=h){const t=l.distance(h);t<=n&&(l=h.move(o.start,t),Md.push(h))}else if(a.distance(o.end)<2*n+1)return i.push(o),i;if(l.distance(o.start)<2*n+1)return i.push(o),i;const c=new ra(a,l);return Ad.push(c),i.push(new ra(o.start,a),c,new ra(l,o.end)),i}),[])}(t,e,s)):y.push(t)}));const b=Ed(y,s,r,o);return Ad=[],Md=[],i.raw?b:b.serialize()}});!function(t){t.presets=Od,t.registry=gl.create({type:"connector"}),t.registry.register(t.presets,!0)}(Sd||(Sd={}));const kd=gl.create;class Pd{constructor(t){this.cell=t,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(t,e,n={},i="/"){const s=this.cell.getPropByPath(t),r=As(n,Pd.defaultOptions),o=this.getTiming(r.timing),a=this.getInterp(r.interp,s,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);let e=(t-l)/r.duration;e<1?this.ids[h]=qo(u):e=1;const i=a(o(e));this.cell.setPropByPath(c,i),n.progress&&n.progress(Object.assign({progress:e,currentValue:i},this.getArgs(h))),1===e&&(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:s,targetValue:e,options:r},this.ids[h]=qo(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=>Ys(i,t.split(n).slice(0,i.length)))).forEach((t=>{Wo(this.ids[t]);const n=this.cache[t],i=this.getArgs(t),s=Object.assign(Object.assign({},n.options),e),r=s.jumpedToEnd;r&&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)),s.complete&&s.complete(Object.assign({},i)));const o=Object.assign({jumpedToEnd:r},i);this.cell.notify("transition:stop",Object.assign({},o)),s.stop&&s.stop(Object.assign({},o)),this.cell.notify("transition:finish",Object.assign({},i)),s.finish&&s.finish(Object.assign({},i)),this.clean(t)})),this}clean(t){delete this.ids[t],delete this.cache[t]}getTiming(t){return"string"==typeof t?Nc[t]:t}getInterp(t,e,n){return t?t(e,n):"number"==typeof n?jc.number(e,n):"string"==typeof n?"#"===n[0]?jc.color(e,n):jc.unit(e,n):jc.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"}}(Pd||(Pd={}));var Td=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class Dd extends Pc{constructor(t={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(_i(t)),this.changed={}}mutate(t,e={}){const n=!0===e.unset,i=!0===e.silent,s=[],r=this.changing;this.changing=!0,r||(this.previous=_i(this.data),this.changed={});const o=this.data,a=this.previous,l=this.changed;if(Object.keys(t).forEach((e=>{const i=e,r=t[i];Ys(o[i],r)||s.push(i),Ys(a[i],r)?delete l[i]:l[i]=r,n?delete o[i]:o[i]=r})),!i&&s.length>0&&(this.pending=!0,this.pendingOptions=e,s.forEach((t=>{this.emit("change:*",{key:t,options:e,store:this,current:o[t],previous:a[t]})}))),r)return this;if(!i)for(;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 s;if("string"==typeof t)i[t]=n,s=e;else if(Array.isArray(t))t.forEach((t=>i[t]=n)),s=e;else{for(const t in this.data)i[t]=n;s=t}return this.mutate(i,Object.assign(Object.assign({},s),{unset:!0})),this}getByPath(t){return Br(this.data,t,"/")}setByPath(t,e,n={}){const i="/",s=Array.isArray(t)?[...t]:t.split(i),r=Array.isArray(t)?t.join(i):t,o=s[0],a=s.length;if(n.propertyPath=r,n.propertyValue=e,n.propertyPathArray=s,1===a)this.set(o,e,n);else{const r={};let l=r,h=o;for(let t=1;t<a;t+=1){const e=s[t],n=Number.isFinite(Number(e));l=l[h]=n?[]:{},h=e}$r(r,s,e,i);const c=_i(this.data);n.rewrite&&Rr(c,t,i);const u=Qs(c,r);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),s=_i(this.get(i));s&&Rr(s,t),this.set(i,s,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()?_i(this.changed):null;const e=this.changing?this.previous:this.data,n={};let i;for(const s in t){const r=t[s];Ys(e[s],r)||(n[s]=r,i=!0)}return i?_i(n):null}toJSON(){return _i(this.data)}clone(){return new(0,this.constructor)(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})}}Td([Pc.dispose()],Dd.prototype,"dispose",null);var Nd,jd=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o},Ld=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Fd extends Pc{constructor(t={}){super();const e=this.constructor.getDefaults(!0),n=Qs({},this.preprocess(e),this.preprocess(t));this.id=n.id||Hr(),this.store=new Dd(n),this.animation=new Pd(this),this.setup(),this.init(),this.postprocess(t)}static config(t){const{markup:e,propHooks:n,attrHooks:i}=t,s=Ld(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=Qs({},this.defaults,s)}static getMarkup(){return this.markup}static getDefaults(t){return t?this.defaults:_i(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(t,e){return this.propHooks.reduce(((e,n)=>n?Kr(n,t,e):e),e)}get[Symbol.toStringTag](){return Fd.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.applyPropHooks(this,t);return null==n&&!0!==e&&(i.id=Hr()),i}postprocess(t){}setup(){this.store.on("change:*",(t=>{const{key:e,current:n,previous:i,options:s}=t;this.notify("change:*",{key:e,options:s,current:n,previous:i,cell:this}),this.notify(`change:${e}`,{options:s,current:n,previous:i,cell:this});const r=e;"source"!==r&&"target"!==r||this.notify("change:terminal",{type:r,current:n,previous:i,options:s,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(Qs({},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 s=e.total();let r=e.indexOf(this)!==s-n.length;r||(r=n.some(((t,e)=>t.getZIndex()!==i+e))),r&&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 s=0!==e.indexOf(this);s||(s=n.some(((t,e)=>t.getZIndex()!==i+e))),s&&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){t=this.constructor.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(Qs({},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.getAttrHooks()||{};let n=e[t]||zh.registry.get(t);if(!n){const i=qn(t);n=e[i]||zh.registry.get(i)}return n||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?e:t;return("boolean"==typeof t?t:!this.isVisible())?this.show(n):this.hide(n),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(Qs({},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();for(;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()||[];for(;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();for(;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 Fd.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 Fd.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(),s=this!==i;let r=e;if(null==r&&(r=this.getChildCount(),s||(r-=1)),i){const e=i.getChildren();if(e){const s=e.indexOf(t);s>=0&&(t.setParent(null,n),e.splice(s,1),i.setChildren(e,n))}}let o=this.children;if(null==o?(o=[],o.push(t)):o.splice(r,0,t),t.setParent(this,n),this.setChildren(o,n),s&&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);return null!=this.children&&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],s="string"==typeof e?e:null,r="object"==typeof e?e:"object"==typeof n?n:{};if(r.reset)return this.setTools({name:s,items:i,local:r.local},r);let o=_i(this.getTools());return null==o||null==s||o.name===s?(null==o&&(o={}),o.items||(o.items=[]),o.name=s,o.items=[...o.items,...i],this.setTools(Object.assign({},o),r)):void 0}setTools(t,e={}){return null==t?this.removeTools():this.store.set("tools",Fd.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=_i(this.getTools());if(n){let i=!1;const s=n.items.slice(),r=t=>{s.splice(t,1),i=!0};if("number"==typeof t)r(t);else for(let e=s.length-1;e>=0;e-=1){const n=s[e];("string"==typeof n?n===t:n.name===t)&&r(e)}i&&(n.items=s,this.setTools(n,e))}return this}getBBox(t){return new sa}getConnectionPoint(t,e){return new ia}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 s=this.constructor,r=!0===t.diff,o=e.attrs||{},a=s.getDefaults(!0),l=r?this.preprocess(a,!0):a,h=l.attrs||{},c={};Object.keys(e).forEach((t=>{const s=e[t];if(null!=s&&!Array.isArray(s)&&"object"==typeof s&&!Ye(s))throw new Error(`Can only serialize ${i} with plain-object props, but got a "${n.call(s)}" type of key "${t}" on ${i} "${this.id}"`);if("attrs"!==t&&"shape"!==t&&r){Ys(s,l[t])&&delete e[t]}})),Object.keys(o).forEach((t=>{const e=o[t],n=h[t];Object.keys(e).forEach((i=>{const s=e[i],r=n?n[i]:null;null==s||"object"!=typeof s||Array.isArray(s)?null!=n&&Ys(r,s)||(null==c[t]&&(c[t]={}),c[t][i]=s):Object.keys(s).forEach((e=>{const o=s[e];if(null==n||null==r||!W(r)||!Ys(r[e],o)){null==c[t]&&(c[t]={}),null==c[t][i]&&(c[t][i]={});c[t][i][e]=o}}))}))}));const u=Object.assign(Object.assign({},e),{attrs:Xs(c)?void 0:c});null==u.attrs&&delete u.attrs;const d=u;return 0===d.angle&&delete d.angle,_i(d)}clone(t={}){if(!t.deep){const e=Object.assign({},this.store.get());t.keepId||delete e.id,delete e.parent,delete e.children;return new(0,this.constructor)(e)}return Fd.deepClone(this)[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 s=e();return this.stopBatch(t,n,i),s}dispose(){this.removeFromParent(),this.store.dispose()}}Fd.defaults={},Fd.attrHooks={},Fd.propHooks=[],jd([Pc.dispose()],Fd.prototype,"dispose",null),function(t){t.normalizeTools=function(t){return"string"==typeof t?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}}(Fd||(Fd={})),function(t){t.toStringTag=`X6.${t.name}`,t.isCell=function(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}}(Fd||(Fd={})),function(t){t.getCommonAncestor=function(...t){const e=t.filter((t=>null!=t)).map((t=>t.getAncestors())).sort(((t,e)=>t.length-e.length));return e.shift().find((t=>e.every((e=>e.includes(t)))))||null},t.getCellsBBox=function(t,e={}){let n=null;for(let i=0,s=t.length;i<s;i+=1){const s=t[i];let r=s.getBBox(e);if(r){if(s.isNode()){const t=s.getAngle();null!=t&&0!==t&&(r=r.bbox(t))}n=null==n?r:n.union(r)}}return n},t.deepClone=function(e){const n=[e,...e.getDescendants({deep:!0})];return t.cloneCells(n)},t.cloneCells=function(t){const e=Tr(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 s=t.getChildren();if(s&&s.length){const t=s.reduce(((t,e)=>(n[e.id]&&t.push(n[e.id]),t)),[]);t.length>0&&e.setChildren(t)}})),n}}(Fd||(Fd={})),function(t){t.config({propHooks(e){var{tools:n}=e,i=Ld(e,["tools"]);return n&&(i.tools=t.normalizeTools(n)),i}})}(Fd||(Fd={})),function(t){let e,n;t.exist=function(t,i){return i?null!=e&&e.exist(t):null!=n&&n.exist(t)},t.setEdgeRegistry=function(t){e=t},t.setNodeRegistry=function(t){n=t}}(Nd||(Nd={}));class zd{constructor(t){this.ports=[],this.groups={},this.init(_i(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,s=i?i.position:null,r=s?s.name:null;let o;if(null!=r){const t=fc.registry.get(r);if(null==t)return fc.registry.onNotFound(r);o=t}else o=fc.presets.left;const a=n.map((t=>t&&t.position&&t.position.args||{})),l=s&&s.args||{};return o(a,e,l).map(((t,i)=>{const s=n[i];return{portLayout:t,portId:s.id,portSize:s.size,portAttrs:s.attrs,labelSize:s.label.size,labelLayout:this.getPortLabelLayout(s,ia.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=Qs({},n.attrs,e.attrs),e.position=this.createPosition(n,e),e.label=Qs({},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 Qs({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",s=t.label.position.args||{},r=Ec.registry.get(i)||Ec.presets.left;return r?r(e,n,s):null}}var Bd=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class $d extends Fd{constructor(t={}){super(t),this.initPorts()}get[Symbol.toStringTag](){return $d.toStringTag}preprocess(t,e){const{x:n,y:i,width:s,height:r}=t,o=Bd(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!=s||null!=r){const t=o.size;o.size=Object.assign(Object.assign({},t),{width:null!=s?s:t?t.width:0,height:null!=r?r: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 s=this.getSize();switch(i){case"left":case"right":e=s.height;break;case"top":case"bottom":t=s.width}let r={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3}[i];const o=Yo.normalize(this.getAngle()||0);n.absolute&&(r+=Math.floor((o+45)/90),r%=4);const a=this.getBBox();let l;l=0===r?a.getBottomLeft():1===r?a.getCorner():2===r?a.getTopRight():a.getOrigin();const h=l.clone().rotate(-o,a.getCenter()),c=Math.sqrt(t*t+e*e)/2;let u=r*Math.PI/2;u+=Math.atan(r%2==0?e/t:t/e),u-=Yo.toRad(o);const d=ia.fromPolar(c,u,h).clone().translate(t/-2,e/-2);this.store.set("size",{width:t,height:e},n),this.setPosition(d.x,d.y,n)}else this.store.set("size",{width:t,height:e},n);return this.stopBatch("resize",n),this}scale(t,e,n,i={}){const s=this.getBBox().scale(t,e,null==n?void 0:n);return this.startBatch("scale",i),this.setPosition(s.x,s.y,i),this.resize(s.width,s.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,s,r;if("object"==typeof t?(i=t.x,s=t.y,r=e||{}):(i=t,s=e,r=n||{}),r.relative){const t=this.getParent();if(null!=t&&t.isNode()){const e=t.getPosition();i+=e.x,s+=e.y}}if(r.deep){const t=this.getPosition();this.translate(i-t.x,s-t.y,r)}else this.store.set("position",{x:i,y:s},r);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 s=this.getBBox({deep:!0}),r=n.restrict,o=i.x-s.x,a=i.y-s.y,l=Math.max(r.x+o,Math.min(r.x+r.width+o-s.width,i.x+t)),h=Math.max(r.y+a,Math.min(r.y+r.height+a-s.height,i.y+e));t=l-i.x,e=h-i.y}const s={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",s,Object.assign(Object.assign({},n.transition),{interp:jc.object})),this.eachChild((i=>{var s;(null===(s=n.exclude)||void 0===s?void 0:s.includes(i))||i.translate(t,e,n)}))):(this.startBatch("translate",n),this.store.set("position",s,n),this.eachChild((i=>{var s;(null===(s=n.exclude)||void 0===s?void 0:s.includes(i))||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(),s=this.getPosition(),r=this.getBBox().getCenter();r.rotate(n-t,e.center);const o=r.x-i.width/2-s.x,a=r.y-i.height/2-s.y;this.startBatch("rotate",{angle:t,options:e}),this.setPosition(s.x+o,s.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),Fd.getCellsBBox(t)}return sa.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(t,e){const n=this.getBBox(),i=n.getCenter(),s=t.getTerminal(e);if(null==s)return i;const r=s.port;if(!r||!this.hasPort(r))return i;const o=this.getPort(r);if(!o||!o.group)return i;const a=this.getPortsPosition(o.group)[r].position,l=ia.create(a).translate(n.getOrigin()),h=this.getAngle();return h&&l.rotate(-h,i),l}fit(t={}){const e=(this.getChildren()||[]).filter((t=>t.isNode()));if(0===e.length)return this;this.startBatch("fit-embeds",t),t.deep&&e.forEach((e=>e.fit(t)));let{x:n,y:i,width:s,height:r}=Fd.getCellsBBox(e);const o=Jr(t.padding);return n-=o.left,i-=o.top,s+=o.left+o.right,r+=o.bottom+o.top,this.store.set({position:{x:n,y:i},size:{width:s,height:r}},t),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(t){this.setPortContainerMarkup(t)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||Uc.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(t,e={}){return this.store.set("portContainerMarkup",Uc.clone(t),e),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(t){this.setPortMarkup(t)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||Uc.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(t,e={}){return this.store.set("portMarkup",Uc.clone(t),e),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(t){this.setPortLabelMarkup(t)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||Uc.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(t,e={}){return this.store.set("portLabelMarkup",Uc.clone(t),e),this}get ports(){const t=this.store.get("ports",{items:[]});return null==t.items&&(t.items=[]),t}getPorts(){return _i(this.ports.items)}getPortsByGroup(t){return this.getPorts().filter((e=>e.group===t))}getPort(t){return _i(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();return this.port.getPortsLayoutByGroup(t,new sa(0,0,e.width,e.height)).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 s=this.prefixPortPath(t,e),r=n;return this.setPropByPath(s,r,i)}const s=this.prefixPortPath(t),r=e;return this.setPropByPath(s,r,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].filter((e=>!t.some((t=>{const n="string"==typeof t?t:t.id;return e.id===n}))));this.setPropByPath("ports/items",e,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={};(this.store.getPrevious("ports")||{items:[]}).items.forEach((t=>{t.id&&!e[t.id]&&(n[t.id]=!0)}));const i=this.model;if(i&&!Xs(n)){i.getConnectedEdges(this,{incoming:!0}).forEach((t=>{const e=t.getTargetPortId();e&&n[e]&&t.remove()}));i.getConnectedEdges(this,{outgoing:!0}).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 Hr()}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 zd(this.ports);const n=this.port.getPorts(),i=e?n.filter((t=>e.find((e=>e.id===t.id))?null:t)):[...n],s=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}),s.length>0&&this.notify("ports:removed",{removed:s,cell:this,node:this})}}$d.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(t){t.toStringTag=`X6.${t.name}`,t.isNode=function(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}}($d||($d={})),function(t){t.config({propHooks(t){var{ports:e}=t,n=Bd(t,["ports"]);return e&&(n.ports=Array.isArray(e)?{items:e}:e),n}})}($d||($d={})),function(t){t.registry=gl.create({type:"node",process(e,n){if(Nd.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:s}=n,r=Bd(n,["inherit"]);if(s)if("string"==typeof s){const t=this.get(s);null==t?this.onNotFound(s,"inherited"):i=t}else i=s;null==r.constructorName&&(r.constructorName=e);const o=i.define.call(i,r);return o.config({shape:e}),o}}),Nd.setNodeRegistry(t.registry)}($d||($d={})),function(t){let e=0;t.define=function(n){const{constructorName:i,overwrite:s}=n,r=Bd(n,["constructorName","overwrite"]),o=Fr((a=i||r.shape)?_r(a):(e+=1,`CustomNode${e}`),this);var a;return o.config(r),r.shape&&t.registry.register(r.shape,o,s),o},t.create=function(e){const n=e.shape||"rect",i=t.registry.get(n);return i?new i(e):t.registry.onNotFound(n)}}($d||($d={}));var Rd=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Id extends $d{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=Rd(t,["label"]);return e&&$r(n,"attrs/text/text",e),n},visible:!0})}(Id||(Id={}));var Vd=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};function _d(t){return`basic.${t}`}function Gd(t="xlink:href"){return e=>{const{imageUrl:n,imageWidth:i,imageHeight:s}=e,r=Vd(e,["imageUrl","imageWidth","imageHeight"]);if(null!=n||null!=i||null!=s){const e=()=>{if(r.attrs){const e=r.attrs.image;null!=n&&(e[t]=n),null!=i&&(e.width=i),null!=s&&(e.height=s),r.attrs.image=e}};r.attrs?(null==r.attrs.image&&(r.attrs.image={}),e()):(r.attrs={image:{}},e())}return r}}function Hd(t,e,n={}){const i=_d(t),s={constructorName:i,attrs:{".":{fill:"#ffffff",stroke:"none"},[t]:{fill:"#ffffff",stroke:"#000000"}}};n.ignoreMarkup||(s.markup=function(t,e=!1){return`<g class="rotatable"><g class="scalable"><${t}/></g>${e?"":"<text/>"}</g>`}(t,!0===n.noText));return(n.parent||Id).define(Qs(s,e,{shape:i}))}Hd("rect",{attrs:{rect:{width:100,height:60}}}),Hd("circle",{width:60,height:60,attrs:{circle:{r:30,cx:30,cy:30}}}),Hd("ellipse",{width:60,height:40,attrs:{ellipse:{rx:30,ry:20,cx:30,cy:20}}}),Hd("polygon",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),Hd("polyline",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),Hd("image",{attrs:{text:{refY:null,refDy:16}},propHooks:Gd()});var Ud=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};const qd=Hd("path",{width:60,height:60,attrs:{text:{ref:"path",refY:null,refDy:16}},propHooks(t){const{d:e}=t,n=Ud(t,["d"]);return null!=e&&$r(n,"attrs/path/d",e),n}});Hd("rhombus",{d:"M 30 0 L 60 30 30 60 0 30 z",attrs:{text:{refY:.5,refDy:null}}},{parent:qd,ignoreMarkup:!0}),Hd("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:qd,ignoreMarkup:!0});var Wd=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Xd extends Fd{constructor(t={}){super(t)}get[Symbol.toStringTag](){return Xd.toStringTag}preprocess(t,e){const{source:n,sourceCell:i,sourcePort:s,sourcePoint:r,target:o,targetCell:a,targetPort:l,targetPoint:h}=t,c=Wd(t,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),u=t=>"string"==typeof t||"number"==typeof t;if(null!=n)if(Fd.isCell(n))c.source={cell:n.id};else if(u(n))c.source={cell:n};else if(ia.isPoint(n))c.source=n.toJSON();else if(Array.isArray(n))c.source={x:n[0],y:n[1]};else{const t=n.cell;Fd.isCell(t)?c.source=Object.assign(Object.assign({},n),{cell:t.id}):c.source=n}if(null!=i||null!=s){let t=c.source;if(null!=i){const e=u(i)?i:i.id;t?t.cell=e:t=c.source={cell:e}}null!=s&&t&&(t.port=s)}else null!=r&&(c.source=ia.create(r).toJSON());if(null!=o)if(Fd.isCell(o))c.target={cell:o.id};else if(u(o))c.target={cell:o};else if(ia.isPoint(o))c.target=o.toJSON();else if(Array.isArray(o))c.target={x:o[0],y:o[1]};else{const t=o.cell;Fd.isCell(t)?c.target=Object.assign(Object.assign({},o),{cell:t.id}):c.target=o}if(null!=a||null!=l){let t=c.target;if(null!=a){const e=u(a)?a:a.id;t?t.cell=e:t=c.target={cell:e}}null!=l&&t&&(t.port=l)}else null!=h&&(c.target=ia.create(h).toJSON());return super.preprocess(c,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(Fd.isCell(e))return this.store.set(t,Qs({},n,{cell:e.id}),i),this;const s=e;return ia.isPoint(e)||null!=s.x&&null!=s.y?(this.store.set(t,Qs({},n,{x:s.x,y:s.y}),i),this):(this.store.set(t,_i(e),i),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(t){const e=this[t];if(ia.isPointLike(e))return ia.create(e);const n=this.getTerminalCell(t);return n?n.getConnectionPoint(this,t):new ia}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={};for(;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;return _i(this.store.get("defaultLabel")||t.defaultLabel||{})}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(),s=i.length;let r=null!=e&&Number.isFinite(e)?e:s;return r<0&&(r=s+r+1),i.splice(r,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,s=n.splice(i,1);return this.setLabels(n,e),s.length?s[0]:null}parseLabel(t){if("string"==typeof t){return this.constructor.parseStringLabel(t)}return t}onLabelsChanged({previous:t,current:e}){const n=t&&e?e.filter((e=>t.find((t=>e===t||Ys(e,t)))?null:e)):e?[...e]:[],i=t&&e?t.filter((t=>e.find((e=>t===e||Ys(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")||Uc.getEdgeVertexMarkup()}getVertexMarkup(){return this.store.get("vertexMarkup")||this.getDefaultVertexMarkup()}setVertexMarkup(t,e={}){return this.store.set("vertexMarkup",Uc.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=>ia.toJSON(t))),e),this}insertVertex(t,e,n={}){const i=this.getVertices(),s=i.length;let r=null!=e&&Number.isFinite(e)?e:s;return r<0&&(r=s+r+1),i.splice(r,0,ia.toJSON(t)),this.setVertices(i,n)}appendVertex(t,e={}){return this.insertVertex(t,-1,e)}getVertexAt(t){if(null!=t&&Number.isFinite(t)){return this.getVertices()[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=>ia.equals(e,t)))?null:e)):e?[...e]:[],i=t&&e?t.filter((t=>e.find((e=>ia.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")||Uc.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}get toolMarkup(){return this.getToolMarkup()}set toolMarkup(t){this.setToolMarkup(t)}getDefaultToolMarkup(){return this.store.get("defaultToolMarkup")||Uc.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")||Uc.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=>ia.create(i).scale(t,e,n).toJSON()),i)}applyToPoints(t,e={}){const n={},i=this.getSource(),s=this.getTarget();ia.isPointLike(i)&&(n.source=t(i)),ia.isPointLike(s)&&(n.target=t(s));const r=this.getVertices();return r.length>0&&(n.vertices=r.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=>ia.create(t))),this.getTargetPoint()];return new aa(t)}updateParent(t){let e=null;const n=this.getSourceCell(),i=this.getTargetCell(),s=this.getParent();return n&&i&&(e=n===i||n.isDescendantOf(i)?i:i.isDescendantOf(n)?n:Fd.getCommonAncestor(n,i)),!s||e&&e.id===s.id||s.unembed(this,t),e&&e.embed(this,t),e}hasLoop(t={}){const e=this.getSource(),n=this.getTarget(),i=e.cell,s=n.cell;if(!i||!s)return!1;let r=i===s;if(!r&&t.deep&&this._model){const e=this.getSourceCell(),n=this.getTargetCell();e&&n&&(r=e.isAncestorOf(n,t)||n.isAncestorOf(e,t))}return r}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))}}Xd.defaults={},function(t){t.equalTerminals=function(t,e){const n=t,i=e;return n.cell===i.cell&&(n.port===i.port||null==n.port&&null==i.port)}}(Xd||(Xd={})),function(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=function(t){return{attrs:{label:{text:t}}}}}(Xd||(Xd={})),function(t){t.toStringTag=`X6.${t.name}`,t.isEdge=function(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}}(Xd||(Xd={})),function(t){t.registry=gl.create({type:"edge",process(e,n){if(Nd.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:s="edge"}=n,r=Wd(n,["inherit"]);if("string"==typeof s){const t=this.get(s||"edge");null==t&&s?this.onNotFound(s,"inherited"):i=t}else i=s;null==r.constructorName&&(r.constructorName=e);const o=i.define.call(i,r);return o.config({shape:e}),o}}),Nd.setEdgeRegistry(t.registry)}(Xd||(Xd={})),function(t){let e=0;t.define=function(n){const{constructorName:i,overwrite:s}=n,r=Wd(n,["constructorName","overwrite"]),o=Fr((a=i||r.shape)?_r(a):(e+=1,`CustomEdge${e}`),this);var a;return o.config(r),r.shape&&t.registry.register(r.shape,o,s),o},t.create=function(e){const n=e.shape||"edge",i=t.registry.get(n);return i?new i(e):t.registry.onNotFound(n)}}(Xd||(Xd={})),function(t){const e="basic.edge";t.config({shape:e,propHooks(e){const{label:n,vertices:i}=e,s=Wd(e,["label","vertices"]);if(n){null==s.labels&&(s.labels=[]);const e="string"==typeof n?t.parseStringLabel(n):n;s.labels.push(e)}return i&&Array.isArray(i)&&(s.vertices=i.map((t=>ia.create(t).toJSON()))),s}}),t.registry.register(e,t)}(Xd||(Xd={}));var Yd=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Jd extends Zc{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.markerCache={}}get[Symbol.toStringTag](){return Jd.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const t=this.sourceView;if(!t){const t=this.cell.getSource();return new sa(t.x,t.y)}const e=this.sourceMagnet;return t.isEdgeElement(e)?new sa(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 sa(t.x,t.y)}const e=this.targetMagnet;return t.isEdgeElement(e)?new sa(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,s=this.sourceView,r=this.targetView;return i&&(s&&!i.renderer.isViewMounted(s)||r&&!i.renderer.isViewMounted(r))?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){if(e[n[1]]){if(2===i)return"object"==typeof t.propertyValue&&qs(t.propertyValue,"markup");if("markup"!==n[2])return!1}}}return!0}render(){return this.empty(),this.containers={},this.renderMarkup(),this.renderLabels(),this.update(),this.renderExternalTools(),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=Oa.createVectors(t);n.forEach((t=>{const n=t.attr("class");n&&(e[qn(n)]=t.node)})),this.renderTools(),this.renderVertexMarkers(),this.renderArrowheadMarkers(),So(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=mo("g"),this.addClass(this.prefixClassName("edge-labels"),i),this.containers.labels=i);for(let n=0,s=e.length;n<s;n+=1){const s=e[n],r=this.normalizeLabelMarkup(this.parseLabelMarkup(s.markup));let o,a;if(r)o=r.node,a=r.selectors;else{const e=t.getDefaultLabel(),n=this.normalizeLabelMarkup(this.parseLabelMarkup(e.markup));o=n.node,a=n.selectors}o.setAttribute("data-index",`${n}`),i.appendChild(o);const l=this.rootSelector;if(a[l])throw new Error("Ambiguous label root selector.");a[l]=o,this.labelCache[n]=o,this.labelSelectors[n]=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=Oa.createVectors(t),n=document.createDocumentFragment();for(let t=0,i=e.length;t<i;t+=1){const i=e[t].node;n.appendChild(i)}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()?Oa.create("g").append(e):Oa.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 t=0,s=e.length;t<s;t+=1){const s=this.labelCache[t],r=this.labelSelectors[t];s.setAttribute("cursor",n?"move":"default");const o=e[t],a=Qs({},i.attrs,o.attrs);this.updateAttrs(s,a,{selectors:r,rootBBox:o.size?sa.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:Qs({},n)}return t?Qs({},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],s=this.labelCache[n],r=this.labelSelectors[n];this.graph.hook.onEdgeLabelRendered({edge:t,label:i,container:s,selectors:r})}}}renderTools(){const t=this.containers.tools;if(null==t)return this;const e=this.cell.toolMarkup,n=this.$(t).empty();if(Uc.isStringMarkup(e)){let t=Sr(e);const i=Oa.create(t());if(n.append(i.node),this.toolCache=i.node,this.options.doubleTools){let e;const s=this.cell.doubleToolMarkup;Uc.isStringMarkup(s)?(t=Sr(s),e=Oa.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(Uc.isStringMarkup(e)){const t=Sr(e);this.cell.getVertices().forEach(((e,i)=>{n.append(Oa.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(Uc.isStringMarkup(e)){const t=Sr(e),i=Oa.create(t({end:"source"})).node,s=Oa.create(t({end:"target"})).node;this.containers.sourceArrowhead=i,this.containers.targetArrowhead=s,n.append(i,s)}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(),this.updateTools(e),this}removeRedundantLinearVertices(t={}){const e=this.cell,n=e.getVertices(),i=[this.sourceAnchor,...n,this.targetAnchor],s=i.length,r=new aa(i);r.simplify({threshold:.01});const o=r.points.map((t=>t.toJSON())),a=o.length;return s===a?0:(e.setVertices(o.slice(1,a-1),t),s-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 ia.create(this.sourceAnchor);case"target":return ia.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalConnectionPoint(t){switch(t){case"source":return ia.create(this.sourcePoint);case"target":return ia.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 aa(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 s=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,s.source||this.sourcePoint,s.target||this.targetPoint)}this.cleanCache()}findAnchors(t){const e=this.cell,n=e.source,i=e.target,s=t[0],r=t[t.length-1];return i.priority&&!n.priority?this.findAnchorsOrdered("target",r,"source",s):this.findAnchorsOrdered("source",s,"target",r)}findAnchorsOrdered(t,e,n,i){let s,r;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?ia.create(e):c?d:ia.create(l),s=this.getAnchor(a.anchor,h,u,n,t)}else s=ia.create(a);if(c){const t=ia.create(i||s);r=this.getAnchor(l.anchor,c,d,t,n)}else r=ia.isPointLike(l)?ia.create(l):new ia;return{[t]:s,[n]:r}}getAnchor(t,e,n,i,s){const r=e.isEdgeElement(n),o=this.graph.options.connecting;let a,l="string"==typeof t?{name:t}:t;if(!l){const t=r?("source"===s?o.sourceEdgeAnchor:o.targetEdgeAnchor)||o.edgeAnchor:("source"===s?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(r){const t=zu.registry.get(h);if("function"!=typeof t)return zu.registry.onNotFound(h);a=Kr(t,this,e,n,i,l.args||{},s)}else{const t=Du.registry.get(h);if("function"!=typeof t)return Du.registry.onNotFound(h);a=Kr(t,this,e,n,i,l.args||{},s)}return a?a.round(this.POINT_ROUNDING):new ia}findRoutePoints(t=[]){const e=this.graph.options.connecting.router||yd.presets.normal,n=this.cell.getRouter()||e;let i;if("function"==typeof n)i=Kr(n,this,t,{},this);else{const e="string"==typeof n?n:n.name,s="string"==typeof n?{}:n.args||{},r=e?yd.registry.get(e):yd.presets.normal;if("function"!=typeof r)return yd.registry.onNotFound(e);i=Kr(r,this,t,s,this)}return null==i?t.map((t=>ia.create(t))):i.map((t=>ia.create(t)))}findConnectionPoints(t,e,n){const i=this.cell,s=this.graph.options.connecting,r=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=new ra(h||n,e),o=r.connectionPoint||s.sourceConnectionPoint||s.connectionPoint;u=this.getConnectionPoint(o,a,t,i,"source")}else u=e;if(l&&!l.isEdgeElement(this.targetMagnet)){const t=this.targetMagnet||l.container,i=o.connectionPoint||s.targetConnectionPoint||s.connectionPoint,r=new ra(c||e,n);d=this.getConnectionPoint(i,l,t,r,"target")}else d=n;return{source:u,target:d}}getConnectionPoint(t,e,n,i,s){const r=i.end;if(null==t)return r;const o="string"==typeof t?t:t.name,a="string"==typeof t?{}:t.args,l=Vu.registry.get(o);if("function"!=typeof l)return Vu.registry.onNotFound(o);const h=Kr(l,this,i,e,n,a||{},s);return h?h.round(this.POINT_ROUNDING):r}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,s=n.length;i<s;i+=1){const s=e[n[i]];if(s[`${t}Marker`]||s[`${t}-marker`]){const t=s.strokeWidth||s["stroke-width"];if(t)return parseFloat(t);break}}return null},s=t[0],r=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||Ka(o),l.sourceBBox.width>0){const t=ol(o);h=e.clone().move(s||n,l.sourceBBox.width*t.sx*-1)}}else{const t=i("source");t&&(h=e.clone().move(s||n,-t))}if(a){if(this.updateMarkerAttr("target"),l.targetBBox=l.targetBBox||Ka(a),l.targetBBox.width>0){const t=ol(a);c=n.clone().move(r||e,l.targetBBox.width*t.sx*-1)}}else{const t=i("target");t&&(c=n.clone().move(r||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 s,r,o;if("string"==typeof i?s=i:(s=i.name,r=i.args),s){const t=Sd.registry.get(s);if("function"!=typeof t)return Sd.registry.onNotFound(s);o=t}else o=Sd.presets.normal;const a=Kr(o,this,e,n,t,Object.assign(Object.assign({},r),{raw:!0}),this);return"string"==typeof a?Sa.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;if(!this.path)return this;const t=this.cell,e=t.getLabels();if(0===e.length)return this;const n=t.getDefaultLabel(),i=this.normalizeLabelPosition(n.position);for(let t=0,n=e.length;t<n;t+=1){const n=e[t],s=this.normalizeLabelPosition(n.position),r=Qs({},i,s),o=this.getLabelTransformationMatrix(r);this.labelCache[t].setAttribute("transform",qa(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&&Fo(this.toolCache,"transform",`translate(${i.x},${i.y}) ${t}`),this.options.doubleTools&&n>=this.options.longLength){const s=this.options.doubleToolsOffset||e;i=this.getPointAtLength(n-s),null!=i&&Fo(this.tool2Cache,"transform",`translate(${i.x},${i.y}) ${t}`),Fo(this.tool2Cache,"visibility","visible")}else this.options.doubleTools&&Fo(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)<this.options.shortLength?.5:1;ol(e,t),ol(n,t),this.translateAndAutoOrientArrows(e,n)}return this}updateTerminalProperties(t){const e=this.cell,n=this.graph,i=e[t],s=i&&i.cell,r=`${t}View`;if(!s)return this[r]=null,this.updateTerminalMagnet(t),!0;const o=n.getCellById(s);if(!o)throw new Error(`Edge's ${t} node with id "${s}" not exists`);const a=o.findView(n);return!!a&&(this[r]=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&&al(t,this.sourcePoint,n[0]||this.targetPoint,this.graph.view.stage),e&&al(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:Qs({},e,t)}addLabel(t,e,n,i){let s,r,o,a=0;"number"!=typeof t?(s=t.x,r=t.y,"number"==typeof e?(a=e,o=n):o=e):(s=t,r=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(s,r,a,c)};return this.cell.insertLabel(u,-1,o),-1}addVertex(t,e,n){const i="number"!=typeof t,s=i?t.x:t,r=i?t.y:e,o=i?e:n,a={x:s,y:r},l=this.getVertexIndex(s,r);return this.cell.insertVertex(a,l,o),l}sendToken(t,e,n){let i,s,r,o,a="linear";"object"==typeof e?(i=e.duration,s=!0===e.reversed,r=e.selector,!1===e.rotate?o="":!0===e.rotate?o="auto":null!=e.rotate&&(o=`${e.rotate}`),e.timing&&(a=e.timing)):(i=e,s=!1,r=null),i=i||1e3;const l={dur:`${i}ms`,repeatCount:"1",calcMode:a,fill:"freeze"};if(o&&(l.rotate=o),s&&(l.keyPoints="1;0",l.keyTimes="0;1"),"object"==typeof e){const t=Yd(e,["duration","reversed","selector","rotate","timing"]);Object.keys(t).forEach((e=>{l[e]=t[e]}))}let h;if(h="string"==typeof r?this.findOne(r,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||Ao(c)},g=Oa.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 qs(t,"data")||(t.data=this.path.serialize()),t.data||""}getConnectionSubdivisions(){if(null==this.path)return null;const t=this.cache.pathCache;return qs(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions}getConnectionLength(){if(null==this.path)return 0;const t=this.cache.pathCache;return qs(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:(Wr(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 s={distance:0};let r,o=0;"number"==typeof n?(o=n,r=i):r=n,null!=r&&(s.options=r);const a=r&&r.absoluteOffset,l=!(r&&r.absoluteDistance),h=r&&r.absoluteDistance&&r.reverseDistance,c=this.path,u={segmentSubdivisions:this.getConnectionSubdivisions()},d=new ia(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),s.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 s.offset=m,s.angle=o,s}normalizeLabelPosition(t){return"number"==typeof t?{distance:t}:t}getLabelTransformationMatrix(t){const e=this.normalizeLabelPosition(t),n=e.options||{},i=e.angle||0,s=e.distance,r=s>0&&s<=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=r?s*this.getConnectionLength():s,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=Yo.normalize((y+90)%180-90)))}else m=d.start,h&&m.translate(a);return Ga().translate(m.x,m.y).rotate(y)}getLabelCoordinates(t){const e=this.getLabelTransformationMatrix(t);return new ia(e.e,e.f)}getVertexIndex(t,e){const n=this.cell.getVertices(),i=this.getClosestPointLength(new ia(t,e));let s=0;if(null!=i)for(const t=n.length;s<t;s+=1){const t=n[s],e=this.getClosestPointLength(t);if(null!=e&&i<e)break}return s}getEventArgs(t,e,n){const i=this,s=i.cell;return null==e||null==n?{e:t,view:i,edge:s,cell:s}:{e:t,x:e,y:n,view:i,edge:s,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);switch(t.target.getAttribute("class")){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)}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)}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)}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){if(wo(t.target,"edge-tool",this.container)){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);this.getEventData(t).stopPropagation&&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:Vi(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,s=0;"source"===t?(i=2,n="target"):(s=2,n="source");const r=this.cell[n],o=r.cell;if(o){let t;const n=e[i]=this.graph.renderer.findViewByCell(o);n&&(t=n.getMagnetFromEdgeTerminal(r),t===n.container&&(t=void 0)),e[i+1]=t}return(t,n)=>(e[s]=t,e[s+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);this.container.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,s=t.currentMagnet;if(!s||!i)return;i.unhighlight(s,{type:"magnetAdsorbed"});const r=t.terminalType,o=i.getEdgeTerminal(s,e,n,this.cell,r);this.cell.setTerminal(r,o,{ui:!0})}snapArrowhead(t,e,n){const i=this.graph,{snap:s,allowEdge:r}=i.options.connecting,o="object"==typeof s&&s.radius||50,a={x:t-o,y:e-o,width:2*o,height:2*o},l=i.renderer.findViewsInArea(a);if(r){const t=i.renderer.findEdgeViewsInArea(a).filter((t=>t!==this));l.push(...t)}const h=n.closestView||null,c=n.closestMagnet||null;let u;n.closestView=null,n.closestMagnet=null;let d=Number.MAX_SAFE_INTEGER;const g=new ia(t,e);let p;l.forEach((s=>{"false"!==s.container.getAttribute("magnet")&&(u=s.cell.getBBox().getCenter().distance(g),u<o&&u<d&&(c===s.container||i.hook.validateConnection(...n.getValidateConnectionArgs(s,null),s.getEdgeTerminal(s.container,t,e,this.cell,n.terminalType)))&&(d=u,n.closestView=s,n.closestMagnet=s.container)),s.container.querySelectorAll("[magnet]").forEach((r=>{if("false"!==r.getAttribute("magnet")){const a=s.getBBoxOfElement(r);u=g.distance(a.getCenter()),u<o&&u<d&&(c===r||i.hook.validateConnection(...n.getValidateConnectionArgs(s,r),s.getEdgeTerminal(r,t,e,this.cell,n.terminalType)))&&(d=u,n.closestView=s,n.closestMagnet=r)}}))}));const f=n.terminalType,m=n.closestView,y=n.closestMagnet,b=c!==y;if(h&&b&&h.unhighlight(c,{type:"magnetAdsorbed"}),m){if(!b)return;m.highlight(y,{type:"magnetAdsorbed"}),p=m.getEdgeTerminal(y,t,e,this.cell,f)}else p={x:t,y:e};this.cell.setTerminal(f,p,{},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})}}notifyConnectionEvent(t,e){const n=t.terminalType,i=t.initialTerminal,s=this.cell[n];if(s&&!Xd.equalTerminals(i,s)){const r=this.graph,o=i,a=o.cell?r.getCellById(o.cell):null,l=o.port,h=a?r.findViewByCell(a):null,c=a||t.isNewEdge?null:ia.create(i).toJSON(),u=s,d=u.cell?r.getCellById(u.cell):null,g=u.port,p=d?r.findViewByCell(d):null,f=d?null:ia.create(s).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,s=n.length;i<s;i+=1){const s=e.renderer.findViewByCell(n[i]);if(!s)continue;const r=Array.prototype.slice.call(s.container.querySelectorAll("[magnet]"));"false"!==s.container.getAttribute("magnet")&&r.push(s.container);const o=r.filter((n=>e.hook.validateConnection(...t.getValidateConnectionArgs(s,n),s.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)s.highlight(o[t],{type:"magnetAvailable"});s.highlight(null,{type:"nodeAvailable"}),t.marked[s.cell.id]=o}}}unhighlightAvailableMagnets(t){const e=t.marked||{};Object.keys(e).forEach((t=>{const n=this.graph.renderer.findViewByCell(t);if(n){e[t].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.getAttribute("data-terminal"),s=this.prepareArrowheadDragging(i,{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,s=this.getEventData(t);i.options.connecting.snap?this.snapArrowheadEnd(s):this.arrowheadDragged(s,e,n);i.hook.validateEdge(this.cell,s.terminalType,s.initialTerminal)?(this.finishEmbedding(s),this.notifyConnectionEvent(s,t)):this.fallbackConnection(s),this.afterArrowheadDragging(s)}startLabelDragging(t,e,n){if(this.can("edgeLabelMovable")){const e=t.currentTarget,n=parseInt(e.getAttribute("data-index"),10),i=this.getLabelPositionAngle(n),s=this.getLabelPositionArgs(n),r=this.getDefaultLabelPositionArgs(),o=this.mergeLabelPositionArgs(s,r);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),s=this.cell.getLabelAt(i.index),r=Qs({},s,{position:this.getLabelPosition(e,n,i.positionAngle,i.positionArgs)});this.cell.setLabelAt(i.index,r)}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,s=parseInt(i.getAttribute("idx"),10);this.cell.removeVertexAt(s)}startVertexDragging(t,e,n){if(!this.can("vertexMovable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=t.target,s=parseInt(i.getAttribute("idx"),10);this.setEventData(t,{index:s,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){t.toStringTag=`X6.${t.name}`,t.isEdgeView=function(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}}(Jd||(Jd={})),Jd.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}),Jd.registry.register("edge",Jd,!0);class Zd extends Zc{constructor(){super(...arguments),this.scalableNode=null,this.rotatableNode=null,this.scalableSelector="scalable",this.rotatableSelector="rotatable",this.defaultPortMarkup=Uc.getPortMarkup(),this.defaultPortLabelMarkup=Uc.getPortLabelMarkup(),this.defaultPortContainerMarkup=Uc.getPortContainerMarkup(),this.portsCache={}}get[Symbol.toStringTag](){return Zd.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")?ao(e,t):oo(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()),"ports"),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(),this.removePorts();const e=this.cell,n=e.getSize(),i=e.getAttrs();this.updateAttrs(this.container,i,{attrs:t===i?null:t,rootBBox:new sa(0,0,n.width,n.height),selectors:this.selectors,scalableNode:this.scalableNode,rotatableNode:this.rotatableNode}),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){So(this.container,Oa.toNodes(Oa.createVectors(t))),this.rotatableNode=xo(this.container,`.${this.rotatableSelector}`),this.scalableNode=xo(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(),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(),s=this.scalableNode;let r=!1;s.getElementsByTagName("path").length>0&&(r=!0);const o=Ka(s,{recursive:r}),a=n.width/(o.width||1),l=n.height/(o.height||1);s.setAttribute("transform",`scale(${a},${l})`);const h=this.rotatableNode;if(null!=h){const r=h.getAttribute("transform");if(r){h.setAttribute("transform",`${r} rotate(${-i},${n.width/2},${n.height/2})`);const o=Ka(s,{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,s=n.portContentSelectors||{};return this.findOne(e,i,s)}initializePorts(){this.cleanPortsCache()}refreshPorts(){this.removePorts(),this.cleanPortsCache(),this.renderPorts()}cleanPortsCache(){this.portsCache={}}removePorts(){Object.keys(this.portsCache).forEach((t=>{Ao(this.portsCache[t].portElement)}))}renderPorts(){const t=this.getPortsContainer(),e=[];t.childNodes.forEach((t=>{e.push(t)}));const n=_s(this.cell.getParsedPorts(),"zIndex"),i="auto";n.auto&&n.auto.forEach((n=>{const i=this.getPortElement(n);t.prepend(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?Oo(n[Math.max(e,0)],i):So(this.getPortsContainer(),i)}getPortElement(t){const e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)}createPortElement(t){let e=Uc.renderMarkup(this.getPortContainerMarkup());const n=e.elem;if(null==n)throw new Error("Invalid port container markup.");e=Uc.renderMarkup(this.getPortMarkup(t));const i=e.elem,s=e.selectors;if(null==i)throw new Error("Invalid port markup.");this.setAttrs({port:t.id,"port-group":t.group},i),e=Uc.renderMarkup(this.getPortLabelMarkup(t.label));const r=e.elem,o=e.selectors;if(null==r)throw new Error("Invalid port label markup.");let a;if(s&&o){for(const t in o)if(s[t]&&t!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},s),o)}else a=s||o;let l="x6-port";return t.group&&(l+=` x6-port-${t.group}`),oo(n,l),oo(i,"x6-port-body"),oo(r,"x6-port-label"),n.appendChild(i),n.appendChild(r),this.portsCache[t.id]={portElement:n,portSelectors:a,portLabelElement:r,portLabelSelectors:o,portContentElement:i,portContentSelectors:s},this.graph.hook.onPortRendered({port:t,node:this.cell,container:n,selectors:a,labelContainer:r,labelSelectors:o,contentContainer:i,contentSelectors:s}),n}updatePorts(){this.updatePortGroup();const t=this.cell.getParsedGroups();Object.keys(t).forEach((t=>this.updatePortGroup(t)))}updatePortGroup(t){const e=sa.fromSize(this.cell.getSize()),n=this.cell.getPortsLayoutByGroup(t,e);for(let t=0,e=n.length;t<e;t+=1){const e=n[t],i=e.portId,s=this.portsCache[i]||{},r=e.portLayout;if(this.applyPortTransform(s.portElement,r),null!=e.portAttrs){const t={selectors:s.portSelectors||{}};e.portSize&&(t.rootBBox=sa.fromSize(e.portSize)),this.updateAttrs(s.portElement,e.portAttrs,t)}const o=e.labelLayout;if(o&&(this.applyPortTransform(s.portLabelElement,o,-(r.angle||0)),o.attrs)){const t={selectors:s.portLabelSelectors||{}};e.labelSize&&(t.rootBBox=sa.fromSize(e.labelSize)),this.updateAttrs(s.portLabelElement,o.attrs,t)}}}applyPortTransform(t,e,n=0){const i=e.angle,s=e.position;il(t,Ga().rotate(n).translate(s.x||0,s.y||0).rotate(i||0),{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,s=i.cell;return null==e||null==n?{e:t,view:i,node:s,cell:s}:{e:t,x:e,y:n,view:i,node:s,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){if(this.isPropagationStopped(t))return;const i=t.target;Po(i)||To(i)||(this.notifyMouseDown(t,e,n),this.startNodeDragging(t,e,n))}onMouseMove(t,e,n){const i=this.getEventData(t),s=i.action;if("magnet"===s)this.dragMagnet(t,e,n);else{if("move"===s){const s=i.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),s=i.action;if("magnet"===s)this.stopMagnetDragging(t,e,n);else{const r=t.target;if(Po(r)||To(r))return;if(this.notifyMouseUp(t,e,n),"move"===s){(i.targetView||this).stopNodeDragging(t,e,n)}}const r=i.targetMagnet;r&&this.onMagnetClick(t,r,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){this.graph.view.getMouseMovedCount(t)>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).cell||this.cell,n=this.graph.findViewByCell(e),i=this.graph.snapToGrid(t.clientX,t.clientY);this.notify("node:embed",{e:t,node:e,view:n,cell:e,x:i.x,y:i.y,currentParent:e.getParent()})}processEmbedding(t,e){const n=e.cell||this.cell,i=e.graph||this.graph,s=i.options.embedding,r=s.findParent;let o="function"==typeof r?Kr(r,i,{view:this,node:this.cell}).filter((t=>Fd.isCell(t)&&this.cell.id!==t.id&&!t.isDescendantOf(this.cell))):i.model.getNodesUnderNode(n,{by:r});if(s.frontOnly&&o.length>0){const t=_s(o,"zIndex"),e=Ks(Object.keys(t));e&&(o=t[e])}o=o.filter((t=>t.visible));let a=null;const l=e.candidateEmbedView,h=s.validate;for(let t=o.length-1;t>=0;t-=1){const e=o[t];if(l&&l.cell.id===e.id){a=l;break}{const t=e.findView(i);if(Kr(h,i,{child:this.cell,parent:t.cell,childView:this,parentView:t})){a=t;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){this.graph.startBatch("embedding");const n=e.cell||this.cell,i=e.graph||this.graph,s=i.findViewByCell(n),r=n.getParent(),o=e.candidateEmbedView;if(o?(o.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null,null!=r&&r.id===o.cell.id||o.cell.insertChild(n,void 0,{ui:!0})):r&&r.unembed(n,{ui:!0}),i.model.getConnectedEdges(n,{deep:!0}).forEach((t=>{t.updateParent({ui:!0})})),s&&o){const e=i.snapToGrid(t.clientX,t.clientY);s.notify("node:embedded",{e:t,cell:n,x:e.x,y:e.y,node:n,view:i.findViewByCell(n),previousParent:r,currentParent:n.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let t=this.cell,e=this;for(;e&&!t.isEdge();){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,s=this.graph;this.setEventData(t,{targetMagnet:i}),s.hook.validateMagnet(this,i,t)?(s.options.magnetThreshold<=0&&this.startConnectting(t,i,e,n),this.setEventData(t,{action:"magnet"}),this.stopPropagation(t)):((ro(i,"x6-port-body")||l(i).closest(".x6-port-body").length>0)&&this.stopPropagation(t),this.onMouseDown(t,e,n)),s.view.delegateDragEvents(t,this)}startConnectting(t,e,n,i){this.graph.model.startBatch("add-edge");const s=this.createEdgeFromMagnet(e,n,i);s.notifyMouseDown(t,n,i),s.setEventData(t,s.prepareArrowheadDragging("target",{x:n,y:i,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(t,{edgeView:s})}createEdgeFromMagnet(t,e,n){const i=this.graph,s=i.model,r=i.hook.getDefaultEdge(this,t);return r.setSource(Object.assign(Object.assign({},r.getSource()),this.getEdgeTerminal(t,e,n,r,"source"))),r.setTarget(Object.assign(Object.assign({},r.getTarget()),{x:e,y:n})),r.addTo(s,{async:!1,ui:!0}),r.findView(i)}dragMagnet(t,e,n){const i=this.getEventData(t),s=i.edgeView;if(s)s.onMouseMove(t,e,n),this.autoScrollGraph(t.clientX,t.clientY);else{const s=this.graph,r=s.options.magnetThreshold,o=this.getEventTarget(t),a=i.targetMagnet;if("onleave"===r){if(a===o||a.contains(o))return}else if(s.view.getMouseMovedCount(t)<=r)return;this.startConnectting(t,a,e,n)}}stopMagnetDragging(t,e,n){const i=this.eventData(t).edgeView;i&&(i.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,s){let r=[s];const o=this.graph.selection.widget;if(o&&o.options.movable){const t=this.graph.getSelectedCells();t.includes(s)&&(r=t.filter((t=>t.isNode())))}r.forEach((s=>{this.notify(t,{e:e,x:n,y:i,cell:s,node:s,view:s.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 s=ia.create(i.cell.getPosition());i.setEventData(t,{moving:!1,offset:s.diff(e,n),restrict:this.graph.hook.getRestrictArea(i)})}dragNode(t,e,n){const i=this.cell,s=this.graph,r=s.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=tc.snapToGrid(e+a.x,r),c=tc.snapToGrid(n+a.y,r);i.setPosition(h,c,{restrict:l,deep:!0,ui:!0}),s.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){t.toStringTag=`X6.${t.name}`,t.isNodeView=function(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}}(Zd||(Zd={})),Zd.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"]}}),Zd.registry.register("node",Zd,!0);const Kd=_d("text");class Qd extends(Hd("text",{view:Kd,attrs:{text:{fontSize:18,fill:"#000000",stroke:null,refX:.5,refY:.5}}},{noText:!0})){}!function(t){class e extends Zd{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"]}}),Zd.registry.register(Kd,e)}(Qd||(Qd={}));class tg extends Pc{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,s;"number"==typeof e?(i=e,s=Object.assign({merge:!1},n)):(i=this.length,s=Object.assign({merge:!1},e)),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);const r=Array.isArray(t)?t:[t],o=this.comparator&&"number"!=typeof e&&!1!==s.sort,a=this.comparator||null;let l=!1;const h=[],c=[];return r.forEach((t=>{const e=this.get(t);e?s.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}),s.silent||(h.forEach(((t,e)=>{const n={cell:t,index:i+e,options:s};this.trigger("added",n),s.dryrun||t.notify("added",Object.assign({},n))})),l&&this.trigger("sorted"),(h.length||c.length)&&this.trigger("updated",{added:h,merged:c,removed:[],options:s})),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 s=this.get(t[i]);if(null==s)continue;const r=this.cells.indexOf(s);this.cells.splice(r,1),this.length-=1,delete this.map[s.id],n.push(s),this.unreference(s),e.dryrun||s.remove(),e.silent||(this.trigger("removed",{cell:s,index:r,options:e}),e.dryrun||s.notify("removed",{cell:s,index:r,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=[],s=[];t.forEach((t=>{n.some((e=>e.id===t.id))||i.push(t)})),n.forEach((e=>{t.some((t=>t.id===e.id))||s.push(e)})),this.trigger("updated",{options:e,added:i,removed:s,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=rr(this.cells,this.comparator),t.silent||this.trigger("sorted")),this}clone(){return new(0,this.constructor)(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 eg extends Pc{constructor(t=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new tg(t),this.setup()}get[Symbol.toStringTag](){return eg.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=Fd.isCell(i.cell)?i.cell.id:i.cell,s=n[e],r=s?s.indexOf(t.id):-1;r>=0&&(s.splice(r,1),0===s.length&&delete n[e])}const s=t.getTerminal(e);if(s&&s.cell){const e=Fd.isCell(s.cell)?s.cell.id:s.cell,i=n[e]||[];-1===i.indexOf(t.id)&&i.push(t.id),n[e]=i}}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)=>(t.isEdge()?1:2)-(e.isEdge()?1:2)));for(;t.length>0;){const e=t.shift();e&&e.remove(n)}}),n),this}addNode(t,e={}){const n=$d.isNode(t)?t:this.createNode(t);return this.addCell(n,e),n}createNode(t){return $d.create(t)}addEdge(t,e={}){const n=Xd.isEdge(t)?t:this.createEdge(t);return this.addCell(n,e),n}createEdge(t){return Xd.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);return this.getConnectedEdges(t).forEach((n=>{const i=n.getSourceCell(),s=n.getTargetCell();i===t&&n.setSource(Object.assign(Object.assign({},n.getSource()),{cell:e})),s===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(),s=t.getTargetCell();i&&i.id===n&&t.setSource({x:0,y:0},e),s&&s.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 s={},r=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=>{s[t.id]||(n.push(t),s[t.id]=!0,r&&(o&&l(t,!1),a&&l(t,!0)))})),r&&t.isEdge()){const i=e?t.getTargetCell():t.getSourceCell();i&&i.isEdge()&&(s[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}),r={};t.forEach((t=>{t.isNode()&&(r[t.id]=!0)}));const l=(t,i)=>{const o=i?this.getOutgoingEdges(t.id):this.getIncomingEdges(t.id);null!=o&&o.forEach((t=>{if(!s[t.id]){const i=t.getSourceCell(),o=t.getTargetCell();if(!e.enclosed&&i&&r[i.id]&&o&&r[o.id])return;n.push(t),s[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 s=this.getConnectedEdges(t,e).reduce(((s,r)=>{const o=r.hasLoop(e),a=r.getSourceCell(),l=r.getTargetCell();return n&&a&&a.isNode()&&!s[a.id]&&(!o&&(a===t||e.deep&&a.isDescendantOf(t))||(s[a.id]=a)),i&&l&&l.isNode()&&!s[l.id]&&(!o&&(l===t||e.deep&&l.isDescendantOf(t))||(s[l.id]=l)),s}),{});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,s=n.outgoing;return null==i&&null==s&&(i=s=!0),this.getConnectedEdges(t,n).some((t=>{const n=t.getSourceCell(),r=t.getTargetCell();return!(!i||!n||n.id!==e.id)||!(!s||!r||r.id!==e.id)}))}getSuccessors(t,e={}){const n=[];return this.search(t,((i,s)=>{i!==t&&this.matchDistance(s,e.distance)&&n.push(i)}),Object.assign(Object.assign({},e),{outgoing:!0})),n}isSuccessor(t,e,n={}){let i=!1;return this.search(t,((s,r)=>{if(s===e&&s!==t&&this.matchDistance(r,n.distance))return i=!0,!1}),Object.assign(Object.assign({},n),{outgoing:!0})),i}getPredecessors(t,e={}){const n=[];return this.search(t,((i,s)=>{i!==t&&this.matchDistance(s,e.distance)&&n.push(i)}),Object.assign(Object.assign({},e),{incoming:!0})),n}isPredecessor(t,e,n={}){let i=!1;return this.search(t,((s,r)=>{if(s===e&&s!==t&&this.matchDistance(r,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))})),Fd.getCommonAncestor(...e)}getSubGraph(t,e={}){const n=[],i={},s=[],r=[],o=t=>{i[t.id]||(n.push(t),i[t.id]=t,t.isEdge()&&r.push(t),t.isNode()&&s.push(t))};return t.forEach((t=>{if(o(t),e.deep){t.getDescendants({deep:!0}).forEach((t=>o(t)))}})),r.forEach((t=>{const e=t.getSourceCell(),r=t.getTargetCell();e&&!i[e.id]&&(n.push(e),i[e.id]=e,e.isNode()&&s.push(e)),r&&!i[r.id]&&(n.push(r),i[r.id]=r,r.isNode()&&s.push(r))})),s.forEach((t=>{this.getConnectedEdges(t,e).forEach((t=>{const e=t.getSourceCell(),s=t.getTargetCell();!i[t.id]&&e&&i[e.id]&&s&&i[s.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 Fd.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,s){const r="number"==typeof t?new sa(t,e,n,i):sa.create(t),o="number"==typeof t?s:e,a=o&&o.strict;return this.getNodes().filter((t=>{const e=t.getBBox();return a?r.containsRect(e):r.isIntersectWithRect(e)}))}getEdgesInArea(t,e,n,i,s){const r="number"==typeof t?new sa(t,e,n,i):sa.create(t),o="number"==typeof t?s: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?r.containsRect(e):r.isIntersectWithRect(e)}))}getNodesUnderNode(t,e={}){const n=t.getBBox();return(null==e.by||"bbox"===e.by?this.getNodesInArea(n):this.getNodesFromPoint(n[e.by])).filter((e=>t.id!==e.id&&!e.isDescendantOf(t)))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(t,e={}){return Fd.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=[],s={},r={};for(i.push(t),r[t.id]=0;i.length>0;){const t=i.shift();if(null==t||s[t.id])continue;if(s[t.id]=!0,!1===Kr(e,this,t,r[t.id]))continue;this.getNeighbors(t,n).forEach((e=>{r[e.id]=r[t.id]+1,i.push(e)}))}}depthFirstSearch(t,e,n={}){const i=[],s={},r={};for(i.push(t),r[t.id]=0;i.length>0;){const t=i.pop();if(null==t||s[t.id])continue;if(s[t.id]=!0,!1===Kr(e,this,t,r[t.id]))continue;const o=this.getNeighbors(t,n),a=i.length;o.forEach((e=>{r[e.id]=r[t.id]+1,i.splice(a,0,e)}))}}getShortestPath(t,e,n={}){const i={};this.getEdges().forEach((t=>{const e=t.getSourceCellId(),s=t.getTargetCellId();e&&s&&(i[e]||(i[e]=[]),i[s]||(i[s]=[]),i[e].push(s),n.directed||i[s].push(e))}));const s="string"==typeof t?t:t.id,r=Dc.run(i,s,n.weight),o=[];let a="string"==typeof e?e:e.id;for(r[a]&&o.push(a);a=r[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 s=this.getCellsBBox(n);if(s){const r=Math.max(t/s.width,0),o=Math.max(e/s.height,0),a=s.getOrigin();n.forEach((t=>t.scale(r,o,a,i)))}return this}toJSON(t={}){return eg.toJSON(this.getCells(),t)}parseJSON(t){return eg.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)){return(Array.isArray(t)?t:[t]).some((t=>this.batches[t]>0))}}!function(t){t.toStringTag=`X6.${t.name}`,t.isModel=function(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}}(eg||(eg={})),function(t){t.toJSON=function(t,e={}){return{cells:t.map((t=>t.toJSON(e)))}},t.fromJSON=function(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($d.registry.exist(e))return $d.create(t);if(Xd.registry.exist(e))return Xd.create(t)}throw new Error("The `shape` should be specified when creating a node/edge instance")}))}}(eg||(eg={}));const ng=".text-block-content",ig=_d("text-block");class sg extends $d{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){M.SUPPORT_FOREIGNOBJECT&&this.setAttrs({foreignObject:Object.assign({},t),[ng]:{style:Object.assign({},t)}})}updateContent(t){M.SUPPORT_FOREIGNOBJECT?this.setAttrs({[ng]:{html:t?Ur(t):""}}):this.setAttrs({[ng]:{text:t}})}}function rg(t,e="body"){return[{tagName:t,selector:e},{tagName:"text",selector:"label"}]}function og(t,e,n={}){const i={constructorName:t,markup:rg(t,n.selector),attrs:{[t]:Object.assign({},Id.bodyAttr)}};return(n.parent||Id).define(Qs(i,e,{shape:t}))}!function(t){t.config({type:ig,view:ig,markup:['<g class="rotatable">','<g class="scalable"><rect/></g>',M.SUPPORT_FOREIGNOBJECT?["<foreignObject>",'<body xmlns="http://www.w3.org/1999/xhtml">',`<div class="${ng.substr(1)}" />`,"</body>","</foreignObject>"].join(""):`<text class="${ng.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"}},[ng]:{refX:.5,refY:.5,yAlign:"middle",xAlign:"middle",style:{textAlign:"center",verticalAlign:"middle",display:"table-cell",padding:"0 5px",margin:0}}}}),$d.registry.register(ig,t)}(sg||(sg={})),function(t){const e="content";class n extends Zd{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(M.SUPPORT_FOREIGNOBJECT)super.update(t);else{const e=this.cell,n=Object.assign({},t||e.getAttrs());delete n[ng],super.update(n),t&&!qs(t,ng)||this.updateContent(t)}}updateContent(t){if(M.SUPPORT_FOREIGNOBJECT)super.update(t);else{const e=this.cell,n=(t||e.getAttrs())[ng],i=Na(e.getContent(),e.getSize(),n,{svgDocument:this.graph.view.svg}),s={[ng]:Qs({},n,{text:i})};super.update(s)}}}t.View=n,function(t){t.config({bootstrap:["render",e],actions:M.SUPPORT_FOREIGNOBJECT?{}:{size:e,content:e}}),Zd.registry.register(ig,t)}(n=t.View||(t.View={}))}(sg||(sg={})),Id.define({shape:"empty"}),og("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}}),$d.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({},Id.bodyAttr),{refWidth:"100%",refHeight:"100%"}),header:Object.assign(Object.assign({},Id.bodyAttr),{refWidth:"100%",height:30,stroke:"#000000"}),headerText:Object.assign(Object.assign({},Id.labelAttr),{refX:"50%",refY:15,fontSize:16}),bodyText:Object.assign(Object.assign({},Id.labelAttr),{refY2:15})}}),og("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}});Id.define({shape:"cylinder",overwrite:!0,markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],attrs:{body:Object.assign(Object.assign({},Id.bodyAttr),{lateral:10}),top:Object.assign(Object.assign({},Id.bodyAttr),{refCx:"50%",refRx:"50%",cy:10,ry:10})},attrHooks:{lateral:{set(t,{refBBox:e}){const n=Wr(t);n&&(t=parseFloat(t)/100);const i=e.x,s=e.y,r=e.width,o=e.height,a=n?o*t:t,l=.551784,h=l*(r/2),c=l*a,u=i+r/2,d=i+r,g=s+a,p=g-a,f=s+o-a,m=s+o;return{d:["M",i,g,"L",i,f,"C",i,f+c,u-h,m,u,m,"C",u+h,m,d,f+c,d,f,"L",d,g,"C",d,g-c,u+h,p,u,p,"C",u-h,p,i,g-c,i,g,"Z"].join(" ")}}}},knob:{enabled:!0,position:({node:t})=>({x:0,y:t.attr("body/lateral")}),onMouseMove({node:t,data:e,deltaY:n}){if(0!==n){const i=t.getBBox(),s=t.attr("body/lateral");null==e.round&&(e.round=s);const r=0,o=i.height/2,a=Wn(e.round+n,r,o);a!==s&&t.attr({body:{lateral:a},top:{cy:a,ry:a}})}}}}),og("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var ag=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class lg extends Id{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",lg.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(","):ia.isPointLike(t)?`${t.x}, ${t.y}`:"")).join(" ")}t.pointsToString=e,t.config({propHooks(t){const{points:n}=t,i=ag(t,["points"]);if(n){const t=e(n);t&&$r(i,"attrs/body/refPoints",t)}return i}})}(lg||(lg={})),og("polygon",{},{parent:lg}),og("polyline",{},{parent:lg});var hg=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};Id.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=hg(t,["path"]);return e&&$r(n,"attrs/body/refD",e),n}});var cg=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};Id.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},M.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:go.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({},Id.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(t){const{text:e}=t,n=cg(t,["text"]);return e&&$r(n,"attrs/label/text",e),n},attrHooks:{text:{set(t,{cell:e,view:n,refBBox:i,elem:s,attrs:r}){if(!(s instanceof HTMLElement)){const o=r.style||{},a={text:t,width:-5,height:"100%"},l=Object.assign({textVerticalAnchor:"middle"},o);return Kr(zh.presets.textWrap.set,this,a,{cell:e,view:n,elem:s,refBBox:i,attrs:l}),{fill:o.color||null}}s.textContent=t},position(t,{refBBox:e,elem:n}){if(n instanceof SVGElement)return e.getCenter()}}}}),og("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:Gd()},{selector:"image"}),og("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:Gd()}),og("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:Gd()}),og("image-inscribed",{propHooks:Gd(),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 ug=Xd.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"}}});Xd.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}}}}),Xd.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 dg extends Id{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 Zd{init(){super.init(),this.cell.on("change:*",(()=>{this.graph.hook.shouldUpdateHTMLComponent(this.cell)&&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}}),Zd.registry.register("html-view",t)}(e=t.View||(t.View={}))}(dg||(dg={})),function(t){t.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},Uc.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),$d.registry.register("html",t)}(dg||(dg={})),function(t){t.componentRegistry=gl.create({type:"html componnet"})}(dg||(dg={}));var gg=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class pg extends Tc{constructor(t){super(),this.delay=10,this.throttle=2,this.threshold=5,this.changeCount=0,this.timestamp=0,this.options=Object.assign(Object.assign({},pg.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()-this.timestamp)/1e3;t>this.delay||this.changeCount>=this.threshold&&t>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)}}gg([Tc.dispose()],pg.prototype,"dispose",null),function(t){t.defaultOptions={delay:10,throttle:2,threshold:5}}(pg||(pg={}));class fg extends Oc{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 mg,yg=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class bg extends Rc{constructor(t){super(),this.graph=t;const{selectors:e,fragment:n}=Uc.parseJSONMarkup(bg.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=bg.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&&Fd.isCell(e.cell))&&(this.svg!==t.target&&this.container!==t.target&&!l.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})}}isPreventDefaultContextMenu(t,e){let n=this.options.preventDefaultContextMenu;return"function"==typeof n&&(n=Kr(n,this.graph,{view:e})),n}onContextMenu(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.isPreventDefaultContextMenu(e,n)&&t.preventDefault(),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){return this.getEventData(t).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&&["touchstart"].includes(e.type)&&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;if(e.mouseMovedCount<=this.options.moveThreshold)return;const i=this.normalizeEvent(t),s=this.graph.snapToGrid(i.clientX,i.clientY),r=e.currentView;r?r.onMouseMove(i,s.x,s.y):this.graph.trigger("blank:mousemove",{e:i,x:s.x,y:s.y}),this.setEventData(i,e)}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY),i=this.getEventData(t).currentView;i?i.onMouseUp(e,n.x,n.y):this.graph.trigger("blank:mouseup",{e:e,x:n.x,y:n.y}),t.isPropagationStopped()||this.onClick(l.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,s=this.graph.snapToGrid(i.clientX,i.clientY),r=Math.max(-1,Math.min(1,i.wheelDelta||-i.detail));n?n.onMouseWheel(e,s.x,s.y,r):this.graph.trigger("blank:mousewheel",{e:e,delta:r,x:s.x,y:s.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 s=this.graph.snapToGrid(e.clientX,e.clientY);i.onCustomEvent(e,n,s.x,s.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 s=this.normalizeEvent(t);if(this.guard(s,i))return;const r=this.graph.snapToGrid(s.clientX,s.clientY);Kr(e,this.graph,i,s,n,r.x,r.y)}}}onMagnetMouseDown(t){this.handleMagnetEvent(t,((t,e,n,i,s)=>{t.onMagnetMouseDown(e,n,i,s)}))}onMagnetDblClick(t){this.handleMagnetEvent(t,((t,e,n,i,s)=>{t.onMagnetDblClick(e,n,i,s)}))}onMagnetContextMenu(t){const e=this.normalizeEvent(t),n=this.findView(e.target);this.isPreventDefaultContextMenu(e,n)&&e.preventDefault(),this.handleMagnetEvent(e,((t,e,n,i,s)=>{t.onMagnetContextMenu(e,n,i,s)}))}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=()=>{}}}yg([Rc.dispose()],bg.prototype,"dispose",null),function(t){const e=`${Qh.prefixCls}-graph`;t.markup=[{ns:go.xhtml,tagName:"div",selector:"background",className:`${e}-background`},{ns:go.xhtml,tagName:"div",selector:"grid",className:`${e}-grid`},{ns:go.svg,tagName:"svg",selector:"svg",className:`${e}-svg`,attrs:{width:"100%",height:"100%","xmlns:xlink":go.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=function(t){const e=t.cloneNode();return t.childNodes.forEach((t=>e.appendChild(t))),()=>{for(Mo(t);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)))}}}(bg||(bg={})),function(t){const e=Qh.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"}}(bg||(bg={})),function(t){t.checkScroller=function(t,e){return(n,i,s)=>{const r=s.value;s.value=function(...n){if(null==this.scroller.widget){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 r.call(this,...n)}}}}(mg||(mg={}));var Cg=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class vg extends fg{init(){vg.ensure()}dispose(){vg.clean()}}Cg([vg.dispose()],vg.prototype,"dispose",null),function(t){let e,n=0;t.ensure=function(){if(n+=1,!(n>1||M.isApplyingHMR())){e=document.createElement("style"),e.setAttribute("type","text/css"),e.textContent=".x6-graph {\n  position: relative;\n  outline: none;\n  touch-action: 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  stroke: #2ecc71;\n  stroke-width: 1px;\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";const t=document.querySelector("head");t&&t.insertBefore(e,t.firstChild)}},t.clean=function(){n-=1,n>0||(e&&e.parentNode&&e.parentNode.removeChild(e),e=null)}}(vg||(vg={}));var xg,wg=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Eg{get handleClassName(){return xg.handle}get pie(){return Object.assign(Object.assign({},Eg.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=xg.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(xg.wrap).addClass(xg.animate).addClass(`${xg.handle}-${t}`)}this.delegateEvents({[`mousedown .${xg.handle}`]:"onHandleMouseDown",[`touchstart .${xg.handle}`]:"onHandleMouseDown",[`mousedown .${xg.pieToggle}`]:"onPieToggleMouseDown",[`touchstart .${xg.pieToggle}`]:"onPieToggleMouseDown"})}onHandleMouseDown(t){const e=this.$(t.currentTarget).closest(`.${xg.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).action;e&&this.triggerHandleAction(e,"mousemove",t)}onHandleMouseUp(t){const e=this.getEventData(t).action;e&&(this.triggerHandleAction(e,"mouseup",t),this.undelegateDocumentEvents())}triggerHandleAction(t,e,n,i){n.preventDefault(),n.stopPropagation();const s=this.normalizeEvent(n),r=this.getEventData(s),o=this.graph.snapToGrid(s.clientX,s.clientY),a=this.graph.snapToGrid(r.clientX,r.clientY),l=o.x-a.x,h=o.y-a.y;this.trigger(`action:${t}:${e}`,Object.assign({e:s,dx:l,dy:h,x:o.x,y:o.y,offsetX:n.clientX-r.startX,offsetY:n.clientY-r.startY},i)),r.clientX=n.clientX,r.clientY=n.clientY}onPieToggleMouseDown(t){t.stopPropagation();const e=this.$(t.target).closest(`.${xg.pieToggle}`).attr("data-name");this.isOpen(e)||this.isOpen()&&this.toggleState(),this.toggleState(e)}setPieIcons(){"pie"===this.handleOptions.type&&this.$handleContainer.find(`.${xg.handle}`).each(((t,e)=>{const n=this.$(e),i=n.attr("data-action"),s=xg.pieSlice,r=this.getHandle(i);if(!r||!r.icon){const t=window.getComputedStyle(e,":before").getPropertyValue("content");if(t&&"none"!==t){const e=n.find(`.${s}-txt`);e.length&&Oa.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(`.${s}-img`);i.length>0&&Oa.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(`${xg.handle} ${xg.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,s=i.outerRadius,r=i.innerRadius,o=(s+r)/2,a=new ia(s,s),l=Yo.toRad(i.sliceAngle),h=n*l+Yo.toRad(i.startAngle),c=function(t,e,n,i){const s=2*Math.PI-1e-6,r=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>=s?r?`M0,${o}A${o},${o} 0 1,1 0,${-o}A${o},${o} 0 1,1 0,${o}M0,${r}A${r},${r} 0 1,0 0,${-r}A${r},${r} 0 1,0 0,${r}Z`:`M0,${o}A${o},${o} 0 1,1 0,${-o}A${o},${o} 0 1,1 0,${o}Z`:r?`M${o*u},${o*d}A${o},${o} 0 ${c},1 ${o*g},${o*p}L${r*g},${r*p}A${r},${r} 0 ${c},0 ${r*u},${r*d}Z`:`M${o*u},${o*d}A${o},${o} 0 ${c},1 ${o*g},${o*p}L0,0Z`}(r,s,h,h+l),u=Oa.create("svg").addClass(`${xg.pieSlice}-svg`),d=Oa.create("path").addClass(xg.pieSlice).attr("d",c).translate(s,s),g=ia.fromPolar(o,-h-l/2,a).toJSON(),p=i.iconSize,f=Oa.create("image").attr(g).addClass(`${xg.pieSlice}-img`);g.y=g.y+p-2;const m=Oa.create("text",{"font-size":p}).attr(g).addClass(`${xg.pieSlice}-txt`);f.attr({width:p,height:p}),f.translate(-p/2,-p/2),m.translate(-p/2,-p/2),u.append([d,f,m]),e.append(u.node)}else e.addClass(`${xg.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],s=`action:${t.name}:${n}`;"string"==typeof i?this.on(s,this[i],this):this.on(s,i)})),this.$handleContainer&&this.$handleContainer.append(this.renderHandle(t))}return this}addHandles(t){return t.forEach((t=>this.addHandle(t))),this}removeHandles(){for(;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),s=`${xg.handle}-selected`;void 0===e&&(e=!i.hasClass(s)),i.toggleClass(s,e);const r=e?n.iconSelected:n.icon;r&&this.updateHandleIcon(i,r)}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(`.${xg.handle}-${t}`)}updateHandleIcon(t,e){if("pie"===this.handleOptions.type){const n=t.find(`.${xg.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(xg.pieToggleOpened):this.$handleContainer.hasClass(`${xg.pieOpended}`))}toggleState(t){if(this.isRendered()){const e=this.$handleContainer;if(Object.keys(this.$pieToggles).forEach((t=>{this.$pieToggles[t].removeClass(xg.pieToggleOpened)})),this.isOpen())this.trigger("pie:close",{name:t}),e.removeClass(xg.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(xg.pieToggleOpened)}e.addClass(xg.pieOpended)}}}applyAttrs(t,e){if(e){const n=Rc.$(t);Object.keys(e).forEach((t=>{const i=n.find(t).addBack().filter(t),s=e[t],{class:r}=s,o=wg(s,["class"]);r&&i.addClass(r),i.attr(o)}))}}}!function(t){t.defaultPieOptions={innerRadius:20,outerRadius:50,sliceAngle:45,startAngle:0,iconSize:14,toggles:[{name:"default",position:"e"}]}}(Eg||(Eg={})),function(t){t.handle=Rc.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`}(xg||(xg={}));var Ag,Mg=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o},Sg=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Og extends Rc{constructor(t){super();const e=t,{view:n,cell:i,node:s,edge:r,graph:o}=e,a=Sg(e,["view","cell","node","edge","graph"]);n?(this.view=n,this.cell=n.cell,this.graph=n.graph,this.model=this.graph.model):(i||r||s)&&o&&(this.cell=s||r||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()[t.view.cid];e&&Object.keys(e).forEach((t=>{const n=e[t];n&&n.remove()}))}static getInstances(t){return this.ensureCache()[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();return this.constructor.unregister(this),super.remove()}dispose(){this.remove()}}Og.instanceCache=new WeakMap,Mg([Rc.dispose()],Og.prototype,"dispose",null);class kg extends Og{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"),oo(this.container,this.prefixClassName("widget-knob")),this.options.className&&oo(this.container,this.options.className),this.view.addClass(Ag.KNOB),this.graph.container.appendChild(this.container),this.update(),this}remove(){return this.view.removeClass(Ag.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=Yo.normalize(this.node.getAngle()),s=ia.create(t);0!==i&&s.rotate(-i,{x:n.width/2,y:n.height/2}),s.translate(n).scale(e.a,e.d).translate(e.e,e.f),this.container.style.left=`${s.x}px`,this.container.style.top=`${s.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(Ag.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(Ag.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,s=(t.clientY-e.originY)/n.d,r=this.node.getAngle(),o=new ia(i,s).rotate(r);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(Ag.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"}}(Ag||(Ag={}));var Pg,Tg,Dg=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};!function(t){t.root="widget-minimap",t.viewport=`${t.root}-viewport`,t.zoom=`${t.viewport}-zoom`}(Pg||(Pg={}));class Ng extends Rc{constructor(t){super(),this.options=Object.assign(Object.assign({},Tg.defaultOptions),t),this.updateViewport=xs(this.updateViewport.bind(this),0),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(Pg.root));const e=document.createElement("div");this.container.appendChild(e),this.$viewport=this.$("<div>").addClass(this.prefixClassName(Pg.viewport)),this.options.scalable&&(this.zoomHandle=this.$("<div>").addClass(this.prefixClassName(Pg.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 Up(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.onTransform,this),this.sourceGraph.on("scale",this.onTransform,this),this.sourceGraph.on("model:updated",this.onModelUpdated,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.onTransform,this),this.sourceGraph.off("scale",this.onTransform,this),this.sourceGraph.off("model:updated",this.onModelUpdated,this)),this.sourceGraph.off("resize",this.updatePaper,this),this.undelegateEvents()}onRemove(){this.targetGraph.view.remove(),this.stopListening(),this.targetGraph.dispose()}onTransform(t){(t.ui||this.targetGraphTransforming)&&this.updateViewport()}onModelUpdated(){this.targetGraph.zoomToFit()}updatePaper(t,e){let n,i;"object"==typeof t?(n=t.width,i=t.height):(n=t,i=e);const s=this.sourceGraph.options,r=this.sourceGraph.transform.getScale(),o=this.options.width-2*this.options.padding,a=this.options.height-2*this.options.padding;n/=r.sx,i/=r.sy,this.ratio=Math.min(o/n,a/i);const l=this.ratio,h=s.x*l/r.sx,c=s.y*l/r.sy;return n*=l,i*=l,this.targetGraph.resizeGraph(n,i),this.targetGraph.translate(h,c),this.scroller?this.targetGraph.scale(l,l):this.targetGraph.zoomToFit(),this.updateViewport(),this}updateViewport(){const t=this.sourceGraph.transform.getScale(),e=this.targetGraph.transform.getScale();let n=null;n=this.scroller?this.scroller.clientToLocalPoint(0,0):this.graph.graphToLocal(0,0);const i=this.$(this.targetGraph.container).position(),s=this.targetGraph.translate();s.ty=s.ty||0,this.geometry={top:i.top+n.y*e.sy+s.ty,left:i.left+n.x*e.sx+s.tx,width:this.$graphContainer.innerWidth()*e.sx/t.sx,height:this.$graphContainer.innerHeight()*e.sy/t.sy},this.$viewport.css(this.geometry)}startAction(t){const e=this.normalizeEvent(t),n=e.target===this.zoomHandle?"zooming":"panning",{tx:i,ty:s}=this.sourceGraph.translate(),r={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:s};this.targetGraphTransforming=!0,this.delegateDocumentEvents(Tg.documentEvents,r)}doAction(t){const e=this.normalizeEvent(t),n=e.clientX,i=e.clientY,s=e.data;switch(s.action){case"panning":{const t=this.sourceGraph.transform.getScale(),e=(n-s.clientX)*t.sx,r=(i-s.clientY)*t.sy;this.scroller?(this.graphContainer.scrollLeft=s.scrollLeft+e/this.ratio,this.graphContainer.scrollTop=s.scrollTop+r/this.ratio):this.sourceGraph.translate(s.translateX-e/this.ratio,s.translateY-r/this.ratio);break}case"zooming":{const t=s.scale,e=s.geometry,i=1+(s.clientX-n)/e.width/t.sx;s.frameId&&cancelAnimationFrame(s.frameId),s.frameId=requestAnimationFrame((()=>{this.sourceGraph.zoom(i*s.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})}));break}}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(t){const e=this.normalizeEvent(t);let n,i;const s=this.targetGraph.translate();if(s.ty=s.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 r=(n-s.tx)/this.ratio,o=(i-s.ty)/this.ratio;this.sourceGraph.centerPoint(r,o)}dispose(){this.remove()}}Dg([Rc.dispose()],Ng.prototype,"dispose",null),function(t){t.defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:t=>new Up(t)},t.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}}(Tg||(Tg={}));var jg=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o},Lg=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Fg extends Rc{constructor(t){super();const{graph:e}=t,n=Lg(t,["graph"]);this.graph=e,this.options=Object.assign({tolerance:10},n),this.offset={x:0,y:0},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(){const t=this.containerWrapper=new Oa("svg"),e=this.horizontal=new Oa("line"),n=this.vertical=new Oa("line");t.addClass(this.containerClassName),e.addClass(this.horizontalClassName),n.addClass(this.verticalClassName),t.setAttribute("width","100%"),t.setAttribute("height","100%"),e.setAttribute("display","none"),n.setAttribute("display","none"),t.append([e,n]),this.options.className&&t.addClass(this.options.className),this.container=this.containerWrapper.node}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(),s=i.bbox(t.getAngle()),r=s.getTopLeft(),o=s.getBottomRight(),a=Yo.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=r.x,-1!==y.indexOf("bottom")?f.horizontal=o.y:f.horizontal=r.y,this.model.getNodes().some((e=>{if(this.isIgnored(t,e))return!1;const n=e.getBBox().bbox(e.getAngle()),i=n.getTopLeft(),r=n.getBottomRight(),a={vertical:[i.x,r.x],horizontal:[i.y,r.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]=rr(n,(t=>t.distance))})),null==h&&m.vertical.length>0&&(h=m.vertical[0].position,c=Math.min(s.y,n.y),u=Math.max(o.y,r.y)-c),null==d&&m.horizontal.length>0&&(d=m.horizontal[0].position,g=Math.min(s.x,n.x),p=Math.max(o.x,r.x)-g),null!=h&&null!=d})),this.hide();let C=0,v=0;null==d&&null==h||(null!=h&&(C=-1!==y.indexOf("right")?h-o.x:r.x-h),null!=d&&(v=-1!==y.indexOf("bottom")?d-o.y:r.y-d));let x=0,w=0;if(a%90==0)90===a||270===a?(x=v,w=C):(x=C,w=v);else{const t=a>=0&&a<90?1:a>=90&&a<180?4:a>=180&&a<270?3:2;null!=d&&null!=h&&(C<v?(v=0,d=void 0):(C=0,h=void 0));const e=Yo.toRad(a%90);C&&(x=3===t?C/Math.cos(e):C/Math.sin(e)),v&&(w=3===t?v/Math.cos(e):v/Math.sin(e));const n=1===t||3===t;switch(b){case"top":case"bottom":w=v?v/(n?Math.cos(e):Math.sin(e)):C/(n?Math.sin(e):Math.cos(e));break;case"left":case"right":x=C?C/(n?Math.cos(e):Math.sin(e)):v/(n?Math.sin(e):Math.cos(e))}}switch(b){case"top":case"bottom":x=0;break;case"left":case"right":w=0}const E=this.graph.getGridSize();let A=Math.max(i.width+x,E),M=Math.max(i.height+w,E);e.minWidth&&e.minWidth>E&&(A=Math.max(A,e.minWidth)),e.minHeight&&e.minHeight>E&&(M=Math.max(M,e.minHeight)),e.maxWidth&&(A=Math.min(A,e.maxWidth)),e.maxHeight&&(M=Math.min(M,e.maxHeight)),e.preserveAspectRatio&&(w<x?M=A*(i.height/i.width):A=M*(i.width/i.height)),A===i.width&&M===i.height||(t.resize(A,M,{direction:m,relativeDirection:b,trueDirection:y,snapped:!0,snaplines:this.cid,restrict:this.graph.hook.getRestrictArea(n)}),u&&(u+=M-i.height),p&&(p+=A-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 s=t.getEventData(e).delegatedView||t;if(!this.isNodeMovable(s))return;const r=s.cell,o=r.getSize(),a=r.getPosition(),l=new sa(n-this.offset.x,i-this.offset.y,o.width,o.height),h=r.getAngle(),c=l.getCenter(),u=l.bbox(h),d=u.getTopLeft(),g=u.getBottomRight(),p=this.options.tolerance||0;let f,m,y,b,C,v,x=0,w=0;if(this.model.getNodes().some((t=>{if(this.isIgnored(r,t))return!1;const e=t.getBBox().bbox(t.getAngle()),n=e.getCenter(),i=e.getTopLeft(),s=e.getBottomRight();return null==f&&(Math.abs(n.x-c.x)<p?(f=n.x,x=.5):Math.abs(i.x-d.x)<p?(f=i.x,x=0):Math.abs(i.x-g.x)<p?(f=i.x,x=1):Math.abs(s.x-g.x)<p?(f=s.x,x=1):Math.abs(s.x-d.x)<p&&(f=s.x),null!=f&&(m=Math.min(u.y,e.y),y=Math.max(g.y,s.y)-m)),null==b&&(Math.abs(n.y-c.y)<p?(b=n.y,w=.5):Math.abs(i.y-d.y)<p?b=i.y:Math.abs(i.y-g.y)<p?(b=i.y,w=1):Math.abs(s.y-g.y)<p?(b=s.y,w=1):Math.abs(s.y-d.y)<p&&(b=s.y),null!=b&&(C=Math.min(u.x,e.x),v=Math.max(g.x,s.x)-C)),null!=f&&null!=b})),this.hide(),null!=b||null!=f){null!=b&&(u.y=b-w*u.height),null!=f&&(u.x=f-x*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||(r.translate(i,o,{snapped:!0,restrict:this.graph.hook.getRestrictArea(s)}),v&&(v+=i),y&&(y+=o)),this.update({verticalLeft:f,verticalTop:m,verticalHeight:y,horizontalTop:b,horizontalLeft:C,horizontalWidth:v})}}isIgnored(t,e){return e.id===t.id||e.isDescendantOf(t)||this.filterShapes[e.shape]||this.filterCells[e.id]||this.filterFunction&&Kr(this.filterFunction,this.graph,e)}update(t){if(t.horizontalTop){const e=this.graph.localToGraph(new ia(t.horizontalLeft,t.horizontalTop)),n=this.graph.localToGraph(new ia(t.horizontalLeft+t.horizontalWidth,t.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${e.x}`:"0",y1:`${e.y}`,x2:this.options.sharp?`${n.x}`:"100%",y2:`${n.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(t.verticalLeft){const e=this.graph.localToGraph(new ia(t.verticalLeft,t.verticalTop)),n=this.graph.localToGraph(new ia(t.verticalLeft,t.verticalTop+t.verticalHeight));this.vertical.setAttributes({x1:`${e.x}`,y1:this.options.sharp?`${e.y}`:"0",x2:`${n.x}`,y2:this.options.sharp?`${n.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),null==this.container.parentNode&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const t=this.options.clean,e="number"==typeof t?t:!1!==t?3e3:0;return e>0&&(this.timer=window.setTimeout((()=>{null!==this.container.parentNode&&this.unmount()}),e)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}jg([Rc.dispose()],Fg.prototype,"dispose",null);var zg=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class Bg extends fg{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(Bg.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=Bg.UPDATE_DELAYING_BATCHES;i.includes(t)&&!n.hasActiveBatch(i)&&this.updateViews(e)}const i=Bg.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,Bg.FLAG_REMOVE,n.priority,e)}onCellZIndexChanged({cell:t,options:e}){if("approx"===this.options.sorting){const n=this.findViewByCell(t);n&&this.requestViewUpdate(n,Bg.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){this.model.getConnectedEdges(t).forEach((n=>{const i=((t,e)=>t.getSourceCellId()!==e.id?t.getSourceCell():t.getTargetCellId()!==e.id?t.getTargetCell():null)(n,t);(null==i||i.isVisible())&&(e?n.show():n.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(Zc.isCellView(t)){const n=t.cell,i=this.model.getConnectedEdges(n);for(let t=0,s=i.length;t<s;t+=1){const s=i[t],r=this.findViewByCell(s);if(!r)continue;const o=["update"];s.getTargetCell()===n&&o.push("target"),s.getSourceCell()===n&&o.push("source"),this.scheduleViewUpdate(r,r.getFlag(o),r.priority,e)}}}forcePostponedViewUpdate(t,e){if(!t||!Zc.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 s=0;const r=this.findViewByCell(n.getTargetCell());if(r&&!this.isViewMounted(r)&&(s=this.dumpView(r),i.updateTerminalMagnet("target")),0===t&&0===s)return!this.dumpView(i)}return!1}scheduleViewUpdate(t,e,n,i={}){const s=t.cid,r=this.updates;let o=r.priorities[n];o||(o=r.priorities[n]={});const a=o[s]||0;(a&e)!==e&&(a||(r.count+=1),e&Bg.FLAG_REMOVE&&a&Bg.FLAG_INSERT?o[s]^=Bg.FLAG_INSERT:e&Bg.FLAG_INSERT&&a&Bg.FLAG_REMOVE&&(o[s]^=Bg.FLAG_REMOVE),o[s]|=e,this.graph.hook.onViewUpdated(t,e,i))}requestViewUpdate(t,e,n,i={}){this.scheduleViewUpdate(t,e,n,i);const s=this.isAsync();if(this.isFrozen()||s&&!1!==i.async||this.model.hasActiveBatch(Bg.UPDATE_DELAYING_BATCHES))return;const r=this.updateViews(i);s&&this.graph.trigger("render:done",{stats:r,options:i})}dumpView(t,e={}){if(null==t)return 0;const n=t.cid,i=this.updates.priorities[t.priority],s=this.registerMountedView(t)|i[n];return delete i[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(Zc.isCellView(t)){if(e&Bg.FLAG_REMOVE)return this.removeView(t.cell),0;e&Bg.FLAG_INSERT&&(this.insertView(t),e^=Bg.FLAG_INSERT)}return e?t.confirmUpdate(e,n):0}updateViews(t={}){let e,n=0,i=0,s=Bg.MIN_PRIORITY;do{e=this.updateViewsBatch(t),n+=1,i+=e.updatedCount,s=Math.min(e.priority,s)}while(!e.empty);return{priority:s,batchCount:n,updatedCount:i}}updateViewsBatch(t={}){const e=this.updates,n=e.priorities,i=t.batchSize||Bg.UPDATE_BATCH_SIZE;let s=!0,r=Bg.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){s=!1;break t}const g=Rc.views[n];if(!g){delete d[n];continue}let p=d[n];if(0==(p&Bg.FLAG_REMOVE)){const t=n in e.unmounted;if(c&&!Kr(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|=Bg.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|=Bg.FLAG_REMOVE),f.hasAction(m,"target")&&!this.isEdgeTerminalVisible(t,"target")&&(m=f.removeAction(m,"target"),m|=Bg.FLAG_REMOVE))}m>0&&(d[n]=m,!this.graph.hook.onViewPostponed(f,m,t)||d[n])?(h+=1,s=!1):(r>u&&(r=u),l+=1,delete d[n])}}return{empty:s,priority:r,mountedCount:o,unmountedCount:a,updatedCount:l,postponedCount:h}}updateViewsAsync(t={},e={processed:0,priority:Bg.MIN_PRIORITY}){const n=this.updates,i=n.animationId;if(i){if(Wo(i),0===e.processed){const e=t.before;"function"==typeof e&&Kr(e,this.graph,this.graph)}const s=this.updateViewsBatch(t),r=this.checkViewImpl({checkView:t.checkView,mountedBatchSize:Bg.MOUNT_BATCH_SIZE-s.mountedCount,unmountedBatchSize:Bg.MOUNT_BATCH_SIZE-s.unmountedCount});let o=e.processed;const a=n.count,l=r.mountedCount,h=r.unmountedCount;s.updatedCount>0&&(o+=s.updatedCount+s.unmountedCount,e.priority=Math.min(s.priority,e.priority),s.empty&&0===l?(s.priority=e.priority,s.mountedCount+=l,s.unmountedCount+=h,this.graph.trigger("render:done",{stats:s,options:t}),e.processed=0,n.count=0):e.processed=o);const c=t.progress;if(a&&"function"==typeof c&&Kr(c,this.graph,{total:a,done:s.empty,current:o}),n.animationId!==i)return}n.animationId=qo((()=>{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]|=Bg.FLAG_INSERT;const i=n.unmounted[e];return n.unmountedCids.push(e),delete n.mounted[e],i}isViewMounted(t){if(null==t)return!1;return t.cid in this.updates.mounted}getMountedViews(){return Object.keys(this.updates.mounted).map((t=>Zc.views[t]))}getUnmountedViews(){return Object.keys(this.updates.unmounted).map((t=>Zc.views[t]))}checkMountedViews(t,e){let n=0;if("function"!=typeof t)return n;const i=this.updates,s=i.mounted,r=i.mountedCids,o=null==e?r.length:Math.min(r.length,e);for(let e=0;e<o;e+=1){const i=r[e];if(!(i in s))continue;const o=Zc.views[i];if(null==o)continue;if(Kr(t,this.graph,{view:o,unmounted:!0})){r.push(i);continue}n+=1;this.registerUnmountedView(o)&&o.unmount()}return r.splice(0,o),n}checkUnmountedViews(t,e){let n=0;"function"!=typeof t&&(t=null);const i=this.updates,s=i.unmounted,r=i.unmountedCids,o=null==e?r.length:Math.min(r.length,e);for(let e=0;e<o;e+=1){const i=r[e];if(!(i in s))continue;const o=Zc.views[i];if(null==o)continue;if(t&&!Kr(t,this.graph,{view:o,unmounted:!1})){r.push(i);continue}n+=1;const a=this.registerMountedView(o);a&&this.scheduleViewUpdate(o,a,o.priority,{mounting:!0})}return r.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);return{mountedCount:this.checkUnmountedViews(e,n>0?Math.min(this.updates.unmountedCids.length-n,t.mountedBatchSize):t.mountedBatchSize),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,s=n.freezeKey;if(e&&e!==s){if(i&&s)return;n.frozen=i,n.freezeKey=e}this.options.frozen=!0;const r=n.animationId;n.animationId=null,this.isAsync()&&null!=r&&Wo(r),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 s=()=>{this.options.frozen=n.frozen=!1,n.sort&&(this.sortViews(),n.sort=!1);const i=t.after;i&&Kr(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&&Kr(e,this.graph,{done:t,current:n,total:i}),t&&s()}}))}else this.updateViews(t),s()}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,s=i.mounted,r=i.unmounted;e.remove(),delete this.views[t.id],delete s[n],delete r[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 s=0,r=i[n];if(t.isVisible()&&(!t.isEdge()||this.isEdgeTerminalVisible(t,"source")&&this.isEdgeTerminalVisible(t,"target"))){if(r)s=Bg.FLAG_INSERT;else{const e=this.graph.hook.createCellView(t);e&&(r=i[t.id]=e,r.graph=this.graph,s=this.registerUnmountedView(r)|r.getBootstrapFlag())}r&&this.requestViewUpdate(r,s,r.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")||""),s=e.getCell(n.getAttribute("data-cell-id")||""),r=i.getZIndex()||0,o=s.getZIndex()||0;return r===o?0:r<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 n in e){const e=+n;e<t&&e>i&&(i=e)}const s=this.view.stage;if(i!==-1/0){const t=e[i];s.insertBefore(n,t.nextSibling)}else s.insertBefore(n,s.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)}}findViewByCell(t){if(null==t)return null;const e=Fd.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&&Ka(t.container,{target:this.view.stage}).containsPoint(e)))}findEdgeViewsInArea(t,e={}){const n=sa.create(t);return this.model.getEdges().map((t=>this.findViewByCell(t))).filter((t=>{if(t){const i=Ka(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=sa.create(t);return this.model.getNodes().map((t=>this.findViewByCell(t))).filter((t=>{if(t){const i=Ka(t.container,{target:this.view.stage});return e.strict?n.containsRect(i):n.isIntersectWithRect(i)}return!1}))}dispose(){this.resetUpdates(),this.stopListening()}}zg([fg.dispose()],Bg.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"]}(Bg||(Bg={}));var $g=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class Rg extends fg{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(),s=this.graph.translate();if("object"==typeof n){n=`${s.tx+i.sx*(n.x||0)}px ${s.ty+i.sy*(n.y||0)}px`}"object"==typeof e&&(e=sa.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 s=e.opacity,r=e.size;let o=e.repeat||"no-repeat";const a=Zh.registry.get(o);if("function"==typeof a){const n=e.quality||1;t.width*=n,t.height*=n;const s=a(t,e);if(!(s instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");i=s.toDataURL("image/png"),o=e.repeat&&o!==e.repeat?e.repeat:"repeat","object"==typeof r?(r.width*=s.width/t.width,r.height*=s.height/t.height):void 0===r&&(e.size={width:s.width/n,height:s.height/n})}else i=t.src,void 0===r&&(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=Vi(e.size));const l=this.elem.style;l.backgroundImage=`url(${i})`,l.backgroundRepeat=o,l.opacity=null==s||s>=1?"":`${s}`,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=Vi(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()}}$g([fg.dispose()],Rg.prototype,"dispose",null);var Ig,Vg=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o},_g=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Gg extends Rc{constructor(t){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=Ig.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(Ig.containerClass)).css({width:n,height:i}),this.options.pageVisible&&this.$container.addClass(this.prefixClassName(Ig.pagedClass)),this.options.className&&this.$container.addClass(this.options.className);const s=this.graph.container;s.parentNode&&this.$container.insertBefore(s);const r=s.getAttribute("style");if(r){const t={};r.split(";").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&&(s.style[e]="",this.container.style[e]=t[e])}))}this.content=document.createElement("div"),this.$content=this.$(this.content).addClass(this.prefixClassName(Ig.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(Ig.backgroundClass)),this.$content.append(this.background),this.options.pageVisible||this.$content.append(this.graph.view.grid),this.$content.append(s),this.$content.appendTo(this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new Gg.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&&Bg.UPDATE_DELAYING_BATCHES.includes(t.name)&&this.update()}delegateBackgroundEvents(t){const e=t||bg.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());"function"==typeof(this.options.autoResizeOptions||this.options.fitTocontentOptions)&&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(){(M.IS_IE||M.IS_EDGE)&&this.$container.css("visibility","hidden")}afterManipulation(){(M.IS_IE||M.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(0===n||0===i)return;if(t>n||e>i){let s=!1;const r=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(r),s=!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(r),s=!0;s&&(oo(r,this.prefixClassName("graph-pagebreak")),this.$(this.graph.view.grid).after(r),this.pageBreak=r)}}}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=Kr(e,this,this));const n=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative",contentArea:this.calcContextArea(e)},e);this.graph.fitToContent(this.getFitToContentOptions(n))}calcContextArea(t){const e=null==t?void 0:t.direction;if(!e)return this.graph.transform.getContentArea(t);function n(t){let e=t.getBBox();if(e&&t.isNode()){const n=t.getAngle();null!=n&&0!==n&&(e=e.bbox(n))}return e}const i=this.options.pageWidth||1,s=this.options.pageHeight||1;let r=this.graph.getCells();return e.includes("top")||(r=r.filter((t=>n(t).y>=0))),e.includes("left")||(r=r.filter((t=>n(t).x>=0))),e.includes("right")||(r=r.filter((t=>{const e=n(t);return e.x+e.width<=i}))),e.includes("bottom")||(r=r.filter((t=>{const e=n(t);return e.y+e.height<=s}))),this.model.getCellsBBox(r)||new sa}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=sa.create()),t}updateScale(t,e){const n=this.graph.options,i=t/this.sx,s=e/this.sy;this.sx=t,this.sy=e,this.graph.translate(n.x*i,n.y*s),this.graph.resizeGraph(n.width*i,n.height*s)}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(),s=this.graph.matrix(),r={};return"number"==typeof t&&(r.scrollLeft=t-i.width/2+s.e+(this.padding.left||0)),"number"==typeof e&&(r.scrollTop=e-i.height/2+s.f+(this.padding.top||0)),n&&n.animation?this.$container.animate(r,n.animation):this.$container.prop(r),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,s=t.getBBox().getCenter();return this.scrollToPoint(s.x*n,s.y*i,e)}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const i=this.graph.matrix(),s=i.a,r=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*=s:t=i.x,"number"==typeof e?e*=r: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 C=this.scrollToPoint(t,e,c||void 0);return this.restoreClientSize(),C}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=sa.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:s}=i,r=_g(i,["padding"]),o=Jr(s),a=sa.fromSize(this.getClientSize()),l=a.clone().moveAndExpand({x:o.left,y:o.top,width:-o.right-o.left,height:-o.top-o.bottom});(e=Xr(e,Math.max(0,l.width)))<0&&(e=l.width+e),(n=Xr(n,Math.max(0,l.height)))<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=ia.create(t).translate(d);return this.centerPoint(g.x,g.y,r)}zoom(t,e){if(null==t)return this.sx;let n,i;e=e||{};const s=this.getClientSize(),r=this.clientToLocalPoint(s.width/2,s.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,s=a/this.sy;n=e.center.x-(e.center.x-r.x)/t,i=e.center.y-(e.center.y-r.y)/s}else n=r.x,i=r.y;return this.beforeManipulation(),this.graph.transform.scale(o,a),this.centerPoint(n,i),this.afterManipulation(),this}zoomToRect(t,e={}){const n=sa.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 s=n.getCenter();return this.centerPoint(s.x,s.y),this.afterManipulation(),this}zoomToFit(t={}){return this.zoomToRect(this.graph.getContentArea(t),t)}transitionToPoint(t,e,n){let i,s;"object"==typeof t?(n=e,e=t.y,t=t.x):e=e,null==n&&(n={});const r=this.sx,o=Math.max(n.scale||r,1e-6),a=this.getClientSize(),l=new ia(t,e),h=this.clientToLocalPoint(a.width/2,a.height/2);if(r===o){const t=h.diff(l).scale(r,r).round();i=`translate(${t.x}px,${t.y}px)`}else{const t=o/(r-o)*l.distance(h),e=h.clone().move(l,t),n=this.localToBackgroundPoint(e).round();i=`scale(${o/r})`,s=`${n.x}px ${n.y}px`}const c=n.onTransitionEnd;return this.$container.addClass(Ig.transitionClassName),this.$content.off(Ig.transitionEventName).on(Ig.transitionEventName,(n=>{this.syncTransition(o,{x:t,y:e}),"function"==typeof c&&Kr(c,this,n.originalEvent)})).css({transform:i,transformOrigin:s,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(Ig.transitionClassName),this.$content.off(Ig.transitionEventName).css({transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(t,e={}){const n=sa.create(t),i=e.maxScale||1/0,s=e.minScale||Number.MIN_VALUE,r=e.scaleGrid||null,o=e.visibility||1,a=e.center?ia.create(e.center):n.getCenter(),l=this.getClientSize(),h=l.width*o,c=l.height*o;let u=new sa(a.x-h/2,a.y-c/2,h,c).getMaxUniformScaleToFit(n,a);return u=Math.min(u,i),r&&(u=Math.floor(u/r)*r),u=Math.max(s,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 s=this.graph.matrix();return n+=this.container.scrollLeft-this.padding.left-s.e,i+=this.container.scrollTop-this.padding.top-s.f,new ia(n/s.a,i/s.d)}localToBackgroundPoint(t,e){const n="object"==typeof t?ia.create(t):new ia(t,e),i=this.graph.matrix(),s=this.padding;return Ya(n,i).translate(s.left,s.top)}resize(t,e){let n=null!=t?t:this.container.offsetWidth,i=null!=e?e:this.container.offsetHeight;"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,s=i.getBoundingClientRect();let r=0,o=0;return t<=s.left+n&&(r=-10),e<=s.top+n&&(o=-10),t>=s.right-n&&(r=n),e>=s.bottom-n&&(o=n),0!==r&&(i.scrollLeft+=r),0!==o&&(i.scrollTop+=o),{scrollerX:r,scrollerY:o}}addPadding(t,e,n,i){let s=this.getPadding();this.padding={left:Math.round(s.left+(t||0)),top:Math.round(s.top+(n||0)),bottom:Math.round(s.bottom+(i||0)),right:Math.round(s.right+(e||0))},s=this.padding,this.$content.css({width:s.left+this.graph.options.width+s.right,height:s.top+this.graph.options.height+s.bottom});const r=this.graph.container;return r.style.left=`${this.padding.left}px`,r.style.top=`${this.padding.top}px`,this}getPadding(){const t=this.options.padding;return Jr("function"==typeof t?Kr(t,this,this):t)}getVisibleArea(){const t=this.graph.matrix(),e=this.getClientSize(),n=Ja({x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:e.width,height:e.height},t.inverse());return n.x-=(this.padding.left||0)/this.sx,n.y-=(this.padding.top||0)/this.sy,n}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 Hg(t,e,n,i={}){if(n){const s=n.graph,r=s.view.normalizeEvent(e),o=s.snapToGrid(r.clientX,r.clientY);n.notify(t,Object.assign({e:r,view:n,node:n.cell,cell:n.cell,x:o.x,y:o.y},i))}}Vg([Rc.dispose()],Gg.prototype,"dispose",null),function(t){t.Background=class extends Rg{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}}}(Gg||(Gg={})),function(t){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),s=Math.max(t.height-n,0);return{left:i,top:s,right:i,bottom:s}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0},t.getOptions=function(e){const n=Qs({},t.defaultOptions,e);return null==n.pageWidth&&(n.pageWidth=e.graph.options.width),null==n.pageHeight&&(n.pageHeight=e.graph.options.height),n}}(Ig||(Ig={}));var Ug,qg,Wg=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class Xg extends Rc{constructor(t){super(),this.options=Qs({},Ug.defaultOptions,t),this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new tg([],{comparator:Ug.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(Ug.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:s,selection:r,translateBy:o}=e;let a=!this.translating;if(a=a&&(!0!==n||"none"===i),a=a&&s&&!r,a=a&&o&&t.id===o,a){this.translating=!0;const n=t.position(),i=t.previous("position"),s=n.x-i.x,r=n.y-i.y;0===s&&0===r||this.translateSelectedNodes(s,r,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]),s={},r={};n.forEach((t=>s[t.id]=t)),i.forEach((t=>r[t.id]=t));const o=[],a=[];return i.forEach((t=>{s[t.id]||o.push(t)})),n.forEach((t=>{r[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 s=this.$(i).offset(),r=i.scrollLeft,o=i.scrollTop;e=t.clientX-s.left+window.pageXOffset+r,n=t.clientY-s.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,moving:!1}),this.delegateDocumentEvents(Ug.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=>Kr(e,this.graph,t))):t}stopSelecting(t){const e=this.graph,n=this.getEventData(t);switch(n.action){case"selecting":{let t=this.$container.width(),n=this.$container.height();const i=this.$container.offset(),s=e.pageToLocal(i.left,i.top),r=e.transform.getScale();t/=r.sx,n/=r.sy;const o=new sa(s.x,s.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()}}onMouseUp(t){this.getEventData(t).action&&(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(Ug.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 s=this.graph.hook.getRestrictArea();if(s){const r=this.collection.toArray(),o=Fd.getCellsBBox(r,{deep:!0})||sa.create(),a=s.x-o.x,l=s.y-o.y,h=s.x+s.width-(o.x+o.width),c=s.y+s.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 s=t.x-e.originX,r=t.y-e.originY;n=s<=a||s>=h?0:n,i=r<=l||r>=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);switch(n.action){case"selecting":{const t=n;!0!==t.moving&&(this.$container.appendTo(this.graph.container),this.showRubberband(),t.moving=!0);const{scrollerX:i,scrollerY:s}=this.autoScrollGraph(e.clientX,e.clientY);t.scrollerX+=i,t.scrollerY+=s;const r=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:r<0?t.offsetX+r:a,top:o<0?t.offsetY+o:l,width:Math.abs(r),height:Math.abs(o)});break}case"translating":{const i=this.graph.snapToGrid(e.clientX,e.clientY),s=n,r=this.getSelectionOffset(i,s);this.options.following?this.updateSelectedNodesPosition(r):this.updateContainerPosition(r),r.dx&&(s.clientX=i.x),r.dy&&(s.clientY=i.y),this.notifyBoxEvent("box:mousemove",t,i.x,i.y);break}}this.boxesUpdated=!1}translateSelectedNodes(t,e,n,i){const s={},r=[];if(n&&(s[n.id]=!0),this.collection.toArray().forEach((t=>{t.getDescendants({deep:!0}).forEach((t=>{s[t.id]=!0}))})),i&&i.translateBy){const t=this.graph.getCellById(i.translateBy);t&&(s[t.id]=!0,t.getDescendants({deep:!0}).forEach((t=>{s[t.id]=!0})),r.push(t))}this.collection.toArray().forEach((n=>{if(!s[n.id]){const o=Object.assign(Object.assign({},i),{selection:this.cid,exclude:r});n.translate(t,e,o),this.graph.model.getConnectedEdges(n).forEach((n=>{s[n.id]||(n.translate(t,e,o),s[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 s=this.getEventData(e).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(Ug.classNames.rubberband)).removeClass(this.prefixClassName(Ug.classNames.selected))}showRubberband(){this.$container.addClass(this.prefixClassName(Ug.classNames.rubberband))}hideRubberband(){this.$container.removeClass(this.prefixClassName(Ug.classNames.rubberband))}showSelected(){this.$container.removeAttr("style").addClass(this.prefixClassName(Ug.classNames.selected))}createContainer(){this.container=document.createElement("div"),this.$container=this.$(this.container),this.$container.addClass(this.prefixClassName(Ug.classNames.root)),this.options.className&&this.$container.addClass(this.options.className),this.$selectionContainer=this.$("<div/>").addClass(this.prefixClassName(Ug.classNames.inner)),this.$selectionContent=this.$("<div/>").addClass(this.prefixClassName(Ug.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};this.collection.toArray().filter((t=>this.canShowSelectionBox(t))).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 n=this.options.content;if(n)if("function"==typeof n){const t=Kr(n,this.graph,this,this.$selectionContent[0]);t&&this.$selectionContent.html(t)}else this.$selectionContent.html(n);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.filter((t=>!!this.graph.getCellById(t.id)))};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=Fd.getCellsBBox(e).getCenter(),i=this.graph.snapToGrid(t.clientX,t.clientY),s=e.reduce(((t,e)=>(t[e.id]=Yo.normalize(e.getAngle()),t)),{});this.setEventData(t,{center:n,angles:s,start:i.theta(n)})}doRotate({e:t}){const e=this.getEventData(t),n=this.graph.options.rotating.grid,i="function"==typeof n?Kr(n,this.graph,null):n,s=this.graph.snapToGrid(t.clientX,t.clientY),r=e.start-s.theta(e.center);e.rotated||(e.rotated=!0),Math.abs(r)>.001&&(this.collection.toArray().forEach((t=>{const n=tc.snapToGrid(e.angles[t.id]+r,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=>{Hg("node:rotated",t,this.graph.findViewByCell(e))})))}startResize({e:t}){const e=this.graph.getGridSize(),n=this.collection.toArray(),i=Fd.getCellsBBox(n),s=n.map((t=>t.getBBox())),r=s.reduce(((t,e)=>e.width<t?e.width:t),1/0),o=s.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/r,minHeight:e*i.height/o})}doResize({e:t,dx:e,dy:n}){const i=this.eventData(t),s=i.bbox,r=s.width,o=s.height,a=Math.max(r+e,i.minWidth),l=Math.max(o+n,i.minHeight);i.resized||(i.resized=!0),(Math.abs(r-a)>.001||Math.abs(o-l)>.001)&&(this.graph.model.resizeCells(a,l,i.cells,{selection:this.cid}),s.width=a,s.height=l,this.updateSelectionBoxes())}stopResize({e:t}){const e=this.eventData(t);e.resized&&(e.resized=!1,this.collection.toArray().forEach((e=>{Hg("node:resized",t,this.graph.findViewByCell(e))})))}dispose(){this.clean(),this.remove()}}Wg([Rc.dispose()],Xg.prototype,"dispose",null),Nr(Xg,Eg),function(t){const e="widget-selection";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=>Sr('<%= 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=function(t){return t.getAncestors().length}}(Ug||(Ug={}));class Yg extends Og{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({},qg.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=qg.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(qg.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=Yo.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(qg.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const t=Yo.normalize(this.node.getAngle()),e=Math.floor(t*(qg.DIRECTIONS.length/360));if(e!==this.prevShift){const t=qg.DIRECTIONS.slice(e).concat(qg.DIRECTIONS.slice(0,e)),n=t=>`${this.containerClassName}-cursor-${t}`;this.$container.find(`.${this.resizeClassName}`).removeClass(qg.DIRECTIONS.map((t=>n(t))).join(" ")).each(((e,i)=>{this.$(i).addClass(n(t[e]))})),this.prevShift=e}}getTrueDirection(t){const e=Yo.normalize(this.node.getAngle());let n=qg.POSITIONS.indexOf(t);return n+=Math.floor(e*(qg.POSITIONS.length/360)),n%=qg.POSITIONS.length,qg.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),Hg("node:resize:mousedown",t,n)}prepareResizing(t,e){const n=this.getTrueDirection(e);let i=0,s=0;e.split("-").forEach((t=>{i={left:-1,right:1}[t]||i,s={top:-1,bottom:1}[t]||s}));const r=this.toValidResizeDirection(e),o={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[r],a=Yo.normalize(this.node.getAngle());this.setEventData(t,{selector:o,direction:r,trueDirection:n,relativeDirection:e,angle:a,resizeX:i,resizeY:s,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),s=this.graph.snapToGrid(i.clientX,i.clientY);this.setEventData(t,{center:n,action:"rotating",angle:Yo.normalize(this.node.getAngle()),start:ia.create(s).theta(n)}),this.startAction(t),Hg("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 s=i.clientX,r=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();s=Wn(s,n.left+e,n.right-e),r=Wn(r,n.top+e,n.bottom-e)}else this.options.autoScrollOnResizing&&o&&o.autoScroll(s,r);const l=this.graph.snapToGrid(s,r),h=this.graph.getGridSize(),c=this.node,u=this.options;if("resizing"===n.action){n=n,n.resized||(e&&(e.addClass("node-resizing"),Hg("node:resize",t,e)),n.resized=!0);const i=c.getBBox(),s=ia.create(l).rotate(n.angle,i.getCenter()).diff(i[n.selector]);let r=n.resizeX?s.x*n.resizeX:i.width,o=n.resizeY?s.y*n.resizeY:i.height;const a=r,d=o;if(r=tc.snapToGrid(r,h),o=tc.snapToGrid(o,h),r=Math.max(r,u.minWidth||h),o=Math.max(o,u.minHeight||h),r=Math.min(r,u.maxWidth||1/0),o=Math.min(o,u.maxHeight||1/0),u.preserveAspectRatio){const t=i.width*o/i.height,e=i.height*r/i.width;r<t?o=e:r=t}const g=n.relativeDirection;if(u.allowReverse&&(a<=-r||d<=-o)){let e;"left"===g?a<=-r&&(e="right"):"right"===g?a<=-r&&(e="left"):"top"===g?d<=-o&&(e="bottom"):"bottom"===g?d<=-o&&(e="top"):"top-left"===g?a<=-r&&d<=-o?e="bottom-right":a<=-r?e="top-right":d<=-o&&(e="bottom-left"):"top-right"===g?a<=-r&&d<=-o?e="bottom-left":a<=-r?e="top-left":d<=-o&&(e="bottom-right"):"bottom-left"===g?a<=-r&&d<=-o?e="top-right":a<=-r?e="bottom-right":d<=-o&&(e="top-left"):"bottom-right"===g&&(a<=-r&&d<=-o?e="top-left":a<=-r?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!==r||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(r,o,i),Hg("node:resizing",t,e)}Hg("node:resize:mousemove",t,e)}else if("rotating"===n.action){n=n,n.rotated||(e&&(e.addClass("node-rotating"),Hg("node:rotate",t,e)),n.rotated=!0);const i=c.getAngle(),s=n.start-ia.create(l).theta(n.center);let r=n.angle+s;u.rotateGrid&&(r=tc.snapToGrid(r,u.rotateGrid)),r=Yo.normalize(r),i!==r&&(c.rotate(r,{absolute:!0}),Hg("node:rotating",t,e)),Hg("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?Hg("node:resize:mouseup",t,e):"rotating"===n.action&&Hg("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=qg.DIRECTIONS[qg.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=qg.DIRECTIONS[qg.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(qg.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?Hg("node:resized",t,e):"rotating"===n.action&&n.rotated&&Hg("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}}(qg||(qg={}));var Jg,Zg=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};!function(t){t.parseOptionGroup=function(t,e,n){const i={};return Object.keys(n||{}).forEach((s=>{const r=n[s];i[s]="function"==typeof r?r.call(t,e):r})),i}}(Jg||(Jg={})),function(t){t.get=function(e){const{grid:n,panning:i,selecting:s,embedding:r,snapline:o,resizing:a,rotating:l,knob:h,clipboard:c,history:u,scroller:d,minimap:g,keyboard:p,mousewheel:f}=e,m=Zg(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=Qs({},t.defaults,m),C={size:10,visible:!1};return b.grid="number"==typeof n?{size:n,visible:!1}:"boolean"==typeof n?Object.assign(Object.assign({},C),{visible:n}):Object.assign(Object.assign({},C),n),["panning","selecting","embedding","snapline","resizing","rotating","knob","clipboard","history","scroller","minimap","keyboard","mousewheel"].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}}(Jg||(Jg={})),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:tc.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:tc.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})=>null!=("target"===t?n:e),createEdge:()=>new ug},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,multipleSelectionModifiers:["ctrl","meta"],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}}(Jg||(Jg={}));var Kg=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class Qg extends fg{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}-${Gr(JSON.stringify(t))}`),!this.isDefined(e)){const i=qh.registry.get(n);if(null==i)return qh.registry.onNotFound(n);const s=i(t.args||{}),r=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},t.attrs),{id:e});Oa.create(Uc.sanitize(s),r).appendTo(this.defs)}return e}gradient(t){let e=t.id;const n=t.type;if(e||(e=`gradient-${n}-${this.cid}-${Gr(JSON.stringify(t))}`),!this.isDefined(e)){const i=`<${n}>${t.stops.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}"/>`})).join("")}</${n}>`,s=Object.assign({id:e},t.attrs);Oa.create(i,s).appendTo(this.defs)}return e}marker(t){const{id:e,refX:n,refY:i,markerUnits:s,markerOrient:r,tagName:o,children:a}=t,l=Kg(t,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let h=e;if(h||(h=`marker-${this.cid}-${Gr(JSON.stringify(t))}`),!this.isDefined(h)){"path"!==o&&delete l.d;const t=Oa.create("marker",{refX:n,refY:i,id:h,overflow:"visible",orient:null!=r?r:"auto",markerUnits:s||"userSpaceOnUse"},a?a.map((t=>{var{tagName:e}=t,n=Kg(t,["tagName"]);return Oa.create(`${e}`||"path",Bo(Object.assign(Object.assign({},l),n)))})):[Oa.create(o||"path",Bo(l))]);this.defs.appendChild(t.node)}return h}remove(t){const e=this.svg.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}}var tp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o},ep=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class np extends fg{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(),s=Array.isArray(t)?t:[t];this.patterns.forEach(((t,r)=>{const o=`pattern_${r}`,a=n.a||1,l=n.d||1,{update:h,markup:c}=t,u=ep(t,["update","markup"]),d=Object.assign(Object.assign(Object.assign({},u),s[r]),{sx:a,sy:l,ox:n.e||0,oy:n.f||0,width:e*a,height:e*l});i.has(o)||i.add(o,Oa.create("pattern",{id:o,patternUnits:"userSpaceOnUse"},Oa.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),Fo(g,{x:p,y:f,width:d.width,height:d.height})}));const r=(new XMLSerializer).serializeToString(i.root),o=`url(data:image/svg+xml;base64,${btoa(r)})`;this.elem.style.backgroundImage=o}getInstance(){return this.instance||(this.instance=new Gh),this.instance}resolveGrid(t){if(!t)return[];const e=t.type;if(null==e)return[Object.assign(Object.assign({},Gh.presets.dot),t.args)];const n=Gh.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 Gh.registry.onNotFound(e)}dispose(){this.stopListening(),this.clear()}}tp([fg.dispose()],np.prototype,"dispose",null);class ip extends fg{getClientMatrix(){return Ga(this.view.stage.getScreenCTM())}getClientOffset(){const t=this.view.svg.getBoundingClientRect();return new ia(t.left,t.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(t,e){return("number"==typeof t?this.clientToLocalPoint(t,e):this.clientToLocalPoint(t.x,t.y)).snapToGrid(this.graph.getGridSize())}localToGraphPoint(t,e){return Ya(ia.create(t,e),this.graph.matrix())}localToClientPoint(t,e){return Ya(ia.create(t,e),this.getClientMatrix())}localToPagePoint(t,e){return("number"==typeof t?this.localToGraphPoint(t,e):this.localToGraphPoint(t)).translate(this.getPageOffset())}localToGraphRect(t,e,n,i){return Ja(sa.create(t,e,n,i),this.graph.matrix())}localToClientRect(t,e,n,i){return Ja(sa.create(t,e,n,i),this.getClientMatrix())}localToPageRect(t,e,n,i){return("number"==typeof t?this.localToGraphRect(t,e,n,i):this.localToGraphRect(t)).translate(this.getPageOffset())}graphToLocalPoint(t,e){return Ya(ia.create(t,e),this.graph.matrix().inverse())}clientToLocalPoint(t,e){return Ya(ia.create(t,e),this.getClientMatrix().inverse())}clientToGraphPoint(t,e){return Ya(ia.create(t,e),this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(t,e){const n=ia.create(t,e).diff(this.getPageOffset());return this.graphToLocalPoint(n)}graphToLocalRect(t,e,n,i){return Ja(sa.create(t,e,n,i),this.graph.matrix().inverse())}clientToLocalRect(t,e,n,i){return Ja(sa.create(t,e,n,i),this.getClientMatrix().inverse())}clientToGraphRect(t,e,n,i){return Ja(sa.create(t,e,n,i),this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(t,e,n,i){const s=sa.create(t,e,n,i),r=this.getPageOffset();return s.x-=r.x,s.y-=r.y,this.graphToLocalRect(s)}}var sp,rp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class op extends fg{constructor(){super(...arguments),this.widget=this.graph.hook.createSnapline()}dispose(){this.widget.dispose()}}rp([fg.dispose()],op.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}}t.parse=e,t.equals=function(t,n){if(null!=t&&null!=n){const i=e(t),s=e(n),r=i.or.sort(),o=s.or.sort(),a=i.and.sort(),l=s.and.sort(),h=(t,e)=>t.length===e.length&&(0===t.length||t.every(((t,n)=>t===e[n])));return h(r,o)&&h(a,l)}return null==t&&null==n},t.isMatch=function(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:s,and:r}=e(n),o=e=>{const n=`${e.toLowerCase()}Key`;return!0===t[n]};return s.some((t=>o(t)))&&r.every((t=>o(t)))}}(sp||(sp={}));var ap=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class lp extends fg{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&&sp.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?(oo(e,n),e.dataset.panning=(!!t).toString()):ao(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()}}ap([fg.dispose()],lp.prototype,"dispose",null);var hp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o},cp=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class up extends fg{get commonOptions(){const t=this.instanceOptions;return cp(t,["enabled"])}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)),this.graph.trigger("clipboard:changed",{cells:t}))}cut(t,e={}){this.disabled||(this.widget.cut(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.graph.trigger("clipboard:changed",{cells:t}))}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(),this.graph.trigger("clipboard:changed",{cells:[]}))}isEmpty(){return this.widget.isEmpty()}dispose(){this.clean(!0)}}hp([fg.dispose()],up.prototype,"dispose",null);var dp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class gp extends fg{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 s=this.getHighlighterId(e,i);if(!this.highlights[s]){const n=i.highlighter;n.highlight(t,e,Object.assign({},i.args)),this.highlights[s]={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,s=i.name,r=lc.registry.get(s);return null==r?lc.registry.onNotFound(s):(lc.check(s,r),{name:s,highlighter:r,args:i.args||{}})}getHighlighterId(t,e){return co(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()}}dp([gp.dispose()],gp.prototype,"dispose",null);var pp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class fp extends fg{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),Ga(this.viewportMatrix)}setMatrix(t){const e=Ga(t),n=qa(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 s=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},s)),this}getComputedSize(){let t=this.options.width,e=this.options.height;return Js(t)||(t=this.container.clientWidth),Js(e)||(e=this.container.clientHeight),{width:t,height:e}}getScale(){return function(t){let e,n,i,s;return t?(e=null==t.a?1:t.a,s=null==t.d?1:t.d,n=t.b,i=t.c):e=s=1,{sx:n?Math.sqrt(e*e+n*n):e,sy:i?Math.sqrt(i*i+s*s):s}}(this.getMatrix())}scale(t,e=t,n=0,i=0,s={}){if(t=this.clampScale(t),e=this.clampScale(e),n||i){const s=this.getTranslation(),r=s.tx-n*(t-1),o=s.ty-i*(e-1);r===s.tx&&o===s.ty||this.translate(r,o)}const r=this.getMatrix();return r.a=t,r.d=e,this.setMatrix(r),this.graph.trigger("scale",Object.assign({sx:t,sy:e,ox:n,oy:i},s)),this}clampScale(t){const e=this.graph.options.scaling;return Wn(t,e.min||.01,e.max||16)}getZoom(){return this.getScale().sx}zoom(t,e){e=e||{};let n=t,i=t;const s=this.getScale(),r=this.getComputedSize();let o=r.width/2,a=r.height/2;if(e.absolute||(n+=s.sx,i+=s.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(),r=o-(o-t.tx)*(n/s.sx),l=a-(a-t.ty)*(i/s.sy);r===t.tx&&l===t.ty||this.translate(r,l,{ui:e.ui})}return this.scale(n,i,0,0,{ui:e.ui}),this}getRotation(){return function(t){let e={x:0,y:1};return t&&(e=Xa(t,e)),{angle:Yo.normalize(Yo.toDeg(Math.atan2(e.y,e.x))-90)}}(this.getMatrix())}rotate(t,e,n){if(null==e||null==n){const t=Ka(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{tx:(t=this.getMatrix())&&t.e||0,ty:t&&t.f||0};var t}translate(t,e,n={}){const i=this.getMatrix();i.e=t||0,i.f=e||0,this.setMatrix(i);const s=this.getTranslation();return this.options.x=s.tx,this.options.y=s.ty,this.graph.trigger("translate",Object.assign(Object.assign({},s),n)),this}setOrigin(t,e){return this.translate(t||0,e||0)}fitToContent(t,e,n,i){if("object"==typeof t){const s=t;t=s.gridWidth||1,e=s.gridHeight||1,n=s.padding||0,i=s}else t=t||1,e=e||1,n=n||0,null==i&&(i={});const s=Jr(n),r=i.border||0,o=i.contentArea?sa.create(i.contentArea):this.getContentArea(i);r>0&&o.inflate(r);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+=s.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+=s.top,d+=p),u+=s.right,d+=s.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;return(g!==l.tx||p!==l.ty)&&this.translate(g,p),m&&this.resize(u,d),new sa(-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=ia.create(e)}else n=this.getContentBBox(t),i=this.graph.graphToLocal(n);if(!n.width||!n.height)return;const s=Jr(t.padding),r=t.minScale||0,o=t.maxScale||Number.MAX_SAFE_INTEGER,a=t.minScaleX||r,l=t.maxScaleX||o,h=t.minScaleY||r,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=sa.create(u).moveAndExpand({x:s.left,y:s.top,width:-s.left-s.right,height:-s.top-s.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=Wn(g,a,l),p=Wn(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 sa:Ka(this.graph.view.stage)}getContentBBox(t={}){return this.graph.localToGraph(this.getContentArea(t))}getGraphArea(){const t=sa.fromSize(this.getComputedSize());return this.graph.graphToLocal(t)}zoomToRect(t,e={}){const n=sa.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 s=n.getCenter();return this.centerPoint(s.x,s.y),this}zoomToFit(t={}){return this.zoomToRect(this.getContentArea(t),t)}centerPoint(t,e){const n=this.getComputedSize(),i=this.getScale(),s=this.getTranslation(),r=n.width/2,o=n.height/2;e="number"==typeof e?e:o,t=r-(t="number"==typeof t?t:r)*i.sx,e=o-e*i.sy,s.tx===t&&s.ty===e||this.translate(t,e)}centerContent(t){const e=this.graph.getContentArea(t).getCenter();this.centerPoint(e.x,e.y)}centerCell(t){return this.positionCell(t,"center")}positionPoint(t,e,n){const i=this.getComputedSize();(e=Xr(e,Math.max(0,i.width)))<0&&(e=i.width+e),(n=Xr(n,Math.max(0,i.height)))<0&&(n=i.height+n);const s=this.getTranslation(),r=this.getScale(),o=e-t.x*r.sx,a=n-t.y*r.sy;s.tx===o&&s.ty===a||this.translate(o,a)}positionRect(t,e){const n=sa.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()}}pp([fp.dispose()],fp.prototype,"dispose",null);var mp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class yp extends fg{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&&sp.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowRubberband(t)}allowMultipleSelection(t){return this.isMultiple()&&sp.isMatch(t,this.widgetOptions.multipleSelectionModifiers)}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||(this.allowMultipleSelection(t)?this.unselectMap.has(e)?this.unselectMap.delete(e):this.isSelected(e)?this.unselect(e):this.select(e):this.reset(e)),this.movedMap.delete(e)}onBoxMouseDown({e:t,cell:e}){this.disabled||this.allowMultipleSelection(t)&&(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()}}mp([fg.dispose()],yp.prototype,"dispose",null);var bp,Cp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o},vp=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};class xp extends Pc{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=bp.getOptions(t),this.validator=new xp.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)?bp.sortBatchCommands(t):[t];for(let t=n.length-1;t>=0;t-=1){const i=n[t],s=Object.assign(Object.assign({},e),sr(i.options,this.options.revertOptionsList||[]));this.executeCommand(i,!0,s)}this.freezed=!1}applyCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?bp.sortBatchCommands(t):[t];for(let t=0;t<n.length;t+=1){const i=n[t],s=Object.assign(Object.assign({},e),sr(i.options,this.options.applyOptionsList||[]));this.executeCommand(i,!1,s)}this.freezed=!1}executeCommand(t,e,n){const i=this.model,s=i.getCell(t.data.id),r=t.event;if(bp.isAddEvent(r)&&e||bp.isRemoveEvent(r)&&!e)s.remove(n);else if(bp.isAddEvent(r)&&!e||bp.isRemoveEvent(r)&&e){const e=t.data;e.node?i.addNode(e.props,n):e.edge&&i.addEdge(e.props,n)}else if(bp.isChangeEvent(r)){const i=t.data,r=i.key;if(r){const t=e?i.prev[r]:i.next[r];s.prop(r,t,n)}}else{const i=this.options.executeCommand;i&&Kr(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(bp.isAddEvent(t)&&this.options.ignoreAdd||bp.isRemoveEvent(t)&&this.options.ignoreRemove||bp.isChangeEvent(t)&&this.options.ignoreChange)return;const s=this.options.beforeAddCommand;if(null!=s&&!1===Kr(s,this,t,e))return;"cell:change:*"===t&&(t=`cell:change:${n.key}`);const r=n.cell,o=eg.isModel(r);let a;if(this.batchCommands){a=this.batchCommands[Math.max(this.lastBatchIndex,0)];const e=o&&!a.modelChange||a.data.id!==r.id,n=a.event!==t;if(this.lastBatchIndex>=0&&(e||n)){const e=this.batchCommands.findIndex((e=>(o&&e.modelChange||e.data.id===r.id)&&e.event===t));e<0||bp.isAddEvent(t)||bp.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(bp.isAddEvent(t)||bp.isRemoveEvent(t)){const e=a.data;return a.event=t,a.options=i,e.id=r.id,e.props=_i(r.toJSON()),r.isEdge()?e.edge=!0:r.isNode()&&(e.node=!0),this.push(a,i)}if(bp.isChangeEvent(t)){const n=e.key,s=a.data;return a.batch&&a.event||(a.event=t,a.options=i,s.key=n,null==s.prev&&(s.prev={}),s.prev[n]=Vi(r.previous(n)),o?a.modelChange=!0:s.id=r.id),null==s.next&&(s.next={}),s.next[n]=Vi(r.prop(n)),this.push(a,i)}const l=this.options.afterAddCommand;l&&Kr(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.consolidateCommands(),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=[];for(;e.length>0;){const t=e.shift(),i=t.event,s=t.data.id;if(null!=i&&(null!=s||t.modelChange)){if(bp.isAddEvent(i)){const t=e.findIndex((t=>bp.isRemoveEvent(t.event)&&t.data.id===s));if(t>=0){e=e.filter(((e,n)=>t<n||e.data.id!==s));continue}}else if(bp.isRemoveEvent(i)){const t=e.findIndex((t=>bp.isAddEvent(t.event)&&t.data.id===s));if(t>=0){e.splice(t,1);continue}}else if(bp.isChangeEvent(i)){const e=t.data;if(Ys(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.consolidateCommands(),this.notify("add",t,e))}consolidateCommands(){var t;const e=this.undoStack[this.undoStack.length-1],n=this.undoStack[this.undoStack.length-2];if(!Array.isArray(e))return;const i=new Set(e.map((t=>t.event)));if(2!==i.size||!i.has("cell:change:parent")||!i.has("cell:change:children"))return;if(!e.every((t=>{var e;return t.batch&&(null===(e=t.options)||void 0===e?void 0:e.ui)})))return;if(!Array.isArray(n)||1!==n.length)return;const s=n[0];"cell:change:position"===s.event&&(null===(t=s.options)||void 0===t?void 0:t.ui)&&(n.push(...e),this.undoStack.pop())}}Cp([Pc.dispose()],xp.prototype,"dispose",null),function(t){class e extends Pc{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 s=r=>{const o=e[i];i+=1;try{if(!o)return void(n=r);o(r,t,s)}catch(r){s(r)}};s(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)}}Cp([Pc.dispose()],e.prototype,"dispose",null),t.Validator=e}(xp||(xp={})),function(t){t.isAddEvent=function(t){return"cell:added"===t},t.isRemoveEvent=function(t){return"cell:removed"===t},t.isChangeEvent=function(t){return null!=t&&t.startsWith("cell:change:")},t.getOptions=function(e){const n=vp(e,["graph"]),i=["cell:added","cell:removed","cell:change:*"],s=["batch:start","batch:stop"],r=e.eventNames?e.eventNames.filter((e=>!(t.isChangeEvent(e)||i.includes(e)||s.includes(e)))):i;return Object.assign(Object.assign({},n),{eventNames:r,applyOptionsList:e.applyOptionsList||["propertyPath"],revertOptionsList:e.revertOptionsList||["propertyPath"]})},t.sortBatchCommands=function(e){const n=[];for(let i=0,s=e.length;i<s;i+=1){const s=e[i];let r=null;if(t.isAddEvent(s.event)){const t=s.data.id;for(let n=0;n<i;n+=1)if(e[n].data.id===t){r=n;break}}null!==r?n.splice(r,0,s):n.push(s)}return n}}(bp||(bp={}));var wp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class Ep extends fg{get widgetOptions(){return this.options.minimap}init(){this.widget=this.graph.hook.createMiniMap()}dispose(){this.widget&&this.widget.dispose()}}wp([fg.dispose()],Ep.prototype,"dispose",null);var Ap={exports:{}};!function(t){!function(e,n,i){if(e){for(var s,r={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"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},l={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},h=1;h<20;++h)r[111+h]="f"+h;for(h=0;h<=9;++h)r[h+96]=h.toString();m.prototype.bind=function(t,e,n){var i=this;return t=t instanceof Array?t:[t],i._bindMultiple.call(i,t,e,n),i},m.prototype.unbind=function(t,e){return this.bind.call(this,t,(function(){}),e)},m.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},m.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},m.prototype.stopCallback=function(t,e){if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(f(e,this.target))return!1;if("composedPath"in t&&"function"==typeof t.composedPath){var n=t.composedPath()[0];n!==t.target&&(e=n)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},m.prototype.handleKey=function(){var t=this;return t._handleKey.apply(t,arguments)},m.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(r[e]=t[e]);s=null},m.init=function(){var t=m(n);for(var e in t)"_"!==e.charAt(0)&&(m[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},m.init(),e.Mousetrap=m,t.exports&&(t.exports=m)}function c(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function u(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return r[t.which]?r[t.which]:o[t.which]?o[t.which]:String.fromCharCode(t.which).toLowerCase()}function d(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function g(t,e,n){return n||(n=function(){if(!s)for(var t in s={},r)t>95&&t<112||r.hasOwnProperty(t)&&(s[r[t]]=t);return s}()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function p(t,e){var n,i,s,r=[];for(n=function(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus")).split("+")}(t),s=0;s<n.length;++s)i=n[s],l[i]&&(i=l[i]),e&&"keypress"!=e&&a[i]&&(i=a[i],r.push("shift")),d(i)&&r.push(i);return{key:i,modifiers:r,action:e=g(i,r,e)}}function f(t,e){return null!==t&&t!==n&&(t===e||f(t.parentNode,e))}function m(t){var e=this;if(t=t||n,!(e instanceof m))return new m(t);e.target=t,e._callbacks={},e._directMap={};var i,s={},r=!1,o=!1,a=!1;function l(t){t=t||{};var e,n=!1;for(e in s)t[e]?n=!0:s[e]=0;n||(a=!1)}function h(t,n,i,r,o,a){var l,h,c,u,g=[],p=i.type;if(!e._callbacks[t])return[];for("keyup"==p&&d(t)&&(n=[t]),l=0;l<e._callbacks[t].length;++l)if(h=e._callbacks[t][l],(r||!h.seq||s[h.seq]==h.level)&&p==h.action&&("keypress"==p&&!i.metaKey&&!i.ctrlKey||(c=n,u=h.modifiers,c.sort().join(",")===u.sort().join(",")))){var f=!r&&h.combo==o,m=r&&h.seq==r&&h.level==a;(f||m)&&e._callbacks[t].splice(l,1),g.push(h)}return g}function g(t,n,i,s){e.stopCallback(n,n.target||n.srcElement,i,s)||!1===t(n,i)&&(function(t){t.preventDefault?t.preventDefault():t.returnValue=!1}(n),function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}(n))}function f(t){"number"!=typeof t.which&&(t.which=t.keyCode);var n=u(t);n&&("keyup"!=t.type||r!==n?e.handleKey(n,function(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}(t),t):r=!1)}function y(t,e,n,o){function h(e){return function(){a=e,++s[t],clearTimeout(i),i=setTimeout(l,1e3)}}function c(e){g(n,e,t),"keyup"!==o&&(r=u(e)),setTimeout(l,10)}s[t]=0;for(var d=0;d<e.length;++d){var f=d+1===e.length?c:h(o||p(e[d+1]).action);b(e[d],f,o,t,d)}}function b(t,n,i,s,r){e._directMap[t+":"+i]=n;var o,a=(t=t.replace(/\s+/g," ")).split(" ");a.length>1?y(t,a,n,i):(o=p(t,i),e._callbacks[o.key]=e._callbacks[o.key]||[],h(o.key,o.modifiers,{type:o.action},s,t,r),e._callbacks[o.key][s?"unshift":"push"]({callback:n,modifiers:o.modifiers,action:o.action,seq:s,level:r,combo:t}))}e._handleKey=function(t,e,n){var i,s=h(t,e,n),r={},c=0,u=!1;for(i=0;i<s.length;++i)s[i].seq&&(c=Math.max(c,s[i].level));for(i=0;i<s.length;++i)if(s[i].seq){if(s[i].level!=c)continue;u=!0,r[s[i].seq]=1,g(s[i].callback,n,s[i].combo,s[i].seq)}else u||g(s[i].callback,n,s[i].combo);var p="keypress"==n.type&&o;n.type!=a||d(t)||p||l(r),o=u&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var i=0;i<t.length;++i)b(t[i],e,n)},c(t,"keypress",f),c(t,"keydown",f),c(t,"keyup",f)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(Ap);var Mp=Ap.exports,Sp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class Op extends Oc{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=Op.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){if(this.isInputEvent(t.e))return;this.target.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?Kr(n,this.graph,e):e}isGraphEvent(t){const e=t.srcElement||t.target,n=t.currentTarget;return!!e&&(e===this.target||n===this.target||e===document.body||Eo(this.container,e))}isInputEvent(t){var e;const n=t.target,i=null===(e=null==n?void 0:n.tagName)||void 0===e?void 0:e.toLowerCase();return["input","textarea"].includes(i)}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 Kr(this.options.guard,this.graph,t)}return e}dispose(){this.mousetrap.reset()}}Sp([Oc.dispose()],Op.prototype,"dispose",null),function(t){t.createMousetrap=function(t){const e=new Mp(t.target),n=e.stopCallback;return e.stopCallback=(i,s,r)=>!t.isEnabledForEvent(i)||!!n&&n.call(e,i,s,r),e}}(Op||(Op={}));var kp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class Pp extends Oc{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 ll(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))&&sp.isMatch(e,this.options.modifiers)}onMouseWheel(t){const e=t.originalEvent||t,n=this.options.guard;if((null==n||n.call(this.graph,e))&&sp.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);t.deltaY<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 n=this.graph.scroller.widget,i=this.currentScale;let s=this.graph.transform.clampScale(i*this.cumulatedFactor);if(s=Wn(s,this.options.minScale||Number.MIN_SAFE_INTEGER,this.options.maxScale||Number.MAX_SAFE_INTEGER),s!==i)if(n)if(this.options.zoomAtMousePosition){const t=this.graph.coord.clientToLocalPoint(this.startPos);n.zoom(s,{absolute:!0,center:t.clone()})}else n.zoom(s,{absolute:!0});else if(this.options.zoomAtMousePosition){const t=this.graph.coord.clientToGraphPoint(this.startPos);this.graph.transform.zoom(s,{absolute:!0,center:t.clone(),ui:!0})}else this.graph.transform.zoom(s,{absolute:!0,ui:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}kp([Oc.dispose()],Pp.prototype,"dispose",null);var Tp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class Dp extends fg{show(t={}){const e=Object.assign(Object.assign({},Dp.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=l(document.body),i=l(this.view.container),s=this.view.prefixClassName("graph-printing");n.addClass(s);const r=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(s),t.forEach((t=>t.remove())),i.append(r),l(`#${this.styleSheetId}`).remove(),this.graph.trigger("after:print",e),l(window).off("afterprint",a))};l(window).one("afterprint",a),setTimeout(a,200),window.print()}}createPrintPage(t,e){this.graph.trigger("before:print",e);const n=l("<div/>").addClass(this.className),i=l("<div/>").addClass(this.view.prefixClassName("graph-print-inner")).css("position","relative");e.size&&n.addClass(`${this.className}-size-${e.size}`);const s=Oa.create(this.view.svg).clone(),r=s.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`);i.append(s.node);const o=this.getSheetSize(e),a=this.graph.transform.getGraphArea(),h=this.graph.transform.getScale(),c=this.graph.translate(),u=Ga().translate(c.tx/h.sx,c.ty/h.sy),d=this.getPageInfo(a,t,o),g=d.scale,p=d.bbox;return i.css({left:0,top:0}),s.attr({width:p.width*g,height:p.height*g,style:"position:relative",viewBox:[p.x,p.y,p.width,p.height].join(" ")}),r.attr("transform",qa(u)),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 s=this.getPageSize(n,t.page);this.getPageAreas(n,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=Jr(e.margin),s=e.marginUnit||"",r=e.sheetUnit||"",o=`\n      @media print {\n        .${this.className}.${this.className}-ready {\n          ${n}\n        }\n\n        @page {\n          margin:\n          ${[i.top+s,i.right+s,i.bottom+s,i.left+s].join(" ")};\n          size: ${e.sheet.width+r} ${e.sheet.height+r};\n\n        .${this.className}.${this.className}-preview {\n          ${n}\n        }\n      }`,a=this.styleSheetId,h=l(`#${a}`);h.length?h.html(o):l("head").append(`'<style type="text/css" id="${a}">${o}</style>'`)}getPrintArea(t){let e=t.area;if(!e){const n=Jr(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,s=e.height;for(let e=0,r=0;e<t.height&&r<200;e+=s,r+=1)for(let r=0,o=0;r<t.width&&o<200;r+=i,o+=1)n.push(new sa(t.x+r,t.y+e,i,s));return n}getSheetSize(t){const e=t.sheet,n=Jr(t.margin),i=t.marginUnit||"",s=t.sheetUnit||"",r=`calc(${e.width}${s} - ${n.left+n.right}${i})`,o=`calc(${e.height}${s} - ${n.top+n.bottom}${i})`,a=Uo.measure(r,o);return{cssWidth:r,cssHeight:o,width:a.width,height:a.height}}getPageInfo(t,e,n){const i=new sa(e.x-t.x,e.y-t.y,e.width,e.height),s=i.width/i.height,r=n.width/n.height;return{bbox:i,scale:r<s?n.width/i.width:n.height/i.height,fitHorizontal:r<s}}dispose(){}}Tp([fg.dispose()],Dp.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)}}(Dp||(Dp={}));class Np extends fg{toSVG(t,e={}){this.graph.trigger("before:export",e);const n=this.view.svg,i=Oa.create(n).clone();let s=i.node;const r=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(" ")),r.removeAttribute("transform"),!1!==e.copyStyles){const t=n.ownerDocument,e=Array.from(n.querySelectorAll("*")),i=Array.from(s.querySelectorAll("*")),r=t.styleSheets.length,o=[];for(let e=r-1;e>=0;e-=1)o[e]=t.styleSheets[e],t.styleSheets[e].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})),r!==t.styleSheets.length&&o.forEach(((e,n)=>{t.styleSheets[n]=e}));for(let e=0;e<r;e+=1)t.styleSheets[e].disabled=!1;const h={};e.forEach(((t,e)=>{const n=window.getComputedStyle(t,null),i=a[e],s={};Object.keys(n).forEach((t=>{var e;e=t,!Array.isArray(e)&&e-parseFloat(e)+1>=0||n.getPropertyValue(t)===i[t]||(s[t]=n.getPropertyValue(t))})),h[e]=s})),i.forEach(((t,e)=>{l(t).css(h[e])}))}const h=e.stylesheet;if("string"==typeof h){const t=n.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(h);i.prepend(Oa.create("style",{type:"text/css"},[t]))}const c=()=>{const n=e.beforeSerialize;if("function"==typeof n){const t=Kr(n,this.graph,s);t instanceof SVGSVGElement&&(s=t)}const i=(new XMLSerializer).serializeToString(s).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");_o.imageToDataUri(n,((n,i)=>{!n&&i&&t.attr("xlink:href",i),e()}))}))));Promise.all(t).then(c)}else c()}toDataURL(t,e){let n=e.viewBox||this.graph.getContentBBox();const i=Jr(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 s=new sa(-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,r=n.height+i.top+i.bottom;s.scale(t/e.width,r/e.height)}n=sa.create(n).moveAndExpand(s);const r="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(r.width*o),1),height:Math.max(Math.round(r.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 s=e.getImageData(n,i,1,1).data;if(1!==s[0]||1!==s[1]||1!==s[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 s=n.toDataURL(e.type,e.quality);t(s)}catch(t){}},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 jp extends fg{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 Lp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class Fp extends fg{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 ll(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&&sp.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;const s=this.graph.transform.getTranslation(),r=s.tx+n,o=s.ty+i;this.graph.transform.translate(r,o,{ui:!0})}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?(oo(t,e),ao(t,n)):(ao(t,e),oo(t,n)):(ao(t,e),ao(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 s=0,r=0;t<=i.left+n&&(s=-10),e<=i.top+n&&(r=-10),t>=i.right-n&&(s=n),e>=i.bottom-n&&(r=n),0===s&&0===r||this.graph.translateBy(-s,-r)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}Lp([fg.dispose()],Fp.prototype,"dispose",null);var zp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class Bp extends fg{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;ul.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(){ul.clear(this.getContainer())}}zp([fg.dispose()],Bp.prototype,"dispose",null);var $p,Rp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o},Ip=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 s=0;for(i=Object.getOwnPropertySymbols(t);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(t,i[s])&&(n[i[s]]=t[i[s]])}return n};!function(t){t.hook=function(t,e){return(n,i,s)=>{const r=s.value,o=e||i;s.value=function(...e){const n=this.options[o];if(null!=n){this.getNativeValue=r.bind(this,...e);const i=Kr(n,this.graph,...e);if(this.getNativeValue=null,null!=i||!0===t&&null===i)return i}return r.call(this,...e)}}},t.after=function(t){return(e,n,i)=>{const s=i.value,r=t||n;i.value=function(...t){let e=s.call(this,...t);const n=this.options[r];return null!=n&&(e=Kr(n,this.graph,...t)&&e),e}}}}($p||($p={}));class Vp extends fg{createModel(){if(this.options.model)return this.options.model;const t=new eg;return t.graph=this.graph,t}createView(){return new bg(this.graph)}createRenderer(){return new Bg(this.graph)}createDefsManager(){return new Qg(this.graph)}createGridManager(){return new np(this.graph)}createCoordManager(){return new ip(this.graph)}createKnobManager(){return new jp(this.graph)}createTransform(t,e){const n=this.getTransformOptions(t);return n.resizable||n.rotatable?new Yg(Object.assign(Object.assign({node:t,graph:this.graph},n),e)):(n.clearAll&&Yg.removeInstances(this.graph),null)}createKnob(t,e){const n=Jg.parseOptionGroup(this.graph,t,this.options.knob),i=Object.assign(Object.assign({},n),e);i.clearAll&&kg.removeInstances(this.graph),i.clearAll=!1;const s=t.prop("knob"),r=[];return(Array.isArray(s)?s:[s]).forEach(((e,s)=>{e&&!1!==e.enabled&&("function"==typeof e.enabled&&!1===e.enabled.call(this.graph,t)||n.enabled&&r.push(new kg(Object.assign({node:t,index:s,graph:this.graph},i))))})),r}getTransformOptions(t){const e=Jg.parseOptionGroup(this.graph,t,this.options.resizing),n=Jg.parseOptionGroup(this.graph,t,this.options.rotating),i=Jg.parseOptionGroup(this.graph,t,this.options.transforming);return 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})}createTransformManager(){return new fp(this.graph)}createHighlightManager(){return new gp(this.graph)}createBackgroundManager(){return new Rg(this.graph)}createClipboard(){return new qp}createClipboardManager(){return new up(this.graph)}createSnapline(){return new Fg(Object.assign({graph:this.graph},this.options.snapline))}createSnaplineManager(){return new op(this.graph)}createSelection(){return new Xg(Object.assign({graph:this.graph},this.options.selecting))}createSelectionManager(){return new yp(this.graph)}allowRubberband(t){return!0}createHistoryManager(){return new xp(Object.assign({graph:this.graph},this.options.history))}createScroller(){return this.options.scroller.enabled?new Gg(Object.assign({graph:this.graph},this.options.scroller)):null}createScrollerManager(){return new lp(this.graph)}allowPanning(t){return!0}createMiniMap(){const t=this.options.minimap,{enabled:e}=t,n=Ip(t,["enabled"]);return e?new Ng(Object.assign({graph:this.graph},n)):null}createMiniMapManager(){return new Ep(this.graph)}createKeyboard(){return new Op(Object.assign({graph:this.graph},this.options.keyboard))}createMouseWheel(){return new Pp(Object.assign({graph:this.graph},this.options.mousewheel))}createPrintManager(){return new Dp(this.graph)}createFormatManager(){return new Np(this.graph)}createPanningManager(){return new Fp(this.graph)}createSizeManager(){return new Bp(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),s=t.getSourceCell(),r=t.getTargetCell(),o=this.graph.findViewByCell(s),a=this.graph.findViewByCell(r);return Kr(n,this.graph,{edge:t,edgeView:i,sourceCell:s,targetCell:r,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||Kr(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||Kr(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=Kr(i,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),null==n&&(n=new ug),n}validateConnection(t,e,n,i,s,r,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=r?r.cell:null,f="target"===s?n:t,m="target"===s?i:e;let y=!0;const b=a=>{const l="source"===s?o?o.port:null:p?p.getSourcePortId():null,h="target"===s?o?o.port:null:p?p.getTargetPortId():null;return Kr(a,this.graph,{edge:p,edgeView:r,sourceView:t,targetView:n,sourcePort:l,targetPort:h,sourceMagnet:e,targetMagnet:i,sourceCell:t?t.cell:null,targetCell:n?n.cell:null,type:s})};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&&Jd.isEdgeView(f)&&(y=!1):y=b(c)),y&&null!=h&&null==m&&("boolean"==typeof h?!h&&Zd.isNodeView(f)&&(y=!1):y=b(h)),y&&null!=d&&r){const t=r.cell,e="source"===s?o:t.getSource(),n="target"===s?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"===s,incoming:"target"===s});if(t.length)if("withPort"===d){t.some((t=>{const i=t.getSource(),s=t.getTarget();return i&&s&&i.cell===e.cell&&s.cell===n.cell&&null!=i.port&&i.port===e.port&&null!=s.port&&s.port===n.port}))&&(y=!1)}else if(!d){t.some((t=>{const i=t.getSource(),s=t.getTarget();return i&&s&&i.cell===e.cell&&s.cell===n.cell}))&&(y=!1)}}}return y&&null!=g&&(y=b(g)),y}getRestrictArea(t){const e=this.options.translating.restrict,n="function"==typeof e?Kr(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&Bg.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=Zc.registry.get(i);return n?new n(t,e):Zc.registry.onNotFound(i)}return t.isNode()?new Zd(t,e):t.isEdge()?new Jd(t,e):null}getHTMLComponent(t){let e=t.getHTML();return"string"==typeof e&&(e=dg.componentRegistry.get(e)||e),Ye(e)&&(e=e.render),"function"==typeof e?Kr(e,this.graph,t):e}shouldUpdateHTMLComponent(t){let e=t.getHTML();if("string"==typeof e&&(e=dg.componentRegistry.get(e)||e),Ye(e)){const n=e.shouldComponentUpdate;return"function"==typeof n?Kr(n,this.graph,t):!!n}return!1}onEdgeLabelRendered(t){}onPortRendered(t){}onToolItemCreated(t){}}Rp([$p.hook()],Vp.prototype,"createModel",null),Rp([$p.hook()],Vp.prototype,"createView",null),Rp([$p.hook()],Vp.prototype,"createRenderer",null),Rp([$p.hook()],Vp.prototype,"createDefsManager",null),Rp([$p.hook()],Vp.prototype,"createGridManager",null),Rp([$p.hook()],Vp.prototype,"createCoordManager",null),Rp([$p.hook()],Vp.prototype,"createKnobManager",null),Rp([$p.hook()],Vp.prototype,"createTransform",null),Rp([$p.hook()],Vp.prototype,"createKnob",null),Rp([$p.hook()],Vp.prototype,"createTransformManager",null),Rp([$p.hook()],Vp.prototype,"createHighlightManager",null),Rp([$p.hook()],Vp.prototype,"createBackgroundManager",null),Rp([$p.hook()],Vp.prototype,"createClipboard",null),Rp([$p.hook()],Vp.prototype,"createClipboardManager",null),Rp([$p.hook()],Vp.prototype,"createSnapline",null),Rp([$p.hook()],Vp.prototype,"createSnaplineManager",null),Rp([$p.hook()],Vp.prototype,"createSelection",null),Rp([$p.hook()],Vp.prototype,"createSelectionManager",null),Rp([$p.hook()],Vp.prototype,"allowRubberband",null),Rp([$p.hook()],Vp.prototype,"createHistoryManager",null),Rp([$p.hook()],Vp.prototype,"createScroller",null),Rp([$p.hook()],Vp.prototype,"createScrollerManager",null),Rp([$p.hook()],Vp.prototype,"allowPanning",null),Rp([$p.hook()],Vp.prototype,"createMiniMap",null),Rp([$p.hook()],Vp.prototype,"createMiniMapManager",null),Rp([$p.hook()],Vp.prototype,"createKeyboard",null),Rp([$p.hook()],Vp.prototype,"createMouseWheel",null),Rp([$p.hook()],Vp.prototype,"createPrintManager",null),Rp([$p.hook()],Vp.prototype,"createFormatManager",null),Rp([$p.hook()],Vp.prototype,"createPanningManager",null),Rp([$p.hook()],Vp.prototype,"createSizeManager",null),Rp([$p.after()],Vp.prototype,"onViewUpdated",null),Rp([$p.after()],Vp.prototype,"onViewPostponed",null),Rp([$p.hook()],Vp.prototype,"getCellView",null),Rp([$p.hook(!0)],Vp.prototype,"createCellView",null),Rp([$p.hook()],Vp.prototype,"getHTMLComponent",null),Rp([$p.hook()],Vp.prototype,"shouldUpdateHTMLComponent",null),Rp([$p.hook()],Vp.prototype,"onEdgeLabelRendered",null),Rp([$p.hook()],Vp.prototype,"onPortRendered",null),Rp([$p.hook()],Vp.prototype,"onToolItemCreated",null);var _p,Gp,Hp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class Up extends Pc{constructor(t){super(),this.options=Jg.get(t),this.css=new vg(this),this.hook=new Vp(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 Up.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=>$d.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=>Xd.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,s){return this.model.getNodesInArea(t,e,n,i,s)}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",s="string"==typeof t?e:t,r="function"==typeof e?n:e;this.startBatch(i,r);const o=s();return this.stopBatch(i,r),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 Fd.isCell(t)?this.findViewByCell(t):this.findViewByElem(t)}findViews(t){return sa.isRectangleLike(t)?this.findViewsInArea(t):ia.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,s){const r="number"==typeof t?{x:t,y:e,width:n,height:i}:t,o="number"==typeof t?s:e;return this.renderer.findViewsInArea(r,o)}isViewMounted(t){return this.renderer.isViewMounted(t)}getMountedViews(){return this.renderer.getMountedViews()}getUnmountedViews(){return this.renderer.getUnmountedViews()}matrix(t){return void 0===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 void 0===t?this.transform.getScale():(this.transform.scale(t,e,n,i),this)}zoom(t,e){const n=this.scroller.widget;if(n){if(void 0===t)return n.zoom();n.zoom(t,e)}else{if(void 0===t)return this.transform.getZoom();this.transform.zoom(t,e)}return this}zoomTo(t,e={}){const n=this.scroller.widget;return n?n.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})):this.transform.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}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 void 0===t?this.transform.getRotation():(this.transform.rotate(t,e,n),this)}translate(t,e){return void 0===t?this.transform.getTranslation():(this.transform.translate(t,e),this)}translateBy(t,e){const n=this.translate(),i=n.tx+t,s=n.ty+e;return this.translate(i,s)}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 s=this.scroller.widget;return s?s.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 sa.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 sa.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 sa.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 sa.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 sa.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 sa.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 sa.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(){return this.scroller.widget?this.scroller.pannable:this.panning.pannable}enablePanning(){return this.scroller.widget?this.scroller.enablePanning():this.panning.enablePanning(),this}disablePanning(){return this.scroller.widget?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(){return this.scroller.widget.scrollbarPosition()}setScrollbarPosition(t,e,n){return this.scroller.widget.scrollbarPosition(t,e,n),this}scrollToPoint(t,e,n){return this.scroller.widget.scrollToPoint(t,e,n),this}scrollToContent(t){return this.scroller.widget.scrollToContent(t),this}scrollToCell(t,e){return this.scroller.widget.scrollToCell(t,e),this}transitionToPoint(t,e,n){return this.scroller.widget.transitionToPoint(t,e,n),this}transitionToRect(t,e={}){return this.scroller.widget.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()}}Hp([mg.checkScroller()],Up.prototype,"lockScroller",null),Hp([mg.checkScroller()],Up.prototype,"unlockScroller",null),Hp([mg.checkScroller()],Up.prototype,"updateScroller",null),Hp([mg.checkScroller()],Up.prototype,"getScrollbarPosition",null),Hp([mg.checkScroller()],Up.prototype,"setScrollbarPosition",null),Hp([mg.checkScroller()],Up.prototype,"scrollToPoint",null),Hp([mg.checkScroller()],Up.prototype,"scrollToContent",null),Hp([mg.checkScroller()],Up.prototype,"scrollToCell",null),Hp([mg.checkScroller()],Up.prototype,"transitionToPoint",null),Hp([mg.checkScroller()],Up.prototype,"transitionToRect",null),Hp([Pc.dispose()],Up.prototype,"dispose",null),function(t){t.View=bg,t.Hook=Vp,t.Renderer=Bg,t.Keyboard=Op,t.MouseWheel=Pp,t.BaseManager=fg,t.DefsManager=Qg,t.GridManager=np,t.CoordManager=ip,t.PrintManager=Dp,t.FormatManager=Np,t.MiniMapManager=Ep,t.HistoryManager=xp,t.SnaplineManager=op,t.ScrollerManager=lp,t.ClipboardManager=up,t.TransformManager=fp,t.HighlightManager=gp,t.BackgroundManager=Rg,t.SelectionManager=yp}(Up||(Up={})),function(t){t.toStringTag=`X6.${t.name}`,t.isGraph=function(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}}(Up||(Up={})),function(t){t.render=function(e,n){const i=e instanceof HTMLElement?new t({container:e}):new t(e);return null!=n&&i.fromJSON(n),i}}(Up||(Up={})),function(t){t.registerNode=$d.registry.register,t.registerEdge=Xd.registry.register,t.registerView=Zc.registry.register,t.registerAttr=zh.registry.register,t.registerGrid=Gh.registry.register,t.registerFilter=qh.registry.register,t.registerNodeTool=pu.registry.register,t.registerEdgeTool=fu.registry.register,t.registerBackground=Zh.registry.register,t.registerHighlighter=lc.registry.register,t.registerPortLayout=fc.registry.register,t.registerPortLabelLayout=Ec.registry.register,t.registerMarker=Ch.registry.register,t.registerRouter=yd.registry.register,t.registerConnector=Sd.registry.register,t.registerAnchor=Du.registry.register,t.registerEdgeAnchor=zu.registry.register,t.registerConnectionPoint=Vu.registry.register,t.registerConnectionStrategy=Hc.registry.register,t.registerHTMLComponent=dg.componentRegistry.register}(Up||(Up={})),function(t){t.unregisterNode=$d.registry.unregister,t.unregisterEdge=Xd.registry.unregister,t.unregisterView=Zc.registry.unregister,t.unregisterAttr=zh.registry.unregister,t.unregisterGrid=Gh.registry.unregister,t.unregisterFilter=qh.registry.unregister,t.unregisterNodeTool=pu.registry.unregister,t.unregisterEdgeTool=fu.registry.unregister,t.unregisterBackground=Zh.registry.unregister,t.unregisterHighlighter=lc.registry.unregister,t.unregisterPortLayout=fc.registry.unregister,t.unregisterPortLabelLayout=Ec.registry.unregister,t.unregisterMarker=Ch.registry.unregister,t.unregisterRouter=yd.registry.unregister,t.unregisterConnector=Sd.registry.unregister,t.unregisterAnchor=Du.registry.unregister,t.unregisterEdgeAnchor=zu.registry.unregister,t.unregisterConnectionPoint=Vu.registry.unregister,t.unregisterConnectionStrategy=Hc.registry.unregister,t.unregisterHTMLComponent=dg.componentRegistry.unregister}(Up||(Up={}));class qp{constructor(){this.cells=[]}copy(t,e,n={}){this.options=Object.assign({},n);const i=(eg.isModel(e)?e:e.model).cloneSubGraph(t,n);this.cells=rr(Object.keys(i).map((t=>i[t])),(t=>t.isEdge()?2:1)),this.serialize(n)}cut(t,e,n={}){this.copy(t,e,n);(Up.isGraph(e)?e.model:e).batchUpdate("cut",(()=>{t.forEach((t=>t.remove()))}))}paste(t,e={}){const n=Object.assign(Object.assign({},this.options),e),{offset:i,edgeProps:s,nodeProps:r}=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),r&&t.isNode()&&t.prop(r),s&&t.isEdge()&&t.prop(s)}));const h=Up.isGraph(t)?t.model:t;return h.batchUpdate("paste",(()=>{h.addCells(this.cells)})),this.copy(l,t,e),l}serialize(t){!1!==t.useLocalStorage&&_p.save(this.cells)}deserialize(t){if(t.useLocalStorage){const t=_p.fetch();t&&(this.cells=t)}}isEmpty(){return this.cells.length<=0}clean(){this.options={},this.cells=[],_p.clean()}}!function(t){const e=`${Qh.prefixCls}.clipboard.cells`;t.save=function(t){if(window.localStorage){const n=t.map((t=>t.toJSON()));localStorage.setItem(e,JSON.stringify(n))}},t.fetch=function(){if(window.localStorage){const t=localStorage.getItem(e),n=t?JSON.parse(t):[];if(n)return eg.fromJSON(n)}},t.clean=function(){window.localStorage&&localStorage.removeItem(e)}}(_p||(_p={}));class Wp{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){return t.cell.getBBox()}return t.getBBox()},content(t){const e=Sr("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=>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=Kr(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 s=i.cell;s.hasLoop()&&this.makeLoopEdge(s),this.halo.stopBatch(),this.halo.trigger("action:edge:addde",{edge:s}),this.edgeView=null}this.graph.view.delegateEvents()}makeLoopEdge(t){let e=null,n=null;const i=this.options.loopEdgeWidth,s=this.graph.options,r=new sa(0,0,s.width,s.height),o=this.graph.graphToLocal(this.view.getBBox());[this.options.loopEdgePreferredSide,"top","bottom","left","right"].some((t=>{let s=null,a=0,l=0;switch(t){case"top":s=new ia(o.x+o.width/2,o.y-i),a=i/2;break;case"bottom":s=new ia(o.x+o.width/2,o.y+o.height+i),a=i/2;break;case"left":s=new ia(o.x-i,o.y+o.height/2),l=i/2;break;case"right":s=new ia(o.x+o.width+i,o.y+o.height/2),l=i/2}return!!s&&(e=s.translate(-a,-l),n=s.translate(a,l),r.containsPoint(e)&&r.containsPoint(n))}))&&e&&n&&t.setVertices([e,n])}startResize({e:t}){this.halo.startBatch(),this.flip=[1,0,0,1,1,0,0,1][Math.floor(Yo.normalize(this.node.getAngle())/45)],this.view.addClass("node-resizing"),Hg("node:resize",t,this.view)}doResize({e:t,dx:e,dy:n}){const i=this.node.getSize(),s=Math.max(i.width+(this.flip?e:n),1),r=Math.max(i.height+(this.flip?n:e),1);this.node.resize(s,r,{absolute:!0}),Hg("node:resizing",t,this.view)}stopResize({e:t}){this.view.removeClass("node-resizing"),Hg("node:resized",t,this.view),this.halo.stopBatch()}startClone({e:t,x:e,y:n}){this.halo.startBatch();const i=this.options.clone(this.cell,{clone:!0});if(!Fd.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 s=this.graph.renderer.findViewByCell(i);s.onMouseDown(t,e,n),this.halo.setEventData(t,{cloneView:s})}centerNodeAtCursor(t,e,n){const i=t.getBBox().getCenter(),s=e-i.x,r=n-i.y;t.translate(s,r)}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(!Fd.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 s=this.createEdgeConnectedToSource(),r=this.graph.renderer.findViewByCell(i),o=this.getMagnet(r,"target"),a=this.getEdgeTerminal(r,o);s.setTarget(a),this.model.addEdge(s,{halo:this.halo.cid,async:!1}),r.onMouseDown(t,e,n),this.halo.setEventData(t,{cloneView:r})}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(),s=[this.node];this.options.rotateEmbeds&&this.node.getDescendants({deep:!0}).reduce(((t,e)=>(e.isNode()&&t.push(e),t)),s),this.halo.setEventData(t,{center:i,nodes:s,rotateStartAngles:s.map((t=>t.getAngle())),clientStartAngle:new ia(e,n).theta(i)}),s.forEach((e=>{const n=this.graph.findViewByCell(e);n&&(n.addClass("node-rotating"),Hg("node:rotate",t,n))}))}doRotate({e:t,x:e,y:n}){const i=this.halo.getEventData(t),s=i.clientStartAngle-new ia(e,n).theta(i.center);i.nodes.forEach(((e,n)=>{const r=i.rotateStartAngles[n],o=tc.snapToGrid(r+s,this.options.rotateGrid);e.rotate(o,{absolute:!0,center:i.center,halo:this.halo.cid}),Hg("node:rotating",t,this.graph.findViewByCell(e))}))}stopRotate({e:t}){this.halo.getEventData(t).nodes.forEach((e=>{const n=this.graph.findViewByCell(e);n.removeClass("node-rotating"),Hg("node:rotated",t,n)})),this.halo.stopBatch()}unlink(){this.halo.startBatch(),this.model.removeConnectedEdges(this.cell),this.halo.stopBatch()}}class Xp{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=>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 Yp extends Og{get type(){return this.options.type||"surround"}get handleOptions(){return this.options}init(t){this.options=Qs(Yp.defaultOptions,this.cell.isNode()?new Wp(this).getPresets():this.cell.isEdge()?new Xp(this).getPresets():null,t),this.render(),this.initHandles(),this.update(),this.startListening()}startListening(){const t=this.model,e=this.graph;this.view.cell.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(Gp.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(Gp.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=Kr(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?Kr(e,this,t):e;return sa.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()}}(Yp||(Yp={})),Object.getOwnPropertyNames(Eg.prototype).forEach((t=>{"constructor"!==t&&Object.defineProperty(Yp.prototype,t,Object.getOwnPropertyDescriptor(Eg.prototype,t))})),function(t){t.NODE_CLS="has-widget-halo"}(Gp||(Gp={}));var Jp,Zp,Kp,Qp=function(t,e,n,i){var s,r=arguments.length,o=r<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--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,n,o):s(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o};class tf extends Rc{constructor(t){super(),this.options=Object.assign(Object.assign({},tf.defaults),t),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName("widget-dnd")),this.draggingGraph=new Up(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 Up.isGraph(t)?t.scroller.widget:t}get targetGraph(){const t=this.options.target;return Up.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(tf.documentEvents,n.data)}isSnaplineEnabled(){return this.snapline&&!this.snapline.disabled}prepareDragging(t,e,n){const i=this.draggingGraph,s=i.model,r=this.options.getDragNode(t,{sourceNode:t,draggingGraph:i,targetGraph:this.targetGraph});r.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),s.resetCells([r]);const a=i.findViewByCell(r);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=r,this.draggingView=a,this.draggingBBox=r.getBBox(),this.padding=o,this.originOffset=this.updateGraphPosition(e,n)}updateGraphPosition(t,e){const n=document.body.scrollTop||document.documentElement.scrollTop,i=this.delta,s=this.geometryBBox,r=this.padding||5,o={left:t-i.x-s.width/2-r,top:e-i.y-s.height/2-r+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,s=n.clientY;this.updateGraphPosition(i,s);const r=this.updateNodePosition(i,s),o=this.targetGraph.options.embedding.enabled,a=(o||this.isSnaplineEnabled())&&this.isInsideValidArea({x:i,y:s});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:r.x,y:r.y}):this.snapline.hide())}}onDragEnd(t){const e=this.draggingNode;if(e){const n=this.normalizeEvent(t),i=this.draggingView,s=this.draggingBBox,r=this.snapOffset;let o=s.x,a=s.y;r&&(o+=r.x,a+=r.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")};Qr(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,n=null;const i=this.targetGraph,s=this.targetScroller;this.options.dndContainer&&(n=this.getDropArea(this.options.dndContainer));const r=n&&n.containsPoint(t);if(s)if(s.options.autoResize)e=this.getDropArea(s.container);else{const t=this.getDropArea(s.container);e=this.getDropArea(i.container).intersectsWithRect(t)}else e=this.getDropArea(i.container);return!r&&e&&e.containsPoint(t)}getDropArea(t){const e=this.$(t),n=e.offset(),i=document.body.scrollTop||document.documentElement.scrollTop,s=document.body.scrollLeft||document.documentElement.scrollLeft;return sa.create({x:n.left+parseInt(e.css("border-left-width"),10)-s,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,s=n.clientToLocal(e),r=this.sourceNode,o=this.options.getDropNode(t,{sourceNode:r,draggingNode:t,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),a=o.getBBox();s.x+=a.x-a.width/2,s.y+=a.y-a.height/2;const l=this.snapOffset?1:n.getGridSize();o.position(tc.snapToGrid(s.x,l),tc.snapToGrid(s.y,l)),o.removeZIndex();const h=this.options.validateNode,c=!h||h(o,{sourceNode:r,draggingNode:t,droppingNode:o,targetGraph:n,draggingGraph:this.draggingGraph});return"boolean"==typeof c?c?(i.addCell(o,{stencil:this.cid}),o):null:function(...t){const e=to(t);return"boolean"==typeof e?Promise.resolve(e):e}(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()}}Qp([Rc.dispose()],tf.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"}}(tf||(tf={})),function(t){t.getMaxDim=function(t,e){return t.reduce(((t,n)=>Math.max(n.getSize()[e],t)),0)},t.getNodesInRow=function(t,e,n){const i=[];for(let s=n*e,r=s+n;s<r;s+=1)i.push(t[s]);return i},t.getNodesInColumn=function(t,e,n){const i=[];for(let s=e,r=t.length;s<r;s+=n)i.push(t[s]);return i},t.accumulate=function(t,e){return t.reduce(((t,e,n)=>(t.push(t[n]+e),t)),[e||0])}}(Jp||(Jp={}));class ef extends Rc{constructor(t){if(super(),this.graphs={},this.$groups={},this.options=Object.assign(Object.assign({},ef.defaultOptions),t),this.dnd=new tf(this.options),this.onSearch=xs(this.onSearch,200),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(Zp.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");t.groups&&t.groups.every((t=>t.collapsed||!1===t.collapsable))&&this.$container.addClass("collapsed")}this.$("<div/>").addClass(this.prefixClassName(Zp.title)).html(this.options.title).appendTo(this.$container),t.search&&this.$container.addClass("searchable").append(this.renderSearch()),this.$content=this.$("<div/>").addClass(this.prefixClassName(Zp.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(Zp.group)).attr("data-name",n.name);(null==n.collapsable&&t.collapsable||!1!==n.collapsable)&&i.addClass("collapsable"),i.toggleClass("collapsed",!0===n.collapsed);const s=this.$("<h3/>").addClass(this.prefixClassName(Zp.groupTitle)).html(n.title||n.name),r=this.$("<div/>").addClass(this.prefixClassName(Zp.groupContent)),o=n.graphOptions,a=new Up(Object.assign(Object.assign(Object.assign({},e),o),{container:document.createElement("div"),model:e.model||new eg,width:n.graphWidth||t.stencilGraphWidth,height:n.graphHeight||t.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));r.append(a.container),i.append(s,r).appendTo(this.$content),this.$groups[n.name]=i,this.graphs[n.name]=a}));else{const n=new Up(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new eg,width:t.stencilGraphWidth,height:t.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.$content.append(n.container),this.graphs[Kp.defaultGroupName]=n}return this.startListening(),this}get targetScroller(){const t=this.options.target;return Up.isGraph(t)?t.scroller.widget:t}get targetGraph(){const t=this.options.target;return Up.isGraph(t)?t:t.graph}get targetModel(){return this.targetGraph.model}renderSearch(){return this.$("<div/>").addClass(this.prefixClassName(Zp.search)).append(this.$("<input/>").attr({type:"search",placeholder:this.options.placeholder||"Search"}).addClass(this.prefixClassName(Zp.searchText)))}startListening(){const t=this.prefixClassName(Zp.title),e=this.prefixClassName(Zp.searchText),n=this.prefixClassName(Zp.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=>{this.graphs[t].on("cell:mousedown",this.onDragStart,this)}))}stopListening(){this.undelegateEvents(),Object.keys(this.graphs).forEach((t=>{this.graphs[t].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=>$d.isNode(t)?t:$d.create(t)));n.resetCells(e)}const i=this.getGroup(e);let s=this.options.stencilGraphHeight;i&&null!=i.graphHeight&&(s=i.graphHeight);const r=i&&i.layout||this.options.layout;if(r&&n&&Kr(r,this,n,i),!s){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 s=this.graphs[i],r=i===Kp.defaultGroupName?null:i,o=s.model.getNodes().filter((n=>{let i=!1;i="function"==typeof e?Kr(e,this,n,t,r,this):"boolean"==typeof e?e:this.isCellMatched(n,t,e,t.toLowerCase()!==t);const o=s.renderer.findViewByCell(n);return o&&o.$(o.container).toggleClass("unmatched",!i),i})),a=o.length>0,l=this.options,h=new eg;return h.resetCells(o),l.layout&&Kr(l.layout,this,h,this.getGroup(i)),this.$groups[i]&&this.$groups[i].toggleClass("unmatched",!a),s.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((s=>{if("*"===s||t.shape===s){const r=n[s];if("boolean"==typeof r)return r;return(Array.isArray(r)?r:[r]).some((n=>{let s=t.getPropByPath(n);return null!=s&&(s=`${s}`,i||(s=s.toLowerCase()),s.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(Zp.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||Kp.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){return this.$groups[t].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=>{this.graphs[t].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};!function(t,e={}){const n=eg.isModel(t)?t:(new eg).resetCells(t,{sort:!1,dryrun:!0}),i=n.getNodes(),s=e.columns||1,r=Math.ceil(i.length/s),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 t=0;t<s;t+=1){const e=Jp.getNodesInColumn(i,t,s);d.push(Jp.getMaxDim(e,"width")+o)}else{null!=g&&"auto"!==g||(g=Jp.getMaxDim(i,"width")+o);for(let t=0;t<s;t+=1)d.push(g)}const p=Jp.accumulate(d,c),f=[];let m=e.rowHeight;if("compact"===m)for(let t=0;t<r;t+=1){const e=Jp.getNodesInRow(i,t,s);f.push(Jp.getMaxDim(e,"height")+a)}else{null!=m&&"auto"!==m||(m=Jp.getMaxDim(i,"height")+a);for(let t=0;t<r;t+=1)f.push(m)}const y=Jp.accumulate(f,u);n.startBatch("layout"),i.forEach(((t,n)=>{const i=n%s,r=Math.floor(n/s),c=d[i],u=f[r];let g=0,m=0,b=t.getSize();if(h){let n=c-2*o,i=u-2*a;const s=b.height*(b.width?n/b.width:1),r=b.width*(b.height?i/b.height:1);u<s?n=r:i=s,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[r]+a+m,e)})),n.stopBatch("layout")}(t,Object.assign(Object.assign(Object.assign({},n),this.options.layoutOptions),e?e.layoutOptions:{}))}},tf.defaults)}(ef||(ef={})),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`}(Zp||(Zp={})),function(t){t.defaultGroupName="__default__"}(Kp||(Kp={}));var nf=kd({type:"vue componnet"});Up.registerVueComponent=nf.register,Up.unregisterVueComponent=nf.unregister,Up.Hook.prototype.getVueComponent=function(t){var e=this.options.getVueComponent;if("function"==typeof e){var n=Kr(e,this.graph,t);if(null!=n)return n}var i=t.getComponent();if("string"==typeof i){var s=nf.get(i);if(null==s)return nf.onNotFound(i);i=s}return i};
/*! *****************************************************************************
	Copyright (c) Microsoft Corporation.

	Permission to use, copy, modify, and/or distribute this software for any
	purpose with or without fee is hereby granted.

	THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
	REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
	AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
	INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
	LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
	OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
	PERFORMANCE OF THIS SOFTWARE.
	***************************************************************************** */
var sf=function(t,e){return(sf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function rf(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}sf(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var of,af=function(){return(af=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)};t.VueShape=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rf(e,t),Object.defineProperty(e.prototype,"component",{get:function(){return this.getComponent()},set:function(t){this.setComponent(t)},enumerable:!1,configurable:!0}),e.prototype.getComponent=function(){return this.store.get("component")},e.prototype.setComponent=function(t,e){return void 0===e&&(e={}),null==t?this.removeComponent(e):this.store.set("component",t,e),this},e.prototype.removeComponent=function(t){return void 0===t&&(t={}),this.store.remove("component",t),this},e}($d),function(t){function e(t,e){void 0===e&&(e="rect");var n=[{tagName:e,selector:"body"}];return t?n.push(Uc.getForeignObjectMarkup()):n.push({tagName:"g",selector:"content"}),n.push({tagName:"text",selector:"label"}),n}t.config({view:"vue-shape-view",markup:e(!0),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"},label:{fontSize:14,fill:"#333",refX:"50%",refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"}},propHooks:function(t){if(null==t.markup){var n=t.primer,i=t.useForeignObject;if((null!=n||null!=i)&&(t.markup=e(!1!==i,n),n)){null==t.attrs&&(t.attrs={});var s={};"circle"===n?s={refCx:"50%",refCy:"50%",refR:"50%"}:"ellipse"===n&&(s={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}),"rect"!==n&&(t.attrs=Qs({},t.attrs,{body:af({refWidth:null,refHeight:null},s)}))}}return t}}),$d.registry.register("vue-shape",t,!0)}(t.VueShape||(t.VueShape={})),(of=(of=s.default)||s.default)&&!of.__composition_api_installed__&&s.default.use(r.default);var lf,hf=s.default;s.default.version,t.VueShapeView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rf(e,t),e.prototype.init=function(){t.prototype.init.call(this)},e.prototype.getComponentContainer=function(){return this.selectors.foContent},e.prototype.confirmUpdate=function(n){var i=this,s=t.prototype.confirmUpdate.call(this,n);return this.handleAction(s,e.action,(function(){dl.scheduleTask((function(){i.renderVueComponent()}))}))},e.prototype.renderVueComponent=function(){this.unmountVueComponent();var t=this.getComponentContainer(),e=this.cell,i=this.graph;if(t){var s=this.graph.hook.getVueComponent(e),r=hf;this.vm=new r("string"==typeof s?{template:s}:{render:function(){return n.h(s,{graph:i,node:e})},provide:function(){return{getGraph:function(){return i},getNode:function(){return e}}}}),this.vm.$mount(t)}},e.prototype.unmountVueComponent=function(){var t=this.getComponentContainer();return this.vm&&(this.vm.$destroy(),this.vm=null),t.innerHTML="",t},e.prototype.unmount=function(){return this.unmountVueComponent(),t.prototype.unmount.call(this),this},e}(Zd),(lf=t.VueShapeView||(t.VueShapeView={})).action="vue",lf.config({bootstrap:[lf.action],actions:{component:lf.action}}),Zd.registry.register("vue-shape-view",lf,!0),t.registry=nf,t.useTeleport=function(e){return console.warn("useTeleport should run in vue3"),Zd.registry.register(e,t.VueShapeView,!0),n.defineComponent((function(){return null}))},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=x6-vue-shape.js.map
