43 lines
343 KiB
Java
43 lines
343 KiB
Java
import{r as tu,ak as eu,d as Ns,l as Xn,E as nu,F as ou,R as Cs}from"./vue-vendor-C7Zq48Yl.js";import{bY as Z,h as X,v as Io,aC as lr,bZ as mr,p as Ve,b_ as it,b$ as be,c0 as je,c1 as re,c2 as qe,c3 as vt,s as ru,c4 as iu,c5 as Gi,c6 as kr,c7 as au,al as js,aB as su,c8 as lu,c9 as Ls,ak as Ui,ca as uu,cb as Ir,aP as cu,cc as pu,q as du}from"./antd-vue-vendor-BPnV8VqP.js";import{n as ks}from"./_commonjsHelpers-B52_cu2H-BG14nIm9.js";import{n as fu}from"./index-Crt100Db-kwMQ9qxI.js";import{P as hu}from"./propStore-Cl0CojEU-DVRhovlH.js";import{J as No}from"./NodeContainer.vue_vue_type_style_index_0_lang-hKTylTLH-Banxh0Pc.js";var yu={},ur,H,Is,we,Vi,Rs,Xs,Bs,Oi,Rr,Xr,Bn={},Hs=[],gu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qn=Array.isArray;function ue(n,t){for(var e in t)n[e]=t[e];return n}function wi(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function $e(n,t,e){var o,r,i,a={};for(i in t)i=="key"?o=t[i]:i=="ref"?r=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?ur.call(arguments,2):e),typeof n=="function"&&n.defaultProps!=null)for(i in n.defaultProps)a[i]===void 0&&(a[i]=n.defaultProps[i]);return Co(n,a,o,r,null)}function Co(n,t,e,o,r){var i={type:n,props:t,key:e,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r==null?++Is:r,__i:-1,__u:0};return r==null&&H.vnode!=null&&H.vnode(i),i}function Si(){return{current:null}}function Je(n){return n.children}function G(n,t){this.props=n,this.context=t}function Qe(n,t){if(t==null)return n.__?Qe(n.__,n.__i+1):null;for(var e;t<n.__k.length;t++)if((e=n.__k[t])!=null&&e.__e!=null)return e.__e;return typeof n.type=="function"?Qe(n):null}function zs(n){var t,e;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,t=0;t<n.__k.length;t++)if((e=n.__k[t])!=null&&e.__e!=null){n.__e=n.__c.base=e.__e;break}return zs(n)}}function Fi(n){(!n.__d&&(n.__d=!0)&&we.push(n)&&!Ro.__r++||Vi!=H.debounceRendering)&&((Vi=H.debounceRendering)||Rs)(Ro)}function Ro(){for(var n,t,e,o,r,i,a,s=1;we.length;)we.length>s&&we.sort(Xs),n=we.shift(),s=we.length,n.__d&&(e=void 0,o=void 0,r=(o=(t=n).__v).__e,i=[],a=[],t.__P&&((e=ue({},o)).__v=o.__v+1,H.vnode&&H.vnode(e),Mi(t.__P,e,o,t.__n,t.__P.namespaceURI,32&o.__u?[r]:null,i,r==null?Qe(o):r,!!(32&o.__u),a),e.__v=o.__v,e.__.__k[e.__i]=e,Us(i,e,a),o.__e=o.__=null,e.__e!=r&&zs(e)));Ro.__r=0}function Ys(n,t,e,o,r,i,a,s,l,u,p){var c,d,f,h,y,v,g,m=o&&o.__k||Hs,M=t.length;for(l=vu(e,t,m,l,M),c=0;c<M;c++)(f=e.__k[c])!=null&&(d=f.__i==-1?Bn:m[f.__i]||Bn,f.__i=c,v=Mi(n,f,d,r,i,a,s,l,u,p),h=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&Ti(d.ref,null,f),p.push(f.ref,f.__c||h,f)),y==null&&h!=null&&(y=h),(g=!!(4&f.__u))||d.__k===f.__k?l=Gs(f,l,n,g):typeof f.type=="function"&&v!==void 0?l=v:h&&(l=h.nextSibling),f.__u&=-7);return e.__e=y,l}function vu(n,t,e,o,r){var i,a,s,l,u,p=e.length,c=p,d=0;for(n.__k=new Array(r),i=0;i<r;i++)(a=t[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=n.__k[i]=Co(null,a,null,null,null):Qn(a)?a=n.__k[i]=Co(Je,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=n.__k[i]=Co(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):n.__k[i]=a,l=i+d,a.__=n,a.__b=n.__b+1,s=null,(u=a.__i=mu(a,e,l,c))!=-1&&(c--,(s=e[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(r>p?d--:r<p&&d++),typeof a.type!="function"&&(a.__u|=4)):u!=l&&(u==l-1?d--:u==l+1?d++:(u>l?d--:d++,a.__u|=4))):n.__k[i]=null;if(c)for(i=0;i<p;i++)(s=e[i])!=null&&(2&s.__u)==0&&(s.__e==o&&(o=Qe(s)),Fs(s,s));return o}function Gs(n,t,e,o){var r,i;if(typeof n.type=="function"){for(r=n.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=n,t=Gs(r[i],t,e,o));return t}n.__e!=t&&(o&&(t&&n.type&&!t.parentNode&&(t=Qe(n)),e.insertBefore(n.__e,t||null)),t=n.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Xo(n,t){return t=t||[],n==null||typeof n=="boolean"||(Qn(n)?n.some(function(e){Xo(e,t)}):t.push(n)),t}function mu(n,t,e,o){var r,i,a,s=n.key,l=n.type,u=t[e],p=u!=null&&(2&u.__u)==0;if(u===null&&s==null||p&&s==u.key&&l==u.type)return e;if(o>(p?1:0)){for(r=e-1,i=e+1;r>=0||i<t.length;)if((u=t[a=r>=0?r--:i++])!=null&&(2&u.__u)==0&&s==u.key&&l==u.type)return a}return-1}function Wi(n,t,e){t[0]=="-"?n.setProperty(t,e==null?"":e):n[t]=e==null?"":typeof e!="number"||gu.test(t)?e:e+"px"}function so(n,t,e,o,r){var i,a;t:if(t=="style")if(typeof e=="string")n.style.cssText=e;else{if(typeof o=="string"&&(n.style.cssText=o=""),o)for(t in o)e&&t in e||Wi(n.style,t,"");if(e)for(t in e)o&&e[t]==o[t]||Wi(n.style,t,e[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(Bs,"$1")),a=t.toLowerCase(),t=a in n||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),n.l||(n.l={}),n.l[t+i]=e,e?o?e.u=o.u:(e.u=Oi,n.addEventListener(t,i?Xr:Rr,i)):n.removeEventListener(t,i?Xr:Rr,i);else{if(r=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in n)try{n[t]=e==null?"":e;break t}catch(s){}typeof e=="function"||(e==null||e===!1&&t[4]!="-"?n.removeAttribute(t):n.setAttribute(t,t=="popover"&&e==1?"":e))}}function Ki(n){return function(t){if(this.l){var e=this.l[t.type+n];if(t.t==null)t.t=Oi++;else if(t.t<e.u)return;return e(H.event?H.event(t):t)}}}function Mi(n,t,e,o,r,i,a,s,l,u){var p,c,d,f,h,y,v,g,m,M,T,w,S,_,x,A,P,I=t.type;if(t.constructor!==void 0)return null;128&e.__u&&(l=!!(32&e.__u),i=[s=t.__e=e.__e]),(p=H.__b)&&p(t);t:if(typeof I=="function")try{if(g=t.props,m="prototype"in I&&I.prototype.render,M=(p=I.contextType)&&o[p.__c],T=p?M?M.props.value:p.__:o,e.__c?v=(c=t.__c=e.__c).__=c.__E:(m?t.__c=c=new I(g,T):(t.__c=c=new G(g,T),c.constructor=I,c.render=bu),M&&M.sub(c),c.state||(c.state={}),c.__n=o,d=c.__d=!0,c.__h=[],c._sb=[]),m&&c.__s==null&&(c.__s=c.state),m&&I.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=ue({},c.__s)),ue(c.__s,I.getDerivedStateFromProps(g,c.__s))),f=c.props,h=c.state,c.__v=t,d)m&&I.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),m&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(m&&I.getDerivedStateFromProps==null&&g!==f&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(g,T),t.__v==e.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(g,c.__s,T)===!1){for(t.__v!=e.__v&&(c.props=g,c.state=c.__s,c.__d=!1),t.__e=e.__e,t.__k=e.__k,t.__k.some(function(B){B&&(B.__=t)}),w=0;w<c._sb.length;w++)c.__h.push(c._sb[w]);c._sb=[],c.__h.length&&a.push(c);break t}c.componentWillUpdate!=null&&c.componentWillUpdate(g,c.__s,T),m&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(f,h,y)})}if(c.context=T,c.props=g,c.__P=n,c.__e=!1,S=H.__r,_=0,m){for(c.state=c.__s,c.__d=!1,S&&S(t),p=c.render(c.props,c.state,c.context),x=0;x<c._sb.length;x++)c.__h.push(c._sb[x]);c._sb=[]}else do c.__d=!1,S&&S(t),p=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++_<25);c.state=c.__s,c.getChildContext!=null&&(o=ue(ue({},o),c.getChildContext())),m&&!d&&c.getSnapshotBeforeUpdate!=null&&(y=c.getSnapshotBeforeUpdate(f,h)),A=p,p!=null&&p.type===Je&&p.key==null&&(A=Vs(p.props.children)),s=Ys(n,Qn(A)?A:[A],t,e,o,r,i,a,s,l,u),c.base=t.__e,t.__u&=-161,c.__h.length&&a.push(c),v&&(c.__E=c.__=null)}catch(B){if(t.__v=null,l||i!=null)if(B.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else{for(P=i.length;P--;)wi(i[P]);Br(t)}else t.__e=e.__e,t.__k=e.__k,B.then||Br(t);H.__e(B,t,e)}else i==null&&t.__v==e.__v?(t.__k=e.__k,t.__e=e.__e):s=t.__e=_u(e.__e,t,e,o,r,i,a,l,u);return(p=H.diffed)&&p(t),128&t.__u?void 0:s}function Br(n){n&&n.__c&&(n.__c.__e=!0),n&&n.__k&&n.__k.forEach(Br)}function Us(n,t,e){for(var o=0;o<e.length;o++)Ti(e[o],e[++o],e[++o]);H.__c&&H.__c(t,n),n.some(function(r){try{n=r.__h,r.__h=[],n.some(function(i){i.call(r)})}catch(i){H.__e(i,r.__v)}})}function Vs(n){return typeof n!="object"||n==null||n.__b&&n.__b>0?n:Qn(n)?n.map(Vs):ue({},n)}function _u(n,t,e,o,r,i,a,s,l){var u,p,c,d,f,h,y,v=e.props||Bn,g=t.props,m=t.type;if(m=="svg"?r="http://www.w3.org/2000/svg":m=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!m&&(m?f.localName==m:f.nodeType==3)){n=f,i[u]=null;break}}if(n==null){if(m==null)return document.createTextNode(g);n=document.createElementNS(r,m,g.is&&g),s&&(H.__m&&H.__m(t,i),s=!1),i=null}if(m==null)v===g||s&&n.data==g||(n.data=g);else{if(i=i&&ur.call(n.childNodes),!s&&i!=null)for(v={},u=0;u<n.attributes.length;u++)v[(f=n.attributes[u]).name]=f.value;for(u in v)if(f=v[u],u!="children"){if(u=="dangerouslySetInnerHTML")c=f;else if(!(u in g)){if(u=="value"&&"defaultValue"in g||u=="checked"&&"defaultChecked"in g)continue;so(n,u,null,f,r)}}for(u in g)f=g[u],u=="children"?d=f:u=="dangerouslySetInnerHTML"?p=f:u=="value"?h=f:u=="checked"?y=f:s&&typeof f!="function"||v[u]===f||so(n,u,f,v[u],r);if(p)s||c&&(p.__html==c.__html||p.__html==n.innerHTML)||(n.innerHTML=p.__html),t.__k=[];else if(c&&(n.innerHTML=""),Ys(t.type=="template"?n.content:n,Qn(d)?d:[d],t,e,o,m=="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,a,i?i[0]:e.__k&&Qe(e,0),s,l),i!=null)for(u=i.length;u--;)wi(i[u]);s||(u="value",m=="progress"&&h==null?n.removeAttribute("value"):h!=null&&(h!==n[u]||m=="progress"&&!h||m=="option"&&h!=v[u])&&so(n,u,h,v[u],r),u="checked",y!=null&&y!=n[u]&&so(n,u,y,v[u],r))}return n}function Ti(n,t,e){try{if(typeof n=="function"){var o=typeof n.__u=="function";o&&n.__u(),o&&t==null||(n.__u=n(t))}else n.current=t}catch(r){H.__e(r,e)}}function Fs(n,t,e){var o,r;if(H.unmount&&H.unmount(n),(o=n.ref)&&(o.current&&o.current!=n.__e||Ti(o,null,t)),(o=n.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){H.__e(i,t)}o.base=o.__P=null}if(o=n.__k)for(r=0;r<o.length;r++)o[r]&&Fs(o[r],t,e||typeof n.type!="function");e||wi(n.__e),n.__c=n.__=n.__e=void 0}function bu(n,t,e){return this.constructor(n,e)}function xu(n,t,e){var o,r,i,a;t==document&&(t=document.documentElement),H.__&&H.__(n,t),r=(o=!1)?null:t.__k,i=[],a=[],Mi(t,n=t.__k=$e(Je,null,[n]),r||Bn,Bn,t.namespaceURI,r?null:t.firstChild?ur.call(t.childNodes):null,i,r?r.__e:t.firstChild,o,a),Us(i,n,a)}ur=Hs.slice,H={__e:function(n,t,e,o){for(var r,i,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(n)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(n,o||{}),a=r.__d),a)return r.__E=r}catch(s){n=s}throw n}},Is=0,G.prototype.setState=function(n,t){var e;e=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ue({},this.state),typeof n=="function"&&(n=n(ue({},e),this.props)),n&&ue(e,n),n!=null&&this.__v&&(t&&this._sb.push(t),Fi(this))},G.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),Fi(this))},G.prototype.render=Je,we=[],Rs=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Xs=function(n,t){return n.__v.__b-t.__v.__b},Ro.__r=0,Bs=/(PointerCapture)$|Capture$/i,Oi=0,Rr=Ki(!1),Xr=Ki(!0);var Eu="An invariant failed, however the error is obfuscated because this is a production build.",Bo=[];Object.freeze(Bo);var Ai={};Object.freeze(Ai);function St(){return++C.mobxGuid}function K(n){throw Pe(!1,n),"X"}function Pe(n,t){if(!n)throw new Error("[mobx] "+(t||Eu))}function Ou(n,t){return!1}function Ws(n){var t=!1;return function(){if(!t)return t=!0,n.apply(this,arguments)}}var lo=function(){};function wu(n){var t=[];return n.forEach(function(e){t.indexOf(e)===-1&&t.push(e)}),t}function Pi(n){return n!==null&&typeof n=="object"}function dn(n){if(n===null||typeof n!="object")return!1;var t=Object.getPrototypeOf(n);return t===Object.prototype||t===null}function Su(n){if(hn(n)||Mt(n))return n;if(Array.isArray(n))return new Map(n);if(dn(n)){var t=new Map;for(var e in n)t.set(e,n[e]);return t}else return K("Cannot convert to map from '"+n+"'")}function fn(n,t,e){Object.defineProperty(n,t,{enumerable:!1,writable:!0,configurable:!0,value:e})}function Mu(n,t,e){Object.defineProperty(n,t,{enumerable:!1,writable:!1,configurable:!0,value:e})}function Tu(n,t){var e=Object.getOwnPropertyDescriptor(n,t);return!e||e.configurable!==!1&&e.writable!==!1}function xe(n,t){var e="isMobX"+n;return t.prototype[e]=!0,function(o){return Pi(o)&&o[e]===!0}}function hn(n){return n instanceof Map}function to(n){return n instanceof Set}function Ks(n){var t=new Set;for(var e in n)t.add(e);return Object.getOwnPropertySymbols(n).forEach(function(o){Object.getOwnPropertyDescriptor(n,o).enumerable&&t.add(o)}),Array.from(t)}function ye(n){return n&&n.toString?n.toString():new String(n).toString()}function Zs(n){return n===null?null:typeof n=="object"?""+n:n}var Au=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,k=Symbol("mobx administration"),yn=(function(){function n(t){t===void 0&&(t="Atom@"+St()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=q.NOT_TRACKING}return n.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(t){return t()})},n.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(t){return t()})},n.prototype.reportObserved=function(){return al(this)},n.prototype.reportChanged=function(){Gt(),qu(this),Ut()},n.prototype.toString=function(){return this.name},n})(),Di=xe("Atom",yn);function Ni(n,t,e){t===void 0&&(t=lo),e===void 0&&(e=lo);var o=new yn(n);return t!==lo&&pc(o,t),e!==lo&&dl(o,e),o}function Pu(n,t){return El(n,t)}function Du(n,t){return Object.is(n,t)}var tn={structural:Pu,default:Du};/*! *****************************************************************************
|
||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||
this file except in compliance with the License. You may obtain a copy of the
|
||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||
|
||
See the Apache Version 2.0 License for specific language governing permissions
|
||
and limitations under the License.
|
||
***************************************************************************** */var Hr=function(n,t){return Hr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var r in o)o.hasOwnProperty(r)&&(e[r]=o[r])},Hr(n,t)};function Nu(n,t){Hr(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Ho=function(){return Ho=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ho.apply(this,arguments)};function Qt(n){var t=typeof Symbol=="function"&&n[Symbol.iterator],e=0;return t?t.call(n):{next:function(){return n&&e>=n.length&&(n=void 0),{value:n&&n[e++],done:!n}}}}function Fe(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i}function Ci(){for(var n=[],t=0;t<arguments.length;t++)n=n.concat(Fe(arguments[t]));return n}var zo=Symbol("mobx did run lazy initializers"),En=Symbol("mobx pending decorators"),Cu={},ju={};function Lu(n,t){var e=t?Cu:ju;return e[n]||(e[n]={configurable:!0,enumerable:t,get:function(){return Le(this),this[n]},set:function(o){Le(this),this[n]=o}})}function Le(n){var t,e;if(n[zo]!==!0){var o=n[En];if(o){fn(n,zo,!0);var r=Ci(Object.getOwnPropertySymbols(o),Object.keys(o));try{for(var i=Qt(r),a=i.next();!a.done;a=i.next()){var s=a.value,l=o[s];l.propertyCreator(n,l.prop,l.descriptor,l.decoratorTarget,l.decoratorArguments)}}catch(u){t={error:u}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}}}}function qs(n,t){return function(){var e,o=function(r,i,a,s){if(s===!0)return t(r,i,a,r,e),null;if(!Object.prototype.hasOwnProperty.call(r,En)){var l=r[En];fn(r,En,Ho({},l))}return r[En][i]={prop:i,propertyCreator:t,descriptor:a,decoratorTarget:r,decoratorArguments:e},Lu(i,n)};return ku(arguments)?(e=Bo,o.apply(null,arguments)):(e=Array.prototype.slice.call(arguments),o)}}function ku(n){return(n.length===2||n.length===3)&&(typeof n[1]=="string"||typeof n[1]=="symbol")||n.length===4&&n[3]===!0}function eo(n,t,e){return rn(n)?n:Array.isArray(n)?E.array(n,{name:e}):dn(n)?E.object(n,void 0,{name:e}):hn(n)?E.map(n,{name:e}):to(n)?E.set(n,{name:e}):n}function Iu(n,t,e){return n==null||Wt(n)||ie(n)||Mt(n)||Lt(n)?n:Array.isArray(n)?E.array(n,{name:e,deep:!1}):dn(n)?E.object(n,void 0,{name:e,deep:!1}):hn(n)?E.map(n,{name:e,deep:!1}):to(n)?E.set(n,{name:e,deep:!1}):K(!1)}function cr(n){return n}function Ru(n,t,e){return El(n,t)?t:n}function pr(n){Pe(n);var t=qs(!0,function(o,r,i,a,s){var l=i?i.initializer?i.initializer.call(o):i.value:void 0;Xi(o).addObservableProp(r,l,n)}),e=t;return e.enhancer=n,e}var $s={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze($s);function Ue(n){return n==null?$s:typeof n=="string"?{name:n,deep:!0,proxy:!0}:n}var ji=pr(eo),Xu=pr(Iu),Js=pr(cr),Bu=pr(Ru);function uo(n){return n.defaultDecorator?n.defaultDecorator.enhancer:n.deep===!1?cr:eo}function Hu(n,t,e){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return ji.apply(null,arguments);if(rn(n))return n;var o=dn(n)?E.object(n,t,e):Array.isArray(n)?E.array(n,t):hn(n)?E.map(n,t):to(n)?E.set(n,t):n;if(o!==n)return o;K(!1)}var Zi={box:function(n,t){arguments.length>2&&mn("box");var e=Ue(t);return new Ne(n,uo(e),e.name,!0,e.equals)},array:function(n,t){arguments.length>2&&mn("array");var e=Ue(t);return Mc(n,uo(e),e.name)},map:function(n,t){arguments.length>2&&mn("map");var e=Ue(t);return new Ri(n,uo(e),e.name)},set:function(n,t){arguments.length>2&&mn("set");var e=Ue(t);return new bl(n,uo(e),e.name)},object:function(n,t,e){typeof arguments[1]=="string"&&mn("object");var o=Ue(e);if(o.proxy===!1)return Fr({},n,t,o);var r=hl(o),i=Fr({},void 0,void 0,o),a=Oc(i);return yl(a,n,t,r),a},ref:Js,shallow:Xu,deep:ji,struct:Bu},E=Hu;Object.keys(Zi).forEach(function(n){return E[n]=Zi[n]});function mn(n){K("Expected one or two arguments to observable."+n+". Did you accidentally try to use observable."+n+" as decorator?")}var Li=qs(!1,function(n,t,e,o,r){var i=e.get,a=e.set,s=r[0]||{};Xi(n).addComputedProp(n,t,Ho({get:i,set:a,context:n},s))}),zu=Li({equals:tn.structural}),Q=function(n,t,e){if(typeof t=="string"||n!==null&&typeof n=="object"&&arguments.length===1)return Li.apply(null,arguments);var o=typeof t=="object"?t:{};return o.get=n,o.set=typeof t=="function"?t:o.set,o.name=o.name||n.name||"",new nn(o)};Q.struct=zu;var q;(function(n){n[n.NOT_TRACKING=-1]="NOT_TRACKING",n[n.UP_TO_DATE=0]="UP_TO_DATE",n[n.POSSIBLY_STALE=1]="POSSIBLY_STALE",n[n.STALE=2]="STALE"})(q||(q={}));var ee;(function(n){n[n.NONE=0]="NONE",n[n.LOG=1]="LOG",n[n.BREAK=2]="BREAK"})(ee||(ee={}));var Yo=(function(){function n(t){this.cause=t}return n})();function On(n){return n instanceof Yo}function zr(n){switch(n.dependenciesState){case q.UP_TO_DATE:return!1;case q.NOT_TRACKING:case q.STALE:return!0;case q.POSSIBLY_STALE:{for(var t=ki(!0),e=gn(),o=n.observing,r=o.length,i=0;i<r;i++){var a=o[i];if(on(a)){if(C.disableErrorBoundaries)a.get();else try{a.get()}catch(s){return me(e),Mn(t),!0}if(n.dependenciesState===q.STALE)return me(e),Mn(t),!0}}return el(n),me(e),Mn(t),!1}}}function en(n){var t=n.observers.size>0;C.computationDepth>0&&t&&K(!1),!C.allowStateChanges&&(t||C.enforceActions==="strict")&&K(!1)}function Qs(n,t,e){var o=ki(!0);el(n),n.newObserving=new Array(n.observing.length+100),n.unboundDepsCount=0,n.runId=++C.runId;var r=C.trackingDerivation;C.trackingDerivation=n;var i;if(C.disableErrorBoundaries===!0)i=t.call(e);else try{i=t.call(e)}catch(a){i=new Yo(a)}return C.trackingDerivation=r,Yu(n),Mn(o),i}function Yu(n){for(var t=n.observing,e=n.observing=n.newObserving,o=q.UP_TO_DATE,r=0,i=n.unboundDepsCount,a=0;a<i;a++){var s=e[a];s.diffValue===0&&(s.diffValue=1,r!==a&&(e[r]=s),r++),s.dependenciesState>o&&(o=s.dependenciesState)}for(e.length=r,n.newObserving=null,i=t.length;i--;){var s=t[i];s.diffValue===0&&rl(s,n),s.diffValue=0}for(;r--;){var s=e[r];s.diffValue===1&&(s.diffValue=0,Zu(s,n))}o!==q.UP_TO_DATE&&(n.dependenciesState=o,n.onBecomeStale())}function Yr(n){var t=n.observing;n.observing=[];for(var e=t.length;e--;)rl(t[e],n);n.dependenciesState=q.NOT_TRACKING}function tl(n){var t=gn();try{return n()}finally{me(t)}}function gn(){var n=C.trackingDerivation;return C.trackingDerivation=null,n}function me(n){C.trackingDerivation=n}function ki(n){var t=C.allowStateReads;return C.allowStateReads=n,t}function Mn(n){C.allowStateReads=n}function el(n){if(n.dependenciesState!==q.UP_TO_DATE){n.dependenciesState=q.UP_TO_DATE;for(var t=n.observing,e=t.length;e--;)t[e].lowestObserverState=q.UP_TO_DATE}}var Go=0,Gu=1,qi=Object.getOwnPropertyDescriptor(function(){},"name"),yy=qi&&qi.configurable;function De(n,t,e){var o=function(){return nl(n,t,e||this,arguments)};return o.isMobxAction=!0,o}function nl(n,t,e,o){var r=Uu(n,e,o);try{return t.apply(e,o)}catch(i){throw r.error=i,i}finally{Vu(r)}}function Uu(n,t,e){var o=mt()&&!!n,r=0;if(o&&!1){var i,a;if(i>0)for(var s;s<i;s++);}var l=gn();Gt();var u=dr(!0),p=ki(!0),c={prevDerivation:l,prevAllowStateChanges:u,prevAllowStateReads:p,notifySpy:o,startTime:r,actionId:Gu++,parentActionId:Go};return Go=c.actionId,c}function Vu(n){Go!==n.actionId&&K("invalid action stack. did you forget to finish an action?"),Go=n.parentActionId,n.error!==void 0&&(C.suppressReactionErrors=!0),fr(n.prevAllowStateChanges),Mn(n.prevAllowStateReads),Ut(),me(n.prevDerivation),n.notifySpy,C.suppressReactionErrors=!1}function dr(n){var t=C.allowStateChanges;return C.allowStateChanges=n,t}function fr(n){C.allowStateChanges=n}var Ne=(function(n){Nu(t,n);function t(e,o,r,i,a){r===void 0&&(r="ObservableValue@"+St()),i===void 0&&(i=!0),a===void 0&&(a=tn.default);var s=n.call(this,r)||this;return s.enhancer=o,s.name=r,s.equals=a,s.hasUnreportedChange=!1,s.value=o(e,void 0,r),i&&mt(),s}return t.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},t.prototype.set=function(e){var o=this.value;if(e=this.prepareNewValue(e),e!==C.UNCHANGED){var r=mt();this.setNewValue(e)}},t.prototype.prepareNewValue=function(e){if(en(this),ne(this)){var o=oe(this,{object:this,type:"update",newValue:e});if(!o)return C.UNCHANGED;e=o.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?C.UNCHANGED:e},t.prototype.setNewValue=function(e){var o=this.value;this.value=e,this.reportChanged(),Vt(this)&&Ft(this,{type:"update",object:this,newValue:e,oldValue:o})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return no(this,e)},t.prototype.observe=function(e,o){return o&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),oo(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return Zs(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t})(yn),Fu=xe("ObservableValue",Ne),nn=(function(){function n(t){this.dependenciesState=q.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=q.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+St(),this.value=new Yo(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=ee.NONE,Pe(t.get,"missing option for computed: get"),this.derivation=t.get,this.name=t.name||"ComputedValue@"+St(),t.set&&(this.setter=De(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?tn.structural:tn.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return n.prototype.onBecomeStale=function(){Ju(this)},n.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(t){return t()})},n.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(t){return t()})},n.prototype.get=function(){this.isComputing&&K("Cycle detected in computation "+this.name+": "+this.derivation),C.inBatch===0&&this.observers.size===0&&!this.keepAlive?zr(this)&&(this.warnAboutUntrackedRead(),Gt(),this.value=this.computeValue(!1),Ut()):(al(this),zr(this)&&this.trackAndCompute()&&$u(this));var t=this.value;if(On(t))throw t.cause;return t},n.prototype.peek=function(){var t=this.computeValue(!1);if(On(t))throw t.cause;return t},n.prototype.set=function(t){if(this.setter){Pe(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,t)}finally{this.isRunningSetter=!1}}else Pe(!1,!1)},n.prototype.trackAndCompute=function(){mt();var t=this.value,e=this.dependenciesState===q.NOT_TRACKING,o=this.computeValue(!0),r=e||On(t)||On(o)||!this.equals(t,o);return r&&(this.value=o),r},n.prototype.computeValue=function(t){this.isComputing=!0,C.computationDepth++;var e;if(t)e=Qs(this,this.derivation,this.scope);else if(C.disableErrorBoundaries===!0)e=this.derivation.call(this.scope);else try{e=this.derivation.call(this.scope)}catch(o){e=new Yo(o)}return C.computationDepth--,this.isComputing=!1,e},n.prototype.suspend=function(){this.keepAlive||(Yr(this),this.value=void 0)},n.prototype.observe=function(t,e){var o=this,r=!0,i=void 0;return lc(function(){var a=o.get();if(!r||e){var s=gn();t({type:"update",object:o,newValue:a,oldValue:i}),me(s)}r=!1,i=a})},n.prototype.warnAboutUntrackedRead=function(){},n.prototype.toJSON=function(){return this.get()},n.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},n.prototype.valueOf=function(){return Zs(this.get())},n.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},n})(),on=xe("ComputedValue",nn),jo=(function(){function n(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return n})(),Wu={};function Gr(){return typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:Wu}var Lo=!0,ol=!1,C=(function(){var n=Gr();return n.__mobxInstanceCount>0&&!n.__mobxGlobals&&(Lo=!1),n.__mobxGlobals&&n.__mobxGlobals.version!==new jo().version&&(Lo=!1),Lo?n.__mobxGlobals?(n.__mobxInstanceCount+=1,n.__mobxGlobals.UNCHANGED||(n.__mobxGlobals.UNCHANGED={}),n.__mobxGlobals):(n.__mobxInstanceCount=1,n.__mobxGlobals=new jo):(setTimeout(function(){ol||K("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new jo)})();function Ku(){(C.pendingReactions.length||C.inBatch||C.isRunningReactions)&&K("isolateGlobalState should be called before MobX is running any reactions"),ol=!0,Lo&&(--Gr().__mobxInstanceCount===0&&(Gr().__mobxGlobals=void 0),C=new jo)}function Ur(){return C}function Zu(n,t){n.observers.add(t),n.lowestObserverState>t.dependenciesState&&(n.lowestObserverState=t.dependenciesState)}function rl(n,t){n.observers.delete(t),n.observers.size===0&&il(n)}function il(n){n.isPendingUnobservation===!1&&(n.isPendingUnobservation=!0,C.pendingUnobservations.push(n))}function Gt(){C.inBatch++}function Ut(){if(--C.inBatch===0){ul();for(var n=C.pendingUnobservations,t=0;t<n.length;t++){var e=n[t];e.isPendingUnobservation=!1,e.observers.size===0&&(e.isBeingObserved&&(e.isBeingObserved=!1,e.onBecomeUnobserved()),e instanceof nn&&e.suspend())}C.pendingUnobservations=[]}}function al(n){var t=C.trackingDerivation;return t!==null?(t.runId!==n.lastAccessedBy&&(n.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=n,n.isBeingObserved||(n.isBeingObserved=!0,n.onBecomeObserved())),!0):(n.observers.size===0&&C.inBatch>0&&il(n),!1)}function qu(n){n.lowestObserverState!==q.STALE&&(n.lowestObserverState=q.STALE,n.observers.forEach(function(t){t.dependenciesState===q.UP_TO_DATE&&(t.isTracing!==ee.NONE&&sl(t,n),t.onBecomeStale()),t.dependenciesState=q.STALE}))}function $u(n){n.lowestObserverState!==q.STALE&&(n.lowestObserverState=q.STALE,n.observers.forEach(function(t){t.dependenciesState===q.POSSIBLY_STALE?t.dependenciesState=q.STALE:t.dependenciesState===q.UP_TO_DATE&&(n.lowestObserverState=q.UP_TO_DATE)}))}function Ju(n){n.lowestObserverState===q.UP_TO_DATE&&(n.lowestObserverState=q.POSSIBLY_STALE,n.observers.forEach(function(t){t.dependenciesState===q.UP_TO_DATE&&(t.dependenciesState=q.POSSIBLY_STALE,t.isTracing!==ee.NONE&&sl(t,n),t.onBecomeStale())}))}function sl(n,t){if(n.isTracing===ee.BREAK){var e=[];ll(fc(n),e,1),new Function(`debugger;
|
||
/*
|
||
Tracing '`+n.name+`'
|
||
|
||
You are entering this break point because derivation '`+n.name+"' is being traced and '"+t.name+`' is now forcing it to update.
|
||
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
||
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
||
|
||
`+(n instanceof nn?n.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
||
|
||
The dependencies for this derivation are:
|
||
|
||
`+e.join(`
|
||
`)+`
|
||
*/
|
||
`)()}}function ll(n,t,e){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+new Array(e).join(" ")+n.name),n.dependencies&&n.dependencies.forEach(function(o){return ll(o,t,e+1)})}var Hn=(function(){function n(t,e,o,r){t===void 0&&(t="Reaction@"+St()),r===void 0&&(r=!1),this.name=t,this.onInvalidate=e,this.errorHandler=o,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=q.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+St(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=ee.NONE}return n.prototype.onBecomeStale=function(){this.schedule()},n.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,C.pendingReactions.push(this),ul())},n.prototype.isScheduled=function(){return this._isScheduled},n.prototype.runReaction=function(){if(!this.isDisposed){if(Gt(),this._isScheduled=!1,zr(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&mt()}catch(t){this.reportExceptionInDerivation(t)}}Ut()}},n.prototype.track=function(t){if(!this.isDisposed){Gt();var e=mt(),o;this._isRunning=!0;var r=Qs(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&Yr(this),On(r)&&this.reportExceptionInDerivation(r.cause),Ut()}},n.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler){this.errorHandler(t,this);return}if(C.disableErrorBoundaries)throw t;var o="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";C.suppressReactionErrors,mt()&&nc({type:"error",name:this.name,message:o,error:""+t}),C.globalReactionErrorHandlers.forEach(function(r){return r(t,e)})},n.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Gt(),Yr(this),Ut()))},n.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t[k]=this,t},n.prototype.toString=function(){return"Reaction["+this.name+"]"},n.prototype.trace=function(t){t===void 0&&(t=!1),bc(this,t)},n})(),Qu=100,Vr=function(n){return n()};function ul(){C.inBatch>0||C.isRunningReactions||Vr(tc)}function tc(){C.isRunningReactions=!0;for(var n=C.pendingReactions,t=0;n.length>0;){++t===Qu&&n.splice(0);for(var e=n.splice(0),o=0,r=e.length;o<r;o++)e[o].runReaction()}C.isRunningReactions=!1}var Uo=xe("Reaction",Hn);function ec(n){var t=Vr;Vr=function(e){return n(function(){return t(e)})}}function mt(){return!1}function nc(n){if(0)for(var t,e,o;e<o;e++);}function oc(n){return function(){}}function rc(){K(!1)}function $i(n){return function(t,e,o){if(o){if(o.value)return{value:De(n,o.value),enumerable:!1,configurable:!0,writable:!0};var r=o.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return De(n,r.call(this))}}}return ic(n).apply(this,arguments)}}function ic(n){return function(t,e,o){Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get:function(){},set:function(r){fn(this,e,b(n,r))}})}}function ac(n,t,e,o){return o===!0?(_r(n,t,e.value),null):e?{configurable:!0,enumerable:!1,get:function(){return _r(this,t,e.value||e.initializer.call(this)),this[t]},set:rc}:{enumerable:!1,configurable:!0,set:function(r){_r(this,t,r)},get:function(){}}}var b=function(n,t,e,o){if(arguments.length===1&&typeof n=="function")return De(n.name||"<unnamed action>",n);if(arguments.length===2&&typeof t=="function")return De(n,t);if(arguments.length===1&&typeof n=="string")return $i(n);if(o===!0)fn(n,t,De(n.name||t,e.value,this));else return $i(t).apply(null,arguments)};b.bound=ac;function sc(n,t){var e=typeof n=="string"?n:n.name||"<unnamed action>",o=typeof n=="function"?n:t;return nl(e,o,this,void 0)}function _r(n,t,e){fn(n,t,De(t,e.bind(n)))}function lc(n,t){t===void 0&&(t=Ai);var e=t&&t.name||n.name||"Autorun@"+St(),o=!t.scheduler&&!t.delay,r;if(o)r=new Hn(e,function(){this.track(s)},t.onError,t.requiresObservable);else{var i=cl(t),a=!1;r=new Hn(e,function(){a||(a=!0,i(function(){a=!1,r.isDisposed||r.track(s)}))},t.onError,t.requiresObservable)}function s(){n(r)}return r.schedule(),r.getDisposer()}var uc=function(n){return n()};function cl(n){return n.scheduler?n.scheduler:n.delay?function(t){return setTimeout(t,n.delay)}:uc}function pl(n,t,e){e===void 0&&(e=Ai);var o=e.name||"Reaction@"+St(),r=b(o,e.onError?cc(e.onError,t):t),i=!e.scheduler&&!e.delay,a=cl(e),s=!0,l=!1,u,p=e.compareStructural?tn.structural:e.equals||tn.default,c=new Hn(o,function(){s||i?d():l||(l=!0,a(d))},e.onError,e.requiresObservable);function d(){if(l=!1,!c.isDisposed){var f=!1;c.track(function(){var h=n(c);f=s||!p(u,h),u=h}),s&&e.fireImmediately&&r(u,c),!s&&f===!0&&r(u,c),s&&(s=!1)}}return c.schedule(),c.getDisposer()}function cc(n,t){return function(){try{return t.apply(this,arguments)}catch(e){n.call(this,e)}}}function pc(n,t,e){return fl("onBecomeObserved",n,t)}function dl(n,t,e){return fl("onBecomeUnobserved",n,t)}function fl(n,t,e,o){var r=_e(t),i=e,a=n+"Listeners";r[a]?r[a].add(i):r[a]=new Set([i]);var s=r[n];return typeof s!="function"?K(!1):function(){var l=r[a];l&&(l.delete(i),l.size===0&&delete r[a])}}function dc(n){var t=n.enforceActions,e=n.computedRequiresReaction,o=n.computedConfigurable,r=n.disableErrorBoundaries,i=n.reactionScheduler,a=n.reactionRequiresObservable,s=n.observableRequiresReaction;if(Ku(),t!==void 0){(typeof t=="boolean"||t==="strict")&&Ou(`Deprecated value for 'enforceActions', use 'false' => '"never"', 'true' => '"observed"', '"strict"' => "'always'" instead`);var l=void 0;switch(t){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:K("Invalid value for 'enforceActions': '"+t+"', expected 'never', 'always' or 'observed'")}C.enforceActions=l,C.allowStateChanges=!(l===!0||l==="strict")}e!==void 0&&(C.computedRequiresReaction=!!e),a!==void 0&&(C.reactionRequiresObservable=!!a),s!==void 0&&(C.observableRequiresReaction=!!s,C.allowStateReads=!C.observableRequiresReaction),o!==void 0&&(C.computedConfigurable=!!o),r!==void 0&&(C.disableErrorBoundaries=!!r),i&&ec(i)}function Fr(n,t,e,o){o=Ue(o);var r=hl(o);return Le(n),Xi(n,o.name,r.enhancer),t&&yl(n,t,e,r),n}function hl(n){return n.defaultDecorator||(n.deep===!1?Js:ji)}function yl(n,t,e,o){var r,i,a,s;if(0){var l;try{for(var u,p;!p.done;p=u.next())var c}catch(g){}finally{}}Gt();try{var l=Au(t);try{for(var d=Qt(l),f=d.next();!f.done;f=d.next()){var c=f.value,h=Object.getOwnPropertyDescriptor(t,c),y=e&&c in e?e[c]:h.get?Li:o,v=y(n,c,h,!0);v&&Object.defineProperty(n,c,v)}}catch(m){a={error:m}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}}finally{Ut()}}function fc(n,t){return gl(_e(n,t))}function gl(n){var t={name:n.name};return n.observing&&n.observing.length>0&&(t.dependencies=wu(n.observing).map(gl)),t}function vl(n,t){if(n==null)return!1;if(t!==void 0){if(Wt(n)===!1||!n[k].values.has(t))return!1;var e=_e(n,t);return on(e)}return on(n)}function hc(n){return arguments.length>1?K(!1):vl(n)}function Ji(n,t){return typeof t!="string"?K(!1):vl(n,t)}function yc(n,t){return n==null?!1:Wt(n)||!!n[k]||Di(n)||Uo(n)||on(n)}function rn(n){return arguments.length!==1&&K(!1),yc(n)}function an(n){return Wt(n)?n[k].getKeys():Mt(n)||Lt(n)?Array.from(n.keys()):ie(n)?n.map(function(t,e){return e}):K(!1)}function gc(n){return Wt(n)?an(n).map(function(t){return n[t]}):Mt(n)?an(n).map(function(t){return n.get(t)}):Lt(n)?Array.from(n.values()):ie(n)?n.slice():K(!1)}function vc(n){return Wt(n)?an(n).map(function(t){return[t,n[t]]}):Mt(n)?an(n).map(function(t){return[t,n.get(t)]}):Lt(n)?Array.from(n.entries()):ie(n)?n.map(function(t,e){return[e,t]}):K(!1)}function Ii(n,t,e){if(arguments.length===2&&!Lt(n)){Gt();var o=t;try{for(var r in o)Ii(n,r,o[r])}finally{Ut()}return}if(Wt(n)){var i=n[k],a=i.values.get(t);a?i.write(t,e):i.addObservableProp(t,e,i.defaultEnhancer)}else if(Mt(n))n.set(t,e);else if(Lt(n))n.add(t);else if(ie(n))typeof t!="number"&&(t=parseInt(t,10)),Pe(t>=0,"Not a valid index: '"+t+"'"),Gt(),t>=n.length&&(n.length=t+1),n[t]=e,Ut();else return K(!1)}function ml(n,t,e,o){return mc(n,t,e)}function mc(n,t,e){return hr(n).observe(t,e)}var _c={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Xe(n,t,e,o){return o.detectCycles&&n.set(t,e),e}function pe(n,t,e){if(!t.recurseEverything&&!rn(n)||typeof n!="object")return n;if(n===null)return null;if(n instanceof Date)return n;if(Fu(n))return pe(n.get(),t,e);rn(n)&&an(n);var o=t.detectCycles===!0;if(o&&n!==null&&e.has(n))return e.get(n);if(ie(n)||Array.isArray(n)){var r=Xe(e,n,[],t),i=n.map(function(f){return pe(f,t,e)});r.length=i.length;for(var a=0,s=i.length;a<s;a++)r[a]=i[a];return r}if(Lt(n)||Object.getPrototypeOf(n)===Set.prototype)if(t.exportMapsAsObjects===!1){var l=Xe(e,n,new Set,t);return n.forEach(function(f){l.add(pe(f,t,e))}),l}else{var u=Xe(e,n,[],t);return n.forEach(function(f){u.push(pe(f,t,e))}),u}if(Mt(n)||Object.getPrototypeOf(n)===Map.prototype)if(t.exportMapsAsObjects===!1){var p=Xe(e,n,new Map,t);return n.forEach(function(f,h){p.set(h,pe(f,t,e))}),p}else{var c=Xe(e,n,{},t);return n.forEach(function(f,h){c[h]=pe(f,t,e)}),c}var d=Xe(e,n,{},t);return Ks(n).forEach(function(f){d[f]=pe(n[f],t,e)}),d}function qt(n,t){typeof t=="boolean"&&(t={detectCycles:t}),t||(t=_c),t.detectCycles=t.detectCycles===void 0?t.recurseEverything===!0:t.detectCycles===!0;var e;return t.detectCycles&&(e=new Map),pe(n,t,e)}function bc(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=!1;typeof n[n.length-1]=="boolean"&&(e=n.pop());var o=xc(n);if(!o)return K(!1);o.isTracing,ee.NONE,o.isTracing=e?ee.BREAK:ee.LOG}function xc(n){switch(n.length){case 0:return C.trackingDerivation;case 1:return _e(n[0]);case 2:return _e(n[0],n[1])}}function zt(n,t){t===void 0&&(t=void 0),Gt();try{return n.apply(t)}finally{Ut()}}function co(n){return n[k]}function po(n){return typeof n=="string"||typeof n=="number"||typeof n=="symbol"}var Ec={has:function(n,t){if(t===k||t==="constructor"||t===zo)return!0;var e=co(n);return po(t)?e.has(t):t in n},get:function(n,t){if(t===k||t==="constructor"||t===zo)return n[t];var e=co(n),o=e.values.get(t);if(o instanceof yn){var r=o.get();return r===void 0&&e.has(t),r}return po(t)&&e.has(t),n[t]},set:function(n,t,e){return po(t)?(Ii(n,t,e),!0):!1},deleteProperty:function(n,t){if(!po(t))return!1;var e=co(n);return e.remove(t),!0},ownKeys:function(n){var t=co(n);return t.keysAtom.reportObserved(),Reflect.ownKeys(n)},preventExtensions:function(n){return K("Dynamic observable objects cannot be frozen"),!1}};function Oc(n){var t=new Proxy(n,Ec);return n[k].proxy=t,t}function ne(n){return n.interceptors!==void 0&&n.interceptors.length>0}function no(n,t){var e=n.interceptors||(n.interceptors=[]);return e.push(t),Ws(function(){var o=e.indexOf(t);o!==-1&&e.splice(o,1)})}function oe(n,t){var e=gn();try{for(var o=Ci(n.interceptors||[]),r=0,i=o.length;r<i&&(t=o[r](t),Pe(!t||t.type,"Intercept handlers should return nothing or a change object"),!!t);r++);return t}finally{me(e)}}function Vt(n){return n.changeListeners!==void 0&&n.changeListeners.length>0}function oo(n,t){var e=n.changeListeners||(n.changeListeners=[]);return e.push(t),Ws(function(){var o=e.indexOf(t);o!==-1&&e.splice(o,1)})}function Ft(n,t){var e=gn(),o=n.changeListeners;if(o){o=o.slice();for(var r=0,i=o.length;r<i;r++)o[r](t);me(e)}}var wc=1e4,Sc={get:function(n,t){return t===k?n[k]:t==="length"?n[k].getArrayLength():typeof t=="number"?le.get.call(n,t):typeof t=="string"&&!isNaN(t)?le.get.call(n,parseInt(t)):le.hasOwnProperty(t)?le[t]:n[t]},set:function(n,t,e){return t==="length"&&n[k].setArrayLength(e),typeof t=="number"&&le.set.call(n,t,e),typeof t=="symbol"||isNaN(t)?n[t]=e:le.set.call(n,parseInt(t),e),!0},preventExtensions:function(n){return K("Observable arrays cannot be frozen"),!1}};function Mc(n,t,e,o){e===void 0&&(e="ObservableArray@"+St()),o===void 0&&(o=!1);var r=new _l(e,t,o);Mu(r.values,k,r);var i=new Proxy(r.values,Sc);if(r.proxy=i,n&&n.length){var a=dr(!0);r.spliceWithArray(0,0,n),fr(a)}return i}var _l=(function(){function n(t,e,o){this.owned=o,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new yn(t||"ObservableArray@"+St()),this.enhancer=function(r,i){return e(r,i,t+"[..]")}}return n.prototype.dehanceValue=function(t){return this.dehancer!==void 0?this.dehancer(t):t},n.prototype.dehanceValues=function(t){return this.dehancer!==void 0&&t.length>0?t.map(this.dehancer):t},n.prototype.intercept=function(t){return no(this,t)},n.prototype.observe=function(t,e){return e===void 0&&(e=!1),e&&t({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),oo(this,t)},n.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},n.prototype.setArrayLength=function(t){if(typeof t!="number"||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var o=new Array(t-e),r=0;r<t-e;r++)o[r]=void 0;this.spliceWithArray(e,0,o)}else this.spliceWithArray(t,e-t)},n.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=e},n.prototype.spliceWithArray=function(t,e,o){var r=this;en(this.atom);var i=this.values.length;if(t===void 0?t=0:t>i?t=i:t<0&&(t=Math.max(0,i+t)),arguments.length===1?e=i-t:e==null?e=0:e=Math.max(0,Math.min(e,i-t)),o===void 0&&(o=Bo),ne(this)){var a=oe(this,{object:this.proxy,type:"splice",index:t,removedCount:e,added:o});if(!a)return Bo;e=a.removedCount,o=a.added}if(o=o.length===0?o:o.map(function(u){return r.enhancer(u,void 0)}),!1)var s;var l=this.spliceItemsIntoValues(t,e,o);return(e!==0||o.length!==0)&&this.notifyArraySplice(t,o,l),this.dehanceValues(l)},n.prototype.spliceItemsIntoValues=function(t,e,o){var r;if(o.length<wc)return(r=this.values).splice.apply(r,Ci([t,e],o));var i=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(o,this.values.slice(t+e)),i},n.prototype.notifyArrayChildUpdate=function(t,e,o){var r=!this.owned&&mt(),i=Vt(this),a=i||r?{object:this.proxy,type:"update",index:t,newValue:e,oldValue:o}:null;this.atom.reportChanged(),i&&Ft(this,a)},n.prototype.notifyArraySplice=function(t,e,o){var r=!this.owned&&mt(),i=Vt(this),a=i||r?{object:this.proxy,type:"splice",index:t,removed:o,added:e,removedCount:o.length,addedCount:e.length}:null;this.atom.reportChanged(),i&&Ft(this,a)},n})(),le={intercept:function(n){return this[k].intercept(n)},observe:function(n,t){t===void 0&&(t=!1);var e=this[k];return e.observe(n,t)},clear:function(){return this.splice(0)},replace:function(n){var t=this[k];return t.spliceWithArray(0,t.values.length,n)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(n,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var r=this[k];switch(arguments.length){case 0:return[];case 1:return r.spliceWithArray(n);case 2:return r.spliceWithArray(n,t)}return r.spliceWithArray(n,t,e)},spliceWithArray:function(n,t,e){var o=this[k];return o.spliceWithArray(n,t,e)},push:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=this[k];return e.spliceWithArray(e.values.length,0,n),e.values.length},pop:function(){return this.splice(Math.max(this[k].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=this[k];return e.spliceWithArray(0,0,n),e.values.length},reverse:function(){var n=this.slice();return n.reverse.apply(n,arguments)},sort:function(n){var t=this.slice();return t.sort.apply(t,arguments)},remove:function(n){var t=this[k],e=t.dehanceValues(t.values).indexOf(n);return e>-1?(this.splice(e,1),!0):!1},get:function(n){var t=this[k];if(t&&n<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[n])},set:function(n,t){var e=this[k],o=e.values;if(n<o.length){en(e.atom);var r=o[n];if(ne(e)){var i=oe(e,{type:"update",object:e.proxy,index:n,newValue:t});if(!i)return;t=i.newValue}t=e.enhancer(t,r);var a=t!==r;a&&(o[n]=t,e.notifyArrayChildUpdate(n,t,r))}else if(n===o.length)e.spliceWithArray(n,0,[t]);else throw new Error("[mobx.array] Index out of bounds, "+n+" is larger than "+o.length)}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach(function(n){typeof Array.prototype[n]=="function"&&(le[n]=function(){var t=this[k];t.atom.reportObserved();var e=t.dehanceValues(t.values);return e[n].apply(e,arguments)})});["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach(function(n){typeof Array.prototype[n]=="function"&&(le[n]=function(t,e){var o=this,r=this[k];r.atom.reportObserved();var i=r.dehanceValues(r.values);return i[n](function(a,s){return t.call(e,a,s,o)},e)})});["reduce","reduceRight"].forEach(function(n){le[n]=function(){var t=this,e=this[k];e.atom.reportObserved();var o=arguments[0];return arguments[0]=function(r,i,a){return i=e.dehanceValue(i),o(r,i,a,t)},e.values[n].apply(e.values,arguments)}});var Tc=xe("ObservableArrayAdministration",_l);function ie(n){return Pi(n)&&Tc(n[k])}var Qi,Ac={},Ri=(function(){function n(t,e,o){if(e===void 0&&(e=eo),o===void 0&&(o="ObservableMap@"+St()),this.enhancer=e,this.name=o,this[Qi]=Ac,this._keysAtom=Ni(this.name+".keys()"),this[Symbol.toStringTag]="Map",typeof Map!="function")throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(t)}return n.prototype._has=function(t){return this._data.has(t)},n.prototype.has=function(t){var e=this;if(!C.trackingDerivation)return this._has(t);var o=this._hasMap.get(t);if(!o){var r=o=new Ne(this._has(t),cr,this.name+"."+ye(t)+"?",!1);this._hasMap.set(t,r),dl(r,function(){return e._hasMap.delete(t)})}return o.get()},n.prototype.set=function(t,e){var o=this._has(t);if(ne(this)){var r=oe(this,{type:o?"update":"add",object:this,newValue:e,name:t});if(!r)return this;e=r.newValue}return o?this._updateValue(t,e):this._addValue(t,e),this},n.prototype.delete=function(t){var e=this;if(en(this._keysAtom),ne(this)){var o=oe(this,{type:"delete",object:this,name:t});if(!o)return!1}if(this._has(t)){var r=mt(),i=Vt(this),o=i||r?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return zt(function(){e._keysAtom.reportChanged(),e._updateHasMapEntry(t,!1);var s=e._data.get(t);s.setNewValue(void 0),e._data.delete(t)}),i&&Ft(this,o),!0}return!1},n.prototype._updateHasMapEntry=function(t,e){var o=this._hasMap.get(t);o&&o.setNewValue(e)},n.prototype._updateValue=function(t,e){var o=this._data.get(t);if(e=o.prepareNewValue(e),e!==C.UNCHANGED){var r=mt(),i=Vt(this),a=i||r?{type:"update",object:this,oldValue:o.value,name:t,newValue:e}:null;o.setNewValue(e),i&&Ft(this,a)}},n.prototype._addValue=function(t,e){var o=this;en(this._keysAtom),zt(function(){var s=new Ne(e,o.enhancer,o.name+"."+ye(t),!1);o._data.set(t,s),e=s.value,o._updateHasMapEntry(t,!0),o._keysAtom.reportChanged()});var r=mt(),i=Vt(this),a=i||r?{type:"add",object:this,name:t,newValue:e}:null;i&&Ft(this,a)},n.prototype.get=function(t){return this.has(t)?this.dehanceValue(this._data.get(t).get()):this.dehanceValue(void 0)},n.prototype.dehanceValue=function(t){return this.dehancer!==void 0?this.dehancer(t):t},n.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},n.prototype.values=function(){var t=this,e=this.keys();return Vo({next:function(){var o=e.next(),r=o.done,i=o.value;return{done:r,value:r?void 0:t.get(i)}}})},n.prototype.entries=function(){var t=this,e=this.keys();return Vo({next:function(){var o=e.next(),r=o.done,i=o.value;return{done:r,value:r?void 0:[i,t.get(i)]}}})},n.prototype[Qi=k,Symbol.iterator]=function(){return this.entries()},n.prototype.forEach=function(t,e){var o,r;try{for(var i=Qt(this),a=i.next();!a.done;a=i.next()){var s=Fe(a.value,2),l=s[0],u=s[1];t.call(e,u,l,this)}}catch(p){o={error:p}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}},n.prototype.merge=function(t){var e=this;return Mt(t)&&(t=t.toJS()),zt(function(){var o=dr(!0);try{dn(t)?Ks(t).forEach(function(r){return e.set(r,t[r])}):Array.isArray(t)?t.forEach(function(r){var i=Fe(r,2),a=i[0],s=i[1];return e.set(a,s)}):hn(t)?(t.constructor!==Map&&K("Cannot initialize from classes that inherit from Map: "+t.constructor.name),t.forEach(function(r,i){return e.set(i,r)})):t!=null&&K("Cannot initialize map from "+t)}finally{fr(o)}}),this},n.prototype.clear=function(){var t=this;zt(function(){tl(function(){var e,o;try{for(var r=Qt(t.keys()),i=r.next();!i.done;i=r.next()){var a=i.value;t.delete(a)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}})})},n.prototype.replace=function(t){var e=this;return zt(function(){var o,r,i,a,s=Su(t),l=new Map,u=!1;try{for(var p=Qt(e._data.keys()),c=p.next();!c.done;c=p.next()){var d=c.value;if(!s.has(d)){var f=e.delete(d);if(f)u=!0;else{var h=e._data.get(d);l.set(d,h)}}}}catch(x){o={error:x}}finally{try{c&&!c.done&&(r=p.return)&&r.call(p)}finally{if(o)throw o.error}}try{for(var y=Qt(s.entries()),v=y.next();!v.done;v=y.next()){var g=Fe(v.value,2),d=g[0],h=g[1],m=e._data.has(d);if(e.set(d,h),e._data.has(d)){var M=e._data.get(d);l.set(d,M),m||(u=!0)}}}catch(x){i={error:x}}finally{try{v&&!v.done&&(a=y.return)&&a.call(y)}finally{if(i)throw i.error}}if(!u)if(e._data.size!==l.size)e._keysAtom.reportChanged();else for(var T=e._data.keys(),w=l.keys(),S=T.next(),_=w.next();!S.done;){if(S.value!==_.value){e._keysAtom.reportChanged();break}S=T.next(),_=w.next()}e._data=l}),this},Object.defineProperty(n.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),n.prototype.toPOJO=function(){var t,e,o={};try{for(var r=Qt(this),i=r.next();!i.done;i=r.next()){var a=Fe(i.value,2),s=a[0],l=a[1];o[typeof s=="symbol"?s:ye(s)]=l}}catch(u){t={error:u}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return o},n.prototype.toJS=function(){return new Map(this)},n.prototype.toJSON=function(){return this.toPOJO()},n.prototype.toString=function(){var t=this;return this.name+"[{ "+Array.from(this.keys()).map(function(e){return ye(e)+": "+(""+t.get(e))}).join(", ")+" }]"},n.prototype.observe=function(t,e){return oo(this,t)},n.prototype.intercept=function(t){return no(this,t)},n})(),Mt=xe("ObservableMap",Ri),ta,Pc={},bl=(function(){function n(t,e,o){if(e===void 0&&(e=eo),o===void 0&&(o="ObservableSet@"+St()),this.name=o,this[ta]=Pc,this._data=new Set,this._atom=Ni(this.name),this[Symbol.toStringTag]="Set",typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(r,i){return e(r,i,o)},t&&this.replace(t)}return n.prototype.dehanceValue=function(t){return this.dehancer!==void 0?this.dehancer(t):t},n.prototype.clear=function(){var t=this;zt(function(){tl(function(){var e,o;try{for(var r=Qt(t._data.values()),i=r.next();!i.done;i=r.next()){var a=i.value;t.delete(a)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(o=r.return)&&o.call(r)}finally{if(e)throw e.error}}})})},n.prototype.forEach=function(t,e){var o,r;try{for(var i=Qt(this),a=i.next();!a.done;a=i.next()){var s=a.value;t.call(e,s,s,this)}}catch(l){o={error:l}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}},Object.defineProperty(n.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),n.prototype.add=function(t){var e=this;if(en(this._atom),ne(this)){var o=oe(this,{type:"add",object:this,newValue:t});if(!o)return this}if(!this.has(t)){zt(function(){e._data.add(e.enhancer(t,void 0)),e._atom.reportChanged()});var r=mt(),i=Vt(this),o=i||r?{type:"add",object:this,newValue:t}:null;i&&Ft(this,o)}return this},n.prototype.delete=function(t){var e=this;if(ne(this)){var o=oe(this,{type:"delete",object:this,oldValue:t});if(!o)return!1}if(this.has(t)){var r=mt(),i=Vt(this),o=i||r?{type:"delete",object:this,oldValue:t}:null;return zt(function(){e._atom.reportChanged(),e._data.delete(t)}),i&&Ft(this,o),!0}return!1},n.prototype.has=function(t){return this._atom.reportObserved(),this._data.has(this.dehanceValue(t))},n.prototype.entries=function(){var t=0,e=Array.from(this.keys()),o=Array.from(this.values());return Vo({next:function(){var r=t;return t+=1,r<o.length?{value:[e[r],o[r]],done:!1}:{done:!0}}})},n.prototype.keys=function(){return this.values()},n.prototype.values=function(){this._atom.reportObserved();var t=this,e=0,o=Array.from(this._data.values());return Vo({next:function(){return e<o.length?{value:t.dehanceValue(o[e++]),done:!1}:{done:!0}}})},n.prototype.replace=function(t){var e=this;return Lt(t)&&(t=t.toJS()),zt(function(){var o=dr(!0);try{Array.isArray(t)?(e.clear(),t.forEach(function(r){return e.add(r)})):to(t)?(e.clear(),t.forEach(function(r){return e.add(r)})):t!=null&&K("Cannot initialize set from "+t)}finally{fr(o)}}),this},n.prototype.observe=function(t,e){return oo(this,t)},n.prototype.intercept=function(t){return no(this,t)},n.prototype.toJS=function(){return new Set(this)},n.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},n.prototype[ta=k,Symbol.iterator]=function(){return this.values()},n})(),Lt=xe("ObservableSet",bl),xl=(function(){function n(t,e,o,r){e===void 0&&(e=new Map),this.target=t,this.values=e,this.name=o,this.defaultEnhancer=r,this.keysAtom=new yn(o+".keys")}return n.prototype.read=function(t){return this.values.get(t).get()},n.prototype.write=function(t,e){var o=this.target,r=this.values.get(t);if(r instanceof nn){r.set(e);return}if(ne(this)){var i=oe(this,{type:"update",object:this.proxy||o,name:t,newValue:e});if(!i)return;e=i.newValue}if(e=r.prepareNewValue(e),e!==C.UNCHANGED){var a=Vt(this),s=mt(),i=a||s?{type:"update",object:this.proxy||o,oldValue:r.value,name:t,newValue:e}:null;r.setNewValue(e),a&&Ft(this,i)}},n.prototype.has=function(t){var e=this.pendingKeys||(this.pendingKeys=new Map),o=e.get(t);if(o)return o.get();var r=!!this.values.get(t);return o=new Ne(r,cr,this.name+"."+ye(t)+"?",!1),e.set(t,o),o.get()},n.prototype.addObservableProp=function(t,e,o){o===void 0&&(o=this.defaultEnhancer);var r=this.target;if(ne(this)){var i=oe(this,{object:this.proxy||r,name:t,type:"add",newValue:e});if(!i)return;e=i.newValue}var a=new Ne(e,o,this.name+"."+ye(t),!1);this.values.set(t,a),e=a.value,Object.defineProperty(r,t,Dc(t)),this.notifyPropertyAddition(t,e)},n.prototype.addComputedProp=function(t,e,o){var r=this.target;o.name=o.name||this.name+"."+ye(e),this.values.set(e,new nn(o)),(t===r||Tu(t,e))&&Object.defineProperty(t,e,Nc(e))},n.prototype.remove=function(t){if(this.values.has(t)){var e=this.target;if(ne(this)){var o=oe(this,{object:this.proxy||e,name:t,type:"remove"});if(!o)return}try{Gt();var r=Vt(this),i=mt(),a=this.values.get(t),s=a&&a.get();if(a&&a.set(void 0),this.keysAtom.reportChanged(),this.values.delete(t),this.pendingKeys){var l=this.pendingKeys.get(t);l&&l.set(!1)}delete this.target[t];var o=r||i?{type:"remove",object:this.proxy||e,oldValue:s,name:t}:null;r&&Ft(this,o)}finally{Ut()}}},n.prototype.illegalAccess=function(t,e){},n.prototype.observe=function(t,e){return oo(this,t)},n.prototype.intercept=function(t){return no(this,t)},n.prototype.notifyPropertyAddition=function(t,e){var o=Vt(this),r=mt(),i=o||r?{type:"add",object:this.proxy||this.target,name:t,newValue:e}:null;if(o&&Ft(this,i),this.pendingKeys){var a=this.pendingKeys.get(t);a&&a.set(!0)}this.keysAtom.reportChanged()},n.prototype.getKeys=function(){var t,e;this.keysAtom.reportObserved();var o=[];try{for(var r=Qt(this.values),i=r.next();!i.done;i=r.next()){var a=Fe(i.value,2),s=a[0],l=a[1];l instanceof Ne&&o.push(s)}}catch(u){t={error:u}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return o},n})();function Xi(n,t,e){if(t===void 0&&(t=""),e===void 0&&(e=eo),Object.prototype.hasOwnProperty.call(n,k))return n[k];dn(n)||(t=(n.constructor.name||"ObservableObject")+"@"+St()),t||(t="ObservableObject@"+St());var o=new xl(n,new Map,ye(t),e);return fn(n,k,o),o}var ea=Object.create(null),na=Object.create(null);function Dc(n){return ea[n]||(ea[n]={configurable:!0,enumerable:!0,get:function(){return this[k].read(n)},set:function(t){this[k].write(n,t)}})}function oa(n){var t=n[k];return t||(Le(n),n[k])}function Nc(n){return na[n]||(na[n]={configurable:C.computedConfigurable,enumerable:!1,get:function(){return oa(this).read(n)},set:function(t){oa(this).write(n,t)}})}var Cc=xe("ObservableObjectAdministration",xl);function Wt(n){return Pi(n)?(Le(n),Cc(n[k])):!1}function _e(n,t){if(typeof n=="object"&&n!==null){if(ie(n))return t!==void 0&&K(!1),n[k].atom;if(Lt(n))return n[k];if(Mt(n)){var e=n;if(t===void 0)return e._keysAtom;var o=e._data.get(t)||e._hasMap.get(t);return o||K(!1),o}if(Le(n),t&&!n[k]&&n[t],Wt(n)){if(!t)return K(!1);var o=n[k].values.get(t);return o||K(!1),o}if(Di(n)||on(n)||Uo(n))return n}else if(typeof n=="function"&&Uo(n[k]))return n[k];return K(!1)}function hr(n,t){if(n||K("Expecting some object"),t!==void 0)return hr(_e(n,t));if(Di(n)||on(n)||Uo(n)||Mt(n)||Lt(n))return n;if(Le(n),n[k])return n[k];K(!1)}function jc(n,t){var e;return t!==void 0?e=_e(n,t):Wt(n)||Mt(n)||Lt(n)?e=hr(n):e=_e(n),e.name}var ra=Object.prototype.toString;function El(n,t,e){return e===void 0&&(e=-1),Wr(n,t,e)}function Wr(n,t,e,o,r){if(n===t)return n!==0||1/n===1/t;if(n==null||t==null)return!1;if(n!==n)return t!==t;var i=typeof n;if(i!=="function"&&i!=="object"&&typeof t!="object")return!1;var a=ra.call(n);if(a!==ra.call(t))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!=+n?+t!=+t:+n==0?1/+n===1/t:+n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object Symbol]":return typeof Symbol!="undefined"&&Symbol.valueOf.call(n)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":e>=0&&e++;break}n=ia(n),t=ia(t);var s=a==="[object Array]";if(!s){if(typeof n!="object"||typeof t!="object")return!1;var l=n.constructor,u=t.constructor;if(l!==u&&!(typeof l=="function"&&l instanceof l&&typeof u=="function"&&u instanceof u)&&"constructor"in n&&"constructor"in t)return!1}if(e===0)return!1;e<0&&(e=-1),o=o||[],r=r||[];for(var p=o.length;p--;)if(o[p]===n)return r[p]===t;if(o.push(n),r.push(t),s){if(p=n.length,p!==t.length)return!1;for(;p--;)if(!Wr(n[p],t[p],e-1,o,r))return!1}else{var c=Object.keys(n),d=void 0;if(p=c.length,Object.keys(t).length!==p)return!1;for(;p--;)if(d=c[p],!(Lc(t,d)&&Wr(n[d],t[d],e-1,o,r)))return!1}return o.pop(),r.pop(),!0}function ia(n){return ie(n)?n.slice():hn(n)||Mt(n)||to(n)||Lt(n)?Array.from(n.entries()):n}function Lc(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function Vo(n){return n[Symbol.iterator]=kc,n}function kc(){return this}if(typeof Proxy=="undefined"||typeof Symbol=="undefined")throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");(function(){function n(){}if(n.name!=="testCodeMinification"&&!1)var t})();typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:oc,extras:{getDebugName:jc},$mobx:k});function Ic(n){return!(n.prototype&&n.prototype.render)&&!G.isPrototypeOf(n)}function Ol(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=t.prefix,o=e===void 0?"":e,r=t.suffix,i=r===void 0?"":r,a=n.displayName||n.name||n.constructor&&n.constructor.name||"<component>";return o+a+i}var aa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},wl=function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")},Sl=(function(){function n(t,e){for(var o=0;o<e.length;o++){var r=e[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,e,o){return e&&n(t.prototype,e),o&&n(t,o),t}})(),Ml=function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)},Tl=function(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:n},sa=console;function Rc(n){var t=Ur().allowStateChanges;return Ur().allowStateChanges=n,t}function Xc(n){Ur().allowStateChanges=n}function Bc(n,t,e,o,r){var i=Rc(n),a=void 0;try{a=t(e,o,r)}finally{Xc(i)}return a}function la(n,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=n[t],r=Al[t],i=o?e===!0?function(){r.apply(this,arguments),o.apply(this,arguments)}:function(){o.apply(this,arguments),r.apply(this,arguments)}:r;n[t]=i}function ua(n,t){if(n==null||t==null||(typeof n=="undefined"?"undefined":aa(n))!=="object"||(typeof t=="undefined"?"undefined":aa(t))!=="object")return n!==t;var e=Object.keys(n);if(e.length!==Object.keys(t).length)return!0;for(var o=void 0,r=e.length-1;o=e[r];r--)if(t[o]!==n[o])return!0;return!1}var Al={componentWillMount:function(){var n=this,t=Ol(this),e=!1,o=!1;function r(p){var c=this[p],d=Ni("reactive "+p);Object.defineProperty(this,p,{configurable:!0,enumerable:!0,get:function(){return d.reportObserved(),c},set:function(f){!o&&ua(c,f)?(c=f,e=!0,d.reportChanged(),e=!1):c=f}})}r.call(this,"props"),r.call(this,"state");var i=this.render.bind(this),a=null,s=!1,l=function(){return a=new Hn(t+".render()",function(){if(!s&&(s=!0,typeof n.componentWillReact=="function"&&n.componentWillReact(),n.__$mobxIsUnmounted!==!0)){var p=!0;try{o=!0,e||G.prototype.forceUpdate.call(n),p=!1}finally{o=!1,p&&a.dispose()}}}),a.reactComponent=n,u.$mobx=a,n.render=u,u(n.props,n.state,n.context)},u=function(p,c,d){s=!1;var f=void 0,h=void 0;if(a.track(function(){try{h=Bc(!1,i,p,c,d)}catch(y){f=y}}),f)throw f;return h};this.render=l},componentWillUnmount:function(){this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(n,t){return this.state!==t?!0:ua(this.props,n)}};function Bi(n){if(arguments.length>1&&sa.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),n.isMobxInjector===!0&&sa.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),Ic(n)){var t,e;return Bi((e=t=(function(r){Ml(i,r);function i(){return wl(this,i),Tl(this,(i.__proto__||Object.getPrototypeOf(i)).apply(this,arguments))}return Sl(i,[{key:"render",value:function(){return n.call(this,this.props,this.context)}}]),i})(G),t.displayName=Ol(n),e))}if(!n)throw new Error("Please pass a valid component to 'observer'");var o=n.prototype||n;return Hc(o),n.isMobXReactObserver=!0,n}function Hc(n){la(n,"componentWillMount",!0),la(n,"componentDidMount"),n.shouldComponentUpdate||(n.shouldComponentUpdate=Al.shouldComponentUpdate)}var zc=Bi(function(n){var t=n.children;return t[0]()});zc.displayName="Observer";var Yc=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Gc(n,t){return t={exports:{}},n(t,t.exports),t.exports}Gc(function(n,t){(function(e,o){n.exports=o()})(Yc,(function(){var e={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r=Object.defineProperty,i=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.getOwnPropertyDescriptor,l=Object.getPrototypeOf,u=l&&l(Object);return function p(c,d,f){if(typeof d!="string"){if(u){var h=l(d);h&&h!==u&&p(c,h,f)}var y=i(d);a&&(y=y.concat(a(d)));for(var v=0;v<y.length;++v){var g=y[v];if(!e[g]&&!o[g]&&(!f||!f[g])){var m=s(d,g);try{r(c,g,m)}catch(M){}}}return c}return c}}))});var ca={children:!0,key:!0,ref:!0},pa=console;(function(n){Ml(t,n);function t(){return wl(this,t),Tl(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Sl(t,[{key:"render",value:function(e){var o=e.children;return o.length>1?$e("div",null," ",o," "):o[0]}},{key:"getChildContext",value:function(){var e={},o=this.context.mobxStores;if(o)for(var r in o)e[r]=o[r];for(var i in this.props)!ca[i]&&i!=="suppressChangedStoreWarning"&&(e[i]=this.props[i]);return{mobxStores:e}}},{key:"componentWillReceiveProps",value:function(e){if(Object.keys(e).length!==Object.keys(this.props).length&&pa.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!e.suppressChangedStoreWarning)for(var o in e)!ca[o]&&this.props[o]!==e[o]&&pa.warn("MobX Provider: Provided store '"+o+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),t})(G);if(!G)throw new Error("mobx-preact requires Preact to be available");var $t,br,da,Pl=[],gt=H,fa=gt.__b,ha=gt.__r,ya=gt.diffed,ga=gt.__c,va=gt.unmount,ma=gt.__;function Uc(){for(var n;n=Pl.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(ko),n.__H.__h.forEach(Kr),n.__H.__h=[]}catch(t){n.__H.__h=[],gt.__e(t,n.__v)}}gt.__b=function(n){$t=null,fa&&fa(n)},gt.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),ma&&ma(n,t)},gt.__r=function(n){ha&&ha(n);var t=($t=n.__c).__H;t&&(br===$t?(t.__h=[],$t.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(ko),t.__h.forEach(Kr),t.__h=[])),br=$t},gt.diffed=function(n){ya&&ya(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(Pl.push(t)!==1&&da===gt.requestAnimationFrame||((da=gt.requestAnimationFrame)||Vc)(Uc)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),br=$t=null},gt.__c=function(n,t){t.some(function(e){try{e.__h.forEach(ko),e.__h=e.__h.filter(function(o){return!o.__||Kr(o)})}catch(o){t.some(function(r){r.__h&&(r.__h=[])}),t=[],gt.__e(o,e.__v)}}),ga&&ga(n,t)},gt.unmount=function(n){va&&va(n);var t,e=n.__c;e&&e.__H&&(e.__H.__.forEach(function(o){try{ko(o)}catch(r){t=r}}),e.__H=void 0,t&>.__e(t,e.__v))};var _a=typeof requestAnimationFrame=="function";function Vc(n){var t,e=function(){clearTimeout(o),_a&&cancelAnimationFrame(t),setTimeout(n)},o=setTimeout(e,35);_a&&(t=requestAnimationFrame(e))}function ko(n){var t=$t,e=n.__c;typeof e=="function"&&(n.__c=void 0,e()),$t=t}function Kr(n){var t=$t;n.__c=n.__(),$t=t}function Fc(n,t){for(var e in t)n[e]=t[e];return n}function ba(n,t){for(var e in n)if(e!=="__source"&&!(e in t))return!0;for(var o in t)if(o!=="__source"&&n[o]!==t[o])return!0;return!1}function xa(n,t){this.props=n,this.context=t}(xa.prototype=new G).isPureReactComponent=!0,xa.prototype.shouldComponentUpdate=function(n,t){return ba(this.props,n)||ba(this.state,t)};var Ea=H.__b;H.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),Ea&&Ea(n)};var Wc=H.__e;H.__e=function(n,t,e,o){if(n.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return t.__e==null&&(t.__e=e.__e,t.__k=e.__k),r.__c(n,t)}Wc(n,t,e,o)};var Oa=H.unmount;function Dl(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),n.__c.__H=null),(n=Fc({},n)).__c!=null&&(n.__c.__P===e&&(n.__c.__P=t),n.__c.__e=!0,n.__c=null),n.__k=n.__k&&n.__k.map(function(o){return Dl(o,t,e)})),n}function Nl(n,t,e){return n&&e&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(o){return Nl(o,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=e)),n}function xr(){this.__u=0,this.o=null,this.__b=null}function Cl(n){var t=n.__.__c;return t&&t.__a&&t.__a(n)}function fo(){this.i=null,this.l=null}H.unmount=function(n){var t=n.__c;t&&t.__R&&t.__R(),t&&32&n.__u&&(n.type=null),Oa&&Oa(n)},(xr.prototype=new G).__c=function(n,t){var e=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(e);var r=Cl(o.__v),i=!1,a=function(){i||(i=!0,e.__R=null,r?r(s):s())};e.__R=a;var s=function(){if(!--o.__u){if(o.state.__a){var l=o.state.__a;o.__v.__k[0]=Nl(l,l.__c.__P,l.__c.__O)}var u;for(o.setState({__a:o.__b=null});u=o.o.pop();)u.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),n.then(a,a)},xr.prototype.componentWillUnmount=function(){this.o=[]},xr.prototype.render=function(n,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Dl(this.__b,e,o.__O=o.__P)}this.__b=null}var r=t.__a&&$e(Je,null,n.fallback);return r&&(r.__u&=-33),[$e(Je,null,t.__a?null:n.children),r]};var wa=function(n,t,e){if(++e[1]===e[0]&&n.l.delete(t),n.props.revealOrder&&(n.props.revealOrder[0]!=="t"||!n.l.size))for(e=n.i;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;n.i=e=e[2]}};(fo.prototype=new G).__a=function(n){var t=this,e=Cl(t.__v),o=t.l.get(n);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),wa(t,n,o)):r()};e?e(i):i()}},fo.prototype.render=function(n){this.i=null,this.l=new Map;var t=Xo(n.children);n.revealOrder&&n.revealOrder[0]==="b"&&t.reverse();for(var e=t.length;e--;)this.l.set(t[e],this.i=[1,0,this.i]);return n.children},fo.prototype.componentDidUpdate=fo.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(t,e){wa(n,e,t)})};var Kc=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Zc=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,qc=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,$c=/[A-Z0-9]/g,Jc=typeof document!="undefined",Qc=function(n){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(n)};function Sa(n,t,e){return t.__k==null&&(t.textContent=""),xu(n,t),typeof e=="function"&&e(),n?n.__c:null}G.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(G.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(t){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t})}})});var Ma=H.event;function tp(){}function ep(){return this.cancelBubble}function np(){return this.defaultPrevented}H.event=function(n){return Ma&&(n=Ma(n)),n.persist=tp,n.isPropagationStopped=ep,n.isDefaultPrevented=np,n.nativeEvent=n};var op={enumerable:!1,configurable:!0,get:function(){return this.class}},Ta=H.vnode;H.vnode=function(n){typeof n.type=="string"&&(function(t){var e=t.props,o=t.type,r={},i=o.indexOf("-")===-1;for(var a in e){var s=e[a];if(!(a==="value"&&"defaultValue"in e&&s==null||Jc&&a==="children"&&o==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in e&&e.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||o!=="input"&&o!=="textarea"||Qc(e.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":qc.test(a)&&(a=l):l=a="oninput":i&&Zc.test(a)?a=a.replace($c,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&r[a=l]&&(a="oninputCapture"),r[a]=s}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=Xo(e.children).forEach(function(u){u.props.selected=r.value.indexOf(u.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=Xo(e.children).forEach(function(u){u.props.selected=r.multiple?r.defaultValue.indexOf(u.props.value)!=-1:r.defaultValue==u.props.value})),e.class&&!e.className?(r.class=e.class,Object.defineProperty(r,"className",op)):(e.className&&!e.class||e.class&&e.className)&&(r.class=r.className=e.className),t.props=r})(n),n.$$typeof=Kc,Ta&&Ta(n)};var Aa=H.__r;H.__r=function(n){Aa&&Aa(n),n.__c};var Pa=H.diffed;H.diffed=function(n){Pa&&Pa(n);var t=n.props,e=n.__e;e!=null&&n.type==="textarea"&&"value"in t&&t.value!==e.value&&(e.value=t.value==null?"":t.value)};var rp=0;function O(n,t,e,o,r,i){t||(t={});var a,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?a=t[s]:l[s]=t[s];var u={type:n,props:l,key:e,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--rp,__i:-1,__u:0,__source:r,__self:i};if(typeof n=="function"&&(a=n.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return H.vnode&&H.vnode(u),u}var ip=function(n,t){var e={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(e[o[r]]=n[o[r]]);return e},zn;(function(n){function t(e){var o=ip(e,[]),r=e.container;if(!r)throw new Error("Ensure the container of LogicFlow is specified and valid.");return Z({},n.defaults,o)}n.get=t})(zn||(zn={}));(function(n){n.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}})(zn||(zn={}));var Da={node:!1,edge:!1},ap={node:!0,edge:!0},sp=function(n){return!n||typeof n=="boolean"?n===!0?X(ap):X(Da):Io(X(Da),n)},lp=function(){return lr(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null};function Et(n){try{return JSON.parse(JSON.stringify(n))}catch(t){return n}}var ho=200,up=9999,cp=10,W;(function(n){n[n.DEFAULT=1]="DEFAULT",n[n.TEXT_EDIT=2]="TEXT_EDIT",n[n.SHOW_MENU=3]="SHOW_MENU",n[n.ALLOW_CONNECT=4]="ALLOW_CONNECT",n[n.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(W||(W={}));var rt;(function(n){n.NODE="node",n.EDGE="edge",n.GRAPH="graph"})(rt||(rt={}));var z;(function(n){n.NODE="node",n.CIRCLE_NODE="circle-node",n.POLYGON_NODE="polygon-node",n.RECT_NODE="rect-node",n.TEXT_NODE="text-node",n.ELLIPSE_NODE="ellipse-node",n.DIAMOND_NODE="diamond-node",n.HTML_NODE="html-node",n.CUSTOM_HTML_NODE="custom-html-node",n.EDGE="edge",n.LINE_EDGE="line-edge",n.POLYLINE_EDGE="polyline-edge",n.BEZIER_EDGE="bezier-edge",n.GRAPH="graph"})(z||(z={}));var N;(function(n){n.ELEMENT_CLICK="element:click",n.NODE_ADD="node:add",n.NODE_DELETE="node:delete",n.NODE_CLICK="node:click",n.NODE_DBCLICK="node:dbclick",n.NODE_GROUP_COPY="node:group-copy-add",n.NODE_DND_ADD="node:dnd-add",n.NODE_DND_DRAG="node:dnd-drag",n.NODE_MOUSEDOWN="node:mousedown",n.NODE_DRAGSTART="node:dragstart",n.NODE_DRAG="node:drag",n.NODE_DROP="node:drop",n.NODE_MOUSEUP="node:mouseup",n.NODE_MOUSEMOVE="node:mousemove",n.NODE_MOUSEENTER="node:mouseenter",n.NODE_MOUSELEAVE="node:mouseleave",n.NODE_CONTEXTMENU="node:contextmenu",n.NODE_ROTATE="node:rotate",n.NODE_RESIZE="node:resize",n.NODE_FOCUS="node:focus",n.NODE_BLUR="node:blur",n.NODE_PROPERTIES_CHANGE="node:properties-change",n.NODE_PROPERTIES_DELETE="node:properties-delete",n.EDGE_ADD="edge:add",n.EDGE_DELETE="edge:delete",n.EDGE_CLICK="edge:click",n.EDGE_DBCLICK="edge:dbclick",n.EDGE_FOCUS="edge:focus",n.EDGE_BLUR="edge:blur",n.EDGE_MOUSEENTER="edge:mouseenter",n.EDGE_MOUSELEAVE="edge:mouseleave",n.EDGE_CONTEXTMENU="edge:contextmenu",n.EDGE_ADJUST="edge:adjust",n.EDGE_EXCHANGE_NODE="edge:exchange-node",n.ANCHOR_CLICK="anchor:click",n.ANCHOR_MOUSEDOWN="anchor:mousedown",n.ANCHOR_DRAGSTART="anchor:dragstart",n.ANCHOR_DRAG="anchor:drag",n.ANCHOR_DROP="anchor:drop",n.ANCHOR_DRAGEND="anchor:dragend",n.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",n.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",n.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",n.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",n.ADJUST_POINT_DRAG="adjustPoint:drag",n.ADJUST_POINT_DROP="adjustPoint:drop",n.ADJUST_POINT_DRAGEND="adjustPoint:dragend",n.BLANK_MOUSEDOWN="blank:mousedown",n.BLANK_DRAGSTART="blank:dragstart",n.BLANK_DRAG="blank:drag",n.BLANK_DROP="blank:drop",n.BLANK_MOUSEMOVE="blank:mousemove",n.BLANK_CANVAS_MOUSEMOVE="blank:canvas-mousemove",n.BLANK_MOUSEUP="blank:mouseup",n.BLANK_CLICK="blank:click",n.BLANK_CONTEXTMENU="blank:contextmenu",n.SELECTION_MOUSEDOWN="selection:mousedown",n.SELECTION_DRAGSTART="selection:dragstart",n.SELECTION_DRAG="selection:drag",n.SELECTION_DROP="selection:drop",n.SELECTION_MOUSEMOVE="selection:mousemove",n.SELECTION_MOUSEUP="selection:mouseup",n.SELECTION_CONTEXTMENU="selection:contextmenu",n.CONNECTION_NOT_ALLOWED="connection:not-allowed",n.TEXT_MOUSEDOWN="text:mousedown",n.TEXT_DRAGSTART="text:dragstart",n.TEXT_DRAG="text:drag",n.TEXT_DROP="text:drop",n.TEXT_CLICK="text:click",n.TEXT_DBCLICK="text:dbclick",n.TEXT_BLUR="text:blur",n.TEXT_MOUSEMOVE="text:mousemove",n.TEXT_MOUSEUP="text:mouseup",n.TEXT_FOCUS="text:focus",n.TEXT_ADD="text:add",n.TEXT_UPDATE="text:update",n.TEXT_CLEAR="text:clear",n.LABEL_MOUSEDOWN="label:mousedown",n.LABEL_DRAGSTART="label:dragstart",n.LABEL_DRAG="label:drag",n.LABEL_DROP="label:drop",n.LABEL_CLICK="label:click",n.LABEL_DBCLICK="label:dbclick",n.LABEL_BLUR="label:blur",n.LABEL_MOUSEMOVE="label:mousemove",n.LABEL_MOUSEUP="label:mouseup",n.LABEL_FOCUS="label:focus",n.LABEL_ADD="label:add",n.LABEL_UPDATE="label:update",n.LABEL_CLEAR="label:clear",n.LABEL_DELETE="label:delete",n.LABEL_SHOULD_ADD="label:should-add",n.LABEL_BATCH_ADD="label:batch-add",n.LABEL_SHOULD_UPDATE="label:should-update",n.LABEL_SHOULD_DELETE="label:should-delete",n.LABEL_BATCH_DELETE="label:batch-delete",n.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",n.HISTORY_CHANGE="history:change",n.GRAPH_TRANSFORM="graph:transform",n.GRAPH_RENDERED="graph:rendered",n.GRAPH_UPDATED="graph:updated",n.EDIT_CONFIG_CHANGED="editConfig:changed"})(N||(N={}));var ft;(function(n){n[n.STATIC=-1]="STATIC",n[n.DEFAULT=0]="DEFAULT",n[n.INCREASE=1]="INCREASE",n[n.EDGE_TOP=2]="EDGE_TOP"})(ft||(ft={}));var et;(function(n){n.HORIZONTAL="horizontal",n.VERTICAL="vertical"})(et||(et={}));var jt;(function(n){n.TEXT="text",n.LABEL="label"})(jt||(jt={}));var pp=0,ae=(function(){function n(t){var e=t.onDragStart,o=e===void 0?mr:e,r=t.onDragging,i=r===void 0?mr:r,a=t.onDragEnd,s=a===void 0?mr:a,l=t.eventType,u=l===void 0?"":l,p=t.eventCenter,c=t.step,d=c===void 0?1:c,f=t.isStopPropagation,h=f===void 0?!0:f,y=t.model,v=t.data,g=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(m){var M,T,w=window==null?void 0:window.document;if(m.button===pp){g.isStopPropagation&&m.stopPropagation(),g.isStartDragging=!0,g.startX=m.clientX,g.startY=m.clientY,w.addEventListener("mousemove",g.handleMouseMove,!1),w.addEventListener("mouseup",g.handleMouseUp,!1);var S=(M=g.model)===null||M===void 0?void 0:M.getData();(T=g.eventCenter)===null||T===void 0||T.emit(N["".concat(g.eventType,"_MOUSEDOWN")],{e:m,data:g.data||S}),g.startTime=new Date().getTime()}},this.handleMouseMove=function(m){var M,T;if(g.isStopPropagation&&m.stopPropagation(),!!g.isStartDragging&&(g.sumDeltaX+=m.clientX-g.startX,g.sumDeltaY+=m.clientY-g.startY,g.startX=m.clientX,g.startY=m.clientY,g.step<=1||Math.abs(g.sumDeltaX)>g.step||Math.abs(g.sumDeltaY)>g.step)){var w=g.sumDeltaX%g.step,S=g.sumDeltaY%g.step,_=g.sumDeltaX-w,x=g.sumDeltaY-S;g.sumDeltaX=w,g.sumDeltaY=S;var A=(M=g.model)===null||M===void 0?void 0:M.getData();g.isDragging||((T=g.eventCenter)===null||T===void 0||T.emit(N["".concat(g.eventType,"_DRAGSTART")],{e:m,data:g.data||A}),g.onDragStart({event:m})),g.isDragging=!0,Promise.resolve().then(function(){var P,I;g.onDragging({deltaX:_,deltaY:x,event:m}),(P=g.eventCenter)===null||P===void 0||P.emit(N["".concat(g.eventType,"_MOUSEMOVE")],{deltaX:_,deltaY:x,e:m,data:g.data||A}),(I=g.eventCenter)===null||I===void 0||I.emit(N["".concat(g.eventType,"_DRAG")],{e:m,data:g.data||A})})}},this.handleMouseUp=function(m){var M=window.document;g.isStartDragging=!1,g.isStopPropagation&&m.stopPropagation(),Promise.resolve().then(function(){var T,w,S;M.removeEventListener("mousemove",g.handleMouseMove,!1),M.removeEventListener("mouseup",g.handleMouseUp,!1);var _=(T=g.model)===null||T===void 0?void 0:T.getData();(w=g.eventCenter)===null||w===void 0||w.emit(N["".concat(g.eventType,"_MOUSEUP")],{e:m,data:g.data||_}),g.isDragging&&(g.isDragging=!1,g.onDragEnd({event:m}),(S=g.eventCenter)===null||S===void 0||S.emit(N["".concat(g.eventType,"_DROP")],{e:m,data:g.data||_}))})},this.cancelDrag=function(){var m=window==null?void 0:window.document;m.removeEventListener("mousemove",g.handleMouseMove,!1),m.removeEventListener("mouseup",g.handleMouseUp,!1),g.onDragEnd({event:void 0}),g.isDragging=!1},this.destroy=function(){g.isStartDragging&&g.cancelDrag()},this.onDragStart=o,this.onDragging=i,this.onDragEnd=s,this.step=d,this.isStopPropagation=h,this.eventType=u,this.eventCenter=p,this.model=y,this.data=v}return n.prototype.setStep=function(t){this.step=t},n.prototype.setModel=function(t){this.model=t},n})(),dp=function(n){var t=n.x,e=n.y,o=n.width,r=n.height;return{x:t-o/2,y:e-r/2,x1:t+o/2,y1:e+r/2}},fp=function(n){var t=n.startPoint,e=n.endPoint,o=(t.x+e.x)/2,r=(t.y+e.y)/2,i=Math.abs(t.x-e.x)+10,a=Math.abs(t.y-e.y)+10;return{x:o-i/2,y:r-a/2,x1:o+i/2,y1:r+a/2}},hp=function(n){var t=n.points,e=ke(t),o=Un(e,8),r=o.x,i=o.y,a=o.width,s=o.height;return{x:r-a/2,y:i-s/2,x1:r+a/2,y1:i+s/2}},yp=function(n){var t=n.path,e=Hi(t),o=Un(e,8),r=o.x,i=o.y,a=o.width,s=o.height;return{x:r-a/2,y:i-s/2,x1:r+a/2,y1:i+s/2}},gp=function(n){if(n.modelType===z.LINE_EDGE)return fp(n);if(n.modelType===z.POLYLINE_EDGE)return hp(n);if(n.modelType===z.BEZIER_EDGE)return yp(n)},vp=function(n,t,e,o){var r=(t.y-n.y)*(o.x-e.x)-(n.x-t.x)*(e.y-o.y);if(r===0)return!1;var i=((t.x-n.x)*(o.x-e.x)*(e.y-n.y)+(t.y-n.y)*(o.x-e.x)*n.x-(o.y-e.y)*(t.x-n.x)*e.x)/r,a=-((t.y-n.y)*(o.y-e.y)*(e.x-n.x)+(t.x-n.x)*(o.y-e.y)*n.y-(o.x-e.x)*(t.y-n.y)*e.y)/r;return(i-n.x)*(i-t.x)<=0&&(a-n.y)*(a-t.y)<=0&&(i-e.x)*(i-o.x)<=0&&(a-e.y)*(a-o.y)<=0?{x:i,y:a}:!1},Yn=function(n,t,e){var o=n.x,r=n.y,i=t.x,a=t.y,s=e.x,l=e.y,u=(l-a)/(s-i),p=a-u*i;return(o>=i&&o<=s||o<=i&&o>=s)&&(r>=a&&r<=l||r<=a&&r>=l)&&Math.abs(r-u*o-p)<Number.EPSILON},Gn=function(n){var t=n.start,e=n.end,o=n.offset,r=n.verticalLength,i=n.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((e.y-t.y)/(e.x-t.x)),l=Math.atan(o/r),u=Math.sqrt(r*r+o*o);return i==="start"?e.x>=t.x?(a.leftX=t.x+u*Math.sin(s+l),a.leftY=t.y-u*Math.cos(s+l),a.rightX=t.x-u*Math.sin(s-l),a.rightY=t.y+u*Math.cos(s-l)):(a.leftX=t.x-u*Math.sin(s+l),a.leftY=t.y+u*Math.cos(s+l),a.rightX=t.x+u*Math.sin(s-l),a.rightY=t.y-u*Math.cos(s-l)):i==="end"&&(e.x>=t.x?(a.leftX=e.x+u*Math.sin(s-l),a.leftY=e.y-u*Math.cos(s-l),a.rightX=e.x-u*Math.sin(s+l),a.rightY=e.y+u*Math.cos(s+l)):(a.leftX=e.x-u*Math.sin(s-l),a.leftY=e.y+u*Math.cos(s-l),a.rightX=e.x+u*Math.sin(s+l),a.rightY=e.y-u*Math.cos(s+l))),a},We=function(){return We=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},We.apply(this,arguments)},Ct=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},ge=function(n,t,e){if(e||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return n.concat(i||Array.prototype.slice.call(t))},mp=function(n,t){return Math.abs(n.centerX-t.centerX)*2<n.width+t.width&&Math.abs(n.centerY-t.centerY)*2<n.height+t.height},Zr=function(n){var t=[],e={};return n.forEach(function(o){var r="".concat(o.x,"-").concat(o.y);o.id=r,e[r]=o}),Object.keys(e).forEach(function(o){t.push(e[o])}),t},Fo=function(n,t){return n.width===0&&n.height===0?n:{x:n.x,y:n.y,centerX:n.centerX,centerY:n.centerY,minX:n.minX-t,minY:n.minY-t,maxX:n.maxX+t,maxY:n.maxY+t,height:n.height+2*t,width:n.width+2*t}},_p=function(n,t){var e=Math.abs(n.x-t.centerX),o=Math.abs(n.y-t.centerY);return e/t.width>o/t.height?et.HORIZONTAL:et.VERTICAL},Wo=function(n,t,e){var o=_p(e,t);return o===et.HORIZONTAL?{x:e.x>n.centerX?n.maxX:n.minX,y:e.y}:{x:e.x,y:e.y>n.centerY?n.maxY:n.minY}},Na=function(n,t){var e=Math.min(n.minX,t.minX),o=Math.min(n.minY,t.minY),r=Math.max(n.maxX,t.maxX),i=Math.max(n.maxY,t.maxY);return{x:(e+r)/2,y:(o+i)/2,centerX:(e+r)/2,centerY:(o+i)/2,minX:e,minY:o,maxX:r,maxY:i,height:i-o,width:r-e}},Un=function(n,t){n===void 0&&(n=[]);var e=[],o=[];n.forEach(function(p){e.push(p.x),o.push(p.y)});var r=Math.min.apply(Math,ge([],Ct(e),!1)),i=Math.max.apply(Math,ge([],Ct(e),!1)),a=Math.min.apply(Math,ge([],Ct(o),!1)),s=Math.max.apply(Math,ge([],Ct(o),!1)),l=i-r,u=s-a;return t&&(l+=t,u+=t),{centerX:(r+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:r,minY:a,x:(r+i)/2,y:(a+s)/2,height:u,width:l}},Ko=function(n){var t=n.minX,e=n.minY,o=n.maxX,r=n.maxY;return[{x:t,y:e},{x:o,y:e},{x:o,y:r},{x:t,y:r}]},yo=function(n,t){var e=n.x,o=n.y;return e<t.minX||e>t.maxX||o<t.minY||o>t.maxY},bp=function(n,t){return t<n.minX||t>n.maxX?[]:[{x:t,y:n.minY},{x:t,y:n.maxY}]},xp=function(n,t){return t<n.minY||t>n.maxY?[]:[{x:n.minX,y:t},{x:n.maxX,y:t}]},Ep=function(n,t){return ge(ge([],Ct(bp(n,t.x)),!1),Ct(xp(n,t.y)),!1)},qr=function(n,t){return Math.abs(n.x-t.x)+Math.abs(n.y-t.y)},Op=function(n,t){var e=-2,o=0;return t.forEach(function(r){r&&(n.x===r.x&&(o+=e),n.y===r.y&&(o+=e))}),o},Ca=function(n,t,e,o,r){return qr(n,t)+qr(n,e)+Op(n,[t,e,o,r])},jl=function(n,t,e,o,r){r||(r=0),n.unshift(t[o]),e[o]&&e[o]!==o&&r<=100&&jl(n,t,e,e[o],r+1)},wp=function(n,t){var e=n.indexOf(t);e>-1&&n.splice(e,1)},wn=function(n,t,e,o){var r=t.x-n.x,i=t.y-n.y,a=o.x-e.x,s=o.y-e.y,l=(-i*(n.x-e.x)+r*(n.y-e.y))/(-a*i+r*s),u=(a*(n.y-e.y)-s*(n.x-e.x))/(-a*i+r*s);return l>=0&&l<=1&&u>=0&&u<=1},ja=function(n,t,e){if(e.width===0&&e.height===0)return!1;var o=Ct(Ko(e),4),r=o[0],i=o[1],a=o[2],s=o[3];return wn(n,t,r,i)||wn(n,t,r,s)||wn(n,t,i,a)||wn(n,t,a,s)},Sp=function(n,t,e,o){var r=[];return n.forEach(function(i){i!==t&&(i.x===t.x||i.y===t.y)&&!ja(i,t,e)&&!ja(i,t,o)&&r.push(i)}),Zr(r)},Mp=function(n,t,e,o,r,i,a){var s=[],l=[t],u={},p={},c={};t.id&&(p[t.id]=0,c[t.id]=Ca(t,e,t));var d={};n.forEach(function(y){y.id&&(d[y.id]=y)});for(var f=function(){var y,v=1/0;if(l.forEach(function(m){m.id&&c[m.id]<v&&(v=c[m.id],y=m)}),y===e&&e.id){var g=[];return jl(g,d,u,e.id),{value:g}}if(!y)return{value:[t,e]};wp(l,y),s.push(y),Sp(n,y,o,r).forEach(function(m){if(s.indexOf(m)===-1&&(l.indexOf(m)===-1&&l.push(m),y!=null&&y.id&&m!=null&&m.id)){var M=c[y.id]+qr(y,m);if(p[m.id]&&M>=p[m.id])return;u[m.id]=y.id,p[m.id]=M,c[m.id]=p[m.id]+Ca(m,e,t,i,a)}})};l.length;){var h=f();if(typeof h=="object")return h.value}return[t,e]},La=function(n){return At(n)},Ll=function(n){for(var t=1;t<n.length-1;){var e=n[t-1],o=n[t],r=n[t+1];e.x===o.x&&o.x===r.x||e.y===o.y&&o.y===r.y?n.splice(t,1):t++}return n},ka=function(n,t,e,o,r){var i=La(e),a=La(o),s=Fo(i,r),l=Fo(a,r),u=Wo(s,i,n),p=Wo(l,a,t);if(mp(s,l)){var c=Ap(n,t,u,p);return ge(ge([n,u],Ct(c),!1),[p,t],!1)}var d=Un([u,p]),f=Na(s,d),h=Na(l,d),y=[];y=y.concat(Ko(f)),y=y.concat(Ko(h));var v={x:(n.x+t.x)/2,y:(n.y+t.y)/2};[d,f,h].forEach(function(m){y=y.concat(Ep(m,v).filter(function(M){return yo(M,s)&&yo(M,l)}))}),[{x:u.x,y:p.y},{x:p.x,y:u.y}].forEach(function(m){yo(m,s)&&yo(m,l)&&y.push(m)}),y.unshift(u),y.push(p),y=Zr(y);var g=Mp(y,u,p,i,a,n,t);return g.unshift(n),g.push(t),g.length>2&&(g=Ll(g)),Zr(g)},Tp=function(n){if(n.length===1){var t=Ct(n,1),e=t[0];return[e,e]}else{for(var o=n[0],r=n[1],i=Yt(o.x,o.y,r.x,r.y),a=1;a<n.length-1;a++){var s=n[a],l=n[a+1],u=Yt(s.x,s.y,l.x,l.y);u>i&&(i=u,o=s,r=l)}return[o,r]}},Ia=function(n,t,e){var o=ce(n,e),r=ce(t,e);return o&&r},Ra=function(n,t,e){var o=ce(n,e),r=ce(t,e),i=o&&r,a=o||r;return!i&&a},Xa=function(n,t,e){for(var o=void 0,r=At(e),i=Ko(r),a=0;a<i.length;a++){var s=wn(n,t,i[a],i[(a+1)%i.length]);s&&(o=[i[a],i[(a+1)%i.length]])}if(o)return vp(n,t,o[0],o[1])},Zo=function(n,t){var e=void 0;return n.x===t.x?e=et.VERTICAL:n.y===t.y&&(e=et.HORIZONTAL),e},ke=function(n){var t=n.split(" "),e=[];return t&&t.forEach(function(o){var r=Ct(o.split(","),2),i=r[0],a=r[1];e.push({x:Number(i),y:Number(a)})}),e},Ap=function(n,t,e,o){var r=[],i=Zo(n,e),a=Zo(t,o);if(i===a)n.y===e.y?(r.push({x:e.x,y:(e.y+o.y)/2}),r.push({x:o.x,y:(e.y+o.y)/2})):(r.push({x:(e.x+o.x)/2,y:e.y}),r.push({x:(e.x+o.x)/2,y:o.y}));else{var s={x:e.x,y:o.y},l=Yn(s,n,e),u=Yn(s,t,o);if(l||u)s={x:o.x,y:e.y};else{var p=Ba(s,n,e),c=Ba(s,t,o);p&&c&&(s={x:o.x,y:e.y})}r.push(s)}return r},Ba=function(n,t,e){return n.x===t.x&&n.x===e.x||n.y===t.y&&n.y===e.y},kl=function(n){if(!n)return 0;for(var t=0,e=0;e<n.length;e++){var o=n.charCodeAt(e);n.match(/[A-Z]/)?t+=1.5:o>=1&&o<=126||o>=65376&&o<=65439?t+=1:t+=2}return t},Pp=function(n){var t=n.start,e=n.end,o;if(t.x===e.x&&t.y===e.y)o="";else{var r={start:t,end:e,offset:10,verticalLength:5},i=Gn(We(We({},r),{type:"start"})),a=Gn(We(We({},r),{type:"end"}));o="M".concat(i.leftX," ").concat(i.leftY,`
|
||
L`).concat(i.rightX," ").concat(i.rightY,`
|
||
L`).concat(a.rightX," ").concat(a.rightY,`
|
||
L`).concat(a.leftX," ").concat(a.leftY," z")}return{d:o,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},Ha=function(n){var t=n.start,e=n.end,o=n.sourceNode,r=n.targetNode,i=n.offset,a=At(o),s=At(r),l=Fo(a,i),u=Fo(s,i),p=Wo(l,a,t),c=Wo(u,s,e);return{sNext:p,ePre:c}},Hi=function(n){var t=n.replace(/M/g,"").replace(/C/g,",").split(","),e=go(t[0]),o=go(t[1]),r=go(t[2]),i=go(t[3]);return[e,o,r,i]},go=function(n){var t=Ct(n.replace(/(^\s*)/g,"").split(" "),2),e=t[0],o=t[1];return{x:+e,y:+o}},za=function(n,t){var e=Ct(n,4),o=e[0],r=e[1],i=e[2],a=e[3],s=bd(o,r,i,a,t);return[s,n[3]]},Il=function(n,t){for(var e=n.x,o=n.y,r=ke(t),i=Number.MAX_SAFE_INTEGER,a,s=[],l=0;l<r.length;l++)s.push({start:r[l],end:r[(l+1)%r.length]});if(s.forEach(function(d){var f=d.start,h=d.end;if(f.x===h.x){var y={x:f.x,y:o},v=Yn(y,f,h);if(v){var g=Math.abs(f.x-e);g<i&&(i=g,a=y)}}else if(f.y===h.y){var y={x:e,y:f.y},v=Yn(y,f,h);if(v){var g=Math.abs(f.y-o);g<i&&(i=g,a=y)}}}),!a){var u=s[0],p=u.start,c=u.end;a={x:p.x+(c.x-p.x)/2,y:p.y+(c.y-p.y)/2}}return a},Dp=function(n){return Ve(n,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},Ya=function(n,t){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))};function Np(n,t){return typeof t!="function"?function(e,o,r){return Object.assign({type:n.edgeType},r)}:function(e,o,r){var i=t(e,o,r);return i?typeof i=="string"?Object.assign({},r,{type:i}):Object.assign({type:i},r):{type:n.edgeType}}}var Cp=function(n){var t=n.rows,e=n.rowsLength,o=n.fontSize,r=0;return it(t,function(i){var a=kl(i);r=a>r?a:r}),{width:Math.ceil(r/2)*o+o/4,height:e*(o+2)+o/4}},Be=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},vo=function(n,t,e){if(e||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return n.concat(i||Array.prototype.slice.call(t))};function sn(n,t,e){return e&&t*Math.round(n/t)||n}function jp(n,t,e){if(!n)return[];var o=Math.min.apply(Math,vo([],Be(n.map(function(y){return y[0]})),!1)),r=Math.max.apply(Math,vo([],Be(n.map(function(y){return y[0]})),!1)),i=Math.min.apply(Math,vo([],Be(n.map(function(y){return y[1]})),!1)),a=Math.max.apply(Math,vo([],Be(n.map(function(y){return y[1]})),!1)),s=-o,l=-i,u=n.map(function(y){var v=Be(y,2),g=v[0],m=v[1];return[g+s,m+l]}),p=r-o,c=a-i,d=t?t/p:1,f=e?e/c:1,h=Math.min(d,f);return u.map(function(y){var v=Be(y,2),g=v[0],m=v[1];return[g*h,m*h]})}var Er=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Or=function(n,t,e){var o=Er(n,2),r=o[0],i=o[1],a=Er(t,2),s=a[0],l=a[1],u=Er(e,2),p=u[0],c=u[1];return r>s&&r<p&&i>l&&i<c},Rl=function(n,t){var e=t.multipleSelectKey,o=!1;switch(e){case"meta":o=n.metaKey;break;case"alt":o=n.altKey;break;case"shift":o=n.shiftKey;break;case"ctrl":o=n.ctrlKey;break;default:o=!1;break}return o},zi=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})();function Ga(n,t){return n instanceof _t&&t instanceof _t}var Xl=(function(n){zi(t,n);function t(e,o,r){var i=n.call(this,3)||this;return i[0]=e,i[1]=o,i[2]=r,i.x=e,i.y=o,i.z=r,Object.setPrototypeOf(i,t.prototype),i}return t.prototype.add=function(e){if(Ga(this,e))return new _t(this.x+e.x,this.y+e.y);var o=this.z+e.z;return new $r((this.x+e.x)/o,(this.y+e.y)/o)},t.prototype.subtract=function(e){if(Ga(this,e))return new _t(this.x-e.x,this.y-e.y);var o=this.z-e.z;return o===0?new _t(this.x-e.x,this.y-e.y):new $r((this.x-e.x)/o,(this.y-e.y)/o)},t})(Array),_t=(function(n){zi(t,n);function t(e,o,r){var i=n.call(this,e,o,r!=null?r:0)||this;return Object.setPrototypeOf(i,t.prototype),i}return t.prototype.toString=function(){return"Vector"},t.prototype.dot=function(e){var o=this;return e.reduce(function(r,i,a){return r+i*o[a]})},t.prototype.cross=function(e){return new t(this.y*e.z-this.z*e.y,this.z*e.x-this.x*e.z,this.x*e.y-this.y*e.x)},t.prototype.getLength=function(){return Math.hypot(this.x,this.y)},t.prototype.normalize=function(){var e=this.getLength();return new t(this.x/e,this.y/e)},t.prototype.crossZ=function(e){return this.x*e.y-this.y*e.x},t.prototype.angle=function(e){var o=this.crossZ(e),r=Math.acos(this.normalize().dot(e.normalize()));return o>=0?r:-r},t})(Xl),$r=(function(n){zi(t,n);function t(e,o){var r=n.call(this,e,o,1)||this;return Object.setPrototypeOf(r,t.prototype),r}return t.prototype.toString=function(){return"Point"},t})(Xl),yr=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),He=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},wr=function(n,t,e){if(e||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return n.concat(i||Array.prototype.slice.call(t))},ro=(function(n){yr(t,n);function t(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];var r=n.call(this,e.length)||this;return r.fill(new Array(3)),e.forEach(function(i,a){r[a]=i}),r.columns=e[0].length,r.rows=e.length,Object.setPrototypeOf(r,t.prototype),r}return t.prototype.getRow=function(e){return this[e]},t.prototype.getColumn=function(e){return wr([],He(this.map(function(o){return o[e]})),!1)},t.prototype.transpose=function(){for(var e=[],o=0;o<this.columns;o++)e.push(this.getColumn(o));return new(t.bind.apply(t,wr([void 0],He(e),!1)))},t.prototype.cross=function(e){var o=new Array(this.rows).fill("").map(function(){return[]});if(this.columns===e.rows)for(var r=0;r<this.rows;r++)for(var i=this.getRow(r),a=function(l){var u=e.getColumn(l);o[r][l]=i.reduce(function(p,c,d){return p+c*u[d]},0)},s=0;s<e.columns;s++)a(s);return new(t.bind.apply(t,wr([void 0],He(o),!1)))},t.prototype.to2D=function(){return this.map(function(e){return[e[0],e[1]]})},t.prototype.toPoints=function(){return this.map(function(e){return new $r(e[0],e[1])})},t.prototype.toString=function(){var e=He(this[0],2),o=e[0],r=e[1],i=He(this[1],2),a=i[0],s=i[1],l=He(this[2],2),u=l[0],p=l[1];return"matrix(".concat(o," ").concat(r," ").concat(a," ").concat(s," ").concat(u," ").concat(p,")")},t.prototype.translate=function(e,o){return this.cross(new qo(e,o))},t.prototype.rotate=function(e){return this.cross(new Lp(e))},t.prototype.scale=function(e,o){return this.cross(new kp(e,o))},t})(Array),Lp=(function(n){yr(t,n);function t(e){var o=n.call(this,new _t(+Math.cos(e).toFixed(2),+Math.sin(e).toFixed(2),0),new _t(-Math.sin(e).toFixed(2),+Math.cos(e).toFixed(2),0),new _t(0,0,1))||this;return Object.setPrototypeOf(o,t.prototype),o}return t.prototype.inverse=function(){return this.transpose()},t})(ro),kp=(function(n){yr(t,n);function t(e,o){var r=n.call(this,new _t(e,0,0),new _t(0,o,0),new _t(0,0,1))||this;return r.sx=e,r.sy=o,Object.setPrototypeOf(r,t.prototype),r}return t.prototype.inverse=function(){return new t(1/this.sx,1/this.sy)},t})(ro),qo=(function(n){yr(t,n);function t(e,o){var r=n.call(this,new _t(1,0,0),new _t(0,1,0),new _t(e,o,1))||this;return r.tx=e,r.ty=o,Object.setPrototypeOf(r,t.prototype),r}return t.prototype.inverse=function(){return new t(-this.tx,-this.ty)},t})(ro);dc({});var $o=function(){return $o=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},$o.apply(this,arguments)},Ip=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Jr=function(n){var t=n.anchors;return t},Jo=function(n,t){for(var e=t.nodes,o,r=e.length-1;r>=0;r--){var i=e[r],a=Bp(n,i);if(a){var s=i.getTargetAnchor(n);if(s){var l={node:i,anchorIndex:s.index,anchor:s.anchor};(!o||Rp(i,o.node,t))&&(o=l)}}}return o},Rp=function(n,t,e){return n.zIndex>t.zIndex?!0:e.nodesMap[n.id].index>e.nodesMap[t.id].index},Xp=function(n,t){for(var e=Jr(t),o,r=Number.MAX_SAFE_INTEGER,i=0;i<e.length;i++){var a=Yt(n.x,n.y,e[i].x,e[i].y);a<r&&(r=a,o={index:i,anchor:$o($o({},e[i]),{x:e[i].x,y:e[i].y,id:e[i].id})})}return o},Yt=function(n,t,e,o){return Math.hypot(n-e,t-o)},ce=function(n,t,e){e===void 0&&(e=0);var o=!1,r=At(t),i=Ip(new ro([n.x,n.y,1]).translate(-t.x,-t.y).rotate(-t.rotate).translate(t.x,t.y)[0],2),a=i[0],s=i[1],l={x:a,y:s};return l.x>=r.minX-e&&l.x<=r.maxX+e&&l.y>=r.minY-e&&l.y<=r.maxY+e&&(o=!0),o},Bp=function(n,t){return ce(n,t,5)},At=function(n){var t=n.x,e=n.y,o=n.width,r=n.height;return{minX:t-o/2,minY:e-r/2,maxX:t+o/2,maxY:e+r/2,x:t,y:e,width:o,height:r,centerX:t,centerY:e}},Hp=function(n){var t=n,e=t.x,o=t.y,r=t.width,i=t.height,a=t.radius;return[{x:e-r/2+a,y:o-i/2+a,r:a},{x:e+r/2-a,y:o-i/2+a,r:a},{x:e-r/2+a,y:o+i/2-a,r:a},{x:e+r/2-a,y:o+i/2-a,r:a}]},Ua=function(n,t,e){var o=Hp(e),r,i=Number.MAX_SAFE_INTEGER;return o.forEach(function(a){var s=Yt(n.x,n.y,a.x,a.y);s<i&&(i=s,r=a)}),Qr(n,t,r)},Qr=function(n,t,e){var o,r=e.x,i=e.y,a=e.r;if(t===et.HORIZONTAL){var s=r-Math.sqrt(a*a-(n.y-i)*(n.y-i)),l=r+Math.sqrt(a*a-(n.y-i)*(n.y-i)),u=Math.abs(s-n.x)<Math.abs(l-n.x)?s:l;o={x:u,y:n.y}}else if(t===et.VERTICAL){var p=i-Math.sqrt(a*a-(n.x-r)*(n.x-r)),c=i+Math.sqrt(a*a-(n.x-r)*(n.x-r)),d=Math.abs(p-n.y)<Math.abs(c-n.y)?p:c;o={x:n.x,y:d}}return o},Va=function(n,t){var e=t,o=!1,r=e.x,i=e.y,a=e.width,s=e.height,l=e.radius,u={minX:r-a/2+l,maxX:r+a/2-l,minY:i-s/2+l,maxY:i+s/2-l};return n.y===i+s/2||n.y===i-s/2?o=n.x>u.minX&&n.x<u.maxX:(n.x===r+a/2||n.x===r-a/2)&&(o=n.y>u.minY&&n.y<u.maxY),o},Fa=function(n,t,e){var o,r=e,i=r.x,a=r.y,s=r.rx,l=r.ry;if(t===et.HORIZONTAL){var u=i-Math.sqrt(s*s-(n.y-a)*(n.y-a)*s*s/(l*l)),p=i+Math.sqrt(s*s-(n.y-a)*(n.y-a)*s*s/(l*l)),c=Math.abs(u-n.x)<Math.abs(p-n.x)?u:p;o={x:c,y:n.y}}else if(t===et.VERTICAL){var d=a-Math.sqrt(l*l-(n.x-i)*(n.x-i)*l*l/(s*s)),f=a+Math.sqrt(l*l-(n.x-i)*(n.x-i)*l*l/(s*s)),h=Math.abs(d-n.y)<Math.abs(f-n.y)?d:f;o={x:n.x,y:h}}return o},mo=function(n,t,e){for(var o=e.pointsPosition,r=Number.MAX_SAFE_INTEGER,i,a=[],s=0;s<o.length;s++)a.push({start:o[s],end:o[(s+1)%o.length]});return a.forEach(function(l){var u=l.start,p=l.end,c=u,d=p;u.x>p.x&&(c=p,d=u);var f={x:n.x,y:n.y};if(c.x===d.x&&t===et.HORIZONTAL&&(f={x:c.x,y:n.y}),c.y===d.y&&t===et.VERTICAL&&(f={x:n.x,y:c.y}),c.x!==d.x&&c.y!==d.y){var h=(d.y-c.y)/(d.x-c.x),y=(c.x*d.y-d.x*c.y)/(c.x-d.x);t===et.HORIZONTAL?f={x:(n.y-y)/h,y:n.y}:t===et.VERTICAL&&(f={x:n.x,y:h*n.x+y})}var v=Yn(f,u,p);if(v){var g=Yt(f.x,f.y,n.x,n.y);g<r&&(r=g,i=f)}}),i},zp=function(n){var t=Ve(n,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"]);return t},Wa=function(n,t,e,o){var r=n.x,i=n.y;return t.x>n.x?r=n.x+e/2:t.x<n.x&&(r=n.x-e/2),t.y>n.y?i=n.y+o/2:t.y<n.y&&(i=n.y-o/2),{x:r,y:i}},Bl=function(n){var t=n.rows,e=n.style,o=n.rowsLength,r=n.className,i=document.createElement("div");i.className=r,i.style.fontSize="".concat(e.fontSize),i.style.width="".concat(e.width),i.style.lineHeight="".concat(e.lineHeight),i.style.padding="".concat(e.padding),e.fontFamily&&(i.style.fontFamily="".concat(e.fontFamily)),o>1?t.forEach(function(s){var l=document.createElement("div");l.textContent=s,i.appendChild(l)}):i.textContent=t[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},Ka=function(n){var t=n.rows,e=n.rowsLength,o=n.fontSize,r=0;return t&&t.forEach(function(i){var a=kl(i);r=a>r?a:r}),{width:Math.ceil(r/2)*o+o/4,height:e*(o+2)+o/4}},Qo=function(n){return typeof n!="object"?{isAllPass:!!n,msg:n?"":"不允许连接"}:n};let _o;const Yp=new Uint8Array(16);function Gp(){if(!_o&&(_o=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!_o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _o(Yp)}const yt=[];for(let n=0;n<256;++n)yt.push((n+256).toString(16).slice(1));function Up(n,t=0){return yt[n[t+0]]+yt[n[t+1]]+yt[n[t+2]]+yt[n[t+3]]+"-"+yt[n[t+4]]+yt[n[t+5]]+"-"+yt[n[t+6]]+yt[n[t+7]]+"-"+yt[n[t+8]]+yt[n[t+9]]+"-"+yt[n[t+10]]+yt[n[t+11]]+yt[n[t+12]]+yt[n[t+13]]+yt[n[t+14]]+yt[n[t+15]]}const Vp=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Za={randomUUID:Vp};function Fp(n,t,e){if(Za.randomUUID&&!n)return Za.randomUUID();n=n||{};const o=n.random||(n.rng||Gp)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Up(o)}var Ce=function(){return Fp()},Tn=new Map,Hl=function(n){var t=Ce();function e(){n();var r=Tn.get(t);if(r){var i=window.requestAnimationFrame(e);Tn.set(t,i)}}var o=window.requestAnimationFrame(e);return Tn.set(t,o),t},tr=function(n){var t=Tn.get(n);t&&(window.cancelAnimationFrame(t),Tn.delete(n))},Vn=function(){return Vn=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Vn.apply(this,arguments)},Wp=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i};function zl(n){var t=n.x,e=t===void 0?0:t,o=n.y,r=o===void 0?0:o,i=n.value,a=n.fontSize,s=a===void 0?12:a,l=n.fill,u=l===void 0?"currentColor":l,p=n.overflowMode,c=p===void 0?"default":p,d=n.textWidth,f=d===void 0?void 0:d,h=n.model,y={x:e,y:r,fill:u,fontSize:s,textAnchor:"middle",dominantBaseline:"central"};if(it(be(n),function(w){var S=Wp(w,2),_=S[0],x=S[1];typeof x!="object"&&(y[_]=x)}),i){var v=String(i).split(/[\r\n]/g),g=v.length;if(c!=="default"){var m=h.BaseType,M=h.modelType;if(m===rt.NODE&&M!==z.TEXT_NODE||m===rt.EDGE&&f)return Kp(n)}if(g>1){var T=v.map(function(w,S){var _=s+2,x=(S-(g-1)/2)*_;return O("tspan",{className:"lf-text-tspan",x:e,y:r+x,children:w})});return O("text",Vn({},y,{children:T}))}return O("text",Vn({},y,{children:i}))}return null}function Kp(n){var t=n.x,e=n.y,o=n.value,r=n.model,i=n.textWidth,a=n.fontSize,s=a===void 0?12:a,l=n.lineHeight,u=n.fontFamily,p=u===void 0?"":u,c=n.wrapPadding,d=c===void 0?"0, 0":c,f=n.overflowMode,h=r.width,y=r.height,v=r.textHeight,g=i||h,m=String(o).split(/[\r\n]/g),M=m.length,T=Bl({rows:m,style:{fontSize:"".concat(s,"px"),width:"".concat(g,"px"),fontFamily:p,lineHeight:l,padding:d},rowsLength:M,className:"lf-get-text-height"}),w=y>T?y:T;v&&(w=v);var S=f==="ellipsis";return S&&(w=s+2),O("g",{children:O("foreignObject",{width:g,height:w,x:t-g/2,y:e-w/2,style:{overflow:"visible",textAlign:"left"},children:O("div",{className:"lf-node-text-auto-wrap",style:{minHeight:w,width:g,padding:d},children:O("div",{className:S?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:S?m.join(""):"",style:Vn({},n),children:m.map(function(_){return O("div",{className:"lf-node-text--auto-wrap-inner",children:_})})})})})})}var ti=function(){return ti=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ti.apply(this,arguments)},Zp=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i};function ln(n){var t={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return it(be(n),function(e){var o=Zp(e,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(t[r]=i)}),O("line",ti({},t))}var ei=function(){return ei=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ei.apply(this,arguments)},qp=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i};function te(n){var t=n.x,e=n.y,o=n.width,r=n.height,i=n.className,a=n.strokeWidth,s=n.radius,l=s===void 0?0:s,u=t-o/2,p=e-r/2,c={};return c["stroke-width"]=a,it(be(n),function(d){var f=qp(d,2),h=f[0],y=f[1];typeof y!="object"&&(c[h]=y)}),i?c.className="lf-basic-shape ".concat(i):c.className="lf-basic-shape",l&&(c.rx=l,c.ry=l),c.x=u,c.y=p,O("rect",ei({},c))}var ni=function(){return ni=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ni.apply(this,arguments)},$p=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i};function Fn(n){var t={d:""};return it(be(n),function(e){var o=$p(e,2),r=o[0],i=o[1];(r==="style"||typeof i!="object")&&(t[r]=i)}),O("path",ni({},t))}var oi=function(){return oi=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},oi.apply(this,arguments)},Jp=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i};function un(n){var t=n.x,e=t===void 0?0:t,o=n.y,r=o===void 0?0:o,i=n.r,a=i===void 0?4:i,s=n.className,l={cx:e,cy:r,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return it(be(n),function(u){var p=Jp(u,2),c=p[0],d=p[1];typeof d!="object"&&(l[c]=d)}),s?l.className="lf-basic-shape ".concat(s):l.className="lf-basic-shape",O("circle",oi({},l))}var ri=function(){return ri=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ri.apply(this,arguments)},Qp=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i};function td(n){var t=n.x,e=t===void 0?0:t,o=n.y,r=o===void 0?0:o,i=n.rx,a=i===void 0?4:i,s=n.ry,l=s===void 0?4:s,u=n.className,p={cx:e,cy:r,rx:a,ry:l,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return it(be(n),function(c){var d=Qp(c,2),f=d[0],h=d[1];typeof h!="object"&&(p[f]=h)}),u?p.className="lf-basic-shape ".concat(u):p.className="lf-basic-shape",O("ellipse",ri({},p))}var er=function(){return er=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},er.apply(this,arguments)},ed=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i};function nd(n,t){var e=n.map(function(m){return{x:m[0],y:m[1]}}),o=e.length;if(o<3)return"";for(var r=Math.abs(t),i="",a=0;a<o;a++){var s=e[(a-1+o)%o],l=e[a],u=e[(a+1)%o],p={x:l.x-s.x,y:l.y-s.y},c={x:u.x-l.x,y:u.y-l.y},d=Math.hypot(p.x,p.y),f=Math.hypot(c.x,c.y),h={x:p.x/d,y:p.y/d},y={x:c.x/f,y:c.y/f},v={x:l.x-h.x*r,y:l.y-h.y*r},g={x:l.x+y.x*r,y:l.y+y.y*r};a===0?i+="M ".concat(v.x," ").concat(v.y," "):i+="L ".concat(v.x," ").concat(v.y," "),i+="Q ".concat(l.x," ").concat(l.y," ").concat(g.x," ").concat(g.y," ")}return i+="Z",i}function Yl(n){var t=n.points,e=t===void 0?[]:t,o=n.className,r=n.radius,i={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};if(it(be(n),function(s){var l=ed(s,2),u=l[0],p=l[1];typeof p!="object"&&(i[u]=p)}),o?i.classNmae="lf-basic-shape ".concat(o):i.className="lf-basic-shape",r){var a=nd(e,r);return i.d=a,O("path",er({},i))}else return i.points=e.map(function(s){return s.join(",")}).join(" "),O("polygon",er({},i))}var ii=function(){return ii=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ii.apply(this,arguments)},od=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i};function rd(n){var t=n.className,e={points:"",fill:"none"};return it(be(n),function(o){var r=od(o,2),i=r[0],a=r[1];(i==="style"||typeof a!="object")&&(e[i]=a)}),t&&(e.className="".concat(t)),O("polyline",ii({},e))}var Gl=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Wn=function(){return Wn=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Wn.apply(this,arguments)},id=function(n,t){var e={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(e[o[r]]=n[o[r]]);return e},ad=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},U;(function(n){n[n.LEFT_TOP=0]="LEFT_TOP",n[n.RIGHT_TOP=1]="RIGHT_TOP",n[n.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",n[n.LEFT_BOTTOM=3]="LEFT_BOTTOM"})(U||(U={}));var sd=(function(n){Gl(t,n);function t(e){var o=n.call(this)||this;o.isShiftPressed=!1,o.bindKeyboardEvents=function(){document.addEventListener("keydown",o.handleKeyDown),document.addEventListener("keyup",o.handleKeyUp)},o.handleKeyDown=function(s){s.key==="Shift"&&(o.isShiftPressed=!0)},o.handleKeyUp=function(s){s.key==="Shift"&&(o.isShiftPressed=!1)},o.updateEdgePointByAnchors=function(){var s=o.nodeModel,l=s.id,u=s.anchors,p=o.graphModel.getNodeEdges(l);it(p,function(c){if(c.sourceNodeId===l){var d=je(u,function(f){return f.id===c.sourceAnchorId});d&&c.updateStartPoint({x:d.x,y:d.y})}else if(c.targetNodeId===l){var d=je(u,function(h){return h.id===c.targetAnchorId});d&&c.updateEndPoint({x:d.x,y:d.y})}})},o.triggerResizeEvent=function(s,l,u,p,c,d){o.graphModel.eventCenter.emit(N.NODE_RESIZE,{preData:s,data:l,deltaX:u,deltaY:p,index:c,model:d})},o.recalcResizeInfo=function(s,l,u,p,c){u===void 0&&(u=1),p===void 0&&(p=!1),c===void 0&&(c=!1);var d=X(l),f=d.deltaX,h=d.deltaY,y=d.width,v=d.height,g=d.PCTResizeInfo;if(g){var m=4,M=0,T=0;switch(s){case U.LEFT_TOP:T=(f*-1-h)/m;break;case U.RIGHT_TOP:T=(f-h)/m;break;case U.RIGHT_BOTTOM:T=(f+h)/m;break;case U.LEFT_BOTTOM:T=(f*-1+h)/m;break}T!==0&&(M=Math.round(T/g.ResizeBasis.basisHeight*1e5)/1e3),g.ResizePCT.widthPCT=Math.max(Math.min(g.ResizePCT.widthPCT+M,g.ScaleLimit.maxScaleLimit),g.ScaleLimit.minScaleLimit),g.ResizePCT.heightPCT=Math.max(Math.min(g.ResizePCT.heightPCT+M,g.ScaleLimit.maxScaleLimit),g.ScaleLimit.minScaleLimit);var w=Math.round(g.ResizePCT.widthPCT*g.ResizeBasis.basisWidth/100),S=Math.round(g.ResizePCT.heightPCT*g.ResizeBasis.basisHeight/100);switch(s){case U.LEFT_TOP:f=y-w,h=v-S;break;case U.RIGHT_TOP:f=w-y,h=v-S;break;case U.RIGHT_BOTTOM:f=w-y,h=S-v;break;case U.LEFT_BOTTOM:f=y-w,h=S-v;break}return d}switch(s){case U.LEFT_TOP:d.width=p?y:y-f*u,d.height=c?v:v-h*u;break;case U.RIGHT_TOP:d.width=p?y:y+f*u,d.height=c?v:v-h*u;break;case U.RIGHT_BOTTOM:d.width=p?y:y+f*u,d.height=c?v:v+h*u;break;case U.LEFT_BOTTOM:d.width=p?y:y-f*u,d.height=c?v:v+h*u;break}return d},o.resizeNode=function(s){var l=s.deltaX,u=s.deltaY,p=o.index,c=o.props,d=c.model,f=c.graphModel,h=c.x,y=c.y;vd({x:h,y,deltaX:l,deltaY:u,index:p,nodeModel:d,graphModel:f,forceProportional:o.isShiftPressed,cancelCallback:function(){o.dragHandler.cancelDrag()}})},o.onDragStart=function(){o.graphModel.selectNodeById(o.nodeModel.id)},o.onDragging=function(s){var l=s.deltaX,u=s.deltaY,p=o.graphModel.transformModel,c=ad(p.fixDeltaXY(l,u),2),d=c[0],f=c[1];o.resizeNode({deltaX:d,deltaY:f})},o.onDragEnd=function(){var s=o.nodeModel.x,l=o.nodeModel.y;o.nodeModel.moveTo(s,l),o.updateEdgePointByAnchors()};var r=e.index,i=e.model,a=e.graphModel;return o.index=r,o.nodeModel=i,o.graphModel=a,o.dragHandler=new ae({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:a.gridSize}),o.bindKeyboardEvents(),o}return t.prototype.componentWillUnmount=function(){this.dragHandler.destroy(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},t.prototype.render=function(){var e=this.props,o=e.x,r=e.y,i=e.direction,a=e.model,s=a.getResizeControlStyle(),l=s.width,u=s.height,p=id(s,["width","height"]);return O("g",{className:"lf-resize-control lf-resize-control-".concat(i),children:[O(te,Wn({className:"lf-resize-control-content",x:o,y:r,width:l!=null?l:7,height:u!=null?u:7},p)),O(te,{className:"lf-resize-control-content",x:o,y:r,width:25,height:25,fill:"transparent",stroke:"transparent",onMouseDown:this.dragHandler.handleMouseDown})]})},t})(G),ld=(function(n){Gl(t,n);function t(){return n.call(this)||this}return t.prototype.getResizeControl=function(){var e=this.props,o=e.model,r=e.graphModel,i=At(o),a=i.minX,s=i.minY,l=i.maxX,u=i.maxY,p=[{index:U.LEFT_TOP,direction:"nw",x:a,y:s},{index:U.RIGHT_TOP,direction:"ne",x:l,y:s},{index:U.RIGHT_BOTTOM,direction:"se",x:l,y:u},{index:U.LEFT_BOTTOM,direction:"sw",x:a,y:u}];return re(p,function(c){return O(sd,Wn({},c,{model:o,graphModel:r}))})},t.prototype.getResizeOutline=function(){var e=this.props.model,o=e.x,r=e.y,i=e.width,a=e.height,s=e.getResizeOutlineStyle();return O(te,Wn({},s,{x:o,y:r,width:i,height:a}))},t.prototype.render=function(){return O("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},t})(G);function ud(n,t){var e=n.x,o=n.y,r=t.x,i=t.y,a={x:e+(r-e)/2,y:o+(i-o)/2};return a}function Sn(n,t,e){var o=cd(e),r=n.x-t.x,i=n.y-t.y,a=r*Math.cos(o)-i*Math.sin(o)+t.x,s=r*Math.sin(o)+i*Math.cos(o)+t.y;return{x:a,y:s}}function cd(n){return n*Math.PI/180}function pd(n){return n/Math.PI*180}function dd(n,t,e,o,r,i,a,s){r===void 0&&(r=!1),i===void 0&&(i=!1);var l={x:e.x-(n.x-e.x),y:e.y-(n.y-e.y)},u=ud(l,t),p=Sn(t,u,-o),c=Sn(l,u,-o);if(r){var d=Math.abs(p.x-c.x),f=d-a;u.x>p.x?u.x=u.x+f/2:u.x=u.x-f/2}if(i){var h=Math.abs(p.y-c.y),y=h-s;u.y>p.y?u.y=u.y+y/2:u.y=u.y-y/2}if(r||i){var v=Sn(c,u,o),g=v.x-l.x,m=v.y-l.y;u.x=u.x-g,u.y=u.y-m,c=Sn(l,u,-o),p={x:u.x-(c.x-u.x),y:u.y-(c.y-u.y)}}var M=Math.abs(p.x-c.x),T=Math.abs(p.y-c.y);return r&&(M=a),i&&(T=s),{width:M,height:T,center:u}}function fd(n,t,e,o,r,i,a,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);var u=t.deltaX,p=t.deltaY,c=t.width,d=t.height,f=pd(e),h={x:o,y:r},y={x:i,y:a},v=Sn(h,y,f),g={x:v.x+u,y:v.y+p},m=dd(v,g,y,f,s,l,c,d),M=m.width,T=m.height,w=m.center;return t.width=M*n,t.height=T*n,t.deltaX=(w.x-y.x)*2,t.deltaY=(w.y-y.y)*2,t}var hd=function(n,t,e,o,r,i,a,s,l,u,p){e===void 0&&(e=1),o===void 0&&(o=!1),r===void 0&&(r=!1),i===void 0&&(i=0),p===void 0&&(p=!1);var c=X(t),d=c.deltaX,f=c.deltaY,h=c.width,y=c.height,v=c.PCTResizeInfo;if(v){var g=4,m=0,M=0;switch(n){case U.LEFT_TOP:M=(d*-1-f)/g;break;case U.RIGHT_TOP:M=(d-f)/g;break;case U.RIGHT_BOTTOM:M=(d+f)/g;break;case U.LEFT_BOTTOM:M=(d*-1+f)/g;break}M!==0&&(m=Math.round(M/v.ResizeBasis.basisHeight*1e5)/1e3),v.ResizePCT.widthPCT=Math.max(Math.min(v.ResizePCT.widthPCT+m,v.ScaleLimit.maxScaleLimit),v.ScaleLimit.minScaleLimit),v.ResizePCT.heightPCT=Math.max(Math.min(v.ResizePCT.heightPCT+m,v.ScaleLimit.maxScaleLimit),v.ScaleLimit.minScaleLimit);var T=Math.round(v.ResizePCT.widthPCT*v.ResizeBasis.basisWidth/100),w=Math.round(v.ResizePCT.heightPCT*v.ResizeBasis.basisHeight/100);switch(n){case U.LEFT_TOP:d=h-T,f=y-w;break;case U.RIGHT_TOP:d=T-h,f=y-w;break;case U.RIGHT_BOTTOM:d=T-h,f=w-y;break;case U.LEFT_BOTTOM:d=h-T,f=w-y;break}return c}if(i%(2*Math.PI)!==0&&a!==void 0&&s!==void 0)return fd(e,c,i,a,s,l,u,o,r);if(p){var S=h/y,_=0,x=h,A=y;switch(n){case U.LEFT_TOP:_=Math.abs(d)>Math.abs(f)?-d:-f,S>=1?(x=h+_,A=x/S):(A=y+_,x=A*S),c.width=x,c.height=A,c.deltaX=h-x,c.deltaY=y-A;break;case U.RIGHT_TOP:_=Math.abs(d)>Math.abs(f)?d:-f,S>=1?(x=h+_,A=x/S):(A=y-_,x=A*S),c.width=x,c.height=A,c.deltaX=x-h,c.deltaY=y-A;break;case U.RIGHT_BOTTOM:_=Math.abs(d)>Math.abs(f)?d:f,S>=1?(x=h+_,A=x/S):(A=y+_,x=A*S),c.width=x,c.height=A,c.deltaX=x-h,c.deltaY=A-y;break;case U.LEFT_BOTTOM:_=Math.abs(d)>Math.abs(f)?-d:f,S>=1?(x=h-_,A=x/S):(A=y+_,x=A*S),c.width=x,c.height=A,c.deltaX=h-x,c.deltaY=A-y;break}return c}switch(n){case U.LEFT_TOP:c.width=o?h:h-d*e,c.height=r?y:y-f*e;break;case U.RIGHT_TOP:c.width=o?h:h+d*e,c.height=r?y:y-f*e;break;case U.RIGHT_BOTTOM:c.width=o?h:h+d*e,c.height=r?y:y+f*e;break;case U.LEFT_BOTTOM:c.width=o?h:h-d*e,c.height=r?y:y+f*e;break}return c},yd=function(n,t){var e=n.id,o=n.anchors,r=t.getNodeEdges(e);it(r,function(i){if(i.sourceNodeId===e){var a=je(o,function(s){return s.id===i.sourceAnchorId});a&&i.updateStartPoint({x:a.x,y:a.y})}else if(i.targetNodeId===e){var a=je(o,function(l){return l.id===i.targetAnchorId});a&&i.updateEndPoint({x:a.x,y:a.y})}})},gd=function(n,t,e,o,r,i,a){a.eventCenter.emit(N.NODE_RESIZE,{preData:n,data:t,deltaX:e,deltaY:o,index:r,model:i})},vd=function(n){var t=n.x,e=n.y,o=n.deltaX,r=n.deltaY,i=n.index,a=n.nodeModel,s=n.graphModel,l=n.cancelCallback,u=n.forceProportional,p=u===void 0?!1:u,c=a.r,d=a.rx,f=a.ry,h=a.width,y=a.height,v=a.PCTResizeInfo,g=a.minWidth,m=a.minHeight,M=a.maxWidth,T=a.maxHeight,w=a.rotate,S=a.x,_=a.y,x=g===M,A=m===T,P={width:c||d||h,height:c||f||y,deltaX:o,deltaY:r,PCTResizeInfo:v},I=c||d&&f?1/2:1,B=t,ot=e,$=hd(i,P,I,x,A,w,B,ot,S,_,p);if($.width<g||$.width>M||$.height<m||$.height>T){l==null||l();return}(w%(2*Math.PI)==0||v||B===void 0||ot===void 0)&&($.deltaX=x?0:$.deltaX,$.deltaY=A?0:$.deltaY);var ct=a.getData(),st=a.resize($);ct.x===st.x&&ct.y===st.y||(yd(a,s),gd(ct,st,o,r,i,a,s))},md=100,_d={x:1,y:0};function bd(n,t,e,o,r){for(var i=function(f){if(f<0||f>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:n.x*Math.pow(1-f,3)+3*t.x*f*Math.pow(1-f,2)+3*e.x*Math.pow(f,2)*(1-f)+o.x*Math.pow(f,3),y:n.y*Math.pow(1-f,3)+3*t.y*f*Math.pow(1-f,2)+3*e.y*Math.pow(f,2)*(1-f)+o.y*Math.pow(f,3)}},a=0,s=2,l=o.x,u=o.y,p=o;a<r&&s<50;){p=i(1-s/md);var c=p.x,d=p.y;a=Yt(l,u,c,d),s++}return p}function xd(n,t){return n.x*t.y-n.y*t.x}function Ed(n,t){var e=[n.x,n.y,n.z],o=[t.x,t.y,t.z];return o.reduce(function(r,i,a){return r+i*e[a]})}function Od(n,t){var e=xd(n,t),o=Math.acos(Ed(qa(n),qa(t)));return e>=0?o:-o}function qa(n){var t=Math.hypot(n.x,n.y);return{x:n.x/t,y:n.y/t,z:0}}function wd(n){return Od(_d,n)}function Sd(n){return n*(180/Math.PI)}var Ul={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},Md={rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},Td={baseNode:{fill:"#23272e",stroke:"#fefeff"},baseEdge:{stroke:"#fefeff"},rect:{radius:8},diamond:{radius:8},polygon:{radius:8},polyline:{radius:8},nodeText:{color:"#fefeff",overflowMode:"default",fontSize:12,lineHeight:1.2},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},Ad={rect:{fill:"#72CBFF",stroke:"#3ABDF9",radius:8},circle:{fill:"#FFE075",stroke:"#F9CE3A",radius:8},ellipse:{fill:"#FFA8A8",stroke:"#FF6B66",radius:8},text:{fill:"#72CBFF",radius:8},diamond:{fill:"#96F7AF",stroke:"#40EF7E",radius:8},polygon:{fill:"#E0A8FF",stroke:"#C271FF",radius:8},polyline:{radius:8},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},resizeOutline:{radius:8,fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},Kn={colorful:Ad,dark:Td,radius:Md,default:Ul},Pd={background:"#23272e"},Dd={background:"#fefeff"},ai={background:"#ffffff"},Zn={colorful:Dd,dark:Pd,radius:ai,default:ai},Nd={color:"#66676a",thickness:1},Cd={color:"#dadada",thickness:1},si={color:"#acacac",thickness:1},qn={colorful:Cd,dark:Nd,radius:si,default:si},Vl=function(n,t){var e=X(Ul);return t&&(e=Io(e,Kn[t])),n&&(e=Io(e,n)),e},jd=function(n,t){Kn[n]||(Kn[n]=t,Zn[n]=t.background||ai,qn[n]=t.grid||si)},Ld=function(n){delete Kn[n],delete Zn[n],delete qn[n]},kd=function(){var n={colorful:{},dark:{},radius:{},default:{}};Z(Kn,n),Z(Zn,n),Z(qn,n)},Id=Vl,Rd=1e3,Xd=999,$n=function(){return++Rd},Bd=function(){return--Xd},at=function(){return at=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},at.apply(this,arguments)},j=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},gr=(function(){function n(t,e){var o;this.BaseType=rt.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=jt.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=W.DEFAULT,this.modelType=z.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=e,this.properties=(o=t.properties)!==null&&o!==void 0?o:{},this.initEdgeData(t),this.setAttributes()}return n.prototype.initEdgeData=function(t){var e=this;if(t.properties||(t.properties={}),!t.id){var o=this.graphModel.idGenerator,r=o&&o(t.type),i=this.createId();t.id=i||r||Ce()}this.arrowConfig.markerEnd="url(#marker-end-".concat(t.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(t.id,")");var a=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=a,Z(this,Dp(t));var s=this.graphModel,l=s.overlapMode,u=s.eventCenter;this.updateZIndexByOverlap(l,t.zIndex||$n()),this.setAnchors(),this.initPoints(),this.formatText(t),u.on("overlap:change",function(p){var c=p.overlapMode;e.updateZIndexByOverlap(c,e.zIndex||$n())})},n.prototype.setAttributes=function(){},n.prototype.createId=function(){return null},n.prototype.getEdgeStyle=function(){return at(at({},this.graphModel.theme.baseEdge),this.style)},n.prototype.getAdjustPointStyle=function(){return at({},this.graphModel.theme.edgeAdjust)},n.prototype.getTextStyle=function(){var t=this.graphModel.theme.edgeText;return X(t)},n.prototype.getEdgeAnimationStyle=function(){var t=this.graphModel.theme.edgeAnimation;return X(t)},n.prototype.getArrowStyle=function(){var t=this.getEdgeStyle(),e=this.getEdgeAnimationStyle(),o=this.graphModel.theme.arrow,r=this.isAnimation?e.stroke:t.stroke;return at(at(at({},t),{fill:r,stroke:r}),o)},n.prototype.getOutlineStyle=function(){var t=this.graphModel,e=t.theme.outline;return X(e)},n.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(n.prototype,"sourceNode",{get:function(){var t,e;return(e=(t=this.graphModel)===null||t===void 0?void 0:t.nodesMap[this.sourceNodeId])===null||e===void 0?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetNode",{get:function(){var t,e;return(e=(t=this.graphModel)===null||t===void 0?void 0:t.nodesMap[this.targetNodeId])===null||e===void 0?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),n.prototype.getBeginAnchor=function(t,e,o){var r,i,a=Jr(t);return o&&(r=je(a,function(s){return s.id===o}),r)||a.forEach(function(s){var l=Ya(s,e);(i===void 0||l<i)&&(i=l,r=s)}),r},n.prototype.getEndAnchor=function(t,e){var o=this,r,i,a=Jr(t);return e&&(r=je(a,function(s){return s.id===e}),r)||a.forEach(function(s){if(o.startPoint){var l=Ya(s,o.startPoint);(i===void 0||l<i)&&(i=l,r=s)}}),r},n.prototype.getProperties=function(){return qt(this.properties)},n.prototype.getData=function(){var t=this.properties;rn(t)&&(t=qt(t));var e={id:this.id,type:this.type,properties:t,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,sourceAnchorId:this.sourceAnchorId,targetAnchorId:this.targetAnchorId,startPoint:Z({},this.startPoint),endPoint:Z({},this.endPoint)};[ft.INCREASE,ft.STATIC].includes(this.graphModel.overlapMode)&&(e.zIndex=this.zIndex);var o=this.text,r=o.x,i=o.y,a=o.value;return a&&(e.text={x:r,y:i,value:a}),e},n.prototype.getHistoryData=function(){return this.getData()},n.prototype.setProperty=function(t,e){Ii(this.properties,t,Et(e)),this.setAttributes()},n.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},n.prototype.setProperties=function(t){this.properties=at(at({},qt(this.properties)),Et(t)),this.setAttributes()},n.prototype.changeEdgeId=function(t){var e=this.arrowConfig,o=e.markerEnd,r=e.markerStart;r&&r==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(t,")")),o&&o==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(t,")")),this.id=t},n.prototype.setStyle=function(t,e){var o;this.style=at(at({},this.style),(o={},o[t]=Et(e),o))},n.prototype.setStyles=function(t){this.style=at(at({},this.style),Et(t))},n.prototype.updateStyles=function(t){this.style=at({},Et(t))},n.prototype.setTextMode=function(t){this.textMode=t},n.prototype.formatText=function(t){var e,o,r,i=this.graphModel.editConfigModel,a=i.edgeTextDraggable,s=i.edgeTextEdit,l=this.textPosition,u=l.x,p=l.y,c=t.text,d={value:"",x:u,y:p,draggable:a,editable:s};c&&(typeof c=="string"?d=at(at({},d),{value:c}):(d=at(at({},d),{x:(e=c.x)!==null&&e!==void 0?e:u,y:(o=c.y)!==null&&o!==void 0?o:p,value:(r=c.value)!==null&&r!==void 0?r:""}),qe(c.draggable)||(d.draggable=c.draggable),qe(c.editable)||(d.editable=c.editable))),this.text=d},n.prototype.resetTextPosition=function(){var t=this.textPosition,e=t.x,o=t.y;this.text.x=e,this.text.y=o},n.prototype.moveText=function(t,e){var o=this.text,r=o.x,i=o.y,a=o.value,s=o.draggable,l=o.editable;this.text={value:a,editable:l,draggable:s,x:r+t,y:i+e}},n.prototype.setText=function(t){t&&Z(this.text,t)},n.prototype.updateText=function(t){this.text=at(at({},qt(this.text)),{value:t})},n.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){var t=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!t)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:t.x,y:t.y}),this.sourceAnchorId||(this.sourceAnchorId=t.id)}if(!this.targetAnchorId||!this.endPoint){var t=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!t)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:t.x,y:t.y}),this.targetAnchorId||(this.targetAnchorId=t.id)}},n.prototype.setSelected=function(t){t===void 0&&(t=!0),this.isSelected=t},n.prototype.setHovered=function(t){t===void 0&&(t=!0),this.isHovered=t},n.prototype.setHitable=function(t){t===void 0&&(t=!0),this.isHitable=t},n.prototype.setHittable=function(t){t===void 0&&(t=!0),this.isHittable=t},n.prototype.openEdgeAnimation=function(){this.isAnimation=!0},n.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},n.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},n.prototype.updateStartPoint=function(t){this.startPoint=t},n.prototype.moveStartPoint=function(t,e){this.startPoint&&(this.startPoint.x+=t,this.startPoint.y+=e)},n.prototype.updateEndPoint=function(t){this.endPoint=t},n.prototype.moveEndPoint=function(t,e){this.endPoint&&(this.endPoint.x+=t,this.endPoint.y+=e)},n.prototype.setZIndex=function(t){t===void 0&&(t=0),this.zIndex=t},n.prototype.initPoints=function(){},n.prototype.updateAttributes=function(t){Z(this,t)},n.prototype.getAdjustStart=function(){return this.startPoint},n.prototype.getAdjustEnd=function(){return this.endPoint},n.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,o=t.endPoint;this.updateStartPoint({x:e.x,y:e.y}),this.updateEndPoint({x:o.x,y:o.y})},n.prototype.updateZIndexByOverlap=function(t,e){switch(t){case ft.DEFAULT:this.zIndex=0;break;case ft.EDGE_TOP:this.zIndex=1;break;case ft.INCREASE:this.zIndex=e;break}},n.BaseType=rt.EDGE,j([E],n.prototype,"type",void 0),j([E],n.prototype,"sourceNodeId",void 0),j([E],n.prototype,"targetNodeId",void 0),j([E],n.prototype,"startPoint",void 0),j([E],n.prototype,"endPoint",void 0),j([E],n.prototype,"textMode",void 0),j([E],n.prototype,"text",void 0),j([E],n.prototype,"properties",void 0),j([E],n.prototype,"points",void 0),j([E],n.prototype,"pointsList",void 0),j([E],n.prototype,"isSelected",void 0),j([E],n.prototype,"isHovered",void 0),j([E],n.prototype,"isHitable",void 0),j([E],n.prototype,"isHittable",void 0),j([E],n.prototype,"draggable",void 0),j([E],n.prototype,"visible",void 0),j([E],n.prototype,"isAnimation",void 0),j([E],n.prototype,"isShowAdjustPoint",void 0),j([E],n.prototype,"zIndex",void 0),j([E],n.prototype,"state",void 0),j([E],n.prototype,"style",void 0),j([E],n.prototype,"arrowConfig",void 0),j([Q],n.prototype,"sourceNode",null),j([Q],n.prototype,"targetNode",null),j([Q],n.prototype,"textPosition",null),j([b],n.prototype,"setProperty",null),j([b],n.prototype,"deleteProperty",null),j([b],n.prototype,"setProperties",null),j([b],n.prototype,"changeEdgeId",null),j([b],n.prototype,"setStyle",null),j([b],n.prototype,"setStyles",null),j([b],n.prototype,"updateStyles",null),j([b],n.prototype,"setTextMode",null),j([b],n.prototype,"formatText",null),j([b],n.prototype,"resetTextPosition",null),j([b],n.prototype,"moveText",null),j([b],n.prototype,"setText",null),j([b],n.prototype,"updateText",null),j([b],n.prototype,"setAnchors",null),j([b],n.prototype,"setSelected",null),j([b],n.prototype,"setHovered",null),j([b],n.prototype,"setHitable",null),j([b],n.prototype,"setHittable",null),j([b],n.prototype,"openEdgeAnimation",null),j([b],n.prototype,"closeEdgeAnimation",null),j([b],n.prototype,"setElementState",null),j([b],n.prototype,"updateStartPoint",null),j([b],n.prototype,"moveStartPoint",null),j([b],n.prototype,"updateEndPoint",null),j([b],n.prototype,"moveEndPoint",null),j([b],n.prototype,"setZIndex",null),j([b],n.prototype,"initPoints",null),j([b],n.prototype,"updateAttributes",null),j([b],n.prototype,"getAdjustStart",null),j([b],n.prototype,"getAdjustEnd",null),j([b],n.prototype,"updateAfterAdjustStartAndEnd",null),j([b],n.prototype,"updateZIndexByOverlap",null),n})(),Hd=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Se=function(){return Se=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Se.apply(this,arguments)},Nt=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Sr=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},$a=(function(n){Hd(t,n);function t(e,o){var r=n.call(this,e,o)||this;return r.modelType=z.BEZIER_EDGE,r.path="",r.initEdgeData(e),r.setAttributes(),r}return t.prototype.initEdgeData=function(e){this.offset=lr(e,"properties.offset",100),n.prototype.initEdgeData.call(this,e)},t.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.bezier,o=n.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return Se(Se(Se({},o),X(e)),X(i))},t.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var e=0,o=0;return this.pointsList.forEach(function(r){var i=r.x,a=r.y;e+=i,o+=a}),{x:e/this.pointsList.length,y:o/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},t.prototype.getData=function(){var e=n.prototype.getData.call(this),o=this.pointsList.map(function(r){var i=r.x,a=r.y;return{x:i,y:a}});return Se(Se({},e),{pointsList:o})},t.prototype.getControls=function(){var e=this.startPoint,o=this.endPoint,r=Ha({start:e,end:o,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset});return r},t.prototype.getPath=function(e){var o=Sr(e,4),r=o[0],i=o[1],a=o[2],s=o[3];return"M ".concat(r.x," ").concat(r.y,`
|
||
C `).concat(i.x," ").concat(i.y,`,
|
||
`).concat(a.x," ").concat(a.y,`,
|
||
`).concat(s.x," ").concat(s.y)},t.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},t.prototype.updatePoints=function(){var e=this.getControls(),o=e.sNext,r=e.ePre;this.updatePath(o,r)},t.prototype.updatePath=function(e,o){e=X(e),o=X(o);var r={x:this.startPoint.x,y:this.startPoint.y},i={x:this.endPoint.x,y:this.endPoint.y};if(!e||!o){var a=this.getControls();e=a.sNext,o=a.ePre}this.pointsList=[r,e,o,i],this.path=this.getPath(this.pointsList)},t.prototype.updateStartPoint=function(e){this.startPoint=Object.assign({},e),this.updatePoints()},t.prototype.updateEndPoint=function(e){this.endPoint=Object.assign({},e),this.updatePoints()},t.prototype.moveStartPoint=function(e,o){this.startPoint.x+=e,this.startPoint.y+=o;var r=Sr(this.pointsList,3),i=r[1],a=r[2];i.x+=e,i.y+=o,this.updatePath(i,a)},t.prototype.moveEndPoint=function(e,o){this.endPoint.x+=e,this.endPoint.y+=o;var r=Sr(this.pointsList,3),i=r[1],a=r[2];a.x+=e,a.y+=o,this.updatePath(i,a)},t.prototype.updateAdjustAnchor=function(e,o){var r;o==="sNext"?this.pointsList[1]=e:o==="ePre"&&(this.pointsList[2]=e),this.path=this.getPath(this.pointsList),!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Z({},this.text,this.textPosition))},t.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},t.prototype.getAdjustEnd=function(){var e=this.pointsList;return e[e.length-1]||this.endPoint},t.prototype.updateAfterAdjustStartAndEnd=function(e){var o=e.startPoint,r=e.endPoint,i=e.sourceNode,a=e.targetNode,s=Ha({start:o,end:r,sourceNode:i,targetNode:a,offset:this.offset}),l=s.sNext,u=s.ePre;this.pointsList=[o,l,u,r],this.initPoints()},Nt([E],t.prototype,"offset",void 0),Nt([E],t.prototype,"path",void 0),Nt([b],t.prototype,"initPoints",null),Nt([b],t.prototype,"updatePoints",null),Nt([b],t.prototype,"updateStartPoint",null),Nt([b],t.prototype,"updateEndPoint",null),Nt([b],t.prototype,"moveStartPoint",null),Nt([b],t.prototype,"moveEndPoint",null),Nt([b],t.prototype,"updateAdjustAnchor",null),Nt([b],t.prototype,"getAdjustStart",null),Nt([b],t.prototype,"getAdjustEnd",null),Nt([b],t.prototype,"updateAfterAdjustStartAndEnd",null),t})(gr),zd=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),An=function(){return An=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},An.apply(this,arguments)},Ja=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Yd=function(n,t,e){if(e||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return n.concat(i||Array.prototype.slice.call(t))},Qa=(function(n){zd(t,n);function t(){var e=n.apply(this,Yd([],Ja(arguments),!1))||this;return e.modelType=z.LINE_EDGE,e}return t.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.line,o=n.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return An(An(An({},o),X(e)),X(i))},t.prototype.initEdgeData=function(e){n.prototype.initEdgeData.call(this,e),this.points=this.getPath([this.startPoint,this.endPoint])},t.prototype.getPath=function(e){var o=Ja(e,2),r=o[0],i=o[1];return"".concat(r.x,",").concat(r.y," ").concat(i.x,",").concat(i.y)},t.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},t})(gr),Gd=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Pn=function(){return Pn=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Pn.apply(this,arguments)},ht=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},ts=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Ud=function(n,t,e){if(e||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return n.concat(i||Array.prototype.slice.call(t))},es=(function(n){Gd(t,n);function t(){var e=n.apply(this,Ud([],ts(arguments),!1))||this;return e.modelType=z.POLYLINE_EDGE,e.draggingPointList=[],e}return t.prototype.initEdgeData=function(e){this.offset=lr(e,"properties.offset",30),e.pointsList&&(this.pointsList=e.pointsList),n.prototype.initEdgeData.call(this,e)},t.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.polyline,o=n.prototype.getEdgeStyle.call(this),r=this.properties.style,i=r===void 0?{}:r;return Pn(Pn(Pn({},o),X(e)),X(i))},t.prototype.getTextPosition=function(){var e,o=(e=this.text)===null||e===void 0?void 0:e.value;if(this.dbClickPosition&&!o){var r=this.dbClickPosition,i=r.x,a=r.y;return{x:i,y:a}}var s=ke(this.points),l=ts(Tp(s),2),u=l[0],p=l[1];return{x:(u.x+p.x)/2,y:(u.y+p.y)/2}},t.prototype.getAfterAnchor=function(e,o,r){var i,a;return r.forEach(function(s){var l;e===et.HORIZONTAL?l=Math.abs(o.y-s.y):e===et.VERTICAL&&(l=Math.abs(o.x-s.x)),(!a||a>l)&&(a=l,i=s)}),i},t.prototype.getCrossPoint=function(e,o,r){var i;return e===et.HORIZONTAL?i={x:r.x,y:o.y}:e===et.VERTICAL&&(i={x:o.x,y:r.y}),i},t.prototype.removeCrossPoints=function(e,o,r){var i=r.map(function(g){return g});if(e===1){var a=i[e],s=i[o],l=i[e-1],u=Ia(l,a,this.sourceNode);if(u){var p=Ra(a,s,this.sourceNode);if(p){var c=Xa(a,s,this.sourceNode);c&&(i[e]=c,i.splice(e-1,1),e--,o--)}}else{var d=this.sourceNode.anchors;d.forEach(function(g){if(g.x===l.x&&g.x===a.x||g.y===l.y&&g.y===a.y){var m=Yt(g.x,g.y,a.x,a.y),M=Yt(l.x,l.y,a.x,a.y);m<M&&(i[e-1]=g)}})}}if(o===r.length-2){var f=i[e],h=i[o],y=i[o+1],v=Ia(h,y,this.targetNode);if(v){var p=Ra(f,h,this.targetNode);if(p){var c=Xa(f,h,this.targetNode);c&&(i[o]=c,i.splice(o+1,1))}}else{var d=this.targetNode.anchors;d.forEach(function(m){if(m.x===y.x&&m.x===h.x||m.y===y.y&&m.y===h.y){var M=Yt(m.x,m.y,h.x,h.y),T=Yt(y.x,y.y,h.x,h.y);M<T&&(i[o+1]=m)}})}}return i},t.prototype.getDraggingPoints=function(e,o,r,i,a){var s=a.map(function(p){return p}),l=this.getAfterAnchor(e,r,i),u=this.getCrossPoint(e,r,l);return o==="start"?(s.unshift(u),s.unshift(l)):(s.push(u),s.push(l)),s},t.prototype.updateCrossPoints=function(e){var o=e.map(function(m){return m}),r=e[0],i=e[1],a=e[o.length-2],s=e[o.length-1],l=this,u=l.sourceNode,p=l.targetNode,c=u.modelType,d=p.modelType,f=Zo(r,i),h=o[0];switch(c){case z.RECT_NODE:if(u.radius!==0){var y=Va(r,u);y||(h=Ua(r,f,u))}break;case z.CIRCLE_NODE:h=Qr(r,f,u);break;case z.ELLIPSE_NODE:h=Fa(r,f,u);break;case z.DIAMOND_NODE:h=mo(r,f,u);break;case z.POLYGON_NODE:h=mo(r,f,u);break}h&&(o[0]=h);var v=Zo(a,s),g=o[o.length-1];switch(d){case z.RECT_NODE:if(p.radius!==0){var y=Va(s,p);y||(g=Ua(s,v,p))}break;case z.CIRCLE_NODE:g=Qr(s,v,p);break;case z.ELLIPSE_NODE:g=Fa(s,v,p);break;case z.DIAMOND_NODE:g=mo(s,v,p);break;case z.POLYGON_NODE:g=mo(s,v,p);break}return g&&(o[o.length-1]=g),o},t.prototype.updatePath=function(e){this.pointsList=e,this.points=this.getPath(this.pointsList)},t.prototype.getData=function(){var e=n.prototype.getData.call(this),o=this.pointsList.map(function(r){var i=r.x,a=r.y;return{x:i,y:a}});return Object.assign({},e,{pointsList:o})},t.prototype.getPath=function(e){return e.map(function(o){return"".concat(o.x,",").concat(o.y)}).join(" ")},t.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.getPath(this.pointsList):this.updatePoints()},t.prototype.updatePoints=function(){var e=ka({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=e,this.points=e.map(function(o){return"".concat(o.x,",").concat(o.y)}).join(" ")},t.prototype.updateStartPoint=function(e){this.startPoint=Object.assign({},e),this.updatePoints()},t.prototype.moveStartPoint=function(e,o){this.startPoint.x+=e,this.startPoint.y+=o,this.updatePoints()},t.prototype.updateEndPoint=function(e){this.endPoint=Object.assign({},e),this.updatePoints()},t.prototype.moveEndPoint=function(e,o){this.endPoint.x+=e,this.endPoint.y+=o,this.updatePoints()},t.prototype.updatePointsList=function(e,o){this.pointsList.forEach(function(a){a.x+=e,a.y+=o});var r=this.pointsList[0];this.startPoint=Object.assign({},r);var i=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},i),this.initPoints()},t.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map(function(e){return e})},t.prototype.dragAppendSimple=function(e,o){var r;this.isDragging=!0;var i=e.start,a=e.end,s=e.startIndex,l=e.endIndex,u=e.direction,p=this.pointsList,c=p;return u===et.HORIZONTAL?(p[s]={x:i.x,y:i.y+o.y},p[l]={x:a.x,y:a.y+o.y},c=this.pointsList.map(function(d){return d})):u===et.VERTICAL&&(p[s]={x:i.x+o.x,y:i.y},p[l]={x:a.x+o.x,y:a.y},c=this.pointsList.map(function(d){return d})),this.updatePointsAfterDrag(c),this.draggingPointList=c,!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Z({},this.text,this.textPosition)),{start:Z({},p[s]),end:Z({},p[l]),startIndex:s,endIndex:l,direction:u}},t.prototype.dragAppend=function(e,o){var r;this.isDragging=!0;var i=e.start,a=e.end,s=e.startIndex,l=e.endIndex,u=e.direction,p=this.pointsList;if(u===et.HORIZONTAL){p[s]={x:i.x,y:i.y+o.y},p[l]={x:a.x,y:a.y+o.y};var c=this.pointsList.map(function(v){return v});if(s!==0&&l!==this.pointsList.length-1&&(c=this.removeCrossPoints(s,l,c)),s===0){var d={x:i.x,y:i.y+o.y},f=ce(d,this.sourceNode);if(!f){var h=this.sourceNode.anchors;c=this.getDraggingPoints(u,"start",d,h,c)}}if(l===this.pointsList.length-1){var y={x:a.x,y:a.y+o.y},f=ce(y,this.targetNode);if(!f){var h=this.targetNode.anchors;c=this.getDraggingPoints(u,"end",y,h,c)}}this.updatePointsAfterDrag(c),this.draggingPointList=c}else if(u===et.VERTICAL){p[s]={x:i.x+o.x,y:i.y},p[l]={x:a.x+o.x,y:a.y};var c=this.pointsList.map(function(g){return g});if(s!==0&&l!==this.pointsList.length-1&&(c=this.removeCrossPoints(s,l,c)),s===0){var d={x:i.x+o.x,y:i.y},f=ce(d,this.sourceNode);if(!f){var h=this.sourceNode.anchors;c=this.getDraggingPoints(u,"start",d,h,c)}}if(l===this.pointsList.length-1){var y={x:a.x+o.x,y:a.y},f=ce(y,this.targetNode);if(!f){var h=this.targetNode.anchors;c=this.getDraggingPoints(u,"end",y,h,c)}}this.updatePointsAfterDrag(c),this.draggingPointList=c}return!((r=this.text)===null||r===void 0)&&r.value&&this.setText(Z({},this.text,this.textPosition)),{start:Z({},p[s]),end:Z({},p[l]),startIndex:s,endIndex:l,direction:u}},t.prototype.dragAppendEnd=function(){if(this.draggingPointList){var e=Ll(ke(this.points));this.pointsList=e.map(function(i){return i}),this.draggingPointList=[];var o=e[0];this.startPoint=Z({},o);var r=e[e.length-1];this.endPoint=Z({},r)}this.isDragging=!1},t.prototype.updatePointsAfterDrag=function(e){var o=this.updateCrossPoints(e);this.points=o.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},t.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},t.prototype.getAdjustEnd=function(){var e=this.pointsList;return e[e.length-1]||this.endPoint},t.prototype.updateAfterAdjustStartAndEnd=function(e){var o=e.startPoint,r=e.endPoint,i=e.sourceNode,a=e.targetNode;this.pointsList=ka({x:o.x,y:o.y},{x:r.x,y:r.y},i,a,this.offset||0),this.initPoints()},ht([E],t.prototype,"offset",void 0),ht([E],t.prototype,"dbClickPosition",void 0),ht([b],t.prototype,"initPoints",null),ht([b],t.prototype,"updatePoints",null),ht([b],t.prototype,"updateStartPoint",null),ht([b],t.prototype,"moveStartPoint",null),ht([b],t.prototype,"updateEndPoint",null),ht([b],t.prototype,"moveEndPoint",null),ht([b],t.prototype,"updatePointsList",null),ht([b],t.prototype,"dragAppendStart",null),ht([b],t.prototype,"dragAppendSimple",null),ht([b],t.prototype,"dragAppend",null),ht([b],t.prototype,"dragAppendEnd",null),ht([b],t.prototype,"updatePointsAfterDrag",null),ht([b],t.prototype,"getAdjustStart",null),ht([b],t.prototype,"getAdjustEnd",null),ht([b],t.prototype,"updateAfterAdjustStartAndEnd",null),t})(gr),ut=function(){return ut=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ut.apply(this,arguments)},L=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},ns=function(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],o=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&o>=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Vd=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Ee=(function(){function n(t,e){var o;this.BaseType=rt.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=jt.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=W.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=z.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.resizeRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=e,this.properties=(o=t.properties)!==null&&o!==void 0?o:{},this.initNodeData(t),this.setAttributes()}return Object.defineProperty(n.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t;var e=this,o=e.x,r=o===void 0?0:o,i=e.y,a=i===void 0?0:i;this.transform=new qo(-r,-a).rotate(t).translate(r,a).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),n.prototype.initNodeData=function(t){var e=this;if(t.properties||(t.properties={}),!t.id){var o=this.graphModel.idGenerator,r=o&&o(t.type),i=this.createId();t.id=i||r||Ce()}this.formatText(t),Z(this,zp(t));var a=this.graphModel,s=a.overlapMode,l=a.eventCenter;this.updateZIndexByOverlap(s,t.zIndex||$n()),l.on("overlap:change",function(u){var p=u.overlapMode;e.updateZIndexByOverlap(p,e.zIndex||$n())})},n.prototype.setAttributes=function(){},n.prototype.createId=function(){return null},n.prototype.setTextMode=function(t){this.textMode=t},n.prototype.formatText=function(t){var e,o,r,i=this.graphModel.editConfigModel,a=i.nodeTextDraggable,s=i.nodeTextEdit,l=t.x,u=t.y,p=t.text,c={value:"",x:l,y:u,draggable:a,editable:s};p&&(typeof p=="string"?c.value=p:(c=ut(ut({},c),{x:(e=p.x)!==null&&e!==void 0?e:l,y:(o=p.y)!==null&&o!==void 0?o:u,value:(r=p.value)!==null&&r!==void 0?r:""}),qe(p.draggable)||(c.draggable=p.draggable),qe(p.editable)||(c.editable=p.editable))),t.text=c},n.prototype.resize=function(t){var e=t.width,o=t.height,r=t.deltaX,i=t.deltaY,a=this.isAllowResizeNode(r,i,e,o);return a?(this.move(r/2,i/2),this.width=e,this.height=o,this.setProperties({width:e,height:o}),this.getData()):this.getData()},n.prototype.proportionalResize=function(){},n.prototype.getData=function(){var t=this.text,e=t.x,o=t.y,r=t.value,i=this.properties;rn(i)&&(i=qt(i)),vt(i.width)&&(i.width=this.width),vt(i.height)&&(i.height=this.height);var a={id:this.id,type:this.type,x:this.x,y:this.y,properties:i};return this.rotate&&(a.rotate=this.rotate),[ft.INCREASE,ft.STATIC].includes(this.graphModel.overlapMode)&&(a.zIndex=this.zIndex),r&&(a.text={x:e,y:o,value:r}),a},n.prototype.getHistoryData=function(){return this.getData()},n.prototype.getProperties=function(){return qt(this.properties)},n.prototype.getOuterGAttributes=function(){return{className:""}},n.prototype.getNodeStyle=function(){return ut(ut({},this.graphModel.theme.baseNode),this.style)},n.prototype.getTextStyle=function(){var t=this.graphModel.theme.nodeText,e=this.properties.textStyle,o=e===void 0?{}:e;return ut(ut({},X(t)),X(o))},n.prototype.getRotateControlStyle=function(){var t=this.graphModel.theme.rotateControl;return X(t)},n.prototype.getResizeControlStyle=function(){var t=this.graphModel.theme.resizeControl;return X(t)},n.prototype.getResizeOutlineStyle=function(){var t=this.graphModel.theme.resizeOutline;return X(t)},n.prototype.getAnchorStyle=function(t){var e=this.graphModel.theme.anchor;return X(e)},n.prototype.getAnchorLineStyle=function(t){var e=this.graphModel.theme.anchorLine;return X(e)},n.prototype.getOutlineStyle=function(){var t=this.graphModel.theme.outline;return X(t)},n.prototype.isAllowConnectedAsSource=function(t,e,o,r){var i=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var a=!0,s="",l=0;l<i.length;l++){var u=i[l];if(!u.validate.call(this,this,t,e,o,r)){a=!1,s=u.message;break}}return{isAllPass:a,msg:s}},n.prototype.getConnectedSourceRules=function(){return this.sourceRules},n.prototype.isAllowConnectedAsTarget=function(t,e,o,r){var i=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var a=!0,s="",l=0;l<i.length;l++){var u=i[l];if(!u.validate.call(this,t,this,e,o,r)){a=!1,s=u.message;break}}return{isAllPass:a,msg:s}},n.prototype.isAllowMoveNode=function(t,e){var o,r,i=!0,a=!0,s=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var l=ns(s),u=l.next();!u.done;u=l.next()){var p=u.value,c=p(this,t,e);if(!c)return!1;if(typeof c=="object"){var d=c;if(!d.x&&!d.y)return!1;i=i&&d.x,a=a&&d.y}}}catch(f){o={error:f}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(o)throw o.error}}return{x:i,y:a}},n.prototype.getConnectedTargetRules=function(){return this.targetRules},n.prototype.getAnchorsByOffset=function(){var t=this,e=t.anchorsOffset,o=t.id,r=t.x,i=t.y;return e&&e.length>0?e.map(function(a,s){return a.length?(a=a,{id:"".concat(o,"_").concat(s),x:r+a[0],y:i+a[1]}):(a=a,ut(ut({},a),{x:r+a.x,y:i+a.y,id:a.id||"".concat(o,"_").concat(s)}))}):this.getDefaultAnchor()},n.prototype.getDefaultAnchor=function(){return[]},n.prototype.getTargetAnchor=function(t){return Xp(t,this)},n.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(n.prototype,"anchors",{get:function(){var t=this.getAnchorsByOffset(),e=this,o=e.x,r=e.y,i=e.rotate;return t.forEach(function(a){var s=a.x,l=a.y,u=Vd(new ro([s,l,1]).translate(-o,-r).rotate(i).translate(o,r)[0],2),p=u[0],c=u[1];a.x=p,a.y=c}),t},enumerable:!1,configurable:!0}),n.prototype.getAnchorInfo=function(t){if(!vt(t))for(var e=0;e<this.anchors.length;e++){var o=this.anchors[e];if(o.id===t)return o}},n.prototype.addNodeMoveRules=function(t){this.moveRules.includes(t)||this.moveRules.push(t)},n.prototype.isAllowMoveByXORY=function(t,e,o){var r,i;if(o)r=!0,i=!0;else{var a=this.isAllowMoveNode(t,e);typeof a=="boolean"?(r=a,i=a):(r=a.x,i=a.y)}return{isAllowMoveX:r,isAllowMoveY:i}},n.prototype.move=function(t,e,o){o===void 0&&(o=!1);var r=this.isAllowMoveByXORY(t,e,o),i=r.isAllowMoveX,a=r.isAllowMoveY;return i&&(this.x=this.x+t,this.text&&this.moveText(t,0)),a&&(this.y=this.y+e,this.text&&this.moveText(0,e)),(i||a)&&(this.rotate=this._rotate),i||a},n.prototype.getMoveDistance=function(t,e,o){o===void 0&&(o=!1);var r=this.isAllowMoveByXORY(t,e,o),i=r.isAllowMoveX,a=r.isAllowMoveY,s=0,l=0;return i&&t&&(this.x=this.x+t,this.text&&this.moveText(t,0),s=t),a&&e&&(this.y=this.y+e,this.text&&this.moveText(0,e),l=e),this.transform=new qo(-this.x,-this.y).rotate(this.rotate).translate(this.x,this.y).toString(),[s,l]},n.prototype.moveTo=function(t,e,o){o===void 0&&(o=!1);var r=t-this.x,i=e-this.y;return!o&&!this.isAllowMoveNode(r,i)?!1:(this.text&&this.moveText(r,i),this.x=t,this.y=e,!0)},n.prototype.moveText=function(t,e){var o=this.text,r=o.x,i=o.y,a=o.value,s=o.draggable,l=o.editable;this.text={value:a,editable:l,draggable:s,x:r+t,y:i+e}},n.prototype.updateText=function(t){this.text=ut(ut({},qt(this.text)),{value:t})},n.prototype.addNodeResizeRules=function(t){this.resizeRules.includes(t)||this.resizeRules.push(t)},n.prototype.isAllowResizeNode=function(t,e,o,r){var i,a,s=this.resizeRules.concat(this.graphModel.nodeResizeRules);try{for(var l=ns(s),u=l.next();!u.done;u=l.next()){var p=u.value,c=p(this,t,e,o,r);if(!c)return!1}}catch(d){i={error:d}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return!0},n.prototype.setSelected=function(t){t===void 0&&(t=!0),this.isSelected=t},n.prototype.setHovered=function(t){t===void 0&&(t=!0),this.isHovered=t,this.setIsShowAnchor(t)},n.prototype.setIsShowAnchor=function(t){t===void 0&&(t=!0),this.isShowAnchor=t},n.prototype.setRotatable=function(t){t===void 0&&(t=!0),this.rotatable=t},n.prototype.setResizable=function(t){t===void 0&&(t=!0),this.resizable=t},n.prototype.setHitable=function(t){t===void 0&&(t=!0),this.isHitable=t},n.prototype.setHittable=function(t){t===void 0&&(t=!0),this.isHittable=t},n.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},n.prototype.updateProperties=function(t,e){var o=qt(this.properties);this.properties=t,this.setAttributes(),this.graphModel.eventCenter.emit(N.NODE_PROPERTIES_CHANGE,{id:this.id,keys:e,preProperties:o,properties:t})},n.prototype.setProperty=function(t,e){var o=qt(this.properties),r=X(o);ru(r,t,Et(e)),this.updateProperties(r,[t])},n.prototype.setProperties=function(t){var e=qt(this.properties),o=ut(ut({},e),Et(t)),r=[];iu(t,function(i,a){(Gi(e,a)&&e[a]!==i||!Gi(e,a))&&r.push(a)}),this.updateProperties(o,r)},n.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},n.prototype.setStyle=function(t,e){var o;this.style=ut(ut({},this.style),(o={},o[t]=Et(e),o))},n.prototype.setStyles=function(t){this.style=ut(ut({},this.style),Et(t))},n.prototype.updateStyles=function(t){this.style=ut({},Et(t))},n.prototype.setZIndex=function(t){t===void 0&&(t=1),this.zIndex=t},n.prototype.updateAttributes=function(t){Z(this,t)},n.prototype.updateZIndexByOverlap=function(t,e){switch(t){case ft.DEFAULT:this.zIndex=1;break;case ft.EDGE_TOP:this.zIndex=0;break;case ft.INCREASE:this.zIndex=e;break}},n.BaseType=rt.NODE,L([E],n.prototype,"type",void 0),L([E],n.prototype,"x",void 0),L([E],n.prototype,"y",void 0),L([E],n.prototype,"textMode",void 0),L([E],n.prototype,"text",void 0),L([E],n.prototype,"properties",void 0),L([E],n.prototype,"_width",void 0),L([E],n.prototype,"_height",void 0),L([E],n.prototype,"anchorsOffset",void 0),L([E],n.prototype,"isSelected",void 0),L([E],n.prototype,"isHovered",void 0),L([E],n.prototype,"isShowAnchor",void 0),L([E],n.prototype,"isDragging",void 0),L([E],n.prototype,"isHitable",void 0),L([E],n.prototype,"isHittable",void 0),L([E],n.prototype,"draggable",void 0),L([E],n.prototype,"visible",void 0),L([E],n.prototype,"rotatable",void 0),L([E],n.prototype,"resizable",void 0),L([E],n.prototype,"zIndex",void 0),L([E],n.prototype,"state",void 0),L([E],n.prototype,"autoToFront",void 0),L([E],n.prototype,"style",void 0),L([E],n.prototype,"transform",void 0),L([E],n.prototype,"_rotate",void 0),L([Q],n.prototype,"incoming",null),L([Q],n.prototype,"outgoing",null),L([b],n.prototype,"setTextMode",null),L([b],n.prototype,"addNodeMoveRules",null),L([b],n.prototype,"move",null),L([b],n.prototype,"getMoveDistance",null),L([b],n.prototype,"moveTo",null),L([b],n.prototype,"moveText",null),L([b],n.prototype,"updateText",null),L([b],n.prototype,"addNodeResizeRules",null),L([b],n.prototype,"setSelected",null),L([b],n.prototype,"setHovered",null),L([b],n.prototype,"setIsShowAnchor",null),L([b],n.prototype,"setRotatable",null),L([b],n.prototype,"setResizable",null),L([b],n.prototype,"setHitable",null),L([b],n.prototype,"setHittable",null),L([b],n.prototype,"setElementState",null),L([b],n.prototype,"setProperty",null),L([b],n.prototype,"setProperties",null),L([b],n.prototype,"deleteProperty",null),L([b],n.prototype,"setStyle",null),L([b],n.prototype,"setStyles",null),L([b],n.prototype,"updateStyles",null),L([b],n.prototype,"setZIndex",null),L([b],n.prototype,"updateAttributes",null),L([b],n.prototype,"updateZIndexByOverlap",null),n})(),Fd=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Dn=function(){return Dn=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Dn.apply(this,arguments)},Mr=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},os=(function(n){Fd(t,n);function t(e,o){var r=n.call(this,e,o)||this;return r.modelType=z.CIRCLE_NODE,r.r=50,r.initNodeData(e),r.setAttributes(),r}return Object.defineProperty(t.prototype,"width",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),t.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var e=this.properties.r;e&&(this.r=e)},t.prototype.getNodeStyle=function(){var e=n.prototype.getNodeStyle.call(this),o=this.graphModel.theme.circle,r=this.properties.style,i=r===void 0?{}:r;return Dn(Dn(Dn({},e),X(o)),X(i))},t.prototype.getDefaultAnchor=function(){var e=this,o=e.x,r=e.y,i=e.r;return[{x:o,y:r-i,id:"".concat(this.id,"_0")},{x:o+i,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+i,id:"".concat(this.id,"_2")},{x:o-i,y:r,id:"".concat(this.id,"_3")}]},t.prototype.resize=function(e){var o=e.width,r=e.deltaX,i=e.deltaY;return this.move(r/2,i/2),this.r=o,this.setProperties({r:o}),this.getData()},Mr([E],t.prototype,"r",void 0),Mr([Q],t.prototype,"width",null),Mr([Q],t.prototype,"height",null),t})(Ee),Wd=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Nn=function(){return Nn=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Nn.apply(this,arguments)},ze=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},bo=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},rs=(function(n){Wd(t,n);function t(e,o){var r=n.call(this,e,o)||this;return r.modelType=z.DIAMOND_NODE,r.rx=30,r.ry=50,r.initNodeData(e),r.setAttributes(),r}return t.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var e=this.properties,o=e.rx,r=e.ry;o&&(this.rx=o),r&&(this.ry=r)},t.prototype.getNodeStyle=function(){var e=n.prototype.getNodeStyle.call(this),o=this.graphModel.theme.diamond,r=this.properties.style,i=r===void 0?{}:r;return Nn(Nn(Nn({},e),X(o)),X(i))},Object.defineProperty(t.prototype,"points",{get:function(){var e=this,o=e.x,r=e.y,i=e.rx,a=e.ry;return[[o,r-a],[o+i,r],[o,r+a],[o-i,r]]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pointsPosition",{get:function(){return re(this.points,function(e){var o=bo(e,2),r=o[0],i=o[1];return{x:r,y:i}})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){var e=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return it(this.points,function(r){var i=bo(r,1),a=i[0];a<e&&(e=a),a>o&&(o=a)}),o-e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var e=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return it(this.points,function(r){var i=bo(r,2),a=i[1];a<e&&(e=a),a>o&&(o=a)}),o-e},enumerable:!1,configurable:!0}),t.prototype.getDefaultAnchor=function(){var e=this;return re(this.points,function(o,r){var i=bo(o,2),a=i[0],s=i[1];return{x:a,y:s,id:"".concat(e.id,"_").concat(r)}})},t.prototype.resize=function(e){var o=e.width,r=e.height,i=e.deltaX,a=e.deltaY;return this.move(i/2,a/2),this.rx=o,this.ry=r,this.setProperties({rx:o,ry:r}),this.getData()},ze([E],t.prototype,"rx",void 0),ze([E],t.prototype,"ry",void 0),ze([Q],t.prototype,"points",null),ze([Q],t.prototype,"pointsPosition",null),ze([Q],t.prototype,"width",null),ze([Q],t.prototype,"height",null),t})(Ee),Kd=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Cn=function(){return Cn=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Cn.apply(this,arguments)},xo=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},is=(function(n){Kd(t,n);function t(e,o){var r=n.call(this,e,o)||this;return r.modelType=z.ELLIPSE_NODE,r.rx=30,r.ry=45,r.initNodeData(e),r.setAttributes(),r}return t.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var e=this.properties,o=e.rx,r=e.ry;o&&(this.rx=o),r&&(this.ry=r)},t.prototype.getNodeStyle=function(){var e=n.prototype.getNodeStyle.call(this),o=this.graphModel.theme.ellipse,r=this.properties.style,i=r===void 0?{}:r;return Cn(Cn(Cn({},e),X(o)),X(i))},Object.defineProperty(t.prototype,"width",{get:function(){return this.rx*2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.ry*2},enumerable:!1,configurable:!0}),t.prototype.getDefaultAnchor=function(){var e=this,o=e.x,r=e.y,i=e.rx,a=e.ry;return[{x:o,y:r-a,id:"".concat(this.id,"_0")},{x:o+i,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a,id:"".concat(this.id,"_2")},{x:o-i,y:r,id:"".concat(this.id,"_3")}]},t.prototype.resize=function(e){var o=e.width,r=e.height,i=e.deltaX,a=e.deltaY;return this.move(i/2,a/2),this.rx=o,this.ry=r,this.setProperties({rx:o,ry:r}),this.getData()},xo([E],t.prototype,"rx",void 0),xo([E],t.prototype,"ry",void 0),xo([Q],t.prototype,"width",null),xo([Q],t.prototype,"height",null),t})(Ee),Zd=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),jn=function(){return jn=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},jn.apply(this,arguments)},Eo=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Oo=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},as=(function(n){Zd(t,n);function t(e,o){var r=n.call(this,e,o)||this;return r.modelType=z.POLYGON_NODE,r.points=[[50,0],[100,50],[50,100],[0,50]],r.initNodeData(e),r.setAttributes(),r}return t.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var e=this.properties,o=e.points,r=e.width,i=e.height,a=o||this.points;this.points=jp(a,r,i)},t.prototype.getNodeStyle=function(){var e=n.prototype.getNodeStyle.call(this),o=this.graphModel.theme.polygon,r=this.properties.style,i=r===void 0?{}:r;return jn(jn(jn({},e),X(o)),X(i))},Object.defineProperty(t.prototype,"pointsPosition",{get:function(){var e=this,o=e.x,r=e.y,i=e.width,a=e.height;return this.points.map(function(s){return{x:s[0]+o-i/2,y:s[1]+r-a/2}})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){var e=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(r){var i=Oo(r,1),a=i[0];a<e&&(e=a),a>o&&(o=a)}),o-e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var e=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(r){var i=Oo(r,2),a=i[1];a<e&&(e=a),a>o&&(o=a)}),o-e},enumerable:!1,configurable:!0}),t.prototype.getDefaultAnchor=function(){var e=this,o=this,r=o.x,i=o.y,a=o.width,s=o.height,l=o.points;return l.map(function(u,p){var c=Oo(u,2),d=c[0],f=c[1];return{x:r+d-a/2,y:i+f-s/2,id:"".concat(e.id,"_").concat(p)}})},t.prototype.resize=function(e){var o=this,r=e.width,i=e.height,a=e.deltaX,s=e.deltaY;this.move(a/2,s/2);var l=re(this.points,function(u){var p=Oo(u,2),c=p[0],d=p[1];return[c*r/o.width,d*i/o.height]});return this.points=l,this.properties.points=l,this.getData()},Eo([E],t.prototype,"points",void 0),Eo([Q],t.prototype,"pointsPosition",null),Eo([Q],t.prototype,"width",null),Eo([Q],t.prototype,"height",null),t})(Ee),qd=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Ln=function(){return Ln=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ln.apply(this,arguments)},$d=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},ss=(function(n){qd(t,n);function t(e,o){var r=n.call(this,e,o)||this;return r.modelType=z.RECT_NODE,r.radius=0,r.initNodeData(e),r.setAttributes(),r}return t.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var e=this.properties,o=e.width,r=e.height,i=e.radius,a=this.getNodeStyle().radius;vt(o)||(this.width=o),vt(r)||(this.height=r),vt(i)||(this.radius=i),vt(a)||(this.radius=a)},t.prototype.getDefaultAnchor=function(){var e=this,o=e.x,r=e.y,i=e.width,a=e.height;return[{x:o,y:r-a/2,id:"".concat(this.id,"_0")},{x:o+i/2,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a/2,id:"".concat(this.id,"_2")},{x:o-i/2,y:r,id:"".concat(this.id,"_3")}]},t.prototype.getNodeStyle=function(){var e=n.prototype.getNodeStyle.call(this),o=this.graphModel.theme.rect,r=this.properties.style,i=r===void 0?{}:r;return Ln(Ln(Ln({},e),X(o)),X(i))},$d([E],t.prototype,"radius",void 0),t})(Ee),Jd=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),kn=function(){return kn=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},kn.apply(this,arguments)},ls=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Qd=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},tf=function(n,t,e){if(e||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return n.concat(i||Array.prototype.slice.call(t))},us=(function(n){Jd(t,n);function t(){var e=n.apply(this,tf([],Qd(arguments),!1))||this;return e.modelType=z.TEXT_NODE,e}return t.prototype.getTextStyle=function(){var e=n.prototype.getTextStyle.call(this),o=this.graphModel.theme.text,r=this.properties.textStyle;return kn(kn(kn({},e),X(o)),X(r))},Object.defineProperty(t.prototype,"width",{get:function(){var e=String(this.text.value).split(/[\r\n]/g),o=this.getTextStyle().fontSize,r=Ka({rows:e,fontSize:o,rowsLength:e.length}).width;return r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){var e=String(this.text.value).split(/[\r\n]/g),o=this.getTextStyle().fontSize,r=Ka({rows:e,fontSize:o,rowsLength:e.length}).height;return r},enumerable:!1,configurable:!0}),ls([Q],t.prototype,"width",null),ls([Q],t.prototype,"height",null),t})(Ee),ef=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),li=(function(n){ef(t,n);function t(e,o){var r=n.call(this,e,o)||this;return r.modelType=z.HTML_NODE,r.setAttributes(),r}return t.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var e=this.properties,o=e.width,r=e.height;o&&(this.width=o),r&&(this.height=r)},t.prototype.getDefaultAnchor=function(){var e=this,o=e.x,r=e.y,i=e.width,a=e.height;return[{x:o,y:r-a/2,id:"".concat(this.id,"_0")},{x:o+i/2,y:r,id:"".concat(this.id,"_1")},{x:o,y:r+a/2,id:"".concat(this.id,"_2")},{x:o-i/2,y:r,id:"".concat(this.id,"_3")}]},t})(Ee),F=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},nf={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},wo=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","snapGrid","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical"],of=(function(){function n(t){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.snapGrid=!1,this.textMode=jt.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=jt.TEXT,this.edgeTextMode=jt.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",Z(this,this.computeConfig(t))}return n.prototype.updateEditConfig=function(t){var e=this.computeConfig(t);Z(this,e)},n.prototype.computeConfig=function(t){var e=t.isSilentMode,o=t.textDraggable,r=t.textMode,i=t.textEdit,a=t.adjustEdgeStartAndEnd,s={};if(e===!1&&Z(s,this.stagedConfig),e===!0&&e!==this.isSilentMode){var l=Ve(nf,wo);this.stagedConfig=Ve(this,wo),Z(s,l)}qe(i)||Z(s,{nodeTextEdit:i,edgeTextEdit:i}),qe(o)||Z(s,{nodeTextDraggable:o,edgeTextDraggable:o}),r&&Z(s,{nodeTextMode:r,edgeTextMode:r}),kr(a)&&Z(s,{adjustEdgeStart:a,adjustEdgeEnd:a});var u=Ve(t,wo);return Z(s,u)},n.prototype.updateTextMode=function(t){this.textMode=t,this.edgeTextMode=t,this.nodeTextMode=t},n.prototype.getConfig=function(){return Ve(this,wo)},F([E],n.prototype,"isSilentMode",void 0),F([E],n.prototype,"stopZoomGraph",void 0),F([E],n.prototype,"stopMoveGraph",void 0),F([E],n.prototype,"stopScrollGraph",void 0),F([E],n.prototype,"snapGrid",void 0),F([E],n.prototype,"textMode",void 0),F([E],n.prototype,"textEdit",void 0),F([E],n.prototype,"textDraggable",void 0),F([E],n.prototype,"nodeTextEdit",void 0),F([E],n.prototype,"nodeTextDraggable",void 0),F([E],n.prototype,"nodeTextMultiple",void 0),F([E],n.prototype,"nodeTextVertical",void 0),F([E],n.prototype,"nodeTextMode",void 0),F([E],n.prototype,"edgeTextMode",void 0),F([E],n.prototype,"edgeTextEdit",void 0),F([E],n.prototype,"edgeTextDraggable",void 0),F([E],n.prototype,"edgeTextMultiple",void 0),F([E],n.prototype,"edgeTextVertical",void 0),F([E],n.prototype,"hideAnchors",void 0),F([E],n.prototype,"allowRotate",void 0),F([E],n.prototype,"allowResize",void 0),F([E],n.prototype,"hoverOutline",void 0),F([E],n.prototype,"nodeSelectedOutline",void 0),F([E],n.prototype,"adjustNodePosition",void 0),F([E],n.prototype,"autoExpand",void 0),F([E],n.prototype,"adjustEdge",void 0),F([E],n.prototype,"adjustEdgeMiddle",void 0),F([E],n.prototype,"adjustEdgeStartAndEnd",void 0),F([E],n.prototype,"adjustEdgeStart",void 0),F([E],n.prototype,"adjustEdgeEnd",void 0),F([E],n.prototype,"edgeSelectedOutline",void 0),F([b],n.prototype,"updateEditConfig",null),F([b],n.prototype,"updateTextMode",null),n})(),rf="*",af=(function(){function n(){this._events={}}return n.prototype.on=function(t,e,o){var r=this;t==null||t.split(",").forEach(function(i){i=i.trim(),r._events[i]||(r._events[i]=[]),r._events[i].push({callback:e,once:!!o})})},n.prototype.once=function(t,e){var o=this;t==null||t.split(",").forEach(function(r){r=r.trim(),o.on(r,e,!0)})},n.prototype.emit=function(t,e){var o=this;t==null||t.split(",").forEach(function(r){var i=o._events[r]||[],a=o._events[rf]||[],s=function(l){for(var u=l.length,p=0;p<u;p++)if(l[p]){var c=l[p],d=c.callback,f=c.once;f&&(l.splice(p,1),l.length===0&&delete o._events[r],u--,p--),d.apply(o,[e])}};s(i),s(a)})},n.prototype.off=function(t,e){var o=this;t||(this._events={}),t.split(",").forEach(function(r){if(!e)delete o._events[r];else{for(var i=o._events[r]||[],a=i.length,s=0;s<a;s++)i[s].callback===e&&(i.splice(s,1),a--,s--);i.length===0&&delete o._events[r]}})},n.prototype.getEvents=function(){return this._events},n.prototype.destroy=function(){this._events={}},n})(),sf=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),ui=function(){return ui=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ui.apply(this,arguments)},lf=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},uf=(function(n){sf(t,n);function t(e){var o=n.call(this)||this;o.stepScrollX=0,o.stepScrollY=0,o.onDragging=function(s){var l=s.deltaX,u=s.deltaY;o.setState({isDragging:!0});var p=o.props.graphModel,c=p.transformModel,d=p.editConfigModel;d.stopMoveGraph!==!0&&c.translate(l,u)},o.onDragEnd=function(){o.setState({isDragging:!1})},o.zoomHandler=function(s){var l=o.props,u=l.graphModel,p=u.editConfigModel,c=u.transformModel,d=u.gridSize,f=l.graphModel,h=s.deltaX,y=s.deltaY,v=p.stopScrollGraph,g=p.stopZoomGraph;if(!v&&!s.ctrlKey&&!s.metaKey){if(s.preventDefault(),o.stepScrollX+=h,o.stepScrollY+=y,Math.abs(o.stepScrollX)>=d){var m=o.stepScrollX%d,M=o.stepScrollX-m;c.translate(-M*c.SCALE_X,0),o.stepScrollX=m}if(Math.abs(o.stepScrollY)>=d){var T=o.stepScrollY%d,w=o.stepScrollY-T;c.translate(0,-w*c.SCALE_Y),o.stepScrollY=T}return}if(!g){s.preventDefault();var S=f.getPointByClient({x:s.clientX,y:s.clientY}),_=S.canvasOverlayPosition,x=_.x,A=_.y;c.zoom(s.deltaY<0,[x,A])}},o.clickHandler=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){var u=o.props.graphModel,p=u.selectElements;p.size>0&&u.clearSelectElements(),u.eventCenter.emit(N.BLANK_CLICK,{e:s})}},o.handleContextMenu=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){s.preventDefault();var u=o.props.graphModel,p=u.getPointByClient({x:s.clientX,y:s.clientY});u.eventCenter.emit(N.BLANK_CONTEXTMENU,{e:s,position:p})}},o.mouseDownHandler=function(s){var l=o.props.graphModel,u=l.eventCenter,p=l.editConfigModel,c=l.transformModel.SCALE_X,d=l.gridSize,f=p.adjustEdge,h=p.adjustNodePosition,y=p.stopMoveGraph,v=s.target,g=!f&&!h;(v.getAttribute("name")==="canvas-overlay"||g)&&(y!==!0?(o.stepDrag.setStep(d*c),o.stepDrag.handleMouseDown(s)):u.emit(N.BLANK_MOUSEDOWN,{e:s}),o.clickHandler(s))};var r=e.graphModel,i=r.gridSize,a=r.eventCenter;return o.stepDrag=new ae({onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:i,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),o.state={isDragging:!1},o}return t.prototype.render=function(){var e=this.props.graphModel.transformModel,o=e.getTransformStyle().transform,r=this.props,i=r.children,a=r.dnd,s=this.state.isDragging;return O("svg",ui({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:s?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},a.eventMap(),{children:O("g",{transform:o,children:i})}))},t=lf([Pt],t),t})(G),Fl=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Jn=function(){return Jn=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Jn.apply(this,arguments)},cf=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},pf=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},cs=(function(n){Fl(t,n);function t(){var e=n.call(this)||this;return e.onDragging=function(o){var r=o.event,i=e.props,a=i.graphModel,s=i.bezierModel,l=i.type,u=a.getPointByClient({x:r.clientX,y:r.clientY}).canvasOverlayPosition,p=u.x,c=u.y;s.updateAdjustAnchor({x:p,y:c},l),a.eventCenter.emit(N.EDGE_ADJUST,{data:s.getData()})},e.onDragEnd=function(){var o=e.props.bezierModel;o.isDragging=!1},e.dragHandler=new ae({onDragging:e.onDragging,onDragEnd:e.onDragEnd}),e}return t.prototype.render=function(){var e=this,o=this.props.position,r=o.x,i=o.y,a=this.props.bezierModel,s=a.getEdgeStyle().adjustAnchor;return O(un,Jn({className:"lf-bezier-adjust-anchor",x:r,y:i},s,{onMouseDown:function(l){e.dragHandler.handleMouseDown(l)}}))},t})(G),df=(function(n){Fl(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getBezierAdjust=function(e,o){var r=e.path,i=e.id,a=Hi(r),s=pf(a,4),l=s[0],u=s[1],p=s[2],c=s[3],d=e.getEdgeStyle().adjustLine,f=[];return f.push(O(ln,Jn({x1:l.x,y1:l.y,x2:u.x,y2:u.y},d))),f.push(O(cs,{position:u,bezierModel:e,graphModel:o,type:"sNext"},"".concat(i,"_ePre"))),f.push(O(ln,Jn({x1:c.x,y1:c.y,x2:p.x,y2:p.y},d))),f.push(O(cs,{position:p,bezierModel:e,graphModel:o,type:"ePre"},"".concat(i,"_sNext"))),f},t.prototype.selectedBezierEdge=function(){for(var e=this.props.graphModel,o=e.edges,r=[],i=0;i<o.length;i++){var a=o[i];a.isSelected&&a.modelType===z.BEZIER_EDGE&&a.draggable&&r.push(this.getBezierAdjust(a,e))}return r},t.prototype.render=function(){return O("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},t=cf([Pt],t),t})(G),ff=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),hf=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},yf=(function(n){ff(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.render=function(){var e=this.props.background;return O("div",{className:"lf-background",children:O("div",{style:au(e)?e:{},className:"lf-background-area"})})},t=hf([Pt],t),t})(G),gf=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),vf=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Ze=(function(n){gf(t,n);function t(e){var o=n.call(this,e)||this;return o.id=Ce(),o.gridOptions=o.props.graphModel.grid,o}return t.prototype.renderDot=function(){var e=this.gridOptions,o=e.config,r=e.size,i=r===void 0?1:r,a=e.visible,s=o!=null?o:{},l=s.color,u=s.thickness,p=u===void 0?2:u,c=Math.min(Math.max(2,p),i/4),d=a?1:0;return O("g",{fill:l,opacity:d,children:[O("circle",{cx:0,cy:0,r:c/2}),O("circle",{cx:0,cy:i,r:c/2}),O("circle",{cx:i,cy:0,r:c/2}),O("circle",{cx:i,cy:i,r:c/2})]})},t.prototype.renderMesh=function(){var e=this.gridOptions,o=e.config,r=e.size,i=r===void 0?1:r,a=e.visible,s=o!=null?o:{},l=s.color,u=s.thickness,p=u===void 0?1:u,c=Math.min(Math.max(1,p),i/2),d="M 0 0 H ".concat(i," V ").concat(i," H 0 Z"),f=a?1:0;return O("path",{d,stroke:l,strokeWidth:c/2,opacity:f,fill:"transparent"})},t.prototype.render=function(){var e=this.props.graphModel,o=e.transformModel,r=e.grid;this.gridOptions=r;var i=this.gridOptions,a=i.type,s=i.size,l=s===void 0?1:s,u=o.SCALE_X,p=o.SKEW_Y,c=o.SKEW_X,d=o.SCALE_Y,f=o.TRANSLATE_X,h=o.TRANSLATE_Y,y=[u,p,c,d,f,h].join(","),v="matrix(".concat(y,")");return O("div",{className:"lf-grid",children:O("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[O("defs",{children:O("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:v,x:"0",y:"0",width:l,height:l,children:[a==="dot"&&this.renderDot(),a==="mesh"&&this.renderMesh()]})}),O("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},t=vf([Pt],t),t})(G);(function(n){n.defaultProps={size:cp,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}};function t(e){var o=X(n.defaultProps);return typeof e=="number"?Z(o,{size:e}):typeof e=="boolean"?Z(o,{visible:e}):Z(o,e)}n.getGridOptions=t})(Ze||(Ze={}));var mf=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),_f=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},bf=(function(n){mf(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.render=function(){var e=this.props.graphModel.transformModel,o=e.getTransformStyle().transform,r=this.props.children;return O("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:O("g",{transform:o,children:r})})},t=_f([Pt],t),t})(G),xf=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),de=function(){return de=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},de.apply(this,arguments)},Ef=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Of=(function(n){xf(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getNodesOutline=function(){var e=this.props.graphModel,o=e.nodes,r=e.editConfigModel,i=r.hoverOutline,a=r.nodeSelectedOutline,s=[];return o.forEach(function(l){if(l.isHovered||l.isSelected){var u=l.isHovered,p=l.isSelected,c=l.x,d=l.y,f=l.width,h=l.height;if(a&&p||i&&u){var y=l.getOutlineStyle()||{},v={};if(Object.keys(y).forEach(function(m){m!=="hover"&&(v[m]=y[m])}),u){var g=y.hover;v=de(de({},v),g)}s.push(O(te,de({transform:l.transform,className:"lf-outline-node",x:c,y:d,width:f+10,height:h+10},v)))}}}),s},t.prototype.getEdgeOutline=function(){for(var e=this.props.graphModel,o=e.edges,r=e.editConfigModel,i=r.edgeSelectedOutline,a=r.hoverOutline,s=[],l=0;l<o.length;l++){var u=o[l];(i&&u.isSelected||a&&u.isHovered)&&(u.modelType===z.LINE_EDGE?s.push(this.getLineOutline(u)):u.modelType===z.POLYLINE_EDGE?s.push(this.getPolylineOutline(u)):u.modelType===z.BEZIER_EDGE&&s.push(this.getBezierOutline(u)))}return s},t.prototype.getLineOutline=function(e){var o=e.startPoint,r=e.endPoint,i=(o.x+r.x)/2,a=(o.y+r.y)/2,s=Math.abs(o.x-r.x)+10,l=Math.abs(o.y-r.y)+10,u=e.getOutlineStyle();return O(te,de({className:"lf-outline-edge",x:i,y:a,width:s,height:l},u))},t.prototype.getPolylineOutline=function(e){var o=e.points,r=ke(o),i=Un(r,8),a=i.x,s=i.y,l=i.width,u=i.height,p=e.getOutlineStyle();return O(te,de({className:"lf-outline",x:a,y:s,width:l,height:u},p))},t.prototype.getBezierOutline=function(e){var o=e.path,r=Hi(o),i=Un(r,8),a=i.x,s=i.y,l=i.width,u=i.height,p=e.getOutlineStyle();return O(te,de({className:"lf-outline",x:a,y:s,width:l,height:u},p))},t.prototype.render=function(){return O("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},t=Ef([Pt],t),t})(G),wf=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),fe=function(){return fe=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},fe.apply(this,arguments)},Sf=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Mf=(function(n){wf(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.render=function(){var e=this.props.snaplineModel,o=e!=null?e:{},r=o.position,i=o.isShowHorizontal,a=o.isShowVertical,s=e==null?void 0:e.getStyle(),l=r!=null?r:{},u=l.x,p=u===void 0?0:u,c=l.y,d=c===void 0?0:c,f=fe(fe({x1:-1e5,y1:d,x2:1e5,y2:d},s),{stroke:i?s==null?void 0:s.stroke:"none"}),h=fe(fe({x1:p,y1:-1e5,x2:p,y2:1e5},s),{stroke:a?s==null?void 0:s.stroke:"none"});return O("g",{className:"lf-snapline",children:[O(ln,fe({},f)),O(ln,fe({},h))]})},t=Sf([Pt],t),t})(G),Tf=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Af=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Pf=(function(n){Tf(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.componentDidMount=function(){this.triggerToolRender()},t.prototype.componentDidUpdate=function(){this.triggerToolRender()},t.prototype.getTools=function(){var e=this.props,o=e.tool,r=e.graphModel,i=r.textEditElement,a=o.getTools(),s=a.map(function(l){return $e(l,{textEditElement:i,graphModel:r,lf:o.instance})});return o.components=s,s},t.prototype.triggerToolRender=function(){var e=this.props,o=e.tool,r=e.graphModel,i=document.querySelector("#ToolOverlay_".concat(r.flowId)),a=o.getInstance();a.components.forEach(function(s){return s(a,i)}),a.components=[]},t.prototype.render=function(){var e=this.props.graphModel;return O("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(e.flowId),children:this.getTools()})},t=Af([Pt],t),t})(G),Rt=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Ye=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Df={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},Nf=(function(){function n(t,e){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=t;var o=e.stopMoveGraph,r=o===void 0?!1:o;this.updateTranslateLimits(r)}return n.prototype.setZoomMiniSize=function(t){this.MINI_SCALE_SIZE=t},n.prototype.setZoomMaxSize=function(t){this.MAX_SCALE_SIZE=t},n.prototype.HtmlPointToCanvasPoint=function(t){var e=Ye(t,2),o=e[0],r=e[1];return[(o-this.TRANSLATE_X)/this.SCALE_X,(r-this.TRANSLATE_Y)/this.SCALE_Y]},n.prototype.CanvasPointToHtmlPoint=function(t){var e=Ye(t,2),o=e[0],r=e[1];return[o*this.SCALE_X+this.TRANSLATE_X,r*this.SCALE_Y+this.TRANSLATE_Y]},n.prototype.moveCanvasPointByHtml=function(t,e,o){var r=Ye(t,2),i=r[0],a=r[1];return[i+e/this.SCALE_X,a+o/this.SCALE_Y]},n.prototype.fixDeltaXY=function(t,e){return[t/this.SCALE_X,e/this.SCALE_Y]},n.prototype.getTransformStyle=function(){var t=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(t,")")}},n.prototype.zoom=function(t,e){t===void 0&&(t=!1);var o=this.SCALE_X,r=this.SCALE_Y;return typeof t=="number"?(o=t,r=t):t?(o+=this.ZOOM_SIZE,r+=this.ZOOM_SIZE):(o-=this.ZOOM_SIZE,r-=this.ZOOM_SIZE),o<this.MINI_SCALE_SIZE||o>this.MAX_SCALE_SIZE?"".concat(this.SCALE_X*100,"%"):(e&&(this.TRANSLATE_X-=(o-this.SCALE_X)*e[0],this.TRANSLATE_Y-=(r-this.SCALE_Y)*e[1]),this.SCALE_X=o,this.SCALE_Y=r,this.emitGraphTransform("zoom"),"".concat(this.SCALE_X*100,"%"))},n.prototype.emitGraphTransform=function(t){this.eventCenter.emit(N.GRAPH_TRANSFORM,{type:t,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},n.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},n.prototype.translate=function(t,e){this.TRANSLATE_X+t<=this.translateLimitMaxX&&this.TRANSLATE_X+t>=this.translateLimitMinX&&(this.TRANSLATE_X+=t),this.TRANSLATE_Y+e<=this.translateLimitMaxY&&this.TRANSLATE_Y+e>=this.translateLimitMinY&&(this.TRANSLATE_Y+=e),this.emitGraphTransform("translate")},n.prototype.focusOn=function(t,e,o,r){var i=Ye(this.CanvasPointToHtmlPoint([t,e]),2),a=i[0],s=i[1],l=Ye([o/2-a,r/2-s],2),u=l[0],p=l[1];this.TRANSLATE_X+=u,this.TRANSLATE_Y+=p,this.emitGraphTransform("focusOn")},n.prototype.updateTranslateLimits=function(t){var e;e=Ye(Array.isArray(t)&&t.length===4?t:Df[t.toString()],4),this.translateLimitMinX=e[0],this.translateLimitMinY=e[1],this.translateLimitMaxX=e[2],this.translateLimitMaxY=e[3]},Rt([E],n.prototype,"SCALE_X",void 0),Rt([E],n.prototype,"SKEW_Y",void 0),Rt([E],n.prototype,"SKEW_X",void 0),Rt([E],n.prototype,"SCALE_Y",void 0),Rt([E],n.prototype,"TRANSLATE_X",void 0),Rt([E],n.prototype,"TRANSLATE_Y",void 0),Rt([E],n.prototype,"ZOOM_SIZE",void 0),Rt([b],n.prototype,"zoom",null),Rt([b],n.prototype,"resetZoom",null),Rt([b],n.prototype,"translate",null),Rt([b],n.prototype,"focusOn",null),n})(),Cf=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Tr=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},jf=(function(n){Cf(t,n);function t(e,o){var r=n.call(this,e,o)||this;return r.parentTransform=o.parentTransform,r}return t.prototype.setParentTransform=function(e){this.parentTransform=e},t.prototype.getCumulativeScale=function(){var e=this.SCALE_X,o=this.SCALE_Y;if(this.parentTransform)if(this.parentTransform instanceof t){var r=this.parentTransform.getCumulativeScale();e*=r.scaleX,o*=r.scaleY}else e*=this.parentTransform.SCALE_X,o*=this.parentTransform.SCALE_Y;return{scaleX:e,scaleY:o}},t.prototype.getCumulativeTranslate=function(){var e=this.TRANSLATE_X,o=this.TRANSLATE_Y;if(this.parentTransform&&this.parentTransform instanceof t){var r=this.parentTransform.getCumulativeScale(),i=r.scaleX,a=r.scaleY;e=i*e,o=a*o}return{translateX:e,translateY:o}},t.prototype.HtmlPointToCanvasPoint=function(e){var o=Tr(e,2),r=o[0],i=o[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,u=this.getCumulativeTranslate(),p=u.translateX,c=u.translateY;return[(r-p)/s,(i-c)/l]},t.prototype.CanvasPointToHtmlPoint=function(e){var o=Tr(e,2),r=o[0],i=o[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,u=this.getCumulativeTranslate(),p=u.translateX,c=u.translateY;return[r*s+p,i*l+c]},t.prototype.moveCanvasPointByHtml=function(e,o,r){var i=Tr(e,2),a=i[0],s=i[1],l=this.getCumulativeScale(),u=l.scaleX,p=l.scaleY;return[a+o/u,s+r/p]},t.prototype.fixDeltaXY=function(e,o){var r=this.getCumulativeScale(),i=r.scaleX,a=r.scaleY;return[e/i,o/a]},t})(Nf),xt=function(){return xt=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},xt.apply(this,arguments)},D=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Lf=function(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],o=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&o>=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},lt=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Tt=function(n,t,e){if(e||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return n.concat(i||Array.prototype.slice.call(t))},kf=(function(){function n(t){var e=this,o,r;this.modelMap=new Map,this.nodeModelMap=new Map,this.edgeModelMap=new Map,this.elementsModelMap=new Map,this.nodeMoveRules=[],this.nodeResizeRules=[],this.nodes=[],this.edges=[],this.overlapMode=ft.DEFAULT,this.gridSize=1,this.partial=!1,this.waitCleanEffects=[];var i=t.container,a=t.partial,s=t.background,l=s===void 0?{}:s,u=t.grid,p=t.idGenerator,c=t.edgeGenerator,d=t.animation,f=t.customTrajectory;this.rootEl=i,this.partial=!!a,this.background=l,typeof u=="object"&&t.snapGrid&&(this.gridSize=u.size||1),this.customStyles=t.style||{},this.grid=Ze.getGridOptions(u!=null?u:!1),this.theme=Vl(t.style,t.themeMode),this.theme.grid=X(this.grid),this.theme.background=X(this.background),this.edgeType=t.edgeType||"polyline",this.animation=sp(d),this.overlapMode=t.overlapMode||ft.DEFAULT,this.isMiniMap=t.isMiniMap||!1,this.width=(o=t.width)!==null&&o!==void 0?o:this.rootEl.getBoundingClientRect().width,this.isContainerWidth=vt(t.width),this.height=(r=t.height)!==null&&r!==void 0?r:this.rootEl.getBoundingClientRect().height,this.isContainerHeight=vt(t.height);var h=new ResizeObserver(js((function(y){var v,g;try{for(var m=Lf(y),M=m.next();!M.done;M=m.next()){var T=M.value;if(T.target===e.rootEl){var w=document.body.contains(e.rootEl);if(!w)return;e.resize(),e.eventCenter.emit("graph:resize",{target:e.rootEl,contentRect:T.contentRect})}}}catch(S){v={error:S}}finally{try{M&&!M.done&&(g=m.return)&&g.call(m)}finally{if(v)throw v.error}}}),16));h.observe(this.rootEl),this.waitCleanEffects.push(function(){h.disconnect()}),this.eventCenter=new af,this.editConfigModel=new of(t),this.transformModel=new jf(this.eventCenter,t),this.flowId=Ce(),this.idGenerator=p,this.edgeGenerator=Np(this,c),this.customTrajectory=f}return Object.defineProperty(n.prototype,"nodesMap",{get:function(){return this.nodes.reduce(function(t,e,o){return t[e.id]={index:o,model:e},t},{})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"edgesMap",{get:function(){return this.edges.reduce(function(t,e,o){return t[e.id]={index:o,model:e},t},{})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"modelsMap",{get:function(){return Tt(Tt([],lt(this.nodes),!1),lt(this.edges),!1).reduce(function(t,e){return t[e.id]=e,t},{})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sortElements",{get:function(){for(var t=function(l){return Tt([],lt(l),!1).sort(function(u,p){return u.zIndex-p.zIndex})},e=t(Tt(Tt([],lt(this.nodes),!1),lt(this.edges),!1)),o=[],r=[-ho,-ho],i=[this.width+ho,this.height+ho],a=0;a<e.length;a++){var s=e[a];s.visible&&(!this.partial||s.isSelected||this.isElementInArea(s,r,i,!1,!1))&&o.push(s)}return o},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"textEditElement",{get:function(){var t=this.nodes.find(function(o){return o.state===W.TEXT_EDIT}),e=this.edges.find(function(o){return o.state===W.TEXT_EDIT});return t||e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectElements",{get:function(){var t=new Map;return this.nodes.forEach(function(e){e.isSelected&&t.set(e.id,e)}),this.edges.forEach(function(e){e.isSelected&&t.set(e.id,e)}),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectNodes",{get:function(){var t=[];return this.nodes.forEach(function(e){e.isSelected&&t.push(e)}),t},enumerable:!1,configurable:!0}),n.prototype.getAreaElement=function(t,e,o,r,i){var a=this;o===void 0&&(o=!0),r===void 0&&(r=!0),i===void 0&&(i=!1);var s=[];return it(Tt(Tt([],lt(this.nodes),!1),lt(this.edges),!1),function(l){var u=a.isElementInArea(l,t,e,o,r);(!i||l.visible)&&u&&s.push(l)}),s},n.prototype.getModel=function(t){return this.modelMap.get(t)},n.prototype.getNodeModelById=function(t){var e;return this.fakeNode&&t===this.fakeNode.id?this.fakeNode:(e=this.nodesMap[t])===null||e===void 0?void 0:e.model},n.prototype.getPointByClient=function(t){var e=t.x,o=t.y,r=this.rootEl.getBoundingClientRect(),i={x:e-r.left,y:o-r.top},a=lt(this.transformModel.HtmlPointToCanvasPoint([i.x,i.y]),2),s=a[0],l=a[1],u={x:s,y:l};return{domOverlayPosition:i,canvasOverlayPosition:u}},n.prototype.isElementInArea=function(t,e,o,r,i){var a;if(r===void 0&&(r=!0),i===void 0&&(i=!0),t.BaseType===rt.NODE){t=t;for(var s=At(t),l=s.minX,u=s.minY,p=s.maxX,c=s.maxY,d=[{x:l,y:u},{x:p,y:u},{x:p,y:c},{x:l,y:c}],f=i,h=0;h<d.length;h++){var y=d[h],v=y.x,g=y.y;if(a=lt(this.transformModel.CanvasPointToHtmlPoint([v,g]),2),v=a[0],g=a[1],Or([v,g],e,o)!==i){f=!i;break}}return f}if(t.BaseType===rt.EDGE){t=t;var m=t.startPoint,M=t.endPoint,T=this.transformModel.CanvasPointToHtmlPoint([m.x,m.y]),w=this.transformModel.CanvasPointToHtmlPoint([M.x,M.y]),S=Or(T,e,o),_=Or(w,e,o);return r?S&&_:S||_}return!1},n.prototype.graphDataToModel=function(t){var e=this;if(!t){this.clearData();return}if(this.elementsModelMap.clear(),this.nodeModelMap.clear(),this.edgeModelMap.clear(),t.nodes?this.nodes=re(t.nodes,function(r){var i=e.getModelAfterSnapToGrid(r);return e.elementsModelMap.set(i.id,i),e.nodeModelMap.set(i.id,i),i}):this.nodes=[],t.edges){var o=this.edgeType;this.edges=re(t.edges,function(r){var i,a=e.getModel((i=r.type)!==null&&i!==void 0?i:o);if(!a)throw new Error("找不到".concat(r.type,"对应的边。"));var s=new a(r,e);return e.edgeModelMap.set(s.id,s),e.elementsModelMap.set(s.id,s),s})}else this.edges=[]},n.prototype.modelToGraphData=function(){var t=[];this.edges.forEach(function(o){var r=o.getData();r&&!o.virtual&&t.push(r)});var e=[];return this.nodes.forEach(function(o){var r=o.getData();r&&!o.virtual&&e.push(r)}),{nodes:e,edges:t}},n.prototype.modelToHistoryData=function(){for(var t=!1,e=[],o=0;o<this.nodes.length;o++){var r=this.nodes[o];if(r.isDragging){t=!0;break}else e.push(r.getHistoryData())}if(t)return!1;for(var i=!1,a=[],s=0;s<this.edges.length;s++){var l=this.edges[s];if(l.isDragging){i=!0;break}l.virtual||a.push(l.getHistoryData())}return i?!1:{nodes:e,edges:a}},n.prototype.getEdgeModelById=function(t){var e;return(e=this.edgesMap[t])===null||e===void 0?void 0:e.model},n.prototype.getElement=function(t){return this.modelsMap[t]},n.prototype.getNodeEdges=function(t){for(var e=[],o=0;o<this.edges.length;o++){var r=this.edges[o],i=r.sourceNodeId===t,a=r.targetNodeId===t;(i||a)&&e.push(r)}return e},n.prototype.getSelectElements=function(t){t===void 0&&(t=!0);var e=this.selectElements,o={nodes:[],edges:[]};return e.forEach(function(r){if(r.BaseType===rt.NODE&&o.nodes.push(r.getData()),r.BaseType===rt.EDGE){var i=r.getData(),a=e.get(i.sourceNodeId)&&e.get(i.targetNodeId);(t||a)&&o.edges.push(i)}}),o},n.prototype.updateAttributes=function(t,e){var o=this.getElement(t);o==null||o.updateAttributes(e)},n.prototype.changeNodeId=function(t,e){return e||(e=Ce()),this.nodesMap[e]||!this.nodesMap[t]?"":(this.edges.forEach(function(o){o.sourceNodeId===t&&(o.sourceNodeId=e),o.targetNodeId===t&&(o.targetNodeId=e)}),this.nodesMap[t].model.id=e,this.nodesMap[e]=this.nodesMap[t],e)},n.prototype.changeEdgeId=function(t,e){return e||(e=Ce()),this.edgesMap[e]||!this.edgesMap[t]?"":(this.edges.forEach(function(o){o.id===t&&o.changeEdgeId(e)}),e)},n.prototype.getTextModel=function(t){var e=this.editConfigModel,o=e.textMode,r=e.nodeTextMode,i=e.edgeTextMode;if(t.BaseType===rt.NODE)return t.textMode||r||o||jt.TEXT;if(t.BaseType===rt.EDGE)return t.textMode||i||o||jt.TEXT},n.prototype.setOverlapMode=function(t){this.overlapMode=t,this.eventCenter.emit("overlap:change",{overlapMode:t})},n.prototype.setTextMode=function(t,e){this.editConfigModel.updateEditConfig({textMode:t})},n.prototype.setFakeNode=function(t){this.fakeNode=t},n.prototype.removeFakeNode=function(){this.fakeNode=null},n.prototype.setModel=function(t,e){return this.modelMap.set(t,e)},n.prototype.toFront=function(t){var e,o,r,i=((e=this.nodesMap[t])===null||e===void 0?void 0:e.model)||((o=this.edgesMap[t])===null||o===void 0?void 0:o.model);if(i){if(this.overlapMode===ft.STATIC)return;if(this.overlapMode===ft.INCREASE){this.setElementZIndex(t,"top");return}(r=this.topElement)===null||r===void 0||r.setZIndex(),i.setZIndex(up),this.topElement=i}},n.prototype.setElementZIndex=function(t,e){var o,r,i=((o=this.nodesMap[t])===null||o===void 0?void 0:o.model)||((r=this.edgesMap[t])===null||r===void 0?void 0:r.model);if(i){var a=void 0;typeof e=="number"?a=e:(e==="top"&&(a=$n()),e==="bottom"&&(a=Bd())),i.setZIndex(a)}},n.prototype.deleteNode=function(t){var e=this.nodesMap[t].model,o=e.getData();this.deleteEdgeBySource(t),this.deleteEdgeByTarget(t),this.nodes.splice(this.nodesMap[t].index,1),this.eventCenter.emit(N.NODE_DELETE,{data:o,model:e})},n.prototype.addNode=function(t,e,o){e===void 0&&(e=N.NODE_ADD);var r=Et(t),i=r.id;i&&this.nodesMap[i]&&delete r.id;var a=this.getModelAfterSnapToGrid(r);this.nodes.push(a);var s=a.getData(),l={data:s};return o&&(l.e=o),this.eventCenter.emit(e,l),a},n.prototype.getModelAfterSnapToGrid=function(t){var e=this.getModel(t.type),o=this.editConfigModel.snapGrid;if(!e)throw new Error("找不到".concat(t.type,"对应的节点,请确认是否已注册此类型节点。"));var r=t.x,i=t.y;r&&i&&(t.x=sn(r,this.gridSize,o),t.y=sn(i,this.gridSize,o),typeof t.text=="object"&&t.text!==null&&(t.text.x+=t.x-r,t.text.y+=t.y-i));var a=new e(t,this);return this.nodeModelMap.set(a.id,a),this.elementsModelMap.set(a.id,a),a},n.prototype.cloneNode=function(t){var e=this.getNodeModelById(t),o=e==null?void 0:e.getData();if(o){o.x+=30,o.y+=30,o.id="",typeof o.text=="object"&&o.text!==null&&(o.text.x+=30,o.text.y+=30);var r=this.addNode(o);return r.setSelected(!0),e==null||e.setSelected(!1),r.getData()}},n.prototype.moveNode=function(t,e,o,r){var i;r===void 0&&(r=!1);var a=this.nodesMap[t];if(a){var s=a.model;i=lt(s.getMoveDistance(e,o,r),2),e=i[0],o=i[1],this.moveEdge(t,e,o)}},n.prototype.moveNode2Coordinate=function(t,e,o,r){r===void 0&&(r=!1);var i=this.nodesMap[t];if(i){var a=i.model,s=a.x,l=a.y,u=e-s,p=o-l;this.moveNode(t,u,p,r)}},n.prototype.editText=function(t){this.setElementStateById(t,W.TEXT_EDIT)},n.prototype.addEdge=function(t){var e=Et(t),o=e.type;o||(o=this.edgeType),e.id&&this.edgesMap[e.id]&&(delete e.id,delete e.sourceAnchorId,delete e.targetAnchorId);var r=this.getModel(o);if(!r)throw new Error("找不到".concat(o,"对应的边,请确认是否已注册此类型边。"));var i=new r(xt(xt({},e),{type:o}),this);this.edgeModelMap.set(i.id,i),this.elementsModelMap.set(i.id,i);var a=i.getData();return this.edges.push(i),this.eventCenter.emit(N.EDGE_ADD,{data:a}),i},n.prototype.moveEdge=function(t,e,o){for(var r=0;r<this.edges.length;r++){var i=this.edges[r],a=i.textPosition,s=a.x,l=a.y,u=this.edges[r].sourceNodeId===t,p=this.edges[r].targetNodeId===t;u&&i.moveStartPoint(e,o),p&&i.moveEndPoint(e,o),(u||p)&&this.handleEdgeTextMove(i,s,l)}},n.prototype.handleEdgeTextMove=function(t,e,o){var r;if(t.customTextPosition){t.resetTextPosition();return}if(t.modelType===z.POLYLINE_EDGE&&!((r=t.text)===null||r===void 0)&&r.value){var i=t.text,a=Il(i,t.points);t.moveText(a.x-i.x,a.y-i.y)}var s=t.textPosition,l=s.x,u=s.y;t.moveText(l-e,u-o)},n.prototype.deleteEdgeBySourceAndTarget=function(t,e){for(var o=0;o<this.edges.length;o++)if(this.edges[o].sourceNodeId===t&&this.edges[o].targetNodeId===e){var r=this.edges[o].getData();this.edges.splice(o,1),o--,this.eventCenter.emit(N.EDGE_DELETE,{data:r})}},n.prototype.deleteEdgeById=function(t){var e=this.edgesMap[t];if(e){var o=this.edgesMap[t].index,r=this.edgesMap[t].model.getData();this.edges.splice(o,1),this.eventCenter.emit(N.EDGE_DELETE,{data:r})}},n.prototype.deleteEdgeBySource=function(t){for(var e=0;e<this.edges.length;e++)if(this.edges[e].sourceNodeId===t){var o=this.edges[e].getData();this.edges.splice(e,1),e--,this.eventCenter.emit(N.EDGE_DELETE,{data:o})}},n.prototype.deleteEdgeByTarget=function(t){for(var e=0;e<this.edges.length;e++)if(this.edges[e].targetNodeId===t){var o=this.edges[e].getData();this.edges.splice(e,1),e--,this.eventCenter.emit(N.EDGE_DELETE,{data:o})}},n.prototype.setElementStateById=function(t,e,o){this.nodes.forEach(function(r){r.id===t?r.setElementState(e,o):r.setElementState(W.DEFAULT)}),this.edges.forEach(function(r){r.id===t?r.setElementState(e,o):r.setElementState(W.DEFAULT)})},n.prototype.updateText=function(t,e){var o=je(Tt(Tt([],lt(this.nodes),!1),lt(this.edges),!1),function(r){return r.id===t});o==null||o.updateText(e)},n.prototype.selectNodeById=function(t,e){var o;e===void 0&&(e=!1),e||this.clearSelectElements();var r=(o=this.nodesMap[t])===null||o===void 0?void 0:o.model;r==null||r.setSelected(!0)},n.prototype.selectEdgeById=function(t,e){var o;e===void 0&&(e=!1),e||this.clearSelectElements();var r=(o=this.edgesMap[t])===null||o===void 0?void 0:o.model;r==null||r.setSelected(!0)},n.prototype.selectElementById=function(t,e){e===void 0&&(e=!1),e||this.clearSelectElements();var o=this.getElement(t);o==null||o.setSelected(!0)},n.prototype.deselectElementById=function(t){var e=this.getElement(t);e&&e.setSelected(!1)},n.prototype.clearSelectElements=function(){var t;this.selectElements.forEach(function(e){e==null||e.setSelected(!1)}),this.selectElements.clear(),[ft.DEFAULT,ft.EDGE_TOP].includes(this.overlapMode)&&((t=this.topElement)===null||t===void 0||t.setZIndex())},n.prototype.moveNodes=function(t,e,o,r){var i,a,s,l=this;r===void 0&&(r=!1);for(var u=t.reduce(function(M,T){var w,S=(w=l.nodesMap[T])===null||w===void 0?void 0:w.model;return S&&(M[T]=S.getMoveDistance(e,o,r)),M},{}),p=0;p<this.edges.length;p++){var c=this.edges[p],d=c.textPosition,f=d.x,h=d.y,y=u[c.sourceNodeId],v=u[c.targetNodeId],g=void 0,m=void 0;y&&v&&c.modelType===z.POLYLINE_EDGE?(i=lt(y,2),g=i[0],m=i[1],c.updatePointsList(g,m)):(y&&(a=lt(y,2),g=a[0],m=a[1],c.moveStartPoint(g,m)),v&&(s=lt(v,2),g=s[0],m=s[1],c.moveEndPoint(g,m))),(y||v)&&this.handleEdgeTextMove(c,f,h)}},n.prototype.addNodeMoveRules=function(t){this.nodeMoveRules.includes(t)||this.nodeMoveRules.push(t)},n.prototype.addNodeResizeRules=function(t){this.nodeResizeRules.includes(t)||this.nodeResizeRules.push(t)},n.prototype.setDefaultEdgeType=function(t){this.edgeType=t},n.prototype.changeNodeType=function(t,e){var o=this.getNodeModelById(t);if(o){var r=o.getData();r.type=e;var i=this.getModel(e);if(!i)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));var a=new i(r,this);this.nodes.splice(this.nodesMap[t].index,1,a);var s=this.getNodeEdges(t);s.forEach(function(l){if(l.sourceNodeId===t){var u=Wa(a,l.startPoint,a.width,a.height);l.updateStartPoint(u)}if(l.targetNodeId===t){var u=Wa(a,l.endPoint,a.width,a.height);l.updateEndPoint(u)}})}},n.prototype.changeEdgeType=function(t,e){var o=this.getEdgeModelById(t);if(o&&o.type!==e){var r=o.getData();r.type=e;var i=this.getModel(e);if(!i)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));delete r.pointsList;var a=new i(r,this);this.edges.splice(this.edgesMap[t].index,1,a)}},n.prototype.getNodeIncomingEdge=function(t){var e=[];return this.edges.forEach(function(o){o.targetNodeId===t&&e.push(o)}),e},n.prototype.getNodeOutgoingEdge=function(t){var e=[];return this.edges.forEach(function(o){o.sourceNodeId===t&&e.push(o)}),e},n.prototype.getAnchorIncomingEdge=function(t){var e=[];return this.edges.forEach(function(o){o.targetAnchorId===t&&e.push(o)}),e},n.prototype.getAnchorOutgoingEdge=function(t){var e=[];return this.edges.forEach(function(o){o.sourceAnchorId===t&&e.push(o)}),e},n.prototype.getNodeIncomingNode=function(t){var e=this,o=[];return this.edges.forEach(function(r){var i;r.targetNodeId===t&&o.push((i=e.nodesMap[r.sourceNodeId])===null||i===void 0?void 0:i.model)}),o},n.prototype.getNodeOutgoingNode=function(t){var e=this,o=[];return this.edges.forEach(function(r){r.sourceNodeId===t&&o.push(e.nodesMap[r.targetNodeId].model)}),o},n.prototype.setTheme=function(t,e){var o;if(e&&(Zn[e]&&this.updateBackgroundOptions(xt(xt({},typeof this.background=="object"?this.background:{}),Zn[e])),qn[e]&&this.updateGridOptions(Ze.getGridOptions(xt(xt({},this.grid),qn[e])))),t.background&&this.updateBackgroundOptions(t.background),t.grid){var r=Ze.getGridOptions((o=t.grid)!==null&&o!==void 0?o:!1);this.updateGridOptions(r)}this.theme=Id(xt(xt({},this.customStyles),t),e),this.customStyles=xt(xt({},this.customStyles),t)},n.prototype.getTheme=function(){var t=this,e=t.background,o=t.grid,r=xt(xt({},X(this.theme)),{background:e,grid:o});return r},n.prototype.updateGridOptions=function(t){Io(this.grid,t)},n.prototype.updateGridSize=function(t){this.gridSize=t},n.prototype.updateBackgroundOptions=function(t){kr(t)||kr(this.background)?this.background=t:this.background=xt(xt({},this.background),t)},n.prototype.resize=function(t,e){if(this.rootEl){var o=document.body.contains(this.rootEl);if(o){var r=this.rootEl.offsetParent!==null;if(r)try{this.width=t!=null?t:this.rootEl.getBoundingClientRect().width,this.isContainerWidth=vt(t),this.height=e!=null?e:this.rootEl.getBoundingClientRect().height,this.isContainerHeight=vt(e),r&&(!this.width||this.height)}catch(i){}}}},n.prototype.clearData=function(){this.nodes=[],this.edges=[],this.edgeModelMap.clear(),this.nodeModelMap.clear(),this.elementsModelMap.clear()},n.prototype.getVirtualRectSize=function(){var t=this.nodes,e=[],o=[];t.forEach(function(d){var f=d.x,h=d.y,y=d.width,v=d.height,g=d.getNodeStyle().strokeWidth,m=g===void 0?0:g,M=f+y/2+m,T=f-y/2-m,w=h+v/2+m,S=h-v/2-m;e=e.concat([M,T].filter(function(_){return!Number.isNaN(_)})),o=o.concat([w,S].filter(function(_){return!Number.isNaN(_)}))});var r=Math.min.apply(Math,Tt([],lt(e),!1)),i=Math.max.apply(Math,Tt([],lt(e),!1)),a=Math.min.apply(Math,Tt([],lt(o),!1)),s=Math.max.apply(Math,Tt([],lt(o),!1)),l=i-r||0,u=s-a||0,p=r+l/2,c=a+u/2;return{width:l,height:u,x:p,y:c}},n.prototype.translateCenter=function(){var t=this,e=t.nodes,o=t.width,r=t.height,i=t.rootEl,a=t.transformModel;if(e.length){var s=o||i.clientWidth,l=r||i.clientHeight,u=this.getVirtualRectSize(),p=u.x,c=u.y;a.focusOn(p,c,s,l)}},n.prototype.fitView=function(t,e){t===void 0&&(t=20),e===void 0&&(e=20);var o=this,r=o.nodes,i=o.width,a=o.height,s=o.rootEl,l=o.transformModel;if(r.length){var u=i||s.clientWidth,p=a||s.clientHeight,c=this.getVirtualRectSize(),d=c.width,f=c.height,h=c.x,y=c.y,v=(d+e)/u,g=(f+t)/p,m=1/Math.max(v,g),M=[u/2,p/2];l.zoom(m,M),l.focusOn(h,y,u,p)}},n.prototype.openEdgeAnimation=function(t){var e=this.getEdgeModelById(t);e==null||e.openEdgeAnimation()},n.prototype.closeEdgeAnimation=function(t){var e=this.getEdgeModelById(t);e==null||e.closeEdgeAnimation()},n.prototype.getPartial=function(){return this.partial},n.prototype.setPartial=function(t){this.partial=t},n.prototype.destroy=function(){try{this.waitCleanEffects.forEach(function(t){t()})}catch(t){}this.waitCleanEffects.length=0,this.eventCenter.destroy()},D([E],n.prototype,"width",void 0),D([E],n.prototype,"height",void 0),D([E],n.prototype,"theme",void 0),D([E],n.prototype,"grid",void 0),D([E],n.prototype,"edgeType",void 0),D([E],n.prototype,"nodes",void 0),D([E],n.prototype,"edges",void 0),D([E],n.prototype,"fakeNode",void 0),D([E],n.prototype,"overlapMode",void 0),D([E],n.prototype,"background",void 0),D([E],n.prototype,"gridSize",void 0),D([E],n.prototype,"transformModel",void 0),D([E],n.prototype,"editConfigModel",void 0),D([E],n.prototype,"partial",void 0),D([Q],n.prototype,"nodesMap",null),D([Q],n.prototype,"edgesMap",null),D([Q],n.prototype,"modelsMap",null),D([Q],n.prototype,"sortElements",null),D([Q],n.prototype,"textEditElement",null),D([Q],n.prototype,"selectElements",null),D([Q],n.prototype,"selectNodes",null),D([b],n.prototype,"setOverlapMode",null),D([b],n.prototype,"setTextMode",null),D([b],n.prototype,"setFakeNode",null),D([b],n.prototype,"removeFakeNode",null),D([b],n.prototype,"setModel",null),D([b],n.prototype,"toFront",null),D([b],n.prototype,"setElementZIndex",null),D([b],n.prototype,"deleteNode",null),D([b],n.prototype,"addNode",null),D([b],n.prototype,"cloneNode",null),D([b],n.prototype,"moveNode",null),D([b],n.prototype,"moveNode2Coordinate",null),D([b],n.prototype,"editText",null),D([b],n.prototype,"addEdge",null),D([b],n.prototype,"moveEdge",null),D([b],n.prototype,"deleteEdgeBySourceAndTarget",null),D([b],n.prototype,"deleteEdgeById",null),D([b],n.prototype,"deleteEdgeBySource",null),D([b],n.prototype,"deleteEdgeByTarget",null),D([b],n.prototype,"setElementStateById",null),D([b],n.prototype,"updateText",null),D([b],n.prototype,"selectNodeById",null),D([b],n.prototype,"selectEdgeById",null),D([b],n.prototype,"selectElementById",null),D([b],n.prototype,"deselectElementById",null),D([b],n.prototype,"clearSelectElements",null),D([b],n.prototype,"moveNodes",null),D([b],n.prototype,"setDefaultEdgeType",null),D([b],n.prototype,"changeNodeType",null),D([b],n.prototype,"changeEdgeType",null),D([b],n.prototype,"getNodeIncomingEdge",null),D([b],n.prototype,"getNodeOutgoingEdge",null),D([b],n.prototype,"getAnchorIncomingEdge",null),D([b],n.prototype,"getAnchorOutgoingEdge",null),D([b],n.prototype,"getNodeIncomingNode",null),D([b],n.prototype,"getNodeOutgoingNode",null),D([b],n.prototype,"setTheme",null),D([b],n.prototype,"getTheme",null),D([b],n.prototype,"resize",null),D([b],n.prototype,"clearData",null),D([b],n.prototype,"translateCenter",null),D([b],n.prototype,"fitView",null),D([b],n.prototype,"openEdgeAnimation",null),D([b],n.prototype,"closeEdgeAnimation",null),D([b],n.prototype,"setPartial",null),n})(),Me=function(){return Me=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Me.apply(this,arguments)},_n=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},If=(function(){function n(t,e){e===void 0&&(e=1),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=t,this.epsilon=e}return n.prototype.getStyle=function(){return Me({},this.graphModel.theme.snapline)},n.prototype.getCenterSnapLine=function(t,e){for(var o=t.x,r=t.y,i=!1,a=!1,s=0;s<e.length;s++){var l=e[s];if(l.id!==t.id&&(Xt(o,l.x,this.epsilon)&&(i=!0),Xt(r,l.y,this.epsilon)&&(a=!0),i&&a))break}return{isShowVertical:i,isShowHorizontal:a,position:{x:o,y:r}}},n.prototype.getHorizontalSnapline=function(t,e){var o=!1,r=0,i=t.id,a;if(i){var s=this.graphModel.fakeNode;if(s&&s.id===i)a=At(s);else{var l=this.graphModel.getNodeModelById(i);l&&(a=At(l))}}for(var u=0;u<e.length;u++){var p=e[u];if(p.id!==t.id){var c=At(p);if(Xt(c.minY,a==null?void 0:a.minY,this.epsilon)||Xt(c.maxY,a==null?void 0:a.minY,this.epsilon)){o=!0,r=a.minY;break}if(Xt(c.minY,a==null?void 0:a.maxY,this.epsilon)||Xt(c.maxY,a==null?void 0:a.maxY,this.epsilon)){o=!0,r=a.maxY;break}}}return{isShowHorizontal:o,isShowVertical:this.isShowVertical,position:Me(Me({},this.position),{y:r})}},n.prototype.getVerticalSnapline=function(t,e){var o=!1,r=0,i=t.id,a;if(i){var s=this.graphModel.fakeNode;if(s&&s.id===i)a=At(s);else{var l=this.graphModel.getNodeModelById(i);l&&(a=At(l))}}for(var u=0;u<e.length;u++){var p=e[u];if(p.id!==t.id){var c=At(p);if(Xt(c.minX,a==null?void 0:a.minX,this.epsilon)){o=!0,r=a.minX;break}if(Xt(c.minX,a==null?void 0:a.minX,this.epsilon)||Xt(c.maxX,a==null?void 0:a.minX,this.epsilon)){o=!0,r=a.minX;break}if(Xt(c.minX,a==null?void 0:a.maxX,this.epsilon)||Xt(c.maxX,a==null?void 0:a.maxX,this.epsilon)){o=!0,r=a.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:o,position:Me(Me({},this.position),{x:r})}},n.prototype.getSnapLinePosition=function(t,e){var o=this.getCenterSnapLine(t,e),r=o.isShowHorizontal,i=o.isShowVertical;if(!r){var a=this.getHorizontalSnapline(t,e);a.isShowHorizontal&&(o.isShowHorizontal=a.isShowHorizontal,o.position.y=a.position.y)}if(!i){var s=this.getVerticalSnapline(t,e);s.isShowVertical&&(o.isShowVertical=s.isShowVertical,o.position.x=s.position.x)}return o},n.prototype.setSnaplineInfo=function(t){var e=t.isShowHorizontal,o=t.isShowVertical,r=t.position;this.position=r,this.isShowHorizontal=e,this.isShowVertical=o},n.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},n.prototype.setNodeSnapLine=function(t){var e=this.graphModel.nodes,o=this.getSnapLinePosition(t,e);this.setSnaplineInfo(o)},_n([E],n.prototype,"isShowHorizontal",void 0),_n([E],n.prototype,"isShowVertical",void 0),_n([E],n.prototype,"position",void 0),_n([b],n.prototype,"clearSnapline",null),_n([b],n.prototype,"setNodeSnapLine",null),n})();function Xt(n,t,e){return Math.abs(n-t)<=e}var Rf=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Xf=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Bf=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Hf=function(n,t,e){if(e||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return n.concat(i||Array.prototype.slice.call(t))},zf=(function(n){Rf(t,n);function t(){var e=n.apply(this,Hf([],Bf(arguments),!1))||this;return e.handleResize=function(){var o=e.props,r=o.graphModel,i=o.options,a=r.width,s=r.height,l=r.isContainerWidth,u=r.isContainerHeight,p=a,c=s,d=!1;l&&(p=void 0,d=!0),u&&(c=void 0,d=!0),d&&r.resize(p,c),i.width=a,i.height=s},e.throttleResize=su(e.handleResize,200),e}return t.prototype.componentDidMount=function(){window.addEventListener("resize",this.throttleResize)},t.prototype.componentDidUpdate=function(){var e=this.props.graphModel.modelToGraphData();this.props.graphModel.eventCenter.emit(N.GRAPH_UPDATED,{data:e})},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.throttleResize)},t.prototype.getComponent=function(e,o,r){r===void 0&&(r="canvas-overlay");var i=this.props.getView,a=i(e.type);return a?O(a,{model:e,graphModel:o,overlay:r},e.id):null},t.prototype.render=function(){var e=this,o=this.props,r=o.graphModel,i=o.tool,a=o.options,s=o.dnd,l=o.snaplineModel,u={};a.width&&(u.width="".concat(r.width,"px")),a.height&&(u.height="".concat(r.height,"px"));var p=r.fakeNode,c=r.editConfigModel,d=r.background,f=c.adjustEdge;return O("div",{className:"lf-graph","flow-id":r.flowId,style:u,children:[O(uf,{graphModel:r,dnd:s,children:[O("g",{className:"lf-base",children:re(r.sortElements,function(h){return e.getComponent(h,r)})}),p?this.getComponent(p,r):""]}),O(bf,{graphModel:r,children:[O(Of,{graphModel:r}),f?O(df,{graphModel:r}):"",a.snapline!==!1?O(Mf,{snaplineModel:l}):""]}),O(Pf,{graphModel:r,tool:i}),d&&O(yf,{background:d}),O(Ze,{graphModel:r})]})},t=Xf([Pt],t),t})(G),Yf=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Zt=function(){return Zt=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Zt.apply(this,arguments)},Gf=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Uf=(function(n){Yf(t,n);function t(){var e=n.call(this)||this;return e.onDragStart=function(o){var r=o.event,i=e.props,a=i.anchorData,s=i.nodeModel,l=i.graphModel;l.selectNodeById(s.id),s.autoToFront&&l.toFront(s.id),l.eventCenter.emit(N.ANCHOR_DRAGSTART,{data:a,e:r,nodeModel:s}),e.setState({startX:a.x,startY:a.y,endX:a.x,endY:a.y})},e.onDragging=function(o){var r=o.event,i=e.props,a=i.graphModel,s=i.nodeModel,l=i.anchorData,u=a.transformModel,p=a.eventCenter,c=a.width,d=a.height,f=a.editConfigModel,h=f.autoExpand,y=f.stopMoveGraph;if(r){var v=r.clientX,g=r.clientY,m=a.getPointByClient({x:v,y:g}),M=m.domOverlayPosition,T=M.x,w=M.y,S=m.canvasOverlayPosition,_=S.x,x=S.y;e.t&&tr(e.t);var A=[],P=10;T<10?A=[P,0]:T+10>c?A=[-P,0]:w<10?A=[0,P]:w+10>d&&(A=[0,-P]),e.setState({endX:_,endY:x,dragging:!0}),e.moveAnchorEnd(_,x),A.length>0&&!y&&h&&(e.t=Hl(function(){var I=Gf(A,2),B=I[0],ot=I[1];u.translate(B,ot);var $=e.state,ct=$.endX,st=$.endY;e.setState({endX:ct-B,endY:st-ot}),e.moveAnchorEnd(ct-B,st-ot)})),p.emit(N.ANCHOR_DRAG,{data:l,e:r,nodeModel:s})}},e.onDragEnd=function(o){var r=o.event;e.t&&tr(e.t);var i=e.checkEnd(r);e.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),e.sourceRuleResults.clear(),e.targetRuleResults.clear();var a=e.props,s=a.graphModel,l=a.nodeModel,u=a.anchorData;s.eventCenter.emit(N.ANCHOR_DRAGEND,{data:u,e:r,nodeModel:l,edgeModel:i!=null?i:void 0})},e.checkEnd=function(o){var r,i=e.props,a=i.graphModel,s=i.nodeModel,l=i.anchorData,u=l.x,p=l.y,c=l.id,d=e.state,f=d.endX,h=d.endY,y=d.dragging,v=Jo({x:f,y:h},a);if(e.preTargetNode&&e.preTargetNode.state!==W.DEFAULT&&e.preTargetNode.setElementState(W.DEFAULT),!!y&&v&&v.node){var g=v.node,m=v.anchor.id,M="".concat(s.id,"_").concat(g.id,"_").concat(m,"_").concat(c),T=e.sourceRuleResults.get(M)||{},w=T.isAllPass,S=T.msg,_=e.targetRuleResults.get(M)||{},x=_.isAllPass,A=_.msg;if(w&&x){g.setElementState(W.DEFAULT);var P=a.getNodeModelById(v.node.id),I=(r=a.edgeGenerator)===null||r===void 0?void 0:r.call(a,s.getData(),P==null?void 0:P.getData()),B=a.addEdge(Zt(Zt({},I),{sourceNodeId:s.id,sourceAnchorId:c,startPoint:{x:u,y:p},targetNodeId:v.node.id,targetAnchorId:v.anchor.id,endPoint:{x:v.anchor.x,y:v.anchor.y}})),ot=e.props.anchorData;return a.eventCenter.emit(N.ANCHOR_DROP,{data:ot,e:o,nodeModel:s,edgeModel:B}),B}var $=g.getData();return a.eventCenter.emit(N.CONNECTION_NOT_ALLOWED,{data:$,msg:A||S||"不允许添加连线"}),null}},e.sourceRuleResults=new Map,e.targetRuleResults=new Map,e.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},e.dragHandler=new ae({onDragStart:e.onDragStart,onDragging:e.onDragging,onDragEnd:e.onDragEnd}),e}return t.prototype.getAnchorShape=function(){var e=this.props,o=e.anchorData,r=e.style,i=e.node,a=i.getAnchorShape(o);if(a)return a;var s=o.x,l=o.y,u=Zt(Zt({},r),r==null?void 0:r.hover);return O("g",{children:[O(un,Zt({className:"lf-node-anchor-hover"},u,{x:s,y:l})),O(un,Zt({className:"lf-node-anchor"},r,{x:s,y:l}))]})},Object.defineProperty(t.prototype,"customTrajectory",{get:function(){var e=this.props.graphModel.customTrajectory;return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"relateEdges",{get:function(){var e=this.props,o=e.graphModel,r=o.getAnchorIncomingEdge,i=o.getAnchorOutgoingEdge,a=e.anchorData.id;return{incomingEdgeList:r(a),outgoingEdgeList:i(a)}},enumerable:!1,configurable:!0}),t.prototype.moveAnchorEnd=function(e,o){var r,i,a=this.props,s=a.graphModel,l=a.nodeModel,u=a.anchorData,p=Jo({x:e,y:o},s);if(p){var c=p.node,d=p.anchor.id;if(this.preTargetNode&&this.preTargetNode!==p.node&&this.preTargetNode.setElementState(W.DEFAULT),u.id===d)return;this.preTargetNode=c;var f="".concat(l.id,"_").concat(c.id,"_").concat(d,"_").concat(u.id);if(!this.targetRuleResults.has(f)){var h=p.anchor,y=l.isAllowConnectedAsSource(c,u,h),v=c.isAllowConnectedAsTarget(l,u,h);this.sourceRuleResults.set(f,Qo(y)),this.targetRuleResults.set(f,Qo(v))}var g=((r=this.sourceRuleResults.get(f))!==null&&r!==void 0?r:{}).isAllPass,m=((i=this.targetRuleResults.get(f))!==null&&i!==void 0?i:{}).isAllPass;g&&m?c.setElementState(W.ALLOW_CONNECT):c.setElementState(W.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==W.DEFAULT&&this.preTargetNode.setElementState(W.DEFAULT)},t.prototype.isShowLine=function(){var e=this.state,o=e.startX,r=e.startY,i=e.endX,a=e.endY,s=Yt(o,r,i,a);return s>10},t.prototype.render=function(){var e=this,o=this.state,r=o.startX,i=o.startY,a=o.endX,s=o.endY,l=this.props,u=l.anchorData,p=l.edgeStyle,c=l.nodeModel,d=l.graphModel,f=u.edgeAddable;return O("g",{className:"lf-anchor",children:[O("g",{onClick:function(h){h.stopPropagation(),d.eventCenter.emit(N.ANCHOR_CLICK,{data:u,e:h,nodeModel:c})},onMouseDown:function(h){d.eventCenter.emit(N.ANCHOR_MOUSEDOWN,{data:u,e:h,nodeModel:c}),f!==!1&&e.dragHandler.handleMouseDown(h)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(Zt({sourcePoint:{x:r,y:i},targetPoint:{x:a,y:s}},p)):O(ln,Zt({x1:r,y1:i,x2:a,y2:s},p,{"pointer-events":"none"})))]})},t})(G),Vf=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),ci=function(){return ci=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ci.apply(this,arguments)},Ff=(function(n){Vf(t,n);function t(e){var o=n.call(this,e)||this;return o.style={},o.onDragging=function(r){var i,a=r.event,s=o.props,l=s.graphModel,u=s.nodeModel,p=s.eventCenter,c=l.selectNodes,d=u.x,f=u.y,h=a.clientX,y=a.clientY,v=l.getPointByClient({x:h,y}).canvasOverlayPosition,g=v.x,m=v.y,M=new _t(g-d,m-f),T=((i=o.normal)===null||i===void 0?void 0:i.angle(M))-o.defaultAngle,w=new qo(-d,-f).rotate(T).translate(d,f).toString();u.transform=w,u.rotate=T;var S=re(c,function(x){return x.id});S.indexOf(u.id)===-1&&(S=[u.id]);var _=lu(S,function(x,A){var P=l.getNodeModelById(A);return x[A]=P==null?void 0:P.getMoveDistance(0,0,!1),x},{});S.forEach(function(x){var A=l.getNodeEdges(x);A.forEach(function(P){if(_[P.sourceNodeId]){var I=l.getNodeModelById(P.sourceNodeId),B=I.anchors.find(function(ot){return ot.id===P.sourceAnchorId});P.updateStartPoint(B)}if(_[P.targetNodeId]){var I=l.getNodeModelById(P.targetNodeId),B=I.anchors.find(function(ct){return ct.id===P.targetAnchorId});P.updateEndPoint(B)}})}),p.emit(N.NODE_ROTATE,{e:a,model:u,data:u.getData()})},o.style=e.style,o.stepperDrag=new ae({onDragging:o.onDragging}),o}return t.prototype.render=function(){var e=this,o=this.props.nodeModel,r=o.x,i=o.y,a=o.width,s=o.height,l=r+a/2+20,u=i-s/2-20;return this.normal=new _t(1,0),this.defaultAngle=this.normal.angle(new _t(l-r,u-i)),o.defaultAngle=this.defaultAngle,O("g",{className:"lf-rotate-control",children:O("g",{onMouseDown:function(p){e.stepperDrag.handleMouseDown(p)},children:O(un,ci({},this.style,{cx:l,cy:u}))})})},t})(G),ps={exports:{}};/*!
|
||
Copyright (c) 2018 Jed Watson.
|
||
Licensed under the MIT License (MIT), see
|
||
http://jedwatson.github.io/classnames
|
||
*/var ds;function Wf(){return ds||(ds=1,(function(n){(function(){var t={}.hasOwnProperty;function e(){for(var i="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(i=r(i,o(s)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return e.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var s in i)t.call(i,s)&&i[s]&&(a=r(a,s));return a}function r(i,a){return a?i?i+" "+a:i+a:i}n.exports?(e.default=e,n.exports=e):window.classNames=e})()})(ps)),ps.exports}var Kf=Wf();const Zf=ks(Kf);var qf=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),pi=function(){return pi=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},pi.apply(this,arguments)},$f=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Wl=(function(n){qf(t,n);function t(e){var o=n.call(this)||this;o.mouseDownHandler=function(i){var a=o.props,s=a.draggable,l=a.model,u=a.graphModel,p=u.editConfigModel.nodeTextDraggable;(s!=null?s:p)&&(i.stopPropagation(),o.stepperDrag.model=l,o.stepperDrag.handleMouseDown(i))},o.onDragging=function(i){var a=i.deltaX,s=i.deltaY,l=o.props,u=l.model,p=l.graphModel.transformModel;if(a||s){var c=$f(p.fixDeltaXY(a,s),2),d=c[0],f=c[1];u.moveText(d,f)}},o.dbClickHandler=function(){var i=o.props,a=i.editable,s=i.graphModel.eventCenter,l=i.model;a&&l.setElementState(W.TEXT_EDIT),s.emit(N.TEXT_DBCLICK,{data:l.text,model:l})};var r=e.draggable;return o.stepperDrag=new ae({onDragging:o.onDragging,step:1,eventType:"TEXT",isStopPropagation:r}),o}return t.prototype.getShape=function(){var e=this.props,o=e.model,r=e.graphModel,i=r.editConfigModel,a=o.text,s=a.value,l=a.x,u=a.y,p=a.editable,c=a.draggable,d={x:l,y:u,className:"",value:s},f=o.getTextStyle(),h=i.nodeTextDraggable||c;return O(zl,pi({},d,f,{className:Zf({"lf-element-text":p,"lf-text-draggable":!p&&h,"lf-text-disabled":!p&&!h}),model:o}))},t.prototype.render=function(){var e=this.props.model.text;if(e)return O("g",{onMouseDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},t})(G),Jf=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Bt=function(){return Bt=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Bt.apply(this,arguments)},So=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Qf=(function(n){Jf(t,n);function t(e){var o=n.call(this,e)||this;return o.setHoverOn=function(){o.setState({isHovered:!0})},o.setHoverOff=function(){o.setState({isHovered:!1})},o.state={isHovered:!1},o}return t.prototype.getBackground=function(){var e=this.state.isHovered,o=this.props.model,r=o.text,i=o.getTextStyle(),a=i.background||{};if(e&&i.hover&&i.hover.background&&(a=Bt(Bt({},a),i.hover.background)),r!=null&&r.value&&(a==null?void 0:a.fill)!=="transparent"){var s=i.fontSize,l=i.textWidth,u=i.lineHeight,p=i.overflowMode,c=a.wrapPadding,d=r==null?void 0:r.value.split(/[\r\n]/g),f=d.length,h=r.x,y=r.y,v={};if(p==="autoWrap"&&l){var g=Bl({rows:d,style:{fontSize:"".concat(s,"px"),width:"".concat(l,"px"),lineHeight:u,padding:c},rowsLength:f,className:"lf-get-text-height"});v=Bt(Bt({},a),{x:h,y,width:l,height:g})}else{var m=Cp({rows:d,rowsLength:f,fontSize:s}),M=m.width,T=m.height;if(p==="ellipsis"&&(M=l,T=s+2),typeof a.wrapPadding=="string"){var w=a.wrapPadding.split(",").filter(function(wt){return wt.trim()}).map(function(wt){return parseFloat(wt.trim())});if(w.length>0&&w.length<=4){if(w.length===1){var S=So(w,1),_=S[0];w=[_,_,_,_]}else if(w.length===2){var x=So(w,2),A=x[0],P=x[1];w=[A,P,A,P]}else if(w.length===3){var I=So(w,3),B=I[0],P=I[1],ot=I[2];w=[B,P,ot,P]}var $=So(w,4),ct=$[0],st=$[1],pt=$[2],bt=$[3];M+=st+bt,T+=ct+pt,h=h+(st-bt)/2,y=y+(pt-ct)/2}}v=Bt(Bt({},a),{x:h-1,y:y-1,width:M,height:T})}return O(te,Bt({},v))}return null},t.prototype.getShape=function(){var e=this.props.model,o=e.text,r=o.x,i=o.y,a=o.value;if(!a)return null;var s=e.getTextStyle(),l=Bt({x:r,y:i,value:a,model:e,className:"lf-element-text"},s);return O("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),O(zl,Bt({},l))]})},t})(Wl),th=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),nr=function(){return nr=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},nr.apply(this,arguments)},eh=function(n,t){var e={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(e[o[r]]=n[o[r]]);return e},Mo=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Oe=(function(n){th(t,n);function t(e){var o=n.call(this)||this;o.onDragStart=function(l){var u=l.event,p=o.props,c=p.model,d=p.graphModel;if(u){var f=d.getPointByClient({x:u.clientX,y:u.clientY}).canvasOverlayPosition,h=f.x,y=f.y;o.moveOffset={dx:c.x-h,dy:c.y-y}}},o.onDragging=function(l){var u,p,c,d,f=l.event,h=o.props,y=h.model,v=h.graphModel,g=v.editConfigModel,m=g.stopMoveGraph,M=g.autoExpand,T=g.snapGrid,w=v.transformModel,S=v.selectNodes,_=v.width,x=v.height,A=v.gridSize;y.isDragging=!0;var P=f,I=P.clientX,B=P.clientY,ot=o.mouseDownPosition,$=ot.x,ct=ot.y;(I-$>A||B-ct>A)&&(y.isDragging=!0);var st=v.getPointByClient({x:I,y:B}).canvasOverlayPosition,pt=st.x,bt=st.y,wt=Mo(w.CanvasPointToHtmlPoint([pt,bt]),2),kt=wt[0],R=wt[1];if(pt=pt+((p=(u=o.moveOffset)===null||u===void 0?void 0:u.dx)!==null&&p!==void 0?p:0),bt=bt+((d=(c=o.moveOffset)===null||c===void 0?void 0:c.dy)!==null&&d!==void 0?d:0),pt=sn(pt,A,T),bt=sn(bt,A,T),!_||!x){v.moveNode2Coordinate(y.id,pt,bt);return}var V=kt<0||R<0||kt>_||R>x;if(!(M&&!m&&V)){var J=Mo(w.CanvasPointToHtmlPoint([pt-y.width/2,bt-y.height/2]),2),Y=J[0],nt=J[1],Dt=Mo(w.CanvasPointToHtmlPoint([pt+y.width/2,bt+y.height/2]),2),tt=Dt[0],dt=Dt[1],It=Math.max(A,20),Ot=[];Y<0?Ot=[It,0]:tt>v.width?Ot=[-It,0]:nt<0?Ot=[0,It]:dt>v.height&&(Ot=[0,-It]),o.t&&tr(o.t);var Ie=S.map(function(Re){return Re.id});Ie.indexOf(y.id)===-1&&(Ie=[y.id]),Ot.length>0&&!m&&M?o.t=Hl(function(){var Re=Mo(Ot,2),io=Re[0],ao=Re[1];w.translate(io!=null?io:0,ao!=null?ao:0);var Jl=-(io!=null?io:0)/w.SCALE_X,Ql=-(ao!=null?ao:0)/w.SCALE_X;v.moveNodes(Ie,Jl,Ql)}):v.moveNodes(Ie,pt-y.x,bt-y.y)}},o.onDragEnd=function(){o.t&&tr(o.t);var l=o.props.model;l.isDragging=!1},o.onMouseOut=function(l){lp()&&o.setHoverOff(l)},o.handleMouseUp=function(){var l=o.props.model;o.mouseUpDrag=l.isDragging},o.handleClick=function(l){var u=o.mouseUpDrag===!1,p=new Date().getTime();if(o.startTime){var c=p-o.startTime,d=o.props,f=d.model,h=d.graphModel;if(!(!u&&c>300)){u||(o.onDragEnd(),o.handleMouseUp());var y=f.getData(),v=h.getPointByClient({x:l.clientX,y:l.clientY}),g={data:y,e:l,position:v,isSelected:!1,isMultiple:!1},m=l.button===2,M=l.detail===2;if(!m){var T=h.editConfigModel,w=Rl(l,T);if(g.isMultiple=w,f.isSelected&&!M&&w?(g.isSelected=!1,f.setSelected(!1)):(h.selectNodeById(f.id,w),g.isSelected=!0,T.isSilentMode||o.toFront()),M)T.nodeTextEdit&&f.text.editable&&T.textMode===jt.TEXT&&(f.setSelected(!1),h.setElementStateById(f.id,W.TEXT_EDIT)),h.eventCenter.emit(N.NODE_DBCLICK,g);else{h.eventCenter.emit(N.ELEMENT_CLICK,g),h.eventCenter.emit(N.NODE_CLICK,g);var S=l.currentTarget,_=!vt(window)&&Ls(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(x){return setTimeout(x,0)};_(function(){S.focus()})}}}}},o.handleContextMenu=function(l){l.preventDefault();var u=o.props,p=u.model,c=u.graphModel,d=c.editConfigModel,f=p.getData(),h=c.getPointByClient({x:l.clientX,y:l.clientY});c.setElementStateById(p.id,W.SHOW_MENU,h.domOverlayPosition),p.isSelected||c.selectNodeById(p.id),c.eventCenter.emit(N.NODE_CONTEXTMENU,{data:f,e:l,position:h}),d.isSilentMode||o.toFront()},o.handleMouseDown=function(l){var u=o.props,p=u.model,c=u.graphModel;o.mouseDownPosition={x:l.clientX,y:l.clientY},o.startTime=new Date().getTime();var d=c.editConfigModel;d.adjustNodePosition&&p.draggable&&o.stepDrag&&o.stepDrag.handleMouseDown(l)},o.handleFocus=function(){var l=o.props,u=l.model,p=l.graphModel;p.eventCenter.emit(N.NODE_FOCUS,{data:u.getData()})},o.handleBlur=function(){if(o.props){var l=o.props,u=l.model,p=l.graphModel;p.eventCenter.emit(N.NODE_BLUR,{data:u.getData()})}},o.setHoverOn=function(l){var u=o.props,p=u.model,c=u.graphModel;if(!p.isHovered){var d=p.getData();p.setHovered(!0),c.eventCenter.emit(N.NODE_MOUSEENTER,{data:d,e:l})}},o.setHoverOff=function(l){var u=o.props,p=u.model,c=u.graphModel,d=p.getData();p.isHovered&&(p.setHovered(!1),c.eventCenter.emit(N.NODE_MOUSELEAVE,{data:d,e:l}))};var r=e.graphModel,i=r.gridSize,a=r.eventCenter,s=e.model;return o.stepDrag=new ae({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,step:i,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),o.modelDisposer=pl(function(){return o.props},function(l){l&&l.model&&o.stepDrag.setModel(l.model)}),o}return t.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer(),this.render.$mobx&&this.render.$mobx.dispose()},t.prototype.componentDidMount=function(){},t.prototype.componentDidUpdate=function(){},t.prototype.getAnchorShape=function(e){return null},t.prototype.getAnchors=function(){var e=this,o=this.props,r=o.model,i=o.graphModel,a=r.isSelected,s=r.isHitable,l=r.isDragging,u=r.isShowAnchor;return s&&(a||u)&&!l?re(r.anchors,function(p,c){var d=r.getAnchorLineStyle(p),f=r.getAnchorStyle(p);return O(Uf,{anchorData:p,node:e,style:f,edgeStyle:d,anchorIndex:c,nodeModel:r,graphModel:i,setHoverOff:e.setHoverOff})}):[]},t.prototype.getRotateControl=function(){var e=this.props,o=e.model,r=e.graphModel,i=r.editConfigModel,a=i.isSilentMode,s=i.allowRotate,l=o.isSelected,u=o.isHitable,p=o.rotatable,c=o.isHovered,d=s&&p,f=o.getRotateControlStyle();if(!a&&u&&(l||c)&&d)return O(Ff,{graphModel:r,nodeModel:o,eventCenter:r.eventCenter,style:f})},t.prototype.getResizeControl=function(){var e=this.props,o=e.model,r=e.graphModel,i=r.editConfigModel,a=i.isSilentMode,s=i.allowResize,l=o.isSelected,u=o.isHitable,p=o.resizable,c=o.isHovered,d=s&&p,f=o.getResizeControlStyle();return!a&&u&&(l||c)&&d?O(ld,{style:f,model:o,graphModel:r}):null},t.prototype.getText=function(){var e,o=this.props,r=o.model,i=o.graphModel,a=i.editConfigModel;if(a.nodeTextMode!==jt.TEXT||r.state===W.TEXT_EDIT)return null;if(r.text){var s=!1;return a.nodeTextDraggable&&r.text.draggable&&(s=!0),O(Wl,{editable:a.nodeTextEdit&&((e=r.text.editable)!==null&&e!==void 0?e:!0),model:r,graphModel:i,draggable:s})}return null},t.prototype.getStateClassName=function(){var e=this.props.model,o=e.state,r=e.isDragging,i=e.isSelected,a="lf-node";switch(o){case W.ALLOW_CONNECT:a+=" lf-node-allow";break;case W.NOT_ALLOW_CONNECT:a+=" lf-node-not-allow";break;default:a+=" lf-node-default";break}return r&&(a+=" lf-dragging"),i&&(a+=" lf-node-selected"),a},t.prototype.toFront=function(){var e=this.props,o=e.model,r=e.graphModel;o.autoToFront&&r.toFront(o.id)},t.prototype.render=function(){var e=this.props,o=e.model,r=e.graphModel,i=r.editConfigModel,a=i.hideAnchors,s=i.adjustNodePosition,l=i.allowRotate,u=i.allowResize,p=r.gridSize,c=r.transformModel.SCALE_X,d=o.isHitable,f=o.draggable,h=o.transform,y=o.getOuterGAttributes(),v=y.className,g=v===void 0?"":v,m=eh(y,["className"]),M=O("g",{className:"lf-node-content",children:[O("g",{transform:h,children:[this.getShape(),this.getText(),l&&this.getRotateControl(),u&&this.getResizeControl()]}),!a&&this.getAnchors()]}),T;return d?(s&&f&&this.stepDrag.setStep(p*c),T=O("g",nr({className:"".concat(this.getStateClassName()," ").concat(g),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu,onFocus:this.handleFocus,onBlur:this.handleBlur},m,{children:M}))):T=O("g",nr({className:"".concat(this.getStateClassName()," ").concat(g)},m,{children:M})),T},t.isObserved=!1,t})(G),nh=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),di=function(){return di=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},di.apply(this,arguments)},fs=(function(n){nh(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getShape=function(){var e=this.props.model,o=e.getNodeStyle();return O(te,di({},o,{x:e.x,y:e.y,width:e.width,height:e.height,radius:e.radius}))},t})(Oe),oh=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),fi=function(){return fi=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},fi.apply(this,arguments)},hs=(function(n){oh(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getShape=function(){var e=this.props.model,o=e.x,r=e.y,i=e.r,a=e.getNodeStyle();return O(un,fi({},a,{x:o,y:r,r:i}))},t})(Oe),rh=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),or=function(){return or=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},or.apply(this,arguments)},ys=(function(n){rh(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getShape=function(){var e=this.props.model,o=e,r=o.x,i=o.y,a=o.width,s=o.height,l=o.points,u=e.getNodeStyle(),p={transform:"matrix(1 0 0 1 ".concat(r-a/2," ").concat(i-s/2,")")};return O("g",or({},p,{children:O(Yl,or({},u,{points:l,x:r,y:i}))}))},t})(Oe),ih=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),hi=function(){return hi=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},hi.apply(this,arguments)},gs=(function(n){ih(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getShape=function(){var e=this.props.model,o=e.getNodeStyle();return O("g",{children:O(Yl,hi({},o,{points:e.points,x:e.x,y:e.y}))})},t})(Oe),ah=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),yi=function(){return yi=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},yi.apply(this,arguments)},vs=(function(n){ah(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getShape=function(){var e=this.props.model,o=e.getNodeStyle();return O(td,yi({},o,{x:e.x,y:e.y,rx:e.rx,ry:e.ry}))},t})(Oe),sh=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),In=function(){return In=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},In.apply(this,arguments)},ms=(function(n){sh(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getBackground=function(){var e=this.props.model,o=e.getTextStyle(),r=e.width,i=e.height,a=e.x,s=e.y,l=In(In({},o.background),{x:a,y:s,width:r,height:i});return O(te,In({},l))},t.prototype.getResizeControl=function(){return null},t.prototype.getShape=function(){return O("g",{children:this.getBackground()})},t})(Oe),lh=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),gi=function(){return gi=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},gi.apply(this,arguments)},uh=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},ch=function(n,t,e){if(e||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return n.concat(i||Array.prototype.slice.call(t))},vi=(function(n){lh(t,n);function t(){var e=n.apply(this,ch([],uh(arguments),!1))||this;return e.ref=Si(),e}return Object.defineProperty(t.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),t.prototype.setHtml=function(e){e.appendChild(document.createElement("div"))},t.prototype.confirmUpdate=function(e){this.setHtml(e)},t.prototype.shouldUpdate=function(){return this.preProperties&&this.preProperties===this.currentProperties?!1:(this.preProperties=this.currentProperties,!0)},t.prototype.componentDidMount=function(){this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},t.prototype.componentDidUpdate=function(){this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},t.prototype.componentWillUnmount=function(){n.prototype.componentWillUnmount.call(this),this.rootEl.innerHTML=""},t.prototype.getShape=function(){var e=this.props.model,o=e.x,r=e.y,i=e.height,a=e.width,s=e.getNodeStyle();return this.currentProperties=JSON.stringify(e.properties),O("foreignObject",gi({},s,{x:o-a/2,y:r-i/2,width:a,height:i,ref:this.ref}))},t})(Oe),ph=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Ht=function(){return Ht=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ht.apply(this,arguments)},dh=function(n,t){var e={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(e[o[r]]=n[o[r]]);return e},fh=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Jt;(function(n){n.SOURCE="SOURCE",n.TARGET="TARGET"})(Jt||(Jt={}));var _s=(function(n){ph(t,n);function t(e){var o=n.call(this)||this;o.handleMouseDown=function(l){o.stepDrag&&o.stepDrag.handleMouseDown(l)},o.onDragStart=function(){var l=o.props,u=l.x,p=l.y,c=l.edgeModel,d=c.startPoint,f=c.endPoint,h=c.pointsList;o.oldEdge={startPoint:d,endPoint:f,pointsList:h},o.setState({endX:u,endY:p,dragging:!0})},o.onDragging=function(l){var u=l.deltaX,p=l.deltaY,c=o.state,d=c.endX,f=c.endY,h=o.props,y=h.graphModel,v=h.type,g=y.transformModel,m=y.editConfigModel,M=fh(g.moveCanvasPointByHtml([d,f],u,p),2),T=M[0],w=M[1];o.setState({endX:T,endY:w,dragging:!0});var S=o.props.edgeModel,_=Jo({x:d,y:f},y);if(_&&_.node&&o.isAllowAdjust(_).pass){var x=S.startPoint,A=S.endPoint,P=S.sourceNode,I=S.targetNode,B=v===Jt.SOURCE?{startPoint:{x:_.anchor.x,y:_.anchor.y},endPoint:{x:A.x,y:A.y},sourceNode:_.node,targetNode:I}:{startPoint:{x:x.x,y:x.y},endPoint:{x:_.anchor.x,y:_.anchor.y},sourceNode:P,targetNode:_.node};S.updateAfterAdjustStartAndEnd(B)}else v===Jt.SOURCE?S.updateStartPoint({x:T,y:w}):S.updateEndPoint({x:T,y:w});S.text.value&&m.adjustEdge&&S.setText(Object.assign({},S.text,S.textPosition))},o.onDragEnd=function(l){var u,p,c,d=l.event;try{o.setState({dragging:!1});var f=o.props,h=f.graphModel,y=f.edgeModel,v=f.type,g=o.state,m=g.endX,M=g.endY,T=g.dragging,w=Jo({x:m,y:M},h);if(!T)return;var S=!1,_=void 0;if(w&&w.node){var x=o.isAllowAdjust(w),A=x.pass,P=x.msg,I=x.newTargetNode;if(A){var B=y.getData(),ot=B.text,$=B.sourceAnchorId,ct=$===void 0?"":$,st=B.targetAnchorId,pt=st===void 0?"":st,bt=dh(B,["text","sourceAnchorId","targetAnchorId"]);if(_=Ht(Ht({sourceAnchorId:ct,targetAnchorId:pt},bt),{text:(ot==null?void 0:ot.value)||""}),v===Jt.SOURCE){var wt=h.getNodeModelById(w.node.id),kt=h.getNodeModelById(y.targetNodeId),R=(u=h.edgeGenerator)===null||u===void 0?void 0:u.call(h,wt==null?void 0:wt.getData(),kt==null?void 0:kt.getData(),_);_=Ht(Ht({},R),{sourceNodeId:w.node.id,sourceAnchorId:w.anchor.id,startPoint:{x:w.anchor.x,y:w.anchor.y},targetNodeId:y.targetNodeId,endPoint:Ht({},y.endPoint)}),y.sourceNodeId===w.node.id&&y.sourceAnchorId===w.anchor.id&&(S=!0)}else if(v===Jt.TARGET){var wt=h.getNodeModelById(y.sourceNodeId),kt=h.getNodeModelById(w.node.id),R=(p=h.edgeGenerator)===null||p===void 0?void 0:p.call(h,wt==null?void 0:wt.getData(),kt==null?void 0:kt.getData(),_);_=Ht(Ht({},R),{sourceNodeId:y.sourceNodeId,startPoint:Ht({},y.startPoint),targetNodeId:w.node.id,targetAnchorId:w.anchor.id,endPoint:{x:w.anchor.x,y:w.anchor.y}}),y.targetNodeId===w.node.id&&y.targetAnchorId===w.anchor.id&&(S=!0)}}else{S=!0;var V=I.getData();h.eventCenter.emit(N.CONNECTION_NOT_ALLOWED,{data:V,msg:P})}}else S=!0;if(S)o.recoveryEdge();else{var J=y.getData();h.deleteEdgeById(y.id);var Y=h.addEdge(Ht({},_));h.eventCenter.emit(N.EDGE_EXCHANGE_NODE,{data:{newEdge:Y.getData(),oldEdge:J}})}(c=o.preTargetNode)===null||c===void 0||c.setElementState(W.DEFAULT)}finally{var h=o.props.graphModel;h.eventCenter.emit(N.ADJUST_POINT_DRAGEND,{e:d,data:o.stepDragData})}},o.recoveryEdge=function(){var l=o.props.edgeModel,u=o.oldEdge,p=u.startPoint,c=u.endPoint,d=u.pointsList;l.updateStartPoint(p),l.updateEndPoint(c),l.modelType!==z.LINE_EDGE&&(l.pointsList=d!=null?d:[],l.initPoints())},o.getAdjustPointStyle=function(){var l=o.props.graphModel.theme,u=l.edgeAdjust;return u},o.state={dragging:!1,endX:0,endY:0},o.targetRuleResults=new Map,o.sourceRuleResults=new Map;var r=e.type,i=e.edgeModel,a=e.graphModel,s=a.eventCenter;return o.stepDragData={type:r,edgeData:i.getData()},o.stepDrag=new ae({onDragStart:o.onDragStart,onDragging:o.onDragging,onDragEnd:o.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:s,data:o.stepDragData}),o}return t.prototype.isAllowAdjust=function(e){var o=this.props,r=o.edgeModel,i=r.id,a=r.sourceNode,s=r.targetNode,l=r.sourceAnchorId,u=r.targetAnchorId,p=o.type,c,d,f,h;if(p===Jt.SOURCE?(c=e.node,d=s,f=e.anchor,h=s.getAnchorInfo(u)):(c=a,d=e.node,h=e.anchor,f=a.getAnchorInfo(l)),this.preTargetNode&&this.preTargetNode!==e.node&&this.preTargetNode.setElementState(W.DEFAULT),this.preTargetNode=e.node,h.id===f.id)return{pass:!1,msg:"",newTargetNode:d};var y="".concat(c.id,"_").concat(d.id,"_").concat(f.id,"_").concat(h.id);if(!this.targetRuleResults.has(y)){var v=c.isAllowConnectedAsSource(d,f,h,i),g=d.isAllowConnectedAsTarget(c,f,h,i);this.sourceRuleResults.set(y,Qo(v)),this.targetRuleResults.set(y,Qo(g))}var m=this.sourceRuleResults.get(y),M=m.isAllPass,T=m.msg,w=this.targetRuleResults.get(y),S=w.isAllPass,_=w.msg,x=M&&S?W.ALLOW_CONNECT:W.NOT_ALLOW_CONNECT;return p===Jt.SOURCE?c.setElementState(x):d.setElementState(x),{pass:M&&S,msg:_||T,newTargetNode:d}},t.prototype.render=function(){var e=this.props,o=e.x,r=e.y,i=e.getAdjustPointShape,a=e.edgeModel,s=this.state.dragging;return O("g",{pointerEvents:s?"none":"",onMouseDown:this.handleMouseDown,children:s?"":i(o,r,a)})},t})(G),hh=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),mi=function(){return mi=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},mi.apply(this,arguments)};(function(n){hh(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getArrowAttributes=function(){var e=this.props,o=e.arrowInfo,r=e.style,i=o.start,a=o.end,s={start:i,end:a,offset:r.offset,verticalLength:r.verticalLength,type:"end"},l=Gn(s),u=l.leftX,p=l.leftY,c=l.rightX,d=l.rightY;return mi({d:"M".concat(u," ").concat(p," L").concat(a.x," ").concat(a.y," L").concat(c," ").concat(d," z")},r)},t.prototype.getShape=function(){var e=this.getArrowAttributes(),o=e.d,r=e.strokeWidth,i=e.stroke,a=e.fill;return O(Fn,{d:o,fill:a,strokeWidth:r,stroke:i})},t.prototype.render=function(){return O("g",{className:"lf-arrow",children:this.getShape()})},t})(G);var yh=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Rn=function(){return Rn=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Rn.apply(this,arguments)},gh=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},vr=(function(n){yh(t,n);function t(){var e=n.call(this)||this;return e.textRef=Si(),e.handleHover=function(o,r){var i=e.props,a=i.model,s=i.graphModel.eventCenter;a.setHovered(o);var l=o?N.EDGE_MOUSEENTER:N.EDGE_MOUSELEAVE,u=a.getData();s.emit(l,{data:u,e:r})},e.setHoverOn=function(o){var r=e.props.model.isHovered;r||(e.textRef&&e.textRef.current&&e.textRef.current.setHoverOn(),e.handleHover(!0,o))},e.setHoverOff=function(o){var r=e.props.model.isHovered;r&&(e.textRef&&e.textRef.current&&e.textRef.current.setHoverOff(),e.handleHover(!1,o))},e.handleContextMenu=function(o){o.preventDefault(),e.contextMenuTime=new Date().getTime(),e.clickTimer&&clearTimeout(e.clickTimer);var r=e.props,i=r.model,a=r.graphModel,s=a.editConfigModel,l=a.getPointByClient({x:o.clientX,y:o.clientY});a.setElementStateById(i.id,W.SHOW_MENU,l.domOverlayPosition),s.isSilentMode||e.toFront(),i.isSelected||a.selectEdgeById(i.id);var u=i==null?void 0:i.getData();a.eventCenter.emit(N.EDGE_CONTEXTMENU,{data:u,e:o,position:l})},e.handleMouseDown=function(o){o.stopPropagation(),e.startTime=new Date().getTime()},e.handleMouseUp=function(){var o=e.props.model;e.mouseUpDrag=o.isDragging},e.handleClick=function(o){if(e.startTime&&!e.mouseUpDrag){var r=o.button===2;if(!r){var i=o.detail===2,a=e.props,s=a.model,l=a.graphModel,u=s==null?void 0:s.getData(),p=l.getPointByClient({x:o.clientX,y:o.clientY});if(i){var c=l.editConfigModel,d=l.textEditElement,f=s.id,h=s.text,y=s.modelType;if(d&&d.id===f&&l.setElementStateById(f,W.DEFAULT),c.edgeTextEdit&&h.editable&&(s.setSelected(!1),l.setElementStateById(f,W.TEXT_EDIT)),y===z.POLYLINE_EDGE){var v=s,g=l.getPointByClient({x:o.x,y:o.y}).canvasOverlayPosition,m=g.x,M=g.y;v.dbClickPosition=Il({x:m,y:M},v.points)}l.eventCenter.emit(N.EDGE_DBCLICK,{data:u,e:o,position:p})}else{l.eventCenter.emit(N.ELEMENT_CLICK,{data:u,e:o,position:p}),l.eventCenter.emit(N.EDGE_CLICK,{data:u,e:o,position:p});var T=o.currentTarget,w=!vt(window)&&Ls(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(_){return setTimeout(_,0)};w(function(){T.focus()})}var S=l.editConfigModel;l.selectEdgeById(s.id,Rl(o,S)),S.isSilentMode||e.toFront()}}},e.handleFocus=function(){var o=e.props,r=o.model,i=o.graphModel;i.eventCenter.emit(N.EDGE_FOCUS,{data:r.getData()})},e.handleBlur=function(){var o=e.props,r=o.model,i=o.graphModel;i.eventCenter.emit(N.EDGE_BLUR,{data:r.getData()})},e}return t.prototype.getShape=function(){return O("g",{children:this.getEdge()})},t.prototype.getTextStyle=function(){},t.prototype.getText=function(){var e,o=this.props,r=o.model,i=o.graphModel,a=i.editConfigModel;if(a.edgeTextMode!==jt.TEXT||r.state===W.TEXT_EDIT)return null;if(r.text){var s=!1;return a.edgeTextDraggable&&r.text.draggable&&(s=!0),O(Qf,{ref:this.textRef,editable:a.edgeTextEdit&&((e=r.text.editable)!==null&&e!==void 0?e:!0),model:r,graphModel:i,draggable:s})}return null},t.prototype.getArrowInfo=function(){var e=this.props.model,o=e.startPoint,r=e.endPoint,i=e.isSelected,a=this.state.hover;return{start:o,end:r,hover:a,isSelected:i}},t.prototype.getLastTwoPoints=function(){var e=this.props.model,o=e.startPoint,r=e.endPoint;return[o,r]},t.prototype.getArrowStyle=function(){return null},t.prototype.getArrow=function(){var e=this.props.model,o=e.id,r=e.getArrowStyle(),i=r.refY,a=i===void 0?0:i,s=r.refX,l=s===void 0?2:s,u=gh(this.getLastTwoPoints(),2),p=u[0],c=u[1],d="auto";if(p&&c){var f=c.x-p.x,h=c.y-p.y;if(f!==0||h!==0){var y=Sd(wd({x:f,y:h}));Number.isFinite(y)&&!Number.isNaN(y)&&(d=y)}}return O("g",{children:O("defs",{children:[O("marker",{id:"marker-start-".concat(o),refX:-l,refY:a,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),O("marker",{id:"marker-end-".concat(o),refX:l,refY:a,overflow:"visible",orient:d,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},t.prototype.getArrowPath=function(e,o){var r=o.stroke,i=o.fill,a=i===void 0?r:i,s=o.strokeWidth,l=o.offset,u=l===void 0?10:l,p=o.verticalLength,c=o.strokeLinecap,d=o.strokeLinejoin,f=o.transform,h="";switch(e){case"solid":h="M".concat(-u/4,",0 L").concat(3*u/4,",").concat(p," L").concat(3*u/4,",-").concat(p," Z");break;case"hollow":h="M".concat(-u/4,",0 L").concat(3*u/4,",").concat(p," L").concat(-u/4,",0 L").concat(3*u/4,",-").concat(p," L").concat(-u/4,",0 Z");break;case"diamond":h="M".concat(-u/2,",0 L0,").concat(p," L").concat(u/2,",0 L0,-").concat(p," L").concat(-u/2,",0 Z");break;case"circle":h="M".concat(-u/2,",0 A").concat(u/4,",").concat(u/4," 0 1,0 ").concat(u/2,",0 A").concat(u/4,",").concat(u/4," 0 1,0 ").concat(-u/2,",0 Z");break;default:h="";break}return O("path",{d:h,stroke:r,fill:a,strokeWidth:s,strokeLinecap:c,strokeLinejoin:d,transform:f})},t.prototype.getStartArrow=function(){var e=this.props.model,o=e.getArrowStyle(),r=o.stroke,i=o.strokeWidth,a=o.offset,s=o.verticalLength,l=o.startArrowType,u=l===void 0?"none":l,p=o.strokeLinecap,c=o.strokeLinejoin;return this.getArrowPath(u,{stroke:r,strokeWidth:i,offset:a,verticalLength:s,strokeLinecap:p,strokeLinejoin:c})},t.prototype.getEndArrow=function(){var e=this.props.model,o=e.getArrowStyle(),r=o.stroke,i=o.strokeWidth,a=o.offset,s=o.verticalLength,l=o.endArrowType,u=l===void 0?"solid":l,p=o.strokeLinecap,c=o.strokeLinejoin;return this.getArrowPath(u,{stroke:r,strokeWidth:i,offset:a,verticalLength:s,strokeLinecap:p,strokeLinejoin:c,transform:"rotate(180)"})},t.prototype.getAdjustPointShape=function(e,o,r){var i=r.getAdjustPointStyle();return O(un,Rn({className:"lf-edge-adjust-point"},i,{x:e,y:o}))},t.prototype.getAdjustPoints=function(){var e=this.props,o=e.model,r=e.graphModel,i=r.editConfigModel,a=i.adjustEdgeStartAndEnd,s=i.adjustEdgeStart,l=i.adjustEdgeEnd,u=o.getAdjustStart(),p=o.getAdjustEnd();return O("g",{children:[a&&s&&O(_s,Rn({type:Jt.SOURCE},u,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:o,graphModel:r})),a&&l&&O(_s,Rn({type:Jt.TARGET},p,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:o,graphModel:r}))]})},t.prototype.getAnimation=function(){},t.prototype.getAppendWidth=function(){return O("g",{})},t.prototype.getAppend=function(){return O("g",{className:"lf-edge-append",children:this.getAppendWidth()})},t.prototype.getEdge=function(){return null},t.prototype.toFront=function(){var e=this.props,o=e.graphModel,r=e.model;o.toFront(r.id)},t.prototype.render=function(){var e=this.props.model,o=e.isSelected,r=e.isHitable,i=e.isShowAdjustPoint;return O("g",{children:[O("g",{className:["lf-edge",!r&&"pointer-none",o&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,onFocus:this.handleFocus,onBlur:this.handleBlur,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),i&&o?this.getAdjustPoints():""]})},t.isObserved=!1,t})(G),vh=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),_i=function(){return _i=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},_i.apply(this,arguments)},mh=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},bs=(function(n){vh(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getEdge=function(){var e=this.props.model,o=e.getEdgeStyle(),r=e,i=r.path,a=r.isAnimation,s=r.arrowConfig,l=e.getEdgeAnimationStyle(),u=l.strokeDasharray,p=l.stroke,c=l.strokeDashoffset,d=l.animationName,f=l.animationDuration,h=l.animationIterationCount,y=l.animationTimingFunction,v=l.animationDirection;return O(Fn,_i({d:i},o,s,a?{strokeDasharray:u,stroke:p,style:{strokeDashoffset:c,animationName:d,animationDuration:f,animationIterationCount:h,animationTimingFunction:y,animationDirection:v}}:{}))},t.prototype.getAppendWidth=function(){var e=this.props.model.path;return O(Fn,{d:e,strokeWidth:10,stroke:"transparent",fill:"none"})},t.prototype.getArrowInfo=function(){var e=this.props.model,o=this.state.hover,r=e.isSelected,i=e.getArrowStyle().offset,a=e.pointsList.map(function(c){return{x:c.x,y:c.y}}),s=mh(za(a,i),2),l=s[0],u=s[1],p={start:l,end:u,hover:o,isSelected:r};return p},t.prototype.getLastTwoPoints=function(){var e=this.props.model,o=e.getArrowStyle().offset,r=e.pointsList.map(function(i){return{x:i.x,y:i.y}});return za(r,o)},t})(vr),_h=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),bi=function(){return bi=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},bi.apply(this,arguments)},xs=(function(n){_h(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getEdge=function(){var e=this.props.model,o=e.startPoint,r=e.endPoint,i=e.isAnimation,a=e.arrowConfig,s=e.getEdgeStyle(),l=e.getEdgeAnimationStyle(),u=l.strokeDasharray,p=l.stroke,c=l.strokeDashoffset,d=l.animationName,f=l.animationDuration,h=l.animationIterationCount,y=l.animationTimingFunction,v=l.animationDirection;return O(ln,bi({},s,{x1:o.x,y1:o.y,x2:r.x,y2:r.y},a,i?{strokeDasharray:u,stroke:p,style:{strokeDashoffset:c,animationName:d,animationDuration:f,animationIterationCount:h,animationTimingFunction:y,animationDirection:v}}:{}))},t.prototype.getAppendWidth=function(){var e=this.props.model,o=e.startPoint,r=e.endPoint,i={start:o,end:r},a=Pp(i),s=a.d,l=a.strokeWidth,u=a.fill,p=a.strokeDasharray,c=a.stroke;return O(Fn,{d:s,fill:u,strokeWidth:l,stroke:c,strokeDasharray:p})},t})(vr),bh=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Te=function(){return Te=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Te.apply(this,arguments)},xh=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Es=(function(n){bh(t,n);function t(){var e=n.call(this)||this;return e.onDragStart=function(){var o=e.props.model;o.dragAppendStart(),e.isShowAdjustPointTemp=o.isShowAdjustPoint,o.isShowAdjustPoint=!1},e.onDragging=function(o){var r=o.deltaX,i=o.deltaY,a=e.props,s=a.model,l=a.graphModel;e.isDragging=!0;var u=l.transformModel,p=l.editConfigModel,c=xh(u.fixDeltaXY(r,i),2),d=c[0],f=c[1],h=s,y=p.adjustEdgeMiddle;y?e.appendInfo=h.dragAppendSimple(e.appendInfo,{x:d,y:f}):e.appendInfo=h.dragAppend(e.appendInfo,{x:d,y:f})},e.onDragEnd=function(){var o,r=e.props,i=r.model,a=r.graphModel.eventCenter,s=i;s.dragAppendEnd(),e.isDragging=!1,s.isShowAdjustPoint=(o=e.isShowAdjustPointTemp)!==null&&o!==void 0?o:!1,e.appendInfo=void 0,a.emit(N.EDGE_ADJUST,{data:s.getData()})},e.beforeDragStart=function(o,r){r.draggable&&e.drag.handleMouseDown(o),e.appendInfo=r},e.drag=new ae({onDragStart:e.onDragStart,onDragging:e.onDragging,onDragEnd:e.onDragEnd,isStopPropagation:!1}),e}return t.prototype.getEdge=function(){var e=this.props.model,o=e.points,r=e.isAnimation,i=e.arrowConfig,a=e.getEdgeStyle(),s=e.getEdgeAnimationStyle(),l=s.strokeDasharray,u=s.stroke,p=s.strokeDashoffset,c=s.animationName,d=s.animationDuration,f=s.animationIterationCount,h=s.animationTimingFunction,y=s.animationDirection;return O(rd,Te({points:o},a,i,r?{strokeDasharray:l,stroke:u,style:{strokeDashoffset:p,animationName:c,animationDuration:d,animationIterationCount:f,animationTimingFunction:h,animationDirection:y}}:{}))},t.prototype.getArrowInfo=function(){var e=this.props.model,o=e.points,r=e.isSelected,i=this.state.hover,a=ke(o),s=a[0],l=a[0];return a.length>=2&&(s=a[a.length-2],l=a[a.length-1]),{start:s,end:l,hover:i,isSelected:r}},t.prototype.getLastTwoPoints=function(){var e=this.props.model,o=e.points,r=ke(o),i=r[0],a=r[0];return r.length>=2&&(i=r[r.length-2],a=r[r.length-1]),[i,a]},t.prototype.getAppendAttributes=function(e){var o=e.start,r=e.end,i;if(o.x===r.x&&o.y===r.y)i="";else{var a={start:o,end:r,offset:10,verticalLength:5},s=Gn(Te(Te({},a),{type:"start"})),l=Gn(Te(Te({},a),{type:"end"}));i="M".concat(s.leftX," ").concat(s.leftY,`
|
||
L`).concat(s.rightX," ").concat(s.rightY,`
|
||
L`).concat(l.rightX," ").concat(l.rightY,`
|
||
L`).concat(l.leftX," ").concat(l.leftY," z")}return{d:i,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},t.prototype.getAppendShape=function(e){var o=this.getAppendAttributes(e),r=o.d,i=o.strokeWidth,a=o.fill,s=o.strokeDasharray,l=o.stroke;return O(Fn,{d:r,fill:a,strokeWidth:i,stroke:l,strokeDasharray:s})},t.prototype.getAppendWidth=function(){for(var e=this,o=this.props,r=o.model,i=o.graphModel,a=r.pointsList,s=r.draggable,l=[],u=a.length,p=function(f){var h="lf-polyline-append",y={start:{x:a[f].x,y:a[f].y},end:{x:a[f+1].x,y:a[f+1].y},startIndex:f,endIndex:f+1,direction:et.HORIZONTAL,draggable:!0},v=O("g",{className:h,children:c.getAppendShape(y)}),g=i.editConfigModel,m=g.adjustEdge,M=g.adjustEdgeMiddle;if(m&&s){var T=y.startIndex,w=y.endIndex,S=M&&(T===0||w===u-1);y.draggable=!S,y.start.x===y.end.x?(y.draggable&&(h+="-ew-resize"),y.direction=et.VERTICAL):y.start.y===y.end.y&&(y.draggable&&(h+="-ns-resize"),y.direction=et.HORIZONTAL),v=O("g",{className:c.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(_){return e.beforeDragStart(_,y)},children:O("g",{className:h,children:c.getAppendShape(y)})})}l.push(v)},c=this,d=0;d<u-1;d++)p(d);return O("g",{children:l})},t})(vr),Ke=function(){return Ke=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ke.apply(this,arguments)},Eh=(function(){function n(t){var e=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){e.nodeConfig=null,window.document.removeEventListener("mouseup",e.stopDrag)},this.dragEnter=function(r){!e.nodeConfig||e.fakeNode||(e.fakeNode=e.lf.createFakeNode(Ke(Ke({},e.nodeConfig),e.clientToLocalPoint({x:r.clientX,y:r.clientY}))))},this.onDragOver=function(r){if(e.lf.graphModel.eventCenter.emit(N.BLANK_CANVAS_MOUSEMOVE,{e:r}),r.preventDefault(),e.fakeNode){var i=e.clientToLocalPoint({x:r.clientX,y:r.clientY}),a=i.x,s=i.y;e.fakeNode.moveTo(a,s);var l=e.fakeNode.getData();e.lf.setNodeSnapLine(l),e.lf.graphModel.eventCenter.emit(N.NODE_DND_DRAG,{data:l,e:r})}return!1},this.onDragLeave=function(){e.fakeNode&&(e.lf.removeNodeSnapLine(),e.lf.graphModel.removeFakeNode(),e.fakeNode=null)},this.onDrop=function(r){!e.lf.graphModel||!r||!e.nodeConfig||(e.lf.addNode(Ke(Ke({},e.nodeConfig),e.clientToLocalPoint({x:r.clientX,y:r.clientY})),N.NODE_DND_ADD,r),r.preventDefault(),r.stopPropagation(),e.nodeConfig=null,e.lf.removeNodeSnapLine(),e.lf.graphModel.removeFakeNode(),e.fakeNode=null)};var o=t.lf;this.lf=o}return n.prototype.clientToLocalPoint=function(t){var e=t.x,o=t.y,r=lr(this.lf.options,["grid","size"]),i=this.lf.graphModel.getPointByClient({x:e,y:o}),a=i.canvasOverlayPosition,s=a.x,l=a.y,u=this.lf.graphModel.editConfigModel.snapGrid;return{x:sn(s,r,u),y:sn(l,r,u)}},n.prototype.startDrag=function(t){var e=this.lf.graphModel.editConfigModel;e!=null&&e.isSilentMode||(this.nodeConfig=t,window.document.addEventListener("mouseup",this.stopDrag))},n.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},n})();function Oh(n,t){n.on("node:mousemove",function(e){var o=e.data;t.setNodeSnapLine(o)}),n.on("node:mouseup",function(){t.clearSnapline()})}var wh=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),se=function(){return se=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},se.apply(this,arguments)},Sh=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Mh=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Th=(function(n){wh(t,n);function t(e){var o=n.call(this,e)||this;return o.ref=Si(),o.__prevText={type:"",text:"",id:""},o.keyupHandler=function(r){var i=o.props.graphModel.textEditElement;r.key==="Enter"&&r.altKey&&(i==null||i.setElementState(W.DEFAULT))},o.inputHandler=function(r){var i=r.target.innerText,a=o.props.graphModel.textEditElement;a&&(o.__prevText={type:a.type,text:i.replace(/(\r\n)+$|(\n)+$/,""),id:a.id})},o.keydownHandler=function(r){r.stopPropagation()},o.state={style:{left:0,top:0}},o}return t.getDerivedStateFromProps=function(e){var o,r=e.textEditElement,i=e.graphModel,a=i.transformModel,s=i.theme,l=s.inputText,u;if(r){if(!(!((o=r.text)===null||o===void 0)&&o.value)&&r.BaseType===rt.EDGE){var p=r.text,c=r.textPosition,d=c.x,f=c.y;p.x=d,p.y=f,r.setText(p)}var h={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(r.BaseType===rt.EDGE){var y=s.edgeText,v=y.overflowMode,g=y.lineHeight,m=y.wrapPadding,M=y.textWidth;M&&v==="autoWrap"&&(u=se(se({},h),{width:M,minWidth:M,lineHeight:g,padding:m}))}else if(r.BaseType===rt.NODE){var T=s.nodeText,v=T.overflowMode,g=T.lineHeight,m=T.wrapPadding,M=T.textWidth,w=r.width,S=r.modelType,_=r.textWidth,x=_||M||w;(S!==z.TEXT_NODE&&v==="autoWrap"||S===z.TEXT_NODE&&M)&&(u=se(se({},h),{width:x,minWidth:x,lineHeight:g,padding:m}))}var A=r.text,P=A.x,I=A.y,B=Mh(a.CanvasPointToHtmlPoint([P,I]),2),ot=B[0],$=B[1];return{style:se(se({left:ot,top:$},u),l)}}return null},t.prototype.componentDidUpdate=function(){var e=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),this.__prevText.id!==""){var o=this.__prevText,r=o.text,i=o.id;e.updateText(i,r),e.eventCenter.emit(N.TEXT_UPDATE,{data:se({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},t.prototype.placeCaretAtEnd=function(e){if(window.getSelection!==void 0&&document.createRange!==void 0){var o=document.createRange();o.selectNodeContents(e),o.collapse(!1);var r=window.getSelection();r==null||r.removeAllRanges(),r==null||r.addRange(o)}},t.prototype.render=function(){var e,o=this.props.graphModel.textEditElement,r=this.state.style;return o?O("div",{contentEditable:!0,className:"lf-text-input",style:r,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:(e=o.text)===null||e===void 0?void 0:e.value},o.id):null},t.toolName="text-edit-tool",t=Sh([Pt],t),t})(G),Ah=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Ph=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Ar=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Dh=function(n,t,e){if(e||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return n.concat(i||Array.prototype.slice.call(t))},Nh=(function(n){Ah(t,n);function t(e){var o=n.call(this,e)||this;o.handleMouseDown=function(s){o.stepDrag.handleMouseDown(s)},o.handleWheelEvent=function(s){var l,u;s.preventDefault();var p=s.deltaX,c=s.deltaY,d=s.clientX,f=s.clientY,h=s.ctrlKey,y=new WheelEvent("wheel",{deltaX:p,deltaY:c,clientX:d,clientY:f,ctrlKey:h});(u=(l=o.props.lf.container)===null||l===void 0?void 0:l.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||u===void 0||u.dispatchEvent(y)},o.onDragging=function(s){var l=s.deltaX,u=s.deltaY,p=o.props,c=p.graphModel,d=p.lf,f=d.getTransform(),h=f.SCALE_X,y=f.SCALE_Y,v=c.getSelectElements(!0);c.moveNodes(v.nodes.map(function(g){return g.id}),l/h,u/y)},o.handleContextMenu=function(s){s.preventDefault();var l=o.props,u=l.graphModel,p=l.graphModel,c=p.eventCenter,d=p.selectElements,f=u.getPointByClient({x:s.clientX,y:s.clientY}),h={nodes:[],edges:[]},y=Dh([],Ar(d.values()),!1);y.forEach(function(v){v.BaseType===rt.NODE&&h.nodes.push(v.getData()),v.BaseType===rt.EDGE&&h.edges.push(v.getData())}),c.emit(N.SELECTION_CONTEXTMENU,{data:h,e:s,position:f})};var r=e.graphModel,i=r.gridSize,a=r.eventCenter;return o.stepDrag=new ae({onDragging:o.onDragging,step:i,eventType:"SELECTION",eventCenter:a}),o}return t.prototype.render=function(){var e,o,r=this.props.graphModel,i=r.selectElements,a=r.transformModel,s=this.props.lf.getTransform(),l=s.SCALE_X,u=s.SCALE_Y;if(!(i.size<=1)){var p=Number.MAX_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,f=Number.MIN_SAFE_INTEGER;i.forEach(function(y){var v;y.BaseType===rt.NODE&&(v=dp(y)),y.BaseType===rt.EDGE&&(v=gp(y)),v!==void 0&&(p=Math.min(p,v.x),c=Math.min(c,v.y),d=Math.max(d,v.x1),f=Math.max(f,v.y1))}),e=Ar(a.CanvasPointToHtmlPoint([p,c]),2),p=e[0],c=e[1],o=Ar(a.CanvasPointToHtmlPoint([d,f]),2),d=o[0],f=o[1];var h={left:"".concat(p-20*l/2,"px"),top:"".concat(c-20*u/2,"px"),width:"".concat(d-p+20*l,"px"),height:"".concat(f-c+20*u,"px"),"border-width":"".concat(2*l,"px")};return O("div",{className:"lf-multiple-select",style:h,onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},t.toolName="multiple-select-tool",t=Ph([Pt],t),t})(G),Pr=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Ch=[Th,Nh],jh=(function(){function n(t){var e=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=t,it(Ch,function(i){e.isDisabled(i.toolName)||e.registerTool(i.toolName,i)});var o=t.graphModel,r=o.eventCenter;r.on("".concat(N.GRAPH_TRANSFORM,",").concat(N.NODE_CLICK,",").concat(N.BLANK_CLICK," "),function(){var i,a=o.textEditElement,s=o.editConfigModel,l=s.edgeTextEdit,u=s.nodeTextEdit;(l||u)&&a&&((i=o.textEditElement)===null||i===void 0||i.setElementState(W.DEFAULT))})}return n.prototype.isDisabled=function(t){var e;return((e=this.instance.options.disabledTools)===null||e===void 0?void 0:e.indexOf(t))!==-1},n.prototype.registerTool=function(t,e){this.toolMap.set(t,e)},n.prototype.disableTool=function(t){var e=this.toolMap.get(t);if(e)return this.disabledToolMap.set(t,e),this.toolMap.delete(t),!0;throw new Error("禁用失败,不存在名为 ".concat(e," 的工具"))},n.prototype.enableTool=function(t){var e=this.disabledToolMap.get(t);if(e)return this.toolMap.set(t,e),this.disabledToolMap.delete(t),!0;throw new Error("不存在名为 ".concat(e," 的工具"))},n.prototype.getTools=function(){return Array.from(this.toolMap.values())},n.prototype.getInstance=function(){return this.instance},n.prototype.destroy=function(){this.toolMap.clear(),this.disabledToolMap.clear()},Pr([E],n.prototype,"toolMap",void 0),Pr([b],n.prototype,"disableTool",null),Pr([b],n.prototype,"enableTool",null),n})();function Lh(n){throw new Error("[mobx-utils] "+n)}function rr(n,t){t===void 0&&(t="Illegal state"),n||Lh(t)}var Kl=function(n){return n&&n!==Object.prototype&&Object.getOwnPropertyNames(n).concat(Kl(Object.getPrototypeOf(n))||[])},kh=function(n){var t=Kl(n),e=t.filter(function(o,r){return t.indexOf(o)===r});return e},Ih=function(n){return kh(n).filter(function(t){return t!=="constructor"&&!~t.indexOf("__")})},Zl="pending",ir="fulfilled",Yi="rejected";function Rh(n){switch(this.state){case Zl:return n.pending&&n.pending(this.value);case Yi:return n.rejected&&n.rejected(this.value);case ir:return n.fulfilled?n.fulfilled(this.value):this.value}}function Os(n,t){if(rr(arguments.length<=2,"fromPromise expects up to two arguments"),rr(typeof n=="function"||typeof n=="object"&&n&&typeof n.then=="function","Please pass a promise or function to fromPromise"),n.isPromiseBasedObservable===!0)return n;typeof n=="function"&&(n=new Promise(n));var e=n;n.then(b("observableFromPromise-resolve",function(r){e.value=r,e.state=ir}),b("observableFromPromise-reject",function(r){e.value=r,e.state=Yi})),e.isPromiseBasedObservable=!0,e.case=Rh;var o=t&&t.state===ir?t.value:void 0;return Fr(e,{value:o,state:Zl},{},{deep:!1}),e}(function(n){n.reject=b("fromPromise.reject",function(e){var o=n(Promise.reject(e));return o.state=Yi,o.value=e,o});function t(e){e===void 0&&(e=void 0);var o=n(Promise.resolve(e));return o.state=ir,o.value=e,o}n.resolve=b("fromPromise.resolve",t)})(Os||(Os={}));var To=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i};(function(){function n(t,e){var o=this;sc(function(){o.current=e,o.subscription=t.subscribe(o)})}return n.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},n.prototype.next=function(t){this.current=t},n.prototype.complete=function(){this.dispose()},n.prototype.error=function(t){this.current=t,this.dispose()},To([E.ref],n.prototype,"current",void 0),To([b.bound],n.prototype,"next",null),To([b.bound],n.prototype,"complete",null),To([b.bound],n.prototype,"error",null),n})();var ar=function(){return ar=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ar.apply(this,arguments)},bn=function(n,t,e,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,e):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,t,e,o);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(i=(r<3?a(i):r>3?a(t,e,i):a(t,e))||i);return r>3&&i&&Object.defineProperty(t,e,i),i},Xh=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function n(t){var e=this;this.model=t,this.localValues=E.map({}),this.localComputedValues=E.map({}),this.isPropertyDirty=function(o){return e.localValues.has(o)},rr(Wt(t),"createViewModel expects an observable object"),Ih(t).forEach(function(o){if(!(o===k||o==="__mobxDidRunLazyInitializers")){if(rr(Xh.indexOf(o)===-1,"The propertyname "+o+" is reserved and cannot be used with viewModels"),Ji(t,o)){var r=hr(t,o).derivation;e.localComputedValues.set(o,Q(r.bind(e)))}var i=Object.getOwnPropertyDescriptor(t,o),a=i?{enumerable:i.enumerable}:{};Object.defineProperty(e,o,ar(ar({},a),{configurable:!0,get:function(){return Ji(t,o)?e.localComputedValues.get(o).get():e.isPropertyDirty(o)?e.localValues.get(o):e.model[o]},set:b(function(s){s!==e.model[o]?e.localValues.set(o,s):e.localValues.delete(o)})}))}})}return Object.defineProperty(n.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),n.prototype.submit=function(){var t=this;an(this.localValues).forEach(function(e){var o=t.localValues.get(e),r=t.model[e];ie(r)?r.replace(o):Mt(r)?(r.clear(),r.merge(o)):hc(o)||(t.model[e]=o)}),this.localValues.clear()},n.prototype.reset=function(){this.localValues.clear()},n.prototype.resetProperty=function(t){this.localValues.delete(t)},bn([Q],n.prototype,"isDirty",null),bn([Q],n.prototype,"changedValues",null),bn([b.bound],n.prototype,"submit",null),bn([b.bound],n.prototype,"reset",null),bn([b.bound],n.prototype,"resetProperty",null),n})();function Dr(n){if(!n)return"ROOT";for(var t=[];n.parent;)t.push(n.path),n=n.parent;return t.reverse().join("/")}function Nr(n){return Wt(n)||ie(n)||Mt(n)}function Bh(n,t){var e=new WeakMap;function o(s){var l=e.get(s.object);r(s,l),t(s,Dr(l),n)}function r(s,l){switch(s.type){case"add":i(s.newValue,l,s.name);break;case"update":a(s.oldValue),i(s.newValue,l,s.name||""+s.index);break;case"remove":case"delete":a(s.oldValue);break;case"splice":s.removed.map(a),s.added.forEach(function(c,d){return i(c,l,""+(s.index+d))});for(var u=s.index+s.addedCount;u<s.object.length;u++)if(Nr(s.object[u])){var p=e.get(s.object[u]);p&&(p.path=""+u)}break}}function i(s,l,u){if(Nr(s)){var p=e.get(s);if(p){if(p.parent!==l||p.path!==u)throw new Error("The same observable object cannot appear twice in the same tree,"+(" trying to assign it to '"+Dr(l)+"/"+u+"',")+(" but it already exists at '"+Dr(p.parent)+"/"+p.path+"'"))}else{var c={parent:l,path:u,dispose:ml(s,o)};e.set(s,c),vc(s).forEach(function(d){var f=d[0],h=d[1];return i(h,c,f)})}}}function a(s){if(Nr(s)){var l=e.get(s);if(!l)return;e.delete(s),l.dispose(),gc(s).forEach(a)}}return i(n,void 0,""),function(){a(n)}}var Hh=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)r.hasOwnProperty(i)&&(o[i]=r[i])},n(t,e)};return function(t,e){n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})();(function(n){Hh(t,n);function t(e,o,r){var i=r===void 0?{}:r,a=i.name,s=a===void 0?"ogm"+(Math.random()*1e3|0):a,l=i.keyToName,u=l===void 0?function(d){return""+d}:l,p=n.call(this)||this;p._keyToName=u,p._groupBy=o,p._ogmInfoKey=Symbol("ogmInfo"+s),p._base=e;for(var c=0;c<e.length;c++)p._addItem(e[c]);return p._disposeBaseObserver=ml(p._base,function(d){if(d.type==="splice")zt(function(){for(var f=0,h=d.removed;f<h.length;f++){var y=h[f];p._removeItem(y)}for(var v=0,g=d.added;v<g.length;v++){var m=g[v];p._addItem(m)}});else if(d.type==="update")zt(function(){p._removeItem(d.oldValue),p._addItem(d.newValue)});else throw new Error("illegal state")}),p}return t.prototype.clear=function(){throw new Error("not supported")},t.prototype.delete=function(e){throw new Error("not supported")},t.prototype.set=function(e,o){throw new Error("not supported")},t.prototype.dispose=function(){this._disposeBaseObserver();for(var e=0;e<this._base.length;e++){var o=this._base[e],r=o[this._ogmInfoKey];r.reaction(),delete o[this._ogmInfoKey]}},t.prototype._getGroupArr=function(e){var o=n.prototype.get.call(this,e);return o===void 0&&(o=E([],{name:"GroupArray["+this._keyToName(e)+"]",deep:!1}),n.prototype.set.call(this,e,o)),o},t.prototype._removeFromGroupArr=function(e,o){var r=n.prototype.get.call(this,e);r.length===1?n.prototype.delete.call(this,e):(o===r.length-1||(r[o]=r[r.length-1],r[o][this._ogmInfoKey].groupArrIndex=o),r.length--)},t.prototype._addItem=function(e){var o=this,r=this._groupBy(e),i=this._getGroupArr(r),a={groupByValue:r,groupArrIndex:i.length,reaction:pl(function(){return o._groupBy(e)},function(s,l){var u=e[o._ogmInfoKey];o._removeFromGroupArr(u.groupByValue,u.groupArrIndex);var p=o._getGroupArr(s),c=p.length;p.push(e),u.groupByValue=s,u.groupArrIndex=c})};Object.defineProperty(e,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:a}),i.push(e)},t.prototype._removeItem=function(e){var o=e[this._ogmInfoKey];this._removeFromGroupArr(o.groupByValue,o.groupArrIndex),o.reaction(),delete e[this._ogmInfoKey]},t})(Ri);Promise.resolve(),typeof queueMicrotask!="undefined"||typeof process!="undefined"&&process.nextTick;var xi=function(){return xi=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},xi.apply(this,arguments)},zh=(function(){function n(t){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=t}return n.prototype.add=function(t){Ui(uu(this.undos),t)||(this.undos.push(t),Ui(this.curData,t)||(this.redos=[]),this.eventCenter.emit(N.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},n.prototype.undoAble=function(){return this.undos.length>1},n.prototype.undo=function(){if(this.undoAble()){var t=this.undos.pop();this.redos.push(t);var e=this.undos.pop();return this.curData=X(e),e}},n.prototype.redoAble=function(){return this.redos.length>0},n.prototype.redo=function(){if(this.redoAble()){var t=this.redos.pop();return this.curData=X(t),t}},n.prototype.watch=function(t){var e=this;this.stopWatch&&this.stopWatch(),this.undos.push(t.modelToGraphData()),this.stopWatch=Bh(t,js(function(){var o=t.modelToHistoryData();o&&e.add(xi({},o))},this.waitTime))},n.prototype.destroy=function(){this.undos=[],this.redos=[],this.curData=null,this.stopWatch&&this.stopWatch()},n})(),ws={exports:{}},Ss;function Yh(){return Ss||(Ss=1,(function(n){(function(t,e,o){if(!t)return;for(var 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"},i={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",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,u=1;u<20;++u)r[111+u]="f"+u;for(u=0;u<=9;++u)r[u+96]=u.toString();function p(_,x,A){if(_.addEventListener){_.addEventListener(x,A,!1);return}_.attachEvent("on"+x,A)}function c(_){if(_.type=="keypress"){var x=String.fromCharCode(_.which);return _.shiftKey||(x=x.toLowerCase()),x}return r[_.which]?r[_.which]:i[_.which]?i[_.which]:String.fromCharCode(_.which).toLowerCase()}function d(_,x){return _.sort().join(",")===x.sort().join(",")}function f(_){var x=[];return _.shiftKey&&x.push("shift"),_.altKey&&x.push("alt"),_.ctrlKey&&x.push("ctrl"),_.metaKey&&x.push("meta"),x}function h(_){if(_.preventDefault){_.preventDefault();return}_.returnValue=!1}function y(_){if(_.stopPropagation){_.stopPropagation();return}_.cancelBubble=!0}function v(_){return _=="shift"||_=="ctrl"||_=="alt"||_=="meta"}function g(){if(!l){l={};for(var _ in r)_>95&&_<112||r.hasOwnProperty(_)&&(l[r[_]]=_)}return l}function m(_,x,A){return A||(A=g()[_]?"keydown":"keypress"),A=="keypress"&&x.length&&(A="keydown"),A}function M(_){return _==="+"?["+"]:(_=_.replace(/\+{2}/g,"+plus"),_.split("+"))}function T(_,x){var A,P,I,B=[];for(A=M(_),I=0;I<A.length;++I)P=A[I],s[P]&&(P=s[P]),x&&x!="keypress"&&a[P]&&(P=a[P],B.push("shift")),v(P)&&B.push(P);return x=m(P,B,x),{key:P,modifiers:B,action:x}}function w(_,x){return _===null||_===e?!1:_===x?!0:w(_.parentNode,x)}function S(_){var x=this;if(_=_||e,!(x instanceof S))return new S(_);x.target=_,x._callbacks={},x._directMap={};var A={},P,I=!1,B=!1,ot=!1;function $(R){R=R||{};var V=!1,J;for(J in A){if(R[J]){V=!0;continue}A[J]=0}V||(ot=!1)}function ct(R,V,J,Y,nt,Dt){var tt,dt,It=[],Ot=J.type;if(!x._callbacks[R])return[];for(Ot=="keyup"&&v(R)&&(V=[R]),tt=0;tt<x._callbacks[R].length;++tt)if(dt=x._callbacks[R][tt],!(!Y&&dt.seq&&A[dt.seq]!=dt.level)&&Ot==dt.action&&(Ot=="keypress"&&!J.metaKey&&!J.ctrlKey||d(V,dt.modifiers))){var Ie=!Y&&dt.combo==nt,Re=Y&&dt.seq==Y&&dt.level==Dt;(Ie||Re)&&x._callbacks[R].splice(tt,1),It.push(dt)}return It}function st(R,V,J,Y){x.stopCallback(V,V.target||V.srcElement,J,Y)||R(V,J)===!1&&(h(V),y(V))}x._handleKey=function(R,V,J){var Y=ct(R,V,J),nt,Dt={},tt=0,dt=!1;for(nt=0;nt<Y.length;++nt)Y[nt].seq&&(tt=Math.max(tt,Y[nt].level));for(nt=0;nt<Y.length;++nt){if(Y[nt].seq){if(Y[nt].level!=tt)continue;dt=!0,Dt[Y[nt].seq]=1,st(Y[nt].callback,J,Y[nt].combo,Y[nt].seq);continue}dt||st(Y[nt].callback,J,Y[nt].combo)}var It=J.type=="keypress"&&B;J.type==ot&&!v(R)&&!It&&$(Dt),B=dt&&J.type=="keydown"};function pt(R){typeof R.which!="number"&&(R.which=R.keyCode);var V=c(R);if(V){if(R.type=="keyup"&&I===V){I=!1;return}x.handleKey(V,f(R),R)}}function bt(){clearTimeout(P),P=setTimeout($,1e3)}function wt(R,V,J,Y){A[R]=0;function nt(Ot){return function(){ot=Ot,++A[R],bt()}}function Dt(Ot){st(J,Ot,R),Y!=="keyup"&&(I=c(Ot)),setTimeout($,10)}for(var tt=0;tt<V.length;++tt){var dt=tt+1===V.length,It=dt?Dt:nt(Y||T(V[tt+1]).action);kt(V[tt],It,Y,R,tt)}}function kt(R,V,J,Y,nt){x._directMap[R+":"+J]=V,R=R.replace(/\s+/g," ");var Dt=R.split(" "),tt;if(Dt.length>1){wt(R,Dt,V,J);return}tt=T(R,J),x._callbacks[tt.key]=x._callbacks[tt.key]||[],ct(tt.key,tt.modifiers,{type:tt.action},Y,R,nt),x._callbacks[tt.key][Y?"unshift":"push"]({callback:V,modifiers:tt.modifiers,action:tt.action,seq:Y,level:nt,combo:R})}x._bindMultiple=function(R,V,J){for(var Y=0;Y<R.length;++Y)kt(R[Y],V,J)},p(_,"keypress",pt),p(_,"keydown",pt),p(_,"keyup",pt)}S.prototype.bind=function(_,x,A){var P=this;return _=_ instanceof Array?_:[_],P._bindMultiple.call(P,_,x,A),P},S.prototype.unbind=function(_,x){var A=this;return A.bind.call(A,_,function(){},x)},S.prototype.trigger=function(_,x){var A=this;return A._directMap[_+":"+x]&&A._directMap[_+":"+x]({},_),A},S.prototype.reset=function(){var _=this;return _._callbacks={},_._directMap={},_},S.prototype.stopCallback=function(_,x){var A=this;if((" "+x.className+" ").indexOf(" mousetrap ")>-1||w(x,A.target))return!1;if("composedPath"in _&&typeof _.composedPath=="function"){var P=_.composedPath()[0];P!==_.target&&(x=P)}return x.tagName=="INPUT"||x.tagName=="SELECT"||x.tagName=="TEXTAREA"||x.isContentEditable},S.prototype.handleKey=function(){var _=this;return _._handleKey.apply(_,arguments)},S.addKeycodes=function(_){for(var x in _)_.hasOwnProperty(x)&&(r[x]=_[x]);l=null},S.init=function(){var _=S(e);for(var x in _)x.charAt(0)!=="_"&&(S[x]=(function(A){return function(){return _[A].apply(_,arguments)}})(x))},S.init(),t.Mousetrap=S,n.exports&&(n.exports=S)})(typeof window!="undefined"?window:null,typeof window!="undefined"?document:null)})(ws)),ws.exports}var Gh=Yh();const Uh=ks(Gh);var ve=function(){return ve=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ve.apply(this,arguments)},Vh=function(n,t){var e={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(n);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(e[o[r]]=n[o[r]]);return e},Kt=null;function Ms(n,t){var e,o;return n.x+=t,n.y+=t,Ir(n.text)||(n.text.x+=t,n.text.y+=t),Ir((e=n.properties)===null||e===void 0?void 0:e._label)||(o=n.properties)===null||o===void 0||o._label.forEach(function(r){r.x+=t,r.y+=t}),n}function Ts(n,t){return n.startPoint&&(n.startPoint.x+=t,n.startPoint.y+=t),n.endPoint&&(n.endPoint.x+=t,n.endPoint.y+=t),n.pointsList&&n.pointsList.length>0&&n.pointsList.forEach(function(e){e.x+=t,e.y+=t}),Ir(n.text)||(n.text.x+=t,n.text.y+=t),n}function gy(n,t){var e=n.x,o=n.y,r=n.text,i=r?{x:r.x+t,y:r.y+t,value:r.value}:void 0;return ve(ve({},n),{id:"",x:e+t,y:o+t,text:i})}function vy(n,t){var e=n.startPoint,o=n.endPoint,r=n.pointsList,i=n.text,a=Vh(n,["startPoint","endPoint","pointsList","text"]);a.id="";var s={x:e.x+t,y:e.y+t},l={x:o.x+t,y:o.y+t},u=re(r,function(c){return{x:c.x+t,y:c.y+t}}),p=i?ve(ve({},i),{x:i.x+t,y:i.y+t}):void 0;return ve(ve({},a),{startPoint:s,endPoint:l,pointsList:u,text:p})}var Ge=40,Ao=40;function Fh(n,t){var e=n.keyboard,o=e.options.keyboard;e.on(["cmd + c","ctrl + c"],function(){if(Ao=Ge,!(o!=null&&o.enabled)||t.textEditElement)return!0;var r=n.options.guards,i=t.getSelectElements(!1),a=r&&r.beforeClone?r.beforeClone(i):!0;return!a||i.nodes.length===0&&i.edges.length===0?(Kt=null,!0):(Kt=i,Kt.nodes.forEach(function(s){return Ms(s,Ge)}),Kt.edges.forEach(function(s){return Ts(s,Ge)}),!1)}),e.on(["cmd + v","ctrl + v"],function(){if(!(o!=null&&o.enabled)||t.textEditElement)return!0;if(Kt&&(Kt.nodes||Kt.edges)){n.clearSelectElements();var r=n.addElements(Kt,Ao);if(!r)return!0;r.nodes.forEach(function(i){return n.selectElementById(i.id,!0)}),r.edges.forEach(function(i){return n.selectElementById(i.id,!0)}),Kt.nodes.forEach(function(i){return Ms(i,Ge)}),Kt.edges.forEach(function(i){return Ts(i,Ge)}),Ao=Ao+Ge}return!1}),e.on(["cmd + z","ctrl + z"],function(){return!(o!=null&&o.enabled)||t.textEditElement?!0:(n.undo(),!1)}),e.on(["cmd + y","ctrl + y"],function(){return!(o!=null&&o.enabled)||t.textEditElement?!0:(n.redo(),!1)}),e.on(["backspace"],function(){if(!(o!=null&&o.enabled)||t.textEditElement)return!0;var r=t.getSelectElements(!0);return n.clearSelectElements(),r.edges.forEach(function(i){return i.id&&n.deleteEdge(i.id)}),r.nodes.forEach(function(i){return i.id&&n.deleteNode(i.id)}),!1})}var Wh=(function(){function n(t){t.keyboard||(t.keyboard={enabled:!1}),this.options=t;var e=t.lf;this.target=e.container,this.mousetrap=new Uh(this.target),t.keyboard.enabled&&!e.options.isSilentMode&&this.enable(!0)}return n.prototype.initShortcuts=function(){var t=this,e,o=((e=this.options.keyboard)!==null&&e!==void 0?e:{}).shortcuts;if(o)if(cu(o))o.forEach(function(s){var l=s.keys,u=s.callback,p=s.action;return t.on(l,u,p)});else{var r=o.keys,i=o.callback,a=o.action;this.on(r,i,a)}},n.prototype.on=function(t,e,o){this.mousetrap.bind(this.getKeys(t),e,o)},Object.defineProperty(n.prototype,"disabled",{get:function(){var t,e;return((e=(t=this.options)===null||t===void 0?void 0:t.keyboard)===null||e===void 0?void 0:e.enabled)!==!0},enumerable:!1,configurable:!0}),n.prototype.off=function(t,e){this.mousetrap.unbind(this.getKeys(t),e)},n.prototype.enable=function(t){(this.disabled||t)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},n.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},n.prototype.destroy=function(){this.mousetrap.reset()},n.prototype.getKeys=function(t){var e=this;return(Array.isArray(t)?t:[t]).map(function(o){return e.formatKey(o)})},n.prototype.formatKey=function(t){return t.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},n})(),he=function(){return he=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},he.apply(this,arguments)},Po=function(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var o=e.call(n),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(e=o.return)&&e.call(o)}finally{if(a)throw a.error}}return i},Cr=function(n,t,e){if(e||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return n.concat(i||Array.prototype.slice.call(t))},jr=Symbol("plugin registered by Logicflow.use"),As=(function(){function n(t){var e=this,o;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(u,p){return e.viewMap.set(u,p)},this.getView=function(u){return e.viewMap.get(u)};var r=zn.get(t),i=r.container,a=r.width,s=r.height;this.options=r,this.container=this.initContainer(i,a,s),this.graphModel=new kf(he(he({},r),{container:this.container})),this.plugins=(o=r.plugins)!==null&&o!==void 0?o:[];var l=this.graphModel.eventCenter;this.tool=new jh(this),this.dnd=new Eh({lf:this}),this.history=new zh(l),this.keyboard=new Wh({lf:this,keyboard:r.keyboard}),r.snapline!==!1&&(this.snaplineModel=new If(this.graphModel,r.snaplineEpsilon),Oh(l,this.snaplineModel)),r.isSilentMode||(Fh(this,this.graphModel),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(r.disabledPlugins)}return n.prototype.initContainer=function(t,e,o){var r=document.createElement("div");return r.style.position="relative",r.style.width=e?"".concat(e,"px"):"100%",r.style.height=o?"".concat(o,"px"):"100%",t.innerHTML="",t.appendChild(r),r},Object.defineProperty(n.prototype,Symbol.toStringTag,{get:function(){return n.toStringTag},enumerable:!1,configurable:!0}),n.prototype.register=function(t,e,o){if(o===void 0&&(o=!0),typeof t!="string"){this.registerElement(t);return}var r={BaseEdge:vr,BaseEdgeModel:gr,BaseNode:Oe,BaseNodeModel:Ee,RectNode:fs,RectNodeModel:ss,CircleNode:hs,CircleNodeModel:os,PolygonNode:ys,PolygonNodeModel:as,TextNode:ms,TextNodeModel:us,LineEdge:xs,LineEdgeModel:Qa,DiamondNode:gs,DiamondNodeModel:rs,PolylineEdge:Es,PolylineEdgeModel:es,BezierEdge:bs,BezierEdgeModel:$a,EllipseNode:vs,EllipseNodeModel:is,HtmlNode:vi,HtmlNodeModel:li,h:$e,type:t};if(this.viewMap.forEach(function(u){var p=u.extendKey;p&&(r[p]=u)}),this.graphModel.modelMap.forEach(function(u){var p=u.extendKey;p&&(r[p]=u)}),e){var i=e(r),a=i.view,s=i.model,l=a;o&&!l.isObserved&&(l.isObserved=!0,l=Pt(l)),this.setView(t,l),this.graphModel.setModel(t,s)}},n.prototype.registerElement=function(t){var e=t.view;t.isObserverView!==!1&&!e.isObserved&&(e.isObserved=!0,e=Pt(e)),this.setView(t.type,e),this.graphModel.setModel(t.type,t.model)},n.prototype.batchRegister=function(t){var e=this;t===void 0&&(t=[]),it(t,function(o){e.registerElement(o)})},n.prototype.defaultRegister=function(){var t=[{type:"rect",view:fs,model:ss},{type:"circle",view:hs,model:os},{type:"polygon",view:ys,model:as},{type:"text",view:ms,model:us},{type:"ellipse",view:vs,model:is},{type:"diamond",view:gs,model:rs},{type:"html",view:vi,model:li},{type:"line",view:xs,model:Qa},{type:"polyline",view:Es,model:es},{type:"bezier",view:bs,model:$a}];this.batchRegister(t)},n.prototype.addNode=function(t,e,o){return e===void 0&&(e=N.NODE_ADD),this.graphModel.addNode(t,e,o)},n.prototype.deleteNode=function(t){var e=this.graphModel.getNodeModelById(t);if(!e)return!1;var o=e.getData(),r=this.options.guards,i=r!=null&&r.beforeDelete?r.beforeDelete(o):!0;return i&&this.graphModel.deleteNode(t),i},n.prototype.cloneNode=function(t){var e=this.graphModel.getNodeModelById(t),o=e==null?void 0:e.getData();if(o){var r=this.options.guards,i=r!=null&&r.beforeClone?r.beforeClone(o):!0;if(i)return this.graphModel.cloneNode(t)}},n.prototype.changeNodeId=function(t,e){return this.graphModel.changeNodeId(t,e)},n.prototype.changeNodeType=function(t,e){this.graphModel.changeNodeType(t,e)},n.prototype.getNodeModelById=function(t){return this.graphModel.getNodeModelById(t)},n.prototype.getNodeDataById=function(t){var e=this.getNodeModelById(t);return e==null?void 0:e.getData()},n.prototype.getNodeIncomingEdge=function(t){return this.graphModel.getNodeIncomingEdge(t)},n.prototype.getNodeOutgoingEdge=function(t){return this.graphModel.getNodeOutgoingEdge(t)},n.prototype.getNodeIncomingNode=function(t){return this.graphModel.getNodeIncomingNode(t)},n.prototype.getNodeOutgoingNode=function(t){return this.graphModel.getNodeOutgoingNode(t)},n.prototype.createFakeNode=function(t){var e=this.graphModel.modelMap.get(t.type);if(!e)return null;var o=new e(he(he({},t),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(o),o},n.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},n.prototype.setNodeSnapLine=function(t){var e;(e=this.snaplineModel)===null||e===void 0||e.setNodeSnapLine(t)},n.prototype.removeNodeSnapLine=function(){var t;(t=this.snaplineModel)===null||t===void 0||t.clearSnapline()},n.prototype.setDefaultEdgeType=function(t){this.graphModel.setDefaultEdgeType(t)},n.prototype.addEdge=function(t){return this.graphModel.addEdge(t)},n.prototype.getEdgeDataById=function(t){var e=this.getEdgeModelById(t);return e==null?void 0:e.getData()},n.prototype.getEdgeModelById=function(t){return this.graphModel.getEdgeModelById(t)},n.prototype.getEdgeModels=function(t){var e=t.sourceNodeId,o=t.targetNodeId,r=[],i=this.graphModel.edges;return e&&o?it(i,function(a){a.sourceNodeId===e&&a.targetNodeId===o&&r.push(a)}):e?it(i,function(a){a.sourceNodeId===e&&r.push(a)}):o&&it(i,function(a){a.targetNodeId===o&&r.push(a)}),r},n.prototype.changeEdgeId=function(t,e){return this.graphModel.changeEdgeId(t,e)},n.prototype.changeEdgeType=function(t,e){this.graphModel.changeEdgeType(t,e)},n.prototype.deleteEdge=function(t){var e=this.graphModel.getEdgeModelById(t);if(!e)return!1;var o=e.getData(),r=this.options.guards,i=r!=null&&r.beforeDelete?r.beforeDelete(o):!0;return i&&this.graphModel.deleteEdgeById(t),i},n.prototype.deleteEdgeByNodeId=function(t){var e=t.sourceNodeId,o=t.targetNodeId;e&&o?this.graphModel.deleteEdgeBySourceAndTarget(e,o):e?this.graphModel.deleteEdgeBySource(e):o&&this.graphModel.deleteEdgeByTarget(o)},n.prototype.getNodeEdges=function(t){return this.graphModel.getNodeEdges(t)},n.prototype.addElements=function(t,e){var o=this,r=t.nodes,i=t.edges;e===void 0&&(e=40);var a={},s={nodes:[],edges:[]};return it(r,function(l){var u=l.id,p=o.addNode(l);u&&(a[u]=p.id),s.nodes.push(p)}),it(i,function(l){var u=l.sourceNodeId,p=l.targetNodeId;a[u]&&(u=a[u]),a[p]&&(p=a[p]);var c=o.graphModel.addEdge(he(he({},l),{sourceNodeId:u,targetNodeId:p}));s.edges.push(c)}),s},n.prototype.selectElementById=function(t,e,o){e===void 0&&(e=!1),o===void 0&&(o=!0),this.graphModel.selectElementById(t,e),!e&&o&&this.graphModel.toFront(t)},n.prototype.deselectElementById=function(t){this.graphModel.deselectElementById(t)},n.prototype.getSelectElements=function(t){return t===void 0&&(t=!0),this.graphModel.getSelectElements(t)},n.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},n.prototype.getModelById=function(t){return this.graphModel.getElement(t)},n.prototype.getDataById=function(t){var e;return(e=this.graphModel.getElement(t))===null||e===void 0?void 0:e.getData()},n.prototype.deleteElement=function(t){var e,o,r,i=this.getModelById(t);if(!i)return!1;var a=(e={},e[rt.NODE]=this.deleteNode,e[rt.EDGE]=this.deleteEdge,e);return(r=(o=a[i.BaseType])===null||o===void 0?void 0:o.call(this,t))!==null&&r!==void 0?r:!1},n.prototype.setElementZIndex=function(t,e){return this.graphModel.setElementZIndex(t,e)},n.prototype.getAreaElement=function(t,e,o,r,i){return o===void 0&&(o=!0),r===void 0&&(r=!0),i===void 0&&(i=!1),this.graphModel.getAreaElement(t,e,o,r,i).map(function(a){return a.getData()})},n.prototype.setProperties=function(t,e){var o;(o=this.graphModel.getElement(t))===null||o===void 0||o.setProperties(Et(e))},n.prototype.getProperties=function(t){var e;return(e=this.graphModel.getElement(t))===null||e===void 0?void 0:e.getProperties()},n.prototype.deleteProperty=function(t,e){var o;(o=this.graphModel.getElement(t))===null||o===void 0||o.deleteProperty(e)},n.prototype.updateAttributes=function(t,e){this.graphModel.updateAttributes(t,e)},n.prototype.editText=function(t){this.graphModel.editText(t)},n.prototype.updateText=function(t,e){this.graphModel.updateText(t,e)},n.prototype.updateEditConfig=function(t){var e=this.graphModel,o=e.editConfigModel,r=e.transformModel,i=o.snapGrid;if(o.updateEditConfig(t),(t==null?void 0:t.stopMoveGraph)!==void 0&&r.updateTranslateLimits(t.stopMoveGraph),t!=null&&t.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0),!vt(t==null?void 0:t.snapGrid)&&t.snapGrid!==i){var a=this.graphModel.grid.size,s=a===void 0?1:a;this.graphModel.updateGridSize(t.snapGrid?s:1)}this.emit(N.EDIT_CONFIG_CHANGED,{data:o.getConfig()})},n.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},n.prototype.setTheme=function(t,e){this.graphModel.setTheme(t,e)},n.prototype.getTheme=function(){return this.graphModel.getTheme()},n.prototype.focusByElement=function(t){var e=void 0,o=this.getNodeModelById(t);if(o){var r=o.getData(),i=r.x,a=r.y;e={x:i,y:a}}var s=this.getEdgeModelById(t);if(s){var l=s.textPosition,i=l.x,a=l.y;e={x:i,y:a}}e&&this.focusByCoordinate(e)},n.prototype.focusByCoordinate=function(t){var e=this.graphModel,o=e.transformModel,r=e.width,i=e.height,a=t.x,s=t.y;o.focusOn(a,s,r,i)},n.prototype.focusOn=function(t){if(typeof t=="string")this.focusByElement(t);else if("x"in t&&"y"in t)this.focusByCoordinate(t);else{var e=t.id,o=t.coordinate;e&&this.focusByElement(e),o&&this.focusByCoordinate(o)}},n.prototype.resize=function(t,e){this.graphModel.resize(t,e),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},n.prototype.toFront=function(t){this.graphModel.toFront(t)},n.prototype.getPointByClient=function(t,e){if(typeof t=="object")return this.graphModel.getPointByClient(t);if(typeof e=="number")return this.graphModel.getPointByClient({x:t,y:e})},n.prototype.getGraphData=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var o=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,Cr([o],Po(t),!1)):o},n.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},n.prototype.clearData=function(){this.graphModel.clearData(),this.render({})},n.prototype.setOverlapMode=function(t){this.graphModel.setOverlapMode(t)},n.prototype.renderRawData=function(t){this.graphModel.graphDataToModel(Et(t)),this.options.history!==!1&&this.history.watch(this.graphModel),Sa(O(zf,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(N.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},n.prototype.render=function(t){var e=X(t);this.adapterIn&&(e=this.adapterIn(e)),this.renderRawData(e)},n.prototype.undo=function(){if(this.history.undoAble()){var t=Et(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},n.prototype.redo=function(){if(this.history.redoAble()){var t=Et(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},n.prototype.zoom=function(t,e){var o=this.graphModel.transformModel;return o.zoom(t,e)},n.prototype.resetZoom=function(){var t=this.graphModel.transformModel;t.resetZoom()},n.prototype.setZoomMiniSize=function(t){var e=this.graphModel.transformModel;e.setZoomMiniSize(t)},n.prototype.setZoomMaxSize=function(t){var e=this.graphModel.transformModel;e.setZoomMaxSize(t)},n.prototype.getTransform=function(){var t=this.graphModel.transformModel,e=t.SCALE_X,o=t.SCALE_Y,r=t.TRANSLATE_X,i=t.TRANSLATE_Y;return{SCALE_X:e,SCALE_Y:o,TRANSLATE_X:r,TRANSLATE_Y:i}},n.prototype.translate=function(t,e){var o=this.graphModel.transformModel;o.translate(t,e)},n.prototype.resetTranslate=function(){var t=this.graphModel.transformModel,e=t.TRANSLATE_X,o=t.TRANSLATE_Y;this.translate(-e,-o)},n.prototype.translateCenter=function(){this.graphModel.translateCenter()},n.prototype.fitView=function(t,e){e===void 0&&(e=t),this.graphModel.fitView(t,e)},n.prototype.openEdgeAnimation=function(t){this.graphModel.openEdgeAnimation(t)},n.prototype.closeEdgeAnimation=function(t){this.graphModel.closeEdgeAnimation(t)},n.prototype.on=function(t,e){this.graphModel.eventCenter.on(t,e)},n.prototype.off=function(t,e){this.graphModel.eventCenter.off(t,e)},n.prototype.once=function(t,e){this.graphModel.eventCenter.once(t,e)},n.prototype.emit=function(t,e){this.graphModel.eventCenter.emit(t,e)},n.use=function(t,e){var o,r=t.pluginName;if(!r)throw new Error("请给插件指定 pluginName!");this.extensions.set(r,(o={},o[jr]=jr,o.extension=t,o.props=e,o))},n.addThemeMode=function(t,e){jd(t,e)},n.removeThemeMode=function(t){Ld(t)},n.clearThemeMode=function(){kd()},n.prototype.installPlugins=function(t){var e=this;t===void 0&&(t=[]);var o=Array.from(n.extensions,function(i){var a=Po(i,2),s=a[1];return s}),r=Cr(Cr([],Po(this.plugins),!1),Po(o),!1);it(r,function(i){var a,s;jr in i?(a=i.extension,s=i.props):a=i;var l=a==null?void 0:a.pluginName;pu(t,l)===-1&&e.installPlugin(a,s)})},n.prototype.installPlugin=function(t,e){var o,r;if("pluginName"in t&&"install"in t){var i=t.pluginName,a=t.install,s=t.render;i&&(a&&a.call(t,this,n),s&&this.components.push(s.bind(t)),this.extension[i]=t);return}var l=t,u=l.pluginName,p=new l({lf:this,LogicFlow:n,props:e,options:(r=(o=this.options.pluginsOptions)===null||o===void 0?void 0:o[u])!==null&&r!==void 0?r:{}});p.render&&this.components.push(p.render.bind(p)),this.extension[u]=p},n.prototype.destroy=function(){var t;this.clearData(),Sa(null,this.container),this.keyboard.destroy(),this.graphModel.destroy(),this.tool.destroy(),this.history.destroy();for(var e in this.extension){var o=this.extension[e];"destroy"in o&&((t=o.destroy)===null||t===void 0||t.call(o))}},n.extensions=new Map,n})();(function(n){n.toStringTag="LF.".concat(n.name)})(As||(As={}));function Pt(n){return Bi(n)}var Kh=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),Ae=function(){return Ae=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++){t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ae.apply(this,arguments)},ql=(function(n){Kh(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.setAttributes=function(){var e=this.properties,o=e.width,r=e.height,i=e.radius;vt(o)||(this.width=o),vt(r)||(this.height=r),vt(i)||(this.radius=i)},t.prototype.getTextStyle=function(){var e=this.properties,o=e.refX,r=o===void 0?0:o,i=e.refY,a=i===void 0?0:i,s=e.textStyle,l=n.prototype.getTextStyle.call(this);return Ae(Ae(Ae({},l),X(s)||{}),{transform:"matrix(1 0 0 1 ".concat(r," ").concat(a,")")})},t.prototype.getNodeStyle=function(){var e=n.prototype.getNodeStyle.call(this),o=this.properties.style;return Ae(Ae({},e),X(o)||{})},t})(li),$l={};function my(n,t){var e=n.type,o=n.component,r=n.effect,i=n.view,a=n.model;if(!e)throw new Error("You should specify type in config");$l[e]={component:o,effect:r},t.register({type:e,view:i||ey,model:a||ql})}var vn=!1,cn=new Map,pn=new Map,sr=tu({});function Zh(n,t,e,o,r){vn&&(r.isMiniMap&&Jh(e,r.flowId),sr[n]=eu(Ns({render:function(){return Xn(nu,{to:e},[Xn(t,{node:o,graph:r})])},provide:function(){return{getNode:function(){return o},getGraph:function(){return r}}}})))}function qh(n,t){if(vn&&(delete sr[n],cn.has(t))){var e=pn.get(t)||[],o=e.indexOf(n);o>-1&&(e.splice(o,1),e.length===0?Qh(t):pn.set(t,e))}}function Lr(){return vn}function $h(){return vn=!0,Ns({props:{flowId:{type:String,required:!0}},setup:function(n){return function(){var t=[];return Object.keys(sr).forEach(function(e){if(e.startsWith(n.flowId)){if(cn.has(n.flowId)){var o=pn.get(n.flowId)||[];o.includes(e)||(o.push(e),pn.set(n.flowId,o))}t.push(sr[e])}}),Xn(ou,{},t.map(function(e){return Xn(e)}))}}})}function Jh(n,t){if(!(!t||!n||!vn)){var e=$h();if(!cn.has(t)){var o=document.createElement("div");n.appendChild(o);var r=Cs(e,{flowId:t});r.mount(o),cn.set(t,r),pn.set(t,[])}}}function Qh(n){if(!(!n||!vn)){var t=cn.get(n);t&&(t.unmount(),cn.delete(n),pn.delete(n))}}var ty=(function(){var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,r){o.__proto__=r}||function(o,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=r[i])},n(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");n(t,e);function o(){this.constructor=t}t.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}})(),ey=(function(n){ty(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.getComponentContainer=function(){return this.root},t.prototype.targetId=function(){return"".concat(this.props.graphModel.flowId,":").concat(this.props.model.id)},t.prototype.componentWillUnmount=function(){n.prototype.componentWillUnmount.call(this),this.unmount()},t.prototype.setHtml=function(e){var o=document.createElement("div");o.className="custom-vue-node-content",this.root=o,e.appendChild(o),this.renderVueComponent()},t.prototype.confirmUpdate=function(e){},t.prototype.renderVueComponent=function(){var e;this.unmountVueComponent();var o=this.getComponentContainer(),r=this.props,i=r.model,a=r.graphModel;if(o){var s=$l[i.type].component;s&&(Lr()?Zh(this.targetId(),s,o,i,a):(this.vm=Cs({render:function(){return Xn(s,{node:i,graph:a})},provide:function(){return{getNode:function(){return i},getGraph:function(){return a}}}}),(e=this.vm)===null||e===void 0||e.mount(o)))}},t.prototype.unmountVueComponent=function(){var e=this.getComponentContainer();return this.vm&&(this.vm.unmount(),this.vm=null),e&&!Lr()&&(e.innerHTML=""),e},t.prototype.unmount=function(){Lr()&&qh(this.targetId(),this.props.graphModel.flowId),this.unmountVueComponent()},t})(vi);const _y="j-airag-vue-node",by=20,ny=332,Ps=62,xy={LINK_BODY:"link_body"},Ey="_"+No.LOOP_BODY,Do={LINK_LOOP:"link_loop",LOOP_START:"loop_start",LOOP_END:"loop_end"},Oy=[{field:"currentLoopTimes",name:"当前循环次数",type:"number"},{field:"currentLoopItem",name:"当前循环项",type:"any"}];function Ei(n,t,e){for(var o=[],r=Math.max(n.length,t.length),i=0,a=0;a<r||i;){var s=a<n.length?n[a]:0,l=a<t.length?t[a]:0,u=i+s+l;o.push(u%e),i=Math.floor(u/e),a++}return o}function Ds(n,t,e){if(n<0)return null;if(n==0)return[];for(var o=[],r=t;n&1&&(o=Ei(o,r,e)),n=n>>1,n!==0;)r=Ei(r,r,e);return o}function oy(n,t){for(var e=n.split(""),o=[],r=e.length-1;r>=0;r--){var i=parseInt(e[r],t);if(isNaN(i))return null;o.push(i)}return o}function ry(n,t,e){var o=oy(n,t);if(o===null)return null;for(var r=[],i=[1],a=0;a<o.length;a++)o[a]&&(r=Ei(r,Ds(o[a],i,e),e)),i=Ds(t,i,e);for(var s="",a=r.length-1;a>=0;a--)s+=r[a].toString(e);return s}function iy(n){return n.substring(0,2)==="0x"&&(n=n.substring(2)),n=n.toLowerCase(),ry(n,16,10)}class ay{constructor(t){t=t||{},this.seq=0,this.mid=(t.mid||1)%1023,this.offset=t.offset||0,this.lastTime=0}generate(){const t=Date.now(),e=(t-this.offset).toString(2);this.lastTime==t?(this.seq++,this.seq>4095&&(this.seq=0)):this.seq=0,this.lastTime=t;let o=this.seq.toString(2),r=this.mid.toString(2);for(;o.length<12;)o="0"+o;for(;r.length<10;)r="0"+r;const i=e+r+o;let a="";for(let s=i.length;s>0;s-=4)a=parseInt(i.substring(s-4,s),2).toString(16)+a;return iy(a)}}const sy=new ay({mid:du(0,1023),offset:54*31536e3*1e3});function ly(){return sy.generate()}const xn=hu();class wy extends ql{constructor(t,e){t.id||(t.id=ly()),delete t.text,super(t,e),this.type=t.type,this.nodeConfig=fu.get(t.type),this.initNodeData(t)}updateId(t){if(!t||this.id===t)return;const e=this.id;xn.removeProps(e),this.id=t,xn.setProps(this)}initNodeData(t){var e,o,r,i,a;if(!this.nodeConfig)return;t.properties=(e=t.properties)!=null?e:{};const{params:s,methods:l}=this.nodeConfig;this.width=(r=(o=t.properties.width)!=null?o:s==null?void 0:s.width)!=null?r:ny,this.height=(a=(i=t.properties.height)!=null?i:s==null?void 0:s.height)!=null?a:Ps,t.properties.width=this.width,t.properties.height=this.height,typeof(l==null?void 0:l.initNodeData)=="function"&&l.initNodeData.call(this,t),super.initNodeData(t),xn.setProps(this);const u=(p,c)=>(p==null?void 0:p.id)===(c==null?void 0:c.id);this.sourceRules.push({validate:(p,c,d,f)=>{if(p==null||c==null||u(p,c)||d==null||f==null)return!1;const h=p.type,y=c.type,v=h===No.LOOP_BODY?p.id:xn.nodeGroupMap.get(p.id),g=v===c.id?c.id:xn.nodeGroupMap.get(c.id);if((v||g)&&v!==g)return!1;if(y===No.LOOP_BODY){if(d.type==="right"&&f.type===Do.LOOP_END)return!0}else if(h===No.LOOP_BODY&&d.type===Do.LOOP_START&&f.type==="left")return!0;return d.type==="right"&&f.type==="left"},message:"右侧锚点只能连接左侧锚点!"}),this.targetRules.push({message:"左侧锚点只能连接右侧锚点!",validate:(p,c,d,f)=>{if(u(p,c)||d==null||f==null)return!1;if(f.type===Do.LOOP_END||d.type===Do.LOOP_START)return!0;let h=!1;if(f.type==="left"&&d.type==="right"){const y=this.graphModel.getNodeIncomingEdge(c.id);y&&y.length>0?h=!y.some(v=>v.sourceAnchorId===d.id):h=!0}return h?!this.graphModel.$J.getAllPrevNodes(p).some(y=>y.id===c.id):!1}})}getTextStyle(){const t=super.getTextStyle();return t.color="transparent",t}getNodeStyle(){const t=super.getNodeStyle();return t.overflow="visible",t}getOutlineStyle(){const t=super.getOutlineStyle();return t.stroke="none",t.hover&&(t.hover.stroke="none"),t}getDefaultAnchor(){var t;if(!this.nodeConfig)return;const e=this.width/2,o=this.height/2,r=this.y-o+Ps/2,i=[{x:this.x-e,y:r,id:`${this.id}_input`,type:"left"},{x:this.x+e,y:r,id:`${this.id}_output`,type:"right"}],a=()=>({x:this.x,y:this.y-o,id:`${this.id}_top`,type:"top"}),s=()=>({x:this.x,y:this.y+o,id:`${this.id}_bottom`,type:"bottom"});return typeof((t=this.nodeConfig.methods)==null?void 0:t.getDefaultAnchor)=="function"?this.nodeConfig.methods.getDefaultAnchor.call(this,i,{getTopAnchor:a,getBottomAnchor:s}):i}getAnchorLineStyle(t){const e=super.getAnchorLineStyle();return e.stroke="#999999",e}}export{my as A,As as B,Oy as C,gy as D,vy as E,Si as F,z as G,Zf as H,Pt as I,Ce as J,qt as K,Do as L,gs as M,vd as N,fs as O,bs as P,ey as Q,_y as R,ys as S,Ey as T,by as U,G as V,W,xs as X,Qa as Y,ly as _,wy as a,xy as b,ny as c,$l as d,es as e,Es as f,as as g,os as h,$e as i,ss as j,Ps as k,ae as l,O as m,te as n,vs as o,li as p,Yl as q,vi as r,$h as s,rt as t,$a as u,rs as v,hs as w,E as x,is as y,N as z};
|